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/uv.loader.js
(function(){"use strict";var v=(e=>(e[e.INSTALL_AME=0]="INSTALL_AME",e[e.UPDATE_AME_CODEC=1]="UPDATE_AME_CODEC",e[e.BUY_AME_LICENSE=2]="BUY_AME_LICENSE",e[e.ADMIN_INSTALL_AME=3]="ADMIN_INSTALL_AME",e[e.ADMIN_UPDATE_AME_CODEC=4]="ADMIN_UPDATE_AME_CODEC",e[e.ADMIN_BUY_AME_LICENSE=5]="ADMIN_BUY_AME_LICENSE",e[e.IMG_CODEC_COMMON_ADVICE=6]="IMG_CODEC_COMMON_ADVICE",e[e.FILE_IN_COLD_TIER=7]="FILE_IN_COLD_TIER",e))(v||{}),d=(e=>(e.INFO_PANEL="uv-info-panel",e.SEARCH_PANEL="uv-search-panel",e.ACTION_PANEL="uv-action-panel",e.FALLBACK_PANEL="uv-fallback-panel",e.PASSWORD_DIALOG="uv-password-dialog",e.MASK="uv-mask",e.ARCHIVE_VIEW="uv-archive-view",e.AUDIO_VIEW="uv-audio-view",e.DOCX_VIEW="uv-docx-view",e.IMAGE_VIEW="uv-image-view",e.ODOC_VIEW="uv-odoc-view",e.OSHEET_VIEW="uv-osheet-view",e.OSLIDES_VIEW="uv-oslides-view",e.PDF_VIEW="uv-pdf-view",e.PPTX_VIEW="uv-pptx-view",e.PSD_VIEW="uv-psd-view",e.TEXT_VIEW="uv-text-view",e.VIDEO_VIEW="uv-video-view",e.XLSX_VIEW="uv-xlsx-view",e))(d||{}),m=(e=>(e.IMG="img",e.PSD="psd",e.TEXT="text",e.ARCHIVE="archive",e.PDF="pdf",e.XLSX="xlsx",e.DOCX="docx",e.PPTX="pptx",e.OSHEET="osheet",e.ODOC="odoc",e.OSLIDE="oslides",e.AUDIO="audio",e.VIDEO="video",e.UNSUPPORT="unsupport",e))(m||{}),p=(e=>(e[e.UNKNOWN=0]="UNKNOWN",e[e.TYPE_NOT_SUPPORT=1]="TYPE_NOT_SUPPORT",e[e.NO_PRIVILEGE=2]="NO_PRIVILEGE",e[e.LARGE_FILE=3]="LARGE_FILE",e))(p||{});function y(e,t){const n=e.createElement("link");n.rel="stylesheet",n.type="text/css",n.href=t,e.body.appendChild(n)}function h(e,t){if(t)for(const n of Array.isArray(t)?t:[t])y(e,n)}function N(e,t){if(t===!1)return;const n=typeof t=="string"?t:"",r=e.createElement("meta");r.setAttribute("http-equiv","Content-Security-Policy");const o="default-src 'self'",a="script-src 'self' 'wasm-unsafe-eval'",u="style-src 'self' 'unsafe-inline'",i=`img-src 'self' data: blob: ${n}`,s=`connect-src 'self' data: blob: ${n}`,l=`media-src 'self' data: blob: ${n}`,c=`frame-src 'self' blob: ${n}`;r.setAttribute("content",`${o}; ${a}; ${u}; ${i}; ${s}; ${l}; ${c};`),e.head.appendChild(r)}function D(e,t){t={height:"100%",width:"100%",border:"none",outline:"none",...t};for(const[n,r]of Object.entries(t))e.style[n]=r}function w(e){const t=e.rootEl.ownerDocument.createElement("iframe");return t.classList.add("syno-uv-main"),D(t,e.iframeStyle),t.style.display="none",t}function f(e){const t=e.contentDocument;if(!t)throw new Error("iframe contentDocument is null");return t}async function P(e){const{rootEl:t,uvPath:n}=e,r=w(e);return r.src=`${n}uv.html?v=1.4.0-0712`,await new Promise((o,a)=>{r.onload=o,r.onerror=a,t.appendChild(r)}),r}async function b(e){var i;const t=e.rootEl,n=e.uvPath.endsWith("/")?e.uvPath:`${e.uvPath}/`;if(n.startsWith("."))throw new Error("Cannot use relative path with anonymous iframe");function r(s){return`${n}${s}`}const o=w(e);t.appendChild(o),(i=o.contentWindow).__uv_path__??(i.__uv_path__=r);const u=(await fetch(`${n}uv.html?v=1.4.0-0712`).then(s=>s.text())).replaceAll(/src="([^"]+)"/g,(s,l)=>`src="${r(l)}"`).replaceAll(/href="([^"]+)"/g,(s,l)=>`href="${r(l)}"`);return await new Promise((s,l)=>{o.onload=()=>s(),o.onerror=()=>l();const c=f(o);c.open(),c.write(u),c.close()}),o}async function W(e){var t;try{let n=function(){r.style.display="none",window.removeEventListener("mouseup",a),window.removeEventListener("mousemove",a)};const r=e.anonymousIframe?await b(e):await P(e),o=f(r);N(o,e.csp),h(o,e.cssUrl),(t=e.highlight)!=null&&t.cssUrl&&h(o,e.highlight.cssUrl),e.rootEl=o.body;const a=i=>{try{const s=new MouseEvent(i.type,i);r.contentWindow.dispatchEvent(s)}catch{}},u=await r.contentWindow.UV.createUniversalViewer(e,e.lang);if(u.on("beforeshow",()=>{r.style.display="block",window.addEventListener("mouseup",a),window.addEventListener("mousemove",a)}),u.on("hide",n),e.forwardEvents)for(const[i,s]of Object.entries(e.forwardEvents))s&&e.rootEl.addEventListener(i,s);return u}catch(n){return console.error(n),null}}const _="1.4.0-0712";async function $(e){return W({...e,urlAdapter(t){return new URL(t,location.href).toString()},uvPath:"webman/3rdparty/UniversalViewer/",anonymousIframe:!1})}const O=Object.freeze(Object.defineProperty({__proto__:null,CATEGORY_CLASS:d,FAILURE_ADVICE:v,FAILURE_REASON:p,FALLBACK_ADVICE:v,ITEM_TYPE:m,createUniversalViewer:$,version:_},Symbol.toStringTag,{value:"Module"}));window.UV??(window.UV=O)})();