efficient-office 0.5.1 → 0.7.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/README.md +17 -0
- package/dist/Documents-CVV64UEH.js +1 -0
- package/dist/Slides-JMP36AJH.js +1 -0
- package/dist/SlidesEditor-MZM7IR46.js +1 -0
- package/dist/Spreadsheet-55AVNUEA.js +1 -0
- package/dist/chunk-2AKHYM66.js +1 -0
- package/dist/chunk-2TZUCKZ7.js +1 -0
- package/dist/chunk-4NKXNXKY.js +1 -0
- package/dist/chunk-7K7AY3V3.js +1 -0
- package/dist/chunk-A5KQPSPX.js +1 -0
- package/dist/chunk-B32ASXHM.js +1 -0
- package/dist/chunk-B6JN7D6G.js +1 -0
- package/dist/chunk-COXKOQPZ.js +1 -0
- package/dist/chunk-GLT7O6TV.js +1 -0
- package/dist/chunk-HU4RI2OM.js +1 -0
- package/dist/chunk-I3AC6PYR.js +1 -0
- package/dist/chunk-JCSB2PHB.js +1 -0
- package/dist/chunk-JKYJGXJE.js +1 -0
- package/dist/chunk-N26CBJZA.js +1 -0
- package/dist/chunk-OB4MLAZC.js +1 -0
- package/dist/chunk-PWF37Y2N.js +1 -0
- package/dist/chunk-QFPW3KLL.js +1 -0
- package/dist/chunk-RHW2M2UY.js +1 -0
- package/dist/chunk-RLNXQG4T.js +1 -0
- package/dist/chunk-VKCG3LPQ.js +1 -0
- package/dist/chunk-X6F3Z4KZ.js +1 -0
- package/dist/chunk-XYVQTQ6N.js +1 -0
- package/dist/deckPdf-Y2RE7MFX.js +1 -0
- package/dist/documents/documents.css +4 -0
- package/dist/documents/index.d.ts +25 -6
- package/dist/documents/index.js +1 -1
- package/dist/docxPdf-EW5I5JR3.js +1 -0
- package/dist/importDocument-274VK7OM.js +1 -0
- package/dist/importSpreadsheet-4U3KEJ76.js +1 -0
- package/dist/pptxImport-STLMOUNE.js +1 -0
- package/dist/slides/index.d.ts +152 -53
- package/dist/slides/index.js +1 -1
- package/dist/slides/slides.css +23 -0
- package/dist/spreadsheet/index.d.ts +67 -43
- package/dist/spreadsheet/index.js +1 -1
- package/dist/spreadsheet/spreadsheet.css +4 -0
- package/dist/words-DK_ajpEa.d.ts +67 -0
- package/dist/workbookPdf-C5SSN226.js +1 -0
- package/dist/xlsxFile-B2JCZCOL.js +1 -0
- package/package.json +7 -2
- package/dist/Documents-XZ3AZVHI.js +0 -1
- package/dist/Slides-ILKPLYAJ.js +0 -1
- package/dist/SlidesEditor-44ITB7B2.js +0 -1
- package/dist/Spreadsheet-R5MYRMOF.js +0 -1
- package/dist/chunk-372GCYWH.js +0 -1
- package/dist/chunk-3JJCHWPJ.js +0 -1
- package/dist/chunk-3SRMKGQW.js +0 -1
- package/dist/chunk-BTDWPUTS.js +0 -1
- package/dist/chunk-CED4ECIS.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ENGLISH_FILE_WORDS as e,ZH_HANS_FILE_WORDS as t}from"./chunk-B32ASXHM.js";var o={ABS:"Absolute value",AND:"True if all are true",AVERAGE:"Average of numbers",AVERAGEIF:"Average where a test passes",AVERAGEIFS:"Average on many tests",CEILING:"Rounds up to a multiple","CEILING.MATH":"Rounds up to a multiple",CHOOSE:"Picks by position",COLUMN:"Column number",COLUMNS:"Number of columns",CONCAT:"Joins text",CONCATENATE:"Joins text",COS:"Cosine",COUNT:"Counts numbers",COUNTA:"Counts non-blank cells",COUNTBLANK:"Counts blank cells",COUNTIF:"Counts where a test passes",COUNTIFS:"Counts on many tests",DATE:"Builds a date",DATEDIF:"Time between dates",DAY:"Day of the month",DAYS:"Days between dates",EDATE:"Date some months away",EOMONTH:"Last day of a month",EXACT:"Same text, case included",EXP:"e to a power",FIND:"Position of text, case exact",FLOOR:"Rounds down to a multiple","FLOOR.MATH":"Rounds down to a multiple",FV:"Future value",HLOOKUP:"Looks along the top row",HOUR:"Hour of a time",IF:"One value or another",IFERROR:"A fallback for an error",IFNA:"A fallback for #N/A",IFS:"First test that passes",INDEX:"The cell at a position",INT:"Rounds down to a whole number",ISBLANK:"True if blank",ISERROR:"True if an error",ISLOGICAL:"True if TRUE or FALSE",ISNA:"True if #N/A",ISNUMBER:"True if a number",ISTEXT:"True if text",LARGE:"The kth largest",LEFT:"Text from the start",LEN:"Length of text",LN:"Natural logarithm",LOG:"Logarithm",LOG10:"Base-10 logarithm",LOWER:"Lower case",MATCH:"Position of a value",MAX:"Largest number",MEDIAN:"Middle number",MID:"Text from the middle",MIN:"Smallest number",MINUTE:"Minute of a time",MOD:"Remainder",MODE:"Most common number","MODE.SNGL":"Most common number",MONTH:"Month of a date",N:"A value as a number",NA:"The #N/A error",NETWORKDAYS:"Working days between dates",NOT:"The opposite",NOW:"Date and time now",NPV:"Net present value",OR:"True if any is true",PI:"The number pi",PMT:"Loan payment",POWER:"A number to a power",PRODUCT:"Multiplies numbers",PROPER:"Capitals on each word",PV:"Present value",RAND:"Random from 0 to 1",RANDBETWEEN:"Random whole number",RANK:"Rank in a list","RANK.EQ":"Rank in a list",REPLACE:"Replaces by position",REPT:"Repeats text",RIGHT:"Text from the end",ROUND:"Rounds a number",ROUNDDOWN:"Rounds toward zero",ROUNDUP:"Rounds away from zero",ROW:"Row number",ROWS:"Number of rows",SEARCH:"Position of text, any case",SECOND:"Second of a time",SIGN:"Sign of a number",SIN:"Sine",SMALL:"The kth smallest",SQRT:"Square root",STDEV:"Standard deviation of a sample","STDEV.P":"Standard deviation of everything","STDEV.S":"Standard deviation of a sample",STDEVP:"Standard deviation of everything",SUBSTITUTE:"Replaces text",SUM:"Adds numbers",SUMIF:"Adds where a test passes",SUMIFS:"Adds on many tests",SUMPRODUCT:"Multiplies, then adds",SWITCH:"Picks a result by value",TAN:"Tangent",TEXT:"A number as formatted text",TEXTJOIN:"Joins with a separator",TIME:"Builds a time",TODAY:"Today's date",TRIM:"Removes extra spaces",TRUNC:"Cuts off decimals",UPPER:"Upper case",VALUE:"Text as a number",VAR:"Variance of a sample","VAR.P":"Variance of everything","VAR.S":"Variance of a sample",VARP:"Variance of everything",VLOOKUP:"Looks down the first column",WEEKDAY:"Day of the week",XLOOKUP:"Looks up in any column",XOR:"True if an odd number are true",YEAR:"Year of a date"},a={ABS:"绝对值",AND:"全部为真时返回真",AVERAGE:"数字的平均值",AVERAGEIF:"满足条件的平均值",AVERAGEIFS:"满足多个条件的平均值",CEILING:"向上舍入到倍数","CEILING.MATH":"向上舍入到倍数",CHOOSE:"按位置选择",COLUMN:"列号",COLUMNS:"列数",CONCAT:"连接文本",CONCATENATE:"连接文本",COS:"余弦",COUNT:"统计数字个数",COUNTA:"统计非空单元格",COUNTBLANK:"统计空单元格",COUNTIF:"统计满足条件的个数",COUNTIFS:"统计满足多个条件的个数",DATE:"生成日期",DATEDIF:"两个日期的间隔",DAY:"月份中的第几天",DAYS:"两个日期相差的天数",EDATE:"相隔若干个月的日期",EOMONTH:"月份的最后一天",EXACT:"文本完全相同",EXP:"e 的幂",FIND:"文本位置(区分大小写)",FLOOR:"向下舍入到倍数","FLOOR.MATH":"向下舍入到倍数",FV:"未来值",HLOOKUP:"在首行中查找",HOUR:"时间中的小时",IF:"二选一返回值",IFERROR:"出错时的备用值",IFNA:"#N/A 时的备用值",IFS:"第一个满足的条件",INDEX:"指定位置的单元格",INT:"向下取整",ISBLANK:"为空时返回真",ISERROR:"为错误时返回真",ISLOGICAL:"为逻辑值时返回真",ISNA:"为 #N/A 时返回真",ISNUMBER:"为数字时返回真",ISTEXT:"为文本时返回真",LARGE:"第 k 大的值",LEFT:"从开头截取文本",LEN:"文本长度",LN:"自然对数",LOG:"对数",LOG10:"以 10 为底的对数",LOWER:"转为小写",MATCH:"值的位置",MAX:"最大值",MEDIAN:"中位数",MID:"从中间截取文本",MIN:"最小值",MINUTE:"时间中的分钟",MOD:"余数",MODE:"出现最多的数字","MODE.SNGL":"出现最多的数字",MONTH:"日期中的月份",N:"转为数字",NA:"#N/A 错误",NETWORKDAYS:"两个日期之间的工作日",NOT:"取反",NOW:"当前日期和时间",NPV:"净现值",OR:"任一为真时返回真",PI:"圆周率",PMT:"贷款每期还款额",POWER:"幂运算",PRODUCT:"数字相乘",PROPER:"每个单词首字母大写",PV:"现值",RAND:"0 到 1 之间的随机数",RANDBETWEEN:"随机整数",RANK:"在列表中的排名","RANK.EQ":"在列表中的排名",REPLACE:"按位置替换",REPT:"重复文本",RIGHT:"从末尾截取文本",ROUND:"四舍五入",ROUNDDOWN:"向零舍入",ROUNDUP:"远离零舍入",ROW:"行号",ROWS:"行数",SEARCH:"文本位置(不区分大小写)",SECOND:"时间中的秒",SIGN:"数字的符号",SIN:"正弦",SMALL:"第 k 小的值",SQRT:"平方根",STDEV:"样本标准差","STDEV.P":"总体标准差","STDEV.S":"样本标准差",STDEVP:"总体标准差",SUBSTITUTE:"替换文本",SUM:"数字求和",SUMIF:"对满足条件的值求和",SUMIFS:"对满足多个条件的值求和",SUMPRODUCT:"相乘后求和",SWITCH:"按值选择结果",TAN:"正切",TEXT:"数字转为带格式的文本",TEXTJOIN:"用分隔符连接",TIME:"生成时间",TODAY:"今天的日期",TRIM:"删除多余空格",TRUNC:"截去小数",UPPER:"转为大写",VALUE:"文本转为数字",VAR:"样本方差","VAR.P":"总体方差","VAR.S":"样本方差",VARP:"总体方差",VLOOKUP:"在首列中查找",WEEKDAY:"星期几",XLOOKUP:"在任意列中查找",XOR:"奇数个为真时返回真",YEAR:"日期中的年份"},l={pdfPageFailed:e=>`Page ${e} couldn't be drawn for the PDF.`,files:e,fileKind:"Excel",untitled:"Untitled",backToFiles:"Back to files",filesHeading:"Spreadsheets",newFile:"New spreadsheet",openFile:"Open a file",filesEmptyTitle:"Make your first spreadsheet",filesEmptyBody:"Every change saves by itself.",deleteFile:"Delete",createFailed:"The spreadsheet could not be made.",deleteFailed:"The spreadsheet could not be deleted.",storedOpenFailed:"This spreadsheet could not be opened.",loading:"Loading",renameFailed:"The spreadsheet could not be renamed.",conflict:"Somebody else saved this spreadsheet, so your latest changes are not saved. Reload to see theirs.",reload:"Reload",noStoreEdited:"Not saved. Save as Excel to keep your changes",saveToFiles:"Save to Files",noStoreClean:"No autosave here. Save as Excel to keep a copy",deleteConfirm:e=>`Delete "${e}"? Nobody can open it again.`,spreadsheetFile:"spreadsheet",sheetBase:"Sheet",menuFile:"File",menuEdit:"Edit",menuView:"View",menuInsert:"Insert",menuFormat:"Format",menuData:"Data",menuNew:"New",menuOpen:"Open",saveExcel:"Save as Excel (.xlsx)",saveCsv:"Download this sheet as CSV",email:"Email",undo:"Undo",redo:"Redo",cut:"Cut",copy:"Copy",paste:"Paste",pasteValues:"Paste values only",pasteFormats:"Paste formatting only",findReplace:"Find and replace",clearValues:"Clear contents",freeze:"Freeze",gridlines:"Gridlines",showFormulas:"Show formulas",rowsAbove:"Rows above",rowsBelow:"Rows below",columnsLeft:"Columns left",columnsRight:"Columns right",sheet:"Sheet",function:"Function",functions:"Functions",number:"Number format",bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",fontSize:"Font size",alignment:"Alignment",borders:"Borders",wrapText:"Wrap text",mergeCells:"Merge cells",clearFormatting:"Clear formatting",sortAscending:"Sort A to Z",sortDescending:"Sort Z to A",filter:"Filter",hideRows:"Hide rows",hideColumns:"Hide columns",unhideRows:"Show hidden rows",unhideColumns:"Show hidden columns",deleteRows:"Delete rows",deleteColumns:"Delete columns",formatGeneral:"Automatic",formatNumber:"Number",formatPercent:"Percent",formatScientific:"Scientific",formatCurrency:"Currency",formatDate:"Date",formatTime:"Time",formatDateTime:"Date and time",formatText:"Plain text",bordersAll:"All borders",bordersOuter:"Outer borders",bordersTop:"Top border",bordersBottom:"Bottom border",bordersLeft:"Left border",bordersRight:"Right border",bordersNone:"No borders",alignLeft:"Left",alignCenter:"Center",alignRight:"Right",alignTop:"Top",alignMiddle:"Middle",alignBottom:"Bottom",formatPainter:"Paint format",fewerDecimals:"Fewer decimal places",moreDecimals:"More decimal places",textColor:"Text color",fillColor:"Fill color",nameBox:"Selected cells",formulaBar:"Formula bar",cellEditor:"Cell contents",selectAll:"Select all",fillHandle:"Fill",find:"Find",replaceWith:"Replace with",replace:"Replace",replaceAll:"Replace all",previous:"Previous",next:"Next",close:"Close",matchCase:"Match case",wholeCell:"Whole cell",inFormulas:"In formulas",addSheet:"Add sheet",rename:"Rename",duplicate:"Duplicate",moveLeft:"Move left",moveRight:"Move right",tabColor:"Tab color",noColor:"No color",deleteSheet:"Delete sheet",deleteSheetTitle:"Delete this sheet?",sheetNameTaken:"Another sheet already has that name.",saveFailed:"Could not save the workbook. Try again.",openFailed:"Could not open that file. It may be damaged or an unsupported type.",statSum:"Sum",statAverage:"Average",statCount:"Count",statMin:"Min",statMax:"Max",blank:"(Blank)",clear:"Clear",apply:"Apply",sheetName:e=>`Sheet ${e}`,filterColumn:e=>`Filter column ${e}`,freezeRows:e=>0===e?"No frozen rows":1===e?"1 row":`${e} rows`,freezeColumns:e=>0===e?"No frozen columns":1===e?"1 column":`${e} columns`,freezeUpToRow:e=>`Up to row ${e}`,freezeUpToColumn:e=>`Up to column ${e}`,hitCount:(e,t)=>`${e} of ${t}`,replacedCount:e=>1===e?"Replaced in 1 cell":`Replaced in ${e} cells`,deleteSheetMessage:e=>`"${e}" and everything on it will be deleted. Formulas that use it will show #REF!.`,functionHelp:e=>o[e]??String(e)},r={pdfPageFailed:e=>`第 ${e} 页无法绘制到 PDF。`,files:t,fileKind:"Excel",untitled:"未命名",backToFiles:"返回文件",filesHeading:"电子表格",newFile:"新建电子表格",openFile:"打开文件",filesEmptyTitle:"创建您的第一个电子表格",filesEmptyBody:"每次更改都会自动保存。",deleteFile:"删除",createFailed:"无法创建电子表格。",deleteFailed:"无法删除电子表格。",storedOpenFailed:"无法打开此电子表格。",loading:"正在加载",renameFailed:"无法重命名电子表格。",conflict:"其他人已保存此电子表格,您最近的更改尚未保存。请重新加载以查看他们的版本。",reload:"重新加载",noStoreEdited:"未保存。请另存为 Excel 以保留更改",saveToFiles:"保存到文件",noStoreClean:"此处不会自动保存。请另存为 Excel 以保留副本",deleteConfirm:e=>`删除“${e}”?之后任何人都无法再打开它。`,spreadsheetFile:"电子表格",sheetBase:"工作表",menuFile:"文件",menuEdit:"编辑",menuView:"视图",menuInsert:"插入",menuFormat:"格式",menuData:"数据",menuNew:"新建",menuOpen:"打开",saveExcel:"另存为 Excel(.xlsx)",saveCsv:"将此工作表下载为 CSV",email:"发送邮件",undo:"撤销",redo:"重做",cut:"剪切",copy:"复制",paste:"粘贴",pasteValues:"仅粘贴数值",pasteFormats:"仅粘贴格式",findReplace:"查找和替换",clearValues:"清除内容",freeze:"冻结",gridlines:"网格线",showFormulas:"显示公式",rowsAbove:"在上方插入行",rowsBelow:"在下方插入行",columnsLeft:"在左侧插入列",columnsRight:"在右侧插入列",sheet:"工作表",function:"函数",functions:"函数",number:"数字格式",bold:"粗体",italic:"斜体",underline:"下划线",strikethrough:"删除线",fontSize:"字号",alignment:"对齐",borders:"边框",wrapText:"自动换行",mergeCells:"合并单元格",clearFormatting:"清除格式",sortAscending:"升序排序",sortDescending:"降序排序",filter:"筛选",hideRows:"隐藏行",hideColumns:"隐藏列",unhideRows:"显示隐藏的行",unhideColumns:"显示隐藏的列",deleteRows:"删除行",deleteColumns:"删除列",formatGeneral:"自动",formatNumber:"数字",formatPercent:"百分比",formatScientific:"科学计数",formatCurrency:"货币",formatDate:"日期",formatTime:"时间",formatDateTime:"日期和时间",formatText:"纯文本",bordersAll:"所有边框",bordersOuter:"外边框",bordersTop:"上边框",bordersBottom:"下边框",bordersLeft:"左边框",bordersRight:"右边框",bordersNone:"无边框",alignLeft:"左对齐",alignCenter:"居中",alignRight:"右对齐",alignTop:"顶端对齐",alignMiddle:"垂直居中",alignBottom:"底端对齐",formatPainter:"格式刷",fewerDecimals:"减少小数位",moreDecimals:"增加小数位",textColor:"文字颜色",fillColor:"填充颜色",nameBox:"所选单元格",formulaBar:"编辑栏",cellEditor:"单元格内容",selectAll:"全选",fillHandle:"填充",find:"查找",replaceWith:"替换为",replace:"替换",replaceAll:"全部替换",previous:"上一个",next:"下一个",close:"关闭",matchCase:"区分大小写",wholeCell:"整个单元格",inFormulas:"在公式中",addSheet:"添加工作表",rename:"重命名",duplicate:"复制工作表",moveLeft:"左移",moveRight:"右移",tabColor:"标签颜色",noColor:"无颜色",deleteSheet:"删除工作表",deleteSheetTitle:"删除此工作表?",sheetNameTaken:"已有工作表使用该名称。",saveFailed:"无法保存工作簿,请重试。",openFailed:"无法打开该文件,文件可能已损坏或类型不受支持。",statSum:"求和",statAverage:"平均值",statCount:"计数",statMin:"最小值",statMax:"最大值",blank:"(空白)",clear:"清除",apply:"应用",sheetName:e=>`工作表 ${e}`,filterColumn:e=>`筛选 ${e} 列`,freezeRows:e=>0===e?"不冻结行":`${e} 行`,freezeColumns:e=>0===e?"不冻结列":`${e} 列`,freezeUpToRow:e=>`冻结至第 ${e} 行`,freezeUpToColumn:e=>`冻结至 ${e} 列`,hitCount:(e,t)=>`${e} / ${t}`,replacedCount:e=>`已替换 ${e} 个单元格`,deleteSheetMessage:e=>`将删除“${e}”及其全部内容。引用它的公式将显示 #REF!。`,functionHelp:e=>a[e]??String(e)};export{l as ENGLISH_WORDS,r as ZH_HANS_WORDS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useCallback as e,useEffect as t,useRef as i,useState as n}from"react";import{WindowTitle as l,activateWindowById as r}from"efficient-shell";import{Icon as a}from"efficient-shell/icons";import{Button as o,ContextMenu as c,buttonClasses as s,DropdownMenu as d,EmptyState as f,Input as m,confirmDestructive as u,registerModalEscapeInterceptor as p,toast as h,useContextMenu as g}from"efficient-shell/ui";import{jsx as v,jsxs as y}from"react/jsx-runtime";function w({words:m,files:p,list:w,create:b,rename:C,remove:N,canCreate:D,canDelete:F,canRename:S=!0,accept:z,choose:x,onOpen:A,onOpenFile:I,busy:T}){const[q,B]=n(null),[E,O]=n(null),P=i(null),j=i(null),K=g(),L=e(()=>{w().then(B,()=>B([]))},[w]);t(L,[L]);const M=()=>P.current?.click(),R=async e=>{await u({message:m.deleteConfirm(e.title),confirmWord:p.delete})&&N(e.id).then(L,()=>h.error(m.deleteFailed))},W=D&&v(o,{onClick:()=>{b().then(({id:e})=>A(e),()=>h.error(m.createFailed))},children:m.newFile}),G=v(a,{name:"folder-open",size:16}),H=x?v(d,{align:"end",triggerClassName:s({variant:"ghost"}),trigger:y("span",{className:"office-filelist-open",children:[G,p.open,v(a,{name:"chevron-down",size:14})]}),items:[{key:"computer",label:p.fromComputer,icon:v(a,{name:"desktop",size:16}),onSelect:M},{key:"drive",label:p.fromDrive,icon:v(a,{name:"cloud",size:16}),onSelect:()=>{(async()=>{x&&(await new Promise(e=>requestAnimationFrame(()=>setTimeout(e,0))),x.run(x.request).then(e=>{if(!e)return;const t=j.current?.closest("[data-modal-panel]"),i=t?.getAttribute("data-window-key")??t?.getAttribute("data-window-owner");i&&r(i),j.current?.focus({preventScroll:!0}),I(e.file,e)},()=>h.error(p.openFailed(p.fromDrive))))})()}}]}):v(o,{variant:"ghost",leftIcon:G,onClick:M,children:p.open});return y("div",{className:"office-filelist",ref:j,tabIndex:-1,children:[v(l,{title:m.windowTitle}),v("input",{ref:P,type:"file",accept:z,className:"office-filelist-input",onChange:e=>{const t=e.target.files?.[0];e.target.value="",t&&I(t)}}),y("div",{className:"office-filelist-head",children:[v("h2",{children:m.heading}),H,q&&q.length>0&&W]}),T&&v("div",{className:"office-filelist-busy",role:"status",children:T}),0===q?.length?v("div",{className:"office-filelist-empty",children:v(f,{title:m.emptyTitle,description:m.emptyBody,children:W})}):v("ul",{className:"office-filelist-rows",children:q?.map(e=>y("li",{className:"office-filelist-row",onContextMenu:t=>K.open(t,e),children:[E===e.id?v(k,{title:e.title,label:p.name,onDone:t=>((e,t)=>{O(null);const i=t?.trim();i&&i!==e.title&&(B(t=>t?.map(t=>t.id===e.id?{...t,title:i}:t)??t),C(e.id,i).then(L,()=>{h.error(p.renameFailed),L()}))})(e,t)}):v(o,{variant:"link",onClick:()=>A(e.id),children:e.title}),v("span",{className:"office-filelist-date",children:new Date(e.updatedAt).toLocaleDateString()}),F&&v(o,{variant:"ghost",leftIcon:v(a,{name:"trash",size:16}),onClick:()=>{R(e)},children:p.delete})]},e.id))}),K.state&&v(c,{...K.props,items:(J=K.state.data,[{key:"open",label:p.open,onSelect:()=>A(J.id)},...S?[{key:"rename",label:p.rename,onSelect:()=>O(J.id)}]:[],...F?[{key:"divider",type:"divider"},{key:"delete",label:p.delete,danger:!0,onSelect:()=>{R(J)}}]:[]])})]});var J}function k({title:e,label:l,onDone:r}){const[a,o]=n(e),c=i(null),s=i(!1),d=e=>{s.current||(s.current=!0,r(e))},f=i(d);return f.current=d,t(()=>{c.current?.focus(),c.current?.select()},[]),t(()=>p(()=>(f.current(null),!0)),[]),v("div",{className:"office-filelist-rename",children:v(m,{ref:c,"aria-label":l,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{"Enter"===e.key?d(a):"Escape"===e.key&&(e.stopPropagation(),d(null))},onBlur:()=>d(a)})})}export{w as FileList};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={open:"Open",fromComputer:"From this computer",fromDrive:"From Efficient Drive",rename:"Rename",delete:"Delete",name:"Name",renameFailed:"Couldn't rename this file.",choosing:(e,o)=>`Choosing a ${e} file for ${o}`,opening:e=>`Opening ${e}…`,openFailed:e=>`Couldn't open ${e}. Check that it isn't damaged or password-protected.`,savedCopy:(e,o,n)=>`${n?`Saved to ${n} as ${e}`:`Saved as ${e}`}. Your ${o} is unchanged.`},o={open:"打开",fromComputer:"从此电脑",fromDrive:"从 Efficient 云盘",rename:"重命名",delete:"删除",name:"名称",renameFailed:"无法重命名此文件。",choosing:(e,o)=>`正在为${o}选择 ${e} 文件`,opening:e=>`正在打开 ${e}…`,openFailed:e=>`无法打开 ${e}。请确认文件未损坏且没有密码保护。`,savedCopy:(e,o,n)=>`${n?`已保存到 ${n},名为 ${e}`:`已保存为 ${e}`}。原文件 ${o} 未作更改。`};export{e as ENGLISH_FILE_WORDS,o as ZH_HANS_FILE_WORDS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{readXlsx as t}from"./chunk-N26CBJZA.js";import{formatKey as e,newSheet as r,parseCsv as s,sheetFromRows as n,writeCells as c}from"./chunk-VKCG3LPQ.js";import{titleOf as a}from"./chunk-XYVQTQ6N.js";async function o(t){const s=await(import("xlsx")),n=s.read(t,{type:"array",cellFormula:!0,cellNF:!0});return n.SheetNames.map(t=>{const a=n.Sheets[t],o=r(t),i=[],f={};if(a["!ref"]){const t=s.utils.decode_range(a["!ref"]);for(let r=t.s.r;r<=t.e.r;r++)for(let n=t.s.c;n<=t.e.c;n++){const t=a[s.utils.encode_cell({r:r,c:n})];if(!t||void 0===t.v&&!t.f)continue;const c=t.f?`=${t.f}`:"b"===t.t?t.v?"TRUE":"FALSE":String(t.v);i.push({row:r,col:n,raw:"s"===t.t&&/^(?:=|-?\d|'|true$|false$)/i.test(c)?`'${c}`:c}),t.z&&"General"!==t.z&&(f[e(r,n)]={numFmt:t.z})}}const l={};(a["!cols"]??[]).forEach((t,e)=>{t?.wpx&&(l[e]=t.wpx)});const m=(a["!merges"]??[]).map(t=>({r1:t.s.r,c1:t.s.c,r2:t.e.r,c2:t.e.c}));return{...c(o,i),formats:f,colWidths:l,merges:m}})}async function i(e,r,c="Sheet1"){const i=await async function(e,r){if(/\.(xlsx|xls|ods)$/i.test(e.name)){const r=new Uint8Array(await e.arrayBuffer());return/\.xlsx$/i.test(e.name)&&"undefined"!=typeof DecompressionStream?t(r):o(r)}const c=s(await e.text());return[n(r,c.length?c:[[""]])]}(r,c),f=a(r.name),l=await e.create(f);try{await e.save(l.id,{sheets:i},l.version)}catch(t){throw await e.remove(l.id).catch(()=>{}),t}return{id:l.id,title:f}}export{o as readWithSheetJs,i as importSpreadsheetFile};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ENGLISH_WORDS as r}from"./chunk-7K7AY3V3.js";import{newSheet as e}from"./chunk-VKCG3LPQ.js";var t=["xlsx","xls","ods","csv","tsv","txt"],s=t.map(r=>`.${r}`).join(",");import{createContext as o,useContext as a}from"react";import{jsx as n}from"react/jsx-runtime";var c=o(r);function i({words:r,children:e}){return n(c.Provider,{value:r,children:e})}var m=()=>a(c);import{createContext as l,useContext as u}from"react";import{jsx as v}from"react/jsx-runtime";var p=class extends Error{},x=l({});function d({value:r,children:e}){return v(x.Provider,{value:r,children:e})}var f=()=>u(x);function h(r,t){const s=Array.isArray(r?.sheets)?r.sheets:[];return s.length?s.map(r=>({...e(r.name),...r,cells:(r.cells??[]).map(r=>(r??[]).map(r=>r??""))})):[e(t)]}export{t as SPREADSHEET_EXTENSIONS,s as SPREADSHEET_ACCEPT,i as SpreadsheetWordsProvider,m as useSpreadsheetWords,p as SpreadsheetsConflict,d as SpreadsheetsProvider,f as useSpreadsheetsHost,h as sheetsOf};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ENGLISH_WORDS as r}from"./chunk-I3AC6PYR.js";import{createContext as e,useContext as o}from"react";import{jsx as t}from"react/jsx-runtime";var n=e(r);function a({words:r,children:e}){return t(n.Provider,{value:r,children:e})}var i=()=>o(n);import{createContext as s,useContext as c}from"react";import{jsx as d}from"react/jsx-runtime";var m=class extends Error{},u=s({});function l({value:r,children:e}){return d(u.Provider,{value:r,children:r.words?d(a,{words:r.words,children:e}):e})}var v=()=>c(u);export{a as DocumentsWordsProvider,i as useDocumentsWords,m as DocumentsConflict,l as DocumentsProvider,v as useDocumentsHost};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{readDocx as t}from"./chunk-COXKOQPZ.js";import{titleOf as a}from"./chunk-XYVQTQ6N.js";async function r(r,i){const e=new Uint8Array(await i.arrayBuffer());await t(e);const n=a(i.name),c=await r.create(n);try{await r.save(c.id,e,c.version)}catch(t){throw await r.remove(c.id).catch(()=>{}),t}return{id:c.id,title:n}}export{r as importDocumentFile};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DEFAULT_COL_WIDTH as t,DEFAULT_FONT_SIZE as e,DEFAULT_ROW_HEIGHT as n,FormulaError as r,colIndex as o,colLabel as s,formatKey as l,isFormula as i,newSheet as a,rangeLabel as m,shiftFormula as c,tokenize as f,usedBounds as u}from"./chunk-VKCG3LPQ.js";var h=(()=>{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 d(t){let e=4294967295;for(let n=0;n<t.length;n++)e=h[255&(e^t[n])]^e>>>8;return(4294967295^e)>>>0}async function g(t,e){const n=e.writable.getWriter();return n.write(t).then(()=>n.close()).catch(()=>{}),new Uint8Array(await new Response(e.readable).arrayBuffer())}async function p(t){return"undefined"==typeof CompressionStream?null:g(t,new CompressionStream("deflate-raw"))}async function $(t){return g(t,new DecompressionStream("deflate-raw"))}async function b(t){const e=new TextEncoder,n=[],r=[];let o=0;for(const s of t){const t=e.encode(s.name),l=e.encode(s.text),i=await p(l),a=null===i||i.length>=l.length,m=a?l:i,c=d(l),f=new Uint8Array(30+t.length),u=new DataView(f.buffer);u.setUint32(0,67324752,!0),u.setUint16(4,20,!0),u.setUint16(6,2048,!0),u.setUint16(8,a?0:8,!0),u.setUint32(14,c,!0),u.setUint32(18,m.length,!0),u.setUint32(22,l.length,!0),u.setUint16(26,t.length,!0),f.set(t,30);const h=new Uint8Array(46+t.length),g=new DataView(h.buffer);g.setUint32(0,33639248,!0),g.setUint16(4,20,!0),g.setUint16(6,20,!0),g.setUint16(8,2048,!0),g.setUint16(10,a?0:8,!0),g.setUint32(16,c,!0),g.setUint32(20,m.length,!0),g.setUint32(24,l.length,!0),g.setUint16(28,t.length,!0),g.setUint32(42,o,!0),h.set(t,46),n.push(f,m),r.push(h),o+=f.length+m.length}const s=r.reduce((t,e)=>t+e.length,0),l=new Uint8Array(22),i=new DataView(l.buffer);i.setUint32(0,101010256,!0),i.setUint16(8,t.length,!0),i.setUint16(10,t.length,!0),i.setUint32(12,s,!0),i.setUint32(16,o,!0);const a=new Uint8Array(o+s+22);let m=0;for(const t of[...n,...r,l])a.set(t,m),m+=t.length;return a}async function x(t){const e=new DataView(t.buffer,t.byteOffset,t.byteLength);let n=-1;for(let r=t.length-22;r>=Math.max(0,t.length-66e3);r--)if(101010256===e.getUint32(r,!0)){n=r;break}if(n<0)throw new Error("Not a zip file");const r=e.getUint16(n+10,!0);let o=e.getUint32(n+16,!0);const s=new TextDecoder,l=new Map;for(let n=0;n<r;n++){const n=e.getUint16(o+10,!0),r=e.getUint32(o+20,!0),i=e.getUint16(o+28,!0),a=e.getUint16(o+30,!0),m=e.getUint16(o+32,!0),c=e.getUint32(o+42,!0),f=s.decode(t.subarray(o+46,o+46+i));if(o+=46+i+a+m,!/\.(xml|rels)$/i.test(f))continue;const u=c+30+e.getUint16(c+26,!0)+e.getUint16(c+28,!0),h=t.subarray(u,u+r);l.set(f,s.decode(8===n?await $(h):h))}return l}var w=new Set(["CONCAT","IFS","SWITCH","TEXTJOIN","XLOOKUP","XOR","IFNA","DAYS","STDEV.S","STDEV.P","VAR.S","VAR.P","MODE.SNGL","RANK.EQ","CEILING.MATH","FLOOR.MATH"]);function F(t){const{tokens:e}=f(t);let n="",r=0;for(const o of e){if("ident"!==o.type)continue;const e=o.value.replace(/^_xlfn\.(?:_xlws\.)?/i,"").replace(/^_xlws\./i,"");e!==o.value&&(n+=t.slice(r,o.start)+e,r=o.end)}return`=${n}${t.slice(r)}`}function y(t){return t.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}var A='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n',C="http://schemas.openxmlformats.org/spreadsheetml/2006/main",v="http://schemas.openxmlformats.org/officeDocument/2006/relationships";function N(t){return`FF${t.replace("#","").toUpperCase().padStart(6,"0").slice(0,6)}`}var U=class{fonts=[`<font><sz val="${e}"/><name val="Arial"/></font>`];fills=['<fill><patternFill patternType="none"/></fill>','<fill><patternFill patternType="gray125"/></fill>'];borders=["<border><left/><right/><top/><bottom/><diagonal/></border>"];numFmts=[];xfs=['<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>'];seen=new Map;index(t,e){const n=t.indexOf(e);return n>=0?n:(t.push(e),t.length-1)}add(t){if(!t||!Object.keys(t).length)return 0;const n=JSON.stringify(t),r=this.seen.get(n);if(void 0!==r)return r;const o=this.index(this.fonts,`<font>${t.bold?"<b/>":""}${t.italic?"<i/>":""}${t.strike?"<strike/>":""}${t.underline?"<u/>":""}<sz val="${t.fontSize??e}"/>${t.color?`<color rgb="${N(t.color)}"/>`:""}<name val="Arial"/></font>`),s=t.fill?this.index(this.fills,`<fill><patternFill patternType="solid"><fgColor rgb="${N(t.fill)}"/><bgColor indexed="64"/></patternFill></fill>`):0,l=(t,e)=>e?`<${t} style="thin"><color auto="1"/></${t}>`:`<${t}/>`,i=t.border??{},a=this.index(this.borders,`<border>${l("left",i.left)}${l("right",i.right)}${l("top",i.top)}${l("bottom",i.bottom)}<diagonal/></border>`);let m=0;t.numFmt&&"General"!==t.numFmt&&(m="@"===t.numFmt?49:164+this.index(this.numFmts,t.numFmt));const c=t.align||t.vAlign||t.wrap?`<alignment${t.align?` horizontal="${t.align}"`:""}${t.vAlign?` vertical="${"middle"===t.vAlign?"center":t.vAlign}"`:""}${t.wrap?' wrapText="1"':""}/>`:"",f=`<xf numFmtId="${m}" fontId="${o}" fillId="${s}" borderId="${a}" xfId="0" applyFont="1"${s?' applyFill="1"':""}${a?' applyBorder="1"':""}${m?' applyNumberFormat="1"':""}${c?' applyAlignment="1"':""}${c?`>${c}</xf>`:"/>"}`;return this.xfs.push(f),this.seen.set(n,this.xfs.length-1),this.xfs.length-1}toXml(){const t=this.numFmts.length?`<numFmts count="${this.numFmts.length}">${this.numFmts.map((t,e)=>`<numFmt numFmtId="${164+e}" formatCode="${y(t)}"/>`).join("")}</numFmts>`:"";return`${A}<styleSheet xmlns="${C}">${t}<fonts count="${this.fonts.length}">${this.fonts.join("")}</fonts><fills count="${this.fills.length}">${this.fills.join("")}</fills><borders count="${this.borders.length}">${this.borders.join("")}</borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="${this.xfs.length}">${this.xfs.join("")}</cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles></styleSheet>`}};function S(t,e,n,o,a,m){const c=`${s(a)}${o+1}`,u=t.cells[o]?.[a]??"",h=t.formats[l(o,a)],d=m.add(h),g=d?` s="${d}"`:"";if(""===u)return d?`<c r="${c}"${g}/>`:"";const p=n.value(e,o,a);if(i(u)){const t=`<f>${y(function(t){const e=t.slice(1),{tokens:n}=f(e);let r="",o=0;for(let t=0;t<n.length;t++){const s=n[t],l=n[t+1];"ident"===s.type&&"op"===l?.type&&"("===l.value&&w.has(s.value.toUpperCase())&&(r+=`${e.slice(o,s.start)}_xlfn.${s.value.toUpperCase()}`,o=s.end)}return r+e.slice(o)}(u))}</f>`;if("number"==typeof p)return`<c r="${c}"${g}>${t}<v>${p}</v></c>`;if("boolean"==typeof p)return`<c r="${c}"${g} t="b">${t}<v>${p?1:0}</v></c>`;if(p instanceof r){return`<c r="${c}"${g} t="e">${t}<v>${/^#(?:REF!|N\/A|NAME\?|DIV\/0!|VALUE!|NUM!|NULL!)$/.test(p.code)?p.code:"#VALUE!"}</v></c>`}return`<c r="${c}"${g} t="str">${t}<v>${y(null===p?"":p)}</v></c>`}if("number"==typeof p)return`<c r="${c}"${g}><v>${p}</v></c>`;if("boolean"==typeof p)return`<c r="${c}"${g} t="b"><v>${p?1:0}</v></c>`;const $=String(p??"");return`<c r="${c}"${g} t="inlineStr"><is><t${$!==$.trim()||/\n/.test($)?' xml:space="preserve"':""}>${y($)}</t></is></c>`}function k(e,r,o,l){const i=u(e);let a=i?.row??0,c=i?.col??0;const f=new Map;for(const t of Object.keys(e.formats)){const[e,n]=t.split(":").map(Number);a=Math.max(a,e),c=Math.max(c,n),f.has(e)||f.set(e,[]),f.get(e).push(n)}const h=new Set(e.hiddenRows);for(const t of[...e.hiddenRows,...Object.keys(e.rowHeights).map(Number)])a=Math.max(a,t);const d=[];for(let t=0;t<=a;t++){const n=e.cells[t]??[],s=new Set(f.get(t)??[]);n.forEach((t,e)=>{""!==t&&s.add(e)});const i=e.rowHeights[t];if(!s.size&&void 0===i&&!h.has(t))continue;const a=[...s].sort((t,e)=>t-e).map(n=>S(e,r,o,t,n,l)).join(""),m=`${void 0!==i?` ht="${(.75*i).toFixed(2)}" customHeight="1"`:""}${h.has(t)?' hidden="1"':""}`;d.push(`<row r="${t+1}"${m}>${a}</row>`)}const g=new Set(e.hiddenCols),p=[...new Set([...Object.keys(e.colWidths).map(Number),...g])].sort((t,e)=>t-e),$=p.length?`<cols>${p.map(n=>`<col min="${n+1}" max="${n+1}" width="${(((e.colWidths[n]??t)-5)/7).toFixed(4)}" customWidth="1"${g.has(n)?' hidden="1"':""}/>`).join("")}</cols>`:"",{frozenRows:b,frozenCols:x}=e,w=b||x?`<pane${x?` xSplit="${x}"`:""}${b?` ySplit="${b}"`:""} topLeftCell="${s(x)}${b+1}" activePane="${b&&x?"bottomRight":b?"bottomLeft":"topRight"}" state="frozen"/>`:"",F=e.merges.length?`<mergeCells count="${e.merges.length}">${e.merges.map(t=>`<mergeCell ref="${m(t)}"/>`).join("")}</mergeCells>`:"",y=e.filter?`<autoFilter ref="${m(e.filter.range)}"/>`:"",v=e.tabColor?`<sheetPr><tabColor rgb="${N(e.tabColor)}"/></sheetPr>`:"";return`${A}<worksheet xmlns="${C}">${v}<dimension ref="A1:${s(c)}${a+1}"/><sheetViews><sheetView${0===r?' tabSelected="1"':""} workbookViewId="0">${w}</sheetView></sheetViews><sheetFormatPr defaultColWidth="${((t-5)/7).toFixed(4)}" defaultRowHeight="${(.75*n).toFixed(2)}" customHeight="1"/>${$}<sheetData>${d.join("")}</sheetData>${y}${F}</worksheet>`}async function I(t,e){const n=new U,r=function(t){const e=new Set;return t.map((t,n)=>{const r=t.name.replace(/[[\]:*?/\\]/g," ").trim().slice(0,31)||`Sheet ${n+1}`;let o=r;for(let t=2;e.has(o.toLowerCase());t++)o=`${r.slice(0,28)} ${t}`;return e.add(o.toLowerCase()),o})}(t),o=t.map((t,r)=>({name:`xl/worksheets/sheet${r+1}.xml`,text:k(t,r,e,n)})),l=t.map((t,e)=>{return t.filter?`<definedName name="_xlnm._FilterDatabase" localSheetId="${e}" hidden="1">${y(`'${r[e].replace(/'/g,"''")}'!${n=t.filter.range,`$${s(n.c1)}$${n.r1+1}:$${s(n.c2)}$${n.r2+1}`}`)}</definedName>`:"";var n}).join("");return b([{name:"[Content_Types].xml",text:`${A}<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="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>${t.map((t,e)=>`<Override PartName="/xl/worksheets/sheet${e+1}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>`).join("")}</Types>`},{name:"_rels/.rels",text:`${A}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="${v}/officeDocument" Target="xl/workbook.xml"/></Relationships>`},{name:"xl/workbook.xml",text:`${A}<workbook xmlns="${C}" xmlns:r="${v}"><sheets>${r.map((t,e)=>`<sheet name="${y(t)}" sheetId="${e+1}" r:id="rId${e+1}"/>`).join("")}</sheets>${l?`<definedNames>${l}</definedNames>`:""}<calcPr calcId="0" fullCalcOnLoad="1"/></workbook>`},{name:"xl/_rels/workbook.xml.rels",text:`${A}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">${t.map((t,e)=>`<Relationship Id="rId${e+1}" Type="${v}/worksheet" Target="worksheets/sheet${e+1}.xml"/>`).join("")}<Relationship Id="rId${t.length+1}" Type="${v}/styles" Target="styles.xml"/></Relationships>`},{name:"xl/styles.xml",text:n.toXml()},...o])}var T={1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",14:"dd/mm/yyyy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"dd/mm/yyyy h:mm",37:"#,##0;(#,##0)",38:"#,##0;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mm:ss.0",48:"##0.0E+0",49:"@"},E=["FFFFFF","000000","E7E6E6","44546A","4472C4","ED7D31","A5A5A5","FFC000","5B9BD5","70AD47","0563C1","954F72"],M={0:"000000",1:"FFFFFF",2:"FF0000",3:"00FF00",4:"0000FF",5:"FFFF00",6:"FF00FF",7:"00FFFF",8:"000000",9:"FFFFFF",10:"FF0000",11:"00FF00",12:"0000FF",13:"FFFF00",14:"FF00FF",15:"00FFFF"};function R(t){if(!t)return;const e=t.getAttribute("rgb");if(e)return`#${e.slice(-6).toLowerCase()}`;const n=Number(t.getAttribute("tint")??0),r=t.getAttribute("theme");if(null!==r){const t=E[Number(r)];return t?`#${function(t,e){const n=n=>{const r=parseInt(t.slice(n,n+2),16),o=e<0?r*(1+e):r+(255-r)*e;return Math.round(o).toString(16).padStart(2,"0")};return`${n(0)}${n(2)}${n(4)}`}(t,n)}`.toLowerCase():void 0}const o=t.getAttribute("indexed");if(null!==o){const t=M[Number(o)];return t?`#${t}`.toLowerCase():void 0}}var D=t=>(new DOMParser).parseFromString(t,"application/xml"),j=(t,e)=>Array.from(t.getElementsByTagNameNS("*",e)),O=(t,e)=>j(t,e)[0],L=(t,e)=>Array.from(t.children).filter(t=>t.localName===e);function V(t){const e=/^([A-Z]+)(\d+)$/.exec(t);return{row:Number(e[2])-1,col:o(e[1])}}function z(t){const[e,n=e]=t.replace(/\$/g,"").split(":"),r=V(e),o=V(n);return{r1:r.row,c1:r.col,r2:o.row,c2:o.col}}function P(t,e,n,r){const o=D(e),s=a(t),i=[],m={},f=new Map;for(const t of j(o,"c")){const e=t.getAttribute("r");if(!e)continue;const{row:o,col:s}=V(e),a=r[Number(t.getAttribute("s")??0)];a&&Object.keys(a).length&&(m[l(o,s)]=a);const u=L(t,"f")[0],h=L(t,"v")[0]?.textContent??"",d=t.getAttribute("t");let g="";if(u){const t=u.getAttribute("si");if("shared"===u.getAttribute("t")&&null!==t)if(u.textContent)f.set(t,{text:u.textContent,row:o,col:s}),g=F(u.textContent);else{const e=f.get(t);e&&(g=c(F(e.text),o-e.row,s-e.col))}else u.textContent&&(g=F(u.textContent))}if(g||(g="s"===d?n[Number(h)]??"":"inlineStr"===d?j(t,"t").map(t=>t.textContent??"").join(""):"b"===d?"1"===h?"TRUE":"FALSE":h,"s"!==d&&"inlineStr"!==d&&"str"!==d||!/^(?:=|-?\d|'|true$|false$)/i.test(g)||(g=`'${g}`)),""!==g){for(;i.length<=o;)i.push([]);for(;i[o].length<=s;)i[o].push("");i[o][s]=g}}const u={},h=[];for(const t of j(o,"col")){const e=Number(t.getAttribute("min"))-1,n=Math.min(Number(t.getAttribute("max"))-1,e+500),r=Number(t.getAttribute("width")??0);for(let o=e;o<=n;o++)r&&"1"===t.getAttribute("customWidth")&&(u[o]=Math.round(7*r+5)),"1"===t.getAttribute("hidden")&&h.push(o)}const d={},g=[];for(const t of j(o,"row")){const e=Number(t.getAttribute("r"))-1,n=t.getAttribute("ht");n&&"1"===t.getAttribute("customHeight")&&(d[e]=Math.round(Number(n)/.75)),"1"===t.getAttribute("hidden")&&g.push(e)}const p=O(o,"pane"),$="frozen"===p?.getAttribute("state"),b=O(o,"autoFilter")?.getAttribute("ref"),x=R(O(o,"tabColor"));return{...s,tabColor:x,cells:i,formats:m,colWidths:u,rowHeights:d,hiddenCols:h,hiddenRows:g,merges:j(o,"mergeCell").map(t=>z(t.getAttribute("ref")??"A1")),frozenRows:$?Number(p?.getAttribute("ySplit")??0):0,frozenCols:$?Number(p?.getAttribute("xSplit")??0):0,filter:b?{range:z(b),excluded:{}}:null,rowCount:Math.max(s.rowCount,i.length+100),colCount:Math.max(s.colCount,i.reduce((t,e)=>Math.max(t,e.length),0))}}async function H(t){const e=await x(t),n=e.get("xl/workbook.xml");if(!n)throw new Error("Not a workbook");const r=D(e.get("xl/_rels/workbook.xml.rels")??"<Relationships/>"),o=new Map(j(r,"Relationship").map(t=>[t.getAttribute("Id"),t.getAttribute("Target")??""])),s=e.get("xl/sharedStrings.xml")?j(D(e.get("xl/sharedStrings.xml")),"si").map(t=>j(t,"t").filter(t=>"rPh"!==t.parentElement?.localName).map(t=>t.textContent??"").join("")):[],l=function(t){if(!t)return[];const e=D(t),n=new Map(j(e,"numFmt").map(t=>[Number(t.getAttribute("numFmtId")),t.getAttribute("formatCode")??""])),r=O(e,"fonts"),o=O(e,"fills"),s=O(e,"borders"),l=O(e,"cellXfs");if(!l)return[];const i=r?L(r,"font"):[],a=o?L(o,"fill"):[],m=s?L(s,"border"):[],c=Number(i[0]?L(i[0],"sz")[0]?.getAttribute("val")??0:0);return L(l,"xf").map(t=>{const e={},r=Number(t.getAttribute("numFmtId")??0),o=n.get(r)??T[r];o&&"General"!==o&&(e.numFmt=o);const s=i[Number(t.getAttribute("fontId")??0)];if(s){L(s,"b").length&&(e.bold=!0),L(s,"i").length&&(e.italic=!0),L(s,"u").length&&(e.underline=!0),L(s,"strike").length&&(e.strike=!0);const t=Number(L(s,"sz")[0]?.getAttribute("val")??0);t&&t!==c&&(e.fontSize=t);const n=R(L(s,"color")[0]);n&&"#000000"!==n&&(e.color=n)}const l=a[Number(t.getAttribute("fillId")??0)]?.getElementsByTagNameNS("*","patternFill")[0];if(l&&"solid"===l.getAttribute("patternType")){const t=R(L(l,"fgColor")[0]);t&&(e.fill=t)}const f=m[Number(t.getAttribute("borderId")??0)];if(f){const t=t=>!!L(f,t)[0]?.getAttribute("style"),n={top:t("top"),right:t("right"),bottom:t("bottom"),left:t("left")};(n.top||n.right||n.bottom||n.left)&&(e.border={...n.top?{top:!0}:{},...n.right?{right:!0}:{},...n.bottom?{bottom:!0}:{},...n.left?{left:!0}:{}})}const u=L(t,"alignment")[0];if(u){const t=u.getAttribute("horizontal");"left"!==t&&"center"!==t&&"right"!==t||(e.align=t);const n=u.getAttribute("vertical");"top"!==n&&"bottom"!==n||(e.vAlign=n),"center"===n&&(e.vAlign="middle");const r=u.getAttribute("wrapText");"1"!==r&&"true"!==r||(e.wrap=!0)}return e})}(e.get("xl/styles.xml")),i=[];for(const t of j(D(n),"sheet")){const n=t.getAttribute("name")??`Sheet ${i.length+1}`,r=t.getAttributeNS(v,"id")??t.getAttribute("r:id"),a=o.get(r)??"",m=a.startsWith("/")?a.slice(1):`xl/${a}`,c=e.get(m);c&&i.push(P(n,c,s,l))}if(!i.length)throw new Error("No sheets");return i}export{b as zip,x as unzip,I as writeXlsx,H as readXlsx};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ENGLISH_WORDS as t}from"./chunk-X6F3Z4KZ.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t,n,o){return t.map((h,r)=>({top:h,height:Math.max(Math.min((t[r+1]??o)-h,n),0)}))}function n(t,n){const o=n.top+n.height;let h=-1,r=-1;return t.forEach((t,e)=>{t.top>=o||t.top+t.height<=n.top||(h<0&&(h=e),r=e)}),h<0?null:{first:h,last:r}}function o(t,n,o){const h=n-o,r=[0];let e=0;return t.forEach((t,n)=>{e>0&&e+t>h&&(r.push(n),e=0),e+=t}),r}export{t as pageWindows,n as boxesInWindow,o as rowPageStarts};
|
|
@@ -0,0 +1 @@
|
|
|
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-STLMOUNE.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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ENGLISH_WORDS as r}from"./chunk-X6F3Z4KZ.js";var s=class extends Error{constructor(s=r.pptxPasswordProtected){super(s),this.name="PptxPasswordError"}},t=class extends Error{constructor(s=r.pptxUnreadable){super(s),this.name="PptxUnreadableError"}};export{s as PptxPasswordError,t as PptxUnreadableError};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=1048576,n=16384;function e(t){let n=t+1,e="";for(;n>0;){const t=(n-1)%26;e=String.fromCharCode(65+t)+e,n=Math.floor((n-1)/26)}return e}function r(t){let n=0;for(const e of t.toUpperCase())n=26*n+(e.charCodeAt(0)-64);return n-1}function o(t,n){return`${e(n)}${t+1}`}function s(t,n){return{r1:Math.min(t.row,n.row),c1:Math.min(t.col,n.col),r2:Math.max(t.row,n.row),c2:Math.max(t.col,n.col)}}function c(t){const n=o(t.r1,t.c1);return t.r1===t.r2&&t.c1===t.c2?n:`${n}:${o(t.r2,t.c2)}`}function u(t,n,e){return n>=t.r1&&n<=t.r2&&e>=t.c1&&e<=t.c2}function l(t,n){return t.r1<=n.r2&&t.r2>=n.r1&&t.c1<=n.c2&&t.c2>=n.c1}function i(t){const n=/^\$?([A-Za-z]{1,3})\$?(\d{1,7})(?::\$?([A-Za-z]{1,3})\$?(\d{1,7}))?$/.exec(t.trim());if(!n)return null;const e={row:Number(n[2])-1,col:r(n[1])},o=n[3]?{row:Number(n[4])-1,col:r(n[3])}:e;return e.row<0||o.row<0?null:s(e,o)}var a=class extends Error{},f=String.raw`(\$?)([A-Za-z]{1,3})(\$?)(\d{1,7})`,h=new RegExp(`^${f}(?::${f})?(?![A-Za-z0-9_.(])`),m=/^(\$?)([A-Za-z]{1,3}):(\$?)([A-Za-z]{1,3})(?![A-Za-z0-9_.(])/,d=/^(\$?)(\d{1,7}):(\$?)(\d{1,7})(?![A-Za-z0-9_.(])/,p=/^(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/,g=/^[A-Za-z_][A-Za-z0-9_.]*/,w=/^#(?:REF!|N\/A|NAME\?|DIV\/0!|VALUE!|NUM!|NULL!)/i,b=/^(?:'((?:[^']|'')+)'|([A-Za-z_][A-Za-z0-9_.]*))!/;function M(t,n,e,o){return{col:r(n),row:Number(o)-1,colAbs:"$"===t,rowAbs:"$"===e}}function y(e){let o=null,s=0;const c=b.exec(e);c&&(o=void 0!==c[1]?c[1].replace(/''/g,"'"):c[2],s=c[0].length);const u=e.slice(s),l=h.exec(u);if(l){const e=M(l[1],l[2],l[3],l[4]);if(e.row<0||e.row>=t||e.col>=n)return null;const r=l[6]?M(l[5],l[6],l[7],l[8]):null;return r&&(r.row<0||r.row>=t||r.col>=n)?null:{ref:{sheet:o,a:e,b:r},length:s+l[0].length}}const i=m.exec(u);if(i){return{ref:{sheet:o,a:{col:r(i[2]),row:null,colAbs:"$"===i[1],rowAbs:!1},b:{col:r(i[4]),row:null,colAbs:"$"===i[3],rowAbs:!1}},length:s+i[0].length}}const a=d.exec(u);if(a&&Number(a[2])>0&&Number(a[4])>0){return{ref:{sheet:o,a:{col:null,row:Number(a[2])-1,colAbs:!1,rowAbs:"$"===a[1]},b:{col:null,row:Number(a[4])-1,colAbs:!1,rowAbs:"$"===a[3]}},length:s+a[0].length}}return null}var A=["<=",">=","<>","+","-","*","/","^","&","=","<",">","%","(",")",",",";"];function v(t){const n=[];let e=0;for(;e<t.length;){const r=t[e];if(/\s/.test(r)){e++;continue}const o=t.slice(e);if('"'===r){let r=e+1,o="",s=!1;for(;r<t.length;){if('"'===t[r]){if('"'===t[r+1]){o+='"',r+=2;continue}s=!0,r++;break}o+=t[r++]}if(!s)return{tokens:n,complete:!1};n.push({type:"string",value:o,start:e,end:r}),e=r;continue}if("#"===r){const t=w.exec(o);if(!t)return{tokens:n,complete:!1};n.push({type:"error",value:t[0].toUpperCase(),start:e,end:e+t[0].length}),e+=t[0].length;continue}const s=y(o);if(s){n.push({type:"ref",ref:s.ref,start:e,end:e+s.length}),e+=s.length;continue}const c=p.exec(o);if(c){n.push({type:"number",value:Number(c[0]),start:e,end:e+c[0].length}),e+=c[0].length;continue}const u=g.exec(o);if(u){n.push({type:"ident",value:u[0],start:e,end:e+u[0].length}),e+=u[0].length;continue}const l=A.find(t=>o.startsWith(t));if(!l)return{tokens:n,complete:!1};n.push({type:"op",value:l,start:e,end:e+l.length}),e+=l.length}return{tokens:n,complete:!0}}var E={"=":1,"<>":1,"<":1,">":1,"<=":1,">=":1,"&":2,"+":3,"-":3,"*":4,"/":4,"^":6},N=class{constructor(t){this.tokens=t}tokens;pos=0;peek(){return this.tokens[this.pos]}isOp(t){const n=this.peek();return"op"===n?.type&&n.value===t}run(){const t=this.expression(0);if(this.pos<this.tokens.length)throw new a("Unexpected text");return t}expression(t){let n=this.prefix();for(;;){const e=this.peek();if("op"!==e?.type)break;if("%"===e.value){this.pos++,n={kind:"percent",arg:n};continue}const r=E[e.value];if(void 0===r||r<=t)break;this.pos++,n={kind:"binary",op:e.value,left:n,right:this.expression(r)}}return n}prefix(){const t=this.peek();if(!t)throw new a("Formula ends early");switch(this.pos++,t.type){case"number":return{kind:"num",value:t.value};case"string":return{kind:"str",value:t.value};case"error":return{kind:"err",value:t.value};case"ref":return{kind:"ref",ref:t.ref};case"ident":{if(this.isOp("("))return this.call(t.value);const n=t.value.toUpperCase();return"TRUE"===n?{kind:"bool",value:!0}:"FALSE"===n?{kind:"bool",value:!1}:{kind:"err",value:"#NAME?"}}case"op":if("-"===t.value||"+"===t.value)return{kind:"unary",op:t.value,arg:this.expression(7)};if("("===t.value){const t=this.expression(0);if(!this.isOp(")"))throw new a("Missing )");return this.pos++,t}throw new a(`Unexpected ${t.value}`)}}call(t){this.pos++;const n=[];if(this.isOp(")"))return this.pos++,{kind:"call",name:t.toUpperCase(),args:n};for(;;){if(this.isOp(",")||this.isOp(";")||this.isOp(")")?n.push({kind:"empty"}):n.push(this.expression(0)),!this.isOp(",")&&!this.isOp(";")){if(this.isOp(")"))return this.pos++,{kind:"call",name:t.toUpperCase(),args:n};throw new a("Missing )")}this.pos++}}},x=new Map;function C(t){return t.length>1&&"="===t[0]}function $(t){return(null===t.col?"":`${t.colAbs?"$":""}${e(t.col)}`)+(null===t.row?"":`${t.rowAbs?"$":""}${t.row+1}`)}function S(t){return(null===(n=t.sheet)?"":/^[A-Za-z_][A-Za-z0-9_.]*$/.test(n)&&!h.test(n)?`${n}!`:`'${n.replace(/'/g,"''")}'!`)+$(t.a)+(t.b?`:${$(t.b)}`:"");var n}function O(t,n){if(!C(t))return t;const e=t.slice(1),{tokens:r}=v(e);let o="",s=0;for(const t of r){if("ref"!==t.type)continue;const r=n(t.ref);o+=e.slice(s,t.start)+(r?S(r):"#REF!"),s=t.end}return`=${o}${e.slice(s)}`}function R(e,r,o){const s=e=>{const s=null===e.row||e.rowAbs?e.row:e.row+r,c=null===e.col||e.colAbs?e.col:e.col+o;return null!==s&&(s<0||s>=t)||null!==c&&(c<0||c>=n)?null:{...e,row:s,col:c}};return O(e,t=>{const n=s(t.a),e=t.b?s(t.b):null;return!n||t.b&&!e?null:{...t,a:n,b:e}})}function T(t){return t.colAbs||t.rowAbs?t.colAbs&&t.rowAbs?{...t,colAbs:!1,rowAbs:!0}:!t.colAbs&&t.rowAbs?{...t,colAbs:!0,rowAbs:!1}:{...t,colAbs:!1,rowAbs:!1}:{...t,colAbs:!0,rowAbs:!0}}var U=t=>String(t).padStart(2,"0"),F={general:"General",number:"#,##0.00",percent:"0.00%",currency:'"$"#,##0.00',scientific:"0.00E+00",date:"yyyy-mm-dd",time:"h:mm:ss AM/PM",dateTime:"yyyy-mm-dd h:mm",text:"@"},k=864e5,D=Date.UTC(1899,11,30);function L(t,n,e){return Math.round((Date.UTC(t,n-1,e)-D)/k)}function I(t){const n=Math.floor(t),e=new Date(D+n*k),r=Math.round(86400*(t-n));return{year:e.getUTCFullYear(),month:e.getUTCMonth()+1,day:e.getUTCDate(),weekday:e.getUTCDay(),hours:Math.floor(r/3600)%24,minutes:Math.floor(r/60)%60,seconds:r%60}}var P=/\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*\d+)\]/i;function V(t){const n=[];let e="",r=!1;for(let o=0;o<t.length;o++){const s=t[o];"\\"!==s?('"'===s&&(r=!r),";"!==s||r?e+=s:(n.push(e),e="")):e+=s+(t[++o]??"")}return n.push(e),n}function z(t){return t.replace(/\\./g,"").replace(/"[^"]*"/g,"").replace(/\[[^\]]*\]/g,"")}function G(t){return!(!t||"General"===t||"@"===t)&&/[ymdhs]/i.test(z(V(t)[0]).replace(/E\+/gi,""))}var W=["January","February","March","April","May","June","July","August","September","October","November","December"],j=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function H(t,n){const e=I(n),r=/AM\/PM|A\/P/i.test(z(t)),o=t.match(/"[^"]*"|\\.|\[[^\]]*\]|AM\/PM|A\/P|y+|m+|d+|h+|s+|./gi)??[];let s="";return o.forEach((t,n)=>{if('"'===t[0])s+=t.slice(1,-1);else if("\\"===t[0])s+=t.slice(1);else if("["===t[0])s+="";else if(/^AM\/PM$/i.test(t))s+=e.hours<12?"AM":"PM";else if(/^A\/P$/i.test(t))s+=e.hours<12?"A":"P";else if(/^y+$/i.test(t))s+=t.length<=2?U(e.year%100):String(e.year);else if(/^m+$/i.test(t))t.length<=2&&(t=>{for(let n=t-1;n>=0;n--){if(/^h+$/i.test(o[n]))return!0;if(/^[ymds]+$/i.test(o[n]))break}for(let n=t+1;n<o.length;n++){if(/^s+$/i.test(o[n]))return!0;if(/^[ymdh]+$/i.test(o[n]))break}return!1})(n)?s+=2===t.length?U(e.minutes):String(e.minutes):1===t.length?s+=String(e.month):2===t.length?s+=U(e.month):3===t.length?s+=W[e.month-1].slice(0,3):s+=W[e.month-1];else if(/^d+$/i.test(t))1===t.length?s+=String(e.day):2===t.length?s+=U(e.day):3===t.length?s+=j[e.weekday].slice(0,3):s+=j[e.weekday];else if(/^h+$/i.test(t)){const n=r?e.hours%12||12:e.hours;s+=2===t.length?U(n):String(n)}else/^s+$/i.test(t)?s+=2===t.length?U(e.seconds):String(e.seconds):s+=t}),s}function Z(t,n){const e=/[eE]([+-])(0+|\?+|#+)$/.exec(t);if(e){const r=(t.slice(0,e.index).split(".")[1]??"").length,[o,s]=n.toExponential(r).split("e"),c=Number(s);return`${o}E${c<0?"-":"+"===e[1]?"+":""}${String(Math.abs(c)).padStart(e[2].length,"0")}`}const[r,o=""]=t.split("."),s=/,+$/.exec(r)?.[0].length??0,c=/[#0?],[#0?]/.test(r),u=(r.match(/0/g)??[]).length,l=o.replace(/[^#0?]/g,"").length,i=(o.match(/0/g)??[]).length,a=n/1e3**s,f=Math.abs(a).toFixed(Math.min(l,20));let[h,m=""]=f.split(".");for(;m.length>i&&m.endsWith("0");)m=m.slice(0,-1);return"0"===h&&0===u&&(h=""),h=h.padStart(u,"0"),c&&(h=h.replace(/\B(?=(\d{3})+(?!\d))/g,",")),m?`${h}.${m}`:(o.includes("."),h)}function _(t){if(!Number.isFinite(t))return String(t);if(0===t)return"0";const n=Math.abs(t);if(n>=1e11||n<1e-9){const[n,e]=t.toExponential(5).split("e"),r=Number(e);return`${n.replace(/\.?0+$/,"")}E${r<0?"-":"+"}${U(Math.abs(r))}`}return String(Number(t.toPrecision(10)))}var K={black:"#000000",blue:"#0000ff",cyan:"#00ffff",green:"#00a650",magenta:"#ff00ff",red:"#ff0000",white:"#ffffff",yellow:"#ffff00"};function X(t,n){if(!n||"General"===n||"@"===n)return{text:_(t),color:null};const e=V(n);let r=e[0],o=!1;t<0&&e.length>1?(r=e[1],o=!0):0===t&&e.length>2&&(r=e[2]);const s=P.exec(r),c=s?K[s[1].toLowerCase()]??null:null;if(/general/i.test(z(r)))return{text:r.replace(/\[[^\]]*\]/g,"").replace(/general/i,_(o?-t:t)),color:c};if(G(r))return t<0?{text:_(t),color:c}:{text:H(r,t),color:c};const u=o?Math.abs(t):t,l=function(t,n){const e=t.match(/"[^"]*"|\\.|\[[^\]]*\]|_.|\*.|[#0?][#0?,.]*(?:[eE][+-][0?#]+)?%?|%|./g)??[],r=n*100**(z(t).match(/%/g)??[]).length;let o="",s=!1;for(const t of e)if('"'===t[0])o+=t.slice(1,-1);else if("\\"===t[0])o+=t.slice(1);else if("["===t[0]){const n=/^\[\$([^-\]]*)/.exec(t);n&&(o+=n[1])}else if("_"===t[0])o+=" ";else if("*"===t[0])o+="";else if(/^[#0?]/.test(t)){const n=t.endsWith("%"),e=n?t.slice(0,-1):t;s||(o+=Z(e,r),s=!0),n&&(o+="%")}else o+=t;return s?o:`${o}`}(r,Math.abs(u)),i=!/[1-9]/.test(l);return{text:!o&&t<0&&!i?`-${l}`:l,color:c}}function Y(t,n){if(!n||"General"===n||"@"===n)return t;const e=V(n),r=e.length>=4?e[3]:e[0];return r.includes("@")?r.replace(/"([^"]*)"/g,"$1").replace(/\\(.)/g,"$1").replace(/@/g,t):t}function B(t,n,e){let r=t;if(!r||"General"===r){const t=null===e?0:Math.min(9,(String(e).split(".")[1]??"").length);r=t>0?`0.${"0".repeat(t)}`:"0"}return"@"===r||G(r)?r:V(r).map(t=>{const e=t.match(/"[^"]*"|\\.|\[[^\]]*\]|./g)??[];let r=-1,o=-1;return e.forEach((t,n)=>{"."===t&&-1===o&&(o=n),"0"!==t&&"#"!==t&&"?"!==t||(r=n)}),-1===r?t:(1===n?-1===o?e.splice(r+1,0,".","0"):e.splice(r+1,0,"0"):-1!==o&&(r-o===1?e.splice(o,2):e.splice(r,1)),e.join(""))}).join(";")}var J=/^(-?)\s*([$€£¥])\s*(-?)\s*([\d,]*\.?\d+)$/,q=/^[+-]?(?:\d{1,3}(?:,\d{3})+|\d+)?(?:\.\d+)?(?:[eE][+-]?\d+)?$/,Q=/^[+-]?0\d/,tt=/^[+-]?\d{16,}$/,nt=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,et=/^(\d{1,2})[/.-](\d{1,2})[/.-](\d{2}|\d{4})$/;function rt(){try{const t=new Intl.DateTimeFormat(void 0).formatToParts(new Date(2e3,11,31));return t.findIndex(t=>"day"===t.type)<t.findIndex(t=>"month"===t.type)}catch{return!0}}function ot(t,n,e){if(n<1||n>12||e<1||e>31)return!1;const r=new Date(Date.UTC(t,n-1,e));return r.getUTCMonth()===n-1&&r.getUTCDate()===e}function st(t){const n=t.trim();if(!n||Q.test(n)||tt.test(n))return null;const e=J.exec(n);if(e){const t=Number(e[4].replace(/,/g,""));if(Number.isNaN(t))return null;return{value:"-"===e[1]||"-"===e[3]?-t:t,kind:"currency",format:`"${e[2]}"#,##0${e[4].includes(".")?".00":""}`}}if(n.endsWith("%")){const t=n.slice(0,-1).trim();if(!t||!q.test(t))return null;return{value:Number(t.replace(/,/g,""))/100,kind:"percent",format:t.includes(".")?"0.00%":"0%"}}if(/\d/.test(n)&&q.test(n))return{value:Number(n.replace(/,/g,"")),kind:"number",format:n.includes(",")?n.includes(".")?"#,##0.00":"#,##0":null};const r=nt.exec(n);if(r&&ot(Number(r[1]),Number(r[2]),Number(r[3])))return{value:L(Number(r[1]),Number(r[2]),Number(r[3])),kind:"date",format:F.date};const o=et.exec(n);if(o){const t=Number(o[1]),n=Number(o[2]),e=2===o[3].length?2e3+Number(o[3]):Number(o[3]),[r,s]=rt()?[t,n]:[n,t];if(ot(e,s,r))return{value:L(e,s,r),kind:"date",format:rt()?"dd/mm/yyyy":"mm/dd/yyyy"}}return null}var ct=class{constructor(t){this.code=t}code;toString(){return this.code}},ut=t=>"object"==typeof t&&null!==t&&!(t instanceof ct),lt=t=>new ct(t),it=lt("#VALUE!"),at=lt("#DIV/0!"),ft=lt("#NUM!"),ht=lt("#N/A"),mt=lt("#REF!"),dt=lt("#NAME?"),pt=lt("#CIRC!"),gt=lt("#ERROR!"),wt=/^-?(?:0|[1-9]\d{0,14})(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function bt(t){if(""===t)return null;if("'"===t[0])return t.slice(1);if(wt.test(t))return Number(t);const n=t.toUpperCase();return"TRUE"===n||"FALSE"!==n&&t}function Mt(t){return ut(t)?0===t.rows||0===t.cols?null:t.at(0,0):t}function yt(t){if(null===t)return 0;if("number"==typeof t)return t;if("boolean"==typeof t)return t?1:0;if(t instanceof ct)return t;if(""===t.trim())return it;const n=st(t);return n?n.value:it}function At(t){return null===t?"":"number"==typeof t?_(t):"boolean"==typeof t?t?"TRUE":"FALSE":t instanceof ct?t.code:t}function vt(t){if(null===t)return!1;if("boolean"==typeof t)return t;if("number"==typeof t)return 0!==t;if(t instanceof ct)return t;const n=t.toUpperCase();return"TRUE"===n||"FALSE"!==n&&it}function Et(t,n){const e=t=>"number"==typeof t?0:"string"==typeof t?1:"boolean"==typeof t?2:3,r=null===t?"string"==typeof n?"":"boolean"!=typeof n&&0:t,o=null===n?"string"==typeof t?"":"boolean"!=typeof t&&0:n,s=e(r),c=e(o);if(s!==c)return s-c;if("number"==typeof r)return r-o;if("string"==typeof r){const t=r.toLowerCase(),n=o.toLowerCase();return t<n?-1:t>n?1:0}return"boolean"==typeof r?Number(r)-Number(o):0}function Nt(t,n,e){if(n instanceof ct)return n;if(e instanceof ct)return e;switch(t){case"&":return At(n)+At(e);case"=":return 0===Et(n,e);case"<>":return 0!==Et(n,e);case"<":return Et(n,e)<0;case">":return Et(n,e)>0;case"<=":return Et(n,e)<=0;case">=":return Et(n,e)>=0}const r=yt(n),o=yt(e);if(r instanceof ct)return r;if(o instanceof ct)return o;switch(t){case"+":return r+o;case"-":return r-o;case"*":return r*o;case"/":return 0===o?at:r/o;case"^":{const t=r**o;return Number.isFinite(t)?t:ft}}return it}function xt(t,n,e){return{rows:t,cols:n,at:e}}function Ct(t,n,e){if(!ut(t)&&!ut(n))return e(t,n);const r=Math.max(ut(t)?t.rows:1,ut(n)?n.rows:1),o=Math.max(ut(t)?t.cols:1,ut(n)?n.cols:1),s=(t,n,e)=>{if(!ut(t))return t;const r=1===t.rows?0:n,o=1===t.cols?0:e;return r<t.rows&&o<t.cols?t.at(r,o):ht};return xt(r,o,(r,o)=>e(s(t,r,o),s(n,r,o)))}function $t(t,n){if(ut(t))for(let e=0;e<t.rows;e++)for(let r=0;r<t.cols;r++)n(t.at(e,r),!0);else n(t,!1)}function St(t){const n=[];let e=null;for(const r of t)$t(r,(t,r)=>{if(e)return;if(t instanceof ct)return void(e=t);if("number"==typeof t)return void n.push(t);if(r||null===t)return;const o=yt(t);o instanceof ct?e=o:n.push(o)});return e??n}function Ot(t){return t.replace(/[.+^${}()|[\]\\]/g,"\\$&")}function Rt(t){let n="";for(let e=0;e<t.length;e++){const r=t[e];"~"===r&&e+1<t.length?n+=Ot(t[++e]):n+="*"===r?"[\\s\\S]*":"?"===r?"[\\s\\S]":Ot(r)}return new RegExp(`^${n}$`,"i")}var Tt=(t,n)=>{if(void 0===t)return n??it;const e=Mt(t);return null===e&&void 0!==n?n:yt(e)},Ut=t=>{if(void 0===t)return it;const n=Mt(t);return n instanceof ct?n:At(n)},Ft=t=>n=>{const e=Tt(n[0]);if(e instanceof ct)return e;const r=t(e);return Number.isFinite(r)?r:ft},kt=t=>n=>{const e=St(n);return e instanceof ct?e:t(e)};var Dt=t=>n=>{const e=Tt(n[0]),r=Tt(n[1],0);if(e instanceof ct)return e;if(r instanceof ct)return r;return(e<0?-1:1)*function(t,n,e){const r=10**n;return e(Number((t*r).toPrecision(15)))/r}(Math.abs(e),Math.trunc(r),t)};function Lt(t,n){const e=t.length;if(e<(n?2:1))return at;const r=t.reduce((t,n)=>t+n,0)/e;return t.reduce((t,n)=>t+(n-r)**2,0)/(n?e-1:e)}function It(t){return ut(t)?t:xt(1,1,()=>t)}function Pt(t,n){const e=n??t[0][0];for(const[n]of t)if(n.rows!==e.rows||n.cols!==e.cols)return it;const r=t.map(([,t])=>function(t){if("string"!=typeof t)return n=>null===t?null===n:null!==n&&0===Et(n,t);const n=/^(<=|>=|<>|=|<|>)?([\s\S]*)$/.exec(t),e=n[1]??"=",r=n[2],o=st(r);if(o){const t=o.value;return n=>{const r="number"==typeof n;switch(e){case"=":return r&&n===t;case"<>":return!(r&&n===t);case"<":return r&&n<t;case">":return r&&n>t;case"<=":return r&&n<=t;default:return r&&n>=t}}}if("="===e||"<>"===e){if(""===r)return t=>"="===e?null===t||""===t:null!==t&&""!==t;const t=Rt(r);return n=>{const r=null!==n&&!(n instanceof ct)&&t.test(At(n));return"="===e?r:!r}}return t=>{if("string"!=typeof t)return!1;const n=Et(t,r);return"<"===e?n<0:">"===e?n>0:"<="===e?n<=0:n>=0}}(t)),o=[];for(let n=0;n<e.rows;n++)for(let s=0;s<e.cols;s++)t.every(([t],e)=>r[e](t.at(n,s)))&&o.push(e.at(n,s));return o}function Vt(t){let n=0;for(const e of t){if(e instanceof ct)return e;"number"==typeof e&&(n+=e)}return n}function zt(t){let n=0,e=0;for(const r of t){if(r instanceof ct)return r;"number"==typeof r&&(n+=r,e++)}return e?n/e:at}function Gt(t,n){if((t.length-n)%2!=0||t.length-n<2)return it;const e=[];for(let r=n;r<t.length;r+=2){const n=Mt(t[r+1]);if(n instanceof ct)return n;e.push([It(t[r]),n])}return e}function Wt(t,n,e,r=!1){const o=Math.max(n.rows,n.cols),s=t=>n.rows>=n.cols?n.at(t,0):n.at(0,t);if(0===e){const n=r&&"string"==typeof t?Rt(t):null;for(let e=0;e<o;e++){const r=s(e);if(n?"string"==typeof r&&n.test(r):null!==r&&!(r instanceof ct)&&0===Et(r,t))return e}return-1}let c=-1;for(let n=0;n<o;n++){const r=s(n);if(null===r||r instanceof ct||typeof r!=typeof t)continue;const o=Et(r,t);(1===e?o<=0:o>=0)&&(-1===c||(1===e?Et(r,s(c))>0:Et(r,s(c))<0))&&(c=n)}return c}function jt(t,n){const e=Mt(t[0]);if(e instanceof ct)return e;if(void 0===t[1])return it;const r=It(t[1]),o=Tt(t[2]);if(o instanceof ct)return o;const s=void 0===t[3]||null===t[3]||vt(Mt(t[3]));if(s instanceof ct)return s;const c=Math.trunc(o)-1,u=n?r.cols:r.rows,l=n?r.rows:r.cols;if(c<0)return it;if(c>=l)return mt;const i=Wt(e,n?xt(1,u,(t,n)=>r.at(0,n)):xt(u,1,t=>r.at(t,0)),s?1:0,!s);return-1===i?ht:n?r.at(c,i):r.at(i,c)}function Ht(){const t=new Date;return L(t.getFullYear(),t.getMonth()+1,t.getDate())+(3600*t.getHours()+60*t.getMinutes()+t.getSeconds())/86400}var Zt=t=>n=>{const e=Tt(n[0]);return e instanceof ct?e:e<0?ft:t(I(e))};function _t(t,n){const e=I(t),r=12*e.year+(e.month-1)+n;return{year:Math.floor(r/12),month:(r%12+12)%12+1,day:e.day}}function Kt(t,n){return new Date(Date.UTC(t,n,0)).getUTCDate()}function Xt(t){const n=I(t).weekday;return 0===n||6===n}var Yt=(t,n)=>{const e=[];for(let r=0;r<n.length;r++){const o=Tt(t[r],n[r]);if(o instanceof ct)return o;e.push(o)}return e},Bt={SUM:kt(t=>t.reduce((t,n)=>t+n,0)),AVERAGE:kt(t=>t.length?t.reduce((t,n)=>t+n,0)/t.length:at),MIN:kt(t=>t.length?Math.min(...t):0),MAX:kt(t=>t.length?Math.max(...t):0),PRODUCT:kt(t=>t.length?t.reduce((t,n)=>t*n,1):0),MEDIAN:kt(t=>{if(!t.length)return ft;const n=[...t].sort((t,n)=>t-n),e=Math.floor(n.length/2);return n.length%2?n[e]:(n[e-1]+n[e])/2}),MODE:kt(t=>{const n=new Map;let e=null,r=1;for(const o of t){const t=(n.get(o)??0)+1;n.set(o,t),t>r&&(r=t,e=o)}return e??ht}),STDEV:kt(t=>{const n=Lt(t,!0);return n instanceof ct?n:Math.sqrt(n)}),STDEVP:kt(t=>{const n=Lt(t,!1);return n instanceof ct?n:Math.sqrt(n)}),VAR:kt(t=>Lt(t,!0)),VARP:kt(t=>Lt(t,!1)),COUNT:t=>{let n=0;for(const e of t)$t(e,(t,e)=>{"number"==typeof t?n++:e||"boolean"!=typeof t?!e&&"string"==typeof t&&st(t)&&n++:n++});return n},COUNTA:t=>{let n=0;for(const e of t)$t(e,t=>{null!==t&&n++});return n},COUNTBLANK:t=>{let n=0;for(const e of t)$t(e,t=>{null!==t&&""!==t||n++});return n},ABS:Ft(Math.abs),INT:Ft(Math.floor),TRUNC:Dt(Math.floor),ROUND:Dt(Math.round),ROUNDUP:Dt(Math.ceil),ROUNDDOWN:Dt(Math.floor),SIGN:Ft(Math.sign),SQRT:Ft(Math.sqrt),EXP:Ft(Math.exp),LN:Ft(Math.log),LOG10:Ft(Math.log10),SIN:Ft(Math.sin),COS:Ft(Math.cos),TAN:Ft(Math.tan),LOG:t=>{const n=Tt(t[0]),e=Tt(t[1],10);if(n instanceof ct)return n;if(e instanceof ct)return e;const r=Math.log(n)/Math.log(e);return Number.isFinite(r)?r:ft},MOD:t=>{const n=Tt(t[0]),e=Tt(t[1]);return n instanceof ct?n:e instanceof ct?e:0===e?at:n-e*Math.floor(n/e)},POWER:t=>Nt("^",Mt(t[0]??null),Mt(t[1]??null)),PI:()=>Math.PI,RAND:()=>Math.random(),RANDBETWEEN:t=>{const n=Tt(t[0]),e=Tt(t[1]);if(n instanceof ct)return n;if(e instanceof ct)return e;const r=Math.ceil(n),o=Math.floor(e);return r>o?ft:r+Math.floor(Math.random()*(o-r+1))},CEILING:t=>{const n=Tt(t[0]),e=Tt(t[1],1);return n instanceof ct?n:e instanceof ct?e:0===e?0:Math.ceil(Number((n/e).toPrecision(15)))*e},FLOOR:t=>{const n=Tt(t[0]),e=Tt(t[1],1);return n instanceof ct?n:e instanceof ct?e:0===e?at:Math.floor(Number((n/e).toPrecision(15)))*e},SUMIF:t=>{const n=Mt(t[1]??null);if(n instanceof ct)return n;const e=Pt([[It(t[0]),n]],void 0!==t[2]?It(t[2]):null);return e instanceof ct?e:Vt(e)},SUMIFS:t=>{const n=Gt(t,1);if(n instanceof ct)return n;const e=Pt(n,It(t[0]));return e instanceof ct?e:Vt(e)},AVERAGEIF:t=>{const n=Mt(t[1]??null);if(n instanceof ct)return n;const e=Pt([[It(t[0]),n]],void 0!==t[2]?It(t[2]):null);return e instanceof ct?e:zt(e)},AVERAGEIFS:t=>{const n=Gt(t,1);if(n instanceof ct)return n;const e=Pt(n,It(t[0]));return e instanceof ct?e:zt(e)},COUNTIF:t=>{const n=Mt(t[1]??null);if(n instanceof ct)return n;const e=Pt([[It(t[0]),n]],null);return e instanceof ct?e:e.length},COUNTIFS:t=>{const n=Gt(t,0);if(n instanceof ct)return n;const e=Pt(n,null);return e instanceof ct?e:e.length},SUMPRODUCT:t=>{if(!t.length)return it;const n=t.map(It),{rows:e,cols:r}=n[0];if(n.some(t=>t.rows!==e||t.cols!==r))return it;let o=0;for(let t=0;t<e;t++)for(let e=0;e<r;e++){let r=1;for(const o of n){const s=o.at(t,e);if(s instanceof ct)return s;r*="number"==typeof s?s:"boolean"==typeof s&&1===n.length?Number(s):0}o+=r}return o},LARGE:t=>{const n=St([t[0]??null]),e=Tt(t[1]);if(n instanceof ct)return n;if(e instanceof ct)return e;const r=[...n].sort((t,n)=>n-t);return e<1||e>r.length?ft:r[Math.trunc(e)-1]},SMALL:t=>{const n=St([t[0]??null]),e=Tt(t[1]);if(n instanceof ct)return n;if(e instanceof ct)return e;const r=[...n].sort((t,n)=>t-n);return e<1||e>r.length?ft:r[Math.trunc(e)-1]},RANK:t=>{const n=Tt(t[0]),e=St([t[1]??null]),r=Tt(t[2],0);return n instanceof ct?n:e instanceof ct?e:r instanceof ct?r:e.includes(n)?1+e.filter(t=>r?t<n:t>n).length:ht},AND:t=>{let n=!1,e=!0,r=null;for(const o of t)$t(o,(t,o)=>{if(r)return;if(o&&"string"==typeof t)return;if(null===t)return;const s=vt(t);s instanceof ct?r=s:(n=!0,s||(e=!1))});return r??(n?e:it)},OR:t=>{let n=!1,e=!1,r=null;for(const o of t)$t(o,(t,o)=>{if(r)return;if(o&&"string"==typeof t)return;if(null===t)return;const s=vt(t);s instanceof ct?r=s:(n=!0,s&&(e=!0))});return r??(n?e:it)},XOR:t=>{let n=!1,e=null;for(const r of t)$t(r,t=>{if(e||null===t)return;const r=vt(t);r instanceof ct?e=r:r&&(n=!n)});return e??n},NOT:t=>{const n=vt(Mt(t[0]??null));return n instanceof ct?n:!n},TRUE:()=>!0,FALSE:()=>!1,CONCAT:t=>{let n="",e=null;for(const r of t)$t(r,t=>{t instanceof ct?e??=t:n+=At(t)});return e??n},TEXTJOIN:t=>{const n=Ut(t[0]),e=vt(Mt(t[1]??null));if(n instanceof ct)return n;if(e instanceof ct)return e;const r=[];let o=null;for(const n of t.slice(2))$t(n,t=>{if(t instanceof ct)return void(o??=t);const n=At(t);e&&""===n||r.push(n)});return o??r.join(n)},LEFT:t=>{const n=Ut(t[0]),e=Tt(t[1],1);return n instanceof ct?n:e instanceof ct?e:e<0?it:n.slice(0,Math.trunc(e))},RIGHT:t=>{const n=Ut(t[0]),e=Tt(t[1],1);return n instanceof ct?n:e instanceof ct?e:e<0?it:0===Math.trunc(e)?"":n.slice(-Math.trunc(e))},MID:t=>{const n=Ut(t[0]),e=Tt(t[1]),r=Tt(t[2]);return n instanceof ct?n:e instanceof ct?e:r instanceof ct?r:e<1||r<0?it:n.slice(Math.trunc(e)-1,Math.trunc(e)-1+Math.trunc(r))},LEN:t=>{const n=Ut(t[0]);return n instanceof ct?n:n.length},LOWER:t=>{const n=Ut(t[0]);return n instanceof ct?n:n.toLowerCase()},UPPER:t=>{const n=Ut(t[0]);return n instanceof ct?n:n.toUpperCase()},PROPER:t=>{const n=Ut(t[0]);return n instanceof ct?n:n.toLowerCase().replace(/(^|[^\p{L}])(\p{L})/gu,(t,n,e)=>n+e.toUpperCase())},TRIM:t=>{const n=Ut(t[0]);return n instanceof ct?n:n.trim().replace(/ +/g," ")},REPT:t=>{const n=Ut(t[0]),e=Tt(t[1]);return n instanceof ct?n:e instanceof ct?e:e<0||n.length*e>32767?it:n.repeat(Math.trunc(e))},EXACT:t=>{const n=Ut(t[0]),e=Ut(t[1]);return n instanceof ct?n:e instanceof ct?e:n===e},SUBSTITUTE:t=>{const n=Ut(t[0]),e=Ut(t[1]),r=Ut(t[2]);if(n instanceof ct)return n;if(e instanceof ct)return e;if(r instanceof ct)return r;if(""===e)return n;if(void 0===t[3])return n.split(e).join(r);const o=Tt(t[3]);if(o instanceof ct)return o;let s=-1;for(let t=0;t<o;t++)if(s=n.indexOf(e,s+1),-1===s)return n;return n.slice(0,s)+r+n.slice(s+e.length)},REPLACE:t=>{const n=Ut(t[0]),e=Tt(t[1]),r=Tt(t[2]),o=Ut(t[3]);return n instanceof ct?n:e instanceof ct?e:r instanceof ct?r:o instanceof ct?o:e<1||r<0?it:n.slice(0,e-1)+o+n.slice(e-1+r)},FIND:t=>{const n=Ut(t[0]),e=Ut(t[1]),r=Tt(t[2],1);if(n instanceof ct)return n;if(e instanceof ct)return e;if(r instanceof ct)return r;const o=e.indexOf(n,r-1);return-1===o?it:o+1},SEARCH:t=>{const n=Ut(t[0]),e=Ut(t[1]),r=Tt(t[2],1);if(n instanceof ct)return n;if(e instanceof ct)return e;if(r instanceof ct)return r;const o=new RegExp(Rt(n).source.slice(1,-1),"i").exec(e.slice(r-1));return o?o.index+r:it},TEXT:t=>{const n=Mt(t[0]??null),e=Ut(t[1]);if(n instanceof ct)return n;if(e instanceof ct)return e;const r="string"==typeof n?st(n)?.value??null:null===n?0:"boolean"==typeof n?null:n;return null===r?Y(At(n),e):X(r,e).text},VALUE:t=>{const n=Mt(t[0]??null);return n instanceof ct||"number"==typeof n?n:st(At(n))?.value??it},VLOOKUP:t=>jt(t,!1),HLOOKUP:t=>jt(t,!0),XLOOKUP:t=>{const n=Mt(t[0]??null);if(n instanceof ct)return n;if(void 0===t[1]||void 0===t[2])return it;const e=It(t[1]),r=It(t[2]),o=Tt(t[4],0);if(o instanceof ct)return o;const s=Wt(n,e,1===o?-1:-1===o?1:0,2===o);return-1===s?void 0!==t[3]&&null!==Mt(t[3])?Mt(t[3]):ht:e.rows>=e.cols?r.at(s,0):r.at(0,s)},MATCH:t=>{const n=Mt(t[0]??null);if(n instanceof ct)return n;if(void 0===t[1])return it;const e=It(t[1]),r=Tt(t[2],1);if(r instanceof ct)return r;if(e.rows>1&&e.cols>1)return ht;const o=Wt(n,e,0===r?0:r<0?-1:1,0===r);return-1===o?ht:o+1},INDEX:t=>{if(void 0===t[0])return it;const n=It(t[0]),e=Tt(t[1],0),r=Tt(t[2],1===n.rows&&void 0===t[2]?0:1);if(e instanceof ct)return e;if(r instanceof ct)return r;const[o,s]=1===n.rows&&void 0===t[2]?[1,e]:[e,r];return o<0||s<0||o>n.rows||s>n.cols?mt:0===o?xt(n.rows,1,t=>n.at(t,Math.max(s,1)-1)):0===s?xt(1,n.cols,(t,e)=>n.at(o-1,e)):n.at(Math.trunc(o)-1,Math.trunc(s)-1)},ROWS:t=>void 0===t[0]?it:It(t[0]).rows,COLUMNS:t=>void 0===t[0]?it:It(t[0]).cols,TODAY:()=>Math.floor(Ht()),NOW:()=>Ht(),DATE:t=>{const n=Tt(t[0]),e=Tt(t[1]),r=Tt(t[2]);if(n instanceof ct)return n;if(e instanceof ct)return e;if(r instanceof ct)return r;const o=n<1900?n+1900:n;return L(o,1,1)+Math.round((Date.UTC(o,e-1,r)-Date.UTC(o,0,1))/864e5)},TIME:t=>{const n=Tt(t[0]),e=Tt(t[1]),r=Tt(t[2]);return n instanceof ct?n:e instanceof ct?e:r instanceof ct?r:(3600*n+60*e+r)/86400%1},YEAR:Zt(t=>t.year),MONTH:Zt(t=>t.month),DAY:Zt(t=>t.day),HOUR:Zt(t=>t.hours),MINUTE:Zt(t=>t.minutes),SECOND:Zt(t=>t.seconds),WEEKDAY:t=>{const n=Tt(t[0]),e=Tt(t[1],1);if(n instanceof ct)return n;if(e instanceof ct)return e;const r=I(n).weekday;return 1===e?r+1:2===e?(r+6)%7+1:3===e?(r+6)%7:ft},EDATE:t=>{const n=Tt(t[0]),e=Tt(t[1]);if(n instanceof ct)return n;if(e instanceof ct)return e;const{year:r,month:o,day:s}=_t(n,Math.trunc(e));return L(r,o,Math.min(s,Kt(r,o)))},EOMONTH:t=>{const n=Tt(t[0]),e=Tt(t[1]);if(n instanceof ct)return n;if(e instanceof ct)return e;const{year:r,month:o}=_t(n,Math.trunc(e));return L(r,o,Kt(r,o))},DAYS:t=>{const n=Tt(t[0]),e=Tt(t[1]);return n instanceof ct?n:e instanceof ct?e:Math.trunc(n)-Math.trunc(e)},DATEDIF:t=>{const n=Tt(t[0]),e=Tt(t[1]),r=Ut(t[2]);if(n instanceof ct)return n;if(e instanceof ct)return e;if(r instanceof ct)return r;if(n>e)return ft;const o=I(n),s=I(e),c=12*(s.year-o.year)+(s.month-o.month)-(s.day<o.day?1:0);switch(r.toUpperCase()){case"D":return Math.trunc(e)-Math.trunc(n);case"M":return c;case"Y":return Math.floor(c/12);default:return ft}},NETWORKDAYS:t=>{const n=Tt(t[0]),e=Tt(t[1]);if(n instanceof ct)return n;if(e instanceof ct)return e;const r=new Set;void 0!==t[2]&&$t(t[2],t=>{"number"==typeof t&&r.add(Math.trunc(t))});const o=Math.trunc(Math.min(n,e)),s=Math.trunc(Math.max(n,e));if(s-o>366e3)return ft;let c=0;for(let t=o;t<=s;t++)Xt(t)||r.has(t)||c++;return n<=e?c:-c},ISBLANK:t=>null===Mt(t[0]??null),ISNUMBER:t=>"number"==typeof Mt(t[0]??null),ISTEXT:t=>"string"==typeof Mt(t[0]??null),ISLOGICAL:t=>"boolean"==typeof Mt(t[0]??null),ISERROR:t=>Mt(t[0]??null)instanceof ct,ISNA:t=>{const n=Mt(t[0]??null);return n instanceof ct&&"#N/A"===n.code},N:t=>{const n=Mt(t[0]??null);return n instanceof ct||"number"==typeof n?n:"boolean"==typeof n?Number(n):0},NA:()=>ht,PMT:t=>{const n=Yt(t,[void 0,void 0,void 0,0,0]);return n instanceof ct?n:0===n[1]?ft:function(t,n,e,r,o){if(0===t)return-(e+r)/n;const s=(1+t)**n;return-t*(e*s+r)/((s-1)*(1+t*o))}(n[0],n[1],n[2],n[3],n[4])},FV:t=>{const n=Yt(t,[void 0,void 0,void 0,0,0]);if(n instanceof ct)return n;const[e,r,o,s,c]=n;if(0===e)return-(s+o*r);const u=(1+e)**r;return-(s*u+o*(1+e*c)*(u-1)/e)},PV:t=>{const n=Yt(t,[void 0,void 0,void 0,0,0]);if(n instanceof ct)return n;const[e,r,o,s,c]=n;if(0===e)return-(s+o*r);const u=(1+e)**r;return-(s+o*(1+e*c)*(u-1)/e)/u},NPV:t=>{const n=Tt(t[0]),e=St(t.slice(1));return n instanceof ct?n:e instanceof ct?e:e.reduce((t,e,r)=>t+e/(1+n)**(r+1),0)}};Bt.CONCATENATE=Bt.CONCAT,Bt["STDEV.S"]=Bt.STDEV,Bt["STDEV.P"]=Bt.STDEVP,Bt["VAR.S"]=Bt.VAR,Bt["VAR.P"]=Bt.VARP,Bt["CEILING.MATH"]=Bt.CEILING,Bt["FLOOR.MATH"]=Bt.FLOOR,Bt["MODE.SNGL"]=Bt.MODE,Bt["RANK.EQ"]=Bt.RANK;var Jt={IF:(t,n)=>{if(t.length<2)return it;const e=vt(Mt(n(t[0])));return e instanceof ct?e:e?n(t[1]):t.length>2&&n(t[2])},IFS:(t,n)=>{if(t.length<2||t.length%2)return it;for(let e=0;e<t.length;e+=2){const r=vt(Mt(n(t[e])));if(r instanceof ct)return r;if(r)return n(t[e+1])}return ht},IFERROR:(t,n)=>{if(t.length<1)return it;const e=Mt(n(t[0]));return e instanceof ct?t[1]?n(t[1]):"":e},IFNA:(t,n)=>{if(t.length<1)return it;const e=Mt(n(t[0]));return e instanceof ct&&"#N/A"===e.code?t[1]?n(t[1]):"":e},SWITCH:(t,n)=>{if(t.length<3)return it;const e=Mt(n(t[0]));if(e instanceof ct)return e;let r=1;for(;r+1<t.length;r+=2){const o=Mt(n(t[r]));if(o instanceof ct)return o;if(0===Et(e,o))return n(t[r+1])}return r<t.length?n(t[r]):ht},CHOOSE:(t,n)=>{if(t.length<2)return it;const e=yt(Mt(n(t[0])));if(e instanceof ct)return e;const r=Math.trunc(e);return r<1||r>=t.length?it:n(t[r])},ROW:(t,n,e)=>t.length?"ref"===t[0].kind&&null!==t[0].ref.a.row?t[0].ref.a.row+1:it:e.row+1,COLUMN:(t,n,e)=>t.length?"ref"===t[0].kind&&null!==t[0].ref.a.col?t[0].ref.a.col+1:it:e.col+1},qt=[...new Set([...Object.keys(Bt),...Object.keys(Jt)])].filter(t=>"TRUE"!==t&&"FALSE"!==t).sort();function Qt(t){const n=t.map(()=>new Map),e=t.map(()=>new Set),r=new Map(t.map((t,n)=>[t.name.toLowerCase(),n]));let o=0;const s=(r,s,c)=>{const l=t[r]?.cells[s]?.[c];if(void 0===l||""===l)return null;if(!C(l))return bt(l);const i=((t,n)=>2e4*t+n)(s,c),f=n[r].get(i);if(void 0!==f)return f;if(e[r].has(i))return pt;let h;e[r].add(i),o++;try{const t=u(function(t){const n=x.get(t);if(n){if(n instanceof a)throw n;return n}let e;try{const{tokens:n,complete:r}=v(t.slice(1));if(!r)throw new a("Unreadable text");e=new N(n).run()}catch(t){if(!(t instanceof a))throw t;e=t}if(x.size>=2e4&&x.clear(),x.set(t,e),e instanceof a)throw e;return e}(l),{sheet:r,row:s,col:c});h=Mt(t),null===h&&(h=0)}catch(t){if(!(t instanceof a)){if(!(t instanceof RangeError)||o>1)throw t;return pt}h=gt}finally{o--,e[r].delete(i)}return n[r].set(i,h),h},c=(n,e)=>{let o=e.sheet;if(null!==n.sheet){const t=r.get(n.sheet.toLowerCase());if(void 0===t)return mt;o=t}const c=n.b??n.a;if(null===n.b)return s(o,n.a.row,n.a.col);const u=Math.min(n.a.row??0,c.row??0),l=Math.min(n.a.col??0,c.col??0),i=null===n.a.row?(n=>t[n].cells.length)(o)-1:Math.max(n.a.row,c.row),a=null===n.a.col?(n=>t[n].cells.reduce((t,n)=>Math.max(t,n.length),0))(o)-1:Math.max(n.a.col,c.col);return xt(Math.max(0,i-u+1),Math.max(0,a-l+1),(t,n)=>s(o,u+t,l+n))},u=(t,n)=>{switch(t.kind){case"num":case"str":case"bool":return t.value;case"err":return lt(t.value);case"empty":return null;case"ref":return c(t.ref,n);case"unary":return Ct(u(t.arg,n),null,n=>{const e=n instanceof ct?n:yt(n);return e instanceof ct?e:"-"===t.op?-e:e});case"percent":return Ct(u(t.arg,n),100,(t,n)=>Nt("/",t,n));case"binary":return Ct(u(t.left,n),u(t.right,n),(n,e)=>Nt(t.op,n,e));case"call":{const e=Jt[t.name];if(e)return e(t.args,t=>u(t,n),n);const r=Bt[t.name];return r?r(t.args.map(t=>u(t,n)),n):dt}}};let l=!1;return{value:(n,e,r)=>t[n]?(l||(l=!0,t.forEach((t,n)=>{t.cells.forEach((t,e)=>t.forEach((t,r)=>{C(t)&&s(n,e,r)}));for(let e=t.cells.length-1;e>=0;e--){const r=t.cells[e];for(let t=r.length-1;t>=0;t--)C(r[t])&&s(n,e,t)}})),s(n,e,r)):null}}var tn=100,nn=24,en=10;function rn(t,n=[]){return{id:crypto.randomUUID(),name:t,rowCount:Math.max(1e3,n.length+100),colCount:Math.max(26,n.reduce((t,n)=>Math.max(t,n.length),0)),cells:n,formats:{},colWidths:{},rowHeights:{},hiddenRows:[],hiddenCols:[],merges:[],frozenRows:0,frozenCols:0,filter:null}}var on=(t,n)=>`${t}:${n}`,sn=(t,n,e)=>t.cells[n]?.[e]??"";function cn(t,n){const e=new Set(t.map(t=>t.name.toLowerCase()));for(let r=t.length+1;;r++){const t=`${n} ${r}`;if(!e.has(t.toLowerCase()))return t}}function un(t){return Qt(t)}function ln(t){let n=0,e=!1;for(const r of t)'"'===r?e=!e:e||"("!==r?e||")"!==r||n--:n++;return!e&&n>0?t+")".repeat(n):t}function an(t,n){if(C(t))return{raw:ln(t),numFmt:null};if(""===t||"'"===t[0])return{raw:t,numFmt:null};if("@"===n?.numFmt)return{raw:`'${t}`,numFmt:null};const e=st(t);return e?{raw:String(e.value),numFmt:e.format}:{raw:t,numFmt:null}}function fn(t,n){if(C(t)||""===t)return t;const e=bt(t);if("number"!=typeof e||!n?.numFmt)return t;if(G(n.numFmt)){const t=I(e),n=`${t.year}-${U(t.month)}-${U(t.day)}`;return Number.isInteger(e)?n:`${n} ${U(t.hours)}:${U(t.minutes)}:${U(t.seconds)}`}return/%/.test(n.numFmt)?`${_(100*e)}%`:t}var hn={text:"",color:null,align:"left",error:!1};function mn(t,n,e,r,o){const s=sn(t,r,o);return""===s?hn:function(t,n,e){if(null===t)return hn;if(t instanceof ct)return{text:t.code,color:null,align:"center",error:!0};if("boolean"==typeof t)return{text:t?"TRUE":"FALSE",color:null,align:"center",error:!1};const r=e?.numFmt;if("number"==typeof t){if(!(r&&"General"!==r||C(n)))return{text:n,color:null,align:"right",error:!1};const{text:e,color:o}=X(t,r??"General");return{text:e,color:o,align:"right",error:!1}}return{text:r?Y(t,r):t,color:null,align:"left",error:!1}}(e.value(n,r,o),s,t.formats[on(r,o)])}function dn(t){let n=-1,e=-1;return t.cells.forEach((t,r)=>{for(let o=t.length-1;o>=0;o--)if(""!==t[o]){n=Math.max(n,r),e=Math.max(e,o);break}}),n<0?null:{row:n,col:e}}function pn(t,n){if(!n.length)return t;const e=[...t.cells],r=new Set;let o=t.rowCount,s=t.colCount;for(const{row:t,col:c,raw:u}of n)if(""!==u||""!==(e[t]?.[c]??"")){for(;e.length<=t;)e.push([]);for(r.has(t)||(e[t]=[...e[t]],r.add(t));e[t].length<=c;)e[t].push("");e[t][c]=u,o=Math.max(o,t+1),s=Math.max(s,c+1)}return{...t,cells:e,rowCount:o,colCount:s}}function gn(t,n,e,r){const o=on(n,e),s=t.formats[o],{raw:c,numFmt:u}=an(r,s),l=pn(t,[{row:n,col:e,raw:c}]);return!u||s?.numFmt&&"General"!==s.numFmt?l:{...l,formats:{...l.formats,[o]:{...s,numFmt:u}}}}function wn(t,n){for(let e=t.r1;e<=t.r2;e++)for(let r=t.c1;r<=t.c2;r++)n(e,r)}function bn(t,n){const e=[];return wn(function(t,n){const e=Math.min(n.r2,t.cells.length-1);return{...n,r2:Math.max(e,n.r1-1)}}(t,n),(n,r)=>{""!==sn(t,n,r)&&e.push({row:n,col:r,raw:""})}),pn(t,e)}function Mn(t,n,e){const r={...t.formats},o=(t,n)=>{const o=on(t,n),s=e(r[o]??{});Object.keys(s).length?r[o]=s:delete r[o]};return wn((n.r2-n.r1+1)*(n.c2-n.c1+1)>2e5?{...n,r2:Math.min(n.r2,Math.max(t.cells.length,2e3))}:n,o),{...t,formats:r}}function yn(t,n,e){const r={...t};return void 0===e||!1===e?delete r[n]:r[n]=e,r}function An(t,n,e){const r={...t.formats};return wn(n,(t,o)=>{const s=on(t,o),c=r[s]??{},u=((t,e)=>({...t===n.r1?{top:!0}:{},...t===n.r2?{bottom:!0}:{},...e===n.c1?{left:!0}:{},...e===n.c2?{right:!0}:{}}))(t,o);let l;switch(e){case"none":l={};break;case"all":l={top:!0,right:!0,bottom:!0,left:!0};break;case"outer":l={...c.border,...u};break;default:l=u[e]?{...c.border,[e]:!0}:c.border??{}}const i=yn(c,"border",Object.keys(l).length?l:void 0);Object.keys(i).length?r[s]=i:delete r[s]}),{...t,formats:r}}function vn(t,n,e){return t.merges.find(t=>u(t,n,e))??null}function En(t,n){let e=n;for(let n=!0;n;){n=!1;for(const r of t.merges){if(!l(e,r))continue;const t={r1:Math.min(e.r1,r.r1),c1:Math.min(e.c1,r.c1),r2:Math.max(e.r2,r.r2),c2:Math.max(e.c2,r.c2)};t.r1===e.r1&&t.c1===e.c1&&t.r2===e.r2&&t.c2===e.c2||(e=t,n=!0)}}return e}function Nn(t,n){if(n.r1===n.r2&&n.c1===n.c2)return t;const e=[];wn(n,(r,o)=>{r===n.r1&&o===n.c1||""===sn(t,r,o)||e.push({row:r,col:o,raw:""})});const r=pn(t,e);return{...r,merges:[...r.merges.filter(t=>!l(t,n)),n]}}function xn(t,n){return{...t,merges:t.merges.filter(t=>!l(t,n))}}function Cn(t,n,e){const r=t[n].name.toLowerCase();return t.map((t,o)=>{let s=!1;const c=t.cells.map(t=>{let c=!1;const u=t.map(t=>{if(!C(t))return t;const s=O(t,t=>(null===t.sheet?o===n:t.sheet.toLowerCase()===r)?e(t):t);return s!==t&&(c=!0),s});return c&&(s=!0),c?u:t});return s?{...t,cells:c}:t})}function $n(t,n,e){if(e>0)return t>=n?t+e:t;const r=n-e;return t>=n&&t<r?null:t>=r?t+e:t}function Sn(t,n,e){const r={};for(const[o,s]of Object.entries(t)){const t=$n(Number(o),n,e);null!==t&&(r[t]=s)}return r}function On(t,n,e,r){const[o,s]="row"===n?[t.r1,t.r2]:[t.c1,t.c2];let c,u;if(r>0)c=o>=e?o+r:o,u=s>=e?s+r:s;else{const t=e-r;if(c=o<e?o:o>=t?o+r:e,u=s<e?s:s>=t?s+r:e-1,c>u)return null}return"row"===n?{...t,r1:c,r2:u}:{...t,c1:c,c2:u}}function Rn(t,n,e,r,o){const s=Cn(t,n,t=>function(t,n,e,r){const o=t=>"row"===n?t.row:t.col,s=(t,e)=>"row"===n?{...t,row:e}:{...t,col:e},c=o(t.a);if(null===c)return t;if(r>0){const n=t=>t>=e?t+r:t;return{...t,a:s(t.a,n(c)),b:t.b?s(t.b,n(o(t.b))):null}}const u=-r,l=e+u;if(!t.b)return c>=e&&c<l?null:{...t,a:s(t.a,c>=l?c-u:c)};const i=Math.min(c,o(t.b)),a=Math.max(c,o(t.b)),f=i<e?i:i>=l?i-u:e,h=a<e?a:a>=l?a-u:e-1;return f>h?null:{...t,a:s(t.a,f),b:s(t.b,h)}}(t,e,r,o));return s.map((t,s)=>{if(s!==n)return t;const c="row"===e?(()=>{const n=[...t.cells];return o>0?n.length>r&&n.splice(r,0,...Array.from({length:o},()=>[])):n.splice(r,-o),n})():t.cells.map(t=>{if(t.length<=r)return t;const n=[...t];return o>0?n.splice(r,0,...Array(o).fill("")):n.splice(r,-o),n}),u={};for(const[n,s]of Object.entries(t.formats)){const[t,c]=n.split(":").map(Number),l=$n("row"===e?t:c,r,o);null!==l&&(u["row"===e?on(l,c):on(t,l)]=s)}const l=t.merges.map(t=>On(t,e,r,o)).filter(t=>null!==t&&(t.r1!==t.r2||t.c1!==t.c2)),i=t=>t.map(t=>$n(t,r,o)).filter(t=>null!==t),a=t.filter?On(t.filter.range,e,r,o):null,f=t.filter&&a?{range:a,excluded:"col"===e?Sn(t.filter.excluded,r,o):t.filter.excluded}:null,h=t=>r<t?o>0?t+o:Math.max(r,t+o):t;return{...t,cells:c,formats:u,merges:l,filter:f,rowCount:"row"===e?Math.max(1,t.rowCount+o):t.rowCount,colCount:"col"===e?Math.max(1,t.colCount+o):t.colCount,rowHeights:"row"===e?Sn(t.rowHeights,r,o):t.rowHeights,colWidths:"col"===e?Sn(t.colWidths,r,o):t.colWidths,hiddenRows:"row"===e?i(t.hiddenRows):t.hiddenRows,hiddenCols:"col"===e?i(t.hiddenCols):t.hiddenCols,frozenRows:"row"===e?h(t.frozenRows):t.frozenRows,frozenCols:"col"===e?h(t.frozenCols):t.frozenCols}})}function Tn(t,n,e){return Cn(t,n,t=>null===t.sheet?t:{...t,sheet:e}).map((t,r)=>r===n?{...t,name:e}:t)}function Un(t,n){return Cn(t,n,t=>null===t.sheet?t:null).filter((t,e)=>e!==n)}function Fn(t,n,e){const r={...t[n],id:crypto.randomUUID(),name:e};return[...t.slice(0,n+1),r,...t.slice(n+1)]}function kn(t,n,e,r,o,s){const c=[];for(let t=r.r1;t<=r.r2;t++)c.push(t);const u=new Map(c.map(t=>[t,e.value(n,t,o)])),l=[...c].sort((t,n)=>{const e=u.get(t),r=u.get(n),o=null===e||""===e,c=null===r||""===r;if(o||c)return o===c?t-n:o?1:-1;if(e instanceof ct||r instanceof ct)return e instanceof ct?1:-1;const l=Et(e,r);return(s?l:-l)||t-n}),i=[],a={...t.formats},f=new Map;return wn(r,(n,e)=>f.set(on(n,e),t.formats[on(n,e)])),l.forEach((n,e)=>{const o=r.r1+e;for(let e=r.c1;e<=r.c2;e++){const r=sn(t,n,e);i.push({row:o,col:e,raw:C(r)?R(r,o-n,0):r});const s=f.get(on(n,e));s?a[on(o,e)]=s:delete a[on(o,e)]}}),{...pn(t,i),formats:a}}function Dn(t,n,e){const r=new Set,{filter:o}=t;if(!o)return r;for(const[s,c]of Object.entries(o.excluded)){if(!c.length)continue;const u=Number(s),l=new Set(c);for(let s=o.range.r1+1;s<=o.range.r2;s++)l.has(mn(t,n,e,s,u).text)&&r.add(s)}return r}function Ln(t,n){if(n.r1!==n.r2||n.c1!==n.c2)return n;const e=(n,e,r)=>{for(let o=e;o<=r;o++)if(""!==sn(t,n,o))return!1;return!0},r=(n,e,r)=>{for(let o=e;o<=r;o++)if(""!==sn(t,o,n))return!1;return!0};let{r1:o,r2:s,c1:c,c2:u}=n;for(let n=!0;n;)n=!1,o>0&&!e(o-1,c,u)&&(o--,n=!0),s<t.rowCount-1&&!e(s+1,c,u)&&(s++,n=!0),c>0&&!r(c-1,o,s)&&(c--,n=!0),u<t.colCount-1&&!r(u+1,o,s)&&(u++,n=!0);return{r1:o,c1:c,r2:s,c2:u}}var In=/^(.*?)(\d+)$/;function Pn(t,n){const e=t.length,r=t.map(t=>{if(C(t))return null;const n=bt(t);return"number"==typeof n?n:null});if(e>=2&&r.every(t=>null!==t)){const t=(r[e-1]-r[0])/(e-1);if(r.every((n,e)=>Math.abs(n-(r[0]+t*e))<1e-9))return String(Number((r[0]+t*n).toPrecision(15)))}const o=(n%e+e)%e,s=t[o];if("number"==typeof r[o]||C(s)||""===s||"'"===s[0])return s;const c=In.exec(s);if(c&&c[1]&&1===e){const t=Number(c[2])+n;if(t>=0)return c[1]+String(t).padStart(c[2].length,"0")}return s}function Vn(t,n,e){const r=[],o={...t.formats},s=n.r2-n.r1+1,c=n.c2-n.c1+1,l=e.r1<n.r1||e.r2>n.r2;return wn(e,(e,i)=>{if(u(n,e,i))return;let a,f,h;if(l){const r=Array.from({length:s},(e,r)=>sn(t,n.r1+r,i)),o=e-n.r1;a=n.r1+(o%s+s)%s,f=i;const c=sn(t,a,f);h=C(c)?R(c,e-a,0):Pn(r,o)}else{const r=Array.from({length:c},(r,o)=>sn(t,e,n.c1+o)),o=i-n.c1;a=e,f=n.c1+(o%c+c)%c;const s=sn(t,a,f);h=C(s)?R(s,0,i-f):Pn(r,o)}r.push({row:e,col:i,raw:h});const m=t.formats[on(a,f)];m?o[on(e,i)]=m:delete o[on(e,i)]}),{...pn(t,r),formats:o}}function zn(t,n,e,r,o){const s=[];for(let o=r.r1;o<=r.r2;o++){const c=[];for(let s=r.c1;s<=r.c2;s++){const r=sn(t,o,s);c.push({raw:r,display:mn(t,n,e,o,s).text,value:""===r?null:e.value(n,o,s),format:t.formats[on(o,s)]})}s.push(c)}return{sheetId:t.id,range:r,cut:o,cells:s,text:s.map(t=>t.map(t=>{return n=t.display,/["\t\n]/.test(n)?`"${n.replace(/"/g,'""')}"`:n;var n}).join("\t")).join("\n")}}function Gn(t,n,e,r){const o=n.cells.length,s=n.cells[0]?.length??0,c=e.r2-e.r1+1,u=e.c2-e.c1+1,l=c%o===0&&u%s===0,i=l?c:o,a=l?u:s,f=[],h={...t.formats};for(let t=0;t<i;t++)for(let c=0;c<a;c++){const u=n.cells[t%o][c%s],l=e.r1+t,i=e.c1+c;if("formats"!==r){let e=u.raw;"values"===r?(e=u.value instanceof ct?u.value.code:null===u.value?"":At(u.value),"number"==typeof u.value&&(e=String(u.value))):C(e)&&!n.cut&&(e=R(e,l-(n.range.r1+t%o),i-(n.range.c1+c%s))),f.push({row:l,col:i,raw:e})}"values"!==r&&(u.format?h[on(l,i)]=u.format:delete h[on(l,i)])}return{sheet:{...pn(t,f),formats:h},range:{r1:e.r1,c1:e.c1,r2:e.r1+i-1,c2:e.c1+a-1}}}function Wn(t,n,e,r,o){const{range:s}=e,c=o.r1-s.r1,l=o.c1-s.c1,i=t[r].name,a=n!==r,f=Cn(t,n,t=>{const n=t.a.row,e=t.a.col,r=t.b?t.b.row:t.a.row,o=t.b?t.b.col:t.a.col;if(null===n||null===e||null===r||null===o)return t;if(!u(s,n,e)||!u(s,r,o))return t;const f=t=>({...t,row:t.row+c,col:t.col+l});return{...t,sheet:a?i:t.sheet,a:f(t.a),b:t.b?f(t.b):null}}),h=f.map((t,e)=>{if(e!==n)return t;const r={...t.formats};return wn(s,(t,n)=>{delete r[on(t,n)]}),{...bn(t,s),formats:r}}),m={...e,cells:e.cells.map((t,e)=>t.map((t,r)=>({...t,raw:sn(f[n],s.r1+e,s.c1+r)})))},d={r1:o.r1,c1:o.c1,r2:o.r1+e.cells.length-1,c2:o.c1+(e.cells[0]?.length??1)-1},p=Gn(h[r],m,d,"all");return{sheets:h.map((t,n)=>n===r?p.sheet:t),range:p.range}}function jn(t,n){const e=n.matchCase?t:t.toLowerCase();return t=>{const r=n.matchCase?t:t.toLowerCase();return n.wholeCell?r===e:r.includes(e)}}function Hn(t,n,e,r,o){if(!r)return[];const s=jn(r,o),c=[];return t.cells.forEach((r,u)=>r.forEach((r,l)=>{if(""===r)return;const i=o.inFormulas?r:mn(t,n,e,u,l).text;s(i)&&c.push({row:u,col:l})})),c}function Zn(t,n,e,r){if(C(t)&&!r.inFormulas)return t;if(r.wholeCell)return jn(n,r)(t)?e:t;const o=r.matchCase?"g":"gi";return t.replace(new RegExp(n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o),()=>e)}function _n(t,n,e,r,o){let s,c=0,u=0,l=0,i=1/0,a=-1/0;const f=Math.min(r.r2,t.cells.length-1);for(let h=r.r1;h<=f;h++){if(o.has(h))continue;const f=t.cells[h];if(!f)continue;const m=Math.min(r.c2,f.length-1);for(let o=r.c1;o<=m;o++){if(""===f[o])continue;u++;const r=e.value(n,h,o);"number"==typeof r&&(l++,c+=r,r<i&&(i=r),r>a&&(a=r),s??=t.formats[on(h,o)]?.numFmt)}}return{sum:c,average:l?c/l:null,count:u,numbers:l,min:i,max:a,firstFormat:s}}function Kn(t){const n=t.replace(/^/,""),e=n.slice(0,n.search(/\r?\n|$/)),r=e.includes("\t")&&!e.includes(",")||e.includes("\t")?"\t":",",o=[];let s=[],c="",u=!1,l=0;for(;l<n.length;){const t=n[l];if(u){if('"'===t){if('"'===n[l+1]){c+='"',l+=2;continue}u=!1,l++;continue}c+=t,l++}else'"'!==t||""!==c?t!==r?("\r"===t&&"\n"===n[l+1]&&l++,"\n"!==t&&"\r"!==t?(c+=t,l++):(s.push(c),o.push(s),s=[],c="",l++)):(s.push(c),c="",l++):(u=!0,l++)}return(""!==c||s.length)&&(s.push(c),o.push(s)),o.filter(t=>t.some(t=>""!==t))}function Xn(t){return/[",\r\n]/.test(t)?`"${t.replace(/"/g,'""')}"`:t}function Yn(t,n,e){const r=dn(t);if(!r)return"";const o=[];for(let s=0;s<=r.row;s++){const c=[];for(let o=0;o<=r.col;o++){const r=sn(t,s,o),u=mn(t,n,e,s,o).text;c.push(Xn("'"===r[0]&&/^[=+\-@]/.test(u)?r:u))}o.push(c.join(","))}return o.join("\n")}function Bn(t,n){const e=rn(t),r={},o=n.map((t,n)=>t.map((t,e)=>{const{raw:o,numFmt:s}=an(t);return s&&(r[on(n,e)]={numFmt:s}),o}));return{...e,cells:o,formats:r,rowCount:Math.max(e.rowCount,o.length+100),colCount:Math.max(e.colCount,o.reduce((t,n)=>Math.max(t,n.length),0))}}function Jn(t,n,e,r,o){const s=new Set;for(let c=r.r1+1;c<=r.r2;c++)s.add(mn(t,n,e,c,o).text);return[...s].sort((t,n)=>t.localeCompare(n,void 0,{numeric:!0}))}export{t as MAX_ROWS,n as MAX_COLS,e as colLabel,r as colIndex,o as cellLabel,s as normalizeRange,c as rangeLabel,u as rangeContains,i as parseRangeLabel,v as tokenize,C as isFormula,S as printRef,R as shiftFormula,T as cycleRefAbsolute,F as NUMBER_FORMATS,X as formatNumber,B as adjustDecimals,ct as FormulaError,qt as FUNCTION_NAMES,tn as DEFAULT_COL_WIDTH,nn as DEFAULT_ROW_HEIGHT,en as DEFAULT_FONT_SIZE,rn as newSheet,on as formatKey,sn as rawAt,cn as nextSheetName,un as makeEvaluator,an as readEntry,fn as editText,mn as cellDisplay,dn as usedBounds,pn as writeCells,gn as commitEntry,bn as clearValues,Mn as updateFormats,yn as withFormat,An as applyBorders,vn as mergedAt,En as expandForMerges,Nn as mergeRange,xn as unmergeRange,Rn as changeStructure,Tn as renameSheet,Un as deleteSheet,Fn as duplicateSheet,kn as sortRange,Dn as filteredRows,Ln as dataRegion,Vn as fillRange,zn as copyClip,Gn as pasteClip,Wn as moveCells,Hn as findCells,Zn as replaceInCell,_n as selectionStats,Kn as parseCsv,Yn as serializeCsv,Bn as sheetFromRows,Jn as columnValues};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ENGLISH_FILE_WORDS as e,ZH_HANS_FILE_WORDS as t}from"./chunk-B32ASXHM.js";var i={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:i})=>{const d=[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`,i.length&&`${i.join(", ")} ${1===i.length?"is":"are"} shown in the deck's font`].filter(Boolean);return d.length?`Some things didn't come across: ${d.join("; ")}.`:null},dismiss:"Dismiss"},d={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:i})=>{const d=[e&&`${e} 个图表、视频或自定义形状未能导入`,t&&`${t} 张幻灯片的动画已移除`,i.length&&`${i.join("、")} 以演示文稿字体显示`].filter(Boolean);return d.length?`部分内容未能导入:${d.join(";")}。`:null},dismiss:"关闭"};export{i as ENGLISH_WORDS,d as ZH_HANS_WORDS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function n(n,e){const t=n.lastIndexOf(".");return t>0&&e.includes(n.slice(t+1).toLowerCase())}function e(n){const e=n.lastIndexOf(".");return(e>0?n.slice(0,e):n).trim()||n}async function t(n,e){return!!n?.place&&n.place(e).then(()=>!0,()=>!1)}export{n as hasExtension,e as titleOf,t as placeCopy};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{drawJpeg as t,embeddedFonts as o,jpegPdf as r,openStage as n,settled as e}from"./chunk-JKYJGXJE.js";import{SLIDE_FONT as i,SlideView as c}from"./chunk-2AKHYM66.js";import"./chunk-2TZUCKZ7.js";import{ENGLISH_WORDS as s}from"./chunk-X6F3Z4KZ.js";import"./chunk-B32ASXHM.js";import{flushSync as a}from"react-dom";import{createRoot as m}from"react-dom/client";import{jsx as l}from"react/jsx-runtime";async function d(o,r,n,i){const s=document.createElement("div");r.root.append(s);const d=m(s);try{a(()=>d.render(l(c,{slide:o,width:1600})));const r=s.firstElementChild;await e(r);return{jpeg:await t(r,{width:1600,height:900,pixelRatio:1,quality:i,fontCss:n,background:o.background}),width:720,height:405}}finally{d.unmount(),s.remove()}}async function u(t,e={}){const{signal:c,onProgress:a,quality:m}=e;c?.throwIfAborted();const l=n();try{const n=await async function(t){const r=document.createElement("div");r.style.fontFamily=i,t.root.append(r);try{return await o(r)}finally{r.remove()}}(l),e=[];for(const[o,r]of t.slides.entries()){c?.throwIfAborted();const i=await d(r,l,n,m).catch(t=>{throw new Error(s.pdfSlideFailed(o+1),{cause:t})});e.push(i),a?.(o+1,t.slides.length)}return r(e)}finally{l.close()}}export{u as deckToPdf};
|
|
@@ -45,3 +45,7 @@
|
|
|
45
45
|
.office-conflict { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; background: var(--status-warning-bg, var(--surface-raised)); border-bottom: 1px solid var(--line); font-size: 12px; }
|
|
46
46
|
.office-open-failed { padding: 24px; }
|
|
47
47
|
.office-save-state { margin-left: auto; }
|
|
48
|
+
.office-filelist-busy { padding: 8px 16px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-muted, var(--ink)); background: var(--surface-sunken, var(--surface)); }
|
|
49
|
+
.office-filelist-rename { flex: 0 1 320px; min-width: 160px; }
|
|
50
|
+
.office-filelist-open { display: inline-flex; align-items: center; gap: 6px; }
|
|
51
|
+
.office-filelist:focus { outline: none; }
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, ComponentType } from 'react';
|
|
3
|
+
import { F as FileWords, C as ChooseOfficeFile, P as PdfOptions } from '../words-DK_ajpEa.js';
|
|
4
|
+
export { E as ENGLISH_FILE_WORDS, O as OfficeFileChoice, a as OfficeFileRequest, Z as ZH_HANS_FILE_WORDS, h as hasExtension } from '../words-DK_ajpEa.js';
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* The Documents app's words: its English, and each language this package carries. A
|
|
@@ -9,6 +11,7 @@ import { ReactNode, ComponentType } from 'react';
|
|
|
9
11
|
* machine-written, and no person has read them yet. Nor have the file list's
|
|
10
12
|
* (`filesHeading` to `deleteConfirm`).
|
|
11
13
|
*/
|
|
14
|
+
|
|
12
15
|
interface DocumentsWords {
|
|
13
16
|
backToFiles: string;
|
|
14
17
|
filesHeading: string;
|
|
@@ -165,15 +168,15 @@ interface DocumentsWords {
|
|
|
165
168
|
discardTitle: (name: string) => string;
|
|
166
169
|
cannotRead: (name: string) => string;
|
|
167
170
|
unsupported: (ext: string) => string;
|
|
171
|
+
pdfPageFailed: (page: number) => string;
|
|
172
|
+
/** The file list's shared words: Open, Rename and the rest. */
|
|
173
|
+
files: FileWords;
|
|
174
|
+
/** The kind of file Open takes from the drive, as the drive names it. */
|
|
175
|
+
fileKind: string;
|
|
168
176
|
}
|
|
169
177
|
declare const ENGLISH_WORDS: DocumentsWords;
|
|
170
178
|
declare const ZH_HANS_WORDS: DocumentsWords;
|
|
171
179
|
|
|
172
|
-
declare function DocumentsWordsProvider({ words, children }: {
|
|
173
|
-
words: DocumentsWords;
|
|
174
|
-
children: ReactNode;
|
|
175
|
-
}): react.JSX.Element;
|
|
176
|
-
|
|
177
180
|
interface DocumentSummary {
|
|
178
181
|
id: string;
|
|
179
182
|
title: string;
|
|
@@ -207,6 +210,9 @@ interface DocumentsHost {
|
|
|
207
210
|
/** Absent: a person may. */
|
|
208
211
|
canCreate?: boolean;
|
|
209
212
|
canDelete?: boolean;
|
|
213
|
+
/** Choose a file from the host's drive (../files/choose.ts). Absent: Open takes
|
|
214
|
+
* a file from this computer only. */
|
|
215
|
+
chooseFile?: ChooseOfficeFile;
|
|
210
216
|
/** The app's words in the host's language. Absent: whatever `DocumentsWordsProvider` says. */
|
|
211
217
|
words?: DocumentsWords;
|
|
212
218
|
}
|
|
@@ -215,6 +221,11 @@ declare function DocumentsProvider({ value, children }: {
|
|
|
215
221
|
children: ReactNode;
|
|
216
222
|
}): react.JSX.Element;
|
|
217
223
|
|
|
224
|
+
declare function DocumentsWordsProvider({ words, children }: {
|
|
225
|
+
words: DocumentsWords;
|
|
226
|
+
children: ReactNode;
|
|
227
|
+
}): react.JSX.Element;
|
|
228
|
+
|
|
218
229
|
declare const Documents: ComponentType<{
|
|
219
230
|
documentId?: string;
|
|
220
231
|
onClose?: () => void;
|
|
@@ -236,5 +247,13 @@ declare const documentsApp: {
|
|
|
236
247
|
readonly multiInstance: true;
|
|
237
248
|
};
|
|
238
249
|
};
|
|
250
|
+
/** A PDF of a `.docx`, its pages as the document's page setup lays them out. */
|
|
251
|
+
declare function docxToPdf(file: Blob, options?: PdfOptions): Promise<Blob>;
|
|
252
|
+
/** A Word file as a document of its own in `store`, which then opens by id. The
|
|
253
|
+
* file stays as it was. Rejects, leaving nothing made, for a file that isn't Word. */
|
|
254
|
+
declare function importDocumentFile(store: DocumentsStore, file: File): Promise<{
|
|
255
|
+
id: string;
|
|
256
|
+
title: string;
|
|
257
|
+
}>;
|
|
239
258
|
|
|
240
|
-
export { DocumentEditor, type DocumentSummary, Documents, DocumentsConflict, type DocumentsHost, DocumentsProvider, type DocumentsStore, type DocumentsWords, DocumentsWordsProvider, ENGLISH_WORDS, type StoredDocument, ZH_HANS_WORDS, documentsApp };
|
|
259
|
+
export { ChooseOfficeFile, DocumentEditor, type DocumentSummary, Documents, DocumentsConflict, type DocumentsHost, DocumentsProvider, type DocumentsStore, type DocumentsWords, DocumentsWordsProvider, ENGLISH_WORDS, FileWords, PdfOptions, type StoredDocument, ZH_HANS_WORDS, documentsApp, docxToPdf, importDocumentFile };
|
package/dist/documents/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DocumentsConflict as t,DocumentsProvider as
|
|
1
|
+
import{DocumentsConflict as t,DocumentsProvider as o,DocumentsWordsProvider as n}from"../chunk-HU4RI2OM.js";import{ENGLISH_WORDS as m,ZH_HANS_WORDS as r}from"../chunk-I3AC6PYR.js";import{ENGLISH_FILE_WORDS as c,ZH_HANS_FILE_WORDS as e}from"../chunk-B32ASXHM.js";import{hasExtension as i}from"../chunk-XYVQTQ6N.js";import{lazy as s}from"react";var u=s(()=>import("../Documents-CVV64UEH.js")),p=s(()=>import("../Documents-CVV64UEH.js").then(t=>({default:t.OpenDocument}))),a={"/documents":{component:u,label:"Documents",size:"xl",appStyle:!0,multiInstance:!0}};async function f(t,o){const{docxToPdf:n}=await(import("../docxPdf-EW5I5JR3.js"));return n(t,o)}async function j(t,o){const{importDocumentFile:n}=await(import("../importDocument-274VK7OM.js"));return n(t,o)}export{p as DocumentEditor,u as Documents,t as DocumentsConflict,o as DocumentsProvider,n as DocumentsWordsProvider,c as ENGLISH_FILE_WORDS,m as ENGLISH_WORDS,e as ZH_HANS_FILE_WORDS,r as ZH_HANS_WORDS,a as documentsApp,f as docxToPdf,i as hasExtension,j as importDocumentFile};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{marginText as t,pageBlocks as e,pageStarts as o,pageStyles as n,printStyles as i}from"./chunk-4NKXNXKY.js";import{boxesInWindow as r,pageWindows as s}from"./chunk-PWF37Y2N.js";import{ENGLISH_WORDS as a}from"./chunk-I3AC6PYR.js";import{drawJpeg as p,embeddedFonts as c,jpegPdf as l,openStage as h,settled as d}from"./chunk-JKYJGXJE.js";import"./chunk-B32ASXHM.js";import{readDocx as f}from"./chunk-COXKOQPZ.js";import"./chunk-RHW2M2UY.js";var u="pdf",g=t=>t/20*(4/3);function m(t){const e=t.getBoundingClientRect().top;return Array.from(t.children,t=>{const o=t.getBoundingClientRect();return{top:o.top-e,height:o.height}})}function x(e,o,n,i,r){const s=document.createElement("div");s.style.cssText=`position:absolute;display:flex;justify-content:space-between;font:9pt Calibri,Carlito,Arial,sans-serif;color:#555;white-space:pre;left:${g(o.left)}px;right:${g(o.right)}px;${r}`;for(const o of t(e,n,i))s.append(Object.assign(document.createElement("span"),{textContent:o}));return s}function w(t,e,o,n){const{page:i,header:s,footer:a}=t.doc,p=document.createElement("div");p.style.cssText=`position:relative;overflow:hidden;background:#fff;width:${g(i.width)}px;height:${g(i.height)}px`;const c=document.createElement("div");return c.style.cssText=`position:absolute;overflow:hidden;left:${g(i.left)}px;top:${g(i.top)}px;right:${g(i.right)}px;height:${e.height}px`,c.append(function({body:t,boxes:e},o){const n=t.cloneNode(!1),i=r(e,o);if(!i)return n;for(let e=i.first;e<=i.last;e+=1)n.append(t.children[e].cloneNode(!0));const s=parseFloat(getComputedStyle(t.children[i.first]).marginTop)||0;return n.style.position="absolute",n.style.left="0",n.style.top=e[i.first].top-s-o.top+"px",n}(t,e)),p.append(c),s.text&&p.append(x(s.text,i,o,n,`top:${g(i.header)}px`)),a.text&&p.append(x(a.text,i,o,n,`bottom:${g(i.footer)}px`)),p}async function y(t,e,o,n,i){e.append(t);try{await d(t);return{jpeg:await p(t,{width:g(o.width),height:g(o.height),pixelRatio:2,quality:i,fontCss:n}),width:o.width/20,height:o.height/20}}finally{t.remove()}}async function b(t,r={}){const{signal:p,onProgress:x,quality:b}=r;p?.throwIfAborted();const $=await f(new Uint8Array(await t.arrayBuffer())),C=h();try{const t=function(t,e){const o=document.createElement("style");o.textContent=`${n(t,u)}\n${i(u)}`;const r=document.createElement("div");return r.className="docs-page",r.dataset.doc=u,r.style.cssText=`display:flow-root;width:${g(t.page.width-t.page.left-t.page.right)}px`,r.innerHTML=t.html,e.append(o,r),r}($,C.root);await d(t);const r={doc:$,body:t,boxes:m(t)},h=function(t,n){const i=g(t.page.height-t.page.top-t.page.bottom),r=o(e(n,n.getBoundingClientRect().top),i);return s(r,i,n.getBoundingClientRect().height)}($,t),f=await c(t),j=[];for(const[t,e]of h.entries()){p?.throwIfAborted();const o=w(r,e,t+1,h.length);j.push(await y(o,C.root,$.page,f,b).catch(e=>{throw new Error(a.pdfPageFailed(t+1),{cause:e})})),x?.(t+1,h.length)}return l(j)}finally{C.close()}}export{b as docxToPdf};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{importDocumentFile as o}from"./chunk-JCSB2PHB.js";import"./chunk-COXKOQPZ.js";import"./chunk-RHW2M2UY.js";import"./chunk-XYVQTQ6N.js";export{o as importDocumentFile};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{importSpreadsheetFile as o}from"./chunk-B6JN7D6G.js";import"./chunk-N26CBJZA.js";import"./chunk-VKCG3LPQ.js";import"./chunk-XYVQTQ6N.js";export{o as importSpreadsheetFile};
|