import{X as e,al as t,an as s,E as r,ae as n,aN as i,as as a,a1 as l,q as o,ap as d,aV as c,S as u,a2 as p,a0 as h,cp as m,dx as w,dy as f,cY as y,U as v}from"./index-WdfADTOW.js";import{V as g,a as j}from"./index-ddUXWqR4.js";var x=d("<div style=width:100%;height:100%;overflow:auto;position:relative;background:#f5f5f5><div id=ppt-result style=width:100%;height:100%>");const $=()=>{const d=o(),[$,S]=e(!0),[E,k]=e(!1),[C,T]=e(!1);let P,b;const q=(e,t)=>new Promise((s,r)=>{if(document.getElementById(t))return void s();const n=document.createElement("script");n.src=e,n.id=t,n.type="text/javascript",n.onload=()=>s(),n.onerror=()=>r(new h(`Failed to load script: ${e}`)),document.head.appendChild(n)}),F=(e,t)=>new Promise((s,r)=>{if(document.getElementById(t))return void s();const n=document.createElement("link");n.rel="stylesheet",n.href=e,n.id=t,n.onload=()=>s(),n.onerror=()=>r(new h(`Failed to load CSS: ${e}`)),document.head.appendChild(n)}),z=()=>{P&&(document.fullscreenElement?document.exitFullscreen().then(()=>{T(!1),b&&b.querySelectorAll(".slide").forEach(e=>{e.style.width="",e.style.margin=""})}):P.requestFullscreen().then(()=>{T(!0),b&&b.querySelectorAll(".slide").forEach(e=>{e.style.width="99%",e.style.margin="0 auto"})}))},A=()=>{!document.fullscreenElement&&(T(!1),b)&&b.querySelectorAll(".slide").forEach(e=>{e.style.width="",e.style.margin=""})};return t(()=>{(async()=>{try{S(!0),k(!1);const e="static/ppt.js";if(await Promise.all([F(`${e}/css/pptxjs.css`,"pptxjs-css"),F(`${e}/css/nv.d3.min.css`,"nv-d3-css")]),await q(`${e}/js/jquery-1.11.3.min.js`,"jquery-script"),await q("static/jszip/jszip-2.6.1.min.js","jszip-2.6.1-script"),await q(`${e}/js/filereader.js`,"filereader-script"),await q(`${e}/js/d3.min.js`,"d3-script"),await q(`${e}/js/nv.d3.min.js`,"nv-d3-script"),await q(`${e}/js/pptxjs.js`,"pptxjs-script"),await q(`${e}/js/divs2slides.js`,"divs2slides-script"),!window.$||!window.jQuery)throw new h("jQuery not loaded");b&&(window.$(b).pptxToHtml({pptxFileUrl:v.raw_url,slideMode:!1,keyBoardShortCut:!1,slideModeConfig:{first:1,nav:!1,navTxtColor:"white",navNextTxt:"&#8250;",navPrevTxt:"&#8249;",showPlayPauseBtn:!1,keyBoardShortCut:!1,showSlideNum:!1,showTotalSlideNum:!1,autoSlide:!1,randomAutoSlide:!1,loop:!1,background:"black",transition:"default",transitionTime:1}}),setTimeout(()=>{S(!1)},2e3))}catch(e){console.error("PPT初始化失败:",e),k(!0),S(!1)}})(),document.addEventListener("fullscreenchange",A)}),s(()=>{document.removeEventListener("fullscreenchange",A)}),r(y,{w:"$full",h:"70vh",pos:"relative",get children(){return[r(n,{pos:"absolute",top:"$2",right:"$2",zIndex:"10",opacity:"0.7",transition:"opacity 0.2s",_hover:{opacity:"1"},get children(){return r(i,{withArrow:!0,get label(){return l(()=>!!C())()?d("home.preview.exit_fullscreen"):d("home.preview.fullscreen")},get children(){return r(a,{size:"sm",colorScheme:"neutral","aria-label":"Toggle Fullscreen",get icon(){return l(()=>!!C())()?r(g,{}):r(j,{})},onClick:z})}})}}),(e=x(),t=e.firstChild,"function"==typeof P?f(P,e):P=e,"function"==typeof b?f(b,t):b=t,c(e,r(u,{get when(){return $()},get children(){return r(p,{})}}),null),c(e,r(u,{get when(){return E()},get children(){return r(h,{get msg(){return d("preview.failed_load_ppt")},h:"70vh"})}}),null),m(e=>w(t,"display",$()||E()?"none":"block")),e)];var e,t}})};export{$ as default};
