efficient-office 0.11.0 → 0.13.0
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.
- package/dist/Documents-2ZU5D3ZI.js +1 -0
- package/dist/Slides-JLWEMUXJ.js +1 -0
- package/dist/SlidesEditor-DGK4W6W4.js +1 -0
- package/dist/Spreadsheet-WQOZPWY5.js +1 -0
- package/dist/chunk-5K2D7PBJ.js +1 -0
- package/dist/chunk-AJTH75FI.js +1 -0
- package/dist/chunk-BDVKNU3U.js +1 -0
- package/dist/chunk-CEVQKZ66.js +1 -0
- package/dist/chunk-D3JKD7KW.js +1 -0
- package/dist/chunk-EC6D54MM.js +1 -0
- package/dist/chunk-EDJRXJNE.js +1 -0
- package/dist/chunk-EP3ZNVDB.js +1 -0
- package/dist/{chunk-HU4RI2OM.js → chunk-HNNYUGDU.js} +1 -1
- package/dist/{chunk-DG4VDXLL.js → chunk-HQM2HX4V.js} +1 -1
- package/dist/{chunk-JCSB2PHB.js → chunk-O35VT6BD.js} +1 -1
- package/dist/chunk-POH6OTTR.js +1 -0
- package/dist/chunk-PX4QOBHF.js +1 -0
- package/dist/{chunk-MDG2ADZ7.js → chunk-R2CXMNZL.js} +1 -1
- package/dist/chunk-T2TZ7HF5.js +1 -0
- package/dist/chunk-VYLIT7NN.js +1 -0
- package/dist/{chunk-MR7ZWQHF.js → chunk-WAB44FLE.js} +1 -1
- package/dist/{chunk-NRGUS5QY.js → chunk-XENQLN5I.js} +1 -1
- package/dist/chunk-YKQ5UKYZ.js +1 -0
- package/dist/deckPdf-KZFS4CTF.js +1 -0
- package/dist/documents/documents.css +39 -0
- package/dist/documents/index.d.ts +63 -2
- package/dist/documents/index.js +1 -1
- package/dist/docxPdf-S4RXU4L2.js +1 -0
- package/dist/importDocument-34WALCTG.js +1 -0
- package/dist/importSpreadsheet-L5FJGRUV.js +1 -0
- package/dist/{pptxImport-Y7TB6PYP.js → pptxImport-UQQXZUQL.js} +1 -1
- package/dist/slides/index.d.ts +213 -17
- package/dist/slides/index.js +1 -1
- package/dist/slides/slides.css +53 -0
- package/dist/spreadsheet/index.d.ts +2 -1
- package/dist/spreadsheet/index.js +1 -1
- package/dist/workbookPdf-K65CQX4K.js +1 -0
- package/dist/xlsxFile-3GXD4KW5.js +1 -0
- package/package.json +1 -1
- package/dist/Documents-ISV66NLW.js +0 -1
- package/dist/Slides-LJW5C24V.js +0 -1
- package/dist/SlidesEditor-ETCUQVJ7.js +0 -1
- package/dist/Spreadsheet-VWRRB6FE.js +0 -1
- package/dist/chunk-3RFDQOTI.js +0 -1
- package/dist/chunk-4NKXNXKY.js +0 -1
- package/dist/chunk-6ZFEBY6H.js +0 -1
- package/dist/chunk-B2X3NIQR.js +0 -1
- package/dist/chunk-BGAR3P46.js +0 -1
- package/dist/chunk-COXKOQPZ.js +0 -1
- package/dist/chunk-I3AC6PYR.js +0 -1
- package/dist/chunk-JKYJGXJE.js +0 -1
- package/dist/chunk-PXOQN7D6.js +0 -1
- package/dist/chunk-Q7NVDOCX.js +0 -1
- package/dist/chunk-RHW2M2UY.js +0 -1
- package/dist/chunk-UKGIT2RS.js +0 -1
- package/dist/chunk-ZS45QEF4.js +0 -1
- package/dist/deckPdf-4RC7QJ45.js +0 -1
- package/dist/docxPdf-EW5I5JR3.js +0 -1
- package/dist/importDocument-274VK7OM.js +0 -1
- package/dist/importSpreadsheet-IRN32JON.js +0 -1
- package/dist/workbookPdf-CQTTURQ5.js +0 -1
- package/dist/xlsxFile-SX767BIH.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{importSpreadsheetFile as e,readWithSheetJs as t}from"./chunk-DG4VDXLL.js";import{readXlsx as r,writeXlsx as n}from"./chunk-MR7ZWQHF.js";import{SPREADSHEET_ACCEPT as o,SPREADSHEET_EXTENSIONS as l,SpreadsheetsConflict as a,sheetsOf as i,useSpreadsheetWords as c,useSpreadsheetsHost as s}from"./chunk-NRGUS5QY.js";import"./chunk-UKGIT2RS.js";import{DEFAULT_COL_WIDTH as u,DEFAULT_FONT_SIZE as d,DEFAULT_ROW_HEIGHT as f,FUNCTION_NAMES as h,MAX_COLS as m,MAX_ROWS as g,NUMBER_FORMATS as p,adjustDecimals as v,applyBorders as w,cellDisplay as x,cellLabel as b,changeStructure as y,clearValues as C,colLabel as k,columnValues as N,commitEntry as E,copyClip as S,cycleRefAbsolute as D,dataRegion as R,deleteSheet as T,duplicateSheet as M,editText as A,expandForMerges as z,fillRange as F,filteredRows as I,findCells as L,formatKey as O,formatNumber as P,isFormula as U,makeEvaluator as $,mergeRange as B,mergedAt as K,moveCells as H,newSheet as W,nextSheetName as X,normalizeRange as V,parseCsv as Y,parseRangeLabel as G,pasteClip as j,printRef as _,rangeContains as Q,rangeLabel as Z,rawAt as q,readEntry as J,renameSheet as ee,replaceInCell as te,selectionStats as re,serializeCsv as ne,sheetFromRows as oe,shiftFormula as le,sortRange as ae,tokenize as ie,unmergeRange as ce,updateFormats as se,usedBounds as ue,withFormat as de,writeCells as fe}from"./chunk-ZS45QEF4.js";import{FileList as he}from"./chunk-PMGQ5GUH.js";import"./chunk-B32ASXHM.js";import{placeCopy as me}from"./chunk-XYVQTQ6N.js";import{useCallback as ge,useEffect as pe,useMemo as ve,useRef as we,useState as xe}from"react";import{saveIndicator as be,useAutosave as ye}from"efficient-easel/autosave";import{SaveState as Ce}from"efficient-easel/chrome";import"efficient-easel/chrome.css";import{useEaselStrings as ke}from"efficient-easel/strings";import{WindowTitle as Ne,useBrowserLayoutEffect as Ee,useWindowDirty as Se}from"efficient-shell";import{Icon as De}from"efficient-shell/icons";import{Button as Re,Checkbox as Te,ColorPickerPanel as Me,ContextMenu as Ae,DropdownMenu as ze,EmptyState as Fe,IconButton as Ie,Input as Le,LoadingSpinner as Oe,Popover as Pe,PopupMenu as Ue,PopupMenuDivider as $e,PopupMenuItem as Be,confirmDestructive as Ke,registerModalEscapeInterceptor as He,toDateKey as We,toast as Xe,useContextMenu as Ve}from"efficient-shell/ui";import{SPREADSHEET_PREVIEW_UPDATE_EVENT as Ye,peekSpreadsheetPreviewStage as Ge,claimSpreadsheetPreviewStage as je}from"efficient-shell/apps";import{forwardRef as _e,useCallback as Qe,useEffect as Ze,useImperativeHandle as qe,useMemo as Je,useRef as et,useState as tt}from"react";import{Icon as rt}from"efficient-shell/icons";import{jsx as nt,jsxs as ot}from"react/jsx-runtime";var lt,at=46,it=24,ct=4/3;function st(e,t){const r=new Float64Array(e+1);for(let n=0;n<e;n++)r[n+1]=r[n]+t(n);return r}function ut(e,t){let r=0,n=e.length-2;for(;r<n;){const o=r+n+1>>1;e[o]<=t?r=o:n=o-1}return r}function dt(e,t){if(void 0===lt)try{lt=document.createElement("canvas").getContext("2d")}catch{lt=null}const r=(t?.fontSize??d)*ct;return lt?(lt.font=`${t?.italic?"italic ":""}${t?.bold?"bold ":""}${r}px system-ui, sans-serif`,lt.measureText(e).width):e.length*r*.55}var ft=_e(function({sheet:e,sheetIndex:t,evaluator:r,filterHidden:n,selection:o,showGridlines:l,showFormulas:a,clipRange:i,highlights:s,pointing:h,onSelect:m,onPoint:g,onEdit:p,onFill:v,onResizeCol:w,onResizeRow:b,onAutoFitCol:y,onAutoFitRow:C,onHeaderMenu:N,onFilterButton:E,renderEditor:S,onKeyDown:D,onCopy:R,onCut:T,onPaste:M},A){const F=c(),I=et(null),[L,P]=tt({x:0,y:0}),[U,$]=tt({width:1e3,height:600}),[B,H]=tt(null),[W,X]=tt(null),[Y,G]=tt(null);Ze(()=>{const e=I.current;if(!e)return;const t=()=>{e.clientWidth&&e.clientHeight&&$({width:e.clientWidth,height:e.clientHeight})};if(t(),"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(t);return r.observe(e),()=>r.disconnect()},[]);const j=Je(()=>{const n=new Map;for(const[o,l]of Object.entries(e.formats)){if(!l.fontSize&&!l.wrap)continue;const[a,i]=o.split(":").map(Number);if(void 0!==e.rowHeights[a])continue;const c=(l.fontSize??d)*ct*1.4;let s=1;if(l.wrap&&""!==q(e,a,i)){const n=(e.colWidths[i]??u)-8;s=x(e,t,r,a,i).text.split("\n").reduce((e,t)=>e+Math.max(1,Math.ceil(dt(t,l)/Math.max(n,1))),0)}const h=Math.ceil(c*s+6);h>(n.get(a)??f)&&n.set(a,h)}return n},[e,t,r]),_=Je(()=>new Set(e.hiddenRows),[e.hiddenRows]),Q=Je(()=>new Set(e.hiddenCols),[e.hiddenCols]),Z=Je(()=>st(e.rowCount,t=>_.has(t)||n.has(t)?0:W?.row===t?W.height:e.rowHeights[t]??j.get(t)??f),[e.rowCount,e.rowHeights,_,n,j,W]),J=Je(()=>st(e.colCount,t=>Q.has(t)?0:B?.col===t?B.width:e.colWidths[t]??u),[e.colCount,e.colWidths,Q,B]),ee=Math.min(e.frozenRows,e.rowCount),te=Math.min(e.frozenCols,e.colCount),re=Z[ee],ne=J[te],oe=J[e.colCount],le=Z[e.rowCount],ae=Qe(e=>at+J[e]-(e>=te?L.x:0),[J,te,L.x]),ie=Qe(e=>it+Z[e]-(e>=ee?L.y:0),[Z,ee,L.y]),ce=Qe(e=>{const t=I.current;if(!t)return;const r=t.clientWidth-at-ne,n=t.clientHeight-it-re;let{scrollLeft:o,scrollTop:l}=t;if(e.col>=te){const t=J[e.col]-ne,n=J[e.col+1]-ne;t<o?o=t:n>o+r&&(o=n-r)}if(e.row>=ee){const t=Z[e.row]-re,r=Z[e.row+1]-re;t<l?l=t:r>l+n&&(l=r-n)}t.scrollTo(o,l)},[J,Z,ne,re,te,ee]);qe(A,()=>({focus:()=>I.current?.focus({preventScroll:!0}),scrollTo:ce,measureColumn:n=>{let o=0;for(let l=0;l<e.cells.length;l++){if(""===q(e,l,n))continue;const a=e.formats[O(l,n)];o=Math.max(o,dt(x(e,t,r,l,n).text,a))}return Math.ceil(o+8+4)}}),[ce,e,t,r]);const se=Qe((e,t)=>{const r=I.current.getBoundingClientRect(),n=e-r.left-at,o=t-r.top-it,l=n<ne?n:n+I.current.scrollLeft,a=o<re?o:o+I.current.scrollTop;return{row:ut(Z,Math.max(0,Math.min(a,le-1))),col:ut(J,Math.max(0,Math.min(l,oe-1)))}},[J,Z,ne,re,oe,le]),ue=Qe((e,t)=>{const r=I.current,n=t=>{const n=r.getBoundingClientRect();t.clientY>n.bottom-4?r.scrollBy(0,24):t.clientY<n.top+it&&r.scrollBy(0,-24),t.clientX>n.right-4?r.scrollBy(24,0):t.clientX<n.left+at&&r.scrollBy(-24,0),e(t)},o=e=>{window.removeEventListener("pointermove",n),window.removeEventListener("pointerup",o),window.removeEventListener("pointercancel",o),t(e)};window.addEventListener("pointermove",n),window.addEventListener("pointerup",o),window.addEventListener("pointercancel",o)},[]),de=Qe((t,r)=>{const n=z(e,V(t,r));m({active:t,range:n})},[e,m]),fe=Math.max(0,U.width-at-ne),he=Math.max(0,U.height-it-re),me=ut(Z,re+L.y),ge=ut(J,ne+L.x),pe=Math.min(e.rowCount-1,ut(Z,re+L.y+he)),ve=Math.min(e.colCount-1,ut(J,ne+L.x+fe)),we=(n,o,i,c)=>{const s=[],u=[],f=new Set,h=(n,o,i)=>{const c=O(n,o);if(f.has(c))return;f.add(c);const h=i?i.r2:n,m=i?i.c2:o,g=J[o],p=Z[n],v=J[m+1]-g,w=Z[h+1]-p;if(v<=0||w<=0)return;const b=e.formats[c],y=q(e,n,o),C=a&&"="===y[0]?{text:y,color:null,align:"left",error:!1}:x(e,t,r,n,o),k=b?.border,N="1px solid var(--ink)",E=!!b?.fill||!!k||!!i,S=l?"1px solid var(--line-subtle)":"1px solid transparent",D={position:"absolute",left:g,top:p,width:v,height:w,boxSizing:"border-box",borderRight:k?.right?N:S,borderBottom:k?.bottom?N:S,borderTop:k?.top?N:void 0,borderLeft:k?.left?N:void 0,background:b?.fill??(i?"var(--surface)":void 0)};if((E||l)&&s.push(nt("div",{style:D},`b${c}`)),!C.text)return;const R=b?.align??C.align;let T=C.text;"string"==typeof T&&!C.error&&"right"===C.align&&!b?.wrap&&dt(T,b)>v-4&&(T="#".repeat(Math.max(1,Math.floor(v/8))));let M=v,A=0;if(!i&&!b?.wrap&&"left"===C.align&&dt(T,b)>v-8){if("left"===R||"center"===R)for(let t=o+1;t<=Math.min(o+40,e.colCount-1)&&(""===q(e,n,t)&&!K(e,n,t));t++)M+=J[t+1]-J[t];if("right"===R||"center"===R)for(let t=o-1;t>=Math.max(o-40,0)&&(""===q(e,n,t)&&!K(e,n,t));t--)A+=J[t+1]-J[t]}const z=b?.vAlign??"bottom",F=C.error?"var(--danger-text)":C.color??b?.color;u.push(nt("div",{"data-cell":c,className:"pointer-events-none",style:{position:"absolute",left:g-A,top:p,width:M+A,height:w,boxSizing:"border-box",padding:"0 4px",overflow:"hidden",display:"flex",alignItems:"top"===z?"flex-start":"middle"===z?"center":"flex-end",justifyContent:b?.wrap?void 0:"right"===R?"flex-end":"center"===R?"center":"flex-start",textAlign:R,whiteSpace:b?.wrap?"pre-wrap":"pre",wordBreak:b?.wrap?"break-word":void 0,fontSize:(b?.fontSize??d)*ct,lineHeight:1.3,paddingBottom:"bottom"===z?2:void 0,fontWeight:b?.bold?700:void 0,fontStyle:b?.italic?"italic":void 0,textDecoration:[b?.underline?"underline":"",b?.strike?"line-through":""].join(" ").trim()||void 0,color:F},children:nt("span",{style:b?.wrap?{width:"100%"}:void 0,children:T})},`t${c}`))};for(let t=n;t<=o;t++)for(let r=i;r<=c;r++){const n=K(e,t,r);(!n||n.r1===t&&n.c1===r)&&h(t,r,n)}for(const t of e.merges)(t.r1<n||t.c1<i)&&t.r2>=n&&t.r1<=o&&t.c2>=i&&t.c1<=c&&h(t.r1,t.c1,t);return[...s,...u]},xe=(t,r,n,l)=>{const a=[],c=(e,o,i,c)=>{e.r2<t||e.r1>r||e.c2<n||e.c1>l||a.push(nt("div",{style:{position:"absolute",boxSizing:"border-box",pointerEvents:"none",left:J[e.c1],top:Z[e.r1],width:J[e.c2+1]-J[e.c1],height:Z[e.r2+1]-Z[e.r1],...i},children:c},o))},u=o.range,d=u.r1!==u.r2||u.c1!==u.c2,f=K(e,o.active.row,o.active.col),h=!!f&&f.r1===u.r1&&f.r2===u.r2&&f.c1===u.c1&&f.c2===u.c2;return c(u,"sel",{background:d&&!h?"color-mix(in srgb, var(--accent-fill) 12%, transparent)":void 0,border:"2px solid var(--accent-fill)"}),Y&&c(Y,"fill",{border:"1px dashed var(--ink-muted)"}),i&&c(i,"clip",{border:"2px dashed var(--accent-fill)"}),s.forEach((e,t)=>c(e.range,`ref${t}`,{border:`2px solid ${e.color}`,background:`color-mix(in srgb, ${e.color} 10%, transparent)`})),a},be=[];ee&&te&&be.push({key:"corner",left:at,top:it,width:ne,height:re,offsetX:0,offsetY:0,r1:0,r2:ee-1,c1:0,c2:te-1}),ee&&be.push({key:"top",left:at+ne,top:it,width:fe,height:re,offsetX:L.x,offsetY:0,r1:0,r2:ee-1,c1:ge,c2:ve}),te&&be.push({key:"left",left:at,top:it+re,width:ne,height:he,offsetX:0,offsetY:L.y,r1:me,r2:pe,c1:0,c2:te-1}),be.push({key:"main",left:at+ne,top:it+re,width:fe,height:he,offsetX:L.x,offsetY:L.y,r1:me,r2:pe,c1:ge,c2:ve});const ye=o.range,Ce=[];for(let e=0;e<te;e++)Ce.push(e);for(let e=ge;e<=ve;e++)Ce.push(e);const ke=[];for(let e=0;e<ee;e++)ke.push(e);for(let e=me;e<=pe;e++)ke.push(e);const Ne=0===ye.r1&&ye.r2===e.rowCount-1,Ee=0===ye.c1&&ye.c2===e.colCount-1,Se="absolute flex items-center justify-center select-none text-xs border-r border-b border-line",De="bg-accent-tint text-accent-text",Re="bg-surface-sunken text-ink-muted",Te=ye.r2<ee||ye.r2>=me,Me=ae(ye.c2+1),Ae=ie(ye.r2+1),ze=Te&&!h&&Me>=at&&Ae>=it&&Me<=U.width&&Ae<=U.height,Fe=K(e,o.active.row,o.active.col)??{r1:o.active.row,c1:o.active.col,r2:o.active.row,c2:o.active.col},Ie={x:ae(Fe.c1),y:ie(Fe.r1),width:J[Fe.c2+1]-J[Fe.c1],height:Z[Fe.r2+1]-Z[Fe.r1],viewportWidth:U.width,viewportHeight:U.height},{filter:Le}=e,Oe=Le?.range.r1??-1,Pe=[];if(Le&&(Oe<ee||Oe>=me&&Oe<=pe))for(let e=Le.range.c1;e<=Le.range.c2;e++)J[e+1]>J[e]&&(e<te||e>=ge&&e<=ve)&&Pe.push(e);return nt("div",{ref:I,tabIndex:0,role:"grid","aria-label":e.name,"aria-rowcount":e.rowCount,"aria-colcount":e.colCount,className:"relative h-full w-full overflow-auto outline-none bg-surface text-ink",onScroll:e=>P({x:e.currentTarget.scrollLeft,y:e.currentTarget.scrollTop}),onKeyDown:D,onCopy:R,onCut:T,onPaste:M,children:nt("div",{style:{width:at+oe,height:it+le},children:ot("div",{className:"sticky top-0 left-0 overflow-hidden",style:{width:U.width,height:U.height},children:[ot("div",{className:"absolute inset-0",onPointerDown:t=>{if(0!==t.button)return;const r=se(t.clientX,t.clientY);if(h)return t.preventDefault(),g(V(r,r),!1),void ue(e=>g(V(r,se(e.clientX,e.clientY)),!1),e=>g(V(r,se(e.clientX,e.clientY)),!0));if(I.current?.focus({preventScroll:!0}),t.detail>=2)return t.preventDefault(),void p(r);const n=t.shiftKey?o.active:K(e,r.row,r.col)?{row:K(e,r.row,r.col).r1,col:K(e,r.row,r.col).c1}:r;de(n,r),ue(e=>de(n,se(e.clientX,e.clientY)),()=>{})},onContextMenu:e=>N(e,"cell",se(e.clientX,e.clientY)),children:[be.map(e=>nt("div",{className:"absolute overflow-hidden",style:{left:e.left,top:e.top,width:e.width,height:e.height},children:ot("div",{className:"absolute",style:{left:-e.offsetX,top:-e.offsetY,width:oe,height:le},children:[we(e.r1,e.r2,e.c1,e.c2),xe(e.r1,e.r2,e.c1,e.c2)]})},e.key)),re>0&&nt("div",{className:"absolute bg-line-strong pointer-events-none",style:{left:0,right:0,top:it+re-1,height:2}}),ne>0&&nt("div",{className:"absolute bg-line-strong pointer-events-none",style:{top:0,bottom:0,left:at+ne-1,width:2}})]}),Pe.map(e=>{const t=ae(e+1),r=ie(Oe),n=Z[Oe+1]-Z[Oe],o=(Le?.excluded[e]?.length??0)>0;return nt("button",{type:"button","aria-label":F.filterColumn(k(e)),onClick:t=>{t.stopPropagation(),E(e,t.currentTarget.getBoundingClientRect())},onPointerDown:e=>e.stopPropagation(),className:`absolute flex items-center justify-center rounded border ${o?"":"border-line"} ${o?"border-accent-fill bg-accent-tint":"bg-surface hover:bg-surface-sunken"}`,style:{left:t-19,top:r+Math.max(0,(n-17)/2),width:17,height:17},children:nt(rt,{name:"filter",size:11})},e)}),ze&&nt("div",{"aria-label":F.fillHandle,className:"absolute bg-accent-fill border border-surface cursor-crosshair",style:{left:Me-5,top:Ae-5,width:8,height:8},onPointerDown:e=>{e.preventDefault(),e.stopPropagation();const t=o.range;let r=null;ue(e=>{r=(e=>{const r=se(e.clientX,e.clientY);return(r.row>t.r2?r.row-t.r2:r.row<t.r1?t.r1-r.row:0)>=(r.col>t.c2?r.col-t.c2:r.col<t.c1?t.c1-r.col:0)?{...t,r1:Math.min(t.r1,r.row),r2:Math.max(t.r2,r.row)}:{...t,c1:Math.min(t.c1,r.col),c2:Math.max(t.c2,r.col)}})(e),G(r)},()=>{G(null),!r||r.r1===t.r1&&r.r2===t.r2&&r.c1===t.c1&&r.c2===t.c2||v(r)})}}),nt("div",{className:"absolute top-0 overflow-hidden bg-surface-sunken",style:{left:at,right:0,height:it},children:Ce.map(t=>{const r=J[t+1]-J[t];if(r<=0)return null;const n=J[t]-(t>=te?L.x:0),l=t>=ye.c1&&t<=ye.c2;return ot("div",{className:`${Se} ${l?De:Re} ${l&&Ne?"font-semibold":""}`,style:{left:n,top:0,width:r,height:it},onPointerDown:r=>((t,r)=>{if(0!==t.button)return;I.current?.focus({preventScroll:!0});const n=t.shiftKey?o.active.col:r,l=t=>{const r={r1:0,c1:Math.min(n,t),r2:e.rowCount-1,c2:Math.max(n,t)};m({active:{row:0,col:n},range:r})};l(r),ue(e=>l(se(e.clientX,e.clientY).col),()=>{})})(r,t),onContextMenu:e=>N(e,"col",{row:0,col:t}),children:[k(t),nt("div",{className:"absolute top-0 bottom-0 cursor-col-resize",style:{right:-3,width:7},onPointerDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation();const r=e.clientX,n=J[t+1]-J[t],o=e=>Math.max(16,Math.round(n+e.clientX-r));ue(e=>H({col:t,width:o(e)}),e=>{H(null),o(e)!==n&&w(t,o(e))})})(e,t),onDoubleClick:e=>{e.stopPropagation(),y(t)}})]},t)})}),nt("div",{className:"absolute left-0 overflow-hidden bg-surface-sunken",style:{top:it,bottom:0,width:at},children:ke.map(t=>{const r=Z[t+1]-Z[t];if(r<=0)return null;const n=Z[t]-(t>=ee?L.y:0),l=t>=ye.r1&&t<=ye.r2;return ot("div",{className:`${Se} ${l?De:Re} ${l&&Ee?"font-semibold":""}`,style:{left:0,top:n,width:at,height:r},onPointerDown:r=>((t,r)=>{if(0!==t.button)return;I.current?.focus({preventScroll:!0});const n=t.shiftKey?o.active.row:r,l=t=>{const r={r1:Math.min(n,t),c1:0,r2:Math.max(n,t),c2:e.colCount-1};m({active:{row:n,col:0},range:r})};l(r),ue(e=>l(se(e.clientX,e.clientY).row),()=>{})})(r,t),onContextMenu:e=>N(e,"row",{row:t,col:0}),children:[t+1,nt("div",{className:"absolute left-0 right-0 cursor-row-resize",style:{bottom:-3,height:7},onPointerDown:e=>((e,t)=>{e.preventDefault(),e.stopPropagation();const r=e.clientY,n=Z[t+1]-Z[t],o=e=>Math.max(12,Math.round(n+e.clientY-r));ue(e=>X({row:t,height:o(e)}),e=>{X(null),o(e)!==n&&b(t,o(e))})})(e,t),onDoubleClick:e=>{e.stopPropagation(),C(t)}})]},t)})}),nt("div",{role:"button","aria-label":F.selectAll,className:`${Se} top-0 left-0 cursor-pointer bg-surface-sunken hover:bg-line`,style:{width:at,height:it},onPointerDown:t=>{t.preventDefault(),I.current?.focus({preventScroll:!0}),m({active:{row:0,col:0},range:{r1:0,c1:0,r2:e.rowCount-1,c2:e.colCount-1}})},onContextMenu:e=>N(e,"corner",{row:0,col:0})}),S?.(Ie)]})})})}),ht=["#000000","#434343","#666666","#999999","#cccccc","#efefef","#ffffff","#c00000","#ff0000","#ffc000","#ffff00","#92d050","#00b050","#00b0f0","#0070c0","#002060","#7030a0","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#d9d2e9","#ead1dc"],mt=["#1a73e8","#d93025","#7b1fa2","#188038","#e37400","#c5221f"];function gt(e,t){let r=!1;for(let n=0;n<t;n++)'"'===e[n]&&(r=!r);return r}function pt(e,t){if("="!==e[0]||gt(e,t))return null;const r=/[A-Za-z][A-Za-z0-9.]*$/.exec(e.slice(0,t));if(!r)return null;if("!"===e[r.index-1]||"("===e[t])return null;const n=r[0].toUpperCase(),o=h.filter(e=>e.startsWith(n));return o.length?{start:r.index,prefix:n,matches:o.slice(0,8)}:null}var vt={ABS:"value",AND:"condition1, [condition2, ...]",AVERAGE:"value1, [value2, ...]",AVERAGEIF:"range, criterion, [average_range]",AVERAGEIFS:"average_range, range1, criterion1, ...",CEILING:"value, [factor]","CEILING.MATH":"value, [factor]",CHOOSE:"index, choice1, [choice2, ...]",COLUMN:"[cell]",COLUMNS:"range",CONCAT:"value1, [value2, ...]",CONCATENATE:"value1, [value2, ...]",COS:"angle",COUNT:"value1, [value2, ...]",COUNTA:"value1, [value2, ...]",COUNTBLANK:"range",COUNTIF:"range, criterion",COUNTIFS:"range1, criterion1, ...",DATE:"year, month, day",DATEDIF:"start, end, unit",DAY:"date",DAYS:"end, start",EDATE:"start, months",EOMONTH:"start, months",EXACT:"text1, text2",EXP:"value",FIND:"find, within, [start]",FLOOR:"value, [factor]","FLOOR.MATH":"value, [factor]",FV:"rate, periods, payment, [present], [type]",HLOOKUP:"key, range, row, [approximate]",HOUR:"time",IF:"condition, if_true, [if_false]",IFERROR:"value, [if_error]",IFNA:"value, [if_na]",IFS:"condition1, value1, ...",INDEX:"range, row, [column]",INT:"value",ISBLANK:"value",ISERROR:"value",ISLOGICAL:"value",ISNA:"value",ISNUMBER:"value",ISTEXT:"value",LARGE:"range, k",LEFT:"text, [count]",LEN:"text",LN:"value",LOG:"value, [base]",LOG10:"value",LOWER:"text",MATCH:"key, range, [type]",MAX:"value1, [value2, ...]",MEDIAN:"value1, [value2, ...]",MID:"text, start, count",MIN:"value1, [value2, ...]",MINUTE:"time",MOD:"value, divisor",MODE:"value1, [value2, ...]","MODE.SNGL":"value1, [value2, ...]",MONTH:"date",N:"value",NA:"",NETWORKDAYS:"start, end, [holidays]",NOT:"condition",NOW:"",NPV:"rate, value1, [value2, ...]",OR:"condition1, [condition2, ...]",PI:"",PMT:"rate, periods, present, [future], [type]",POWER:"value, exponent",PRODUCT:"value1, [value2, ...]",PROPER:"text",PV:"rate, periods, payment, [future], [type]",RAND:"",RANDBETWEEN:"low, high",RANK:"value, range, [ascending]","RANK.EQ":"value, range, [ascending]",REPLACE:"text, start, count, new",REPT:"text, count",RIGHT:"text, [count]",ROUND:"value, [places]",ROUNDDOWN:"value, [places]",ROUNDUP:"value, [places]",ROW:"[cell]",ROWS:"range",SEARCH:"find, within, [start]",SECOND:"time",SIGN:"value",SIN:"angle",SMALL:"range, k",SQRT:"value",STDEV:"value1, [value2, ...]","STDEV.P":"value1, [value2, ...]","STDEV.S":"value1, [value2, ...]",STDEVP:"value1, [value2, ...]",SUBSTITUTE:"text, find, new, [occurrence]",SUM:"value1, [value2, ...]",SUMIF:"range, criterion, [sum_range]",SUMIFS:"sum_range, range1, criterion1, ...",SUMPRODUCT:"range1, [range2, ...]",SWITCH:"value, case1, result1, ..., [default]",TAN:"angle",TEXT:"value, format",TEXTJOIN:"delimiter, skip_blank, value1, ...",TIME:"hour, minute, second",TODAY:"",TRIM:"text",TRUNC:"value, [places]",UPPER:"text",VALUE:"text",VAR:"value1, [value2, ...]","VAR.P":"value1, [value2, ...]","VAR.S":"value1, [value2, ...]",VARP:"value1, [value2, ...]",VLOOKUP:"key, range, column, [approximate]",WEEKDAY:"date, [type]",XLOOKUP:"key, lookup_range, result_range, [if_not_found], [match_mode]",XOR:"condition1, [condition2, ...]",YEAR:"date",CHAR:"number",CLEAN:"text",CODE:"text",ISERR:"value",ISEVEN:"value",ISODD:"value",MAXIFS:"max_range, range1, criterion1, ...",MINIFS:"min_range, range1, criterion1, ...",MROUND:"value, factor",PERCENTILE:"range, percentile","PERCENTILE.INC":"range, percentile",QUARTILE:"range, quartile","QUARTILE.INC":"range, quartile",QUOTIENT:"dividend, divisor",REGEXEXTRACT:"text, regular_expression",REGEXMATCH:"text, regular_expression",REGEXREPLACE:"text, regular_expression, replacement",SUBTOTAL:"function_code, range1, [range2, ...]",DATEVALUE:"text",ISOWEEKNUM:"date","NETWORKDAYS.INTL":"start, end, [weekend], [holidays]",TIMEVALUE:"text",WEEKNUM:"date, [type]",WORKDAY:"start, days, [holidays]","WORKDAY.INTL":"start, days, [weekend], [holidays]",YEARFRAC:"start, end, [basis]"};import{Fragment as wt,jsx as xt,jsxs as bt}from"react/jsx-runtime";var yt=[8,9,10,11,12,14,16,18,20,24,28,36],Ct="undefined"!=typeof navigator&&/Mac|iPhone|iPad/.test(navigator.platform),kt=Ct?"⌘":"Ctrl+";function Nt(e,t,r){const n=URL.createObjectURL(new Blob([e],{type:t})),o=document.createElement("a");o.href=n,o.download=r,o.click(),URL.revokeObjectURL(n)}var Et=o;function St({spreadsheetId:t,onClose:r}){const n=c(),{store:o,canCreate:a=!0,canDelete:i=!0,chooseFile:u}=s(),[d]=xe(()=>null!=Ge()),[f,h]=xe(null),[m,g]=xe(null);if(!o||d)return xt(Mt,{onClose:r});if(t)return xt(Rt,{store:o,id:t,onClose:r});if(f?.id)return xt(Rt,{store:o,id:f.id,onClose:()=>h(null)},f.key);if(f?.file)return xt(Mt,{initialFile:f.file,hasStore:!0,onClose:()=>h(null)},f.key);return xt(he,{words:{windowTitle:n.filesHeading,heading:n.filesHeading,newFile:n.newFile,emptyTitle:n.filesEmptyTitle,emptyBody:n.filesEmptyBody,deleteConfirm:n.deleteConfirm,createFailed:n.createFailed,deleteFailed:n.deleteFailed},files:n.files,list:o.list,create:()=>o.create(n.untitled),rename:o.rename,remove:o.remove,canCreate:a,canDelete:i,accept:Et,choose:u&&{run:u,request:{title:n.files.choosing(n.fileKind,n.filesHeading),extensions:l}},onOpen:e=>h({key:Date.now(),id:e}),onOpenFile:(t,r)=>{m||(g(n.files.opening(t.name)),e(o,t).then(async e=>{const o=await me(r,e.id);Xe.success(n.files.savedCopy(e.title,t.name,o?r?.location:void 0)),h({key:Date.now(),id:e.id})}).catch(()=>Xe.error(n.files.openFailed(t.name))).finally(()=>g(null)))},busy:m})}function Dt({id:e,onClose:t}){return xt(St,{spreadsheetId:e,onClose:t})}function Rt({store:e,id:t,onClose:r,pane:n}){const o=c(),[l,a]=xe(null),[i,s]=xe(!1),u=ge(()=>{s(!1),e.get(t).then(e=>a(t=>({kept:e,nonce:(t?.nonce??0)+1})),()=>s(!0))},[t,e]);return pe(u,[u]),i?xt("div",{className:"office-open-failed",children:xt(Fe,{title:o.storedOpenFailed,children:r&&xt(Re,{onClick:r,children:o.backToFiles})})}):l?xt(Mt,{stored:{store:e,...l.kept},onClose:r,onReload:u,pane:n},l.nonce):xt(Oe,{size:"sm",padding:"",className:"h-full",label:o.loading})}function Tt({initial:e,spreadsheetId:t,bridge:r,onSaveToFiles:n}){const{store:o}=s(),l=ve(()=>({bridge:r,onSaveToFiles:n}),[r,n]);return o&&t?xt(Rt,{store:o,id:t,pane:l}):xt(Mt,{initial:e??{rows:[],filename:""},pane:l})}function Mt({stored:e,initialFile:o,hasStore:l,onClose:s,onReload:u,initial:f,pane:h}){const x=c(),k=we(void 0);void 0===k.current&&(k.current=e?null:f?{token:-1,data:f}:Ge());const he=we(k.current?.data??null),[me]=xe(()=>{const e=k.current;if(!e)return null;const t=At(e.data,x.sheetName(1));return t?{sheet:t,title:e.data.filename.replace(/\.(csv|tsv|txt)$/i,"")}:-1===e.token&&e.data.filename?{sheet:W(x.sheetName(1)),title:e.data.filename}:null}),[Fe,Oe]=xe(()=>e?i(e.workbook,x.sheetName(1)):me?[me.sheet]:[W(x.sheetName(1))]),[_e,Qe]=xe(0),[Ze,qe]=xe(e?.title??me?.title??x.untitled),[Je,et]=xe(()=>k.current?.data.onEmail),tt=we(Fe),rt=we([]),nt=we([]),[,ot]=xe(0),lt=ge(e=>{const t=tt.current,r=e(t);r!==t&&(rt.current.push(t),rt.current.length>100&&rt.current.shift(),nt.current=[],tt.current=r,Oe(r),ot(e=>e+1))},[]),at=ge(e=>{rt.current=[],nt.current=[],tt.current=e,Oe(e),Qe(0),ot(e=>e+1)},[]),it=ge(()=>{const e=rt.current.pop();e&&(nt.current.push(tt.current),tt.current=e,Oe(e),Qe(t=>Math.min(t,e.length-1)),ot(e=>e+1))},[]),ct=ge(()=>{const e=nt.current.pop();e&&(rt.current.push(tt.current),tt.current=e,Oe(e),Qe(t=>Math.min(t,e.length-1)),ot(e=>e+1))},[]),st=we(Fe),ut=we(e?.version??""),dt=we(e?.title??""),[St,Dt]=xe(!1),Rt=ke(),Tt=ye({save:async t=>{e&&(ut.current=await e.store.save(e.id,{sheets:t},ut.current))},onFailure:(e,t)=>{e instanceof a?(Tt.stop(),Dt(!0)):0===t&&Xe.error(x.saveFailed)}}),{push:Mt,flush:zt}=Tt,Ft=we(Fe);pe(()=>{e&&Fe!==Ft.current&&(Ft.current=Fe,Mt(Fe))},[Mt,Fe,e]),pe(()=>()=>{zt()},[zt]),Se(e?Tt.state.pending||St:Fe!==st.current);const It=ge(e=>{const t=At(e,x.sheetName(1));t&&(at([t]),st.current=tt.current,qe(e.filename.replace(/\.(csv|tsv|txt)$/i,"")),et(()=>e.onEmail))},[at,x]);pe(()=>{const e=k.current;null!=e&&(je(e),e.data!==he.current&&It(e.data))},[]),pe(()=>{const e=k.current?.token;if(null==e)return;const t=t=>{const r=t.detail;r&&r.token===e&&It(r.data)};return window.addEventListener(Ye,t),()=>window.removeEventListener(Ye,t)},[]);const Lt=Math.min(_e,Fe.length-1),Ot=Fe[Lt],Pt=ve(()=>$(Fe),[Fe]),Ut=ve(()=>I(Ot,Lt,Pt),[Ot,Lt,Pt]),$t=we(null),Bt=we(null),[Kt,Ht]=xe({}),Wt=Kt[Ot.id]??{active:{row:0,col:0},range:{r1:0,c1:0,r2:0,c2:0}},Xt=we(_e);Xt.current=_e;const Vt=ge(e=>{Ht(t=>({...t,[tt.current[Math.min(Xt.current,tt.current.length-1)].id]:e}))},[]),Yt=Wt.active,Gt=Ot.formats[O(Yt.row,Yt.col)]??{},jt=q(Ot,Yt.row,Yt.col),[_t,Qt]=xe(null),Zt=we(_t);Zt.current=_t;const[qt,Jt]=xe(null),[er,tr]=xe(!0),[rr,nr]=xe(!1),[or,lr]=xe(null),[ar,ir]=xe(null),[cr,sr]=xe(!1),[ur,dr]=xe(null),[fr,hr]=xe(null),[mr,gr]=xe(!1),[pr,vr]=xe(""),[wr,xr]=xe(""),[br,yr]=xe({matchCase:!1,wholeCell:!1,inFormulas:!1}),Cr=we(null),kr=we(null),Nr=we(null),Er=Ve(),Sr=Ve(),Dr=ge(()=>{$t.current?.focus(),setTimeout(()=>{const e=document.activeElement;e&&e!==document.body&&!e.closest("[aria-haspopup]")||$t.current?.focus()},0)},[]),Rr=ge(e=>{lt(t=>{const r=Math.min(Xt.current,t.length-1),n=e(t[r]);return n===t[r]?t:t.map((e,t)=>t===r?n:e)})},[lt]),Tr=we(null),Mr=we(()=>!1);pe(()=>He(()=>!!Tr.current?.contains(document.activeElement)&&Mr.current()),[]);const Ar=ge(e=>Ot.hiddenRows.includes(e)||Ut.has(e),[Ot.hiddenRows,Ut]),zr=ge(e=>Ot.hiddenCols.includes(e),[Ot.hiddenCols]),Fr=ge(e=>{const t=K(Ot,e.row,e.col),r=t??{r1:e.row,c1:e.col,r2:e.row,c2:e.col};Vt({active:t?{row:t.r1,col:t.c1}:e,range:r}),$t.current?.scrollTo(e)},[Ot,Vt]),Ir=ge((e,t,r)=>{let{row:n,col:o}=e;const l=K(Ot,n,o);l&&(t>0&&(n=l.r2),t<0&&(n=l.r1),r>0&&(o=l.c2),r<0&&(o=l.c1));do{n+=t,o+=r}while(n>=0&&n<Ot.rowCount&&o>=0&&o<Ot.colCount&&(Ar(n)||zr(o)));return n<0||n>=Ot.rowCount||o<0||o>=Ot.colCount?e:{row:n,col:o}},[Ot,Ar,zr]),Lr=ge((e,t,r)=>{const n=e=>""!==q(Ot,e.row,e.col);let o=e,l=Ir(o,t,r);if(l===o)return o;if(n(o)&&n(l)){for(;n(l);)if(o=l,l=Ir(o,t,r),l===o)return o;return o}for(;!n(l);)if(o=l,l=Ir(o,t,r),l===o)return o;return l},[Ot,Ir]),Or=ge(e=>{const t=z(Ot,V(Wt.active,e));Vt({active:Wt.active,range:t}),$t.current?.scrollTo(e)},[Ot,Wt.active,Vt]),Pr=ge(()=>{const{range:e,active:t}=Wt;return{row:t.row===e.r1?e.r2:e.r1,col:t.col===e.c1?e.c2:e.c1}},[Wt]),Ur=we(null),$r=ge((e,t={})=>{const r=q(Ot,e.row,e.col),n=t.text??A(r,Ot.formats[O(e.row,e.col)]);Jt(e=>e?.cut?null:e),t.inBar||null!==Ur.current||(Ur.current=n.length),Qt({sheetId:Ot.id,row:e.row,col:e.col,text:n,mode:t.mode??(void 0!==t.text?"enter":"edit"),inBar:!!t.inBar,caret:n.length,pick:null,suggestion:0})},[Ot]),Br=ge(e=>{const t=Zt.current;if(!t)return!1;Zt.current=null,Qt(null),lt(r=>{const n=r.findIndex(e=>e.id===t.sheetId);if(n<0)return r;const o=r[n];if(t.text===A(q(o,t.row,t.col),o.formats[O(t.row,t.col)])&&!e)return r;let l=o;if(e)for(let r=e.r1;r<=e.r2;r++)for(let n=e.c1;n<=e.c2;n++){const e=U(t.text)?le(J(t.text).raw,r-t.row,n-t.col):t.text;l=E(l,r,n,e)}else l=E(l,t.row,t.col,t.text);return r.map((e,t)=>t===n?l:e)});const r=tt.current.findIndex(e=>e.id===t.sheetId);return r>=0&&r!==Xt.current&&Qe(r),!0},[lt]),Kr=ge(()=>{const e=Zt.current;if(Zt.current=null,Qt(null),e){const t=tt.current.findIndex(t=>t.id===e.sheetId);t>=0&&t!==Xt.current&&Qe(t)}Dr()},[Dr]),Hr=ge((e,t)=>{Fr(Ir(Wt.active,e,t)),Dr()},[Dr,Fr,Wt.active,Ir]);Ee(()=>{if(!_t)return;const e=_t.inBar?Cr.current:kr.current;e&&(document.activeElement!==e&&e.focus({preventScroll:!0}),null!==Ur.current&&(e.setSelectionRange(Ur.current,Ur.current),Ur.current=null))},[_t]);const Wr=ge((e,t)=>{Qt(r=>r?{...r,text:e,caret:t,pick:null,suggestion:0}:r)},[]),Xr=_t?.sheetId===Ot.id,Vr=_t?pt(_t.text,_t.caret):null,Yr=_t?function(e,t){if("="!==e[0])return null;const r=[];let n=!1;for(let o=1;o<t;o++){const t=e[o];if('"'===t&&(n=!n),!n)if("("===t){const t=/([A-Za-z][A-Za-z0-9.]*)$/.exec(e.slice(1,o));r.push({name:t?t[1].toUpperCase():"",argIndex:0})}else")"===t?r.pop():","!==t&&";"!==t||!r.length||r[r.length-1].argIndex++}for(let e=r.length-1;e>=0;e--)if(r[e].name)return r[e];return null}(_t.text,_t.caret):null,Gr=!!_t&&(null!==_t.pick||function(e,t){if("="!==e[0]||gt(e,t))return!1;const r=e.slice(0,t).trimEnd(),n=e.slice(t).trimStart()[0];return!(void 0!==n&&!/[,;)+\-*/^&=<>%]/.test(n))&&/[=(,;+\-*/^&<>]$/.test(r)}(_t.text,_t.caret)),jr=ve(()=>_t?function(e,t,r,n,o){if("="!==e[0])return[];const l=[];let a=0;for(const i of ie(e.slice(1)).tokens){if("ref"!==i.type)continue;const e=mt[a++%mt.length];if(!(null===i.ref.sheet?r:i.ref.sheet.toLowerCase()===t.toLowerCase()))continue;const c=i.ref.b??i.ref.a,s=V({row:i.ref.a.row??0,col:i.ref.a.col??0},{row:c.row??n-1,col:c.col??o-1});l.push({range:s,color:e})}return l}(_t.text,Ot.name,Xr,Ot.rowCount,Ot.colCount):[],[_t,Ot.name,Ot.rowCount,Ot.colCount,Xr]),_r=ge((e,t)=>{const r=Zt.current;if(!r)return;const n=_({sheet:r.sheetId===tt.current[Xt.current].id?null:tt.current[Xt.current].name,a:{row:e.r1,col:e.c1,rowAbs:!1,colAbs:!1},b:e.r1===e.r2&&e.c1===e.c2?null:{row:e.r2,col:e.c2,rowAbs:!1,colAbs:!1}}),o=r.pick?.start??r.caret,l=r.pick?.end??r.caret,a=r.text.slice(0,o)+n+r.text.slice(l),i=o+n.length;Ur.current=i,Qt({...r,text:a,caret:i,pick:t?null:{start:o,end:i}})},[]),Qr=ge(e=>{const t=Zt.current,r=t?pt(t.text,t.caret):null;if(!t||!r)return;const n=function(e,t,r,n){const o=`${n}(`;return{text:e.slice(0,r)+o+e.slice(t),caret:r+o.length}}(t.text,t.caret,r.start,e);Ur.current=n.caret,Qt({...t,text:n.text,caret:n.caret,suggestion:0,pick:null})},[]),Zr=e=>{if(_t){if(e.stopPropagation(),Vr){if("ArrowDown"===e.key||"ArrowUp"===e.key){e.preventDefault();const t=Vr.matches.length;return void Qt({..._t,suggestion:(_t.suggestion+("ArrowDown"===e.key?1:t-1))%t})}if("Tab"===e.key||"Enter"===e.key&&_t.suggestion>0)return e.preventDefault(),void Qr(Vr.matches[_t.suggestion])}if("Enter"===e.key){if(e.altKey){e.preventDefault();const{selectionStart:t,selectionEnd:r,value:n}=e.currentTarget,o=`${n.slice(0,t)}\n${n.slice(r)}`;return Ur.current=t+1,void Wr(o,t+1)}return e.preventDefault(),e.ctrlKey||e.metaKey?(Br(Wt.range),void Dr()):(Br(),void Hr(e.shiftKey?-1:1,0))}if("Tab"===e.key)return e.preventDefault(),Br(),void Hr(0,e.shiftKey?-1:1);if("F4"===e.key){e.preventDefault();const t=function(e,t){if("="!==e[0])return null;const r=t-1;for(const t of ie(e.slice(1)).tokens){if("ref"!==t.type||r<t.start||r>t.end)continue;const n={...t.ref,a:D(t.ref.a),b:t.ref.b?D(t.ref.b):null},o=_(n);return{text:`=${e.slice(1,t.start+1)}${o}${e.slice(t.end+1)}`,caret:t.start+1+o.length}}return null}(_t.text,e.currentTarget.selectionStart);return void(t&&(Ur.current=t.caret,Wr(t.text,t.caret)))}"enter"!==_t.mode||_t.inBar||U(_t.text)||!e.key.startsWith("Arrow")||(e.preventDefault(),Br(),Hr("ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:0,"ArrowRight"===e.key?1:"ArrowLeft"===e.key?-1:0))}},qr=e=>{const t=e.currentTarget.selectionStart;Qt(e=>e&&e.caret!==t?{...e,caret:t,pick:null}:e)},Jr=ge(e=>{Br(),e(),Dr()},[Br,Dr]),en=we(Wt);en.current=Wt;const tn=h?.bridge,rn=we(Ze);rn.current=Ze;const nn=Kt[Ot.id]?Wt:null,on=we(nn);on.current=nn,pe(()=>{if(tn)return tn.attach({sheets:()=>tt.current,activeSheet:()=>Math.min(Xt.current,tt.current.length-1),title:()=>rn.current||x.untitled,selection:()=>on.current?{sheet:Math.min(Xt.current,tt.current.length-1),range:on.current.range}:null,commit:e=>lt(()=>e),undoLast:it})},[tn,lt,x,it]),pe(()=>{tn?.changed()},[tn,nn,Lt,Fe,Ze]);const ln=ge(e=>{Jr(()=>Rr(t=>se(t,en.current.range,e)))},[Jr,Rr]),an=ge(e=>{const t=!Gt[e];ln(r=>de(r,e,t||void 0))},[Gt,ln]),cn=ge(e=>{ln(t=>de(t,"numFmt","General"===e?void 0:e))},[ln]),sn=ge(e=>{const t=Pt.value(Lt,Yt.row,Yt.col),r=v(Gt.numFmt??"General",e,"number"==typeof t?t:null);cn(r)},[Yt,Gt.numFmt,Pt,Lt,cn]),un=ge((e,t)=>{const{range:r}=Wt,[n,o]="row"===e?[r.r1,r.r2]:[r.c1,r.c2],l="row"===e?Ot.rowCount:Ot.colCount,a=o-n+1>=l?1:o-n+1;l+a>("row"===e?g:m)||Jr(()=>lt(r=>y(r,Lt,e,t?o+1:n,a)))},[Ot.colCount,Ot.rowCount,lt,Lt,Jr,Wt]),dn=ge(e=>{const{range:t}=Wt,[r,n]="row"===e?[t.r1,t.r2]:[t.c1,t.c2],o="row"===e?Ot.rowCount:Ot.colCount,l=Math.min(n-r+1,o-1);l<1||Jr(()=>{lt(t=>y(t,Lt,e,r,-l)),Fr({row:"row"===e?Math.min(r,o-l-1):Wt.active.row,col:"col"===e?Math.min(r,o-l-1):Wt.active.col})})},[Ot.colCount,Ot.rowCount,lt,Lt,Jr,Fr,Wt]),fn=ge(e=>{const{range:t}=Wt;Jr(()=>Rr(r=>{if("row"===e){const e=new Set(r.hiddenRows);for(let r=t.r1;r<=t.r2;r++)e.add(r);return{...r,hiddenRows:[...e]}}const n=new Set(r.hiddenCols);for(let e=t.c1;e<=t.c2;e++)n.add(e);return{...r,hiddenCols:[...n]}}))},[Jr,Wt,Rr]),hn=ge(e=>{Jr(()=>Rr(t=>"row"===e?{...t,hiddenRows:[]}:{...t,hiddenCols:[]}))},[Jr,Rr]),mn=ge(e=>{Jr(()=>Rr(t=>{const r=Wt.range.r1===Wt.range.r2&&Wt.range.c1===Wt.range.c2,n=0===Wt.range.r1&&Wt.range.r2===t.rowCount-1;let o=r?R(t,Wt.range):Wt.range;return n&&(o={...o,r2:Math.max(o.r1,ue(t)?.row??0)}),t.filter&&Q(t.filter.range,Wt.active.row,Wt.active.col)&&(o={...t.filter.range,r1:t.filter.range.r1+1}),ae(t,Lt,Pt,o,Wt.active.col,e)}))},[Pt,Lt,Jr,Wt,Rr]),gn=ge(()=>{ir(null),Jr(()=>Rr(e=>{if(e.filter)return{...e,filter:null};const t=R(e,Wt.range);return t.r1===t.r2?e:{...e,filter:{range:t,excluded:{}}}}))},[Jr,Wt.range,Rr]),pn=ge(()=>{Jr(()=>Rr(e=>e.merges.some(e=>Q(Wt.range,e.r1,e.c1))?ce(e,Wt.range):B(e,Wt.range)))},[Jr,Wt.range,Rr]),vn=ge((e,t)=>{Jr(()=>Rr(r=>({...r,frozenRows:e??r.frozenRows,frozenCols:t??r.frozenCols})))},[Jr,Rr]),wn=ge(e=>{const{range:t,active:r}=Wt,n=t.r1===t.r2&&t.c1===t.c2;let o="";if(n){const e=(e,t)=>"number"==typeof Pt.value(Lt,e,t);let t=r.row;for(;t>0&&e(t-1,r.col);)t--;let n=r.col;for(;n>0&&e(r.row,n-1);)n--;t<r.row?o=Z({r1:t,c1:r.col,r2:r.row-1,c2:r.col}):n<r.col&&(o=Z({r1:r.row,c1:n,r2:r.row,c2:r.col-1}))}else o=Z(t);const l=n?r:{row:t.r2+1,col:t.c1};Br(),n||Fr(l);const a=`=${e}(${o})`;Ur.current=a.length-1,$r(l,{text:a})},[Br,Pt,Lt,Fr,Wt,$r]),xn=ge((e,t)=>{const r=Wt.range,n={...r,r2:Math.min(r.r2,Math.max(r.r1,Ot.cells.length-1))},o=S(Ot,Lt,Pt,n,e);Jt(o),t?(t.preventDefault(),t.clipboardData.setData("text/plain",o.text)):navigator.clipboard?.writeText(o.text).catch(()=>{})},[Ot,Pt,Lt,Wt.range]),bn=ge((e,t)=>{const{range:r}=Wt;if(qt&&qt.text===e){if(qt.cut){const e=tt.current.findIndex(e=>e.id===qt.sheetId);if(e<0)return;let t=null;return lt(n=>{const o=H(n,e,qt,Lt,r);return t=o.range,o.sheets}),t&&Vt({active:{row:t.r1,col:t.c1},range:t}),void Jt(null)}return void Rr(e=>{const n=j(e,qt,r,t);return Vt({active:Wt.active,range:n.range}),n.sheet})}if(!e)return;const n=function(e){const t=e.replace(/\r\n?/g,"\n").replace(/\n$/,"");if(!t.includes("\t")&&!t.includes("\n"))return[[t]];if(!t.includes('"'))return t.split("\n").map(e=>e.split("\t"));const r=Y(t.includes("\t")?t:`${t}\t`);return r.length?r:[[t]]}(e);Rr(e=>{let t=e;n.forEach((e,n)=>e.forEach((e,o)=>{t=E(t,r.r1+n,r.c1+o,e)}));const o=n.reduce((e,t)=>Math.max(e,t.length),1);return Vt({active:Wt.active,range:{r1:r.r1,c1:r.c1,r2:r.r1+n.length-1,c2:r.c1+o-1}}),t})},[qt,lt,Lt,Wt,Vt,Rr]),yn=ge(e=>{Jr(()=>{const t=navigator.clipboard?.readText?.();t?t.then(t=>bn(t,e)).catch(()=>{qt&&bn(qt.text,e)}):qt&&bn(qt.text,e)})},[qt,bn,Jr]);Mr.current=()=>Zt.current?(Kr(),!0):ar?(ir(null),Dr(),!0):ur?(dr(null),Dr(),!0):cr?(sr(!1),Dr(),!0):null!==fr?(hr(null),Dr(),!0):mr?(gr(!1),Dr(),!0):!(!qt&&!or)&&(Jt(null),lr(null),!0);const Cn=Ze||x.spreadsheetFile,kn=ge(async()=>{Br();try{const e=tt.current;Nt(await n(e,$(e)),"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",`${Cn}.xlsx`),st.current=e,ot(e=>e+1)}catch{Xe.error(x.saveFailed)}},[Br,Cn,x]),Nn=()=>{const e=tt.current,t=Math.min(Xt.current,e.length-1);return ne(e[t],t,$(e))},En=async n=>{const o=n.name.replace(/\.(csv|tsv|txt|xlsx|xls|ods)$/i,"");try{if(Br(),/\.(xlsx|xls|ods)$/i.test(n.name)){const e=new Uint8Array(await n.arrayBuffer()),o=/\.xlsx$/i.test(n.name)&&"undefined"!=typeof DecompressionStream?await r(e):await t(e);lt(()=>o),Qe(0)}else{const e=Y(await n.text());if(!e.length)return;Rr(t=>({...oe(t.name,e),id:t.id}))}e||qe(o)}catch{Xe.error(x.openFailed)}};pe(()=>{o&&En(o)},[]);const Sn=ve(()=>mr?L(Ot,Lt,Pt,pr,br):[],[Ot,Pt,mr,br,pr,Lt]),Dn=Sn.findIndex(e=>e.row===Wt.active.row&&e.col===Wt.active.col),Rn=e=>{if(!Sn.length)return;const t=Dn<0?e>0?0:Sn.length-1:(Dn+e+Sn.length)%Sn.length;Fr(Sn[t])},Tn=()=>{Br();const e=Lt+1;lt(t=>{const r=X(t,x.sheetBase);return[...t.slice(0,e),W(r),...t.slice(e)]}),Qe(e),Dr()},Mn=()=>{if(!ur)return;const{index:e,name:t}=ur;dr(null);const r=t.trim();r&&r!==Fe[e]?.name&&(Fe.some((t,n)=>n!==e&&t.name.toLowerCase()===r.toLowerCase())?Xe.error(x.sheetNameTaken):lt(t=>ee(t,e,r)))},An=(e,t)=>{const r=e+t;r<0||r>=Fe.length||(lt(t=>{const n=[...t],[o]=n.splice(e,1);return n.splice(r,0,o),n}),e===Lt?Qe(r):r===Lt&&Qe(e))},zn=ge(e=>{Zt.current&&Br(),Vt(e),or&&(Rr(t=>se(t,e.range,()=>or)),lr(null))},[Br,or,Vt,Rr]),Fn=ge((e,t,r)=>{"cell"!==t||Q(Wt.range,r.row,r.col)?"col"!==t||0===Wt.range.r1&&Wt.range.r2===Ot.rowCount-1&&r.col>=Wt.range.c1&&r.col<=Wt.range.c2?"row"!==t||0===Wt.range.c1&&Wt.range.c2===Ot.colCount-1&&r.row>=Wt.range.r1&&r.row<=Wt.range.r2||Vt({active:{row:r.row,col:0},range:{r1:r.row,c1:0,r2:r.row,c2:Ot.colCount-1}}):Vt({active:{row:0,col:r.col},range:{r1:0,c1:r.col,r2:Ot.rowCount-1,c2:r.col}}):Fr(r),Er.open(e,{kind:t,pos:r})},[Ot.colCount,Ot.rowCount,Er,Fr,Wt.range,Vt]),In=ge((e,t)=>{if(!Ot.filter)return;const r=N(Ot,Lt,Pt,Ot.filter.range,e);ir({col:e,x:t.left,y:t.bottom+2,values:r,unticked:new Set(Ot.filter.excluded[e]??[]),search:""})},[Ot,Pt,Lt]),Ln=(e,t)=>{ir(null),Jr(()=>Rr(r=>{if(!r.filter)return r;const{range:n}=r.filter;return ae(r,Lt,Pt,{...n,r1:n.r1+1},e,t)}))},On=ve(()=>{const{range:e}=Wt;return e.r1===e.r2&&e.c1===e.c2?null:re(Ot,Lt,Pt,e,Ut)},[Ot,Pt,Ut,Lt,Wt]),Pn=e=>P(Number(e.toPrecision(12)),On?.firstFormat??"#,##0.##").text,Un=(e,t)=>bt("span",{className:"flex w-full items-center justify-between gap-6",children:[xt("span",{children:e}),xt("span",{className:"text-xs text-ink-faint",children:t})]}),$n=(e,t,r,n={})=>({key:e,label:t,onSelect:r,...n}),Bn=e=>({type:"divider",key:e}),Kn=[{key:"general",label:x.formatGeneral,code:p.general},{key:"number",label:x.formatNumber,code:p.number},{key:"percent",label:x.formatPercent,code:p.percent},{key:"scientific",label:x.formatScientific,code:p.scientific},{key:"currency",label:x.formatCurrency,code:p.currency},{key:"date",label:x.formatDate,code:p.date},{key:"time",label:x.formatTime,code:p.time},{key:"dateTime",label:x.formatDateTime,code:p.dateTime},{key:"text",label:x.formatText,code:p.text}].map(e=>({type:"radio",key:e.key,label:e.label,checked:(Gt.numFmt??"General")===e.code,onSelect:()=>cn(e.code)})),Hn=[["all",x.bordersAll],["outer",x.bordersOuter],["top",x.bordersTop],["bottom",x.bordersBottom],["left",x.bordersLeft],["right",x.bordersRight],["none",x.bordersNone]].map(([e,t])=>$n(e,t,()=>Jr(()=>Rr(t=>w(t,Wt.range,e))))),Wn=[...["left","center","right"].map(e=>({type:"radio",key:e,label:"left"===e?x.alignLeft:"center"===e?x.alignCenter:x.alignRight,checked:Gt.align===e,onSelect:()=>ln(t=>de(t,"align",e))})),Bn("v"),...["top","middle","bottom"].map(e=>({type:"radio",key:e,label:"top"===e?x.alignTop:"middle"===e?x.alignMiddle:x.alignBottom,checked:(Gt.vAlign??"bottom")===e,onSelect:()=>ln(t=>de(t,"vAlign",e))}))],Xn=yt.map(e=>({type:"radio",key:String(e),label:String(e),checked:(Gt.fontSize??d)===e,onSelect:()=>ln(t=>de(t,"fontSize",e===d?void 0:e))})),Vn=["SUM","AVERAGE","COUNT","MAX","MIN"].map(e=>$n(e,e,()=>wn(e))),Yn=[...[0,1,2].map(e=>({type:"radio",key:`r${e}`,label:x.freezeRows(e),checked:Ot.frozenRows===e,onSelect:()=>vn(e,null)})),{type:"radio",key:"rUp",label:x.freezeUpToRow(Yt.row+1),checked:Ot.frozenRows===Yt.row+1&&Yt.row>1,onSelect:()=>vn(Yt.row+1,null)},Bn("c"),...[0,1,2].map(e=>({type:"radio",key:`c${e}`,label:x.freezeColumns(e),checked:Ot.frozenCols===e,onSelect:()=>vn(null,e)})),{type:"radio",key:"cUp",label:x.freezeUpToColumn(b(0,Yt.col).replace(/\d+$/,"")),checked:Ot.frozenCols===Yt.col+1&&Yt.col>1,onSelect:()=>vn(null,Yt.col+1)}],Gn=[...e?[]:[$n("new",x.menuNew,()=>Jr(()=>{lt(()=>[W(x.sheetName(1))]),Qe(0),qe(x.untitled)}))],$n("open",x.menuOpen,()=>Bt.current?.click()),Bn("a"),$n("xlsx",Un(x.saveExcel,`${kt}S`),()=>{kn()}),$n("csv",x.saveCsv,()=>Jr(()=>Nt(Nn(),"text/csv",`${Cn}.csv`))),...Je?[Bn("b"),$n("email",x.email,()=>Jr(()=>Je(Nn(),`${Cn}.csv`)))]:[],...!e&&h?.onSaveToFiles?[Bn("c"),$n("keep",x.saveToFiles,()=>Jr(()=>h.onSaveToFiles?.(Ze.trim()||x.untitled,tt.current)))]:[]],jn=[$n("undo",Un(x.undo,`${kt}Z`),()=>Jr(it),{disabled:0===rt.current.length}),$n("redo",Un(x.redo,Ct?"⇧⌘Z":"Ctrl+Y"),()=>Jr(ct),{disabled:0===nt.current.length}),Bn("a"),$n("cut",Un(x.cut,`${kt}X`),()=>Jr(()=>xn(!0))),$n("copy",Un(x.copy,`${kt}C`),()=>Jr(()=>xn(!1))),$n("paste",Un(x.paste,`${kt}V`),()=>yn("all")),$n("pasteValues",x.pasteValues,()=>yn("values")),$n("pasteFormats",x.pasteFormats,()=>yn("formats")),Bn("b"),$n("find",Un(x.findReplace,`${kt}F`),()=>{gr(!0),setTimeout(()=>Nr.current?.focus(),0)}),$n("clear",Un(x.clearValues,"Delete"),()=>Jr(()=>Rr(e=>C(e,Wt.range))))],_n=[{type:"submenu",key:"freeze",label:x.freeze,items:Yn},{type:"checkbox",key:"gridlines",label:x.gridlines,checked:er,onSelect:()=>tr(e=>!e)},{type:"checkbox",key:"formulas",label:Un(x.showFormulas,`${kt}\``),checked:rr,onSelect:()=>nr(e=>!e)}],Qn=[$n("rowAbove",x.rowsAbove,()=>un("row",!1)),$n("rowBelow",x.rowsBelow,()=>un("row",!0)),$n("colLeft",x.columnsLeft,()=>un("col",!1)),$n("colRight",x.columnsRight,()=>un("col",!0)),Bn("a"),$n("sheet",x.sheet,Tn),{type:"submenu",key:"fn",label:x.function,items:Vn}],Zn=[{type:"submenu",key:"number",label:x.number,items:Kn},Bn("a"),$n("bold",Un(x.bold,`${kt}B`),()=>an("bold")),$n("italic",Un(x.italic,`${kt}I`),()=>an("italic")),$n("underline",Un(x.underline,`${kt}U`),()=>an("underline")),$n("strike",x.strikethrough,()=>an("strike")),{type:"submenu",key:"size",label:x.fontSize,items:Xn},Bn("b"),{type:"submenu",key:"align",label:x.alignment,items:Wn},{type:"submenu",key:"borders",label:x.borders,items:Hn},$n("wrap",x.wrapText,()=>an("wrap")),$n("merge",x.mergeCells,pn),Bn("c"),$n("clearFormat",x.clearFormatting,()=>Jr(()=>Rr(e=>se(e,Wt.range,()=>({})))))],qn=[$n("asc",x.sortAscending,()=>mn(!0)),$n("desc",x.sortDescending,()=>mn(!1)),Bn("a"),{type:"checkbox",key:"filter",label:x.filter,checked:!!Ot.filter,onSelect:gn},Bn("b"),$n("hideRows",x.hideRows,()=>fn("row")),$n("hideCols",x.hideColumns,()=>fn("col")),$n("unhideRows",x.unhideRows,()=>hn("row"),{disabled:!Ot.hiddenRows.length}),$n("unhideCols",x.unhideColumns,()=>hn("col"),{disabled:!Ot.hiddenCols.length})],Jn="rounded px-2 py-0.5 text-xs text-ink-muted hover:bg-line-subtle hover:text-ink",eo="inline-flex h-7 items-center gap-1 rounded px-2 text-xs text-ink-muted hover:bg-line-subtle hover:text-ink",to=xt("div",{className:"mx-1 h-4 w-px bg-line"}),ro=e=>e.preventDefault(),no=(e,t,r,n={})=>xt(Ie,{"aria-label":e,title:e,size:"sm",variant:"ghost",onMouseDown:ro,onClick:r,disabled:n.disabled,...void 0!==n.pressed?{"aria-pressed":n.pressed}:{},children:t}),oo=(e,t,r)=>xt(Pe,{triggerLabel:e,align:"start",triggerClassName:"inline-flex h-7 w-7 flex-col items-center justify-center rounded text-ink-muted hover:bg-line-subtle hover:text-ink",trigger:bt(wt,{children:[t,xt("span",{className:"h-0.5 w-4 rounded-sm",style:{background:Gt[r]??("color"===r?"var(--ink)":"var(--line)")}})]}),children:({close:t})=>xt(Me,{label:e,value:Gt[r]??"",presets:ht,clearable:!0,dragWrites:"end",onChange:e=>{ln(t=>de(t,r,e||void 0)),t()}})}),lo=e=>{if(!_t||!Xr||_t.inBar)return null;const t=Ot.formats[O(_t.row,_t.col)],r=(t?.fontSize??d)*(4/3),n=Math.min(Math.max(e.width,_t.text.length*r*.62+16),e.viewportWidth-e.x-4);return xt("textarea",{ref:kr,"aria-label":x.cellEditor,value:_t.text,spellCheck:!1,rows:1,onChange:e=>Wr(e.target.value,e.target.selectionStart),onSelect:qr,onKeyDown:Zr,onPointerDown:e=>e.stopPropagation(),className:"absolute resize-none overflow-hidden border-2 border-accent-fill bg-surface text-ink outline-none",style:{left:e.x,top:e.y,width:n,minHeight:e.height,height:Math.max(e.height,_t.text.split("\n").length*r*1.35+6),padding:"0 2px",fontSize:r,lineHeight:1.3,fontWeight:t?.bold?700:void 0,fontStyle:t?.italic?"italic":void 0,background:t?.fill??void 0,color:t?.color??void 0}})},ao=e=>{if(!_t||!Xr)return null;const t=e.y+e.height+2,r=Math.max(0,Math.min(e.x,e.viewportWidth-320));if(Vr)return bt("div",{role:"listbox","aria-label":x.functions,className:"absolute w-80 overflow-hidden rounded-lg border border-line bg-surface shadow-lg",style:{left:r,top:t},onPointerDown:e=>e.preventDefault(),children:[Vr.matches.map((e,t)=>bt("div",{role:"option","aria-selected":t===_t.suggestion,onPointerDown:t=>{t.preventDefault(),t.stopPropagation(),Qr(e)},className:"flex cursor-pointer items-center justify-between gap-3 px-2 py-1 text-xs "+(t===_t.suggestion?"bg-accent-tint text-accent-text":"text-ink hover:bg-surface-sunken"),children:[xt("span",{className:"font-medium",children:e}),xt("span",{className:"truncate "+(t===_t.suggestion?"text-accent-text":"text-ink-muted"),children:x.functionHelp(e)})]},e)),bt("div",{className:"border-t border-line px-2 py-1 font-mono text-xs text-ink-muted",children:[Vr.matches[_t.suggestion],"(",vt[Vr.matches[_t.suggestion]]??"",")"]})]});if(Yr&&void 0!==vt[Yr.name]){const e=vt[Yr.name].split(", ");return bt("div",{className:"absolute max-w-md rounded-lg border border-line bg-surface px-2 py-1 text-xs text-ink-muted shadow-lg",style:{left:r,top:t},children:[bt("div",{className:"font-mono",children:[Yr.name,"(",e.map((t,r)=>bt("span",{children:[r>0?", ":"",xt("span",{className:r===Math.min(Yr.argIndex,e.length-1)?"font-semibold text-ink":"",children:t})]},t+r)),")"]}),xt("div",{className:"mt-0.5",children:x.functionHelp(Yr.name)})]})}return null},io=ar?ar.values.filter(e=>e.toLowerCase().includes(ar.search.toLowerCase())):[];return bt("div",{ref:Tr,className:"flex h-full flex-col bg-surface text-ink",children:[!h&&xt(Ne,{title:`${uo=Ze||x.untitled,uo.length>24?`${uo.slice(0,23)}…`:uo} - Spreadsheets`}),xt("input",{ref:Bt,type:"file",accept:Et,onChange:e=>{const t=e.target.files?.[0];Bt.current&&(Bt.current.value=""),t&&En(t)},className:"hidden"}),bt("div",{className:"flex shrink-0 items-center gap-1 border-b border-line bg-surface-sunken px-2 py-1",children:[s&&xt(Ie,{"aria-label":x.backToFiles,title:x.backToFiles,size:"sm",variant:"ghost",onClick:()=>{zt(),s()},children:xt(De,{name:"arrow-left",size:16})}),cr?xt("input",{type:"text",value:Ze,autoFocus:!0,"aria-label":x.rename,onChange:e=>qe(e.target.value),onBlur:()=>{sr(!1);const t=Ze.trim()||x.untitled;if(t!==Ze&&qe(t),e&&t!==dt.current){const r=dt.current;dt.current=t,e.store.rename(e.id,t).catch(()=>{Xe.error(x.renameFailed),dt.current=r,qe(r)})}},onKeyDown:e=>{"Enter"===e.key&&(e.currentTarget.blur(),Dr())},className:"w-40 rounded border border-line bg-surface px-2 py-0.5 text-sm font-medium text-ink"}):xt("button",{type:"button",onClick:()=>sr(!0),title:x.rename,className:"max-w-[200px] truncate rounded px-2 py-0.5 text-sm font-medium text-ink hover:bg-line-subtle",children:Ze||x.untitled}),xt(ze,{trigger:x.menuFile,items:Gn,align:"start",triggerClassName:Jn}),xt(ze,{trigger:x.menuEdit,items:jn,align:"start",triggerClassName:Jn}),xt(ze,{trigger:x.menuView,items:_n,align:"start",triggerClassName:Jn}),xt(ze,{trigger:x.menuInsert,items:Qn,align:"start",triggerClassName:Jn}),xt(ze,{trigger:x.menuFormat,items:Zn,align:"start",triggerClassName:Jn}),xt(ze,{trigger:x.menuData,items:qn,align:"start",triggerClassName:Jn}),(e||l)&&xt("span",{className:"office-save-state",children:xt(Ce,{...e?be(Tt.state,Rt.save):{tone:Fe!==st.current?"off-unsaved":"off",label:Fe!==st.current?x.noStoreEdited:x.noStoreClean}})})]}),St&&bt("div",{className:"office-conflict",role:"alert",children:[xt("span",{children:x.conflict}),xt(Re,{variant:"secondary",onClick:u,children:x.reload})]}),bt("div",{className:"flex shrink-0 flex-wrap items-center gap-0.5 border-b border-line bg-surface-sunken px-2 py-1",children:[no(x.undo,xt(De,{name:"undo",size:16}),()=>Jr(it),{disabled:0===rt.current.length}),no(x.redo,xt(De,{name:"redo",size:16}),()=>Jr(ct),{disabled:0===nt.current.length}),no(x.formatPainter,xt(De,{name:"copy-style",size:16}),()=>lr(e=>e?null:Gt),{pressed:!!or}),to,no(x.formatCurrency,xt(De,{name:"dollar",size:16}),()=>cn(Gt.numFmt===p.currency?"General":p.currency),{pressed:Gt.numFmt===p.currency}),no(x.formatPercent,xt(De,{name:"percent",size:16}),()=>cn(/%/.test(Gt.numFmt??"")?"General":"0%"),{pressed:/%/.test(Gt.numFmt??"")}),no(x.fewerDecimals,xt("span",{className:"text-xs",children:".0"}),()=>sn(-1)),no(x.moreDecimals,xt("span",{className:"text-xs",children:".00"}),()=>sn(1)),xt(ze,{trigger:bt("span",{title:x.number,className:"flex items-center gap-0.5",children:["123",xt(De,{name:"chevron-down",size:12})]}),"aria-label":x.number,items:Kn,align:"start",triggerClassName:eo}),to,xt(ze,{trigger:bt("span",{title:x.fontSize,className:"flex items-center gap-0.5",children:[Gt.fontSize??d,xt(De,{name:"chevron-down",size:12})]}),"aria-label":x.fontSize,items:Xn,align:"start",triggerClassName:eo}),no(x.bold,xt(De,{name:"bold",size:16}),()=>an("bold"),{pressed:!!Gt.bold}),no(x.italic,xt(De,{name:"italic",size:16}),()=>an("italic"),{pressed:!!Gt.italic}),no(x.underline,xt(De,{name:"underline",size:16}),()=>an("underline"),{pressed:!!Gt.underline}),no(x.strikethrough,xt(De,{name:"strike",size:16}),()=>an("strike"),{pressed:!!Gt.strike}),oo(x.textColor,xt(De,{name:"text-color",size:14}),"color"),oo(x.fillColor,xt(De,{name:"palette",size:14}),"fill"),to,xt(ze,{trigger:bt("span",{title:x.borders,className:"flex items-center gap-0.5",children:[xt(De,{name:"border-all",size:16}),xt(De,{name:"chevron-down",size:12})]}),"aria-label":x.borders,items:Hn,align:"start",triggerClassName:eo}),no(x.mergeCells,xt(De,{name:"grid",size:16}),pn,{pressed:Ot.merges.some(e=>Q(e,Yt.row,Yt.col))}),xt(ze,{trigger:bt("span",{title:x.alignment,className:"flex items-center gap-0.5",children:["center"===Gt.align?xt(De,{name:"align-center",size:16}):"right"===Gt.align?xt(De,{name:"align-right",size:16}):xt(De,{name:"align-left",size:16}),xt(De,{name:"chevron-down",size:12})]}),"aria-label":x.alignment,items:Wn,align:"start",triggerClassName:eo}),no(x.wrapText,xt(De,{name:"wrap",size:16}),()=>an("wrap"),{pressed:!!Gt.wrap}),to,no(x.filter,xt(De,{name:"filter",size:16}),gn,{pressed:!!Ot.filter}),no(x.sortAscending,xt(De,{name:"sort",size:16}),()=>mn(!0)),xt(ze,{trigger:bt("span",{title:x.functions,className:"flex items-center gap-0.5 text-sm",children:["Σ",xt(De,{name:"chevron-down",size:12})]}),"aria-label":x.functions,items:Vn,align:"end",triggerClassName:eo})]}),bt("div",{className:"flex shrink-0 items-start gap-1 border-b border-line bg-surface px-2 py-1",children:[xt("input",{type:"text","aria-label":x.nameBox,spellCheck:!1,value:fr??(_t&&Xr?b(_t.row,_t.col):Z(Wt.range)),onFocus:e=>{hr(e.target.value),e.target.select()},onChange:e=>hr(e.target.value),onBlur:()=>hr(null),onKeyDown:e=>{if("Enter"===e.key){const e=G(fr??"");e&&e.r2<Ot.rowCount&&e.c2<Ot.colCount&&(Vt({active:{row:e.r1,col:e.c1},range:z(Ot,e)}),$t.current?.scrollTo({row:e.r1,col:e.c1})),hr(null),Dr()}},className:"w-20 shrink-0 rounded border border-line bg-surface px-2 py-0.5 text-center text-xs text-ink"}),xt("span",{className:"select-none pt-0.5 font-serif text-sm italic text-ink-faint","aria-hidden":"true",children:"fx"}),xt("textarea",{ref:Cr,"aria-label":x.formulaBar,spellCheck:!1,rows:1,value:_t?_t.text:A(jt,Gt),onFocus:()=>{_t?_t.inBar||Qt({..._t,inBar:!0}):$r(Yt,{inBar:!0,mode:"edit"})},onChange:e=>{_t&&Wr(e.target.value,e.target.selectionStart)},onSelect:qr,onKeyDown:Zr,className:"max-h-24 min-h-[22px] flex-1 resize-y rounded border border-line bg-surface px-2 py-0.5 font-mono text-xs text-ink outline-none focus:border-accent-fill"})]}),mr&&bt("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-line bg-surface-sunken px-2 py-1 text-xs",children:[xt("div",{className:"w-44",children:xt(Le,{ref:Nr,size:"sm","aria-label":x.find,placeholder:x.find,value:pr,onChange:e=>vr(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),Rn(e.shiftKey?-1:1))}})}),xt("span",{className:"w-16 text-center text-ink-muted",children:pr?x.hitCount(Dn<0?0:Dn+1,Sn.length):""}),no(x.previous,xt(De,{name:"arrow-up",size:14}),()=>Rn(-1)),no(x.next,xt(De,{name:"arrow-down",size:14}),()=>Rn(1)),xt("div",{className:"w-44",children:xt(Le,{size:"sm","aria-label":x.replaceWith,placeholder:x.replaceWith,value:wr,onChange:e=>xr(e.target.value)})}),xt(Re,{size:"sm",variant:"secondary",disabled:!Sn.length,onClick:()=>{if(Dn<0)return void Rn(1);const{row:e,col:t}=Sn[Dn];Rr(r=>{const n=te(q(r,e,t),pr,wr,br);return n===q(r,e,t)?r:fe(r,[{row:e,col:t,raw:n}])}),Rn(1)},children:x.replace}),xt(Re,{size:"sm",variant:"secondary",disabled:!Sn.length,onClick:()=>{let e=0;Rr(t=>{const r=[];for(const{row:e,col:n}of Sn){const o=te(q(t,e,n),pr,wr,br);o!==q(t,e,n)&&r.push({row:e,col:n,raw:o})}return e=r.length,fe(t,r)}),Xe.success(x.replacedCount(e))},children:x.replaceAll}),xt(Te,{label:x.matchCase,checked:br.matchCase,onChange:e=>yr(t=>({...t,matchCase:e}))}),xt(Te,{label:x.wholeCell,checked:br.wholeCell,onChange:e=>yr(t=>({...t,wholeCell:e}))}),xt(Te,{label:x.inFormulas,checked:br.inFormulas,onChange:e=>yr(t=>({...t,inFormulas:e}))}),xt("div",{className:"ml-auto",children:no(x.close,xt(De,{name:"close",size:14}),()=>{gr(!1),Dr()})})]}),xt("div",{className:"min-h-0 flex-1",children:xt(ft,{ref:$t,sheet:Ot,sheetIndex:Lt,evaluator:Pt,filterHidden:Ut,selection:Wt,showGridlines:er,showFormulas:rr,clipRange:qt&&qt.sheetId===Ot.id?qt.range:null,highlights:jr,pointing:Gr,onSelect:zn,onPoint:_r,onEdit:e=>{Br(),Fr(e),$r(K(Ot,e.row,e.col)?{row:K(Ot,e.row,e.col).r1,col:K(Ot,e.row,e.col).c1}:e)},onFill:e=>{const t=Wt.range;Rr(r=>F(r,t,e)),Vt({active:Wt.active,range:e})},onResizeCol:(e,t)=>Rr(r=>{const{range:n}=Wt,o=0===n.r1&&n.r2===r.rowCount-1&&e>=n.c1&&e<=n.c2,l={...r.colWidths};if(o)for(let e=n.c1;e<=n.c2;e++)l[e]=t;else l[e]=t;return{...r,colWidths:l}}),onResizeRow:(e,t)=>Rr(r=>({...r,rowHeights:{...r.rowHeights,[e]:t}})),onAutoFitCol:e=>{const t=Math.max(40,$t.current?.measureColumn(e)??0);Rr(r=>({...r,colWidths:{...r.colWidths,[e]:t}}))},onAutoFitRow:e=>Rr(t=>{const r={...t.rowHeights};return delete r[e],{...t,rowHeights:r}}),onHeaderMenu:Fn,onFilterButton:In,renderEditor:e=>bt(wt,{children:[lo(e),ao(e)]}),onKeyDown:t=>{if(_t)return;const r=t.ctrlKey||t.metaKey,n=t.key,o=n.toLowerCase(),l="ArrowUp"===n?[-1,0]:"ArrowDown"===n?[1,0]:"ArrowLeft"===n?[0,-1]:"ArrowRight"===n?[0,1]:null;if(l){t.preventDefault();const e=t.shiftKey?Pr():Wt.active,n=r?Lr(e,l[0],l[1]):Ir(e,l[0],l[1]);return void(t.shiftKey?Or(n):Fr(n))}if("Tab"===n||"Enter"===n){if(t.preventDefault(),"Enter"===n&&r)return;const e=Wt.range.r1!==Wt.range.r2||Wt.range.c1!==Wt.range.c2,o="Enter"===n?t.shiftKey?-1:1:0,l="Tab"===n?t.shiftKey?-1:1:0;if(e){const{range:e}=Wt;let{row:t,col:r}=Wt.active;return t+=o,r+=l,r>e.c2&&(r=e.c1,t=t+1>e.r2?e.r1:t+1),r<e.c1&&(r=e.c2,t=t-1<e.r1?e.r2:t-1),t>e.r2&&(t=e.r1,r=r+1>e.c2?e.c1:r+1),t<e.r1&&(t=e.r2,r=r-1<e.c1?e.c2:r-1),Vt({active:{row:t,col:r},range:e}),void $t.current?.scrollTo({row:t,col:r})}return void Fr(Ir(Wt.active,o,l))}if("Home"===n)return t.preventDefault(),void Fr(r?{row:Ot.frozenRows,col:Ot.frozenCols}:{row:Wt.active.row,col:0});if("End"===n){t.preventDefault();const e=ue(Ot);return void Fr(r?{row:e?.row??0,col:e?.col??0}:{row:Wt.active.row,col:Math.max(0,(Ot.cells[Wt.active.row]?.length??1)-1)})}if("PageDown"===n||"PageUp"===n){t.preventDefault();const e="PageDown"===n?25:-25;return void Fr({row:Math.max(0,Math.min(Ot.rowCount-1,Wt.active.row+e)),col:Wt.active.col})}if("Delete"===n||"Backspace"===n)return t.preventDefault(),void Rr(e=>C(e,Wt.range));if("F2"===n)return t.preventDefault(),void $r(Wt.active);if(" "===n&&(r||t.shiftKey))return t.preventDefault(),void Vt(r?{active:Wt.active,range:{r1:0,c1:Wt.range.c1,r2:Ot.rowCount-1,c2:Wt.range.c2}}:{active:Wt.active,range:{r1:Wt.range.r1,c1:0,r2:Wt.range.r2,c2:Ot.colCount-1}});if(!r)return!t.altKey||"="!==n&&"≠"!==n?1!==n.length||t.altKey?void("Process"!==n&&229!==t.keyCode||$r(Wt.active,{text:""})):(t.preventDefault(),void $r(Wt.active,{text:n})):(t.preventDefault(),void wn("SUM"));switch(o){case"z":return t.preventDefault(),void(t.shiftKey?ct():it());case"y":return t.preventDefault(),void ct();case"a":return t.preventDefault(),void Vt({active:Wt.active,range:{r1:0,c1:0,r2:Ot.rowCount-1,c2:Ot.colCount-1}});case"b":return t.preventDefault(),void an("bold");case"i":return t.preventDefault(),void an("italic");case"u":return t.preventDefault(),void an("underline");case"f":case"h":return t.preventDefault(),gr(!0),void setTimeout(()=>Nr.current?.focus(),0);case"s":return t.preventDefault(),void(e?zt():kn());case"d":{t.preventDefault();const{range:e}=Wt;return void(e.r2>e.r1?Rr(t=>F(t,{...e,r2:e.r1},e)):e.r1>0&&Rr(t=>F(t,{...e,r1:e.r1-1,r2:e.r1-1},{...e,r1:e.r1-1})))}case"r":{t.preventDefault();const{range:e}=Wt;return void(e.c2>e.c1?Rr(t=>F(t,{...e,c2:e.c1},e)):e.c1>0&&Rr(t=>F(t,{...e,c1:e.c1-1,c2:e.c1-1},{...e,c1:e.c1-1})))}case";":return t.preventDefault(),void Rr(e=>E(e,Wt.active.row,Wt.active.col,We(new Date)));case"`":return t.preventDefault(),void nr(e=>!e)}if(t.shiftKey){if("$"===n||"4"===n)return t.preventDefault(),void cn(p.currency);if("%"===n||"5"===n)return t.preventDefault(),void cn("0%")}},onCopy:e=>{_t||xn(!1,e)},onCut:e=>{_t||xn(!0,e)},onPaste:e=>{_t||(e.preventDefault(),bn(e.clipboardData.getData("text/plain"),"all"))}})}),bt("div",{className:"flex shrink-0 items-center border-t border-line bg-surface-sunken",children:[bt("div",{className:"flex min-w-0 flex-1 items-center gap-0.5 overflow-x-auto px-1 py-1",children:[xt(Ie,{"aria-label":x.addSheet,title:x.addSheet,size:"sm",variant:"ghost",onClick:Tn,children:xt(De,{name:"add",size:14})}),Fe.map((e,t)=>xt("button",{type:"button",onClick:()=>(e=>{_t&&!Gr&&Br(),Qe(e),ir(null)})(t),onDoubleClick:()=>dr({index:t,name:e.name}),onContextMenu:e=>Sr.open(e,t),style:e.tabColor?{boxShadow:`inset 0 -3px 0 ${e.tabColor}`}:void 0,className:"whitespace-nowrap rounded px-3 py-1 text-xs font-medium "+(t===Lt?"bg-accent-tint text-accent-text":"text-ink-muted hover:bg-line-subtle hover:text-ink"),children:ur?.index===t?xt("input",{type:"text",value:ur.name,autoFocus:!0,"aria-label":x.rename,onChange:e=>dr({index:t,name:e.target.value}),onBlur:Mn,onKeyDown:e=>{e.stopPropagation(),"Enter"===e.key&&Mn()},onClick:e=>e.stopPropagation(),className:"w-24 rounded border border-accent-fill bg-surface px-1 text-xs text-ink outline-none"}):e.name},e.id))]}),On&&On.count>0&&bt("div",{className:"flex shrink-0 items-center gap-3 border-l border-line px-3 py-1 text-xs text-ink-muted",children:[On.numbers>0&&bt("span",{children:[x.statSum,": ",Pn(On.sum)]}),null!==On.average&&bt("span",{children:[x.statAverage,": ",Pn(On.average)]}),bt("span",{children:[x.statCount,": ",On.count]}),On.numbers>0&&bt("span",{children:[x.statMin,": ",Pn(On.min)]}),On.numbers>0&&bt("span",{children:[x.statMax,": ",Pn(On.max)]})]})]}),Er.state&&xt(Ae,{...Er.props,items:(so=Er.state.data.kind,[$n("cut",x.cut,()=>Jr(()=>xn(!0))),$n("copy",x.copy,()=>Jr(()=>xn(!1))),$n("paste",x.paste,()=>yn("all")),$n("pasteValues",x.pasteValues,()=>yn("values")),Bn("a"),..."col"!==so?[$n("rowAbove",x.rowsAbove,()=>un("row",!1)),$n("rowBelow",x.rowsBelow,()=>un("row",!0))]:[],..."row"!==so?[$n("colLeft",x.columnsLeft,()=>un("col",!1)),$n("colRight",x.columnsRight,()=>un("col",!0))]:[],Bn("b"),..."col"!==so?[$n("delRows",x.deleteRows,()=>dn("row"),{danger:!0})]:[],..."row"!==so?[$n("delCols",x.deleteColumns,()=>dn("col"),{danger:!0})]:[],$n("clear",x.clearValues,()=>Jr(()=>Rr(e=>C(e,Wt.range)))),Bn("c"),..."col"!==so?[$n("hideRows",x.hideRows,()=>fn("row"))]:[],..."row"!==so?[$n("hideCols",x.hideColumns,()=>fn("col"))]:[],..."col"!==so&&Ot.hiddenRows.length?[$n("unhideRows",x.unhideRows,()=>hn("row"))]:[],..."row"!==so&&Ot.hiddenCols.length?[$n("unhideCols",x.unhideColumns,()=>hn("col"))]:[]])}),Sr.state&&xt(Ae,{...Sr.props,items:(co=Sr.state.data,[$n("rename",x.rename,()=>dr({index:co,name:Fe[co].name})),$n("duplicate",x.duplicate,()=>{lt(e=>M(e,co,X(e,Fe[co].name))),Qe(co+1)}),$n("left",x.moveLeft,()=>An(co,-1),{disabled:0===co}),$n("right",x.moveRight,()=>An(co,1),{disabled:co===Fe.length-1}),{type:"submenu",key:"colour",label:x.tabColor,items:[$n("none",x.noColor,()=>lt(e=>e.map((e,t)=>t===co?{...e,tabColor:void 0}:e))),...ht.slice(7,17).map(e=>$n(e,bt("span",{className:"flex items-center gap-2",children:[xt("span",{className:"inline-block h-3 w-3 rounded-sm",style:{background:e}}),e]}),()=>lt(t=>t.map((t,r)=>r===co?{...t,tabColor:e}:t))))]},Bn("a"),$n("delete",x.deleteSheet,()=>{(async e=>{Fe.length<=1||(null===ue(Fe[e])||await Ke({title:x.deleteSheetTitle,message:x.deleteSheetMessage(Fe[e].name),confirmLabel:x.deleteSheet}))&&(lt(t=>T(t,e)),Qe(t=>t>e||t>=Fe.length-1?Math.max(0,t-1):t))})(co)},{danger:!0,disabled:Fe.length<=1})])}),ar&&bt(Ue,{portal:!0,minWidth:230,onClose:()=>ir(null),style:{position:"fixed",left:ar.x,top:ar.y},children:[xt(Be,{onClick:()=>Ln(ar.col,!0),children:x.sortAscending}),xt(Be,{onClick:()=>Ln(ar.col,!1),children:x.sortDescending}),xt($e,{}),xt("div",{className:"px-2 py-1",children:xt(Le,{size:"sm","aria-label":x.find,placeholder:x.find,value:ar.search,onChange:e=>ir({...ar,search:e.target.value})})}),xt("div",{className:"max-h-52 overflow-y-auto px-2 py-1",children:io.map(e=>xt("div",{className:"py-0.5",children:xt(Te,{label:e||x.blank,checked:!ar.unticked.has(e),onChange:t=>{const r=new Set(ar.unticked);t?r.delete(e):r.add(e),ir({...ar,unticked:r})}})},e))}),bt("div",{className:"flex items-center justify-between gap-2 border-t border-line px-2 py-1",children:[xt(Re,{size:"sm",variant:"ghost",onClick:()=>ir({...ar,unticked:new Set}),children:x.clear}),xt(Re,{size:"sm",variant:"primary",onClick:()=>{if(!ar)return;const{col:e,unticked:t}=ar;ir(null),Jr(()=>Rr(r=>{if(!r.filter)return r;const n={...r.filter.excluded};return t.size?n[e]=[...t]:delete n[e],{...r,filter:{...r.filter,excluded:n}}}))},children:x.apply})]})]})]});var co,so,uo}function At(e,t){const r=e.rows?e.rows.map(e=>e.map(e=>String(e??""))):Y(e.csv??"");return 0===r.length?null:oe(t,r)}export{Rt as OpenSpreadsheet,Dt as SpreadsheetById,Tt as SpreadsheetPane,St as default};
|
package/dist/chunk-3RFDQOTI.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=(e,n)=>e===n||JSON.stringify(e)===JSON.stringify(n);function n(n,s,t){return e(s,n)?t:s}function s(n,s,t,i){const r=new Map(n.map(e=>[e.id,e])),o=new Map(s.map(e=>[e.id,e])),a=new Map(t.map(e=>[e.id,e])),u=new Set,l=new Map;for(const e of new Set([...o.keys(),...a.keys()])){const n=r.get(e),s=o.get(e),t=a.get(e);if(n){if(!s||!t)continue;l.set(e,i(n,s,t))}else l.set(e,s??t);u.add(e)}return function(n,s,t,i){const r=e=>e.filter(e=>n.includes(e)&&i.has(e)),o=!e(r(n),r(s)),[a,u]=o?[s,t]:[t,s],l=a.filter(e=>i.has(e));return u.forEach((e,n)=>{if(l.includes(e)||!i.has(e))return;const s=u.slice(0,n).reverse().find(e=>l.includes(e));l.splice(s?l.indexOf(s)+1:0,0,e)}),l}([...r.keys()],[...o.keys()],[...a.keys()],u).map(e=>l.get(e))}var t=(e,s,t)=>n(e,s,t);function i(e,i,r){return{...r,background:n(e.background,i.background,r.background),notes:n(e.notes,i.notes,r.notes),layout:n(e.layout,i.layout,r.layout),skip:n(e.skip,i.skip,r.skip),transition:n(e.transition,i.transition,r.transition),animations:n(e.animations,i.animations,r.animations),elements:s(e.elements,i.elements,r.elements,t)}}function r(t,r,o){if(e(r,t))return o;if(e(o,t))return r;const a=s(t.slides,r.slides,o.slides,i);return{...o,theme:n(t.theme,r.theme,o.theme),slideNumbers:n(t.slideNumbers,r.slideNumbers,o.slideNumbers),slides:a.length>0?a:o.slides}}export{r as mergeDecks};
|
package/dist/chunk-4NKXNXKY.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=new Set(["P","DIV","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","PRE","LI","TR","TABLE","UL","OL","TBODY"]);function t(t){let o="";const n=t=>{for(const a of Array.from(t.childNodes)){if(3===a.nodeType){o+=(a.nodeValue??"").replace(//g,"");continue}if(1!==a.nodeType)continue;const t=a;if("BR"===t.tagName){o+="\n";continue}if("DEL"===t.tagName||t.hasAttribute("data-hidden"))continue;if("object"===t.getAttribute("data-kind")||"mark"===t.getAttribute("data-kind"))continue;if("TD"===t.tagName||"TH"===t.tagName){n(t),o=`${o.replace(/\n+$/,"")}\t`;continue}const r=e.has(t.tagName);n(t),r&&!o.endsWith("\n")&&(o+="\n")}};return n(t),o.replace(/\t\n/g,"\n").replace(/\n+$/,"\n")}function o(e){return(e.match(/[-ヿ㐀-鿿豈-]/g)?.length??0)+(e.replace(/[-ヿ㐀-鿿豈-]/g," ").match(/\S+/g)?.length??0)}function n(t,o,n){if(!o)return[];const a=function(e){const t=[],o=e=>{for(const n of Array.from(e.childNodes))if(3===n.nodeType)t.push(n);else if(1===n.nodeType){const e=n;if("false"===e.getAttribute("contenteditable")||e.hasAttribute("data-raw"))continue;o(e)}};return o(e),t}(t),r=o=>{let n=o.parentNode;for(;n&&n!==t&&!e.has(n.tagName)&&"TD"!==n.tagName;)n=n.parentNode;return n},i=[];let c=0;for(;c<a.length;){const e=r(a[c]);let t=c;const d=[];for(;t<a.length&&r(a[t])===e;)d.push(a[t++]);const s=d.map(e=>e.nodeValue??"").join(""),l=n?s:s.toLowerCase(),p=n?o:o.toLowerCase(),g=l.length===s.length?l:s;for(let e=g.indexOf(p);e>=0;e=g.indexOf(p,e+p.length)){const t=[];let o=0;for(const n of d){const a=(n.nodeValue??"").length,r=Math.max(e,o),i=Math.min(e+p.length,o+a);r<i&&t.push({node:n,start:r-o,end:i-o}),o+=a}i.push(t)}c=t}return i}function a(e,t){e.forEach((e,o)=>{const n=e.node.nodeValue??"";e.node.nodeValue=n.slice(0,e.start)+(0===o?t:"")+n.slice(e.end)})}function r(e,t){const o=[0];if(t<=0)return o;let n=0;for(const a of e)if(a.breakBefore&&a.top>n&&(n=a.top,o.push(n)),!(a.top+a.height-n<=t))if(a.height<=t)a.top>n&&(n=a.top,o.push(n));else for(;a.top+a.height-n>t;)n+=t,o.push(n);return o}function i(e,t,o=1){const n=[],a=e=>{const a=e.getBoundingClientRect();n.push({top:(a.top-t)/o,height:a.height/o,breakBefore:e.hasAttribute("data-break-before")})};for(const r of Array.from(e.children))"TABLE"===r.tagName?r.querySelectorAll("tr").forEach(a):"UL"===r.tagName||"OL"===r.tagName?r.querySelectorAll("li").forEach(a):a(r),r.querySelectorAll("[data-page-break]").forEach(e=>{const a=e.getBoundingClientRect();n.push({top:(a.bottom-t)/o,height:0,breakBefore:!0})});return n}var c=new Set(["P","DIV","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","LI","TABLE","THEAD","TBODY","TFOOT","TR","TD","TH","COLGROUP","COL","B","STRONG","I","EM","U","S","STRIKE","SUB","SUP","SPAN","FONT","A","BR","IMG","PRE","HR"]),d=new Set(["SCRIPT","STYLE","TITLE","META","LINK","OBJECT","EMBED","IFRAME","NOSCRIPT","TEMPLATE","SVG","MATH","FORM","INPUT","BUTTON","SELECT","TEXTAREA","VIDEO","AUDIO","CANVAS"]),s=new Set(["color","background-color","font-weight","font-style","text-decoration-line","text-decoration","font-family","font-size","text-align","margin-left","line-height","width","height","list-style-type"]),l=/^(https?:|mailto:|tel:|#)/i,p=/^(data:image\/(png|jpe?g|gif|webp|bmp);base64,|blob:)/i;function g(e){const t=document.implementation.createHTMLDocument("");t.body.innerHTML=e;const o=(e,t,n)=>{for(const a of Array.from(e.childNodes)){if(3===a.nodeType){t.appendChild(n.createTextNode(a.nodeValue??""));continue}if(1!==a.nodeType)continue;const e=a,r=e.tagName.toUpperCase();if(d.has(r))continue;if(!c.has(r)){o(e,t,n);continue}if("IMG"===r&&!p.test(e.getAttribute("src")??""))continue;const i=n.createElement(r),g=(e.getAttribute("style")??"").split(";").map(e=>{const t=e.indexOf(":");if(t<0)return"";const o=e.slice(0,t).trim().toLowerCase(),n=e.slice(t+1).trim();return s.has(o)&&!/url\(|expression|mso-/i.test(n)?`${o}:${n}`:""}).filter(Boolean).join(";");g&&i.setAttribute("style",g),"A"===r&&l.test(e.getAttribute("href")??"")&&i.setAttribute("href",e.getAttribute("href")),"IMG"===r&&i.setAttribute("src",e.getAttribute("src"));for(const t of["colspan","rowspan","start","color","face","size"]){const o=e.getAttribute(t);null!==o&&i.setAttribute(t,o)}o(e,i,n),t.appendChild(i)}},n=document.createElement("div");return o(t.body,n,document),n.innerHTML}import{escapeHtml as f}from"efficient-shell/ui";var u="\nhtml,body{margin:0;background:#fff}\n.docs-page [data-comment]{background:none;border:0}\n.docs-page [data-locked]{background:none;box-shadow:none}\n.docs-page [data-page-break]{break-after:page;border:0;margin:0}\n.docs-page [data-break-before]{break-before:page}\n.docs-page tr,.docs-page img{break-inside:avoid}\n";function h(e,t){return`\n.docs-sheet{background:#fff;color:#777}\n.docs-sheet-line{border-color:#aaa}\n\n${`\n.docs-page{color:#000;background:#fff;white-space:pre-wrap;overflow-wrap:break-word;outline:none;line-height:1.08;tab-size:36pt;font-family:Calibri,Carlito,Arial,sans-serif;font-size:11pt}\n.docs-page p,.docs-page h1,.docs-page h2,.docs-page h3,.docs-page h4,.docs-page h5,.docs-page h6{margin:0;font:inherit;font-weight:400}\n.docs-page ul,.docs-page ol{margin:0;padding-left:24pt}\n.docs-page ul{list-style-type:disc}.docs-page ol{list-style-type:decimal}\n.docs-page ul ul{list-style-type:circle}.docs-page ul ul ul{list-style-type:square}\n.docs-page a{color:#0563c1;text-decoration:underline}\n.docs-page sub,.docs-page sup{font-size:.66em}\n.docs-page img{max-width:100%}\n.docs-page table{border-collapse:collapse;table-layout:fixed;width:100%}\n.docs-page td,.docs-page th{border:.5pt solid #000;padding:0 5.4pt;vertical-align:top}\n.docs-page table[data-no-borders] td,.docs-page table[data-no-borders] th{border:.5pt dotted #bbb}\n.docs-page td p{margin-bottom:0}\n.docs-page blockquote{margin:0 0 8pt 24pt;font-style:italic}\n.docs-page hr{border:0;border-top:.75pt solid #000;margin:6pt 0}\n.docs-page [data-hidden]{display:none}\n.docs-page [data-page-break]{display:block;height:0;border-top:1pt dashed #999;margin:6pt 0;user-select:none}\n.docs-page [data-comment]{background:#fff2cc;border-bottom:1.5pt solid #e0b000}\n.docs-page [data-locked]{background:#f4f4f4;box-shadow:-5pt 0 0 #bbb;cursor:not-allowed}\n.docs-page ins{color:#c00000;text-decoration:underline}\n.docs-page del{color:#c00000;text-decoration:line-through}\n.docs-page [data-kind="object"]{display:inline-block;background:#f4f4f4;border:.75pt dashed #999;color:#555;padding:1pt 5pt;cursor:not-allowed;white-space:normal}\n.docs-page [data-kind="field"]{background:#ededed}\n.docs-page [data-kind="note"]{vertical-align:super;font-size:.66em}\n.docs-page ::highlight(docs-find){background:#ffe680}\n.docs-page ::highlight(docs-find-current){background:#ff9f1a}\n\n${e.css}`.replaceAll(".docs-page",`.docs-page[data-doc="${t}"]`)}`}var b=e=>u.replaceAll(".docs-page",`.docs-page[data-doc="${e}"]`);function m(e,t,o){const n=e=>(e??"").replaceAll("{page}",String(t)).replaceAll("{pages}",String(o)),[a,r]=e.split(/\s*\|\s*/);return[n(a),n(r)]}function T(e,t){const[o,n]=function(e){return e.split(/\s*\|\s*/).map(e=>e.split(/(\{page\}|\{pages\})/).map(e=>"{page}"===e?"counter(page)":"{pages}"===e?"counter(pages)":e?`"${e.replace(/["\\\n\r]/g,"")}"`:"").filter(Boolean).join(" "))}(t),a="font:9pt Calibri,Carlito,Arial,sans-serif;color:#555";return`${o?`@${e}-left{content:${o};${a}}`:""}${n?`@${e}-right{content:${n};${a}}`:""}`}function A({title:e,html:t,doc:o,scope:n,page:a,header:r,footer:i}){const c=e=>Math.round(e)/20+"pt",d=`@page{size:${c(a.width)} ${c(a.height)};margin:${c(a.top)} ${c(a.right)} ${c(a.bottom)} ${c(a.left)};${T("top",r)}${T("bottom",i)}}`;return`<!doctype html><html><head><meta charset="utf-8"><meta name="generator" content="efficient-shell Documents"><title>${f(e)}</title><style>${h(o,n)}\n${b(n)}\n${d}</style></head><body><div class="docs-page" data-doc="${n}">${t}</div></body></html>`}export{t as documentText,o as countWords,n as findInNodes,a as replaceSpots,r as pageStarts,i as pageBlocks,g as sanitizeHtml,h as pageStyles,b as printStyles,m as marginText,A as pageDocument};
|
package/dist/chunk-6ZFEBY6H.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{titleOf as r}from"./chunk-XYVQTQ6N.js";var e=r=>new Promise((e,t)=>{const a=new FileReader;a.onload=()=>e(String(a.result)),a.onerror=()=>t(a.error??new Error("Unreadable picture")),a.readAsDataURL(r)});async function t(t,a,o={}){const{importPptx:n}=await(import("./pptxImport-Y7TB6PYP.js")),{document:i,notes:s}=await n(a,{storeImage:o.storeImage??e,onProgress:o.onProgress,signal:o.signal}),c=r(a.name),m=await t.create(c);try{await t.save(m.id,i,m.version)}catch(r){throw await t.remove(m.id).catch(()=>{}),r}return{id:m.id,title:c,notes:s}}export{t as importDeckFile};
|
package/dist/chunk-B2X3NIQR.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{DECK_FONT as t,NO_FILL as e,SLIDE_H as n,SLIDE_W as r,newId as o}from"./chunk-PXOQN7D6.js";var i=t=>`M${t.map(([t,e])=>`${t},${e}`).join(" L")} Z`,a=(t,e,n,r=-Math.PI/2)=>i(Array.from({length:t},(o,i)=>{const a=r+2*i*Math.PI/t;return[e/2+e/2*Math.cos(a),n/2+n/2*Math.sin(a)]})),l={rect:(t,e)=>i([[0,0],[t,0],[t,e],[0,e]]),roundRect:(t,e,n)=>{const r=Math.min(n??Math.min(t,e)/6,t/2,e/2);return`M${r},0 H${t-r} A${r},${r} 0 0 1 ${t},${r} V${e-r} A${r},${r} 0 0 1 ${t-r},${e} H${r} A${r},${r} 0 0 1 0,${e-r} V${r} A${r},${r} 0 0 1 ${r},0 Z`},ellipse:(t,e)=>`M0,${e/2} A${t/2},${e/2} 0 1 1 ${t},${e/2} A${t/2},${e/2} 0 1 1 0,${e/2} Z`,triangle:(t,e)=>i([[t/2,0],[t,e],[0,e]]),rightTriangle:(t,e)=>i([[0,0],[t,e],[0,e]]),diamond:(t,e)=>i([[t/2,0],[t,e/2],[t/2,e],[0,e/2]]),pentagon:(t,e)=>a(5,t,e),hexagon:(t,e)=>a(6,t,e,0),octagon:(t,e)=>a(8,t,e,Math.PI/8),star:(t,e)=>i(Array.from({length:10},(n,r)=>{const o=-Math.PI/2+r*Math.PI/5,i=r%2==0?.5:.2;return[t/2+t*i*Math.cos(o),e/2+e*i*Math.sin(o)+.04*e]})),heart:(t,e)=>`M${t/2},${e} C${.1*t},${.7*e} 0,${.45*e} 0,${.28*e} C0,${.05*e} ${.25*t},0 ${.5*t},${.2*e} C${.75*t},0 ${t},${.05*e} ${t},${.28*e} C${t},${.45*e} ${.9*t},${.7*e} ${t/2},${e} Z`,cloud:(t,e)=>`M${.25*t},${.85*e} C${.05*t},${.85*e} 0,${.6*e} ${.12*t},${.5*e} C${.05*t},${.25*e} ${.3*t},${.15*e} ${.4*t},${.25*e} C${.45*t},${.05*e} ${.75*t},${.05*e} ${.75*t},${.3*e} C${.95*t},${.25*e} ${t},${.55*e} ${.88*t},${.65*e} C${t},${.8*e} ${.85*t},${.9*e} ${.72*t},${.85*e} Z`,bolt:(t,e)=>i([[.55*t,0],[.15*t,.55*e],[.45*t,.55*e],[.35*t,e],[.85*t,.4*e],[.55*t,.4*e],[.75*t,0]]),parallelogram:(t,e)=>i([[.25*t,0],[t,0],[.75*t,e],[0,e]]),trapezoid:(t,e)=>i([[.2*t,0],[.8*t,0],[t,e],[0,e]]),cylinder:(t,e)=>{const n=Math.min(.15*e,t/4);return`M0,${n} A${t/2},${n} 0 0 1 ${t},${n} V${e-n} A${t/2},${n} 0 0 1 0,${e-n} Z M0,${n} A${t/2},${n} 0 0 0 ${t},${n}`},plus:(t,e)=>{const n=t/3,r=e/3;return i([[n,0],[2*n,0],[2*n,r],[t,r],[t,2*r],[2*n,2*r],[2*n,e],[n,e],[n,2*r],[0,2*r],[0,r],[n,r]])},arrowRight:(t,e)=>i([[0,.25*e],[.6*t,.25*e],[.6*t,0],[t,e/2],[.6*t,e],[.6*t,.75*e],[0,.75*e]]),arrowLeft:(t,e)=>i([[t,.25*e],[.4*t,.25*e],[.4*t,0],[0,e/2],[.4*t,e],[.4*t,.75*e],[t,.75*e]]),arrowUp:(t,e)=>i([[.25*t,e],[.25*t,.4*e],[0,.4*e],[t/2,0],[t,.4*e],[.75*t,.4*e],[.75*t,e]]),arrowDown:(t,e)=>i([[.25*t,0],[.25*t,.6*e],[0,.6*e],[t/2,e],[t,.6*e],[.75*t,.6*e],[.75*t,0]]),arrowLeftRight:(t,e)=>i([[0,e/2],[.25*t,0],[.25*t,.25*e],[.75*t,.25*e],[.75*t,0],[t,e/2],[.75*t,e],[.75*t,.75*e],[.25*t,.75*e],[.25*t,e]]),chevron:(t,e)=>i([[0,0],[.7*t,0],[t,e/2],[.7*t,e],[0,e],[.3*t,e/2]]),callout:(t,e)=>i([[0,0],[t,0],[t,.75*e],[.4*t,.75*e],[.2*t,e],[.25*t,.75*e],[0,.75*e]]),calloutRound:(t,e)=>{const n=.12*Math.min(t,e),r=.75*e;return`M${n},0 H${t-n} A${n},${n} 0 0 1 ${t},${n} V${r-n} A${n},${n} 0 0 1 ${t-n},${r} H${.4*t} L${.2*t},${e} L${.25*t},${r} H${n} A${n},${n} 0 0 1 0,${r-n} V${n} A${n},${n} 0 0 1 ${n},0 Z`}};function s(t,e,n,r){return(l[t]??l.rect)(e,n,r)}var c={rect:"rect",roundRect:"roundRect",ellipse:"ellipse",triangle:"triangle",rightTriangle:"rtTriangle",diamond:"diamond",pentagon:"pentagon",hexagon:"hexagon",octagon:"octagon",star:"star5",heart:"heart",cloud:"cloud",bolt:"lightningBolt",parallelogram:"parallelogram",trapezoid:"trapezoid",cylinder:"can",plus:"plus",arrowRight:"rightArrow",arrowLeft:"leftArrow",arrowUp:"upArrow",arrowDown:"downArrow",arrowLeftRight:"leftRightArrow",chevron:"chevron",callout:"wedgeRectCallout",calloutRound:"wedgeRoundRectCallout",line:"line"},h=["bold","italic","underline","strike","color","highlight","size","font","link"];function u(t){return t.paragraphs&&t.paragraphs.length>0?t.paragraphs:t.text.split("\n").map(t=>({runs:[{text:t}]}))}function d(t){return t.map(t=>t.runs.map(t=>t.text).join("")).join("\n")}function f(t,e){const n=e.map(m);return{...t,paragraphs:n,text:d(n)}}var p=(t,e)=>h.every(n=>(t[n]??void 0)===(e[n]??void 0));function g(t){const e={};for(const n of h){const r=t[n];void 0!==r&&!1!==r&&""!==r&&(e[n]=r)}return e}function m(t){const e=[];for(const n of t.runs){const t=g(n),r=e[e.length-1];n.text&&(r&&p(g(r),t)?r.text+=n.text:e.push({text:n.text,...t}))}const n={};t.align&&"left"!==t.align&&(n.align=t.align),t.list&&(n.list=t.list),t.level&&(n.level=Math.max(0,Math.min(4,t.level))),t.lineHeight&&(n.lineHeight=t.lineHeight);const r=t.runs[0]?[{...g(t.runs[0]),text:""}]:[{text:""}];return{...n,runs:e.length>0?e:r}}function $(t){const e=[];let n=0;for(const r of t)e.push(n),n+=r.runs.reduce((t,e)=>t+e.text.length,0)+1;return e}function y(t,e,n,r){return function(t,e,n,r){const o=$(t);return t.map((t,i)=>{const a=o[i],l=t.runs.reduce((t,e)=>t+e.text.length,0),s=Math.max(e-a,0),c=Math.min(n-a,l);if(c<=s)return t;let h=0;const u=function(t,e,n){const r=[];let o=0;for(const i of t){const t=o+i.text.length,a=[e,n].filter(e=>e>o&&e<t).map(t=>t-o);let l=0;for(const t of[...a,i.text.length])t>l&&r.push({...i,text:i.text.slice(l,t)}),l=t;o=t}return r}(t.runs,s,c).map(t=>{const e=h>=s&&h+t.text.length<=c;return h+=t.text.length,e?r(t):t});return m({...t,runs:u})})}(t,e,n,t=>{const e={...t,...r};for(const t of h)void 0===e[t]&&delete e[t];return e})}function w(t,e,n){const r=[],o=$(t);if(t.forEach((t,i)=>{let a=o[i];for(const o of t.runs){const t=a+o.text.length;(e===n?e>a&&e<=t||e===a&&""===o.text:t>e&&a<n)&&r.push(g(o)),a=t}}),0===r.length){let n=0;o.forEach((t,r)=>{t<=e&&(n=r)}),r.push(g(t[n]?.runs[0]??{text:""}))}const i={};for(const t of h){const e=r[0][t];void 0!==e&&r.every(n=>n[t]===e)&&(i[t]=e)}return i}function x(t,e,n){const r=$(t);return t.map((t,e)=>e).filter(o=>r[o]+t[o].runs.reduce((t,e)=>t+e.text.length,0)>=e&&r[o]<=n)}function v(t,e,n,r){const o=new Set(x(t,e,n));return t.map((t,e)=>o.has(e)?m(r(t)):t)}function b(t,e,n,r){const o=x(t,e,n).every(e=>t[e].list===r);return v(t,e,n,t=>({...t,list:o?void 0:r}))}function M(t,e,n,r){return v(t,e,n,t=>({...t,level:Math.max(0,Math.min(4,(t.level??0)+r))}))}function k(t){const e=[];return t.map(t=>{const n=t.level??0;return e.length=n+1,"number"!==t.list?(t.list?e[n]=0:e.length=0,"bullet"===t.list?["•","◦","▪"][n%3]:null):(e[n]=(e[n]??0)+1,`${e[n]}.`)})}var S="data-run",C="data-paragraph",A=t=>t instanceof HTMLElement&&"false"===t.getAttribute("contenteditable");function I(t,e=[]){return A(t)||(t.nodeType===Node.TEXT_NODE?e.push(t):t.childNodes.forEach(t=>I(t,e))),e}var H=t=>I(t).reduce((t,e)=>t+e.data.replace(/\u200b/g,"").length,0);function j(t){const e=[...t.childNodes],n=[];let r=null;const o=(e,n)=>{if(!A(e))if(e.nodeType===Node.TEXT_NODE){const r=e.parentElement?.closest(`[${S}]`),o=r&&t.contains(r)?JSON.parse(r.getAttribute(S)||"{}"):{};n.push({...o,text:(e.textContent??"").replace(//g,"")})}else e.childNodes.forEach(t=>o(t,n))};for(const t of e){if(!(t instanceof HTMLElement&&(t.hasAttribute(C)||/^(DIV|P)$/.test(t.tagName)))){if(t instanceof HTMLElement&&"BR"===t.tagName){r=null;continue}r||(r={runs:[]},n.push(r)),o(t,r.runs);continue}r=null;const e=JSON.parse(t.getAttribute(C)||"{}"),i=[];o(t,i),n.push({...e,runs:i})}return(n.length>0?n:[{runs:[{text:""}]}]).map(m)}function z(t){const e=t.ownerDocument.getSelection();if(!e||0===e.rangeCount)return null;const n=e.getRangeAt(0);if(!t.contains(n.startContainer)||!t.contains(n.endContainer))return null;const r=(e,n)=>{const r=t.ownerDocument.createRange();r.setStart(t,0),r.setEnd(e,n);const o=[...t.childNodes];let i=0;return o.forEach((t,o)=>{if(r.intersectsNode(t)){o>0&&(i+=1);for(const o of I(t))o===e?i+=o.data.slice(0,n).replace(/\u200b/g,"").length:r.isPointInRange(o,o.data.length)&&(i+=o.data.replace(/\u200b/g,"").length)}}),i},o=r(n.startContainer,n.startOffset),i=r(n.endContainer,n.endOffset);return{start:Math.min(o,i),end:Math.max(o,i)}}function L(t,e,n){const r=e=>{const n=[...t.childNodes];let r=0;for(let t=0;t<n.length;t+=1){t>0&&(r+=1);const o=I(n[t]);if(e<=r+H(n[t])){let i=r;for(const t of o){const n=t.data.replace(/\u200b/g,"").length;if(e<=i+n)return[t,0===n?t.data.length:e-i];i+=n}return[n[t],n[t].childNodes.length]}r+=H(n[t])}return[t,t.childNodes.length]},o=t.ownerDocument.getSelection();if(!o)return;const i=t.ownerDocument.createRange(),[a,l]=r(e),[s,c]=r(n);i.setStart(a,l),i.setEnd(s,c),o.removeAllRanges(),o.addRange(i)}var E=24;function F(t,e){const n=t.x+t.w/2,r=t.y+t.h/2,o={n:[0,-t.h/2],e:[t.w/2,0],s:[0,t.h/2],w:[-t.w/2,0]}[e],i=t.rotation*Math.PI/180;return{x:n+o[0]*Math.cos(i)-o[1]*Math.sin(i),y:r+o[0]*Math.sin(i)+o[1]*Math.cos(i)}}function N(t,e,n,r){let o=null;for(const i of t)if(i.id!==r&&"connector"!==i.type)for(const t of["n","e","s","w"]){const r=F(i,t),a=Math.hypot(r.x-e,r.y-n);a<=40&&(!o||a<o.d)&&(o={id:i.id,side:t,...r,d:a})}return o&&{id:o.id,side:o.side,x:o.x,y:o.y}}function P(t,e){const n=Math.min(t.x,e.x),r=Math.min(t.y,e.y),o=Math.max(Math.abs(e.x-t.x),E),i=Math.max(Math.abs(e.y-t.y),E);return{x:n-(o===E?12:0),y:r-(i===E?12:0),w:o,h:i}}function R(t,e,n){return{...t,start:e,end:n,...P(e,n),rotation:0}}function W(t,e){const n=new Map(t.elements.map(t=>[t.id,t]));let r=!1;const o=t.elements.map(t=>{if("connector"!==t.type)return t;const o=r=>{if(!r.attach)return r;const o=n.get(r.attach.id);return o&&"connector"!==o.type?e?.has(t.id)&&!e.has(o.id)?{x:r.x,y:r.y}:{...F(o,r.attach.side),attach:r.attach}:{x:r.x,y:r.y}},i=R(t,o(t.start),o(t.end));return JSON.stringify(i)!==JSON.stringify(t)&&(r=!0),i});return r?{...t,elements:o}:t}function O(t){const e=t.start.x-t.x,n=t.start.y-t.y,r=t.end.x-t.x,o=t.end.y-t.y;if("straight"===t.route)return`M${e},${n} L${r},${o}`;if("elbow"===t.route){if(t.start.attach?"e"===(i=t.start.attach.side)||"w"===i:Math.abs(r-e)>=Math.abs(o-n)){return`M${e},${n} H${(e+r)/2} V${o} H${r}`}return`M${e},${n} V${(n+o)/2} H${r} V${o}`}var i;const a=Math.max(Math.abs(r-e),Math.abs(o-n))/2,l=(t,i,l,s=1)=>{if(!l)return Math.abs(r-e)>=Math.abs(o-n)?[t+s*a,i]:[t,i+s*a];const c={n:[0,-a],e:[a,0],s:[0,a],w:[-a,0]}[l];return[t+c[0],i+c[1]]},[s,c]=l(e,n,t.start.attach?.side,1),[h,u]=l(r,o,t.end.attach?.side,-1);return`M${e},${n} C${s},${c} ${h},${u} ${r},${o}`}import{Fragment as D,useLayoutEffect as T,useRef as V}from"react";import{Fragment as X,jsx as B,jsxs as Z}from"react/jsx-runtime";function Y({shape:t}){const{w:n,h:r,arrowEnd:o,arrowStart:i}=t,a=t.stroke??(t.fill===e?"#2c2c2a":t.fill),l=t.strokeWidth??4,s=r/2,c=Math.min(Math.max(4*l,14),n/2),h=c/2;return Z(X,{children:[B("line",{x1:i?c:0,y1:s,x2:o?n-c:n,y2:s,stroke:a,strokeWidth:l}),i&&B("polygon",{points:`0,${s} ${c},${s-h} ${c},${s+h}`,fill:a}),o&&B("polygon",{points:`${n},${s} ${n-c},${s-h} ${n-c},${s+h}`,fill:a})]})}function J({shape:t}){const{w:e,h:n,fill:r,stroke:o,strokeWidth:i}=t,a={fill:r,stroke:o,strokeWidth:o?i??4:void 0};switch(t.shape){case"line":return null;case"rect":return B("rect",{width:e,height:n,...a});case"ellipse":return B("ellipse",{cx:e/2,cy:n/2,rx:e/2,ry:n/2,...a});case"diamond":return B("polygon",{points:`${e/2},0 ${e},${n/2} ${e/2},${n} 0,${n/2}`,...a});case"roundRect":return B("rect",{width:e,height:n,rx:Math.min(t.radius??Math.min(e,n)/6,e/2,n/2),...a});default:return B("path",{d:s(t.shape,e,n,t.radius),...a,strokeLinejoin:"round"})}}function q({shape:t}){const e=Math.max(t.w,1),n=Math.max(t.h,1);return B("svg",{width:e,height:n,viewBox:`0 0 ${e} ${n}`,"aria-hidden":"true",style:{display:"block",overflow:"visible"},children:"line"===t.shape?B(Y,{shape:t}):B(J,{shape:t})})}import{useLayoutEffect as U,useRef as _,useState as Q}from"react";import{jsx as G,jsxs as K}from"react/jsx-runtime";var tt=e=>`${e?`'${e}', `:""}${t}, ui-sans-serif, system-ui, sans-serif`,et=1.4;function nt(t,e,n=1){const r=[e.underline||e.link?"underline":"",e.strike?"line-through":""].filter(Boolean).join(" ");return{fontFamily:e.font||t.font?tt(e.font??t.font):void 0,fontSize:e.size?e.size*n:void 0,fontWeight:void 0===e.bold?void 0:e.bold?700:400,fontStyle:e.italic?"italic":void 0,textDecoration:r||void 0,color:e.color,background:e.highlight}}function rt(t,e){const n=e.level??0,r=e.list?1:0;return{margin:0,textAlign:e.align??t.align,lineHeight:e.lineHeight??1.25,paddingLeft:n*et+r*et+"em",position:"relative",minHeight:`${e.lineHeight??1.25}em`}}function ot(t,e=1){return{fontFamily:tt(t.font),fontSize:t.fontSize*e,fontWeight:t.bold?700:400,color:t.color,whiteSpace:"pre-wrap",overflowWrap:"break-word"}}var it={position:"absolute",left:0,width:"1.4em",textAlign:"left"};function at({marker:t,level:e}){return t?G("span",{"aria-hidden":"true",contentEditable:!1,style:{...it,left:e*et+"em"},children:t}):null}function lt({el:t,run:e,scale:n,onLink:r}){const o=nt(t,e,n);return e.link&&r?G("a",{href:e.link,style:{...o,color:o.color??"inherit",cursor:"pointer"},onClick:t=>{t.preventDefault(),t.stopPropagation(),r(e.link)},children:e.text}):G("span",{style:o,children:e.text})}function st({element:t,onLink:e}){const n=u(t),r=k(n),o=_(null),[i,a]=Q(1),l=t.autofit,s=JSON.stringify([n,t.fontSize,t.w,t.h,t.font]);U(()=>{if(!l)return void a(1);const e=o.current;if(!e)return;let n=.2,r=1;if(e.style.fontSize=`${t.fontSize}px`,e.scrollHeight<=t.h+1)a(1);else{for(let o=0;o<8;o+=1){const o=(n+r)/2;e.style.fontSize=t.fontSize*o+"px",e.scrollHeight<=t.h+1?n=o:r=o}e.style.fontSize="",a(n)}},[l,s]);const c={top:"flex-start",middle:"center",bottom:"flex-end"}[t.anchor??"top"];return G("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:c,overflow:l?"hidden":void 0},children:G("div",{ref:o,style:ot(t,i),children:n.map((n,o)=>K("div",{"data-slide-paragraph":"",style:rt(t,n),children:[G(at,{marker:r[o],level:n.level??0}),n.runs.map((n,r)=>G(lt,{el:t,run:n,scale:i,onLink:e},r)),n.runs.every(t=>!t.text)&&""]},o))})})}function ct(t,e){const n=k(e),r=t=>Object.entries(t).filter(([,t])=>void 0!==t&&""!==t).map(([t,e])=>`${t.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}:${"number"!=typeof e||/weight|height/i.test(t)?e:`${e}px`}`).join(";"),o=t=>t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");return e.map((e,i)=>{const{runs:a,...l}=e,s=e.level??0,c=n[i]?`<span contenteditable="false" aria-hidden="true" style="${r({...it,left:s*et+"em"})}">${o(n[i])}</span>`:"",h=a.map(e=>`<span ${S}="${o(JSON.stringify(g(e)))}" style="${r(nt(t,e))}">${o(e.text)||""}</span>`).join("");return`<div ${C}="${o(JSON.stringify(l))}" style="${r(rt(t,e))}">${c}${h}</div>`}).join("")}function ht(t){return t.series&&t.series.length>0&&t.categories?{categories:t.categories,series:t.series}:{categories:t.points.map(t=>t.label),series:[{name:"",color:t.color,values:t.points.map(t=>t.value)}]}}function ut(t){const{categories:e,series:n}=ht(t);return[["",...n.map(t=>t.name)],...e.map((t,e)=>[t,...n.map(t=>String(t.values[e]??""))])]}function dt(t,e,n){const r=ht(t).series,o=Math.max(1,...e.map(t=>t.length)),i=(e[0]??[]).slice(1),a=e.slice(1),l=Array.from({length:o-1},(t,e)=>({name:i[e]?.trim()??"",color:r[e]?.color??n[e%n.length],values:a.map(t=>{const n=Number((t[e+1]??"").trim());return Number.isFinite(n)?n:0})}));return function(t,e,n){const r=n[0]??{name:"",color:t.color,values:[]};return{...t,categories:e,series:n.map(t=>({...t,values:e.map((e,n)=>t.values[n]??0)})),color:r.color,points:e.map((t,e)=>({label:t,value:r.values[e]??0}))}}(t,a.map(t=>(t[0]??"").trim()),l)}var ft=.5;function pt(t,e="fadeIn"){return{id:o(),elementId:t,effect:e,start:"click",duration:.5,..."flyIn"===e?{from:"bottom"}:{}}}function gt(t){const e=(t.animations??[]).filter(e=>t.elements.some(t=>t.id===e.elementId)),n=[[]];let r=0,o=0;for(const t of e){if("click"===t.start){n.push([{animation:t,delay:0}]),o=0,r=t.duration;continue}const e=n[n.length-1],i="withPrevious"===t.start?o:r;e.push({animation:t,delay:i}),o=i,r=Math.max(r,i+t.duration)}return n}var mt=t=>gt(t).length-1,$t=new Set(["appear","fadeIn","flyIn","zoomIn"]),yt=t=>$t.has(t);function wt(t,e){const n=gt(t),r=new Set;return n.forEach((t,n)=>{for(const{animation:o}of t)yt(o.effect)&&n>e&&r.add(o.elementId),!yt(o.effect)&&n<e&&r.add(o.elementId)}),{hidden:r,playing:n[Math.min(e,n.length-1)]??[]}}function xt(t){switch(t.effect){case"appear":return[{opacity:0},{opacity:0,offset:.99},{opacity:1}];case"fadeIn":return[{opacity:0},{opacity:1}];case"zoomIn":return[{opacity:0,transform:"scale(0.3)"},{opacity:1,transform:"scale(1)"}];case"fadeOut":return[{opacity:1},{opacity:0}];case"flyIn":return[{opacity:0,transform:{left:"translateX(-1200px)",right:"translateX(1200px)",top:"translateY(-900px)",bottom:"translateY(900px)"}[t.from??"bottom"]},{opacity:1,transform:"translate(0, 0)"}]}}function vt(t){switch(t.kind){case"fade":return{incoming:[{opacity:0},{opacity:1}],outgoing:[{opacity:1},{opacity:1}]};case"slide":return{incoming:[{transform:"translateX(100%)"},{transform:"translateX(0)"}],outgoing:[{opacity:1},{opacity:1}]};case"push":return{incoming:[{transform:"translateX(100%)"},{transform:"translateX(0)"}],outgoing:[{transform:"translateX(0)"},{transform:"translateX(-100%)"}]};case"zoom":return{incoming:[{opacity:0,transform:"scale(0.6)"},{opacity:1,transform:"scale(1)"}],outgoing:[{opacity:1},{opacity:0}]};case"flip":return{incoming:[{transform:"perspective(2000px) rotateY(-90deg)",offset:0},{transform:"perspective(2000px) rotateY(-90deg)",offset:.5},{transform:"perspective(2000px) rotateY(0deg)"}],outgoing:[{transform:"perspective(2000px) rotateY(0deg)"},{transform:"perspective(2000px) rotateY(90deg)",offset:.5},{transform:"perspective(2000px) rotateY(90deg)"}]}}}function bt(t){const e=t.map((t,e)=>t.skip?-1:e).filter(t=>-1!==t);return e.length>0?e:t.map((t,e)=>e)}function Mt(t,e,n){const r=[...t],[o]=r.splice(e,1);return r.splice(Math.max(0,Math.min(n,r.length)),0,o),r}var kt=(t,e,n)=>t&&[...t.slice(0,e),n,...t.slice(e)],St=(t,e)=>t&&t.filter((t,n)=>n!==e);function Ct(t,e,n,r){if(!t)return t;const o="row"===e?"rows":"cols";return t.flatMap(t=>{const i=t[e],a=i+t[o];return 1===r?n<=i?[{...t,[e]:i+1}]:n<a?[{...t,[o]:t[o]+1}]:[t]:n<i?[{...t,[e]:i-1}]:n<a?t[o]>2?[{...t,[o]:t[o]-1}]:[]:[t]})}function At(t,e){const n=t.rows[0]?.length??1,r=t.rowHeights&&kt(t.rowHeights,e,t.rowHeights[Math.max(0,e-1)]??80);return{...t,rows:kt(t.rows,e,Array(n).fill("")),rowHeights:r,cellFills:kt(t.cellFills,e,Array(n).fill(null)),cellColors:kt(t.cellColors,e,Array(n).fill(null)),merges:Ct(t.merges,"row",e,1)}}function It(t,e){return t.rows.length<=1?t:{...t,rows:St(t.rows,e),rowHeights:St(t.rowHeights,e),cellFills:St(t.cellFills,e),cellColors:St(t.cellColors,e),merges:Ct(t.merges,"row",e,-1)}}function Ht(t,e){const n=(t.rows[0]?.length??0)+1;return{...t,rows:t.rows.map(t=>kt(t,e,"")),columnWidths:t.columnWidths&&(r=n,Array(r).fill(1/r)),cellFills:t.cellFills?.map(t=>kt(t,e,null)),cellColors:t.cellColors?.map(t=>kt(t,e,null)),merges:Ct(t.merges,"col",e,1)};var r}function jt(t,e){if((t.rows[0]?.length??0)<=1)return t;const n=t.columnWidths&&St(t.columnWidths,e),r=n?.reduce((t,e)=>t+e,0)||1;return{...t,rows:t.rows.map(t=>St(t,e)),columnWidths:n?.map(t=>t/r),cellFills:t.cellFills?.map(t=>St(t,e)),cellColors:t.cellColors?.map(t=>St(t,e)),merges:Ct(t.merges,"col",e,-1)}}var zt=(t,e,n)=>t.merges?.find(t=>e>=t.row&&e<t.row+t.rows&&n>=t.col&&n<t.col+t.cols);function Lt(t,e){if(e.rows*e.cols<2)return t;let{row:n,col:r,rows:o,cols:i}=e;const a=(t.merges??[]).filter(t=>t.row<n+o&&n<t.row+t.rows&&t.col<r+i&&r<t.col+t.cols);for(const t of a){const e=Math.max(n+o,t.row+t.rows),a=Math.max(r+i,t.col+t.cols);n=Math.min(n,t.row),r=Math.min(r,t.col),o=e-n,i=a-r}const l=[],s=t.rows.map((t,e)=>t.map((t,a)=>e>=n&&e<n+o&&a>=r&&a<r+i?(t.trim()&&l.push(t.trim()),""):t));s[n][r]=l.join(" ");const c=(t.merges??[]).filter(t=>!a.includes(t));return{...t,rows:s,merges:[...c,{row:n,col:r,rows:o,cols:i}]}}function Et(t,e,n){const r=zt(t,e,n);if(!r)return t;const o=t.merges.filter(t=>t!==r);return{...t,merges:o.length>0?o:void 0}}function Ft(t,e,n,r){return{...t,rows:t.rows.map((t,o)=>o===e?t.map((t,e)=>e===n?r:t):t)}}import{jsx as Nt,jsxs as Pt}from"react/jsx-runtime";var Rt=tt();function Wt(t){return{position:"absolute",left:t.x,top:t.y,width:t.w,height:t.h,transform:t.rotation?`rotate(${t.rotation}deg)`:void 0}}var Ot="#444441";function Dt(t){const e=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/i.exec(t);if(!e)return Ot;const[n,r,o]=[e[1],e[2],e[3]].map(t=>parseInt(t,16)/255).map(t=>t<=.03928?t/12.92:((t+.055)/1.055)**2.4);return.2126*n+.7152*r+.0722*o<.25?"#f1efe8":Ot}function Tt({names:t,colors:e,side:n,ink:r}){return Nt("div",{style:{display:"flex",flexDirection:"right"===n?"column":"row",gap:24,justifyContent:"center",fontFamily:Rt,fontSize:28,color:r,padding:8},children:t.map((t,n)=>Pt("span",{style:{display:"inline-flex",alignItems:"center",gap:10,whiteSpace:"nowrap"},children:[Nt("span",{style:{width:22,height:22,background:e[n],display:"inline-block"}}),t]},n))})}function Vt({chart:t,w:e,h:n,ink:r}){const{categories:o,series:i}=ht(t),{kind:a}=t;if("pie"===a||"donut"===a){const r=i[0]?.values??[],l=r.reduce((t,e)=>t+Math.max(e,0),0)||1,s=Math.min(e,n)/2-8,c=e/2,h=n/2;let u=-Math.PI/2;const d=Bt(t,o.length);return Pt("svg",{width:e,height:n,viewBox:`0 0 ${e} ${n}`,role:"img","aria-label":"Chart",style:{display:"block"},children:[r.map((t,e)=>{const n=Math.max(t,0)/l*Math.PI*2,r=u;if(u+=n,n>=2*Math.PI-1e-6)return Nt("circle",{cx:c,cy:h,r:s,fill:d[e]},e);const o=n>Math.PI?1:0,i=t=>`${c+s*Math.cos(t)},${h+s*Math.sin(t)}`;return Nt("path",{d:`M${c},${h} L${i(r)} A${s},${s} 0 ${o} 1 ${i(u)} Z`,fill:d[e],stroke:"#ffffff",strokeWidth:4},e)}),"donut"===a&&Nt("circle",{cx:c,cy:h,r:.55*s,fill:"#ffffff"})]})}const l=(t=>Math.max(1,...t.flatMap(t=>t.values)))(i),s=Math.max(o.length,1);if("hbar"===a){const t=Math.min(240,.25*e),a=n/s,c=.7*a/Math.max(i.length,1),h=n=>Math.max(n,0)/l*(e-t-90);return Nt("svg",{width:e,height:n,viewBox:`0 0 ${e} ${n}`,role:"img","aria-label":"Chart",style:{display:"block"},children:o.map((e,n)=>Pt("g",{fontFamily:Rt,fontSize:30,fill:r,children:[Nt("text",{x:t-12,y:a*n+a/2+10,textAnchor:"end",children:e}),i.map((e,r)=>Pt(D,{children:[Nt("rect",{x:t,y:a*n+.15*a+c*r,width:h(e.values[n]??0),height:c,fill:e.color}),1===i.length&&Nt("text",{x:t+h(e.values[n]??0)+12,y:a*n+a/2+10,children:e.values[n]})]},r))]},n))})}const c=n-56,h=e/s,u=t=>c-Math.max(t,0)/l*(c-40),d=t=>h*t+h/2;return Pt("svg",{width:e,height:n,viewBox:`0 0 ${e} ${n}`,role:"img","aria-label":"Chart",style:{display:"block"},children:[i.map((t,e)=>{if("line"===a||"area"===a){const n=t.values.map((t,e)=>`${d(e)},${u(t)}`).join(" ");return Pt("g",{children:["area"===a&&Nt("polygon",{points:`${d(0)},${c} ${n} ${d(t.values.length-1)},${c}`,fill:t.color,fillOpacity:.35}),Nt("polyline",{fill:"none",stroke:t.color,strokeWidth:8,points:n})]},e)}const n=.7*h/i.length;return t.values.map((r,o)=>Nt("rect",{x:h*o+.15*h+n*e,y:u(r),width:n,height:c-u(r),fill:t.color},`${e}-${o}`))}),o.map((t,e)=>Pt("g",{fontFamily:Rt,fontSize:30,fill:r,textAnchor:"middle",children:[Nt("text",{x:d(e),y:n-14,children:t}),1===i.length&&Nt("text",{x:d(e),y:u(i[0].values[e]??0)-12,children:i[0].values[e]})]},e))]})}var Xt=["#534ab7","#1d9e75","#d85a30","#ef9f27","#378add","#d4537e","#5f5e5a","#97c459"];function Bt(t,e){const n=ht(t).series[0]?.color??t.color,r=Xt.filter(t=>t.toLowerCase()!==n.toLowerCase());return Array.from({length:e},(t,e)=>0===e?n:r[(e-1)%r.length])}function Zt({chart:t,ink:e=Ot}){const{categories:n,series:r}=ht(t),o="pie"===t.kind||"donut"===t.kind,i=t.legend??(o||r.length>1?"bottom":"none"),a=o?n:r.map(t=>t.name),l=o?Bt(t,n.length):r.map(t=>t.color);if("none"===i)return Nt(Vt,{chart:t,w:t.w,h:t.h,ink:e});const s="right"===i,c=s?Math.min(360,.3*t.w):t.w,h=s?t.h:64;return Pt("div",{style:{display:"flex",flexDirection:s?"row":"column",width:t.w,height:t.h},children:[Nt(Vt,{chart:t,w:s?t.w-c:t.w,h:s?t.h:t.h-h,ink:e}),Nt("div",{style:{width:s?c:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:Nt(Tt,{names:a,colors:l,side:i,ink:e})})]})}var Yt="#2c2c2a";function Jt({table:t,cellEditor:e,ink:n}){const r=t.fontSize??32,o=t.borderWidth??2,i=t.borderColor??"#b4b2a9",a=t.rows[0]?.length??0,{columnWidths:l,rowHeights:s}=t,c=s?.slice(0,t.rows.length).reduce((t,e)=>t+e,0)??0,h=e=>s?.[e]&&c?s[e]*(t.h-o)/c:void 0;return Pt("table",{style:{width:"100%",height:"100%",borderCollapse:"collapse",fontFamily:Rt,fontSize:r,lineHeight:t.fontSize?1.2:void 0,color:n&&n!==Ot?n:Yt,tableLayout:"fixed"},children:[l?.length===a&&Nt("colgroup",{children:l.map((t,e)=>Nt("col",{style:{width:100*t+"%"}},e))}),Nt("tbody",{children:t.rows.map((a,l)=>Nt("tr",{style:{height:h(l),background:0===l?t.headerFill:void 0,color:0===l?t.headerColor??(n&&n!==Ot?Yt:void 0):void 0,fontWeight:0===l?500:400},children:a.map((n,a)=>{const s=zt(t,l,a);return!s||s.row===l&&s.col===a?Nt("td",{"data-cell":`${l}:${a}`,rowSpan:s?.rows,colSpan:s?.cols,style:{border:o?`${o}px solid ${i}`:"none",padding:`${.25*r}px ${.5*r}px`,overflow:"hidden",background:t.cellFills?.[l]?.[a]??void 0,color:t.cellColors?.[l]?.[a]??void 0,verticalAlign:"top"},children:e?.(l,a)??n},a):null})},l))})]})}function qt({image:t}){if(!t.src)return Nt("div",{style:{width:"100%",height:"100%",background:"#f1efe8",border:"4px dashed #b4b2a9",boxSizing:"border-box"}});const e=t.crop??{left:0,top:0,right:0,bottom:0},n=Math.max(.05,1-e.left-e.right),r=Math.max(.05,1-e.top-e.bottom),o=e.left||e.top||e.right||e.bottom,i=Nt("img",{src:t.src,alt:t.alt,draggable:!1,style:o?{position:"absolute",width:100/n+"%",height:100/r+"%",left:-e.left/n*100+"%",top:-e.top/r*100+"%",objectFit:"fill",display:"block"}:{width:"100%",height:"100%",objectFit:"contain",display:"block"}});return Nt("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",opacity:t.opacity??1},children:i})}function Ut(t){if(!t)return null;const e=t.match(/(?:youtube\.com\/(?:watch\?(?:.*&)?v=|embed\/|shorts\/)|youtu\.be\/)([\w-]{6,})/);if(e)return{kind:"youtube",id:e[1]};const n=t.match(/vimeo\.com\/(?:video\/)?(\d+)/);return n?{kind:"vimeo",id:n[1]}:{kind:"file"}}function _t({video:t,live:e}){const n=Ut(t.src),r={width:"100%",height:"100%",border:0,display:"block",background:"#000"};if(e&&"youtube"===n?.kind)return Nt("iframe",{title:t.alt||"Video",src:`https://www.youtube-nocookie.com/embed/${n.id}`,style:r,allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0});if(e&&"vimeo"===n?.kind)return Nt("iframe",{title:t.alt||"Video",src:`https://player.vimeo.com/video/${n.id}`,style:r,allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0});if(e&&"file"===n?.kind)return Nt("video",{src:t.src,controls:!0,style:r,"aria-label":t.alt||"Video"});const o="youtube"===n?.kind?`https://img.youtube.com/vi/${n.id}/hqdefault.jpg`:null;return Pt("div",{style:{position:"relative",width:"100%",height:"100%",background:"#2c2c2a",overflow:"hidden"},children:[o&&Nt("img",{src:o,alt:t.alt,draggable:!1,style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}),Pt("svg",{viewBox:"0 0 100 100","aria-hidden":"true",style:{position:"absolute",left:"50%",top:"50%",width:140,height:140,marginLeft:-70,marginTop:-70},children:[Nt("circle",{cx:"50",cy:"50",r:"48",fill:"rgba(0,0,0,0.55)"}),Nt("polygon",{points:"40,30 72,50 40,70",fill:"#ffffff"})]})]})}function Qt({connector:t}){const{w:e,h:n,stroke:r,strokeWidth:o}=t,i=Math.max(4*o,14),a=e=>{const n="end"===e?t.end:t.start,o=function(t,e){const n="end"===e?t.end:t.start,r=n.attach?.side;if("straight"!==t.route&&r)return{n:Math.PI/2,e:Math.PI,s:-Math.PI/2,w:0}[r];const o="end"===e?t.start:t.end;if("elbow"===t.route){return(t.start.attach?"e"===t.start.attach.side||"w"===t.start.attach.side:Math.abs(t.end.x-t.start.x)>=Math.abs(t.end.y-t.start.y))?n.x>=o.x?0:Math.PI:n.y>=o.y?Math.PI/2:-Math.PI/2}return Math.atan2(n.y-o.y,n.x-o.x)}(t,e)+("start"===e?Math.PI:0),a=n.x-t.x,l=n.y-t.y,s=t=>`${a-i*Math.cos(o)+t*(i/2)*Math.sin(o)},${l-i*Math.sin(o)-t*(i/2)*Math.cos(o)}`;return Nt("polygon",{points:`${a},${l} ${s(1)} ${s(-1)}`,fill:r})};return Pt("svg",{width:Math.max(e,1),height:Math.max(n,1),viewBox:`0 0 ${Math.max(e,1)} ${Math.max(n,1)}`,"aria-hidden":"true",style:{display:"block",overflow:"visible"},children:[Nt("path",{d:O(t),fill:"none",stroke:r,strokeWidth:o,strokeLinejoin:"round"}),t.arrowStart&&a("start"),t.arrowEnd&&a("end")]})}function Gt({element:t,options:e={}}){switch(t.type){case"text":return Nt(st,{element:t,onLink:e.onLink});case"shape":return Nt(q,{shape:t});case"image":return Nt(qt,{image:t});case"video":return Nt(_t,{video:t,live:e.live});case"connector":return Nt(Qt,{connector:t});case"chart":return Nt(Zt,{chart:t,ink:e.ink});case"table":return Nt(Jt,{table:t,cellEditor:e.cellEditor,ink:e.ink})}}function Kt({slide:e,width:o,editingId:i,editor:a,number:l,motion:s,options:c}){const h=o/r,u=V(null);return function(t,e){T(()=>{const n=t.current;if(!n||!e)return;const r=[];for(const{animation:t,delay:o}of e.playing){const e=n.querySelector(`[data-element="${CSS.escape(t.elementId)}"]`);if(!e)continue;const i=xt(t),a={duration:1e3*t.duration,delay:1e3*o,fill:"both",easing:"ease-out"},l=t.byParagraph?[...e.querySelectorAll("[data-slide-paragraph]")]:[];l.length>1?(l.forEach((e,n)=>r.push(e.animate(i,{...a,delay:1e3*(o+n*t.duration)}))),e.style.visibility="visible"):r.push(e.animate(i,a))}return()=>r.forEach(t=>t.cancel())},[t,e])}(u,s),Nt("div",{style:{width:o,height:n*h,overflow:"hidden",position:"relative",background:e.background},children:Pt("div",{ref:u,style:{width:r,height:n,transform:`scale(${h})`,transformOrigin:"0 0",position:"absolute",left:0,top:0},children:[e.elements.map(t=>Nt("div",{"data-element":t.id,style:{...Wt(t),visibility:s?.hidden.has(t.id)?"hidden":void 0},children:t.id===i?a:Nt(Gt,{element:t,options:{...c,ink:Dt(e.background)}})},t.id)),void 0!==l&&Nt("div",{style:{position:"absolute",right:60,bottom:36,fontFamily:`${t}, sans-serif`,fontSize:28,color:Dt(e.background)===Ot?"#888780":"#b4b2a9"},children:l})]})})}export{s as shapePath,c as PPTX_SHAPES,u as paragraphsOf,d as plainText,f as withParagraphs,y as applyStyle,w as styleAt,x as paragraphsIn,v as setParagraphs,b as toggleList,M as indent,k as listMarkers,j as readParagraphs,z as selectionOffsets,L as restoreSelection,ot as boxStyle,ct as editorHtml,ht as seriesOf,ut as chartToGrid,dt as gridToChart,N as nearestSide,R as withEnds,W as relayConnectors,O as connectorPath,ft as DEFAULT_TRANSITION_SECONDS,pt as newAnimation,mt as clicksOf,wt as stateAt,vt as transitionKeyframes,bt as shownSlides,Mt as moveAnimation,At as insertRow,It as removeRow,Ht as insertColumn,jt as removeColumn,zt as mergeAt,Lt as mergeCells,Et as unmergeCell,Ft as setCell,Rt as SLIDE_FONT,Ut as videoSource,Kt as SlideView};
|
package/dist/chunk-BGAR3P46.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ENGLISH_WORDS as t}from"./chunk-PXOQN7D6.js";import{createContext as e,useContext as r}from"react";import{jsx as o}from"react/jsx-runtime";var n=class extends Error{},a="efficient-office:slides",c=()=>{try{return JSON.parse(localStorage.getItem(a)??"{}")}catch{return{}}},s=t=>localStorage.setItem(a,JSON.stringify(t)),i={list:async()=>Object.values(c()).map(({id:t,title:e,updatedAt:r})=>({id:t,title:e,updatedAt:r})).sort((t,e)=>e.updatedAt.localeCompare(t.updatedAt)),get:async t=>{const e=c()[t];if(!e)throw new Error("No such deck");return e},create:async t=>{const e=(new Date).toISOString(),r={id:crypto.randomUUID(),title:t,document:{},version:crypto.randomUUID(),updatedAt:e};return s({...c(),[r.id]:r}),r},rename:async(t,e)=>{const r=c();r[t]&&s({...r,[t]:{...r[t],title:e,updatedAt:(new Date).toISOString()}})},save:async(t,e,r)=>{const o=c();if(!o[t]||o[t].version!==r)throw new n;const a=crypto.randomUUID();return s({...o,[t]:{...o[t],document:e,version:a,updatedAt:(new Date).toISOString()}}),a},remove:async t=>{const{[t]:e,...r}=c();s(r)}},d=e({store:i});function u({value:t,children:e}){return o(d.Provider,{value:t,children:e})}var l=()=>r(d),m=()=>r(d).words??t;export{n as SlidesConflict,i as browserSlidesStore,u as SlidesProvider,l as useSlidesHost,m as useSlidesWords};
|
package/dist/chunk-COXKOQPZ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{BUILTIN_STYLES as t,DEFAULT_PAGE as e,REL as n,child as r,childrenOf as a,descendants as o,paraCss as s,parseParaProps as l,parseRunProps as c,parseXml as i,partText as d,readRels as w,readThemeFonts as m,readZip as p,resolveTarget as f,runCss as u}from"./chunk-RHW2M2UY.js";import{escapeHtml as b}from"efficient-shell/ui";var h={textBox:"Text box",chart:"Chart",diagram:"Diagram",equation:"Equation",picture:"Picture",object:"Object",contents:"Field"},g=new Set(["w:ins","w:del","w:moveFrom","w:moveTo","w:rPrChange","w:pPrChange","w:tcPrChange","w:trPrChange","w:tblPrChange","w:sectPrChange","w:cellIns","w:cellDel"]),$=new Set(["w:ins","w:del","w:moveFrom","w:moveTo"]),v={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",webp:"image/webp",svg:"image/svg+xml"},x=/^(https?:|mailto:|tel:)/i,k=t=>b(t);function y(t,e){let n="";for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));return`data:${e};base64,${btoa(n)}`}var P=(t,e)=>`${e}${++t.nextId}`,j=(t,e)=>t.src.slice(e.start,e.end),C=(t,e)=>e?j(t,e):void 0;function S(t,e){const n=[],a=new Set;let o=e;for(;o&&!a.has(o);){a.add(o);const e=t.styles.get(o);if(!e)break;n.unshift(e),o=r(e,"w:basedOn")?.attrs["w:val"]}return n}var I=t=>`"${t.replace(/["\\\n\r]/g,"")}"`;function M(t){return"w:t"===t.name||"w:delText"===t.name?t.text:"w:tab"===t.name?"\t":"w:instrText"===t.name||"w:instrDelText"===t.name?"":t.children.map(M).join("")}function T(t,e,n,r,a=""){const o=P(t,"x");return t.doc.raw.set(o,e),`<span data-raw="${o}" data-kind="${n}" contenteditable="false"${a}>${b(r)}</span>`}function N(t,e){const n=P(t,"x");return t.doc.raw.set(n,e),`<span data-raw="${n}" data-kind="mark"></span>`}function B(t,e,n){const a=n(j(t,e)),s=t=>o(e,new Set([t])).length>0,l=r(e,"wp:inline"),c=o(e,new Set(["a:blip"]))[0],i=c&&t.rels.get(c.attrs["r:embed"]),d=i&&!i.external?f(t.doc.docPath,i.target):void 0,w=d?.split(".").pop()?.toLowerCase()??"",m=d?t.doc.parts.get(d):void 0;if(m&&v[w]&&!s("wps:txbx")){const n=P(t,"x");t.doc.raw.set(n,a);const o=r(l??r(e,"wp:anchor"),"wp:extent"),s=Number(o?.attrs.cx)/12700,c=Number(o?.attrs.cy)/12700,i=s&&c?` style="width:${Math.round(100*s)/100}pt;height:${Math.round(100*c)/100}pt"`:"",d=l?"":' contenteditable="false"';return l||t.doc.notices.objects++,`<img data-raw="${n}" src="${k(t.imageUrl(m,v[w]))}"${i}${d} alt="">`}return t.doc.notices.objects++,s("wps:txbx")||s("w:txbxContent")?T(t,a,"object",`${t.labels.textBox}: ${M(e).slice(0,80)}`):s("c:chart")?T(t,a,"object",t.labels.chart):s("dgm:relIds")?T(t,a,"object",t.labels.diagram):T(t,a,"object",c?t.labels.picture:t.labels.object)}function A(t,e){const n=r(e,"w:rPr"),a=c(n,t.theme),s=C(t,n)??"",l=t=>`<w:r>${s}${t}</w:r>`;let i="";for(const n of e.children)switch(n.name){case"w:rPr":case"w:lastRenderedPageBreak":case"w:commentReference":case"w:fldChar":case"w:instrText":case"w:delInstrText":break;case"w:t":case"w:delText":i+=b(n.text);break;case"w:tab":i+="\t";break;case"w:noBreakHyphen":i+="‑";break;case"w:softHyphen":i+="";break;case"w:br":case"w:cr":"page"===n.attrs["w:type"]?i+='<span data-page-break contenteditable="false"></span>':"column"===n.attrs["w:type"]?i+=T(t,l(j(t,n)),"mark",""):i+="<br>";break;case"w:drawing":i+=B(t,n,l);break;case"mc:AlternateContent":case"w:pict":case"w:object":t.doc.notices.objects++,i+=T(t,l(j(t,n)),"object",o(n,new Set(["wps:txbx","w:txbxContent","v:textbox"])).length?`${t.labels.textBox}: ${M(o(n,new Set(["wps:txbx","w:txbxContent","v:textbox"]))[0]).slice(0,80)}`:t.labels.object);break;case"w:footnoteReference":case"w:endnoteReference":{const e=++t.footnoteCount;t.doc.notices.footnotes++;const r=t.footnotes.get(n.attrs["w:id"]);i+=T(t,l(j(t,n)),"note",String(e),r?` title="${k(r)}"`:"");break}default:i+=T(t,l(j(t,n)),"mark","")}if(!i)return"";if(a.vert&&(i=`<${"sub"===a.vert?"sub":"sup"}>${i}</${"sub"===a.vert?"sub":"sup"}>`),n){const e=P(t,"r");t.doc.runs.set(e,s);const o=u(a),l=r(n,"w:rStyle")?.attrs["w:val"];i=`<span data-r="${e}"${l?` data-rstyle="${k(l)}"`:""}${o?` style="${k(o)}"`:""}>${i}</span>`}for(const e of t.openComments)i=`<span data-comment="${k(e)}" title="${k(t.comments.get(e)??"")}">${i}</span>`;return i}function E(t,e){let n="",r=0,o=-1,s=-1,l="",c=!1;const i=()=>{o>=0&&(n+=T(t,t.src.slice(o,s),"field",l||t.labels.contents)),o=-1,l="",c=!1};for(const d of e){if("w:r"===d.name){const e=a(d,"w:fldChar");if(e.length||r>0){0===r&&(o=d.start,c=!1),c&&(l+=M(d));for(const t of e){const e=t.attrs["w:fldCharType"];"begin"===e?r++:"separate"===e&&1===r?c=!0:"end"===e&&r--}s=d.end,0===r&&i();continue}n+=A(t,d);continue}if(r>0)s=d.end;else switch(d.name){case"w:pPr":case"w:proofErr":break;case"w:commentRangeStart":t.openComments.add(d.attrs["w:id"]);break;case"w:commentRangeEnd":t.openComments.delete(d.attrs["w:id"]);break;case"w:hyperlink":{const e=d.attrs["r:id"]?t.rels.get(d.attrs["r:id"]):void 0,r=d.attrs["w:anchor"],a=e?.target??(r?`#${r}`:""),o=x.test(a)||a.startsWith("#"),s=`${e?` data-rel="${k(d.attrs["r:id"])}"`:""}${r?` data-anchor="${k(r)}"`:""}`;n+=`<a${o?` href="${k(a)}"`:""}${s}>${E(t,d.children)}</a>`;break}case"w:ins":case"w:moveTo":n+=`<ins>${E(t,d.children)}</ins>`;break;case"w:del":case"w:moveFrom":n+=`<del>${E(t,d.children)}</del>`;break;case"w:bookmarkStart":case"w:bookmarkEnd":case"w:permStart":case"w:permEnd":default:n+=N(t,j(t,d));break;case"m:oMath":case"m:oMathPara":t.doc.notices.objects++,n+=T(t,j(t,d),"object",t.labels.equation);break;case"w:fldSimple":case"w:sdt":case"w:smartTag":case"w:customXml":n+=T(t,j(t,d),"field",M(d)||t.labels.contents)}}return r>0&&(n+=b(l)),n}function R(t){return o(t,g).length>0}function F(t,e){const n=r(e,"w:pPr"),a=r(n,"w:pStyle")?.attrs["w:val"],o=r(n,"w:numPr")??function(t,e){let n;for(const a of S(t,e))n=r(r(a,"w:pPr"),"w:numPr")??n;return n}(t,a),s=r(o,"w:numId")?.attrs["w:val"];if(!s||"0"===s)return null;const l=Number(r(o,"w:ilvl")?.attrs["w:val"]??0),c=t.numbering.get(s)?.get(l);return{numId:s,ilvl:l,ordered:c?.ordered??!1,marker:c?.marker??""}}function L(t){const e=[],n=r(t,"w:pBdr");for(const t of["top","bottom","left","right"]){const a=r(n,`w:${t}`);if(!a||"nil"===a.attrs["w:val"]||"none"===a.attrs["w:val"])continue;const o=/^[0-9a-fA-F]{6}$/.test(a.attrs["w:color"]??"")?`#${a.attrs["w:color"]}`:"currentcolor";e.push(`border-${t}:${(Number(a.attrs["w:sz"])||4)/8}pt solid ${o}`)}const a=r(t,"w:shd")?.attrs["w:fill"];return a&&/^[0-9a-fA-F]{6}$/.test(a)&&e.push(`background-color:#${a}`),e.join(";")}function O(t,e,n){const a=r(e,"w:pPr"),c=r(a,"w:pStyle")?.attrs["w:val"],i=t.fieldOpen,d=function(t){let e=0;for(const n of o(t,new Set(["w:fldChar"]))){const t=n.attrs["w:fldCharType"];"begin"===t?e++:"end"===t&&e--}return e}(e),w=R(e)||i||0!==d;d>0&&(t.fieldOpen=!0),i&&d<0&&(t.fieldOpen=!1);const m=P(t,"p");t.doc.blocks.set(m,{xml:j(t,e),fingerprint:"",props:C(t,a),numId:n?.numId,ilvl:n?.ilvl});const p=n?0:function(t,e){if(!e)return 0;const n=r(t.styles.get(e),"w:name")?.attrs["w:val"]??"",a=/^heading ([1-6])$/i.exec(n);return a?Number(a[1]):0}(t,c),f=n?"li":p?`h${p}`:"p",u=l(a);n&&delete u.indentLeft,n&&delete u.firstLine;const b=[s(u),L(a)].filter(Boolean).join(";");let h=w?D(t,e):E(t,e.children);h&&!/<br>(<\/[^>]+>)*$/.test(h)||(h+="<br>");return`<${f} data-docx="${m}"${r(a,"w:pageBreakBefore")?" data-break-before":""}${c?` data-pstyle="${k(c)}"`:""}${b?` style="${k(b)}"`:""}${w?' data-locked contenteditable="false"':""}>${h}</${f}>`}function D(t,e){let n="";for(const r of e.children)"w:pPr"!==r.name&&"w:rPr"!==r.name&&"w:instrText"!==r.name&&"w:delInstrText"!==r.name&&("w:ins"===r.name||"w:moveTo"===r.name?n+=`<ins>${D(t,r)}</ins>`:"w:del"===r.name||"w:moveFrom"===r.name?n+=`<del>${D(t,r)}</del>`:"w:commentRangeStart"===r.name?t.openComments.add(r.attrs["w:id"]):"w:commentRangeEnd"===r.name?t.openComments.delete(r.attrs["w:id"]):"w:t"===r.name||"w:delText"===r.name?n+=b(r.text):"w:tab"===r.name?n+="\t":"w:br"===r.name?n+="<br>":"w:drawing"===r.name||"mc:AlternateContent"===r.name||"w:pict"===r.name?n+=`<span data-kind="object">${b(t.labels.object)}</span>`:n+=D(t,r));return n}function H(t,e){const n=P(t,"t"),o=r(e,"w:tblPr"),s=r(e,"w:tblGrid"),l=a(e,"w:tr"),c=l.some(t=>r(r(t,"w:trPr"),"w:gridBefore")||r(r(t,"w:trPr"),"w:gridAfter")),i=R(e)||c;c&&t.doc.notices.objects++,t.doc.blocks.set(n,{xml:j(t,e),fingerprint:"",props:C(t,o),tblGrid:C(t,s)});const d=r(o,"w:tblStyle")?.attrs["w:val"],w=a(s,"w:gridCol").map(t=>Number(t.attrs["w:w"])/20),m=new Map,p=l.map(t=>{const e=[];let n=0;for(const o of a(t,"w:tc")){const t=r(o,"w:tcPr"),a=Number(r(t,"w:gridSpan")?.attrs["w:val"]??1),s=r(t,"w:vMerge");if(s&&"restart"!==s.attrs["w:val"]&&m.has(n))m.get(n).rowSpan++;else{const t={node:o,rowSpan:1,col:n,span:a};e.push(t),s?m.set(n,t):m.delete(n)}n+=a}return e}),f=function(t,e,n){let a=r(e,"w:tblBorders");if(!a)for(const e of S(t,n))a=r(r(e,"w:tblPr"),"w:tblBorders")??a;return!!a&&a.children.some(t=>!["nil","none"].includes(t.attrs["w:val"]))}(t,o,d),u=l.map((e,n)=>{const a=P(t,"t");t.doc.blocks.set(a,{xml:"",fingerprint:"",props:C(t,r(e,"w:trPr"))});return`<tr data-docx="${a}">${p[n].map(e=>{const n=P(t,"t"),a=r(e.node,"w:tcPr");t.doc.blocks.set(n,{xml:"",fingerprint:"",props:C(t,a)});const o=r(a,"w:shd")?.attrs["w:fill"],s=[];o&&/^[0-9a-fA-F]{6}$/.test(o)&&s.push(`background-color:#${o.toLowerCase()}`);const l=r(a,"w:vAlign")?.attrs["w:val"];return"center"===l&&s.push("vertical-align:middle"),"bottom"===l&&s.push("vertical-align:bottom"),`<td data-docx="${n}"${e.span>1?` colspan="${e.span}"`:""}${e.rowSpan>1?` rowspan="${e.rowSpan}"`:""}${s.length?` style="${s.join(";")}"`:""}>${U(t,e.node.children)}</td>`}).join("")}</tr>`}).join(""),b=w.length?`<colgroup>${w.map(t=>`<col style="width:${Math.round(100*t)/100}pt">`).join("")}</colgroup>`:"";return`<table data-docx="${n}"${d?` data-tstyle="${k(d)}"`:""}${f?"":" data-no-borders"}${i?' data-locked contenteditable="false"':""}>${b}<tbody>${u}</tbody></table>`}function U(t,e){const n=[],o=[],s=t=>{for(;o.length>t;){const t=o.pop();n.push(`</li></${t.tag}>`)}};for(const l of e){const e="w:p"===l.name?F(t,l):null;if(e){for(;o.length&&o[o.length-1].ilvl>e.ilvl;)s(o.length-1);const r=o[o.length-1];!r||r.ilvl!==e.ilvl||r.numId===e.numId&&r.tag===(e.ordered?"ol":"ul")||s(o.length-1);const a=`${e.numId}:${e.ilvl}`,c=t.listCounters.get(a)??0;t.listCounters.set(a,c+1);const i=O(t,l,e),d=o[o.length-1];if(d&&d.ilvl===e.ilvl)n.push(`</li>${i.slice(0,i.lastIndexOf("</li>"))}`);else{const t=e.ordered?"ol":"ul",r=e.marker?` style="list-style-type:${e.marker}"`:"",a=e.ordered&&c?` start="${c+1}"`:"";n.push(`<${t} data-num-id="${k(e.numId)}" data-ilvl="${e.ilvl}"${a}${r}>${i.slice(0,i.lastIndexOf("</li>"))}`),o.push({tag:t,numId:e.numId,ilvl:e.ilvl})}continue}if("w:tcPr"!==l.name&&"w:sectPr"!==l.name)if(s(0),"w:p"===l.name)n.push(O(t,l,null));else if("w:tbl"===l.name)n.push(H(t,l));else if("w:sdt"===l.name){const e=P(t,"p");t.doc.blocks.set(e,{xml:j(t,l),fingerprint:""}),t.doc.notices.objects++;const o=U(t,a(r(l,"w:sdtContent"),"w:p"));n.push(`<div data-docx="${e}" data-locked contenteditable="false">${o}</div>`)}else{const e=P(t,"p");t.doc.blocks.set(e,{xml:j(t,l),fingerprint:""}),n.push(`<div data-docx="${e}" data-locked data-hidden contenteditable="false"></div>`)}}return s(0),n.join("")}function z(t){if("LI"!==t.tagName)return t.outerHTML;const e=t.cloneNode(!0);return Array.from(e.children).forEach(t=>{"UL"!==t.tagName&&"OL"!==t.tagName||t.remove()}),e.outerHTML}function q(t){const e=document.createElement("div");e.innerHTML=t.html,e.querySelectorAll("[data-docx]").forEach(e=>{const n=t.blocks.get(e.getAttribute("data-docx"));n&&(n.fingerprint=z(e))})}function W(t,e){const n=e?d(t,e):void 0;if(!n)return{text:"",editable:!0};const r=i(n),a=r.children.filter(t=>"w:p"===t.name),s=r.children.every(t=>"w:p"===t.name)&&0===o(r,new Set(["w:drawing","w:pict","mc:AlternateContent","w:sdt"])).length,l=a.map(t=>{let e="",n="",r=!1;const a=t=>{for(const o of t.children)if("w:t"===o.name)r||(e+=o.text);else if("w:tab"===o.name)r||(e+=" | ");else if("w:instrText"===o.name)n+=o.text;else if("w:fldChar"===o.name){const t=o.attrs["w:fldCharType"];"separate"!==t&&"end"!==t||(n&&(e+=G(n),n=""),r="separate"===t)}else"w:fldSimple"===o.name?e+=G(o.attrs["w:instr"]??"")||o.children.map(M).join(""):"w:pPr"!==o.name&&"w:rPr"!==o.name&&a(o)};return a(t),e}).filter(Boolean);return{text:l.join(" "),editable:s&&l.length<=1,part:e}}function G(t){const e=t.trim().split(/\s+/)[0]?.toUpperCase();return"PAGE"===e?"{page}":"NUMPAGES"===e?"{pages}":""}async function X(t,e={}){return Y(await p(t),t,e)}function Y(p,b,g={}){const v=w(p,"").find(t=>t.type.endsWith("/officeDocument")),x=v?f("",v.target):"word/document.xml",k=d(p,x);if(!k)throw new Error("Not a Word document");const P=i(k),j=r(P,"w:body");if(!j)throw new Error("Not a Word document");const C=w(p,x),T=t=>{const e=(t=>C.find(e=>e.type===t))(t);return e?f(x,e.target):void 0},N=m(T(n.theme)?d(p,T(n.theme)):void 0),B={parts:p,docPath:x,source:b,html:"",css:"",page:{...e},header:{text:"",editable:!0},footer:{text:"",editable:!0},blocks:new Map,runs:new Map,raw:new Map,notices:{comments:0,tracked:0,objects:0,footnotes:0},styles:[],theme:N},A={src:k,doc:B,labels:g.labels??h,rels:new Map(C.map(t=>[t.id,t])),theme:N,imageUrl:g.imageUrl??y,styles:new Map,numbering:new Map,listCounters:new Map,comments:new Map,footnotes:new Map,nextId:0,footnoteCount:0,openComments:new Set,fieldOpen:!1},E=T(n.styles),R=E?d(p,E):void 0,F=R?i(R):void 0;for(const t of a(F,"w:style"))A.styles.set(t.attrs["w:styleId"],t);const L=new Set(A.styles.keys());for(const[e,n]of Object.entries(t))L.has(e)||A.styles.set(e,i(n.xml));const O=r(F,"w:docDefaults");B.lang=r(r(r(O,"w:rPrDefault"),"w:rPr"),"w:lang")?.attrs["w:val"],B.css=function(t,e){const n=[],a=c(r(r(e,"w:rPrDefault"),"w:rPr"),t.theme),o=l(r(r(e,"w:pPrDefault"),"w:pPr"));t.doc.defaultFont=a.font,t.doc.defaultSize=a.size;let i=a,d=o;for(const[e,w]of t.styles){const m=w.attrs["w:type"];if("paragraph"!==m&&"character"!==m&&"table"!==m)continue;let p={},f={};for(const n of S(t,e))p={...p,...c(r(n,"w:rPr"),t.theme)},f={...f,...l(r(n,"w:pPr"))};if("paragraph"===m)n.push(`.docs-page [data-pstyle=${I(e)}]{${[u(p),s(f)].filter(Boolean).join(";")}}`),"1"===w.attrs["w:default"]&&(i={...a,...p},d={...o,...f});else if("character"===m)n.push(`.docs-page [data-rstyle=${I(e)}]{${u(p)}}`);else{const t=s(f);t&&n.push(`.docs-page table[data-tstyle=${I(e)}] p{${t}}`)}}return n.unshift(`.docs-page{${u(i)}}`,`.docs-page p,.docs-page h1,.docs-page h2,.docs-page h3,.docs-page h4,.docs-page h5,.docs-page h6,.docs-page li{${s(d)}}`),n.join("\n")}(A,O);const D=new Set(Object.keys(t));B.styles=[...A.styles.values()].filter(t=>"paragraph"===t.attrs["w:type"]&&"1"!==t.attrs["w:default"]&&(D.has(t.attrs["w:styleId"])||r(t,"w:qFormat"))&&!r(t,"w:hidden")&&!r(t,"w:semiHidden")).map(t=>({id:t.attrs["w:styleId"],name:r(t,"w:name")?.attrs["w:val"]??t.attrs["w:styleId"]}));const H=T(n.numbering),z=H?d(p,H):void 0;z&&function(t,e){const n=new Map;for(const t of a(e,"w:abstractNum")){const e=new Map;for(const n of a(t,"w:lvl")){const t=r(n,"w:numFmt")?.attrs["w:val"]??"decimal";e.set(Number(n.attrs["w:ilvl"]),{ordered:"bullet"!==t&&"none"!==t,marker:Z[t]??""})}n.set(t.attrs["w:abstractNumId"],e)}for(const o of a(e,"w:num")){const e=n.get(r(o,"w:abstractNumId")?.attrs["w:val"]??"");e&&t.numbering.set(o.attrs["w:numId"],e)}}(A,i(z));const G=T(n.comments),X=G?d(p,G):void 0;if(X){for(const t of a(i(X),"w:comment"))A.comments.set(t.attrs["w:id"],`${t.attrs["w:author"]??""}: ${M(t)}`);B.notices.comments=A.comments.size}const Y=T(n.footnotes),J=Y?d(p,Y):void 0;if(J)for(const t of a(i(J),"w:footnote"))A.footnotes.set(t.attrs["w:id"],M(t));B.notices.tracked=o(j,$).length;const K=r(j,"w:sectPr"),Q=r(K,"w:pgSz"),V=r(K,"w:pgMar"),_=(t,e,n)=>{const r=Number(t?.attrs[e]);return Number.isFinite(r)&&void 0!==t?.attrs[e]?r:n};B.page={width:_(Q,"w:w",e.width),height:_(Q,"w:h",e.height),top:Math.abs(_(V,"w:top",e.top)),right:_(V,"w:right",e.right),bottom:Math.abs(_(V,"w:bottom",e.bottom)),left:_(V,"w:left",e.left),header:_(V,"w:header",e.header),footer:_(V,"w:footer",e.footer)};const tt=t=>{const e=a(K,t).find(t=>"default"===t.attrs["w:type"]),n=e&&A.rels.get(e.attrs["r:id"]);return n?f(x,n.target):void 0};return B.header=W(p,tt("w:headerReference")),B.footer=W(p,tt("w:footerReference")),B.html=U(A,j.children),B.html||(B.html="<p><br></p>"),q(B),B}var Z={lowerLetter:"lower-alpha",upperLetter:"upper-alpha",lowerRoman:"lower-roman",upperRoman:"upper-roman",decimalZero:"decimal-leading-zero"};export{z as fingerprintOf,q as stampFingerprints,X as readDocx,Y as readParts};
|
package/dist/chunk-I3AC6PYR.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ENGLISH_FILE_WORDS as e,ZH_HANS_FILE_WORDS as t}from"./chunk-B32ASXHM.js";var o={pdfPageFailed:e=>`Page ${e} couldn't be drawn for the PDF.`,files:e,fileKind:"Word",backToFiles:"Back to files",filesHeading:"Documents",newFile:"New document",openFile:"Open a file",filesEmptyTitle:"Write your first document",filesEmptyBody:"Every change saves by itself.",deleteFile:"Delete",createFailed:"The document could not be made.",deleteFailed:"The document could not be deleted.",deleteConfirm:e=>`Delete "${e}"? Nobody can open it again.`,documentName:"Document name",documentPanel:"Document",pagePanel:"Page",outline:"Outline",outlineEmpty:"Headings in the document show here.",morePageSetup:"More page setup",export:"Export",renameFailed:"The document could not be renamed.",openFailed:"This document could not be opened.",conflict:"Somebody else saved this document, so your latest changes are not saved. Reload to see theirs.",reload:"Reload",noStoreEdited:"Not saved. Export to keep your changes",noStoreClean:"No autosave here. Export to keep a copy",openFromFiles:"Go back to your files to open another document.",untitled:"Untitled",loading:"Loading",newDocument:"New",open:"Open",rename:"Rename",menuFile:"File",menuInsert:"Insert",menuLayout:"Layout",save:"Save",saveDocx:"Save (.docx)",saveKeepType:"Save",saveAs:"Save as",saveAsWord:"Word document (.docx)",saveAsPdf:"PDF (from the print dialog)",saveAsWeb:"Web page (.html)",saveAsText:"Plain text (.txt)",print:"Print",undo:"Undo",redo:"Redo",find:"Find",replaceWith:"Replace with",replace:"Replace",replaceAll:"Replace all",matchCase:"Match case",previousMatch:"Previous match",nextMatch:"Next match",closeFind:"Close find",noMatches:"No matches",paragraphStyle:"Paragraph style",font:"Font",fontSize:"Font size",bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",superscript:"Superscript",subscript:"Subscript",textColor:"Text color",highlight:"Highlight color",clearFormatting:"Clear formatting",bulletedList:"Bulleted list",numberedList:"Numbered list",decreaseIndent:"Decrease indent",increaseIndent:"Increase indent",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",justify:"Justify",lineSpacing:"Line spacing",styleNormal:"Normal",styleTitle:"Title",styleHeading1:"Heading 1",styleHeading2:"Heading 2",styleHeading3:"Heading 3",styleQuote:"Quote",table:"Table",image:"Image",link:"Link",linkPrompt:"Web address, or leave empty to remove the link.",linkInvalid:"That address can't be used as a link.",pageBreak:"Page break",pageNumber:"Page number",horizontalLine:"Horizontal line",rowAbove:"Insert row above",rowBelow:"Insert row below",columnLeft:"Insert column left",columnRight:"Insert column right",mergeCells:"Merge cells",mergeFailed:"These cells can't be merged: the selection would cut a merged cell.",cellShading:"Cell shading",noColor:"No color",deleteRow:"Delete row",deleteColumn:"Delete column",deleteTable:"Delete table",imageWidth:"Image width",imageOriginalSize:"Original size",imageRemove:"Remove image",pageSetup:"Page setup",paperSize:"Size",paperLetter:"US Letter",paperLegal:"US Legal",custom:"Custom",orientation:"Orientation",portrait:"Portrait",landscape:"Landscape",margins:"Margins",marginsNormal:"Normal, 2.54 cm",marginsNarrow:"Narrow, 1.27 cm",marginsModerate:"Moderate, 1.91 cm sides",marginsWide:"Wide, 5.08 cm sides",header:"Header",footer:"Footer",headerFooterHint:"{page} and {pages} become page numbers. A | pushes the text after it to the right.",headerFooterLocked:"This one holds a picture or a table, so it is kept as it is. Edit it in Word.",ok:"OK",cancel:"Cancel",dismiss:"Dismiss",zoomIn:"Zoom in",zoomOut:"Zoom out",wrapLines:"Wrap lines",objectTextBox:"Text box",objectChart:"Chart from Word. Kept as is.",objectDiagram:"Diagram from Word. Kept as is.",objectEquation:"Equation from Word. Kept as is.",objectPicture:"Picture from Word. Kept as is.",objectOther:"Object from Word. Kept as is.",objectField:"Field",discardMessage:"They haven't been saved.",discard:"Discard",keepEditing:"Keep editing",legacyDoc:".doc is the old Word format. Save it as .docx in Word first.",openedOldSave:"Opened as a document. Save it to get a Word file.",saveFailed:"The document could not be saved.",savedAsUtf8:"Saved as UTF-8: the original encoding can't be written from a browser.",dropHint:"Drop a document to open. Images insert into the page.",matchCount:(e,t)=>`${e} of ${t}`,replacedCount:e=>1===e?"1 replacement":`${e} replacements`,tableSize:(e,t)=>`${e} × ${t}`,pageLabel:e=>`Page ${e}`,pageOf:(e,t)=>`Page ${e} of ${t}`,wordCount:e=>1===e?"1 word":`${e.toLocaleString()} words`,lineColumn:(e,t)=>`Ln ${e}, Col ${t}`,lineCount:e=>1===e?"1 line":`${e.toLocaleString()} lines`,noticeComments:e=>1===e?"1 comment":`${e} comments`,noticeTracked:e=>1===e?"1 tracked change":`${e} tracked changes`,noticeObjects:e=>1===e?"1 object such as a text box":`${e} objects such as text boxes`,noticeFootnotes:e=>1===e?"1 footnote":`${e} footnotes`,noticeLead:e=>`Has ${e.length>1?`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`:e[0]}. They stay in the file, but need Word to edit.`,discardTitle:e=>`Discard your changes to ${e}?`,cannotRead:e=>`${e} can't be opened. It may be damaged or password protected.`,unsupported:e=>`Unsupported file type: .${e||"unknown"}`},a={pdfPageFailed:e=>`第 ${e} 页无法绘制到 PDF。`,files:t,fileKind:"Word",backToFiles:"返回文件",filesHeading:"文档",newFile:"新建文档",openFile:"打开文件",filesEmptyTitle:"写下您的第一份文档",filesEmptyBody:"每次更改都会自动保存。",deleteFile:"删除",createFailed:"无法创建文档。",deleteFailed:"无法删除文档。",deleteConfirm:e=>`删除“${e}”?之后任何人都无法再打开它。`,documentName:"文档名称",documentPanel:"文档",pagePanel:"页面",outline:"大纲",outlineEmpty:"文档中的标题会显示在这里。",morePageSetup:"更多页面设置",export:"导出",renameFailed:"无法重命名文档。",openFailed:"无法打开此文档。",conflict:"其他人已保存此文档,您最近的更改尚未保存。请重新加载以查看他们的版本。",reload:"重新加载",noStoreEdited:"未保存。请导出以保留更改",noStoreClean:"此处不会自动保存。请导出以保留副本",openFromFiles:"请返回文件列表以打开其他文档。",untitled:"未命名",loading:"正在加载",newDocument:"新建",open:"打开",rename:"重命名",menuFile:"文件",menuInsert:"插入",menuLayout:"布局",save:"保存",saveDocx:"保存 (.docx)",saveKeepType:"保存",saveAs:"另存为",saveAsWord:"Word 文档 (.docx)",saveAsPdf:"PDF(通过打印对话框)",saveAsWeb:"网页 (.html)",saveAsText:"纯文本 (.txt)",print:"打印",undo:"撤销",redo:"重做",find:"查找",replaceWith:"替换为",replace:"替换",replaceAll:"全部替换",matchCase:"区分大小写",previousMatch:"上一个匹配项",nextMatch:"下一个匹配项",closeFind:"关闭查找",noMatches:"无匹配项",paragraphStyle:"段落样式",font:"字体",fontSize:"字号",bold:"加粗",italic:"倾斜",underline:"下划线",strikethrough:"删除线",superscript:"上标",subscript:"下标",textColor:"文字颜色",highlight:"突出显示颜色",clearFormatting:"清除格式",bulletedList:"项目符号列表",numberedList:"编号列表",decreaseIndent:"减少缩进",increaseIndent:"增加缩进",alignLeft:"左对齐",alignCenter:"居中",alignRight:"右对齐",justify:"两端对齐",lineSpacing:"行距",styleNormal:"正文",styleTitle:"标题",styleHeading1:"标题 1",styleHeading2:"标题 2",styleHeading3:"标题 3",styleQuote:"引用",table:"表格",image:"图片",link:"链接",linkPrompt:"输入网址;留空则移除链接。",linkInvalid:"该地址不能用作链接。",pageBreak:"分页符",pageNumber:"页码",horizontalLine:"水平线",rowAbove:"在上方插入行",rowBelow:"在下方插入行",columnLeft:"在左侧插入列",columnRight:"在右侧插入列",mergeCells:"合并单元格",mergeFailed:"无法合并这些单元格:所选范围会切开已合并的单元格。",cellShading:"单元格底纹",noColor:"无颜色",deleteRow:"删除行",deleteColumn:"删除列",deleteTable:"删除表格",imageWidth:"图片宽度",imageOriginalSize:"原始大小",imageRemove:"移除图片",pageSetup:"页面设置",paperSize:"纸张大小",paperLetter:"美国信纸",paperLegal:"美国法律用纸",custom:"自定义",orientation:"方向",portrait:"纵向",landscape:"横向",margins:"页边距",marginsNormal:"常规,2.54 厘米",marginsNarrow:"窄,1.27 厘米",marginsModerate:"中等,左右 1.91 厘米",marginsWide:"宽,左右 5.08 厘米",header:"页眉",footer:"页脚",headerFooterHint:"{page} 和 {pages} 会变成页码。| 会把其后的文字推到右侧。",headerFooterLocked:"此处包含图片或表格,因此保持原样。请在 Word 中编辑。",ok:"确定",cancel:"取消",dismiss:"关闭",zoomIn:"放大",zoomOut:"缩小",wrapLines:"自动换行",objectTextBox:"文本框",objectChart:"来自 Word 的图表,保持原样。",objectDiagram:"来自 Word 的示意图,保持原样。",objectEquation:"来自 Word 的公式,保持原样。",objectPicture:"来自 Word 的图片,保持原样。",objectOther:"来自 Word 的对象,保持原样。",objectField:"域",discardMessage:"这些更改尚未保存。",discard:"放弃",keepEditing:"继续编辑",legacyDoc:".doc 是旧版 Word 格式,请先在 Word 中另存为 .docx。",openedOldSave:"已作为文档打开。保存后即可得到 Word 文件。",saveFailed:"无法保存文档。",savedAsUtf8:"已保存为 UTF-8:浏览器无法写入原始编码。",dropHint:"拖放文档以打开;图片会插入页面。",matchCount:(e,t)=>`第 ${e} 个,共 ${t} 个`,replacedCount:e=>`已替换 ${e} 处`,tableSize:(e,t)=>`${e} × ${t}`,pageLabel:e=>`第 ${e} 页`,pageOf:(e,t)=>`第 ${e} 页,共 ${t} 页`,wordCount:e=>`${e.toLocaleString()} 字`,lineColumn:(e,t)=>`第 ${e} 行,第 ${t} 列`,lineCount:e=>`${e.toLocaleString()} 行`,noticeComments:e=>`${e} 条批注`,noticeTracked:e=>`${e} 处修订`,noticeObjects:e=>`${e} 个文本框等对象`,noticeFootnotes:e=>`${e} 条脚注`,noticeLead:e=>`包含 ${e.join("、")}。它们会保留在文件中,但需要在 Word 中编辑。`,discardTitle:e=>`放弃对 ${e} 的更改?`,cannotRead:e=>`无法打开 ${e}。文件可能已损坏或受密码保护。`,unsupported:e=>`不支持的文件类型:.${e||"未知"}`};export{o as ENGLISH_WORDS,a as ZH_HANS_WORDS};
|
package/dist/chunk-JKYJGXJE.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t=t=>t>=192&&t<=207&&196!==t&&200!==t&&204!==t;var e={1:"/DeviceGray",3:"/DeviceRGB",4:"/DeviceCMYK"},n=t=>String(Math.round(100*t)/100),o=class{chunks=[];offsets=[];length=0;write(t){this.chunks.push(t),this.length+=t.length}object(t,e){this.offsets[t]=this.length,this.write(`${t} 0 obj\n${e}\nendobj\n`)}stream(t,e,n){this.offsets[t]=this.length,this.write(`${t} 0 obj\n<<${e}/Length ${n.length}>>\nstream\n`),this.write(n),this.write("\nendstream\nendobj\n")}finish(t){const e=this.length,n=this.offsets.slice(1).map(t=>`${String(t).padStart(10,"0")} 00000 n \n`);return this.write(`xref\n0 ${this.offsets.length}\n0000000000 65535 f \n${n.join("")}`),this.write(`trailer\n<</Size ${this.offsets.length}/Root ${t} 0 R>>\nstartxref\n${e}\n%%EOF\n`),new Blob(this.chunks,{type:"application/pdf"})}};function i(o,i,r){const s=3+3*r,{width:a,height:h,components:c}=function(e){if(255!==e[0]||216!==e[1])throw new Error("Not a JPEG");let n=2;for(;n+9<e.length;){if(255!==e[n])throw new Error("Damaged JPEG");const o=e[n+1];if(255!==o){if(t(o))return{height:e[n+5]<<8|e[n+6],width:e[n+7]<<8|e[n+8],components:e[n+9]};n+=2+(e[n+2]<<8|e[n+3])}else n+=1}throw new Error("Damaged JPEG")}(i.jpeg),f=e[c];if(!f)throw new Error("Unsupported JPEG colours");const l=n(i.width),g=n(i.height);o.object(s,`<</Type/Page/Parent 2 0 R/MediaBox[0 0 ${l} ${g}]/Contents ${s+1} 0 R/Resources<</XObject<</Im0 ${s+2} 0 R>>>>>>`),o.stream(s+1,"",`q ${l} 0 0 ${g} 0 0 cm /Im0 Do Q`),o.stream(s+2,`/Type/XObject/Subtype/Image/Width ${a}/Height ${h}/ColorSpace${f}/BitsPerComponent 8/Filter/DCTDecode`,i.jpeg)}function r(t){if(!t.length)throw new Error("A PDF needs a page");const e=new o;e.write("%PDF-1.4\n"),e.write(Uint8Array.of(37,226,227,207,211,10)),e.object(1,"<</Type/Catalog/Pages 2 0 R>>");const n=t.map((t,e)=>3+3*e+" 0 R").join(" ");return e.object(2,`<</Type/Pages/Kids[${n}]/Count ${t.length}>>`),t.forEach((t,n)=>i(e,t,n)),e.finish(1)}function s(){const t=document.createElement("div");return t.setAttribute("aria-hidden","true"),t.style.cssText="position:fixed;left:-100000px;top:0;pointer-events:none;",document.body.append(t),{root:t,close:()=>t.remove()}}async function a(t){const{getFontEmbedCSS:e}=await(import("html-to-image"));return e(t,{includeQueryParams:!0})}async function h(t){t.getBoundingClientRect(),await document.fonts.ready,await Promise.all(Array.from(t.querySelectorAll("img"),t=>t.decode()))}async function c(t,{width:e,height:n,pixelRatio:o,quality:i,fontCss:r,background:s}){const{toJpeg:a}=await(import("html-to-image"));return function(t){const e=atob(t.slice(t.indexOf(",")+1)),n=new Uint8Array(e.length);for(let t=0;t<e.length;t+=1)n[t]=e.charCodeAt(t);return n}(await a(t,{width:e,height:n,pixelRatio:o,quality:i??.8,backgroundColor:s??"#ffffff",fontEmbedCSS:r,includeQueryParams:!0}))}export{r as jpegPdf,s as openStage,a as embeddedFonts,h as settled,c as drawJpeg};
|
package/dist/chunk-PXOQN7D6.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ENGLISH_FILE_WORDS as e,ZH_HANS_FILE_WORDS as t}from"./chunk-B32ASXHM.js";var o={rect:"Rectangle",roundRect:"Rounded rectangle",ellipse:"Ellipse",triangle:"Triangle",rightTriangle:"Right triangle",diamond:"Diamond",pentagon:"Pentagon",hexagon:"Hexagon",octagon:"Octagon",star:"Star",heart:"Heart",cloud:"Cloud",bolt:"Lightning bolt",parallelogram:"Parallelogram",trapezoid:"Trapezoid",cylinder:"Cylinder",plus:"Plus",arrowRight:"Right arrow",arrowLeft:"Left arrow",arrowUp:"Up arrow",arrowDown:"Down arrow",arrowLeftRight:"Left-right arrow",chevron:"Chevron",callout:"Callout",calloutRound:"Rounded callout",line:"Line"},n={rect:"矩形",roundRect:"圆角矩形",ellipse:"椭圆",triangle:"三角形",rightTriangle:"直角三角形",diamond:"菱形",pentagon:"五边形",hexagon:"六边形",octagon:"八边形",star:"星形",heart:"心形",cloud:"云形",bolt:"闪电形",parallelogram:"平行四边形",trapezoid:"梯形",cylinder:"圆柱形",plus:"加号",arrowRight:"右箭头",arrowLeft:"左箭头",arrowUp:"上箭头",arrowDown:"下箭头",arrowLeftRight:"左右箭头",chevron:"燕尾形",callout:"标注",calloutRound:"圆角标注",line:"线条"},i={blank:"Blank",simple:"Simple",midnight:"Midnight",editorial:"Editorial",dealerPitch:"Dealer pitch",monthlyReport:"Monthly report"},r={blank:"空白",simple:"简约",midnight:"午夜",editorial:"杂志",dealerPitch:"经销商推介",monthlyReport:"月度报告"},a={decks:"Decks",newDeck:"New deck",untitledDeck:"Untitled deck",emptyTitle:"Make your first deck",emptyBody:"Build slides here, then present them or export to PowerPoint.",openFailed:"Couldn't open this deck",createFailed:"Could not create a deck.",deleteFailed:"Could not delete this deck.",backToDecks:"Back to decks",deleteConfirm:e=>`Delete "${e}"? This can't be undone.`,delete:"Delete",deckName:"Deck name",slidesPanel:"Slides",slideNumber:e=>`Slide ${e}`,slideOf:(e,t)=>`Slide ${e} of ${t}`,addSlide:"Add slide",duplicateSlide:"Duplicate slide",deleteSlide:"Delete slide",slideText:"Slide text",undo:"Undo",redo:"Redo",export:"Export",exportFailed:"Could not export this deck.",present:"Present",endShow:"End show",popupBlocked:"Your browser blocked the audience window. Allow pop-ups for this site, then end the show and present again.",back:"Back",next:"Next",nextSlide:"Next slide",endOfDeck:"End of the deck.",notes:"Notes",noNotes:"No notes for this slide.",speakerNotes:"Speaker notes",saveFailed:"Could not save this deck. Trying again.",renameFailed:"Could not rename this deck.",conflict:"Somebody else changed this deck. Your latest edits aren't saved. Reload to see their version.",reload:"Reload",addText:"Add text",addShape:"Add shape",addImage:"Add image",addChart:"Add chart",addTable:"Add table",elementText:"Text",elementShape:"Shape",elementImage:"Image",elementChart:"Chart",elementTable:"Table",slide:"Slide",objects:e=>`${e} objects`,background:"Background",positionAndSize:"Position and size",width:"W",height:"H",angle:"Angle",align:"Align",alignLeft:"Align left",alignCentre:"Align centre",alignRight:"Align right",bringForward:"Bring forward",size:"Size",weight:"Weight",regular:"Regular",bold:"Bold",textAlignment:"Text alignment",left:"Left",centre:"Centre",right:"Right",colour:"Colour",rectangle:"Rectangle",ellipse:"Ellipse",roundedRectangle:"Rounded rectangle",diamond:"Diamond",lineShape:"Line",outlineColour:"Outline colour",imageAddress:"Image address",chooseImage:"Choose image",imageTitle:"Slide image",description:"Description",data:"Data",chartType:"Chart type",bar:"Bar",line:"Line",values:"Values",valuesHint:"One label and number a line, like Sept, 42.",rows:"Rows",rowsHint:"One row a line, with commas between cells.",headingColour:"Heading colour",pptxPasswordProtected:"This file has a password. Remove it in PowerPoint, then import the file again.",pptxUnreadable:"This file can't be read as a PowerPoint (.pptx) file.",pptxLegacyFormat:"This is an older Office file. Save it as .pptx in PowerPoint, then import it again.",pptxTooManySlides:(e,t)=>`This deck has ${e} slides, and a deck can have at most ${t}.`,pptxTooLarge:(e,t)=>`This deck comes to ${e} MiB without its pictures, and a deck can be at most ${t} MiB. Split it into smaller decks.`,pdfSlideFailed:e=>`Slide ${e} couldn't be drawn for the PDF.`,files:e,fileKind:"PowerPoint",importNotes:({skipped:e,animations:t,fonts:o})=>{const n=[e&&(1===e?"a chart, video or custom shape was":`${e} charts, videos or custom shapes were`)+" left out",t&&`animations on ${1===t?"1 slide were":`${t} slides were`} dropped`,o.length&&`${o.join(", ")} ${1===o.length?"is":"are"} shown in the deck's font`].filter(Boolean);return n.length?`Some things didn't come across: ${n.join("; ")}.`:null},dismiss:"Dismiss",newSlide:"New slide",layouts:"Layouts",layoutTitle:"Title",layoutTitleBody:"Title and body",layoutSection:"Section",layoutTwoColumns:"Two columns",layoutTitleOnly:"Title only",layoutBlank:"Blank",placeholderTitle:"Click to add a title",placeholderSubtitle:"Click to add a subtitle",placeholderBody:"Click to add text",addVideo:"Add video",addLine:"Add line or connector",elementVideo:"Video",elementConnector:"Connector",lineStraight:"Line",lineArrow:"Arrow",lineDoubleArrow:"Double arrow",connectorElbow:"Elbow connector",connectorCurved:"Curved connector",arrange:"Arrange",theme:"Theme",motion:"Motion",comments:"Comments",versionHistory:"Version history",font:"Font",fontSize:"Font size",smaller:"Smaller",larger:"Larger",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",textColour:"Text colour",highlight:"Highlight",link:"Link",linkPrompt:"Link to a web address, an email address, or a slide number",removeLink:"Remove link",badLink:"That link isn’t a web address, an email address or a slide number.",alignJustify:"Justify",bulletList:"Bulleted list",numberedList:"Numbered list",indentLess:"Decrease indent",indentMore:"Increase indent",lineSpacing:"Line spacing",verticalAlign:"Vertical alignment",top:"Top",middle:"Middle",bottom:"Bottom",shrinkToFit:"Shrink text to fit",cut:"Cut",copy:"Copy",paste:"Paste",duplicate:"Duplicate",copyStyle:"Copy style",pasteStyle:"Paste style",order:"Order",bringToFront:"Bring to front",sendBackward:"Send backward",sendToBack:"Send to back",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom",distributeAcross:"Distribute horizontally",distributeDown:"Distribute vertically",distribute:"Distribute",group:"Group",ungroup:"Ungroup",lock:"Lock",unlock:"Unlock",locked:"Locked",comment:"Comment",grid:"Grid",crop:"Crop",cropLeft:"Left",cropTop:"Top",cropRight:"Right",cropBottom:"Bottom",opacity:"Opacity",replaceImage:"Replace image",videoAddress:"Video address",videoHint:"A YouTube or Vimeo link, or a video file.",chooseVideo:"Choose from Media Library",videoUnsupported:"This video can’t be played here. Open it from its link.",route:"Route",routeStraight:"Straight",routeElbow:"Elbow",routeCurved:"Curved",arrowStart:"Arrow at start",arrowEnd:"Arrow at end",lineWidth:"Line width",fill:"Fill",noFill:"No fill",outline:"Outline",chartBar:"Column",chartHbar:"Bar",chartArea:"Area",chartPie:"Pie",chartDonut:"Donut",legend:"Legend",legendBottom:"Bottom",legendRight:"Right",legendNone:"None",addSeries:"Series",addCategory:"Row",seriesName:"Series name",borders:"Borders",borderColour:"Border colour",borderWidth:"Border width",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",insertColumnLeft:"Insert column left",insertColumnRight:"Insert column right",deleteRow:"Delete row",deleteColumn:"Delete column",mergeCells:"Merge cells",unmergeCells:"Unmerge cells",cellEditHint:"Double-click a cell to type in it. Shift-click to choose several.",colours:"Colours",headingFont:"Headings",bodyFont:"Body",slideNumbers:"Slide numbers",skipSlide:"Skip slide",unskipSlide:"Don’t skip slide",skipped:"Skipped in the show",transition:"Transition",transitionNone:"None",transitionFade:"Fade",transitionSlide:"Slide from right",transitionPush:"Push",transitionZoom:"Zoom",transitionFlip:"Flip",duration:"Duration",applyToAll:"Apply to all slides",play:"Play",animations:"Object animations",addAnimation:"Add animation",removeAnimation:"Remove animation",selectToAnimate:"Select an object on the slide to animate it.",noAnimations:"No animations on this slide.",effectAppear:"Appear",effectFadeIn:"Fade in",effectFlyIn:"Fly in",effectZoomIn:"Zoom in",effectFadeOut:"Fade out",startClick:"On click",startWithPrevious:"With previous",startAfterPrevious:"After previous",fromLeft:"From left",fromRight:"From right",fromTop:"From top",fromBottom:"From bottom",byParagraph:"By paragraph",moveEarlier:"Earlier",moveLater:"Later",commentPlaceholder:"Comment or add others with @",replyPlaceholder:"Reply",post:"Comment",reply:"Reply",resolve:"Resolve",reopen:"Reopen",showResolved:"Show resolved",noComments:"No comments yet. Select something and choose Comment.",editComment:"Edit",deleteComment:"Delete",save:"Save",cancel:"Cancel",commentFailed:"Could not save this comment.",onSlide:"On the slide",objectGone:"The object it was on is gone.",resolvedBy:"Resolved",nameVersion:"Name this version",versionName:"Version name",restore:"Restore",previewVersion:"Preview",noVersions:"No earlier versions yet.",restoreFailed:"Could not restore this version.",closePreview:"Back to the deck",versionsFailed:"Could not load the history.",startFrom:"Start from",exportPptx:"PowerPoint (.pptx)",exportPdf:"PDF",exporting:"Exporting…",merged:"Somebody else changed this deck too. Their changes are in.",editingNow:e=>`${e} also here`,commentCount:e=>`${e} comments`,restoreConfirm:e=>`Restore the deck as it was on ${e}? You can undo this.`,shapeName:e=>o[e],starterName:e=>i[e],themeName:e=>({simple:"Simple",midnight:"Midnight",editorial:"Editorial"}[e]??e),presenterStep:(e,t)=>`Click ${e} of ${t}`,dealerPitch:[["Wheel and Tyre Haus","Dealer programme 2026"],["Why stock us","Fast restock from three warehouses"],["The range","Wheels, tyres and fitting kits"],["Margins and support","Tiered pricing and co-op marketing"],["Next steps","Book a range review"]],monthlyReport:[["Monthly report","October 2026"],["Highlights","What went well this month"],["Numbers","Sales, margin and stock"],["Risks","What needs attention"],["Next month","Priorities and owners"]]},l={decks:"演示文稿",newDeck:"新建演示文稿",untitledDeck:"未命名演示文稿",emptyTitle:"制作第一份演示文稿",emptyBody:"在这里制作幻灯片,然后放映或导出为 PowerPoint。",openFailed:"无法打开此演示文稿",createFailed:"无法创建演示文稿。",deleteFailed:"无法删除此演示文稿。",backToDecks:"返回演示文稿列表",deleteConfirm:e=>`要删除“${e}”吗?此操作无法撤销。`,delete:"删除",deckName:"演示文稿名称",slidesPanel:"幻灯片",slideNumber:e=>`第 ${e} 张幻灯片`,slideOf:(e,t)=>`第 ${e} 张,共 ${t} 张`,addSlide:"添加幻灯片",duplicateSlide:"复制幻灯片",deleteSlide:"删除幻灯片",slideText:"幻灯片文字",undo:"撤销",redo:"重做",export:"导出",exportFailed:"无法导出此演示文稿。",present:"放映",endShow:"结束放映",popupBlocked:"浏览器阻止了观众窗口。请允许此网站的弹出窗口,然后结束放映并重新放映。",back:"上一张",next:"下一张",nextSlide:"下一张幻灯片",endOfDeck:"演示文稿已结束。",notes:"备注",noNotes:"此幻灯片没有备注。",speakerNotes:"演讲者备注",saveFailed:"无法保存此演示文稿,正在重试。",renameFailed:"无法重命名此演示文稿。",conflict:"其他人修改了此演示文稿,您最近的编辑未保存。请重新加载以查看对方的版本。",reload:"重新加载",addText:"添加文字",addShape:"添加形状",addImage:"添加图片",addChart:"添加图表",addTable:"添加表格",elementText:"文字",elementShape:"形状",elementImage:"图片",elementChart:"图表",elementTable:"表格",slide:"幻灯片",objects:e=>`${e} 个对象`,background:"背景",positionAndSize:"位置和大小",width:"宽",height:"高",angle:"角度",align:"对齐",alignLeft:"左对齐",alignCentre:"居中对齐",alignRight:"右对齐",bringForward:"上移一层",size:"字号",weight:"字重",regular:"常规",bold:"粗体",textAlignment:"文字对齐",left:"左",centre:"中",right:"右",colour:"颜色",rectangle:"矩形",ellipse:"椭圆",roundedRectangle:"圆角矩形",diamond:"菱形",lineShape:"线条",outlineColour:"轮廓颜色",imageAddress:"图片地址",chooseImage:"选择图片",imageTitle:"幻灯片图片",description:"描述",data:"数据",chartType:"图表类型",bar:"柱形图",line:"折线图",values:"数值",valuesHint:"每行一个标签和数字,例如 九月, 42。",rows:"行",rowsHint:"每行一行数据,单元格之间用逗号分隔。",headingColour:"标题颜色",pptxPasswordProtected:"此文件设有密码。请先在 PowerPoint 中移除密码,再重新导入。",pptxUnreadable:"无法将此文件读取为 PowerPoint (.pptx) 文件。",pptxLegacyFormat:"这是旧版 Office 文件。请先在 PowerPoint 中另存为 .pptx,再重新导入。",pptxTooManySlides:(e,t)=>`此演示文稿有 ${e} 张幻灯片,最多只能有 ${t} 张。`,pptxTooLarge:(e,t)=>`此演示文稿不计图片已达 ${e} MiB,上限为 ${t} MiB。请拆分成较小的演示文稿。`,pdfSlideFailed:e=>`第 ${e} 张幻灯片无法绘制到 PDF。`,files:t,fileKind:"PowerPoint",importNotes:({skipped:e,animations:t,fonts:o})=>{const n=[e&&`${e} 个图表、视频或自定义形状未能导入`,t&&`${t} 张幻灯片的动画已移除`,o.length&&`${o.join("、")} 以演示文稿字体显示`].filter(Boolean);return n.length?`部分内容未能导入:${n.join(";")}。`:null},dismiss:"关闭",newSlide:"新建幻灯片",layouts:"版式",layoutTitle:"标题",layoutTitleBody:"标题和正文",layoutSection:"节标题",layoutTwoColumns:"两栏",layoutTitleOnly:"仅标题",layoutBlank:"空白",placeholderTitle:"单击添加标题",placeholderSubtitle:"单击添加副标题",placeholderBody:"单击添加文本",addVideo:"添加视频",addLine:"添加线条或连接线",elementVideo:"视频",elementConnector:"连接线",lineStraight:"直线",lineArrow:"箭头",lineDoubleArrow:"双向箭头",connectorElbow:"肘形连接线",connectorCurved:"曲线连接线",arrange:"排列",theme:"主题",motion:"动画",comments:"评论",versionHistory:"版本历史记录",font:"字体",fontSize:"字号",smaller:"减小字号",larger:"增大字号",italic:"斜体",underline:"下划线",strikethrough:"删除线",textColour:"文字颜色",highlight:"突出显示",link:"链接",linkPrompt:"链接到网址、电子邮件地址或幻灯片编号",removeLink:"移除链接",badLink:"该链接不是网址、电子邮件地址或幻灯片编号。",alignJustify:"两端对齐",bulletList:"项目符号列表",numberedList:"编号列表",indentLess:"减少缩进",indentMore:"增加缩进",lineSpacing:"行距",verticalAlign:"垂直对齐",top:"顶端",middle:"居中",bottom:"底端",shrinkToFit:"缩小文字以适应",cut:"剪切",copy:"复制",paste:"粘贴",duplicate:"创建副本",copyStyle:"复制格式",pasteStyle:"粘贴格式",order:"顺序",bringToFront:"置于顶层",sendBackward:"下移一层",sendToBack:"置于底层",alignTop:"顶端对齐",alignMiddle:"垂直居中",alignBottom:"底端对齐",distributeAcross:"横向分布",distributeDown:"纵向分布",distribute:"分布",group:"组合",ungroup:"取消组合",lock:"锁定",unlock:"解锁",locked:"已锁定",comment:"评论",grid:"网格",crop:"裁剪",cropLeft:"左",cropTop:"上",cropRight:"右",cropBottom:"下",opacity:"不透明度",replaceImage:"替换图片",videoAddress:"视频地址",videoHint:"YouTube 或 Vimeo 链接,或视频文件。",chooseVideo:"从媒体库选择",videoUnsupported:"此视频无法在此播放。请通过其链接打开。",route:"路线",routeStraight:"直线",routeElbow:"肘形",routeCurved:"曲线",arrowStart:"起点箭头",arrowEnd:"终点箭头",lineWidth:"线条粗细",fill:"填充",noFill:"无填充",outline:"轮廓",chartBar:"柱形图",chartHbar:"条形图",chartArea:"面积图",chartPie:"饼图",chartDonut:"圆环图",legend:"图例",legendBottom:"底部",legendRight:"右侧",legendNone:"无",addSeries:"系列",addCategory:"行",seriesName:"系列名称",borders:"边框",borderColour:"边框颜色",borderWidth:"边框粗细",insertRowAbove:"在上方插入行",insertRowBelow:"在下方插入行",insertColumnLeft:"在左侧插入列",insertColumnRight:"在右侧插入列",deleteRow:"删除行",deleteColumn:"删除列",mergeCells:"合并单元格",unmergeCells:"取消合并单元格",cellEditHint:"双击单元格即可输入。按住 Shift 单击可选择多个。",colours:"颜色",headingFont:"标题",bodyFont:"正文",slideNumbers:"幻灯片编号",skipSlide:"跳过幻灯片",unskipSlide:"不跳过幻灯片",skipped:"放映时跳过",transition:"切换效果",transitionNone:"无",transitionFade:"淡出",transitionSlide:"从右侧滑入",transitionPush:"推入",transitionZoom:"缩放",transitionFlip:"翻转",duration:"持续时间",applyToAll:"应用于所有幻灯片",play:"播放",animations:"对象动画",addAnimation:"添加动画",removeAnimation:"删除动画",selectToAnimate:"选择幻灯片上的对象以添加动画。",noAnimations:"此幻灯片没有动画。",effectAppear:"出现",effectFadeIn:"淡入",effectFlyIn:"飞入",effectZoomIn:"放大",effectFadeOut:"淡出",startClick:"单击时",startWithPrevious:"与上一动画同时",startAfterPrevious:"上一动画之后",fromLeft:"自左侧",fromRight:"自右侧",fromTop:"自顶部",fromBottom:"自底部",byParagraph:"按段落",moveEarlier:"提前",moveLater:"延后",commentPlaceholder:"发表评论,或使用 @ 添加其他人",replyPlaceholder:"回复",post:"评论",reply:"回复",resolve:"解决",reopen:"重新打开",showResolved:"显示已解决",noComments:"还没有评论。选择内容后选择“评论”。",editComment:"编辑",deleteComment:"删除",save:"保存",cancel:"取消",commentFailed:"无法保存此评论。",onSlide:"在幻灯片上",objectGone:"所评论的对象已被删除。",resolvedBy:"已解决",nameVersion:"命名此版本",versionName:"版本名称",restore:"恢复",previewVersion:"预览",noVersions:"还没有较早的版本。",restoreFailed:"无法恢复此版本。",closePreview:"返回演示文稿",versionsFailed:"无法加载历史记录。",startFrom:"开始于",exportPptx:"PowerPoint (.pptx)",exportPdf:"PDF",exporting:"正在导出…",merged:"其他人也修改了此演示文稿,其更改已合并。",editingNow:e=>`${e} 也在此处`,commentCount:e=>`${e} 条评论`,restoreConfirm:e=>`将演示文稿恢复为 ${e} 时的版本?此操作可以撤销。`,shapeName:e=>n[e],starterName:e=>r[e],themeName:e=>({simple:"简约",midnight:"午夜",editorial:"杂志"}[e]??e),presenterStep:(e,t)=>`第 ${e} 次单击,共 ${t} 次`,dealerPitch:[["Wheel and Tyre Haus","2026 年经销商计划"],["为何选择我们","三个仓库快速补货"],["产品系列","轮毂、轮胎和安装套件"],["利润与支持","阶梯定价和联合营销"],["后续步骤","预约产品系列评审"]],monthlyReport:[["月度报告","2026 年 10 月"],["亮点","本月进展顺利的方面"],["数据","销售、利润和库存"],["风险","需要关注的事项"],["下月","重点工作和负责人"]]},s=1920,d=1080,c="Inter",p=["Inter","Roboto","Montserrat","Lora","Playfair Display","JetBrains Mono"],m="transparent",h=20,u=["rect","roundRect","ellipse","triangle","rightTriangle","diamond","pentagon","hexagon","octagon","star","heart","cloud","bolt","parallelogram","trapezoid","cylinder","plus","arrowRight","arrowLeft","arrowUp","arrowDown","arrowLeftRight","chevron","callout","calloutRound","line"],g=()=>crypto.randomUUID();function f(){return{id:g(),background:"#ffffff",notes:"",elements:[]}}function w(e){const t=e,o=t?.slides;return Array.isArray(o)&&o.length>0?{...t,slides:o}:{slides:[f()]}}var y={text:"#2c2c2a",accents:["#534ab7","#1d9e75","#d85a30"],shapeFill:"#afa9ec"};function b(e,t=y){const o=(e,t)=>({id:g(),x:(s-e)/2,y:(d-t)/2,w:e,h:t,rotation:0}),n=t.accents[0]??y.accents[0];switch(e){case"text":return{...o(800,160),type:e,text:"Text",fontSize:64,bold:!1,color:t.text,align:"left",...t.bodyFont&&t.bodyFont!==c?{font:t.bodyFont}:{}};case"shape":return{...o(400,400),type:e,shape:"rect",fill:t.shapeFill};case"image":return{...o(800,450),type:e,src:"",alt:""};case"video":return{...o(960,540),type:e,src:"",alt:""};case"connector":{const n={x:760,y:540},i={x:1160,y:540};return{...o(400,24),y:528,type:e,start:n,end:i,route:"straight",stroke:t.text,strokeWidth:4,arrowEnd:!0}}case"chart":return{...o(900,600),type:e,kind:"bar",color:n,points:[{label:"A",value:40},{label:"B",value:65},{label:"C",value:90}]};case"table":return{...o(1e3,400),type:e,headerFill:"#eeedfe",rows:[["Heading","Heading"],["Cell","Cell"]]}}}function k(e,t,o){return{...e,slides:e.slides.map(e=>e.id===t?o(e):e)}}function x(e,t,o){const n=e.slides.findIndex(e=>e.id===t),i=[...e.slides];return i.splice(-1===n?i.length:n+1,0,o),{...e,slides:i}}function S(e){return{...e,id:g(),elements:e.elements.map(e=>({...e,id:g()}))}}function v(e,t){const o=e.slides.filter(e=>e.id!==t);return{...e,slides:o.length>0?o:[f()]}}function C(e,t,o){const n=e.slides.findIndex(e=>e.id===t);if(-1===n)return e;const i=[...e.slides],[r]=i.splice(n,1);return i.splice(Math.max(0,Math.min(o,i.length)),0,r),{...e,slides:i}}function T(e,t,o){return{...e,elements:e.elements.map(e=>t.has(e.id)?o(e):e)}}function P(e,t){return{...e,elements:e.elements.filter(e=>!t.has(e.id))}}function F(e,t,o){const n={...e,x:e.x+t,y:e.y+o};if("connector"!==n.type)return n;const i=e=>({...e,x:e.x+t,y:e.y+o});return{...n,start:i(n.start),end:i(n.end)}}function R(e,t){const o=[...e.elements];for(let e=o.length-2;e>=0;e-=1)t.has(o[e].id)&&!t.has(o[e+1].id)&&([o[e],o[e+1]]=[o[e+1],o[e]]);return{...e,elements:o}}function A(e){const t=Math.min(...e.map(e=>e.x)),o=Math.min(...e.map(e=>e.y));return{x:t,y:o,w:Math.max(...e.map(e=>e.x+e.w))-t,h:Math.max(...e.map(e=>e.y+e.h))-o}}function B(e,t){const o=[{x:0,y:0,w:s,h:d},...t],n=(e,t,o)=>{let n=null;for(const i of[e,e+t/2,e+t])for(const e of o){const t=e-i;Math.abs(t)<=8&&(!n||Math.abs(t)<Math.abs(n.shift))&&(n={shift:t,at:e})}return n},i=n(e.x,e.w,o.flatMap(e=>[e.x,e.x+e.w/2,e.x+e.w])),r=n(e.y,e.h,o.flatMap(e=>[e.y,e.y+e.h/2,e.y+e.h]));return{box:{...e,x:e.x+(i?.shift??0),y:e.y+(r?.shift??0)},guides:{x:i?[i.at]:[],y:r?[r.at]:[]}}}var L=["nw","n","ne","e","se","s","sw","w"];function D(e,t,o,n,i=!1){let{x:r,y:a,w:l,h:s}=e;if(t.includes("e")&&(l=Math.max(20,e.w+o)),t.includes("s")&&(s=Math.max(20,e.h+n)),t.includes("w")&&(l=Math.max(20,e.w-o),r=e.x+e.w-l),t.includes("n")&&(s=Math.max(20,e.h-n),a=e.y+e.h-s),i&&2===t.length){const o=Math.max(l/e.w,s/e.h);l=e.w*o,s=e.h*o,t.includes("w")&&(r=e.x+e.w-l),t.includes("n")&&(a=e.y+e.h-s)}return{x:r,y:a,w:l,h:s}}function N(e,t,o,n=!1){const i=180*Math.atan2(o-(e.y+e.h/2),t-(e.x+e.w/2))/Math.PI+90;return((n?15*Math.round(i/15):Math.round(i))%360+360)%360}function M(e,t){return e.x<t.x+t.w&&t.x<e.x+e.w&&e.y<t.y+t.h&&t.y<e.y+e.h}function $(e,t){switch(t.type){case"commit":return t.doc===e.present?e:{past:[...e.past,e.present].slice(-200),present:t.doc,future:[]};case"live":return{...e,present:t.doc};case"settle":return t.from===e.present?e:{past:[...e.past,t.from].slice(-200),present:e.present,future:[]};case"undo":{const t=e.past[e.past.length-1];return t?{past:e.past.slice(0,-1),present:t,future:[e.present,...e.future]}:e}case"redo":{const[t,...o]=e.future;return t?{past:[...e.past,e.present],present:t,future:o}:e}case"rebase":return{past:e.past.map(t.rebase),present:t.rebase(e.present),future:e.future.map(t.rebase)}}}export{a as ENGLISH_WORDS,l as ZH_HANS_WORDS,s as SLIDE_W,d as SLIDE_H,c as DECK_FONT,p as DECK_FONTS,m as NO_FILL,h as MIN_SIZE,u as SHAPE_KINDS,g as newId,f as newSlide,w as asDocument,b as newElement,k as updateSlide,x as insertSlideAfter,S as copySlide,v as removeSlide,C as moveSlide,T as updateElements,P as removeElements,F as shiftElement,R as bringForward,A as boundsOf,B as snapBox,L as HANDLES,D as resizeBox,N as angleTo,M as boxesTouch,$ as historyReducer};
|
package/dist/chunk-Q7NVDOCX.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{paragraphsOf as t,withParagraphs as e}from"./chunk-B2X3NIQR.js";import{DECK_FONT as o,DECK_FONTS as n,SLIDE_H as r,SLIDE_W as i,newId as a,newSlide as l}from"./chunk-PXOQN7D6.js";var s=[{id:"simple",name:"Simple",background:"#ffffff",text:"#2c2c2a",heading:"#26215c",accents:["#534ab7","#1d9e75","#d85a30","#ef9f27","#378add","#d4537e"],headingFont:o,bodyFont:o},{id:"midnight",name:"Midnight",background:"#26215c",text:"#eeedfe",heading:"#ffffff",accents:["#afa9ec","#5dcaa5","#f0997b","#fac775","#85b7eb","#ed93b1"],headingFont:"Montserrat",bodyFont:o},{id:"editorial",name:"Editorial",background:"#f1efe8",text:"#444441",heading:"#2c2c2a",accents:["#993c1d","#5f5e5a","#0f6e56","#854f0b","#185fa5","#993556"],headingFont:"Playfair Display",bodyFont:"Lora"}],c=s[0],d=t=>t.theme??c,f={title:96,subtitle:48,body:44};function u(t,e,o,n){return{id:a(),type:"text",...e,rotation:0,text:o,fontSize:f[t],bold:"title"===t,color:"title"===t?n.heading:n.text,font:"title"===t?n.headingFont:n.bodyFont,align:"left",anchor:"body"===t?"top":"bottom",placeholder:t,..."body"===t?{paragraphs:[{list:"bullet",runs:[{text:o}]}]}:{}}}var h=120,b={x:h,y:80,w:i-240,h:180},m={x:h,y:300,w:i-240,h:r-300-100},p=["title","titleBody","section","twoColumns","titleOnly","blank"];function y(t,e,o){const n={...l(),background:e.background,layout:t},r=(m.w-80)/2;return{...n,elements:(()=>{switch(t){case"title":return[{...u("title",{x:h,y:340,w:i-240,h:220},o.title,e),align:"center"},{...u("subtitle",{x:h,y:580,w:i-240,h:120},o.subtitle,e),align:"center",anchor:"top"}];case"titleBody":return[u("title",b,o.title,e),u("body",m,o.body,e)];case"section":return[u("title",{x:h,y:520,w:i-240,h:200},o.title,e)];case"twoColumns":return[u("title",b,o.title,e),u("body",{...m,w:r},o.body,e),u("body",{...m,x:m.x+r+80,w:r},o.body,e)];case"titleOnly":return[u("title",b,o.title,e)];case"blank":return[]}})()}}function g(n,r){const i=d(n),a=(t,e)=>!!t&&t.toLowerCase()===e.toLowerCase(),l=t=>{const e=i.accents.findIndex(e=>a(t,e));return-1===e?t:r.accents[e]??t},s=n=>{switch(n.type){case"text":{const l="title"===n.placeholder||!n.placeholder&&a(n.color,i.heading),s=t=>a(t,i.heading)?r.heading:a(t,i.text)?r.text:t,c=l?i.headingFont:i.bodyFont,d=l?r.headingFont:r.bodyFont,f=n.placeholder||(n.font??o)===c?d===o?void 0:d:n.font,u=t(n).map(t=>({...t,runs:t.runs.map(t=>({...t,color:s(t.color),font:t.font===c?void 0:t.font}))}));return e({...n,color:s(n.color)??n.color,font:f},u)}case"shape":return{...n,fill:l(n.fill),stroke:n.stroke&&(a(n.stroke,i.text)?r.text:l(n.stroke))};case"connector":return{...n,stroke:a(n.stroke,i.text)?r.text:l(n.stroke)};case"chart":return{...n,color:l(n.color),series:n.series?.map(t=>({...t,color:l(t.color)}))};default:return n}};return{...n,theme:r,slides:n.slides.map(t=>({...t,background:a(t.background,i.background)?r.background:t.background,elements:t.elements.map(s)}))}}var x=["blank","simple","midnight","editorial","dealerPitch","monthlyReport"];function k(o,n){if("blank"===o)return{slides:[l()]};const r=s.find(t=>t.id===o)??("dealerPitch"===o?s[1]:c);if("simple"===o||"midnight"===o||"editorial"===o)return{theme:r,slides:[y("title",r,n)]};const i="dealerPitch"===o?n.dealerPitch:n.monthlyReport,a=i.map(([o,a],l)=>((o,n,r)=>({...o,elements:o.elements.map(o=>{if("text"!==o.type)return o;const i="title"===o.placeholder?n:r;return e(o,t(o).slice(0,1).map(t=>({...t,runs:[{...t.runs[0],text:i}]})))})}))(y(0===l?"title":l===i.length-1?"section":"titleBody",r,n),o,a));return{theme:r,slideNumbers:!0,slides:a}}function w(t){const e=d(t),o=new Set([e.headingFont,e.bodyFont]);for(const e of t.slides)for(const t of e.elements)if("text"===t.type){t.font&&o.add(t.font);for(const e of t.paragraphs??[])for(const t of e.runs)t.font&&o.add(t.font)}return[...o].filter(t=>n.includes(t))}var F="data-slides-fonts";function v(t,e){const n=function(t){return`https://fonts.googleapis.com/css2?${[...t].sort().map(t=>`family=${t.replace(/ /g,"+")}:ital,wght@0,400;0,700;1,400;1,700`).join("&")}&display=swap`}([...new Set([o,...e])]),r=t.head.querySelector(`link[${F}]`);if(r?.href===n)return;const i=t.createElement("link");i.rel="stylesheet",i.crossOrigin="anonymous",i.href=n,i.setAttribute(F,""),t.head.appendChild(i),r?.remove()}export{s as THEMES,d as themeOf,p as LAYOUTS,y as slideFromLayout,g as applyTheme,x as STARTERS,k as starterDeck,w as fontsOf,v as ensureFonts};
|
package/dist/chunk-RHW2M2UY.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t=(()=>{const t=new Uint32Array(256);for(let e=0;e<256;e++){let n=e;for(let t=0;t<8;t++)n=1&n?3988292384^n>>>1:n>>>1;t[e]=n>>>0}return t})();function e(e){let n=4294967295;for(let r=0;r<e.length;r++)n=t[255&(n^e[r])]^n>>>8;return(4294967295^n)>>>0}async function n(t,e){const n=e.writable.getWriter();return n.write(t).then(()=>n.close()).catch(()=>{}),new Uint8Array(await new Response(e.readable).arrayBuffer())}function r(t){const e=new DataView(t.buffer,t.byteOffset,t.byteLength);for(let n=t.length-22;n>=Math.max(0,t.length-66e3);n--)if(101010256===e.getUint32(n,!0))return{count:e.getUint16(n+10,!0),size:e.getUint32(n+12,!0),offset:e.getUint32(n+16,!0)};throw new Error("Not a zip file")}function a(t,e,n){const r=new DataView(t.buffer,t.byteOffset,t.byteLength),a=new TextDecoder,o=[];let s=e,i=0;for(let e=0;e<n;e++){if(33639248!==r.getUint32(s,!0))throw new Error("Damaged zip file");if(i+=r.getUint32(s+24,!0),i>1073741824)throw new Error("Zip file too large");const e=r.getUint16(s+28,!0),n=a.decode(t.subarray(s+46,s+46+e));n.endsWith("/")||o.push({name:n,method:r.getUint16(s+10,!0),packedSize:r.getUint32(s+20,!0),localAt:r.getUint32(s+42,!0)}),s+=46+e+r.getUint16(s+30,!0)+r.getUint16(s+32,!0)}return o}async function o(t,e){if(0===t.method)return e.slice();if(8===t.method)return n(e,new DecompressionStream("deflate-raw"));throw new Error("Unsupported zip compression")}var s=(t,e)=>{const n=new DataView(e.buffer,e.byteOffset,e.byteLength);return t.localAt+30+n.getUint16(26,!0)+n.getUint16(28,!0)};async function i(t){const e=r(t),n=new Map;for(const r of a(t,e.offset,e.count)){const e=s(r,t.subarray(r.localAt,r.localAt+30));n.set(r.name,await o(r,t.subarray(e,e+r.packedSize)))}return n}async function l(t){const e=async(e,n)=>new Uint8Array(await t.slice(e,n).arrayBuffer()),n=r(await e(Math.max(0,t.size-66e3),t.size)),i=new Map(a(await e(n.offset,n.offset+n.size),0,n.count).map(t=>[t.name,t]));return{names:[...i.keys()],read:async t=>{const n=i.get(t);if(!n)throw new Error(`No part named ${t}`);const r=s(n,await e(n.localAt,n.localAt+30));return o(n,await e(r,r+n.packedSize))}}}async function w(t){const r=new TextEncoder,a=[],o=[];let s=0;for(const[i,l]of t){const t=r.encode(i),w="undefined"==typeof CompressionStream?null:await n(l,new CompressionStream("deflate-raw")),c=null===w||w.length>=l.length,f=c?l:w,p=e(l),h=new Uint8Array(30+t.length),m=new DataView(h.buffer);m.setUint32(0,67324752,!0),m.setUint16(4,20,!0),m.setUint16(6,2048,!0),m.setUint16(8,c?0:8,!0),m.setUint16(12,33,!0),m.setUint32(14,p,!0),m.setUint32(18,f.length,!0),m.setUint32(22,l.length,!0),m.setUint16(26,t.length,!0),h.set(t,30);const u=new Uint8Array(46+t.length),d=new DataView(u.buffer);d.setUint32(0,33639248,!0),d.setUint16(4,20,!0),d.setUint16(6,20,!0),d.setUint16(8,2048,!0),d.setUint16(10,c?0:8,!0),d.setUint16(14,33,!0),d.setUint32(16,p,!0),d.setUint32(20,f.length,!0),d.setUint32(24,l.length,!0),d.setUint16(28,t.length,!0),d.setUint32(42,s,!0),u.set(t,46),a.push(h,f),o.push(u),s+=h.length+f.length}const i=o.reduce((t,e)=>t+e.length,0),l=new Uint8Array(22),w=new DataView(l.buffer);w.setUint32(0,101010256,!0),w.setUint16(8,t.size,!0),w.setUint16(10,t.size,!0),w.setUint32(12,i,!0),w.setUint32(16,s,!0);const c=new Uint8Array(s+i+22);let f=0;for(const t of[...a,...o,l])c.set(t,f),f+=t.length;return c}var c={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};function f(t){return t.includes("&")?t.replace(/&(#x[0-9a-fA-F]+|#\d+|[a-zA-Z]+);/g,(t,e)=>{if("#"!==e[0])return c[e]??t;const n="x"===e[1]?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return n<=1114111?String.fromCodePoint(n):t}):t}function p(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f]/g,"")}var h=/([^\s=]+)\s*=\s*("([^"]*)"|'([^']*)')/g;function m(t){const e=[];let n=null,r=0;for(;r<t.length;){const a=t.indexOf("<",r);if(a<0)break;if(a>r&&e.length&&(e[e.length-1].text+=f(t.slice(r,a))),t.startsWith("\x3c!--",a)){r=u(t,"--\x3e",a);continue}if(t.startsWith("<?",a)){r=u(t,"?>",a);continue}if(t.startsWith("<![CDATA[",a)){const n=u(t,"]]>",a);e.length&&(e[e.length-1].text+=t.slice(a+9,n-3)),r=n;continue}if(t.startsWith("<!",a)){r=u(t,">",a);continue}const o=d(t,a);if("/"===t[a+1]){const n=e.pop();if(!n||n.name!==t.slice(a+2,o).trim())throw new Error("Malformed XML");n.innerEnd=a,n.end=o+1,r=o+1;continue}const s="/"===t[o-1],i=t.slice(a+1,s?o-1:o),l=i.search(/\s/),w={name:l<0?i:i.slice(0,l),attrs:{},children:[],text:"",start:a,end:o+1,innerStart:o+1,innerEnd:o+1};if(l>=0)for(const t of i.slice(l).matchAll(h))w.attrs[t[1]]=f(t[3]??t[4]??"");e.length?e[e.length-1].children.push(w):n||(n=w),s||e.push(w),r=o+1}if(!n||e.length)throw new Error("Malformed XML");return n}function u(t,e,n){const r=t.indexOf(e,n);if(r<0)throw new Error("Malformed XML");return r+e.length}function d(t,e){let n="";for(let r=e+1;r<t.length;r++){const e=t[r];if(n)e===n&&(n="");else if('"'===e||"'"===e)n=e;else if(">"===e)return r}throw new Error("Malformed XML")}var g=(t,e)=>t?.children.find(t=>t.name===e),y=(t,e)=>t?.children.filter(t=>t.name===e)??[];function v(t,e,n=[]){for(const r of t.children)e.has(r.name)&&n.push(r),v(r,e,n);return n}function x(t){if(!t)return;const e=t.attrs["w:val"];return!("0"===e||"false"===e||"off"===e||"none"===e)}var b='xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"',$="http://schemas.openxmlformats.org/officeDocument/2006/relationships",U={officeDocument:`${$}/officeDocument`,styles:`${$}/styles`,numbering:`${$}/numbering`,theme:`${$}/theme`,comments:`${$}/comments`,footnotes:`${$}/footnotes`,header:`${$}/header`,footer:`${$}/footer`,image:`${$}/image`,hyperlink:`${$}/hyperlink`},T=new TextEncoder,P=new TextDecoder,z=(t,e)=>{const n=t.get(e);return n?P.decode(n):void 0},C=(t,e,n)=>{t.set(e,T.encode(n))},N=t=>{const e=t.lastIndexOf("/");return`${t.slice(0,e+1)}_rels/${t.slice(e+1)}.rels`};function A(t,e){const n=z(t,N(e));return n?m(n).children.filter(t=>"Relationship"===t.name).map(t=>({id:t.attrs.Id,type:t.attrs.Type,target:t.attrs.Target,external:"External"===t.attrs.TargetMode})):[]}function M(t,e){if(e.startsWith("/"))return e.slice(1);const n=t.split("/").slice(0,-1);for(const t of e.split("/"))".."===t?n.pop():"."!==t&&n.push(t);return n.join("/")}function k(t,e,n,r,a=!1){const o=N(e),s=z(t,o),i=new Set(A(t,e).map(t=>t.id));let l=i.size+1;for(;i.has(`rId${l}`);)l++;const w=`rId${l}`,c=`<Relationship Id="${w}" Type="${n}" Target="${p(r)}"${a?' TargetMode="External"':""}/>`;return C(t,o,s?s.replace(/(<\/Relationships>\s*)$/,`${c}$1`).replace(/<Relationships([^>]*)\/>\s*$/,`<Relationships$1>${c}</Relationships>`):`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">${c}</Relationships>`),w}function D(t,e,n){const r=z(t,"[Content_Types].xml")??"";r.includes(`PartName="/${e}"`)||C(t,"[Content_Types].xml",r.replace("</Types>",`<Override PartName="/${e}" ContentType="${n}"/></Types>`))}function R(t,e,n){const r=z(t,"[Content_Types].xml")??"";new RegExp(`Extension="${e}"`,"i").test(r)||C(t,"[Content_Types].xml",r.replace(/(<Types[^>]*>)/,`$1<Default Extension="${e}" ContentType="${n}"/>`))}var E={a4:{width:11906,height:16838},letter:{width:12240,height:15840},legal:{width:12240,height:20160},a3:{width:16838,height:23811},a5:{width:8391,height:11906}},I={normal:{top:1440,right:1440,bottom:1440,left:1440},narrow:{top:720,right:720,bottom:720,left:720},moderate:{top:1440,right:1080,bottom:1440,left:1080},wide:{top:1440,right:2880,bottom:1440,left:2880}},L={...E.a4,...I.normal,header:708,footer:708};function O(t,e){const n=E[e];return t.width>t.height?{...t,width:n.height,height:n.width}:{...t,...n}}function F(t,e){return{...t,...I[e]}}function j(t){const e=Math.min(t.width,t.height),n=Math.max(t.width,t.height);for(const[t,r]of Object.entries(E))if(Math.abs(r.width-e)<30&&Math.abs(r.height-n)<30)return t;return null}function S(t){for(const[e,n]of Object.entries(I))if(n.top===t.top&&n.right===t.right&&n.bottom===t.bottom&&n.left===t.left)return e;return null}var q={yellow:"#ffff00",green:"#00ff00",cyan:"#00ffff",magenta:"#ff00ff",blue:"#0000ff",red:"#ff0000",darkBlue:"#000080",darkCyan:"#008080",darkGreen:"#008000",darkMagenta:"#800080",darkRed:"#800000",darkYellow:"#808000",darkGray:"#808080",lightGray:"#c0c0c0",black:"#000000",white:"#ffffff"};function W(t){if(!t)return{};try{const e=m(t),n=g(g(e,"a:themeElements"),"a:fontScheme");return{major:g(g(n,"a:majorFont"),"a:latin")?.attrs.typeface,minor:g(g(n,"a:minorFont"),"a:latin")?.attrs.typeface}}catch{return{}}}var _=t=>t&&/^[0-9a-fA-F]{6}$/.test(t)?`#${t.toLowerCase()}`:void 0;function H(t,e){const n={};if(!t)return n;const r=x(g(t,"w:b"));void 0!==r&&(n.b=r);const a=x(g(t,"w:i"));void 0!==a&&(n.i=a);const o=g(t,"w:u");o&&(n.u="none"!==o.attrs["w:val"]);const s=x(g(t,"w:strike"));void 0!==s&&(n.strike=s);const i=g(t,"w:vertAlign")?.attrs["w:val"];"subscript"===i&&(n.vert="sub"),"superscript"===i&&(n.vert="super");const l=function(t,e){if(!t)return;const n=t.attrs["w:ascii"]??t.attrs["w:hAnsi"];if(n)return n;const r=t.attrs["w:asciiTheme"]??t.attrs["w:hAnsiTheme"];return r?r.startsWith("major")?e.major:e.minor:t.attrs["w:eastAsia"]??t.attrs["w:cs"]}(g(t,"w:rFonts"),e);l&&(n.font=l);const w=Number(g(t,"w:sz")?.attrs["w:val"]);w&&(n.size=w/2);const c=_(g(t,"w:color")?.attrs["w:val"]);c&&(n.color=c);const f=g(t,"w:highlight")?.attrs["w:val"];if(f&&q[f])n.hl=q[f];else{const e=_(g(t,"w:shd")?.attrs["w:fill"]);e&&(n.hl=e)}return n}function V(t){const e={};if(!t)return e;const n=g(t,"w:jc")?.attrs["w:val"];"left"===n||"start"===n?e.align="left":"center"===n?e.align="center":"right"===n||"end"===n?e.align="right":"both"!==n&&"distribute"!==n||(e.align="justify");const r=g(t,"w:ind");if(r){const t=r.attrs["w:left"]??r.attrs["w:start"];void 0!==t&&(e.indentLeft=Number(t)/20),void 0!==r.attrs["w:firstLine"]&&(e.firstLine=Number(r.attrs["w:firstLine"])/20),void 0!==r.attrs["w:hanging"]&&(e.firstLine=-Number(r.attrs["w:hanging"])/20)}const a=g(t,"w:spacing");if(a){void 0!==a.attrs["w:before"]&&(e.before=Number(a.attrs["w:before"])/20),void 0!==a.attrs["w:after"]&&(e.after=Number(a.attrs["w:after"])/20);const t=Number(a.attrs["w:line"]);t&&("exact"===a.attrs["w:lineRule"]||"atLeast"===a.attrs["w:lineRule"]?e.linePoints=t/20:e.lineMultiple=t/240)}return e}var B=t=>Math.round(100*t)/100;function Q(t){const e=[];return t.align&&e.push(`text-align:${t.align}`),void 0!==t.indentLeft&&e.push(`margin-left:${B(t.indentLeft)}pt`),void 0!==t.firstLine&&e.push(`text-indent:${B(t.firstLine)}pt`),void 0!==t.before&&e.push(`margin-top:${B(t.before)}pt`),void 0!==t.after&&e.push(`margin-bottom:${B(t.after)}pt`),void 0!==t.lineMultiple&&e.push(`line-height:${B(t.lineMultiple)}`),void 0!==t.linePoints&&e.push(`line-height:${B(t.linePoints)}pt`),e.join(";")}function X(t){const e=[];void 0!==t.b&&e.push("font-weight:"+(t.b?700:400)),void 0!==t.i&&e.push("font-style:"+(t.i?"italic":"normal"));const n=[t.u&&"underline",t.strike&&"line-through"].filter(Boolean);return n.length&&e.push(`text-decoration-line:${n.join(" ")}`),t.font&&e.push(`font-family:${function(t){const e=t.replace(/["\\<>;]/g,"");return/mono|courier|consolas|menlo/i.test(e)?`"${e}",monospace`:/times|georgia|cambria|garamond|palatino|serif|song|ming/i.test(e)&&!/sans/i.test(e)?`"${e}",Caladea,serif`:`"${e}",Carlito,Arial,sans-serif`}(t.font)}`),t.size&&e.push(`font-size:${B(t.size)}pt`),t.color&&e.push(`color:${t.color}`),t.hl&&e.push(`background-color:${t.hl}`),e.join(";")}var Z={Title:{name:"Title",xml:'<w:style w:type="paragraph" w:styleId="Title"><w:name w:val="Title"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:qFormat/><w:pPr><w:spacing w:after="80" w:line="240" w:lineRule="auto"/></w:pPr><w:rPr><w:sz w:val="56"/><w:szCs w:val="56"/></w:rPr></w:style>'},Heading1:{name:"heading 1",xml:'<w:style w:type="paragraph" w:styleId="Heading1"><w:name w:val="heading 1"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:qFormat/><w:pPr><w:keepNext/><w:spacing w:before="360" w:after="80"/><w:outlineLvl w:val="0"/></w:pPr><w:rPr><w:color w:val="0F4761"/><w:sz w:val="40"/><w:szCs w:val="40"/></w:rPr></w:style>'},Heading2:{name:"heading 2",xml:'<w:style w:type="paragraph" w:styleId="Heading2"><w:name w:val="heading 2"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:qFormat/><w:pPr><w:keepNext/><w:spacing w:before="160" w:after="80"/><w:outlineLvl w:val="1"/></w:pPr><w:rPr><w:color w:val="0F4761"/><w:sz w:val="32"/><w:szCs w:val="32"/></w:rPr></w:style>'},Heading3:{name:"heading 3",xml:'<w:style w:type="paragraph" w:styleId="Heading3"><w:name w:val="heading 3"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:qFormat/><w:pPr><w:keepNext/><w:spacing w:before="160" w:after="80"/><w:outlineLvl w:val="2"/></w:pPr><w:rPr><w:color w:val="0F4761"/><w:sz w:val="28"/><w:szCs w:val="28"/></w:rPr></w:style>'},Quote:{name:"Quote",xml:'<w:style w:type="paragraph" w:styleId="Quote"><w:name w:val="Quote"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:qFormat/><w:pPr><w:spacing w:before="160"/><w:jc w:val="center"/></w:pPr><w:rPr><w:i/><w:iCs/><w:color w:val="404040"/></w:rPr></w:style>'}},G='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n';function Y(t){const e=new Map;C(e,"[Content_Types].xml",`${G}<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/><Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/><Override PartName="/word/settings.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml"/></Types>`),C(e,"_rels/.rels",`${G}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="${U.officeDocument}" Target="word/document.xml"/></Relationships>`);const n=L;C(e,"word/document.xml",`${G}<w:document ${b}><w:body><w:p/><w:sectPr><w:pgSz w:w="${n.width}" w:h="${n.height}"/><w:pgMar w:top="${n.top}" w:right="${n.right}" w:bottom="${n.bottom}" w:left="${n.left}" w:header="${n.header}" w:footer="${n.footer}" w:gutter="0"/></w:sectPr></w:body></w:document>`),C(e,"word/_rels/document.xml.rels",`${G}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="${U.styles}" Target="styles.xml"/><Relationship Id="rId2" Type="${$}/settings" Target="settings.xml"/></Relationships>`),C(e,"word/settings.xml",`${G}<w:settings ${b}><w:compat><w:compatSetting w:name="compatibilityMode" w:uri="http://schemas.microsoft.com/office/word" w:val="15"/></w:compat></w:settings>`);const r=/^[A-Za-z]{2,3}(-[A-Za-z0-9]+)*$/.test(t)?t:"en-AU";return C(e,"word/styles.xml",`${G}<w:styles ${b}><w:docDefaults><w:rPrDefault><w:rPr><w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" w:eastAsia="Calibri" w:cs="Calibri"/><w:sz w:val="22"/><w:szCs w:val="22"/><w:lang w:val="${r}"/></w:rPr></w:rPrDefault><w:pPrDefault><w:pPr><w:spacing w:after="160" w:line="259" w:lineRule="auto"/></w:pPr></w:pPrDefault></w:docDefaults><w:style w:type="paragraph" w:default="1" w:styleId="Normal"><w:name w:val="Normal"/><w:qFormat/></w:style>${Object.values(Z).map(t=>t.xml).join("")}<w:style w:type="table" w:default="1" w:styleId="TableNormal"><w:name w:val="Normal Table"/><w:tblPr><w:tblInd w:w="0" w:type="dxa"/><w:tblCellMar><w:top w:w="0" w:type="dxa"/><w:left w:w="108" w:type="dxa"/><w:bottom w:w="0" w:type="dxa"/><w:right w:w="108" w:type="dxa"/></w:tblCellMar></w:tblPr></w:style></w:styles>`),e}export{i as readZip,l as openZip,w as writeZip,p as escapeXml,m as parseXml,g as child,y as childrenOf,v as descendants,b as WORD_NS,U as REL,z as partText,C as setPartText,A as readRels,M as resolveTarget,k as addRel,D as addContentOverride,R as addContentDefault,E as PAPER_SIZES,I as MARGIN_PRESETS,L as DEFAULT_PAGE,O as withPaper,F as withMargins,j as paperOf,S as marginsOf,q as HIGHLIGHTS,W as readThemeFonts,H as parseRunProps,V as parseParaProps,Q as paraCss,X as runCss,Z as BUILTIN_STYLES,Y as blankDocxParts};
|