HEX
Server: Apache/2.4.63 (Unix)
System: Linux TOMS-220NAS 4.4.302+ #86009 SMP Wed Nov 26 18:19:17 CST 2025 x86_64
User: flavio87 (1026)
PHP: 8.3.27
Disabled: NONE
Upload Files
File: //var/packages/UniversalViewer/target/dist/assets/item-DBlKVj6T.js
import"../uv.main.XdP33zSa.js";import"./usePaperFloat-QHga-gfl.js";import{O as z}from"./officeItem-DyDugwZR.js";import"./ZoomFloatingBar.vue_vue_type_script_setup_true_lang-DOYCzXq-.js";import{r as N}from"./handler-Z295YBgO.js";/**
 * @license
 * Copyright 2019 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const S=Symbol("Comlink.proxy"),F=Symbol("Comlink.endpoint"),H=Symbol("Comlink.releaseProxy"),x=Symbol("Comlink.finalizer"),p=Symbol("Comlink.thrown"),I=e=>typeof e=="object"&&e!==null||typeof e=="function",U={canHandle:e=>I(e)&&e[S],serialize(e){const{port1:r,port2:t}=new MessageChannel;return M(e,r),[t,[t]]},deserialize(e){return e.start(),T(e)}},V={canHandle:e=>I(e)&&p in e,serialize({value:e}){let r;return e instanceof Error?r={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:r={isError:!1,value:e},[r,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},L=new Map([["proxy",U],["throw",V]]);function W(e,r){for(const t of e)if(r===t||t==="*"||t instanceof RegExp&&t.test(r))return!0;return!1}function M(e,r=globalThis,t=["*"]){r.addEventListener("message",function l(n){if(!n||!n.data)return;if(!W(t,n.origin)){console.warn(`Invalid origin '${n.origin}' for comlink proxy`);return}const{id:f,type:o,path:s}=Object.assign({path:[]},n.data),i=(n.data.argumentList||[]).map(m);let c;try{const a=s.slice(0,-1).reduce((g,d)=>g[d],e),u=s.reduce((g,d)=>g[d],e);switch(o){case"GET":c=u;break;case"SET":a[s.slice(-1)[0]]=m(n.data.value),c=!0;break;case"APPLY":c=u.apply(a,i);break;case"CONSTRUCT":{const g=new u(...i);c=Y(g)}break;case"ENDPOINT":{const{port1:g,port2:d}=new MessageChannel;M(e,d),c=v(g,[g])}break;case"RELEASE":c=void 0;break;default:return}}catch(a){c={value:a,[p]:0}}Promise.resolve(c).catch(a=>({value:a,[p]:0})).then(a=>{const[u,g]=b(a);r.postMessage(Object.assign(Object.assign({},u),{id:f}),g),o==="RELEASE"&&(r.removeEventListener("message",l),A(r),x in e&&typeof e[x]=="function"&&e[x]())}).catch(a=>{const[u,g]=b({value:new TypeError("Unserializable return value"),[p]:0});r.postMessage(Object.assign(Object.assign({},u),{id:f}),g)})}),r.start&&r.start()}function j(e){return e.constructor.name==="MessagePort"}function A(e){j(e)&&e.close()}function T(e,r){return R(e,[],r)}function y(e){if(e)throw new Error("Proxy has been released and is not useable")}function C(e){return h(e,{type:"RELEASE"}).then(()=>{A(e)})}const P=new WeakMap,E="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const r=(P.get(e)||0)-1;P.set(e,r),r===0&&C(e)});function D(e,r){const t=(P.get(r)||0)+1;P.set(r,t),E&&E.register(e,r,e)}function B(e){E&&E.unregister(e)}function R(e,r=[],t=function(){}){let l=!1;const n=new Proxy(t,{get(f,o){if(y(l),o===H)return()=>{B(n),C(e),l=!0};if(o==="then"){if(r.length===0)return{then:()=>n};const s=h(e,{type:"GET",path:r.map(i=>i.toString())}).then(m);return s.then.bind(s)}return R(e,[...r,o])},set(f,o,s){y(l);const[i,c]=b(s);return h(e,{type:"SET",path:[...r,o].map(a=>a.toString()),value:i},c).then(m)},apply(f,o,s){y(l);const i=r[r.length-1];if(i===F)return h(e,{type:"ENDPOINT"}).then(m);if(i==="bind")return R(e,r.slice(0,-1));const[c,a]=O(s);return h(e,{type:"APPLY",path:r.map(u=>u.toString()),argumentList:c},a).then(m)},construct(f,o){y(l);const[s,i]=O(o);return h(e,{type:"CONSTRUCT",path:r.map(c=>c.toString()),argumentList:s},i).then(m)}});return D(n,e),n}function G(e){return Array.prototype.concat.apply([],e)}function O(e){const r=e.map(b);return[r.map(t=>t[0]),G(r.map(t=>t[1]))]}const _=new WeakMap;function v(e,r){return _.set(e,r),e}function Y(e){return Object.assign(e,{[S]:!0})}function b(e){for(const[r,t]of L)if(t.canHandle(e)){const[l,n]=t.serialize(e);return[{type:"HANDLER",name:r,value:l},n]}return[{type:"RAW",value:e},_.get(e)||[]]}function m(e){switch(e.type){case"HANDLER":return L.get(e.name).deserialize(e.value);case"RAW":return e.value}}function h(e,r,t){return new Promise(l=>{const n=q();e.addEventListener("message",function f(o){!o.data||!o.data.id||o.data.id!==n||(e.removeEventListener("message",f),l(o.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:n},r),t)})}function q(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}let k=null;function w(){if(!k){const e=new Worker(new URL(""+new URL("worker-0ZqDYG0x.js",import.meta.url).href,import.meta.url),{type:"module"});k=T(e)}return k}class Q extends z{static officeVersion;storagePath;_previewPromises;constructor(r){super(r),this._previewPromises=null}destroy(){super.destroy(),this.storagePath&&w().cleanImages(this.storagePath),this._previewPromises=null}async writeBlob(r){const t=N(),l=await r.arrayBuffer(),n=new Uint8Array(l);try{await w().writeFile(t,v(n,[n.buffer]))}catch(f){return console.error(f),null}return t}_getPreviewPromises(){let r,t,l=new Promise(s=>{t=s}),n;const f=new Promise(s=>{n=s});return this.fetchPreview().then(async s=>{if(!s){t(null),n(null);return}const i=await this.writeBlob(s);if(!i){t(null),n(null);return}try{if(await w().checkEncrypt(this.getFileExt(),i,"")){t(null),n({path:i});return}}catch(a){t(null),n(null),console.error(a);return}const c=async a=>{r.needPassword=l=new Promise(u=>{t=u});try{if(await w().checkEncrypt(this.getFileExt(),i,a))return t(null),n({path:i,password:a}),!0}catch(u){console.error(u)}return t(c),!1};t(c)}),r={needPassword:l,parseInfo:f}}getPreviewPromises(){return this._previewPromises||(this._previewPromises=this._getPreviewPromises())}needPassword(){return this.getPreviewPromises().needPassword}getParseInfo(){return this.getPreviewPromises().parseInfo}async _handlePreview(){try{const r=await this.getParseInfo();if(!r)return null;const t=await w().parse(this.getFileExt(),r.path,r.password||"");return t?(this.storagePath=t.storage,new Blob([`{"data":${t.payload},"success":true}`],{type:"application/json"})):null}catch(r){console.error(r)}return null}async getImageHandler(r){if(this.storagePath)return w().getImageURL(this.storagePath,r)}}export{Q as M};