PageSourceSearch

https://zhama.ai/assets/use-open-document-B1lgN5re.js

js zhama.ai collected 2026-10-05 15:28:08 UTC 3,707 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-D8F8nRbJ.js","assets/index-D3vn9Q0K.js","assets/query-vuJkI9Vw.js","assets/router-BbxLWYoF.js","assets/index-T-mKmUGJ.css","assets/deck-size-Bs17Hq7P.js","assets/jszip.min-BBMLzRt1.js","assets/_commonjs-dynamic-modules-TDtrdbi3.js","assets/size-ceilings-HrUrinWm.js"])))=>i.map(i=>d[i]);
2import{A as l,_ as r,e as m,aA as f,aG as y,aH as _,bc as D,bd as w,y as T,$ as u,be as k}from"./index-D3vn9Q0K.js";import{r as d,a as b}from"./query-vuJkI9Vw.js";async function v(n){if(!l)return!1;const{open:t}=await r(async()=>{const{open:e}=await import("./index-D8F8nRbJ.js");return{open:e}},__vite__mapDeps([0,1,2,3,4]));return await t(n),!0}function A(){const{t:n}=m(),t=d.useRef(n);return t.current=n,d.useCallback(async e=>{const{name:c,path:i}=e.info,a=`document-open:${i??e.info.fileId??c}`;try{const o=await f().open(e);await y().open(_(o.source.info)),e.info.format==="pptx"&&E(o)}catch(o){if(o instanceof D){w({kind:"document.refused",format:T(c)??"unknown",verdict:o.verdict.kind});const{title:s,description:p}=I(o.verdict,c,t.current);u({title:s,description:p,deduplicationKey:a,...i?{action:b.jsx(k,{altText:t.current("document.open.openInSystemApp","用系统应用打开"),onClick:()=>void v(i),children:t.current("document.open.openInSystemApp","用系统应用打开")})}:{}});return}console.error("[document] Could not open",c,o),u({title:t.current("document.open.failedTitle","这份文档没能打开"),description:t.current("document.open.failedDescription",{defaultValue:"{{name}} 没有取回来。稍后再试,或者先下载它。",name:c}
2),deduplicationKey:a})}},[])}async function E(n){const{deckLooksSlow:t}=await r(async()=>{const{deckLooksSlow:a}=await import("./deck-size-Bs17Hq7P.js");return{deckLooksSlow:a}},__vite__mapDeps([5,6,2,7,8])),{default:e}=await r(async()=>{const{default:a}=await import("./index-D3vn9Q0K.js").then(o=>o.du);return{default:a}},__vite__mapDeps([1,2,3,4])),c=n.openedBytes(),i=n.source;!c||!await t(c.bytes)||u({title:e.t("document.open.largeDeckTitle","这份演示文稿比较大"),description:e.t("document.open.largeDeckDescription",{defaultValue:"{{name}} 页数较多,打开需要一些时间,请稍候。",name:i.info.name}),deduplicationKey:`document-large-deck:${i.info.path??i.info.fileId??i.info.name}`})}function I(n,t,e){switch(n.kind){case"legacy-binary":return{title:e("document.open.legacyTitle","这是旧版格式"),description:e("document.open.legacyDescription",{defaultValue:"{{name}} 是 Office 97-2003 格式(.doc / .xls / .ppt)。用 Office 另存为新格式后可以在这里编辑。",name:t})};case"encrypted":return{title:e("document.open.encryptedTitle","这份文档有密码"),description:e("document.open.encryptedDescription",{defaultValue:"{{name}} 是加密的。在 Office 里去掉密码后可以在这里编辑。",name:t})};case"not-a-document":return{title:e("document.open.corruptTitle","这个文件读不出来"),description:e("document.open.corruptDescription",{defaultValue:"{{name}} 的内容和它的扩展名不一致。可能没下载完,或者本来是别的格式。",name:t})};case"unsupported-name":return{title:e("document.open.unsupportedTitle","这个格式暂不支持"),description:e("document.open.unsupportedDescription",{defaultValue:"Tego 目前能编辑 Word、Excel、PowerPoint 和 PDF。",name:t})};case"macro-enabled":return{title:e("document.open.macroTitle","这份文档带宏"),description:e("document.open.macroDescription",{defaultValue:"{{name}} 包含宏(.docm / .xlsm / .pptm)。Tego 不会运行宏,为避免丢失其中的自动化,请在 Office 里打开。",name:t})}}}export{A as u};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.