From d77cec2fca8b95c66ad41cbcf4845ddd30396e96 Mon Sep 17 00:00:00 2001 From: pipipi-pikachu Date: Sat, 2 Nov 2024 07:02:28 +0000 Subject: [PATCH] deploy to github pages 52ca83884e793639d0115adbed35117001b7730c --- assets/{index-BwYAyTkv.js => index-BYueP6BV.js} | 4 ++-- assets/{index-Ck6T9eBK.css => index-CgHKu_gS.css} | 2 +- index.html | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) rename assets/{index-BwYAyTkv.js => index-BYueP6BV.js} (98%) rename assets/{index-Ck6T9eBK.css => index-CgHKu_gS.css} (99%) diff --git a/assets/index-BwYAyTkv.js b/assets/index-BYueP6BV.js similarity index 98% rename from assets/index-BwYAyTkv.js rename to assets/index-BYueP6BV.js index 933b93e3..ac82f0da 100644 --- a/assets/index-BwYAyTkv.js +++ b/assets/index-BYueP6BV.js @@ -205,7 +205,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `)&&(M="(?: "+M+")",P=" "+P,O++),A=new RegExp("^(?:"+M+")",w)),p&&(A=new RegExp("^"+M+"$(?!\\s)",w)),d&&(R=y.lastIndex),x=u.call(T?A:y,P),T?x?(x.input=x.input.slice(O),x[0]=x[0].slice(O),x.index=y.lastIndex,y.lastIndex+=x[0].length):y.lastIndex=0:d&&x&&(y.lastIndex=y.global?x.index+x[0].length:R),p&&x&&x.length>1&&c.call(x[0],A,function(){for(S=1;S=51||!l(function(){var M=[];return M[y]=!1,M.concat()[0]!==M}),S=v("concat"),T=function(M){if(!c(M))return!1;var O=M[y];return O!==void 0?!!O:u(M)},w=!x||!S;s({target:"Array",proto:!0,forced:w},{concat:function(O){var P=f(this),k=p(P,0),F=0,C,I,N,W,D;for(C=-1,N=arguments.length;CR)throw TypeError(A);for(I=0;I=R)throw TypeError(A);h(k,F++,D)}return k.length=F,k}})},"9bdd":function(i,o,a){var s=a("825a");i.exports=function(l,u,c,f){try{return f?u(s(c)[0],c[1]):u(c)}catch(h){var d=l.return;throw d!==void 0&&s(d.call(l)),h}}},"9bf2":function(i,o,a){var s=a("83ab"),l=a("0cfb"),u=a("825a"),c=a("c04e"),f=Object.defineProperty;o.f=s?f:function(h,p,v){if(u(h),p=c(p,!0),u(v),l)try{return f(h,p,v)}catch{}if("get"in v||"set"in v)throw TypeError("Accessors not supported");return"value"in v&&(h[p]=v.value),h}},"9ed3":function(i,o,a){var s=a("ae93").IteratorPrototype,l=a("7c73"),u=a("5c6c"),c=a("d44e"),f=a("3f8c"),d=function(){return this};i.exports=function(h,p,v){var g=p+" Iterator";return h.prototype=l(s,{next:u(1,v)}),c(h,g,!1,!0),f[g]=d,h}},"9f7f":function(i,o,a){var s=a("d039");function l(u,c){return RegExp(u,c)}o.UNSUPPORTED_Y=s(function(){var u=l("a","y");return u.lastIndex=2,u.exec("abcd")!=null}),o.BROKEN_CARET=s(function(){var u=l("^r","gy");return u.lastIndex=2,u.exec("str")!=null})},a2bf:function(i,o,a){var s=a("e8b5"),l=a("50c4"),u=a("0366"),c=function(f,d,h,p,v,g,m,y){for(var R=v,A=0,x=m?u(m,y,3):!1,S;A0&&s(S))R=c(f,d,S,l(S.length),R,g-1)-1;else{if(R>=9007199254740991)throw TypeError("Exceed the acceptable array length");f[R]=S}R++}A++}return R};i.exports=c},a352:function(i,o){i.exports=r},a434:function(i,o,a){var s=a("23e7"),l=a("23cb"),u=a("a691"),c=a("50c4"),f=a("7b0b"),d=a("65f0"),h=a("8418"),p=a("1dde"),v=a("ae40"),g=p("splice"),m=v("splice",{ACCESSORS:!0,0:0,1:2}),y=Math.max,R=Math.min,A=9007199254740991,x="Maximum allowed length exceeded";s({target:"Array",proto:!0,forced:!g||!m},{splice:function(T,w){var M=f(this),O=c(M.length),P=l(T,O),k=arguments.length,F,C,I,N,W,D;if(k===0?F=C=0:k===1?(F=0,C=O-P):(F=k-2,C=R(y(u(w),0),O-P)),O+F-C>A)throw TypeError(x);for(I=d(M,C),N=0;NO-C+F;N--)delete M[N-1]}else if(F>C)for(N=O-C;N>P;N--)W=N+C-1,D=N+F-1,W in M?M[D]=M[W]:delete M[D];for(N=0;NBn;)Gt.push(arguments[Bn++]);if(Ts=St,!(!m(St)&&vt===void 0||ye(vt)))return g(St)||(St=function(hl,Hi){if(typeof Ts=="function"&&(Hi=Ts.call(this,hl,Hi)),!ye(Hi))return Hi}),Gt[1]=St,$.apply(null,Gt)}})}E[Ae][ce]||I(E[Ae],ce,E[Ae].valueOf),G(E,ue),Z[H]=!0},a630:function(i,o,a){var s=a("23e7"),l=a("4df4"),u=a("1c7e"),c=!u(function(f){Array.from(f)});s({target:"Array",stat:!0,forced:c},{from:l})},a640:function(i,o,a){var s=a("d039");i.exports=function(l,u){var c=[][l];return!!c&&s(function(){c.call(null,u||function(){throw 1},1)})}},a691:function(i,o){var a=Math.ceil,s=Math.floor;i.exports=function(l){return isNaN(l=+l)?0:(l>0?s:a)(l)}},ab13:function(i,o,a){var s=a("b622"),l=s("match");i.exports=function(u){var c=/./;try{"/./"[u](c)}catch{try{return c[l]=!1,"/./"[u](c)}catch{}}return!1}},ac1f:function(i,o,a){var s=a("23e7"),l=a("9263");s({target:"RegExp",proto:!0,forced:/./.exec!==l},{exec:l})},ad6d:function(i,o,a){var s=a("825a");i.exports=function(){var l=s(this),u="";return l.global&&(u+="g"),l.ignoreCase&&(u+="i"),l.multiline&&(u+="m"),l.dotAll&&(u+="s"),l.unicode&&(u+="u"),l.sticky&&(u+="y"),u}},ae40:function(i,o,a){var s=a("83ab"),l=a("d039"),u=a("5135"),c=Object.defineProperty,f={},d=function(h){throw h};i.exports=function(h,p){if(u(f,h))return f[h];p||(p={});var v=[][h],g=u(p,"ACCESSORS")?p.ACCESSORS:!1,m=u(p,0)?p[0]:d,y=u(p,1)?p[1]:void 0;return f[h]=!!v&&!l(function(){if(g&&!s)return!0;var R={length:-1};g?c(R,1,{enumerable:!0,get:d}):R[1]=1,v.call(R,m,y)})}},ae93:function(i,o,a){var s=a("e163"),l=a("9112"),u=a("5135"),c=a("b622"),f=a("c430"),d=c("iterator"),h=!1,p=function(){return this},v,g,m;[].keys&&(m=[].keys(),"next"in m?(g=s(s(m)),g!==Object.prototype&&(v=g)):h=!0),v==null&&(v={}),!f&&!u(v,d)&&l(v,d,p),i.exports={IteratorPrototype:v,BUGGY_SAFARI_ITERATORS:h}},b041:function(i,o,a){var s=a("00ee"),l=a("f5df");i.exports=s?{}.toString:function(){return"[object "+l(this)+"]"}},b0c0:function(i,o,a){var s=a("83ab"),l=a("9bf2").f,u=Function.prototype,c=u.toString,f=/^\s*function ([^ (]*)/,d="name";s&&!(d in u)&&l(u,d,{configurable:!0,get:function(){try{return c.call(this).match(f)[1]}catch{return""}}})},b622:function(i,o,a){var s=a("da84"),l=a("5692"),u=a("5135"),c=a("90e3"),f=a("4930"),d=a("fdbf"),h=l("wks"),p=s.Symbol,v=d?p:p&&p.withoutSetter||c;i.exports=function(g){return u(h,g)||(f&&u(p,g)?h[g]=p[g]:h[g]=v("Symbol."+g)),h[g]}},b64b:function(i,o,a){var s=a("23e7"),l=a("7b0b"),u=a("df75"),c=a("d039"),f=c(function(){u(1)});s({target:"Object",stat:!0,forced:f},{keys:function(h){return u(l(h))}})},b727:function(i,o,a){var s=a("0366"),l=a("44ad"),u=a("7b0b"),c=a("50c4"),f=a("65f0"),d=[].push,h=function(p){var v=p==1,g=p==2,m=p==3,y=p==4,R=p==6,A=p==5||R;return function(x,S,T,w){for(var M=u(x),O=l(M),P=s(S,T,3),k=c(O.length),F=0,C=w||f,I=v?C(x,k):g?C(x,0):void 0,N,W;k>F;F++)if((A||F in O)&&(N=O[F],W=P(N,F,M),p)){if(v)I[F]=W;else if(W)switch(p){case 3:return!0;case 5:return N;case 6:return F;case 2:d.call(I,N)}else if(y)return!1}return R?-1:m||y?y:I}};i.exports={forEach:h(0),map:h(1),filter:h(2),some:h(3),every:h(4),find:h(5),findIndex:h(6)}},c04e:function(i,o,a){var s=a("861d");i.exports=function(l,u){if(!s(l))return l;var c,f;if(u&&typeof(c=l.toString)=="function"&&!s(f=c.call(l))||typeof(c=l.valueOf)=="function"&&!s(f=c.call(l))||!u&&typeof(c=l.toString)=="function"&&!s(f=c.call(l)))return f;throw TypeError("Can't convert object to primitive value")}},c430:function(i,o){i.exports=!1},c6b6:function(i,o){var a={}.toString;i.exports=function(s){return a.call(s).slice(8,-1)}},c6cd:function(i,o,a){var s=a("da84"),l=a("ce4e"),u="__core-js_shared__",c=s[u]||l(u,{});i.exports=c},c740:function(i,o,a){var s=a("23e7"),l=a("b727").findIndex,u=a("44d2"),c=a("ae40"),f="findIndex",d=!0,h=c(f);f in[]&&Array(1)[f](function(){d=!1}),s({target:"Array",proto:!0,forced:d||!h},{findIndex:function(v){return l(this,v,arguments.length>1?arguments[1]:void 0)}}),u(f)},c8ba:function(i,o){var a;a=function(){return this}();try{a=a||new Function("return this")()}catch{typeof window=="object"&&(a=window)}i.exports=a},c975:function(i,o,a){var s=a("23e7"),l=a("4d64").indexOf,u=a("a640"),c=a("ae40"),f=[].indexOf,d=!!f&&1/[1].indexOf(1,-0)<0,h=u("indexOf"),p=c("indexOf",{ACCESSORS:!0,1:0});s({target:"Array",proto:!0,forced:d||!h||!p},{indexOf:function(g){return d?f.apply(this,arguments)||0:l(this,g,arguments.length>1?arguments[1]:void 0)}})},ca84:function(i,o,a){var s=a("5135"),l=a("fc6a"),u=a("4d64").indexOf,c=a("d012");i.exports=function(f,d){var h=l(f),p=0,v=[],g;for(g in h)!s(c,g)&&s(h,g)&&v.push(g);for(;d.length>p;)s(h,g=d[p++])&&(~u(v,g)||v.push(g));return v}},caad:function(i,o,a){var s=a("23e7"),l=a("4d64").includes,u=a("44d2"),c=a("ae40"),f=c("indexOf",{ACCESSORS:!0,1:0});s({target:"Array",proto:!0,forced:!f},{includes:function(h){return l(this,h,arguments.length>1?arguments[1]:void 0)}}),u("includes")},cc12:function(i,o,a){var s=a("da84"),l=a("861d"),u=s.document,c=l(u)&&l(u.createElement);i.exports=function(f){return c?u.createElement(f):{}}},ce4e:function(i,o,a){var s=a("da84"),l=a("9112");i.exports=function(u,c){try{l(s,u,c)}catch{s[u]=c}return c}},d012:function(i,o){i.exports={}},d039:function(i,o){i.exports=function(a){try{return!!a()}catch{return!0}}},d066:function(i,o,a){var s=a("428f"),l=a("da84"),u=function(c){return typeof c=="function"?c:void 0};i.exports=function(c,f){return arguments.length<2?u(s[c])||u(l[c]):s[c]&&s[c][f]||l[c]&&l[c][f]}},d1e7:function(i,o,a){var s={}.propertyIsEnumerable,l=Object.getOwnPropertyDescriptor,u=l&&!s.call({1:2},1);o.f=u?function(f){var d=l(this,f);return!!d&&d.enumerable}:s},d28b:function(i,o,a){var s=a("746f");s("iterator")},d2bb:function(i,o,a){var s=a("825a"),l=a("3bbe");i.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var u=!1,c={},f;try{f=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,f.call(c,[]),u=c instanceof Array}catch{}return function(h,p){return s(h),l(p),u?f.call(h,p):h.__proto__=p,h}}():void 0)},d3b7:function(i,o,a){var s=a("00ee"),l=a("6eeb"),u=a("b041");s||l(Object.prototype,"toString",u,{unsafe:!0})},d44e:function(i,o,a){var s=a("9bf2").f,l=a("5135"),u=a("b622"),c=u("toStringTag");i.exports=function(f,d,h){f&&!l(f=h?f:f.prototype,c)&&s(f,c,{configurable:!0,value:d})}},d58f:function(i,o,a){var s=a("1c0b"),l=a("7b0b"),u=a("44ad"),c=a("50c4"),f=function(d){return function(h,p,v,g){s(p);var m=l(h),y=u(m),R=c(m.length),A=d?R-1:0,x=d?-1:1;if(v<2)for(;;){if(A in y){g=y[A],A+=x;break}if(A+=x,d?A<0:R<=A)throw TypeError("Reduce of empty array with no initial value")}for(;d?A>=0:R>A;A+=x)A in y&&(g=p(g,y[A],A,m));return g}};i.exports={left:f(!1),right:f(!0)}},d784:function(i,o,a){a("ac1f");var s=a("6eeb"),l=a("d039"),u=a("b622"),c=a("9263"),f=a("9112"),d=u("species"),h=!l(function(){var y=/./;return y.exec=function(){var R=[];return R.groups={a:"7"},R},"".replace(y,"$")!=="7"}),p=function(){return"a".replace(/./,"$0")==="$0"}(),v=u("replace"),g=function(){return/./[v]?/./[v]("a","$0")==="":!1}(),m=!l(function(){var y=/(?:)/,R=y.exec;y.exec=function(){return R.apply(this,arguments)};var A="ab".split(y);return A.length!==2||A[0]!=="a"||A[1]!=="b"});i.exports=function(y,R,A,x){var S=u(y),T=!l(function(){var F={};return F[S]=function(){return 7},""[y](F)!=7}),w=T&&!l(function(){var F=!1,C=/a/;return y==="split"&&(C={},C.constructor={},C.constructor[d]=function(){return C},C.flags="",C[S]=/./[S]),C.exec=function(){return F=!0,null},C[S](""),!F});if(!T||!w||y==="replace"&&!(h&&p&&!g)||y==="split"&&!m){var M=/./[S],O=A(S,""[y],function(F,C,I,N,W){return C.exec===c?T&&!W?{done:!0,value:M.call(C,I,N)}:{done:!0,value:F.call(I,C,N)}:{done:!1}},{REPLACE_KEEPS_$0:p,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:g}),P=O[0],k=O[1];s(String.prototype,y,P),s(RegExp.prototype,S,R==2?function(F,C){return k.call(F,this,C)}:function(F){return k.call(F,this)})}x&&f(RegExp.prototype[S],"sham",!0)}},d81d:function(i,o,a){var s=a("23e7"),l=a("b727").map,u=a("1dde"),c=a("ae40"),f=u("map"),d=c("map");s({target:"Array",proto:!0,forced:!f||!d},{map:function(p){return l(this,p,arguments.length>1?arguments[1]:void 0)}})},da84:function(i,o,a){(function(s){var l=function(u){return u&&u.Math==Math&&u};i.exports=l(typeof globalThis=="object"&&globalThis)||l(typeof window=="object"&&window)||l(typeof self=="object"&&self)||l(typeof s=="object"&&s)||Function("return this")()}).call(this,a("c8ba"))},dbb4:function(i,o,a){var s=a("23e7"),l=a("83ab"),u=a("56ef"),c=a("fc6a"),f=a("06cf"),d=a("8418");s({target:"Object",stat:!0,sham:!l},{getOwnPropertyDescriptors:function(p){for(var v=c(p),g=f.f,m=u(v),y={},R=0,A,x;m.length>R;)x=g(v,A=m[R++]),x!==void 0&&d(y,A,x);return y}})},dbf1:function(i,o,a){(function(s){a.d(o,"a",function(){return u});function l(){return typeof window<"u"?window.console:s.console}var u=l()}).call(this,a("c8ba"))},ddb0:function(i,o,a){var s=a("da84"),l=a("fdbc"),u=a("e260"),c=a("9112"),f=a("b622"),d=f("iterator"),h=f("toStringTag"),p=u.values;for(var v in l){var g=s[v],m=g&&g.prototype;if(m){if(m[d]!==p)try{c(m,d,p)}catch{m[d]=p}if(m[h]||c(m,h,v),l[v]){for(var y in u)if(m[y]!==u[y])try{c(m,y,u[y])}catch{m[y]=u[y]}}}}},df75:function(i,o,a){var s=a("ca84"),l=a("7839");i.exports=Object.keys||function(c){return s(c,l)}},e01a:function(i,o,a){var s=a("23e7"),l=a("83ab"),u=a("da84"),c=a("5135"),f=a("861d"),d=a("9bf2").f,h=a("e893"),p=u.Symbol;if(l&&typeof p=="function"&&(!("description"in p.prototype)||p().description!==void 0)){var v={},g=function(){var S=arguments.length<1||arguments[0]===void 0?void 0:String(arguments[0]),T=this instanceof g?new p(S):S===void 0?p():p(S);return S===""&&(v[T]=!0),T};h(g,p);var m=g.prototype=p.prototype;m.constructor=g;var y=m.toString,R=String(p("test"))=="Symbol(test)",A=/^Symbol\((.*)\)[^)]+$/;d(m,"description",{configurable:!0,get:function(){var S=f(this)?this.valueOf():this,T=y.call(S);if(c(v,S))return"";var w=R?T.slice(7,-1):T.replace(A,"$1");return w===""?void 0:w}}),s({global:!0,forced:!0},{Symbol:g})}},e163:function(i,o,a){var s=a("5135"),l=a("7b0b"),u=a("f772"),c=a("e177"),f=u("IE_PROTO"),d=Object.prototype;i.exports=c?Object.getPrototypeOf:function(h){return h=l(h),s(h,f)?h[f]:typeof h.constructor=="function"&&h instanceof h.constructor?h.constructor.prototype:h instanceof Object?d:null}},e177:function(i,o,a){var s=a("d039");i.exports=!s(function(){function l(){}return l.prototype.constructor=null,Object.getPrototypeOf(new l)!==l.prototype})},e260:function(i,o,a){var s=a("fc6a"),l=a("44d2"),u=a("3f8c"),c=a("69f3"),f=a("7dd0"),d="Array Iterator",h=c.set,p=c.getterFor(d);i.exports=f(Array,"Array",function(v,g){h(this,{type:d,target:s(v),index:0,kind:g})},function(){var v=p(this),g=v.target,m=v.kind,y=v.index++;return!g||y>=g.length?(v.target=void 0,{value:void 0,done:!0}):m=="keys"?{value:y,done:!1}:m=="values"?{value:g[y],done:!1}:{value:[y,g[y]],done:!1}},"values"),u.Arguments=u.Array,l("keys"),l("values"),l("entries")},e439:function(i,o,a){var s=a("23e7"),l=a("d039"),u=a("fc6a"),c=a("06cf").f,f=a("83ab"),d=l(function(){c(1)}),h=!f||d;s({target:"Object",stat:!0,forced:h,sham:!f},{getOwnPropertyDescriptor:function(v,g){return c(u(v),g)}})},e538:function(i,o,a){var s=a("b622");o.f=s},e893:function(i,o,a){var s=a("5135"),l=a("56ef"),u=a("06cf"),c=a("9bf2");i.exports=function(f,d){for(var h=l(d),p=c.f,v=u.f,g=0;g"u"||!(Symbol.iterator in Object(ye)))){var Ce=[],Be=!0,it=!1,Oe=void 0;try{for(var Ke=ye[Symbol.iterator](),tt;!(Be=(tt=Ke.next()).done)&&(Ce.push(tt.value),!(Me&&Ce.length===Me));Be=!0);}catch(Rt){it=!0,Oe=Rt}finally{try{!Be&&Ke.return!=null&&Ke.return()}finally{if(it)throw Oe}}return Ce}}a("a630"),a("fb6a"),a("b0c0"),a("25f0");function v(ye,Me){(Me==null||Me>ye.length)&&(Me=ye.length);for(var Ce=0,Be=new Array(Me);Ce[...i.value,s.value]),h=ge(!1),p=we(()=>a.value.some(H=>H.sectionTag)),{copySlide:v,pasteSlide:g,createSlide:m,createSlideByTemplate:y,copyAndPasteSlide:R,deleteSlide:A,cutSlide:x,selectAllSlide:S,sortSlides:T}=Jf(),{createSection:w,removeSection:M,removeAllSection:O,removeSectionSlides:P,updateSectionTitle:k}=d9e(),F=ge();_t(()=>s.value,()=>{d.value.length&&t.updateSelectedSlidesIndex([]),Qr(()=>{var ue,Ae;const H=(Ae=(ue=F.value)==null?void 0:ue.$el)==null?void 0:Ae.querySelector(".thumbnail-item.active");F.value&&H&&!q0e(H,F.value.$el)&&setTimeout(()=>{H.scrollIntoView({behavior:"smooth"})},100)})});const C=H=>{t.setActiveElementIdList([]),s.value!==H&&n.updateSlideIndex(H)},I=(H,ue)=>{if(Z.value)return;const Ae=d.value.length>1;if(!(Ae&&d.value.includes(ue)&&H.button!==0))if(u.value)if(s.value===ue){if(!Ae)return;const ce=d.value.filter(de=>de!==ue);t.updateSelectedSlidesIndex(ce),C(d.value[0])}else if(d.value.includes(ue)){const ce=d.value.filter(de=>de!==ue);t.updateSelectedSlidesIndex(ce)}else{const ce=[...d.value,ue];t.updateSelectedSlidesIndex(ce)}else if(c.value){if(s.value===ue&&!Ae)return;let ce=Math.min(...d.value),de=ue;ue{o.value!==H&&(t.setThumbnailsFocus(H),H||t.updateSelectedSlidesIndex([]))},W=H=>{const{newIndex:ue,oldIndex:Ae}=H;ue===void 0||Ae===void 0||ue===Ae||T(ue,Ae)},D=()=>{t.setNotesPanelState(!0)},Z=ge(""),re=H=>{t.setDisableHotkeysState(!0),Z.value=H||"default",Qr(()=>{document.querySelector(`#section-title-input-${H||"default"}`).focus()})},B=H=>{const ue=H.target.value;k(Z.value,ue),Z.value="",t.setDisableHotkeysState(!1)},Y=H=>{const ue=H.dataset.sectionId;return[{text:"删除节",handler:()=>M(ue)},{text:"删除节和幻灯片",handler:()=>{t.setActiveElementIdList([]),P(ue)}},{text:"删除所有节",handler:O},{text:"重命名节",handler:()=>re(ue)}]},{enterScreening:K,enterScreeningFromStart:G}=$f(),ee=()=>[{text:"粘贴",subText:"Ctrl + V",handler:g},{text:"全选",subText:"Ctrl + A",handler:S},{text:"新建页面",subText:"Enter",handler:m},{text:"幻灯片放映",subText:"F5",handler:G}],q=()=>[{text:"剪切",subText:"Ctrl + X",handler:x},{text:"复制",subText:"Ctrl + C",handler:v},{text:"粘贴",subText:"Ctrl + V",handler:g},{text:"全选",subText:"Ctrl + A",handler:S},{divider:!0},{text:"新建页面",subText:"Enter",handler:m},{text:"复制页面",subText:"Ctrl + D",handler:R},{text:"删除页面",subText:"Delete",handler:()=>A()},{text:"增加节",handler:w,disable:!!l.value.sectionTag},{divider:!0},{text:"从当前放映",subText:"Shift + F5",handler:K}];return(H,ue)=>{const Ae=Se("IconPlus"),ce=Se("IconDown"),de=Cn("contextmenu"),le=Cn("click-outside");return Ge((U(),ne("div",{class:"thumbnails",onMousedown:ue[7]||(ue[7]=()=>N(!0))},[V("div",oFe,[V("div",{class:"btn",onClick:ue[0]||(ue[0]=J=>z(m)())},[_(Ae,{class:"icon"}),De("添加幻灯片")]),_(It,{trigger:"click",placement:"bottom-start",value:h.value,"onUpdate:value":ue[2]||(ue[2]=J=>h.value=J),center:""},{content:se(()=>[_(A9e,{onSelect:ue[1]||(ue[1]=J=>{z(y)(J),h.value=!1})})]),default:se(()=>[V("div",aFe,[_(ce)])]),_:1},8,["value"])]),_(z($k),{class:"thumbnail-list",ref_key:"thumbnailsRef",ref:F,modelValue:z(a),animation:200,scroll:!0,scrollSensitivity:50,disabled:Z.value,onEnd:W,itemKey:"id"},{item:se(({element:J,index:E})=>{var $,ie,j,te,ae;return[V("div",sFe,[J.sectionTag||p.value&&E===0?Ge((U(),ne("div",{key:0,class:"section-title","data-section-id":(($=J==null?void 0:J.sectionTag)==null?void 0:$.id)||""},[Z.value===((ie=J==null?void 0:J.sectionTag)==null?void 0:ie.id)||E===0&&Z.value==="default"?(U(),ne("input",{key:0,id:`section-title-input-${((j=J==null?void 0:J.sectionTag)==null?void 0:j.id)||"default"}`,type:"text",value:((te=J==null?void 0:J.sectionTag)==null?void 0:te.title)||"",placeholder:"输入节名称",onBlur:ue[3]||(ue[3]=he=>B(he)),onKeydown:ue[4]||(ue[4]=qu(Et(he=>B(he),["stop"]),["enter"]))},null,40,uFe)):(U(),ne("span",cFe,[V("div",fFe,pt(J!=null&&J.sectionTag?((ae=J==null?void 0:J.sectionTag)==null?void 0:ae.title)||"无标题节":"默认节"),1)]))],8,lFe)),[[de,Y]]):Ze("",!0),Ge((U(),ne("div",{class:$e(["thumbnail-item",{active:z(s)===E,selected:d.value.includes(E)}]),onMousedown:he=>I(he,E),onDblclick:ue[6]||(ue[6]=he=>z(K)())},[V("div",{class:$e(["label",{"offset-left":E>=99}])},pt(z(H1)(E+1,2)),3),_(il,{class:"thumbnail",slide:J,size:120,visible:ED())},pt(J.notes.length),1)):Ze("",!0)],42,dFe)),[[de,q]])])]}),_:1},8,["modelValue","disabled"]),V("div",hFe,"幻灯片 "+pt(z(s)+1)+" / "+pt(z(a).length),1)],32)),[[le,()=>N(!1)],[de,ee]])}}}),vFe=Ue(pFe,[["__scopeId","data-v-f6304958"]]);function jk(e,t){return t===void 0&&(t=15),+parseFloat(Number(e).toPrecision(t))}function su(e){var t=e.toString().split(/[eE]/),n=(t[0].split(".")[1]||"").length-+(t[1]||0);return n>0?n:0}function r2(e){if(e.toString().indexOf("e")===-1)return Number(e.toString().replace(".",""));var t=su(e);return t>0?jk(Number(e)*Math.pow(10,t)):Number(e)}function VT(e){mq&&(e>Number.MAX_SAFE_INTEGER||eA.getBoundingClientRect().left,r=e,i=t,o=ge(),a=ge(0),s=ge(0),l=ge(0),u=ge("end"),c=A=>{let x=A/100*(r.max-r.min);if(r.step>=1)x=Math.fround(x);else{const S=r.step.toString(),T=S.match(/^[0.]*([1-9])/);if(T){const w=T[1],M=S.indexOf(w)-1;if(M>0){const O=Math.pow(10,M);x=Math.fround(x*O)/O}}}return RFe.plus(x,r.min)},f=we(()=>c(a.value)),d=we(()=>c(s.value)),h=we(()=>c(l.value));_t(()=>r.value,()=>{r.max!==r.min&&(typeof r.value=="number"?a.value=(r.value-r.min)/(r.max-r.min)*100:(s.value=(r.value[0]-r.min)/(r.max-r.min)*100,l.value=(r.value[1]-r.min)/(r.max-r.min)*100))},{immediate:!0});const p=A=>{if(!o.value)return 0;let S=(("clientX"in A?A.clientX:A.changedTouches[0].clientX)-n(o.value))/o.value.clientWidth;S=Math.max(S,0),S=Math.min(S,1);let T=S*100;const w=r.step/(r.max-r.min)*100,M=T%w;return M>0&&(M<=w/2?T=T-M:T=T-M+w),T},v=A=>{const x=p(A);u.value==="start"?s.value=x:l.value=x},g=A=>{m(A);const x=c(a.value),S=r.value,T=u.value==="start"?[x,S[1]]:[S[0],x];T[0]>T[1]&&([T[0],T[1]]=[T[1],T[0]]),i("update:value",T),document.removeEventListener("mousemove",v),document.removeEventListener("touchmove",v),document.removeEventListener("mouseup",g),document.removeEventListener("touchend",g)},m=A=>{a.value=p(A)},y=A=>{m(A);const x=c(a.value);i("update:value",x),document.removeEventListener("mousemove",m),document.removeEventListener("touchmove",m),document.removeEventListener("mouseup",y),document.removeEventListener("touchend",y)},R=A=>{if(!r.disabled)if(r.range){const x=p(A);Math.abs(x-s.value)(U(),ne("div",{class:$e(["slider",{disabled:A.disabled}]),ref_key:"sliderRef",ref:o,onMousedown:x[0]||(x[0]=S=>R(S))},[V("div",bFe,[A.range?(U(),ne(Ve,{key:1},[V("div",{class:"track",style:Le({width:`${l.value-s.value}%`,left:`${s.value}%`})},null,4),V("div",{class:"thumb",style:Le({left:`${s.value}%`}),"data-tooltip":d.value},null,12,SFe),V("div",{class:"thumb",style:Le({left:`${l.value}%`}),"data-tooltip":h.value},null,12,wFe)],64)):(U(),ne(Ve,{key:0},[V("div",{class:"track",style:Le({width:`${a.value}%`})},null,4),V("div",{class:"thumb",style:Le({left:`${a.value}%`}),"data-tooltip":f.value},null,12,xFe)],64))])],34))}}),Yi=Ue(MFe,[["__scopeId","data-v-a7428be4"]]),LFe=e=>(rn("data-v-c3b27b40"),e=e(),on(),e),TFe={class:"element-opacity"},_Fe={class:"row"},OFe=LFe(()=>V("div",{style:{width:"40%"}},"不透明度:",-1)),kFe=Ee({__name:"ElementOpacity",setup(e){const t=lt(),{handleElement:n}=We(dt()),r=ge(1);_t(n,()=>{n.value&&(r.value="opacity"in n.value&&n.value.opacity!==void 0?n.value.opacity:1)},{deep:!0,immediate:!0});const{addHistorySnapshot:i}=qt(),o=a=>{if(!n.value)return;const s={opacity:a};t.updateElement({id:n.value.id,props:s}),i()};return(a,s)=>(U(),ne("div",TFe,[V("div",_Fe,[OFe,_(Yi,{min:0,max:1,step:.1,value:r.value,"onUpdate:value":s[0]||(s[0]=l=>o(l)),style:{width:"60%"}},null,8,["value"])])]))}}),yq=Ue(kFe,[["__scopeId","data-v-c3b27b40"]]),PFe={class:"color-block"},CFe=Ee({__name:"ColorButton",props:{color:{}},setup(e){return(t,n)=>{const r=Se("IconPlatte");return U(),_e(qe,{class:"color-btn"},{default:se(()=>[V("div",PFe,[V("div",{class:"content",style:Le({backgroundColor:t.color})},null,4)]),_(r,{class:"color-btn-icon"})]),_:1})}}}),Zr=Ue(CFe,[["__scopeId","data-v-53175c6f"]]);function NFe(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}const IFe=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function $u(e){const t=[];for(let n=0,r=e.length;npa||e.height>pa)&&(e.width>pa&&e.height>pa?e.width>e.height?(e.height*=pa/e.width,e.width=pa):(e.width*=pa/e.height,e.height=pa):e.width>pa?(e.height*=pa/e.width,e.width=pa):(e.width*=pa/e.height,e.height=pa))}function Gx(e){return new Promise((t,n)=>{const r=new Image;r.decode=()=>t(r),r.onload=()=>t(r),r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function VFe(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function DFe(e,t,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),o=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${t} ${n}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),i.appendChild(o),o.appendChild(e),VFe(i)}const na=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||na(n,t)};function UFe(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function BFe(e){return $u(e).map(t=>{const n=e.getPropertyValue(t),r=e.getPropertyPriority(t);return`${t}: ${n}${r?" !important":""};`}).join(" ")}function YFe(e,t,n){const r=`.${e}:${t}`,i=n.cssText?UFe(n):BFe(n);return document.createTextNode(`${r}{${i}}`)}function HD(e,t,n){const r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const o=IFe();try{t.className=`${t.className} ${o}`}catch{return}const a=document.createElement("style");a.appendChild(YFe(o,n,r)),t.appendChild(a)}function ZFe(e,t){HD(e,t,":before"),HD(e,t,":after")}const KD="application/font-woff",GD="image/jpeg",QFe={woff:KD,woff2:KD,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:GD,jpeg:GD,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function HFe(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function qk(e){const t=HFe(e).toLowerCase();return QFe[t]||""}function KFe(e){return e.split(/,/)[1]}function DT(e){return e.search(/^(data:)/)!==-1}function GFe(e,t){return`data:${t};base64,${e}`}async function Rq(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const i=await r.blob();return new Promise((o,a)=>{const s=new FileReader;s.onerror=a,s.onloadend=()=>{try{o(n({res:r,result:s.result}))}catch(l){a(l)}},s.readAsDataURL(i)})}const L8={};function zFe(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function eP(e,t,n){const r=zFe(e,t,n.includeQueryParams);if(L8[r]!=null)return L8[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const o=await Rq(e,n.fetchRequestInit,({res:a,result:s})=>(t||(t=a.headers.get("Content-Type")||""),KFe(s)));i=GFe(o,t)}catch(o){i=n.imagePlaceholder||"";let a=`Failed to fetch resource: ${e}`;o&&(a=typeof o=="string"?o:o.message),a&&console.warn(a)}return L8[r]=i,i}async function JFe(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):Gx(t)}async function $Fe(e,t){if(e.currentSrc){const o=document.createElement("canvas"),a=o.getContext("2d");o.width=e.clientWidth,o.height=e.clientHeight,a==null||a.drawImage(e,0,0,o.width,o.height);const s=o.toDataURL();return Gx(s)}const n=e.poster,r=qk(n),i=await eP(n,r,t);return Gx(i)}async function jFe(e){var t;try{if(!((t=e==null?void 0:e.contentDocument)===null||t===void 0)&&t.body)return await S3(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function qFe(e,t){return na(e,HTMLCanvasElement)?JFe(e):na(e,HTMLVideoElement)?$Fe(e,t):na(e,HTMLIFrameElement)?jFe(e):e.cloneNode(!1)}const eEe=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function tEe(e,t,n){var r,i;let o=[];return eEe(e)&&e.assignedNodes?o=$u(e.assignedNodes()):na(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?o=$u(e.contentDocument.body.childNodes):o=$u(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),o.length===0||na(e,HTMLVideoElement)||await o.reduce((a,s)=>a.then(()=>S3(s,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function nEe(e,t){const n=t.style;if(!n)return;const r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):$u(r).forEach(i=>{let o=r.getPropertyValue(i);i==="font-size"&&o.endsWith("px")&&(o=`${Math.floor(parseFloat(o.substring(0,o.length-2)))-.1}px`),na(e,HTMLIFrameElement)&&i==="display"&&o==="inline"&&(o="block"),i==="d"&&t.getAttribute("d")&&(o=`path(${t.getAttribute("d")})`),n.setProperty(i,o,r.getPropertyPriority(i))})}function rEe(e,t){na(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),na(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function iEe(e,t){if(na(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function oEe(e,t){return na(t,Element)&&(nEe(e,t),ZFe(e,t),rEe(e,t),iEe(e,t)),t}async function aEe(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let o=0;oqFe(r,t)).then(r=>tEe(e,r,t)).then(r=>oEe(e,r)).then(r=>aEe(r,t))}const bq=/url\((['"]?)([^'"]+?)\1\)/g,sEe=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,lEe=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function uEe(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function cEe(e){const t=[];return e.replace(bq,(n,r,i)=>(t.push(i),n)),t.filter(n=>!DT(n))}async function fEe(e,t,n,r,i){try{const o=n?NFe(t,n):t,a=qk(t);let s;return i||(s=await eP(o,a,r)),e.replace(uEe(t),`$1${s}$3`)}catch{}return e}function dEe(e,{preferredFontFormat:t}){return t?e.replace(lEe,n=>{for(;;){const[r,,i]=sEe.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function xq(e){return e.search(bq)!==-1}async function Sq(e,t,n){if(!xq(e))return e;const r=dEe(e,n);return cEe(r).reduce((o,a)=>o.then(s=>fEe(s,a,t,n)),Promise.resolve(r))}async function AR(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const o=await Sq(i,null,n);return t.style.setProperty(e,o,t.style.getPropertyPriority(e)),!0}return!1}async function hEe(e,t){await AR("background",e,t)||await AR("background-image",e,t),await AR("mask",e,t)||await AR("mask-image",e,t)}async function pEe(e,t){const n=na(e,HTMLImageElement);if(!(n&&!DT(e.src))&&!(na(e,SVGImageElement)&&!DT(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await eP(r,qk(r),t);await new Promise((o,a)=>{e.onload=o,e.onerror=a;const s=e;s.decode&&(s.decode=o),s.loading==="lazy"&&(s.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function vEe(e,t){const r=$u(e.childNodes).map(i=>wq(i,t));await Promise.all(r).then(()=>e)}async function wq(e,t){na(e,Element)&&(await hEe(e,t),await pEe(e,t),await vEe(e,t))}function gEe(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(i=>{n[i]=r[i]}),e}const zD={};async function JD(e){let t=zD[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},zD[e]=t,t}async function $D(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,o=(n.match(/url\([^)]+\)/g)||[]).map(async a=>{let s=a.replace(r,"$1");return s.startsWith("https://")||(s=new URL(s,e.url).href),Rq(s,t.fetchRequestInit,({result:l})=>(n=n.replace(a,`url(${l})`),[a,l]))});return Promise.all(o).then(()=>n)}function jD(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const l=i.exec(r);if(l===null)break;t.push(l[0])}r=r.replace(i,"");const o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",s=new RegExp(a,"gi");for(;;){let l=o.exec(r);if(l===null){if(l=s.exec(r),l===null)break;o.lastIndex=s.lastIndex}else s.lastIndex=o.lastIndex;t.push(l[0])}return t}async function mEe(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{$u(i.cssRules||[]).forEach((o,a)=>{if(o.type===CSSRule.IMPORT_RULE){let s=a+1;const l=o.href,u=JD(l).then(c=>$D(c,t)).then(c=>jD(c).forEach(f=>{try{i.insertRule(f,f.startsWith("@import")?s+=1:i.cssRules.length)}catch(d){console.error("Error inserting rule from remote css",{rule:f,error:d})}})).catch(c=>{console.error("Error loading remote css",c.toString())});r.push(u)}})}catch(o){const a=e.find(s=>s.href==null)||document.styleSheets[0];i.href!=null&&r.push(JD(i.href).then(s=>$D(s,t)).then(s=>jD(s).forEach(l=>{a.insertRule(l,i.cssRules.length)})).catch(s=>{console.error("Error loading remote stylesheet",s)})),console.error("Error inlining remote css file",o)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{$u(i.cssRules||[]).forEach(o=>{n.push(o)})}catch(o){console.error(`Error while reading CSS rules from ${i.href}`,o)}}),n))}function yEe(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>xq(t.style.getPropertyValue("src")))}async function AEe(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=$u(e.ownerDocument.styleSheets),r=await mEe(n,t);return yEe(r)}async function REe(e,t){const n=await AEe(e,t);return(await Promise.all(n.map(i=>{const o=i.parentStyleSheet?i.parentStyleSheet.href:null;return Sq(i.cssText,o,t)}))).join(` -`)}async function bEe(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await REe(e,t);if(n){const r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function xEe(e,t={}){const{width:n,height:r}=Aq(e,t),i=await S3(e,t,!0);return await bEe(i,t),await wq(i,t),gEe(i,t),await DFe(i,n,r)}async function tP(e,t={}){const{width:n,height:r}=Aq(e,t),i=await xEe(e,t),o=await Gx(i),a=document.createElement("canvas"),s=a.getContext("2d"),l=t.pixelRatio||XFe(),u=t.canvasWidth||n,c=t.canvasHeight||r;return a.width=u*l,a.height=c*l,t.skipAutoScale||WFe(a),a.style.width=`${u}`,a.style.height=`${c}`,t.backgroundColor&&(s.fillStyle=t.backgroundColor,s.fillRect(0,0,a.width,a.height)),s.drawImage(o,0,0,a.width,a.height),a}async function SEe(e,t={}){return(await tP(e,t)).toDataURL()}async function wEe(e,t={}){return(await tP(e,t)).toDataURL("image/jpeg",t.quality||1)}const MEe=Ee({__name:"Checkboard",props:{size:{default:8},white:{default:"#fff"},grey:{default:"#e6e6e6"}},setup(e){const t=e,n={},r=(a,s,l)=>{const u=document.createElement("canvas");u.width=u.height=l*2;const c=u.getContext("2d");return c?(c.fillStyle=a,c.fillRect(0,0,u.width,u.height),c.fillStyle=s,c.fillRect(0,0,l,l),c.translate(l,l),c.fillRect(0,0,l,l),u.toDataURL()):null},i=(a,s,l)=>{const u=a+","+s+","+l;if(n[u])return n[u];const c=r(a,s,l);return n[u]=c,c},o=we(()=>({backgroundImage:`url(${i(t.white,t.grey,t.size)})`}));return(a,s)=>(U(),ne("div",{class:"checkerboard",style:Le(o.value)},null,4))}}),UT=Ue(MEe,[["__scopeId","data-v-46275348"]]),LEe=e=>(rn("data-v-429f62d3"),e=e(),on(),e),TEe={class:"alpha"},_Ee={class:"alpha-checkboard-wrap"},OEe=LEe(()=>V("div",{class:"alpha-picker"},null,-1)),kEe=[OEe],PEe=Ee({__name:"Alpha",props:{value:{}},emits:["colorChange"],setup(e,{emit:t}){const n=e,r=t,i=we(()=>n.value),o=we(()=>{const c=[i.value.r,i.value.g,i.value.b].join(",");return`linear-gradient(to right, rgba(${c}, 0) 0%, rgba(${c}, 1) 100%)`}),a=ge(),s=c=>{if(c.preventDefault(),!a.value)return;const f=a.value.clientWidth,d=a.value.getBoundingClientRect().left+window.pageXOffset,h=c.pageX-d;let p;h<0?p=0:h>f?p=1:p=Math.round(h*100/f)/100,i.value.a!==p&&r("colorChange",{r:i.value.r,g:i.value.g,b:i.value.b,a:p})},l=()=>{window.removeEventListener("mousemove",s),window.removeEventListener("mouseup",l)},u=c=>{s(c),window.addEventListener("mousemove",s),window.addEventListener("mouseup",l)};return Fn(l),(c,f)=>(U(),ne("div",TEe,[V("div",_Ee,[_(UT)]),V("div",{class:"alpha-gradient",style:Le({background:o.value})},null,4),V("div",{class:"alpha-container",ref_key:"alphaRef",ref:a,onMousedown:f[0]||(f[0]=d=>u(d))},[V("div",{class:"alpha-pointer",style:Le({left:i.value.a*100+"%"})},kEe,4)],544)]))}}),CEe=Ue(PEe,[["__scopeId","data-v-429f62d3"]]),NEe=e=>(rn("data-v-21ccc370"),e=e(),on(),e),IEe={class:"hue"},FEe=NEe(()=>V("div",{class:"hue-picker"},null,-1)),EEe=[FEe],XEe=Ee({__name:"Hue",props:{value:{},hue:{}},emits:["colorChange"],setup(e,{emit:t}){const n=e,r=t,i=ge(0),o=ge(""),a=we(()=>{const d=ot(n.value).toHsl();return n.hue!==-1&&(d.h=n.hue),d}),s=we(()=>a.value.h===0&&o.value==="right"?"100%":a.value.h*100/360+"%");_t(()=>n.value,()=>{const d=ot(n.value).toHsl(),h=d.s===0?n.hue:d.h;h!==0&&h-i.value>0&&(o.value="right"),h!==0&&h-i.value<0&&(o.value="left"),i.value=h});const l=ge(),u=d=>{if(d.preventDefault(),!l.value)return;const h=l.value.clientWidth,p=l.value.getBoundingClientRect().left+window.pageXOffset,v=d.pageX-p;let g,m;v<0?g=0:v>h?g=360:(m=v*100/h,g=360*m/100),(n.hue===-1||a.value.h!==g)&&r("colorChange",{h:g,l:a.value.l,s:a.value.s,a:a.value.a})},c=()=>{window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",c)},f=d=>{u(d),window.addEventListener("mousemove",u),window.addEventListener("mouseup",c)};return Fn(c),(d,h)=>(U(),ne("div",IEe,[V("div",{class:"hue-container",ref_key:"hueRef",ref:l,onMousedown:h[0]||(h[0]=p=>f(p))},[V("div",{class:"hue-pointer",style:Le({left:s.value})},EEe,4)],544)]))}}),WEe=Ue(XEe,[["__scopeId","data-v-21ccc370"]]),nP=e=>(rn("data-v-1a7711ae"),e=e(),on(),e),VEe=nP(()=>V("div",{class:"saturation-white"},null,-1)),DEe=nP(()=>V("div",{class:"saturation-black"},null,-1)),UEe=nP(()=>V("div",{class:"saturation-circle"},null,-1)),BEe=[UEe],YEe=Ee({__name:"Saturation",props:{value:{},hue:{}},emits:["colorChange"],setup(e,{emit:t}){const n=e,r=t,i=we(()=>{const h=ot(n.value).toHsv();return n.hue!==-1&&(h.h=n.hue),h}),o=we(()=>`hsl(${i.value.h}, 100%, 50%)`),a=we(()=>-(i.value.v*100)+1+100+"%"),s=we(()=>i.value.s*100+"%"),l=Un.throttle(function(h){r("colorChange",h)},20,{leading:!0,trailing:!1}),u=ge(),c=h=>{if(h.preventDefault(),!u.value)return;const p=u.value.clientWidth,v=u.value.clientHeight,g=u.value.getBoundingClientRect().left+window.pageXOffset,m=u.value.getBoundingClientRect().top+window.pageYOffset,y=Un.clamp(h.pageX-g,0,p),R=Un.clamp(h.pageY-m,0,v),A=y/p,x=Un.clamp(-(R/v)+1,0,1);l({h:i.value.h,s:A,v:x,a:i.value.a})},f=()=>{window.removeEventListener("mousemove",c),window.removeEventListener("mouseup",f)},d=h=>{c(h),window.addEventListener("mousemove",c),window.addEventListener("mouseup",f)};return Fn(f),(h,p)=>(U(),ne("div",{class:"saturation",ref_key:"saturationRef",ref:u,style:Le({background:o.value}),onMousedown:p[0]||(p[0]=v=>d(v))},[VEe,DEe,V("div",{class:"saturation-pointer",style:Le({top:a.value,left:s.value})},BEe,4)],36))}}),ZEe=Ue(YEe,[["__scopeId","data-v-1a7711ae"]]),QEe={class:"editable-input"},HEe=["value"],KEe=Ee({__name:"EditableInput",props:{value:{}},emits:["colorChange"],setup(e,{emit:t}){const n=e,r=t,i=we(()=>{let a="";return n.value.a<1?a=ot(n.value).toHex8String().toUpperCase():a=ot(n.value).toHexString().toUpperCase(),a.replace("#","")}),o=a=>{const s=a.target.value;if(s.length>=6){const l=ot(s);l.isValid()&&r("colorChange",l.toRgb())}};return(a,s)=>(U(),ne("div",QEe,[V("input",{class:"input-content",value:i.value,onInput:s[0]||(s[0]=l=>o(l))},null,40,HEe)]))}}),GEe=Ue(KEe,[["__scopeId","data-v-573b4dde"]]),zEe={class:"color-picker"},JEe={class:"picker-saturation-wrap"},$Ee={class:"picker-controls"},jEe={class:"picker-color-wrap"},qEe={class:"picker-sliders"},eXe={class:"picker-hue-wrap"},tXe={class:"picker-alpha-wrap"},nXe={class:"picker-field"},rXe={class:"picker-presets"},iXe=["onClick"],oXe={class:"picker-gradient-presets"},aXe=["onClick"],sXe={class:"picker-presets"},lXe=["onClick"],uXe={key:0,class:"recent-colors-title"},cXe={class:"picker-presets"},fXe=["onClick"],qD="RECENT_COLORS",dXe=Ee({__name:"index",props:{modelValue:{default:"#e86b99"}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,i=[["#7f7f7f","#f2f2f2"],["#0d0d0d","#808080"],["#1c1a10","#ddd8c3"],["#0e243d","#c6d9f0"],["#233f5e","#dae5f0"],["#632623","#f2dbdb"],["#4d602c","#eaf1de"],["#3f3150","#e6e0ec"],["#1e5867","#d9eef3"],["#99490f","#fee9da"]],o=(A,x,S)=>{const T=ot(A).toRgb(),w=ot(x).toRgb(),M=(w.r-T.r)/S,O=(w.g-T.g)/S,P=(w.b-T.b)/S,k=[];for(let F=0;F{const A=[];for(const x of i)A.push(o(x[1],x[0],5));return A},s=["#000000","#ffffff","#eeece1","#1e497b","#4e81bb","#e2534d","#9aba60","#8165a0","#47acc5","#f9974c"],l=["#c21401","#ff1e02","#ffc12a","#ffff3a","#90cf5b","#00af57","#00afee","#0071be","#00215f","#72349d"],u=ge(-1),c=ge([]),f=we({get(){return ot(n.modelValue).toRgb()},set(A){const x=`rgba(${[A.r,A.g,A.b,A.a].join(",")})`;r("update:modelValue",x)}}),d=a(),h=we(()=>`rgba(${[f.value.r,f.value.g,f.value.b,f.value.a].join(",")})`),p=A=>{u.value=ot(A).toHsl().h,r("update:modelValue",A)},v=Un.debounce(function(){const A=ot(f.value).toRgbString();if(!c.value.includes(A)){c.value=[A,...c.value];const x=10;c.value.length>x&&(c.value=c.value.slice(0,x))}},300,{trailing:!0});jt(()=>{const A=localStorage.getItem(qD);A&&(c.value=JSON.parse(A))}),_t(c,()=>{const A=JSON.stringify(c.value);localStorage.setItem(qD,A)});const g=A=>{"h"in A?(u.value=A.h,f.value=ot(A).toRgb()):(u.value=ot(A).toHsl().h,f.value=A),v()},m=()=>{"EyeDropper"in window?y():R()},y=()=>{Tn.success("按 ESC 键关闭取色吸管",{duration:0}),new window.EyeDropper().open().then(x=>{const S=ot(x.sRGBHex);u.value=S.toHsl().h,f.value=S.toRgb(),Tn.closeAll(),v()}).catch(()=>{Tn.closeAll()})},R=()=>{const A=document.querySelector(".canvas");if(!A)return;const x=document.createElement("div");x.style.cssText="position: fixed; top: 0; left: 0; bottom: 0; right: 0; z-index: 9999; cursor: wait;",document.body.appendChild(x);const S=document.createElement("div");S.style.cssText="position: absolute; top: -100px; left: -100px; width: 16px; height: 16px; border: 1px solid #000; z-index: 999",x.appendChild(S);const{left:T,top:w,width:M,height:O}=A.getBoundingClientRect();tP(A,{filter:k=>!(k.tagName&&k.tagName.toUpperCase()==="FOREIGNOBJECT"||k.classList&&k.classList.contains("operate")),fontEmbedCSS:"",width:M,height:O,canvasWidth:M,canvasHeight:O,pixelRatio:1}).then(k=>{k.style.cssText=`position: absolute; top: ${w}px; left: ${T}px; cursor: crosshair;`,x.style.cursor="default",x.appendChild(k);const F=k.getContext("2d");if(!F)return;let C="";const I=D=>{const Z=D.x,re=D.y,B=Z-T,Y=re-w,[K,G,ee,q]=F.getImageData(B,Y,1,1).data;C=`rgba(${K}, ${G}, ${ee}, ${(q/255).toFixed(2)})`,S.style.left=Z+10+"px",S.style.top=re+10+"px",S.style.backgroundColor=C},N=()=>{C="",S.style.left="-100px",S.style.top="-100px",S.style.backgroundColor=""},W=D=>{if(C&&D.button===0){const Z=ot(C);u.value=Z.toHsl().h,f.value=Z.toRgb(),v()}document.body.removeChild(x),k.removeEventListener("mousemove",I),k.removeEventListener("mouseleave",N),window.removeEventListener("mousedown",W)};k.addEventListener("mousemove",I),k.addEventListener("mouseleave",N),window.addEventListener("mousedown",W)}).catch(()=>{Tn.error("取色吸管初始化失败"),document.body.removeChild(x)})};return(A,x)=>{const S=Se("IconNeedle");return U(),ne("div",zEe,[V("div",JEe,[_(ZEe,{value:f.value,hue:u.value,onColorChange:x[0]||(x[0]=T=>g(T))},null,8,["value","hue"])]),V("div",$Ee,[V("div",jEe,[V("div",{class:"picker-current-color",style:Le({background:h.value})},null,4),_(UT)]),V("div",qEe,[V("div",eXe,[_(WEe,{value:f.value,hue:u.value,onColorChange:x[1]||(x[1]=T=>g(T))},null,8,["value","hue"])]),V("div",tXe,[_(CEe,{value:f.value,onColorChange:x[2]||(x[2]=T=>g(T))},null,8,["value"])])])]),V("div",nXe,[_(GEe,{class:"input",value:f.value,onColorChange:x[3]||(x[3]=T=>g(T))},null,8,["value"]),V("div",{class:"straw",onClick:x[4]||(x[4]=T=>m())},[_(S)]),V("div",{class:"transparent",onClick:x[5]||(x[5]=T=>p("#00000000"))},[_(UT)])]),V("div",rXe,[(U(),ne(Ve,null,rt(s,T=>V("div",{class:"picker-presets-color",key:T,style:Le({background:T}),onClick:w=>p(T)},null,12,iXe)),64))]),V("div",oXe,[(U(!0),ne(Ve,null,rt(z(d),(T,w)=>(U(),ne("div",{class:"picker-gradient-col",key:w},[(U(!0),ne(Ve,null,rt(T,M=>(U(),ne("div",{class:"picker-gradient-color",key:M,style:Le({background:M}),onClick:O=>p(M)},null,12,aXe))),128))]))),128))]),V("div",sXe,[(U(),ne(Ve,null,rt(l,T=>V("div",{key:T,class:"picker-presets-color",style:Le({background:T}),onClick:w=>p(T)},null,12,lXe)),64))]),c.value.length?(U(),ne("div",uXe,"最近使用:")):Ze("",!0),V("div",cXe,[(U(!0),ne(Ve,null,rt(c.value,T=>(U(),ne("div",{key:T,class:"picker-presets-color alpha",onClick:w=>p(T)},[V("div",{class:"picker-presets-color-content",style:Le({background:T})},null,4)],8,fXe))),128))])])}}}),$n=Ue(dXe,[["__scopeId","data-v-58b37f0f"]]),hXe=e=>(rn("data-v-a0d44a99"),e=e(),on(),e),pXe=hXe(()=>V("span",{class:"switch-core"},null,-1)),vXe=[pXe],gXe=Ee({__name:"Switch",props:{value:{type:Boolean},disabled:{type:Boolean,default:!1}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,i=()=>{n.disabled||r("update:value",!n.value)};return(o,a)=>(U(),ne("span",{class:$e(["switch",{active:o.value,disabled:o.disabled}]),onClick:a[0]||(a[0]=s=>i())},vXe,2))}}),ws=Ue(gXe,[["__scopeId","data-v-a0d44a99"]]),w3=e=>(rn("data-v-3e3db022"),e=e(),on(),e),mXe={class:"element-outline"},yXe={key:0,class:"row"},AXe=w3(()=>V("div",{style:{width:"40%"}},"启用边框:",-1)),RXe={class:"switch-wrapper",style:{width:"60%"}},bXe={class:"row"},xXe=w3(()=>V("div",{style:{width:"40%"}},"边框样式:",-1)),SXe={class:"row"},wXe=w3(()=>V("div",{style:{width:"40%"}},"边框颜色:",-1)),MXe={class:"row"},LXe=w3(()=>V("div",{style:{width:"40%"}},"边框粗细:",-1)),TXe=Ee({__name:"ElementOutline",props:{fixed:{type:Boolean,default:!1}},setup(e){const t=lt(),{theme:n}=We(t),{handleElement:r}=We(dt()),i=ge(),o=ge(!1);_t(r,()=>{r.value&&(i.value="outline"in r.value?r.value.outline:void 0,o.value=!!i.value)},{deep:!0,immediate:!0});const{addHistorySnapshot:a}=qt(),s=u=>{if(!r.value)return;const c={outline:{...i.value,...u}};t.updateElement({id:r.value.id,props:c}),a()},l=u=>{if(r.value){if(u){const c=n.value.outline;t.updateElement({id:r.value.id,props:{outline:c}})}else t.removeElementProps({id:r.value.id,propName:"outline"});a()}};return(u,c)=>(U(),ne("div",mXe,[u.fixed?Ze("",!0):(U(),ne("div",yXe,[AXe,V("div",RXe,[_(ws,{value:o.value,"onUpdate:value":c[0]||(c[0]=f=>l(f))},null,8,["value"])])])),o.value&&i.value?(U(),ne(Ve,{key:1},[V("div",bXe,[xXe,_(Ar,{style:{width:"60%"},value:i.value.style||"","onUpdate:value":c[1]||(c[1]=f=>s({style:f})),options:[{label:"实线边框",value:"solid"},{label:"虚线边框",value:"dashed"},{label:"点线边框",value:"dotted"}]},null,8,["value"])]),V("div",SXe,[wXe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:i.value.color,"onUpdate:modelValue":c[2]||(c[2]=f=>s({color:f}))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:i.value.color||"#000"},null,8,["color"])]),_:1})]),V("div",MXe,[LXe,_(Ko,{value:i.value.width||0,"onUpdate:value":c[3]||(c[3]=f=>s({width:f})),style:{width:"60%"}},null,8,["value"])])],64)):Ze("",!0)]))}}),K2=Ue(TXe,[["__scopeId","data-v-3e3db022"]]),G2=e=>(rn("data-v-671988a4"),e=e(),on(),e),_Xe={class:"element-shadow"},OXe={class:"row"},kXe=G2(()=>V("div",{style:{width:"40%"}},"启用阴影:",-1)),PXe={class:"switch-wrapper",style:{width:"60%"}},CXe={class:"row"},NXe=G2(()=>V("div",{style:{width:"40%"}},"水平阴影:",-1)),IXe={class:"row"},FXe=G2(()=>V("div",{style:{width:"40%"}},"垂直阴影:",-1)),EXe={class:"row"},XXe=G2(()=>V("div",{style:{width:"40%"}},"模糊距离:",-1)),WXe={class:"row"},VXe=G2(()=>V("div",{style:{width:"40%"}},"阴影颜色:",-1)),DXe=Ee({__name:"ElementShadow",setup(e){const t=lt(),{theme:n}=We(t),{handleElement:r}=We(dt()),i=ge(),o=ge(!1);_t(r,()=>{r.value&&(i.value="shadow"in r.value?r.value.shadow:void 0,o.value=!!i.value)},{deep:!0,immediate:!0});const{addHistorySnapshot:a}=qt(),s=u=>{if(!r.value||!i.value)return;const c={...i.value,...u};t.updateElement({id:r.value.id,props:{shadow:c}}),a()},l=u=>{if(r.value){if(u){const c=n.value.shadow;t.updateElement({id:r.value.id,props:{shadow:c}})}else t.removeElementProps({id:r.value.id,propName:"shadow"});a()}};return(u,c)=>(U(),ne("div",_Xe,[V("div",OXe,[kXe,V("div",PXe,[_(ws,{value:o.value,"onUpdate:value":c[0]||(c[0]=f=>l(f))},null,8,["value"])])]),o.value&&i.value?(U(),ne(Ve,{key:0},[V("div",CXe,[NXe,_(Yi,{style:{width:"60%"},min:-10,max:10,step:1,value:i.value.h,"onUpdate:value":c[1]||(c[1]=f=>s({h:f}))},null,8,["value"])]),V("div",IXe,[FXe,_(Yi,{style:{width:"60%"},min:-10,max:10,step:1,value:i.value.v,"onUpdate:value":c[2]||(c[2]=f=>s({v:f}))},null,8,["value"])]),V("div",EXe,[XXe,_(Yi,{style:{width:"60%"},min:1,max:20,step:1,value:i.value.blur,"onUpdate:value":c[3]||(c[3]=f=>s({blur:f}))},null,8,["value"])]),V("div",WXe,[VXe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:i.value.color,"onUpdate:modelValue":c[4]||(c[4]=f=>s({color:f}))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:i.value.color},null,8,["color"])]),_:1})])],64)):Ze("",!0)]))}}),M3=Ue(DXe,[["__scopeId","data-v-671988a4"]]),UXe=()=>{const e=dt(),{richTextAttrs:t,textFormatPainter:n}=We(e);return{toggleTextFormatPainter:(i=!1)=>{n.value?e.setTextFormatPainter(null):e.setTextFormatPainter({keep:i,bold:t.value.bold,em:t.value.em,underline:t.value.underline,strikethrough:t.value.strikethrough,color:t.value.color,backcolor:t.value.backcolor,fontname:t.value.fontname,fontsize:t.value.fontsize,align:t.value.align})}}},BXe={class:"text-color-block"},YXe=Ee({__name:"TextColorButton",props:{color:{}},setup(e){return(t,n)=>(U(),_e(qe,{class:"text-color-btn"},{default:se(()=>[kr(t.$slots,"default",{},void 0,!0),V("div",BXe,[V("div",{class:"text-color-block-content",style:Le({backgroundColor:t.color})},null,4)])]),_:3}))}}),yv=Ue(YXe,[["__scopeId","data-v-97cd463a"]]),Ur=Ee({__name:"CheckboxButton",props:{checked:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(e){return(t,n)=>(U(),_e(qe,{checked:t.checked,disabled:t.disabled,type:"checkbox"},{default:se(()=>[kr(t.$slots,"default")]),_:3},8,["checked","disabled"]))}}),ZXe=Ee({__name:"ButtonGroup",props:{passive:{type:Boolean,default:!1}},setup(e){return(t,n)=>(U(),ne("div",{class:$e(["button-group",{passive:t.passive}]),ref:"groupRef"},[kr(t.$slots,"default",{},void 0,!0)],2))}}),Dn=Ue(ZXe,[["__scopeId","data-v-6a640ef5"]]),QXe={},HXe={class:"select-group"};function KXe(e,t){return U(),ne("div",HXe,[kr(e.$slots,"default",{},void 0,!0)])}const rP=Ue(QXe,[["render",KXe],["__scopeId","data-v-ed58c719"]]),Kn=Ee({__name:"RadioButton",props:{value:{},disabled:{type:Boolean,default:!1}},setup(e){const{value:t,updateValue:n}=hs(wK);return(r,i)=>(U(),_e(qe,{checked:!r.disabled&&z(t)===r.value,disabled:r.disabled,type:"radio",onClick:i[0]||(i[0]=o=>!r.disabled&&z(n)(r.value))},{default:se(()=>[kr(r.$slots,"default")]),_:3},8,["checked","disabled"]))}}),lu=Ee({__name:"RadioGroup",props:{value:{},disabled:{type:Boolean,default:!1}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,i=a=>{n.disabled||r("update:value",a)},o=we(()=>n.value);return Qh(wK,{value:o,updateValue:i}),(a,s)=>(U(),_e(Dn,{class:"radio-group"},{default:se(()=>[kr(a.$slots,"default")]),_:3}))}}),L3=e=>(rn("data-v-830b245d"),e=e(),on(),e),GXe={class:"rich-text-base"},zXe={class:"link-popover"},JXe={class:"btns"},$Xe={class:"row",passive:""},jXe={class:"list-wrap"},qXe=["onClick"],eWe=L3(()=>V("span",null,null,-1)),tWe=[eWe],nWe=L3(()=>V("div",{style:{width:"10px"}},null,-1)),rWe={class:"list-wrap"},iWe=["onClick"],oWe=L3(()=>V("span",null,null,-1)),aWe=[oWe],sWe={class:"row"},lWe=L3(()=>V("div",{style:{width:"10px"}},null,-1)),uWe=Ee({__name:"RichTextBase",setup(e){const{richTextAttrs:t,availableFonts:n,textFormatPainter:r}=We(dt()),{toggleTextFormatPainter:i}=UXe(),o=["12px","14px","16px","18px","20px","22px","24px","28px","32px","36px","40px","44px","48px","54px","60px","66px","72px","76px","80px","88px","96px","104px","112px","120px"],a=(y,R)=>{Bi.emit(Si.RICH_TEXT_COMMAND,{action:{command:y,value:R}})},s=ge(!1),l=ge(!1),u=ge(!1),c=ge(!1),f=ge(["disc","circle","square"]),d=ge(["decimal","lower-roman","upper-roman","lower-alpha","upper-alpha","lower-greek"]),h=ge(""),p=ge(!1);_t(t,()=>p.value=!1);const v=()=>{h.value=t.value.link},g=y=>{if(!y||!/^(https?):\/\/[\w\-]+(\.[\w\-]+)+([\w\-.,@?^=%&:\/~+#]*[\w\-@?^=%&\/~+#])?$/.test(y))return Tn.error("不是正确的网页链接地址");a("link",y),p.value=!1},m=()=>{a("link"),p.value=!1};return(y,R)=>{const A=Se("IconFontSize"),x=Se("IconAddText"),S=Se("IconText"),T=Se("IconHighLight"),w=Se("IconTextBold"),M=Se("IconTextItalic"),O=Se("IconTextUnderline"),P=Se("IconStrikethrough"),k=Se("IconCode"),F=Se("IconQuote"),C=Se("IconFormat"),I=Se("IconFormatBrush"),N=Se("IconLinkOne"),W=Se("IconAlignTextLeft"),D=Se("IconAlignTextCenter"),Z=Se("IconAlignTextRight"),re=Se("IconAlignTextBoth"),B=Se("IconList"),Y=Se("IconDown"),K=Se("IconOrderedList"),G=Se("IconIndentLeft"),ee=Se("IconIndentRight"),q=Cn("tooltip");return U(),ne("div",GXe,[_(rP,{class:"row"},{default:se(()=>[_(Ar,{class:"font-select",style:{width:"60%"},value:z(t).fontname,search:"",searchLabel:"搜索字体","onUpdate:value":R[0]||(R[0]=H=>a("fontname",H)),options:[...z(n),...z(p2)]},{icon:se(()=>[_(A)]),_:1},8,["value","options"]),_(Ar,{style:{width:"40%"},value:z(t).fontsize,search:"",searchLabel:"搜索字号","onUpdate:value":R[1]||(R[1]=H=>a("fontsize",H)),options:o.map(H=>({label:H,value:H}))},{icon:se(()=>[_(x)]),_:1},8,["value","options"])]),_:1}),_(Dn,{class:"row",passive:""},{default:se(()=>[_(It,{trigger:"click",style:{width:"30%"}},{content:se(()=>[_($n,{modelValue:z(t).color,"onUpdate:modelValue":R[2]||(R[2]=H=>a("color",H))},null,8,["modelValue"])]),default:se(()=>[Ge((U(),_e(yv,{first:"",color:z(t).color},{default:se(()=>[_(S)]),_:1},8,["color"])),[[q,"文字颜色"]])]),_:1}),_(It,{trigger:"click",style:{width:"30%"}},{content:se(()=>[_($n,{modelValue:z(t).backcolor,"onUpdate:modelValue":R[3]||(R[3]=H=>a("backcolor",H))},null,8,["modelValue"])]),default:se(()=>[Ge((U(),_e(yv,{color:z(t).backcolor},{default:se(()=>[_(T)]),_:1},8,["color"])),[[q,"文字高亮"]])]),_:1}),Ge((U(),_e(qe,{class:"font-size-btn",style:{width:"20%"},onClick:R[4]||(R[4]=H=>a("fontsize-add"))},{default:se(()=>[_(A),De("+")]),_:1})),[[q,"增大字号"]]),Ge((U(),_e(qe,{last:"",class:"font-size-btn",style:{width:"20%"},onClick:R[5]||(R[5]=H=>a("fontsize-reduce"))},{default:se(()=>[_(A),De("-")]),_:1})),[[q,"减小字号"]])]),_:1}),_(Dn,{class:"row"},{default:se(()=>[Ge((U(),_e(Ur,{style:{flex:"1"},checked:z(t).bold,onClick:R[6]||(R[6]=H=>a("bold"))},{default:se(()=>[_(w)]),_:1},8,["checked"])),[[q,"加粗"]]),Ge((U(),_e(Ur,{style:{flex:"1"},checked:z(t).em,onClick:R[7]||(R[7]=H=>a("em"))},{default:se(()=>[_(M)]),_:1},8,["checked"])),[[q,"斜体"]]),Ge((U(),_e(Ur,{style:{flex:"1"},checked:z(t).underline,onClick:R[8]||(R[8]=H=>a("underline"))},{default:se(()=>[_(O)]),_:1},8,["checked"])),[[q,"下划线"]]),Ge((U(),_e(Ur,{style:{flex:"1"},checked:z(t).strikethrough,onClick:R[9]||(R[9]=H=>a("strikethrough"))},{default:se(()=>[_(P)]),_:1},8,["checked"])),[[q,"删除线"]])]),_:1}),_(Dn,{class:"row"},{default:se(()=>[Ge((U(),_e(Ur,{style:{flex:"1"},checked:z(t).superscript,onClick:R[10]||(R[10]=H=>a("superscript"))},{default:se(()=>[De("A²")]),_:1},8,["checked"])),[[q,"上标"]]),Ge((U(),_e(Ur,{style:{flex:"1"},checked:z(t).subscript,onClick:R[11]||(R[11]=H=>a("subscript"))},{default:se(()=>[De("A₂")]),_:1},8,["checked"])),[[q,"下标"]]),Ge((U(),_e(Ur,{style:{flex:"1"},checked:z(t).code,onClick:R[12]||(R[12]=H=>a("code"))},{default:se(()=>[_(k)]),_:1},8,["checked"])),[[q,"行内代码"]]),Ge((U(),_e(Ur,{style:{flex:"1"},checked:z(t).blockquote,onClick:R[13]||(R[13]=H=>a("blockquote"))},{default:se(()=>[_(F)]),_:1},8,["checked"])),[[q,"引用"]])]),_:1}),_(Dn,{class:"row",passive:""},{default:se(()=>[Ge((U(),_e(Ur,{first:"",style:{flex:"1"},onClick:R[14]||(R[14]=H=>a("clear"))},{default:se(()=>[_(C)]),_:1})),[[q,"清除格式"]]),Ge((U(),_e(Ur,{style:{flex:"1"},checked:!!z(r),onClick:R[15]||(R[15]=H=>z(i)()),onDblclick:R[16]||(R[16]=H=>z(i)(!0))},{default:se(()=>[_(I)]),_:1},8,["checked"])),[[q,"格式刷(双击连续使用)"]]),_(It,{placement:"bottom-end",trigger:"click",value:p.value,"onUpdate:value":R[21]||(R[21]=H=>p.value=H),style:{width:"33.33%"}},{content:se(()=>[V("div",zXe,[_(If,{value:h.value,"onUpdate:value":R[17]||(R[17]=H=>h.value=H),placeholder:"请输入超链接"},null,8,["value"]),V("div",JXe,[_(qe,{size:"small",disabled:!z(t).link,onClick:R[18]||(R[18]=H=>m()),style:{"margin-right":"5px"}},{default:se(()=>[De("移除")]),_:1},8,["disabled"]),_(qe,{size:"small",type:"primary",onClick:R[19]||(R[19]=H=>g(h.value))},{default:se(()=>[De("确认")]),_:1})])])]),default:se(()=>[Ge((U(),_e(Ur,{last:"",style:{width:"100%"},checked:!!z(t).link,onClick:R[20]||(R[20]=H=>v())},{default:se(()=>[_(N)]),_:1},8,["checked"])),[[q,"超链接"]])]),_:1},8,["value"])]),_:1}),_(Yt),_(lu,{class:"row","button-style":"solid",value:z(t).align,"onUpdate:value":R[22]||(R[22]=H=>a("align",H))},{default:se(()=>[Ge((U(),_e(Kn,{value:"left",style:{flex:"1"}},{default:se(()=>[_(W)]),_:1})),[[q,"左对齐"]]),Ge((U(),_e(Kn,{value:"center",style:{flex:"1"}},{default:se(()=>[_(D)]),_:1})),[[q,"居中"]]),Ge((U(),_e(Kn,{value:"right",style:{flex:"1"}},{default:se(()=>[_(Z)]),_:1})),[[q,"右对齐"]]),Ge((U(),_e(Kn,{value:"justify",style:{flex:"1"}},{default:se(()=>[_(re)]),_:1})),[[q,"两端对齐"]])]),_:1},8,["value"]),V("div",$Xe,[_(Dn,{style:{flex:"1"}},{default:se(()=>[Ge((U(),_e(qe,{first:"",type:z(t).bulletList?"primary":"default",style:{flex:"1"},onClick:R[23]||(R[23]=H=>a("bulletList"))},{default:se(()=>[_(B)]),_:1},8,["type"])),[[q,"项目符号"]]),_(It,{trigger:"click",value:s.value,"onUpdate:value":R[24]||(R[24]=H=>s.value=H)},{content:se(()=>[V("div",jXe,[(U(!0),ne(Ve,null,rt(f.value,H=>(U(),ne("ul",{class:"list",key:H,style:Le({listStyleType:H}),onClick:ue=>a("bulletList",H)},[(U(),ne(Ve,null,rt(3,ue=>V("li",{class:"list-item",key:ue},tWe)),64))],12,qXe))),128))])]),default:se(()=>[_(qe,{last:"",class:"popover-btn"},{default:se(()=>[_(Y)]),_:1})]),_:1},8,["value"])]),_:1}),nWe,_(Dn,{style:{flex:"1"},passive:""},{default:se(()=>[Ge((U(),_e(qe,{first:"",type:z(t).orderedList?"primary":"default",style:{flex:"1"},onClick:R[25]||(R[25]=H=>a("orderedList"))},{default:se(()=>[_(K)]),_:1},8,["type"])),[[q,"编号"]]),_(It,{trigger:"click",value:l.value,"onUpdate:value":R[26]||(R[26]=H=>l.value=H)},{content:se(()=>[V("div",rWe,[(U(!0),ne(Ve,null,rt(d.value,H=>(U(),ne("ul",{class:"list",key:H,style:Le({listStyleType:H}),onClick:ue=>a("orderedList",H)},[(U(),ne(Ve,null,rt(3,ue=>V("li",{class:"list-item",key:ue},aWe)),64))],12,iWe))),128))])]),default:se(()=>[_(qe,{last:"",class:"popover-btn"},{default:se(()=>[_(Y)]),_:1})]),_:1},8,["value"])]),_:1})]),V("div",sWe,[_(Dn,{style:{flex:"1"},passive:""},{default:se(()=>[Ge((U(),_e(qe,{first:"",style:{flex:"1"},onClick:R[27]||(R[27]=H=>a("indent","-1"))},{default:se(()=>[_(G)]),_:1})),[[q,"减小段落缩进"]]),_(It,{trigger:"click",value:u.value,"onUpdate:value":R[29]||(R[29]=H=>u.value=H)},{content:se(()=>[_(ri,{onClick:R[28]||(R[28]=H=>a("textIndent","-1"))},{default:se(()=>[De("减小首行缩进")]),_:1})]),default:se(()=>[_(qe,{last:"",class:"popover-btn"},{default:se(()=>[_(Y)]),_:1})]),_:1},8,["value"])]),_:1}),lWe,_(Dn,{style:{flex:"1"},passive:""},{default:se(()=>[Ge((U(),_e(qe,{first:"",style:{flex:"1"},onClick:R[30]||(R[30]=H=>a("indent","+1"))},{default:se(()=>[_(ee)]),_:1})),[[q,"增大段落缩进"]]),_(It,{trigger:"click",value:c.value,"onUpdate:value":R[32]||(R[32]=H=>c.value=H)},{content:se(()=>[_(ri,{onClick:R[31]||(R[31]=H=>a("textIndent","+1"))},{default:se(()=>[De("增大首行缩进")]),_:1})]),default:se(()=>[_(qe,{last:"",class:"popover-btn"},{default:se(()=>[_(Y)]),_:1})]),_:1},8,["value"])]),_:1})])])}}}),Mq=Ue(uWe,[["__scopeId","data-v-830b245d"]]),T3=e=>(rn("data-v-82b69e69"),e=e(),on(),e),cWe={class:"text-style-panel"},fWe={class:"preset-style"},dWe=["onClick"],hWe={class:"row"},pWe=T3(()=>V("div",{style:{width:"40%"}},"行间距:",-1)),vWe={class:"row"},gWe=T3(()=>V("div",{style:{width:"40%"}},"段间距:",-1)),mWe={class:"row"},yWe=T3(()=>V("div",{style:{width:"40%"}},"字间距:",-1)),AWe={class:"row"},RWe=T3(()=>V("div",{style:{width:"40%"}},"文本框填充:",-1)),bWe=Ee({__name:"TextStylePanel",setup(e){const t=[{label:"大标题",style:{fontSize:"26px",fontWeight:700},cmd:[{command:"clear"},{command:"bold"},{command:"fontsize",value:"66px"},{command:"align",value:"center"}]},{label:"小标题",style:{fontSize:"22px",fontWeight:700},cmd:[{command:"clear"},{command:"bold"},{command:"fontsize",value:"40px"},{command:"align",value:"center"}]},{label:"正文",style:{fontSize:"20px"},cmd:[{command:"clear"},{command:"fontsize",value:"20px"}]},{label:"正文[小]",style:{fontSize:"18px"},cmd:[{command:"clear"},{command:"fontsize",value:"18px"}]},{label:"注释 1",style:{fontSize:"16px",fontStyle:"italic"},cmd:[{command:"clear"},{command:"fontsize",value:"16px"},{command:"em"}]},{label:"注释 2",style:{fontSize:"16px",textDecoration:"underline"},cmd:[{command:"clear"},{command:"fontsize",value:"16px"},{command:"underline"}]}],n=dt(),r=lt(),{handleElement:i,handleElementId:o}=We(n),{addHistorySnapshot:a}=qt(),s=A=>{r.updateElement({id:o.value,props:A}),a()},l=ge("#000"),u=ge(),c=ge(),f=ge();_t(i,()=>{!i.value||i.value.type!=="text"||(l.value=i.value.fill||"#fff",u.value=i.value.lineHeight||1.5,c.value=i.value.wordSpace||0,f.value=i.value.paragraphSpace===void 0?5:i.value.paragraphSpace,Bi.emit(Si.SYNC_RICH_TEXT_ATTRS_TO_STORE))},{deep:!0,immediate:!0});const d=[.9,1,1.15,1.2,1.4,1.5,1.8,2,2.5,3],h=[0,1,2,3,4,5,6,8,10],p=[0,5,10,15,20,25,30,40,50,80],v=A=>{s({lineHeight:A})},g=A=>{s({paragraphSpace:A})},m=A=>{s({wordSpace:A})},y=A=>{s({fill:A})},R=A=>{Bi.emit(Si.RICH_TEXT_COMMAND,{action:A})};return(A,x)=>{const S=Se("IconRowHeight"),T=Se("IconVerticalSpacingBetweenItems"),w=Se("IconFullwidth");return U(),ne("div",cWe,[V("div",fWe,[(U(),ne(Ve,null,rt(t,M=>V("div",{class:"preset-style-item",key:M.label,style:Le(M.style),onClick:O=>R(M.cmd)},pt(M.label),13,dWe)),64))]),_(Yt),_(Mq),_(Yt),V("div",hWe,[pWe,_(Ar,{style:{width:"60%"},value:u.value||1,"onUpdate:value":x[0]||(x[0]=M=>v(M)),options:d.map(M=>({label:M+"倍",value:M}))},{icon:se(()=>[_(S)]),_:1},8,["value","options"])]),V("div",vWe,[gWe,_(Ar,{style:{width:"60%"},value:f.value||0,"onUpdate:value":x[1]||(x[1]=M=>g(M)),options:p.map(M=>({label:M+"px",value:M}))},{icon:se(()=>[_(T)]),_:1},8,["value","options"])]),V("div",mWe,[yWe,_(Ar,{style:{width:"60%"},value:c.value||0,"onUpdate:value":x[2]||(x[2]=M=>m(M)),options:h.map(M=>({label:M+"px",value:M}))},{icon:se(()=>[_(w)]),_:1},8,["value","options"])]),V("div",AWe,[RWe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:l.value,"onUpdate:modelValue":x[3]||(x[3]=M=>y(M))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:l.value},null,8,["color"])]),_:1})]),_(Yt),_(K2),_(Yt),_(M3),_(Yt),_(yq)])}}}),xWe=Ue(bWe,[["__scopeId","data-v-82b69e69"]]),SWe={class:"element-flip"},wWe=Ee({__name:"ElementFlip",setup(e){const t=lt(),{handleElement:n}=We(dt()),r=ge(!1),i=ge(!1);_t(n,()=>{n.value&&(n.value.type==="image"||n.value.type==="shape")&&(r.value=!!n.value.flipH,i.value=!!n.value.flipV)},{deep:!0,immediate:!0});const{addHistorySnapshot:o}=qt(),a=s=>{n.value&&(t.updateElement({id:n.value.id,props:s}),o())};return(s,l)=>{const u=Se("IconFlipVertically"),c=Se("IconFlipHorizontally");return U(),ne("div",SWe,[_(Dn,{class:"row"},{default:se(()=>[_(Ur,{style:{flex:"1"},checked:i.value,onClick:l[0]||(l[0]=f=>a({flipV:!i.value}))},{default:se(()=>[_(u),De(" 垂直翻转")]),_:1},8,["checked"]),_(Ur,{style:{flex:"1"},checked:r.value,onClick:l[1]||(l[1]=f=>a({flipH:!r.value}))},{default:se(()=>[_(c),De(" 水平翻转")]),_:1},8,["checked"])]),_:1})])}}}),Lq=Ue(wWe,[["__scopeId","data-v-100c8a7c"]]),MWe=e=>(rn("data-v-e7ba40ca"),e=e(),on(),e),LWe={class:"element-filter"},TWe={class:"row"},_We=MWe(()=>V("div",{style:{flex:"2"}},"启用滤镜:",-1)),OWe={class:"switch-wrapper",style:{flex:"3"}},kWe={class:"presets"},PWe=["onClick"],CWe=["src"],NWe={class:"preset-label"},IWe={class:"filter"},FWe={class:"name"},EWe=Ee({__name:"ElementFilter",setup(e){const t=[{label:"模糊",key:"blur",default:0,value:0,unit:"px",max:10,step:1},{label:"亮度",key:"brightness",default:100,value:100,unit:"%",max:200,step:5},{label:"对比度",key:"contrast",default:100,value:100,unit:"%",max:200,step:5},{label:"灰度",key:"grayscale",default:0,value:0,unit:"%",max:100,step:5},{label:"饱和度",key:"saturate",default:100,value:100,unit:"%",max:200,step:5},{label:"色相",key:"hue-rotate",default:0,value:0,unit:"deg",max:360,step:10},{label:"褐色",key:"sepia",default:0,value:0,unit:"%",max:100,step:5},{label:"反转",key:"invert",default:0,value:0,unit:"%",max:100,step:5},{label:"不透明度",key:"opacity",default:100,value:100,unit:"%",max:100,step:5}],n=[{label:"黑白",values:{grayscale:"100%"}},{label:"复古",values:{sepia:"50%",contrast:"110%",brightness:"90%"}},{label:"锐化",values:{contrast:"150%"}},{label:"柔和",values:{brightness:"110%",contrast:"90%"}},{label:"暖色",values:{sepia:"30%",saturate:"135%"}},{label:"明亮",values:{brightness:"110%",contrast:"110%"}},{label:"鲜艳",values:{saturate:"200%"}},{label:"模糊",values:{blur:"2px"}},{label:"反转",values:{invert:"100%"}}],r=lt(),{handleElement:i,handleElementId:o}=We(dt()),a=i,s=ge(JSON.parse(JSON.stringify(t))),l=ge(!1),{addHistorySnapshot:u}=qt();_t(i,()=>{if(!i.value||i.value.type!=="image")return;const p=i.value.filters;p?(s.value=t.map(v=>{const g=p[v.key];return g?{...v,value:parseInt(g)}:v}),l.value=!0):(s.value=JSON.parse(JSON.stringify(t)),l.value=!1)},{deep:!0,immediate:!0});const c=p=>{let v="";const g=Object.keys(p);for(const m of g)v+=`${m}(${p[m]}) `;return v},f=(p,v)=>{const y={...i.value.filters||{},[p.key]:`${v}${p.unit}`};r.updateElement({id:o.value,props:{filters:y}}),u()},d=p=>{i.value&&(p?r.updateElement({id:i.value.id,props:{filters:{}}}):r.removeElementProps({id:i.value.id,propName:"filters"}),u())},h=p=>{r.updateElement({id:o.value,props:{filters:p}}),u()};return(p,v)=>(U(),ne("div",LWe,[V("div",TWe,[_We,V("div",OWe,[_(ws,{value:l.value,"onUpdate:value":v[0]||(v[0]=g=>d(g))},null,8,["value"])])]),l.value?(U(),ne(Ve,{key:0},[V("div",kWe,[(U(),ne(Ve,null,rt(n,(g,m)=>V("div",{class:"preset-item",key:m,onClick:y=>h(g.values)},[V("img",{src:z(a).src,alt:"",style:Le({filter:c(g.values)})},null,12,CWe),V("span",NWe,pt(g.label),1)],8,PWe)),64))]),V("div",IWe,[(U(!0),ne(Ve,null,rt(s.value,g=>(U(),ne("div",{class:"filter-item",key:g.key},[V("div",FWe,pt(g.label),1),_(Yi,{class:"filter-slider",max:g.max,min:0,step:g.step,value:g.value,"onUpdate:value":m=>f(g,m)},null,8,["max","step","value","onUpdate:value"])]))),128))])],64)):Ze("",!0)]))}}),XWe=Ue(EWe,[["__scopeId","data-v-e7ba40ca"]]),Tq=e=>(rn("data-v-51ffed2c"),e=e(),on(),e),WWe={class:"element-color-mask"},VWe={class:"row"},DWe=Tq(()=>V("div",{style:{width:"40%"}},"着色(蒙版):",-1)),UWe={class:"switch-wrapper",style:{width:"60%"}},BWe={key:0,class:"row",style:{"margin-top":"15px"}},YWe=Tq(()=>V("div",{style:{width:"40%"}},"蒙版颜色:",-1)),eU="rgba(226, 83, 77, 0.5)",ZWe=Ee({__name:"ElementColorMask",setup(e){const t=lt(),{handleElement:n,handleElementId:r}=We(dt()),i=ge(eU),o=ge(!1),{addHistorySnapshot:a}=qt();_t(n,()=>{!n.value||n.value.type!=="image"||(n.value.colorMask?(i.value=n.value.colorMask,o.value=!0):o.value=!1)},{deep:!0,immediate:!0});const s=u=>{n.value&&(u?t.updateElement({id:n.value.id,props:{colorMask:eU}}):t.removeElementProps({id:n.value.id,propName:"colorMask"}),a())},l=u=>{t.updateElement({id:r.value,props:{colorMask:u}}),a()};return(u,c)=>(U(),ne("div",WWe,[V("div",VWe,[DWe,V("div",UWe,[_(ws,{value:o.value,"onUpdate:value":c[0]||(c[0]=f=>s(f))},null,8,["value"])])]),o.value?(U(),ne("div",BWe,[YWe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:i.value,"onUpdate:modelValue":c[1]||(c[1]=f=>l(f))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:i.value},null,8,["color"])]),_:1})])):Ze("",!0)]))}}),QWe=Ue(ZWe,[["__scopeId","data-v-51ffed2c"]]),_q=e=>(rn("data-v-0e7500b2"),e=e(),on(),e),HWe={class:"image-style-panel"},KWe={class:"clip"},GWe=_q(()=>V("div",{class:"title"},"按形状:",-1)),zWe={class:"shape-clip"},JWe=["onClick"],$We={key:0,class:"title"},jWe={class:"row"},qWe=_q(()=>V("div",{style:{width:"40%"}},"圆角半径:",-1)),eVe=Ee({__name:"ImageStylePanel",setup(e){const t=pL,n=[{label:"纵横比(正方形)",children:[{key:"1:1",ratio:1/1}]},{label:"纵横比(纵向)",children:[{key:"2:3",ratio:3/2},{key:"3:4",ratio:4/3},{key:"3:5",ratio:5/3},{key:"4:5",ratio:5/4}]},{label:"纵横比(横向)",children:[{key:"3:2",ratio:2/3},{key:"4:3",ratio:3/4},{key:"5:3",ratio:3/5},{key:"5:4",ratio:4/5}]},{children:[{key:"16:9",ratio:9/16},{key:"16:10",ratio:10/16}]}],r=dt(),i=lt(),{handleElement:o,handleElementId:a}=We(r),{currentSlide:s}=We(i),l=o,u=ge(!1),{addHistorySnapshot:c}=qt(),f=()=>{r.setClipingImageElementId(a.value),u.value=!1},d=()=>{const y=o.value,R=y.width,A=y.height,x=y.left,S=y.top,T=y.clip?y.clip.range:[[0,0],[100,100]],w=R/((T[1][0]-T[0][0])/100),M=A/((T[1][1]-T[0][1])/100),O=x-w*(T[0][0]/100),P=S-M*(T[0][1]/100);return{originClipRange:T,originWidth:w,originHeight:M,originLeft:O,originTop:P}},h=y=>{o.value&&(i.updateElement({id:a.value,props:y}),c())},p=(y,R=0)=>{const A=o.value,{originClipRange:x,originWidth:S,originHeight:T,originLeft:w,originTop:M}=d();if(R){const O=T/S,P=0,k=100;let F;if(O>R){const C=(1-R/O)/2*100;F=[[P,C],[k,k-C]]}else{const C=(1-O/R)/2*100;F=[[C,P],[k-C,k]]}h({clip:{...A.clip,shape:y,range:F},left:w+S*(F[0][0]/100),top:M+T*(F[0][1]/100),width:S*(F[1][0]-F[0][0])/100,height:T*(F[1][1]-F[0][1])/100})}else{const O={...A.clip,shape:y,range:x};let P={clip:O};y==="rect"&&(P={clip:O,radius:0}),h(P)}f()},v=y=>{const R=y[0];R&&zf(R).then(A=>{h({src:A})})},g=()=>{if(o.value.clip){const{originWidth:R,originHeight:A,originLeft:x,originTop:S}=d();h({left:x,top:S,width:R,height:A})}i.removeElementProps({id:a.value,propName:["clip","outline","flip","shadow","filters","colorMask"]}),c()},m=()=>{const y=o.value,R={...s.value.background,type:"image",image:{src:y.src,size:"cover"}};i.updateSlide({background:R}),c()};return(y,R)=>{const A=Se("IconTailoring"),x=Se("IconDown"),S=Se("IconTransform"),T=Se("IconUndo"),w=Se("IconTheme");return U(),ne("div",HWe,[V("div",{class:"origin-image",style:Le({backgroundImage:`url(${z(l).src})`})},null,4),_(Lq),_(Dn,{class:"row",passive:""},{default:se(()=>[_(qe,{first:"",style:{width:"calc(100% / 6 * 5)"},onClick:R[0]||(R[0]=M=>f())},{default:se(()=>[_(A,{class:"btn-icon"}),De(" 裁剪图片")]),_:1}),_(It,{trigger:"click",value:u.value,"onUpdate:value":R[1]||(R[1]=M=>u.value=M),style:{width:"calc(100% / 6)"}},{content:se(()=>[V("div",KWe,[GWe,V("div",zWe,[(U(!0),ne(Ve,null,rt(z(t),(M,O)=>(U(),ne("div",{class:"shape-clip-item",key:O,onClick:P=>p(O)},[V("div",{class:"shape",style:Le({clipPath:M.style})},null,4)],8,JWe))),128))]),(U(),ne(Ve,null,rt(n,M=>(U(),ne(Ve,{key:M.label},[M.label?(U(),ne("div",$We,"按"+pt(M.label)+":",1)):Ze("",!0),_(Dn,{class:"row"},{default:se(()=>[(U(!0),ne(Ve,null,rt(M.children,O=>(U(),_e(qe,{style:{flex:"1"},key:O.key,onClick:P=>p("rect",O.ratio)},{default:se(()=>[De(pt(O.key),1)]),_:2},1032,["onClick"]))),128))]),_:2},1024)],64))),64))])]),default:se(()=>[_(qe,{last:"",class:"popover-btn",style:{width:"100%"}},{default:se(()=>[_(x)]),_:1})]),_:1},8,["value"])]),_:1}),V("div",jWe,[qWe,_(Ko,{value:z(l).radius||0,"onUpdate:value":R[2]||(R[2]=M=>h({radius:M})),style:{width:"60%"}},null,8,["value"])]),_(Yt),_(QWe),_(Yt),_(XWe),_(Yt),_(K2),_(Yt),_(M3),_(Yt),_(Xh,{onChange:R[3]||(R[3]=M=>v(M))},{default:se(()=>[_(qe,{class:"full-width-btn"},{default:se(()=>[_(S,{class:"btn-icon"}),De(" 替换图片")]),_:1})]),_:1}),_(qe,{class:"full-width-btn",onClick:R[4]||(R[4]=M=>g())},{default:se(()=>[_(T,{class:"btn-icon"}),De(" 重置样式")]),_:1}),_(qe,{class:"full-width-btn",onClick:R[5]||(R[5]=M=>m())},{default:se(()=>[_(w,{class:"btn-icon"}),De(" 设为背景")]),_:1})])}}}),tVe=Ue(eVe,[["__scopeId","data-v-0e7500b2"]]),nVe=()=>{const e=dt(),{shapeFormatPainter:t,handleElement:n}=We(e);return{toggleShapeFormatPainter:(i=!1)=>{const o=n.value;t.value?e.setShapeFormatPainter(null):e.setShapeFormatPainter({keep:i,fill:o.fill,gradient:o.gradient,outline:o.outline,opacity:o.opacity,shadow:o.shadow})}}},rVe={class:"gradient-bar"},iVe=["onMousedown","onContextmenu"],oVe=Ee({__name:"GradientBar",props:{value:{}},emits:["update:value","update:index"],setup(e,{emit:t}){const n=e,r=t,i=ge([]),o=ge(),a=ge(0);xv(()=>{i.value=n.value,a.value>n.value.length-1&&(a.value=0)}),_t(a,()=>{r("update:index",a.value)});const s=we(()=>`linear-gradient(to right, ${i.value.map(d=>`${d.color} ${d.pos}%`).join(",")})`),l=f=>{if(n.value.length<=2)return;f===a.value?a.value=f-1<0?0:f-1:a.value===n.value.length-1&&(a.value=n.value.length-2);const d=n.value.filter((h,p)=>p!==f);r("update:value",d)},u=f=>{let d=!0;document.onmousemove=h=>{if(!d||!o.value)return;let p=Math.round((h.clientX-o.value.getBoundingClientRect().left)/o.value.clientWidth*100);p>100&&(p=100),p<0&&(p=0),i.value=i.value.map((v,g)=>g===f?{...v,pos:p}:v)},document.onmouseup=()=>{d=!1;const h=i.value[f],p=[...i.value];p.splice(f,1);let v=0;for(let g=0;gp[g].pos&&(v=g+1);a.value=v,p.splice(v,0,h),r("update:value",p),document.onmousemove=null,document.onmouseup=null}},c=f=>{if(n.value.length>=6||!o.value)return;const d=Math.round((f.clientX-o.value.getBoundingClientRect().left)/o.value.clientWidth*100);let h=0;for(let g=0;gn.value[g].pos&&(h=g+1);const p=n.value[h-1]?n.value[h-1].color:n.value[h].color,v=[...n.value];v.splice(h,0,{pos:d,color:p}),a.value=h,r("update:value",v)};return(f,d)=>(U(),ne("div",rVe,[V("div",{class:"bar",ref_key:"barRef",ref:o,style:Le({backgroundImage:s.value}),onClick:d[0]||(d[0]=h=>c(h))},null,4),(U(!0),ne(Ve,null,rt(i.value,(h,p)=>(U(),ne("div",{class:$e(["point",{active:a.value===p}]),key:h.pos+"-"+p,style:Le({backgroundColor:h.color,left:`calc(${h.pos}% - 5px)`}),onMousedown:Et(v=>u(p),["left"]),onContextmenu:Et(v=>l(p),["right"])},null,46,iVe))),128))]))}}),Oq=Ue(oVe,[["__scopeId","data-v-c1273c7e"]]),_3=e=>(rn("data-v-d5ed5ce8"),e=e(),on(),e),aVe={class:"shape-style-panel"},sVe={class:"title"},lVe=_3(()=>V("span",null,"点击替换形状",-1)),uVe={class:"shape-pool"},cVe={class:"shape-list"},fVe={class:"row"},dVe=_3(()=>V("div",{style:{width:"10px"}},null,-1)),hVe={class:"row"},pVe={class:"row"},vVe=_3(()=>V("div",{style:{width:"40%"}},"当前色块:",-1)),gVe={key:0,class:"row"},mVe=_3(()=>V("div",{style:{width:"40%"}},"渐变角度:",-1)),yVe={class:"row"},AVe=Ee({__name:"ShapeStylePanel",setup(e){const t=dt(),n=lt(),{handleElement:r,handleElementId:i,shapeFormatPainter:o}=We(t),a=r,s=ge("#000"),l=ge({type:"linear",rotate:0,colors:[{pos:0,color:"#fff"},{pos:100,color:"#fff"}]}),u=ge("fill"),c=ge("middle"),f=ge(0);_t(r,()=>{var S,T;if(!r.value||r.value.type!=="shape")return;s.value=r.value.fill||"#fff";const x=[{pos:0,color:s.value},{pos:100,color:"#fff"}];l.value=r.value.gradient||{type:"linear",rotate:0,colors:x},u.value=r.value.gradient?"gradient":"fill",c.value=((T=(S=r.value)==null?void 0:S.text)==null?void 0:T.align)||"middle"},{deep:!0,immediate:!0});const{addHistorySnapshot:d}=qt(),{toggleShapeFormatPainter:h}=nVe(),p=x=>{n.updateElement({id:i.value,props:x}),d()},v=x=>{x==="fill"?(n.removeElementProps({id:i.value,propName:"gradient"}),d()):(f.value=0,p({gradient:l.value}))},g=x=>{if(!l.value)return;const S={...l.value,...x};p({gradient:S})},m=x=>{const S=l.value.colors.map((T,w)=>w===f.value?{...T,color:x}:T);g({colors:S})},y=x=>{p({fill:x})},R=x=>{const{width:S,height:T}=r.value,w={viewBox:x.viewBox,path:x.path,special:x.special};if(x.pathFormula){w.pathFormula=x.pathFormula,w.viewBox=[S,T];const M=Gh[x.pathFormula];"editable"in M?(w.path=M.formula(S,T,M.defaultValue),w.keypoints=M.defaultValue):w.path=M.formula(S,T)}else w.pathFormula=void 0,w.keypoints=void 0;p(w)},A=x=>{const S=r.value,T={content:"",defaultFontName:"微软雅黑",defaultColor:"#000",align:"middle"},w=S.text||T;p({text:{...w,align:x}})};return(x,S)=>{var F;const T=Se("IconDown"),w=Se("IconAlignTextTopOne"),M=Se("IconAlignTextMiddleOne"),O=Se("IconAlignTextBottomOne"),P=Se("IconFormatBrush"),k=Cn("tooltip");return U(),ne("div",aVe,[V("div",sVe,[lVe,_(T)]),V("div",uVe,[(U(!0),ne(Ve,null,rt(z(J_),C=>(U(),ne("div",{class:"category",key:C.type},[V("div",cVe,[(U(!0),ne(Ve,null,rt(C.children,(I,N)=>(U(),_e(jj,{class:"shape-item",key:N,shape:I,onClick:W=>R(I)},null,8,["shape","onClick"]))),128))])]))),128))]),V("div",fVe,[_(Ar,{style:{flex:"1"},value:u.value,"onUpdate:value":S[0]||(S[0]=C=>v(C)),options:[{label:"纯色填充",value:"fill"},{label:"渐变填充",value:"gradient"}]},null,8,["value"]),dVe,u.value==="fill"?(U(),_e(It,{key:0,trigger:"click",style:{flex:"1"}},{content:se(()=>[_($n,{modelValue:s.value,"onUpdate:modelValue":S[1]||(S[1]=C=>y(C))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:s.value},null,8,["color"])]),_:1})):(U(),_e(Ar,{key:1,style:{flex:"1"},value:l.value.type,"onUpdate:value":S[2]||(S[2]=C=>g({type:C})),options:[{label:"线性渐变",value:"linear"},{label:"径向渐变",value:"radial"}]},null,8,["value"]))]),u.value==="gradient"?(U(),ne(Ve,{key:0},[V("div",hVe,[_(Oq,{value:l.value.colors,"onUpdate:value":S[3]||(S[3]=C=>g({colors:C})),"onUpdate:index":S[4]||(S[4]=C=>f.value=C)},null,8,["value"])]),V("div",pVe,[vVe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:l.value.colors[f.value].color,"onUpdate:modelValue":S[5]||(S[5]=C=>m(C))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:l.value.colors[f.value].color},null,8,["color"])]),_:1})]),l.value.type==="linear"?(U(),ne("div",gVe,[mVe,_(Yi,{style:{width:"60%"},min:0,max:360,step:15,value:l.value.rotate,"onUpdate:value":S[6]||(S[6]=C=>g({rotate:C}))},null,8,["value"])])):Ze("",!0)],64)):Ze("",!0),_(Lq),_(Yt),(F=z(a).text)!=null&&F.content?(U(),ne(Ve,{key:1},[_(Mq),_(Yt),_(lu,{class:"row","button-style":"solid",value:c.value,"onUpdate:value":S[7]||(S[7]=C=>A(C))},{default:se(()=>[Ge((U(),_e(Kn,{value:"top",style:{flex:"1"}},{default:se(()=>[_(w)]),_:1})),[[k,"顶对齐"]]),Ge((U(),_e(Kn,{value:"middle",style:{flex:"1"}},{default:se(()=>[_(M)]),_:1})),[[k,"居中"]]),Ge((U(),_e(Kn,{value:"bottom",style:{flex:"1"}},{default:se(()=>[_(O)]),_:1})),[[k,"底对齐"]])]),_:1},8,["value"]),_(Yt)],64)):Ze("",!0),_(K2),_(Yt),_(M3),_(Yt),_(yq),_(Yt),V("div",yVe,[Ge((U(),_e(Ur,{style:{flex:"1"},checked:!!z(o),onClick:S[8]||(S[8]=C=>z(h)()),onDblclick:S[9]||(S[9]=C=>z(h)(!0))},{default:se(()=>[_(P),De(" 形状格式刷")]),_:1},8,["checked"])),[[k,"双击连续使用"]])])])}}}),RVe=Ue(AVe,[["__scopeId","data-v-d5ed5ce8"]]),z2=e=>(rn("data-v-2766c9e7"),e=e(),on(),e),bVe={class:"line-style-panel"},xVe={class:"row"},SVe=z2(()=>V("div",{style:{width:"40%"}},"线条样式:",-1)),wVe={class:"row"},MVe=z2(()=>V("div",{style:{width:"40%"}},"线条颜色:",-1)),LVe={class:"row"},TVe=z2(()=>V("div",{style:{width:"40%"}},"线条宽度:",-1)),_Ve={class:"row"},OVe=z2(()=>V("div",{style:{width:"40%"}},"起点样式:",-1)),kVe={class:"row"},PVe=z2(()=>V("div",{style:{width:"40%"}},"终点样式:",-1)),CVe={class:"row"},NVe=Ee({__name:"LineStylePanel",setup(e){const t=lt(),{handleElement:n}=We(dt()),r=n,{addHistorySnapshot:i}=qt(),o=a=>{n.value&&(t.updateElement({id:n.value.id,props:a}),i())};return(a,s)=>{const l=Se("IconSwitch");return U(),ne("div",bVe,[V("div",xVe,[SVe,_(Ar,{style:{width:"60%"},value:z(r).style,"onUpdate:value":s[0]||(s[0]=u=>o({style:u})),options:[{label:"实线",value:"solid"},{label:"虚线",value:"dashed"},{label:"点线",value:"dotted"}]},null,8,["value"])]),V("div",wVe,[MVe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:z(r).color,"onUpdate:modelValue":s[1]||(s[1]=u=>o({color:u}))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:z(r).color},null,8,["color"])]),_:1})]),V("div",LVe,[TVe,_(Ko,{value:z(r).width,"onUpdate:value":s[2]||(s[2]=u=>o({width:u})),style:{width:"60%"}},null,8,["value"])]),V("div",_Ve,[OVe,_(Ar,{style:{width:"60%"},value:z(r).points[0],"onUpdate:value":s[3]||(s[3]=u=>o({points:[u,z(r).points[1]]})),options:[{label:"无",value:""},{label:"箭头",value:"arrow"},{label:"圆点",value:"dot"}]},null,8,["value"])]),V("div",kVe,[PVe,_(Ar,{style:{width:"60%"},value:z(r).points[1],"onUpdate:value":s[4]||(s[4]=u=>o({points:[z(r).points[0],u]})),options:[{label:"无",value:""},{label:"箭头",value:"arrow"},{label:"圆点",value:"dot"}]},null,8,["value"])]),_(Yt),V("div",CVe,[_(qe,{style:{flex:"1"},onClick:s[5]||(s[5]=u=>o({start:z(r).end,end:z(r).start}))},{default:se(()=>[_(l),De(" 交换方向")]),_:1})]),_(Yt),_(M3)])}}}),IVe=Ue(NVe,[["__scopeId","data-v-2766c9e7"]]),kq=e=>(rn("data-v-31747c29"),e=e(),on(),e),FVe={class:"chart-data-editor"},EVe={class:"editor-content"},XVe={class:"handler"},WVe={class:"col-header"},VVe={class:"col-key"},DVe={class:"row-header"},UVe={class:"row-key"},BVe=kq(()=>V("div",{class:"all-header"},[V("svg",{class:"triangle",width:"8",height:"8",viewBox:"0 0 8 8",xmlns:"http://www.w3.org/2000/svg"},[V("path",{d:"M8,0 L8,8 L0,8 L8,0",fill:"#ccc"})])],-1)),YVe={class:"range-box"},ZVe=["id","onFocus","onPaste"],QVe={class:"btns"},HVe={class:"left"},KVe=kq(()=>V("span",{class:"change"},"点击更换",-1)),GVe={class:"right"},zVe="ABCDEFGHIJKLMNOPQRSTUVWXYZ",Nc=100,Ic=32,JVe=Ee({__name:"ChartDataEditor",props:{type:{},data:{}},emits:["save","close"],setup(e,{emit:t}){const n=e,r=t,i=["bar","column","line","area","scatter","pie","ring","radar"],o=ge(!1),a=ge([0,0]),s=ge({width:0,height:0}),l=ge(null),u=ge("bar"),c=we(()=>{const A=a.value[0]*Nc,x=a.value[1]*Ic;return[{type:"t",style:{width:A+"px"}},{type:"b",style:{top:x+"px",width:A+"px"}},{type:"l",style:{height:x+"px"}},{type:"r",style:{left:A+"px",height:x+"px"}}]}),f=we(()=>{const A=a.value[0]*Nc,x=a.value[1]*Ic;return{left:A+"px",top:x+"px"}});jt(()=>{u.value=n.type;const A=[],{labels:x,legends:S,series:T}=n.data,w=x.length,M=T.length;A.push(["",...S]);for(let O=0;O{if(!l.value)return;const[A,x]=l.value,S=document.querySelector(`#cell-${A+1}-${x}`);S&&S.focus()},p=A=>{A.key.toUpperCase()===yt.ENTER&&h()};jt(()=>{document.addEventListener("keydown",p)}),Fn(()=>{document.removeEventListener("keydown",p)});const v=()=>{const[A,x]=a.value,S=[];let T=[],w=[];for(let M=1;M2&&(T=T.slice(0,2),w=w.slice(0,2)),T.length<2&&(T.push("Y"),w.push(w[0]))),(u.value==="ring"||u.value==="pie")&&T.length>1&&(T=T.slice(0,1),w=w.slice(0,1)),r("save",{data:{labels:S,legends:T,series:w},type:u.value})},g=()=>{for(let A=1;A<31;A++)for(let x=1;x<7;x++){const S=document.querySelector(`#cell-${A}-${x}`);S&&(S.value="")}},m=(A,x,S)=>{if(A.preventDefault(),!A.clipboardData)return;const T=A.clipboardData.items[0];T&&T.kind==="string"&&T.type==="text/plain"&&T.getAsString(w=>{if(typeof G_(w)=="object")return;const O=nQ(w);if(O){const P=x+O.length,k=S+O[0].length;for(let F=x;Fr("close"),R=A=>{let x=!0;const S=A.pageX,T=A.pageY,w=a.value[0]*Nc,M=a.value[1]*Ic;document.onmousemove=O=>{if(!x)return;const P=O.pageX,k=O.pageY,F=P-S,C=k-T,I=w+F,N=M+C;s.value={width:I,height:N}},document.onmouseup=O=>{x=!1,document.onmousemove=null,document.onmouseup=null;const P=O.pageX,k=O.pageY;if(S===P&&T===k)return;let F=s.value.width,C=s.value.height;F%Nc>Nc*.5&&(F=F+(Nc-F%Nc)),C%Ic>Ic*.5&&(C=C+(Ic-C%Ic));let I=Math.round(C/Ic),N=Math.round(F/Nc);I<3&&(I=3),N<2&&(N=2),a.value=[N,I],s.value={width:0,height:0}}};return(A,x)=>(U(),ne("div",FVe,[V("div",EVe,[V("div",XVe,[V("div",WVe,[(U(),ne(Ve,null,rt(7,S=>V("div",{class:"col-header-item",key:S},[V("div",VVe,pt(zVe[S-1]),1)])),64))]),V("div",DVe,[(U(),ne(Ve,null,rt(31,S=>V("div",{class:"row-header-item",key:S},[V("div",UVe,pt(S),1)])),64))]),BVe]),V("div",YVe,[V("div",{class:"temp-range",style:Le({width:s.value.width+"px",height:s.value.height+"px"})},null,4),(U(!0),ne(Ve,null,rt(c.value,S=>(U(),ne("div",{class:$e(["range-line",S.type]),key:S.type,style:Le(S.style)},null,6))),128)),V("div",{class:"resizable",style:Le(f.value),onMousedown:x[0]||(x[0]=Et(S=>R(S),["stop"]))},null,36)]),V("table",null,[V("tbody",null,[(U(),ne(Ve,null,rt(31,S=>V("tr",{key:S},[(U(),ne(Ve,null,rt(7,T=>V("td",{key:T,class:$e({head:T===1&&S<=a.value[1]||S===1&&T<=a.value[0]})},[S===1&&T===1?Ze("",!0):(U(),ne("input",{key:0,class:$e(["item",{selected:S<=a.value[1]&&T<=a.value[0]}]),id:`cell-${S-1}-${T-1}`,autocomplete:"off",onFocus:w=>l.value=[S-1,T-1],onPaste:w=>m(w,S-1,T-1)},null,42,ZVe))],2)),64))])),64))])])]),V("div",QVe,[V("div",HVe,[De(" 图表类型:"+pt(z(F6)[u.value])+" ",1),_(It,{trigger:"click",placement:"top",value:o.value,"onUpdate:value":x[1]||(x[1]=S=>o.value=S)},{content:se(()=>[(U(),ne(Ve,null,rt(i,S=>_(ri,{center:"",key:S,onClick:T=>{u.value=S,o.value=!1}},{default:se(()=>[De(pt(z(F6)[S]),1)]),_:2},1032,["onClick"])),64))]),default:se(()=>[KVe]),_:1},8,["value"])]),V("div",GVe,[_(qe,{class:"btn",onClick:x[2]||(x[2]=S=>y())},{default:se(()=>[De("取消")]),_:1}),_(qe,{class:"btn",onClick:x[3]||(x[3]=S=>g())},{default:se(()=>[De("清空数据")]),_:1}),_(qe,{type:"primary",class:"btn",onClick:x[4]||(x[4]=S=>v())},{default:se(()=>[De("确认")]),_:1})])])]))}}),$Ve=Ue(JVe,[["__scopeId","data-v-31747c29"]]),jVe=e=>(rn("data-v-40b4de83"),e=e(),on(),e),qVe=jVe(()=>V("span",{class:"checkbox-input"},null,-1)),eDe=["checked"],tDe={class:"checkbox-label"},nDe=Ee({__name:"Checkbox",props:{value:{type:Boolean},disabled:{type:Boolean,default:!1}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,i=o=>{n.disabled||r("update:value",o.target.checked)};return(o,a)=>(U(),ne("label",{class:$e(["checkbox",{checked:o.value,disabled:o.disabled}]),onChange:a[0]||(a[0]=s=>i(s))},[qVe,V("input",{class:"checkbox-original",type:"checkbox",checked:o.value},null,8,eDe),V("span",tDe,[kr(o.$slots,"default",{},void 0,!0)])],34))}}),bp=Ue(nDe,[["__scopeId","data-v-40b4de83"]]),Pq=e=>(rn("data-v-c779ea7f"),e=e(),on(),e),rDe={class:"chart-style-panel"},iDe={class:"row"},oDe={class:"row"},aDe=Pq(()=>V("div",{style:{width:"40%"}},"背景填充:",-1)),sDe={class:"row"},lDe=Pq(()=>V("div",{style:{width:"40%"}},"文字颜色:",-1)),uDe={style:{width:"40%"}},cDe={class:"color-btn-wrap",style:{width:"100%"}},fDe=["onClick"],dDe={class:"preset-themes"},hDe=["onClick","onMouseenter"],pDe=Ee({__name:"index",setup(e){const t=dt(),n=lt(),{handleElement:r,handleElementId:i}=We(t),{theme:o}=We(n),a=r,s=ge(!1),l=ge(!1),u=ge([-1,-1]),{addHistorySnapshot:c}=qt(),f=ge("#000"),d=ge([]),h=ge(""),p=ge(!1),v=ge(!1);_t(r,()=>{if(!(!r.value||r.value.type!=="chart")){if(f.value=r.value.fill||"#fff",p.value=!1,v.value=!1,r.value.options){const{lineSmooth:O,stack:P}=r.value.options;O!==void 0&&(p.value=O),P!==void 0&&(v.value=P)}d.value=r.value.themeColors,h.value=r.value.textColor||"#333"}},{deep:!0,immediate:!0});const g=O=>{n.updateElement({id:i.value,props:O}),c()},m=O=>{s.value=!1,g({data:O.data,chartType:O.type})},y=O=>{g({fill:O})},R=O=>{const k={...r.value.options,...O};g({options:k})},A=(O,P)=>{const k={themeColors:d.value.map((F,C)=>C===P?O:F)};g(k)},x=()=>{const O={themeColors:[...d.value,o.value.themeColor]};g(O)},S=(O,P)=>{const k=O.slice(0,P+1);g({themeColors:k}),l.value=!1},T=O=>{const P={themeColors:d.value.filter((k,F)=>F!==O)};g(P)},w=O=>{g({textColor:O})},M=()=>s.value=!0;return Bi.on(Si.OPEN_CHART_DATA_EDITOR,M),Fn(()=>{Bi.off(Si.OPEN_CHART_DATA_EDITOR,M)}),(O,P)=>{const k=Se("IconEdit"),F=Se("IconCloseSmall"),C=Se("IconPlus"),I=Cn("tooltip");return U(),ne("div",rDe,[_(qe,{class:"full-width-btn",onClick:P[0]||(P[0]=N=>s.value=!0)},{default:se(()=>[_(k,{class:"btn-icon"}),De(" 编辑图表 ")]),_:1}),_(Yt),["bar","column","area","line"].includes(z(a).chartType)?(U(),ne(Ve,{key:0},[V("div",iDe,[_(bp,{"onUpdate:value":P[1]||(P[1]=N=>R({stack:N})),value:v.value,style:{flex:"2"}},{default:se(()=>[De("堆叠样式")]),_:1},8,["value"]),z(a).chartType==="line"?(U(),_e(bp,{key:0,"onUpdate:value":P[2]||(P[2]=N=>R({lineSmooth:N})),value:p.value,style:{flex:"3"}},{default:se(()=>[De("使用平滑曲线")]),_:1},8,["value"])):Ze("",!0)]),_(Yt)],64)):Ze("",!0),V("div",oDe,[aDe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:f.value,"onUpdate:modelValue":P[3]||(P[3]=N=>y(N))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:f.value},null,8,["color"])]),_:1})]),V("div",sDe,[lDe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:h.value,"onUpdate:modelValue":P[4]||(P[4]=N=>w(N))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:h.value},null,8,["color"])]),_:1})]),_(Yt),(U(!0),ne(Ve,null,rt(d.value,(N,W)=>(U(),ne("div",{class:"row",key:W},[V("div",uDe,pt(W===0?"主题配色:":""),1),_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:N,"onUpdate:modelValue":D=>A(D,W)},null,8,["modelValue","onUpdate:modelValue"])]),default:se(()=>[V("div",cDe,[_(Zr,{color:N},null,8,["color"]),W!==0?Ge((U(),ne("div",{key:0,class:"delete-color-btn",onClick:Et(D=>T(W),["stop"])},[_(F)],8,fDe)),[[I,"删除"]]):Ze("",!0)])]),_:2},1024)]))),128)),_(Dn,{class:"row",passive:""},{default:se(()=>[_(It,{trigger:"click",open:l.value,"onUpdate:open":P[6]||(P[6]=N=>l.value=N),style:{width:"40%"}},{content:se(()=>[V("div",dDe,[(U(!0),ne(Ve,null,rt(z(I1e),(N,W)=>(U(),ne("div",{class:"preset-theme",key:W},[(U(!0),ne(Ve,null,rt(N,(D,Z)=>(U(),ne("div",{class:$e(["preset-theme-color",{select:u.value[0]===W&&Z<=u.value[1]}]),key:D,style:Le({backgroundColor:D}),onClick:re=>S(N,Z),onMouseenter:re=>u.value=[W,Z],onMouseleave:P[5]||(P[5]=re=>u.value=[-1,-1])},null,46,hDe))),128))]))),128))])]),default:se(()=>[_(qe,{first:"",style:{width:"100%"}},{default:se(()=>[De("推荐主题")]),_:1})]),_:1},8,["open"]),_(qe,{last:"",disabled:d.value.length>=10,style:{width:"60%"},onClick:P[7]||(P[7]=N=>x())},{default:se(()=>[_(C,{class:"btn-icon"}),De(" 添加主题色 ")]),_:1},8,["disabled"])]),_:1}),_(Yt),_(K2),_(Vv,{visible:s.value,"onUpdate:visible":P[10]||(P[10]=N=>s.value=N),width:640},{default:se(()=>[_($Ve,{type:z(a).chartType,data:z(a).data,onClose:P[8]||(P[8]=N=>s.value=!1),onSave:P[9]||(P[9]=N=>m(N))},null,8,["type","data"])]),_:1},8,["visible"])])}}}),vDe=Ue(pDe,[["__scopeId","data-v-c779ea7f"]]),O3=e=>(rn("data-v-3bf19801"),e=e(),on(),e),gDe={class:"table-style-panel"},mDe={class:"row"},yDe=O3(()=>V("div",{style:{width:"40%"}},"行数:",-1)),ADe={class:"set-count",style:{width:"60%"}},RDe={class:"count-text"},bDe={class:"row"},xDe=O3(()=>V("div",{style:{width:"40%"}},"列数:",-1)),SDe={class:"set-count",style:{width:"60%"}},wDe={class:"count-text"},MDe={class:"row theme-switch"},LDe=O3(()=>V("div",{style:{width:"40%"}},"启用主题表格:",-1)),TDe={class:"switch-wrapper",style:{width:"60%"}},_De={class:"row"},ODe={class:"row"},kDe={class:"row"},PDe=O3(()=>V("div",{style:{width:"40%"}},"主题颜色:",-1)),CDe=Ee({__name:"TableStylePanel",setup(e){const t=lt(),{handleElement:n,handleElementId:r,selectedTableCells:i,availableFonts:o}=We(dt()),a=we(()=>t.theme.themeColor),s=["12px","14px","16px","18px","20px","22px","24px","28px","32px"],l=ge({bold:!1,em:!1,underline:!1,strikethrough:!1,color:"#000",backcolor:"",fontsize:"12px",fontname:"微软雅黑",align:"left"}),u=ge(),c=ge(!1),f=ge(0),d=ge(0),h=ge(0),p=ge(0);_t(n,()=>{!n.value||n.value.type!=="table"||(u.value=n.value.theme,c.value=!!u.value,f.value=n.value.data.length,d.value=n.value.data[0].length,h.value=n.value.data.length,p.value=n.value.data[0].length)},{deep:!0,immediate:!0});const{addHistorySnapshot:v}=qt(),g=()=>{if(!n.value||n.value.type!=="table")return;let T=0,w=0;if(i.value.length){const O=i.value[0];T=+O.split("_")[0],w=+O.split("_")[1]}const M=n.value.data[T][w].style;M?l.value={bold:!!M.bold,em:!!M.em,underline:!!M.underline,strikethrough:!!M.strikethrough,color:M.color||"#000",backcolor:M.backcolor||"",fontsize:M.fontsize||"12px",fontname:M.fontname||"微软雅黑",align:M.align||"left"}:l.value={bold:!1,em:!1,underline:!1,strikethrough:!1,color:"#000",backcolor:"",fontsize:"12px",fontname:"微软雅黑",align:"left"}};jt(()=>{i.value.length&&g()}),_t(i,g);const m=T=>{t.updateElement({id:r.value,props:T}),v()},y=T=>{const w=n.value,M=JSON.parse(JSON.stringify(w.data));for(let O=0;O{if(!u.value)return;const w={...u.value,...T};m({theme:w})},A=T=>{if(T){const w={theme:{color:a.value,rowHeader:!0,rowFooter:!1,colHeader:!1,colFooter:!1}};m(w)}else t.removeElementProps({id:r.value,propName:"theme"}),v()},x=T=>{const w=n.value,M=w.data.length;if(T>M){const O=new Array(d.value).fill({id:yn(10),colspan:1,rowspan:1,text:""}),P=new Array(T-M).fill(O),k=JSON.parse(JSON.stringify(w.data));k.push(...P),m({data:k})}else{const O=w.data.slice(0,T);m({data:O})}},S=T=>{const w=n.value,M=w.data[0].length;let O=w.data,P=w.colWidths.map(I=>I*w.width);if(T>M){O=O.map(N=>{const W=new Array(T-M).fill({id:yn(10),colspan:1,rowspan:1,text:""});return N.push(...W),N});const I=new Array(T-M).fill(100);P.push(...I)}else O=O.map(I=>I.slice(0,T)),P=P.slice(0,T);const k=P.reduce((I,N)=>I+N),F=P.map(I=>I/k);m({width:k,data:O,colWidths:F})};return(T,w)=>{const M=Se("IconFontSize"),O=Se("IconAddText"),P=Se("IconText"),k=Se("IconFill"),F=Se("IconTextBold"),C=Se("IconTextItalic"),I=Se("IconTextUnderline"),N=Se("IconStrikethrough"),W=Se("IconAlignTextLeft"),D=Se("IconAlignTextCenter"),Z=Se("IconAlignTextRight"),re=Se("IconAlignTextBoth"),B=Se("IconMinus"),Y=Se("IconPlus"),K=Cn("tooltip");return U(),ne("div",gDe,[_(rP,{class:"row"},{default:se(()=>[_(Ar,{style:{width:"50%"},value:l.value.fontname,search:"",searchLabel:"搜索字体","onUpdate:value":w[0]||(w[0]=G=>y({fontname:G})),options:[...z(o),...z(p2)]},{icon:se(()=>[_(M)]),_:1},8,["value","options"]),_(Ar,{style:{width:"50%"},value:l.value.fontsize,search:"",searchLabel:"搜索字号","onUpdate:value":w[1]||(w[1]=G=>y({fontsize:G})),options:s.map(G=>({label:G,value:G}))},{icon:se(()=>[_(O)]),_:1},8,["value","options"])]),_:1}),_(Dn,{class:"row",passive:""},{default:se(()=>[_(It,{trigger:"click",style:{width:"50%"}},{content:se(()=>[_($n,{modelValue:l.value.color,"onUpdate:modelValue":w[2]||(w[2]=G=>y({color:G}))},null,8,["modelValue"])]),default:se(()=>[Ge((U(),_e(yv,{first:"",color:l.value.color},{default:se(()=>[_(P)]),_:1},8,["color"])),[[K,"文字颜色"]])]),_:1}),_(It,{trigger:"click",style:{width:"50%"}},{content:se(()=>[_($n,{modelValue:l.value.backcolor,"onUpdate:modelValue":w[3]||(w[3]=G=>y({backcolor:G}))},null,8,["modelValue"])]),default:se(()=>[Ge((U(),_e(yv,{last:"",color:l.value.backcolor},{default:se(()=>[_(k)]),_:1},8,["color"])),[[K,"单元格填充"]])]),_:1})]),_:1}),_(Dn,{class:"row"},{default:se(()=>[Ge((U(),_e(Ur,{style:{flex:"1"},checked:l.value.bold,onClick:w[4]||(w[4]=G=>y({bold:!l.value.bold}))},{default:se(()=>[_(F)]),_:1},8,["checked"])),[[K,"加粗"]]),Ge((U(),_e(Ur,{style:{flex:"1"},checked:l.value.em,onClick:w[5]||(w[5]=G=>y({em:!l.value.em}))},{default:se(()=>[_(C)]),_:1},8,["checked"])),[[K,"斜体"]]),Ge((U(),_e(Ur,{style:{flex:"1"},checked:l.value.underline,onClick:w[6]||(w[6]=G=>y({underline:!l.value.underline}))},{default:se(()=>[_(I)]),_:1},8,["checked"])),[[K,"下划线"]]),Ge((U(),_e(Ur,{style:{flex:"1"},checked:l.value.strikethrough,onClick:w[7]||(w[7]=G=>y({strikethrough:!l.value.strikethrough}))},{default:se(()=>[_(N)]),_:1},8,["checked"])),[[K,"删除线"]])]),_:1}),_(lu,{class:"row","button-style":"solid",value:l.value.align,"onUpdate:value":w[8]||(w[8]=G=>y({align:G}))},{default:se(()=>[Ge((U(),_e(Kn,{value:"left",style:{flex:"1"}},{default:se(()=>[_(W)]),_:1})),[[K,"左对齐"]]),Ge((U(),_e(Kn,{value:"center",style:{flex:"1"}},{default:se(()=>[_(D)]),_:1})),[[K,"居中"]]),Ge((U(),_e(Kn,{value:"right",style:{flex:"1"}},{default:se(()=>[_(Z)]),_:1})),[[K,"右对齐"]]),Ge((U(),_e(Kn,{value:"justify",style:{flex:"1"}},{default:se(()=>[_(re)]),_:1})),[[K,"两端对齐"]])]),_:1},8,["value"]),_(Yt),_(K2,{fixed:!0}),_(Yt),V("div",mDe,[yDe,V("div",ADe,[_(qe,{class:"btn",disabled:f.value<=1,onClick:w[9]||(w[9]=G=>x(f.value-1))},{default:se(()=>[_(B)]),_:1},8,["disabled"]),V("div",RDe,pt(f.value),1),_(qe,{class:"btn",disabled:f.value>=30,onClick:w[10]||(w[10]=G=>x(f.value+1))},{default:se(()=>[_(Y)]),_:1},8,["disabled"])])]),V("div",bDe,[xDe,V("div",SDe,[_(qe,{class:"btn",disabled:d.value<=1,onClick:w[11]||(w[11]=G=>S(d.value-1))},{default:se(()=>[_(B)]),_:1},8,["disabled"]),V("div",wDe,pt(d.value),1),_(qe,{class:"btn",disabled:d.value>=30,onClick:w[12]||(w[12]=G=>S(d.value+1))},{default:se(()=>[_(Y)]),_:1},8,["disabled"])])]),_(Yt),V("div",MDe,[LDe,V("div",TDe,[_(ws,{value:c.value,"onUpdate:value":w[13]||(w[13]=G=>A(G))},null,8,["value"])])]),u.value?(U(),ne(Ve,{key:0},[V("div",_De,[_(bp,{"onUpdate:value":w[14]||(w[14]=G=>R({rowHeader:G})),value:u.value.rowHeader,style:{flex:"1"}},{default:se(()=>[De("标题行")]),_:1},8,["value"]),_(bp,{"onUpdate:value":w[15]||(w[15]=G=>R({rowFooter:G})),value:u.value.rowFooter,style:{flex:"1"}},{default:se(()=>[De("汇总行")]),_:1},8,["value"])]),V("div",ODe,[_(bp,{"onUpdate:value":w[16]||(w[16]=G=>R({colHeader:G})),value:u.value.colHeader,style:{flex:"1"}},{default:se(()=>[De("第一列")]),_:1},8,["value"]),_(bp,{"onUpdate:value":w[17]||(w[17]=G=>R({colFooter:G})),value:u.value.colFooter,style:{flex:"1"}},{default:se(()=>[De("最后一列")]),_:1},8,["value"])]),V("div",kDe,[PDe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:u.value.color,"onUpdate:modelValue":w[18]||(w[18]=G=>R({color:G}))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:u.value.color},null,8,["color"])]),_:1})])],64)):Ze("",!0)])}}}),NDe=Ue(CDe,[["__scopeId","data-v-3bf19801"]]),Cq=e=>(rn("data-v-e173eae4"),e=e(),on(),e),IDe={class:"latex-style-panel"},FDe={class:"row"},EDe={class:"row"},XDe=Cq(()=>V("div",{style:{width:"40%"}},"颜色:",-1)),WDe={class:"row"},VDe=Cq(()=>V("div",{style:{width:"40%"}},"粗细:",-1)),DDe=Ee({__name:"LatexStylePanel",setup(e){const t=lt(),{handleElement:n}=We(dt()),r=n,i=ge(!1),{addHistorySnapshot:o}=qt(),a=u=>{n.value&&(t.updateElement({id:n.value.id,props:u}),o())},s=u=>{a({path:u.path,latex:u.latex,width:u.w,height:u.h,viewBox:[u.w,u.h]})},l=()=>i.value=!0;return Bi.on(Si.OPEN_LATEX_EDITOR,l),Fn(()=>{Bi.off(Si.OPEN_LATEX_EDITOR,l)}),(u,c)=>(U(),ne("div",IDe,[V("div",FDe,[_(qe,{style:{flex:"1"},onClick:c[0]||(c[0]=f=>i.value=!0)},{default:se(()=>[De("编辑 LaTeX")]),_:1})]),_(Yt),V("div",EDe,[XDe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:z(r).color,"onUpdate:modelValue":c[1]||(c[1]=f=>a({color:f}))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:z(r).color},null,8,["color"])]),_:1})]),V("div",WDe,[VDe,_(Ko,{min:1,max:3,value:z(r).strokeWidth,"onUpdate:value":c[2]||(c[2]=f=>a({strokeWidth:f})),style:{width:"60%"}},null,8,["value"])]),_(Vv,{visible:i.value,"onUpdate:visible":c[5]||(c[5]=f=>i.value=f),width:880},{default:se(()=>[_(rq,{value:z(r).latex,onClose:c[3]||(c[3]=f=>i.value=!1),onUpdate:c[4]||(c[4]=f=>{s(f),i.value=!1})},null,8,["value"])]),_:1},8,["visible"])]))}}),UDe=Ue(DDe,[["__scopeId","data-v-e173eae4"]]),Nq=e=>(rn("data-v-b289959e"),e=e(),on(),e),BDe={class:"video-style-panel"},YDe=Nq(()=>V("div",{class:"title"},"视频预览封面",-1)),ZDe={class:"background-image-wrapper"},QDe={class:"background-image"},HDe={class:"row"},KDe={class:"row switch-row"},GDe=Nq(()=>V("div",{style:{width:"40%"}},"自动播放:",-1)),zDe={class:"switch-wrapper",style:{width:"60%"}},JDe=Ee({__name:"VideoStylePanel",setup(e){const t=lt(),{handleElement:n}=We(dt()),r=n,{addHistorySnapshot:i}=qt(),o=s=>{n.value&&(t.updateElement({id:n.value.id,props:s}),i())},a=s=>{const l=s[0];l&&zf(l).then(u=>o({poster:u}))};return(s,l)=>{const u=Se("IconPlus");return U(),ne("div",BDe,[YDe,V("div",ZDe,[_(Xh,{onChange:l[0]||(l[0]=c=>a(c))},{default:se(()=>[V("div",QDe,[V("div",{class:"content",style:Le({backgroundImage:z(r).poster?`url(${z(r).poster})`:""})},[_(u)],4)])]),_:1})]),V("div",HDe,[_(qe,{style:{flex:"1"},onClick:l[1]||(l[1]=c=>o({poster:""}))},{default:se(()=>[De("重置封面")]),_:1})]),V("div",KDe,[GDe,V("div",zDe,[_(ws,{value:z(r).autoplay,"onUpdate:value":l[2]||(l[2]=c=>o({autoplay:c}))},null,8,["value"])])])])}}}),$De=Ue(JDe,[["__scopeId","data-v-b289959e"]]),iP=e=>(rn("data-v-685cdba7"),e=e(),on(),e),jDe={class:"audio-style-panel"},qDe={class:"row"},eUe=iP(()=>V("div",{style:{width:"40%"}},"图标颜色:",-1)),tUe={class:"row switch-row"},nUe=iP(()=>V("div",{style:{width:"40%"}},"自动播放:",-1)),rUe={class:"switch-wrapper",style:{width:"60%"}},iUe={class:"row switch-row"},oUe=iP(()=>V("div",{style:{width:"40%"}},"循环播放:",-1)),aUe={class:"switch-wrapper",style:{width:"60%"}},sUe=Ee({__name:"AudioStylePanel",setup(e){const t=lt(),{handleElement:n}=We(dt()),r=n,{addHistorySnapshot:i}=qt(),o=a=>{n.value&&(t.updateElement({id:n.value.id,props:a}),i())};return(a,s)=>(U(),ne("div",jDe,[V("div",qDe,[eUe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:z(r).color,"onUpdate:modelValue":s[0]||(s[0]=l=>o({color:l}))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:z(r).color},null,8,["color"])]),_:1})]),V("div",tUe,[nUe,V("div",rUe,[_(ws,{value:z(r).autoplay,"onUpdate:value":s[1]||(s[1]=l=>o({autoplay:l}))},null,8,["value"])])]),V("div",iUe,[oUe,V("div",aUe,[_(ws,{value:z(r).loop,"onUpdate:value":s[2]||(s[2]=l=>o({loop:l}))},null,8,["value"])])])]))}}),lUe=Ue(sUe,[["__scopeId","data-v-685cdba7"]]),k3=e=>(rn("data-v-6dd86a49"),e=e(),on(),e),uUe={class:"multi-style-panel"},cUe={class:"row"},fUe=k3(()=>V("div",{style:{width:"40%"}},"填充颜色:",-1)),dUe={class:"row"},hUe=k3(()=>V("div",{style:{width:"40%"}},"边框样式:",-1)),pUe={class:"row"},vUe=k3(()=>V("div",{style:{width:"40%"}},"边框颜色:",-1)),gUe={class:"row"},mUe=k3(()=>V("div",{style:{width:"40%"}},"边框粗细:",-1)),yUe=Ee({__name:"MultiStylePanel",setup(e){const t=lt(),{richTextAttrs:n,availableFonts:r,activeElementList:i}=We(dt()),{addHistorySnapshot:o}=qt(),a=(h,p)=>{t.updateElement({id:h,props:p}),o()},s=["12px","14px","16px","18px","20px","22px","24px","28px","32px","36px","40px","44px","48px","54px","60px","66px","72px","76px","80px","88px","96px","104px","112px","120px"],l=ge("#fff"),u=ge({width:0,color:"#fff",style:"solid"}),c=h=>{for(const p of i.value){if((p.type==="text"||p.type==="shape"||p.type==="chart")&&a(p.id,{fill:h}),p.type==="table"){const v=JSON.parse(JSON.stringify(p.data));for(let g=0;g{for(const p of i.value){if(p.type==="text"||p.type==="image"||p.type==="shape"||p.type==="table"||p.type==="chart"){const g={outline:{...p.outline||{width:2,color:"#000",style:"solid"},...h}};a(p.id,g)}p.type==="line"&&a(p.id,h)}u.value={...u.value,...h}},d=(h,p)=>{var v;for(const g of i.value){if((g.type==="text"||g.type==="shape"&&((v=g.text)!=null&&v.content))&&Bi.emit(Si.RICH_TEXT_COMMAND,{target:g.id,action:{command:h,value:p}}),g.type==="table"){const m=JSON.parse(JSON.stringify(g.data));for(let y=0;y{const v=Se("IconFontSize"),g=Se("IconAddText"),m=Se("IconText"),y=Se("IconHighLight"),R=Se("IconAlignTextLeft"),A=Se("IconAlignTextCenter"),x=Se("IconAlignTextRight"),S=Se("IconAlignTextBoth"),T=Cn("tooltip");return U(),ne("div",uUe,[V("div",cUe,[fUe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:l.value,"onUpdate:modelValue":p[0]||(p[0]=w=>c(w))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:l.value},null,8,["color"])]),_:1})]),_(Yt),V("div",dUe,[hUe,_(Ar,{style:{width:"60%"},value:u.value.style||"","onUpdate:value":p[1]||(p[1]=w=>f({style:w})),options:[{label:"实线边框",value:"solid"},{label:"虚线边框",value:"dashed"},{label:"点线边框",value:"dotted"}]},null,8,["value"])]),V("div",pUe,[vUe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:u.value.color,"onUpdate:modelValue":p[2]||(p[2]=w=>f({color:w}))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:u.value.color||"#000"},null,8,["color"])]),_:1})]),V("div",gUe,[mUe,_(Ko,{value:u.value.width||0,"onUpdate:value":p[3]||(p[3]=w=>f({width:w})),style:{width:"60%"}},null,8,["value"])]),_(Yt),_(rP,{class:"row"},{default:se(()=>[_(Ar,{style:{width:"60%"},value:z(n).fontname,search:"",searchLabel:"搜索字体","onUpdate:value":p[4]||(p[4]=w=>d("fontname",w)),options:[...z(r),...z(p2)]},{icon:se(()=>[_(v)]),_:1},8,["value","options"]),_(Ar,{style:{width:"40%"},value:z(n).fontsize,search:"",searchLabel:"搜索字号","onUpdate:value":p[5]||(p[5]=w=>d("fontsize",w)),options:s.map(w=>({label:w,value:w}))},{icon:se(()=>[_(g)]),_:1},8,["value","options"])]),_:1}),_(Dn,{class:"row",passive:""},{default:se(()=>[_(It,{trigger:"click",style:{width:"30%"}},{content:se(()=>[_($n,{modelValue:z(n).color,"onUpdate:modelValue":p[6]||(p[6]=w=>d("color",w))},null,8,["modelValue"])]),default:se(()=>[Ge((U(),_e(yv,{first:"",color:z(n).color},{default:se(()=>[_(m)]),_:1},8,["color"])),[[T,"文字颜色"]])]),_:1}),_(It,{trigger:"click",style:{width:"30%"}},{content:se(()=>[_($n,{modelValue:z(n).backcolor,"onUpdate:modelValue":p[7]||(p[7]=w=>d("backcolor",w))},null,8,["modelValue"])]),default:se(()=>[Ge((U(),_e(yv,{color:z(n).backcolor},{default:se(()=>[_(y)]),_:1},8,["color"])),[[T,"文字高亮"]])]),_:1}),Ge((U(),_e(qe,{class:"font-size-btn",style:{width:"20%"},onClick:p[8]||(p[8]=w=>d("fontsize-add","2"))},{default:se(()=>[_(v),De("+")]),_:1})),[[T,"增大字号"]]),Ge((U(),_e(qe,{last:"",class:"font-size-btn",style:{width:"20%"},onClick:p[9]||(p[9]=w=>d("fontsize-reduce","2"))},{default:se(()=>[_(v),De("-")]),_:1})),[[T,"减小字号"]])]),_:1}),_(lu,{class:"row","button-style":"solid",value:z(n).align,"onUpdate:value":p[10]||(p[10]=w=>d("align",w))},{default:se(()=>[Ge((U(),_e(Kn,{value:"left",style:{flex:"1"}},{default:se(()=>[_(R)]),_:1})),[[T,"左对齐"]]),Ge((U(),_e(Kn,{value:"center",style:{flex:"1"}},{default:se(()=>[_(A)]),_:1})),[[T,"居中"]]),Ge((U(),_e(Kn,{value:"right",style:{flex:"1"}},{default:se(()=>[_(x)]),_:1})),[[T,"右对齐"]]),Ge((U(),_e(Kn,{value:"justify",style:{flex:"1"}},{default:se(()=>[_(S)]),_:1})),[[T,"两端对齐"]])]),_:1},8,["value"])])}}}),AUe=Ue(yUe,[["__scopeId","data-v-6dd86a49"]]),RUe={class:"element-style-panel"},bUe=Ee({__name:"index",setup(e){const t={[Nt.TEXT]:xWe,[Nt.IMAGE]:tVe,[Nt.SHAPE]:RVe,[Nt.LINE]:IVe,[Nt.CHART]:vDe,[Nt.TABLE]:NDe,[Nt.LATEX]:UDe,[Nt.VIDEO]:$De,[Nt.AUDIO]:lUe},{activeElementIdList:n,activeElementList:r,handleElement:i,activeGroupElementId:o}=We(dt()),a=we(()=>{if(n.value.length>1){if(!o.value)return AUe;const s=r.value.find(l=>l.id===o.value);return s&&t[s.type]||null}return i.value&&t[i.value.type]||null});return(s,l)=>(U(),ne("div",RUe,[(U(),_e(uu(a.value)))]))}}),P3=e=>(rn("data-v-eba29c8f"),e=e(),on(),e),xUe={class:"element-positopn-panel"},SUe=P3(()=>V("div",{class:"title"},"层级:",-1)),wUe=P3(()=>V("div",{class:"title"},"对齐:",-1)),MUe={class:"row"},LUe=P3(()=>V("div",{style:{width:"10%"}},null,-1)),TUe={key:0,class:"row"},_Ue={key:1,style:{width:"10%"}},OUe={class:"row"},kUe=P3(()=>V("div",{style:{width:"7%"}},null,-1)),PUe=Ee({__name:"ElementPositionPanel",setup(e){const t=lt(),{handleElement:n,handleElementId:r}=We(dt()),i=ge(0),o=ge(0),a=ge(0),s=ge(0),l=ge(0),u=ge(!1),c=we(()=>n.value&&LK[n.value.type]||20),f=we(()=>{var w;return((w=n.value)==null?void 0:w.type)==="text"&&!n.value.vertical}),d=we(()=>{var w;return((w=n.value)==null?void 0:w.type)==="text"&&n.value.vertical});_t(n,()=>{n.value&&(i.value=Un.round(n.value.left,1),o.value=Un.round(n.value.top,1),u.value="fixedRatio"in n.value&&!!n.value.fixedRatio,n.value.type!=="line"&&(a.value=Un.round(n.value.width,1),s.value=Un.round(n.value.height,1),l.value="rotate"in n.value&&n.value.rotate!==void 0?Un.round(n.value.rotate,1):0))},{deep:!0,immediate:!0});const{orderElement:h}=x2(),{alignElementToCanvas:p}=E4(),{addHistorySnapshot:v}=qt(),g=w=>{const M={left:w};t.updateElement({id:r.value,props:M}),v()},m=w=>{const M={top:w};t.updateElement({id:r.value,props:M}),v()},y=(w,M)=>{if(n.value&&n.value.type==="shape"&&"pathFormula"in n.value&&n.value.pathFormula){const O=Gh[n.value.pathFormula];let P="";return"editable"in O&&O.editable?P=O.formula(w,M,n.value.keypoints):P=O.formula(w,M),{viewBox:[w,M],path:P}}return null},R=w=>{if(!n.value||n.value.type==="line"||d.value)return;let M=s.value;if(u.value){const k=a.value/s.value;M=w/k{if(!n.value||n.value.type==="line"||n.value.type==="table"||f.value)return;let M=a.value;if(u.value){const k=a.value/s.value;M=w*k{const M={rotate:w};t.updateElement({id:r.value,props:M}),v()},S=w=>{const M={fixedRatio:w};t.updateElement({id:r.value,props:M}),v()},T=w=>{let M=Math.floor(l.value/45)*45;w==="+"?M=M+45:w==="-"&&(M=M-45),M<-180&&(M=-180),M>180&&(M=180);const O={rotate:M};t.updateElement({id:r.value,props:O}),v()};return(w,M)=>{const O=Se("IconSendToBack"),P=Se("IconBringToFrontOne"),k=Se("IconBringToFront"),F=Se("IconSentToBack"),C=Se("IconAlignLeft"),I=Se("IconAlignVertically"),N=Se("IconAlignRight"),W=Se("IconAlignTop"),D=Se("IconAlignHorizontally"),Z=Se("IconAlignBottom"),re=Se("IconLock"),B=Se("IconUnlock"),Y=Se("IconRotate"),K=Cn("tooltip");return U(),ne("div",xUe,[SUe,_(Dn,{class:"row"},{default:se(()=>[_(qe,{style:{flex:"1"},onClick:M[0]||(M[0]=G=>z(h)(z(n),z(Fr).TOP))},{default:se(()=>[_(O,{class:"btn-icon"}),De(" 置顶")]),_:1}),_(qe,{style:{flex:"1"},onClick:M[1]||(M[1]=G=>z(h)(z(n),z(Fr).BOTTOM))},{default:se(()=>[_(P,{class:"btn-icon"}),De(" 置底")]),_:1})]),_:1}),_(Dn,{class:"row"},{default:se(()=>[_(qe,{style:{flex:"1"},onClick:M[2]||(M[2]=G=>z(h)(z(n),z(Fr).UP))},{default:se(()=>[_(k,{class:"btn-icon"}),De(" 上移")]),_:1}),_(qe,{style:{flex:"1"},onClick:M[3]||(M[3]=G=>z(h)(z(n),z(Fr).DOWN))},{default:se(()=>[_(F,{class:"btn-icon"}),De(" 下移")]),_:1})]),_:1}),_(Yt),wUe,_(Dn,{class:"row"},{default:se(()=>[Ge((U(),_e(qe,{style:{flex:"1"},onClick:M[4]||(M[4]=G=>z(p)(z(dn).LEFT))},{default:se(()=>[_(C)]),_:1})),[[K,"左对齐"]]),Ge((U(),_e(qe,{style:{flex:"1"},onClick:M[5]||(M[5]=G=>z(p)(z(dn).HORIZONTAL))},{default:se(()=>[_(I)]),_:1})),[[K,"水平居中"]]),Ge((U(),_e(qe,{style:{flex:"1"},onClick:M[6]||(M[6]=G=>z(p)(z(dn).RIGHT))},{default:se(()=>[_(N)]),_:1})),[[K,"右对齐"]])]),_:1}),_(Dn,{class:"row"},{default:se(()=>[Ge((U(),_e(qe,{style:{flex:"1"},onClick:M[7]||(M[7]=G=>z(p)(z(dn).TOP))},{default:se(()=>[_(W)]),_:1})),[[K,"上对齐"]]),Ge((U(),_e(qe,{style:{flex:"1"},onClick:M[8]||(M[8]=G=>z(p)(z(dn).VERTICAL))},{default:se(()=>[_(D)]),_:1})),[[K,"垂直居中"]]),Ge((U(),_e(qe,{style:{flex:"1"},onClick:M[9]||(M[9]=G=>z(p)(z(dn).BOTTOM))},{default:se(()=>[_(Z)]),_:1})),[[K,"下对齐"]])]),_:1}),_(Yt),V("div",MUe,[_(Ko,{step:5,value:i.value,"onUpdate:value":M[10]||(M[10]=G=>g(G)),style:{width:"45%"}},{prefix:se(()=>[De(" 水平: ")]),_:1},8,["value"]),LUe,_(Ko,{step:5,value:o.value,"onUpdate:value":M[11]||(M[11]=G=>m(G)),style:{width:"45%"}},{prefix:se(()=>[De(" 垂直: ")]),_:1},8,["value"])]),z(n).type!=="line"?(U(),ne("div",TUe,[_(Ko,{min:c.value,max:1500,step:5,disabled:d.value,value:a.value,"onUpdate:value":M[12]||(M[12]=G=>R(G)),style:{width:"45%"}},{prefix:se(()=>[De(" 宽度: ")]),_:1},8,["min","disabled","value"]),["image","shape","audio"].includes(z(n).type)?(U(),ne(Ve,{key:0},[u.value?Ge((U(),_e(re,{key:0,style:{width:"10%"},class:"icon-btn active",onClick:M[13]||(M[13]=G=>S(!1))},null,512)),[[K,"解除宽高比锁定"]]):Ge((U(),_e(B,{key:1,style:{width:"10%"},class:"icon-btn",onClick:M[14]||(M[14]=G=>S(!0))},null,512)),[[K,"宽高比锁定"]])],64)):(U(),ne("div",_Ue)),_(Ko,{min:c.value,max:800,step:5,disabled:f.value||z(n).type==="table",value:s.value,"onUpdate:value":M[15]||(M[15]=G=>A(G)),style:{width:"45%"}},{prefix:se(()=>[De(" 高度: ")]),_:1},8,["min","disabled","value"])])):Ze("",!0),["line","video","audio"].includes(z(n).type)?Ze("",!0):(U(),ne(Ve,{key:1},[_(Yt),V("div",OUe,[_(Ko,{min:-180,max:180,step:5,value:l.value,"onUpdate:value":M[16]||(M[16]=G=>x(G)),style:{width:"45%"}},{prefix:se(()=>[De(" 旋转: ")]),_:1},8,["value"]),kUe,V("div",{class:"text-btn",onClick:M[17]||(M[17]=G=>T("-")),style:{width:"24%"}},[_(Y),De(" -45°")]),V("div",{class:"text-btn",onClick:M[18]||(M[18]=G=>T("+")),style:{width:"24%"}},[_(Y,{style:{transform:"rotateY(180deg)"}}),De(" +45°")])])],64))])}}}),CUe=Ue(PUe,[["__scopeId","data-v-eba29c8f"]]),T8=1e3,NUe="click",wa="animate__",tU=[{type:"bounce",name:"弹跳",children:[{name:"弹入",value:"bounceIn"},{name:"向右弹入",value:"bounceInLeft"},{name:"向左弹入",value:"bounceInRight"},{name:"向上弹入",value:"bounceInUp"},{name:"向下弹入",value:"bounceInDown"}]},{type:"fade",name:"浮现",children:[{name:"浮入",value:"fadeIn"},{name:"向下浮入",value:"fadeInDown"},{name:"向下长距浮入",value:"fadeInDownBig"},{name:"向右浮入",value:"fadeInLeft"},{name:"向右长距浮入",value:"fadeInLeftBig"},{name:"向左浮入",value:"fadeInRight"},{name:"向左长距浮入",value:"fadeInRightBig"},{name:"向上浮入",value:"fadeInUp"},{name:"向上长距浮入",value:"fadeInUpBig"},{name:"从左上浮入",value:"fadeInTopLeft"},{name:"从右上浮入",value:"fadeInTopRight"},{name:"从左下浮入",value:"fadeInBottomLeft"},{name:"从右下浮入",value:"fadeInBottomRight"}]},{type:"rotate",name:"旋转",children:[{name:"旋转进入",value:"rotateIn"},{name:"绕左下进入",value:"rotateInDownLeft"},{name:"绕右下进入",value:"rotateInDownRight"},{name:"绕左上进入",value:"rotateInUpLeft"},{name:"绕右上进入",value:"rotateInUpRight"}]},{type:"zoom",name:"缩放",children:[{name:"放大进入",value:"zoomIn"},{name:"向下放大进入",value:"zoomInDown"},{name:"从左放大进入",value:"zoomInLeft"},{name:"从右放大进入",value:"zoomInRight"},{name:"向上放大进入",value:"zoomInUp"}]},{type:"slide",name:"滑入",children:[{name:"向下滑入",value:"slideInDown"},{name:"从右滑入",value:"slideInLeft"},{name:"从左滑入",value:"slideInRight"},{name:"向上滑入",value:"slideInUp"}]},{type:"flip",name:"翻转",children:[{name:"X轴翻转进入",value:"flipInX"},{name:"Y轴翻转进入",value:"flipInY"}]},{type:"back",name:"放大滑入",children:[{name:"向下放大滑入",value:"backInDown"},{name:"从左放大滑入",value:"backInLeft"},{name:"从右放大滑入",value:"backInRight"},{name:"向上放大滑入",value:"backInUp"}]},{type:"lightSpeed",name:"飞入",children:[{name:"从右飞入",value:"lightSpeedInRight"},{name:"从左飞入",value:"lightSpeedInLeft"}]}],nU=[{type:"bounce",name:"弹跳",children:[{name:"弹出",value:"bounceOut"},{name:"向左弹出",value:"bounceOutLeft"},{name:"向右弹出",value:"bounceOutRight"},{name:"向上弹出",value:"bounceOutUp"},{name:"向下弹出",value:"bounceOutDown"}]},{type:"fade",name:"浮现",children:[{name:"浮出",value:"fadeOut"},{name:"向下浮出",value:"fadeOutDown"},{name:"向下长距浮出",value:"fadeOutDownBig"},{name:"向左浮出",value:"fadeOutLeft"},{name:"向左长距浮出",value:"fadeOutLeftBig"},{name:"向右浮出",value:"fadeOutRight"},{name:"向右长距浮出",value:"fadeOutRightBig"},{name:"向上浮出",value:"fadeOutUp"},{name:"向上长距浮出",value:"fadeOutUpBig"},{name:"从左上浮出",value:"fadeOutTopLeft"},{name:"从右上浮出",value:"fadeOutTopRight"},{name:"从左下浮出",value:"fadeOutBottomLeft"},{name:"从右下浮出",value:"fadeOutBottomRight"}]},{type:"rotate",name:"旋转",children:[{name:"旋转退出",value:"rotateOut"},{name:"绕左下退出",value:"rotateOutDownLeft"},{name:"绕右下退出",value:"rotateOutDownRight"},{name:"绕左上退出",value:"rotateOutUpLeft"},{name:"绕右上退出",value:"rotateOutUpRight"}]},{type:"zoom",name:"缩放",children:[{name:"缩小退出",value:"zoomOut"},{name:"向下缩小退出",value:"zoomOutDown"},{name:"从左缩小退出",value:"zoomOutLeft"},{name:"从右缩小退出",value:"zoomOutRight"},{name:"向上缩小退出",value:"zoomOutUp"}]},{type:"slide",name:"滑出",children:[{name:"向下滑出",value:"slideOutDown"},{name:"从左滑出",value:"slideOutLeft"},{name:"从右滑出",value:"slideOutRight"},{name:"向上滑出",value:"slideOutUp"}]},{type:"flip",name:"翻转",children:[{name:"X轴翻转退出",value:"flipOutX"},{name:"Y轴翻转退出",value:"flipOutY"}]},{type:"back",name:"缩小滑出",children:[{name:"向下缩小滑出",value:"backOutDown"},{name:"从左缩小滑出",value:"backOutLeft"},{name:"从右缩小滑出",value:"backOutRight"},{name:"向上缩小滑出",value:"backOutUp"}]},{type:"lightSpeed",name:"飞出",children:[{name:"从右飞出",value:"lightSpeedOutRight"},{name:"从左飞出",value:"lightSpeedOutLeft"}]}],rU=[{type:"shake",name:"晃动",children:[{name:"左右摇晃",value:"shakeX"},{name:"上下摇晃",value:"shakeY"},{name:"摇头",value:"headShake"},{name:"摆动",value:"swing"},{name:"晃动",value:"wobble"},{name:"惊恐",value:"tada"},{name:"果冻",value:"jello"}]},{type:"other",name:"其他",children:[{name:"弹跳",value:"bounce"},{name:"闪烁",value:"flash"},{name:"脉搏",value:"pulse"},{name:"橡皮筋",value:"rubberBand"},{name:"心跳(快)",value:"heartBeat"}]}],Iq=[{label:"无",value:"no"},{label:"随机",value:"random"},{label:"左右推移",value:"slideX"},{label:"上下推移",value:"slideY"},{label:"左右推移(3D)",value:"slideX3D"},{label:"上下推移(3D)",value:"slideY3D"},{label:"淡入淡出",value:"fade"},{label:"旋转",value:"rotate"},{label:"上下展开",value:"scaleY"},{label:"左右展开",value:"scaleX"},{label:"放大",value:"scale"},{label:"缩小",value:"scaleReverse"}],Fq=e=>(rn("data-v-d71f68dd"),e=e(),on(),e),IUe={class:"element-animation-panel"},FUe={key:0,class:"element-animation"},EUe={class:"type-title"},XUe={class:"pool-item-wrapper"},WUe=["onMouseenter","onClick"],VUe={key:0,class:"mask"},DUe={key:1,class:"tip"},UUe={class:"sequence-content"},BUe={class:"index"},YUe={class:"text"},ZUe={class:"handler"},QUe={key:0,class:"configs"},HUe={class:"config-item"},KUe=Fq(()=>V("div",{style:{width:"35%"}},"持续时长:",-1)),GUe={class:"config-item"},zUe=Fq(()=>V("div",{style:{width:"35%"}},"触发方式:",-1)),JUe={class:"config-item"},$Ue=Ee({__name:"ElementAnimationPanel",setup(e){const t={};for(const C of tU)for(const I of C.children)t[I.value]=I.name;for(const C of nU)for(const I of C.children)t[I.value]=I.name;for(const C of rU)for(const I of C.children)t[I.value]=I.name;const n=["in","out","attention"],r=lt(),{handleElement:i,handleElementId:o}=We(dt()),{currentSlide:a,formatedAnimations:s,currentSlideAnimations:l}=We(r),u=[{key:"in",label:"入场",color:"#68a490"},{key:"out",label:"退场",color:"#d86344"},{key:"attention",label:"强调",color:"#e8b76a"}],c=ge("in"),f=ge(!1);_t(()=>o.value,()=>{h.value=!1});const d=ge(""),h=ge(!1),{addHistorySnapshot:p}=qt(),v=we(()=>{const C=[];for(let I=0;IY.id===D.elId);if(!Z)continue;const re=ig[Z.type],B=t[D.effect];C.push({...D,index:W===0?I+1:"",elType:re,animationEffect:B})}}return C}),g=we(()=>l.value.filter(N=>N.elId===o.value)||[]),m=C=>{const I=l.value.filter(N=>N.id!==C);r.updateSlide({animations:I}),p()},y=C=>{const{newIndex:I,oldIndex:N}=C;if(I===void 0||N===void 0||I===N)return;const W=JSON.parse(JSON.stringify(l.value)),D=W[N];W.splice(N,1),W.splice(I,0,D),r.updateSlide({animations:W}),p()},R=(C,I,N)=>{const W=document.querySelector(`#editable-element-${C} [class^=editable-element-]`);if(W){const D=`${wa}${I}`;document.documentElement.style.setProperty("--animate-duration",`${N}ms`),W.classList.add(`${wa}animated`,D);const Z=()=>{document.documentElement.style.removeProperty("--animate-duration"),W.classList.remove(`${wa}animated`,D)};W.addEventListener("animationend",Z,{once:!0})}},A=async()=>{f.value=!f.value;for(let C=0;CsetTimeout(N,I.duration+100)),R(I.elId,I.effect,I.duration),C>=v.value.length-1&&(f.value=!1)}},x=(C,I)=>{if(I<100||I>5e3)return;const N=l.value.map(W=>W.id===C?{...W,duration:I}:W);r.updateSlide({animations:N}),p()},S=(C,I)=>{const N=l.value.map(W=>W.id===C?{...W,trigger:I}:W);r.updateSlide({animations:N}),p()},T=(C,I)=>{const N=l.value.map(Z=>Z.id===w.value?{...Z,type:C,effect:I}:Z);r.updateSlide({animations:N}),h.value=!1,p();const W=l.value.find(Z=>Z.elId===o.value),D=(W==null?void 0:W.duration)||T8;setTimeout(()=>{R(o.value,I,D)},0)},w=ge(""),M=(C,I)=>{if(w.value){T(C,I);return}const N=JSON.parse(JSON.stringify(l.value));N.push({id:yn(10),elId:o.value,type:C,effect:I,duration:T8,trigger:NUe}),r.updateSlide({animations:N}),h.value=!1,p(),setTimeout(()=>{R(o.value,I,T8)},0)},O=ge(!1),P=C=>{C?setTimeout(()=>O.value=!0,600):O.value=!1},k=C=>{h.value=!0,w.value=C,P(!0)},F={in:tU,out:nU,attention:rU};return(C,I)=>{const N=Se("IconEffects"),W=Se("IconClick"),D=Se("IconPlayOne"),Z=Se("IconCloseSmall"),re=Cn("tooltip");return U(),ne("div",IUe,[z(i)?(U(),ne("div",FUe,[_(It,{trigger:"click",value:h.value,"onUpdate:value":[I[3]||(I[3]=B=>h.value=B),I[4]||(I[4]=B=>P(B))],style:{width:"100%"}},{content:se(()=>[_(ol,{tabs:u,value:c.value,"onUpdate:value":I[0]||(I[0]=B=>c.value=B),tabsStyle:{marginBottom:"20px"},tabStyle:{width:"33.333%"},spaceAround:""},null,8,["value"]),(U(),ne(Ve,null,rt(n,B=>(U(),ne(Ve,null,[c.value===B?(U(),ne("div",{class:$e(["animation-pool",B]),key:B},[(U(!0),ne(Ve,null,rt(F[B],Y=>(U(),ne("div",{class:"pool-type",key:Y.name},[V("div",EUe,pt(Y.name)+":",1),V("div",XUe,[(U(!0),ne(Ve,null,rt(Y.children,K=>(U(),ne("div",{class:"pool-item",key:K.name,onMouseenter:G=>d.value=K.value,onMouseleave:I[1]||(I[1]=G=>d.value=""),onClick:G=>M(B,K.value)},[V("div",{class:$e(["animation-box",[`${z(wa)}animated`,`${z(wa)}fast`,d.value===K.value&&`${z(wa)}${K.value}`]])},pt(K.name),3)],40,WUe))),128))])]))),128)),O.value?Ze("",!0):(U(),ne("div",VUe))],2)):Ze("",!0)],64))),64))]),default:se(()=>[_(qe,{class:"element-animation-btn",onClick:I[2]||(I[2]=B=>w.value="")},{default:se(()=>[_(N,{style:{"margin-right":"5px"}}),De(" 添加动画 ")]),_:1})]),_:1},8,["value"])])):(U(),ne("div",DUe,[_(W,{style:{"margin-right":"5px"}}),De(" 选中画布中的元素添加动画")])),_(Yt),_(z($k),{class:"animation-sequence",modelValue:v.value,animation:200,scroll:!0,scrollSensitivity:50,handle:".sequence-content",itemKey:"id",onEnd:y},{item:se(({element:B})=>{var Y,K;return[V("div",{class:$e(["sequence-item",[B.type,{active:((Y=z(i))==null?void 0:Y.id)===B.elId}]])},[V("div",UUe,[V("div",BUe,pt(B.index),1),V("div",YUe,"【"+pt(B.elType)+"】"+pt(B.animationEffect),1),V("div",ZUe,[Ge(_(D,{class:"handler-btn",onClick:G=>R(B.elId,B.effect,B.duration)},null,8,["onClick"]),[[re,"预览"]]),Ge(_(Z,{class:"handler-btn",onClick:G=>m(B.id)},null,8,["onClick"]),[[re,"删除"]])])]),((K=g.value[0])==null?void 0:K.elId)===B.elId?(U(),ne("div",QUe,[_(Yt,{margin:16}),V("div",HUe,[KUe,_(Ko,{min:500,max:3e3,step:500,value:B.duration,"onUpdate:value":G=>x(B.id,G),style:{width:"65%"}},null,8,["value","onUpdate:value"])]),V("div",GUe,[zUe,_(Ar,{value:B.trigger,"onUpdate:value":G=>S(B.id,G),style:{width:"65%"},options:[{label:"主动触发",value:"click"},{label:"与上一动画同时",value:"meantime"},{label:"上一动画之后",value:"auto"}]},null,8,["value","onUpdate:value"])]),V("div",JUe,[_(qe,{style:{width:"100%"},onClick:G=>k(B.id)},{default:se(()=>[De("更换动画")]),_:2},1032,["onClick"])])])):Ze("",!0)],2)]}),_:1},8,["modelValue"]),v.value.length>=2?(U(),ne(Ve,{key:2},[_(Yt),_(qe,{onClick:I[5]||(I[5]=B=>A())},{default:se(()=>[De(pt(f.value?"停止预览":"预览全部"),1)]),_:1})],64)):Ze("",!0)])}}}),jUe=Ue($Ue,[["__scopeId","data-v-d71f68dd"]]),qUe=[{background:"#ffffff",fontColor:"#333333",fontname:"Microsoft Yahei",colors:["#5b9bd5","#ed7d31","#a5a5a5","#ffc000","#4472c4","#70ad47"]},{background:"#ffffff",fontColor:"#333333",fontname:"Microsoft Yahei",colors:["#83992a","#3c9670","#44709d","#a23b32","#d87728","#deb340"]},{background:"#ffffff",fontColor:"#333333",fontname:"Microsoft Yahei",colors:["#e48312","#bd582c","#865640","#9b8357","#c2bc80","#94a088"]},{background:"#ffffff",fontColor:"#333333",fontname:"Microsoft Yahei",colors:["#bdc8df","#003fa9","#f5ba00","#ff7567","#7676d9","#923ffc"]},{background:"#ffffff",fontColor:"#333333",fontname:"Microsoft Yahei",colors:["#90c225","#54a121","#e6b91e","#e86618","#c42f19","#918756"]},{background:"#ffffff",fontColor:"#333333",fontname:"Microsoft Yahei",colors:["#1cade4","#2683c6","#27ced7","#42ba97","#3e8853","#62a39f"]},{background:"#e9efd6",fontColor:"#333333",fontname:"Microsoft Yahei",colors:["#a5300f","#de7e18","#9f8351","#728653","#92aa4c","#6aac91"]},{background:"#17444e",fontColor:"#ffffff",fontname:"Microsoft Yahei",colors:["#b01513","#ea6312","#e6b729","#6bab90","#55839a","#9e5d9d"]},{background:"#36234d",fontColor:"#ffffff",fontname:"Microsoft Yahei",colors:["#b31166","#e33d6f","#e45f3c","#e9943a","#9b6bf2","#d63cd0"]},{background:"#247fad",fontColor:"#ffffff",fontname:"Microsoft Yahei",colors:["#052f61","#a50e82","#14967c","#6a9e1f","#e87d37","#c62324"]},{background:"#103f55",fontColor:"#ffffff",fontname:"Microsoft Yahei",colors:["#40aebd","#97e8d5","#a1cf49","#628f3e","#f2df3a","#fcb01c"]},{background:"#242367",fontColor:"#ffffff",fontname:"Microsoft Yahei",colors:["#ac3ec1","#477bd1","#46b298","#90ba4c","#dd9d31","#e25345"]},{background:"#e4b75e",fontColor:"#333333",fontname:"Microsoft Yahei",colors:["#f0a22e","#a5644e","#b58b80","#c3986d","#a19574","#c17529"]},{background:"#333333",fontColor:"#ffffff",fontname:"Microsoft Yahei",colors:["#bdc8df","#003fa9","#f5ba00","#ff7567","#7676d9","#923ffc"]}],Eq=()=>{const e=lt(),{slides:t,currentSlide:n,theme:r}=We(e),{addHistorySnapshot:i}=qt(),o=d=>{var S,T,w,M,O,P,k,F,C;const h=Array.isArray(d)?d:[d],p=[],v=[],g=[],m=[];for(const I of h){if(I.background)if(I.background.type==="solid"&&I.background.color)p.push({area:1,value:I.background.color});else if(I.background.type==="gradient"&&I.background.gradient){const N=I.background.gradient.colors.length;p.push(...I.background.gradient.colors.map(W=>({area:1/N,value:W.color})))}else p.push({area:1,value:r.value.backgroundColor});for(const N of I.elements){const W=N.width;let D=0;if(N.type==="line"){const[re,B]=N.start,[Y,K]=N.end;D=Math.sqrt(Math.pow(Math.abs(re-Y),2)+Math.pow(Math.abs(B-K),2))}else D=N.height;const Z=W*D;if(N.type==="shape"||N.type==="text"){if(N.fill&&v.push({area:Z,value:N.fill}),N.type==="shape"&&N.gradient){const q=N.gradient.colors.length;v.push(...N.gradient.colors.map(H=>({area:1/q*Z,value:H.color})))}const re=(N.type==="shape"?(S=N.text)==null?void 0:S.content:N.content)||"";if(!re)continue;const B=re.replace(/<[^>]+>/g,"").replace(/\s*/g,""),Y=re.match(/<[^>]+color: .+?<\/.+?>/g),K=re.match(/<[^>]+font-family: .+?<\/.+?>/g);let G=1,ee=1;if(Y)for(const q of Y){const H=q.match(/color: (.+?);/);if(!H)continue;const ue=q.replace(/<[^>]+>/g,"").replace(/\s*/g,""),Ae=H[1],ce=ue.length/B.length;G=G-ce,g.push({area:Z*ce,value:Ae})}if(K)for(const q of K){const H=q.match(/font-family: (.+?);/);if(!H)continue;const ue=q.replace(/<[^>]+>/g,"").replace(/\s*/g,""),Ae=H[1],ce=ue.length/B.length;ee=ee-ce,m.push({area:Z*ce,value:Ae})}if(G){const H=(N.type==="shape"?(T=N.text)==null?void 0:T.defaultColor:N.defaultColor)||r.value.fontColor;g.push({area:Z*G,value:H})}if(ee){const H=(N.type==="shape"?(w=N.text)==null?void 0:w.defaultFontName:N.defaultFontName)||r.value.fontName;m.push({area:Z*ee,value:H})}}else if(N.type==="table"){const re=N.data.length*N.data[0].length;let B=0;for(const Y of N.data)for(const K of Y)if((M=K.style)!=null&&M.backcolor&&(B+=1,v.push({area:Z/re,value:(O=K.style)==null?void 0:O.backcolor})),K.text){const G=K.text.length>=10?1:K.text.length/10;(P=K.style)!=null&&P.color&&g.push({area:Z/re*G,value:(k=K.style)==null?void 0:k.color}),(F=K.style)!=null&&F.fontname&&g.push({area:Z/re*G,value:(C=K.style)==null?void 0:C.fontname})}if(N.theme){const Y=1-B/re;v.push({area:Z*Y,value:N.theme.color})}}else N.type==="chart"?(N.fill&&v.push({area:Z*.5,value:N.fill}),v.push({area:Z*.5,value:N.themeColors[0]})):N.type==="line"?v.push({area:Z,value:N.color}):N.type==="audio"?v.push({area:Z,value:N.color}):N.type==="latex"&&g.push({area:Z,value:N.color})}}const y={};for(const I of p){const N=ot(I.value).toRgbString();N!=="rgba(0, 0, 0, 0)"&&(y[N]?y[N]+=I.area:y[N]=I.area)}const R={};for(const I of v){const N=ot(I.value).toRgbString();N!=="rgba(0, 0, 0, 0)"&&(R[N]?R[N]+=I.area:R[N]=I.area)}const A={};for(const I of g){const N=ot(I.value).toRgbString();N!=="rgba(0, 0, 0, 0)"&&(A[N]?A[N]+=I.area:A[N]=I.area)}const x={};for(const I of m)x[I.value]?x[I.value]+=I.area:x[I.value]=I.area;return{backgroundColors:Object.keys(y).sort((I,N)=>y[N]-y[I]),themeColors:Object.keys(R).sort((I,N)=>R[N]-R[I]),fontColors:Object.keys(A).sort((I,N)=>A[N]-A[I]),fontNames:Object.keys(x).sort((I,N)=>x[N]-x[I])}},a=d=>{const h=[];for(const p of d.elements){if(p.type==="shape"&&ot(p.fill).getAlpha()!==0){const v=ot(p.fill).toRgbString();h.includes(v)||h.push(v)}if(p.type==="text"&&p.fill&&ot(p.fill).getAlpha()!==0){const v=ot(p.fill).toRgbString();h.includes(v)||h.push(v)}if(p.type==="table"&&p.theme&&ot(p.theme.color).getAlpha()!==0){const v=ot(p.theme.color).toRgbString();h.includes(v)||h.push(v)}if(p.type==="chart"&&p.themeColors[0]&&ot(p.themeColors[0]).getAlpha()!==0){const v=ot(p.themeColors[0]).toRgbString();h.includes(v)||h.push(v)}if(p.type==="line"&&ot(p.color).getAlpha()!==0){const v=ot(p.color).toRgbString();h.includes(v)||h.push(v)}if(p.type==="audio"&&ot(p.color).getAlpha()!==0){const v=ot(p.color).toRgbString();h.includes(v)||h.push(v)}}return h},s=(d,h)=>{const p=a(d),v={};if(p.length>h.length){const m=ot(h[0]).analogous(p.length-h.length+10).map(y=>y.toHexString()).slice(1);h.push(...m)}for(let g=0;g{const p=s(d,h.colors);(!d.background||d.background.type!=="image")&&(d.background={type:"solid",color:h.background});for(const v of d.elements){if(v.type==="shape"&&(v.fill=p[ot(v.fill).toRgbString()]||v.fill,v.gradient&&delete v.gradient),v.type==="text"&&(v.fill&&(v.fill=p[ot(v.fill).toRgbString()]||v.fill),v.defaultColor=h.fontColor,v.defaultFontName=h.fontname),v.type==="table"){v.theme&&(v.theme.color=p[ot(v.theme.color).toRgbString()]||v.theme.color);for(const g of v.data)for(const m of g)m.style&&(m.style.color=h.fontColor,m.style.fontname=h.fontname)}v.type==="chart"&&(v.themeColors=[p[ot(v.themeColors[0]).toRgbString()]],v.textColor=h.fontColor),v.type==="line"&&(v.color=p[ot(v.color).toRgbString()]||v.color),v.type==="audio"&&(v.color=p[ot(v.color).toRgbString()]||v.color),v.type==="latex"&&(v.color=h.fontColor)}};return{getSlidesThemeStyles:o,applyPresetThemeToSingleSlide:d=>{const h=JSON.parse(JSON.stringify(n.value));l(h,d),e.updateSlide({background:h.background,elements:h.elements}),i()},applyPresetThemeToAllSlides:d=>{const h=JSON.parse(JSON.stringify(t.value));for(const p of h)l(p,d);e.setTheme({backgroundColor:d.background,themeColor:d.colors[0],fontColor:d.fontColor,fontName:d.fontname}),e.setSlides(h),i()},applyThemeToAllSlides:(d=!1)=>{const h=JSON.parse(JSON.stringify(t.value)),{themeColor:p,backgroundColor:v,fontColor:g,fontName:m,outline:y,shadow:R}=r.value;for(const A of h){(!A.background||A.background.type!=="image")&&(A.background={type:"solid",color:v});for(const x of A.elements)if(d&&("outline"in x&&x.outline&&(x.outline=y),"shadow"in x&&x.shadow&&(x.shadow=R)),x.type==="shape")x.fill=p;else if(x.type==="line")x.color=p;else if(x.type==="text")x.defaultColor=g,x.defaultFontName=m,x.fill&&(x.fill=p);else if(x.type==="table"){x.theme&&(x.theme.color=p);for(const S of x.data)for(const T of S)T.style&&(T.style.color=g,T.style.fontname=m)}else x.type==="chart"?(x.themeColors=[p],x.textColor=g):x.type==="latex"?x.color=g:x.type==="audio"&&(x.color=p)}e.setSlides(h),i()}}},C3=e=>(rn("data-v-724633c2"),e=e(),on(),e),eBe={class:"theme-styles-extract"},tBe={class:"content"},nBe={class:"config-item"},rBe=C3(()=>V("div",{class:"label"},"字体:",-1)),iBe={class:"values"},oBe={class:"handler"},aBe=["onClick"],sBe=["onClick"],lBe={class:"config-item"},uBe=C3(()=>V("div",{class:"label"},"文字颜色:",-1)),cBe={class:"values"},fBe={class:"handler"},dBe=["onClick"],hBe=["onClick"],pBe={class:"config-item"},vBe=C3(()=>V("div",{class:"label"},"背景颜色:",-1)),gBe={class:"values"},mBe={class:"handler"},yBe=["onClick"],ABe=["onClick"],RBe={class:"config-item"},bBe=C3(()=>V("div",{class:"label"},"主题色:",-1)),xBe={class:"values"},SBe={class:"handler"},wBe=["onClick"],MBe=["onClick"],LBe={class:"btns"},TBe=Ee({__name:"ThemeStylesExtract",emits:["close"],setup(e,{emit:t}){const n=t,r=lt(),{slides:i,currentSlide:o}=We(r),{getSlidesThemeStyles:a}=Eq(),s=[{key:"single",label:"从当前页中提取"},{key:"all",label:"从全部幻灯片提取"}],l=ge("single"),u=ge({});jt(()=>{const p={};for(const v of u6)p[v.value]=v.label;for(const v of p2)p[v.value]=v.label;u.value=p});const c=ge({backgroundColors:[],themeColors:[],fontColors:[],fontNames:[]}),f=ge({backgroundColor:0,themeColor:0,fontColor:0,fontName:0});_t(l,()=>{l.value==="single"?c.value=a(o.value):c.value=a(i.value)}),jt(()=>{c.value=a(o.value)});const d=p=>{r.setTheme(p)},h=()=>{r.setTheme({backgroundColor:c.value.backgroundColors[f.value.backgroundColor],themeColor:c.value.themeColors[f.value.themeColor],fontColor:c.value.fontColors[f.value.fontColor],fontName:c.value.fontNames[f.value.fontName]}),n("close")};return(p,v)=>(U(),ne("div",eBe,[_(ol,{tabs:s,value:l.value,"onUpdate:value":v[0]||(v[0]=g=>l.value=g),tabsStyle:{marginBottom:"12px"},tabStyle:{padding:"8px 12px"}},null,8,["value"]),V("div",tBe,[V("div",nBe,[rBe,V("div",iBe,[(U(!0),ne(Ve,null,rt(c.value.fontNames,(g,m)=>(U(),ne("div",{class:"value-wrap",key:g},[V("div",{class:"value",style:Le({fontFamily:g})},pt(u.value[g]||g),5),V("div",oBe,[V("div",{class:$e(["state",{active:f.value.fontName===m}])},"√",2),V("div",{class:"config-btn",onClick:y=>f.value.fontName=m},"选择",8,aBe),V("div",{class:"config-btn",onClick:y=>{d({fontName:g}),f.value.fontName=m}},"配置到主题",8,sBe)])]))),128))])]),V("div",lBe,[uBe,V("div",cBe,[(U(!0),ne(Ve,null,rt(c.value.fontColors,(g,m)=>(U(),ne("div",{class:"value-wrap",key:g},[V("div",{class:"value",style:Le({backgroundColor:g})},null,4),V("div",fBe,[V("div",{class:$e(["state",{active:f.value.fontColor===m}])},"√",2),V("div",{class:"config-btn",onClick:y=>f.value.fontColor=m},"选择",8,dBe),V("div",{class:"config-btn",onClick:y=>{d({fontColor:g}),f.value.fontColor=m}},"配置到主题",8,hBe)])]))),128))])]),V("div",pBe,[vBe,V("div",gBe,[(U(!0),ne(Ve,null,rt(c.value.backgroundColors,(g,m)=>(U(),ne("div",{class:"value-wrap",key:g},[V("div",{class:"value",style:Le({backgroundColor:g})},null,4),V("div",mBe,[V("div",{class:$e(["state",{active:f.value.backgroundColor===m}])},"√",2),V("div",{class:"config-btn",onClick:y=>f.value.backgroundColor=m},"选择",8,yBe),V("div",{class:"config-btn",onClick:y=>{d({backgroundColor:g}),f.value.backgroundColor=m}},"配置到主题",8,ABe)])]))),128))])]),V("div",RBe,[bBe,V("div",xBe,[(U(!0),ne(Ve,null,rt(c.value.themeColors,(g,m)=>(U(),ne("div",{class:"value-wrap",key:g},[V("div",{class:"value",style:Le({backgroundColor:g})},null,4),V("div",SBe,[V("div",{class:$e(["state",{active:f.value.themeColor===m}])},"√",2),V("div",{class:"config-btn",onClick:y=>f.value.themeColor=m},"选择",8,wBe),V("div",{class:"config-btn",onClick:y=>{d({themeColor:g}),f.value.themeColor=m}},"配置到主题",8,MBe)])]))),128))])])]),V("div",LBe,[_(qe,{class:"btn",type:"primary",onClick:v[1]||(v[1]=g=>h())},{default:se(()=>[De("将选中配置保存为主题")]),_:1})])]))}}),_Be=Ue(TBe,[["__scopeId","data-v-724633c2"]]),gi=e=>(rn("data-v-169fa39d"),e=e(),on(),e),OBe={class:"slide-design-panel"},kBe=gi(()=>V("div",{class:"title"},"背景填充",-1)),PBe={class:"row"},CBe=gi(()=>V("div",{style:{width:"10px"}},null,-1)),NBe={key:0,class:"background-image-wrapper"},IBe={class:"background-image"},FBe={key:1,class:"background-gradient-wrapper"},EBe={class:"row"},XBe={class:"row"},WBe=gi(()=>V("div",{style:{width:"40%"}},"当前色块:",-1)),VBe={key:0,class:"row"},DBe=gi(()=>V("div",{style:{width:"40%"}},"渐变角度:",-1)),UBe={class:"row"},BBe={class:"row"},YBe=gi(()=>V("div",{style:{width:"40%"}},"画布尺寸:",-1)),ZBe={class:"title"},QBe=gi(()=>V("span",null,"全局主题",-1)),HBe=gi(()=>V("span",{class:"text"},"更多",-1)),KBe={class:"row"},GBe=gi(()=>V("div",{style:{width:"40%"}},"字体:",-1)),zBe={class:"row"},JBe=gi(()=>V("div",{style:{width:"40%"}},"字体颜色:",-1)),$Be={class:"row"},jBe=gi(()=>V("div",{style:{width:"40%"}},"背景颜色:",-1)),qBe={class:"row"},eYe=gi(()=>V("div",{style:{width:"40%"}},"主题色:",-1)),tYe={class:"row"},nYe=gi(()=>V("div",{style:{width:"40%"}},"边框样式:",-1)),rYe={class:"row"},iYe=gi(()=>V("div",{style:{width:"40%"}},"边框颜色:",-1)),oYe={class:"row"},aYe=gi(()=>V("div",{style:{width:"40%"}},"边框粗细:",-1)),sYe={class:"row",style:{height:"30px"}},lYe=gi(()=>V("div",{style:{width:"40%"}},"水平阴影:",-1)),uYe={class:"row",style:{height:"30px"}},cYe=gi(()=>V("div",{style:{width:"40%"}},"垂直阴影:",-1)),fYe={class:"row",style:{height:"30px"}},dYe=gi(()=>V("div",{style:{width:"40%"}},"模糊距离:",-1)),hYe={class:"row"},pYe=gi(()=>V("div",{style:{width:"40%"}},"阴影颜色:",-1)),vYe={class:"row"},gYe={class:"row"},mYe=gi(()=>V("div",{class:"title"},"预置主题",-1)),yYe={class:"theme-list"},AYe={class:"theme-item-content"},RYe={class:"colors"},bYe={class:"btns"},xYe=Ee({__name:"SlideDesignPanel",setup(e){const t=lt(),{availableFonts:n}=We(dt()),{slides:r,currentSlide:i,viewportRatio:o,theme:a}=We(t),s=ge(!1),l=ge(!1),u=ge(0),c=we(()=>i.value.background?i.value.background:{type:"solid",value:"#fff"}),{addHistorySnapshot:f}=qt(),{applyPresetThemeToSingleSlide:d,applyPresetThemeToAllSlides:h,applyThemeToAllSlides:p}=Eq(),v=w=>{if(w==="solid"){const M={...c.value,type:"solid",color:c.value.color||"#fff"};t.updateSlide({background:M})}else if(w==="image"){const M={...c.value,type:"image",image:c.value.image||{src:"",size:"cover"}};t.updateSlide({background:M})}else{const M={...c.value,type:"gradient",gradient:c.value.gradient||{type:"linear",colors:[{pos:0,color:"#fff"},{pos:100,color:"#fff"}],rotate:0}};u.value=0,t.updateSlide({background:M})}f()},g=w=>{t.updateSlide({background:{...c.value,...w}}),f()},m=w=>{g({gradient:{...c.value.gradient,...w}})},y=w=>{const M=c.value.gradient.colors.map((O,P)=>P===u.value?{...O,color:w}:O);m({colors:M})},R=w=>{g({image:{...c.value.image,...w}})},A=w=>{const M=w[0];M&&zf(M).then(O=>R({src:O}))},x=()=>{const w=r.value.map(M=>({...M,background:i.value.background}));t.setSlides(w),f()},S=w=>{t.setTheme(w)},T=w=>{t.setViewportRatio(w)};return(w,M)=>{var F,C,I,N;const O=Se("IconPlus"),P=Se("IconDown"),k=Se("IconRight");return U(),ne(Ve,null,[V("div",OBe,[kBe,V("div",PBe,[_(Ar,{style:{flex:"1"},value:c.value.type,"onUpdate:value":M[0]||(M[0]=W=>v(W)),options:[{label:"纯色填充",value:"solid"},{label:"图片填充",value:"image"},{label:"渐变填充",value:"gradient"}]},null,8,["value"]),CBe,c.value.type==="solid"?(U(),_e(It,{key:0,trigger:"click",style:{flex:"1"}},{content:se(()=>[_($n,{modelValue:c.value.color,"onUpdate:modelValue":M[1]||(M[1]=W=>g({color:W}))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:c.value.color||"#fff"},null,8,["color"])]),_:1})):c.value.type==="image"?(U(),_e(Ar,{key:1,style:{flex:"1"},value:((F=c.value.image)==null?void 0:F.size)||"cover","onUpdate:value":M[2]||(M[2]=W=>R({size:W})),options:[{label:"缩放",value:"contain"},{label:"拼贴",value:"repeat"},{label:"缩放铺满",value:"cover"}]},null,8,["value"])):(U(),_e(Ar,{key:2,style:{flex:"1"},value:((C=c.value.gradient)==null?void 0:C.type)||"","onUpdate:value":M[3]||(M[3]=W=>m({type:W})),options:[{label:"线性渐变",value:"linear"},{label:"径向渐变",value:"radial"}]},null,8,["value"]))]),c.value.type==="image"?(U(),ne("div",NBe,[_(Xh,{onChange:M[4]||(M[4]=W=>A(W))},{default:se(()=>{var W;return[V("div",IBe,[V("div",{class:"content",style:Le({backgroundImage:`url(${(W=c.value.image)==null?void 0:W.src})`})},[_(O)],4)])]}),_:1})])):Ze("",!0),c.value.type==="gradient"?(U(),ne("div",FBe,[V("div",EBe,[_(Oq,{value:((I=c.value.gradient)==null?void 0:I.colors)||[],"onUpdate:value":M[5]||(M[5]=W=>m({colors:W})),"onUpdate:index":M[6]||(M[6]=W=>u.value=W)},null,8,["value"])]),V("div",XBe,[WBe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:c.value.gradient.colors[u.value].color,"onUpdate:modelValue":M[7]||(M[7]=W=>y(W))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:c.value.gradient.colors[u.value].color},null,8,["color"])]),_:1})]),((N=c.value.gradient)==null?void 0:N.type)==="linear"?(U(),ne("div",VBe,[DBe,_(Yi,{min:0,max:360,step:15,value:c.value.gradient.rotate||0,"onUpdate:value":M[8]||(M[8]=W=>m({rotate:W})),style:{width:"60%"}},null,8,["value"])])):Ze("",!0)])):Ze("",!0),V("div",UBe,[_(qe,{style:{flex:"1"},onClick:M[9]||(M[9]=W=>x())},{default:se(()=>[De("应用背景到全部")]),_:1})]),_(Yt),V("div",BBe,[YBe,_(Ar,{style:{width:"60%"},value:z(o),"onUpdate:value":M[10]||(M[10]=W=>T(W)),options:[{label:"宽屏 16 : 9",value:.5625},{label:"宽屏 16 : 10",value:.625},{label:"标准 4 : 3",value:.75},{label:"纸张 A3 / A4",value:.70710678},{label:"竖向 A3 / A4",value:1.41421356}]},null,8,["value"])]),_(Yt),V("div",ZBe,[QBe,V("span",{class:"more",onClick:M[11]||(M[11]=W=>s.value=!s.value)},[HBe,s.value?(U(),_e(P,{key:0})):(U(),_e(k,{key:1}))])]),V("div",KBe,[GBe,_(Ar,{style:{width:"60%"},value:z(a).fontName,search:"",searchLabel:"搜索字体","onUpdate:value":M[12]||(M[12]=W=>S({fontName:W})),options:[...z(n),...z(p2)]},null,8,["value","options"])]),V("div",zBe,[JBe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:z(a).fontColor,"onUpdate:modelValue":M[13]||(M[13]=W=>S({fontColor:W}))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:z(a).fontColor},null,8,["color"])]),_:1})]),V("div",$Be,[jBe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:z(a).backgroundColor,"onUpdate:modelValue":M[14]||(M[14]=W=>S({backgroundColor:W}))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:z(a).backgroundColor},null,8,["color"])]),_:1})]),V("div",qBe,[eYe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:z(a).themeColor,"onUpdate:modelValue":M[15]||(M[15]=W=>S({themeColor:W}))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:z(a).themeColor},null,8,["color"])]),_:1})]),s.value?(U(),ne(Ve,{key:2},[V("div",tYe,[nYe,_(Ar,{style:{width:"60%"},value:z(a).outline.style||"","onUpdate:value":M[16]||(M[16]=W=>S({outline:{...z(a).outline,style:W}})),options:[{label:"实线边框",value:"solid"},{label:"虚线边框",value:"dashed"},{label:"点线边框",value:"dotted"}]},null,8,["value"])]),V("div",rYe,[iYe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:z(a).outline.color,"onUpdate:modelValue":M[17]||(M[17]=W=>S({outline:{...z(a).outline,color:W}}))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:z(a).outline.color||"#000"},null,8,["color"])]),_:1})]),V("div",oYe,[aYe,_(Ko,{value:z(a).outline.width||0,"onUpdate:value":M[18]||(M[18]=W=>S({outline:{...z(a).outline,width:W}})),style:{width:"60%"}},null,8,["value"])]),V("div",sYe,[lYe,_(Yi,{style:{width:"60%"},min:-10,max:10,step:1,value:z(a).shadow.h,"onUpdate:value":M[19]||(M[19]=W=>S({shadow:{...z(a).shadow,h:W}}))},null,8,["value"])]),V("div",uYe,[cYe,_(Yi,{style:{width:"60%"},min:-10,max:10,step:1,value:z(a).shadow.v,"onUpdate:value":M[20]||(M[20]=W=>S({shadow:{...z(a).shadow,v:W}}))},null,8,["value"])]),V("div",fYe,[dYe,_(Yi,{style:{width:"60%"},min:1,max:20,step:1,value:z(a).shadow.blur,"onUpdate:value":M[21]||(M[21]=W=>S({shadow:{...z(a).shadow,blur:W}}))},null,8,["value"])]),V("div",hYe,[pYe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:z(a).shadow.color,"onUpdate:modelValue":M[22]||(M[22]=W=>S({shadow:{...z(a).shadow,color:W}}))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:z(a).shadow.color},null,8,["color"])]),_:1})])],64)):Ze("",!0),V("div",vYe,[_(qe,{style:{flex:"1"},onClick:M[23]||(M[23]=W=>z(p)(s.value))},{default:se(()=>[De("应用主题到全部")]),_:1})]),V("div",gYe,[_(qe,{style:{flex:"1"},onClick:M[24]||(M[24]=W=>l.value=!0)},{default:se(()=>[De("从幻灯片提取主题")]),_:1})]),_(Yt),mYe,V("div",yYe,[(U(!0),ne(Ve,null,rt(z(qUe),(W,D)=>(U(),ne("div",{class:"theme-item",key:D,style:Le({backgroundColor:W.background,fontFamily:W.fontname})},[V("div",AYe,[V("div",{class:"text",style:Le({color:W.fontColor})},"文字 Aa",4),V("div",RYe,[(U(!0),ne(Ve,null,rt(W.colors,(Z,re)=>(U(),ne("div",{class:"color-block",key:re,style:Le({backgroundColor:Z})},null,4))),128))]),V("div",bYe,[_(qe,{type:"primary",size:"small",onClick:Z=>z(d)(W)},{default:se(()=>[De("应用")]),_:2},1032,["onClick"]),_(qe,{type:"primary",size:"small",style:{"margin-top":"3px"},onClick:Z=>z(h)(W)},{default:se(()=>[De("应用全局")]),_:2},1032,["onClick"])])])],4))),128))])]),_(Vv,{visible:l.value,"onUpdate:visible":M[26]||(M[26]=W=>l.value=W),width:320,onClosed:M[27]||(M[27]=W=>l.value=!1)},{default:se(()=>[_(_Be,{onClose:M[25]||(M[25]=W=>l.value=!1)})]),_:1},8,["visible"])],64)}}}),SYe=Ue(xYe,[["__scopeId","data-v-169fa39d"]]),wYe={class:"slide-animation-panel"},MYe={class:"animation-pool"},LYe=["onClick"],TYe={class:"animation-text"},_Ye=Ee({__name:"SlideAnimationPanel",setup(e){const t=lt(),{slides:n,currentSlide:r}=We(t),i=we(()=>r.value.turningMode||"slideY"),o=Iq,{addHistorySnapshot:a}=qt(),s=u=>{u!==i.value&&(t.updateSlide({turningMode:u}),a())},l=()=>{const u=n.value.map(c=>({...c,turningMode:r.value.turningMode}));t.setSlides(u),Tn.success("已应用到全部"),a()};return(u,c)=>(U(),ne("div",wYe,[V("div",MYe,[(U(!0),ne(Ve,null,rt(z(o),f=>(U(),ne("div",{class:$e(["animation-item",{active:i.value===f.value}]),key:f.label,onClick:d=>s(f.value)},[V("div",{class:$e(["animation-block",f.value])},null,2),V("div",TYe,pt(f.label),1)],10,LYe))),128))]),_(qe,{style:{width:"100%"},onClick:c[0]||(c[0]=f=>l())},{default:se(()=>[De("应用到全部")]),_:1})]))}}),OYe=Ue(_Ye,[["__scopeId","data-v-ae84c3f4"]]),kYe=()=>{const e=lt(),{activeElementIdList:t,activeElementList:n}=We(dt()),{currentSlide:r}=We(e),{addHistorySnapshot:i}=qt();return{alignActiveElement:a=>{const{minX:s,maxX:l,minY:u,maxY:c}=Uu(n.value),f=JSON.parse(JSON.stringify(r.value.elements)),d={};for(const h of n.value)if(h.groupId&&!d[h.groupId]){const p=n.value.filter(v=>v.groupId===h.groupId);d[h.groupId]=Uu(p)}if(a===dn.LEFT)f.forEach(h=>{if(t.value.includes(h.id))if(h.groupId){const v=d[h.groupId].minX-s;h.left=h.left-v}else if("rotate"in h&&h.rotate){const{offsetX:p}=dp({left:h.left,top:h.top,width:h.width,height:h.height,rotate:h.rotate});h.left=s-p}else h.left=s});else if(a===dn.RIGHT)f.forEach(h=>{if(t.value.includes(h.id))if(h.groupId){const v=d[h.groupId].maxX-l;h.left=h.left-v}else{const p=h.type==="line"?Math.max(h.start[0],h.end[0]):h.width;if("rotate"in h&&h.rotate){const{offsetX:v}=dp({left:h.left,top:h.top,width:h.width,height:h.height,rotate:h.rotate});h.left=l-p+v}else h.left=l-p}});else if(a===dn.TOP)f.forEach(h=>{if(t.value.includes(h.id))if(h.groupId){const v=d[h.groupId].minY-u;h.top=h.top-v}else if("rotate"in h&&h.rotate){const{offsetY:p}=dp({left:h.left,top:h.top,width:h.width,height:h.height,rotate:h.rotate});h.top=u-p}else h.top=u});else if(a===dn.BOTTOM)f.forEach(h=>{if(t.value.includes(h.id))if(h.groupId){const v=d[h.groupId].maxY-c;h.top=h.top-v}else{const p=h.type==="line"?Math.max(h.start[1],h.end[1]):h.height;if("rotate"in h&&h.rotate){const{offsetY:v}=dp({left:h.left,top:h.top,width:h.width,height:h.height,rotate:h.rotate});h.top=c-p+v}else h.top=c-p}});else if(a===dn.HORIZONTAL){const h=(s+l)/2;f.forEach(p=>{if(t.value.includes(p.id))if(p.groupId){const v=d[p.groupId],m=(v.maxX+v.minX)/2-h;p.left=p.left-m}else{const v=p.type==="line"?Math.max(p.start[0],p.end[0]):p.width;p.left=h-v/2}})}else if(a===dn.VERTICAL){const h=(u+c)/2;f.forEach(p=>{if(t.value.includes(p.id))if(p.groupId){const v=d[p.groupId],m=(v.maxY+v.minY)/2-h;p.top=p.top-m}else{const v=p.type==="line"?Math.max(p.start[1],p.end[1]):p.height;p.top=h-v/2}})}e.updateSlide({elements:f}),i()}}},PYe=()=>{const e=lt(),{activeElementIdList:t,activeElementList:n}=We(dt()),{currentSlide:r}=We(e),{addHistorySnapshot:i}=qt();return{displayItemCount:we(()=>{let l=0;const u=[];for(const c of n.value)c.groupId?u.includes(c.groupId)||(u.push(c.groupId),l+=1):l+=1;return l}),uniformHorizontalDisplay:()=>{const{minX:l,maxX:u}=Uu(n.value),c=JSON.parse(JSON.stringify(n.value)),f=JSON.parse(JSON.stringify(r.value.elements)),d=[];let h=[];for(const x of c)if(x.groupId)h.find(T=>T.groupId===x.groupId)?h=h.map(T=>T.groupId===x.groupId?{...T,els:[...T.els,x]}:T):h.push({groupId:x.groupId,els:[x]});else{const{minX:S,maxX:T}=is(x);d.push({min:S,max:T,el:x})}const p=[];for(const x of h){const{minX:S,maxX:T}=Uu(x.els);p.push({min:S,max:T,els:x.els})}const v=[...d,...p];v.sort((x,S)=>x.min-S.min);let g=0;for(const x of v){const S=x.max-x.min;g+=S}const m=(u-l-g)/(v.length-1),y=[],R=v[0];let A={min:R.min,max:R.max};if("el"in R)y.push({pos:R.min,el:R.el});else for(const x of R.els){const{minX:S}=is(x);y.push({pos:S,el:x})}for(let x=1;x{const{minY:l,maxY:u}=Uu(n.value),c=JSON.parse(JSON.stringify(n.value)),f=JSON.parse(JSON.stringify(r.value.elements)),d=[];let h=[];for(const x of c)if(x.groupId)h.find(T=>T.groupId===x.groupId)?h=h.map(T=>T.groupId===x.groupId?{...T,els:[...T.els,x]}:T):h.push({groupId:x.groupId,els:[x]});else{const{minY:S,maxY:T}=is(x);d.push({min:S,max:T,el:x})}const p=[];for(const x of h){const{minY:S,maxY:T}=Uu(x.els);p.push({min:S,max:T,els:x.els})}const v=[...d,...p];v.sort((x,S)=>x.min-S.min);let g=0;for(const x of v){const S=x.max-x.min;g+=S}const m=(u-l-g)/(v.length-1),y=[],R=v[0];let A={min:R.min,max:R.max};if("el"in R)y.push({pos:R.min,el:R.el});else for(const x of R.els){const{minY:S}=is(x);y.push({pos:S,el:x})}for(let x=1;x{t.value?i(c):o(c)};return(c,f)=>{const d=Se("IconAlignLeft"),h=Se("IconAlignHorizontally"),p=Se("IconAlignRight"),v=Se("IconAlignTop"),g=Se("IconAlignVertically"),m=Se("IconAlignBottom"),y=Se("IconGroup"),R=Se("IconUngroup"),A=Cn("tooltip");return U(),ne("div",CYe,[_(Dn,{class:"row"},{default:se(()=>[Ge((U(),_e(qe,{style:{flex:"1"},onClick:f[0]||(f[0]=x=>u(z(dn).LEFT))},{default:se(()=>[_(d)]),_:1})),[[A,"左对齐"]]),Ge((U(),_e(qe,{style:{flex:"1"},onClick:f[1]||(f[1]=x=>u(z(dn).HORIZONTAL))},{default:se(()=>[_(h)]),_:1})),[[A,"水平居中"]]),Ge((U(),_e(qe,{style:{flex:"1"},onClick:f[2]||(f[2]=x=>u(z(dn).RIGHT))},{default:se(()=>[_(p)]),_:1})),[[A,"右对齐"]])]),_:1}),_(Dn,{class:"row"},{default:se(()=>[Ge((U(),_e(qe,{style:{flex:"1"},onClick:f[3]||(f[3]=x=>u(z(dn).TOP))},{default:se(()=>[_(v)]),_:1})),[[A,"上对齐"]]),Ge((U(),_e(qe,{style:{flex:"1"},onClick:f[4]||(f[4]=x=>u(z(dn).VERTICAL))},{default:se(()=>[_(g)]),_:1})),[[A,"垂直居中"]]),Ge((U(),_e(qe,{style:{flex:"1"},onClick:f[5]||(f[5]=x=>u(z(dn).BOTTOM))},{default:se(()=>[_(m)]),_:1})),[[A,"下对齐"]])]),_:1}),z(a)>2?(U(),_e(Dn,{key:0,class:"row"},{default:se(()=>[_(qe,{style:{flex:"1"},onClick:f[6]||(f[6]=x=>z(s)())},{default:se(()=>[De("水平均匀分布")]),_:1}),_(qe,{style:{flex:"1"},onClick:f[7]||(f[7]=x=>z(l)())},{default:se(()=>[De("垂直均匀分布")]),_:1})]),_:1})):Ze("",!0),_(Yt),_(Dn,{class:"row"},{default:se(()=>[_(qe,{disabled:!z(t),onClick:f[8]||(f[8]=x=>z(n)()),style:{flex:"1"}},{default:se(()=>[_(y,{style:{"margin-right":"3px"}}),De("组合")]),_:1},8,["disabled"]),_(qe,{disabled:z(t),onClick:f[9]||(f[9]=x=>z(r)()),style:{flex:"1"}},{default:se(()=>[_(R,{style:{"margin-right":"3px"}}),De("取消组合")]),_:1},8,["disabled"])]),_:1})])}}}),IYe=Ue(NYe,[["__scopeId","data-v-d41009b1"]]),_8=[{key:"letter",label:"字母",children:["α","β","γ","δ","ϵ","ε","ζ","η","θ","ϑ","ι","κ","λ","μ","ν","ξ","π","ϖ","ρ","ϱ","σ","ς","τ","υ","ϕ","φ","χ","ψ","ω","Γ","Δ","Θ","Λ","Ξ","Π","Σ","Υ","Φ","Ψ","Ω","𝐀","𝐁","𝐂","𝐃","𝐄","𝐅","𝐆","𝐇","𝐈","𝐉","𝐊","𝐋","𝐌","𝐍","𝐎","𝐏","𝐐","𝐑","𝐒","𝐓","𝐔","𝐕","𝐖","𝐗","𝐘","𝐙","𝐚","𝐛","𝐜","𝐝","𝐞","𝐟","𝐠","𝐡","𝐢","𝐣","𝐤","𝐥","𝐦","𝐧","𝐨","𝐩","𝐪","𝐫","𝐬","𝐭","𝐮","𝐯","𝐰","𝐱","𝐲","𝐳","𝓐","𝓑","𝓒","𝓓","𝓔","𝓕","𝓖","𝓗","𝓘","𝓙","𝓚","𝓛","𝓜","𝓝","𝓞","𝓟","𝓠","𝓡","𝓢","𝓣","𝓤","𝓥","𝓦","𝓧","𝓨","𝓩","𝓪","𝓫","𝓬","𝓭","𝓮","𝓯","𝓰","𝓱","𝓲","𝓳","𝓴","𝓵","𝓶","𝓷","𝓸","𝓹","𝓺","𝓻","𝓼","𝓽","𝓾","𝓿","𝔀","𝔁","𝔂","𝔃"]},{key:"number",label:"序号",children:["①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩","⑪","⑫","⑬","⑭","⑮","⑯","⑰","⑱","⑲","⑳","⑴","⑵","⑶","⑷","⑸","⑹","⑺","⑻","⑼","⑽","⑾","⑿","⒀","⒁","⒂","⒃","⒄","⒅","⒆","⒇","º","¹","²","³","⁴","⁵","⁶","⁷","⁸","⁹","₀","₁","₂","₃","₄","₅","₆","₇","₈","₉","Ⅰ","Ⅱ","Ⅲ","Ⅳ","Ⅴ","Ⅵ","Ⅶ","Ⅷ","Ⅸ","Ⅹ","Ⅺ","Ⅻ","Ⅼ","Ⅽ","Ⅾ","Ⅿ","ⅰ","ⅱ","ⅲ","ⅳ","ⅴ","ⅵ","ⅶ","ⅷ","ⅸ","ⅹ","ⅺ","ⅻ","ⅼ","ⅽ","ⅾ","ⅿ","ↀ","ↁ","ↂ","㊀","㊁","㊂","㊃","㊄","㊅","㊆","㊇","㊈","㊉","㈠","㈡","㈢","㈣","㈤","㈥","㈦","㈧","㈨","㈩","𝟘","𝟙","𝟚","𝟛","𝟜","𝟝","𝟞","𝟟","𝟠","𝟡"]},{key:"math",label:"数学",children:["+","-","×","÷","=","~","¬","±","%","°","ǃ","‰","‱","½","⅓","⅔","¼","¾","<",">","l","o","g","l","g","l","n","⨂","⨁","⨄","⨃","⨅","⨆","√","∛","∜","∝","∞","∟","∠","∡","∢","∧","∨","∩","∪","∫","∬","∭","∮","∯","∰","∱","∲","∳","∴","∵","∼","∽","∾","∿","≃","≄","≅","≆","≇","≈","≊","≋","≌","≍","≎","≏","≐","≑","≒","≓","≔","≕","≤","≥","≦","≧","≨","≩","≪","≫","≺","≻","≼","≽","≾","≿","⊀","⊁","⊂","⊃","⊄","⊅","⊆","⊇","⊈","⊉","⊊","⊋","⊏","⊐","⊑","⊒","⊓","⊔","⊢","⊣","⊤","⊥","⊦","⊧","⊨","⊩","⊪","⊫","⊬","⊭","⊮","⊯","⊲","⊳","⊴","⊵","⋀","⋁","⋂","⋃","⋉","⋊","⋋","⋌","⟨","⟩","⟪","⟫","⟮","⟯","⧼","⧽","⦰"]},{key:"arrow",label:"箭头",children:["←","↑","→","↓","↔","↕","↖","↗","↘","↙","↚","↛","↜","↝","↞","↟","↠","↡","↢","↣","↤","↥","↦","↧","↨","↫","↬","↭","↮","↯","↰","↱","↲","↳","↴","↵","↶","↷","↸","↹","↺","↻","↼","↽","↾","↿","⇀","⇁","⇂","⇃","⇄","⇅","⇆","⇇","⇈","⇉","⇊","⇋","⇌","⇍","⇎","⇏","⇐","⇑","⇒","⇓","⇔","⇕","⇖","⇗","⇘","⇙","⇚","⇛","⇜","⇝","⇞","⇟","⇠","⇡","⇢","⇣","⇤","⇥","⇦","⇧","⇨","⇩","⇪","⇫","⇬","⇭","⇮","⇯","⇰","⇱","⇲","⇳","⇴","⇵","⇶","⇷","⇸","⇹","⇺","⇻","⇼","⇽","⇾","⇿"]},{key:"graph",label:"图形",children:["▢","▣","▤","▥","▦","▧","▨","▩","▭","▮","▯","▰","▱","▲","▷","▼","◁","◈","◉","◍","◐","◑","◒","◓","◔","◕","◧","◨","◩","◪","◫","◬","◭","◮"]}],FYe={class:"symbol-panel"},EYe={class:"pool"},XYe=["onClick"],WYe={class:"symbol"},VYe=Ee({__name:"SymbolPanel",setup(e){const t=ge(_8[0].key),n=we(()=>{const o=_8.find(a=>a.key===t.value);return(o==null?void 0:o.children)||[]}),r=_8.map(o=>({key:o.key,label:o.label})),i=o=>{Bi.emit(Si.RICH_TEXT_COMMAND,{action:{command:"insert",value:o}})};return(o,a)=>(U(),ne("div",FYe,[_(ol,{tabs:z(r),value:t.value,"onUpdate:value":a[0]||(a[0]=s=>t.value=s),tabsStyle:{marginBottom:"8px"},spaceBetween:""},null,8,["tabs","value"]),V("div",EYe,[(U(!0),ne(Ve,null,rt(n.value,(s,l)=>(U(),ne("div",{class:"symbol-item",key:l,onClick:u=>i(s)},[V("div",WYe,pt(s),1)],8,XYe))),128))])]))}}),DYe=Ue(VYe,[["__scopeId","data-v-0f662bb0"]]),UYe={class:"toolbar"},BYe={class:"content"},YYe=Ee({__name:"index",setup(e){const t=dt(),{activeElementIdList:n,handleElement:r,toolbarState:i}=We(t),o=we(()=>{var f;return((f=r.value)==null?void 0:f.type)==="text"?[{label:"样式",key:zr.EL_STYLE},{label:"符号",key:zr.SYMBOL},{label:"位置",key:zr.EL_POSITION},{label:"动画",key:zr.EL_ANIMATION}]:[{label:"样式",key:zr.EL_STYLE},{label:"位置",key:zr.EL_POSITION},{label:"动画",key:zr.EL_ANIMATION}]}),a=[{label:"设计",key:zr.SLIDE_DESIGN},{label:"切换",key:zr.SLIDE_ANIMATION},{label:"动画",key:zr.EL_ANIMATION}],s=[{label:"样式",key:zr.EL_STYLE},{label:"位置",key:zr.MULTI_POSITION}],l=f=>{t.setToolbarState(f)},u=we(()=>{if(n.value.length){if(n.value.length>1)return s}else return a;return o.value});_t(u,()=>{const f=u.value.map(d=>d.key);f.includes(i.value)||t.setToolbarState(f[0])});const c=we(()=>({[zr.EL_STYLE]:bUe,[zr.EL_POSITION]:CUe,[zr.EL_ANIMATION]:jUe,[zr.SLIDE_DESIGN]:SYe,[zr.SLIDE_ANIMATION]:OYe,[zr.MULTI_POSITION]:IYe,[zr.SYMBOL]:DYe})[i.value]||null);return(f,d)=>(U(),ne("div",UYe,[_(ol,{tabs:u.value,value:z(i),card:"","onUpdate:value":d[0]||(d[0]=h=>l(h))},null,8,["tabs","value"]),V("div",BYe,[(U(),_e(uu(c.value)))])]))}}),ZYe=Ue(YYe,[["__scopeId","data-v-83fff59a"]]),QYe={class:"editor"},HYe=Ee({__name:"Editor",props:{value:{}},emits:["update"],setup(e,{expose:t,emit:n}){const r=e,i=n,o=dt(),a=ge();let s;const l=ge(),u=ge(),c=ge(),f=()=>{u.value&&u.value.hide()},d=Un.debounce(function(){i("update",s.dom.innerHTML)},300,{trailing:!0}),h=()=>{o.setDisableHotkeysState(!0)},p=()=>{o.setDisableHotkeysState(!1)};t({updateTextContent:()=>{if(!s)return;const{doc:y,tr:R}=s.state;s.dispatch(R.replaceRangeWith(0,y.content.size,XO(r.value)))}});const g=()=>{const y=window.getSelection();if(!y||!y.anchorNode||!y.focusNode||y.isCollapsed||y.type==="Caret"||y.type==="None")return;const R=y.getRangeAt(0);if(u.value){l.value=l6(s);const{x:A,y:x,left:S,top:T}=R.getBoundingClientRect();u.value.setProps({getReferenceClientRect:()=>({x:A,y:x,left:S,top:T,height:0,width:0,right:S,bottom:T})}),u.value.show()}},m=(y,R)=>{if(y==="color"&&R){const A=s.state.schema.marks.forecolor.create({color:R});ui(s),Tl(s,A)}else if(y==="backcolor"&&R){const A=s.state.schema.marks.backcolor.create({backcolor:R});ui(s),Tl(s,A)}else if(y==="bold")ui(s),ni(s.state.schema.marks.strong)(s.state,s.dispatch);else if(y==="em")ui(s),ni(s.state.schema.marks.em)(s.state,s.dispatch);else if(y==="underline")ui(s),ni(s.state.schema.marks.underline)(s.state,s.dispatch);else if(y==="strikethrough")ui(s),ni(s.state.schema.marks.strikethrough)(s.state,s.dispatch);else if(y==="bulletList"){const{bullet_list:A,list_item:x}=s.state.schema.nodes;hx(A,x,"")(s.state,s.dispatch)}else if(y==="orderedList"){const{ordered_list:A,list_item:x}=s.state.schema.nodes;hx(A,x,"")(s.state,s.dispatch)}else if(y==="clear"){ui(s);const{$from:A,$to:x}=s.state.selection;s.dispatch(s.state.tr.removeMark(A.pos,x.pos))}s.focus(),d(),l.value=l6(s)};return jt(()=>{s=SG(a.value,r.value,{handleDOMEvents:{focus:h,blur:p,mouseup:g,mousedown:()=>{var y;(y=window.getSelection())==null||y.removeAllRanges(),f()},keydown:f,input:d}},{placeholder:"点击输入演讲者备注"}),u.value=jh(a.value,{duration:0,content:c.value,interactive:!0,trigger:"manual",placement:"top-start",hideOnClick:"toggle",offset:[0,6]})}),Fn(()=>{s&&s.destroy()}),(y,R)=>{var C,I,N,W,D,Z;const A=Se("IconTextBold"),x=Se("IconTextItalic"),S=Se("IconTextUnderline"),T=Se("IconStrikethrough"),w=Se("IconText"),M=Se("IconHighLight"),O=Se("IconList"),P=Se("IconOrderedList"),k=Se("IconFormat"),F=Cn("click-outside");return Ge((U(),ne("div",QYe,[V("div",{class:"prosemirror-editor",ref_key:"editorViewRef",ref:a},null,512),V("div",{class:"menu",ref_key:"menuRef",ref:c},[V("button",{class:$e({active:(C=l.value)==null?void 0:C.bold}),onClick:R[0]||(R[0]=re=>m("bold"))},[_(A)],2),V("button",{class:$e({active:(I=l.value)==null?void 0:I.em}),onClick:R[1]||(R[1]=re=>m("em"))},[_(x)],2),V("button",{class:$e({active:(N=l.value)==null?void 0:N.underline}),onClick:R[2]||(R[2]=re=>m("underline"))},[_(S)],2),V("button",{class:$e({active:(W=l.value)==null?void 0:W.strikethrough}),onClick:R[3]||(R[3]=re=>m("strikethrough"))},[_(T)],2),_(It,{trigger:"click",style:{width:"30%"}},{content:se(()=>{var re;return[_($n,{modelValue:(re=l.value)==null?void 0:re.color,"onUpdate:modelValue":R[4]||(R[4]=B=>m("color",B))},null,8,["modelValue"])]}),default:se(()=>[V("button",null,[_(w)])]),_:1}),_(It,{trigger:"click",style:{width:"30%"}},{content:se(()=>{var re;return[_($n,{modelValue:(re=l.value)==null?void 0:re.backcolor,"onUpdate:modelValue":R[5]||(R[5]=B=>m("backcolor",B))},null,8,["modelValue"])]}),default:se(()=>[V("button",null,[_(M)])]),_:1}),V("button",{class:$e({active:(D=l.value)==null?void 0:D.bulletList}),onClick:R[6]||(R[6]=re=>m("bulletList"))},[_(O)],2),V("button",{class:$e({active:(Z=l.value)==null?void 0:Z.orderedList}),onClick:R[7]||(R[7]=re=>m("orderedList"))},[_(P)],2),V("button",{onClick:R[8]||(R[8]=re=>m("clear"))},[_(k)])],512)])),[[F,f]])}}}),KYe=Ue(HYe,[["__scopeId","data-v-4042a280"]]),GYe={class:"remark"},zYe=Ee({__name:"index",props:{height:{}},emits:["update:height"],setup(e,{emit:t}){const n=e,r=t,i=lt(),{currentSlide:o}=We(i),a=ge();_t(()=>o.value.id,()=>{Qr(()=>{a.value.updateTextContent()})},{immediate:!0});const s=we(()=>{var c;return((c=o.value)==null?void 0:c.remark)||""}),l=c=>{i.updateSlide({remark:c})},u=c=>{let f=!0;const d=c.pageY,h=n.height;document.onmousemove=p=>{if(!f)return;let m=-(p.pageY-d)+h;m<40&&(m=40),m>360&&(m=360),r("update:height",m)},document.onmouseup=()=>{f=!1,document.onmousemove=null,document.onmouseup=null}};return(c,f)=>(U(),ne("div",GYe,[V("div",{class:"resize-handler",onMousedown:f[0]||(f[0]=d=>u(d))},null,32),_(KYe,{value:s.value,ref_key:"editorRef",ref:a,onUpdate:f[1]||(f[1]=d=>l(d))},null,8,["value"])]))}}),JYe=Ue(zYe,[["__scopeId","data-v-1c52a472"]]);var Xq={exports:{}};(function(e,t){(function(n,r){r()})(Ft,function(){function n(u,c){return typeof c>"u"?c={autoBom:!1}:typeof c!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),c={autoBom:!c}),c.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(u.type)?new Blob(["\uFEFF",u],{type:u.type}):u}function r(u,c,f){var d=new XMLHttpRequest;d.open("GET",u),d.responseType="blob",d.onload=function(){l(d.response,c,f)},d.onerror=function(){console.error("could not download file")},d.send()}function i(u){var c=new XMLHttpRequest;c.open("HEAD",u,!1);try{c.send()}catch{}return 200<=c.status&&299>=c.status}function o(u){try{u.dispatchEvent(new MouseEvent("click"))}catch{var c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),u.dispatchEvent(c)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Ft=="object"&&Ft.global===Ft?Ft:void 0,s=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(u,c,f){var d=a.URL||a.webkitURL,h=document.createElement("a");c=c||u.name||"download",h.download=c,h.rel="noopener",typeof u=="string"?(h.href=u,h.origin===location.origin?o(h):i(h.href)?r(u,c,f):o(h,h.target="_blank")):(h.href=d.createObjectURL(u),setTimeout(function(){d.revokeObjectURL(h.href)},4e4),setTimeout(function(){o(h)},0))}:"msSaveOrOpenBlob"in navigator?function(u,c,f){if(c=c||u.name||"download",typeof u!="string")navigator.msSaveOrOpenBlob(n(u,f),c);else if(i(u))r(u,c,f);else{var d=document.createElement("a");d.href=u,d.target="_blank",setTimeout(function(){o(d)})}}:function(u,c,f,d){if(d=d||open("","_blank"),d&&(d.document.title=d.document.body.innerText="downloading..."),typeof u=="string")return r(u,c,f);var h=u.type==="application/octet-stream",p=/constructor/i.test(a.HTMLElement)||a.safari,v=/CriOS\/[\d]+/.test(navigator.userAgent);if((v||h&&p||s)&&typeof FileReader<"u"){var g=new FileReader;g.onloadend=function(){var R=g.result;R=v?R:R.replace(/^data:[^;]*;/,"data:attachment/file;"),d?d.location.href=R:location=R,d=null},g.readAsDataURL(u)}else{var m=a.URL||a.webkitURL,y=m.createObjectURL(u);d?d.location=y:location.href=y,d=null,setTimeout(function(){m.revokeObjectURL(y)},4e4)}});a.saveAs=l.saveAs=l,e.exports=l})})(Xq);var O8=Xq.exports,Wq={exports:{}};/*! +`)}async function bEe(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await REe(e,t);if(n){const r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function xEe(e,t={}){const{width:n,height:r}=Aq(e,t),i=await S3(e,t,!0);return await bEe(i,t),await wq(i,t),gEe(i,t),await DFe(i,n,r)}async function tP(e,t={}){const{width:n,height:r}=Aq(e,t),i=await xEe(e,t),o=await Gx(i),a=document.createElement("canvas"),s=a.getContext("2d"),l=t.pixelRatio||XFe(),u=t.canvasWidth||n,c=t.canvasHeight||r;return a.width=u*l,a.height=c*l,t.skipAutoScale||WFe(a),a.style.width=`${u}`,a.style.height=`${c}`,t.backgroundColor&&(s.fillStyle=t.backgroundColor,s.fillRect(0,0,a.width,a.height)),s.drawImage(o,0,0,a.width,a.height),a}async function SEe(e,t={}){return(await tP(e,t)).toDataURL()}async function wEe(e,t={}){return(await tP(e,t)).toDataURL("image/jpeg",t.quality||1)}const MEe=Ee({__name:"Checkboard",props:{size:{default:8},white:{default:"#fff"},grey:{default:"#e6e6e6"}},setup(e){const t=e,n={},r=(a,s,l)=>{const u=document.createElement("canvas");u.width=u.height=l*2;const c=u.getContext("2d");return c?(c.fillStyle=a,c.fillRect(0,0,u.width,u.height),c.fillStyle=s,c.fillRect(0,0,l,l),c.translate(l,l),c.fillRect(0,0,l,l),u.toDataURL()):null},i=(a,s,l)=>{const u=a+","+s+","+l;if(n[u])return n[u];const c=r(a,s,l);return n[u]=c,c},o=we(()=>({backgroundImage:`url(${i(t.white,t.grey,t.size)})`}));return(a,s)=>(U(),ne("div",{class:"checkerboard",style:Le(o.value)},null,4))}}),UT=Ue(MEe,[["__scopeId","data-v-46275348"]]),LEe=e=>(rn("data-v-429f62d3"),e=e(),on(),e),TEe={class:"alpha"},_Ee={class:"alpha-checkboard-wrap"},OEe=LEe(()=>V("div",{class:"alpha-picker"},null,-1)),kEe=[OEe],PEe=Ee({__name:"Alpha",props:{value:{}},emits:["colorChange"],setup(e,{emit:t}){const n=e,r=t,i=we(()=>n.value),o=we(()=>{const c=[i.value.r,i.value.g,i.value.b].join(",");return`linear-gradient(to right, rgba(${c}, 0) 0%, rgba(${c}, 1) 100%)`}),a=ge(),s=c=>{if(c.preventDefault(),!a.value)return;const f=a.value.clientWidth,d=a.value.getBoundingClientRect().left+window.pageXOffset,h=c.pageX-d;let p;h<0?p=0:h>f?p=1:p=Math.round(h*100/f)/100,i.value.a!==p&&r("colorChange",{r:i.value.r,g:i.value.g,b:i.value.b,a:p})},l=()=>{window.removeEventListener("mousemove",s),window.removeEventListener("mouseup",l)},u=c=>{s(c),window.addEventListener("mousemove",s),window.addEventListener("mouseup",l)};return Fn(l),(c,f)=>(U(),ne("div",TEe,[V("div",_Ee,[_(UT)]),V("div",{class:"alpha-gradient",style:Le({background:o.value})},null,4),V("div",{class:"alpha-container",ref_key:"alphaRef",ref:a,onMousedown:f[0]||(f[0]=d=>u(d))},[V("div",{class:"alpha-pointer",style:Le({left:i.value.a*100+"%"})},kEe,4)],544)]))}}),CEe=Ue(PEe,[["__scopeId","data-v-429f62d3"]]),NEe=e=>(rn("data-v-21ccc370"),e=e(),on(),e),IEe={class:"hue"},FEe=NEe(()=>V("div",{class:"hue-picker"},null,-1)),EEe=[FEe],XEe=Ee({__name:"Hue",props:{value:{},hue:{}},emits:["colorChange"],setup(e,{emit:t}){const n=e,r=t,i=ge(0),o=ge(""),a=we(()=>{const d=ot(n.value).toHsl();return n.hue!==-1&&(d.h=n.hue),d}),s=we(()=>a.value.h===0&&o.value==="right"?"100%":a.value.h*100/360+"%");_t(()=>n.value,()=>{const d=ot(n.value).toHsl(),h=d.s===0?n.hue:d.h;h!==0&&h-i.value>0&&(o.value="right"),h!==0&&h-i.value<0&&(o.value="left"),i.value=h});const l=ge(),u=d=>{if(d.preventDefault(),!l.value)return;const h=l.value.clientWidth,p=l.value.getBoundingClientRect().left+window.pageXOffset,v=d.pageX-p;let g,m;v<0?g=0:v>h?g=360:(m=v*100/h,g=360*m/100),(n.hue===-1||a.value.h!==g)&&r("colorChange",{h:g,l:a.value.l,s:a.value.s,a:a.value.a})},c=()=>{window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",c)},f=d=>{u(d),window.addEventListener("mousemove",u),window.addEventListener("mouseup",c)};return Fn(c),(d,h)=>(U(),ne("div",IEe,[V("div",{class:"hue-container",ref_key:"hueRef",ref:l,onMousedown:h[0]||(h[0]=p=>f(p))},[V("div",{class:"hue-pointer",style:Le({left:s.value})},EEe,4)],544)]))}}),WEe=Ue(XEe,[["__scopeId","data-v-21ccc370"]]),nP=e=>(rn("data-v-1a7711ae"),e=e(),on(),e),VEe=nP(()=>V("div",{class:"saturation-white"},null,-1)),DEe=nP(()=>V("div",{class:"saturation-black"},null,-1)),UEe=nP(()=>V("div",{class:"saturation-circle"},null,-1)),BEe=[UEe],YEe=Ee({__name:"Saturation",props:{value:{},hue:{}},emits:["colorChange"],setup(e,{emit:t}){const n=e,r=t,i=we(()=>{const h=ot(n.value).toHsv();return n.hue!==-1&&(h.h=n.hue),h}),o=we(()=>`hsl(${i.value.h}, 100%, 50%)`),a=we(()=>-(i.value.v*100)+1+100+"%"),s=we(()=>i.value.s*100+"%"),l=Un.throttle(function(h){r("colorChange",h)},20,{leading:!0,trailing:!1}),u=ge(),c=h=>{if(h.preventDefault(),!u.value)return;const p=u.value.clientWidth,v=u.value.clientHeight,g=u.value.getBoundingClientRect().left+window.pageXOffset,m=u.value.getBoundingClientRect().top+window.pageYOffset,y=Un.clamp(h.pageX-g,0,p),R=Un.clamp(h.pageY-m,0,v),A=y/p,x=Un.clamp(-(R/v)+1,0,1);l({h:i.value.h,s:A,v:x,a:i.value.a})},f=()=>{window.removeEventListener("mousemove",c),window.removeEventListener("mouseup",f)},d=h=>{c(h),window.addEventListener("mousemove",c),window.addEventListener("mouseup",f)};return Fn(f),(h,p)=>(U(),ne("div",{class:"saturation",ref_key:"saturationRef",ref:u,style:Le({background:o.value}),onMousedown:p[0]||(p[0]=v=>d(v))},[VEe,DEe,V("div",{class:"saturation-pointer",style:Le({top:a.value,left:s.value})},BEe,4)],36))}}),ZEe=Ue(YEe,[["__scopeId","data-v-1a7711ae"]]),QEe={class:"editable-input"},HEe=["value"],KEe=Ee({__name:"EditableInput",props:{value:{}},emits:["colorChange"],setup(e,{emit:t}){const n=e,r=t,i=we(()=>{let a="";return n.value.a<1?a=ot(n.value).toHex8String().toUpperCase():a=ot(n.value).toHexString().toUpperCase(),a.replace("#","")}),o=a=>{const s=a.target.value;if(s.length>=6){const l=ot(s);l.isValid()&&r("colorChange",l.toRgb())}};return(a,s)=>(U(),ne("div",QEe,[V("input",{class:"input-content",value:i.value,onInput:s[0]||(s[0]=l=>o(l))},null,40,HEe)]))}}),GEe=Ue(KEe,[["__scopeId","data-v-573b4dde"]]),zEe={class:"color-picker"},JEe={class:"picker-saturation-wrap"},$Ee={class:"picker-controls"},jEe={class:"picker-color-wrap"},qEe={class:"picker-sliders"},eXe={class:"picker-hue-wrap"},tXe={class:"picker-alpha-wrap"},nXe={class:"picker-field"},rXe={class:"picker-presets"},iXe=["onClick"],oXe={class:"picker-gradient-presets"},aXe=["onClick"],sXe={class:"picker-presets"},lXe=["onClick"],uXe={key:0,class:"recent-colors-title"},cXe={class:"picker-presets"},fXe=["onClick"],qD="RECENT_COLORS",dXe=Ee({__name:"index",props:{modelValue:{default:"#e86b99"}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,i=[["#7f7f7f","#f2f2f2"],["#0d0d0d","#808080"],["#1c1a10","#ddd8c3"],["#0e243d","#c6d9f0"],["#233f5e","#dae5f0"],["#632623","#f2dbdb"],["#4d602c","#eaf1de"],["#3f3150","#e6e0ec"],["#1e5867","#d9eef3"],["#99490f","#fee9da"]],o=(A,x,S)=>{const T=ot(A).toRgb(),w=ot(x).toRgb(),M=(w.r-T.r)/S,O=(w.g-T.g)/S,P=(w.b-T.b)/S,k=[];for(let F=0;F{const A=[];for(const x of i)A.push(o(x[1],x[0],5));return A},s=["#000000","#ffffff","#eeece1","#1e497b","#4e81bb","#e2534d","#9aba60","#8165a0","#47acc5","#f9974c"],l=["#c21401","#ff1e02","#ffc12a","#ffff3a","#90cf5b","#00af57","#00afee","#0071be","#00215f","#72349d"],u=ge(-1),c=ge([]),f=we({get(){return ot(n.modelValue).toRgb()},set(A){const x=`rgba(${[A.r,A.g,A.b,A.a].join(",")})`;r("update:modelValue",x)}}),d=a(),h=we(()=>`rgba(${[f.value.r,f.value.g,f.value.b,f.value.a].join(",")})`),p=A=>{u.value=ot(A).toHsl().h,r("update:modelValue",A)},v=Un.debounce(function(){const A=ot(f.value).toRgbString();if(!c.value.includes(A)){c.value=[A,...c.value];const x=10;c.value.length>x&&(c.value=c.value.slice(0,x))}},300,{trailing:!0});jt(()=>{const A=localStorage.getItem(qD);A&&(c.value=JSON.parse(A))}),_t(c,()=>{const A=JSON.stringify(c.value);localStorage.setItem(qD,A)});const g=A=>{"h"in A?(u.value=A.h,f.value=ot(A).toRgb()):(u.value=ot(A).toHsl().h,f.value=A),v()},m=()=>{"EyeDropper"in window?y():R()},y=()=>{Tn.success("按 ESC 键关闭取色吸管",{duration:0}),new window.EyeDropper().open().then(x=>{const S=ot(x.sRGBHex);u.value=S.toHsl().h,f.value=S.toRgb(),Tn.closeAll(),v()}).catch(()=>{Tn.closeAll()})},R=()=>{const A=document.querySelector(".canvas");if(!A)return;const x=document.createElement("div");x.style.cssText="position: fixed; top: 0; left: 0; bottom: 0; right: 0; z-index: 9999; cursor: wait;",document.body.appendChild(x);const S=document.createElement("div");S.style.cssText="position: absolute; top: -100px; left: -100px; width: 16px; height: 16px; border: 1px solid #000; z-index: 999",x.appendChild(S);const{left:T,top:w,width:M,height:O}=A.getBoundingClientRect();tP(A,{filter:k=>!(k.tagName&&k.tagName.toUpperCase()==="FOREIGNOBJECT"||k.classList&&k.classList.contains("operate")),fontEmbedCSS:"",width:M,height:O,canvasWidth:M,canvasHeight:O,pixelRatio:1}).then(k=>{k.style.cssText=`position: absolute; top: ${w}px; left: ${T}px; cursor: crosshair;`,x.style.cursor="default",x.appendChild(k);const F=k.getContext("2d");if(!F)return;let C="";const I=D=>{const Z=D.x,re=D.y,B=Z-T,Y=re-w,[K,G,ee,q]=F.getImageData(B,Y,1,1).data;C=`rgba(${K}, ${G}, ${ee}, ${(q/255).toFixed(2)})`,S.style.left=Z+10+"px",S.style.top=re+10+"px",S.style.backgroundColor=C},N=()=>{C="",S.style.left="-100px",S.style.top="-100px",S.style.backgroundColor=""},W=D=>{if(C&&D.button===0){const Z=ot(C);u.value=Z.toHsl().h,f.value=Z.toRgb(),v()}document.body.removeChild(x),k.removeEventListener("mousemove",I),k.removeEventListener("mouseleave",N),window.removeEventListener("mousedown",W)};k.addEventListener("mousemove",I),k.addEventListener("mouseleave",N),window.addEventListener("mousedown",W)}).catch(()=>{Tn.error("取色吸管初始化失败"),document.body.removeChild(x)})};return(A,x)=>{const S=Se("IconNeedle");return U(),ne("div",zEe,[V("div",JEe,[_(ZEe,{value:f.value,hue:u.value,onColorChange:x[0]||(x[0]=T=>g(T))},null,8,["value","hue"])]),V("div",$Ee,[V("div",jEe,[V("div",{class:"picker-current-color",style:Le({background:h.value})},null,4),_(UT)]),V("div",qEe,[V("div",eXe,[_(WEe,{value:f.value,hue:u.value,onColorChange:x[1]||(x[1]=T=>g(T))},null,8,["value","hue"])]),V("div",tXe,[_(CEe,{value:f.value,onColorChange:x[2]||(x[2]=T=>g(T))},null,8,["value"])])])]),V("div",nXe,[_(GEe,{class:"input",value:f.value,onColorChange:x[3]||(x[3]=T=>g(T))},null,8,["value"]),V("div",{class:"straw",onClick:x[4]||(x[4]=T=>m())},[_(S)]),V("div",{class:"transparent",onClick:x[5]||(x[5]=T=>p("#00000000"))},[_(UT)])]),V("div",rXe,[(U(),ne(Ve,null,rt(s,T=>V("div",{class:"picker-presets-color",key:T,style:Le({background:T}),onClick:w=>p(T)},null,12,iXe)),64))]),V("div",oXe,[(U(!0),ne(Ve,null,rt(z(d),(T,w)=>(U(),ne("div",{class:"picker-gradient-col",key:w},[(U(!0),ne(Ve,null,rt(T,M=>(U(),ne("div",{class:"picker-gradient-color",key:M,style:Le({background:M}),onClick:O=>p(M)},null,12,aXe))),128))]))),128))]),V("div",sXe,[(U(),ne(Ve,null,rt(l,T=>V("div",{key:T,class:"picker-presets-color",style:Le({background:T}),onClick:w=>p(T)},null,12,lXe)),64))]),c.value.length?(U(),ne("div",uXe,"最近使用:")):Ze("",!0),V("div",cXe,[(U(!0),ne(Ve,null,rt(c.value,T=>(U(),ne("div",{key:T,class:"picker-presets-color alpha",onClick:w=>p(T)},[V("div",{class:"picker-presets-color-content",style:Le({background:T})},null,4)],8,fXe))),128))])])}}}),$n=Ue(dXe,[["__scopeId","data-v-58b37f0f"]]),hXe=e=>(rn("data-v-a0d44a99"),e=e(),on(),e),pXe=hXe(()=>V("span",{class:"switch-core"},null,-1)),vXe=[pXe],gXe=Ee({__name:"Switch",props:{value:{type:Boolean},disabled:{type:Boolean,default:!1}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,i=()=>{n.disabled||r("update:value",!n.value)};return(o,a)=>(U(),ne("span",{class:$e(["switch",{active:o.value,disabled:o.disabled}]),onClick:a[0]||(a[0]=s=>i())},vXe,2))}}),ws=Ue(gXe,[["__scopeId","data-v-a0d44a99"]]),w3=e=>(rn("data-v-3e3db022"),e=e(),on(),e),mXe={class:"element-outline"},yXe={key:0,class:"row"},AXe=w3(()=>V("div",{style:{width:"40%"}},"启用边框:",-1)),RXe={class:"switch-wrapper",style:{width:"60%"}},bXe={class:"row"},xXe=w3(()=>V("div",{style:{width:"40%"}},"边框样式:",-1)),SXe={class:"row"},wXe=w3(()=>V("div",{style:{width:"40%"}},"边框颜色:",-1)),MXe={class:"row"},LXe=w3(()=>V("div",{style:{width:"40%"}},"边框粗细:",-1)),TXe=Ee({__name:"ElementOutline",props:{fixed:{type:Boolean,default:!1}},setup(e){const t=lt(),{theme:n}=We(t),{handleElement:r}=We(dt()),i=ge(),o=ge(!1);_t(r,()=>{r.value&&(i.value="outline"in r.value?r.value.outline:void 0,o.value=!!i.value)},{deep:!0,immediate:!0});const{addHistorySnapshot:a}=qt(),s=u=>{if(!r.value)return;const c={outline:{...i.value,...u}};t.updateElement({id:r.value.id,props:c}),a()},l=u=>{if(r.value){if(u){const c=n.value.outline;t.updateElement({id:r.value.id,props:{outline:c}})}else t.removeElementProps({id:r.value.id,propName:"outline"});a()}};return(u,c)=>(U(),ne("div",mXe,[u.fixed?Ze("",!0):(U(),ne("div",yXe,[AXe,V("div",RXe,[_(ws,{value:o.value,"onUpdate:value":c[0]||(c[0]=f=>l(f))},null,8,["value"])])])),o.value&&i.value?(U(),ne(Ve,{key:1},[V("div",bXe,[xXe,_(Ar,{style:{width:"60%"},value:i.value.style||"","onUpdate:value":c[1]||(c[1]=f=>s({style:f})),options:[{label:"实线边框",value:"solid"},{label:"虚线边框",value:"dashed"},{label:"点线边框",value:"dotted"}]},null,8,["value"])]),V("div",SXe,[wXe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:i.value.color,"onUpdate:modelValue":c[2]||(c[2]=f=>s({color:f}))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:i.value.color||"#000"},null,8,["color"])]),_:1})]),V("div",MXe,[LXe,_(Ko,{value:i.value.width||0,"onUpdate:value":c[3]||(c[3]=f=>s({width:f})),style:{width:"60%"}},null,8,["value"])])],64)):Ze("",!0)]))}}),K2=Ue(TXe,[["__scopeId","data-v-3e3db022"]]),G2=e=>(rn("data-v-671988a4"),e=e(),on(),e),_Xe={class:"element-shadow"},OXe={class:"row"},kXe=G2(()=>V("div",{style:{width:"40%"}},"启用阴影:",-1)),PXe={class:"switch-wrapper",style:{width:"60%"}},CXe={class:"row"},NXe=G2(()=>V("div",{style:{width:"40%"}},"水平阴影:",-1)),IXe={class:"row"},FXe=G2(()=>V("div",{style:{width:"40%"}},"垂直阴影:",-1)),EXe={class:"row"},XXe=G2(()=>V("div",{style:{width:"40%"}},"模糊距离:",-1)),WXe={class:"row"},VXe=G2(()=>V("div",{style:{width:"40%"}},"阴影颜色:",-1)),DXe=Ee({__name:"ElementShadow",setup(e){const t=lt(),{theme:n}=We(t),{handleElement:r}=We(dt()),i=ge(),o=ge(!1);_t(r,()=>{r.value&&(i.value="shadow"in r.value?r.value.shadow:void 0,o.value=!!i.value)},{deep:!0,immediate:!0});const{addHistorySnapshot:a}=qt(),s=u=>{if(!r.value||!i.value)return;const c={...i.value,...u};t.updateElement({id:r.value.id,props:{shadow:c}}),a()},l=u=>{if(r.value){if(u){const c=n.value.shadow;t.updateElement({id:r.value.id,props:{shadow:c}})}else t.removeElementProps({id:r.value.id,propName:"shadow"});a()}};return(u,c)=>(U(),ne("div",_Xe,[V("div",OXe,[kXe,V("div",PXe,[_(ws,{value:o.value,"onUpdate:value":c[0]||(c[0]=f=>l(f))},null,8,["value"])])]),o.value&&i.value?(U(),ne(Ve,{key:0},[V("div",CXe,[NXe,_(Yi,{style:{width:"60%"},min:-10,max:10,step:1,value:i.value.h,"onUpdate:value":c[1]||(c[1]=f=>s({h:f}))},null,8,["value"])]),V("div",IXe,[FXe,_(Yi,{style:{width:"60%"},min:-10,max:10,step:1,value:i.value.v,"onUpdate:value":c[2]||(c[2]=f=>s({v:f}))},null,8,["value"])]),V("div",EXe,[XXe,_(Yi,{style:{width:"60%"},min:1,max:20,step:1,value:i.value.blur,"onUpdate:value":c[3]||(c[3]=f=>s({blur:f}))},null,8,["value"])]),V("div",WXe,[VXe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:i.value.color,"onUpdate:modelValue":c[4]||(c[4]=f=>s({color:f}))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:i.value.color},null,8,["color"])]),_:1})])],64)):Ze("",!0)]))}}),M3=Ue(DXe,[["__scopeId","data-v-671988a4"]]),UXe=()=>{const e=dt(),{richTextAttrs:t,textFormatPainter:n}=We(e);return{toggleTextFormatPainter:(i=!1)=>{n.value?e.setTextFormatPainter(null):e.setTextFormatPainter({keep:i,bold:t.value.bold,em:t.value.em,underline:t.value.underline,strikethrough:t.value.strikethrough,color:t.value.color,backcolor:t.value.backcolor,fontname:t.value.fontname,fontsize:t.value.fontsize,align:t.value.align})}}},BXe={class:"text-color-block"},YXe=Ee({__name:"TextColorButton",props:{color:{}},setup(e){return(t,n)=>(U(),_e(qe,{class:"text-color-btn"},{default:se(()=>[kr(t.$slots,"default",{},void 0,!0),V("div",BXe,[V("div",{class:"text-color-block-content",style:Le({backgroundColor:t.color})},null,4)])]),_:3}))}}),yv=Ue(YXe,[["__scopeId","data-v-97cd463a"]]),Ur=Ee({__name:"CheckboxButton",props:{checked:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(e){return(t,n)=>(U(),_e(qe,{checked:t.checked,disabled:t.disabled,type:"checkbox"},{default:se(()=>[kr(t.$slots,"default")]),_:3},8,["checked","disabled"]))}}),ZXe=Ee({__name:"ButtonGroup",props:{passive:{type:Boolean,default:!1}},setup(e){return(t,n)=>(U(),ne("div",{class:$e(["button-group",{passive:t.passive}]),ref:"groupRef"},[kr(t.$slots,"default",{},void 0,!0)],2))}}),Dn=Ue(ZXe,[["__scopeId","data-v-6a640ef5"]]),QXe={},HXe={class:"select-group"};function KXe(e,t){return U(),ne("div",HXe,[kr(e.$slots,"default",{},void 0,!0)])}const rP=Ue(QXe,[["render",KXe],["__scopeId","data-v-ed58c719"]]),Kn=Ee({__name:"RadioButton",props:{value:{},disabled:{type:Boolean,default:!1}},setup(e){const{value:t,updateValue:n}=hs(wK);return(r,i)=>(U(),_e(qe,{checked:!r.disabled&&z(t)===r.value,disabled:r.disabled,type:"radio",onClick:i[0]||(i[0]=o=>!r.disabled&&z(n)(r.value))},{default:se(()=>[kr(r.$slots,"default")]),_:3},8,["checked","disabled"]))}}),lu=Ee({__name:"RadioGroup",props:{value:{},disabled:{type:Boolean,default:!1}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,i=a=>{n.disabled||r("update:value",a)},o=we(()=>n.value);return Qh(wK,{value:o,updateValue:i}),(a,s)=>(U(),_e(Dn,{class:"radio-group"},{default:se(()=>[kr(a.$slots,"default")]),_:3}))}}),L3=e=>(rn("data-v-830b245d"),e=e(),on(),e),GXe={class:"rich-text-base"},zXe={class:"link-popover"},JXe={class:"btns"},$Xe={class:"row",passive:""},jXe={class:"list-wrap"},qXe=["onClick"],eWe=L3(()=>V("span",null,null,-1)),tWe=[eWe],nWe=L3(()=>V("div",{style:{width:"10px"}},null,-1)),rWe={class:"list-wrap"},iWe=["onClick"],oWe=L3(()=>V("span",null,null,-1)),aWe=[oWe],sWe={class:"row"},lWe=L3(()=>V("div",{style:{width:"10px"}},null,-1)),uWe=Ee({__name:"RichTextBase",setup(e){const{richTextAttrs:t,availableFonts:n,textFormatPainter:r}=We(dt()),{toggleTextFormatPainter:i}=UXe(),o=["12px","14px","16px","18px","20px","22px","24px","28px","32px","36px","40px","44px","48px","54px","60px","66px","72px","76px","80px","88px","96px","104px","112px","120px"],a=(y,R)=>{Bi.emit(Si.RICH_TEXT_COMMAND,{action:{command:y,value:R}})},s=ge(!1),l=ge(!1),u=ge(!1),c=ge(!1),f=ge(["disc","circle","square"]),d=ge(["decimal","lower-roman","upper-roman","lower-alpha","upper-alpha","lower-greek"]),h=ge(""),p=ge(!1);_t(t,()=>p.value=!1);const v=()=>{h.value=t.value.link},g=y=>{if(!y||!/^(https?):\/\/[\w\-]+(\.[\w\-]+)+([\w\-.,@?^=%&:\/~+#]*[\w\-@?^=%&\/~+#])?$/.test(y))return Tn.error("不是正确的网页链接地址");a("link",y),p.value=!1},m=()=>{a("link"),p.value=!1};return(y,R)=>{const A=Se("IconFontSize"),x=Se("IconAddText"),S=Se("IconText"),T=Se("IconHighLight"),w=Se("IconTextBold"),M=Se("IconTextItalic"),O=Se("IconTextUnderline"),P=Se("IconStrikethrough"),k=Se("IconCode"),F=Se("IconQuote"),C=Se("IconFormat"),I=Se("IconFormatBrush"),N=Se("IconLinkOne"),W=Se("IconAlignTextLeft"),D=Se("IconAlignTextCenter"),Z=Se("IconAlignTextRight"),re=Se("IconAlignTextBoth"),B=Se("IconList"),Y=Se("IconDown"),K=Se("IconOrderedList"),G=Se("IconIndentLeft"),ee=Se("IconIndentRight"),q=Cn("tooltip");return U(),ne("div",GXe,[_(rP,{class:"row"},{default:se(()=>[_(Ar,{class:"font-select",style:{width:"60%"},value:z(t).fontname,search:"",searchLabel:"搜索字体","onUpdate:value":R[0]||(R[0]=H=>a("fontname",H)),options:[...z(n),...z(p2)]},{icon:se(()=>[_(A)]),_:1},8,["value","options"]),_(Ar,{style:{width:"40%"},value:z(t).fontsize,search:"",searchLabel:"搜索字号","onUpdate:value":R[1]||(R[1]=H=>a("fontsize",H)),options:o.map(H=>({label:H,value:H}))},{icon:se(()=>[_(x)]),_:1},8,["value","options"])]),_:1}),_(Dn,{class:"row",passive:""},{default:se(()=>[_(It,{trigger:"click",style:{width:"30%"}},{content:se(()=>[_($n,{modelValue:z(t).color,"onUpdate:modelValue":R[2]||(R[2]=H=>a("color",H))},null,8,["modelValue"])]),default:se(()=>[Ge((U(),_e(yv,{first:"",color:z(t).color},{default:se(()=>[_(S)]),_:1},8,["color"])),[[q,"文字颜色"]])]),_:1}),_(It,{trigger:"click",style:{width:"30%"}},{content:se(()=>[_($n,{modelValue:z(t).backcolor,"onUpdate:modelValue":R[3]||(R[3]=H=>a("backcolor",H))},null,8,["modelValue"])]),default:se(()=>[Ge((U(),_e(yv,{color:z(t).backcolor},{default:se(()=>[_(T)]),_:1},8,["color"])),[[q,"文字高亮"]])]),_:1}),Ge((U(),_e(qe,{class:"font-size-btn",style:{width:"20%"},onClick:R[4]||(R[4]=H=>a("fontsize-add"))},{default:se(()=>[_(A),De("+")]),_:1})),[[q,"增大字号"]]),Ge((U(),_e(qe,{last:"",class:"font-size-btn",style:{width:"20%"},onClick:R[5]||(R[5]=H=>a("fontsize-reduce"))},{default:se(()=>[_(A),De("-")]),_:1})),[[q,"减小字号"]])]),_:1}),_(Dn,{class:"row"},{default:se(()=>[Ge((U(),_e(Ur,{style:{flex:"1"},checked:z(t).bold,onClick:R[6]||(R[6]=H=>a("bold"))},{default:se(()=>[_(w)]),_:1},8,["checked"])),[[q,"加粗"]]),Ge((U(),_e(Ur,{style:{flex:"1"},checked:z(t).em,onClick:R[7]||(R[7]=H=>a("em"))},{default:se(()=>[_(M)]),_:1},8,["checked"])),[[q,"斜体"]]),Ge((U(),_e(Ur,{style:{flex:"1"},checked:z(t).underline,onClick:R[8]||(R[8]=H=>a("underline"))},{default:se(()=>[_(O)]),_:1},8,["checked"])),[[q,"下划线"]]),Ge((U(),_e(Ur,{style:{flex:"1"},checked:z(t).strikethrough,onClick:R[9]||(R[9]=H=>a("strikethrough"))},{default:se(()=>[_(P)]),_:1},8,["checked"])),[[q,"删除线"]])]),_:1}),_(Dn,{class:"row"},{default:se(()=>[Ge((U(),_e(Ur,{style:{flex:"1"},checked:z(t).superscript,onClick:R[10]||(R[10]=H=>a("superscript"))},{default:se(()=>[De("A²")]),_:1},8,["checked"])),[[q,"上标"]]),Ge((U(),_e(Ur,{style:{flex:"1"},checked:z(t).subscript,onClick:R[11]||(R[11]=H=>a("subscript"))},{default:se(()=>[De("A₂")]),_:1},8,["checked"])),[[q,"下标"]]),Ge((U(),_e(Ur,{style:{flex:"1"},checked:z(t).code,onClick:R[12]||(R[12]=H=>a("code"))},{default:se(()=>[_(k)]),_:1},8,["checked"])),[[q,"行内代码"]]),Ge((U(),_e(Ur,{style:{flex:"1"},checked:z(t).blockquote,onClick:R[13]||(R[13]=H=>a("blockquote"))},{default:se(()=>[_(F)]),_:1},8,["checked"])),[[q,"引用"]])]),_:1}),_(Dn,{class:"row",passive:""},{default:se(()=>[Ge((U(),_e(Ur,{first:"",style:{flex:"1"},onClick:R[14]||(R[14]=H=>a("clear"))},{default:se(()=>[_(C)]),_:1})),[[q,"清除格式"]]),Ge((U(),_e(Ur,{style:{flex:"1"},checked:!!z(r),onClick:R[15]||(R[15]=H=>z(i)()),onDblclick:R[16]||(R[16]=H=>z(i)(!0))},{default:se(()=>[_(I)]),_:1},8,["checked"])),[[q,"格式刷(双击连续使用)"]]),_(It,{placement:"bottom-end",trigger:"click",value:p.value,"onUpdate:value":R[21]||(R[21]=H=>p.value=H),style:{width:"33.33%"}},{content:se(()=>[V("div",zXe,[_(If,{value:h.value,"onUpdate:value":R[17]||(R[17]=H=>h.value=H),placeholder:"请输入超链接"},null,8,["value"]),V("div",JXe,[_(qe,{size:"small",disabled:!z(t).link,onClick:R[18]||(R[18]=H=>m()),style:{"margin-right":"5px"}},{default:se(()=>[De("移除")]),_:1},8,["disabled"]),_(qe,{size:"small",type:"primary",onClick:R[19]||(R[19]=H=>g(h.value))},{default:se(()=>[De("确认")]),_:1})])])]),default:se(()=>[Ge((U(),_e(Ur,{last:"",style:{width:"100%"},checked:!!z(t).link,onClick:R[20]||(R[20]=H=>v())},{default:se(()=>[_(N)]),_:1},8,["checked"])),[[q,"超链接"]])]),_:1},8,["value"])]),_:1}),_(Yt),_(lu,{class:"row","button-style":"solid",value:z(t).align,"onUpdate:value":R[22]||(R[22]=H=>a("align",H))},{default:se(()=>[Ge((U(),_e(Kn,{value:"left",style:{flex:"1"}},{default:se(()=>[_(W)]),_:1})),[[q,"左对齐"]]),Ge((U(),_e(Kn,{value:"center",style:{flex:"1"}},{default:se(()=>[_(D)]),_:1})),[[q,"居中"]]),Ge((U(),_e(Kn,{value:"right",style:{flex:"1"}},{default:se(()=>[_(Z)]),_:1})),[[q,"右对齐"]]),Ge((U(),_e(Kn,{value:"justify",style:{flex:"1"}},{default:se(()=>[_(re)]),_:1})),[[q,"两端对齐"]])]),_:1},8,["value"]),V("div",$Xe,[_(Dn,{style:{flex:"1"}},{default:se(()=>[Ge((U(),_e(qe,{first:"",type:z(t).bulletList?"primary":"default",style:{flex:"1"},onClick:R[23]||(R[23]=H=>a("bulletList"))},{default:se(()=>[_(B)]),_:1},8,["type"])),[[q,"项目符号"]]),_(It,{trigger:"click",value:s.value,"onUpdate:value":R[24]||(R[24]=H=>s.value=H)},{content:se(()=>[V("div",jXe,[(U(!0),ne(Ve,null,rt(f.value,H=>(U(),ne("ul",{class:"list",key:H,style:Le({listStyleType:H}),onClick:ue=>a("bulletList",H)},[(U(),ne(Ve,null,rt(3,ue=>V("li",{class:"list-item",key:ue},tWe)),64))],12,qXe))),128))])]),default:se(()=>[_(qe,{last:"",class:"popover-btn"},{default:se(()=>[_(Y)]),_:1})]),_:1},8,["value"])]),_:1}),nWe,_(Dn,{style:{flex:"1"},passive:""},{default:se(()=>[Ge((U(),_e(qe,{first:"",type:z(t).orderedList?"primary":"default",style:{flex:"1"},onClick:R[25]||(R[25]=H=>a("orderedList"))},{default:se(()=>[_(K)]),_:1},8,["type"])),[[q,"编号"]]),_(It,{trigger:"click",value:l.value,"onUpdate:value":R[26]||(R[26]=H=>l.value=H)},{content:se(()=>[V("div",rWe,[(U(!0),ne(Ve,null,rt(d.value,H=>(U(),ne("ul",{class:"list",key:H,style:Le({listStyleType:H}),onClick:ue=>a("orderedList",H)},[(U(),ne(Ve,null,rt(3,ue=>V("li",{class:"list-item",key:ue},aWe)),64))],12,iWe))),128))])]),default:se(()=>[_(qe,{last:"",class:"popover-btn"},{default:se(()=>[_(Y)]),_:1})]),_:1},8,["value"])]),_:1})]),V("div",sWe,[_(Dn,{style:{flex:"1"},passive:""},{default:se(()=>[Ge((U(),_e(qe,{first:"",style:{flex:"1"},onClick:R[27]||(R[27]=H=>a("indent","-1"))},{default:se(()=>[_(G)]),_:1})),[[q,"减小段落缩进"]]),_(It,{trigger:"click",value:u.value,"onUpdate:value":R[29]||(R[29]=H=>u.value=H)},{content:se(()=>[_(ri,{onClick:R[28]||(R[28]=H=>a("textIndent","-1"))},{default:se(()=>[De("减小首行缩进")]),_:1})]),default:se(()=>[_(qe,{last:"",class:"popover-btn"},{default:se(()=>[_(Y)]),_:1})]),_:1},8,["value"])]),_:1}),lWe,_(Dn,{style:{flex:"1"},passive:""},{default:se(()=>[Ge((U(),_e(qe,{first:"",style:{flex:"1"},onClick:R[30]||(R[30]=H=>a("indent","+1"))},{default:se(()=>[_(ee)]),_:1})),[[q,"增大段落缩进"]]),_(It,{trigger:"click",value:c.value,"onUpdate:value":R[32]||(R[32]=H=>c.value=H)},{content:se(()=>[_(ri,{onClick:R[31]||(R[31]=H=>a("textIndent","+1"))},{default:se(()=>[De("增大首行缩进")]),_:1})]),default:se(()=>[_(qe,{last:"",class:"popover-btn"},{default:se(()=>[_(Y)]),_:1})]),_:1},8,["value"])]),_:1})])])}}}),Mq=Ue(uWe,[["__scopeId","data-v-830b245d"]]),T3=e=>(rn("data-v-82b69e69"),e=e(),on(),e),cWe={class:"text-style-panel"},fWe={class:"preset-style"},dWe=["onClick"],hWe={class:"row"},pWe=T3(()=>V("div",{style:{width:"40%"}},"行间距:",-1)),vWe={class:"row"},gWe=T3(()=>V("div",{style:{width:"40%"}},"段间距:",-1)),mWe={class:"row"},yWe=T3(()=>V("div",{style:{width:"40%"}},"字间距:",-1)),AWe={class:"row"},RWe=T3(()=>V("div",{style:{width:"40%"}},"文本框填充:",-1)),bWe=Ee({__name:"TextStylePanel",setup(e){const t=[{label:"大标题",style:{fontSize:"26px",fontWeight:700},cmd:[{command:"clear"},{command:"bold"},{command:"fontsize",value:"66px"},{command:"align",value:"center"}]},{label:"小标题",style:{fontSize:"22px",fontWeight:700},cmd:[{command:"clear"},{command:"bold"},{command:"fontsize",value:"40px"},{command:"align",value:"center"}]},{label:"正文",style:{fontSize:"20px"},cmd:[{command:"clear"},{command:"fontsize",value:"20px"}]},{label:"正文[小]",style:{fontSize:"18px"},cmd:[{command:"clear"},{command:"fontsize",value:"18px"}]},{label:"注释 1",style:{fontSize:"16px",fontStyle:"italic"},cmd:[{command:"clear"},{command:"fontsize",value:"16px"},{command:"em"}]},{label:"注释 2",style:{fontSize:"16px",textDecoration:"underline"},cmd:[{command:"clear"},{command:"fontsize",value:"16px"},{command:"underline"}]}],n=dt(),r=lt(),{handleElement:i,handleElementId:o}=We(n),{addHistorySnapshot:a}=qt(),s=A=>{r.updateElement({id:o.value,props:A}),a()},l=ge("#000"),u=ge(),c=ge(),f=ge();_t(i,()=>{!i.value||i.value.type!=="text"||(l.value=i.value.fill||"#fff",u.value=i.value.lineHeight||1.5,c.value=i.value.wordSpace||0,f.value=i.value.paragraphSpace===void 0?5:i.value.paragraphSpace,Bi.emit(Si.SYNC_RICH_TEXT_ATTRS_TO_STORE))},{deep:!0,immediate:!0});const d=[.9,1,1.15,1.2,1.4,1.5,1.8,2,2.5,3],h=[0,1,2,3,4,5,6,8,10],p=[0,5,10,15,20,25,30,40,50,80],v=A=>{s({lineHeight:A})},g=A=>{s({paragraphSpace:A})},m=A=>{s({wordSpace:A})},y=A=>{s({fill:A})},R=A=>{Bi.emit(Si.RICH_TEXT_COMMAND,{action:A})};return(A,x)=>{const S=Se("IconRowHeight"),T=Se("IconVerticalSpacingBetweenItems"),w=Se("IconFullwidth");return U(),ne("div",cWe,[V("div",fWe,[(U(),ne(Ve,null,rt(t,M=>V("div",{class:"preset-style-item",key:M.label,style:Le(M.style),onClick:O=>R(M.cmd)},pt(M.label),13,dWe)),64))]),_(Yt),_(Mq),_(Yt),V("div",hWe,[pWe,_(Ar,{style:{width:"60%"},value:u.value||1,"onUpdate:value":x[0]||(x[0]=M=>v(M)),options:d.map(M=>({label:M+"倍",value:M}))},{icon:se(()=>[_(S)]),_:1},8,["value","options"])]),V("div",vWe,[gWe,_(Ar,{style:{width:"60%"},value:f.value||0,"onUpdate:value":x[1]||(x[1]=M=>g(M)),options:p.map(M=>({label:M+"px",value:M}))},{icon:se(()=>[_(T)]),_:1},8,["value","options"])]),V("div",mWe,[yWe,_(Ar,{style:{width:"60%"},value:c.value||0,"onUpdate:value":x[2]||(x[2]=M=>m(M)),options:h.map(M=>({label:M+"px",value:M}))},{icon:se(()=>[_(w)]),_:1},8,["value","options"])]),V("div",AWe,[RWe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:l.value,"onUpdate:modelValue":x[3]||(x[3]=M=>y(M))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:l.value},null,8,["color"])]),_:1})]),_(Yt),_(K2),_(Yt),_(M3),_(Yt),_(yq)])}}}),xWe=Ue(bWe,[["__scopeId","data-v-82b69e69"]]),SWe={class:"element-flip"},wWe=Ee({__name:"ElementFlip",setup(e){const t=lt(),{handleElement:n}=We(dt()),r=ge(!1),i=ge(!1);_t(n,()=>{n.value&&(n.value.type==="image"||n.value.type==="shape")&&(r.value=!!n.value.flipH,i.value=!!n.value.flipV)},{deep:!0,immediate:!0});const{addHistorySnapshot:o}=qt(),a=s=>{n.value&&(t.updateElement({id:n.value.id,props:s}),o())};return(s,l)=>{const u=Se("IconFlipVertically"),c=Se("IconFlipHorizontally");return U(),ne("div",SWe,[_(Dn,{class:"row"},{default:se(()=>[_(Ur,{style:{flex:"1"},checked:i.value,onClick:l[0]||(l[0]=f=>a({flipV:!i.value}))},{default:se(()=>[_(u),De(" 垂直翻转")]),_:1},8,["checked"]),_(Ur,{style:{flex:"1"},checked:r.value,onClick:l[1]||(l[1]=f=>a({flipH:!r.value}))},{default:se(()=>[_(c),De(" 水平翻转")]),_:1},8,["checked"])]),_:1})])}}}),Lq=Ue(wWe,[["__scopeId","data-v-100c8a7c"]]),MWe=e=>(rn("data-v-e7ba40ca"),e=e(),on(),e),LWe={class:"element-filter"},TWe={class:"row"},_We=MWe(()=>V("div",{style:{flex:"2"}},"启用滤镜:",-1)),OWe={class:"switch-wrapper",style:{flex:"3"}},kWe={class:"presets"},PWe=["onClick"],CWe=["src"],NWe={class:"preset-label"},IWe={class:"filter"},FWe={class:"name"},EWe=Ee({__name:"ElementFilter",setup(e){const t=[{label:"模糊",key:"blur",default:0,value:0,unit:"px",max:10,step:1},{label:"亮度",key:"brightness",default:100,value:100,unit:"%",max:200,step:5},{label:"对比度",key:"contrast",default:100,value:100,unit:"%",max:200,step:5},{label:"灰度",key:"grayscale",default:0,value:0,unit:"%",max:100,step:5},{label:"饱和度",key:"saturate",default:100,value:100,unit:"%",max:200,step:5},{label:"色相",key:"hue-rotate",default:0,value:0,unit:"deg",max:360,step:10},{label:"褐色",key:"sepia",default:0,value:0,unit:"%",max:100,step:5},{label:"反转",key:"invert",default:0,value:0,unit:"%",max:100,step:5},{label:"不透明度",key:"opacity",default:100,value:100,unit:"%",max:100,step:5}],n=[{label:"黑白",values:{grayscale:"100%"}},{label:"复古",values:{sepia:"50%",contrast:"110%",brightness:"90%"}},{label:"锐化",values:{contrast:"150%"}},{label:"柔和",values:{brightness:"110%",contrast:"90%"}},{label:"暖色",values:{sepia:"30%",saturate:"135%"}},{label:"明亮",values:{brightness:"110%",contrast:"110%"}},{label:"鲜艳",values:{saturate:"200%"}},{label:"模糊",values:{blur:"2px"}},{label:"反转",values:{invert:"100%"}}],r=lt(),{handleElement:i,handleElementId:o}=We(dt()),a=i,s=ge(JSON.parse(JSON.stringify(t))),l=ge(!1),{addHistorySnapshot:u}=qt();_t(i,()=>{if(!i.value||i.value.type!=="image")return;const p=i.value.filters;p?(s.value=t.map(v=>{const g=p[v.key];return g?{...v,value:parseInt(g)}:v}),l.value=!0):(s.value=JSON.parse(JSON.stringify(t)),l.value=!1)},{deep:!0,immediate:!0});const c=p=>{let v="";const g=Object.keys(p);for(const m of g)v+=`${m}(${p[m]}) `;return v},f=(p,v)=>{const y={...i.value.filters||{},[p.key]:`${v}${p.unit}`};r.updateElement({id:o.value,props:{filters:y}}),u()},d=p=>{i.value&&(p?r.updateElement({id:i.value.id,props:{filters:{}}}):r.removeElementProps({id:i.value.id,propName:"filters"}),u())},h=p=>{r.updateElement({id:o.value,props:{filters:p}}),u()};return(p,v)=>(U(),ne("div",LWe,[V("div",TWe,[_We,V("div",OWe,[_(ws,{value:l.value,"onUpdate:value":v[0]||(v[0]=g=>d(g))},null,8,["value"])])]),l.value?(U(),ne(Ve,{key:0},[V("div",kWe,[(U(),ne(Ve,null,rt(n,(g,m)=>V("div",{class:"preset-item",key:m,onClick:y=>h(g.values)},[V("img",{src:z(a).src,alt:"",style:Le({filter:c(g.values)})},null,12,CWe),V("span",NWe,pt(g.label),1)],8,PWe)),64))]),V("div",IWe,[(U(!0),ne(Ve,null,rt(s.value,g=>(U(),ne("div",{class:"filter-item",key:g.key},[V("div",FWe,pt(g.label),1),_(Yi,{class:"filter-slider",max:g.max,min:0,step:g.step,value:g.value,"onUpdate:value":m=>f(g,m)},null,8,["max","step","value","onUpdate:value"])]))),128))])],64)):Ze("",!0)]))}}),XWe=Ue(EWe,[["__scopeId","data-v-e7ba40ca"]]),Tq=e=>(rn("data-v-51ffed2c"),e=e(),on(),e),WWe={class:"element-color-mask"},VWe={class:"row"},DWe=Tq(()=>V("div",{style:{width:"40%"}},"着色(蒙版):",-1)),UWe={class:"switch-wrapper",style:{width:"60%"}},BWe={key:0,class:"row",style:{"margin-top":"15px"}},YWe=Tq(()=>V("div",{style:{width:"40%"}},"蒙版颜色:",-1)),eU="rgba(226, 83, 77, 0.5)",ZWe=Ee({__name:"ElementColorMask",setup(e){const t=lt(),{handleElement:n,handleElementId:r}=We(dt()),i=ge(eU),o=ge(!1),{addHistorySnapshot:a}=qt();_t(n,()=>{!n.value||n.value.type!=="image"||(n.value.colorMask?(i.value=n.value.colorMask,o.value=!0):o.value=!1)},{deep:!0,immediate:!0});const s=u=>{n.value&&(u?t.updateElement({id:n.value.id,props:{colorMask:eU}}):t.removeElementProps({id:n.value.id,propName:"colorMask"}),a())},l=u=>{t.updateElement({id:r.value,props:{colorMask:u}}),a()};return(u,c)=>(U(),ne("div",WWe,[V("div",VWe,[DWe,V("div",UWe,[_(ws,{value:o.value,"onUpdate:value":c[0]||(c[0]=f=>s(f))},null,8,["value"])])]),o.value?(U(),ne("div",BWe,[YWe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:i.value,"onUpdate:modelValue":c[1]||(c[1]=f=>l(f))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:i.value},null,8,["color"])]),_:1})])):Ze("",!0)]))}}),QWe=Ue(ZWe,[["__scopeId","data-v-51ffed2c"]]),_q=e=>(rn("data-v-0e7500b2"),e=e(),on(),e),HWe={class:"image-style-panel"},KWe={class:"clip"},GWe=_q(()=>V("div",{class:"title"},"按形状:",-1)),zWe={class:"shape-clip"},JWe=["onClick"],$We={key:0,class:"title"},jWe={class:"row"},qWe=_q(()=>V("div",{style:{width:"40%"}},"圆角半径:",-1)),eVe=Ee({__name:"ImageStylePanel",setup(e){const t=pL,n=[{label:"纵横比(正方形)",children:[{key:"1:1",ratio:1/1}]},{label:"纵横比(纵向)",children:[{key:"2:3",ratio:3/2},{key:"3:4",ratio:4/3},{key:"3:5",ratio:5/3},{key:"4:5",ratio:5/4}]},{label:"纵横比(横向)",children:[{key:"3:2",ratio:2/3},{key:"4:3",ratio:3/4},{key:"5:3",ratio:3/5},{key:"5:4",ratio:4/5}]},{children:[{key:"16:9",ratio:9/16},{key:"16:10",ratio:10/16}]}],r=dt(),i=lt(),{handleElement:o,handleElementId:a}=We(r),{currentSlide:s}=We(i),l=o,u=ge(!1),{addHistorySnapshot:c}=qt(),f=()=>{r.setClipingImageElementId(a.value),u.value=!1},d=()=>{const y=o.value,R=y.width,A=y.height,x=y.left,S=y.top,T=y.clip?y.clip.range:[[0,0],[100,100]],w=R/((T[1][0]-T[0][0])/100),M=A/((T[1][1]-T[0][1])/100),O=x-w*(T[0][0]/100),P=S-M*(T[0][1]/100);return{originClipRange:T,originWidth:w,originHeight:M,originLeft:O,originTop:P}},h=y=>{o.value&&(i.updateElement({id:a.value,props:y}),c())},p=(y,R=0)=>{const A=o.value,{originClipRange:x,originWidth:S,originHeight:T,originLeft:w,originTop:M}=d();if(R){const O=T/S,P=0,k=100;let F;if(O>R){const C=(1-R/O)/2*100;F=[[P,C],[k,k-C]]}else{const C=(1-O/R)/2*100;F=[[C,P],[k-C,k]]}h({clip:{...A.clip,shape:y,range:F},left:w+S*(F[0][0]/100),top:M+T*(F[0][1]/100),width:S*(F[1][0]-F[0][0])/100,height:T*(F[1][1]-F[0][1])/100})}else{const O={...A.clip,shape:y,range:x};let P={clip:O};y==="rect"&&(P={clip:O,radius:0}),h(P)}f()},v=y=>{const R=y[0];R&&zf(R).then(A=>{h({src:A})})},g=()=>{if(o.value.clip){const{originWidth:R,originHeight:A,originLeft:x,originTop:S}=d();h({left:x,top:S,width:R,height:A})}i.removeElementProps({id:a.value,propName:["clip","outline","flip","shadow","filters","colorMask"]}),c()},m=()=>{const y=o.value,R={...s.value.background,type:"image",image:{src:y.src,size:"cover"}};i.updateSlide({background:R}),c()};return(y,R)=>{const A=Se("IconTailoring"),x=Se("IconDown"),S=Se("IconTransform"),T=Se("IconUndo"),w=Se("IconTheme");return U(),ne("div",HWe,[V("div",{class:"origin-image",style:Le({backgroundImage:`url(${z(l).src})`})},null,4),_(Lq),_(Dn,{class:"row",passive:""},{default:se(()=>[_(qe,{first:"",style:{width:"calc(100% / 6 * 5)"},onClick:R[0]||(R[0]=M=>f())},{default:se(()=>[_(A,{class:"btn-icon"}),De(" 裁剪图片")]),_:1}),_(It,{trigger:"click",value:u.value,"onUpdate:value":R[1]||(R[1]=M=>u.value=M),style:{width:"calc(100% / 6)"}},{content:se(()=>[V("div",KWe,[GWe,V("div",zWe,[(U(!0),ne(Ve,null,rt(z(t),(M,O)=>(U(),ne("div",{class:"shape-clip-item",key:O,onClick:P=>p(O)},[V("div",{class:"shape",style:Le({clipPath:M.style})},null,4)],8,JWe))),128))]),(U(),ne(Ve,null,rt(n,M=>(U(),ne(Ve,{key:M.label},[M.label?(U(),ne("div",$We,"按"+pt(M.label)+":",1)):Ze("",!0),_(Dn,{class:"row"},{default:se(()=>[(U(!0),ne(Ve,null,rt(M.children,O=>(U(),_e(qe,{style:{flex:"1"},key:O.key,onClick:P=>p("rect",O.ratio)},{default:se(()=>[De(pt(O.key),1)]),_:2},1032,["onClick"]))),128))]),_:2},1024)],64))),64))])]),default:se(()=>[_(qe,{last:"",class:"popover-btn",style:{width:"100%"}},{default:se(()=>[_(x)]),_:1})]),_:1},8,["value"])]),_:1}),V("div",jWe,[qWe,_(Ko,{value:z(l).radius||0,"onUpdate:value":R[2]||(R[2]=M=>h({radius:M})),style:{width:"60%"}},null,8,["value"])]),_(Yt),_(QWe),_(Yt),_(XWe),_(Yt),_(K2),_(Yt),_(M3),_(Yt),_(Xh,{onChange:R[3]||(R[3]=M=>v(M))},{default:se(()=>[_(qe,{class:"full-width-btn"},{default:se(()=>[_(S,{class:"btn-icon"}),De(" 替换图片")]),_:1})]),_:1}),_(qe,{class:"full-width-btn",onClick:R[4]||(R[4]=M=>g())},{default:se(()=>[_(T,{class:"btn-icon"}),De(" 重置样式")]),_:1}),_(qe,{class:"full-width-btn",onClick:R[5]||(R[5]=M=>m())},{default:se(()=>[_(w,{class:"btn-icon"}),De(" 设为背景")]),_:1})])}}}),tVe=Ue(eVe,[["__scopeId","data-v-0e7500b2"]]),nVe=()=>{const e=dt(),{shapeFormatPainter:t,handleElement:n}=We(e);return{toggleShapeFormatPainter:(i=!1)=>{const o=n.value;t.value?e.setShapeFormatPainter(null):e.setShapeFormatPainter({keep:i,fill:o.fill,gradient:o.gradient,outline:o.outline,opacity:o.opacity,shadow:o.shadow})}}},rVe={class:"gradient-bar"},iVe=["onMousedown","onContextmenu"],oVe=Ee({__name:"GradientBar",props:{value:{}},emits:["update:value","update:index"],setup(e,{emit:t}){const n=e,r=t,i=ge([]),o=ge(),a=ge(0);xv(()=>{i.value=n.value,a.value>n.value.length-1&&(a.value=0)}),_t(a,()=>{r("update:index",a.value)});const s=we(()=>`linear-gradient(to right, ${i.value.map(d=>`${d.color} ${d.pos}%`).join(",")})`),l=f=>{if(n.value.length<=2)return;f===a.value?a.value=f-1<0?0:f-1:a.value===n.value.length-1&&(a.value=n.value.length-2);const d=n.value.filter((h,p)=>p!==f);r("update:value",d)},u=f=>{let d=!0;document.onmousemove=h=>{if(!d||!o.value)return;let p=Math.round((h.clientX-o.value.getBoundingClientRect().left)/o.value.clientWidth*100);p>100&&(p=100),p<0&&(p=0),i.value=i.value.map((v,g)=>g===f?{...v,pos:p}:v)},document.onmouseup=()=>{d=!1;const h=i.value[f],p=[...i.value];p.splice(f,1);let v=0;for(let g=0;gp[g].pos&&(v=g+1);a.value=v,p.splice(v,0,h),r("update:value",p),document.onmousemove=null,document.onmouseup=null}},c=f=>{if(n.value.length>=6||!o.value)return;const d=Math.round((f.clientX-o.value.getBoundingClientRect().left)/o.value.clientWidth*100);let h=0;for(let g=0;gn.value[g].pos&&(h=g+1);const p=n.value[h-1]?n.value[h-1].color:n.value[h].color,v=[...n.value];v.splice(h,0,{pos:d,color:p}),a.value=h,r("update:value",v)};return(f,d)=>(U(),ne("div",rVe,[V("div",{class:"bar",ref_key:"barRef",ref:o,style:Le({backgroundImage:s.value}),onClick:d[0]||(d[0]=h=>c(h))},null,4),(U(!0),ne(Ve,null,rt(i.value,(h,p)=>(U(),ne("div",{class:$e(["point",{active:a.value===p}]),key:h.pos+"-"+p,style:Le({backgroundColor:h.color,left:`calc(${h.pos}% - 5px)`}),onMousedown:Et(v=>u(p),["left"]),onContextmenu:Et(v=>l(p),["right"])},null,46,iVe))),128))]))}}),Oq=Ue(oVe,[["__scopeId","data-v-c1273c7e"]]),_3=e=>(rn("data-v-d5ed5ce8"),e=e(),on(),e),aVe={class:"shape-style-panel"},sVe={class:"title"},lVe=_3(()=>V("span",null,"点击替换形状",-1)),uVe={class:"shape-pool"},cVe={class:"shape-list"},fVe={class:"row"},dVe=_3(()=>V("div",{style:{width:"10px"}},null,-1)),hVe={class:"row"},pVe={class:"row"},vVe=_3(()=>V("div",{style:{width:"40%"}},"当前色块:",-1)),gVe={key:0,class:"row"},mVe=_3(()=>V("div",{style:{width:"40%"}},"渐变角度:",-1)),yVe={class:"row"},AVe=Ee({__name:"ShapeStylePanel",setup(e){const t=dt(),n=lt(),{handleElement:r,handleElementId:i,shapeFormatPainter:o}=We(t),a=r,s=ge("#000"),l=ge({type:"linear",rotate:0,colors:[{pos:0,color:"#fff"},{pos:100,color:"#fff"}]}),u=ge("fill"),c=ge("middle"),f=ge(0);_t(r,()=>{var S,T;if(!r.value||r.value.type!=="shape")return;s.value=r.value.fill||"#fff";const x=[{pos:0,color:s.value},{pos:100,color:"#fff"}];l.value=r.value.gradient||{type:"linear",rotate:0,colors:x},u.value=r.value.gradient?"gradient":"fill",c.value=((T=(S=r.value)==null?void 0:S.text)==null?void 0:T.align)||"middle"},{deep:!0,immediate:!0});const{addHistorySnapshot:d}=qt(),{toggleShapeFormatPainter:h}=nVe(),p=x=>{n.updateElement({id:i.value,props:x}),d()},v=x=>{x==="fill"?(n.removeElementProps({id:i.value,propName:"gradient"}),d()):(f.value=0,p({gradient:l.value}))},g=x=>{if(!l.value)return;const S={...l.value,...x};p({gradient:S})},m=x=>{const S=l.value.colors.map((T,w)=>w===f.value?{...T,color:x}:T);g({colors:S})},y=x=>{p({fill:x})},R=x=>{const{width:S,height:T}=r.value,w={viewBox:x.viewBox,path:x.path,special:x.special};if(x.pathFormula){w.pathFormula=x.pathFormula,w.viewBox=[S,T];const M=Gh[x.pathFormula];"editable"in M?(w.path=M.formula(S,T,M.defaultValue),w.keypoints=M.defaultValue):w.path=M.formula(S,T)}else w.pathFormula=void 0,w.keypoints=void 0;p(w)},A=x=>{const S=r.value,T={content:"",defaultFontName:"微软雅黑",defaultColor:"#000",align:"middle"},w=S.text||T;p({text:{...w,align:x}})};return(x,S)=>{var F;const T=Se("IconDown"),w=Se("IconAlignTextTopOne"),M=Se("IconAlignTextMiddleOne"),O=Se("IconAlignTextBottomOne"),P=Se("IconFormatBrush"),k=Cn("tooltip");return U(),ne("div",aVe,[V("div",sVe,[lVe,_(T)]),V("div",uVe,[(U(!0),ne(Ve,null,rt(z(J_),C=>(U(),ne("div",{class:"category",key:C.type},[V("div",cVe,[(U(!0),ne(Ve,null,rt(C.children,(I,N)=>(U(),_e(jj,{class:"shape-item",key:N,shape:I,onClick:W=>R(I)},null,8,["shape","onClick"]))),128))])]))),128))]),V("div",fVe,[_(Ar,{style:{flex:"1"},value:u.value,"onUpdate:value":S[0]||(S[0]=C=>v(C)),options:[{label:"纯色填充",value:"fill"},{label:"渐变填充",value:"gradient"}]},null,8,["value"]),dVe,u.value==="fill"?(U(),_e(It,{key:0,trigger:"click",style:{flex:"1"}},{content:se(()=>[_($n,{modelValue:s.value,"onUpdate:modelValue":S[1]||(S[1]=C=>y(C))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:s.value},null,8,["color"])]),_:1})):(U(),_e(Ar,{key:1,style:{flex:"1"},value:l.value.type,"onUpdate:value":S[2]||(S[2]=C=>g({type:C})),options:[{label:"线性渐变",value:"linear"},{label:"径向渐变",value:"radial"}]},null,8,["value"]))]),u.value==="gradient"?(U(),ne(Ve,{key:0},[V("div",hVe,[_(Oq,{value:l.value.colors,"onUpdate:value":S[3]||(S[3]=C=>g({colors:C})),"onUpdate:index":S[4]||(S[4]=C=>f.value=C)},null,8,["value"])]),V("div",pVe,[vVe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:l.value.colors[f.value].color,"onUpdate:modelValue":S[5]||(S[5]=C=>m(C))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:l.value.colors[f.value].color},null,8,["color"])]),_:1})]),l.value.type==="linear"?(U(),ne("div",gVe,[mVe,_(Yi,{style:{width:"60%"},min:0,max:360,step:15,value:l.value.rotate,"onUpdate:value":S[6]||(S[6]=C=>g({rotate:C}))},null,8,["value"])])):Ze("",!0)],64)):Ze("",!0),_(Lq),_(Yt),(F=z(a).text)!=null&&F.content?(U(),ne(Ve,{key:1},[_(Mq),_(Yt),_(lu,{class:"row","button-style":"solid",value:c.value,"onUpdate:value":S[7]||(S[7]=C=>A(C))},{default:se(()=>[Ge((U(),_e(Kn,{value:"top",style:{flex:"1"}},{default:se(()=>[_(w)]),_:1})),[[k,"顶对齐"]]),Ge((U(),_e(Kn,{value:"middle",style:{flex:"1"}},{default:se(()=>[_(M)]),_:1})),[[k,"居中"]]),Ge((U(),_e(Kn,{value:"bottom",style:{flex:"1"}},{default:se(()=>[_(O)]),_:1})),[[k,"底对齐"]])]),_:1},8,["value"]),_(Yt)],64)):Ze("",!0),_(K2),_(Yt),_(M3),_(Yt),_(yq),_(Yt),V("div",yVe,[Ge((U(),_e(Ur,{style:{flex:"1"},checked:!!z(o),onClick:S[8]||(S[8]=C=>z(h)()),onDblclick:S[9]||(S[9]=C=>z(h)(!0))},{default:se(()=>[_(P),De(" 形状格式刷")]),_:1},8,["checked"])),[[k,"双击连续使用"]])])])}}}),RVe=Ue(AVe,[["__scopeId","data-v-d5ed5ce8"]]),z2=e=>(rn("data-v-2766c9e7"),e=e(),on(),e),bVe={class:"line-style-panel"},xVe={class:"row"},SVe=z2(()=>V("div",{style:{width:"40%"}},"线条样式:",-1)),wVe={class:"row"},MVe=z2(()=>V("div",{style:{width:"40%"}},"线条颜色:",-1)),LVe={class:"row"},TVe=z2(()=>V("div",{style:{width:"40%"}},"线条宽度:",-1)),_Ve={class:"row"},OVe=z2(()=>V("div",{style:{width:"40%"}},"起点样式:",-1)),kVe={class:"row"},PVe=z2(()=>V("div",{style:{width:"40%"}},"终点样式:",-1)),CVe={class:"row"},NVe=Ee({__name:"LineStylePanel",setup(e){const t=lt(),{handleElement:n}=We(dt()),r=n,{addHistorySnapshot:i}=qt(),o=a=>{n.value&&(t.updateElement({id:n.value.id,props:a}),i())};return(a,s)=>{const l=Se("IconSwitch");return U(),ne("div",bVe,[V("div",xVe,[SVe,_(Ar,{style:{width:"60%"},value:z(r).style,"onUpdate:value":s[0]||(s[0]=u=>o({style:u})),options:[{label:"实线",value:"solid"},{label:"虚线",value:"dashed"},{label:"点线",value:"dotted"}]},null,8,["value"])]),V("div",wVe,[MVe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:z(r).color,"onUpdate:modelValue":s[1]||(s[1]=u=>o({color:u}))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:z(r).color},null,8,["color"])]),_:1})]),V("div",LVe,[TVe,_(Ko,{value:z(r).width,"onUpdate:value":s[2]||(s[2]=u=>o({width:u})),style:{width:"60%"}},null,8,["value"])]),V("div",_Ve,[OVe,_(Ar,{style:{width:"60%"},value:z(r).points[0],"onUpdate:value":s[3]||(s[3]=u=>o({points:[u,z(r).points[1]]})),options:[{label:"无",value:""},{label:"箭头",value:"arrow"},{label:"圆点",value:"dot"}]},null,8,["value"])]),V("div",kVe,[PVe,_(Ar,{style:{width:"60%"},value:z(r).points[1],"onUpdate:value":s[4]||(s[4]=u=>o({points:[z(r).points[0],u]})),options:[{label:"无",value:""},{label:"箭头",value:"arrow"},{label:"圆点",value:"dot"}]},null,8,["value"])]),_(Yt),V("div",CVe,[_(qe,{style:{flex:"1"},onClick:s[5]||(s[5]=u=>o({start:z(r).end,end:z(r).start}))},{default:se(()=>[_(l),De(" 交换方向")]),_:1})]),_(Yt),_(M3)])}}}),IVe=Ue(NVe,[["__scopeId","data-v-2766c9e7"]]),kq=e=>(rn("data-v-31747c29"),e=e(),on(),e),FVe={class:"chart-data-editor"},EVe={class:"editor-content"},XVe={class:"handler"},WVe={class:"col-header"},VVe={class:"col-key"},DVe={class:"row-header"},UVe={class:"row-key"},BVe=kq(()=>V("div",{class:"all-header"},[V("svg",{class:"triangle",width:"8",height:"8",viewBox:"0 0 8 8",xmlns:"http://www.w3.org/2000/svg"},[V("path",{d:"M8,0 L8,8 L0,8 L8,0",fill:"#ccc"})])],-1)),YVe={class:"range-box"},ZVe=["id","onFocus","onPaste"],QVe={class:"btns"},HVe={class:"left"},KVe=kq(()=>V("span",{class:"change"},"点击更换",-1)),GVe={class:"right"},zVe="ABCDEFGHIJKLMNOPQRSTUVWXYZ",Nc=100,Ic=32,JVe=Ee({__name:"ChartDataEditor",props:{type:{},data:{}},emits:["save","close"],setup(e,{emit:t}){const n=e,r=t,i=["bar","column","line","area","scatter","pie","ring","radar"],o=ge(!1),a=ge([0,0]),s=ge({width:0,height:0}),l=ge(null),u=ge("bar"),c=we(()=>{const A=a.value[0]*Nc,x=a.value[1]*Ic;return[{type:"t",style:{width:A+"px"}},{type:"b",style:{top:x+"px",width:A+"px"}},{type:"l",style:{height:x+"px"}},{type:"r",style:{left:A+"px",height:x+"px"}}]}),f=we(()=>{const A=a.value[0]*Nc,x=a.value[1]*Ic;return{left:A+"px",top:x+"px"}});jt(()=>{u.value=n.type;const A=[],{labels:x,legends:S,series:T}=n.data,w=x.length,M=T.length;A.push(["",...S]);for(let O=0;O{if(!l.value)return;const[A,x]=l.value,S=document.querySelector(`#cell-${A+1}-${x}`);S&&S.focus()},p=A=>{A.key.toUpperCase()===yt.ENTER&&h()};jt(()=>{document.addEventListener("keydown",p)}),Fn(()=>{document.removeEventListener("keydown",p)});const v=()=>{const[A,x]=a.value,S=[];let T=[],w=[];for(let M=1;M2&&(T=T.slice(0,2),w=w.slice(0,2)),T.length<2&&(T.push("Y"),w.push(w[0]))),(u.value==="ring"||u.value==="pie")&&T.length>1&&(T=T.slice(0,1),w=w.slice(0,1)),r("save",{data:{labels:S,legends:T,series:w},type:u.value})},g=()=>{for(let A=1;A<31;A++)for(let x=1;x<7;x++){const S=document.querySelector(`#cell-${A}-${x}`);S&&(S.value="")}},m=(A,x,S)=>{if(A.preventDefault(),!A.clipboardData)return;const T=A.clipboardData.items[0];T&&T.kind==="string"&&T.type==="text/plain"&&T.getAsString(w=>{if(typeof G_(w)=="object")return;const O=nQ(w);if(O){const P=x+O.length,k=S+O[0].length;for(let F=x;Fr("close"),R=A=>{let x=!0;const S=A.pageX,T=A.pageY,w=a.value[0]*Nc,M=a.value[1]*Ic;document.onmousemove=O=>{if(!x)return;const P=O.pageX,k=O.pageY,F=P-S,C=k-T,I=w+F,N=M+C;s.value={width:I,height:N}},document.onmouseup=O=>{x=!1,document.onmousemove=null,document.onmouseup=null;const P=O.pageX,k=O.pageY;if(S===P&&T===k)return;let F=s.value.width,C=s.value.height;F%Nc>Nc*.5&&(F=F+(Nc-F%Nc)),C%Ic>Ic*.5&&(C=C+(Ic-C%Ic));let I=Math.round(C/Ic),N=Math.round(F/Nc);I<3&&(I=3),N<2&&(N=2),a.value=[N,I],s.value={width:0,height:0}}};return(A,x)=>(U(),ne("div",FVe,[V("div",EVe,[V("div",XVe,[V("div",WVe,[(U(),ne(Ve,null,rt(7,S=>V("div",{class:"col-header-item",key:S},[V("div",VVe,pt(zVe[S-1]),1)])),64))]),V("div",DVe,[(U(),ne(Ve,null,rt(31,S=>V("div",{class:"row-header-item",key:S},[V("div",UVe,pt(S),1)])),64))]),BVe]),V("div",YVe,[V("div",{class:"temp-range",style:Le({width:s.value.width+"px",height:s.value.height+"px"})},null,4),(U(!0),ne(Ve,null,rt(c.value,S=>(U(),ne("div",{class:$e(["range-line",S.type]),key:S.type,style:Le(S.style)},null,6))),128)),V("div",{class:"resizable",style:Le(f.value),onMousedown:x[0]||(x[0]=Et(S=>R(S),["stop"]))},null,36)]),V("table",null,[V("tbody",null,[(U(),ne(Ve,null,rt(31,S=>V("tr",{key:S},[(U(),ne(Ve,null,rt(7,T=>V("td",{key:T,class:$e({head:T===1&&S<=a.value[1]||S===1&&T<=a.value[0]})},[S===1&&T===1?Ze("",!0):(U(),ne("input",{key:0,class:$e(["item",{selected:S<=a.value[1]&&T<=a.value[0]}]),id:`cell-${S-1}-${T-1}`,autocomplete:"off",onFocus:w=>l.value=[S-1,T-1],onPaste:w=>m(w,S-1,T-1)},null,42,ZVe))],2)),64))])),64))])])]),V("div",QVe,[V("div",HVe,[De(" 图表类型:"+pt(z(F6)[u.value])+" ",1),_(It,{trigger:"click",placement:"top",value:o.value,"onUpdate:value":x[1]||(x[1]=S=>o.value=S)},{content:se(()=>[(U(),ne(Ve,null,rt(i,S=>_(ri,{center:"",key:S,onClick:T=>{u.value=S,o.value=!1}},{default:se(()=>[De(pt(z(F6)[S]),1)]),_:2},1032,["onClick"])),64))]),default:se(()=>[KVe]),_:1},8,["value"])]),V("div",GVe,[_(qe,{class:"btn",onClick:x[2]||(x[2]=S=>y())},{default:se(()=>[De("取消")]),_:1}),_(qe,{class:"btn",onClick:x[3]||(x[3]=S=>g())},{default:se(()=>[De("清空数据")]),_:1}),_(qe,{type:"primary",class:"btn",onClick:x[4]||(x[4]=S=>v())},{default:se(()=>[De("确认")]),_:1})])])]))}}),$Ve=Ue(JVe,[["__scopeId","data-v-31747c29"]]),jVe=e=>(rn("data-v-40b4de83"),e=e(),on(),e),qVe=jVe(()=>V("span",{class:"checkbox-input"},null,-1)),eDe=["checked"],tDe={class:"checkbox-label"},nDe=Ee({__name:"Checkbox",props:{value:{type:Boolean},disabled:{type:Boolean,default:!1}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,i=o=>{n.disabled||r("update:value",o.target.checked)};return(o,a)=>(U(),ne("label",{class:$e(["checkbox",{checked:o.value,disabled:o.disabled}]),onChange:a[0]||(a[0]=s=>i(s))},[qVe,V("input",{class:"checkbox-original",type:"checkbox",checked:o.value},null,8,eDe),V("span",tDe,[kr(o.$slots,"default",{},void 0,!0)])],34))}}),bp=Ue(nDe,[["__scopeId","data-v-40b4de83"]]),Pq=e=>(rn("data-v-c779ea7f"),e=e(),on(),e),rDe={class:"chart-style-panel"},iDe={class:"row"},oDe={class:"row"},aDe=Pq(()=>V("div",{style:{width:"40%"}},"背景填充:",-1)),sDe={class:"row"},lDe=Pq(()=>V("div",{style:{width:"40%"}},"文字颜色:",-1)),uDe={style:{width:"40%"}},cDe={class:"color-btn-wrap",style:{width:"100%"}},fDe=["onClick"],dDe={class:"preset-themes"},hDe=["onClick","onMouseenter"],pDe=Ee({__name:"index",setup(e){const t=dt(),n=lt(),{handleElement:r,handleElementId:i}=We(t),{theme:o}=We(n),a=r,s=ge(!1),l=ge(!1),u=ge([-1,-1]),{addHistorySnapshot:c}=qt(),f=ge("#000"),d=ge([]),h=ge(""),p=ge(!1),v=ge(!1);_t(r,()=>{if(!(!r.value||r.value.type!=="chart")){if(f.value=r.value.fill||"#fff",p.value=!1,v.value=!1,r.value.options){const{lineSmooth:O,stack:P}=r.value.options;O!==void 0&&(p.value=O),P!==void 0&&(v.value=P)}d.value=r.value.themeColors,h.value=r.value.textColor||"#333"}},{deep:!0,immediate:!0});const g=O=>{n.updateElement({id:i.value,props:O}),c()},m=O=>{s.value=!1,g({data:O.data,chartType:O.type})},y=O=>{g({fill:O})},R=O=>{const k={...r.value.options,...O};g({options:k})},A=(O,P)=>{const k={themeColors:d.value.map((F,C)=>C===P?O:F)};g(k)},x=()=>{const O={themeColors:[...d.value,o.value.themeColor]};g(O)},S=(O,P)=>{const k=O.slice(0,P+1);g({themeColors:k}),l.value=!1},T=O=>{const P={themeColors:d.value.filter((k,F)=>F!==O)};g(P)},w=O=>{g({textColor:O})},M=()=>s.value=!0;return Bi.on(Si.OPEN_CHART_DATA_EDITOR,M),Fn(()=>{Bi.off(Si.OPEN_CHART_DATA_EDITOR,M)}),(O,P)=>{const k=Se("IconEdit"),F=Se("IconCloseSmall"),C=Se("IconPlus"),I=Cn("tooltip");return U(),ne("div",rDe,[_(qe,{class:"full-width-btn",onClick:P[0]||(P[0]=N=>s.value=!0)},{default:se(()=>[_(k,{class:"btn-icon"}),De(" 编辑图表 ")]),_:1}),_(Yt),["bar","column","area","line"].includes(z(a).chartType)?(U(),ne(Ve,{key:0},[V("div",iDe,[_(bp,{"onUpdate:value":P[1]||(P[1]=N=>R({stack:N})),value:v.value,style:{flex:"2"}},{default:se(()=>[De("堆叠样式")]),_:1},8,["value"]),z(a).chartType==="line"?(U(),_e(bp,{key:0,"onUpdate:value":P[2]||(P[2]=N=>R({lineSmooth:N})),value:p.value,style:{flex:"3"}},{default:se(()=>[De("使用平滑曲线")]),_:1},8,["value"])):Ze("",!0)]),_(Yt)],64)):Ze("",!0),V("div",oDe,[aDe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:f.value,"onUpdate:modelValue":P[3]||(P[3]=N=>y(N))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:f.value},null,8,["color"])]),_:1})]),V("div",sDe,[lDe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:h.value,"onUpdate:modelValue":P[4]||(P[4]=N=>w(N))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:h.value},null,8,["color"])]),_:1})]),_(Yt),(U(!0),ne(Ve,null,rt(d.value,(N,W)=>(U(),ne("div",{class:"row",key:W},[V("div",uDe,pt(W===0?"主题配色:":""),1),_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:N,"onUpdate:modelValue":D=>A(D,W)},null,8,["modelValue","onUpdate:modelValue"])]),default:se(()=>[V("div",cDe,[_(Zr,{color:N},null,8,["color"]),W!==0?Ge((U(),ne("div",{key:0,class:"delete-color-btn",onClick:Et(D=>T(W),["stop"])},[_(F)],8,fDe)),[[I,"删除"]]):Ze("",!0)])]),_:2},1024)]))),128)),_(Dn,{class:"row",passive:""},{default:se(()=>[_(It,{trigger:"click",open:l.value,"onUpdate:open":P[6]||(P[6]=N=>l.value=N),style:{width:"40%"}},{content:se(()=>[V("div",dDe,[(U(!0),ne(Ve,null,rt(z(I1e),(N,W)=>(U(),ne("div",{class:"preset-theme",key:W},[(U(!0),ne(Ve,null,rt(N,(D,Z)=>(U(),ne("div",{class:$e(["preset-theme-color",{select:u.value[0]===W&&Z<=u.value[1]}]),key:D,style:Le({backgroundColor:D}),onClick:re=>S(N,Z),onMouseenter:re=>u.value=[W,Z],onMouseleave:P[5]||(P[5]=re=>u.value=[-1,-1])},null,46,hDe))),128))]))),128))])]),default:se(()=>[_(qe,{first:"",style:{width:"100%"}},{default:se(()=>[De("推荐主题")]),_:1})]),_:1},8,["open"]),_(qe,{last:"",disabled:d.value.length>=10,style:{width:"60%"},onClick:P[7]||(P[7]=N=>x())},{default:se(()=>[_(C,{class:"btn-icon"}),De(" 添加主题色 ")]),_:1},8,["disabled"])]),_:1}),_(Yt),_(K2),_(Vv,{visible:s.value,"onUpdate:visible":P[10]||(P[10]=N=>s.value=N),width:640},{default:se(()=>[_($Ve,{type:z(a).chartType,data:z(a).data,onClose:P[8]||(P[8]=N=>s.value=!1),onSave:P[9]||(P[9]=N=>m(N))},null,8,["type","data"])]),_:1},8,["visible"])])}}}),vDe=Ue(pDe,[["__scopeId","data-v-c779ea7f"]]),O3=e=>(rn("data-v-3bf19801"),e=e(),on(),e),gDe={class:"table-style-panel"},mDe={class:"row"},yDe=O3(()=>V("div",{style:{width:"40%"}},"行数:",-1)),ADe={class:"set-count",style:{width:"60%"}},RDe={class:"count-text"},bDe={class:"row"},xDe=O3(()=>V("div",{style:{width:"40%"}},"列数:",-1)),SDe={class:"set-count",style:{width:"60%"}},wDe={class:"count-text"},MDe={class:"row theme-switch"},LDe=O3(()=>V("div",{style:{width:"40%"}},"启用主题表格:",-1)),TDe={class:"switch-wrapper",style:{width:"60%"}},_De={class:"row"},ODe={class:"row"},kDe={class:"row"},PDe=O3(()=>V("div",{style:{width:"40%"}},"主题颜色:",-1)),CDe=Ee({__name:"TableStylePanel",setup(e){const t=lt(),{handleElement:n,handleElementId:r,selectedTableCells:i,availableFonts:o}=We(dt()),a=we(()=>t.theme.themeColor),s=["12px","14px","16px","18px","20px","22px","24px","28px","32px"],l=ge({bold:!1,em:!1,underline:!1,strikethrough:!1,color:"#000",backcolor:"",fontsize:"12px",fontname:"微软雅黑",align:"left"}),u=ge(),c=ge(!1),f=ge(0),d=ge(0),h=ge(0),p=ge(0);_t(n,()=>{!n.value||n.value.type!=="table"||(u.value=n.value.theme,c.value=!!u.value,f.value=n.value.data.length,d.value=n.value.data[0].length,h.value=n.value.data.length,p.value=n.value.data[0].length)},{deep:!0,immediate:!0});const{addHistorySnapshot:v}=qt(),g=()=>{if(!n.value||n.value.type!=="table")return;let T=0,w=0;if(i.value.length){const O=i.value[0];T=+O.split("_")[0],w=+O.split("_")[1]}const M=n.value.data[T][w].style;M?l.value={bold:!!M.bold,em:!!M.em,underline:!!M.underline,strikethrough:!!M.strikethrough,color:M.color||"#000",backcolor:M.backcolor||"",fontsize:M.fontsize||"12px",fontname:M.fontname||"微软雅黑",align:M.align||"left"}:l.value={bold:!1,em:!1,underline:!1,strikethrough:!1,color:"#000",backcolor:"",fontsize:"12px",fontname:"微软雅黑",align:"left"}};jt(()=>{i.value.length&&g()}),_t(i,g);const m=T=>{t.updateElement({id:r.value,props:T}),v()},y=T=>{const w=n.value,M=JSON.parse(JSON.stringify(w.data));for(let O=0;O{if(!u.value)return;const w={...u.value,...T};m({theme:w})},A=T=>{if(T){const w={theme:{color:a.value,rowHeader:!0,rowFooter:!1,colHeader:!1,colFooter:!1}};m(w)}else t.removeElementProps({id:r.value,propName:"theme"}),v()},x=T=>{const w=n.value,M=w.data.length;if(T>M){const O=new Array(d.value).fill({id:yn(10),colspan:1,rowspan:1,text:""}),P=new Array(T-M).fill(O),k=JSON.parse(JSON.stringify(w.data));k.push(...P),m({data:k})}else{const O=w.data.slice(0,T);m({data:O})}},S=T=>{const w=n.value,M=w.data[0].length;let O=w.data,P=w.colWidths.map(I=>I*w.width);if(T>M){O=O.map(N=>{const W=new Array(T-M).fill({id:yn(10),colspan:1,rowspan:1,text:""});return N.push(...W),N});const I=new Array(T-M).fill(100);P.push(...I)}else O=O.map(I=>I.slice(0,T)),P=P.slice(0,T);const k=P.reduce((I,N)=>I+N),F=P.map(I=>I/k);m({width:k,data:O,colWidths:F})};return(T,w)=>{const M=Se("IconFontSize"),O=Se("IconAddText"),P=Se("IconText"),k=Se("IconFill"),F=Se("IconTextBold"),C=Se("IconTextItalic"),I=Se("IconTextUnderline"),N=Se("IconStrikethrough"),W=Se("IconAlignTextLeft"),D=Se("IconAlignTextCenter"),Z=Se("IconAlignTextRight"),re=Se("IconAlignTextBoth"),B=Se("IconMinus"),Y=Se("IconPlus"),K=Cn("tooltip");return U(),ne("div",gDe,[_(rP,{class:"row"},{default:se(()=>[_(Ar,{style:{width:"50%"},value:l.value.fontname,search:"",searchLabel:"搜索字体","onUpdate:value":w[0]||(w[0]=G=>y({fontname:G})),options:[...z(o),...z(p2)]},{icon:se(()=>[_(M)]),_:1},8,["value","options"]),_(Ar,{style:{width:"50%"},value:l.value.fontsize,search:"",searchLabel:"搜索字号","onUpdate:value":w[1]||(w[1]=G=>y({fontsize:G})),options:s.map(G=>({label:G,value:G}))},{icon:se(()=>[_(O)]),_:1},8,["value","options"])]),_:1}),_(Dn,{class:"row",passive:""},{default:se(()=>[_(It,{trigger:"click",style:{width:"50%"}},{content:se(()=>[_($n,{modelValue:l.value.color,"onUpdate:modelValue":w[2]||(w[2]=G=>y({color:G}))},null,8,["modelValue"])]),default:se(()=>[Ge((U(),_e(yv,{first:"",color:l.value.color},{default:se(()=>[_(P)]),_:1},8,["color"])),[[K,"文字颜色"]])]),_:1}),_(It,{trigger:"click",style:{width:"50%"}},{content:se(()=>[_($n,{modelValue:l.value.backcolor,"onUpdate:modelValue":w[3]||(w[3]=G=>y({backcolor:G}))},null,8,["modelValue"])]),default:se(()=>[Ge((U(),_e(yv,{last:"",color:l.value.backcolor},{default:se(()=>[_(k)]),_:1},8,["color"])),[[K,"单元格填充"]])]),_:1})]),_:1}),_(Dn,{class:"row"},{default:se(()=>[Ge((U(),_e(Ur,{style:{flex:"1"},checked:l.value.bold,onClick:w[4]||(w[4]=G=>y({bold:!l.value.bold}))},{default:se(()=>[_(F)]),_:1},8,["checked"])),[[K,"加粗"]]),Ge((U(),_e(Ur,{style:{flex:"1"},checked:l.value.em,onClick:w[5]||(w[5]=G=>y({em:!l.value.em}))},{default:se(()=>[_(C)]),_:1},8,["checked"])),[[K,"斜体"]]),Ge((U(),_e(Ur,{style:{flex:"1"},checked:l.value.underline,onClick:w[6]||(w[6]=G=>y({underline:!l.value.underline}))},{default:se(()=>[_(I)]),_:1},8,["checked"])),[[K,"下划线"]]),Ge((U(),_e(Ur,{style:{flex:"1"},checked:l.value.strikethrough,onClick:w[7]||(w[7]=G=>y({strikethrough:!l.value.strikethrough}))},{default:se(()=>[_(N)]),_:1},8,["checked"])),[[K,"删除线"]])]),_:1}),_(lu,{class:"row","button-style":"solid",value:l.value.align,"onUpdate:value":w[8]||(w[8]=G=>y({align:G}))},{default:se(()=>[Ge((U(),_e(Kn,{value:"left",style:{flex:"1"}},{default:se(()=>[_(W)]),_:1})),[[K,"左对齐"]]),Ge((U(),_e(Kn,{value:"center",style:{flex:"1"}},{default:se(()=>[_(D)]),_:1})),[[K,"居中"]]),Ge((U(),_e(Kn,{value:"right",style:{flex:"1"}},{default:se(()=>[_(Z)]),_:1})),[[K,"右对齐"]]),Ge((U(),_e(Kn,{value:"justify",style:{flex:"1"}},{default:se(()=>[_(re)]),_:1})),[[K,"两端对齐"]])]),_:1},8,["value"]),_(Yt),_(K2,{fixed:!0}),_(Yt),V("div",mDe,[yDe,V("div",ADe,[_(qe,{class:"btn",disabled:f.value<=1,onClick:w[9]||(w[9]=G=>x(f.value-1))},{default:se(()=>[_(B)]),_:1},8,["disabled"]),V("div",RDe,pt(f.value),1),_(qe,{class:"btn",disabled:f.value>=30,onClick:w[10]||(w[10]=G=>x(f.value+1))},{default:se(()=>[_(Y)]),_:1},8,["disabled"])])]),V("div",bDe,[xDe,V("div",SDe,[_(qe,{class:"btn",disabled:d.value<=1,onClick:w[11]||(w[11]=G=>S(d.value-1))},{default:se(()=>[_(B)]),_:1},8,["disabled"]),V("div",wDe,pt(d.value),1),_(qe,{class:"btn",disabled:d.value>=30,onClick:w[12]||(w[12]=G=>S(d.value+1))},{default:se(()=>[_(Y)]),_:1},8,["disabled"])])]),_(Yt),V("div",MDe,[LDe,V("div",TDe,[_(ws,{value:c.value,"onUpdate:value":w[13]||(w[13]=G=>A(G))},null,8,["value"])])]),u.value?(U(),ne(Ve,{key:0},[V("div",_De,[_(bp,{"onUpdate:value":w[14]||(w[14]=G=>R({rowHeader:G})),value:u.value.rowHeader,style:{flex:"1"}},{default:se(()=>[De("标题行")]),_:1},8,["value"]),_(bp,{"onUpdate:value":w[15]||(w[15]=G=>R({rowFooter:G})),value:u.value.rowFooter,style:{flex:"1"}},{default:se(()=>[De("汇总行")]),_:1},8,["value"])]),V("div",ODe,[_(bp,{"onUpdate:value":w[16]||(w[16]=G=>R({colHeader:G})),value:u.value.colHeader,style:{flex:"1"}},{default:se(()=>[De("第一列")]),_:1},8,["value"]),_(bp,{"onUpdate:value":w[17]||(w[17]=G=>R({colFooter:G})),value:u.value.colFooter,style:{flex:"1"}},{default:se(()=>[De("最后一列")]),_:1},8,["value"])]),V("div",kDe,[PDe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:u.value.color,"onUpdate:modelValue":w[18]||(w[18]=G=>R({color:G}))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:u.value.color},null,8,["color"])]),_:1})])],64)):Ze("",!0)])}}}),NDe=Ue(CDe,[["__scopeId","data-v-3bf19801"]]),Cq=e=>(rn("data-v-e173eae4"),e=e(),on(),e),IDe={class:"latex-style-panel"},FDe={class:"row"},EDe={class:"row"},XDe=Cq(()=>V("div",{style:{width:"40%"}},"颜色:",-1)),WDe={class:"row"},VDe=Cq(()=>V("div",{style:{width:"40%"}},"粗细:",-1)),DDe=Ee({__name:"LatexStylePanel",setup(e){const t=lt(),{handleElement:n}=We(dt()),r=n,i=ge(!1),{addHistorySnapshot:o}=qt(),a=u=>{n.value&&(t.updateElement({id:n.value.id,props:u}),o())},s=u=>{a({path:u.path,latex:u.latex,width:u.w,height:u.h,viewBox:[u.w,u.h]})},l=()=>i.value=!0;return Bi.on(Si.OPEN_LATEX_EDITOR,l),Fn(()=>{Bi.off(Si.OPEN_LATEX_EDITOR,l)}),(u,c)=>(U(),ne("div",IDe,[V("div",FDe,[_(qe,{style:{flex:"1"},onClick:c[0]||(c[0]=f=>i.value=!0)},{default:se(()=>[De("编辑 LaTeX")]),_:1})]),_(Yt),V("div",EDe,[XDe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:z(r).color,"onUpdate:modelValue":c[1]||(c[1]=f=>a({color:f}))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:z(r).color},null,8,["color"])]),_:1})]),V("div",WDe,[VDe,_(Ko,{min:1,max:3,value:z(r).strokeWidth,"onUpdate:value":c[2]||(c[2]=f=>a({strokeWidth:f})),style:{width:"60%"}},null,8,["value"])]),_(Vv,{visible:i.value,"onUpdate:visible":c[5]||(c[5]=f=>i.value=f),width:880},{default:se(()=>[_(rq,{value:z(r).latex,onClose:c[3]||(c[3]=f=>i.value=!1),onUpdate:c[4]||(c[4]=f=>{s(f),i.value=!1})},null,8,["value"])]),_:1},8,["visible"])]))}}),UDe=Ue(DDe,[["__scopeId","data-v-e173eae4"]]),Nq=e=>(rn("data-v-b289959e"),e=e(),on(),e),BDe={class:"video-style-panel"},YDe=Nq(()=>V("div",{class:"title"},"视频预览封面",-1)),ZDe={class:"background-image-wrapper"},QDe={class:"background-image"},HDe={class:"row"},KDe={class:"row switch-row"},GDe=Nq(()=>V("div",{style:{width:"40%"}},"自动播放:",-1)),zDe={class:"switch-wrapper",style:{width:"60%"}},JDe=Ee({__name:"VideoStylePanel",setup(e){const t=lt(),{handleElement:n}=We(dt()),r=n,{addHistorySnapshot:i}=qt(),o=s=>{n.value&&(t.updateElement({id:n.value.id,props:s}),i())},a=s=>{const l=s[0];l&&zf(l).then(u=>o({poster:u}))};return(s,l)=>{const u=Se("IconPlus");return U(),ne("div",BDe,[YDe,V("div",ZDe,[_(Xh,{onChange:l[0]||(l[0]=c=>a(c))},{default:se(()=>[V("div",QDe,[V("div",{class:"content",style:Le({backgroundImage:z(r).poster?`url(${z(r).poster})`:""})},[_(u)],4)])]),_:1})]),V("div",HDe,[_(qe,{style:{flex:"1"},onClick:l[1]||(l[1]=c=>o({poster:""}))},{default:se(()=>[De("重置封面")]),_:1})]),V("div",KDe,[GDe,V("div",zDe,[_(ws,{value:z(r).autoplay,"onUpdate:value":l[2]||(l[2]=c=>o({autoplay:c}))},null,8,["value"])])])])}}}),$De=Ue(JDe,[["__scopeId","data-v-b289959e"]]),iP=e=>(rn("data-v-685cdba7"),e=e(),on(),e),jDe={class:"audio-style-panel"},qDe={class:"row"},eUe=iP(()=>V("div",{style:{width:"40%"}},"图标颜色:",-1)),tUe={class:"row switch-row"},nUe=iP(()=>V("div",{style:{width:"40%"}},"自动播放:",-1)),rUe={class:"switch-wrapper",style:{width:"60%"}},iUe={class:"row switch-row"},oUe=iP(()=>V("div",{style:{width:"40%"}},"循环播放:",-1)),aUe={class:"switch-wrapper",style:{width:"60%"}},sUe=Ee({__name:"AudioStylePanel",setup(e){const t=lt(),{handleElement:n}=We(dt()),r=n,{addHistorySnapshot:i}=qt(),o=a=>{n.value&&(t.updateElement({id:n.value.id,props:a}),i())};return(a,s)=>(U(),ne("div",jDe,[V("div",qDe,[eUe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:z(r).color,"onUpdate:modelValue":s[0]||(s[0]=l=>o({color:l}))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:z(r).color},null,8,["color"])]),_:1})]),V("div",tUe,[nUe,V("div",rUe,[_(ws,{value:z(r).autoplay,"onUpdate:value":s[1]||(s[1]=l=>o({autoplay:l}))},null,8,["value"])])]),V("div",iUe,[oUe,V("div",aUe,[_(ws,{value:z(r).loop,"onUpdate:value":s[2]||(s[2]=l=>o({loop:l}))},null,8,["value"])])])]))}}),lUe=Ue(sUe,[["__scopeId","data-v-685cdba7"]]),k3=e=>(rn("data-v-6dd86a49"),e=e(),on(),e),uUe={class:"multi-style-panel"},cUe={class:"row"},fUe=k3(()=>V("div",{style:{width:"40%"}},"填充颜色:",-1)),dUe={class:"row"},hUe=k3(()=>V("div",{style:{width:"40%"}},"边框样式:",-1)),pUe={class:"row"},vUe=k3(()=>V("div",{style:{width:"40%"}},"边框颜色:",-1)),gUe={class:"row"},mUe=k3(()=>V("div",{style:{width:"40%"}},"边框粗细:",-1)),yUe=Ee({__name:"MultiStylePanel",setup(e){const t=lt(),{richTextAttrs:n,availableFonts:r,activeElementList:i}=We(dt()),{addHistorySnapshot:o}=qt(),a=(h,p)=>{t.updateElement({id:h,props:p}),o()},s=["12px","14px","16px","18px","20px","22px","24px","28px","32px","36px","40px","44px","48px","54px","60px","66px","72px","76px","80px","88px","96px","104px","112px","120px"],l=ge("#fff"),u=ge({width:0,color:"#fff",style:"solid"}),c=h=>{for(const p of i.value){if((p.type==="text"||p.type==="shape"||p.type==="chart")&&a(p.id,{fill:h}),p.type==="table"){const v=JSON.parse(JSON.stringify(p.data));for(let g=0;g{for(const p of i.value){if(p.type==="text"||p.type==="image"||p.type==="shape"||p.type==="table"||p.type==="chart"){const g={outline:{...p.outline||{width:2,color:"#000",style:"solid"},...h}};a(p.id,g)}p.type==="line"&&a(p.id,h)}u.value={...u.value,...h}},d=(h,p)=>{var v;for(const g of i.value){if((g.type==="text"||g.type==="shape"&&((v=g.text)!=null&&v.content))&&Bi.emit(Si.RICH_TEXT_COMMAND,{target:g.id,action:{command:h,value:p}}),g.type==="table"){const m=JSON.parse(JSON.stringify(g.data));for(let y=0;y{const v=Se("IconFontSize"),g=Se("IconAddText"),m=Se("IconText"),y=Se("IconHighLight"),R=Se("IconAlignTextLeft"),A=Se("IconAlignTextCenter"),x=Se("IconAlignTextRight"),S=Se("IconAlignTextBoth"),T=Cn("tooltip");return U(),ne("div",uUe,[V("div",cUe,[fUe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:l.value,"onUpdate:modelValue":p[0]||(p[0]=w=>c(w))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:l.value},null,8,["color"])]),_:1})]),_(Yt),V("div",dUe,[hUe,_(Ar,{style:{width:"60%"},value:u.value.style||"","onUpdate:value":p[1]||(p[1]=w=>f({style:w})),options:[{label:"实线边框",value:"solid"},{label:"虚线边框",value:"dashed"},{label:"点线边框",value:"dotted"}]},null,8,["value"])]),V("div",pUe,[vUe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:u.value.color,"onUpdate:modelValue":p[2]||(p[2]=w=>f({color:w}))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:u.value.color||"#000"},null,8,["color"])]),_:1})]),V("div",gUe,[mUe,_(Ko,{value:u.value.width||0,"onUpdate:value":p[3]||(p[3]=w=>f({width:w})),style:{width:"60%"}},null,8,["value"])]),_(Yt),_(rP,{class:"row"},{default:se(()=>[_(Ar,{style:{width:"60%"},value:z(n).fontname,search:"",searchLabel:"搜索字体","onUpdate:value":p[4]||(p[4]=w=>d("fontname",w)),options:[...z(r),...z(p2)]},{icon:se(()=>[_(v)]),_:1},8,["value","options"]),_(Ar,{style:{width:"40%"},value:z(n).fontsize,search:"",searchLabel:"搜索字号","onUpdate:value":p[5]||(p[5]=w=>d("fontsize",w)),options:s.map(w=>({label:w,value:w}))},{icon:se(()=>[_(g)]),_:1},8,["value","options"])]),_:1}),_(Dn,{class:"row",passive:""},{default:se(()=>[_(It,{trigger:"click",style:{width:"30%"}},{content:se(()=>[_($n,{modelValue:z(n).color,"onUpdate:modelValue":p[6]||(p[6]=w=>d("color",w))},null,8,["modelValue"])]),default:se(()=>[Ge((U(),_e(yv,{first:"",color:z(n).color},{default:se(()=>[_(m)]),_:1},8,["color"])),[[T,"文字颜色"]])]),_:1}),_(It,{trigger:"click",style:{width:"30%"}},{content:se(()=>[_($n,{modelValue:z(n).backcolor,"onUpdate:modelValue":p[7]||(p[7]=w=>d("backcolor",w))},null,8,["modelValue"])]),default:se(()=>[Ge((U(),_e(yv,{color:z(n).backcolor},{default:se(()=>[_(y)]),_:1},8,["color"])),[[T,"文字高亮"]])]),_:1}),Ge((U(),_e(qe,{class:"font-size-btn",style:{width:"20%"},onClick:p[8]||(p[8]=w=>d("fontsize-add","2"))},{default:se(()=>[_(v),De("+")]),_:1})),[[T,"增大字号"]]),Ge((U(),_e(qe,{last:"",class:"font-size-btn",style:{width:"20%"},onClick:p[9]||(p[9]=w=>d("fontsize-reduce","2"))},{default:se(()=>[_(v),De("-")]),_:1})),[[T,"减小字号"]])]),_:1}),_(lu,{class:"row","button-style":"solid",value:z(n).align,"onUpdate:value":p[10]||(p[10]=w=>d("align",w))},{default:se(()=>[Ge((U(),_e(Kn,{value:"left",style:{flex:"1"}},{default:se(()=>[_(R)]),_:1})),[[T,"左对齐"]]),Ge((U(),_e(Kn,{value:"center",style:{flex:"1"}},{default:se(()=>[_(A)]),_:1})),[[T,"居中"]]),Ge((U(),_e(Kn,{value:"right",style:{flex:"1"}},{default:se(()=>[_(x)]),_:1})),[[T,"右对齐"]]),Ge((U(),_e(Kn,{value:"justify",style:{flex:"1"}},{default:se(()=>[_(S)]),_:1})),[[T,"两端对齐"]])]),_:1},8,["value"])])}}}),AUe=Ue(yUe,[["__scopeId","data-v-6dd86a49"]]),RUe={class:"element-style-panel"},bUe=Ee({__name:"index",setup(e){const t={[Nt.TEXT]:xWe,[Nt.IMAGE]:tVe,[Nt.SHAPE]:RVe,[Nt.LINE]:IVe,[Nt.CHART]:vDe,[Nt.TABLE]:NDe,[Nt.LATEX]:UDe,[Nt.VIDEO]:$De,[Nt.AUDIO]:lUe},{activeElementIdList:n,activeElementList:r,handleElement:i,activeGroupElementId:o}=We(dt()),a=we(()=>{if(n.value.length>1){if(!o.value)return AUe;const s=r.value.find(l=>l.id===o.value);return s&&t[s.type]||null}return i.value&&t[i.value.type]||null});return(s,l)=>(U(),ne("div",RUe,[(U(),_e(uu(a.value)))]))}}),P3=e=>(rn("data-v-eba29c8f"),e=e(),on(),e),xUe={class:"element-positopn-panel"},SUe=P3(()=>V("div",{class:"title"},"层级:",-1)),wUe=P3(()=>V("div",{class:"title"},"对齐:",-1)),MUe={class:"row"},LUe=P3(()=>V("div",{style:{width:"10%"}},null,-1)),TUe={key:0,class:"row"},_Ue={key:1,style:{width:"10%"}},OUe={class:"row"},kUe=P3(()=>V("div",{style:{width:"7%"}},null,-1)),PUe=Ee({__name:"ElementPositionPanel",setup(e){const t=lt(),{handleElement:n,handleElementId:r}=We(dt()),i=ge(0),o=ge(0),a=ge(0),s=ge(0),l=ge(0),u=ge(!1),c=we(()=>n.value&&LK[n.value.type]||20),f=we(()=>{var w;return((w=n.value)==null?void 0:w.type)==="text"&&!n.value.vertical}),d=we(()=>{var w;return((w=n.value)==null?void 0:w.type)==="text"&&n.value.vertical});_t(n,()=>{n.value&&(i.value=Un.round(n.value.left,1),o.value=Un.round(n.value.top,1),u.value="fixedRatio"in n.value&&!!n.value.fixedRatio,n.value.type!=="line"&&(a.value=Un.round(n.value.width,1),s.value=Un.round(n.value.height,1),l.value="rotate"in n.value&&n.value.rotate!==void 0?Un.round(n.value.rotate,1):0))},{deep:!0,immediate:!0});const{orderElement:h}=x2(),{alignElementToCanvas:p}=E4(),{addHistorySnapshot:v}=qt(),g=w=>{const M={left:w};t.updateElement({id:r.value,props:M}),v()},m=w=>{const M={top:w};t.updateElement({id:r.value,props:M}),v()},y=(w,M)=>{if(n.value&&n.value.type==="shape"&&"pathFormula"in n.value&&n.value.pathFormula){const O=Gh[n.value.pathFormula];let P="";return"editable"in O&&O.editable?P=O.formula(w,M,n.value.keypoints):P=O.formula(w,M),{viewBox:[w,M],path:P}}return null},R=w=>{if(!n.value||n.value.type==="line"||d.value)return;let M=s.value;if(u.value){const k=a.value/s.value;M=w/k{if(!n.value||n.value.type==="line"||n.value.type==="table"||f.value)return;let M=a.value;if(u.value){const k=a.value/s.value;M=w*k{const M={rotate:w};t.updateElement({id:r.value,props:M}),v()},S=w=>{const M={fixedRatio:w};t.updateElement({id:r.value,props:M}),v()},T=w=>{let M=Math.floor(l.value/45)*45;w==="+"?M=M+45:w==="-"&&(M=M-45),M<-180&&(M=-180),M>180&&(M=180);const O={rotate:M};t.updateElement({id:r.value,props:O}),v()};return(w,M)=>{const O=Se("IconSendToBack"),P=Se("IconBringToFrontOne"),k=Se("IconBringToFront"),F=Se("IconSentToBack"),C=Se("IconAlignLeft"),I=Se("IconAlignVertically"),N=Se("IconAlignRight"),W=Se("IconAlignTop"),D=Se("IconAlignHorizontally"),Z=Se("IconAlignBottom"),re=Se("IconLock"),B=Se("IconUnlock"),Y=Se("IconRotate"),K=Cn("tooltip");return U(),ne("div",xUe,[SUe,_(Dn,{class:"row"},{default:se(()=>[_(qe,{style:{flex:"1"},onClick:M[0]||(M[0]=G=>z(h)(z(n),z(Fr).TOP))},{default:se(()=>[_(O,{class:"btn-icon"}),De(" 置顶")]),_:1}),_(qe,{style:{flex:"1"},onClick:M[1]||(M[1]=G=>z(h)(z(n),z(Fr).BOTTOM))},{default:se(()=>[_(P,{class:"btn-icon"}),De(" 置底")]),_:1})]),_:1}),_(Dn,{class:"row"},{default:se(()=>[_(qe,{style:{flex:"1"},onClick:M[2]||(M[2]=G=>z(h)(z(n),z(Fr).UP))},{default:se(()=>[_(k,{class:"btn-icon"}),De(" 上移")]),_:1}),_(qe,{style:{flex:"1"},onClick:M[3]||(M[3]=G=>z(h)(z(n),z(Fr).DOWN))},{default:se(()=>[_(F,{class:"btn-icon"}),De(" 下移")]),_:1})]),_:1}),_(Yt),wUe,_(Dn,{class:"row"},{default:se(()=>[Ge((U(),_e(qe,{style:{flex:"1"},onClick:M[4]||(M[4]=G=>z(p)(z(dn).LEFT))},{default:se(()=>[_(C)]),_:1})),[[K,"左对齐"]]),Ge((U(),_e(qe,{style:{flex:"1"},onClick:M[5]||(M[5]=G=>z(p)(z(dn).HORIZONTAL))},{default:se(()=>[_(I)]),_:1})),[[K,"水平居中"]]),Ge((U(),_e(qe,{style:{flex:"1"},onClick:M[6]||(M[6]=G=>z(p)(z(dn).RIGHT))},{default:se(()=>[_(N)]),_:1})),[[K,"右对齐"]])]),_:1}),_(Dn,{class:"row"},{default:se(()=>[Ge((U(),_e(qe,{style:{flex:"1"},onClick:M[7]||(M[7]=G=>z(p)(z(dn).TOP))},{default:se(()=>[_(W)]),_:1})),[[K,"上对齐"]]),Ge((U(),_e(qe,{style:{flex:"1"},onClick:M[8]||(M[8]=G=>z(p)(z(dn).VERTICAL))},{default:se(()=>[_(D)]),_:1})),[[K,"垂直居中"]]),Ge((U(),_e(qe,{style:{flex:"1"},onClick:M[9]||(M[9]=G=>z(p)(z(dn).BOTTOM))},{default:se(()=>[_(Z)]),_:1})),[[K,"下对齐"]])]),_:1}),_(Yt),V("div",MUe,[_(Ko,{step:5,value:i.value,"onUpdate:value":M[10]||(M[10]=G=>g(G)),style:{width:"45%"}},{prefix:se(()=>[De(" 水平: ")]),_:1},8,["value"]),LUe,_(Ko,{step:5,value:o.value,"onUpdate:value":M[11]||(M[11]=G=>m(G)),style:{width:"45%"}},{prefix:se(()=>[De(" 垂直: ")]),_:1},8,["value"])]),z(n).type!=="line"?(U(),ne("div",TUe,[_(Ko,{min:c.value,max:1500,step:5,disabled:d.value,value:a.value,"onUpdate:value":M[12]||(M[12]=G=>R(G)),style:{width:"45%"}},{prefix:se(()=>[De(" 宽度: ")]),_:1},8,["min","disabled","value"]),["image","shape","audio"].includes(z(n).type)?(U(),ne(Ve,{key:0},[u.value?Ge((U(),_e(re,{key:0,style:{width:"10%"},class:"icon-btn active",onClick:M[13]||(M[13]=G=>S(!1))},null,512)),[[K,"解除宽高比锁定"]]):Ge((U(),_e(B,{key:1,style:{width:"10%"},class:"icon-btn",onClick:M[14]||(M[14]=G=>S(!0))},null,512)),[[K,"宽高比锁定"]])],64)):(U(),ne("div",_Ue)),_(Ko,{min:c.value,max:800,step:5,disabled:f.value||z(n).type==="table",value:s.value,"onUpdate:value":M[15]||(M[15]=G=>A(G)),style:{width:"45%"}},{prefix:se(()=>[De(" 高度: ")]),_:1},8,["min","disabled","value"])])):Ze("",!0),["line","video","audio"].includes(z(n).type)?Ze("",!0):(U(),ne(Ve,{key:1},[_(Yt),V("div",OUe,[_(Ko,{min:-180,max:180,step:5,value:l.value,"onUpdate:value":M[16]||(M[16]=G=>x(G)),style:{width:"45%"}},{prefix:se(()=>[De(" 旋转: ")]),_:1},8,["value"]),kUe,V("div",{class:"text-btn",onClick:M[17]||(M[17]=G=>T("-")),style:{width:"24%"}},[_(Y),De(" -45°")]),V("div",{class:"text-btn",onClick:M[18]||(M[18]=G=>T("+")),style:{width:"24%"}},[_(Y,{style:{transform:"rotateY(180deg)"}}),De(" +45°")])])],64))])}}}),CUe=Ue(PUe,[["__scopeId","data-v-eba29c8f"]]),T8=1e3,NUe="click",wa="animate__",tU=[{type:"bounce",name:"弹跳",children:[{name:"弹入",value:"bounceIn"},{name:"向右弹入",value:"bounceInLeft"},{name:"向左弹入",value:"bounceInRight"},{name:"向上弹入",value:"bounceInUp"},{name:"向下弹入",value:"bounceInDown"}]},{type:"fade",name:"浮现",children:[{name:"浮入",value:"fadeIn"},{name:"向下浮入",value:"fadeInDown"},{name:"向下长距浮入",value:"fadeInDownBig"},{name:"向右浮入",value:"fadeInLeft"},{name:"向右长距浮入",value:"fadeInLeftBig"},{name:"向左浮入",value:"fadeInRight"},{name:"向左长距浮入",value:"fadeInRightBig"},{name:"向上浮入",value:"fadeInUp"},{name:"向上长距浮入",value:"fadeInUpBig"},{name:"从左上浮入",value:"fadeInTopLeft"},{name:"从右上浮入",value:"fadeInTopRight"},{name:"从左下浮入",value:"fadeInBottomLeft"},{name:"从右下浮入",value:"fadeInBottomRight"}]},{type:"rotate",name:"旋转",children:[{name:"旋转进入",value:"rotateIn"},{name:"绕左下进入",value:"rotateInDownLeft"},{name:"绕右下进入",value:"rotateInDownRight"},{name:"绕左上进入",value:"rotateInUpLeft"},{name:"绕右上进入",value:"rotateInUpRight"}]},{type:"zoom",name:"缩放",children:[{name:"放大进入",value:"zoomIn"},{name:"向下放大进入",value:"zoomInDown"},{name:"从左放大进入",value:"zoomInLeft"},{name:"从右放大进入",value:"zoomInRight"},{name:"向上放大进入",value:"zoomInUp"}]},{type:"slide",name:"滑入",children:[{name:"向下滑入",value:"slideInDown"},{name:"从右滑入",value:"slideInLeft"},{name:"从左滑入",value:"slideInRight"},{name:"向上滑入",value:"slideInUp"}]},{type:"flip",name:"翻转",children:[{name:"X轴翻转进入",value:"flipInX"},{name:"Y轴翻转进入",value:"flipInY"}]},{type:"back",name:"放大滑入",children:[{name:"向下放大滑入",value:"backInDown"},{name:"从左放大滑入",value:"backInLeft"},{name:"从右放大滑入",value:"backInRight"},{name:"向上放大滑入",value:"backInUp"}]},{type:"lightSpeed",name:"飞入",children:[{name:"从右飞入",value:"lightSpeedInRight"},{name:"从左飞入",value:"lightSpeedInLeft"}]}],nU=[{type:"bounce",name:"弹跳",children:[{name:"弹出",value:"bounceOut"},{name:"向左弹出",value:"bounceOutLeft"},{name:"向右弹出",value:"bounceOutRight"},{name:"向上弹出",value:"bounceOutUp"},{name:"向下弹出",value:"bounceOutDown"}]},{type:"fade",name:"浮现",children:[{name:"浮出",value:"fadeOut"},{name:"向下浮出",value:"fadeOutDown"},{name:"向下长距浮出",value:"fadeOutDownBig"},{name:"向左浮出",value:"fadeOutLeft"},{name:"向左长距浮出",value:"fadeOutLeftBig"},{name:"向右浮出",value:"fadeOutRight"},{name:"向右长距浮出",value:"fadeOutRightBig"},{name:"向上浮出",value:"fadeOutUp"},{name:"向上长距浮出",value:"fadeOutUpBig"},{name:"从左上浮出",value:"fadeOutTopLeft"},{name:"从右上浮出",value:"fadeOutTopRight"},{name:"从左下浮出",value:"fadeOutBottomLeft"},{name:"从右下浮出",value:"fadeOutBottomRight"}]},{type:"rotate",name:"旋转",children:[{name:"旋转退出",value:"rotateOut"},{name:"绕左下退出",value:"rotateOutDownLeft"},{name:"绕右下退出",value:"rotateOutDownRight"},{name:"绕左上退出",value:"rotateOutUpLeft"},{name:"绕右上退出",value:"rotateOutUpRight"}]},{type:"zoom",name:"缩放",children:[{name:"缩小退出",value:"zoomOut"},{name:"向下缩小退出",value:"zoomOutDown"},{name:"从左缩小退出",value:"zoomOutLeft"},{name:"从右缩小退出",value:"zoomOutRight"},{name:"向上缩小退出",value:"zoomOutUp"}]},{type:"slide",name:"滑出",children:[{name:"向下滑出",value:"slideOutDown"},{name:"从左滑出",value:"slideOutLeft"},{name:"从右滑出",value:"slideOutRight"},{name:"向上滑出",value:"slideOutUp"}]},{type:"flip",name:"翻转",children:[{name:"X轴翻转退出",value:"flipOutX"},{name:"Y轴翻转退出",value:"flipOutY"}]},{type:"back",name:"缩小滑出",children:[{name:"向下缩小滑出",value:"backOutDown"},{name:"从左缩小滑出",value:"backOutLeft"},{name:"从右缩小滑出",value:"backOutRight"},{name:"向上缩小滑出",value:"backOutUp"}]},{type:"lightSpeed",name:"飞出",children:[{name:"从右飞出",value:"lightSpeedOutRight"},{name:"从左飞出",value:"lightSpeedOutLeft"}]}],rU=[{type:"shake",name:"晃动",children:[{name:"左右摇晃",value:"shakeX"},{name:"上下摇晃",value:"shakeY"},{name:"摇头",value:"headShake"},{name:"摆动",value:"swing"},{name:"晃动",value:"wobble"},{name:"惊恐",value:"tada"},{name:"果冻",value:"jello"}]},{type:"other",name:"其他",children:[{name:"弹跳",value:"bounce"},{name:"闪烁",value:"flash"},{name:"脉搏",value:"pulse"},{name:"橡皮筋",value:"rubberBand"},{name:"心跳(快)",value:"heartBeat"}]}],Iq=[{label:"无",value:"no"},{label:"随机",value:"random"},{label:"左右推移",value:"slideX"},{label:"上下推移",value:"slideY"},{label:"左右推移(3D)",value:"slideX3D"},{label:"上下推移(3D)",value:"slideY3D"},{label:"淡入淡出",value:"fade"},{label:"旋转",value:"rotate"},{label:"上下展开",value:"scaleY"},{label:"左右展开",value:"scaleX"},{label:"放大",value:"scale"},{label:"缩小",value:"scaleReverse"}],Fq=e=>(rn("data-v-d71f68dd"),e=e(),on(),e),IUe={class:"element-animation-panel"},FUe={key:0,class:"element-animation"},EUe={class:"type-title"},XUe={class:"pool-item-wrapper"},WUe=["onMouseenter","onClick"],VUe={key:0,class:"mask"},DUe={key:1,class:"tip"},UUe={class:"sequence-content"},BUe={class:"index"},YUe={class:"text"},ZUe={class:"handler"},QUe={key:0,class:"configs"},HUe={class:"config-item"},KUe=Fq(()=>V("div",{style:{width:"35%"}},"持续时长:",-1)),GUe={class:"config-item"},zUe=Fq(()=>V("div",{style:{width:"35%"}},"触发方式:",-1)),JUe={class:"config-item"},$Ue=Ee({__name:"ElementAnimationPanel",setup(e){const t={};for(const C of tU)for(const I of C.children)t[I.value]=I.name;for(const C of nU)for(const I of C.children)t[I.value]=I.name;for(const C of rU)for(const I of C.children)t[I.value]=I.name;const n=["in","out","attention"],r=lt(),{handleElement:i,handleElementId:o}=We(dt()),{currentSlide:a,formatedAnimations:s,currentSlideAnimations:l}=We(r),u=[{key:"in",label:"入场",color:"#68a490"},{key:"out",label:"退场",color:"#d86344"},{key:"attention",label:"强调",color:"#e8b76a"}],c=ge("in"),f=ge(!1);_t(()=>o.value,()=>{h.value=!1});const d=ge(""),h=ge(!1),{addHistorySnapshot:p}=qt(),v=we(()=>{const C=[];for(let I=0;IY.id===D.elId);if(!Z)continue;const re=ig[Z.type],B=t[D.effect];C.push({...D,index:W===0?I+1:"",elType:re,animationEffect:B})}}return C}),g=we(()=>l.value.filter(N=>N.elId===o.value)||[]),m=C=>{const I=l.value.filter(N=>N.id!==C);r.updateSlide({animations:I}),p()},y=C=>{const{newIndex:I,oldIndex:N}=C;if(I===void 0||N===void 0||I===N)return;const W=JSON.parse(JSON.stringify(l.value)),D=W[N];W.splice(N,1),W.splice(I,0,D),r.updateSlide({animations:W}),p()},R=(C,I,N)=>{const W=document.querySelector(`#editable-element-${C} [class^=editable-element-]`);if(W){const D=`${wa}${I}`;document.documentElement.style.setProperty("--animate-duration",`${N}ms`),W.classList.add(`${wa}animated`,D);const Z=()=>{document.documentElement.style.removeProperty("--animate-duration"),W.classList.remove(`${wa}animated`,D)};W.addEventListener("animationend",Z,{once:!0})}},A=async()=>{f.value=!f.value;for(let C=0;CsetTimeout(N,I.duration+100)),R(I.elId,I.effect,I.duration),C>=v.value.length-1&&(f.value=!1)}},x=(C,I)=>{if(I<100||I>5e3)return;const N=l.value.map(W=>W.id===C?{...W,duration:I}:W);r.updateSlide({animations:N}),p()},S=(C,I)=>{const N=l.value.map(W=>W.id===C?{...W,trigger:I}:W);r.updateSlide({animations:N}),p()},T=(C,I)=>{const N=l.value.map(Z=>Z.id===w.value?{...Z,type:C,effect:I}:Z);r.updateSlide({animations:N}),h.value=!1,p();const W=l.value.find(Z=>Z.elId===o.value),D=(W==null?void 0:W.duration)||T8;setTimeout(()=>{R(o.value,I,D)},0)},w=ge(""),M=(C,I)=>{if(w.value){T(C,I);return}const N=JSON.parse(JSON.stringify(l.value));N.push({id:yn(10),elId:o.value,type:C,effect:I,duration:T8,trigger:NUe}),r.updateSlide({animations:N}),h.value=!1,p(),setTimeout(()=>{R(o.value,I,T8)},0)},O=ge(!1),P=C=>{C?setTimeout(()=>O.value=!0,600):O.value=!1},k=C=>{h.value=!0,w.value=C,P(!0)},F={in:tU,out:nU,attention:rU};return(C,I)=>{const N=Se("IconEffects"),W=Se("IconClick"),D=Se("IconPlayOne"),Z=Se("IconCloseSmall"),re=Cn("tooltip");return U(),ne("div",IUe,[z(i)?(U(),ne("div",FUe,[_(It,{trigger:"click",value:h.value,"onUpdate:value":[I[3]||(I[3]=B=>h.value=B),I[4]||(I[4]=B=>P(B))],style:{width:"100%"}},{content:se(()=>[_(ol,{tabs:u,value:c.value,"onUpdate:value":I[0]||(I[0]=B=>c.value=B),tabsStyle:{marginBottom:"20px"},tabStyle:{width:"33.333%"},spaceAround:""},null,8,["value"]),(U(),ne(Ve,null,rt(n,B=>(U(),ne(Ve,null,[c.value===B?(U(),ne("div",{class:$e(["animation-pool",B]),key:B},[(U(!0),ne(Ve,null,rt(F[B],Y=>(U(),ne("div",{class:"pool-type",key:Y.name},[V("div",EUe,pt(Y.name)+":",1),V("div",XUe,[(U(!0),ne(Ve,null,rt(Y.children,K=>(U(),ne("div",{class:"pool-item",key:K.name,onMouseenter:G=>d.value=K.value,onMouseleave:I[1]||(I[1]=G=>d.value=""),onClick:G=>M(B,K.value)},[V("div",{class:$e(["animation-box",[`${z(wa)}animated`,`${z(wa)}fast`,d.value===K.value&&`${z(wa)}${K.value}`]])},pt(K.name),3)],40,WUe))),128))])]))),128)),O.value?Ze("",!0):(U(),ne("div",VUe))],2)):Ze("",!0)],64))),64))]),default:se(()=>[_(qe,{class:"element-animation-btn",onClick:I[2]||(I[2]=B=>w.value="")},{default:se(()=>[_(N,{style:{"margin-right":"5px"}}),De(" 添加动画 ")]),_:1})]),_:1},8,["value"])])):(U(),ne("div",DUe,[_(W,{style:{"margin-right":"5px"}}),De(" 选中画布中的元素添加动画")])),_(Yt),_(z($k),{class:"animation-sequence",modelValue:v.value,animation:200,scroll:!0,scrollSensitivity:50,handle:".sequence-content",itemKey:"id",onEnd:y},{item:se(({element:B})=>{var Y,K;return[V("div",{class:$e(["sequence-item",[B.type,{active:((Y=z(i))==null?void 0:Y.id)===B.elId}]])},[V("div",UUe,[V("div",BUe,pt(B.index),1),V("div",YUe,"【"+pt(B.elType)+"】"+pt(B.animationEffect),1),V("div",ZUe,[Ge(_(D,{class:"handler-btn",onClick:G=>R(B.elId,B.effect,B.duration)},null,8,["onClick"]),[[re,"预览"]]),Ge(_(Z,{class:"handler-btn",onClick:G=>m(B.id)},null,8,["onClick"]),[[re,"删除"]])])]),((K=g.value[0])==null?void 0:K.elId)===B.elId?(U(),ne("div",QUe,[_(Yt,{margin:16}),V("div",HUe,[KUe,_(Ko,{min:500,max:3e3,step:500,value:B.duration,"onUpdate:value":G=>x(B.id,G),style:{width:"65%"}},null,8,["value","onUpdate:value"])]),V("div",GUe,[zUe,_(Ar,{value:B.trigger,"onUpdate:value":G=>S(B.id,G),style:{width:"65%"},options:[{label:"主动触发",value:"click"},{label:"与上一动画同时",value:"meantime"},{label:"上一动画之后",value:"auto"}]},null,8,["value","onUpdate:value"])]),V("div",JUe,[_(qe,{style:{width:"100%"},onClick:G=>k(B.id)},{default:se(()=>[De("更换动画")]),_:2},1032,["onClick"])])])):Ze("",!0)],2)]}),_:1},8,["modelValue"]),v.value.length>=2?(U(),ne(Ve,{key:2},[_(Yt),_(qe,{onClick:I[5]||(I[5]=B=>A())},{default:se(()=>[De(pt(f.value?"停止预览":"预览全部"),1)]),_:1})],64)):Ze("",!0)])}}}),jUe=Ue($Ue,[["__scopeId","data-v-d71f68dd"]]),qUe=[{background:"#ffffff",fontColor:"#333333",fontname:"Microsoft Yahei",colors:["#5b9bd5","#ed7d31","#a5a5a5","#ffc000","#4472c4","#70ad47"]},{background:"#ffffff",fontColor:"#333333",fontname:"Microsoft Yahei",colors:["#83992a","#3c9670","#44709d","#a23b32","#d87728","#deb340"]},{background:"#ffffff",fontColor:"#333333",fontname:"Microsoft Yahei",colors:["#e48312","#bd582c","#865640","#9b8357","#c2bc80","#94a088"]},{background:"#ffffff",fontColor:"#333333",fontname:"Microsoft Yahei",colors:["#bdc8df","#003fa9","#f5ba00","#ff7567","#7676d9","#923ffc"]},{background:"#ffffff",fontColor:"#333333",fontname:"Microsoft Yahei",colors:["#90c225","#54a121","#e6b91e","#e86618","#c42f19","#918756"]},{background:"#ffffff",fontColor:"#333333",fontname:"Microsoft Yahei",colors:["#1cade4","#2683c6","#27ced7","#42ba97","#3e8853","#62a39f"]},{background:"#e9efd6",fontColor:"#333333",fontname:"Microsoft Yahei",colors:["#a5300f","#de7e18","#9f8351","#728653","#92aa4c","#6aac91"]},{background:"#17444e",fontColor:"#ffffff",fontname:"Microsoft Yahei",colors:["#b01513","#ea6312","#e6b729","#6bab90","#55839a","#9e5d9d"]},{background:"#36234d",fontColor:"#ffffff",fontname:"Microsoft Yahei",colors:["#b31166","#e33d6f","#e45f3c","#e9943a","#9b6bf2","#d63cd0"]},{background:"#247fad",fontColor:"#ffffff",fontname:"Microsoft Yahei",colors:["#052f61","#a50e82","#14967c","#6a9e1f","#e87d37","#c62324"]},{background:"#103f55",fontColor:"#ffffff",fontname:"Microsoft Yahei",colors:["#40aebd","#97e8d5","#a1cf49","#628f3e","#f2df3a","#fcb01c"]},{background:"#242367",fontColor:"#ffffff",fontname:"Microsoft Yahei",colors:["#ac3ec1","#477bd1","#46b298","#90ba4c","#dd9d31","#e25345"]},{background:"#e4b75e",fontColor:"#333333",fontname:"Microsoft Yahei",colors:["#f0a22e","#a5644e","#b58b80","#c3986d","#a19574","#c17529"]},{background:"#333333",fontColor:"#ffffff",fontname:"Microsoft Yahei",colors:["#bdc8df","#003fa9","#f5ba00","#ff7567","#7676d9","#923ffc"]}],Eq=()=>{const e=lt(),{slides:t,currentSlide:n,theme:r}=We(e),{addHistorySnapshot:i}=qt(),o=d=>{var S,T,w,M,O,P,k,F,C;const h=Array.isArray(d)?d:[d],p=[],v=[],g=[],m=[];for(const I of h){if(I.background)if(I.background.type==="solid"&&I.background.color)p.push({area:1,value:I.background.color});else if(I.background.type==="gradient"&&I.background.gradient){const N=I.background.gradient.colors.length;p.push(...I.background.gradient.colors.map(W=>({area:1/N,value:W.color})))}else p.push({area:1,value:r.value.backgroundColor});for(const N of I.elements){const W=N.width;let D=0;if(N.type==="line"){const[re,B]=N.start,[Y,K]=N.end;D=Math.sqrt(Math.pow(Math.abs(re-Y),2)+Math.pow(Math.abs(B-K),2))}else D=N.height;const Z=W*D;if(N.type==="shape"||N.type==="text"){if(N.fill&&v.push({area:Z,value:N.fill}),N.type==="shape"&&N.gradient){const q=N.gradient.colors.length;v.push(...N.gradient.colors.map(H=>({area:1/q*Z,value:H.color})))}const re=(N.type==="shape"?(S=N.text)==null?void 0:S.content:N.content)||"";if(!re)continue;const B=re.replace(/<[^>]+>/g,"").replace(/\s*/g,""),Y=re.match(/<[^>]+color: .+?<\/.+?>/g),K=re.match(/<[^>]+font-family: .+?<\/.+?>/g);let G=1,ee=1;if(Y)for(const q of Y){const H=q.match(/color: (.+?);/);if(!H)continue;const ue=q.replace(/<[^>]+>/g,"").replace(/\s*/g,""),Ae=H[1],ce=ue.length/B.length;G=G-ce,g.push({area:Z*ce,value:Ae})}if(K)for(const q of K){const H=q.match(/font-family: (.+?);/);if(!H)continue;const ue=q.replace(/<[^>]+>/g,"").replace(/\s*/g,""),Ae=H[1],ce=ue.length/B.length;ee=ee-ce,m.push({area:Z*ce,value:Ae})}if(G){const H=(N.type==="shape"?(T=N.text)==null?void 0:T.defaultColor:N.defaultColor)||r.value.fontColor;g.push({area:Z*G,value:H})}if(ee){const H=(N.type==="shape"?(w=N.text)==null?void 0:w.defaultFontName:N.defaultFontName)||r.value.fontName;m.push({area:Z*ee,value:H})}}else if(N.type==="table"){const re=N.data.length*N.data[0].length;let B=0;for(const Y of N.data)for(const K of Y)if((M=K.style)!=null&&M.backcolor&&(B+=1,v.push({area:Z/re,value:(O=K.style)==null?void 0:O.backcolor})),K.text){const G=K.text.length>=10?1:K.text.length/10;(P=K.style)!=null&&P.color&&g.push({area:Z/re*G,value:(k=K.style)==null?void 0:k.color}),(F=K.style)!=null&&F.fontname&&g.push({area:Z/re*G,value:(C=K.style)==null?void 0:C.fontname})}if(N.theme){const Y=1-B/re;v.push({area:Z*Y,value:N.theme.color})}}else N.type==="chart"?(N.fill&&v.push({area:Z*.5,value:N.fill}),v.push({area:Z*.5,value:N.themeColors[0]})):N.type==="line"?v.push({area:Z,value:N.color}):N.type==="audio"?v.push({area:Z,value:N.color}):N.type==="latex"&&g.push({area:Z,value:N.color})}}const y={};for(const I of p){const N=ot(I.value).toRgbString();N!=="rgba(0, 0, 0, 0)"&&(y[N]?y[N]+=I.area:y[N]=I.area)}const R={};for(const I of v){const N=ot(I.value).toRgbString();N!=="rgba(0, 0, 0, 0)"&&(R[N]?R[N]+=I.area:R[N]=I.area)}const A={};for(const I of g){const N=ot(I.value).toRgbString();N!=="rgba(0, 0, 0, 0)"&&(A[N]?A[N]+=I.area:A[N]=I.area)}const x={};for(const I of m)x[I.value]?x[I.value]+=I.area:x[I.value]=I.area;return{backgroundColors:Object.keys(y).sort((I,N)=>y[N]-y[I]),themeColors:Object.keys(R).sort((I,N)=>R[N]-R[I]),fontColors:Object.keys(A).sort((I,N)=>A[N]-A[I]),fontNames:Object.keys(x).sort((I,N)=>x[N]-x[I])}},a=d=>{const h=[];for(const p of d.elements){if(p.type==="shape"&&ot(p.fill).getAlpha()!==0){const v=ot(p.fill).toRgbString();h.includes(v)||h.push(v)}if(p.type==="text"&&p.fill&&ot(p.fill).getAlpha()!==0){const v=ot(p.fill).toRgbString();h.includes(v)||h.push(v)}if(p.type==="table"&&p.theme&&ot(p.theme.color).getAlpha()!==0){const v=ot(p.theme.color).toRgbString();h.includes(v)||h.push(v)}if(p.type==="chart"&&p.themeColors[0]&&ot(p.themeColors[0]).getAlpha()!==0){const v=ot(p.themeColors[0]).toRgbString();h.includes(v)||h.push(v)}if(p.type==="line"&&ot(p.color).getAlpha()!==0){const v=ot(p.color).toRgbString();h.includes(v)||h.push(v)}if(p.type==="audio"&&ot(p.color).getAlpha()!==0){const v=ot(p.color).toRgbString();h.includes(v)||h.push(v)}}return h},s=(d,h)=>{const p=a(d),v={};if(p.length>h.length){const m=ot(h[0]).analogous(p.length-h.length+10).map(y=>y.toHexString()).slice(1);h.push(...m)}for(let g=0;g{const p=s(d,h.colors);(!d.background||d.background.type!=="image")&&(d.background={type:"solid",color:h.background});for(const v of d.elements){if(v.type==="shape"&&(v.fill=p[ot(v.fill).toRgbString()]||v.fill,v.gradient&&delete v.gradient),v.type==="text"&&(v.fill&&(v.fill=p[ot(v.fill).toRgbString()]||v.fill),v.defaultColor=h.fontColor,v.defaultFontName=h.fontname),v.type==="table"){v.theme&&(v.theme.color=p[ot(v.theme.color).toRgbString()]||v.theme.color);for(const g of v.data)for(const m of g)m.style&&(m.style.color=h.fontColor,m.style.fontname=h.fontname)}v.type==="chart"&&(v.themeColors=[p[ot(v.themeColors[0]).toRgbString()]],v.textColor=h.fontColor),v.type==="line"&&(v.color=p[ot(v.color).toRgbString()]||v.color),v.type==="audio"&&(v.color=p[ot(v.color).toRgbString()]||v.color),v.type==="latex"&&(v.color=h.fontColor)}};return{getSlidesThemeStyles:o,applyPresetThemeToSingleSlide:d=>{const h=JSON.parse(JSON.stringify(n.value));l(h,d),e.updateSlide({background:h.background,elements:h.elements}),i()},applyPresetThemeToAllSlides:d=>{const h=JSON.parse(JSON.stringify(t.value));for(const p of h)l(p,d);e.setTheme({backgroundColor:d.background,themeColor:d.colors[0],fontColor:d.fontColor,fontName:d.fontname}),e.setSlides(h),i()},applyThemeToAllSlides:(d=!1)=>{const h=JSON.parse(JSON.stringify(t.value)),{themeColor:p,backgroundColor:v,fontColor:g,fontName:m,outline:y,shadow:R}=r.value;for(const A of h){(!A.background||A.background.type!=="image")&&(A.background={type:"solid",color:v});for(const x of A.elements)if(d&&("outline"in x&&x.outline&&(x.outline=y),"shadow"in x&&x.shadow&&(x.shadow=R)),x.type==="shape")x.fill=p,x.gradient&&delete x.gradient;else if(x.type==="line")x.color=p;else if(x.type==="text")x.defaultColor=g,x.defaultFontName=m,x.fill&&(x.fill=p);else if(x.type==="table"){x.theme&&(x.theme.color=p);for(const S of x.data)for(const T of S)T.style&&(T.style.color=g,T.style.fontname=m)}else x.type==="chart"?(x.themeColors=[p],x.textColor=g):x.type==="latex"?x.color=g:x.type==="audio"&&(x.color=p)}e.setSlides(h),i()}}},C3=e=>(rn("data-v-724633c2"),e=e(),on(),e),eBe={class:"theme-styles-extract"},tBe={class:"content"},nBe={class:"config-item"},rBe=C3(()=>V("div",{class:"label"},"字体:",-1)),iBe={class:"values"},oBe={class:"handler"},aBe=["onClick"],sBe=["onClick"],lBe={class:"config-item"},uBe=C3(()=>V("div",{class:"label"},"文字颜色:",-1)),cBe={class:"values"},fBe={class:"handler"},dBe=["onClick"],hBe=["onClick"],pBe={class:"config-item"},vBe=C3(()=>V("div",{class:"label"},"背景颜色:",-1)),gBe={class:"values"},mBe={class:"handler"},yBe=["onClick"],ABe=["onClick"],RBe={class:"config-item"},bBe=C3(()=>V("div",{class:"label"},"主题色:",-1)),xBe={class:"values"},SBe={class:"handler"},wBe=["onClick"],MBe=["onClick"],LBe={class:"btns"},TBe=Ee({__name:"ThemeStylesExtract",emits:["close"],setup(e,{emit:t}){const n=t,r=lt(),{slides:i,currentSlide:o}=We(r),{getSlidesThemeStyles:a}=Eq(),s=[{key:"single",label:"从当前页中提取"},{key:"all",label:"从全部幻灯片提取"}],l=ge("single"),u=ge({});jt(()=>{const p={};for(const v of u6)p[v.value]=v.label;for(const v of p2)p[v.value]=v.label;u.value=p});const c=ge({backgroundColors:[],themeColors:[],fontColors:[],fontNames:[]}),f=ge({backgroundColor:0,themeColor:0,fontColor:0,fontName:0});_t(l,()=>{l.value==="single"?c.value=a(o.value):c.value=a(i.value)}),jt(()=>{c.value=a(o.value)});const d=p=>{r.setTheme(p)},h=()=>{r.setTheme({backgroundColor:c.value.backgroundColors[f.value.backgroundColor],themeColor:c.value.themeColors[f.value.themeColor],fontColor:c.value.fontColors[f.value.fontColor],fontName:c.value.fontNames[f.value.fontName]}),n("close")};return(p,v)=>(U(),ne("div",eBe,[_(ol,{tabs:s,value:l.value,"onUpdate:value":v[0]||(v[0]=g=>l.value=g),tabsStyle:{marginBottom:"12px"},tabStyle:{padding:"8px 12px"}},null,8,["value"]),V("div",tBe,[V("div",nBe,[rBe,V("div",iBe,[(U(!0),ne(Ve,null,rt(c.value.fontNames,(g,m)=>(U(),ne("div",{class:"value-wrap",key:g},[V("div",{class:"value",style:Le({fontFamily:g})},pt(u.value[g]||g),5),V("div",oBe,[V("div",{class:$e(["state",{active:f.value.fontName===m}])},"√",2),V("div",{class:"config-btn",onClick:y=>f.value.fontName=m},"选择",8,aBe),V("div",{class:"config-btn",onClick:y=>{d({fontName:g}),f.value.fontName=m}},"配置到主题",8,sBe)])]))),128))])]),V("div",lBe,[uBe,V("div",cBe,[(U(!0),ne(Ve,null,rt(c.value.fontColors,(g,m)=>(U(),ne("div",{class:"value-wrap",key:g},[V("div",{class:"value",style:Le({backgroundColor:g})},null,4),V("div",fBe,[V("div",{class:$e(["state",{active:f.value.fontColor===m}])},"√",2),V("div",{class:"config-btn",onClick:y=>f.value.fontColor=m},"选择",8,dBe),V("div",{class:"config-btn",onClick:y=>{d({fontColor:g}),f.value.fontColor=m}},"配置到主题",8,hBe)])]))),128))])]),V("div",pBe,[vBe,V("div",gBe,[(U(!0),ne(Ve,null,rt(c.value.backgroundColors,(g,m)=>(U(),ne("div",{class:"value-wrap",key:g},[V("div",{class:"value",style:Le({backgroundColor:g})},null,4),V("div",mBe,[V("div",{class:$e(["state",{active:f.value.backgroundColor===m}])},"√",2),V("div",{class:"config-btn",onClick:y=>f.value.backgroundColor=m},"选择",8,yBe),V("div",{class:"config-btn",onClick:y=>{d({backgroundColor:g}),f.value.backgroundColor=m}},"配置到主题",8,ABe)])]))),128))])]),V("div",RBe,[bBe,V("div",xBe,[(U(!0),ne(Ve,null,rt(c.value.themeColors,(g,m)=>(U(),ne("div",{class:"value-wrap",key:g},[V("div",{class:"value",style:Le({backgroundColor:g})},null,4),V("div",SBe,[V("div",{class:$e(["state",{active:f.value.themeColor===m}])},"√",2),V("div",{class:"config-btn",onClick:y=>f.value.themeColor=m},"选择",8,wBe),V("div",{class:"config-btn",onClick:y=>{d({themeColor:g}),f.value.themeColor=m}},"配置到主题",8,MBe)])]))),128))])])]),V("div",LBe,[_(qe,{class:"btn",type:"primary",onClick:v[1]||(v[1]=g=>h())},{default:se(()=>[De("将选中配置保存为主题")]),_:1})])]))}}),_Be=Ue(TBe,[["__scopeId","data-v-724633c2"]]),gi=e=>(rn("data-v-169fa39d"),e=e(),on(),e),OBe={class:"slide-design-panel"},kBe=gi(()=>V("div",{class:"title"},"背景填充",-1)),PBe={class:"row"},CBe=gi(()=>V("div",{style:{width:"10px"}},null,-1)),NBe={key:0,class:"background-image-wrapper"},IBe={class:"background-image"},FBe={key:1,class:"background-gradient-wrapper"},EBe={class:"row"},XBe={class:"row"},WBe=gi(()=>V("div",{style:{width:"40%"}},"当前色块:",-1)),VBe={key:0,class:"row"},DBe=gi(()=>V("div",{style:{width:"40%"}},"渐变角度:",-1)),UBe={class:"row"},BBe={class:"row"},YBe=gi(()=>V("div",{style:{width:"40%"}},"画布尺寸:",-1)),ZBe={class:"title"},QBe=gi(()=>V("span",null,"全局主题",-1)),HBe=gi(()=>V("span",{class:"text"},"更多",-1)),KBe={class:"row"},GBe=gi(()=>V("div",{style:{width:"40%"}},"字体:",-1)),zBe={class:"row"},JBe=gi(()=>V("div",{style:{width:"40%"}},"字体颜色:",-1)),$Be={class:"row"},jBe=gi(()=>V("div",{style:{width:"40%"}},"背景颜色:",-1)),qBe={class:"row"},eYe=gi(()=>V("div",{style:{width:"40%"}},"主题色:",-1)),tYe={class:"row"},nYe=gi(()=>V("div",{style:{width:"40%"}},"边框样式:",-1)),rYe={class:"row"},iYe=gi(()=>V("div",{style:{width:"40%"}},"边框颜色:",-1)),oYe={class:"row"},aYe=gi(()=>V("div",{style:{width:"40%"}},"边框粗细:",-1)),sYe={class:"row",style:{height:"30px"}},lYe=gi(()=>V("div",{style:{width:"40%"}},"水平阴影:",-1)),uYe={class:"row",style:{height:"30px"}},cYe=gi(()=>V("div",{style:{width:"40%"}},"垂直阴影:",-1)),fYe={class:"row",style:{height:"30px"}},dYe=gi(()=>V("div",{style:{width:"40%"}},"模糊距离:",-1)),hYe={class:"row"},pYe=gi(()=>V("div",{style:{width:"40%"}},"阴影颜色:",-1)),vYe={class:"row"},gYe={class:"row"},mYe=gi(()=>V("div",{class:"title"},"预置主题",-1)),yYe={class:"theme-list"},AYe={class:"theme-item-content"},RYe={class:"colors"},bYe={class:"btns"},xYe=Ee({__name:"SlideDesignPanel",setup(e){const t=lt(),{availableFonts:n}=We(dt()),{slides:r,currentSlide:i,viewportRatio:o,theme:a}=We(t),s=ge(!1),l=ge(!1),u=ge(0),c=we(()=>i.value.background?i.value.background:{type:"solid",value:"#fff"}),{addHistorySnapshot:f}=qt(),{applyPresetThemeToSingleSlide:d,applyPresetThemeToAllSlides:h,applyThemeToAllSlides:p}=Eq(),v=w=>{if(w==="solid"){const M={...c.value,type:"solid",color:c.value.color||"#fff"};t.updateSlide({background:M})}else if(w==="image"){const M={...c.value,type:"image",image:c.value.image||{src:"",size:"cover"}};t.updateSlide({background:M})}else{const M={...c.value,type:"gradient",gradient:c.value.gradient||{type:"linear",colors:[{pos:0,color:"#fff"},{pos:100,color:"#fff"}],rotate:0}};u.value=0,t.updateSlide({background:M})}f()},g=w=>{t.updateSlide({background:{...c.value,...w}}),f()},m=w=>{g({gradient:{...c.value.gradient,...w}})},y=w=>{const M=c.value.gradient.colors.map((O,P)=>P===u.value?{...O,color:w}:O);m({colors:M})},R=w=>{g({image:{...c.value.image,...w}})},A=w=>{const M=w[0];M&&zf(M).then(O=>R({src:O}))},x=()=>{const w=r.value.map(M=>({...M,background:i.value.background}));t.setSlides(w),f()},S=w=>{t.setTheme(w)},T=w=>{t.setViewportRatio(w)};return(w,M)=>{var F,C,I,N;const O=Se("IconPlus"),P=Se("IconDown"),k=Se("IconRight");return U(),ne(Ve,null,[V("div",OBe,[kBe,V("div",PBe,[_(Ar,{style:{flex:"1"},value:c.value.type,"onUpdate:value":M[0]||(M[0]=W=>v(W)),options:[{label:"纯色填充",value:"solid"},{label:"图片填充",value:"image"},{label:"渐变填充",value:"gradient"}]},null,8,["value"]),CBe,c.value.type==="solid"?(U(),_e(It,{key:0,trigger:"click",style:{flex:"1"}},{content:se(()=>[_($n,{modelValue:c.value.color,"onUpdate:modelValue":M[1]||(M[1]=W=>g({color:W}))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:c.value.color||"#fff"},null,8,["color"])]),_:1})):c.value.type==="image"?(U(),_e(Ar,{key:1,style:{flex:"1"},value:((F=c.value.image)==null?void 0:F.size)||"cover","onUpdate:value":M[2]||(M[2]=W=>R({size:W})),options:[{label:"缩放",value:"contain"},{label:"拼贴",value:"repeat"},{label:"缩放铺满",value:"cover"}]},null,8,["value"])):(U(),_e(Ar,{key:2,style:{flex:"1"},value:((C=c.value.gradient)==null?void 0:C.type)||"","onUpdate:value":M[3]||(M[3]=W=>m({type:W})),options:[{label:"线性渐变",value:"linear"},{label:"径向渐变",value:"radial"}]},null,8,["value"]))]),c.value.type==="image"?(U(),ne("div",NBe,[_(Xh,{onChange:M[4]||(M[4]=W=>A(W))},{default:se(()=>{var W;return[V("div",IBe,[V("div",{class:"content",style:Le({backgroundImage:`url(${(W=c.value.image)==null?void 0:W.src})`})},[_(O)],4)])]}),_:1})])):Ze("",!0),c.value.type==="gradient"?(U(),ne("div",FBe,[V("div",EBe,[_(Oq,{value:((I=c.value.gradient)==null?void 0:I.colors)||[],"onUpdate:value":M[5]||(M[5]=W=>m({colors:W})),"onUpdate:index":M[6]||(M[6]=W=>u.value=W)},null,8,["value"])]),V("div",XBe,[WBe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:c.value.gradient.colors[u.value].color,"onUpdate:modelValue":M[7]||(M[7]=W=>y(W))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:c.value.gradient.colors[u.value].color},null,8,["color"])]),_:1})]),((N=c.value.gradient)==null?void 0:N.type)==="linear"?(U(),ne("div",VBe,[DBe,_(Yi,{min:0,max:360,step:15,value:c.value.gradient.rotate||0,"onUpdate:value":M[8]||(M[8]=W=>m({rotate:W})),style:{width:"60%"}},null,8,["value"])])):Ze("",!0)])):Ze("",!0),V("div",UBe,[_(qe,{style:{flex:"1"},onClick:M[9]||(M[9]=W=>x())},{default:se(()=>[De("应用背景到全部")]),_:1})]),_(Yt),V("div",BBe,[YBe,_(Ar,{style:{width:"60%"},value:z(o),"onUpdate:value":M[10]||(M[10]=W=>T(W)),options:[{label:"宽屏 16 : 9",value:.5625},{label:"宽屏 16 : 10",value:.625},{label:"标准 4 : 3",value:.75},{label:"纸张 A3 / A4",value:.70710678},{label:"竖向 A3 / A4",value:1.41421356}]},null,8,["value"])]),_(Yt),V("div",ZBe,[QBe,V("span",{class:"more",onClick:M[11]||(M[11]=W=>s.value=!s.value)},[HBe,s.value?(U(),_e(P,{key:0})):(U(),_e(k,{key:1}))])]),V("div",KBe,[GBe,_(Ar,{style:{width:"60%"},value:z(a).fontName,search:"",searchLabel:"搜索字体","onUpdate:value":M[12]||(M[12]=W=>S({fontName:W})),options:[...z(n),...z(p2)]},null,8,["value","options"])]),V("div",zBe,[JBe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:z(a).fontColor,"onUpdate:modelValue":M[13]||(M[13]=W=>S({fontColor:W}))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:z(a).fontColor},null,8,["color"])]),_:1})]),V("div",$Be,[jBe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:z(a).backgroundColor,"onUpdate:modelValue":M[14]||(M[14]=W=>S({backgroundColor:W}))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:z(a).backgroundColor},null,8,["color"])]),_:1})]),V("div",qBe,[eYe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:z(a).themeColor,"onUpdate:modelValue":M[15]||(M[15]=W=>S({themeColor:W}))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:z(a).themeColor},null,8,["color"])]),_:1})]),s.value?(U(),ne(Ve,{key:2},[V("div",tYe,[nYe,_(Ar,{style:{width:"60%"},value:z(a).outline.style||"","onUpdate:value":M[16]||(M[16]=W=>S({outline:{...z(a).outline,style:W}})),options:[{label:"实线边框",value:"solid"},{label:"虚线边框",value:"dashed"},{label:"点线边框",value:"dotted"}]},null,8,["value"])]),V("div",rYe,[iYe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:z(a).outline.color,"onUpdate:modelValue":M[17]||(M[17]=W=>S({outline:{...z(a).outline,color:W}}))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:z(a).outline.color||"#000"},null,8,["color"])]),_:1})]),V("div",oYe,[aYe,_(Ko,{value:z(a).outline.width||0,"onUpdate:value":M[18]||(M[18]=W=>S({outline:{...z(a).outline,width:W}})),style:{width:"60%"}},null,8,["value"])]),V("div",sYe,[lYe,_(Yi,{style:{width:"60%"},min:-10,max:10,step:1,value:z(a).shadow.h,"onUpdate:value":M[19]||(M[19]=W=>S({shadow:{...z(a).shadow,h:W}}))},null,8,["value"])]),V("div",uYe,[cYe,_(Yi,{style:{width:"60%"},min:-10,max:10,step:1,value:z(a).shadow.v,"onUpdate:value":M[20]||(M[20]=W=>S({shadow:{...z(a).shadow,v:W}}))},null,8,["value"])]),V("div",fYe,[dYe,_(Yi,{style:{width:"60%"},min:1,max:20,step:1,value:z(a).shadow.blur,"onUpdate:value":M[21]||(M[21]=W=>S({shadow:{...z(a).shadow,blur:W}}))},null,8,["value"])]),V("div",hYe,[pYe,_(It,{trigger:"click",style:{width:"60%"}},{content:se(()=>[_($n,{modelValue:z(a).shadow.color,"onUpdate:modelValue":M[22]||(M[22]=W=>S({shadow:{...z(a).shadow,color:W}}))},null,8,["modelValue"])]),default:se(()=>[_(Zr,{color:z(a).shadow.color},null,8,["color"])]),_:1})])],64)):Ze("",!0),V("div",vYe,[_(qe,{style:{flex:"1"},onClick:M[23]||(M[23]=W=>z(p)(s.value))},{default:se(()=>[De("应用主题到全部")]),_:1})]),V("div",gYe,[_(qe,{style:{flex:"1"},onClick:M[24]||(M[24]=W=>l.value=!0)},{default:se(()=>[De("从幻灯片提取主题")]),_:1})]),_(Yt),mYe,V("div",yYe,[(U(!0),ne(Ve,null,rt(z(qUe),(W,D)=>(U(),ne("div",{class:"theme-item",key:D,style:Le({backgroundColor:W.background,fontFamily:W.fontname})},[V("div",AYe,[V("div",{class:"text",style:Le({color:W.fontColor})},"文字 Aa",4),V("div",RYe,[(U(!0),ne(Ve,null,rt(W.colors,(Z,re)=>(U(),ne("div",{class:"color-block",key:re,style:Le({backgroundColor:Z})},null,4))),128))]),V("div",bYe,[_(qe,{type:"primary",size:"small",onClick:Z=>z(d)(W)},{default:se(()=>[De("应用")]),_:2},1032,["onClick"]),_(qe,{type:"primary",size:"small",style:{"margin-top":"3px"},onClick:Z=>z(h)(W)},{default:se(()=>[De("应用全局")]),_:2},1032,["onClick"])])])],4))),128))])]),_(Vv,{visible:l.value,"onUpdate:visible":M[26]||(M[26]=W=>l.value=W),width:320,onClosed:M[27]||(M[27]=W=>l.value=!1)},{default:se(()=>[_(_Be,{onClose:M[25]||(M[25]=W=>l.value=!1)})]),_:1},8,["visible"])],64)}}}),SYe=Ue(xYe,[["__scopeId","data-v-169fa39d"]]),wYe={class:"slide-animation-panel"},MYe={class:"animation-pool"},LYe=["onClick"],TYe={class:"animation-text"},_Ye=Ee({__name:"SlideAnimationPanel",setup(e){const t=lt(),{slides:n,currentSlide:r}=We(t),i=we(()=>r.value.turningMode||"slideY"),o=Iq,{addHistorySnapshot:a}=qt(),s=u=>{u!==i.value&&(t.updateSlide({turningMode:u}),a())},l=()=>{const u=n.value.map(c=>({...c,turningMode:r.value.turningMode}));t.setSlides(u),Tn.success("已应用到全部"),a()};return(u,c)=>(U(),ne("div",wYe,[V("div",MYe,[(U(!0),ne(Ve,null,rt(z(o),f=>(U(),ne("div",{class:$e(["animation-item",{active:i.value===f.value}]),key:f.label,onClick:d=>s(f.value)},[V("div",{class:$e(["animation-block",f.value])},null,2),V("div",TYe,pt(f.label),1)],10,LYe))),128))]),_(qe,{style:{width:"100%"},onClick:c[0]||(c[0]=f=>l())},{default:se(()=>[De("应用到全部")]),_:1})]))}}),OYe=Ue(_Ye,[["__scopeId","data-v-ae84c3f4"]]),kYe=()=>{const e=lt(),{activeElementIdList:t,activeElementList:n}=We(dt()),{currentSlide:r}=We(e),{addHistorySnapshot:i}=qt();return{alignActiveElement:a=>{const{minX:s,maxX:l,minY:u,maxY:c}=Uu(n.value),f=JSON.parse(JSON.stringify(r.value.elements)),d={};for(const h of n.value)if(h.groupId&&!d[h.groupId]){const p=n.value.filter(v=>v.groupId===h.groupId);d[h.groupId]=Uu(p)}if(a===dn.LEFT)f.forEach(h=>{if(t.value.includes(h.id))if(h.groupId){const v=d[h.groupId].minX-s;h.left=h.left-v}else if("rotate"in h&&h.rotate){const{offsetX:p}=dp({left:h.left,top:h.top,width:h.width,height:h.height,rotate:h.rotate});h.left=s-p}else h.left=s});else if(a===dn.RIGHT)f.forEach(h=>{if(t.value.includes(h.id))if(h.groupId){const v=d[h.groupId].maxX-l;h.left=h.left-v}else{const p=h.type==="line"?Math.max(h.start[0],h.end[0]):h.width;if("rotate"in h&&h.rotate){const{offsetX:v}=dp({left:h.left,top:h.top,width:h.width,height:h.height,rotate:h.rotate});h.left=l-p+v}else h.left=l-p}});else if(a===dn.TOP)f.forEach(h=>{if(t.value.includes(h.id))if(h.groupId){const v=d[h.groupId].minY-u;h.top=h.top-v}else if("rotate"in h&&h.rotate){const{offsetY:p}=dp({left:h.left,top:h.top,width:h.width,height:h.height,rotate:h.rotate});h.top=u-p}else h.top=u});else if(a===dn.BOTTOM)f.forEach(h=>{if(t.value.includes(h.id))if(h.groupId){const v=d[h.groupId].maxY-c;h.top=h.top-v}else{const p=h.type==="line"?Math.max(h.start[1],h.end[1]):h.height;if("rotate"in h&&h.rotate){const{offsetY:v}=dp({left:h.left,top:h.top,width:h.width,height:h.height,rotate:h.rotate});h.top=c-p+v}else h.top=c-p}});else if(a===dn.HORIZONTAL){const h=(s+l)/2;f.forEach(p=>{if(t.value.includes(p.id))if(p.groupId){const v=d[p.groupId],m=(v.maxX+v.minX)/2-h;p.left=p.left-m}else{const v=p.type==="line"?Math.max(p.start[0],p.end[0]):p.width;p.left=h-v/2}})}else if(a===dn.VERTICAL){const h=(u+c)/2;f.forEach(p=>{if(t.value.includes(p.id))if(p.groupId){const v=d[p.groupId],m=(v.maxY+v.minY)/2-h;p.top=p.top-m}else{const v=p.type==="line"?Math.max(p.start[1],p.end[1]):p.height;p.top=h-v/2}})}e.updateSlide({elements:f}),i()}}},PYe=()=>{const e=lt(),{activeElementIdList:t,activeElementList:n}=We(dt()),{currentSlide:r}=We(e),{addHistorySnapshot:i}=qt();return{displayItemCount:we(()=>{let l=0;const u=[];for(const c of n.value)c.groupId?u.includes(c.groupId)||(u.push(c.groupId),l+=1):l+=1;return l}),uniformHorizontalDisplay:()=>{const{minX:l,maxX:u}=Uu(n.value),c=JSON.parse(JSON.stringify(n.value)),f=JSON.parse(JSON.stringify(r.value.elements)),d=[];let h=[];for(const x of c)if(x.groupId)h.find(T=>T.groupId===x.groupId)?h=h.map(T=>T.groupId===x.groupId?{...T,els:[...T.els,x]}:T):h.push({groupId:x.groupId,els:[x]});else{const{minX:S,maxX:T}=is(x);d.push({min:S,max:T,el:x})}const p=[];for(const x of h){const{minX:S,maxX:T}=Uu(x.els);p.push({min:S,max:T,els:x.els})}const v=[...d,...p];v.sort((x,S)=>x.min-S.min);let g=0;for(const x of v){const S=x.max-x.min;g+=S}const m=(u-l-g)/(v.length-1),y=[],R=v[0];let A={min:R.min,max:R.max};if("el"in R)y.push({pos:R.min,el:R.el});else for(const x of R.els){const{minX:S}=is(x);y.push({pos:S,el:x})}for(let x=1;x{const{minY:l,maxY:u}=Uu(n.value),c=JSON.parse(JSON.stringify(n.value)),f=JSON.parse(JSON.stringify(r.value.elements)),d=[];let h=[];for(const x of c)if(x.groupId)h.find(T=>T.groupId===x.groupId)?h=h.map(T=>T.groupId===x.groupId?{...T,els:[...T.els,x]}:T):h.push({groupId:x.groupId,els:[x]});else{const{minY:S,maxY:T}=is(x);d.push({min:S,max:T,el:x})}const p=[];for(const x of h){const{minY:S,maxY:T}=Uu(x.els);p.push({min:S,max:T,els:x.els})}const v=[...d,...p];v.sort((x,S)=>x.min-S.min);let g=0;for(const x of v){const S=x.max-x.min;g+=S}const m=(u-l-g)/(v.length-1),y=[],R=v[0];let A={min:R.min,max:R.max};if("el"in R)y.push({pos:R.min,el:R.el});else for(const x of R.els){const{minY:S}=is(x);y.push({pos:S,el:x})}for(let x=1;x{t.value?i(c):o(c)};return(c,f)=>{const d=Se("IconAlignLeft"),h=Se("IconAlignHorizontally"),p=Se("IconAlignRight"),v=Se("IconAlignTop"),g=Se("IconAlignVertically"),m=Se("IconAlignBottom"),y=Se("IconGroup"),R=Se("IconUngroup"),A=Cn("tooltip");return U(),ne("div",CYe,[_(Dn,{class:"row"},{default:se(()=>[Ge((U(),_e(qe,{style:{flex:"1"},onClick:f[0]||(f[0]=x=>u(z(dn).LEFT))},{default:se(()=>[_(d)]),_:1})),[[A,"左对齐"]]),Ge((U(),_e(qe,{style:{flex:"1"},onClick:f[1]||(f[1]=x=>u(z(dn).HORIZONTAL))},{default:se(()=>[_(h)]),_:1})),[[A,"水平居中"]]),Ge((U(),_e(qe,{style:{flex:"1"},onClick:f[2]||(f[2]=x=>u(z(dn).RIGHT))},{default:se(()=>[_(p)]),_:1})),[[A,"右对齐"]])]),_:1}),_(Dn,{class:"row"},{default:se(()=>[Ge((U(),_e(qe,{style:{flex:"1"},onClick:f[3]||(f[3]=x=>u(z(dn).TOP))},{default:se(()=>[_(v)]),_:1})),[[A,"上对齐"]]),Ge((U(),_e(qe,{style:{flex:"1"},onClick:f[4]||(f[4]=x=>u(z(dn).VERTICAL))},{default:se(()=>[_(g)]),_:1})),[[A,"垂直居中"]]),Ge((U(),_e(qe,{style:{flex:"1"},onClick:f[5]||(f[5]=x=>u(z(dn).BOTTOM))},{default:se(()=>[_(m)]),_:1})),[[A,"下对齐"]])]),_:1}),z(a)>2?(U(),_e(Dn,{key:0,class:"row"},{default:se(()=>[_(qe,{style:{flex:"1"},onClick:f[6]||(f[6]=x=>z(s)())},{default:se(()=>[De("水平均匀分布")]),_:1}),_(qe,{style:{flex:"1"},onClick:f[7]||(f[7]=x=>z(l)())},{default:se(()=>[De("垂直均匀分布")]),_:1})]),_:1})):Ze("",!0),_(Yt),_(Dn,{class:"row"},{default:se(()=>[_(qe,{disabled:!z(t),onClick:f[8]||(f[8]=x=>z(n)()),style:{flex:"1"}},{default:se(()=>[_(y,{style:{"margin-right":"3px"}}),De("组合")]),_:1},8,["disabled"]),_(qe,{disabled:z(t),onClick:f[9]||(f[9]=x=>z(r)()),style:{flex:"1"}},{default:se(()=>[_(R,{style:{"margin-right":"3px"}}),De("取消组合")]),_:1},8,["disabled"])]),_:1})])}}}),IYe=Ue(NYe,[["__scopeId","data-v-d41009b1"]]),_8=[{key:"letter",label:"字母",children:["α","β","γ","δ","ϵ","ε","ζ","η","θ","ϑ","ι","κ","λ","μ","ν","ξ","π","ϖ","ρ","ϱ","σ","ς","τ","υ","ϕ","φ","χ","ψ","ω","Γ","Δ","Θ","Λ","Ξ","Π","Σ","Υ","Φ","Ψ","Ω","𝐀","𝐁","𝐂","𝐃","𝐄","𝐅","𝐆","𝐇","𝐈","𝐉","𝐊","𝐋","𝐌","𝐍","𝐎","𝐏","𝐐","𝐑","𝐒","𝐓","𝐔","𝐕","𝐖","𝐗","𝐘","𝐙","𝐚","𝐛","𝐜","𝐝","𝐞","𝐟","𝐠","𝐡","𝐢","𝐣","𝐤","𝐥","𝐦","𝐧","𝐨","𝐩","𝐪","𝐫","𝐬","𝐭","𝐮","𝐯","𝐰","𝐱","𝐲","𝐳","𝓐","𝓑","𝓒","𝓓","𝓔","𝓕","𝓖","𝓗","𝓘","𝓙","𝓚","𝓛","𝓜","𝓝","𝓞","𝓟","𝓠","𝓡","𝓢","𝓣","𝓤","𝓥","𝓦","𝓧","𝓨","𝓩","𝓪","𝓫","𝓬","𝓭","𝓮","𝓯","𝓰","𝓱","𝓲","𝓳","𝓴","𝓵","𝓶","𝓷","𝓸","𝓹","𝓺","𝓻","𝓼","𝓽","𝓾","𝓿","𝔀","𝔁","𝔂","𝔃"]},{key:"number",label:"序号",children:["①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩","⑪","⑫","⑬","⑭","⑮","⑯","⑰","⑱","⑲","⑳","⑴","⑵","⑶","⑷","⑸","⑹","⑺","⑻","⑼","⑽","⑾","⑿","⒀","⒁","⒂","⒃","⒄","⒅","⒆","⒇","º","¹","²","³","⁴","⁵","⁶","⁷","⁸","⁹","₀","₁","₂","₃","₄","₅","₆","₇","₈","₉","Ⅰ","Ⅱ","Ⅲ","Ⅳ","Ⅴ","Ⅵ","Ⅶ","Ⅷ","Ⅸ","Ⅹ","Ⅺ","Ⅻ","Ⅼ","Ⅽ","Ⅾ","Ⅿ","ⅰ","ⅱ","ⅲ","ⅳ","ⅴ","ⅵ","ⅶ","ⅷ","ⅸ","ⅹ","ⅺ","ⅻ","ⅼ","ⅽ","ⅾ","ⅿ","ↀ","ↁ","ↂ","㊀","㊁","㊂","㊃","㊄","㊅","㊆","㊇","㊈","㊉","㈠","㈡","㈢","㈣","㈤","㈥","㈦","㈧","㈨","㈩","𝟘","𝟙","𝟚","𝟛","𝟜","𝟝","𝟞","𝟟","𝟠","𝟡"]},{key:"math",label:"数学",children:["+","-","×","÷","=","~","¬","±","%","°","ǃ","‰","‱","½","⅓","⅔","¼","¾","<",">","l","o","g","l","g","l","n","⨂","⨁","⨄","⨃","⨅","⨆","√","∛","∜","∝","∞","∟","∠","∡","∢","∧","∨","∩","∪","∫","∬","∭","∮","∯","∰","∱","∲","∳","∴","∵","∼","∽","∾","∿","≃","≄","≅","≆","≇","≈","≊","≋","≌","≍","≎","≏","≐","≑","≒","≓","≔","≕","≤","≥","≦","≧","≨","≩","≪","≫","≺","≻","≼","≽","≾","≿","⊀","⊁","⊂","⊃","⊄","⊅","⊆","⊇","⊈","⊉","⊊","⊋","⊏","⊐","⊑","⊒","⊓","⊔","⊢","⊣","⊤","⊥","⊦","⊧","⊨","⊩","⊪","⊫","⊬","⊭","⊮","⊯","⊲","⊳","⊴","⊵","⋀","⋁","⋂","⋃","⋉","⋊","⋋","⋌","⟨","⟩","⟪","⟫","⟮","⟯","⧼","⧽","⦰"]},{key:"arrow",label:"箭头",children:["←","↑","→","↓","↔","↕","↖","↗","↘","↙","↚","↛","↜","↝","↞","↟","↠","↡","↢","↣","↤","↥","↦","↧","↨","↫","↬","↭","↮","↯","↰","↱","↲","↳","↴","↵","↶","↷","↸","↹","↺","↻","↼","↽","↾","↿","⇀","⇁","⇂","⇃","⇄","⇅","⇆","⇇","⇈","⇉","⇊","⇋","⇌","⇍","⇎","⇏","⇐","⇑","⇒","⇓","⇔","⇕","⇖","⇗","⇘","⇙","⇚","⇛","⇜","⇝","⇞","⇟","⇠","⇡","⇢","⇣","⇤","⇥","⇦","⇧","⇨","⇩","⇪","⇫","⇬","⇭","⇮","⇯","⇰","⇱","⇲","⇳","⇴","⇵","⇶","⇷","⇸","⇹","⇺","⇻","⇼","⇽","⇾","⇿"]},{key:"graph",label:"图形",children:["▢","▣","▤","▥","▦","▧","▨","▩","▭","▮","▯","▰","▱","▲","▷","▼","◁","◈","◉","◍","◐","◑","◒","◓","◔","◕","◧","◨","◩","◪","◫","◬","◭","◮"]}],FYe={class:"symbol-panel"},EYe={class:"pool"},XYe=["onClick"],WYe={class:"symbol"},VYe=Ee({__name:"SymbolPanel",setup(e){const t=ge(_8[0].key),n=we(()=>{const o=_8.find(a=>a.key===t.value);return(o==null?void 0:o.children)||[]}),r=_8.map(o=>({key:o.key,label:o.label})),i=o=>{Bi.emit(Si.RICH_TEXT_COMMAND,{action:{command:"insert",value:o}})};return(o,a)=>(U(),ne("div",FYe,[_(ol,{tabs:z(r),value:t.value,"onUpdate:value":a[0]||(a[0]=s=>t.value=s),tabsStyle:{marginBottom:"8px"},spaceBetween:""},null,8,["tabs","value"]),V("div",EYe,[(U(!0),ne(Ve,null,rt(n.value,(s,l)=>(U(),ne("div",{class:"symbol-item",key:l,onClick:u=>i(s)},[V("div",WYe,pt(s),1)],8,XYe))),128))])]))}}),DYe=Ue(VYe,[["__scopeId","data-v-0f662bb0"]]),UYe={class:"toolbar"},BYe={class:"content"},YYe=Ee({__name:"index",setup(e){const t=dt(),{activeElementIdList:n,handleElement:r,toolbarState:i}=We(t),o=we(()=>{var f;return((f=r.value)==null?void 0:f.type)==="text"?[{label:"样式",key:zr.EL_STYLE},{label:"符号",key:zr.SYMBOL},{label:"位置",key:zr.EL_POSITION},{label:"动画",key:zr.EL_ANIMATION}]:[{label:"样式",key:zr.EL_STYLE},{label:"位置",key:zr.EL_POSITION},{label:"动画",key:zr.EL_ANIMATION}]}),a=[{label:"设计",key:zr.SLIDE_DESIGN},{label:"切换",key:zr.SLIDE_ANIMATION},{label:"动画",key:zr.EL_ANIMATION}],s=[{label:"样式",key:zr.EL_STYLE},{label:"位置",key:zr.MULTI_POSITION}],l=f=>{t.setToolbarState(f)},u=we(()=>{if(n.value.length){if(n.value.length>1)return s}else return a;return o.value});_t(u,()=>{const f=u.value.map(d=>d.key);f.includes(i.value)||t.setToolbarState(f[0])});const c=we(()=>({[zr.EL_STYLE]:bUe,[zr.EL_POSITION]:CUe,[zr.EL_ANIMATION]:jUe,[zr.SLIDE_DESIGN]:SYe,[zr.SLIDE_ANIMATION]:OYe,[zr.MULTI_POSITION]:IYe,[zr.SYMBOL]:DYe})[i.value]||null);return(f,d)=>(U(),ne("div",UYe,[_(ol,{tabs:u.value,value:z(i),card:"","onUpdate:value":d[0]||(d[0]=h=>l(h))},null,8,["tabs","value"]),V("div",BYe,[(U(),_e(uu(c.value)))])]))}}),ZYe=Ue(YYe,[["__scopeId","data-v-83fff59a"]]),QYe={class:"editor"},HYe=Ee({__name:"Editor",props:{value:{}},emits:["update"],setup(e,{expose:t,emit:n}){const r=e,i=n,o=dt(),a=ge();let s;const l=ge(),u=ge(),c=ge(),f=()=>{u.value&&u.value.hide()},d=Un.debounce(function(){i("update",s.dom.innerHTML)},300,{trailing:!0}),h=()=>{o.setDisableHotkeysState(!0)},p=()=>{o.setDisableHotkeysState(!1)};t({updateTextContent:()=>{if(!s)return;const{doc:y,tr:R}=s.state;s.dispatch(R.replaceRangeWith(0,y.content.size,XO(r.value)))}});const g=()=>{const y=window.getSelection();if(!y||!y.anchorNode||!y.focusNode||y.isCollapsed||y.type==="Caret"||y.type==="None")return;const R=y.getRangeAt(0);if(u.value){l.value=l6(s);const{x:A,y:x,left:S,top:T}=R.getBoundingClientRect();u.value.setProps({getReferenceClientRect:()=>({x:A,y:x,left:S,top:T,height:0,width:0,right:S,bottom:T})}),u.value.show()}},m=(y,R)=>{if(y==="color"&&R){const A=s.state.schema.marks.forecolor.create({color:R});ui(s),Tl(s,A)}else if(y==="backcolor"&&R){const A=s.state.schema.marks.backcolor.create({backcolor:R});ui(s),Tl(s,A)}else if(y==="bold")ui(s),ni(s.state.schema.marks.strong)(s.state,s.dispatch);else if(y==="em")ui(s),ni(s.state.schema.marks.em)(s.state,s.dispatch);else if(y==="underline")ui(s),ni(s.state.schema.marks.underline)(s.state,s.dispatch);else if(y==="strikethrough")ui(s),ni(s.state.schema.marks.strikethrough)(s.state,s.dispatch);else if(y==="bulletList"){const{bullet_list:A,list_item:x}=s.state.schema.nodes;hx(A,x,"")(s.state,s.dispatch)}else if(y==="orderedList"){const{ordered_list:A,list_item:x}=s.state.schema.nodes;hx(A,x,"")(s.state,s.dispatch)}else if(y==="clear"){ui(s);const{$from:A,$to:x}=s.state.selection;s.dispatch(s.state.tr.removeMark(A.pos,x.pos))}s.focus(),d(),l.value=l6(s)};return jt(()=>{s=SG(a.value,r.value,{handleDOMEvents:{focus:h,blur:p,mouseup:g,mousedown:()=>{var y;(y=window.getSelection())==null||y.removeAllRanges(),f()},keydown:f,input:d}},{placeholder:"点击输入演讲者备注"}),u.value=jh(a.value,{duration:0,content:c.value,interactive:!0,trigger:"manual",placement:"top-start",hideOnClick:"toggle",offset:[0,6]})}),Fn(()=>{s&&s.destroy()}),(y,R)=>{var C,I,N,W,D,Z;const A=Se("IconTextBold"),x=Se("IconTextItalic"),S=Se("IconTextUnderline"),T=Se("IconStrikethrough"),w=Se("IconText"),M=Se("IconHighLight"),O=Se("IconList"),P=Se("IconOrderedList"),k=Se("IconFormat"),F=Cn("click-outside");return Ge((U(),ne("div",QYe,[V("div",{class:"prosemirror-editor",ref_key:"editorViewRef",ref:a},null,512),V("div",{class:"menu",ref_key:"menuRef",ref:c},[V("button",{class:$e({active:(C=l.value)==null?void 0:C.bold}),onClick:R[0]||(R[0]=re=>m("bold"))},[_(A)],2),V("button",{class:$e({active:(I=l.value)==null?void 0:I.em}),onClick:R[1]||(R[1]=re=>m("em"))},[_(x)],2),V("button",{class:$e({active:(N=l.value)==null?void 0:N.underline}),onClick:R[2]||(R[2]=re=>m("underline"))},[_(S)],2),V("button",{class:$e({active:(W=l.value)==null?void 0:W.strikethrough}),onClick:R[3]||(R[3]=re=>m("strikethrough"))},[_(T)],2),_(It,{trigger:"click",style:{width:"30%"}},{content:se(()=>{var re;return[_($n,{modelValue:(re=l.value)==null?void 0:re.color,"onUpdate:modelValue":R[4]||(R[4]=B=>m("color",B))},null,8,["modelValue"])]}),default:se(()=>[V("button",null,[_(w)])]),_:1}),_(It,{trigger:"click",style:{width:"30%"}},{content:se(()=>{var re;return[_($n,{modelValue:(re=l.value)==null?void 0:re.backcolor,"onUpdate:modelValue":R[5]||(R[5]=B=>m("backcolor",B))},null,8,["modelValue"])]}),default:se(()=>[V("button",null,[_(M)])]),_:1}),V("button",{class:$e({active:(D=l.value)==null?void 0:D.bulletList}),onClick:R[6]||(R[6]=re=>m("bulletList"))},[_(O)],2),V("button",{class:$e({active:(Z=l.value)==null?void 0:Z.orderedList}),onClick:R[7]||(R[7]=re=>m("orderedList"))},[_(P)],2),V("button",{onClick:R[8]||(R[8]=re=>m("clear"))},[_(k)])],512)])),[[F,f]])}}}),KYe=Ue(HYe,[["__scopeId","data-v-4042a280"]]),GYe={class:"remark"},zYe=Ee({__name:"index",props:{height:{}},emits:["update:height"],setup(e,{emit:t}){const n=e,r=t,i=lt(),{currentSlide:o}=We(i),a=ge();_t(()=>o.value.id,()=>{Qr(()=>{a.value.updateTextContent()})},{immediate:!0});const s=we(()=>{var c;return((c=o.value)==null?void 0:c.remark)||""}),l=c=>{i.updateSlide({remark:c})},u=c=>{let f=!0;const d=c.pageY,h=n.height;document.onmousemove=p=>{if(!f)return;let m=-(p.pageY-d)+h;m<40&&(m=40),m>360&&(m=360),r("update:height",m)},document.onmouseup=()=>{f=!1,document.onmousemove=null,document.onmouseup=null}};return(c,f)=>(U(),ne("div",GYe,[V("div",{class:"resize-handler",onMousedown:f[0]||(f[0]=d=>u(d))},null,32),_(KYe,{value:s.value,ref_key:"editorRef",ref:a,onUpdate:f[1]||(f[1]=d=>l(d))},null,8,["value"])]))}}),JYe=Ue(zYe,[["__scopeId","data-v-1c52a472"]]);var Xq={exports:{}};(function(e,t){(function(n,r){r()})(Ft,function(){function n(u,c){return typeof c>"u"?c={autoBom:!1}:typeof c!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),c={autoBom:!c}),c.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(u.type)?new Blob(["\uFEFF",u],{type:u.type}):u}function r(u,c,f){var d=new XMLHttpRequest;d.open("GET",u),d.responseType="blob",d.onload=function(){l(d.response,c,f)},d.onerror=function(){console.error("could not download file")},d.send()}function i(u){var c=new XMLHttpRequest;c.open("HEAD",u,!1);try{c.send()}catch{}return 200<=c.status&&299>=c.status}function o(u){try{u.dispatchEvent(new MouseEvent("click"))}catch{var c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),u.dispatchEvent(c)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Ft=="object"&&Ft.global===Ft?Ft:void 0,s=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(u,c,f){var d=a.URL||a.webkitURL,h=document.createElement("a");c=c||u.name||"download",h.download=c,h.rel="noopener",typeof u=="string"?(h.href=u,h.origin===location.origin?o(h):i(h.href)?r(u,c,f):o(h,h.target="_blank")):(h.href=d.createObjectURL(u),setTimeout(function(){d.revokeObjectURL(h.href)},4e4),setTimeout(function(){o(h)},0))}:"msSaveOrOpenBlob"in navigator?function(u,c,f){if(c=c||u.name||"download",typeof u!="string")navigator.msSaveOrOpenBlob(n(u,f),c);else if(i(u))r(u,c,f);else{var d=document.createElement("a");d.href=u,d.target="_blank",setTimeout(function(){o(d)})}}:function(u,c,f,d){if(d=d||open("","_blank"),d&&(d.document.title=d.document.body.innerText="downloading..."),typeof u=="string")return r(u,c,f);var h=u.type==="application/octet-stream",p=/constructor/i.test(a.HTMLElement)||a.safari,v=/CriOS\/[\d]+/.test(navigator.userAgent);if((v||h&&p||s)&&typeof FileReader<"u"){var g=new FileReader;g.onloadend=function(){var R=g.result;R=v?R:R.replace(/^data:[^;]*;/,"data:attachment/file;"),d?d.location.href=R:location=R,d=null},g.readAsDataURL(u)}else{var m=a.URL||a.webkitURL,y=m.createObjectURL(u);d?d.location=y:location.href=y,d=null,setTimeout(function(){m.revokeObjectURL(y)},4e4)}});a.saveAs=l.saveAs=l,e.exports=l})})(Xq);var O8=Xq.exports,Wq={exports:{}};/*! JSZip v3.10.1 - A JavaScript class for generating and reading zip files @@ -327,7 +327,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE `)}function FZe(e,t){var n=t.map(function(r,i){return{target:"../slideLayouts/slideLayout".concat(i+1,".xml"),type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout"}});return n.push({target:"../theme/theme1.xml",type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"}),lP(e,n)}function EZe(){return''.concat(Ti,` `)}function XZe(e,t,n){for(var r=0;r'):'',a=!((r=e.theme)===null||r===void 0)&&r.bodyFontFace?''):'';return''.concat(o,'').concat(a,'')}function VZe(e){var t=''.concat(Ti)+'');t+='',t+="",e.slides.forEach(function(r){return t+='')}),t+="",t+=''),t+=''),t+=''),t+="";for(var n=1;n<10;n++)t+="')+''+"");return t+="",e.sections&&e.sections.length>0&&(t+='',t+='',e.sections.forEach(function(r){t+=''),r._slides.forEach(function(i){return t+='')}),t+=""}),t+="",t+='',t+=""),t+="",t}function DZe(){return''.concat(Ti,'')}function UZe(){return''.concat(Ti,'')}function BZe(){return''.concat(Ti,'')}var YZe="3.12.0",ZZe=function(){function e(){var t=this;this._version=YZe,this._alignH=KT,this._alignV=GT,this._chartType=QT,this._outputType=ZT,this._schemeColor=ba,this._shapeType=HT,this._charts=ut,this._colors=zT,this._shapes=Qf,this.addNewSlide=function(a){var s=t.sections.length>0&&t.sections[t.sections.length-1]._slides.filter(function(l){return l._slideNum===t.slides[t.slides.length-1]._slideNum}).length>0;return a.sectionTitle=s?t.sections[t.sections.length-1].title:null,t.addSlide(a)},this.getSlide=function(a){return t.slides.filter(function(s){return s._slideNum===a})[0]},this.setSlideNumber=function(a){t.masterSlide._slideNumberProps=a,t.slideLayouts.filter(function(s){return s._name===BT})[0]._slideNumberProps=a},this.createChartMediaRels=function(a,s,l){a._relsChart.forEach(function(u){return l.push(vZe(u,s))}),a._relsMedia.forEach(function(u){if(u.type!=="online"&&u.type!=="hyperlink"){var c=u.data&&typeof u.data=="string"?u.data:"";!c.includes(",")&&!c.includes(";")?c="image/png;base64,"+c:c.includes(",")?c.includes(";")||(c="image/png;"+c):c="image/png;base64,"+c,s.file(u.Target.replace("..","ppt"),c.split(",").pop(),{base64:!0})}})},this.writeFileToBrowser=function(a,s){return Ol(t,void 0,void 0,function(){var l,u;return kl(this,function(c){switch(c.label){case 0:return l=document.createElement("a"),l.setAttribute("style","display:none;"),l.dataset.interception="off",document.body.appendChild(l),window.URL.createObjectURL?(u=window.URL.createObjectURL(new Blob([s],{type:"application/vnd.openxmlformats-officedocument.presentationml.presentation"})),l.href=u,l.download=a,l.click(),setTimeout(function(){window.URL.revokeObjectURL(u),document.body.removeChild(l)},100),[4,Promise.resolve(a)]):[3,2];case 1:return[2,c.sent()];case 2:return[2]}})})},this.exportPresentation=function(a){return Ol(t,void 0,void 0,function(){var s,l,u,c=this;return kl(this,function(f){switch(f.label){case 0:return s=[],l=[],u=new Vq,this.slides.forEach(function(d){l=l.concat(F8(d))}),this.slideLayouts.forEach(function(d){l=l.concat(F8(d))}),l=l.concat(F8(this.masterSlide)),[4,Promise.all(l).then(function(){return Ol(c,void 0,void 0,function(){var d=this;return kl(this,function(h){switch(h.label){case 0:return this.slides.forEach(function(p){p._slideLayout&&hZe(p)}),u.folder("_rels"),u.folder("docProps"),u.folder("ppt").folder("_rels"),u.folder("ppt/charts").folder("_rels"),u.folder("ppt/embeddings"),u.folder("ppt/media"),u.folder("ppt/slideLayouts").folder("_rels"),u.folder("ppt/slideMasters").folder("_rels"),u.folder("ppt/slides").folder("_rels"),u.folder("ppt/theme"),u.folder("ppt/notesMasters").folder("_rels"),u.folder("ppt/notesSlides").folder("_rels"),u.file("[Content_Types].xml",bZe(this.slides,this.slideLayouts,this.masterSlide)),u.file("_rels/.rels",xZe()),u.file("docProps/app.xml",SZe(this.slides,this.company)),u.file("docProps/core.xml",wZe(this.title,this.subject,this.author,this.revision)),u.file("ppt/_rels/presentation.xml.rels",MZe(this.slides)),u.file("ppt/theme/theme1.xml",WZe(this)),u.file("ppt/presentation.xml",VZe(this)),u.file("ppt/presProps.xml",DZe()),u.file("ppt/tableStyles.xml",UZe()),u.file("ppt/viewProps.xml",BZe()),this.slideLayouts.forEach(function(p,v){u.file("ppt/slideLayouts/slideLayout".concat(v+1,".xml"),kZe(p)),u.file("ppt/slideLayouts/_rels/slideLayout".concat(v+1,".xml.rels"),CZe(v+1,d.slideLayouts))}),this.slides.forEach(function(p,v){u.file("ppt/slides/slide".concat(v+1,".xml"),LZe(p)),u.file("ppt/slides/_rels/slide".concat(v+1,".xml.rels"),NZe(d.slides,d.slideLayouts,v+1)),u.file("ppt/notesSlides/notesSlide".concat(v+1,".xml"),OZe(p)),u.file("ppt/notesSlides/_rels/notesSlide".concat(v+1,".xml.rels"),IZe(v+1))}),u.file("ppt/slideMasters/slideMaster1.xml",PZe(this.masterSlide,this.slideLayouts)),u.file("ppt/slideMasters/_rels/slideMaster1.xml.rels",FZe(this.masterSlide,this.slideLayouts)),u.file("ppt/notesMasters/notesMaster1.xml",_Ze()),u.file("ppt/notesMasters/_rels/notesMaster1.xml.rels",EZe()),this.slideLayouts.forEach(function(p){d.createChartMediaRels(p,u,s)}),this.slides.forEach(function(p){d.createChartMediaRels(p,u,s)}),this.createChartMediaRels(this.masterSlide,u,s),[4,Promise.all(s).then(function(){return Ol(d,void 0,void 0,function(){return kl(this,function(p){switch(p.label){case 0:return a.outputType!=="STREAM"?[3,2]:[4,u.generateAsync({type:"nodebuffer",compression:a.compression?"DEFLATE":"STORE"})];case 1:return[2,p.sent()];case 2:return a.outputType?[4,u.generateAsync({type:a.outputType})]:[3,4];case 3:return[2,p.sent()];case 4:return[4,u.generateAsync({type:"blob",compression:a.compression?"DEFLATE":"STORE"})];case 5:return[2,p.sent()]}})})})];case 1:return[2,h.sent()]}})})})];case 1:return[2,f.sent()]}})})};var n={name:"screen4x3",width:9144e3,height:6858e3},r={name:"screen16x9",width:9144e3,height:5143500},i={name:"screen16x10",width:9144e3,height:5715e3},o={name:"custom",width:12192e3,height:6858e3};this.LAYOUTS={LAYOUT_4x3:n,LAYOUT_16x9:r,LAYOUT_16x10:i,LAYOUT_WIDE:o},this._author="PptxGenJS",this._company="PptxGenJS",this._revision="1",this._subject="PptxGenJS Presentation",this._title="PptxGenJS Presentation",this._presLayout={name:this.LAYOUTS[K0].name,_sizeW:this.LAYOUTS[K0].width,_sizeH:this.LAYOUTS[K0].height,width:this.LAYOUTS[K0].width,height:this.LAYOUTS[K0].height},this._rtlMode=!1,this._slideLayouts=[{_margin:i2,_name:BT,_presLayout:this._presLayout,_rels:[],_relsChart:[],_relsMedia:[],_slide:null,_slideNum:1e3,_slideNumberProps:null,_slideObjects:[]}],this._slides=[],this._sections=[],this._masterSlide={addChart:null,addImage:null,addMedia:null,addNotes:null,addShape:null,addTable:null,addText:null,_name:null,_presLayout:this._presLayout,_rId:null,_rels:[],_relsChart:[],_relsMedia:[],_slideId:null,_slideLayout:null,_slideNum:null,_slideNumberProps:null,_slideObjects:[]}}return Object.defineProperty(e.prototype,"layout",{get:function(){return this._layout},set:function(t){var n=this.LAYOUTS[t];if(n)this._layout=t,this._presLayout=n;else throw new Error("UNKNOWN-LAYOUT")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"author",{get:function(){return this._author},set:function(t){this._author=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"company",{get:function(){return this._company},set:function(t){this._company=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"revision",{get:function(){return this._revision},set:function(t){this._revision=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subject",{get:function(){return this._subject},set:function(t){this._subject=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"theme",{get:function(){return this._theme},set:function(t){this._theme=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return this._title},set:function(t){this._title=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rtlMode",{get:function(){return this._rtlMode},set:function(t){this._rtlMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"masterSlide",{get:function(){return this._masterSlide},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"slides",{get:function(){return this._slides},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sections",{get:function(){return this._sections},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"slideLayouts",{get:function(){return this._slideLayouts},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"AlignH",{get:function(){return this._alignH},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"AlignV",{get:function(){return this._alignV},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ChartType",{get:function(){return this._chartType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"OutputType",{get:function(){return this._outputType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"presLayout",{get:function(){return this._presLayout},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SchemeColor",{get:function(){return this._schemeColor},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ShapeType",{get:function(){return this._shapeType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"charts",{get:function(){return this._charts},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"colors",{get:function(){return this._colors},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shapes",{get:function(){return this._shapes},enumerable:!1,configurable:!0}),e.prototype.stream=function(t){return Ol(this,void 0,void 0,function(){return kl(this,function(n){switch(n.label){case 0:return[4,this.exportPresentation({compression:t==null?void 0:t.compression,outputType:"STREAM"})];case 1:return[2,n.sent()]}})})},e.prototype.write=function(t){return Ol(this,void 0,void 0,function(){var n,r;return kl(this,function(i){switch(i.label){case 0:return n=typeof t=="object"&&(t!=null&&t.outputType)?t.outputType:t||null,r=typeof t=="object"&&(t!=null&&t.compression)?t.compression:!1,[4,this.exportPresentation({compression:r,outputType:n})];case 1:return[2,i.sent()]}})})},e.prototype.writeFile=function(t){return Ol(this,void 0,void 0,function(){var n,r,i,o,a=this;return kl(this,function(s){switch(s.label){case 0:return n=typeof require<"u"&&typeof window>"u"?require("fs"):null,typeof t=="string"&&console.log("Warning: `writeFile(filename)` is deprecated - please use `WriteFileProps` argument (v3.5.0)"),r=typeof t=="object"&&(t!=null&&t.fileName)?t.fileName:typeof t=="string"?t:"",i=typeof t=="object"&&(t!=null&&t.compression)?t.compression:!1,o=r?r.toString().toLowerCase().endsWith(".pptx")?r:r+".pptx":"Presentation.pptx",[4,this.exportPresentation({compression:i,outputType:n?"nodebuffer":null}).then(function(l){return Ol(a,void 0,void 0,function(){return kl(this,function(u){switch(u.label){case 0:return n?[4,new Promise(function(c,f){n.writeFile(o,l,function(d){d?f(d):c(o)})})]:[3,2];case 1:return[2,u.sent()];case 2:return[4,this.writeFileToBrowser(o,l)];case 3:return[2,u.sent()]}})})})];case 1:return[2,s.sent()]}})})},e.prototype.addSection=function(t){t?t.title||console.warn("addSection requires a title"):console.warn("addSection requires an argument");var n={_type:"user",_slides:[],title:t.title};t.order?this.sections.splice(t.order,0,n):this._sections.push(n)},e.prototype.addSlide=function(t){var n=typeof t=="string"?t:t!=null&&t.masterName?t.masterName:"",r={_name:this.LAYOUTS[K0].name,_presLayout:this.presLayout,_rels:[],_relsChart:[],_relsMedia:[],_slideNum:this.slides.length+1};if(n){var i=this.slideLayouts.filter(function(l){return l._name===n})[0];i&&(r=i)}var o=new pZe({addSlide:this.addNewSlide,getSlide:this.getSlide,presLayout:this.presLayout,setSlideNum:this.setSlideNumber,slideId:this.slides.length+256,slideRId:this.slides.length+2,slideNumber:this.slides.length+1,slideLayout:r});if(this._slides.push(o),t!=null&&t.sectionTitle){var a=this.sections.filter(function(l){return l.title===t.sectionTitle})[0];a?a._slides.push(o):console.warn('addSlide: unable to find section with title: "'.concat(t.sectionTitle,'"'))}else if(this.sections&&this.sections.length>0&&!(t!=null&&t.sectionTitle)){var s=this._sections[this.sections.length-1];s._type==="default"?s._slides.push(o):this._sections.push({title:"Default-".concat(this.sections.filter(function(l){return l._type==="default"}).length+1),_type:"default",_slides:[o]})}return o},e.prototype.defineLayout=function(t){t?t.name?t.width?t.height?typeof t.height!="number"?console.warn("defineLayout `height` should be a number (inches)"):typeof t.width!="number"&&console.warn("defineLayout `width` should be a number (inches)"):console.warn("defineLayout requires `height`"):console.warn("defineLayout requires `width`"):console.warn("defineLayout requires `name`"):console.warn("defineLayout requires `{name, width, height}`"),this.LAYOUTS[t.name]={name:t.name,_sizeW:Math.round(Number(t.width)*zt),_sizeH:Math.round(Number(t.height)*zt),width:Math.round(Number(t.width)*zt),height:Math.round(Number(t.height)*zt)}},e.prototype.defineSlideMaster=function(t){if(!t.title)throw new Error("defineSlideMaster() object argument requires a `title` value. (https://gitbrent.github.io/PptxGenJS/docs/masters.html)");var n={_margin:t.margin||i2,_name:t.title,_presLayout:this.presLayout,_rels:[],_relsChart:[],_relsMedia:[],_slide:null,_slideNum:1e3+this.slideLayouts.length+1,_slideNumberProps:t.slideNumber||null,_slideObjects:[],background:t.background||null,bkgd:t.bkgd||null};uZe(t,n),this.slideLayouts.push(n),(t.background||t.bkgd)&&Kq(t.background,n),n._slideNumberProps&&!this.masterSlide._slideNumberProps&&(this.masterSlide._slideNumberProps=n._slideNumberProps)},e.prototype.tableToSlides=function(t,n){n===void 0&&(n={}),sZe(this,t,n,n!=null&&n.masterSlideName?this.slideLayouts.filter(function(r){return r._name===n.masterSlideName})[0]:null)},e}();const QZe=["style","script","template"],HZe=["html","head","body","p","dt","dd","li","option","thead","th","tbody","tr","td","tfoot","colgroup"],KZe={li:["ul","ol","menu"],dt:["dl"],dd:["dl"],tbody:["table"],thead:["table"],tfoot:["table"],tr:["table"],td:["table"]},GZe=["!doctype","area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],Lh=(e,t)=>{const n=t-e.position;Jx(e,n)},Jx=(e,t)=>{e.position=e.position+t},zZe=(e,t)=>{for(;;){const r=e.indexOf("<",t);if(r===-1)return r;const i=e.charAt(r+1);if(i==="/"||i==="!"||/[A-Za-z0-9]/.test(i))return r;t=r+1}return-1},zq=e=>{const{str:t}=e;let n=zZe(t,e.position);if(n===e.position)return;n===-1&&(n=t.length);const r=t.slice(e.position,n);Lh(e,n),e.tokens.push({type:"text",content:r})},JZe=e=>{const{str:t}=e;Jx(e,4);let n=t.indexOf("-->",e.position),r=n+3;n===-1&&(n=r=t.length);const i=t.slice(e.position,n);Lh(e,r),e.tokens.push({type:"comment",content:i})},$Ze=e=>{const{str:t}=e,n=t.length;let r=e.position;for(;r"))break;r++}let i=r+1;for(;i"))break;i++}Lh(e,i);const o=t.slice(r,i);return e.tokens.push({type:"tag",content:o}),o},jZe=e=>{const{str:t,tokens:n}=e;let r=e.position,i=null,o=r;const a=[],s=t.length;for(;r"){r!==o&&a.push(t.slice(o,r));break}if(/\s/.test(u)){r!==o&&a.push(t.slice(o,r)),o=r+1,r++;continue}if(u==="'"||u==='"'){i=u,r++;continue}r++}Lh(e,r);const l="attribute";for(let u=0;u1){const p=c+d;n.push({type:l,content:p}),u+=1;continue}const h=a[u+2];if(u+=1,h){const p=c+"="+h;n.push({type:l,content:p}),u+=1;continue}}}if(Un.endsWith(c,"=")){const d=a[u+1];if(d&&d.indexOf("=")===-1){const p=c+d;n.push({type:l,content:p}),u+=1;continue}const h=c.slice(0,-1);n.push({type:l,content:h});continue}n.push({type:l,content:c})}},qZe=(e,t)=>{const{str:n,tokens:r}=t,i=e.toLowerCase(),o=n.length;let a=t.position;for(;a{const{str:t}=e,r=t.charAt(e.position+1)==="/";Jx(e,r?2:1),e.tokens.push({type:"tag-start",close:r});const i=$Ze(e);jZe(e);const a=t.charAt(e.position)==="/";return Jx(e,a?2:1),e.tokens.push({type:"tag-end",close:a}),i},eQe=e=>{const t=e.str,n=t.length;for(;e.position{const t={str:e,position:0,tokens:[]};return eQe(t),t.tokens},nQe=e=>{const t={tagName:null,children:[]};return $q({tokens:e,cursor:0,stack:[t]}),t.children},rQe=(e,t)=>{const n=KZe[e];if(n){let r=t.length-1;for(;r>=0;){const i=t[r].tagName;if(i===e)break;if(i&&n.includes(i))return!0;r--}}return!1},uU=(e,t)=>{e.splice(t)},$q=e=>{const{stack:t,tokens:n}=e;let{cursor:r}=e,i=t[t.length-1].children;const o=n.length;for(;r-1;)if(t[g].tagName===l){m=!0;break}for(;r0;){if(l===t[g].tagName){uU(t,g);const m=g-1;i=t[m].children;break}g=g-1}}const f=[];let d;for(;r{const n=e.indexOf(t);return n===-1?[e]:[e.slice(0,n),e.slice(n+t.length)]},oQe=e=>{const t=e.charAt(0),n=e.length-1;return(t==='"'||t==="'")&&t===e.charAt(n)?e.slice(1,n):e},aQe=e=>e.map(t=>{const n=iQe(t.trim(),"="),r=n[0],i=typeof n[1]=="string"?oQe(n[1]):null;return{key:r,value:i}}),jq=e=>e.map(t=>{if(t.type==="element"){const r=jq(t.children);return{type:"element",tagName:t.tagName.toLowerCase(),attributes:aQe(t.attributes),children:r}}return{type:t.type,content:t.content}}),sQe=e=>{const t=tQe(e),n=nQe(t);return jq(n)},bR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",lQe="data:image/svg+xml;base64,",uQe=e=>{e=e.replace(/\r\n/g,` -`);let t="";for(let n=0;n127&&r<2048?(t+=String.fromCharCode(r>>6|192),t+=String.fromCharCode(r&63|128)):(t+=String.fromCharCode(r>>12|224),t+=String.fromCharCode(r>>6&63|128),t+=String.fromCharCode(r&63|128))}return t},cQe=e=>{let t="",n,r,i,o,a,s,l,u=0;for(e=uQe(e);u>2,a=(n&3)<<4|r>>4,s=(r&15)<<2|i>>6,l=i&63,isNaN(r)?s=l=64:isNaN(i)&&(l=64),t=t+bR.charAt(o)+bR.charAt(a)+bR.charAt(s)+bR.charAt(l);return t},cU=e=>{const n=new XMLSerializer().serializeToString(e);return lQe+cQe(n)},I3=()=>{const e=lt(),{slides:t,theme:n,viewportRatio:r,title:i,viewportSize:o}=We(e),a=we(()=>96*(o.value/960)),s=we(()=>96/72*(o.value/960)),l=ge(!1),u=(x,S,T,w=!0)=>{l.value=!0;const M=S==="png"?SEe:wEe;x.querySelectorAll("foreignObject [xmlns]").forEach(P=>P.removeAttribute("xmlns")),setTimeout(()=>{const P={quality:T,width:1600};w&&(P.fontEmbedCSS=""),M(x,P).then(k=>{l.value=!1,O8.saveAs(k,`${i.value}.${S}`)}).catch(()=>{l.value=!1,Tn.error("导出图片失败")})},200)},c=x=>{const S=new Blob([K_(JSON.stringify(x))],{type:""});O8.saveAs(S,`${i.value}.pptist`)},f=()=>{const x=new Blob([JSON.stringify(t.value)],{type:""});O8.saveAs(x,`${i.value}.json`)},d=x=>{const S=ot(x),T=S.getAlpha(),w=T===0?"#ffffff":S.setAlpha(1).toHexString();return{alpha:T,color:w}},h=x=>{const S=sQe(x);let T=!1,w=0;const M=[],O=(P,k={})=>{for(const F of P){if("tagName"in F&&["div","li","p"].includes(F.tagName)&&M.length){const W=M[M.length-1];W.options||(W.options={}),W.options.breakLine=!0}const I={...k},N="attributes"in F?F.attributes.find(W=>W.key==="style"):null;if(N&&N.value){const W=N.value.split(";");for(const D of W){const[Z,re]=D.split(": "),[B,Y]=[Un.trim(Z),Un.trim(re)];B&&Y&&(I[B]=Y)}}if("tagName"in F){if(F.tagName==="em"&&(I["font-style"]="italic"),F.tagName==="strong"&&(I["font-weight"]="bold"),F.tagName==="sup"&&(I["vertical-align"]="super"),F.tagName==="sub"&&(I["vertical-align"]="sub"),F.tagName==="a"){const W=F.attributes.find(D=>D.key==="href");I.href=(W==null?void 0:W.value)||""}if(F.tagName==="ul"&&(I["list-type"]="ul"),F.tagName==="ol"&&(I["list-type"]="ol"),F.tagName==="li"&&(T=!0),F.tagName==="p"&&"attributes"in F){const W=F.attributes.find(D=>D.key==="data-indent");W&&W.value&&(w=+W.value)}}if("tagName"in F&&F.tagName==="br")M.push({text:"",options:{breakLine:!0}});else if("content"in F){const W=F.content.replace(/ /g," ").replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&").replace(/\n/g,""),D={};I["font-size"]&&(D.fontSize=parseInt(I["font-size"])/s.value),I.color&&(D.color=d(I.color).color),I["background-color"]&&(D.highlight=d(I["background-color"]).color),I["text-decoration-line"]&&(I["text-decoration-line"].indexOf("underline")!==-1&&(D.underline={color:D.color||"#000000",style:"sng"}),I["text-decoration-line"].indexOf("line-through")!==-1&&(D.strike="sngStrike")),I["text-decoration"]&&(I["text-decoration"].indexOf("underline")!==-1&&(D.underline={color:D.color||"#000000",style:"sng"}),I["text-decoration"].indexOf("line-through")!==-1&&(D.strike="sngStrike")),I["vertical-align"]&&(I["vertical-align"]==="super"&&(D.superscript=!0),I["vertical-align"]==="sub"&&(D.subscript=!0)),I["text-align"]&&(D.align=I["text-align"]),I["font-weight"]&&(D.bold=I["font-weight"]==="bold"),I["font-style"]&&(D.italic=I["font-style"]==="italic"),I["font-family"]&&(D.fontFace=I["font-family"]),I.href&&(D.hyperlink={url:I.href}),T&&I["list-type"]==="ol"&&(D.bullet={type:"number",indent:(D.fontSize||20)*1.25},D.paraSpaceBefore=.1,T=!1),T&&I["list-type"]==="ul"&&(D.bullet={indent:(D.fontSize||20)*1.25},D.paraSpaceBefore=.1,T=!1),w&&(D.indentLevel=w,w=0),M.push({text:W,options:D})}else"children"in F&&O(F.children,I)}};return O(S),M},p=(x,S={x:1,y:1})=>x.map(T=>{if(T.close!==void 0)return{close:!0};if(T.type==="M")return{x:T.x/a.value*S.x,y:T.y/a.value*S.y,moveTo:!0};if(T.curve){if(T.curve.type==="cubic")return{x:T.x/a.value*S.x,y:T.y/a.value*S.y,curve:{type:"cubic",x1:T.curve.x1/a.value*S.x,y1:T.curve.y1/a.value*S.y,x2:T.curve.x2/a.value*S.x,y2:T.curve.y2/a.value*S.y}};if(T.curve.type==="quadratic")return{x:T.x/a.value*S.x,y:T.y/a.value*S.y,curve:{type:"quadratic",x1:T.curve.x1/a.value*S.x,y1:T.curve.y1/a.value*S.y}}}return{x:T.x/a.value*S.x,y:T.y/a.value*S.y}}),v=x=>{const S=d(x.color),{h:T,v:w}=x;let M=4,O=45;return T===0&&w===0?(M=4,O=45):T===0?w>0?(M=w,O=90):(M=-w,O=270):w===0?T>0?(M=T,O=1):(M=-T,O=180):T>0&&w>0?(M=Math.max(T,w),O=45):T>0&&w<0?(M=Math.max(T,-w),O=315):T<0&&w>0?(M=Math.max(-T,w),O=135):T<0&&w<0&&(M=Math.max(-T,-w),O=225),{type:"outer",color:S.color.replace("#",""),opacity:S.alpha,blur:x.blur/s.value,offset:M,angle:O}},g={solid:"solid",dashed:"dash",dotted:"sysDot"},m=x=>{const S=d((x==null?void 0:x.color)||"#000000");return{color:S.color,transparency:(1-S.alpha)*100,width:(x.width||1)/s.value,dashType:x.style?g[x.style]:"solid"}},y=x=>{const{type:S,target:T}=x;if(S==="web")return{url:T};if(S==="slide"){const w=t.value.findIndex(M=>M.id===T);if(w!==-1)return{slide:w+1}}return null},R=x=>{const S=/^data:image\/[^;]+;base64,/;return x.match(S)!==null};return{exporting:l,exportImage:u,exportJSON:f,exportSpecificFile:c,exportPPTX:(x,S,T)=>{var M,O,P,k,F,C,I,N,W,D,Z,re,B,Y,K,G;l.value=!0;const w=new ZZe;if(r.value===.625?w.layout="LAYOUT_16x10":r.value===.75?w.layout="LAYOUT_4x3":r.value===.70710678?(w.defineLayout({name:"A3",width:10,height:7.0710678}),w.layout="A3"):r.value===1.41421356?(w.defineLayout({name:"A3_V",width:10,height:14.1421356}),w.layout="A3_V"):w.layout="LAYOUT_16x9",S){const{color:ee,alpha:q}=d(n.value.backgroundColor);w.defineSlideMaster({title:"PPTIST_MASTER",background:{color:ee,transparency:(1-q)*100}})}for(const ee of x){const q=w.addSlide();if(ee.background){const H=ee.background;if(H.type==="image"&&H.image)R(H.image.src)?q.background={data:H.image.src}:q.background={path:H.image.src};else if(H.type==="solid"&&H.color){const ue=d(H.color);q.background={color:ue.color,transparency:(1-ue.alpha)*100}}else if(H.type==="gradient"&&H.gradient){const ue=H.gradient.colors,Ae=ue[0].color,ce=ue[ue.length-1].color,de=ot.mix(Ae,ce).toHexString(),le=d(de);q.background={color:le.color,transparency:(1-le.alpha)*100}}}if(ee.remark&&q.addNotes(ee.remark),!!ee.elements){for(const H of ee.elements)if(H.type==="text"){const ue=h(H.content),Ae={x:H.left/a.value,y:H.top/a.value,w:H.width/a.value,h:H.height/a.value,fontSize:20/s.value,fontFace:"微软雅黑",color:"#000000",valign:"top",margin:10/s.value,paraSpaceBefore:5/s.value,lineSpacingMultiple:1.5/1.25,autoFit:!0};if(H.rotate&&(Ae.rotate=H.rotate),H.wordSpace&&(Ae.charSpacing=H.wordSpace/s.value),H.lineHeight&&(Ae.lineSpacingMultiple=H.lineHeight/1.25),H.fill){const ce=d(H.fill),de=H.opacity===void 0?1:H.opacity;Ae.fill={color:ce.color,transparency:(1-ce.alpha*de)*100}}H.defaultColor&&(Ae.color=d(H.defaultColor).color),H.defaultFontName&&(Ae.fontFace=H.defaultFontName),H.shadow&&(Ae.shadow=v(H.shadow)),(M=H.outline)!=null&&M.width&&(Ae.line=m(H.outline)),H.opacity!==void 0&&(Ae.transparency=(1-H.opacity)*100),H.paragraphSpace!==void 0&&(Ae.paraSpaceBefore=H.paragraphSpace/s.value),H.vertical&&(Ae.vert="eaVert"),q.addText(ue,Ae)}else if(H.type==="image"){const ue={x:H.left/a.value,y:H.top/a.value,w:H.width/a.value,h:H.height/a.value};if(R(H.src)?ue.data=H.src:ue.path=H.src,H.flipH&&(ue.flipH=H.flipH),H.flipV&&(ue.flipV=H.flipV),H.rotate&&(ue.rotate=H.rotate),H.link){const Ae=y(H.link);Ae&&(ue.hyperlink=Ae)}if((O=H.filters)!=null&&O.opacity&&(ue.transparency=100-parseInt((P=H.filters)==null?void 0:P.opacity)),H.clip){H.clip.shape==="ellipse"&&(ue.rounding=!0);const[Ae,ce]=H.clip.range,[de,le]=Ae,[J,E]=ce,$=H.width/((J-de)/a.value),ie=H.height/((E-le)/a.value);ue.w=$/a.value,ue.h=ie/a.value,ue.sizing={type:"crop",x:de/a.value*$/a.value,y:le/a.value*ie/a.value,w:(J-de)/a.value*$/a.value,h:(E-le)/a.value*ie/a.value}}q.addImage(ue)}else if(H.type==="shape"){if(H.special){const ue=document.querySelector(`.thumbnail-list .base-element-${H.id} svg`);if(ue.clientWidth<1||ue.clientHeight<1)continue;const ce={data:cU(ue),x:H.left/a.value,y:H.top/a.value,w:H.width/a.value,h:H.height/a.value};if(H.rotate&&(ce.rotate=H.rotate),H.link){const de=y(H.link);de&&(ce.hyperlink=de)}q.addImage(ce)}else{const ue={x:H.width/H.viewBox[0],y:H.height/H.viewBox[1]},Ae=p(zF(H.path),ue);let ce=d(H.fill);if(H.gradient){const J=H.gradient.colors,E=J[0].color,$=J[J.length-1].color,ie=ot.mix(E,$).toHexString();ce=d(ie)}const de=H.opacity===void 0?1:H.opacity,le={x:H.left/a.value,y:H.top/a.value,w:H.width/a.value,h:H.height/a.value,fill:{color:ce.color,transparency:(1-ce.alpha*de)*100},points:Ae};if(H.flipH&&(le.flipH=H.flipH),H.flipV&&(le.flipV=H.flipV),H.shadow&&(le.shadow=v(H.shadow)),(k=H.outline)!=null&&k.width&&(le.line=m(H.outline)),H.rotate&&(le.rotate=H.rotate),H.link){const J=y(H.link);J&&(le.hyperlink=J)}q.addShape("custGeom",le)}if(H.text){const ue=h(H.text.content),Ae={x:H.left/a.value,y:H.top/a.value,w:H.width/a.value,h:H.height/a.value,fontSize:20/s.value,fontFace:"微软雅黑",color:"#000000",paraSpaceBefore:5/s.value,valign:H.text.align};H.rotate&&(Ae.rotate=H.rotate),H.text.defaultColor&&(Ae.color=d(H.text.defaultColor).color),H.text.defaultFontName&&(Ae.fontFace=H.text.defaultFontName),q.addText(ue,Ae)}}else if(H.type==="line"){const ue=z_(H),Ae=p(zF(ue)),{minX:ce,maxX:de,minY:le,maxY:J}=is(H),E=d(H.color),$={x:H.left/a.value,y:H.top/a.value,w:(de-ce)/a.value,h:(J-le)/a.value,line:{color:E.color,transparency:(1-E.alpha)*100,width:H.width/s.value,dashType:g[H.style],beginArrowType:H.points[0]?"arrow":"none",endArrowType:H.points[1]?"arrow":"none"},points:Ae};H.shadow&&($.shadow=v(H.shadow)),q.addShape("custGeom",$)}else if(H.type==="chart"){const ue=[];for(let E=0;Ed(E).color);else if(H.themeColors.length===1)Ae=ot(H.themeColors[0]).analogous(10).map(E=>d(E.toHexString()).color);else{const E=H.themeColors.length,$=ot(H.themeColors[E-1]).analogous(11-E).map(ie=>ie.toHexString());Ae=[...H.themeColors.slice(0,E-1),...$].map(ie=>d(ie).color)}const ce={x:H.left/a.value,y:H.top/a.value,w:H.width/a.value,h:H.height/a.value,chartColors:H.chartType==="pie"||H.chartType==="ring"?Ae:Ae.slice(0,H.data.series.length)},de=d(H.textColor||"#000000").color;ce.catAxisLabelColor=de,ce.valAxisLabelColor=de;const le=14/s.value;if(ce.catAxisLabelFontSize=le,ce.valAxisLabelFontSize=le,H.fill||H.outline){const E={};H.fill&&(E.fill={color:d(H.fill).color}),H.outline&&(E.border={pt:H.outline.width/s.value,color:d(H.outline.color).color}),ce.plotArea=E}(H.data.series.length>1&&H.chartType!=="scatter"||H.chartType==="pie"||H.chartType==="ring")&&(ce.showLegend=!0,ce.legendPos="b",ce.legendColor=de,ce.legendFontSize=le);let J=w.ChartType.bar;H.chartType==="bar"?(J=w.ChartType.bar,ce.barDir="col",(F=H.options)!=null&&F.stack&&(ce.barGrouping="stacked")):H.chartType==="column"?(J=w.ChartType.bar,ce.barDir="bar",(C=H.options)!=null&&C.stack&&(ce.barGrouping="stacked")):H.chartType==="line"?(J=w.ChartType.line,(I=H.options)!=null&&I.lineSmooth&&(ce.lineSmooth=!0)):H.chartType==="area"?J=w.ChartType.area:H.chartType==="radar"?J=w.ChartType.radar:H.chartType==="scatter"?(J=w.ChartType.scatter,ce.lineSize=0):H.chartType==="pie"?J=w.ChartType.pie:H.chartType==="ring"&&(J=w.ChartType.doughnut,ce.holeSize=60),q.addChart(J,ue,ce)}else if(H.type==="table"){const ue=[];for(let E=0;E1||j.rowspan>1)for(let te=E;ted(E)));for(let E=0;EH.width*E/a.value)};H.theme&&(J.fill={color:"#ffffff"}),H.outline.width&&H.outline.color&&(J.border={type:H.outline.style==="solid"?"solid":"dash",pt:H.outline.width/s.value,color:d(H.outline.color).color}),q.addTable(Ae,J)}else if(H.type==="latex"){const ue=document.querySelector(`.thumbnail-list .base-element-${H.id} svg`),ce={data:cU(ue),x:H.left/a.value,y:H.top/a.value,w:H.width/a.value,h:H.height/a.value};if(H.link){const de=y(H.link);de&&(ce.hyperlink=de)}q.addImage(ce)}else if(!T&&(H.type==="video"||H.type==="audio")){const ue={x:H.left/a.value,y:H.top/a.value,w:H.width/a.value,h:H.height/a.value,path:H.src,type:H.type};H.type==="video"&&H.poster&&(ue.cover=H.poster);const Ae=H.src.match(/\.([a-zA-Z0-9]+)(?:[\?#]|$)/);Ae&&Ae[1]?ue.extn=Ae[1]:H.ext&&(ue.extn=H.ext);const ce=["avi","mp4","m4v","mov","wmv"],de=["mp3","m4a","mp4","wav","wma"];ue.extn&&[...ce,...de].includes(ue.extn)&&q.addMedia(ue)}}}setTimeout(()=>{w.writeFile({fileName:`${i.value}.pptx`}).then(()=>l.value=!1).catch(()=>{l.value=!1,Tn.error("导出失败")})},200)}}},F3=e=>(rn("data-v-32b43d99"),e=e(),on(),e),fQe={class:"export-img-dialog"},dQe={class:"thumbnails-view"},hQe={class:"configs"},pQe={class:"row"},vQe=F3(()=>V("div",{class:"title"},"导出格式:",-1)),gQe={class:"row"},mQe=F3(()=>V("div",{class:"title"},"导出范围:",-1)),yQe={key:0,class:"row"},AQe=["data-range"],RQe={class:"row"},bQe=F3(()=>V("div",{class:"title"},"图片质量:",-1)),xQe={class:"row"},SQe=F3(()=>V("div",{class:"title"},"忽略在线字体:",-1)),wQe={class:"config-item"},MQe={class:"btns"},LQe=Ee({__name:"ExportImage",emits:["close"],setup(e,{emit:t}){const n=t,{slides:r,currentSlide:i}=We(lt()),o=ge(),a=ge("all"),s=ge([1,r.value.length]),l=ge("jpeg"),u=ge(1),c=ge(!0),f=we(()=>a.value==="all"?r.value:a.value==="current"?[i.value]:r.value.filter((v,g)=>{const[m,y]=s.value;return g>=m-1&&g<=y-1})),{exportImage:d,exporting:h}=I3(),p=()=>{o.value&&d(o.value,l.value,u.value,c.value)};return(v,g)=>{const m=Cn("tooltip");return U(),ne("div",fQe,[V("div",dQe,[V("div",{class:"thumbnails",ref_key:"imageThumbnailsRef",ref:o},[(U(!0),ne(Ve,null,rt(f.value,y=>(U(),_e(il,{class:"thumbnail",key:y.id,slide:y,size:1600},null,8,["slide"]))),128))],512)]),V("div",hQe,[V("div",pQe,[vQe,_(lu,{class:"config-item",value:l.value,"onUpdate:value":g[0]||(g[0]=y=>l.value=y)},{default:se(()=>[_(Kn,{style:{width:"50%"},value:"jpeg"},{default:se(()=>[De("JPEG")]),_:1}),_(Kn,{style:{width:"50%"},value:"png"},{default:se(()=>[De("PNG")]),_:1})]),_:1},8,["value"])]),V("div",gQe,[mQe,_(lu,{class:"config-item",value:a.value,"onUpdate:value":g[1]||(g[1]=y=>a.value=y)},{default:se(()=>[_(Kn,{style:{width:"33.33%"},value:"all"},{default:se(()=>[De("全部")]),_:1}),_(Kn,{style:{width:"33.33%"},value:"current"},{default:se(()=>[De("当前页")]),_:1}),_(Kn,{style:{width:"33.33%"},value:"custom"},{default:se(()=>[De("自定义")]),_:1})]),_:1},8,["value"])]),a.value==="custom"?(U(),ne("div",yQe,[V("div",{class:"title","data-range":`(${s.value[0]} ~ ${s.value[1]})`},"自定义范围:",8,AQe),_(Yi,{class:"config-item",range:"",min:1,max:z(r).length,step:1,value:s.value,"onUpdate:value":g[2]||(g[2]=y=>s.value=y)},null,8,["max","value"])])):Ze("",!0),V("div",RQe,[bQe,_(Yi,{class:"config-item",min:0,max:1,step:.1,value:u.value,"onUpdate:value":g[3]||(g[3]=y=>u.value=y)},null,8,["value"])]),V("div",xQe,[SQe,V("div",wQe,[Ge(_(ws,{value:c.value,"onUpdate:value":g[4]||(g[4]=y=>c.value=y)},null,8,["value"]),[[m,"导出时默认忽略在线字体,若您在幻灯片中使用了在线字体,且希望导出后保留相关样式,可选择关闭【忽略在线字体】选项,但要注意这将会增加导出用时。"]])])])]),V("div",MQe,[_(qe,{class:"btn export",type:"primary",onClick:g[5]||(g[5]=y=>p())},{default:se(()=>[De("导出图片")]),_:1}),_(qe,{class:"btn close",onClick:g[6]||(g[6]=y=>n("close"))},{default:se(()=>[De("关闭")]),_:1})]),_(gO,{loading:z(h),tip:"正在导出..."},null,8,["loading"])])}}}),TQe=Ue(LQe,[["__scopeId","data-v-32b43d99"]]),_Qe={class:"export-json-dialog"},OQe={class:"preview"},kQe={class:"btns"},PQe=Ee({__name:"ExportJSON",emits:["close"],setup(e,{emit:t}){const n=t,{slides:r}=We(lt()),{exportJSON:i}=I3();return(o,a)=>(U(),ne("div",_Qe,[V("div",OQe,[V("pre",null,pt(z(r)),1)]),V("div",kQe,[_(qe,{class:"btn export",type:"primary",onClick:a[0]||(a[0]=s=>z(i)())},{default:se(()=>[De("导出 JSON")]),_:1}),_(qe,{class:"btn close",onClick:a[1]||(a[1]=s=>n("close"))},{default:se(()=>[De("关闭")]),_:1})])]))}}),CQe=Ue(PQe,[["__scopeId","data-v-ae2be22f"]]),NQe=()=>{const e=document.createElement("iframe");return e.style.width="0",e.style.height="0",e.style.position="absolute",e.style.right="0",e.style.top="0",e.style.border="0",document.body.appendChild(e),e},IQe=(e,t,n)=>{const r="";let i="";const o=document.styleSheets;if(o){for(const f of o)if(f.cssRules)for(const d of f.cssRules)i+=d.cssText}const{width:a,height:s,margin:l}=n,u=` +`);let t="";for(let n=0;n127&&r<2048?(t+=String.fromCharCode(r>>6|192),t+=String.fromCharCode(r&63|128)):(t+=String.fromCharCode(r>>12|224),t+=String.fromCharCode(r>>6&63|128),t+=String.fromCharCode(r&63|128))}return t},cQe=e=>{let t="",n,r,i,o,a,s,l,u=0;for(e=uQe(e);u>2,a=(n&3)<<4|r>>4,s=(r&15)<<2|i>>6,l=i&63,isNaN(r)?s=l=64:isNaN(i)&&(l=64),t=t+bR.charAt(o)+bR.charAt(a)+bR.charAt(s)+bR.charAt(l);return t},cU=e=>{const n=new XMLSerializer().serializeToString(e);return lQe+cQe(n)},I3=()=>{const e=lt(),{slides:t,theme:n,viewportRatio:r,title:i,viewportSize:o}=We(e),a=we(()=>96*(o.value/960)),s=we(()=>96/72*(o.value/960)),l=ge(!1),u=(x,S,T,w=!0)=>{l.value=!0;const M=S==="png"?SEe:wEe;x.querySelectorAll("foreignObject [xmlns]").forEach(P=>P.removeAttribute("xmlns")),setTimeout(()=>{const P={quality:T,width:1600};w&&(P.fontEmbedCSS=""),M(x,P).then(k=>{l.value=!1,O8.saveAs(k,`${i.value}.${S}`)}).catch(()=>{l.value=!1,Tn.error("导出图片失败")})},200)},c=x=>{const S=new Blob([K_(JSON.stringify(x))],{type:""});O8.saveAs(S,`${i.value}.pptist`)},f=()=>{const x={title:i.value,width:o.value,height:o.value*r.value,slides:t.value},S=new Blob([JSON.stringify(x)],{type:""});O8.saveAs(S,`${i.value}.json`)},d=x=>{const S=ot(x),T=S.getAlpha(),w=T===0?"#ffffff":S.setAlpha(1).toHexString();return{alpha:T,color:w}},h=x=>{const S=sQe(x);let T=!1,w=0;const M=[],O=(P,k={})=>{for(const F of P){if("tagName"in F&&["div","li","p"].includes(F.tagName)&&M.length){const W=M[M.length-1];W.options||(W.options={}),W.options.breakLine=!0}const I={...k},N="attributes"in F?F.attributes.find(W=>W.key==="style"):null;if(N&&N.value){const W=N.value.split(";");for(const D of W){const[Z,re]=D.split(": "),[B,Y]=[Un.trim(Z),Un.trim(re)];B&&Y&&(I[B]=Y)}}if("tagName"in F){if(F.tagName==="em"&&(I["font-style"]="italic"),F.tagName==="strong"&&(I["font-weight"]="bold"),F.tagName==="sup"&&(I["vertical-align"]="super"),F.tagName==="sub"&&(I["vertical-align"]="sub"),F.tagName==="a"){const W=F.attributes.find(D=>D.key==="href");I.href=(W==null?void 0:W.value)||""}if(F.tagName==="ul"&&(I["list-type"]="ul"),F.tagName==="ol"&&(I["list-type"]="ol"),F.tagName==="li"&&(T=!0),F.tagName==="p"&&"attributes"in F){const W=F.attributes.find(D=>D.key==="data-indent");W&&W.value&&(w=+W.value)}}if("tagName"in F&&F.tagName==="br")M.push({text:"",options:{breakLine:!0}});else if("content"in F){const W=F.content.replace(/ /g," ").replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&").replace(/\n/g,""),D={};I["font-size"]&&(D.fontSize=parseInt(I["font-size"])/s.value),I.color&&(D.color=d(I.color).color),I["background-color"]&&(D.highlight=d(I["background-color"]).color),I["text-decoration-line"]&&(I["text-decoration-line"].indexOf("underline")!==-1&&(D.underline={color:D.color||"#000000",style:"sng"}),I["text-decoration-line"].indexOf("line-through")!==-1&&(D.strike="sngStrike")),I["text-decoration"]&&(I["text-decoration"].indexOf("underline")!==-1&&(D.underline={color:D.color||"#000000",style:"sng"}),I["text-decoration"].indexOf("line-through")!==-1&&(D.strike="sngStrike")),I["vertical-align"]&&(I["vertical-align"]==="super"&&(D.superscript=!0),I["vertical-align"]==="sub"&&(D.subscript=!0)),I["text-align"]&&(D.align=I["text-align"]),I["font-weight"]&&(D.bold=I["font-weight"]==="bold"),I["font-style"]&&(D.italic=I["font-style"]==="italic"),I["font-family"]&&(D.fontFace=I["font-family"]),I.href&&(D.hyperlink={url:I.href}),T&&I["list-type"]==="ol"&&(D.bullet={type:"number",indent:(D.fontSize||20)*1.25},D.paraSpaceBefore=.1,T=!1),T&&I["list-type"]==="ul"&&(D.bullet={indent:(D.fontSize||20)*1.25},D.paraSpaceBefore=.1,T=!1),w&&(D.indentLevel=w,w=0),M.push({text:W,options:D})}else"children"in F&&O(F.children,I)}};return O(S),M},p=(x,S={x:1,y:1})=>x.map(T=>{if(T.close!==void 0)return{close:!0};if(T.type==="M")return{x:T.x/a.value*S.x,y:T.y/a.value*S.y,moveTo:!0};if(T.curve){if(T.curve.type==="cubic")return{x:T.x/a.value*S.x,y:T.y/a.value*S.y,curve:{type:"cubic",x1:T.curve.x1/a.value*S.x,y1:T.curve.y1/a.value*S.y,x2:T.curve.x2/a.value*S.x,y2:T.curve.y2/a.value*S.y}};if(T.curve.type==="quadratic")return{x:T.x/a.value*S.x,y:T.y/a.value*S.y,curve:{type:"quadratic",x1:T.curve.x1/a.value*S.x,y1:T.curve.y1/a.value*S.y}}}return{x:T.x/a.value*S.x,y:T.y/a.value*S.y}}),v=x=>{const S=d(x.color),{h:T,v:w}=x;let M=4,O=45;return T===0&&w===0?(M=4,O=45):T===0?w>0?(M=w,O=90):(M=-w,O=270):w===0?T>0?(M=T,O=1):(M=-T,O=180):T>0&&w>0?(M=Math.max(T,w),O=45):T>0&&w<0?(M=Math.max(T,-w),O=315):T<0&&w>0?(M=Math.max(-T,w),O=135):T<0&&w<0&&(M=Math.max(-T,-w),O=225),{type:"outer",color:S.color.replace("#",""),opacity:S.alpha,blur:x.blur/s.value,offset:M,angle:O}},g={solid:"solid",dashed:"dash",dotted:"sysDot"},m=x=>{const S=d((x==null?void 0:x.color)||"#000000");return{color:S.color,transparency:(1-S.alpha)*100,width:(x.width||1)/s.value,dashType:x.style?g[x.style]:"solid"}},y=x=>{const{type:S,target:T}=x;if(S==="web")return{url:T};if(S==="slide"){const w=t.value.findIndex(M=>M.id===T);if(w!==-1)return{slide:w+1}}return null},R=x=>{const S=/^data:image\/[^;]+;base64,/;return x.match(S)!==null};return{exporting:l,exportImage:u,exportJSON:f,exportSpecificFile:c,exportPPTX:(x,S,T)=>{var M,O,P,k,F,C,I,N,W,D,Z,re,B,Y,K,G;l.value=!0;const w=new ZZe;if(r.value===.625?w.layout="LAYOUT_16x10":r.value===.75?w.layout="LAYOUT_4x3":r.value===.70710678?(w.defineLayout({name:"A3",width:10,height:7.0710678}),w.layout="A3"):r.value===1.41421356?(w.defineLayout({name:"A3_V",width:10,height:14.1421356}),w.layout="A3_V"):w.layout="LAYOUT_16x9",S){const{color:ee,alpha:q}=d(n.value.backgroundColor);w.defineSlideMaster({title:"PPTIST_MASTER",background:{color:ee,transparency:(1-q)*100}})}for(const ee of x){const q=w.addSlide();if(ee.background){const H=ee.background;if(H.type==="image"&&H.image)R(H.image.src)?q.background={data:H.image.src}:q.background={path:H.image.src};else if(H.type==="solid"&&H.color){const ue=d(H.color);q.background={color:ue.color,transparency:(1-ue.alpha)*100}}else if(H.type==="gradient"&&H.gradient){const ue=H.gradient.colors,Ae=ue[0].color,ce=ue[ue.length-1].color,de=ot.mix(Ae,ce).toHexString(),le=d(de);q.background={color:le.color,transparency:(1-le.alpha)*100}}}if(ee.remark&&q.addNotes(ee.remark),!!ee.elements){for(const H of ee.elements)if(H.type==="text"){const ue=h(H.content),Ae={x:H.left/a.value,y:H.top/a.value,w:H.width/a.value,h:H.height/a.value,fontSize:20/s.value,fontFace:"微软雅黑",color:"#000000",valign:"top",margin:10/s.value,paraSpaceBefore:5/s.value,lineSpacingMultiple:1.5/1.25,autoFit:!0};if(H.rotate&&(Ae.rotate=H.rotate),H.wordSpace&&(Ae.charSpacing=H.wordSpace/s.value),H.lineHeight&&(Ae.lineSpacingMultiple=H.lineHeight/1.25),H.fill){const ce=d(H.fill),de=H.opacity===void 0?1:H.opacity;Ae.fill={color:ce.color,transparency:(1-ce.alpha*de)*100}}H.defaultColor&&(Ae.color=d(H.defaultColor).color),H.defaultFontName&&(Ae.fontFace=H.defaultFontName),H.shadow&&(Ae.shadow=v(H.shadow)),(M=H.outline)!=null&&M.width&&(Ae.line=m(H.outline)),H.opacity!==void 0&&(Ae.transparency=(1-H.opacity)*100),H.paragraphSpace!==void 0&&(Ae.paraSpaceBefore=H.paragraphSpace/s.value),H.vertical&&(Ae.vert="eaVert"),q.addText(ue,Ae)}else if(H.type==="image"){const ue={x:H.left/a.value,y:H.top/a.value,w:H.width/a.value,h:H.height/a.value};if(R(H.src)?ue.data=H.src:ue.path=H.src,H.flipH&&(ue.flipH=H.flipH),H.flipV&&(ue.flipV=H.flipV),H.rotate&&(ue.rotate=H.rotate),H.link){const Ae=y(H.link);Ae&&(ue.hyperlink=Ae)}if((O=H.filters)!=null&&O.opacity&&(ue.transparency=100-parseInt((P=H.filters)==null?void 0:P.opacity)),H.clip){H.clip.shape==="ellipse"&&(ue.rounding=!0);const[Ae,ce]=H.clip.range,[de,le]=Ae,[J,E]=ce,$=H.width/((J-de)/a.value),ie=H.height/((E-le)/a.value);ue.w=$/a.value,ue.h=ie/a.value,ue.sizing={type:"crop",x:de/a.value*$/a.value,y:le/a.value*ie/a.value,w:(J-de)/a.value*$/a.value,h:(E-le)/a.value*ie/a.value}}q.addImage(ue)}else if(H.type==="shape"){if(H.special){const ue=document.querySelector(`.thumbnail-list .base-element-${H.id} svg`);if(ue.clientWidth<1||ue.clientHeight<1)continue;const ce={data:cU(ue),x:H.left/a.value,y:H.top/a.value,w:H.width/a.value,h:H.height/a.value};if(H.rotate&&(ce.rotate=H.rotate),H.link){const de=y(H.link);de&&(ce.hyperlink=de)}q.addImage(ce)}else{const ue={x:H.width/H.viewBox[0],y:H.height/H.viewBox[1]},Ae=p(zF(H.path),ue);let ce=d(H.fill);if(H.gradient){const J=H.gradient.colors,E=J[0].color,$=J[J.length-1].color,ie=ot.mix(E,$).toHexString();ce=d(ie)}const de=H.opacity===void 0?1:H.opacity,le={x:H.left/a.value,y:H.top/a.value,w:H.width/a.value,h:H.height/a.value,fill:{color:ce.color,transparency:(1-ce.alpha*de)*100},points:Ae};if(H.flipH&&(le.flipH=H.flipH),H.flipV&&(le.flipV=H.flipV),H.shadow&&(le.shadow=v(H.shadow)),(k=H.outline)!=null&&k.width&&(le.line=m(H.outline)),H.rotate&&(le.rotate=H.rotate),H.link){const J=y(H.link);J&&(le.hyperlink=J)}q.addShape("custGeom",le)}if(H.text){const ue=h(H.text.content),Ae={x:H.left/a.value,y:H.top/a.value,w:H.width/a.value,h:H.height/a.value,fontSize:20/s.value,fontFace:"微软雅黑",color:"#000000",paraSpaceBefore:5/s.value,valign:H.text.align};H.rotate&&(Ae.rotate=H.rotate),H.text.defaultColor&&(Ae.color=d(H.text.defaultColor).color),H.text.defaultFontName&&(Ae.fontFace=H.text.defaultFontName),q.addText(ue,Ae)}}else if(H.type==="line"){const ue=z_(H),Ae=p(zF(ue)),{minX:ce,maxX:de,minY:le,maxY:J}=is(H),E=d(H.color),$={x:H.left/a.value,y:H.top/a.value,w:(de-ce)/a.value,h:(J-le)/a.value,line:{color:E.color,transparency:(1-E.alpha)*100,width:H.width/s.value,dashType:g[H.style],beginArrowType:H.points[0]?"arrow":"none",endArrowType:H.points[1]?"arrow":"none"},points:Ae};H.shadow&&($.shadow=v(H.shadow)),q.addShape("custGeom",$)}else if(H.type==="chart"){const ue=[];for(let E=0;Ed(E).color);else if(H.themeColors.length===1)Ae=ot(H.themeColors[0]).analogous(10).map(E=>d(E.toHexString()).color);else{const E=H.themeColors.length,$=ot(H.themeColors[E-1]).analogous(11-E).map(ie=>ie.toHexString());Ae=[...H.themeColors.slice(0,E-1),...$].map(ie=>d(ie).color)}const ce={x:H.left/a.value,y:H.top/a.value,w:H.width/a.value,h:H.height/a.value,chartColors:H.chartType==="pie"||H.chartType==="ring"?Ae:Ae.slice(0,H.data.series.length)},de=d(H.textColor||"#000000").color;ce.catAxisLabelColor=de,ce.valAxisLabelColor=de;const le=14/s.value;if(ce.catAxisLabelFontSize=le,ce.valAxisLabelFontSize=le,H.fill||H.outline){const E={};H.fill&&(E.fill={color:d(H.fill).color}),H.outline&&(E.border={pt:H.outline.width/s.value,color:d(H.outline.color).color}),ce.plotArea=E}(H.data.series.length>1&&H.chartType!=="scatter"||H.chartType==="pie"||H.chartType==="ring")&&(ce.showLegend=!0,ce.legendPos="b",ce.legendColor=de,ce.legendFontSize=le);let J=w.ChartType.bar;H.chartType==="bar"?(J=w.ChartType.bar,ce.barDir="col",(F=H.options)!=null&&F.stack&&(ce.barGrouping="stacked")):H.chartType==="column"?(J=w.ChartType.bar,ce.barDir="bar",(C=H.options)!=null&&C.stack&&(ce.barGrouping="stacked")):H.chartType==="line"?(J=w.ChartType.line,(I=H.options)!=null&&I.lineSmooth&&(ce.lineSmooth=!0)):H.chartType==="area"?J=w.ChartType.area:H.chartType==="radar"?J=w.ChartType.radar:H.chartType==="scatter"?(J=w.ChartType.scatter,ce.lineSize=0):H.chartType==="pie"?J=w.ChartType.pie:H.chartType==="ring"&&(J=w.ChartType.doughnut,ce.holeSize=60),q.addChart(J,ue,ce)}else if(H.type==="table"){const ue=[];for(let E=0;E1||j.rowspan>1)for(let te=E;ted(E)));for(let E=0;EH.width*E/a.value)};H.theme&&(J.fill={color:"#ffffff"}),H.outline.width&&H.outline.color&&(J.border={type:H.outline.style==="solid"?"solid":"dash",pt:H.outline.width/s.value,color:d(H.outline.color).color}),q.addTable(Ae,J)}else if(H.type==="latex"){const ue=document.querySelector(`.thumbnail-list .base-element-${H.id} svg`),ce={data:cU(ue),x:H.left/a.value,y:H.top/a.value,w:H.width/a.value,h:H.height/a.value};if(H.link){const de=y(H.link);de&&(ce.hyperlink=de)}q.addImage(ce)}else if(!T&&(H.type==="video"||H.type==="audio")){const ue={x:H.left/a.value,y:H.top/a.value,w:H.width/a.value,h:H.height/a.value,path:H.src,type:H.type};H.type==="video"&&H.poster&&(ue.cover=H.poster);const Ae=H.src.match(/\.([a-zA-Z0-9]+)(?:[\?#]|$)/);Ae&&Ae[1]?ue.extn=Ae[1]:H.ext&&(ue.extn=H.ext);const ce=["avi","mp4","m4v","mov","wmv"],de=["mp3","m4a","mp4","wav","wma"];ue.extn&&[...ce,...de].includes(ue.extn)&&q.addMedia(ue)}}}setTimeout(()=>{w.writeFile({fileName:`${i.value}.pptx`}).then(()=>l.value=!1).catch(()=>{l.value=!1,Tn.error("导出失败")})},200)}}},F3=e=>(rn("data-v-32b43d99"),e=e(),on(),e),fQe={class:"export-img-dialog"},dQe={class:"thumbnails-view"},hQe={class:"configs"},pQe={class:"row"},vQe=F3(()=>V("div",{class:"title"},"导出格式:",-1)),gQe={class:"row"},mQe=F3(()=>V("div",{class:"title"},"导出范围:",-1)),yQe={key:0,class:"row"},AQe=["data-range"],RQe={class:"row"},bQe=F3(()=>V("div",{class:"title"},"图片质量:",-1)),xQe={class:"row"},SQe=F3(()=>V("div",{class:"title"},"忽略在线字体:",-1)),wQe={class:"config-item"},MQe={class:"btns"},LQe=Ee({__name:"ExportImage",emits:["close"],setup(e,{emit:t}){const n=t,{slides:r,currentSlide:i}=We(lt()),o=ge(),a=ge("all"),s=ge([1,r.value.length]),l=ge("jpeg"),u=ge(1),c=ge(!0),f=we(()=>a.value==="all"?r.value:a.value==="current"?[i.value]:r.value.filter((v,g)=>{const[m,y]=s.value;return g>=m-1&&g<=y-1})),{exportImage:d,exporting:h}=I3(),p=()=>{o.value&&d(o.value,l.value,u.value,c.value)};return(v,g)=>{const m=Cn("tooltip");return U(),ne("div",fQe,[V("div",dQe,[V("div",{class:"thumbnails",ref_key:"imageThumbnailsRef",ref:o},[(U(!0),ne(Ve,null,rt(f.value,y=>(U(),_e(il,{class:"thumbnail",key:y.id,slide:y,size:1600},null,8,["slide"]))),128))],512)]),V("div",hQe,[V("div",pQe,[vQe,_(lu,{class:"config-item",value:l.value,"onUpdate:value":g[0]||(g[0]=y=>l.value=y)},{default:se(()=>[_(Kn,{style:{width:"50%"},value:"jpeg"},{default:se(()=>[De("JPEG")]),_:1}),_(Kn,{style:{width:"50%"},value:"png"},{default:se(()=>[De("PNG")]),_:1})]),_:1},8,["value"])]),V("div",gQe,[mQe,_(lu,{class:"config-item",value:a.value,"onUpdate:value":g[1]||(g[1]=y=>a.value=y)},{default:se(()=>[_(Kn,{style:{width:"33.33%"},value:"all"},{default:se(()=>[De("全部")]),_:1}),_(Kn,{style:{width:"33.33%"},value:"current"},{default:se(()=>[De("当前页")]),_:1}),_(Kn,{style:{width:"33.33%"},value:"custom"},{default:se(()=>[De("自定义")]),_:1})]),_:1},8,["value"])]),a.value==="custom"?(U(),ne("div",yQe,[V("div",{class:"title","data-range":`(${s.value[0]} ~ ${s.value[1]})`},"自定义范围:",8,AQe),_(Yi,{class:"config-item",range:"",min:1,max:z(r).length,step:1,value:s.value,"onUpdate:value":g[2]||(g[2]=y=>s.value=y)},null,8,["max","value"])])):Ze("",!0),V("div",RQe,[bQe,_(Yi,{class:"config-item",min:0,max:1,step:.1,value:u.value,"onUpdate:value":g[3]||(g[3]=y=>u.value=y)},null,8,["value"])]),V("div",xQe,[SQe,V("div",wQe,[Ge(_(ws,{value:c.value,"onUpdate:value":g[4]||(g[4]=y=>c.value=y)},null,8,["value"]),[[m,"导出时默认忽略在线字体,若您在幻灯片中使用了在线字体,且希望导出后保留相关样式,可选择关闭【忽略在线字体】选项,但要注意这将会增加导出用时。"]])])])]),V("div",MQe,[_(qe,{class:"btn export",type:"primary",onClick:g[5]||(g[5]=y=>p())},{default:se(()=>[De("导出图片")]),_:1}),_(qe,{class:"btn close",onClick:g[6]||(g[6]=y=>n("close"))},{default:se(()=>[De("关闭")]),_:1})]),_(gO,{loading:z(h),tip:"正在导出..."},null,8,["loading"])])}}}),TQe=Ue(LQe,[["__scopeId","data-v-32b43d99"]]),_Qe={class:"export-json-dialog"},OQe={class:"preview"},kQe={class:"btns"},PQe=Ee({__name:"ExportJSON",emits:["close"],setup(e,{emit:t}){const n=t,{slides:r,viewportRatio:i,title:o,viewportSize:a}=We(lt()),{exportJSON:s}=I3(),l=we(()=>({title:o.value,width:a.value,height:a.value*i.value,slides:r.value}));return(u,c)=>(U(),ne("div",_Qe,[V("div",OQe,[V("pre",null,pt(l.value),1)]),V("div",kQe,[_(qe,{class:"btn export",type:"primary",onClick:c[0]||(c[0]=f=>z(s)())},{default:se(()=>[De("导出 JSON")]),_:1}),_(qe,{class:"btn close",onClick:c[1]||(c[1]=f=>n("close"))},{default:se(()=>[De("关闭")]),_:1})])]))}}),CQe=Ue(PQe,[["__scopeId","data-v-aaf5a228"]]),NQe=()=>{const e=document.createElement("iframe");return e.style.width="0",e.style.height="0",e.style.position="absolute",e.style.right="0",e.style.top="0",e.style.border="0",document.body.appendChild(e),e},IQe=(e,t,n)=>{const r="";let i="";const o=document.styleSheets;if(o){for(const f of o)if(f.cssRules)for(const d of f.cssRules)i+=d.cssText}const{width:a,height:s,margin:l}=n,u=` - - + +