@8btc/wujie-ppt 0.0.13-beta → 0.0.14-beta

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.
@@ -32540,28 +32540,35 @@ const W3 = ({
32540
32540
  }, 200);
32541
32541
  } };
32542
32542
  }, kB = ({ initialSlidesData: t, onDataUpdate: e, renderPageExtra: r }, n) => {
32543
- const { setSlides: i, setTheme: a, setViewportRatio: o, setViewportSize: s } = Rt.getState(), { applyThemeToAllSlides: l, applyPresetTheme: u, applyFontToAllSlides: c } = uB(), { exportPPTX: f } = PB();
32543
+ const {
32544
+ slides: i,
32545
+ theme: a,
32546
+ setSlides: o,
32547
+ setTheme: s,
32548
+ setViewportRatio: l,
32549
+ setViewportSize: u
32550
+ } = Rt.getState(), { applyThemeToAllSlides: c, applyPresetTheme: f, applyFontToAllSlides: d } = uB(), { exportPPTX: h } = PB();
32544
32551
  return Lt(() => {
32545
32552
  if (t) {
32546
- const { slides: d, theme: h, viewportRatio: p, viewportSize: v } = lB(t);
32547
- i(d), a(h), o(p), s(v);
32553
+ const { slides: p, theme: v, viewportRatio: g, viewportSize: m } = lB(t);
32554
+ o(p), s(v), l(g), u(m);
32548
32555
  }
32549
32556
  }, []), Lt(() => {
32550
- const d = Rt.subscribe((h) => {
32551
- const p = {
32552
- slides: h.slides,
32553
- title: h.title,
32554
- theme: h.theme,
32555
- viewportRatio: h.viewportRatio
32557
+ const p = Rt.subscribe((v, g) => {
32558
+ const m = {
32559
+ slides: v.slides,
32560
+ title: v.title,
32561
+ theme: v.theme,
32562
+ viewportRatio: v.viewportRatio
32556
32563
  };
32557
- e(p);
32564
+ (g.slides !== v.slides || g.theme !== v.theme) && e(m);
32558
32565
  });
32559
- return () => d();
32566
+ return () => p();
32560
32567
  }, [e]), Ed(n, () => ({
32561
- applyThemeToAllSlides: l,
32562
- applyPresetTheme: u,
32563
- applyFontToAllSlides: c,
32564
- exportPPTX: f
32568
+ applyThemeToAllSlides: c,
32569
+ applyPresetTheme: f,
32570
+ applyFontToAllSlides: d,
32571
+ exportPPTX: h
32565
32572
  })), /* @__PURE__ */ A.createElement("div", { style: { width: "100%", height: "100%", position: "relative" } }, /* @__PURE__ */ A.createElement(iB, { renderPageExtra: r }));
32566
32573
  }, BV = yc(kB), NB = "_thumbnails_1awpq_1", OB = "_thumbnailList_1awpq_6", RB = "_thumbnailItem_1awpq_11", IB = "_thumbnail_1awpq_1", BB = "_active_1awpq_19", $B = "_label_1awpq_25", Hn = {
32567
32574
  thumbnails: NB,
@@ -40,4 +40,4 @@ echarts.use([`+P+"]);":"Unknown series "+E))}return}if(f==="tooltip"){if(_){proc
40
40
  `:"";function n(i){var a=i.children,o=i.tag,s=i.attrs,l=i.text;return PA(o,s)+(o!=="style"?y9(l):l||"")+(a?""+r+ve(a,function(u){return n(u)}).join(r)+r:"")+NA(o)}return n(e)}function OA(e,t,r){r=r||{};var n=r.newline?`
41
41
  `:"",i=" {"+n,a=n+"}",o=ve(Ve(e),function(l){return l+i+ve(Ve(e[l]),function(u){return u+":"+e[l][u]+";"}).join(n)+a}).join(n),s=ve(Ve(t),function(l){return"@keyframes "+l+i+ve(Ve(t[l]),function(u){return u+i+ve(Ve(t[l][u]),function(c){var f=t[l][u][c];return c==="d"&&(f='path("'+f+'")'),c+":"+f+";"}).join(n)+a}).join(n)+a}).join(n);return!o&&!s?"":["<![CDATA[",o,s,"]]>"].join(n)}function up(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function I_(e,t,r,n){return yt("svg","root",{width:e,height:t,xmlns:k_,"xmlns:xlink":P_,version:"1.1",baseProfile:"full",viewBox:n?"0 0 "+e+" "+t:!1},r)}var IA=0;function B_(){return IA++}var $_={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},ea="transform-origin";function BA(e,t,r){var n=se({},e.shape);se(n,t),e.buildPath(r,n);var i=new A_;return i.reset(V1(e)),r.rebuildPath(i,1),i.generateStr(),i.getStr()}function $A(e,t){var r=t.originX,n=t.originY;(r||n)&&(e[ea]=r+"px "+n+"px")}var RA={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function R_(e,t){var r=t.zrId+"-ani-"+t.cssAnimIdx++;return t.cssAnims[r]=e,r}function VA(e,t,r){var n=e.shape.paths,i={},a,o;if(V(n,function(l){var u=up(r.zrId);u.animation=!0,Cc(l,{},u,!0);var c=u.cssAnims,f=u.cssNodes,d=Ve(c),h=d.length;if(h){o=d[h-1];var p=c[o];for(var v in p){var g=p[v];i[v]=i[v]||{d:""},i[v].d+=g.d||""}for(var m in f){var y=f[m].animation;y.indexOf(o)>=0&&(a=y)}}}),!!a){t.d=!1;var s=R_(i,r);return a.replace(o,s)}}function V_(e){return we(e)?$_[e]?"cubic-bezier("+$_[e]+")":Bf(e)?e:"":""}function Cc(e,t,r,n){var i=e.animators,a=i.length,o=[];if(e instanceof Dm){var s=VA(e,t,r);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u<a;u++){var c=i[u],f=[c.getMaxTime()/1e3+"s"],d=V_(c.getClip().easing),h=c.getDelay();d?f.push(d):f.push("linear"),h&&f.push(h/1e3+"s"),c.getLoop()&&f.push("infinite");var p=f.join(" ");l[p]=l[p]||[p,[]],l[p][1].push(c)}function v(y){var _=y[1],b=_.length,w={},x={},T={},L="animation-timing-function";function M(q,W,j){for(var Y=q.getTracks(),re=q.getMaxTime(),te=0;te<Y.length;te++){var ne=Y[te];if(ne.needsAnimate()){var ge=ne.keyframes,Se=ne.propName;if(j&&(Se=j(Se)),Se)for(var ie=0;ie<ge.length;ie++){var Ee=ge[ie],K=Math.round(Ee.time/re*100)+"%",le=V_(Ee.easing),U=Ee.rawValue;(we(U)||Ke(U))&&(W[K]=W[K]||{},W[K][Se]=Ee.rawValue,le&&(W[K][L]=le))}}}}for(var C=0;C<b;C++){var E=_[C],P=E.targetName;P?P==="shape"&&M(E,x):!n&&M(E,w)}for(var D in w){var k={};Hl(k,e),se(k,w[D]);var N=z1(k),I=w[D][L];T[D]=N?{transform:N}:{},$A(T[D],k),I&&(T[D][L]=I)}var O,z=!0;for(var D in x){T[D]=T[D]||{};var $=!O,I=x[D][L];$&&(O=new zn);var R=O.len();O.reset(),T[D].d=BA(e,x[D],O);var B=O.len();if(!$&&R!==B){z=!1;break}I&&(T[D][L]=I)}if(!z)for(var D in T)delete T[D].d;if(!n)for(var C=0;C<b;C++){var E=_[C],P=E.targetName;P==="style"&&M(E,T,function(Y){return RA[Y]})}for(var H=Ve(T),F=!0,A,C=1;C<H.length;C++){var G=H[C-1],Z=H[C];if(T[G][ea]!==T[Z][ea]){F=!1;break}A=T[G][ea]}if(F&&A){for(var D in T)T[D][ea]&&delete T[D][ea];t[ea]=A}if(vt(H,function(q){return Ve(T[q]).length>0}).length){var Q=R_(T,r);return Q+" "+y[0]+" both"}}for(var g in l){var s=v(l[g]);s&&o.push(s)}if(o.length){var m=r.zrId+"-cls-"+B_();r.cssNodes["."+m]={animation:o.join(",")},t.class=m}}function zA(e,t,r){if(!e.ignore)if(e.isSilent()){var n={"pointer-events":"none"};z_(n,t,r)}else{var i=e.states.emphasis&&e.states.emphasis.style?e.states.emphasis.style:{},a=i.fill;if(!a){var o=e.style&&e.style.fill,s=e.states.select&&e.states.select.style&&e.states.select.style.fill,l=e.currentStates.indexOf("select")>=0&&s||o;l&&(a=Gf(l))}var u=i.lineWidth;if(u){var c=!i.strokeNoScale&&e.transform?e.transform[0]:1;u=u/c}var n={cursor:"pointer"};a&&(n.fill=a),i.stroke&&(n.stroke=i.stroke),u&&(n["stroke-width"]=u),z_(n,t,r)}}function z_(e,t,r,n){var i=JSON.stringify(e),a=r.cssStyleCache[i];a||(a=r.zrId+"-cls-"+B_(),r.cssStyleCache[i]=a,r.cssNodes["."+a+":hover"]=e),t.class=t.class?t.class+" "+a:a}var Ns=Math.round;function F_(e){return e&&we(e.src)}function H_(e){return e&&Le(e.toDataURL)}function cp(e,t,r,n){DA(function(i,a){var o=i==="fill"||i==="stroke";o&&R1(a)?q_(t,e,i,n):o&&Xf(a)?Z_(r,e,i,n):e[i]=a,o&&n.ssr&&a==="none"&&(e["pointer-events"]="visible")},t,r,!1),YA(r,e,n)}function fp(e,t){var r=Ab(t);r&&(r.each(function(n,i){n!=null&&(e[(N_+i).toLowerCase()]=n+"")}),t.isSilent()&&(e[N_+"silent"]="true"))}function G_(e){return Bn(e[0]-1)&&Bn(e[1])&&Bn(e[2])&&Bn(e[3]-1)}function FA(e){return Bn(e[4])&&Bn(e[5])}function hp(e,t,r){if(t&&!(FA(t)&&G_(t))){var n=1e4;e.transform=G_(t)?"translate("+Ns(t[4]*n)/n+" "+Ns(t[5]*n)/n+")":j9(t)}}function W_(e,t,r){for(var n=e.points,i=[],a=0;a<n.length;a++)i.push(Ns(n[a][0]*r)/r),i.push(Ns(n[a][1]*r)/r);t.points=i.join(" ")}function X_(e){return!e.smooth}function HA(e){var t=ve(e,function(r){return typeof r=="string"?[r,r]:r});return function(r,n,i){for(var a=0;a<t.length;a++){var o=t[a],s=r[o[0]];s!=null&&(n[o[1]]=Ns(s*i)/i)}}}var GA={circle:[HA(["cx","cy","r"])],polyline:[W_,X_],polygon:[W_,X_]};function WA(e){for(var t=e.animators,r=0;r<t.length;r++)if(t[r].targetName==="shape")return!0;return!1}function U_(e,t){var r=e.style,n=e.shape,i=GA[e.type],a={},o=t.animation,s="path",l=e.style.strokePercent,u=t.compress&&V1(e)||4;if(i&&!t.willUpdate&&!(i[1]&&!i[1](n))&&!(o&&WA(e))&&!(l<1)){s=e.type;var c=Math.pow(10,u);i[0](n,a,c)}else{var f=!e.path||e.shapeChanged();e.path||e.createPathProxy();var d=e.path;f&&(d.beginPath(),e.buildPath(d,e.shape),e.pathUpdated());var h=d.getVersion(),p=e,v=p.__svgPathBuilder;(p.__svgPathVersion!==h||!v||l!==p.__svgPathStrokePercent)&&(v||(v=p.__svgPathBuilder=new A_),v.reset(u),d.rebuildPath(v,l),v.generateStr(),p.__svgPathVersion=h,p.__svgPathStrokePercent=l),a.d=v.getStr()}return hp(a,e.transform),cp(a,r,e,t),fp(a,e),t.animation&&Cc(e,a,t),t.emphasis&&zA(e,a,t),yt(s,e.id+"",a)}function XA(e,t){var r=e.style,n=r.image;if(n&&!we(n)&&(F_(n)?n=n.src:H_(n)&&(n=n.toDataURL())),!!n){var i=r.x||0,a=r.y||0,o=r.width,s=r.height,l={href:n,width:o,height:s};return i&&(l.x=i),a&&(l.y=a),hp(l,e.transform),cp(l,r,e,t),fp(l,e),t.animation&&Cc(e,l,t),yt("image",e.id+"",l)}}function UA(e,t){var r=e.style,n=r.text;if(n!=null&&(n+=""),!(!n||isNaN(r.x)||isNaN(r.y))){var i=r.font||ln,a=r.x||0,o=K9(r.y||0,No(i),r.textBaseline),s=Q9[r.textAlign]||r.textAlign,l={"dominant-baseline":"central","text-anchor":s};if(Yg(r)){var u="",c=r.fontStyle,f=Xg(r.fontSize);if(!parseFloat(f))return;var d=r.fontFamily||Uv,h=r.fontWeight;u+="font-size:"+f+";font-family:"+d+";",c&&c!=="normal"&&(u+="font-style:"+c+";"),h&&h!=="normal"&&(u+="font-weight:"+h+";"),l.style=u}else l.style="font: "+i;return n.match(/\s/)&&(l["xml:space"]="preserve"),a&&(l.x=a),o&&(l.y=o),hp(l,e.transform),cp(l,r,e,t),fp(l,e),t.animation&&Cc(e,l,t),yt("text",e.id+"",l,void 0,n)}}function Y_(e,t){if(e instanceof Fe)return U_(e,t);if(e instanceof Pr)return XA(e,t);if(e instanceof Go)return UA(e,t)}function YA(e,t,r){var n=e.style;if(J9(n)){var i=eb(e),a=r.shadowCache,o=a[i];if(!o){var s=e.getGlobalScale(),l=s[0],u=s[1];if(!l||!u)return;var c=n.shadowOffsetX||0,f=n.shadowOffsetY||0,d=n.shadowBlur,h=Do(n.shadowColor),p=h.opacity,v=h.color,g=d/2/l,m=d/2/u,y=g+" "+m;o=r.zrId+"-s"+r.shadowIdx++,r.defs[o]=yt("filter",o,{id:o,x:"-100%",y:"-100%",width:"300%",height:"300%"},[yt("feDropShadow","",{dx:c/l,dy:f/u,stdDeviation:y,"flood-color":v,"flood-opacity":p})]),a[i]=o}t.filter=Ol(o)}}function q_(e,t,r,n){var i=e[r],a,o={gradientUnits:i.global?"userSpaceOnUse":"objectBoundingBox"};if(B1(i))a="linearGradient",o.x1=i.x,o.y1=i.y,o.x2=i.x2,o.y2=i.y2;else if($1(i))a="radialGradient",o.cx=ye(i.x,.5),o.cy=ye(i.y,.5),o.r=ye(i.r,.5);else{process.env.NODE_ENV!=="production"&&ha("Illegal gradient type.");return}for(var s=i.colorStops,l=[],u=0,c=s.length;u<c;++u){var f=Wf(s[u].offset)*100+"%",d=s[u].color,h=Do(d),p=h.color,v=h.opacity,g={offset:f};g["stop-color"]=p,v<1&&(g["stop-opacity"]=v),l.push(yt("stop",u+"",g))}var m=yt(a,"",o,l),y=lp(m),_=n.gradientCache,b=_[y];b||(b=n.zrId+"-g"+n.gradientIdx++,_[y]=b,o.id=b,n.defs[b]=yt(a,b,o,l)),t[r]=Ol(b)}function Z_(e,t,r,n){var i=e.style[r],a=e.getBoundingRect(),o={},s=i.repeat,l=s==="no-repeat",u=s==="repeat-x",c=s==="repeat-y",f;if(I1(i)){var d=i.imageWidth,h=i.imageHeight,p=void 0,v=i.image;if(we(v)?p=v:F_(v)?p=v.src:H_(v)&&(p=v.toDataURL()),typeof Image>"u"){var g="Image width/height must been given explictly in svg-ssr renderer.";be(d,g),be(h,g)}else if(d==null||h==null){var m=function(C,E){if(C){var P=C.elm,D=d||E.width,k=h||E.height;C.tag==="pattern"&&(u?(k=1,D/=a.width):c&&(D=1,k/=a.height)),C.attrs.width=D,C.attrs.height=k,P&&(P.setAttribute("width",D),P.setAttribute("height",k))}},y=Th(p,null,e,function(C){l||m(x,C),m(f,C)});y&&y.width&&y.height&&(d=d||y.width,h=h||y.height)}f=yt("image","img",{href:p,width:d,height:h}),o.width=d,o.height=h}else i.svgElement&&(f=Be(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(f){var _,b;l?_=b=1:u?(b=1,_=o.width/a.width):c?(_=1,b=o.height/a.height):o.patternUnits="userSpaceOnUse",_!=null&&!isNaN(_)&&(o.width=_),b!=null&&!isNaN(b)&&(o.height=b);var w=z1(i);w&&(o.patternTransform=w);var x=yt("pattern","",o,[f]),T=lp(x),L=n.patternCache,M=L[T];M||(M=n.zrId+"-p"+n.patternIdx++,L[T]=M,o.id=M,x=n.defs[M]=yt("pattern",M,o,[f])),t[r]=Ol(M)}}function qA(e,t,r){var n=r.clipPathCache,i=r.defs,a=n[e.id];if(!a){a=r.zrId+"-c"+r.clipPathIdx++;var o={id:a};n[e.id]=a,i[a]=yt("clipPath",a,o,[U_(e,r)])}t["clip-path"]=Ol(a)}function j_(e){return document.createTextNode(e)}function ta(e,t,r){e.insertBefore(t,r)}function Q_(e,t){e.removeChild(t)}function K_(e,t){e.appendChild(t)}function J_(e){return e.parentNode}function e3(e){return e.nextSibling}function dp(e,t){e.textContent=t}var t3=58,ZA=120,jA=yt("","");function pp(e){return e===void 0}function an(e){return e!==void 0}function QA(e,t,r){for(var n={},i=t;i<=r;++i){var a=e[i].key;a!==void 0&&(process.env.NODE_ENV!=="production"&&n[a]!=null&&console.error("Duplicate key "+a),n[a]=i)}return n}function Os(e,t){var r=e.key===t.key,n=e.tag===t.tag;return n&&r}function Is(e){var t,r=e.children,n=e.tag;if(an(n)){var i=e.elm=O_(n);if(vp(jA,e),me(r))for(t=0;t<r.length;++t){var a=r[t];a!=null&&K_(i,Is(a))}else an(e.text)&&!xe(e.text)&&K_(i,j_(e.text))}else e.elm=j_(e.text);return e.elm}function r3(e,t,r,n,i){for(;n<=i;++n){var a=r[n];a!=null&&ta(e,Is(a),t)}}function Dc(e,t,r,n){for(;r<=n;++r){var i=t[r];if(i!=null)if(an(i.tag)){var a=J_(i.elm);Q_(a,i.elm)}else Q_(e,i.elm)}}function vp(e,t){var r,n=t.elm,i=e&&e.attrs||{},a=t.attrs||{};if(i!==a){for(r in a){var o=a[r],s=i[r];s!==o&&(o===!0?n.setAttribute(r,""):o===!1?n.removeAttribute(r):r==="style"?n.style.cssText=o:r.charCodeAt(0)!==ZA?n.setAttribute(r,o):r==="xmlns:xlink"||r==="xmlns"?n.setAttributeNS(AA,r,o):r.charCodeAt(3)===t3?n.setAttributeNS(kA,r,o):r.charCodeAt(5)===t3?n.setAttributeNS(P_,r,o):n.setAttribute(r,o))}for(r in i)r in a||n.removeAttribute(r)}}function KA(e,t,r){for(var n=0,i=0,a=t.length-1,o=t[0],s=t[a],l=r.length-1,u=r[0],c=r[l],f,d,h,p;n<=a&&i<=l;)o==null?o=t[++n]:s==null?s=t[--a]:u==null?u=r[++i]:c==null?c=r[--l]:Os(o,u)?(ao(o,u),o=t[++n],u=r[++i]):Os(s,c)?(ao(s,c),s=t[--a],c=r[--l]):Os(o,c)?(ao(o,c),ta(e,o.elm,e3(s.elm)),o=t[++n],c=r[--l]):Os(s,u)?(ao(s,u),ta(e,s.elm,o.elm),s=t[--a],u=r[++i]):(pp(f)&&(f=QA(t,n,a)),d=f[u.key],pp(d)?ta(e,Is(u),o.elm):(h=t[d],h.tag!==u.tag?ta(e,Is(u),o.elm):(ao(h,u),t[d]=void 0,ta(e,h.elm,o.elm))),u=r[++i]);(n<=a||i<=l)&&(n>a?(p=r[l+1]==null?null:r[l+1].elm,r3(e,p,r,i,l)):Dc(e,t,n,a))}function ao(e,t){var r=t.elm=e.elm,n=e.children,i=t.children;e!==t&&(vp(e,t),pp(t.text)?an(n)&&an(i)?n!==i&&KA(r,n,i):an(i)?(an(e.text)&&dp(r,""),r3(r,null,i,0,i.length-1)):an(n)?Dc(r,n,0,n.length-1):an(e.text)&&dp(r,""):e.text!==t.text&&(an(n)&&Dc(r,n,0,n.length-1),dp(r,t.text)))}function JA(e,t){if(Os(e,t))ao(e,t);else{var r=e.elm,n=J_(r);Is(t),n!==null&&(ta(n,t.elm,e3(r)),Dc(n,[e],0,0))}return t}var ek=0,tk=function(){function e(t,r,n){if(this.type="svg",this.refreshHover=n3("refreshHover"),this.configLayer=n3("configLayer"),this.storage=r,this._opts=n=se({},n),this.root=t,this._id="zr"+ek++,this._oldVNode=I_(n.width,n.height),t&&!n.ssr){var i=this._viewport=document.createElement("div");i.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=O_("svg");vp(null,this._oldVNode),i.appendChild(a),t.appendChild(i)}this.resize(n.width,n.height)}return e.prototype.getType=function(){return this.type},e.prototype.getViewportRoot=function(){return this._viewport},e.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},e.prototype.getSvgDom=function(){return this._svgDom},e.prototype.refresh=function(){if(this.root){var t=this.renderToVNode({willUpdate:!0});t.attrs.style="position:absolute;left:0;top:0;user-select:none",JA(this._oldVNode,t),this._oldVNode=t}},e.prototype.renderOneToVNode=function(t){return Y_(t,up(this._id))},e.prototype.renderToVNode=function(t){t=t||{};var r=this.storage.getDisplayList(!0),n=this._width,i=this._height,a=up(this._id);a.animation=t.animation,a.willUpdate=t.willUpdate,a.compress=t.compress,a.emphasis=t.emphasis,a.ssr=this._opts.ssr;var o=[],s=this._bgVNode=rk(n,i,this._backgroundColor,a);s&&o.push(s);var l=t.compress?null:this._mainVNode=yt("g","main",{},[]);this._paintList(r,a,l?l.children:o),l&&o.push(l);var u=ve(Ve(a.defs),function(d){return a.defs[d]});if(u.length&&o.push(yt("defs","defs",{},u)),t.animation){var c=OA(a.cssNodes,a.cssAnims,{newline:!0});if(c){var f=yt("style","stl",{},[],c);o.push(f)}}return I_(n,i,o,t.useViewBox)},e.prototype.renderToString=function(t){return t=t||{},lp(this.renderToVNode({animation:ye(t.cssAnimation,!0),emphasis:ye(t.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:ye(t.useViewBox,!0)}),{newline:!0})},e.prototype.setBackgroundColor=function(t){this._backgroundColor=t},e.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},e.prototype._paintList=function(t,r,n){for(var i=t.length,a=[],o=0,s,l,u=0,c=0;c<i;c++){var f=t[c];if(!f.invisible){var d=f.__clipPaths,h=d&&d.length||0,p=l&&l.length||0,v=void 0;for(v=Math.max(h-1,p-1);v>=0&&!(d&&l&&d[v]===l[v]);v--);for(var g=p-1;g>v;g--)o--,s=a[o-1];for(var m=v+1;m<h;m++){var y={};qA(d[m],y,r);var _=yt("g","clip-g-"+u++,y,[]);(s?s.children:n).push(_),a[o++]=_,s=_}l=d;var b=Y_(f,r);b&&(s?s.children:n).push(b)}}},e.prototype.resize=function(t,r){var n=this._opts,i=this.root,a=this._viewport;if(t!=null&&(n.width=t),r!=null&&(n.height=r),i&&a&&(a.style.display="none",t=xy(i,0,n),r=xy(i,1,n),a.style.display=""),this._width!==t||this._height!==r){if(this._width=t,this._height=r,a){var o=a.style;o.width=t+"px",o.height=r+"px"}if(Xf(this._backgroundColor))this.refresh();else{var s=this._svgDom;s&&(s.setAttribute("width",t),s.setAttribute("height",r));var l=this._bgVNode&&this._bgVNode.elm;l&&(l.setAttribute("width",t),l.setAttribute("height",r))}}},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e.prototype.dispose=function(){this.root&&(this.root.innerHTML=""),this._svgDom=this._viewport=this.storage=this._oldVNode=this._bgVNode=this._mainVNode=null},e.prototype.clear=function(){this._svgDom&&(this._svgDom.innerHTML=null),this._oldVNode=null},e.prototype.toDataURL=function(t){var r=this.renderToString(),n="data:image/svg+xml;";return t?(r=rb(r),r&&n+"base64,"+r):n+"charset=UTF-8,"+encodeURIComponent(r)},e}();function n3(e){return function(){process.env.NODE_ENV!=="production"&&ha('In SVG mode painter not support method "'+e+'"')}}function rk(e,t,r,n){var i;if(r&&r!=="none")if(i=yt("rect","bg",{width:e,height:t,x:"0",y:"0"}),R1(r))q_({fill:r},i.attrs,"fill",n);else if(Xf(r))Z_({style:{fill:r},dirty:er,getBoundingRect:function(){return{width:e,height:t}}},i.attrs,"fill",n);else{var a=Do(r),o=a.color,s=a.opacity;i.attrs.fill=o,s<1&&(i.attrs["fill-opacity"]=s)}return i}function nk(e){e.registerPainter("svg",tk)}const ik=({type:e,data:t,themeColors:r,textColor:n,lineColor:i,lineSmooth:a,stack:o})=>{const s=n?{color:n}:{},l=n?{lineStyle:{color:n}}:void 0,u=n?{color:n}:void 0,c=i?{lineStyle:{color:i}}:{},f=t.series.length>1?{top:"bottom",textStyle:s}:void 0;if(e==="bar")return{color:r,textStyle:s,legend:f,xAxis:{type:"category",data:t.labels,axisLine:l,axisLabel:u},yAxis:{type:"value",axisLine:l,axisLabel:u,splitLine:c},series:t.series.map((d,h)=>{const p={data:d,name:t.legends[h],type:"bar",label:{show:!0},itemStyle:{borderRadius:[2,2,0,0]}};return o&&(p.stack="A"),p})};if(e==="column")return{color:r,textStyle:s,legend:f,yAxis:{type:"category",data:t.labels,axisLine:l,axisLabel:u},xAxis:{type:"value",axisLine:l,axisLabel:u,splitLine:c},series:t.series.map((d,h)=>{const p={data:d,name:t.legends[h],type:"bar",label:{show:!0},itemStyle:{borderRadius:[0,2,2,0]}};return o&&(p.stack="A"),p})};if(e==="line")return{color:r,textStyle:s,legend:f,xAxis:{type:"category",data:t.labels,axisLine:l,axisLabel:u},yAxis:{type:"value",axisLine:l,axisLabel:u,splitLine:c},series:t.series.map((d,h)=>{const p={data:d,name:t.legends[h],type:"line",smooth:a,label:{show:!0}};return o&&(p.stack="A"),p})};if(e==="pie")return{color:r,textStyle:s,legend:{top:"bottom",textStyle:s},series:[{data:t.series[0].map((d,h)=>({value:d,name:t.labels[h]})),label:n?{color:n}:{},type:"pie",radius:"70%",emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"},label:{show:!0,fontSize:14,fontWeight:"bold"}}}]};if(e==="ring")return{color:r,textStyle:s,legend:{top:"bottom",textStyle:s},series:[{data:t.series[0].map((d,h)=>({value:d,name:t.labels[h]})),label:n?{color:n}:{},type:"pie",radius:["40%","70%"],padAngle:1,avoidLabelOverlap:!1,itemStyle:{borderRadius:4},emphasis:{label:{show:!0,fontSize:14,fontWeight:"bold"}}}]};if(e==="area")return{color:r,textStyle:s,legend:f,xAxis:{type:"category",boundaryGap:!1,data:t.labels,axisLine:l,axisLabel:u},yAxis:{type:"value",axisLine:l,axisLabel:u,splitLine:c},series:t.series.map((d,h)=>{const p={data:d,name:t.legends[h],type:"line",areaStyle:{},label:{show:!0}};return o&&(p.stack="A"),p})};if(e==="radar")return{color:r,textStyle:s,legend:f,radar:{indicator:t.labels.map(d=>({name:d})),splitLine:c,axisLine:i?{lineStyle:{color:i}}:void 0},series:[{data:t.series.map((d,h)=>({value:d,name:t.legends[h]})),type:"radar"}]};if(e==="scatter"){const d=[];for(let h=0;h<t.series[0].length;h++){const p=t.series[0][h],v=t.series[1]?t.series[1][h]:p;d.push([p,v])}return{color:r,textStyle:s,xAxis:{axisLine:l,axisLabel:u,splitLine:c},yAxis:{axisLine:l,axisLabel:u,splitLine:c},series:[{symbolSize:12,data:d,type:"scatter"}]}}return null},ak={chart:"_chart_1g0qq_1"};ji([jC,IC,oD,rA,hA,xA,nk]);const i3=({width:e,height:t,type:r,data:n,themeColors:i,textColor:a,lineColor:o,options:s})=>{const l=S.useRef(null),u=S.useRef(null),c=S.useMemo(()=>{let d=[];if(i.length>=10)d=i;else if(i.length===1)d=Je(i[0]).analogous(10).map(h=>h.toRgbString());else{const h=i.length,p=Je(i[h-1]).analogous(11-h).map(v=>v.toRgbString());d=[...i.slice(0,h-1),...p]}return d},[i]),f=S.useCallback(()=>{if(!u.current)return;const d=ik({type:r,data:n,themeColors:c,textColor:a,lineColor:o,lineSmooth:(s==null?void 0:s.lineSmooth)||!1,stack:(s==null?void 0:s.stack)||!1});d&&u.current.setOption(d,!0)},[r,n,c,a,o,s]);return S.useEffect(()=>{if(!l.current)return;u.current=NE(l.current,null,{renderer:"svg"}),f();const d=()=>{var p;return(p=u.current)==null?void 0:p.resize()},h=new ResizeObserver(d);return h.observe(l.current),()=>{var p;h.disconnect(),(p=u.current)==null||p.dispose(),u.current=null}},[]),S.useEffect(()=>{f()},[f]),S.createElement("div",{className:ak.chart,ref:l})},gp={editableElementChart:"_editableElementChart_1i7hz_1",rotateWrapper:"_rotateWrapper_1i7hz_5",elementContent:"_elementContent_1i7hz_10"},ok=({elementInfo:e,selectElement:t,contextmenus:r})=>{const n=S.useRef(null),i=o=>{o.stopPropagation(),t==null||t(o.nativeEvent,e)},a=()=>{ca.emit(vi.OPEN_CHART_DATA_EDITOR)};return Hr(n,()=>(r==null?void 0:r())||[]),S.createElement("div",{className:gp.editableElementChart,style:{top:e.top+"px",left:e.left+"px",width:e.width+"px",height:e.height+"px"}},S.createElement("div",{className:gp.rotateWrapper,style:{transform:`rotate(${e.rotate}deg)`}},S.createElement("div",{ref:n,className:gp.elementContent,style:{backgroundColor:e.fill},onMouseDown:i,onTouchStart:i,onDoubleClick:a},S.createElement(pl,{width:e.width,height:e.height,outline:e.outline}),S.createElement(i3,{width:e.width,height:e.height,type:e.chartType,data:e.data,themeColors:e.themeColors,textColor:e.textColor,lineColor:e.lineColor,options:e.options}))))},a3=e=>{if(!e)return{};const{bold:t,em:r,underline:n,strikethrough:i,color:a,backcolor:o,fontsize:s,fontname:l,align:u}=e;let c=`${n?"underline":""} ${i?"line-through":""}`;return c.trim()===""&&(c="none"),{fontWeight:t?"bold":"normal",fontStyle:r?"italic":"normal",textDecoration:c,color:a||"#000",backgroundColor:o||"",fontSize:s||"14px",fontFamily:l||"",textAlign:u||"left"}},o3=e=>e.replace(/\n/g,"</br>").replace(/ /g,"&nbsp;"),s3=e=>({hideCells:S.useMemo(()=>{const r=[];for(let n=0;n<e.length;n++){const i=e[n];for(let a=0;a<i.length;a++){const o=i[a];if(o.colspan>1||o.rowspan>1)for(let s=n;s<n+o.rowspan;s++)for(let l=s===n?a+1:a;l<a+o.colspan;l++)r.push(`${s}_${l}`)}}return r},[e])}),l3=e=>({subThemeColor:S.useMemo(()=>e?_v(e.color):["",""],[e])}),sk={customTextarea:"_customTextarea_15hzl_1"},lk=({value:e,className:t,style:r,onUpdateValue:n,onInsertExcelData:i})=>{const a=S.useRef(null),o=S.useRef(!1);S.useEffect(()=>{o.current||!a.current||a.current.innerHTML!==e&&(a.current.innerHTML=e)},[e]);const s=()=>{if(!a.current)return;const f=a.current.innerHTML;n(f)},l=()=>{o.current=!0},u=f=>{if(f.preventDefault(),!f.clipboardData)return;const d=f.clipboardData.items[0];d&&d.kind==="string"&&(d.type==="text/plain"?d.getAsString(h=>{if(typeof mv(h)=="object")return;const v=Z7(h);if(v){i(v),a.current&&(a.current.innerHTML=v[0][0]);return}document.execCommand("insertText",!1,h)}):d.type==="text/html"&&d.getAsString(h=>{const p=j7(h);p&&(i(p),a.current&&(a.current.innerHTML=p[0][0]))}))},c=()=>{o.current=!1};return S.createElement("div",{className:Me(sk.customTextarea,t),style:r,ref:a,contentEditable:!0,onFocus:l,onBlur:c,onInput:s,onPaste:u,dangerouslySetInnerHTML:{__html:e}})},Bt={editableTable:"_editableTable_exzav_1",theme:"_theme_exzav_19",cell:"_cell_exzav_22",rowHeader:"_rowHeader_exzav_28",rowFooter:"_rowFooter_exzav_31",colHeader:"_colHeader_exzav_34",colFooter:"_colFooter_exzav_37",selected:"_selected_exzav_49",cellText:"_cellText_exzav_58",active:"_active_exzav_64",dragLine:"_dragLine_exzav_68"},uk=({data:e,width:t,cellMinHeight:r,colWidths:n,outline:i,theme:a,editable:o=!0,onChange:s,onChangeColWidths:l,onChangeSelectedCells:u,onMouseDown:c,contextmenus:f})=>{const{canvasScale:d,setSelectedTableCells:h}=_e(),[p,v]=S.useState(!1),[g,m]=S.useState([]),[y,_]=S.useState([]),[b,w]=S.useState([]);S.useEffect(()=>{w(n.map(U=>U*t))},[n,t]);const x=S.useMemo(()=>b.reduce((U,X)=>U+X,0),[b]),{hideCells:T}=s3(e),{subThemeColor:L}=l3(a),M=S.useMemo(()=>a?{"--themeColor":a.color,"--subThemeColor1":L[0],"--subThemeColor2":L[1]}:{},[a,L]);S.useEffect(()=>{o||(m([]),_([]))},[o]);const C=S.useMemo(()=>{const U=[];for(let X=1;X<b.length+1;X++){const ee=b.slice(0,X).reduce((J,ce)=>J+ce,0);U.push(ee)}return U},[b]),E=S.useMemo(()=>{if(!g.length)return[];const[U,X]=g;if(!y.length)return[`${U}_${X}`];const[ee,J]=y;if(U===ee&&X===J)return[`${U}_${X}`];const ce=[],de=Math.min(U,ee),pe=Math.min(X,J),qe=Math.max(U,ee),et=Math.max(X,J);for(let He=0;He<e.length;He++){const Ct=e[He];for(let Rt=0;Rt<Ct.length;Rt++)He>=de&&He<=qe&&Rt>=pe&&Rt<=et&&ce.push(`${He}_${Rt}`)}return ce},[g,y,e]);S.useEffect(()=>{u(E),h(E)},[E,u,h]);const P=S.useMemo(()=>E.length>1?null:E[0]||null,[E]),D=S.useCallback(()=>v(!1),[]);S.useEffect(()=>(document.addEventListener("mouseup",D),()=>{document.removeEventListener("mouseup",D)}),[D]);const k=(U,X,ee)=>{U.button===0&&(_([]),v(!0),m([X,ee]))},N=(U,X)=>{p&&_([U,X])},I=(U,X)=>T.includes(`${U}_${X}`),O=U=>{const X=JSON.parse(JSON.stringify(e)),ee=[];for(let J=0;J<X[0].length;J++)ee.push({colspan:1,rowspan:1,text:"",id:ze.nanoid(10)});X.splice(U,0,ee),s(X)},z=U=>{const X=e.map(J=>{const ce={colspan:1,rowspan:1,text:"",id:ze.nanoid(10)},de=[...J];return de.splice(U,0,ce),de}),ee=[...b];ee.splice(U,0,100),s(X),l(ee)},$=U=>{const X=JSON.parse(JSON.stringify(e)),ee=e[U],J=[];for(let ce=0;ce<ee.length;ce++)I(U,ce)&&J.push(ce);for(const ce of J)for(let de=U;de>=0;de--)if(!I(de,ce)){X[de][ce].rowspan=X[de][ce].rowspan-1;break}X.splice(U,1),s(X)},R=U=>{const X=JSON.parse(JSON.stringify(e)),ee=[];for(let de=0;de<e.length;de++)I(de,U)&&ee.push(de);for(const de of ee)for(let pe=U;pe>=0;pe--)if(!I(de,pe)){X[de][pe].colspan=X[de][pe].colspan-1;break}const J=X.map(de=>(de.splice(U,1),de)),ce=[...b];ce.splice(U,1),s(J),l(ce)},B=()=>{const[U,X]=g,[ee,J]=y,ce=Math.min(U,ee),de=Math.min(X,J),pe=Math.max(U,ee),qe=Math.max(X,J),et=JSON.parse(JSON.stringify(e));et[ce][de].rowspan=pe-ce+1,et[ce][de].colspan=qe-de+1,s(et),m([]),_([])},H=(U,X)=>{const ee=JSON.parse(JSON.stringify(e));ee[U][X].rowspan=1,ee[U][X].colspan=1,s(ee),m([]),_([])},F=U=>{const X=e.length-1;m([0,U]),_([X,U])},A=U=>{const X=e[U].length-1;m([U,0]),_([U,X])},G=()=>{const U=e.length-1,X=e[U].length-1;m([0,0]),_([U,X])},Z=()=>{const U=JSON.parse(JSON.stringify(e));for(let X=0;X<U.length;X++)for(let ee=0;ee<U[X].length;ee++)E.includes(`${X}_${ee}`)&&(U[X][ee].text="");s(U)},Q=()=>{requestAnimationFrame(()=>{const U=document.querySelector(`.${Bt.cellText}.${Bt.active}`);U&&U.focus()})},q=()=>{const U=(ce,de)=>e[ce]?e[ce][de]?I(ce,de)?U(ce,de+1):[ce,de]:U(ce+1,0):null;_([]);const X=g[0],ee=g[1]+1,J=U(X,ee);J?m(J):(O(X+1),m([X+1,0])),Q()},W=U=>{var ee;const X=window.getSelection();if(X&&X.rangeCount>0){const J=X.getRangeAt(0),ce=J.cloneRange();ce.selectNodeContents(U),ce.setEnd(J.startContainer,J.startOffset);const de=ce.toString().length;ce.setEnd(J.endContainer,J.endOffset);const pe=ce.toString().length,qe=((ee=U.textContent)==null?void 0:ee.length)||0;return{start:de,end:pe,len:qe}}return null},j=U=>{const X=+E[0].split("_")[0],ee=+E[0].split("_")[1],J=e.length,ce=e[0].length,de=pe=>{if(pe[0]<0||pe[1]<0||pe[0]>J-1||pe[1]>ce-1)return[0,0];const qe=`${pe[0]}_${pe[1]}`;return T.includes(qe)?U==="UP"?de([pe[0],pe[1]-1]):U==="DOWN"?de([pe[0],pe[1]-1]):U==="LEFT"?de([pe[0]-1,pe[1]]):U==="RIGHT"?de([pe[0]-1,pe[1]]):[0,0]:pe};if(U==="UP"){const pe=X-1;if(pe<0)return;_([]),m(de([pe,ee]))}else if(U==="DOWN"){const pe=X+1;if(pe>J-1)return;_([]),m(de([pe,ee]))}else if(U==="LEFT"){const pe=ee-1;if(pe<0)return;_([]),m(de([X,pe]))}else if(U==="RIGHT"){const pe=ee+1;if(pe>ce-1)return;_([]),m(de([X,pe]))}Q()},Y=()=>{const U=[];for(let X=0;X<e.length;X++){const ee=e[X],J=[];for(let ce=0;ce<ee.length;ce++)I(X,ce)||J.push(ee[ce]);J.length&&U.push(J)}return U},re=()=>{const U=Y(),X=U.length>1,ee=U[0].length>1;return{canDeleteRow:X,canDeleteCol:ee}},te=(U,X)=>{const ee=E.length>1,J=e[U][X],ce=ee,de=!ee&&(J.rowspan>1||J.colspan>1);return{canMerge:ce,canSplit:de}},ne=(U,X,ee)=>{U.preventDefault(),U.stopPropagation();const J=document.getElementById("global-contextmenu-container");J&&document.body.removeChild(J);const ce=document.createElement("div");ce.id="global-contextmenu-container",document.body.appendChild(ce);const de=tv.createRoot(ce),pe=()=>{setTimeout(()=>{de.unmount(),document.body.contains(ce)&&document.body.removeChild(ce),X.classList.remove("contextmenu-active"),document.body.removeEventListener("scroll",pe),window.removeEventListener("resize",pe)},0)};de.render(S.createElement(Pv,{axis:{x:U.clientX,y:U.clientY},el:X,menus:ee,removeContextmenu:pe})),X.classList.add("contextmenu-active"),document.body.addEventListener("scroll",pe),window.addEventListener("resize",pe)};S.useEffect(()=>{const U=X=>{if(!o||!E.length)return;const ee=X.key.toUpperCase();if(E.length<2){if(ee===ft.TAB)X.preventDefault(),q();else if(X.ctrlKey&&ee===ft.UP){X.preventDefault();const J=+E[0].split("_")[0];O(J)}else if(X.ctrlKey&&ee===ft.DOWN){X.preventDefault();const J=+E[0].split("_")[0];O(J+1)}else if(X.ctrlKey&&ee===ft.LEFT){X.preventDefault();const J=+E[0].split("_")[1];z(J)}else if(X.ctrlKey&&ee===ft.RIGHT){X.preventDefault();const J=+E[0].split("_")[1];z(J+1)}else if(ee===ft.UP){const J=W(X.target);J&&J.start===J.end&&J.start===0&&j("UP")}else if(ee===ft.DOWN){const J=W(X.target);J&&J.start===J.end&&J.start===J.len&&j("DOWN")}else if(ee===ft.LEFT){const J=W(X.target);J&&J.start===J.end&&J.start===0&&j("LEFT")}else if(ee===ft.RIGHT){const J=W(X.target);J&&J.start===J.end&&J.start===J.len&&j("RIGHT")}}else ee===ft.DELETE&&Z()};return document.addEventListener("keydown",U),()=>{document.removeEventListener("keydown",U)}},[o,E,e,s]);const ge=(U,X)=>{U.stopPropagation(),m([]),_([]);let ee=!0;const J=b[X],ce=U.pageX,de=50,pe=et=>{if(!ee)return;const He=(et.pageX-ce)/d,Ct=J+He<de?de:Math.round(J+He),Rt=[...b];Rt[X]=Ct,w(Rt)},qe=()=>{ee=!1,document.removeEventListener("mousemove",pe),document.removeEventListener("mouseup",qe),l(Se.current)};document.addEventListener("mousemove",pe),document.addEventListener("mouseup",qe)},Se=S.useRef(b);S.useEffect(()=>{Se.current=b},[b]);const ie=(U,X,ee)=>{const J=JSON.parse(JSON.stringify(e));J[X][ee].text=U,s(J)},Ee=S.useMemo(()=>Gt.debounce(ie,300,{trailing:!0}),[e,s]),K=(U,X,ee)=>{const J=U.length,ce=U[0].length;let de=0,pe=0;if(X+J>e.length&&(de=X+J-e.length),ee+ce>e[0].length&&(pe=ee+ce-e[0].length),de||pe){let qe=JSON.parse(JSON.stringify(e));const et={colspan:1,rowspan:1,text:""};if(de){const He=[];for(let Ct=0;Ct<de;Ct++){const Rt=[];for(let ue=0;ue<qe[0].length;ue++)Rt.push({...et,id:ze.nanoid(10)});He.push(Rt)}qe=[...qe,...He]}if(pe){qe=qe.map(Ct=>{const Rt=[];for(let ue=0;ue<pe;ue++){const lr={...et,id:ze.nanoid(10)};Rt.push(lr)}return[...Ct,...Rt]});const He=[...b,...new Array(pe).fill(100)];w(He),l(He)}s(qe)}requestAnimationFrame(()=>{const qe=JSON.parse(JSON.stringify(e));for(let et=0;et<J;et++)for(let He=0;He<ce;He++)qe[X+et]&&qe[X+et][ee+He]&&(qe[X+et][ee+He].text=U[et][He]);s(qe)})},le=(U,X,ee)=>{const J=U.currentTarget;E.includes(`${X}_${ee}`)||(m([X,ee]),_([]));const{canMerge:ce,canSplit:de}=te(X,ee),{canDeleteRow:pe,canDeleteCol:qe}=re(),et=[{text:"插入列",children:[{text:"到左侧",handler:()=>z(ee)},{text:"到右侧",handler:()=>z(ee+1)}]},{text:"插入行",children:[{text:"到上方",handler:()=>O(X)},{text:"到下方",handler:()=>O(X+1)}]},{text:"删除列",disable:!qe,handler:()=>R(ee)},{text:"删除行",disable:!pe,handler:()=>$(X)},{divider:!0},{text:"合并单元格",disable:!ce,handler:B},{text:"取消合并单元格",disable:!de,handler:()=>H(X,ee)},{divider:!0},{text:"选中当前列",handler:()=>F(ee)},{text:"选中当前行",handler:()=>A(X)},{text:"选中全部单元格",handler:G}],He=f?f(J)||[]:[],Ct=[...et,...He||[]];Ct.length&&ne(U,J,Ct)};return S.createElement("div",{className:Bt.editableTable,style:{width:x+"px"},onMouseDown:c},o&&S.createElement("div",{className:Bt.handler},C.map((U,X)=>S.createElement("div",{key:X,className:Bt.dragLine,style:{left:U+"px"},onMouseDown:ee=>ge(ee,X)}))),S.createElement("table",{className:Me({[Bt.theme]:a,[Bt.rowHeader]:a==null?void 0:a.rowHeader,[Bt.rowFooter]:a==null?void 0:a.rowFooter,[Bt.colHeader]:a==null?void 0:a.colHeader,[Bt.colFooter]:a==null?void 0:a.colFooter}),style:M},S.createElement("colgroup",null,b.map((U,X)=>S.createElement("col",{key:X,span:1,width:U}))),S.createElement("tbody",null,e.map((U,X)=>S.createElement("tr",{key:X,style:{height:r+"px"}},U.map((ee,J)=>{if(T.includes(`${X}_${J}`))return null;const ce=E.includes(`${X}_${J}`)&&E.length>1,de=P===`${X}_${J}`;return S.createElement("td",{key:ee.id,className:Me(Bt.cell,{[Bt.selected]:ce,[Bt.active]:de}),style:{borderStyle:i.style,borderColor:i.color,borderWidth:i.width+"px",...a3(ee.style)},rowSpan:ee.rowspan,colSpan:ee.colspan,"data-cell-index":`${X}_${J}`,onMouseDown:pe=>k(pe,X,J),onMouseEnter:()=>N(X,J),onContextMenu:pe=>le(pe,X,J)},de?S.createElement(lk,{className:Me(Bt.cellText,{[Bt.active]:!0}),style:{minHeight:r-4+"px"},value:ee.text,onUpdateValue:pe=>Ee(pe,X,J),onInsertExcelData:pe=>K(pe,X,J)}):S.createElement("div",{className:Bt.cellText,style:{minHeight:r-4+"px"},dangerouslySetInnerHTML:{__html:o3(ee.text)}}))}))))))},Bs={editableElementTable:"_editableElementTable_gxw12_1",rotateWrapper:"_rotateWrapper_gxw12_5",elementContent:"_elementContent_gxw12_10",tableMask:"_tableMask_gxw12_17",maskTip:"_maskTip_gxw12_26"},ck=({elementInfo:e,selectElement:t,contextmenus:r})=>{const n=e,{canvasScale:i,handleElementId:a,isScaling:o,setDisableHotkeysState:s,setSelectedTableCells:l}=_e(),{updateElement:u}=ke(),{addHistorySnapshot:c}=wt(),f=S.useRef(null),d=S.useRef(null),[h,p]=S.useState(!1),v=S.useRef(-1),g=(x,T=!0)=>{x.stopPropagation(),t==null||t(x.nativeEvent,n,T)};S.useEffect(()=>{a!==n.id&&p(!1)},[a,n.id]),S.useEffect(()=>{s(h)},[h,s]);const m=()=>{p(!0)};S.useEffect(()=>{a===n.id&&(o&&p(!1),!o&&v.current!==-1&&(u({id:n.id,props:{height:v.current}}),v.current=-1))},[o,a,n.id,u]);const y=S.useCallback(x=>{const T=x[0].contentRect;if(!f.current)return;const L=T.height;n.height!==L&&(o?v.current=L:u({id:n.id,props:{height:L}}))},[n.height,n.id,o,u]);S.useEffect(()=>{const x=new ResizeObserver(y);return f.current&&x.observe(f.current),()=>{f.current&&x.unobserve(f.current),x.disconnect()}},[y]);const _=x=>{u({id:n.id,props:{data:x}}),c()},b=x=>{const T=x.reduce((M,C)=>M+C),L=x.map(M=>M/T);u({id:n.id,props:{width:T,colWidths:L}}),c()},w=x=>{setTimeout(()=>l(x),0)};return Hr(d,()=>(r==null?void 0:r())||[]),S.createElement("div",{className:Bs.editableElementTable,ref:f,style:{top:n.top+"px",left:n.left+"px",width:n.width+"px"}},S.createElement("div",{className:Bs.rotateWrapper,style:{transform:`rotate(${n.rotate}deg)`}},S.createElement("div",{ref:d,className:Bs.elementContent},S.createElement(uk,{data:n.data,width:n.width,cellMinHeight:n.cellMinHeight,colWidths:n.colWidths,outline:n.outline,theme:n.theme,editable:h,onChange:_,onChangeColWidths:b,onChangeSelectedCells:w,onMouseDown:x=>x.stopPropagation()}),!h&&S.createElement("div",{className:Bs.tableMask,onDoubleClick:m,onMouseDown:g,onTouchStart:g},a===n.id&&S.createElement("div",{className:Bs.maskTip,style:{transform:`scale(${1/i})`}},"双击编辑")))))},mp={editableElementLatex:"_editableElementLatex_106e3_1",rotateWrapper:"_rotateWrapper_106e3_5",elementContent:"_elementContent_106e3_10"},fk=({elementInfo:e,selectElement:t,contextmenus:r})=>{const n=S.useRef(null),i=o=>{o.stopPropagation(),t==null||t(o.nativeEvent,e)},a=()=>{ca.emit(vi.OPEN_LATEX_EDITOR)};return Hr(n,()=>(r==null?void 0:r())||[]),S.createElement("div",{className:mp.editableElementLatex,style:{top:e.top+"px",left:e.left+"px",width:e.width+"px",height:e.height+"px"}},S.createElement("div",{className:mp.rotateWrapper,style:{transform:`rotate(${e.rotate}deg)`}},S.createElement("div",{ref:n,className:mp.elementContent,onMouseDown:i,onTouchStart:i,onDoubleClick:a},S.createElement("svg",{overflow:"visible",width:e.width,height:e.height,stroke:e.color,strokeWidth:e.strokeWidth,fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},S.createElement("g",{transform:`scale(${e.width/e.viewBox[0]}, ${e.height/e.viewBox[1]}) translate(0,0) matrix(1,0,0,1,0,0)`},S.createElement("path",{d:e.path}))))))},hk=(e,t)=>{S.useEffect(()=>{if(!t.current)return;let r="normal";if(/m3u8(#|\?|$)/i.exec(e)?r="hls":/.flv(#|\?|$)/i.exec(e)&&(r="flv"),t.current&&r==="hls"&&(t.current.canPlayType("application/x-mpegURL")||t.current.canPlayType("application/vnd.apple.mpegURL"))&&(r="normal"),r==="hls"){const n=window.Hls;if(n&&n.isSupported()){const i=new n;return i.loadSource(e),i.attachMedia(t.current),()=>{i.destroy()}}}else if(r==="flv"){const n=window.flvjs;if(n&&n.isSupported()){const i=n.createPlayer({type:"flv",url:e});return i.attachMediaElement(t.current),i.load(),()=>{i.destroy()}}}},[e,t])},Te={videoPlayer:"_videoPlayer_17n95_1",hideController:"_hideController_17n95_8",controllerMask:"_controllerMask_17n95_11",controller:"_controller_17n95_11",videoWrap:"_videoWrap_17n95_20",bgCanvas:"_bgCanvas_17n95_27",video:"_video_17n95_1",loadError:"_loadError_17n95_43",barWrap:"_barWrap_17n95_79",bar:"_bar_17n95_79",played:"_played_17n95_87",thumb:"_thumb_17n95_87",barTime:"_barTime_17n95_90",barTimeHidden:"_barTimeHidden_17n95_107",loaded:"_loaded_17n95_117",icons:"_icons_17n95_150",time:"_time_17n95_157",icon:"_icon_17n95_150",playIcon:"_playIcon_17n95_174",iconContent:"_iconContent_17n95_177",loopIcon:"_loopIcon_17n95_182",speedIcon:"_speedIcon_17n95_188",speedMenu:"_speedMenu_17n95_192",speedMenuItem:"_speedMenuItem_17n95_201",volume:"_volume_17n95_212",volumeBarWrap:"_volumeBarWrap_17n95_219",volumeBar:"_volumeBar_17n95_219",volumeBarInner:"_volumeBarInner_17n95_222",volumeActive:"_volumeActive_17n95_225",loop:"_loop_17n95_182",iconsRight:"_iconsRight_17n95_272",speedMenuItemActive:"_speedMenuItemActive_17n95_275",iconActive:"_iconActive_17n95_279",bezel:"_bezel_17n95_283",bezelIcon:"_bezelIcon_17n95_294",bezelTransition:"_bezelTransition_17n95_311","bezel-hide":"_bezel-hide_17n95_1"},dk=({width:e,height:t,src:r,poster:n="",autoplay:i=!1,scale:a=1})=>{const o=S.useRef(null),s=S.useRef(null),l=S.useRef(null),u=S.useRef(null),[c,f]=S.useState(.5),[d,h]=S.useState(!0),[p,v]=S.useState(0),[g,m]=S.useState(0),[y,_]=S.useState(0),[b,w]=S.useState(!1),[x,T]=S.useState(!1),[L,M]=S.useState(1),[C,E]=S.useState(!1),[P,D]=S.useState(!1),[k,N]=S.useState("00:00"),[I,O]=S.useState("0"),[z,$]=S.useState(!1),[R,B]=S.useState(!1);hk(r,o);const H=(ue=0)=>{if(ue===0||isNaN(ue))return"00:00";const lr=ev=>ev<10?"0"+ev:""+ev,Dt=Math.floor(ue/3600),Tn=Math.floor((ue-Dt*3600)/60),b7=Math.floor(ue-Dt*3600-Tn*60);return(Dt>0?[Dt,Tn,b7]:[Tn,b7]).map(lr).join(":")},F=S.useMemo(()=>H(p),[p]),A=S.useMemo(()=>H(g),[g]),G=S.useMemo(()=>(g?p/g*100:0)+"%",[p,g]),Z=S.useMemo(()=>(g?y/g*100:0)+"%",[y,g]),Q=S.useMemo(()=>c*100+"%",[c]),q=[{label:"2x",value:2},{label:"1.5x",value:1.5},{label:"1.25x",value:1.25},{label:"1x",value:1},{label:"0.75x",value:.75},{label:"0.5x",value:.5}],W=S.useRef(null),j=S.useCallback(()=>{B(!1),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{o.current&&!o.current.paused&&B(!0)},3e3)},[]),Y=()=>{o.current&&(h(!1),o.current.play(),T(!0),j())},re=()=>{o.current&&(h(!0),o.current.pause(),T(!0),j())},te=()=>{d?Y():re()},ne=ue=>{o.current&&(ue=Math.max(ue,0),ue=Math.min(ue,g),o.current.currentTime=ue,v(ue))},ge=ue=>{o.current&&(ue=Math.max(ue,0),ue=Math.min(ue,1),o.current.volume=ue,f(ue),o.current.muted&&ue!==0&&(o.current.muted=!1))},Se=ue=>{o.current&&(o.current.playbackRate=ue),M(ue)},ie=()=>{o.current&&(o.current.muted?(o.current.muted=!1,ge(.5)):(o.current.muted=!0,ge(0)))},Ee=()=>{w(!b)},K=()=>{var ue;return m(((ue=o.current)==null?void 0:ue.duration)||0)},le=()=>{var ue;return v(((ue=o.current)==null?void 0:ue.currentTime)||0)},U=()=>{b?(ne(0),Y()):re()},X=()=>{o.current&&o.current.buffered.length&&_(o.current.buffered.end(o.current.buffered.length-1))},ee=()=>E(!0),J=ue=>ue.getBoundingClientRect().left,ce=S.useCallback(ue=>{if(!o.current||!s.current)return;let Dt=(("clientX"in ue?ue.clientX:ue.changedTouches[0].clientX)-J(s.current))/s.current.clientWidth;Dt=Math.max(Dt,0),Dt=Math.min(Dt,1);const Tn=Dt*g;o.current.currentTime=Tn,v(Tn)},[g]),de=S.useCallback(ue=>{ce(ue),document.removeEventListener("mousemove",ce),document.removeEventListener("touchmove",ce),document.removeEventListener("mouseup",de),document.removeEventListener("touchend",de)},[ce]),pe=()=>{document.addEventListener("mousemove",ce),document.addEventListener("touchmove",ce),document.addEventListener("mouseup",de),document.addEventListener("touchend",de)},qe=ue=>{if(g&&s.current){const lr=s.current.getBoundingClientRect().left,Dt=ue.clientX-lr;if(Dt<0||Dt>s.current.offsetWidth)return;const Tn=g*(Dt/s.current.offsetWidth);O(`${Dt-(Tn>=3600?25:20)}px`),N(H(Tn)),D(!0)}},et=S.useCallback(ue=>{if(!l.current)return;const Dt=(("clientX"in ue?ue.clientX:ue.changedTouches[0].clientX)-J(l.current))/45;ge(Dt)},[]),He=S.useCallback(()=>{document.removeEventListener("mousemove",et),document.removeEventListener("touchmove",et),document.removeEventListener("mouseup",He),document.removeEventListener("touchend",He)},[et]),Ct=()=>{document.addEventListener("mousemove",et),document.addEventListener("touchmove",et),document.addEventListener("mouseup",He),document.addEventListener("touchend",He)},Rt=ue=>{if(!l.current)return;const lr=(ue.clientX-J(l.current))/45;ge(lr)};return S.useEffect(()=>{if(!u.current||!o.current)return;const ue=u.current.getContext("2d");if(!ue)return;const lr=()=>{o.current.requestVideoFrameCallback(()=>{o.current&&u.current&&ue.drawImage(o.current,0,0,u.current.width,u.current.height)})};o.current.addEventListener("loadedmetadata",lr,{once:!0})},[]),S.createElement("div",{className:Me(Te.videoPlayer,{[Te.hideController]:R}),style:{width:e*a+"px",height:t*a+"px",transform:`scale(${1/a})`},onMouseMove:j,onClick:j},S.createElement("div",{className:Te.videoWrap,onClick:te},C&&S.createElement("div",{className:Te.loadError},"视频加载失败"),S.createElement("canvas",{ref:u,className:Te.bgCanvas}),S.createElement("video",{className:Te.video,ref:o,src:r,autoPlay:i,poster:n,playsInline:!0,crossOrigin:"anonymous",onDurationChange:K,onTimeUpdate:le,onEnded:U,onProgress:X,onPlay:()=>{j(),h(!1)},onPause:()=>j(),onError:ee}),S.createElement("div",{className:Te.bezel},S.createElement("span",{className:Me(Te.bezelIcon,{[Te.bezelTransition]:x}),onAnimationEnd:()=>T(!1)},d?S.createElement(At.Pause,null):S.createElement(At.PlayOne,null)))),S.createElement("div",{className:Te.controllerMask}),S.createElement("div",{className:Te.controller},S.createElement("div",{className:Te.icons},S.createElement("div",{className:Me(Te.icon,Te.playIcon),onClick:ue=>{ue.stopPropagation(),te()}},S.createElement("span",{className:Te.iconContent},d?S.createElement(At.PlayOne,null):S.createElement(At.Pause,null))),S.createElement("div",{className:Te.volume},S.createElement("div",{className:Me(Te.icon,Te.volumeIcon),onClick:ue=>{ue.stopPropagation(),ie()}},S.createElement("span",{className:Te.iconContent},c===0?S.createElement(At.VolumeMute,null):c===1?S.createElement(At.VolumeNotice,null):S.createElement(At.VolumeSmall,null))),S.createElement("div",{className:Te.volumeBarWrap,onMouseDown:ue=>{ue.stopPropagation(),Ct()},onTouchStart:ue=>{ue.stopPropagation(),Ct()},onClick:ue=>{ue.stopPropagation(),Rt(ue)}},S.createElement("div",{className:Te.volumeBar,ref:l},S.createElement("div",{className:Te.volumeBarInner,style:{width:Q}},S.createElement("span",{className:Te.thumb}))))),S.createElement("span",{className:Te.time},S.createElement("span",{className:Te.ptime},F)," /"," ",S.createElement("span",{className:Te.dtime},A))),S.createElement("div",{className:Me(Te.icons,Te.iconsRight)},S.createElement("div",{className:Te.speed},S.createElement("div",{className:Me(Te.icon,Te.speedIcon),onMouseLeave:()=>$(!1)},S.createElement("span",{className:Te.iconContent,onClick:ue=>{ue.stopPropagation(),$(!z)}},L===1?"倍速":L+"x"),z&&S.createElement("div",{className:Te.speedMenu},q.map(ue=>S.createElement("div",{key:ue.label,className:Me(Te.speedMenuItem,{[Te.speedMenuItemActive]:ue.value===L}),onClick:lr=>{lr.stopPropagation(),Se(ue.value),$(!1)}},ue.label))))),S.createElement("div",{className:Te.loop,onClick:ue=>{ue.stopPropagation(),Ee()}},S.createElement("div",{className:Me(Te.icon,Te.loopIcon,{[Te.iconActive]:b})},S.createElement("span",{className:Te.iconContent},"循环",b?"开":"关")))),S.createElement("div",{className:Te.barWrap,ref:s,onMouseDown:ue=>{ue.stopPropagation(),pe()},onTouchStart:ue=>{ue.stopPropagation(),pe()},onMouseMove:qe,onMouseEnter:()=>D(!0),onMouseLeave:()=>D(!1),onClick:ue=>ue.stopPropagation()},S.createElement("div",{className:Me(Te.barTime,{[Te.barTimeHidden]:!P}),style:{left:I}},k),S.createElement("div",{className:Te.bar},S.createElement("div",{className:Te.loaded,style:{width:Z}}),S.createElement("div",{className:Te.played,style:{width:G}},S.createElement("span",{className:Te.thumb}))))))},$s={editableElementVideo:"_editableElementVideo_92vvh_1",rotateWrapper:"_rotateWrapper_92vvh_5",elementContent:"_elementContent_92vvh_10",handlerBorder:"_handlerBorder_92vvh_16",t:"_t_92vvh_21",b:"_b_92vvh_28",l:"_l_92vvh_35",r:"_r_92vvh_5"},pk=({elementInfo:e,selectElement:t,contextmenus:r})=>{const n=e,{canvasScale:i}=_e(),a=S.useRef(null),o=(s,l=!0)=>{s.stopPropagation(),t==null||t(s.nativeEvent,n,l)};return Hr(a,()=>(r==null?void 0:r())||[]),S.createElement("div",{className:$s.editableElementVideo,style:{top:n.top+"px",left:n.left+"px",width:n.width+"px",height:n.height+"px"}},S.createElement("div",{className:$s.rotateWrapper,style:{transform:`rotate(${n.rotate}deg)`}},S.createElement("div",{className:$s.elementContent,ref:a,onMouseDown:s=>o(s,!1),onTouchStart:s=>o(s,!1)},S.createElement(dk,{width:n.width,height:n.height,src:n.src,poster:n.poster,scale:i}),["t","b","l","r"].map(s=>S.createElement("div",{key:s,className:`${$s.handlerBorder} ${$s[s]}`,onMouseDown:l=>o(l),onTouchStart:l=>o(l)})))))},it={audioPlayer:"_audioPlayer_1156v_1",controller:"_controller_1156v_11",barWrap:"_barWrap_1156v_21",bar:"_bar_1156v_21",played:"_played_1156v_29",thumb:"_thumb_1156v_29",barTime:"_barTime_1156v_32",barTimeHidden:"_barTimeHidden_1156v_49",loaded:"_loaded_1156v_59",icons:"_icons_1156v_92",icon:"_icon_1156v_92",playIcon:"_playIcon_1156v_109",iconContent:"_iconContent_1156v_112",iconActive:"_iconActive_1156v_120",volume:"_volume_1156v_123",volumeBarWrap:"_volumeBarWrap_1156v_130",volumeBar:"_volumeBar_1156v_130",volumeBarInner:"_volumeBarInner_1156v_133",volumeActive:"_volumeActive_1156v_136",time:"_time_1156v_179",ptime:"_ptime_1156v_193",dtime:"_dtime_1156v_196"},vk=S.forwardRef(({src:e,loop:t=!1,autoplay:r=!1,scale:n=1,className:i,style:a,onMouseDown:o},s)=>{const l=S.useRef(null),u=S.useRef(null),c=S.useRef(null),[f,d]=S.useState(.5),[h,p]=S.useState(!0),[v,g]=S.useState(0),[m,y]=S.useState(0),[_,b]=S.useState(0),[w,x]=S.useState(!1),[T,L]=S.useState("00:00"),[M,C]=S.useState("0"),E=(ie=0)=>{if(ie===0||isNaN(ie))return"00:00";const Ee=X=>X<10?"0"+X:""+X,K=Math.floor(ie/3600),le=Math.floor((ie-K*3600)/60),U=Math.floor(ie-K*3600-le*60);return(K>0?[K,le,U]:[le,U]).map(Ee).join(":")},P=S.useMemo(()=>E(v),[v]),D=S.useMemo(()=>E(m),[m]),k=S.useMemo(()=>(m?v/m*100:0)+"%",[v,m]),N=S.useMemo(()=>(m?_/m*100:0)+"%",[_,m]),I=S.useMemo(()=>f*100+"%",[f]),O=()=>{l.current&&(p(!1),l.current.play())},z=()=>{l.current&&(p(!0),l.current.pause())},$=()=>{h?O():z()};S.useImperativeHandle(s,()=>({toggle:$}));const R=ie=>{l.current&&(ie=Math.max(ie,0),ie=Math.min(ie,m),l.current.currentTime=ie,g(ie))},B=ie=>{l.current&&(ie=Math.max(ie,0),ie=Math.min(ie,1),l.current.volume=ie,d(ie),l.current.muted&&ie!==0&&(l.current.muted=!1))},H=()=>{l.current&&(l.current.muted?(l.current.muted=!1,B(.5)):(l.current.muted=!0,B(0)))},F=()=>{var ie;return y(((ie=l.current)==null?void 0:ie.duration)||0)},A=()=>{var ie;return g(((ie=l.current)==null?void 0:ie.currentTime)||0)},G=()=>{t?(R(0),O()):z()},Z=()=>{l.current&&l.current.buffered.length&&b(l.current.buffered.end(l.current.buffered.length-1))},Q=()=>console.error("音频加载失败"),q=ie=>ie.getBoundingClientRect().left,W=S.useCallback(ie=>{if(!l.current||!u.current)return;let K=(("clientX"in ie?ie.clientX:ie.changedTouches[0].clientX)-q(u.current))/u.current.clientWidth;K=Math.max(K,0),K=Math.min(K,1);const le=K*m;l.current.currentTime=le,g(le)},[m]),j=S.useCallback(ie=>{W(ie),document.removeEventListener("mousemove",W),document.removeEventListener("touchmove",W),document.removeEventListener("mouseup",j),document.removeEventListener("touchend",j)},[W]),Y=()=>{document.addEventListener("mousemove",W),document.addEventListener("touchmove",W),document.addEventListener("mouseup",j),document.addEventListener("touchend",j)},re=ie=>{if(m&&u.current){const Ee=u.current.getBoundingClientRect().left,K=ie.clientX-Ee;if(K<0||K>u.current.offsetWidth)return;const le=m*(K/u.current.offsetWidth);C(`${K-(le>=3600?25:20)}px`),L(E(le)),x(!0)}},te=S.useCallback(ie=>{if(!c.current)return;const K=(("clientX"in ie?ie.clientX:ie.changedTouches[0].clientX)-q(c.current))/45;B(K)},[]),ne=S.useCallback(()=>{document.removeEventListener("mousemove",te),document.removeEventListener("touchmove",te),document.removeEventListener("mouseup",ne),document.removeEventListener("touchend",ne)},[te]),ge=()=>{document.addEventListener("mousemove",te),document.addEventListener("touchmove",te),document.addEventListener("mouseup",ne),document.addEventListener("touchend",ne)},Se=ie=>{if(!c.current)return;const Ee=(ie.clientX-q(c.current))/45;B(Ee)};return S.createElement("div",{className:Me(it.audioPlayer,i),style:{transform:`scale(${1/n})`,...a},onMouseDown:o},S.createElement("audio",{className:it.audio,ref:l,src:e,autoPlay:r,onDurationChange:F,onTimeUpdate:A,onPlay:()=>p(!1),onEnded:G,onProgress:Z,onError:Q}),S.createElement("div",{className:it.controller},S.createElement("div",{className:it.icons},S.createElement("div",{className:Me(it.icon,it.playIcon),onClick:$},S.createElement("span",{className:it.iconContent},h?S.createElement(At.PlayOne,null):S.createElement(At.Pause,null))),S.createElement("div",{className:it.volume},S.createElement("div",{className:Me(it.icon,it.volumeIcon),onClick:H},S.createElement("span",{className:it.iconContent},f===0?S.createElement(At.VolumeMute,null):f===1?S.createElement(At.VolumeNotice,null):S.createElement(At.VolumeSmall,null))),S.createElement("div",{className:it.volumeBarWrap,onMouseDown:ge,onTouchStart:ge,onClick:Se},S.createElement("div",{className:it.volumeBar,ref:c},S.createElement("div",{className:it.volumeBarInner,style:{width:I}},S.createElement("span",{className:it.thumb})))))),S.createElement("span",{className:it.time},S.createElement("span",{className:it.ptime},P)," /"," ",S.createElement("span",{className:it.dtime},D)),S.createElement("div",{className:it.barWrap,ref:u,onMouseDown:Y,onTouchStart:Y,onMouseMove:re,onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1)},S.createElement("div",{className:Me(it.barTime,{[it.barTimeHidden]:!w}),style:{left:M}},T),S.createElement("div",{className:it.bar},S.createElement("div",{className:it.loaded,style:{width:N}}),S.createElement("div",{className:it.played,style:{width:k}},S.createElement("span",{className:it.thumb}))))))}),Rs={editableElementAudio:"_editableElementAudio_nmvrn_1",rotateWrapper:"_rotateWrapper_nmvrn_5",elementContent:"_elementContent_nmvrn_10",audioIcon:"_audioIcon_nmvrn_18",audioPlayer:"_audioPlayer_nmvrn_22"},gk=({elementInfo:e,selectElement:t,contextmenus:r})=>{const{canvasScale:n,handleElementId:i}=_e(),{viewportRatio:a,viewportSize:o}=ke(),s=S.useRef(null),l=S.useMemo(()=>Math.min(e.width,e.height)+"px",[e.width,e.height]),u=S.useMemo(()=>{const f=o,d=o*a,h=280/n,p=50/n,v=e.width,g=e.height,m=e.left,y=e.top;let _=0,b=g;return m+h>=f&&(_=v-h),y+g+p>=d&&(b=-p),{left:_+"px",top:b+"px"}},[o,a,n,e.width,e.height,e.left,e.top]),c=f=>{f.stopPropagation(),t==null||t(f.nativeEvent,e)};return Hr(s,()=>(r==null?void 0:r())||[]),S.createElement("div",{className:Rs.editableElementAudio,style:{top:e.top+"px",left:e.left+"px",width:e.width+"px",height:e.height+"px"}},S.createElement("div",{className:Rs.rotateWrapper,style:{transform:`rotate(${e.rotate}deg)`}},S.createElement("div",{ref:s,className:Rs.elementContent,onMouseDown:f=>c(f),onTouchStart:f=>c(f)},S.createElement(At.VolumeNotice,{className:Rs.audioIcon,style:{fontSize:l,color:e.color}}),i===e.id&&S.createElement(vk,{className:Rs.audioPlayer,style:{...u},src:e.src,loop:e.loop,scale:n,onMouseDown:f=>f.stopPropagation()}))))},mk=({elementInfo:e,elementIndex:t,isMultiSelect:r,selectElement:n})=>{const{orderElement:i}=R6(),{alignElementToCanvas:a}=V6(),{deleteElement:o}=Av(),{copyElement:s,pasteElement:l,cutElement:u}=z6(),c=S.useRef(null),f=S.useMemo(()=>({[Ge.IMAGE]:Z6,[Ge.TEXT]:B8,[Ge.SHAPE]:$8,[Ge.LINE]:R8,[Ge.CHART]:ok,[Ge.TABLE]:ck,[Ge.LATEX]:fk,[Ge.VIDEO]:pk,[Ge.AUDIO]:gk})[e.type]||null,[e.type]),d=()=>[{text:"剪切",subText:"Ctrl + X",handler:u},{text:"复制",subText:"Ctrl + C",handler:s},{text:"粘贴",subText:"Ctrl + V",handler:l},{divider:!0},{text:"水平居中",handler:()=>a(_t.HORIZONTAL),children:[{text:"水平垂直居中",handler:()=>a(_t.CENTER)},{text:"水平居中",handler:()=>a(_t.HORIZONTAL)},{text:"左对齐",handler:()=>a(_t.LEFT)},{text:"右对齐",handler:()=>a(_t.RIGHT)}]},{text:"垂直居中",handler:()=>a(_t.VERTICAL),children:[{text:"水平垂直居中",handler:()=>a(_t.CENTER)},{text:"垂直居中",handler:()=>a(_t.VERTICAL)},{text:"顶部对齐",handler:()=>a(_t.TOP)},{text:"底部对齐",handler:()=>a(_t.BOTTOM)}]},{divider:!0},{text:"置于顶层",disable:r&&!e.groupId,handler:()=>i(e,Mr.TOP),children:[{text:"置于顶层",handler:()=>i(e,Mr.TOP)},{text:"上移一层",handler:()=>i(e,Mr.UP)}]},{text:"置于底层",disable:r&&!e.groupId,handler:()=>i(e,Mr.BOTTOM),children:[{text:"置于底层",handler:()=>i(e,Mr.BOTTOM)},{text:"下移一层",handler:()=>i(e,Mr.DOWN)}]},{divider:!0},{text:"删除",subText:"Delete",handler:o}];return Hr(c,d),f?S.createElement("div",{ref:c,className:"editable-element",id:`editable-element-${e.id}`,style:{zIndex:t}},S.createElement(f,{elementInfo:e,selectElement:n,contextmenus:d})):null},yk=()=>{const{updateElement:e,removeElementProps:t}=ke(),{addHistorySnapshot:r}=wt();return{setLink:(a,o)=>{const s=/^(https?):\/\/[\w\-]+(\.[\w\-]+)+([\w\-.,@?^=%&:\/~+#]*[\w\-@?^=%&\/~+#])?$/;if(o.type==="web"&&!s.test(o.target))return console.error("不是正确的网页链接地址"),!1;if(o.type==="slide"&&!o.target)return console.error("请先选择链接目标"),!1;const l={link:o};return e({id:a.id,props:l}),r(),!0},removeLink:a=>{t({id:a.id,propName:"link"}),r()}}},Vs={baseElementImage:"_baseElementImage_1yw1u_1",rotateWrapper:"_rotateWrapper_1yw1u_5",elementContent:"_elementContent_1yw1u_10",imageContent:"_imageContent_1yw1u_15",colorMask:"_colorMask_1yw1u_24"},_k=({elementInfo:e})=>{const{shadowStyle:t}=En(e.shadow),{flipStyle:r}=dl(e.flipH,e.flipV),{clipShape:n,imgPosition:i}=cf(e),{filter:a}=Iv(e.filters);return S.createElement("div",{className:Vs.baseElementImage,style:{top:e.top+"px",left:e.left+"px",width:e.width+"px",height:e.height+"px"}},S.createElement("div",{className:Vs.rotateWrapper,style:{transform:`rotate(${e.rotate}deg)`}},S.createElement("div",{className:Vs.elementContent,style:{filter:t?`drop-shadow(${t})`:"",transform:r}},S.createElement(Bv,{elementInfo:e}),S.createElement("div",{className:Vs.imageContent,style:{clipPath:n.style}},S.createElement("img",{src:e.src,draggable:!1,style:{top:i.top,left:i.left,width:i.width,height:i.height,filter:a},alt:""}),e.colorMask&&S.createElement("div",{className:Vs.colorMask,style:{backgroundColor:e.colorMask}})))))},zs={baseElementText:"_baseElementText_emqg1_1",rotateWrapper:"_rotateWrapper_emqg1_5",elementContent:"_elementContent_emqg1_10",text:"_text_emqg1_16",thumbnail:"_thumbnail_emqg1_19"},bk=({elementInfo:e,target:t})=>{const{shadowStyle:r}=En(e.shadow);return S.createElement("div",{className:zs.baseElementText,style:{top:e.top+"px",left:e.left+"px",width:e.width+"px",height:e.height+"px"}},S.createElement("div",{className:zs.rotateWrapper,style:{transform:`rotate(${e.rotate}deg)`}},S.createElement("div",{className:zs.elementContent,style:{width:e.vertical?"auto":e.width+"px",height:e.vertical?e.height+"px":"auto",backgroundColor:e.fill,opacity:e.opacity,textShadow:r,lineHeight:e.lineHeight,letterSpacing:(e.wordSpace||0)+"px",color:e.defaultColor,fontFamily:e.defaultFontName,writingMode:e.vertical?"vertical-rl":"horizontal-tb"}},S.createElement(pl,{width:e.width,height:e.height,outline:e.outline}),S.createElement("div",{className:Me(zs.text,"ProseMirror-static",{[zs.thumbnail]:t==="thumbnail"}),style:{"--paragraphSpace":`${e.paragraphSpace===void 0?5:e.paragraphSpace}px`},dangerouslySetInnerHTML:{__html:e.content}}))))},Fs={baseElementShape:"_baseElementShape_16w80_1",rotateWrapper:"_rotateWrapper_16w80_5",elementContent:"_elementContent_16w80_10",shapeText:"_shapeText_16w80_21",top:"_top_16w80_34",middle:"_middle_16w80_38",bottom:"_bottom_16w80_42"},Sk=({elementInfo:e})=>{const{theme:t}=ke(),{fill:r}=Gv(e,"base"),{outlineWidth:n,outlineColor:i,strokeDashArray:a}=ua(e.outline),{shadowStyle:o}=En(e.shadow),{flipStyle:s}=dl(e.flipH,e.flipV),l=S.useMemo(()=>{const u={content:"",align:"middle",defaultFontName:t.fontName,defaultColor:t.fontColor};return e.text?e.text:u},[e.text,t]);return S.createElement("div",{className:Fs.baseElementShape,style:{top:e.top+"px",left:e.left+"px",width:e.width+"px",height:e.height+"px"}},S.createElement("div",{className:Fs.rotateWrapper,style:{transform:`rotate(${e.rotate}deg)`}},S.createElement("div",{className:Fs.elementContent,style:{opacity:e.opacity,filter:o?`drop-shadow(${o})`:"",transform:s,color:l.defaultColor,fontFamily:l.defaultFontName}},S.createElement("svg",{overflow:"visible",width:e.width,height:e.height},S.createElement("defs",null,e.pattern?S.createElement(Xv,{id:`base-pattern-${e.id}`,src:e.pattern}):e.gradient?S.createElement(Wv,{id:`base-gradient-${e.id}`,type:e.gradient.type,colors:e.gradient.colors,rotate:e.gradient.rotate}):null),S.createElement("g",{transform:`scale(${e.width/e.viewBox[0]}, ${e.height/e.viewBox[1]}) translate(0,0) matrix(1,0,0,1,0,0)`},S.createElement("path",{vectorEffect:"non-scaling-stroke",strokeLinecap:"butt",strokeMiterlimit:"8",d:e.path,fill:r,stroke:i,strokeWidth:n,strokeDasharray:a}))),S.createElement("div",{className:Me(Fs.shapeText,Fs[l.align])},S.createElement("div",{className:"ProseMirror-static",dangerouslySetInnerHTML:{__html:l.content}})))))},u3={baseElementLine:"_baseElementLine_135s9_1",elementContent:"_elementContent_135s9_5"},wk=({elementInfo:e})=>{const{shadowStyle:t}=En(e.shadow),r=S.useMemo(()=>{const l=Math.abs(e.start[0]-e.end[0]);return l<24?24:l},[e.start,e.end]),n=S.useMemo(()=>{const l=Math.abs(e.start[1]-e.end[1]);return l<24?24:l},[e.start,e.end]),i=S.useMemo(()=>{const l=e.width;return e.style==="dashed"?l<=8?`${l*5} ${l*2.5}`:`${l*5} ${l*1.5}`:e.style==="dotted"?l<=8?`${l*1.8} ${l*1.6}`:`${l*1.5} ${l*1.2}`:"0 0"},[e.width,e.style]),a=S.useMemo(()=>af(e),[e]),o=e.points[0],s=e.points[1];return S.createElement("div",{className:u3.baseElementLine,style:{top:e.top+"px",left:e.left+"px"}},S.createElement("div",{className:u3.elementContent,style:{filter:t?`drop-shadow(${t})`:""}},S.createElement("svg",{overflow:"visible",width:r,height:n},S.createElement("defs",null,o&&S.createElement(vl,{id:e.id,position:"start",type:o,color:e.color,baseSize:e.width}),s&&S.createElement(vl,{id:e.id,position:"end",type:s,color:e.color,baseSize:e.width})),S.createElement("path",{d:a,stroke:e.color,strokeWidth:e.width,strokeDasharray:i,fill:"none",markerStart:o?`url(#${e.id}-${o}-start)`:"",markerEnd:s?`url(#${e.id}-${s}-end)`:""}))))},yp={baseElementChart:"_baseElementChart_1cqxu_1",isThumbnail:"_isThumbnail_1cqxu_4",rotateWrapper:"_rotateWrapper_1cqxu_8",elementContent:"_elementContent_1cqxu_13"},xk=({elementInfo:e})=>S.createElement("div",{className:yp.baseElementChart,style:{top:e.top+"px",left:e.left+"px",width:e.width+"px",height:e.height+"px"}},S.createElement("div",{className:yp.rotateWrapper,style:{transform:`rotate(${e.rotate}deg)`}},S.createElement("div",{className:yp.elementContent,style:{backgroundColor:e.fill}},S.createElement(pl,{width:e.width,height:e.height,outline:e.outline}),S.createElement(i3,{width:e.width,height:e.height,type:e.chartType,data:e.data,themeColors:e.themeColors,textColor:e.textColor,lineColor:e.lineColor,options:e.options})))),oi={staticTable:"_staticTable_hc5uz_1",theme:"_theme_hc5uz_19",cell:"_cell_hc5uz_22",rowHeader:"_rowHeader_hc5uz_28",rowFooter:"_rowFooter_hc5uz_31",colHeader:"_colHeader_hc5uz_34",colFooter:"_colFooter_hc5uz_37",cellText:"_cellText_hc5uz_47"},Tk=({data:e,width:t,cellMinHeight:r,colWidths:n,outline:i,theme:a,editable:o=!0})=>{const[s,l]=S.useState([]);S.useEffect(()=>{l(n.map(h=>h*t))},[n,t]);const u=S.useMemo(()=>s.reduce((h,p)=>h+p,0),[s]),{hideCells:c}=s3(e),{subThemeColor:f}=l3(a),d=S.useMemo(()=>a?{"--themeColor":a.color,"--subThemeColor1":f[0],"--subThemeColor2":f[1]}:{},[a,f]);return S.createElement("div",{className:oi.staticTable,style:{width:u+"px"}},S.createElement("table",{className:Me({[oi.theme]:a,[oi.rowHeader]:a==null?void 0:a.rowHeader,[oi.rowFooter]:a==null?void 0:a.rowFooter,[oi.colHeader]:a==null?void 0:a.colHeader,[oi.colFooter]:a==null?void 0:a.colFooter}),style:d},S.createElement("colgroup",null,s.map((h,p)=>S.createElement("col",{key:p,span:1,width:h}))),S.createElement("tbody",null,e.map((h,p)=>S.createElement("tr",{key:p,style:{height:r+"px"}},h.map((v,g)=>c.includes(`${p}_${g}`)?null:S.createElement("td",{key:v.id,className:oi.cell,style:{borderStyle:i.style,borderColor:i.color,borderWidth:i.width+"px",...a3(v.style)},rowSpan:v.rowspan,colSpan:v.colspan},S.createElement("div",{className:oi.cellText,style:{minHeight:r-4+"px"},dangerouslySetInnerHTML:{__html:o3(v.text)}}))))))))},_p={baseElementTable:"_baseElementTable_uo3vw_1",rotateWrapper:"_rotateWrapper_uo3vw_5",elementContent:"_elementContent_uo3vw_10"},Lk=({elementInfo:e})=>S.createElement("div",{className:_p.baseElementTable,style:{top:e.top+"px",left:e.left+"px",width:e.width+"px"}},S.createElement("div",{className:_p.rotateWrapper,style:{transform:`rotate(${e.rotate}deg)`}},S.createElement("div",{className:_p.elementContent},S.createElement(Tk,{data:e.data,width:e.width,cellMinHeight:e.cellMinHeight,colWidths:e.colWidths,outline:e.outline,theme:e.theme})))),bp={baseElementLatex:"_baseElementLatex_ybsi7_1",rotateWrapper:"_rotateWrapper_ybsi7_5",elementContent:"_elementContent_ybsi7_10"},Ek=({elementInfo:e})=>S.createElement("div",{className:bp.baseElementLatex,style:{top:e.top+"px",left:e.left+"px",width:e.width+"px",height:e.height+"px"}},S.createElement("div",{className:bp.rotateWrapper,style:{transform:`rotate(${e.rotate}deg)`}},S.createElement("div",{className:bp.elementContent},S.createElement("svg",{overflow:"visible",width:e.width,height:e.height,stroke:e.color,strokeWidth:e.strokeWidth,fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},S.createElement("g",{transform:`scale(${e.width/e.viewBox[0]}, ${e.height/e.viewBox[1]}) translate(0,0) matrix(1,0,0,1,0,0)`},S.createElement("path",{d:e.path})))))),Ac={baseElementVideo:"_baseElementVideo_vw6yo_1",rotateWrapper:"_rotateWrapper_vw6yo_5",elementContent:"_elementContent_vw6yo_10",icon:"_icon_vw6yo_22"},Mk=({elementInfo:e})=>S.createElement("div",{className:Ac.baseElementVideo,style:{top:e.top+"px",left:e.left+"px",width:e.width+"px",height:e.height+"px"}},S.createElement("div",{className:Ac.rotateWrapper,style:{transform:`rotate(${e.rotate}deg)`}},S.createElement("div",{className:Ac.elementContent,style:{backgroundImage:e.poster?`url(${e.poster})`:""}},S.createElement("div",{className:Ac.icon},S.createElement(At.PlayOne,null))))),kc={baseElementAudio:"_baseElementAudio_1jxzq_1",rotateWrapper:"_rotateWrapper_1jxzq_5",elementContent:"_elementContent_1jxzq_10",audioIcon:"_audioIcon_1jxzq_18"},Ck=({elementInfo:e})=>{const t=S.useMemo(()=>Math.min(e.width,e.height)+"px",[e.width,e.height]);return S.createElement("div",{className:kc.baseElementAudio,style:{top:e.top+"px",left:e.left+"px",width:e.width+"px",height:e.height+"px"}},S.createElement("div",{className:kc.rotateWrapper,style:{transform:`rotate(${e.rotate}deg)`}},S.createElement("div",{className:kc.elementContent,style:{color:e.color}},S.createElement(At.VolumeNotice,{className:kc.audioIcon,style:{fontSize:t,color:e.color}}))))},Dk=({elementInfo:e,elementIndex:t})=>{const r=S.useMemo(()=>({[Ge.IMAGE]:_k,[Ge.TEXT]:bk,[Ge.SHAPE]:Sk,[Ge.LINE]:wk,[Ge.CHART]:xk,[Ge.TABLE]:Lk,[Ge.LATEX]:Ek,[Ge.VIDEO]:Mk,[Ge.AUDIO]:Ck})[e.type]||null,[e.type]);return S.createElement("div",{className:Me("thumbnail-element",`base-element-${e.id}`),style:{zIndex:t}},S.createElement(r,{elementInfo:e}))},Pc={"thumbnail-slide":"_thumbnail-slide_o3c1m_1",elements:"_elements_o3c1m_7",background:"_background_o3c1m_11",placeholder:"_placeholder_o3c1m_18"},c3=({slide:e,size:t,visible:r=!0,className:n})=>{const{viewportRatio:i,viewportSize:a}=ke(),{backgroundStyle:o}=Lv(e.background),s=S.useMemo(()=>t/a,[t,a]);return S.createElement("div",{className:Me(Pc["thumbnail-slide"],n),style:{width:t,height:t*i}},r?S.createElement("div",{className:Pc.elements,style:{width:a,height:a*i,transform:`scale(${s})`}},S.createElement("div",{className:Pc.background,style:o}),e.elements.map((l,u)=>S.createElement(Dk,{key:l.id,elementInfo:l,elementIndex:u+1}))):S.createElement("div",{className:Pc.placeholder},"加载中 ..."))},$t={linkDialogMask:"_linkDialogMask_1kfou_1",linkDialog:"_linkDialog_1kfou_1",tabs:"_tabs_1kfou_26",tab:"_tab_1kfou_26",active:"_active_1kfou_38",content:"_content_1kfou_44",input:"_input_1kfou_50",preview:"_preview_1kfou_60",thumbnail:"_thumbnail_1kfou_64",btns:"_btns_1kfou_75",btn:"_btn_1kfou_75",primary:"_primary_1kfou_91"},Ak=({onClose:e})=>{const{handleElementId:t,setDisableHotkeysState:r}=_e(),{slides:n,currentSlide:i}=ke(),[a,o]=S.useState("web"),[s,l]=S.useState(""),[u,c]=S.useState(""),{setLink:f}=yk(),d=S.useRef(null),h=S.useMemo(()=>n.map((g,m)=>({label:`幻灯片 ${m+1}`,value:g.id,disabled:(i==null?void 0:i.id)===g.id})),[n,i]),p=S.useMemo(()=>u&&n.find(g=>g.id===u)||null,[u,n]);S.useEffect(()=>{r(!0);const g=n.find(y=>y.id!==(i==null?void 0:i.id));g&&c(g.id);const m=(i==null?void 0:i.elements.find(y=>y.id===t))||null;return m!=null&&m.link&&(o(m.link.type),m.link.type==="web"?l(m.link.target):m.link.type==="slide"&&c(m.link.target)),a==="web"&&setTimeout(()=>{var y;return(y=d.current)==null?void 0:y.focus()},0),()=>{r(!1)}},[]);const v=()=>{const g={type:a,target:a==="web"?s:u},m=(i==null?void 0:i.elements.find(y=>y.id===t))||null;m&&(f(m,g)?e():l(""))};return S.createElement("div",{className:$t.linkDialogMask,onClick:e},S.createElement("div",{className:$t.linkDialog,onClick:g=>g.stopPropagation()},S.createElement("div",{className:$t.tabs},S.createElement("div",{className:Me($t.tab,{[$t.active]:a==="web"}),onClick:()=>o("web")},"网页链接"),S.createElement("div",{className:Me($t.tab,{[$t.active]:a==="slide"}),onClick:()=>o("slide")},"幻灯片页面")),S.createElement("div",{className:$t.content},a==="web"?S.createElement("input",{ref:d,className:$t.input,type:"text",value:s,onChange:g=>l(g.target.value),onKeyDown:g=>g.key==="Enter"&&v(),placeholder:"请输入网页链接地址"}):S.createElement(S.Fragment,null,S.createElement("select",{className:$t.input,value:u,onChange:g=>c(g.target.value)},h.map(g=>S.createElement("option",{key:g.value,value:g.value,disabled:g.disabled},g.label))),p&&S.createElement("div",{className:$t.preview},S.createElement("div",null,"预览:"),S.createElement(c3,{className:$t.thumbnail,slide:p,size:500})))),S.createElement("div",{className:$t.btns},S.createElement("button",{className:$t.btn,onClick:e},"取消"),S.createElement("button",{className:Me($t.btn,$t.primary),onClick:v},"确认"))))},Sp={canvas:"_canvas_r5284_1",dragMask:"_dragMask_r5284_9",viewportWrapper:"_viewportWrapper_r5284_18",viewport:"_viewport_r5284_18"},kk=({renderPageExtra:e})=>{const{canvasScale:t,activeElementIdList:r,handleElementId:n,activeGroupElementId:i,hiddenElementIdList:a,creatingElement:o,creatingCustomShape:s,setActiveElementIdList:l,setActiveGroupElementId:u,editorAreaFocus:c,textFormatPainter:f,setEditorareaFocus:d,setTextFormatPainter:h}=_e(),{currentSlide:p,slideIndex:v}=ke(),{spaceKeyState:g}=cr(),{createCustomShapeElement:m,createTextElement:y}=ho(),{updateSlideIndex:_}=r6(),b=S.useRef(null),w=S.useRef(null),[x,T]=S.useState(!1),L=(p==null?void 0:p.elements)||[],[M,C]=S.useState([]),E=K=>{const le=ke.getState().currentSlide;if(!le)return;const U=typeof K=="function"?K(le.elements):K;ke.getState().updateSlide({elements:U})},{dragElement:P}=c6(L,E,C),{scaleElement:D,scaleMultiElement:k}=v6(L,E,C),{rotateElement:N}=d6(L,E,w),{dragLineElement:I}=g6(L,E),{moveShapeKeypoint:O}=m6(L,E),{viewportStyles:z,dragViewport:$}=a6(b),{selectionState:R,mouseSelectionVisible:B,updateMouseSelection:H}=o6(L,w);l6(b);const{insertElementFromCreateSelection:F}=u6(w),{selectElement:A}=f6(L,P);n6(b,()=>{const K=_e.getState();K.editorAreaFocus&&K.setEditorareaFocus(!1)}),S.useEffect(()=>{u("")},[n,u]);const Z=(K,le,U=!0)=>{K.stopPropagation();const X=K.nativeEvent||K;A(X,le,U)},Q=K=>{r.length&&l([]),g?$(K.nativeEvent):H(K),c||d(!0),f&&h(null),i6()},q=K=>{if(r.length||o||s||!w.current)return;const{pageX:le,pageY:U}=K,{x:X,y:ee}=w.current.getBoundingClientRect(),J=(le-X)/t,ce=(U-ee)/t;y({left:J,top:ce,width:200/t,height:0})};S.useEffect(()=>{r.length&&l([])},[]),S.useEffect(()=>()=>{const{textFormatPainter:K}=_e.getState();K&&h(null)},[h]);const W=S.useRef(_);S.useEffect(()=>{W.current=_},[_]);const j=S.useRef(!1),Y=S.useRef(null),re=K=>{if(K.preventDefault(),K.ctrlKey)return;const le=K.deltaY>0?ft.DOWN:K.deltaY<0?ft.UP:null;le&&(j.current||(j.current=!0,W.current(le)),Y.current&&window.clearTimeout(Y.current),Y.current=window.setTimeout(()=>{j.current=!1,Y.current=null},50))};S.useEffect(()=>{const K=b.current;if(K)return K.addEventListener("wheel",re,{passive:!1}),()=>K.removeEventListener("wheel",re)},[]),S.useEffect(()=>()=>{Y.current&&(window.clearTimeout(Y.current),Y.current=null)},[]);const te=()=>T(!0),ne=(K,le)=>{N(K.nativeEvent,le)},ge=(K,le,U)=>{D(K.nativeEvent,le,U)},Se=(K,le,U)=>{I(K.nativeEvent,le,U)},ie=(K,le,U)=>{O(K.nativeEvent,le,U)},Ee=(K,le,U)=>{k(K.nativeEvent,le,U)};return S.createElement("div",{className:Sp.canvas,ref:b,onMouseDown:Q,onDoubleClick:q,onDragOver:K=>K.preventDefault()},x&&S.createElement(Ak,{onClose:()=>T(!1)}),o&&S.createElement(P6,{onCreated:F}),s&&S.createElement(O6,{onClose:()=>_e.getState().setCreatingCustomShapeState(!1),onCreated:m}),S.createElement("div",{className:Sp.viewportWrapper,style:{width:z.width*t,height:z.height*t,left:z.left,top:z.top}},S.createElement("div",{className:"operates"},M.map((K,le)=>S.createElement(k6,{key:le,type:K.type,axis:K.axis,length:K.length,canvasScale:t})),r.length>1&&S.createElement($6,{elementList:(p==null?void 0:p.elements)||[],scaleMultiElement:Ee}),p==null?void 0:p.elements.filter(K=>!a.includes(K.id)).map(K=>S.createElement(A6,{key:K.id,elementInfo:K,isSelected:r.includes(K.id),isActive:n===K.id,isActiveGroupElement:i===K.id,isMultiSelect:r.length>1,rotateElement:ne,scaleElement:ge,dragLineElement:Se,moveShapeKeypoint:ie,openLinkDialog:te})),S.createElement(S6,null)),S.createElement("div",{className:Sp.viewport,ref:w,style:{transform:`scale(${t})`}},B&&R&&S.createElement(I6,{top:R.top,left:R.left,width:R.width,height:R.height,quadrant:R.quadrant}),p==null?void 0:p.elements.filter(K=>!a.includes(K.id)).map((K,le)=>S.createElement(mk,{key:K.id,elementInfo:K,elementIndex:le+1,isMultiSelect:r.length>1,selectElement:Z,openLinkDialog:te}))),e==null?void 0:e({slideIndex:v,currentSlide:p})))},Pk={1:"Z",2:"M",4:"H",8:"V",16:"L",32:"C",64:"S",128:"Q",256:"T",512:"A"},f3=e=>{const t=new av.SVGPathData(e),r=[];for(const n of t.commands){const i=Pk[n.type];if((n.type===2||n.type===16)&&r.push({x:n.x,y:n.y,relative:n.relative,type:i}),n.type===32)r.push({x:n.x,y:n.y,curve:{type:"cubic",x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2},relative:n.relative,type:i});else if(n.type===128)r.push({x:n.x,y:n.y,curve:{type:"quadratic",x1:n.x1,y1:n.y1},relative:n.relative,type:i});else if(n.type===512){const a=r[r.length-1];if(!["M","L","Q","C"].includes(a.type))continue;const o=D7({px:a.x,py:a.y,cx:n.x,cy:n.y,rx:n.rX,ry:n.rY,xAxisRotation:n.xRot,largeArcFlag:n.lArcFlag,sweepFlag:n.sweepFlag});for(const s of o)r.push({x:s.x,y:s.y,curve:{type:"cubic",x1:s.x1,y1:s.y1,x2:s.x2,y2:s.y2},relative:!1,type:"C"})}else if(n.type===1)r.push({close:!0,type:i});else continue}return r},h3=e=>{try{const t=new av.SVGPathData(e),r=[],n=[];for(const i of t.commands){const a="x"in i?i.x:0,o="y"in i?i.y:0;r.push(a),n.push(o)}return{minX:Math.min(...r),minY:Math.min(...n),maxX:Math.max(...r),maxY:Math.max(...n)}}catch{return{minX:0,minY:0,maxX:0,maxY:0}}},wp=(e,t)=>e.replace(/font-size:\s*([\d.]+)pt/g,(r,n)=>`font-size: ${(parseFloat(n)*t).toFixed(1)}px`),Nk=(e,t)=>{const{start:r,end:n}=e,i=t*Math.PI/180,a=(r[0]+n[0])/2,o=(r[1]+n[1])/2,s=r[0]-a,l=r[1]-o,u=n[0]-a,c=n[1]-o,f=Math.cos(i),d=Math.sin(i),h=s*f-l*d,p=s*d+l*f,v=u*f-c*d,g=u*d+c*f,m=h+a,y=p+o,_=v+a,b=g+o,w=Math.min(r[0],n[0]),x=Math.min(r[1],n[1]),T=Math.min(m,_),L=Math.min(y,b),M=m-T,C=y-L,E=_-T,P=b-L,D=[M,C],k=[E,P],N=[T-w,L-x];return{start:D,end:k,offset:N}},Ok=(e,t)=>{let r=[0,0],n=[0,0];!e.isFlipV&&!e.isFlipH?(r=[0,0],n=[e.width,e.height]):e.isFlipV&&e.isFlipH?(r=[e.width,e.height],n=[0,0]):e.isFlipV&&!e.isFlipH?(r=[0,e.height],n=[e.width,0]):(r=[e.width,0],n=[0,e.height]);const i={type:"line",id:ze.nanoid(10),width:+((e.borderWidth||1)*t).toFixed(2),left:e.left,top:e.top,start:r,end:n,style:e.borderType||"solid",color:e.borderColor||"#000",points:["",/straightConnector/.test(e.shapType||"")?"arrow":""]};if(e.rotate){const{start:a,end:o,offset:s}=Nk(i,e.rotate);i.start=a,i.end=o,i.left=i.left+s[0],i.top=i.top+s[1]}if(/bentConnector/.test(e.shapType||"")&&(i.broken2=[Math.abs(i.start[0]-i.end[0])/2,Math.abs(i.start[1]-i.end[1])/2]),/curvedConnector/.test(e.shapType||"")){const a=[Math.abs(i.start[0]-i.end[0])/2,Math.abs(i.start[1]-i.end[1])/2];i.cubic=[a,a]}return i},Ik=e=>{var l;const t=[];for(const u of U7)t.push(...u.children);const r=96/72,i=e.size.width*r,a=e.size.height/e.size.width,o={themeColors:e.themeColors,fontColor:"#333",fontName:"微软雅黑",backgroundColor:"#fff"},s=[];for(const u of e.slides){let c;const f=u.fill;let d="solid",h="#fff";typeof f=="string"?h=f:f&&(d=f.type,h=f.value),d==="image"?c={type:"image",image:{src:h.picBase64,size:"cover"}}:d==="gradient"?c={type:"gradient",gradient:{type:h.path==="line"?"linear":"radial",colors:h.colors.map(g=>({...g,pos:parseInt(g.pos)})),rotate:h.rot+90}}:d==="pattern"?c={type:"solid",color:"#fff"}:c={type:"solid",color:h||"#fff"};const p={id:ze.nanoid(10),elements:[],background:c,remark:u.note||""},v=u.elements.sort((g,m)=>g.order-m.order);for(const g of v){const m=g.width||1,y=g.height||1,_={...g};if(_.width=_.width*r,_.height=_.height*r,_.left=_.left*r,_.top=_.top*r,_.type==="text"||_.type==="shape"&&_.shapType==="rect"&&_.content,_.type==="text"){const b={type:"text",id:ze.nanoid(10),width:_.width,height:_.height,left:_.left,top:_.top,rotate:_.rotate||0,defaultFontName:o.fontName,defaultColor:o.fontColor,content:wp(_.content||"",r),lineHeight:1,outline:{color:_.borderColor,width:+(_.borderWidth*r).toFixed(2),style:_.borderType||"solid"},fill:((l=_.fill)==null?void 0:l.type)==="color"?_.fill.value:"",vertical:_.isVertical};_.shadow&&(b.shadow={h:_.shadow.h*r,v:_.shadow.v*r,blur:_.shadow.blur*r,color:_.shadow.color}),p.elements.push(b)}else if(_.type==="image"){const b={type:"image",id:ze.nanoid(10),src:_.src||"",width:_.width,height:_.height,left:_.left,top:_.top,fixedRatio:!0,rotate:_.rotate||0,flipH:_.isFlipH,flipV:_.isFlipV};_.borderWidth&&(b.outline={color:_.borderColor,width:+(_.borderWidth*r).toFixed(2),style:_.borderType||"solid"});const w=["roundRect","ellipse","triangle","rhombus","pentagon","hexagon","heptagon","octagon","parallelogram","trapezoid"];_.rect?b.clip={shape:_.geom&&w.includes(_.geom)?_.geom:"rect",range:[[_.rect.l||0,_.rect.t||0],[100-(_.rect.r||0),100-(_.rect.b||0)]]}:_.geom&&w.includes(_.geom)&&(b.clip={shape:_.geom,range:[[0,0],[100,100]]}),p.elements.push(b)}else if(_.type==="math")p.elements.push({type:"image",id:ze.nanoid(10),src:_.picBase64||"",width:_.width,height:_.height,left:_.left,top:_.top,fixedRatio:!0,rotate:0});else if(_.type==="audio")p.elements.push({type:"audio",id:ze.nanoid(10),src:_.blob||"",width:_.width,height:_.height,left:_.left,top:_.top,rotate:0,fixedRatio:!1,color:o.themeColors[0],loop:!1,autoplay:!1});else if(_.type==="video")p.elements.push({type:"video",id:ze.nanoid(10),src:_.blob||_.src,width:_.width,height:_.height,left:_.left,top:_.top,rotate:0,autoplay:!1});else if(_.type==="shape")if(_.shapType==="line"||/Connector/.test(_.shapType||"")){const b=Ok(_,r);p.elements.push(b)}else{const b=t.find(E=>E.pptxShapeType===_.shapType),w={mid:"middle",down:"bottom",up:"top"},x=_.fill,T=(x==null?void 0:x.type)==="gradient"?{type:x.value.path==="line"?"linear":"radial",colors:x.value.colors.map(E=>({...E,pos:parseInt(E.pos)})),rotate:x.value.rot}:void 0,L=(x==null?void 0:x.type)==="image"?x.value.picBase64:void 0,M=(x==null?void 0:x.type)==="color"?x.value:"",C={type:"shape",id:ze.nanoid(10),width:_.width,height:_.height,left:_.left,top:_.top,viewBox:[200,200],path:"M 0 0 L 200 0 L 200 200 L 0 200 Z",fill:M,gradient:T,pattern:L,fixedRatio:!1,rotate:_.rotate||0,outline:{color:_.borderColor,width:+(_.borderWidth*r).toFixed(2),style:_.borderType||"solid"},text:{content:wp(_.content||"",r),defaultFontName:o.fontName,defaultColor:o.fontColor,align:w[_.vAlign||"mid"]||"middle"},flipH:_.isFlipH,flipV:_.isFlipV};if(_.shadow&&(C.shadow={h:_.shadow.h*r,v:_.shadow.v*r,blur:_.shadow.blur*r,color:_.shadow.color}),b){if(C.path=b.path,C.viewBox=b.viewBox,b.pathFormula){C.pathFormula=b.pathFormula,C.viewBox=[_.width,_.height];const E=fo[b.pathFormula];"editable"in E&&E.editable?(C.path=E.formula(_.width,_.height,E.defaultValue),C.keypoints=E.defaultValue):C.path=E.formula(_.width,_.height)}}else if(_.path&&_.path.indexOf("NaN")===-1){const{maxX:E,maxY:P}=h3(_.path);C.path=_.path,E/P>m/y?C.viewBox=[E,E*y/m]:C.viewBox=[P*m/y,P]}if(_.shapType==="custom"){_.path.indexOf("NaN")!==-1?(C.width===0&&(C.width=.1),C.height===0&&(C.height=.1),C.path=_.path.replace(/NaN/g,"0")):(C.special=!0,C.path=_.path);const{maxX:E,maxY:P}=h3(C.path);E/P>m/y?C.viewBox=[E,E*y/m]:C.viewBox=[P*m/y,P]}C.path&&p.elements.push(C)}else if(_.type==="table"){const b=_.data.length,w=_.data[0].length,x={fontname:o.fontName,color:o.fontColor},T=[];for(let L=0;L<b;L++){const M=[];for(let C=0;C<w;C++){const E=_.data[L][C];let P=null;typeof document<"u"&&(P=document.createElement("div"),P.innerHTML=E.text);let D="left",k="14px";if(P){const N=P.querySelector("p");D=(N==null?void 0:N.style.textAlign)||"left";const I=P.querySelector("span");k=(I==null?void 0:I.style.fontSize)||"14px"}M.push({id:ze.nanoid(10),colspan:1,rowspan:1,text:wp(E.text,r),style:{...x,align:D,fontsize:k}})}T.push(M)}p.elements.push({type:"table",id:ze.nanoid(10),width:_.width,height:_.height,left:_.left,top:_.top,colWidths:new Array(w).fill(1/w),data:T,theme:{color:o.themeColors[0],rowHeader:!0,rowFooter:!1,colHeader:!1,colFooter:!1},outline:{width:2,style:"solid",color:"#eeece1"},cellMinHeight:36,rotate:0})}}s.push(p)}return{slides:s,theme:{themeColors:o.themeColors,fontColor:o.fontColor,fontName:o.fontName,backgroundColor:o.backgroundColor},viewportRatio:a,viewportSize:i}},Bk=()=>{const e=ke(),{slides:t,theme:r}=ke(),{addHistorySnapshot:n}=wt(),i=f=>{var w,x,T,L,M,C,E,P,D;const d=Array.isArray(f)?f:[f],h=[],p=[],v=[],g=[];for(const k of d){if(k.background)if(k.background.type==="solid"&&k.background.color)h.push({area:1,value:k.background.color});else if(k.background.type==="gradient"&&k.background.gradient){const N=k.background.gradient.colors.length;h.push(...k.background.gradient.colors.map(I=>({area:1/N,value:I.color})))}else h.push({area:1,value:r.backgroundColor});for(const N of k.elements){const I=N.width;let O=0;if(N.type==="line"){const[$,R]=N.start,[B,H]=N.end;O=Math.sqrt(Math.pow(Math.abs($-B),2)+Math.pow(Math.abs(R-H),2))}else O=N.height;const z=I*O;if(N.type==="shape"||N.type==="text"){if(N.fill&&p.push({area:z,value:N.fill}),N.type==="shape"&&N.gradient){const G=N.gradient.colors.length;p.push(...N.gradient.colors.map(Z=>({area:1/G*z,value:Z.color})))}const $=(N.type==="shape"?(w=N.text)==null?void 0:w.content:N.content)||"";if(!$)continue;const R=$.replace(/<[^>]+>/g,"").replace(/\s*/g,""),B=$.match(/<[^>]+color: .+?<\/.+?>/g),H=$.match(/<[^>]+font-family: .+?<\/.+?>/g);let F=1,A=1;if(B)for(const G of B){const Z=G.match(/color: (.+?);/);if(!Z)continue;const Q=G.replace(/<[^>]+>/g,"").replace(/\s*/g,""),q=Z[1],W=Q.length/R.length;F=F-W,v.push({area:z*W,value:q})}if(H)for(const G of H){const Z=G.match(/font-family: (.+?);/);if(!Z)continue;const Q=G.replace(/<[^>]+>/g,"").replace(/\s*/g,""),q=Z[1],W=Q.length/R.length;A=A-W,g.push({area:z*W,value:q})}if(F){const Z=(N.type==="shape"?(x=N.text)==null?void 0:x.defaultColor:N.defaultColor)||r.fontColor;v.push({area:z*F,value:Z})}if(A){const Z=(N.type==="shape"?(T=N.text)==null?void 0:T.defaultFontName:N.defaultFontName)||r.fontName;g.push({area:z*A,value:Z})}}else if(N.type==="table"){const $=N.data.length*N.data[0].length;let R=0;for(const B of N.data)for(const H of B)if((L=H.style)!=null&&L.backcolor&&(R+=1,p.push({area:z/$,value:(M=H.style)==null?void 0:M.backcolor})),H.text){const F=H.text.length>=10?1:H.text.length/10;(C=H.style)!=null&&C.color&&v.push({area:z/$*F,value:(E=H.style)==null?void 0:E.color}),(P=H.style)!=null&&P.fontname&&v.push({area:z/$*F,value:(D=H.style)==null?void 0:D.fontname})}if(N.theme){const B=1-R/$;p.push({area:z*B,value:N.theme.color})}}else if(N.type==="chart"){N.fill&&p.push({area:z*.6,value:N.fill}),N.themeColors[0]&&p.push({area:z*.3,value:N.themeColors[0]});for(const $ of N.themeColors)Je($).getAlpha()!==0&&p.push({area:z/N.themeColors.length*.1,value:$})}else N.type==="line"?p.push({area:z,value:N.color}):N.type==="audio"?p.push({area:z,value:N.color}):N.type==="latex"&&v.push({area:z,value:N.color})}}const m={};for(const k of h){const N=Je(k.value).toRgbString();N!=="rgba(0, 0, 0, 0)"&&(m[N]?m[N]+=k.area:m[N]=k.area)}const y={};for(const k of p){const N=Je(k.value).toRgbString();N!=="rgba(0, 0, 0, 0)"&&(y[N]?y[N]+=k.area:y[N]=k.area)}const _={};for(const k of v){const N=Je(k.value).toRgbString();N!=="rgba(0, 0, 0, 0)"&&(_[N]?_[N]+=k.area:_[N]=k.area)}const b={};for(const k of g)b[k.value]?b[k.value]+=k.area:b[k.value]=k.area;return{backgroundColors:Object.keys(m).sort((k,N)=>m[N]-m[k]),themeColors:Object.keys(y).sort((k,N)=>y[N]-y[k]),fontColors:Object.keys(_).sort((k,N)=>_[N]-_[k]),fontNames:Object.keys(b).sort((k,N)=>b[N]-b[k])}},a=f=>{const d={},h=(v,g)=>{const m=Je(v).setAlpha(1).toRgbString();d[m]?d[m]=d[m]+g:d[m]=g};for(const v of f.elements){const g=v.width,m=v.type==="line"?Q7(v):v.height,y=g*m;if(v.type==="shape"&&Je(v.fill).getAlpha()!==0&&h(v.fill,y),v.type==="text"&&v.fill&&Je(v.fill).getAlpha()!==0&&h(v.fill,y),v.type==="image"&&v.colorMask&&Je(v.colorMask).getAlpha()!==0&&h(v.colorMask,y),v.type==="table"&&v.theme&&Je(v.theme.color).getAlpha()!==0&&h(v.theme.color,y),v.type==="chart"){for(const _ of v.themeColors)Je(_).getAlpha()!==0&&h(_,y/v.themeColors.length*.1);v.themeColors[0]&&Je(v.themeColors[0]).getAlpha()!==0&&h(v.themeColors[0],y*.3),v.fill&&Je(v.fill).getAlpha()!==0&&h(v.fill,y*.6)}v.type==="line"&&Je(v.color).getAlpha()!==0&&h(v.color,y),v.type==="audio"&&Je(v.color).getAlpha()!==0&&h(v.color,y)}return Object.keys(d).sort((v,g)=>d[g]-d[v])},o=(f,d)=>{const h=[...d],p=a(f),v={};if(p.length>h.length){const m=Je(h[0]).analogous(p.length-h.length+10).map(y=>y.toHexString()).slice(1);h.push(...m)}for(let g=0;g<p.length;g++)v[p[g]]=h[g];return v},s=(f,d)=>{const h=o(f,d.colors),p=v=>{const g=Je(v).getAlpha(),m=h[Je(v).setAlpha(1).toRgbString()];return m?Je(m).setAlpha(g).toRgbString():v};(!f.background||f.background.type!=="image")&&(f.background={type:"solid",color:d.background});for(const v of f.elements){if(v.type==="shape"&&(v.fill&&(v.fill=p(v.fill)),v.gradient&&delete v.gradient,v.text&&(v.text.defaultColor=d.fontColor,v.text.defaultFontName=d.fontname,v.text.content&&(v.text.content=v.text.content.replace(/color: .+?;/g,"").replace(/font-family: .+?;/g,"")))),v.type==="text"&&(v.fill&&(v.fill=p(v.fill)),v.defaultColor=d.fontColor,v.defaultFontName=d.fontname,v.content&&(v.content=v.content.replace(/color: .+?;/g,"").replace(/font-family: .+?;/g,""))),v.type==="image"&&v.colorMask&&(v.colorMask=p(v.colorMask)),v.type==="table"){v.theme&&(v.theme.color=p(v.theme.color));for(const g of v.data)for(const m of g)m.style&&(m.style.color=d.fontColor,m.style.fontname=d.fontname)}v.type==="chart"&&(v.themeColors=[...d.colors],v.textColor=d.fontColor),v.type==="line"&&(v.color=p(v.color)),v.type==="audio"&&(v.color=p(v.color)),v.type==="latex"&&(v.color=d.fontColor),"outline"in v&&v.outline&&(d.outline&&(v.outline={...d.outline}),d.borderColor&&(v!=null&&v.outline)&&(v.outline.color=d.borderColor)),"shadow"in v&&v.shadow&&d.shadow&&(v.shadow=d.shadow)}};return{getSlidesThemeStyles:i,applyPresetTheme:(f,d=!1)=>{if(e.setTheme({backgroundColor:f.background,themeColors:f.colors,fontColor:f.fontColor,outline:{width:2,style:"solid",color:f.borderColor},fontName:f.fontname}),d){const h=JSON.parse(JSON.stringify(t));for(const p of h)s(p,f);e.setSlides(h),n()}},applyThemeToAllSlides:(f=!1)=>{const d=JSON.parse(JSON.stringify(t)),h={background:r.backgroundColor,fontColor:r.fontColor,borderColor:f?r.outline.color:void 0,fontname:r.fontName,colors:r.themeColors,outline:f?r.outline:void 0,shadow:f?r.shadow:void 0};for(const p of d)s(p,h);e.setSlides(d),n()},applyFontToAllSlides:f=>{const d=JSON.parse(JSON.stringify(t));for(const h of d)for(const p of h.elements)if(p.type==="shape"&&p.text&&(p.text.defaultFontName=f,p.text.content&&(p.text.content=p.text.content.replace(/color: .+?;/g,"").replace(/font-family: .+?;/g,""))),p.type==="text"&&(p.defaultFontName=f,p.content&&(p.content=p.content.replace(/color: .+?;/g,"").replace(/font-family: .+?;/g,""))),p.type==="table")for(const v of p.data)for(const g of v)g.style&&(g.style.fontname=f);e.setSlides(d),n()}}},$k=["style","script","template"],Rk=["html","head","body","p","dt","dd","li","option","thead","th","tbody","tr","td","tfoot","colgroup"],Vk={li:["ul","ol","menu"],dt:["dl"],dd:["dl"],tbody:["table"],thead:["table"],tfoot:["table"],tr:["table"],td:["table"]},zk=["!doctype","area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],ra=(e,t)=>{const r=t-e.position;Nc(e,r)},Nc=(e,t)=>{e.position=e.position+t},Fk=(e,t)=>{for(;;){const n=e.indexOf("<",t);if(n===-1)return n;const i=e.charAt(n+1);if(i==="/"||i==="!"||/[A-Za-z0-9]/.test(i))return n;t=n+1}return-1},d3=e=>{const{str:t}=e;let r=Fk(t,e.position);if(r===e.position)return;r===-1&&(r=t.length);const n=t.slice(e.position,r);ra(e,r),e.tokens.push({type:"text",content:n})},Hk=e=>{const{str:t}=e;Nc(e,4);let r=t.indexOf("-->",e.position),n=r+3;r===-1&&(r=n=t.length);const i=t.slice(e.position,r);ra(e,n),e.tokens.push({type:"comment",content:i})},Gk=e=>{const{str:t}=e,r=t.length;let n=e.position;for(;n<r;){const o=t.charAt(n);if(!(/\s/.test(o)||o==="/"||o===">"))break;n++}let i=n+1;for(;i<r;){const o=t.charAt(i);if(!!(/\s/.test(o)||o==="/"||o===">"))break;i++}ra(e,i);const a=t.slice(n,i);return e.tokens.push({type:"tag",content:a}),a},Wk=e=>{const{str:t,tokens:r}=e;let n=e.position,i=null,a=n;const o=[],s=t.length;for(;n<s;){const u=t.charAt(n);if(i){u===i&&(i=null),n++;continue}if(u==="/"||u===">"){n!==a&&o.push(t.slice(a,n));break}if(/\s/.test(u)){n!==a&&o.push(t.slice(a,n)),a=n+1,n++;continue}if(u==="'"||u==='"'){i=u,n++;continue}n++}ra(e,n);const l="attribute";for(let u=0;u<o.length;u++){const c=o[u];if(c.indexOf("=")===-1){const d=o[u+1];if(d&&Gt.startsWith(d,"=")){if(d.length>1){const p=c+d;r.push({type:l,content:p}),u+=1;continue}const h=o[u+2];if(u+=1,h){const p=c+"="+h;r.push({type:l,content:p}),u+=1;continue}}}if(Gt.endsWith(c,"=")){const d=o[u+1];if(d&&d.indexOf("=")===-1){const p=c+d;r.push({type:l,content:p}),u+=1;continue}const h=c.slice(0,-1);r.push({type:l,content:h});continue}r.push({type:l,content:c})}},Xk=(e,t)=>{const{str:r,tokens:n}=t,i=e.toLowerCase(),a=r.length;let o=t.position;for(;o<a;){const s=r.indexOf("</",o);if(s===-1){d3(t);break}const l={str:r,position:t.position,tokens:[]};ra(l,s);const u=p3(l);if(i!==u.toLowerCase()){o=l.position;continue}if(s!==t.position){const c=t.position;ra(t,s),n.push({type:"text",content:r.slice(c,s)})}n.push(...l.tokens),ra(t,l.position);break}},p3=e=>{const{str:t}=e,n=t.charAt(e.position+1)==="/";Nc(e,n?2:1),e.tokens.push({type:"tag-start",close:n});const i=Gk(e);Wk(e);const o=t.charAt(e.position)==="/";return Nc(e,o?2:1),e.tokens.push({type:"tag-end",close:o}),i},Uk=e=>{const t=e.str,r=t.length;for(;e.position<r;){const n=e.position;if(d3(e),e.position===n)if(Gt.startsWith(t,"!--",n+1))Hk(e);else{const a=p3(e),o=a.toLowerCase();$k.includes(o)&&Xk(a,e)}}},Yk=e=>{const t={str:e,position:0,tokens:[]};return Uk(t),t.tokens},qk=e=>{const t={tagName:null,children:[]};return g3({tokens:e,cursor:0,stack:[t]}),t.children},Zk=(e,t)=>{const r=Vk[e];if(r){let n=t.length-1;for(;n>=0;){const i=t[n].tagName;if(i===e)break;if(i&&r.includes(i))return!0;n--}}return!1},v3=(e,t)=>{e.splice(t)},g3=e=>{const{stack:t,tokens:r}=e;let{cursor:n}=e,i=t[t.length-1].children;const a=r.length;for(;n<a;){const o=r[n];if(o.type!=="tag-start"){i.push(o),n++;continue}const s=r[++n];n++;const l=s.content.toLowerCase();if(o.close){let g=t.length,m=!1;for(;--g>-1;)if(t[g].tagName===l){m=!0;break}for(;n<a&&r[n].type==="tag-end";)n++;if(m){v3(t,g);break}else continue}let c=Rk.includes(l);if(c&&(c=!Zk(l,t)),c){let g=t.length-1;for(;g>0;){if(l===t[g].tagName){v3(t,g);const m=g-1;i=t[m].children;break}g=g-1}}const f=[];let d;for(;n<a;){const g=r[n];if(g.type==="tag-end"){d=g;break}f.push(g.content),n++}if(!d)break;n++;const h=[],p={type:"element",tagName:s.content,attributes:f,children:h};if(i.push(p),!(d.close||zk.includes(l))){t.push({tagName:l,children:h});const g={tokens:r,cursor:n,stack:t};g3(g),n=g.cursor}}e.cursor=n},jk=(e,t)=>{const r=e.indexOf(t);return r===-1?[e]:[e.slice(0,r),e.slice(r+t.length)]},Qk=e=>{const t=e.charAt(0),r=e.length-1;return(t==='"'||t==="'")&&t===e.charAt(r)?e.slice(1,r):e},Kk=e=>e.map(t=>{const r=jk(t.trim(),"="),n=r[0],i=typeof r[1]=="string"?Qk(r[1]):null;return{key:n,value:i}}),m3=e=>e.map(t=>{if(t.type==="element"){const n=m3(t.children);return{type:"element",tagName:t.tagName.toLowerCase(),attributes:Kk(t.attributes),children:n}}return{type:t.type,content:t.content}}),Jk=e=>{const t=Yk(e),r=qk(t);return m3(r)},Oc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",eP="data:image/svg+xml;base64,",tP=e=>{e=e.replace(/\r\n/g,`
42
42
  `);let t="";for(let r=0;r<e.length;r++){const n=e.charCodeAt(r);n<128?t+=String.fromCharCode(n):n>127&&n<2048?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(n&63|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(n&63|128))}return t},rP=e=>{let t="",r,n,i,a,o,s,l,u=0;for(e=tP(e);u<e.length;)r=e.charCodeAt(u++),n=e.charCodeAt(u++),i=e.charCodeAt(u++),a=r>>2,o=(r&3)<<4|n>>4,s=(n&15)<<2|i>>6,l=i&63,isNaN(n)?s=l=64:isNaN(i)&&(l=64),t=t+Oc.charAt(a)+Oc.charAt(o)+Oc.charAt(s)+Oc.charAt(l);return t},y3=e=>{const r=new XMLSerializer().serializeToString(e);return eP+rP(r)},at=e=>{if(!e)return{alpha:0,color:"#000000"};const t=Je(e),r=t.getAlpha(),n=r===0?"#ffffff":t.setAlpha(1).toHexString();return{alpha:r,color:n}},nP=e=>{const t=/^data:image\/svg\+xml;base64,/.test(e),r=/\.svg$/.test(e);return t||r},xp=e=>{const t=/^data:image\/[^;]+;base64,/;return e.match(t)!==null},Ic=16,iP=()=>{const{viewportRatio:e,viewportSize:t,theme:r,slides:n,title:i}=ke(),a=S.useMemo(()=>96*(t/960),[t]),o=S.useMemo(()=>96/72*(t/960),[t]),s=p=>{const v=Jk(p);let g=!1,m=0;const y=[],_=(b,w={})=>{for(const x of b){if("tagName"in x&&["div","li","p"].includes(x.tagName)&&y.length){const C=y[y.length-1];C.options||(C.options={}),C.options.breakLine=!0}const L={...w},M="attributes"in x?x.attributes.find(C=>C.key==="style"):null;if(M&&M.value){const C=M.value.split(";");for(const E of C){const P=E.match(/([^:]+):\s*(.+)/);if(P){const[D,k]=[P[1].trim(),P[2].trim()];D&&k&&(L[D]=k)}}}if("tagName"in x){if(x.tagName==="em"&&(L["font-style"]="italic"),x.tagName==="strong"&&(L["font-weight"]="bold"),x.tagName==="sup"&&(L["vertical-align"]="super"),x.tagName==="sub"&&(L["vertical-align"]="sub"),x.tagName==="a"){const C=x.attributes.find(E=>E.key==="href");L.href=(C==null?void 0:C.value)||""}if(x.tagName==="ul"&&(L["list-type"]="ul"),x.tagName==="ol"&&(L["list-type"]="ol"),x.tagName==="li"&&(g=!0),x.tagName==="p"&&"attributes"in x){const C=x.attributes.find(E=>E.key==="data-indent");C&&C.value&&(m=+C.value)}}if("tagName"in x&&x.tagName==="br")y.push({text:"",options:{breakLine:!0}});else if("content"in x){const C=x.content.replace(/&nbsp;/g," ").replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&").replace(/\n/g,""),E={};L["font-size"]&&(E.fontSize=parseInt(L["font-size"])/o),L.color&&(E.color=at(L.color).color),L["background-color"],L["text-decoration-line"]&&(L["text-decoration-line"].indexOf("underline")!==-1&&(E.underline={color:E.color||"#000000",style:"sng"}),L["text-decoration-line"].indexOf("line-through")!==-1&&(E.strike="sngStrike")),L["text-decoration"]&&(L["text-decoration"].indexOf("underline")!==-1&&(E.underline={color:E.color||"#000000",style:"sng"}),L["text-decoration"].indexOf("line-through")!==-1&&(E.strike="sngStrike")),L["vertical-align"]&&(L["vertical-align"]==="super"&&(E.superscript=!0),L["vertical-align"]==="sub"&&(E.subscript=!0)),L["text-align"]&&(E.align=L["text-align"]),L["font-weight"]&&(E.bold=L["font-weight"]==="bold"),L["font-style"]&&(E.italic=L["font-style"]==="italic"),L["font-family"]&&(E.fontFace=L["font-family"]),L.href&&(E.hyperlink={url:L.href}),g&&L["list-type"]==="ol"&&(E.bullet={type:"number",indent:(E.fontSize||Ic)*1.25},E.paraSpaceBefore=.1,g=!1),g&&L["list-type"]==="ul"&&(E.bullet={indent:(E.fontSize||Ic)*1.25},E.paraSpaceBefore=.1,g=!1),m&&(E.indentLevel=m,m=0),y.push({text:C,options:E})}else"children"in x&&_(x.children,L)}};return _(v),y},l=(p,v={x:1,y:1})=>p.map(g=>{if(g.close!==void 0)return{close:!0};if(g.type==="M")return{x:g.x/a*v.x,y:g.y/a*v.y,moveTo:!0};if(g.curve){if(g.curve.type==="cubic")return{x:g.x/a*v.x,y:g.y/a*v.y,curve:{type:"cubic",x1:g.curve.x1/a*v.x,y1:g.curve.y1/a*v.y,x2:g.curve.x2/a*v.x,y2:g.curve.y2/a*v.y}};if(g.curve.type==="quadratic")return{x:g.x/a*v.x,y:g.y/a*v.y,curve:{type:"quadratic",x1:g.curve.x1/a*v.x,y1:g.curve.y1/a*v.y}}}return{x:g.x/a*v.x,y:g.y/a*v.y}}),u=p=>{const v=at(p.color),{h:g,v:m}=p;let y=4,_=45;return g===0&&m===0?(y=4,_=45):g===0?m>0?(y=m,_=90):(y=-m,_=270):m===0?g>0?(y=g,_=1):(y=-g,_=180):g>0&&m>0?(y=Math.max(g,m),_=45):g>0&&m<0?(y=Math.max(g,-m),_=315):g<0&&m>0?(y=Math.max(-g,m),_=135):g<0&&m<0&&(y=Math.max(-g,-m),_=225),{type:"outer",color:v.color.replace("#",""),opacity:v.alpha,blur:p.blur/o,offset:y,angle:_}},c={solid:"solid",dashed:"dash",dotted:"sysDot"},f=p=>{const v=at((p==null?void 0:p.color)||"#000000");return{color:v.color,transparency:(1-v.alpha)*100,width:(p.width||1)/o,dashType:p.style?c[p.style]:"solid"}},d=p=>{const{type:v,target:g}=p;if(v==="web")return{url:g};if(v==="slide"){const m=n.findIndex(y=>y.id===g);if(m!==-1)return{slide:m+1}}return null};return{exportPPTX:({slides:p,theme:v,masterOverwrite:g=!0,ignoreMedia:m=!0,writeFile:y,onError:_,onSuccess:b})=>{var x,T,L,M,C,E,P,D,k,N,I,O,z,$,R,B;const w=new A7;if(e===.625?w.layout="LAYOUT_16x10":e===.75?w.layout="LAYOUT_4x3":e===.70710678?(w.defineLayout({name:"A3",width:10,height:7.0710678}),w.layout="A3"):e===1.41421356?(w.defineLayout({name:"A3_V",width:10,height:14.1421356}),w.layout="A3_V"):w.layout="LAYOUT_16x9",g){const{color:H,alpha:F}=at(v.backgroundColor);w.defineSlideMaster({title:"PPTIST_MASTER",background:{color:H,transparency:(1-F)*100}})}for(const H of p){const F=w.addSlide();if(H.background){const A=H.background;if(A.type==="image"&&A.image)nP(A.image.src)?F.addImage({data:A.image.src,x:0,y:0,w:t/a,h:t*e/a}):xp(A.image.src)?F.background={data:A.image.src}:F.background={path:A.image.src};else if(A.type==="solid"&&A.color){const G=at(A.color);F.background={color:G.color,transparency:(1-G.alpha)*100}}else if(A.type==="gradient"&&A.gradient){const G=A.gradient.colors,Z=G[0].color,Q=G[G.length-1].color,q=Je.mix(Z,Q).toHexString(),W=at(q);F.background={color:W.color,transparency:(1-W.alpha)*100}}}if(H.remark){const G=new DOMParser().parseFromString(H.remark,"text/html").body.querySelectorAll("p"),Z=[];for(const Q of G){const q=Q.textContent;Z.push(q||"")}F.addNotes(Z.join(`
43
- `))}if(H.elements){for(const A of H.elements)if(A.type==="text"){const G=s(A.content),Z={x:A.left/a,y:A.top/a,w:A.width/a,h:A.height/a,fontSize:Ic/o,fontFace:"微软雅黑",color:"#000000",valign:"top",margin:10/o,paraSpaceBefore:5/o,lineSpacingMultiple:1.5/1.25,autoFit:!0};if(A.rotate&&(Z.rotate=A.rotate),A.wordSpace&&(Z.charSpacing=A.wordSpace/o),A.lineHeight&&(Z.lineSpacingMultiple=A.lineHeight/1.25),A.fill){const Q=at(A.fill),q=A.opacity===void 0?1:A.opacity;Z.fill={color:Q.color,transparency:(1-Q.alpha*q)*100}}A.defaultColor&&(Z.color=at(A.defaultColor).color),A.defaultFontName&&(Z.fontFace=A.defaultFontName),A.shadow&&(Z.shadow=u(A.shadow)),(x=A.outline)!=null&&x.width&&(Z.line=f(A.outline)),A.opacity!==void 0&&(Z.transparency=(1-A.opacity)*100),A.paragraphSpace!==void 0&&(Z.paraSpaceBefore=A.paragraphSpace/o),A.vertical&&(Z.vert="eaVert"),F.addText(G,Z)}else if(A.type==="image"){const G={x:A.left/a,y:A.top/a,w:A.width/a,h:A.height/a};if(xp(A.src)?G.data=A.src:G.path=A.src,A.flipH&&(G.flipH=A.flipH),A.flipV&&(G.flipV=A.flipV),A.rotate&&(G.rotate=A.rotate),A.link){const Z=d(A.link);Z&&(G.hyperlink=Z)}if((T=A.filters)!=null&&T.opacity&&(G.transparency=100-parseInt((L=A.filters)==null?void 0:L.opacity)),A.clip){A.clip.shape==="ellipse"&&(G.rounding=!0);const[Z,Q]=A.clip.range,[q,W]=Z,[j,Y]=Q,re=A.width/((j-q)/a),te=A.height/((Y-W)/a);G.w=re/a,G.h=te/a,G.sizing={type:"crop",x:q/a*re/a,y:W/a*te/a,w:(j-q)/a*re/a,h:(Y-W)/a*te/a}}F.addImage(G)}else if(A.type==="shape"){if(A.special){const G=document.querySelector(`.thumbnail-list .base-element-${A.id} svg`);if(G.clientWidth<1||G.clientHeight<1)continue;const Q={data:y3(G),x:A.left/a,y:A.top/a,w:A.width/a,h:A.height/a};if(A.rotate&&(Q.rotate=A.rotate),A.flipH&&(Q.flipH=A.flipH),A.flipV&&(Q.flipV=A.flipV),A.link){const q=d(A.link);q&&(Q.hyperlink=q)}F.addImage(Q)}else{const G={x:A.width/A.viewBox[0],y:A.height/A.viewBox[1]},Z=l(f3(A.path),G);let Q=at(A.fill);if(A.gradient){const j=A.gradient.colors,Y=j[0].color,re=j[j.length-1].color,te=Je.mix(Y,re).toHexString();Q=at(te)}A.pattern&&(Q=at("#00000000"));const q=A.opacity===void 0?1:A.opacity,W={x:A.left/a,y:A.top/a,w:A.width/a,h:A.height/a,fill:{color:Q.color,transparency:(1-Q.alpha*q)*100},points:Z};if(A.flipH&&(W.flipH=A.flipH),A.flipV&&(W.flipV=A.flipV),A.shadow&&(W.shadow=u(A.shadow)),(M=A.outline)!=null&&M.width&&(W.line=f(A.outline)),A.rotate&&(W.rotate=A.rotate),A.link){const j=d(A.link);j&&(W.hyperlink=j)}F.addShape("custGeom",W)}if(A.text){const G=s(A.text.content),Z={x:A.left/a,y:A.top/a,w:A.width/a,h:A.height/a,fontSize:Ic/o,fontFace:"微软雅黑",color:"#000000",paraSpaceBefore:5/o,valign:A.text.align};A.rotate&&(Z.rotate=A.rotate),A.text.defaultColor&&(Z.color=at(A.text.defaultColor).color),A.text.defaultFontName&&(Z.fontFace=A.text.defaultFontName),F.addText(G,Z)}if(A.pattern){const G={x:A.left/a,y:A.top/a,w:A.width/a,h:A.height/a};if(xp(A.pattern)?G.data=A.pattern:G.path=A.pattern,A.flipH&&(G.flipH=A.flipH),A.flipV&&(G.flipV=A.flipV),A.rotate&&(G.rotate=A.rotate),A.link){const Z=d(A.link);Z&&(G.hyperlink=Z)}F.addImage(G)}}else if(A.type==="line"){const G=af(A),Z=l(f3(G)),{minX:Q,maxX:q,minY:W,maxY:j}=oa(A),Y=at(A.color),re={x:A.left/a,y:A.top/a,w:(q-Q)/a,h:(j-W)/a,line:{color:Y.color,transparency:(1-Y.alpha)*100,width:A.width/o,dashType:c[A.style],beginArrowType:A.points[0]?"arrow":"none",endArrowType:A.points[1]?"arrow":"none"},points:Z};A.shadow&&(re.shadow=u(A.shadow)),F.addShape("custGeom",re)}else if(A.type==="chart"){const G=[];for(let Y=0;Y<A.data.series.length;Y++){const re=A.data.series[Y];G.push({name:`系列${Y+1}`,labels:A.data.labels,values:re})}let Z=[];if(A.themeColors.length===10)Z=A.themeColors.map(Y=>at(Y).color);else if(A.themeColors.length===1)Z=Je(A.themeColors[0]).analogous(10).map(Y=>at(Y.toHexString()).color);else{const Y=A.themeColors.length,re=Je(A.themeColors[Y-1]).analogous(11-Y).map(te=>te.toHexString());Z=[...A.themeColors.slice(0,Y-1),...re].map(te=>at(te).color)}const Q={x:A.left/a,y:A.top/a,w:A.width/a,h:A.height/a,chartColors:A.chartType==="pie"||A.chartType==="ring"?Z:Z.slice(0,A.data.series.length)},q=at(A.textColor||"#000000").color;Q.catAxisLabelColor=q,Q.valAxisLabelColor=q;const W=14/o;if(Q.catAxisLabelFontSize=W,Q.valAxisLabelFontSize=W,A.fill||A.outline){const Y={};A.fill&&(Y.fill={color:at(A.fill).color}),A.outline&&(Y.border={pt:A.outline.width/o,color:at(A.outline.color).color}),Q.plotArea=Y}(A.data.series.length>1&&A.chartType!=="scatter"||A.chartType==="pie"||A.chartType==="ring")&&(Q.showLegend=!0,Q.legendPos="b",Q.legendColor=q,Q.legendFontSize=W);let j=w.ChartType.bar;A.chartType==="bar"?(j=w.ChartType.bar,Q.barDir="col",(C=A.options)!=null&&C.stack&&(Q.barGrouping="stacked")):A.chartType==="column"?(j=w.ChartType.bar,Q.barDir="bar",(E=A.options)!=null&&E.stack&&(Q.barGrouping="stacked")):A.chartType==="line"?(j=w.ChartType.line,(P=A.options)!=null&&P.lineSmooth&&(Q.lineSmooth=!0)):A.chartType==="area"?j=w.ChartType.area:A.chartType==="radar"?j=w.ChartType.radar:A.chartType==="scatter"?(j=w.ChartType.scatter,Q.lineSize=0):A.chartType==="pie"?j=w.ChartType.pie:A.chartType==="ring"&&(j=w.ChartType.doughnut,Q.holeSize=60),F.addChart(j,G,Q)}else if(A.type==="table"){const G=[];for(let Y=0;Y<A.data.length;Y++){const re=A.data[Y];for(let te=0;te<re.length;te++){const ne=re[te];if(ne.colspan>1||ne.rowspan>1)for(let ge=Y;ge<Y+ne.rowspan;ge++)for(let Se=ge===Y?te+1:te;Se<te+ne.colspan;Se++)G.push(`${ge}_${Se}`)}}const Z=[],Q=A.theme;let q=null,W=[];Q&&(q=at(Q.color),W=_v(Q.color).map(Y=>at(Y)));for(let Y=0;Y<A.data.length;Y++){const re=A.data[Y],te=[];for(let ne=0;ne<re.length;ne++){const ge=re[ne],Se={colspan:ge.colspan,rowspan:ge.rowspan,bold:((D=ge.style)==null?void 0:D.bold)||!1,italic:((k=ge.style)==null?void 0:k.em)||!1,underline:{style:(N=ge.style)!=null&&N.underline?"sng":"none"},align:((I=ge.style)==null?void 0:I.align)||"left",valign:"middle",fontFace:((O=ge.style)==null?void 0:O.fontname)||"微软雅黑",fontSize:((z=ge.style)!=null&&z.fontsize?parseInt(($=ge.style)==null?void 0:$.fontsize):14)/o};if(Q&&q){let ie;Y%2===0?ie=W[1]:ie=W[0],(Q.rowHeader&&Y===0||Q.rowFooter&&Y===A.data.length-1||Q.colHeader&&ne===0||Q.colFooter&&ne===re.length-1)&&(ie=q),Se.fill={color:ie.color,transparency:(1-ie.alpha)*100}}if((R=ge.style)!=null&&R.backcolor){const ie=at(ge.style.backcolor);Se.fill={color:ie.color,transparency:(1-ie.alpha)*100}}(B=ge.style)!=null&&B.color&&(Se.color=at(ge.style.color).color),G.includes(`${Y}_${ne}`)||te.push({text:ge.text,options:Se})}te.length&&Z.push(te)}const j={x:A.left/a,y:A.top/a,w:A.width/a,h:A.height/a,colW:A.colWidths.map(Y=>A.width*Y/a)};A.theme&&(j.fill={color:"#ffffff"}),A.outline.width&&A.outline.color&&(j.border={type:A.outline.style==="solid"?"solid":"dash",pt:A.outline.width/o,color:at(A.outline.color).color}),F.addTable(Z,j)}else if(A.type==="latex"){const G=document.querySelector(`.thumbnail-list .base-element-${A.id} svg`),Q={data:y3(G),x:A.left/a,y:A.top/a,w:A.width/a,h:A.height/a};if(A.link){const q=d(A.link);q&&(Q.hyperlink=q)}F.addImage(Q)}else if(!m&&(A.type==="video"||A.type==="audio")){const G={x:A.left/a,y:A.top/a,w:A.width/a,h:A.height/a,path:A.src,type:A.type};A.type==="video"&&A.poster&&(G.cover=A.poster);const Z=A.src.match(/\.([a-zA-Z0-9]+)(?:[\?#]|$)/);Z&&Z[1]?G.extn=Z[1]:A.ext&&(G.extn=A.ext);const Q=["avi","mp4","m4v","mov","wmv"],q=["mp3","m4a","mp4","wav","wma"];G.extn&&[...Q,...q].includes(G.extn)&&F.addMedia(G)}}}setTimeout(()=>{if(y){w.writeFile({fileName:`${i}.pptx`}).then(b).catch(_);return}w.write({outputType:"blob"}).then(b).catch(_)},200)}}},aP=({initialSlidesData:e,onDataUpdate:t,renderPageExtra:r},n)=>{const{setSlides:i,setTheme:a,setViewportRatio:o,setViewportSize:s}=ke.getState(),{applyThemeToAllSlides:l,applyPresetTheme:u,applyFontToAllSlides:c}=Bk(),{exportPPTX:f}=iP();return S.useEffect(()=>{if(e){const{slides:d,theme:h,viewportRatio:p,viewportSize:v}=Ik(e);i(d),a(h),o(p),s(v)}},[]),S.useEffect(()=>{const d=ke.subscribe(h=>{const p={slides:h.slides,title:h.title,theme:h.theme,viewportRatio:h.viewportRatio};t(p)});return()=>d()},[t]),S.useImperativeHandle(n,()=>({applyThemeToAllSlides:l,applyPresetTheme:u,applyFontToAllSlides:c,exportPPTX:f})),S.createElement("div",{style:{width:"100%",height:"100%",position:"relative"}},S.createElement(kk,{renderPageExtra:r}))},oP=S.forwardRef(aP),si={thumbnails:"_thumbnails_1awpq_1",thumbnailList:"_thumbnailList_1awpq_6",thumbnailItem:"_thumbnailItem_1awpq_11",thumbnail:"_thumbnail_1awpq_1",active:"_active_1awpq_19",label:"_label_1awpq_25"};var Tp=Gs(),De=e=>Hs(e,Tp),Lp=Gs();De.write=e=>Hs(e,Lp);var Bc=Gs();De.onStart=e=>Hs(e,Bc);var Ep=Gs();De.onFrame=e=>Hs(e,Ep);var Mp=Gs();De.onFinish=e=>Hs(e,Mp);var oo=[];De.setTimeout=(e,t)=>{const r=De.now()+t,n=()=>{const a=oo.findIndex(o=>o.cancel==n);~a&&oo.splice(a,1),ui-=~a?1:0},i={time:r,handler:e,cancel:n};return oo.splice(_3(r),0,i),ui+=1,b3(),i};var _3=e=>~(~oo.findIndex(t=>t.time>e)||~oo.length);De.cancel=e=>{Bc.delete(e),Ep.delete(e),Mp.delete(e),Tp.delete(e),Lp.delete(e)},De.sync=e=>{Dp=!0,De.batchedUpdates(e),Dp=!1},De.throttle=e=>{let t;function r(){try{e(...t)}finally{t=null}}function n(...i){t=i,De.onStart(r)}return n.handler=e,n.cancel=()=>{Bc.delete(r),t=null},n};var Cp=typeof window<"u"?window.requestAnimationFrame:()=>{};De.use=e=>Cp=e,De.now=typeof performance<"u"?()=>performance.now():Date.now,De.batchedUpdates=e=>e(),De.catch=console.error,De.frameLoop="always",De.advance=()=>{De.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):w3()};var li=-1,ui=0,Dp=!1;function Hs(e,t){Dp?(t.delete(e),e(0)):(t.add(e),b3())}function b3(){li<0&&(li=0,De.frameLoop!=="demand"&&Cp(S3))}function sP(){li=-1}function S3(){~li&&(Cp(S3),De.batchedUpdates(w3))}function w3(){const e=li;li=De.now();const t=_3(li);if(t&&(x3(oo.splice(0,t),r=>r.handler()),ui-=t),!ui){sP();return}Bc.flush(),Tp.flush(e?Math.min(64,li-e):16.667),Ep.flush(),Lp.flush(),Mp.flush()}function Gs(){let e=new Set,t=e;return{add(r){ui+=t==e&&!e.has(r)?1:0,e.add(r)},delete(r){return ui-=t==e&&e.has(r)?1:0,e.delete(r)},flush(r){t.size&&(e=new Set,ui-=t.size,x3(t,n=>n(r)&&e.add(n)),ui+=e.size,t=e)}}}function x3(e,t){e.forEach(r=>{try{t(r)}catch(n){De.catch(n)}})}var lP=Object.defineProperty,uP=(e,t)=>{for(var r in t)lP(e,r,{get:t[r],enumerable:!0})},Rr={};uP(Rr,{assign:()=>fP,colors:()=>ci,createStringInterpolator:()=>Pp,skipAnimation:()=>L3,to:()=>T3,willAdvance:()=>Np});function Ap(){}var cP=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0}),ae={arr:Array.isArray,obj:e=>!!e&&e.constructor.name==="Object",fun:e=>typeof e=="function",str:e=>typeof e=="string",num:e=>typeof e=="number",und:e=>e===void 0};function xn(e,t){if(ae.arr(e)){if(!ae.arr(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return e===t}var $e=(e,t)=>e.forEach(t);function on(e,t,r){if(ae.arr(e)){for(let n=0;n<e.length;n++)t.call(r,e[n],`${n}`);return}for(const n in e)e.hasOwnProperty(n)&&t.call(r,e[n],n)}var sr=e=>ae.und(e)?[]:ae.arr(e)?e:[e];function Ws(e,t){if(e.size){const r=Array.from(e);e.clear(),$e(r,t)}}var Xs=(e,...t)=>Ws(e,r=>r(...t)),kp=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Pp,T3,ci=null,L3=!1,Np=Ap,fP=e=>{e.to&&(T3=e.to),e.now&&(De.now=e.now),e.colors!==void 0&&(ci=e.colors),e.skipAnimation!=null&&(L3=e.skipAnimation),e.createStringInterpolator&&(Pp=e.createStringInterpolator),e.requestAnimationFrame&&De.use(e.requestAnimationFrame),e.batchedUpdates&&(De.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Np=e.willAdvance),e.frameLoop&&(De.frameLoop=e.frameLoop)},Us=new Set,Tr=[],Op=[],$c=0,Rc={get idle(){return!Us.size&&!Tr.length},start(e){$c>e.priority?(Us.add(e),De.onStart(hP)):(E3(e),De(Ip))},advance:Ip,sort(e){if($c)De.onFrame(()=>Rc.sort(e));else{const t=Tr.indexOf(e);~t&&(Tr.splice(t,1),M3(e))}},clear(){Tr=[],Us.clear()}};function hP(){Us.forEach(E3),Us.clear(),De(Ip)}function E3(e){Tr.includes(e)||M3(e)}function M3(e){Tr.splice(dP(Tr,t=>t.priority>e.priority),0,e)}function Ip(e){const t=Op;for(let r=0;r<Tr.length;r++){const n=Tr[r];$c=n.priority,n.idle||(Np(n),n.advance(e),n.idle||t.push(n))}return $c=0,Op=Tr,Op.length=0,Tr=t,Tr.length>0}function dP(e,t){const r=e.findIndex(t);return r<0?e.length:r}var pP=(e,t,r)=>Math.min(Math.max(r,e),t),vP={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Vr="[-+]?\\d*\\.?\\d+",Vc=Vr+"%";function zc(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var gP=new RegExp("rgb"+zc(Vr,Vr,Vr)),mP=new RegExp("rgba"+zc(Vr,Vr,Vr,Vr)),yP=new RegExp("hsl"+zc(Vr,Vc,Vc)),_P=new RegExp("hsla"+zc(Vr,Vc,Vc,Vr)),bP=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,SP=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,wP=/^#([0-9a-fA-F]{6})$/,xP=/^#([0-9a-fA-F]{8})$/;function TP(e){let t;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=wP.exec(e))?parseInt(t[1]+"ff",16)>>>0:ci&&ci[e]!==void 0?ci[e]:(t=gP.exec(e))?(so(t[1])<<24|so(t[2])<<16|so(t[3])<<8|255)>>>0:(t=mP.exec(e))?(so(t[1])<<24|so(t[2])<<16|so(t[3])<<8|A3(t[4]))>>>0:(t=bP.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=xP.exec(e))?parseInt(t[1],16)>>>0:(t=SP.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=yP.exec(e))?(C3(D3(t[1]),Fc(t[2]),Fc(t[3]))|255)>>>0:(t=_P.exec(e))?(C3(D3(t[1]),Fc(t[2]),Fc(t[3]))|A3(t[4]))>>>0:null}function Bp(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function C3(e,t,r){const n=r<.5?r*(1+t):r+t-r*t,i=2*r-n,a=Bp(i,n,e+1/3),o=Bp(i,n,e),s=Bp(i,n,e-1/3);return Math.round(a*255)<<24|Math.round(o*255)<<16|Math.round(s*255)<<8}function so(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function D3(e){return(parseFloat(e)%360+360)%360/360}function A3(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function Fc(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function k3(e){let t=TP(e);if(t===null)return e;t=t||0;const r=(t&4278190080)>>>24,n=(t&16711680)>>>16,i=(t&65280)>>>8,a=(t&255)/255;return`rgba(${r}, ${n}, ${i}, ${a})`}var Ys=(e,t,r)=>{if(ae.fun(e))return e;if(ae.arr(e))return Ys({range:e,output:t,extrapolate:r});if(ae.str(e.output[0]))return Pp(e);const n=e,i=n.output,a=n.range||[0,1],o=n.extrapolateLeft||n.extrapolate||"extend",s=n.extrapolateRight||n.extrapolate||"extend",l=n.easing||(u=>u);return u=>{const c=EP(u,a);return LP(u,a[c],a[c+1],i[c],i[c+1],l,o,s,n.map)}};function LP(e,t,r,n,i,a,o,s,l){let u=l?l(e):e;if(u<t){if(o==="identity")return u;o==="clamp"&&(u=t)}if(u>r){if(s==="identity")return u;s==="clamp"&&(u=r)}return n===i?n:t===r?e<=t?n:i:(t===-1/0?u=-u:r===1/0?u=u-t:u=(u-t)/(r-t),u=a(u),n===-1/0?u=-u:i===1/0?u=u+n:u=u*(i-n)+n,u)}function EP(e,t){for(var r=1;r<t.length-1&&!(t[r]>=e);++r);return r-1}var MP=(e,t="end")=>r=>{r=t==="end"?Math.min(r,.999):Math.max(r,.001);const n=r*e,i=t==="end"?Math.floor(n):Math.ceil(n);return pP(0,1,i/e)},Hc=1.70158,Gc=Hc*1.525,P3=Hc+1,N3=2*Math.PI/3,O3=2*Math.PI/4.5,Wc=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,CP={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>e===0?0:Math.pow(2,10*e-10),easeOutExpo:e=>e===1?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>e===0?0:e===1?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>P3*e*e*e-Hc*e*e,easeOutBack:e=>1+P3*Math.pow(e-1,3)+Hc*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*((Gc+1)*2*e-Gc)/2:(Math.pow(2*e-2,2)*((Gc+1)*(e*2-2)+Gc)+2)/2,easeInElastic:e=>e===0?0:e===1?1:-Math.pow(2,10*e-10)*Math.sin((e*10-10.75)*N3),easeOutElastic:e=>e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e*10-.75)*N3)+1,easeInOutElastic:e=>e===0?0:e===1?1:e<.5?-(Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*O3))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*O3)/2+1,easeInBounce:e=>1-Wc(1-e),easeOutBounce:Wc,easeInOutBounce:e=>e<.5?(1-Wc(1-2*e))/2:(1+Wc(2*e-1))/2,steps:MP},qs=Symbol.for("FluidValue.get"),lo=Symbol.for("FluidValue.observers"),Lr=e=>!!(e&&e[qs]),Kt=e=>e&&e[qs]?e[qs]():e,I3=e=>e[lo]||null;function DP(e,t){e.eventObserved?e.eventObserved(t):e(t)}function Zs(e,t){const r=e[lo];r&&r.forEach(n=>{DP(n,t)})}var B3=class{constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");AP(this,e)}},AP=(e,t)=>$3(e,qs,t);function uo(e,t){if(e[qs]){let r=e[lo];r||$3(e,lo,r=new Set),r.has(t)||(r.add(t),e.observerAdded&&e.observerAdded(r.size,t))}return t}function js(e,t){const r=e[lo];if(r&&r.has(t)){const n=r.size-1;n?r.delete(t):e[lo]=null,e.observerRemoved&&e.observerRemoved(n,t)}}var $3=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0}),Xc=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,kP=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,R3=new RegExp(`(${Xc.source})(%|[a-z]+)`,"i"),PP=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Uc=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,V3=e=>{const[t,r]=NP(e);if(!t||kp())return e;const n=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(n)return n.trim();if(r&&r.startsWith("--")){const i=window.getComputedStyle(document.documentElement).getPropertyValue(r);return i||e}else{if(r&&Uc.test(r))return V3(r);if(r)return r}return e},NP=e=>{const t=Uc.exec(e);if(!t)return[,];const[,r,n]=t;return[r,n]},$p,OP=(e,t,r,n,i)=>`rgba(${Math.round(t)}, ${Math.round(r)}, ${Math.round(n)}, ${i})`,z3=e=>{$p||($p=ci?new RegExp(`(${Object.keys(ci).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map(a=>Kt(a).replace(Uc,V3).replace(kP,k3).replace($p,k3)),r=t.map(a=>a.match(Xc).map(Number)),i=r[0].map((a,o)=>r.map(s=>{if(!(o in s))throw Error('The arity of each "output" value must be equal');return s[o]})).map(a=>Ys({...e,output:a}));return a=>{var l;const o=!R3.test(t[0])&&((l=t.find(u=>R3.test(u)))==null?void 0:l.replace(Xc,""));let s=0;return t[0].replace(Xc,()=>`${i[s++](a)}${o||""}`).replace(PP,OP)}},Rp="react-spring: ",F3=e=>{const t=e;let r=!1;if(typeof t!="function")throw new TypeError(`${Rp}once requires a function parameter`);return(...n)=>{r||(t(...n),r=!0)}},IP=F3(console.warn);function BP(){IP(`${Rp}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var $P=F3(console.warn);function RP(){$P(`${Rp}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function Yc(e){return ae.str(e)&&(e[0]=="#"||/\d/.test(e)||!kp()&&Uc.test(e)||e in(ci||{}))}var Vp=kp()?S.useEffect:S.useLayoutEffect,VP=()=>{const e=S.useRef(!1);return Vp(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function H3(){const e=S.useState()[1],t=VP();return()=>{t.current&&e(Math.random())}}var G3=e=>S.useEffect(e,zP),zP=[];function W3(e){const t=S.useRef(void 0);return S.useEffect(()=>{t.current=e}),t.current}var Qs=Symbol.for("Animated:node"),FP=e=>!!e&&e[Qs]===e,sn=e=>e&&e[Qs],zp=(e,t)=>cP(e,Qs,t),qc=e=>e&&e[Qs]&&e[Qs].getPayload(),X3=class{constructor(){zp(this,this)}getPayload(){return this.payload||[]}},Zc=class S7 extends X3{constructor(t){super(),this._value=t,this.done=!0,this.durationProgress=0,ae.num(this._value)&&(this.lastPosition=this._value)}static create(t){return new S7(t)}getPayload(){return[this]}getValue(){return this._value}setValue(t,r){return ae.num(t)&&(this.lastPosition=t,r&&(t=Math.round(t/r)*r,this.done&&(this.lastPosition=t))),this._value===t?!1:(this._value=t,!0)}reset(){const{done:t}=this;this.done=!1,ae.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,t&&(this.lastVelocity=null),this.v0=null)}},jc=class w7 extends Zc{constructor(t){super(0),this._string=null,this._toString=Ys({output:[t,t]})}static create(t){return new w7(t)}getValue(){const t=this._string;return t??(this._string=this._toString(this._value))}setValue(t){if(ae.str(t)){if(t==this._string)return!1;this._string=t,this._value=1}else if(super.setValue(t))this._string=null;else return!1;return!0}reset(t){t&&(this._toString=Ys({output:[this.getValue(),t]})),this._value=0,super.reset()}},Qc={dependencies:null},Kc=class extends X3{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return on(this.source,(r,n)=>{FP(r)?t[n]=r.getValue(e):Lr(r)?t[n]=Kt(r):e||(t[n]=r)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&$e(this.payload,e=>e.reset())}_makePayload(e){if(e){const t=new Set;return on(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Qc.dependencies&&Lr(e)&&Qc.dependencies.add(e);const t=qc(e);t&&$e(t,r=>this.add(r))}},HP=class x7 extends Kc{constructor(t){super(t)}static create(t){return new x7(t)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){const r=this.getPayload();return t.length==r.length?r.map((n,i)=>n.setValue(t[i])).some(Boolean):(super.setValue(t.map(GP)),!0)}};function GP(e){return(Yc(e)?jc:Zc).create(e)}function Fp(e){const t=sn(e);return t?t.constructor:ae.arr(e)?HP:Yc(e)?jc:Zc}var U3=(e,t)=>{const r=!ae.fun(e)||e.prototype&&e.prototype.isReactComponent;return S.forwardRef((n,i)=>{const a=S.useRef(null),o=r&&S.useCallback(p=>{a.current=UP(i,p)},[i]),[s,l]=XP(n,t),u=H3(),c=()=>{const p=a.current;if(r&&!p)return;(p?t.applyAnimatedValues(p,s.getValue(!0)):!1)===!1&&u()},f=new WP(c,l),d=S.useRef(void 0);Vp(()=>(d.current=f,$e(l,p=>uo(p,f)),()=>{d.current&&($e(d.current.deps,p=>js(p,d.current)),De.cancel(d.current.update))})),S.useEffect(c,[]),G3(()=>()=>{const p=d.current;$e(p.deps,v=>js(v,p))});const h=t.getComponentProps(s.getValue());return ov.createElement(e,{...h,ref:o})})},WP=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){e.type=="change"&&De.write(this.update)}};function XP(e,t){const r=new Set;return Qc.dependencies=r,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new Kc(e),Qc.dependencies=null,[e,r]}function UP(e,t){return e&&(ae.fun(e)?e(t):e.current=t),t}var Y3=Symbol.for("AnimatedComponent"),YP=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:r=i=>new Kc(i),getComponentProps:n=i=>i}={})=>{const i={applyAnimatedValues:t,createAnimatedStyle:r,getComponentProps:n},a=o=>{const s=q3(o)||"Anonymous";return ae.str(o)?o=a[o]||(a[o]=U3(o,i)):o=o[Y3]||(o[Y3]=U3(o,i)),o.displayName=`Animated(${s})`,o};return on(e,(o,s)=>{ae.arr(e)&&(s=q3(o)),a[s]=a(o)}),{animated:a}},q3=e=>ae.str(e)?e:e&&ae.str(e.displayName)?e.displayName:ae.fun(e)&&e.name||null;function na(e,...t){return ae.fun(e)?e(...t):e}var Ks=(e,t)=>e===!0||!!(t&&e&&(ae.fun(e)?e(t):sr(e).includes(t))),Z3=(e,t)=>ae.obj(e)?t&&e[t]:e,j3=(e,t)=>e.default===!0?e[t]:e.default?e.default[t]:void 0,qP=e=>e,Hp=(e,t=qP)=>{let r=ZP;e.default&&e.default!==!0&&(e=e.default,r=Object.keys(e));const n={};for(const i of r){const a=t(e[i],i);ae.und(a)||(n[i]=a)}return n},ZP=["config","onProps","onStart","onChange","onPause","onResume","onRest"],jP={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function QP(e){const t={};let r=0;if(on(e,(n,i)=>{jP[i]||(t[i]=n,r++)}),r)return t}function Q3(e){const t=QP(e);if(t){const r={to:t};return on(e,(n,i)=>i in t||(r[i]=n)),r}return{...e}}function Js(e){return e=Kt(e),ae.arr(e)?e.map(Js):Yc(e)?Rr.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function KP(e){for(const t in e)return!0;return!1}function Gp(e){return ae.fun(e)||ae.arr(e)&&ae.obj(e[0])}function JP(e,t){var r;(r=e.ref)==null||r.delete(e),t==null||t.delete(e)}function eN(e,t){var r;t&&e.ref!==t&&((r=e.ref)==null||r.delete(e),t.add(e),e.ref=t)}var tN={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},Wp={...tN.default,mass:1,damping:1,easing:CP.linear,clamp:!1},rN=class{constructor(){this.velocity=0,Object.assign(this,Wp)}};function nN(e,t,r){r&&(r={...r},K3(r,t),t={...r,...t}),K3(e,t),Object.assign(e,t);for(const o in Wp)e[o]==null&&(e[o]=Wp[o]);let{frequency:n,damping:i}=e;const{mass:a}=e;return ae.und(n)||(n<.01&&(n=.01),i<0&&(i=0),e.tension=Math.pow(2*Math.PI/n,2)*a,e.friction=4*Math.PI*i*a/n),e}function K3(e,t){if(!ae.und(t.decay))e.duration=void 0;else{const r=!ae.und(t.tension)||!ae.und(t.friction);(r||!ae.und(t.frequency)||!ae.und(t.damping)||!ae.und(t.mass))&&(e.duration=void 0,e.decay=void 0),r&&(e.frequency=void 0)}}var J3=[],iN=class{constructor(){this.changed=!1,this.values=J3,this.toValues=null,this.fromValues=J3,this.config=new rN,this.immediate=!1}};function e7(e,{key:t,props:r,defaultProps:n,state:i,actions:a}){return new Promise((o,s)=>{let l,u,c=Ks(r.cancel??(n==null?void 0:n.cancel),t);if(c)h();else{ae.und(r.pause)||(i.paused=Ks(r.pause,t));let p=n==null?void 0:n.pause;p!==!0&&(p=i.paused||Ks(p,t)),l=na(r.delay||0,t),p?(i.resumeQueue.add(d),a.pause()):(a.resume(),d())}function f(){i.resumeQueue.add(d),i.timeouts.delete(u),u.cancel(),l=u.time-De.now()}function d(){l>0&&!Rr.skipAnimation?(i.delayed=!0,u=De.setTimeout(h,l),i.pauseQueue.add(f),i.timeouts.add(u)):h()}function h(){i.delayed&&(i.delayed=!1),i.pauseQueue.delete(f),i.timeouts.delete(u),e<=(i.cancelId||0)&&(c=!0);try{a.start({...r,callId:e,cancel:c},o)}catch(p){s(p)}}})}var Xp=(e,t)=>t.length==1?t[0]:t.some(r=>r.cancelled)?co(e.get()):t.every(r=>r.noop)?t7(e.get()):zr(e.get(),t.every(r=>r.finished)),t7=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),zr=(e,t,r=!1)=>({value:e,finished:t,cancelled:r}),co=e=>({value:e,cancelled:!0,finished:!1});function r7(e,t,r,n){const{callId:i,parentId:a,onRest:o}=t,{asyncTo:s,promise:l}=r;return!a&&e===s&&!t.reset?l:r.promise=(async()=>{r.asyncId=i,r.asyncTo=e;const u=Hp(t,(g,m)=>m==="onRest"?void 0:g);let c,f;const d=new Promise((g,m)=>(c=g,f=m)),h=g=>{const m=i<=(r.cancelId||0)&&co(n)||i!==r.asyncId&&zr(n,!1);if(m)throw g.result=m,f(g),g},p=(g,m)=>{const y=new n7,_=new i7;return(async()=>{if(Rr.skipAnimation)throw el(r),_.result=zr(n,!1),f(_),_;h(y);const b=ae.obj(g)?{...g}:{...m,to:g};b.parentId=i,on(u,(x,T)=>{ae.und(b[T])&&(b[T]=x)});const w=await n.start(b);return h(y),r.paused&&await new Promise(x=>{r.resumeQueue.add(x)}),w})()};let v;if(Rr.skipAnimation)return el(r),zr(n,!1);try{let g;ae.arr(e)?g=(async m=>{for(const y of m)await p(y)})(e):g=Promise.resolve(e(p,n.stop.bind(n))),await Promise.all([g.then(c),d]),v=zr(n.get(),!0,!1)}catch(g){if(g instanceof n7)v=g.result;else if(g instanceof i7)v=g.result;else throw g}finally{i==r.asyncId&&(r.asyncId=a,r.asyncTo=a?s:void 0,r.promise=a?l:void 0)}return ae.fun(o)&&De.batchedUpdates(()=>{o(v,n,n.item)}),v})()}function el(e,t){Ws(e.timeouts,r=>r.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var n7=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},i7=class extends Error{constructor(){super("SkipAnimationSignal")}},Up=e=>e instanceof Yp,aN=1,Yp=class extends B3{constructor(){super(...arguments),this.id=aN++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=sn(this);return e&&e.getValue()}to(...e){return Rr.to(this,e)}interpolate(...e){return BP(),Rr.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Zs(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Rc.sort(this),Zs(this,{type:"priority",parent:this,priority:e})}},ia=Symbol.for("SpringPhase"),a7=1,qp=2,Zp=4,jp=e=>(e[ia]&a7)>0,fi=e=>(e[ia]&qp)>0,tl=e=>(e[ia]&Zp)>0,o7=(e,t)=>t?e[ia]|=qp|a7:e[ia]&=~qp,s7=(e,t)=>t?e[ia]|=Zp:e[ia]&=~Zp,oN=class extends Yp{constructor(e,t){if(super(),this.animation=new iN,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!ae.und(e)||!ae.und(t)){const r=ae.obj(e)?{...e}:{...t,from:e};ae.und(r.default)&&(r.default=!0),this.start(r)}}get idle(){return!(fi(this)||this._state.asyncTo)||tl(this)}get goal(){return Kt(this.animation.to)}get velocity(){const e=sn(this);return e instanceof Zc?e.lastVelocity||0:e.getPayload().map(t=>t.lastVelocity||0)}get hasAnimated(){return jp(this)}get isAnimating(){return fi(this)}get isPaused(){return tl(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,r=!1;const n=this.animation;let{toValues:i}=n;const{config:a}=n,o=qc(n.to);!o&&Lr(n.to)&&(i=sr(Kt(n.to))),n.values.forEach((u,c)=>{if(u.done)return;const f=u.constructor==jc?1:o?o[c].lastPosition:i[c];let d=n.immediate,h=f;if(!d){if(h=u.lastPosition,a.tension<=0){u.done=!0;return}let p=u.elapsedTime+=e;const v=n.fromValues[c],g=u.v0!=null?u.v0:u.v0=ae.arr(a.velocity)?a.velocity[c]:a.velocity;let m;const y=a.precision||(v==f?.005:Math.min(1,Math.abs(f-v)*.001));if(ae.und(a.duration))if(a.decay){const _=a.decay===!0?.998:a.decay,b=Math.exp(-(1-_)*p);h=v+g/(1-_)*(1-b),d=Math.abs(u.lastPosition-h)<=y,m=g*b}else{m=u.lastVelocity==null?g:u.lastVelocity;const _=a.restVelocity||y/10,b=a.clamp?0:a.bounce,w=!ae.und(b),x=v==f?u.v0>0:v<f;let T,L=!1;const M=1,C=Math.ceil(e/M);for(let E=0;E<C&&(T=Math.abs(m)>_,!(!T&&(d=Math.abs(f-h)<=y,d)));++E){w&&(L=h==f||h>f==x,L&&(m=-m*b,h=f));const P=-a.tension*1e-6*(h-f),D=-a.friction*.001*m,k=(P+D)/a.mass;m=m+k*M,h=h+m*M}}else{let _=1;a.duration>0&&(this._memoizedDuration!==a.duration&&(this._memoizedDuration=a.duration,u.durationProgress>0&&(u.elapsedTime=a.duration*u.durationProgress,p=u.elapsedTime+=e)),_=(a.progress||0)+p/this._memoizedDuration,_=_>1?1:_<0?0:_,u.durationProgress=_),h=v+a.easing(_)*(f-v),m=(h-u.lastPosition)/e,d=_==1}u.lastVelocity=m,Number.isNaN(h)&&(console.warn("Got NaN while animating:",this),d=!0)}o&&!o[c].done&&(d=!1),d?u.done=!0:t=!1,u.setValue(h,a.round)&&(r=!0)});const s=sn(this),l=s.getValue();if(t){const u=Kt(n.to);(l!==u||r)&&!a.decay?(s.setValue(u),this._onChange(u)):r&&a.decay&&this._onChange(l),this._stop()}else r&&this._onChange(l)}set(e){return De.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(fi(this)){const{to:e,config:t}=this.animation;De.batchedUpdates(()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let r;return ae.und(e)?(r=this.queue||[],this.queue=[]):r=[ae.obj(e)?e:{...t,to:e}],Promise.all(r.map(n=>this._update(n))).then(n=>Xp(this,n))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),el(this._state,e&&this._lastCallId),De.batchedUpdates(()=>this._stop(t,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:r,from:n}=e;r=ae.obj(r)?r[t]:r,(r==null||Gp(r))&&(r=void 0),n=ae.obj(n)?n[t]:n,n==null&&(n=void 0);const i={to:r,from:n};return jp(this)||(e.reverse&&([r,n]=[n,r]),n=Kt(n),ae.und(n)?sn(this)||this._set(r):this._set(n)),i}_update({...e},t){const{key:r,defaultProps:n}=this;e.default&&Object.assign(n,Hp(e,(o,s)=>/^on/.test(s)?Z3(o,r):o)),c7(this,e,"onProps"),il(this,"onProps",e,this);const i=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const a=this._state;return e7(++this._lastCallId,{key:r,props:e,defaultProps:n,state:a,actions:{pause:()=>{tl(this)||(s7(this,!0),Xs(a.pauseQueue),il(this,"onPause",zr(this,rl(this,this.animation.to)),this))},resume:()=>{tl(this)&&(s7(this,!1),fi(this)&&this._resume(),Xs(a.resumeQueue),il(this,"onResume",zr(this,rl(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then(o=>{if(e.loop&&o.finished&&!(t&&o.noop)){const s=l7(e);if(s)return this._update(s,!0)}return o})}_merge(e,t,r){if(t.cancel)return this.stop(!0),r(co(this));const n=!ae.und(e.to),i=!ae.und(e.from);if(n||i)if(t.callId>this._lastToId)this._lastToId=t.callId;else return r(co(this));const{key:a,defaultProps:o,animation:s}=this,{to:l,from:u}=s;let{to:c=l,from:f=u}=e;i&&!n&&(!t.default||ae.und(c))&&(c=f),t.reverse&&([c,f]=[f,c]);const d=!xn(f,u);d&&(s.from=f),f=Kt(f);const h=!xn(c,l);h&&this._focus(c);const p=Gp(t.to),{config:v}=s,{decay:g,velocity:m}=v;(n||i)&&(v.velocity=0),t.config&&!p&&nN(v,na(t.config,a),t.config!==o.config?na(o.config,a):void 0);let y=sn(this);if(!y||ae.und(c))return r(zr(this,!0));const _=ae.und(t.reset)?i&&!t.default:!ae.und(f)&&Ks(t.reset,a),b=_?f:this.get(),w=Js(c),x=ae.num(w)||ae.arr(w)||Yc(w),T=!p&&(!x||Ks(o.immediate||t.immediate,a));if(h){const E=Fp(c);if(E!==y.constructor)if(T)y=this._set(w);else throw Error(`Cannot animate between ${y.constructor.name} and ${E.name}, as the "to" prop suggests`)}const L=y.constructor;let M=Lr(c),C=!1;if(!M){const E=_||!jp(this)&&d;(h||E)&&(C=xn(Js(b),w),M=!C),(!xn(s.immediate,T)&&!T||!xn(v.decay,g)||!xn(v.velocity,m))&&(M=!0)}if(C&&fi(this)&&(s.changed&&!_?M=!0:M||this._stop(l)),!p&&((M||Lr(l))&&(s.values=y.getPayload(),s.toValues=Lr(c)?null:L==jc?[1]:sr(w)),s.immediate!=T&&(s.immediate=T,!T&&!_&&this._set(l)),M)){const{onRest:E}=s;$e(lN,D=>c7(this,t,D));const P=zr(this,rl(this,l));Xs(this._pendingCalls,P),this._pendingCalls.add(r),s.changed&&De.batchedUpdates(()=>{var D;s.changed=!_,E==null||E(P,this),_?na(o.onRest,P):(D=s.onStart)==null||D.call(s,P,this)})}_&&this._set(b),p?r(r7(t.to,t,this._state,this)):M?this._start():fi(this)&&!h?this._pendingCalls.add(r):r(t7(b))}_focus(e){const t=this.animation;e!==t.to&&(I3(this)&&this._detach(),t.to=e,I3(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Lr(t)&&(uo(t,this),Up(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Lr(e)&&js(e,this)}_set(e,t=!0){const r=Kt(e);if(!ae.und(r)){const n=sn(this);if(!n||!xn(r,n.getValue())){const i=Fp(r);!n||n.constructor!=i?zp(this,i.create(r)):n.setValue(r),n&&De.batchedUpdates(()=>{this._onChange(r,t)})}}return sn(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,il(this,"onStart",zr(this,rl(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),na(this.animation.onChange,e,this)),na(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;sn(this).reset(Kt(e.to)),e.immediate||(e.fromValues=e.values.map(t=>t.lastPosition)),fi(this)||(o7(this,!0),tl(this)||this._resume())}_resume(){Rr.skipAnimation?this.finish():Rc.start(this)}_stop(e,t){if(fi(this)){o7(this,!1);const r=this.animation;$e(r.values,i=>{i.done=!0}),r.toValues&&(r.onChange=r.onPause=r.onResume=void 0),Zs(this,{type:"idle",parent:this});const n=t?co(this.get()):zr(this.get(),rl(this,e??r.to));Xs(this._pendingCalls,n),r.changed&&(r.changed=!1,il(this,"onRest",n,this))}}};function rl(e,t){const r=Js(t),n=Js(e.get());return xn(n,r)}function l7(e,t=e.loop,r=e.to){const n=na(t);if(n){const i=n!==!0&&Q3(n),a=(i||e).reverse,o=!i||i.reset;return nl({...e,loop:t,default:!1,pause:void 0,to:!a||Gp(r)?r:void 0,from:o?e.from:void 0,reset:o,...i})}}function nl(e){const{to:t,from:r}=e=Q3(e),n=new Set;return ae.obj(t)&&u7(t,n),ae.obj(r)&&u7(r,n),e.keys=n.size?Array.from(n):null,e}function sN(e){const t=nl(e);return ae.und(t.default)&&(t.default=Hp(t)),t}function u7(e,t){on(e,(r,n)=>r!=null&&t.add(n))}var lN=["onStart","onRest","onChange","onPause","onResume"];function c7(e,t,r){e.animation[r]=t[r]!==j3(t,r)?Z3(t[r],e.key):void 0}function il(e,t,...r){var n,i,a,o;(i=(n=e.animation)[t])==null||i.call(n,...r),(o=(a=e.defaultProps)[t])==null||o.call(a,...r)}var uN=["onStart","onChange","onRest"],cN=1,fN=class{constructor(e,t){this.id=cN++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each((t,r)=>e[r]=t.get()),e}set(e){for(const t in e){const r=e[t];ae.und(r)||this.springs[t].set(r)}}update(e){return e&&this.queue.push(nl(e)),this}start(e){let{queue:t}=this;return e?t=sr(e).map(nl):this.queue=[],this._flush?this._flush(this,t):(g7(this,t),Qp(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const r=this.springs;$e(sr(t),n=>r[n].stop(!!e))}else el(this._state,this._lastAsyncId),this.each(r=>r.stop(!!e));return this}pause(e){if(ae.und(e))this.start({pause:!0});else{const t=this.springs;$e(sr(e),r=>t[r].pause())}return this}resume(e){if(ae.und(e))this.start({pause:!1});else{const t=this.springs;$e(sr(e),r=>t[r].resume())}return this}each(e){on(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:r}=this._events,n=this._active.size>0,i=this._changed.size>0;(n&&!this._started||i&&!this._started)&&(this._started=!0,Ws(e,([s,l])=>{l.value=this.get(),s(l,this,this._item)}));const a=!n&&this._started,o=i||a&&r.size?this.get():null;i&&t.size&&Ws(t,([s,l])=>{l.value=o,s(l,this,this._item)}),a&&(this._started=!1,Ws(r,([s,l])=>{l.value=o,s(l,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;De.onFrame(this._onFrame)}};function Qp(e,t){return Promise.all(t.map(r=>f7(e,r))).then(r=>Xp(e,r))}async function f7(e,t,r){const{keys:n,to:i,from:a,loop:o,onRest:s,onResolve:l}=t,u=ae.obj(t.default)&&t.default;o&&(t.loop=!1),i===!1&&(t.to=null),a===!1&&(t.from=null);const c=ae.arr(i)||ae.fun(i)?i:void 0;c?(t.to=void 0,t.onRest=void 0,u&&(u.onRest=void 0)):$e(uN,v=>{const g=t[v];if(ae.fun(g)){const m=e._events[v];t[v]=({finished:y,cancelled:_})=>{const b=m.get(g);b?(y||(b.finished=!1),_&&(b.cancelled=!0)):m.set(g,{value:null,finished:y||!1,cancelled:_||!1})},u&&(u[v]=t[v])}});const f=e._state;t.pause===!f.paused?(f.paused=t.pause,Xs(t.pause?f.pauseQueue:f.resumeQueue)):f.paused&&(t.pause=!0);const d=(n||Object.keys(e.springs)).map(v=>e.springs[v].start(t)),h=t.cancel===!0||j3(t,"cancel")===!0;(c||h&&f.asyncId)&&d.push(e7(++e._lastAsyncId,{props:t,state:f,actions:{pause:Ap,resume:Ap,start(v,g){h?(el(f,e._lastAsyncId),g(co(e))):(v.onRest=s,g(r7(c,v,f,e)))}}})),f.paused&&await new Promise(v=>{f.resumeQueue.add(v)});const p=Xp(e,await Promise.all(d));if(o&&p.finished&&!(r&&p.noop)){const v=l7(t,o,i);if(v)return g7(e,[v]),f7(e,v,!0)}return l&&De.batchedUpdates(()=>l(p,e,e.item)),p}function h7(e,t){const r={...e.springs};return t&&$e(sr(t),n=>{ae.und(n.keys)&&(n=nl(n)),ae.obj(n.to)||(n={...n,to:void 0}),v7(r,n,i=>p7(i))}),d7(e,r),r}function d7(e,t){on(t,(r,n)=>{e.springs[n]||(e.springs[n]=r,uo(r,e))})}function p7(e,t){const r=new oN;return r.key=e,t&&uo(r,t),r}function v7(e,t,r){t.keys&&$e(t.keys,n=>{(e[n]||(e[n]=r(n)))._prepareNode(t)})}function g7(e,t){$e(t,r=>{v7(e.springs,r,n=>p7(n,e))})}var hN=ov.createContext({pause:!1,immediate:!1}),dN=()=>{const e=[],t=function(n){RP();const i=[];return $e(e,(a,o)=>{if(ae.und(n))i.push(a.start());else{const s=r(n,a,o);s&&i.push(a.start(s))}}),i};t.current=e,t.add=function(n){e.includes(n)||e.push(n)},t.delete=function(n){const i=e.indexOf(n);~i&&e.splice(i,1)},t.pause=function(){return $e(e,n=>n.pause(...arguments)),this},t.resume=function(){return $e(e,n=>n.resume(...arguments)),this},t.set=function(n){$e(e,(i,a)=>{const o=ae.fun(n)?n(a,i):n;o&&i.set(o)})},t.start=function(n){const i=[];return $e(e,(a,o)=>{if(ae.und(n))i.push(a.start());else{const s=this._getProps(n,a,o);s&&i.push(a.start(s))}}),i},t.stop=function(){return $e(e,n=>n.stop(...arguments)),this},t.update=function(n){return $e(e,(i,a)=>i.update(this._getProps(n,i,a))),this};const r=function(n,i,a){return ae.fun(n)?n(a,i):n};return t._getProps=r,t};function pN(e,t,r){const n=ae.fun(t)&&t;n&&!r&&(r=[]);const i=S.useMemo(()=>n||arguments.length==3?dN():void 0,[]),a=S.useRef(0),o=H3(),s=S.useMemo(()=>({ctrls:[],queue:[],flush(m,y){const _=h7(m,y);return a.current>0&&!s.queue.length&&!Object.keys(_).some(w=>!m.springs[w])?Qp(m,y):new Promise(w=>{d7(m,_),s.queue.push(()=>{w(Qp(m,y))}),o()})}}),[]),l=S.useRef([...s.ctrls]),u=S.useRef([]),c=W3(e)||0;S.useMemo(()=>{$e(l.current.slice(e,c),m=>{JP(m,i),m.stop(!0)}),l.current.length=e,f(c,e)},[e]),S.useMemo(()=>{f(0,Math.min(c,e))},r);function f(m,y){for(let _=m;_<y;_++){const b=l.current[_]||(l.current[_]=new fN(null,s.flush)),w=n?n(_,b):t[_];w&&(u.current[_]=sN(w))}}const d=l.current.map((m,y)=>h7(m,u.current[y])),h=S.useContext(hN),p=W3(h),v=h!==p&&KP(h);Vp(()=>{a.current++,s.ctrls=l.current;const{queue:m}=s;m.length&&(s.queue=[],$e(m,y=>y())),$e(l.current,(y,_)=>{i==null||i.add(y),v&&y.start({default:h});const b=u.current[_];b&&(eN(y,b.ref),y.ref?y.queue.push(b):y.start(b))})}),G3(()=>()=>{$e(s.ctrls,m=>m.stop(!0))});const g=d.map(m=>({...m}));return i?[g,i]:g}function vN(e,t){const r=ae.fun(e),[[n],i]=pN(1,r?e:[e],r?[]:t);return r||arguments.length==2?[n,i]:n}var gN=class extends Yp{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=Ys(...t);const r=this._get(),n=Fp(r);zp(this,n.create(r))}advance(e){const t=this._get(),r=this.get();xn(t,r)||(sn(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&m7(this._active)&&Kp(this)}_get(){const e=ae.arr(this.source)?this.source.map(Kt):sr(Kt(this.source));return this.calc(...e)}_start(){this.idle&&!m7(this._active)&&(this.idle=!1,$e(qc(this),e=>{e.done=!1}),Rr.skipAnimation?(De.batchedUpdates(()=>this.advance()),Kp(this)):Rc.start(this))}_attach(){let e=1;$e(sr(this.source),t=>{Lr(t)&&uo(t,this),Up(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){$e(sr(this.source),e=>{Lr(e)&&js(e,this)}),this._active.clear(),Kp(this)}eventObserved(e){e.type=="change"?e.idle?this.advance():(this._active.add(e.parent),this._start()):e.type=="idle"?this._active.delete(e.parent):e.type=="priority"&&(this.priority=sr(this.source).reduce((t,r)=>Math.max(t,(Up(r)?r.priority:0)+1),0))}};function mN(e){return e.idle!==!1}function m7(e){return!e.size||Array.from(e).every(mN)}function Kp(e){e.idle||(e.idle=!0,$e(qc(e),t=>{t.done=!0}),Zs(e,{type:"idle",parent:e}))}Rr.assign({createStringInterpolator:z3,to:(e,t)=>new gN(e,t)});var y7=/^--/;function yN(e,t){return t==null||typeof t=="boolean"||t===""?"":typeof t=="number"&&t!==0&&!y7.test(e)&&!(al.hasOwnProperty(e)&&al[e])?t+"px":(""+t).trim()}var _7={};function _N(e,t){if(!e.nodeType||!e.setAttribute)return!1;const r=e.nodeName==="filter"||e.parentNode&&e.parentNode.nodeName==="filter",{className:n,style:i,children:a,scrollTop:o,scrollLeft:s,viewBox:l,...u}=t,c=Object.values(u),f=Object.keys(u).map(d=>r||e.hasAttribute(d)?d:_7[d]||(_7[d]=d.replace(/([A-Z])/g,h=>"-"+h.toLowerCase())));a!==void 0&&(e.textContent=a);for(const d in i)if(i.hasOwnProperty(d)){const h=yN(d,i[d]);y7.test(d)?e.style.setProperty(d,h):e.style[d]=h}f.forEach((d,h)=>{e.setAttribute(d,c[h])}),n!==void 0&&(e.className=n),o!==void 0&&(e.scrollTop=o),s!==void 0&&(e.scrollLeft=s),l!==void 0&&e.setAttribute("viewBox",l)}var al={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},bN=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1),SN=["Webkit","Ms","Moz","O"];al=Object.keys(al).reduce((e,t)=>(SN.forEach(r=>e[bN(r,t)]=e[t]),e),al);var wN=/^(matrix|translate|scale|rotate|skew)/,xN=/^(translate)/,TN=/^(rotate|skew)/,Jp=(e,t)=>ae.num(e)&&e!==0?e+t:e,Jc=(e,t)=>ae.arr(e)?e.every(r=>Jc(r,t)):ae.num(e)?e===t:parseFloat(e)===t,LN=class extends Kc{constructor({x:e,y:t,z:r,...n}){const i=[],a=[];(e||t||r)&&(i.push([e||0,t||0,r||0]),a.push(o=>[`translate3d(${o.map(s=>Jp(s,"px")).join(",")})`,Jc(o,0)])),on(n,(o,s)=>{if(s==="transform")i.push([o||""]),a.push(l=>[l,l===""]);else if(wN.test(s)){if(delete n[s],ae.und(o))return;const l=xN.test(s)?"px":TN.test(s)?"deg":"";i.push(sr(o)),a.push(s==="rotate3d"?([u,c,f,d])=>[`rotate3d(${u},${c},${f},${Jp(d,l)})`,Jc(d,0)]:u=>[`${s}(${u.map(c=>Jp(c,l)).join(",")})`,Jc(u,s.startsWith("scale")?1:0)])}}),i.length&&(n.transform=new EN(i,a)),super(n)}},EN=class extends B3{constructor(e,t){super(),this.inputs=e,this.transforms=t,this._value=null}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return $e(this.inputs,(r,n)=>{const i=Kt(r[0]),[a,o]=this.transforms[n](ae.arr(i)?i:r.map(Kt));e+=" "+a,t=t&&o}),t?"none":e}observerAdded(e){e==1&&$e(this.inputs,t=>$e(t,r=>Lr(r)&&uo(r,this)))}observerRemoved(e){e==0&&$e(this.inputs,t=>$e(t,r=>Lr(r)&&js(r,this)))}eventObserved(e){e.type=="change"&&(this._value=null),Zs(this,e)}},MN=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];Rr.assign({batchedUpdates:k7.unstable_batchedUpdates,createStringInterpolator:z3,colors:vP});var CN=YP(MN,{applyAnimatedValues:_N,createAnimatedStyle:e=>new LN(e),getComponentProps:({scrollTop:e,scrollLeft:t,...r})=>r}),DN=CN.animated;const AN=({slide:e,index:t,selected:r,active:n,onClick:i})=>{const a=S.useRef(null);return S.createElement("div",{ref:a,className:Me(si.thumbnailItem,{[si.active]:n,[si.selected]:r}),onClick:i},S.createElement("div",{className:si.thumbnail},S.createElement(c3,{slide:e,size:112})),S.createElement("div",{className:Me(si.label)},J7(t+1,2)))},kN=({className:e})=>{const{selectedSlidesIndex:t,updateSelectedSlidesIndex:r}=_e(),{slides:n,slideIndex:i,updateSlideIndex:a}=ke(),o=S.useMemo(()=>[...t,i],[t,i]),s=S.useRef(null),[{scrollTop:l},u]=vN(()=>({scrollTop:0,config:{tension:300,clamp:!0}})),c=()=>{const h=s.current;if(!h)return;const p=h.children.item(0);if(!p)return;const v=p.children.item(i);if(!v)return;const g=h.offsetHeight,y=h.scrollHeight-g;if(y<=0){u.start({scrollTop:0,from:{scrollTop:h.scrollTop}});return}const _=v.offsetTop,b=v.offsetHeight,w=Math.max(0,Math.min(_-(g-b)/2,y));u.start({scrollTop:w,from:{scrollTop:h.scrollTop}})},f=h=>{r([]),i!==h&&a(h)},d=h=>{r([]),f(h)};return S.useEffect(()=>{c()},[i,n.length]),S.createElement(DN.div,{className:Me(si.thumbnails,e),ref:s,scrollTop:l},S.createElement("div",{className:Me("thumbnail-list",si.thumbnailList)},n.map((h,p)=>S.createElement("div",{className:si.thumbnailContainer,key:h.id},S.createElement(AN,{slide:h,index:p,active:i===p,selected:o.includes(p),onClick:()=>d(p)})))))},PN=()=>S.createElement(kN,null);Ie.ElementTypes=Ge,Ie.PPTCanvas=oP,Ie.PPThumbnails=PN,Ie.ShapePathFormulasKeys=Pe,Object.defineProperty(Ie,Symbol.toStringTag,{value:"Module"})});
43
+ `))}if(H.elements){for(const A of H.elements)if(A.type==="text"){const G=s(A.content),Z={x:A.left/a,y:A.top/a,w:A.width/a,h:A.height/a,fontSize:Ic/o,fontFace:"微软雅黑",color:"#000000",valign:"top",margin:10/o,paraSpaceBefore:5/o,lineSpacingMultiple:1.5/1.25,autoFit:!0};if(A.rotate&&(Z.rotate=A.rotate),A.wordSpace&&(Z.charSpacing=A.wordSpace/o),A.lineHeight&&(Z.lineSpacingMultiple=A.lineHeight/1.25),A.fill){const Q=at(A.fill),q=A.opacity===void 0?1:A.opacity;Z.fill={color:Q.color,transparency:(1-Q.alpha*q)*100}}A.defaultColor&&(Z.color=at(A.defaultColor).color),A.defaultFontName&&(Z.fontFace=A.defaultFontName),A.shadow&&(Z.shadow=u(A.shadow)),(x=A.outline)!=null&&x.width&&(Z.line=f(A.outline)),A.opacity!==void 0&&(Z.transparency=(1-A.opacity)*100),A.paragraphSpace!==void 0&&(Z.paraSpaceBefore=A.paragraphSpace/o),A.vertical&&(Z.vert="eaVert"),F.addText(G,Z)}else if(A.type==="image"){const G={x:A.left/a,y:A.top/a,w:A.width/a,h:A.height/a};if(xp(A.src)?G.data=A.src:G.path=A.src,A.flipH&&(G.flipH=A.flipH),A.flipV&&(G.flipV=A.flipV),A.rotate&&(G.rotate=A.rotate),A.link){const Z=d(A.link);Z&&(G.hyperlink=Z)}if((T=A.filters)!=null&&T.opacity&&(G.transparency=100-parseInt((L=A.filters)==null?void 0:L.opacity)),A.clip){A.clip.shape==="ellipse"&&(G.rounding=!0);const[Z,Q]=A.clip.range,[q,W]=Z,[j,Y]=Q,re=A.width/((j-q)/a),te=A.height/((Y-W)/a);G.w=re/a,G.h=te/a,G.sizing={type:"crop",x:q/a*re/a,y:W/a*te/a,w:(j-q)/a*re/a,h:(Y-W)/a*te/a}}F.addImage(G)}else if(A.type==="shape"){if(A.special){const G=document.querySelector(`.thumbnail-list .base-element-${A.id} svg`);if(G.clientWidth<1||G.clientHeight<1)continue;const Q={data:y3(G),x:A.left/a,y:A.top/a,w:A.width/a,h:A.height/a};if(A.rotate&&(Q.rotate=A.rotate),A.flipH&&(Q.flipH=A.flipH),A.flipV&&(Q.flipV=A.flipV),A.link){const q=d(A.link);q&&(Q.hyperlink=q)}F.addImage(Q)}else{const G={x:A.width/A.viewBox[0],y:A.height/A.viewBox[1]},Z=l(f3(A.path),G);let Q=at(A.fill);if(A.gradient){const j=A.gradient.colors,Y=j[0].color,re=j[j.length-1].color,te=Je.mix(Y,re).toHexString();Q=at(te)}A.pattern&&(Q=at("#00000000"));const q=A.opacity===void 0?1:A.opacity,W={x:A.left/a,y:A.top/a,w:A.width/a,h:A.height/a,fill:{color:Q.color,transparency:(1-Q.alpha*q)*100},points:Z};if(A.flipH&&(W.flipH=A.flipH),A.flipV&&(W.flipV=A.flipV),A.shadow&&(W.shadow=u(A.shadow)),(M=A.outline)!=null&&M.width&&(W.line=f(A.outline)),A.rotate&&(W.rotate=A.rotate),A.link){const j=d(A.link);j&&(W.hyperlink=j)}F.addShape("custGeom",W)}if(A.text){const G=s(A.text.content),Z={x:A.left/a,y:A.top/a,w:A.width/a,h:A.height/a,fontSize:Ic/o,fontFace:"微软雅黑",color:"#000000",paraSpaceBefore:5/o,valign:A.text.align};A.rotate&&(Z.rotate=A.rotate),A.text.defaultColor&&(Z.color=at(A.text.defaultColor).color),A.text.defaultFontName&&(Z.fontFace=A.text.defaultFontName),F.addText(G,Z)}if(A.pattern){const G={x:A.left/a,y:A.top/a,w:A.width/a,h:A.height/a};if(xp(A.pattern)?G.data=A.pattern:G.path=A.pattern,A.flipH&&(G.flipH=A.flipH),A.flipV&&(G.flipV=A.flipV),A.rotate&&(G.rotate=A.rotate),A.link){const Z=d(A.link);Z&&(G.hyperlink=Z)}F.addImage(G)}}else if(A.type==="line"){const G=af(A),Z=l(f3(G)),{minX:Q,maxX:q,minY:W,maxY:j}=oa(A),Y=at(A.color),re={x:A.left/a,y:A.top/a,w:(q-Q)/a,h:(j-W)/a,line:{color:Y.color,transparency:(1-Y.alpha)*100,width:A.width/o,dashType:c[A.style],beginArrowType:A.points[0]?"arrow":"none",endArrowType:A.points[1]?"arrow":"none"},points:Z};A.shadow&&(re.shadow=u(A.shadow)),F.addShape("custGeom",re)}else if(A.type==="chart"){const G=[];for(let Y=0;Y<A.data.series.length;Y++){const re=A.data.series[Y];G.push({name:`系列${Y+1}`,labels:A.data.labels,values:re})}let Z=[];if(A.themeColors.length===10)Z=A.themeColors.map(Y=>at(Y).color);else if(A.themeColors.length===1)Z=Je(A.themeColors[0]).analogous(10).map(Y=>at(Y.toHexString()).color);else{const Y=A.themeColors.length,re=Je(A.themeColors[Y-1]).analogous(11-Y).map(te=>te.toHexString());Z=[...A.themeColors.slice(0,Y-1),...re].map(te=>at(te).color)}const Q={x:A.left/a,y:A.top/a,w:A.width/a,h:A.height/a,chartColors:A.chartType==="pie"||A.chartType==="ring"?Z:Z.slice(0,A.data.series.length)},q=at(A.textColor||"#000000").color;Q.catAxisLabelColor=q,Q.valAxisLabelColor=q;const W=14/o;if(Q.catAxisLabelFontSize=W,Q.valAxisLabelFontSize=W,A.fill||A.outline){const Y={};A.fill&&(Y.fill={color:at(A.fill).color}),A.outline&&(Y.border={pt:A.outline.width/o,color:at(A.outline.color).color}),Q.plotArea=Y}(A.data.series.length>1&&A.chartType!=="scatter"||A.chartType==="pie"||A.chartType==="ring")&&(Q.showLegend=!0,Q.legendPos="b",Q.legendColor=q,Q.legendFontSize=W);let j=w.ChartType.bar;A.chartType==="bar"?(j=w.ChartType.bar,Q.barDir="col",(C=A.options)!=null&&C.stack&&(Q.barGrouping="stacked")):A.chartType==="column"?(j=w.ChartType.bar,Q.barDir="bar",(E=A.options)!=null&&E.stack&&(Q.barGrouping="stacked")):A.chartType==="line"?(j=w.ChartType.line,(P=A.options)!=null&&P.lineSmooth&&(Q.lineSmooth=!0)):A.chartType==="area"?j=w.ChartType.area:A.chartType==="radar"?j=w.ChartType.radar:A.chartType==="scatter"?(j=w.ChartType.scatter,Q.lineSize=0):A.chartType==="pie"?j=w.ChartType.pie:A.chartType==="ring"&&(j=w.ChartType.doughnut,Q.holeSize=60),F.addChart(j,G,Q)}else if(A.type==="table"){const G=[];for(let Y=0;Y<A.data.length;Y++){const re=A.data[Y];for(let te=0;te<re.length;te++){const ne=re[te];if(ne.colspan>1||ne.rowspan>1)for(let ge=Y;ge<Y+ne.rowspan;ge++)for(let Se=ge===Y?te+1:te;Se<te+ne.colspan;Se++)G.push(`${ge}_${Se}`)}}const Z=[],Q=A.theme;let q=null,W=[];Q&&(q=at(Q.color),W=_v(Q.color).map(Y=>at(Y)));for(let Y=0;Y<A.data.length;Y++){const re=A.data[Y],te=[];for(let ne=0;ne<re.length;ne++){const ge=re[ne],Se={colspan:ge.colspan,rowspan:ge.rowspan,bold:((D=ge.style)==null?void 0:D.bold)||!1,italic:((k=ge.style)==null?void 0:k.em)||!1,underline:{style:(N=ge.style)!=null&&N.underline?"sng":"none"},align:((I=ge.style)==null?void 0:I.align)||"left",valign:"middle",fontFace:((O=ge.style)==null?void 0:O.fontname)||"微软雅黑",fontSize:((z=ge.style)!=null&&z.fontsize?parseInt(($=ge.style)==null?void 0:$.fontsize):14)/o};if(Q&&q){let ie;Y%2===0?ie=W[1]:ie=W[0],(Q.rowHeader&&Y===0||Q.rowFooter&&Y===A.data.length-1||Q.colHeader&&ne===0||Q.colFooter&&ne===re.length-1)&&(ie=q),Se.fill={color:ie.color,transparency:(1-ie.alpha)*100}}if((R=ge.style)!=null&&R.backcolor){const ie=at(ge.style.backcolor);Se.fill={color:ie.color,transparency:(1-ie.alpha)*100}}(B=ge.style)!=null&&B.color&&(Se.color=at(ge.style.color).color),G.includes(`${Y}_${ne}`)||te.push({text:ge.text,options:Se})}te.length&&Z.push(te)}const j={x:A.left/a,y:A.top/a,w:A.width/a,h:A.height/a,colW:A.colWidths.map(Y=>A.width*Y/a)};A.theme&&(j.fill={color:"#ffffff"}),A.outline.width&&A.outline.color&&(j.border={type:A.outline.style==="solid"?"solid":"dash",pt:A.outline.width/o,color:at(A.outline.color).color}),F.addTable(Z,j)}else if(A.type==="latex"){const G=document.querySelector(`.thumbnail-list .base-element-${A.id} svg`),Q={data:y3(G),x:A.left/a,y:A.top/a,w:A.width/a,h:A.height/a};if(A.link){const q=d(A.link);q&&(Q.hyperlink=q)}F.addImage(Q)}else if(!m&&(A.type==="video"||A.type==="audio")){const G={x:A.left/a,y:A.top/a,w:A.width/a,h:A.height/a,path:A.src,type:A.type};A.type==="video"&&A.poster&&(G.cover=A.poster);const Z=A.src.match(/\.([a-zA-Z0-9]+)(?:[\?#]|$)/);Z&&Z[1]?G.extn=Z[1]:A.ext&&(G.extn=A.ext);const Q=["avi","mp4","m4v","mov","wmv"],q=["mp3","m4a","mp4","wav","wma"];G.extn&&[...Q,...q].includes(G.extn)&&F.addMedia(G)}}}setTimeout(()=>{if(y){w.writeFile({fileName:`${i}.pptx`}).then(b).catch(_);return}w.write({outputType:"blob"}).then(b).catch(_)},200)}}},aP=({initialSlidesData:e,onDataUpdate:t,renderPageExtra:r},n)=>{const{slides:i,theme:a,setSlides:o,setTheme:s,setViewportRatio:l,setViewportSize:u}=ke.getState(),{applyThemeToAllSlides:c,applyPresetTheme:f,applyFontToAllSlides:d}=Bk(),{exportPPTX:h}=iP();return S.useEffect(()=>{if(e){const{slides:p,theme:v,viewportRatio:g,viewportSize:m}=Ik(e);o(p),s(v),l(g),u(m)}},[]),S.useEffect(()=>{const p=ke.subscribe((v,g)=>{const m={slides:v.slides,title:v.title,theme:v.theme,viewportRatio:v.viewportRatio};(g.slides!==v.slides||g.theme!==v.theme)&&t(m)});return()=>p()},[t]),S.useImperativeHandle(n,()=>({applyThemeToAllSlides:c,applyPresetTheme:f,applyFontToAllSlides:d,exportPPTX:h})),S.createElement("div",{style:{width:"100%",height:"100%",position:"relative"}},S.createElement(kk,{renderPageExtra:r}))},oP=S.forwardRef(aP),si={thumbnails:"_thumbnails_1awpq_1",thumbnailList:"_thumbnailList_1awpq_6",thumbnailItem:"_thumbnailItem_1awpq_11",thumbnail:"_thumbnail_1awpq_1",active:"_active_1awpq_19",label:"_label_1awpq_25"};var Tp=Gs(),De=e=>Hs(e,Tp),Lp=Gs();De.write=e=>Hs(e,Lp);var Bc=Gs();De.onStart=e=>Hs(e,Bc);var Ep=Gs();De.onFrame=e=>Hs(e,Ep);var Mp=Gs();De.onFinish=e=>Hs(e,Mp);var oo=[];De.setTimeout=(e,t)=>{const r=De.now()+t,n=()=>{const a=oo.findIndex(o=>o.cancel==n);~a&&oo.splice(a,1),ui-=~a?1:0},i={time:r,handler:e,cancel:n};return oo.splice(_3(r),0,i),ui+=1,b3(),i};var _3=e=>~(~oo.findIndex(t=>t.time>e)||~oo.length);De.cancel=e=>{Bc.delete(e),Ep.delete(e),Mp.delete(e),Tp.delete(e),Lp.delete(e)},De.sync=e=>{Dp=!0,De.batchedUpdates(e),Dp=!1},De.throttle=e=>{let t;function r(){try{e(...t)}finally{t=null}}function n(...i){t=i,De.onStart(r)}return n.handler=e,n.cancel=()=>{Bc.delete(r),t=null},n};var Cp=typeof window<"u"?window.requestAnimationFrame:()=>{};De.use=e=>Cp=e,De.now=typeof performance<"u"?()=>performance.now():Date.now,De.batchedUpdates=e=>e(),De.catch=console.error,De.frameLoop="always",De.advance=()=>{De.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):w3()};var li=-1,ui=0,Dp=!1;function Hs(e,t){Dp?(t.delete(e),e(0)):(t.add(e),b3())}function b3(){li<0&&(li=0,De.frameLoop!=="demand"&&Cp(S3))}function sP(){li=-1}function S3(){~li&&(Cp(S3),De.batchedUpdates(w3))}function w3(){const e=li;li=De.now();const t=_3(li);if(t&&(x3(oo.splice(0,t),r=>r.handler()),ui-=t),!ui){sP();return}Bc.flush(),Tp.flush(e?Math.min(64,li-e):16.667),Ep.flush(),Lp.flush(),Mp.flush()}function Gs(){let e=new Set,t=e;return{add(r){ui+=t==e&&!e.has(r)?1:0,e.add(r)},delete(r){return ui-=t==e&&e.has(r)?1:0,e.delete(r)},flush(r){t.size&&(e=new Set,ui-=t.size,x3(t,n=>n(r)&&e.add(n)),ui+=e.size,t=e)}}}function x3(e,t){e.forEach(r=>{try{t(r)}catch(n){De.catch(n)}})}var lP=Object.defineProperty,uP=(e,t)=>{for(var r in t)lP(e,r,{get:t[r],enumerable:!0})},Rr={};uP(Rr,{assign:()=>fP,colors:()=>ci,createStringInterpolator:()=>Pp,skipAnimation:()=>L3,to:()=>T3,willAdvance:()=>Np});function Ap(){}var cP=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0}),ae={arr:Array.isArray,obj:e=>!!e&&e.constructor.name==="Object",fun:e=>typeof e=="function",str:e=>typeof e=="string",num:e=>typeof e=="number",und:e=>e===void 0};function xn(e,t){if(ae.arr(e)){if(!ae.arr(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return e===t}var $e=(e,t)=>e.forEach(t);function on(e,t,r){if(ae.arr(e)){for(let n=0;n<e.length;n++)t.call(r,e[n],`${n}`);return}for(const n in e)e.hasOwnProperty(n)&&t.call(r,e[n],n)}var sr=e=>ae.und(e)?[]:ae.arr(e)?e:[e];function Ws(e,t){if(e.size){const r=Array.from(e);e.clear(),$e(r,t)}}var Xs=(e,...t)=>Ws(e,r=>r(...t)),kp=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Pp,T3,ci=null,L3=!1,Np=Ap,fP=e=>{e.to&&(T3=e.to),e.now&&(De.now=e.now),e.colors!==void 0&&(ci=e.colors),e.skipAnimation!=null&&(L3=e.skipAnimation),e.createStringInterpolator&&(Pp=e.createStringInterpolator),e.requestAnimationFrame&&De.use(e.requestAnimationFrame),e.batchedUpdates&&(De.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Np=e.willAdvance),e.frameLoop&&(De.frameLoop=e.frameLoop)},Us=new Set,Tr=[],Op=[],$c=0,Rc={get idle(){return!Us.size&&!Tr.length},start(e){$c>e.priority?(Us.add(e),De.onStart(hP)):(E3(e),De(Ip))},advance:Ip,sort(e){if($c)De.onFrame(()=>Rc.sort(e));else{const t=Tr.indexOf(e);~t&&(Tr.splice(t,1),M3(e))}},clear(){Tr=[],Us.clear()}};function hP(){Us.forEach(E3),Us.clear(),De(Ip)}function E3(e){Tr.includes(e)||M3(e)}function M3(e){Tr.splice(dP(Tr,t=>t.priority>e.priority),0,e)}function Ip(e){const t=Op;for(let r=0;r<Tr.length;r++){const n=Tr[r];$c=n.priority,n.idle||(Np(n),n.advance(e),n.idle||t.push(n))}return $c=0,Op=Tr,Op.length=0,Tr=t,Tr.length>0}function dP(e,t){const r=e.findIndex(t);return r<0?e.length:r}var pP=(e,t,r)=>Math.min(Math.max(r,e),t),vP={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Vr="[-+]?\\d*\\.?\\d+",Vc=Vr+"%";function zc(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var gP=new RegExp("rgb"+zc(Vr,Vr,Vr)),mP=new RegExp("rgba"+zc(Vr,Vr,Vr,Vr)),yP=new RegExp("hsl"+zc(Vr,Vc,Vc)),_P=new RegExp("hsla"+zc(Vr,Vc,Vc,Vr)),bP=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,SP=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,wP=/^#([0-9a-fA-F]{6})$/,xP=/^#([0-9a-fA-F]{8})$/;function TP(e){let t;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=wP.exec(e))?parseInt(t[1]+"ff",16)>>>0:ci&&ci[e]!==void 0?ci[e]:(t=gP.exec(e))?(so(t[1])<<24|so(t[2])<<16|so(t[3])<<8|255)>>>0:(t=mP.exec(e))?(so(t[1])<<24|so(t[2])<<16|so(t[3])<<8|A3(t[4]))>>>0:(t=bP.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=xP.exec(e))?parseInt(t[1],16)>>>0:(t=SP.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=yP.exec(e))?(C3(D3(t[1]),Fc(t[2]),Fc(t[3]))|255)>>>0:(t=_P.exec(e))?(C3(D3(t[1]),Fc(t[2]),Fc(t[3]))|A3(t[4]))>>>0:null}function Bp(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function C3(e,t,r){const n=r<.5?r*(1+t):r+t-r*t,i=2*r-n,a=Bp(i,n,e+1/3),o=Bp(i,n,e),s=Bp(i,n,e-1/3);return Math.round(a*255)<<24|Math.round(o*255)<<16|Math.round(s*255)<<8}function so(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function D3(e){return(parseFloat(e)%360+360)%360/360}function A3(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function Fc(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function k3(e){let t=TP(e);if(t===null)return e;t=t||0;const r=(t&4278190080)>>>24,n=(t&16711680)>>>16,i=(t&65280)>>>8,a=(t&255)/255;return`rgba(${r}, ${n}, ${i}, ${a})`}var Ys=(e,t,r)=>{if(ae.fun(e))return e;if(ae.arr(e))return Ys({range:e,output:t,extrapolate:r});if(ae.str(e.output[0]))return Pp(e);const n=e,i=n.output,a=n.range||[0,1],o=n.extrapolateLeft||n.extrapolate||"extend",s=n.extrapolateRight||n.extrapolate||"extend",l=n.easing||(u=>u);return u=>{const c=EP(u,a);return LP(u,a[c],a[c+1],i[c],i[c+1],l,o,s,n.map)}};function LP(e,t,r,n,i,a,o,s,l){let u=l?l(e):e;if(u<t){if(o==="identity")return u;o==="clamp"&&(u=t)}if(u>r){if(s==="identity")return u;s==="clamp"&&(u=r)}return n===i?n:t===r?e<=t?n:i:(t===-1/0?u=-u:r===1/0?u=u-t:u=(u-t)/(r-t),u=a(u),n===-1/0?u=-u:i===1/0?u=u+n:u=u*(i-n)+n,u)}function EP(e,t){for(var r=1;r<t.length-1&&!(t[r]>=e);++r);return r-1}var MP=(e,t="end")=>r=>{r=t==="end"?Math.min(r,.999):Math.max(r,.001);const n=r*e,i=t==="end"?Math.floor(n):Math.ceil(n);return pP(0,1,i/e)},Hc=1.70158,Gc=Hc*1.525,P3=Hc+1,N3=2*Math.PI/3,O3=2*Math.PI/4.5,Wc=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,CP={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>e===0?0:Math.pow(2,10*e-10),easeOutExpo:e=>e===1?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>e===0?0:e===1?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>P3*e*e*e-Hc*e*e,easeOutBack:e=>1+P3*Math.pow(e-1,3)+Hc*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*((Gc+1)*2*e-Gc)/2:(Math.pow(2*e-2,2)*((Gc+1)*(e*2-2)+Gc)+2)/2,easeInElastic:e=>e===0?0:e===1?1:-Math.pow(2,10*e-10)*Math.sin((e*10-10.75)*N3),easeOutElastic:e=>e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e*10-.75)*N3)+1,easeInOutElastic:e=>e===0?0:e===1?1:e<.5?-(Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*O3))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*O3)/2+1,easeInBounce:e=>1-Wc(1-e),easeOutBounce:Wc,easeInOutBounce:e=>e<.5?(1-Wc(1-2*e))/2:(1+Wc(2*e-1))/2,steps:MP},qs=Symbol.for("FluidValue.get"),lo=Symbol.for("FluidValue.observers"),Lr=e=>!!(e&&e[qs]),Kt=e=>e&&e[qs]?e[qs]():e,I3=e=>e[lo]||null;function DP(e,t){e.eventObserved?e.eventObserved(t):e(t)}function Zs(e,t){const r=e[lo];r&&r.forEach(n=>{DP(n,t)})}var B3=class{constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");AP(this,e)}},AP=(e,t)=>$3(e,qs,t);function uo(e,t){if(e[qs]){let r=e[lo];r||$3(e,lo,r=new Set),r.has(t)||(r.add(t),e.observerAdded&&e.observerAdded(r.size,t))}return t}function js(e,t){const r=e[lo];if(r&&r.has(t)){const n=r.size-1;n?r.delete(t):e[lo]=null,e.observerRemoved&&e.observerRemoved(n,t)}}var $3=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0}),Xc=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,kP=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,R3=new RegExp(`(${Xc.source})(%|[a-z]+)`,"i"),PP=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Uc=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,V3=e=>{const[t,r]=NP(e);if(!t||kp())return e;const n=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(n)return n.trim();if(r&&r.startsWith("--")){const i=window.getComputedStyle(document.documentElement).getPropertyValue(r);return i||e}else{if(r&&Uc.test(r))return V3(r);if(r)return r}return e},NP=e=>{const t=Uc.exec(e);if(!t)return[,];const[,r,n]=t;return[r,n]},$p,OP=(e,t,r,n,i)=>`rgba(${Math.round(t)}, ${Math.round(r)}, ${Math.round(n)}, ${i})`,z3=e=>{$p||($p=ci?new RegExp(`(${Object.keys(ci).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map(a=>Kt(a).replace(Uc,V3).replace(kP,k3).replace($p,k3)),r=t.map(a=>a.match(Xc).map(Number)),i=r[0].map((a,o)=>r.map(s=>{if(!(o in s))throw Error('The arity of each "output" value must be equal');return s[o]})).map(a=>Ys({...e,output:a}));return a=>{var l;const o=!R3.test(t[0])&&((l=t.find(u=>R3.test(u)))==null?void 0:l.replace(Xc,""));let s=0;return t[0].replace(Xc,()=>`${i[s++](a)}${o||""}`).replace(PP,OP)}},Rp="react-spring: ",F3=e=>{const t=e;let r=!1;if(typeof t!="function")throw new TypeError(`${Rp}once requires a function parameter`);return(...n)=>{r||(t(...n),r=!0)}},IP=F3(console.warn);function BP(){IP(`${Rp}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var $P=F3(console.warn);function RP(){$P(`${Rp}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function Yc(e){return ae.str(e)&&(e[0]=="#"||/\d/.test(e)||!kp()&&Uc.test(e)||e in(ci||{}))}var Vp=kp()?S.useEffect:S.useLayoutEffect,VP=()=>{const e=S.useRef(!1);return Vp(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function H3(){const e=S.useState()[1],t=VP();return()=>{t.current&&e(Math.random())}}var G3=e=>S.useEffect(e,zP),zP=[];function W3(e){const t=S.useRef(void 0);return S.useEffect(()=>{t.current=e}),t.current}var Qs=Symbol.for("Animated:node"),FP=e=>!!e&&e[Qs]===e,sn=e=>e&&e[Qs],zp=(e,t)=>cP(e,Qs,t),qc=e=>e&&e[Qs]&&e[Qs].getPayload(),X3=class{constructor(){zp(this,this)}getPayload(){return this.payload||[]}},Zc=class S7 extends X3{constructor(t){super(),this._value=t,this.done=!0,this.durationProgress=0,ae.num(this._value)&&(this.lastPosition=this._value)}static create(t){return new S7(t)}getPayload(){return[this]}getValue(){return this._value}setValue(t,r){return ae.num(t)&&(this.lastPosition=t,r&&(t=Math.round(t/r)*r,this.done&&(this.lastPosition=t))),this._value===t?!1:(this._value=t,!0)}reset(){const{done:t}=this;this.done=!1,ae.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,t&&(this.lastVelocity=null),this.v0=null)}},jc=class w7 extends Zc{constructor(t){super(0),this._string=null,this._toString=Ys({output:[t,t]})}static create(t){return new w7(t)}getValue(){const t=this._string;return t??(this._string=this._toString(this._value))}setValue(t){if(ae.str(t)){if(t==this._string)return!1;this._string=t,this._value=1}else if(super.setValue(t))this._string=null;else return!1;return!0}reset(t){t&&(this._toString=Ys({output:[this.getValue(),t]})),this._value=0,super.reset()}},Qc={dependencies:null},Kc=class extends X3{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return on(this.source,(r,n)=>{FP(r)?t[n]=r.getValue(e):Lr(r)?t[n]=Kt(r):e||(t[n]=r)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&$e(this.payload,e=>e.reset())}_makePayload(e){if(e){const t=new Set;return on(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Qc.dependencies&&Lr(e)&&Qc.dependencies.add(e);const t=qc(e);t&&$e(t,r=>this.add(r))}},HP=class x7 extends Kc{constructor(t){super(t)}static create(t){return new x7(t)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){const r=this.getPayload();return t.length==r.length?r.map((n,i)=>n.setValue(t[i])).some(Boolean):(super.setValue(t.map(GP)),!0)}};function GP(e){return(Yc(e)?jc:Zc).create(e)}function Fp(e){const t=sn(e);return t?t.constructor:ae.arr(e)?HP:Yc(e)?jc:Zc}var U3=(e,t)=>{const r=!ae.fun(e)||e.prototype&&e.prototype.isReactComponent;return S.forwardRef((n,i)=>{const a=S.useRef(null),o=r&&S.useCallback(p=>{a.current=UP(i,p)},[i]),[s,l]=XP(n,t),u=H3(),c=()=>{const p=a.current;if(r&&!p)return;(p?t.applyAnimatedValues(p,s.getValue(!0)):!1)===!1&&u()},f=new WP(c,l),d=S.useRef(void 0);Vp(()=>(d.current=f,$e(l,p=>uo(p,f)),()=>{d.current&&($e(d.current.deps,p=>js(p,d.current)),De.cancel(d.current.update))})),S.useEffect(c,[]),G3(()=>()=>{const p=d.current;$e(p.deps,v=>js(v,p))});const h=t.getComponentProps(s.getValue());return ov.createElement(e,{...h,ref:o})})},WP=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){e.type=="change"&&De.write(this.update)}};function XP(e,t){const r=new Set;return Qc.dependencies=r,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new Kc(e),Qc.dependencies=null,[e,r]}function UP(e,t){return e&&(ae.fun(e)?e(t):e.current=t),t}var Y3=Symbol.for("AnimatedComponent"),YP=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:r=i=>new Kc(i),getComponentProps:n=i=>i}={})=>{const i={applyAnimatedValues:t,createAnimatedStyle:r,getComponentProps:n},a=o=>{const s=q3(o)||"Anonymous";return ae.str(o)?o=a[o]||(a[o]=U3(o,i)):o=o[Y3]||(o[Y3]=U3(o,i)),o.displayName=`Animated(${s})`,o};return on(e,(o,s)=>{ae.arr(e)&&(s=q3(o)),a[s]=a(o)}),{animated:a}},q3=e=>ae.str(e)?e:e&&ae.str(e.displayName)?e.displayName:ae.fun(e)&&e.name||null;function na(e,...t){return ae.fun(e)?e(...t):e}var Ks=(e,t)=>e===!0||!!(t&&e&&(ae.fun(e)?e(t):sr(e).includes(t))),Z3=(e,t)=>ae.obj(e)?t&&e[t]:e,j3=(e,t)=>e.default===!0?e[t]:e.default?e.default[t]:void 0,qP=e=>e,Hp=(e,t=qP)=>{let r=ZP;e.default&&e.default!==!0&&(e=e.default,r=Object.keys(e));const n={};for(const i of r){const a=t(e[i],i);ae.und(a)||(n[i]=a)}return n},ZP=["config","onProps","onStart","onChange","onPause","onResume","onRest"],jP={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function QP(e){const t={};let r=0;if(on(e,(n,i)=>{jP[i]||(t[i]=n,r++)}),r)return t}function Q3(e){const t=QP(e);if(t){const r={to:t};return on(e,(n,i)=>i in t||(r[i]=n)),r}return{...e}}function Js(e){return e=Kt(e),ae.arr(e)?e.map(Js):Yc(e)?Rr.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function KP(e){for(const t in e)return!0;return!1}function Gp(e){return ae.fun(e)||ae.arr(e)&&ae.obj(e[0])}function JP(e,t){var r;(r=e.ref)==null||r.delete(e),t==null||t.delete(e)}function eN(e,t){var r;t&&e.ref!==t&&((r=e.ref)==null||r.delete(e),t.add(e),e.ref=t)}var tN={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},Wp={...tN.default,mass:1,damping:1,easing:CP.linear,clamp:!1},rN=class{constructor(){this.velocity=0,Object.assign(this,Wp)}};function nN(e,t,r){r&&(r={...r},K3(r,t),t={...r,...t}),K3(e,t),Object.assign(e,t);for(const o in Wp)e[o]==null&&(e[o]=Wp[o]);let{frequency:n,damping:i}=e;const{mass:a}=e;return ae.und(n)||(n<.01&&(n=.01),i<0&&(i=0),e.tension=Math.pow(2*Math.PI/n,2)*a,e.friction=4*Math.PI*i*a/n),e}function K3(e,t){if(!ae.und(t.decay))e.duration=void 0;else{const r=!ae.und(t.tension)||!ae.und(t.friction);(r||!ae.und(t.frequency)||!ae.und(t.damping)||!ae.und(t.mass))&&(e.duration=void 0,e.decay=void 0),r&&(e.frequency=void 0)}}var J3=[],iN=class{constructor(){this.changed=!1,this.values=J3,this.toValues=null,this.fromValues=J3,this.config=new rN,this.immediate=!1}};function e7(e,{key:t,props:r,defaultProps:n,state:i,actions:a}){return new Promise((o,s)=>{let l,u,c=Ks(r.cancel??(n==null?void 0:n.cancel),t);if(c)h();else{ae.und(r.pause)||(i.paused=Ks(r.pause,t));let p=n==null?void 0:n.pause;p!==!0&&(p=i.paused||Ks(p,t)),l=na(r.delay||0,t),p?(i.resumeQueue.add(d),a.pause()):(a.resume(),d())}function f(){i.resumeQueue.add(d),i.timeouts.delete(u),u.cancel(),l=u.time-De.now()}function d(){l>0&&!Rr.skipAnimation?(i.delayed=!0,u=De.setTimeout(h,l),i.pauseQueue.add(f),i.timeouts.add(u)):h()}function h(){i.delayed&&(i.delayed=!1),i.pauseQueue.delete(f),i.timeouts.delete(u),e<=(i.cancelId||0)&&(c=!0);try{a.start({...r,callId:e,cancel:c},o)}catch(p){s(p)}}})}var Xp=(e,t)=>t.length==1?t[0]:t.some(r=>r.cancelled)?co(e.get()):t.every(r=>r.noop)?t7(e.get()):zr(e.get(),t.every(r=>r.finished)),t7=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),zr=(e,t,r=!1)=>({value:e,finished:t,cancelled:r}),co=e=>({value:e,cancelled:!0,finished:!1});function r7(e,t,r,n){const{callId:i,parentId:a,onRest:o}=t,{asyncTo:s,promise:l}=r;return!a&&e===s&&!t.reset?l:r.promise=(async()=>{r.asyncId=i,r.asyncTo=e;const u=Hp(t,(g,m)=>m==="onRest"?void 0:g);let c,f;const d=new Promise((g,m)=>(c=g,f=m)),h=g=>{const m=i<=(r.cancelId||0)&&co(n)||i!==r.asyncId&&zr(n,!1);if(m)throw g.result=m,f(g),g},p=(g,m)=>{const y=new n7,_=new i7;return(async()=>{if(Rr.skipAnimation)throw el(r),_.result=zr(n,!1),f(_),_;h(y);const b=ae.obj(g)?{...g}:{...m,to:g};b.parentId=i,on(u,(x,T)=>{ae.und(b[T])&&(b[T]=x)});const w=await n.start(b);return h(y),r.paused&&await new Promise(x=>{r.resumeQueue.add(x)}),w})()};let v;if(Rr.skipAnimation)return el(r),zr(n,!1);try{let g;ae.arr(e)?g=(async m=>{for(const y of m)await p(y)})(e):g=Promise.resolve(e(p,n.stop.bind(n))),await Promise.all([g.then(c),d]),v=zr(n.get(),!0,!1)}catch(g){if(g instanceof n7)v=g.result;else if(g instanceof i7)v=g.result;else throw g}finally{i==r.asyncId&&(r.asyncId=a,r.asyncTo=a?s:void 0,r.promise=a?l:void 0)}return ae.fun(o)&&De.batchedUpdates(()=>{o(v,n,n.item)}),v})()}function el(e,t){Ws(e.timeouts,r=>r.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var n7=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},i7=class extends Error{constructor(){super("SkipAnimationSignal")}},Up=e=>e instanceof Yp,aN=1,Yp=class extends B3{constructor(){super(...arguments),this.id=aN++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=sn(this);return e&&e.getValue()}to(...e){return Rr.to(this,e)}interpolate(...e){return BP(),Rr.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Zs(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Rc.sort(this),Zs(this,{type:"priority",parent:this,priority:e})}},ia=Symbol.for("SpringPhase"),a7=1,qp=2,Zp=4,jp=e=>(e[ia]&a7)>0,fi=e=>(e[ia]&qp)>0,tl=e=>(e[ia]&Zp)>0,o7=(e,t)=>t?e[ia]|=qp|a7:e[ia]&=~qp,s7=(e,t)=>t?e[ia]|=Zp:e[ia]&=~Zp,oN=class extends Yp{constructor(e,t){if(super(),this.animation=new iN,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!ae.und(e)||!ae.und(t)){const r=ae.obj(e)?{...e}:{...t,from:e};ae.und(r.default)&&(r.default=!0),this.start(r)}}get idle(){return!(fi(this)||this._state.asyncTo)||tl(this)}get goal(){return Kt(this.animation.to)}get velocity(){const e=sn(this);return e instanceof Zc?e.lastVelocity||0:e.getPayload().map(t=>t.lastVelocity||0)}get hasAnimated(){return jp(this)}get isAnimating(){return fi(this)}get isPaused(){return tl(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,r=!1;const n=this.animation;let{toValues:i}=n;const{config:a}=n,o=qc(n.to);!o&&Lr(n.to)&&(i=sr(Kt(n.to))),n.values.forEach((u,c)=>{if(u.done)return;const f=u.constructor==jc?1:o?o[c].lastPosition:i[c];let d=n.immediate,h=f;if(!d){if(h=u.lastPosition,a.tension<=0){u.done=!0;return}let p=u.elapsedTime+=e;const v=n.fromValues[c],g=u.v0!=null?u.v0:u.v0=ae.arr(a.velocity)?a.velocity[c]:a.velocity;let m;const y=a.precision||(v==f?.005:Math.min(1,Math.abs(f-v)*.001));if(ae.und(a.duration))if(a.decay){const _=a.decay===!0?.998:a.decay,b=Math.exp(-(1-_)*p);h=v+g/(1-_)*(1-b),d=Math.abs(u.lastPosition-h)<=y,m=g*b}else{m=u.lastVelocity==null?g:u.lastVelocity;const _=a.restVelocity||y/10,b=a.clamp?0:a.bounce,w=!ae.und(b),x=v==f?u.v0>0:v<f;let T,L=!1;const M=1,C=Math.ceil(e/M);for(let E=0;E<C&&(T=Math.abs(m)>_,!(!T&&(d=Math.abs(f-h)<=y,d)));++E){w&&(L=h==f||h>f==x,L&&(m=-m*b,h=f));const P=-a.tension*1e-6*(h-f),D=-a.friction*.001*m,k=(P+D)/a.mass;m=m+k*M,h=h+m*M}}else{let _=1;a.duration>0&&(this._memoizedDuration!==a.duration&&(this._memoizedDuration=a.duration,u.durationProgress>0&&(u.elapsedTime=a.duration*u.durationProgress,p=u.elapsedTime+=e)),_=(a.progress||0)+p/this._memoizedDuration,_=_>1?1:_<0?0:_,u.durationProgress=_),h=v+a.easing(_)*(f-v),m=(h-u.lastPosition)/e,d=_==1}u.lastVelocity=m,Number.isNaN(h)&&(console.warn("Got NaN while animating:",this),d=!0)}o&&!o[c].done&&(d=!1),d?u.done=!0:t=!1,u.setValue(h,a.round)&&(r=!0)});const s=sn(this),l=s.getValue();if(t){const u=Kt(n.to);(l!==u||r)&&!a.decay?(s.setValue(u),this._onChange(u)):r&&a.decay&&this._onChange(l),this._stop()}else r&&this._onChange(l)}set(e){return De.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(fi(this)){const{to:e,config:t}=this.animation;De.batchedUpdates(()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let r;return ae.und(e)?(r=this.queue||[],this.queue=[]):r=[ae.obj(e)?e:{...t,to:e}],Promise.all(r.map(n=>this._update(n))).then(n=>Xp(this,n))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),el(this._state,e&&this._lastCallId),De.batchedUpdates(()=>this._stop(t,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:r,from:n}=e;r=ae.obj(r)?r[t]:r,(r==null||Gp(r))&&(r=void 0),n=ae.obj(n)?n[t]:n,n==null&&(n=void 0);const i={to:r,from:n};return jp(this)||(e.reverse&&([r,n]=[n,r]),n=Kt(n),ae.und(n)?sn(this)||this._set(r):this._set(n)),i}_update({...e},t){const{key:r,defaultProps:n}=this;e.default&&Object.assign(n,Hp(e,(o,s)=>/^on/.test(s)?Z3(o,r):o)),c7(this,e,"onProps"),il(this,"onProps",e,this);const i=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const a=this._state;return e7(++this._lastCallId,{key:r,props:e,defaultProps:n,state:a,actions:{pause:()=>{tl(this)||(s7(this,!0),Xs(a.pauseQueue),il(this,"onPause",zr(this,rl(this,this.animation.to)),this))},resume:()=>{tl(this)&&(s7(this,!1),fi(this)&&this._resume(),Xs(a.resumeQueue),il(this,"onResume",zr(this,rl(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then(o=>{if(e.loop&&o.finished&&!(t&&o.noop)){const s=l7(e);if(s)return this._update(s,!0)}return o})}_merge(e,t,r){if(t.cancel)return this.stop(!0),r(co(this));const n=!ae.und(e.to),i=!ae.und(e.from);if(n||i)if(t.callId>this._lastToId)this._lastToId=t.callId;else return r(co(this));const{key:a,defaultProps:o,animation:s}=this,{to:l,from:u}=s;let{to:c=l,from:f=u}=e;i&&!n&&(!t.default||ae.und(c))&&(c=f),t.reverse&&([c,f]=[f,c]);const d=!xn(f,u);d&&(s.from=f),f=Kt(f);const h=!xn(c,l);h&&this._focus(c);const p=Gp(t.to),{config:v}=s,{decay:g,velocity:m}=v;(n||i)&&(v.velocity=0),t.config&&!p&&nN(v,na(t.config,a),t.config!==o.config?na(o.config,a):void 0);let y=sn(this);if(!y||ae.und(c))return r(zr(this,!0));const _=ae.und(t.reset)?i&&!t.default:!ae.und(f)&&Ks(t.reset,a),b=_?f:this.get(),w=Js(c),x=ae.num(w)||ae.arr(w)||Yc(w),T=!p&&(!x||Ks(o.immediate||t.immediate,a));if(h){const E=Fp(c);if(E!==y.constructor)if(T)y=this._set(w);else throw Error(`Cannot animate between ${y.constructor.name} and ${E.name}, as the "to" prop suggests`)}const L=y.constructor;let M=Lr(c),C=!1;if(!M){const E=_||!jp(this)&&d;(h||E)&&(C=xn(Js(b),w),M=!C),(!xn(s.immediate,T)&&!T||!xn(v.decay,g)||!xn(v.velocity,m))&&(M=!0)}if(C&&fi(this)&&(s.changed&&!_?M=!0:M||this._stop(l)),!p&&((M||Lr(l))&&(s.values=y.getPayload(),s.toValues=Lr(c)?null:L==jc?[1]:sr(w)),s.immediate!=T&&(s.immediate=T,!T&&!_&&this._set(l)),M)){const{onRest:E}=s;$e(lN,D=>c7(this,t,D));const P=zr(this,rl(this,l));Xs(this._pendingCalls,P),this._pendingCalls.add(r),s.changed&&De.batchedUpdates(()=>{var D;s.changed=!_,E==null||E(P,this),_?na(o.onRest,P):(D=s.onStart)==null||D.call(s,P,this)})}_&&this._set(b),p?r(r7(t.to,t,this._state,this)):M?this._start():fi(this)&&!h?this._pendingCalls.add(r):r(t7(b))}_focus(e){const t=this.animation;e!==t.to&&(I3(this)&&this._detach(),t.to=e,I3(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Lr(t)&&(uo(t,this),Up(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Lr(e)&&js(e,this)}_set(e,t=!0){const r=Kt(e);if(!ae.und(r)){const n=sn(this);if(!n||!xn(r,n.getValue())){const i=Fp(r);!n||n.constructor!=i?zp(this,i.create(r)):n.setValue(r),n&&De.batchedUpdates(()=>{this._onChange(r,t)})}}return sn(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,il(this,"onStart",zr(this,rl(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),na(this.animation.onChange,e,this)),na(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;sn(this).reset(Kt(e.to)),e.immediate||(e.fromValues=e.values.map(t=>t.lastPosition)),fi(this)||(o7(this,!0),tl(this)||this._resume())}_resume(){Rr.skipAnimation?this.finish():Rc.start(this)}_stop(e,t){if(fi(this)){o7(this,!1);const r=this.animation;$e(r.values,i=>{i.done=!0}),r.toValues&&(r.onChange=r.onPause=r.onResume=void 0),Zs(this,{type:"idle",parent:this});const n=t?co(this.get()):zr(this.get(),rl(this,e??r.to));Xs(this._pendingCalls,n),r.changed&&(r.changed=!1,il(this,"onRest",n,this))}}};function rl(e,t){const r=Js(t),n=Js(e.get());return xn(n,r)}function l7(e,t=e.loop,r=e.to){const n=na(t);if(n){const i=n!==!0&&Q3(n),a=(i||e).reverse,o=!i||i.reset;return nl({...e,loop:t,default:!1,pause:void 0,to:!a||Gp(r)?r:void 0,from:o?e.from:void 0,reset:o,...i})}}function nl(e){const{to:t,from:r}=e=Q3(e),n=new Set;return ae.obj(t)&&u7(t,n),ae.obj(r)&&u7(r,n),e.keys=n.size?Array.from(n):null,e}function sN(e){const t=nl(e);return ae.und(t.default)&&(t.default=Hp(t)),t}function u7(e,t){on(e,(r,n)=>r!=null&&t.add(n))}var lN=["onStart","onRest","onChange","onPause","onResume"];function c7(e,t,r){e.animation[r]=t[r]!==j3(t,r)?Z3(t[r],e.key):void 0}function il(e,t,...r){var n,i,a,o;(i=(n=e.animation)[t])==null||i.call(n,...r),(o=(a=e.defaultProps)[t])==null||o.call(a,...r)}var uN=["onStart","onChange","onRest"],cN=1,fN=class{constructor(e,t){this.id=cN++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each((t,r)=>e[r]=t.get()),e}set(e){for(const t in e){const r=e[t];ae.und(r)||this.springs[t].set(r)}}update(e){return e&&this.queue.push(nl(e)),this}start(e){let{queue:t}=this;return e?t=sr(e).map(nl):this.queue=[],this._flush?this._flush(this,t):(g7(this,t),Qp(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const r=this.springs;$e(sr(t),n=>r[n].stop(!!e))}else el(this._state,this._lastAsyncId),this.each(r=>r.stop(!!e));return this}pause(e){if(ae.und(e))this.start({pause:!0});else{const t=this.springs;$e(sr(e),r=>t[r].pause())}return this}resume(e){if(ae.und(e))this.start({pause:!1});else{const t=this.springs;$e(sr(e),r=>t[r].resume())}return this}each(e){on(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:r}=this._events,n=this._active.size>0,i=this._changed.size>0;(n&&!this._started||i&&!this._started)&&(this._started=!0,Ws(e,([s,l])=>{l.value=this.get(),s(l,this,this._item)}));const a=!n&&this._started,o=i||a&&r.size?this.get():null;i&&t.size&&Ws(t,([s,l])=>{l.value=o,s(l,this,this._item)}),a&&(this._started=!1,Ws(r,([s,l])=>{l.value=o,s(l,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;De.onFrame(this._onFrame)}};function Qp(e,t){return Promise.all(t.map(r=>f7(e,r))).then(r=>Xp(e,r))}async function f7(e,t,r){const{keys:n,to:i,from:a,loop:o,onRest:s,onResolve:l}=t,u=ae.obj(t.default)&&t.default;o&&(t.loop=!1),i===!1&&(t.to=null),a===!1&&(t.from=null);const c=ae.arr(i)||ae.fun(i)?i:void 0;c?(t.to=void 0,t.onRest=void 0,u&&(u.onRest=void 0)):$e(uN,v=>{const g=t[v];if(ae.fun(g)){const m=e._events[v];t[v]=({finished:y,cancelled:_})=>{const b=m.get(g);b?(y||(b.finished=!1),_&&(b.cancelled=!0)):m.set(g,{value:null,finished:y||!1,cancelled:_||!1})},u&&(u[v]=t[v])}});const f=e._state;t.pause===!f.paused?(f.paused=t.pause,Xs(t.pause?f.pauseQueue:f.resumeQueue)):f.paused&&(t.pause=!0);const d=(n||Object.keys(e.springs)).map(v=>e.springs[v].start(t)),h=t.cancel===!0||j3(t,"cancel")===!0;(c||h&&f.asyncId)&&d.push(e7(++e._lastAsyncId,{props:t,state:f,actions:{pause:Ap,resume:Ap,start(v,g){h?(el(f,e._lastAsyncId),g(co(e))):(v.onRest=s,g(r7(c,v,f,e)))}}})),f.paused&&await new Promise(v=>{f.resumeQueue.add(v)});const p=Xp(e,await Promise.all(d));if(o&&p.finished&&!(r&&p.noop)){const v=l7(t,o,i);if(v)return g7(e,[v]),f7(e,v,!0)}return l&&De.batchedUpdates(()=>l(p,e,e.item)),p}function h7(e,t){const r={...e.springs};return t&&$e(sr(t),n=>{ae.und(n.keys)&&(n=nl(n)),ae.obj(n.to)||(n={...n,to:void 0}),v7(r,n,i=>p7(i))}),d7(e,r),r}function d7(e,t){on(t,(r,n)=>{e.springs[n]||(e.springs[n]=r,uo(r,e))})}function p7(e,t){const r=new oN;return r.key=e,t&&uo(r,t),r}function v7(e,t,r){t.keys&&$e(t.keys,n=>{(e[n]||(e[n]=r(n)))._prepareNode(t)})}function g7(e,t){$e(t,r=>{v7(e.springs,r,n=>p7(n,e))})}var hN=ov.createContext({pause:!1,immediate:!1}),dN=()=>{const e=[],t=function(n){RP();const i=[];return $e(e,(a,o)=>{if(ae.und(n))i.push(a.start());else{const s=r(n,a,o);s&&i.push(a.start(s))}}),i};t.current=e,t.add=function(n){e.includes(n)||e.push(n)},t.delete=function(n){const i=e.indexOf(n);~i&&e.splice(i,1)},t.pause=function(){return $e(e,n=>n.pause(...arguments)),this},t.resume=function(){return $e(e,n=>n.resume(...arguments)),this},t.set=function(n){$e(e,(i,a)=>{const o=ae.fun(n)?n(a,i):n;o&&i.set(o)})},t.start=function(n){const i=[];return $e(e,(a,o)=>{if(ae.und(n))i.push(a.start());else{const s=this._getProps(n,a,o);s&&i.push(a.start(s))}}),i},t.stop=function(){return $e(e,n=>n.stop(...arguments)),this},t.update=function(n){return $e(e,(i,a)=>i.update(this._getProps(n,i,a))),this};const r=function(n,i,a){return ae.fun(n)?n(a,i):n};return t._getProps=r,t};function pN(e,t,r){const n=ae.fun(t)&&t;n&&!r&&(r=[]);const i=S.useMemo(()=>n||arguments.length==3?dN():void 0,[]),a=S.useRef(0),o=H3(),s=S.useMemo(()=>({ctrls:[],queue:[],flush(m,y){const _=h7(m,y);return a.current>0&&!s.queue.length&&!Object.keys(_).some(w=>!m.springs[w])?Qp(m,y):new Promise(w=>{d7(m,_),s.queue.push(()=>{w(Qp(m,y))}),o()})}}),[]),l=S.useRef([...s.ctrls]),u=S.useRef([]),c=W3(e)||0;S.useMemo(()=>{$e(l.current.slice(e,c),m=>{JP(m,i),m.stop(!0)}),l.current.length=e,f(c,e)},[e]),S.useMemo(()=>{f(0,Math.min(c,e))},r);function f(m,y){for(let _=m;_<y;_++){const b=l.current[_]||(l.current[_]=new fN(null,s.flush)),w=n?n(_,b):t[_];w&&(u.current[_]=sN(w))}}const d=l.current.map((m,y)=>h7(m,u.current[y])),h=S.useContext(hN),p=W3(h),v=h!==p&&KP(h);Vp(()=>{a.current++,s.ctrls=l.current;const{queue:m}=s;m.length&&(s.queue=[],$e(m,y=>y())),$e(l.current,(y,_)=>{i==null||i.add(y),v&&y.start({default:h});const b=u.current[_];b&&(eN(y,b.ref),y.ref?y.queue.push(b):y.start(b))})}),G3(()=>()=>{$e(s.ctrls,m=>m.stop(!0))});const g=d.map(m=>({...m}));return i?[g,i]:g}function vN(e,t){const r=ae.fun(e),[[n],i]=pN(1,r?e:[e],r?[]:t);return r||arguments.length==2?[n,i]:n}var gN=class extends Yp{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=Ys(...t);const r=this._get(),n=Fp(r);zp(this,n.create(r))}advance(e){const t=this._get(),r=this.get();xn(t,r)||(sn(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&m7(this._active)&&Kp(this)}_get(){const e=ae.arr(this.source)?this.source.map(Kt):sr(Kt(this.source));return this.calc(...e)}_start(){this.idle&&!m7(this._active)&&(this.idle=!1,$e(qc(this),e=>{e.done=!1}),Rr.skipAnimation?(De.batchedUpdates(()=>this.advance()),Kp(this)):Rc.start(this))}_attach(){let e=1;$e(sr(this.source),t=>{Lr(t)&&uo(t,this),Up(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){$e(sr(this.source),e=>{Lr(e)&&js(e,this)}),this._active.clear(),Kp(this)}eventObserved(e){e.type=="change"?e.idle?this.advance():(this._active.add(e.parent),this._start()):e.type=="idle"?this._active.delete(e.parent):e.type=="priority"&&(this.priority=sr(this.source).reduce((t,r)=>Math.max(t,(Up(r)?r.priority:0)+1),0))}};function mN(e){return e.idle!==!1}function m7(e){return!e.size||Array.from(e).every(mN)}function Kp(e){e.idle||(e.idle=!0,$e(qc(e),t=>{t.done=!0}),Zs(e,{type:"idle",parent:e}))}Rr.assign({createStringInterpolator:z3,to:(e,t)=>new gN(e,t)});var y7=/^--/;function yN(e,t){return t==null||typeof t=="boolean"||t===""?"":typeof t=="number"&&t!==0&&!y7.test(e)&&!(al.hasOwnProperty(e)&&al[e])?t+"px":(""+t).trim()}var _7={};function _N(e,t){if(!e.nodeType||!e.setAttribute)return!1;const r=e.nodeName==="filter"||e.parentNode&&e.parentNode.nodeName==="filter",{className:n,style:i,children:a,scrollTop:o,scrollLeft:s,viewBox:l,...u}=t,c=Object.values(u),f=Object.keys(u).map(d=>r||e.hasAttribute(d)?d:_7[d]||(_7[d]=d.replace(/([A-Z])/g,h=>"-"+h.toLowerCase())));a!==void 0&&(e.textContent=a);for(const d in i)if(i.hasOwnProperty(d)){const h=yN(d,i[d]);y7.test(d)?e.style.setProperty(d,h):e.style[d]=h}f.forEach((d,h)=>{e.setAttribute(d,c[h])}),n!==void 0&&(e.className=n),o!==void 0&&(e.scrollTop=o),s!==void 0&&(e.scrollLeft=s),l!==void 0&&e.setAttribute("viewBox",l)}var al={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},bN=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1),SN=["Webkit","Ms","Moz","O"];al=Object.keys(al).reduce((e,t)=>(SN.forEach(r=>e[bN(r,t)]=e[t]),e),al);var wN=/^(matrix|translate|scale|rotate|skew)/,xN=/^(translate)/,TN=/^(rotate|skew)/,Jp=(e,t)=>ae.num(e)&&e!==0?e+t:e,Jc=(e,t)=>ae.arr(e)?e.every(r=>Jc(r,t)):ae.num(e)?e===t:parseFloat(e)===t,LN=class extends Kc{constructor({x:e,y:t,z:r,...n}){const i=[],a=[];(e||t||r)&&(i.push([e||0,t||0,r||0]),a.push(o=>[`translate3d(${o.map(s=>Jp(s,"px")).join(",")})`,Jc(o,0)])),on(n,(o,s)=>{if(s==="transform")i.push([o||""]),a.push(l=>[l,l===""]);else if(wN.test(s)){if(delete n[s],ae.und(o))return;const l=xN.test(s)?"px":TN.test(s)?"deg":"";i.push(sr(o)),a.push(s==="rotate3d"?([u,c,f,d])=>[`rotate3d(${u},${c},${f},${Jp(d,l)})`,Jc(d,0)]:u=>[`${s}(${u.map(c=>Jp(c,l)).join(",")})`,Jc(u,s.startsWith("scale")?1:0)])}}),i.length&&(n.transform=new EN(i,a)),super(n)}},EN=class extends B3{constructor(e,t){super(),this.inputs=e,this.transforms=t,this._value=null}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return $e(this.inputs,(r,n)=>{const i=Kt(r[0]),[a,o]=this.transforms[n](ae.arr(i)?i:r.map(Kt));e+=" "+a,t=t&&o}),t?"none":e}observerAdded(e){e==1&&$e(this.inputs,t=>$e(t,r=>Lr(r)&&uo(r,this)))}observerRemoved(e){e==0&&$e(this.inputs,t=>$e(t,r=>Lr(r)&&js(r,this)))}eventObserved(e){e.type=="change"&&(this._value=null),Zs(this,e)}},MN=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];Rr.assign({batchedUpdates:k7.unstable_batchedUpdates,createStringInterpolator:z3,colors:vP});var CN=YP(MN,{applyAnimatedValues:_N,createAnimatedStyle:e=>new LN(e),getComponentProps:({scrollTop:e,scrollLeft:t,...r})=>r}),DN=CN.animated;const AN=({slide:e,index:t,selected:r,active:n,onClick:i})=>{const a=S.useRef(null);return S.createElement("div",{ref:a,className:Me(si.thumbnailItem,{[si.active]:n,[si.selected]:r}),onClick:i},S.createElement("div",{className:si.thumbnail},S.createElement(c3,{slide:e,size:112})),S.createElement("div",{className:Me(si.label)},J7(t+1,2)))},kN=({className:e})=>{const{selectedSlidesIndex:t,updateSelectedSlidesIndex:r}=_e(),{slides:n,slideIndex:i,updateSlideIndex:a}=ke(),o=S.useMemo(()=>[...t,i],[t,i]),s=S.useRef(null),[{scrollTop:l},u]=vN(()=>({scrollTop:0,config:{tension:300,clamp:!0}})),c=()=>{const h=s.current;if(!h)return;const p=h.children.item(0);if(!p)return;const v=p.children.item(i);if(!v)return;const g=h.offsetHeight,y=h.scrollHeight-g;if(y<=0){u.start({scrollTop:0,from:{scrollTop:h.scrollTop}});return}const _=v.offsetTop,b=v.offsetHeight,w=Math.max(0,Math.min(_-(g-b)/2,y));u.start({scrollTop:w,from:{scrollTop:h.scrollTop}})},f=h=>{r([]),i!==h&&a(h)},d=h=>{r([]),f(h)};return S.useEffect(()=>{c()},[i,n.length]),S.createElement(DN.div,{className:Me(si.thumbnails,e),ref:s,scrollTop:l},S.createElement("div",{className:Me("thumbnail-list",si.thumbnailList)},n.map((h,p)=>S.createElement("div",{className:si.thumbnailContainer,key:h.id},S.createElement(AN,{slide:h,index:p,active:i===p,selected:o.includes(p),onClick:()=>d(p)})))))},PN=()=>S.createElement(kN,null);Ie.ElementTypes=Ge,Ie.PPTCanvas=oP,Ie.PPThumbnails=PN,Ie.ShapePathFormulasKeys=Pe,Object.defineProperty(Ie,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@8btc/wujie-ppt",
3
- "version": "0.0.13-beta",
3
+ "version": "0.0.14-beta",
4
4
  "type": "module",
5
5
  "main": "./dist/wujie-ppt.umd.js",
6
6
  "module": "./dist/wujie-ppt.es.js",