@netless/app-slide 0.2.34-beta.2 → 0.2.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.cjs.js CHANGED
@@ -7826,7 +7826,7 @@ void main(void){
7826
7826
  vec4 texColor = texture2D(uSampler, vTextureCoord);
7827
7827
  gl_FragColor = transform(texColor, arg1);
7828
7828
  }
7829
- `),{arg1:Float32Array.from(e)})}}class uo{constructor(t,e,n,r,o){this.ctx=t,this.fillStyle=e,this.width=n,this.height=r,this.config=o,this.clonedObjects=[],this._displayObject=null,this.gradientHash=Jl()(`${JSON.stringify(e)}${Math.ceil(n)}${Math.ceil(r)}`)}get displayObject(){return this._displayObject||(this._displayObject=this.createDisplayObject()),this._displayObject}set displayObject(t){this._displayObject&&this._displayObject.destroy({children:!0,texture:!0}),this._displayObject=t}get hasFill(){return!!this.fillStyle&&this.fillStyle.fillType!=="noFill"}createDisplayObject(){var t;if(!this.fillStyle)return null;if(this.config.useSlideBackgroundFill&&this.ctx.bgTexture){const e=new di;return e.texture=this.ctx.bgTexture,e}if(this.fillStyle.fillType==="solidFill"||this.fillStyle.fillType==="noFill")return null;if(this.fillStyle.fillType==="gradientFill"){const e=new di,n=r1(this.fillStyle,this.width,this.height),r=ce.p.create({width:this.width,height:this.height,resolution:this.ctx.renderer.resolution});return this.ctx.renderer.render(n,{renderTexture:r}),n.destroy({children:!0,texture:!0}),e.texture=r,e}if(this.fillStyle.fillType==="blipFill"){const{src:e,filters:n}=this.fillStyle,r=this.ctx.spriteTexture.getTexture(e),o=this.ctx.spriteTexture.getFrameData(e);if(r){const s=new di;if(s.texture=r,n.length>0&&this.config.useFilter&&(this.ctx.featureList||{}).filter&&(s.filters=function(a,h){const l=[];return a.forEach(u=>{const p=((h==null?void 0:h.filter)||[]).indexOf(u.type)>=0;if(["biLevel","alphaBiLevel","alphaCeiling","alphaModFix","alphaFloor","grayscl"].indexOf(u.type)>=0&&p)l.push(new a1(u.type,u.args[0]||0));else if(["clrChange","changeBulletColor","duotone"].indexOf(u.type)>=0&&p){const y=br(u.args[0]),x=br(u.args[1]);l.push(new u1(u.type,y,x))}else if(u.type==="lum"&&p)l.push(new p1(u.type,u.args[0],u.args[1]));else if(u.type==="alphaInv"&&p){const y=br(u.args[0]);l.push(new g1(u.type,y))}}),l}(n,this.ctx.featureList)),this.config.fillFloat){const{l:a,t:h,r:l,b:u}=this.config.fillFloat.fillRect,p=this.width*(1-a-l),y=this.height*(1-h-u),x=(t=this.config.shapeRotation)!==null&&t!==void 0?t:0,E=new qi;E.drawRect(0,0,p,y),E.pivot.x=p/2,E.pivot.y=y/2,E.rotation=x;const A=E.getBounds(),C=A.width,W=A.height;s.width=C,s.height=W,s.anchor.x=.5,s.anchor.y=.5,s.rotation=-1*x,s.name="math-texture",x===0?(s.position.x=C/2+a*this.width,s.position.y=W/2+h*this.height):(s.position.x=this.width/2,s.position.y=this.height/2)}else s.width=this.width,s.height=this.height,o.rotate&&(s.position.x=this.width/2,s.position.y=this.height/2,s.anchor.x=.5,s.anchor.y=.5,s.rotation=o.rotate/180*Math.PI);return s}}else if(this.fillStyle.fillType==="gifFill"){const{src:e,delays:n}=this.fillStyle,r=this.ctx.spriteTexture.getGifFrames(e).map((h,l)=>({texture:h,time:n[l]||20})),o=new Gu(r,!0);o.name=ss(),o.width=this.width,o.height=this.height;const s=this.fillStyle.loop;let a=1;return o.onLoop=()=>{a+=1,s>0&&a>s&&o.gotoAndStop(o.totalFrames)},o}return null}isSolidFill(){var t;return((t=this.fillStyle)===null||t===void 0?void 0:t.fillType)==="solidFill"}getSolidFillColor(){var t;return((t=this.fillStyle)===null||t===void 0?void 0:t.fillType)==="solidFill"?this.fillStyle.color:"#000000"}getClonedDisplayObject(){const t=this.createDisplayObject();return this.clonedObjects.push(t),t}destroy(){var t;(t=this._displayObject)===null||t===void 0||t.destroy(),this._displayObject=null,this.clonedObjects.forEach(e=>{e==null||e.destroy()}),this.clonedObjects=[]}}var v1=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};class _1 extends Xu{constructor(t,e,n){var r;super(t,e,n),this.textureContainer=new Cn.b,this.underline=null,this.cacheSprite=new di;const{shapeId:o,paragraphIndex:s,lineIndex:a,unitIndex:h,lineHeight:l,width:u,underLine:p,fill:y,height:x,isHorz:E,lineWidth:A}=t,C=((r=y==null?void 0:y.fill)===null||r===void 0?void 0:r.fillType)==="solidFill"?y.fill.color:null;if(p){const W=E?l/16:A/16;this.underline=new Qb(e,p.type,W,u,x,C,E,o,s,a,h)}this.textGraphics=this.createTextGraphics(),this.textFill=this.createTextFill(),this.strokeGraphics=this.createStrokeGraphics(),this.strokeFill=this.createStrokeFill()}createStrokeFill(){const{stroke:t,lineWidth:e,lineHeight:n}=this.json;return new uo(this.ctx,t==null?void 0:t.fill,e,n,{useFilter:!1,useSlideBackgroundFill:!1})}createStrokeGraphics(){const{stroke:t}=this.json,e=t!=null&&t.key?{fillType:"blipFill",src:t.key,filters:[]}:void 0;return new uo(this.ctx,e,(t==null?void 0:t.width)||0,(t==null?void 0:t.height)||0,{useFilter:!1,useSlideBackgroundFill:!1})}createTextFill(){const{isHorz:t,fill:e,lineWidth:n,lineHeight:r,fillLineHeight:o}=this.json;return t?new uo(this.ctx,e==null?void 0:e.fill,n,Math.max(o,r),{useFilter:!1,useSlideBackgroundFill:!1}):new uo(this.ctx,e==null?void 0:e.fill,o,r,{useFilter:!1,useSlideBackgroundFill:!1})}createTextGraphics(){var t;const{fill:e,content:n}=this.json;let r="#000000";((t=e==null?void 0:e.fill)===null||t===void 0?void 0:t.fillType)==="solidFill"&&(r=e.fill.color);const o=e!=null&&e.key?{fillType:"blipFill",src:e.key,filters:[{type:"changeBulletColor",args:["#000000",r]}]}:void 0;return new uo(this.ctx,o,(e==null?void 0:e.width)||0,(e==null?void 0:e.height)||0,{useFilter:n==="\u25FE",useSlideBackgroundFill:!1})}getIterateEntry(){return null}getBgElement(){return null}updateTransform(t){var e,n,r,o;const{isHorz:s}=this.json;t.position={x:s&&(n=(e=t.position)===null||e===void 0?void 0:e.x)!==null&&n!==void 0?n:0,y:s?0:(o=(r=t.position)===null||r===void 0?void 0:r.y)!==null&&o!==void 0?o:0},t.width=s?this.json.width:this.json.lineWidth,t.height=s?this.json.lineHeight:this.json.height,super.updateTransform(t)}preRender(){var t;(t=this.underline)===null||t===void 0||t.preRender()}render(t){t.addSubMTask(()=>v1(this,void 0,void 0,function*(){this.doRender()}),"@TextUnitImpl[doRender]")}doRender(){let t=!1;const{lineWidth:e,lineHeight:n,baseLine:r,isHorz:o,underline:s,height:a,width:h,highlightColor:l,x:u,y:p,content:y,fillLineHeight:x,fill:E}=this.json;let A=this.json.needFill!==!1;if(E&&E.fill&&E.fill.fillType!=="solidFill"&&(A=!0),l){const C=new qi,[W,Q]=Om(l);C.beginFill(W,Q),C.drawRect(0,0,o?h:e,o?n:a),C.endFill(),this.textureContainer.addChild(C)}if(this.textGraphics.displayObject){const C=this.textGraphics.displayObject;if(o&&(C.position.y=p>0?p:0),A){const W=this.textFill.displayObject;if(W)W.mask=C,W.addChild(C),W.position.x=-u,C.position.x+=u,t=!0,this.textureContainer.addChild(W);else if(this.textFill.isSolidFill()){const Q=new ls;Q.color=this.textFill.getSolidFillColor(),C.filters=[Q],t=!0,this.textureContainer.addChild(C)}}else this.textureContainer.addChild(C)}if(this.strokeGraphics.displayObject){const C=this.strokeGraphics.displayObject;if(A){const W=this.strokeFill.displayObject;if(W)W.mask=C,W.addChild(C),o?W.position.y=p>0?p:0:W.position.x=u,this.textureContainer.addChild(W);else if(this.strokeFill.isSolidFill()){o?C.position.y=p>0?p:0:C.position.x=u;const Q=new ls;Q.color=this.strokeFill.getSolidFillColor(),C.filters=[Q],t=!0,this.textureContainer.addChild(C)}}else o?C.position.y=p>0?p:0:C.position.x=u,this.textureContainer.addChild(C)}if(this.underline&&(this.underline.render(),this.underline.sprite)){o?(this.underline.sprite.position.y=s?s-n/16:r,this.underline.sprite.position.x=0):(this.underline.sprite.position.x=0,this.underline.sprite.position.y=0);const C=this.textFill.getClonedDisplayObject();C?(C.mask=this.underline.sprite,C.addChild(this.underline.sprite),this.textureContainer.addChild(C)):this.textureContainer.addChild(this.underline.sprite)}if(t){const C=ce.p.create({width:o?h:e,height:o?Math.max(x,n):a,resolution:this.ctx.renderer.resolution});this.ctx.renderer.render(this.textureContainer,{renderTexture:C}),this.cacheSprite.texture=C,o&&p<0&&(this.cacheSprite.position.y=p),this.container.addChild(this.cacheSprite)}else this.container.addChild(this.textureContainer);this.container.name=y}destroy(){this.textFill.destroy(),this.textGraphics.destroy(),this.strokeFill.destroy(),this.strokeGraphics.destroy(),this.cacheSprite.texture.destroy(!0),this.cacheSprite.destroy(),this.textureContainer.destroy(),this.container.destroy()}}var zm=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};class y1 extends Xu{constructor(){super(...arguments),this.units=[],this.isHorz=!0,this.hyperLinkMap=new Map,this.hyperLinkContainerMap=new Map}getIterateElements(){return this.units}getIterateEntry(t,e,n){return this.units[e]?this.units[e]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null)}preRender(){}createUnits(t,e,n,r){for(let o=0,s=this.json.textUnits.length;o<s;o++)r.addSubMTask(()=>zm(this,void 0,void 0,function*(){var a;const h=this.json.textUnits[o],{height:l,width:u,fillHeight:p,baseline:y,y:x,underline:E}=this.json,A=new _1(Object.assign(Object.assign({},h),{lineHeight:l,lineWidth:u,baseLine:y-x,underline:E,fillLineHeight:p||l,isHorz:this.isHorz,shapeId:t,paragraphIndex:e,lineIndex:n,unitIndex:o}),this.ctx,this.global);if(A.preRender(),this.units.push(A),h.hyperlink||h.hlinkHover){const C=h.hyperlink?"click-"+JSON.stringify({action:h.hyperlink.action,target:h.hyperlink.target}):"hover-"+JSON.stringify({action:h.hlinkHover.action,target:h.hlinkHover.target}),W=this.hyperLinkContainerMap.has(C),Q=(a=this.hyperLinkContainerMap.get(C))!==null&&a!==void 0?a:new Cn.b;Q.name=C,Q.hitArea=new De.j(0,0,this.json.width,this.json.height);const rt=this.hyperLinkMap.get(C)||new Pm(this.container,this.ctx),pt=new qi;pt.beginFill(0,1e-5).drawRect(h.x,h.y,h.width,h.height).endFill(),Q.addChild(pt),W||(h.hyperlink&&rt.addAction(h.hyperlink,"click"),h.hlinkHover&&rt.addAction(h.hlinkHover,"hover"),rt.addProxy(Q),Q.zIndex=999,this.container.addChild(Q),this.container.sortableChildren=!0,this.hyperLinkContainerMap.set(C,Q),this.hyperLinkMap.set(C,rt))}}),"@TextLineImpl[createUnits]")}render(t){for(const e of this.units.reverse())e.render(t),t.addSubMTask(()=>zm(this,void 0,void 0,function*(){this.container.addChild(e.container)}),"@TextLineImpl[container.addChild]")}destroy(){this.units.forEach(t=>{t.destroy()}),this.container.destroy({children:!1}),this.hyperLinkMap.clear();for(const t of this.hyperLinkContainerMap.values())t.destroy({children:!0,baseTexture:!0,texture:!0});this.hyperLinkContainerMap.clear()}}var Vm=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};class x1 extends Xu{constructor(){super(...arguments),this.iterateElements=[],this.lines=[],this.isHorz=!0}getIterateElements(){if(this.iterateElements.length>0)return this.iterateElements;const t=this.lines.reduce((e,n)=>e=e.concat(n.getIterateElements()),[]);return this.iterateElements=t,t}getIterateEntry(t,e,n){const r=this.getIterateElements();return r[e]?r[e]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null)}preRender(){}createLines(t,e,n){for(let r=0,o=this.json.lines.length;r<o;r++)n.addSubMTask(()=>Vm(this,void 0,void 0,function*(){const s=this.json.lines[r],a=new y1(s,this.ctx,this.global);a.isHorz=this.isHorz,a.container.name="line-"+r,a.createUnits(t,e,r,n),this.lines.push(a)}),"@TextParagraphImpl[createLines]")}render(t){for(const e of this.lines)e.render(t),t.addSubMTask(()=>Vm(this,void 0,void 0,function*(){this.container.addChild(e.container)}),"@TextParagraphImpl[container.addChild]")}destroy(){this.lines.forEach(t=>{t.destroy()}),this.container.destroy({children:!1})}}function b1(i,t,e){let n,r;const o=Math.round(i)%360;if(o%180==0)n=Math.cos(o*(Math.PI/180))*t,r=0;else if(o%90==0)n=0,r=-Math.sin(o*(Math.PI/180))*e;else{const s=Math.tan(o*Math.PI/180);n=t*e/Math.sqrt(Math.pow(e,2)+Math.pow(t*s,2)),(o>90&&o<270||o<-90&&o>-270)&&(n=-n),r=-s*n}return{x:n,y:r}}function T1(i,t,e,n,r,o){const s=b1((r=-r)/Math.PI*180,e,n),a=i.x-s.x,h=i.y-s.y;return{centerX:a/9525*t.x,centerY:h/9525*t.y,rx:e/9525*t.x,ry:n/9525*t.y,st:-r,end:-r+o,aClockWise:o<0}}function Wm(i){const t=new Ps,{scale:e}=i;let n={x:0,y:0};const r=i.path.trim().split(" ");for(let o=0;o<r.length;o+=2){const s=r[o],a=r[o+1];if(s==="M"){let[h,l]=a.split(",").map(u=>Number(u));n={x:h,y:l},h=h/9525*e.x,l=l/9525*e.y,t.moveTo(h,l)}else if(s==="A"){const[h,l,u,p]=a.split(",").map(rt=>Number(rt)),{centerX:y,centerY:x,rx:E,ry:A,st:C,end:W,aClockWise:Q}=T1(n,e,h,l,u,p);t.absellipse(y,x,E,A,C,W,Q,0)}else if(s==="L"){let[h,l]=a.split(",").map(u=>Number(u));n={x:h,y:l},h=h/9525*e.x,l=l/9525*e.y,t.lineTo(h,l)}else if(s==="QB"){let[h,l,u,p]=a.split(",").map(y=>Number(y));n={x:u,y:p},h=h/9525*e.x,l=l/9525*e.y,u=u/9525*e.x,p=p/9525*e.y,t.quadraticCurveTo(h,l,u,p)}else if(s==="CB"){let[h,l,u,p,y,x]=a.split(",").map(E=>Number(E));n={x:y,y:x},h=h/9525*e.x,l=l/9525*e.y,u=u/9525*e.x,p=p/9525*e.y,y=y/9525*e.x,x=x/9525*e.y,t.bezierCurveTo(h,l,u,p,y,x)}else if(s==="C")try{t.closePath()}catch{}}return t}function Bn(i,t){return i.curves.map(e=>e.getPoints(t)).reduce((e,n)=>e.concat(n),[])}const Ku={textCirclePour:{top:i=>i.getPoints(360),bottom:i=>i.getPoints(360)},textStop:{top:i=>Bn(i,100),bottom:i=>Bn(i,100)},textPlain:{top:i=>Bn(i,100),bottom:i=>Bn(i,100)},textTriangle:{top:i=>Bn(i,50),bottom:i=>Bn(i,101)},textTriangleInverted:{bottom:i=>Bn(i,50),top:i=>Bn(i,101)},textChevron:{bottom:i=>Bn(i,50),top:i=>Bn(i,50)},textChevronInverted:{bottom:i=>Bn(i,50),top:i=>Bn(i,50)},textRingInside:{top:i=>i.getPoints(360),bottom:i=>i.getPoints(360)},textRingOutside:{top:i=>i.getPoints(360),bottom:i=>i.getPoints(360)},textArchUpPour:{top:i=>i.getPoints(360),bottom:i=>i.getPoints(360)},textArchDownPour:{top:i=>i.getPoints(360),bottom:i=>i.getPoints(360)},textCurveUp:{top:i=>i.getPoints(360),bottom:i=>i.getPoints(360)},textCurveDown:{top:i=>i.getPoints(360),bottom:i=>i.getPoints(360)},textCanUp:{top:i=>i.getPoints(360),bottom:i=>i.getPoints(360)},textCanDown:{top:i=>i.getPoints(360),bottom:i=>i.getPoints(360)},textWave1:{top:i=>i.getPoints(180),bottom:i=>i.getPoints(180)},textWave2:{top:i=>i.getPoints(180),bottom:i=>i.getPoints(180)},textDoubleWave1:{top:i=>i.getPoints(360),bottom:i=>i.getPoints(360)},textWave4:{top:i=>i.getPoints(360),bottom:i=>i.getPoints(360)},textInflate:{top:i=>i.getPoints(180),bottom:i=>i.getPoints(180)},textDeflate:{top:i=>i.getPoints(180),bottom:i=>i.getPoints(180)},textInflateBottom:{top:i=>Bn(i,180),bottom:i=>i.getPoints(180)},textDeflateBottom:{top:i=>Bn(i,180),bottom:i=>i.getPoints(180)},textInflateTop:{bottom:i=>Bn(i,180),top:i=>i.getPoints(180)},textDeflateTop:{bottom:i=>Bn(i,180),top:i=>i.getPoints(180)},textFadeRight:{bottom:i=>Bn(i,180),top:i=>Bn(i,180)},textFadeLeft:{bottom:i=>Bn(i,180),top:i=>Bn(i,180)},textFadeUp:{bottom:i=>Bn(i,180),top:i=>Bn(i,180)},textFadeDown:{bottom:i=>Bn(i,180),top:i=>Bn(i,180)},textSlantUp:{bottom:i=>Bn(i,180),top:i=>Bn(i,180)},textSlantDown:{bottom:i=>Bn(i,180),top:i=>Bn(i,180)},textCascadeUp:{bottom:i=>Bn(i,180),top:i=>Bn(i,180)},textCascadeDown:{bottom:i=>Bn(i,180),top:i=>Bn(i,180)},textArchUp:{bottom:i=>Bn(i,180),top:i=>Bn(i,180)},textArchDown:{bottom:i=>Bn(i,180),top:i=>Bn(i,180)},textCircle:{bottom:i=>Bn(i,180),top:i=>Bn(i,180)}};function E1(i,t,e,n,r){const o=i.trim().split(" "),[s,a]=o[1].split(",").map(Q=>parseFloat(Q)),[h,l,u,p]=o[3].split(",").map(Q=>parseFloat(Q)),y=function(Q,rt,pt,it,gt,ht){const ft=Math.abs(ht*Math.sqrt((pt*pt+it*it)/2)),jt=Math.ceil(ft/9525/10);let Lt=0,At=gt,Rt={x:Q+pt*Math.cos(At),y:rt+it*Math.sin(At)};for(let Nt=0;Nt<jt;Nt+=1){At+=ht/jt;const Ot={x:Q+pt*Math.cos(At),y:rt+it*Math.sin(At)};Lt+=Math.sqrt(Math.pow(Ot.x-Rt.x,2)+Math.pow(Ot.y-Rt.y,2)),Rt=Ot}return Lt}(s,a,h,l,u,p);r*=Math.min(1,y/9525/n);const x=new De.d;x.translate(r+t/2,0),x.rotate(2*Math.PI-u);const E=new De.g(0,0),A=x.apply(E);A.x+=t/2,A.y=e/2-A.y;const C=h+9525*r,W=l+9525*r;return`M ${9525*A.x},${9525*A.y} A ${C},${W},${u},${p}`}var Oa=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};class S1{constructor(t,e,n,r,o){this.iterateElements=[],this.paragraphs=[],this.container=new Cn.b,this.textContainer=new Cn.b,this.textColorFilter=new ls,this.json=t,this.ctx=e,this.shapeRotation=o,this.parentGlobalPos=r,this.iterateType=n,this.container.name="textBody",this.global={x:this.parentGlobalPos.x+t.position.x,y:this.parentGlobalPos.y+t.position.y},this.container.position.x=t.position.x,this.container.position.y=t.position.y,this.container.scale.x=t.scale.x,this.container.scale.y=t.scale.y;const s=new qi;s.drawRect(0,0,t.width,t.height),this.container.addChild(s),this.container.addChild(this.textContainer),this.textColorFilter.currentColor="#000000FF",this.textColorFilter.designColor="#000000FF"}get width(){return this.json.width}get height(){return this.json.height}get x(){return this.json.position.x}get y(){return this.json.position.y}set color(t){var e;((e=this.container.filters)!==null&&e!==void 0?e:[]).length>0&&(this.textColorFilter.color=t)}get color(){return this.textColorFilter.color}get on(){var t;return((t=this.container.filters)!==null&&t!==void 0?t:[]).length>0?"true":"false"}set on(t){var e;t==="true"?((e=this.container.filters)!==null&&e!==void 0?e:[]).indexOf(this.textColorFilter)<0&&(this.container.filters=[this.textColorFilter]):this.container.filters=[]}getTextElement(t,e){return t==="paragraph"?this.paragraphs[e[0]]:null}getIterateEntry(t,e){return this.iterateElements[t]?this.iterateElements[t]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",e),null)}destroy(){this.paragraphs.forEach(t=>{t.destroy()}),this.textColorFilter.destroy()}createParagraphs(t,e){for(let n=0,r=this.json.paragraphs.length;n<r;n++)e.addSubMTask(()=>Oa(this,void 0,void 0,function*(){var o;const s=this.json.paragraphs[n],a=new x1(s,this.ctx,this.global);a.isHorz=(o=this.json.isHorz)===null||o===void 0||o,a.createLines(t,n,e),e.addSubMTask(()=>Oa(this,void 0,void 0,function*(){this.iterateElements=this.iterateElements.concat(a.getIterateElements()),a.container.name="\u6BB5\u843D-"+n,this.paragraphs.push(a)}),"@TextBodyImpl[paragraphs.push]")}),"@TextBodyImpl[createParagraphs]")}render(t){for(const e of this.paragraphs)e.render(t),t.addSubMTask(()=>Oa(this,void 0,void 0,function*(){this.textContainer.addChild(e.container)}),"@TextBodyImpl[container.addChild]");t.addSubMTask(()=>Oa(this,void 0,void 0,function*(){const{width:e}=this.container;this.container.scale.x<0&&(this.container.x+=-1*e)}),"@TextBodyImpl[reset width]"),t.addSubMTask(()=>Oa(this,void 0,void 0,function*(){if(this.json.presetTextShape){const e=this.json.paragraphs.map(l=>l.x).reduce((l,u)=>Math.min(l,u)),n=this.json.paragraphs[0].y,r=this.textContainer.getBounds(),{width:o,height:s}=r,{geometry:a,type:h}=this.json.presetTextShape;if(a.paths){const l=ce.p.create({width:o,height:s,resolution:this.ctx.renderer.resolution}),u=new De.d;u.translate(-e,-n),this.ctx.renderer.render(this.textContainer,{renderTexture:l,transform:u});const p=this.json.isHorz!==void 0&&!this.json.isHorz;if(["textCircle","textArchUp","textArchDown"].indexOf(this.json.presetTextShape.type)>=0){const x=E1(a.paths[0].path,this.json.width,this.json.height,o,s);a.paths.unshift(Object.assign(Object.assign({},a.paths[0]),{path:x}))}const y=function(x,E,A,C){if(!Ku[A])return null;const W=Ku[A].top(Wm(E)),Q=Ku[A].bottom(Wm(x));if(W.length!==Q.length)return null;const rt=Math.min(W.length,Q.length),pt=1/(rt-1),it=[],gt=[],ht=new Array(2*rt).fill("").map((ft,jt)=>jt);for(let ft=0;ft<rt;ft++)it.push(W[ft].x,W[ft].y),C?gt.push(1,pt*ft):gt.push(pt*ft,0),it.push(Q[ft].x,Q[ft].y),C?gt.push(0,pt*ft):gt.push(pt*ft,1);return{vertices:new Float32Array(it),uvs:new Float32Array(gt),drawMode:gn.f.TRIANGLE_STRIP,indices:new Uint16Array(ht)}}(a.paths[1],a.paths[0],h,p);if(y){const x=new Sb.b(l,y.vertices,y.uvs,y.indices,y.drawMode);this.textContainer.visible=!1,this.container.addChild(x)}}}}),"presetTextShape")}}class w1{constructor(t){this.scaleX=1,this.scaleY=1,this.pivot={x:0,y:0},this.paths=[],this.hash="",this.width=0,this.height=0,this.graphicsId="",this.textureId="",this.id=t.id,this.type=t.type,this.heightSize=t.heightSize,this.widthSize=t.widthSize,this.fillStyle=t.fillStyle||{fillType:"solidFill",color:"#ffffffff"},this.lineWidth=t.lineWidth||1,this.position=t.position||{x:0,y:0},this.rotate=t.rotation||1,this.path=this.getUnitPath(),this.setScaleFromLineWidth(),this.setScaleFromSize(),this.generatePaths(),this.setPivot()}setPivot(){switch(this.type){case"oval":case"diamond":this.pivot={x:this.width/2,y:this.height/2};break;case"triangle":this.pivot={x:.7*this.width,y:this.height/2};break;case"arrow":case"stealth":default:this.pivot={x:this.width,y:this.height/2}}}generatePaths(){this.hash="arrow-"+Jl()(this.path+this.scaleX+this.scaleY),this.paths=[{id:this.id,path:this.path,fill:"norm",hasStroke:!1,hash:this.hash,scale:{x:this.scaleX,y:this.scaleY}}]}getUnitPath(){switch(this.type){case"stealth":return"M 0,0 L 95250,47625 L 0,95250 L 28575,47625 C C";case"oval":return"M 0,47625 A 47625,47625,-3.14159265,6.2831853 C C";case"diamond":return"M 47625,0 L 95250,47625 L 47625,95250 L 0,47625 C C";case"arrow":return"M 9525,0 L 95250,47625 L 9525,95250 L 0,85725 L 68389.5,47625 L 0,9525 C C";case"triangle":return"M 0,0 L 95250,47625 L 0,95250 C C";default:return""}}setScaleFromLineWidth(){switch(this.type){case"stealth":case"oval":case"diamond":case"arrow":case"triangle":this.scaleX*=.29*this.lineWidth+.7,this.scaleY*=.29*this.lineWidth+.7;break;default:throw new Error("can't match any arrow type!")}}setScaleFromSize(){switch(this.type){case"stealth":case"oval":case"diamond":case"arrow":case"triangle":this.scaleX*=1,this.scaleY*=1;break;default:throw new Error("can't match any arrow type!")}switch(this.widthSize){case"sm":this.scaleX*=3/4;break;case"lg":this.scaleX*=1.25;break;case"med":this.scaleX*=1}switch(this.heightSize){case"sm":this.scaleY*=3/4;break;case"lg":this.scaleY*=1.25;break;case"med":this.scaleY*=1}this.width=10*this.scaleX,this.height=10*this.scaleY}}class Zu{constructor(t,e,n,r,o,s,a,h,l,u,p){this.id=t,this.ctx=e,this.paths=n,this.hash=r,this.nept=o,this.width=s,this.height=a,this.lineStyle=h,this.shouldFill=l,this.bgColor=u,this.lnColor=p,this.clonedObjects=[],this._displayObject=null,this.isRectangle=!1,this.isPureRect=!1,this.isColoredPureRect=!1,this.isRectangle=this.rectangleDetect(n),this.isRectangle&&l?this.bgColor?this.isColoredPureRect=!0:this.isPureRect=!0:this.ctx.graphicsTexture.addGraphics(this.id,this.paths,this.hash,this.nept,this.width,this.height,this.lineStyle,this.ctx.objectPoolGroup,this.shouldFill,this.bgColor,this.lnColor)}get displayObject(){return this._displayObject}pointDis(t,e){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)}rectangleDetect(t){if(t.length!==1)return!1;const e=t[0].path.trim().split(" ");if(e.length!==10)return!1;const n=[],r=[];for(let h=0;h<e.length;h+=2){const l=e[h],u=e[h+1],[p,y]=u.split(",").map(x=>Number(x)/100);n.push(l),r.push({x:p,y})}if(n.join("")!=="MLLLC")return!1;for(let h=0;h<3;h++){const l=r[h],u=r[h+1];if(l.x!==u.x&&l.y!==u.y)return!1}const o=r.slice(0,4).reduce((h,l)=>h+l.x,0)/4,s=r.slice(0,4).reduce((h,l)=>h+l.y,0)/4;if(Number.isNaN(o)||Number.isNaN(s))return!1;const a={x:o,y:s};return xr(this.pointDis(a,r[0]),this.pointDis(a,r[1]))&&xr(this.pointDis(a,r[0]),this.pointDis(a,r[2]))&&xr(this.pointDis(a,r[0]),this.pointDis(a,r[3]))&&this.pointDis(a,r[0])===this.pointDis(a,r[1])}createDisplayObject(){if(this.isPureRect){const t=new qi;return t.beginFill(0,1),t.drawRect(0,0,this.width,this.height),t}if(this.isColoredPureRect&&this.bgColor){const t=new qi,[e,n]=Om(this.bgColor);return t.beginFill(e,n),t.drawRect(0,0,this.width,this.height),t}{const t=new di,e=this.ctx.graphicsTexture.getGraphicsData(this.id);return e?(t.texture=e.texture,t.pivot.x=e.pivot.x,t.pivot.y=e.pivot.y,t):null}}getClonedDisplayObject(){const t=this.createDisplayObject();return this.clonedObjects.push(t),t}render(){this._displayObject=this.createDisplayObject()}isNeedMask(t,e){let n=!1;return this._displayObject&&(n=!(this.isRectangle&&Math.abs(t-this._displayObject.width)<2&&Math.abs(e-this._displayObject.height)<2&&this.shouldFill)),n}addArrows(t){var e;(e=this._displayObject)===null||e===void 0||e.addChild(t)}destroy(){var t;(t=this._displayObject)===null||t===void 0||t.destroy(),this._displayObject=null,this.clonedObjects.forEach(e=>{e==null||e.destroy()}),this.clonedObjects=[]}}class Qu extends ce.k{}var A1=v(113),M1=v.n(A1),C1=v(114),R1=v.n(C1);class I1 extends Qu{constructor(t){super(M1.a,R1.a,{uShapeFilterArea:new Float32Array([0,0,0,0]),uGlowColor:br(t.color),uSdfSampler:ce.t.WHITE,uSdfReady:0,uSdfMaxDis:0,uRad:t.rad/2,uSdfPosition:new Float32Array([0,0])}),this.priority=3,this.json=t}filterAreaJustify(t){const e=Math.ceil(this.json.rad),n=Math.ceil(t.width+2*e),r=Math.ceil(t.height+2*e);return new De.j(t.x-e,t.y-e,n,r)}sdfBox(t,e){const n=Math.ceil(this.json.rad),r=Math.ceil(t+2*n),o=Math.ceil(e+2*n);return new De.j(n,n,r,o)}}var P1=v(19),eh=v.n(P1),O1=v(115),N1=v.n(O1);class L1 extends Qu{constructor(t){super(eh.a,N1.a,{uShapeFilterArea:new Float32Array([0,0,0,0]),uRad:t.rad,uSdfSampler:ce.t.WHITE,uSdfReady:0,uSdfMaxDis:1}),this.priority=2,this.json=t}filterAreaJustify(t){return t}sdfBox(t,e){return new De.j(0,0,t,e)}}class Xm{}var D1=v(116),F1=v.n(D1);class B1 extends ce.k{constructor(t){super(eh.a,F1.a,{uColor:br(t)})}}class U1 extends Xm{constructor(t,e,n){super(),this.order=1,this.outputTexture=ce.t.WHITE,this.frameTextures=[],this.json=t,this.effectContainer=e,this.outputSprite=new di,this.targetScale=n,this.outputSprite.scale.x=this.json.sx,this.outputSprite.scale.y=this.json.sy,this.outputSprite.skew.x=(this.targetScale.x>0?1:-1)*this.json.kx,this.outputSprite.skew.y=(this.targetScale.y>0?1:-1)*this.json.ky,this.outputSprite.filters=[new Hs.BlurFilter(this.json.blurRad/2,4),new B1(this.json.color)]}updateFrame(t){const e=this.frameTextures[t];if(e){const n=this.effectContainer.getBounds(),r=(this.effectContainer.width-e.width)/2,o=(this.effectContainer.height-e.height)/2,s=new De.g(n.x,n.y),a=new De.g(n.x,n.y);switch(this.json.align){case"tl":a.x=n.x,a.y=n.y;break;case"t":a.x=n.x+n.width/2,a.y=n.y,s.x+=n.width/2;break;case"tr":a.x=n.x+n.width,a.y=n.y,s.x+=n.width;break;case"l":a.x=n.x,a.y=n.y+n.height/2,s.y+=n.height/2;break;case"ctr":a.x=n.x+n.width/2,a.y=n.y+n.height/2,s.x+=n.width/2,s.y+=n.height/2;break;case"r":a.x=n.x+n.width,a.y=n.y+n.height/2,s.x+=n.width,s.y+=n.height/2;break;case"bl":a.x=n.x,a.y=n.y+n.height,s.y+=n.height;break;case"b":a.x=n.x+n.width/2,a.y=n.y+n.height,s.x+=n.width/2,s.y+=n.height;break;case"br":a.x=n.x+n.width,a.y=n.y+n.height,s.x+=n.width,s.y+=n.height}const h=this.effectContainer.toLocal(a);this.outputSprite.pivot.x=h.x,this.outputSprite.pivot.y=h.y;const l=new De.g(this.json.dist,0),u=new De.d;u.rotate(this.json.dir),u.translate(s.x+r,s.y+o),u.apply({x:l.x,y:l.y},l);const p=this.effectContainer.toLocal(l);this.outputSprite.position.x=p.x,this.outputSprite.position.y=p.y,this.outputSprite.texture=e}}createOutput(t,e){this.frameTextures[e]=t}setFrameOffset(t,e){console.log(t,e)}}var k1=v(117),G1=v.n(k1);class H1 extends ce.k{constructor(t,e){super(eh.a,G1.a,{uStartAlpha:t.startAlpha,uEndAlpha:t.endAlpha,uStartPos:t.startPos,uEndPos:t.endPos,uHeight:e}),console.log(this)}}class j1 extends Xm{constructor(t,e,n,r,o){super(),this.order=2,this.outputSprite=new di,this.outputTexture=ce.t.WHITE,this.frameTextures=[],this.json=t,this.shapeScaleX=r,this.effectContainer=e,this.rotation=n,this.ctx=o,this.outputSprite.anchor.x=.5,this.outputSprite.anchor.y=.5;const s=this.effectContainer.getBounds();this.outputSprite.filters=[new Hs.BlurFilter(this.json.blurRad/2,4),new H1(this.json,s.height)],this.outputSprite.alpha=.5,this.outputSprite.rotation=this.shapeScaleX===-1?Math.PI+2*this.rotation:Math.PI-2*this.rotation,this.outputSprite.scale.x=-1}updateFrame(t){const e=this.frameTextures[t];e&&(this.outputSprite.texture=e)}createOutput(t,e){this.frameTextures[e]=t}setFrameOffset(t,e){const n=this.effectContainer.getBounds(),r=new De.g(n.x+n.width/2,n.y+n.height/2),o=new De.g(r.x,r.y+n.height+this.json.dist),s=this.effectContainer.toLocal(o);this.outputSprite.position.x=s.x+t,this.outputSprite.position.y=s.y+e}}var z1=v(118),V1=v.n(z1);class W1 extends Qu{constructor(t){super(eh.a,V1.a,{}),this.priority=1,this.json=t}filterAreaJustify(t){return t}sdfBox(){return null}}var Ym=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};class X1 extends yi.a{constructor(t,e,n,r,o,s){super(),this.effects=[],this.attachs=[],this.frames=new Map,this._targetContainer=new Cn.b,this.frameCount=1,this.ctx=r,this.originWidth=t.width,this.originHeight=t.height,this.cacheKey=n,this.sourceSprite=new di;for(const x of e)switch(x.type){case"innerShadow":this.effects.push(new W1(x));break;case"softEdge":this.effects.push(new L1(x));break;case"glow":this.effects.push(new I1(x));break;case"reflection":this.attachs.push(new j1(x,t,o,s.x,this.ctx));break;case"outerShadow":this.attachs.push(new U1(x,t,s))}this.effects=this.effects.sort((x,E)=>x.priority-E.priority),this.attachs=this.attachs.sort((x,E)=>x.order-E.order);for(const x of this.attachs)this._targetContainer.addChild(x.outputSprite);this.sourceSprite.name="effect-sprite";const a=new De.j(0,0,this.originWidth,this.originHeight),h=this.effects.map(x=>x.filterAreaJustify(a)),l=h.map(x=>x.x),u=h.map(x=>x.y),p=h.map(x=>x.width),y=h.map(x=>x.height);this.filterArea=new De.j(Math.min(...l,0),Math.min(...u,0),Math.max(...p,this.originWidth),Math.max(...y,this.originHeight)),this.sourceSprite.filters=this.effects,this.sourceSprite.filterArea=new De.j(0,0,this.filterArea.width,this.filterArea.height),this._targetSprite=new di,this._targetSprite.name="effect-sprite",this._targetContainer.sortableChildren=!0,this._targetSprite.zIndex=999,this._targetContainer.addChild(this._targetSprite)}get container(){return this._targetContainer}getSdfTexture(t,e){return Ym(this,void 0,void 0,function*(){const n=`${this.cacheKey}_${t}`,r=this.effects.map(o=>({sdfRect:o.sdfBox(e.width,e.height)})).reduce((o,s)=>(s.sdfRect&&(o.width<s.sdfRect.width&&(o.width=s.sdfRect.width),o.height<s.sdfRect.height&&(o.height=s.sdfRect.height)),o),new De.j(0,0));return r.width===0||r.height===0?null:this.ctx.sdfManager.getSdf(e,r,n)})}setFrameCount(t){this.frameCount=t}updateFrame(t){const e=this.frames.get(t);if(e){this._targetSprite.texture=e.texture,this._targetSprite.pivot.x=e.pivotX,this._targetSprite.pivot.y=e.pivotY;for(const n of this.attachs)n.updateFrame(t)}}hasFrame(t){return this.frames.has(t)}setFrameOffset(t,e){this._targetContainer.position.x=-1*t,this._targetContainer.position.y=-1*e,this.attachs.forEach(n=>n.setFrameOffset(t,e))}createFrame(t,e){var n,r;return Ym(this,void 0,void 0,function*(){const o=e.width,s=e.height;if(this.frames.has(t))return;const a=yield this.getSdfTexture(t,e),h=(n=a==null?void 0:a.texture.width)!==null&&n!==void 0?n:0,l=(r=a==null?void 0:a.texture.height)!==null&&r!==void 0?r:0;for(const A of this.effects){const C=A.sdfBox(e.width,e.height);C&&a&&(A.uniforms.uSdfSampler=a.texture,A.uniforms.uSdfIsReady=1,A.uniforms.uSdfMaxDis=a.maxDis,A.uniforms.uSdfPosition=new Float32Array([(a.texture.width-C.width)/2/a.texture.width,(a.texture.height-C.height)/2/a.texture.height])),A.uniforms.uShapeFilterArea=new Float32Array([0,0,this.filterArea.width,this.filterArea.height])}this.sourceSprite.texture=e;const u=(this.filterArea.width-this.sourceSprite.width)/2,p=(this.filterArea.height-this.sourceSprite.height)/2;this.sourceSprite.x=u,this.sourceSprite.y=p;const y=Math.max(o,h,this.filterArea.width),x=Math.max(s,l,this.filterArea.height),E=ce.p.create({width:y,height:x,resolution:this.ctx.renderer.resolution});this.ctx.renderer.render(this.sourceSprite,{renderTexture:E}),this.frames.set(t,{texture:E,pivotX:-1*(this.originWidth-y)/2,pivotY:-1*(this.originWidth-y)/2});for(const A of this.attachs)A.createOutput(E,t);Array.from(this.frames.keys()).length===this.frameCount&&this.emit("ready")})}}var nh=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};const hs={pivot:{x:0,y:0},width:0,height:0};class qm extends Wu{constructor(t,e,n,r){var o,s,a,h,l,u,p,y,x;super(t,e,n),this.renderContainer=new Cn.b,this.needCacheAsBitMap=!1,this.backgroundGraphics=null,this.effectList=[],this.strokeGraphics=null,this.ghco=null,this.arrowList=[],this.fillColorFilter=new ls,this.strokeColorFilter=new ls,this.pptColorFilter=new ls,this.id="",this.ppt_c=new Yb(this),this.fill=new Im(this),this.stroke=new Wb(this),this.effectObject=null,this.effectContainer=new Cn.b,this.effectDisposer=()=>{},this.json=t,this.json.fillStyle&&this.json.fillStyle.fillType==="groupFill"&&r&&(this.json.fillStyle=r),this.id=t.id;const{fillStyle:E,lineStyle:A}=this.json;this.container.sortableChildren=!0,this.container.name=t.id+"_container_[Shape]",this.effectContainer.name="effect-container",this.effectContainer.zIndex=1,this.container.addChild(this.effectContainer),this.renderContainer.name=t.id+"_render_container_[Shape]",this.generateArrowList(),this.backgroundFill=this.createBackgroundFill(),this.backgroundGraphics=this.createBackgroundGraphics(),this.strokeFill=this.createStrokeFill(),this.strokeGraphics=this.createStrokeGraphics();try{this.ghco=new Zu(this.json.id+"-path-graphics-text-wrap",this.ctx,(a=(s=(o=this.json.textBody)===null||o===void 0?void 0:o.presetTextShape)===null||s===void 0?void 0:s.geometry.paths)!==null&&a!==void 0?a:[],(u=(l=(h=this.json.textBody)===null||h===void 0?void 0:h.presetTextShape)===null||l===void 0?void 0:l.geometry.hash)!==null&&u!==void 0?u:"",{x:0,y:0},((p=this.json.textBody)===null||p===void 0?void 0:p.width)||100,((y=this.json.textBody)===null||y===void 0?void 0:y.height)||100,{width:2,fill:{fillType:"solidFill",color:"#FF0000FF"}},!1,null,null)}catch(C){this.ctx.logger.error(C.message,this.ctx.taskId)}this.ctx.timingTargets.addTarget(this.id,this),(E==null?void 0:E.fillType)==="solidFill"&&(this.fillColorFilter.currentColor=E.color,this.fillColorFilter.designColor=E.color),((x=A==null?void 0:A.fill)===null||x===void 0?void 0:x.fillType)==="solidFill"&&(this.strokeColorFilter.currentColor=A.fill.color,this.strokeColorFilter.designColor=A.fill.color),this.updateTransform(this.json),t.textBody&&(this.text=new S1(t.textBody,this.ctx,t.textBody.iterateType,{x:this.designGlobalPosition.x,y:this.designGlobalPosition.y},this.json.rotation||0)),this.container.hitArea=new De.k(1,1,this.json.width,this.json.height),this.ctx.slideScopeEventHub.once("slide-render",C=>{if(this.ctx.slideIndex===C&&this.effectObject){const W=this.getEffectTexture();if(W){const{texture:Q,offsetX:rt,offsetY:pt}=W;this.effectObject.setFrameOffset(rt,pt),this.effectObject.createFrame(1,Q)}}})}get interactiveContainer(){return this.renderContainer}get strokeActive(){var t,e,n,r,o,s,a;return this.strokeFill.displayObject?((n=(e=(t=this.strokeFill.displayObject)===null||t===void 0?void 0:t.filters)===null||e===void 0?void 0:e.length)!==null&&n!==void 0?n:-1)>0:((a=(s=(o=(r=this.strokeGraphics)===null||r===void 0?void 0:r.displayObject)===null||o===void 0?void 0:o.filters)===null||s===void 0?void 0:s.length)!==null&&a!==void 0?a:-1)>0}set strokeActive(t){var e,n,r,o,s,a;const{displayObject:h}=this.strokeFill;t?h&&((n=(e=h.filters)===null||e===void 0?void 0:e.indexOf(this.strokeColorFilter))!==null&&n!==void 0?n:-1)<0?h.filters=[this.strokeColorFilter]:((r=this.strokeGraphics)===null||r===void 0?void 0:r.displayObject)&&((s=(o=this.strokeGraphics.displayObject.filters)===null||o===void 0?void 0:o.indexOf(this.strokeColorFilter))!==null&&s!==void 0?s:-1)<0&&(this.strokeGraphics.displayObject.filters=[this.strokeColorFilter]):h?h.filters=[]:!((a=this.strokeGraphics)===null||a===void 0)&&a.displayObject&&(this.strokeGraphics.displayObject.filters=[])}get pptColorActive(){var t,e;return((e=(t=this.renderContainer.filters)===null||t===void 0?void 0:t.length)!==null&&e!==void 0?e:-1)>0}set pptColorActive(t){this.renderContainer.filters=t?[this.pptColorFilter]:[]}get fillActive(){var t,e,n,r,o,s,a;return this.backgroundFill.displayObject?((n=(e=(t=this.backgroundFill.displayObject)===null||t===void 0?void 0:t.filters)===null||e===void 0?void 0:e.length)!==null&&n!==void 0?n:-1)>0:((a=(s=(o=(r=this.backgroundGraphics)===null||r===void 0?void 0:r.displayObject)===null||o===void 0?void 0:o.filters)===null||s===void 0?void 0:s.length)!==null&&a!==void 0?a:-1)>0}set fillActive(t){var e,n,r,o,s,a;t?this.backgroundFill.displayObject&&((n=(e=this.backgroundFill.displayObject.filters)===null||e===void 0?void 0:e.indexOf(this.fillColorFilter))!==null&&n!==void 0?n:-1)<0?this.backgroundFill.displayObject.filters=[this.fillColorFilter]:((r=this.backgroundGraphics)===null||r===void 0?void 0:r.displayObject)&&((s=(o=this.backgroundGraphics.displayObject.filters)===null||o===void 0?void 0:o.indexOf(this.fillColorFilter))!==null&&s!==void 0?s:-1)<0&&(this.backgroundGraphics.displayObject.filters=[this.fillColorFilter]):this.backgroundFill.displayObject?this.backgroundFill.displayObject.filters=[]:!((a=this.backgroundGraphics)===null||a===void 0)&&a.displayObject&&(this.backgroundGraphics.displayObject.filters=[])}getTextElement(t,e){var n,r;return(r=(n=this.text)===null||n===void 0?void 0:n.getTextElement(t,e))!==null&&r!==void 0?r:null}getBgElement(){return this}getIterateEntry(t,e,n){return e===0?this:t==="el"?(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null):this.text?this.text.getIterateEntry(e-1,n)||null:(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null)}getEffectTexture(){const t=this.effectContainer.getLocalBounds();let e=0,n=0;for(const s of this.effectContainer.children)s.pivot.x>e&&(e=s.pivot.x),s.pivot.y>n&&(n=s.pivot.y);const r=new De.d;if(r.translate(e,n),this.effectContainer.children.length===0)return null;const o=ce.p.create({width:t.width,height:t.height,resolution:this.ctx.renderer.resolution});return this.ctx.renderer.render(this.effectContainer,{renderTexture:o,transform:r}),{texture:o,offsetX:e,offsetY:n}}createStrokeGraphics(){var t,e,n,r;const{id:o,geometry:s,lineStyle:a}=this.json,{width:h,height:l,pivot:u}=(s==null?void 0:s.lineTransform)||hs,p=h||this.json.width,y=l||this.json.height,x=((t=a==null?void 0:a.fill)===null||t===void 0?void 0:t.fillType)==="solidFill"?a.fill.color:null;return a&&((e=a.fill)===null||e===void 0?void 0:e.fillType)!=="noFill"?new Zu(o+"-path-graphics",this.ctx,(n=s==null?void 0:s.paths)!==null&&n!==void 0?n:[],(r=s==null?void 0:s.hash)!==null&&r!==void 0?r:"",u||{x:0,y:0},p,y,a,!1,null,x):null}createStrokeFill(){const[t,e]=this.calculateFillObjectOffset(),{geometry:n,lineStyle:r,width:o,height:s}=this.json,a=(n==null?void 0:n.lineTransform)||hs,h=as()(r==null?void 0:r.width)?r.width:1;return new uo(this.ctx,r==null?void 0:r.fill,(a.width||o)+h+t,Math.max((a.height||s)+h,e),{useFilter:!0,useSlideBackgroundFill:!1})}createBackgroundGraphics(){var t;const{geometry:e,lineStyle:n,fillStyle:r,id:o}=this.json,{width:s,height:a,pivot:h}=(e==null?void 0:e.lineTransform)||hs,l=s||this.json.width,u=a||this.json.height,p=(r==null?void 0:r.fillType)==="solidFill"?r.color:null;return r&&r.fillType!=="noFill"||this.json.isPicture?new Zu(o+"-bg-graphics",this.ctx,(t=e==null?void 0:e.paths)!==null&&t!==void 0?t:[],(e==null?void 0:e.hash)||"",h||{x:0,y:0},l,u,n,!0,p,null):null}createBackgroundFill(){var t,e;const{fillStyle:n,width:r,height:o,lineStyle:s,geometry:a}=this.json,h=(a==null?void 0:a.fillTransform)||hs;return new uo(this.ctx,n,(h.width||r)+((t=s==null?void 0:s.width)!==null&&t!==void 0?t:0),(h.height||o)+((e=s==null?void 0:s.width)!==null&&e!==void 0?e:0),{useFilter:!0,useSlideBackgroundFill:this.json.useBgFill,fillFloat:this.json.fillFloat,shapeRotation:this.json.rotation})}createBackground(){var t,e,n,r,o,s,a,h;const{pivot:l,width:u,height:p}=((t=this.json.geometry)===null||t===void 0?void 0:t.fillTransform)||hs,{displayObject:y}=this.backgroundFill;y?(this.json.useBgFill&&((n=this.backgroundGraphics)===null||n===void 0?void 0:n.displayObject)?(this.needCacheAsBitMap=!0,y.mask=this.backgroundGraphics.displayObject,y.pivot.x=((r=this.json.position)===null||r===void 0?void 0:r.x)||0,y.pivot.y=((o=this.json.position)===null||o===void 0?void 0:o.y)||0,this.effectContainer.addChild(this.backgroundGraphics.displayObject)):((s=this.json.fillStyle)===null||s===void 0?void 0:s.fillType)==="gifFill"?(y.height=p||this.designHeight,y.width=u||this.designWidth,y instanceof Gu&&y.play(),!((a=this.backgroundGraphics)===null||a===void 0)&&a.isNeedMask(y.width,y.height)&&(y.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.effectContainer.addChild(this.backgroundGraphics.displayObject))):!((h=this.backgroundGraphics)===null||h===void 0)&&h.isNeedMask(y.width,y.height)&&(this.json.fillFloat||(this.needCacheAsBitMap=!0,y.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.effectContainer.addChild(this.backgroundGraphics.displayObject))),this.json.fillFloat||(y.x=l.x,y.y=l.y),this.effectContainer.addChild(y)):this.backgroundFill.hasFill&&((e=this.backgroundGraphics)===null||e===void 0?void 0:e.displayObject)&&this.effectContainer.addChild(this.backgroundGraphics.displayObject)}createPathFill(){var t,e,n;const{displayObject:r}=this.strokeFill,o=(t=this.strokeGraphics)===null||t===void 0?void 0:t.displayObject,[s,a]=this.calculateFillObjectOffset();r?(((e=this.strokeGraphics)===null||e===void 0?void 0:e.isNeedMask(r.width,r.height))&&o&&(this.needCacheAsBitMap=!0,r.pivot.x=o.pivot.x,r.pivot.y=o.pivot.y,o.pivot.x=0,o.pivot.y=0,r.mask=o,r.addChild(o),r.position.x=-s/2,r.position.y=-a/2,o.position.x=s/2,o.position.y=a/2),this.effectContainer.addChild(r)):this.strokeFill.hasFill&&((n=this.strokeGraphics)===null||n===void 0?void 0:n.displayObject)&&this.effectContainer.addChild(this.strokeGraphics.displayObject)}createFilledPathMask(){var t,e,n;const r=((e=(t=this.json.geometry)===null||t===void 0?void 0:t.paths)===null||e===void 0?void 0:e.filter(o=>o.fill!=="none"&&o.fill!=="norm"))||[];for(const o of r){const s=this.ctx.graphicsTexture.getGraphicsData(o.id);if(s){const a=new di(s.texture);a.pivot.x=s.pivot.x,a.pivot.y=s.pivot.y;const h=this.backgroundFill.getClonedDisplayObject(),l=(n=this.backgroundGraphics)===null||n===void 0?void 0:n.getClonedDisplayObject(),u=h||l;u&&(this.backgroundFill.displayObject&&(u.pivot.x=this.backgroundFill.displayObject.pivot.x,u.pivot.y=this.backgroundFill.displayObject.pivot.y),u.mask=a,u.filters=[Zb[o.fill]],this.needCacheAsBitMap=!0,this.effectContainer.addChild(u),this.effectContainer.addChild(a))}}}createArrow(){this.arrowList.length&&this.arrowList.forEach(t=>{var e;const n=this.ctx.graphicsTexture.getGraphicsData(t.graphicsId);if(n){const{texture:r}=n,o=new di(r);o.pivot.x=t.pivot.x,o.pivot.y=t.pivot.y,o.position.x=t.position.x,o.position.y=t.position.y,o.rotation=t.rotate/180*Math.PI,(e=this.backgroundGraphics)===null||e===void 0||e.addArrows(o)}})}generateArrowList(){var t,e;const{lineArrowList:n,lineStyle:r,id:o}=this.json,s=((t=r==null?void 0:r.fill)===null||t===void 0?void 0:t.fillType)==="solidFill"?r.fill.color:null;(e=n||[])===null||e===void 0||e.forEach((a,h)=>{var l,u;const p=new w1(Object.assign(Object.assign({},a),{fillStyle:r==null?void 0:r.fill,lineWidth:(l=r==null?void 0:r.width)!==null&&l!==void 0?l:0}));p.graphicsId=`${o}-arrow-${h}-graphics`,p.textureId=`${o}-arrow-${h}-fill`,this.ctx.graphicsTexture.addGraphics(p.graphicsId,(u=p.paths)!==null&&u!==void 0?u:[],p.hash,{x:0,y:0},p.width,p.height,void 0,this.ctx.objectPoolGroup,!0,s,null),this.arrowList.push(p)})}calculateFillObjectOffset(){let[t,e]=[0,0];return this.arrowList.length&&(t=this.arrowList.reduce((n,r)=>Math.max(n,r.width),0),e=this.arrowList.reduce((n,r)=>Math.max(n,r.height),0)),[t,e]}preRender(t){var e,n,r;const{lineStyle:o,geometry:s}=this.json,{width:a,height:h}=(s==null?void 0:s.lineTransform)||hs,l=a||this.json.width,u=h||this.json.height,p=((e=s==null?void 0:s.paths)===null||e===void 0?void 0:e.filter(x=>x.fill!=="none"&&x.fill!=="norm"))||[],y=((n=o==null?void 0:o.fill)===null||n===void 0?void 0:n.fillType)==="solidFill"?o.fill.color:null;t.addSubMTask(()=>nh(this,void 0,void 0,function*(){for(const x of p)this.ctx.graphicsTexture.addGraphics(x.id,[x],x.hash,((s==null?void 0:s.lineTransform)||hs).pivot,l,u,o,this.ctx.objectPoolGroup,!0,null,y)}),"@ShapeImpl[addGraphics]"),(r=this.text)===null||r===void 0||r.createParagraphs(this.json.id,t)}subClassRender(){return nh(this,void 0,void 0,function*(){})}render(t){t.addSubMTask(()=>nh(this,void 0,void 0,function*(){var e,n;(e=this.strokeGraphics)===null||e===void 0||e.render(),(n=this.backgroundGraphics)===null||n===void 0||n.render(),this.createBackground(),yield this.subClassRender(),this.createFilledPathMask(),this.createPathFill(),this.createArrow()}),"@ShapeImpl[render]"),this.text&&this.text.render(t),t.addSubMTask(()=>nh(this,void 0,void 0,function*(){var e,n,r,o,s,a,h,l,u,p,y,x,E;if(((e=this.json.textBody)===null||e===void 0?void 0:e.iterateType)==="wd"||((n=this.json.textBody)===null||n===void 0?void 0:n.iterateType)==="lt"){if(this.renderContainer.addChild(this.container),this.text){const{x:A,y:C}=(r=this.json.scale)!==null&&r!==void 0?r:{x:1,y:1};this.text.container.scale.x=C<0?-Math.abs(A):Math.abs(A),this.text.container.scale.y=C,this.text.container.position.x=((s=(o=this.json.position)===null||o===void 0?void 0:o.x)!==null&&s!==void 0?s:0)+this.text.x,this.text.container.position.y=((h=(a=this.json.position)===null||a===void 0?void 0:a.y)!==null&&h!==void 0?h:0)+this.text.y,this.text.container.scale.y<0&&(this.text.container.position.y+=this.text.height),this.text.container.scale.x<0&&(this.text.container.position.x+=this.json.width),this.renderContainer.addChild(this.text.container)}}else{if(this.text){if(Kb()(this.json.textRotateWithShape)&&!this.json.textRotateWithShape){const Q=this.json.rotation||0;this.text.container.rotation=-Q;const{width:rt}=this.text;this.text.container.position.x=rt}this.text.container.zIndex=100;const A=(l=this.json.effectList)===null||l===void 0?void 0:l.find(Q=>Q.type==="outerShadow"),C=(u=this.json.effectList)===null||u===void 0?void 0:u.find(Q=>Q.type==="softEdge"),W=(p=this.json.effectList)===null||p===void 0?void 0:p.find(Q=>Q.type==="glow");A&&A.sx!==1||C||W?this.container.addChild(this.text.container):this.effectContainer.addChild(this.text.container)}this.renderContainer.addChild(this.container)}if(this.needCacheAsBitMap,this.json.id==="background"&&this.ctx.hasBackgroundFillShape){const A=ce.p.create({width:this.json.width,height:this.json.height,resolution:Math.ceil(this.ctx.renderer.resolution)});this.ctx.renderer.render(this.renderContainer,{renderTexture:A}),this.ctx.bgTexture=A}this.json.effectList&&this.json.effectList.length>0&&((y=this.ctx.featureList)===null||y===void 0?void 0:y.effect)&&!this.ctx.forceCanvas&&!this.json.media&&(this.effectObject=new X1(this.effectContainer,this.json.effectList,`${this.ctx.taskId}_${this.ctx.slideIndex}_${this.json.id}`,this.ctx,this.json.rotation||0,new De.g(((x=this.json.scale)===null||x===void 0?void 0:x.x)||1,((E=this.json.scale)===null||E===void 0?void 0:E.y)||1)),function(A){var C,W,Q;return((C=A.fillStyle)===null||C===void 0?void 0:C.fillType)==="gifFill"||((Q=(W=A.lineStyle)===null||W===void 0?void 0:W.fill)===null||Q===void 0?void 0:Q.fillType)==="gifFill"||!!A.picFill&&A.picFill.fillType==="gifFill"}(this.json)&&this.effectObject.setFrameCount(-1),this.effectObject.on("ready",()=>{var A;this.effectContainer.visible=!1,this.effectObject.container.zIndex=10,this.container.addChild(this.effectObject.container),(A=this.effectObject)===null||A===void 0||A.updateFrame(1)}))}),"@ShapeImpl[post.render]")}clearOnSlideChange(){}initOnReuse(){}destroy(){var t,e,n,r;(t=this.text)===null||t===void 0||t.destroy(),this.fillColorFilter.destroy(),this.strokeColorFilter.destroy(),this.backgroundFill.destroy(),(e=this.backgroundGraphics)===null||e===void 0||e.destroy(),this.strokeFill.destroy(),(n=this.strokeGraphics)===null||n===void 0||n.destroy(),this.renderContainer.destroy(),(r=this.arrowRenderTexture)===null||r===void 0||r.destroy(!0),this.arrowList=[],this.effectDisposer()}}var Y1=v(119);const $u=new(v.n(Y1)).a,q1=$u.getDevice(),J1=$u.getBrowser(),ih=$u.getOS(),us={isDesktop(){let i=!0;return q1.type==="mobile"&&(i=!1),/Samsung/.test(J1.name||"")&&(i=!1),window.__nativeTags&&window.__nativeTags.platform&&(i=!1),i},isIOS(){let i=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^ios/i.test(window.__nativeTags.platform)&&(i=!0),ih.name&&/iOS/.test(ih.name)&&(i=!0),i},isAndroid(){let i=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^android/i.test(window.__nativeTags.platform)&&(i=!0),ih.name&&/android/i.test(ih.name)&&(i=!0),i},isLowGpuMemory(){var i,t;const e=(t=(i=window.__nativeTags)===null||i===void 0?void 0:i.platform)!==null&&t!==void 0?t:"";if(e){const n=e.split(" ");if(n[1]){if(/^iPad/.test(n[1])){const r=n[1].match(/^iPad(\d+)/);return!(r&&r[1]&&parseInt(r[1],10)>=6)}if(/^iPhone/.test(n[1])){const r=n[1].match(/^iPhone(\d+)/);return!(r&&r[1]&&parseInt(r[1],10)>=9)}return!1}return!1}return!0}};var rh=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};function ir(i,t){for(const e in t)i.style[e]=t[e]}const Uo={medianContainerClass:"median-container",hoverHiddeDelay:1500,portalWidth:300,portalHeight:50,hiddenOpacity:"0",hoverOpacity:"1",opacityAnimationTime:.4};class Na{constructor(t){var e,n;this.progress=document.createElement("div"),this.totalTime=document.createElement("span"),this.playButton=document.createElement("div"),this.pauseButton=document.createElement("div"),this.currentTime=document.createElement("span"),this.mediaController=document.createElement("div"),this.currentProgress=document.createElement("div"),this.fullScreenButton=document.createElement("div"),this.exitFullScreenButton=document.createElement("div"),this.medianIsEnd=!1,this.pickBookmarkIndex=0,this.playCallBackList=[],this.duration=0,this.isVideo=!1,this.start=0,this.end=0,this.fullscreenStatus=!1,this.changeMediaProgress=r=>{if(this.ctx.isPlayerPaused())return void this.ctx.logger.info("Media controller prevent seek event with paused state",this.ctx.taskId);r.stopPropagation();const o=r.offsetX/this.progress.clientWidth*this.duration;this.medianIsEnd=!1,this.ctx.mode!=="interactive"&&this.jumpToTime(o),this.ctx.mode!=="local"&&this.ctx.eventHub.emit(Qe.mediaSeek,{id:this.targetId,time:o,isPlaying:this.media.isPlaying}),this.delayHide()},this.jumpToTime=(r=0)=>rh(this,void 0,void 0,function*(){yield Xl(()=>!!this.duration,3e3);const o=Math.floor(r)+this.start;this.media.currentTime!==o&&(this.media.currentTime=o,this.changeBookmarkIndex(o,o>this.media.currentTime))}),this.showController=r=>{r.stopPropagation(),this.show()},this.getMediaDuration=()=>{this.duration&&!Number.isNaN(this.duration)||(this.duration=this.media.duration,this.start&&(this.duration-=this.start,this.jumpToTime()),this.end&&(this.duration-=this.end)),this.totalTime.innerText=Na.formatTime(this.duration)},this.playMedia=()=>rh(this,void 0,void 0,function*(){this.playButton.style.display="none",this.pauseButton.style.display="block",yield this.media.play(),this.medianIsEnd&&(this.medianIsEnd=!1,this.jumpToTime()),this.playCallBackList.forEach(r=>{r()}),this.delayHide()}),this.pauseMedia=()=>rh(this,void 0,void 0,function*(){this.playButton.style.display="block",this.pauseButton.style.display="none",yield this.media.pause()}),this.onMouseOut=r=>{r.stopPropagation(),this.hide()},this.mediaTimeUpdate=()=>rh(this,void 0,void 0,function*(){const r=this.media.currentTime-this.start;if(this.duration>0&&(r>this.duration||this.media.ended)&&(yield this.pauseMedia(),this.medianIsEnd=!0,this.jumpToTime(),this.ctx.eventHub.emit(Qe.mediaStop,{id:this.targetId}),this.onClickCancelFullScreenButtonHandle()),this.currentTime.innerText=Na.formatTime(r),this.currentProgress.style.flex=(r/this.duration).toString(),!this.bookmarkList||this.bookmarkList.length===0)return;const o=this.bookmarkList[this.pickBookmarkIndex];o&&o.time.toFixed(0)===this.media.currentTime.toFixed(0)&&(this.ctx.timingEventHub.emit(`shape ${this.shapeId} onMediaBookmark ${o.name}`),this.pickBookmarkIndex+=1)}),this.onPauseMedia=()=>{this.playButton.style.display="block",this.pauseButton.style.display="none"},this.onPlayMedia=()=>{this.playButton.style.display="none",this.pauseButton.style.display="block",this.playCallBackList.forEach(r=>{r()})},this._playMediaFromCtrl=()=>{this.playMediaFromCtrl(!1)},this._pauseMediaFromCtrl=()=>{this.pauseMediaFromCtrl(!1),this.delayHide()},this.onClickFullScreenButtonHandle=()=>{this.fullscreenPlay()},this.onClickCancelFullScreenButtonHandle=()=>{this.fullscreenStatus=!1,this.media.requestCancelFullscreen(),this.ctx.eventHub.emit(Qe.fullscreenChange,{targetId:this.targetId,state:!1}),this.delayHide()},this.onFullScreenChange=r=>{const{status:o,targetId:s,slideIndex:a}=r;this.changeFullScreenState(o,s,a),this.delayHide()},this.onContainerSizeChange=()=>{this.setControllerPosition()},this.onControllerShowStatusChange=({slideIndex:r,targetId:o,status:s})=>{if(r===this.ctx.slideIndex){if(this.targetId===o){const{hiddenOpacity:a,hoverOpacity:h}=Uo;s?(this.mediaController.style.opacity=h,this.mediaController.style.display="flex"):this.mediaController.style.opacity=a}this.delayHide()}},this.targetId=t.targetId,this.ctx=t.ctx,this.height=t.height,this.width=t.width,this.target=t.target,this.media=t.media,this.info=t.info,this.shapeId=t.shapeId,this.canvasElement=t.canvasElement,this.media.type==="video"&&(this.isVideo=!0),this.getMedianContainer(),this.createMediaController(),this.info.cut&&(this.start=(e=this.info.cut.start)!==null&&e!==void 0?e:0,this.end=(n=this.info.cut.end)!==null&&n!==void 0?n:0),this.info.bookmarkList&&(this.bookmarkList=this.info.bookmarkList.sort((r,o)=>r.time-o.time))}get clippedDuration(){return this.duration}getMedianContainer(){var t;const{medianContainerClass:e}=Uo;let n=(t=this.canvasElement.parentElement)===null||t===void 0?void 0:t.querySelector("."+e);n||(n=document.createElement("div"),n.className=e,this.canvasElement.parentElement.appendChild(n)),this.container=n}static formatTime(t){let e="00:00";if(t){const n=Math.floor(t/60),r=String(n<0?0:n).padStart(2,"0"),o=Math.floor(t%60);e=`${r}:${String(o<0?0:o).padStart(2,"0")}`}return e}generatePlayButton(t=20,e=20){const n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttributeNS(null,"viewBox","0 0 512 512"),n.setAttributeNS(null,"height",t.toString()),n.setAttributeNS(null,"width",e.toString());const r=document.createElementNS("http://www.w3.org/2000/svg","polyline");return r.setAttributeNS(null,"points","35 0, 477 256, 35 512"),r.setAttributeNS(null,"fill","#000000"),n.appendChild(r),n}generatePauseButton(t=20,e=20){const n=document.createElementNS("http://www.w3.org/2000/svg","svg");ir(n,{height:t+"px"}),n.setAttributeNS(null,"viewBox","0 0 512 512"),n.setAttributeNS(null,"height",t.toString()),n.setAttributeNS(null,"width",e.toString());const r=document.createElementNS("http://www.w3.org/2000/svg","rect");r.setAttributeNS(null,"x","35"),r.setAttributeNS(null,"y","0"),r.setAttributeNS(null,"width","148"),r.setAttributeNS(null,"height","512");const o=r.cloneNode(!0);return o.setAttributeNS(null,"x","330"),n.append(r,o),n}generateFullScreenButton(t=20,e=20){const n=document.createElementNS("http://www.w3.org/2000/svg","svg");ir(n,{height:t+"px",width:e+"px"}),n.setAttributeNS(null,"width",e.toString()),n.setAttributeNS(null,"height",t.toString()),n.setAttributeNS(null,"viewBox","0 0 1024 1024");const r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttributeNS(null,"d","M918.116352 107.409408c10.186752 10.175488 10.186752 26.691584 0 36.87936L653.734912 407.038976c-10.187776 10.187776-26.703872 10.187776-36.891648 0-10.175488-10.187776-10.175488-26.703872 0.013312-36.891648l264.38144-262.73792c10.174464-10.187776 26.69056-10.200064 36.87936-0.013312L918.117376 107.409408zM878.281728 148.096l-161.155072-0.44544c-11.283456 0.279552-20.85888-8.226816-21.90336-19.458048l0-13.421568c0.318464-10.671104 8.889344-19.241984 19.560448-19.560448l187.030528 0.827392c0.1792-0.037888 0.357376-0.0768 0.523264-0.089088l9.549824-0.229376c5.005312-0.152576 9.843712 1.770496 13.372416 5.336064 3.32288 3.629056 4.9664 8.49408 4.545536 13.40928l-1.032192 9.537536c0 0.191488 0.70144 0.318464 0.70144 0.49664l-0.534528 188.279808c-0.54784 9.984-9.092096 17.637376-19.076096 17.089536-0.165888-0.012288-0.319488-0.0256-0.484352-0.037888L896.009216 329.8304c-10.379264-0.0512-18.733056-8.506368-18.681856-18.885632 0.013312-0.191488 0.013312-0.381952 0.013312-0.585728L878.281728 148.096zM105.884672 916.661248c-10.187776-10.175488-10.200064-26.691584-0.013312-36.87936 0 0 0-0.013312 0.013312-0.013312l265.19552-262.73792c10.35264-10.008576 26.86976-9.729024 36.866048 0.636928 9.766912 10.110976 9.766912 26.131456 0 36.242432L143.579136 916.661248C133.072896 926.848 116.3776 926.848 105.884672 916.661248L105.884672 916.661248zM146.533376 875.973632l161.154048 0.433152c11.283456-0.292864 20.85888 8.213504 21.891072 19.458048l0 13.38368c-0.292864 10.672128-8.876032 19.255296-19.560448 19.561472l-187.858944-0.828416c-0.165888 0.037888-0.344064 0.075776-0.509952 0.089088l-9.550848 0.229376c-5.004288 0.152576-9.831424-1.782784-13.35808-5.336064-3.323904-3.629056-4.979712-8.493056-4.54656-13.395968l1.031168-9.537536c0-0.191488-0.712704-0.330752-0.700416-0.509952l0.534528-188.278784c0.534528-9.984 9.066496-17.625088 19.050496-17.089536 0.165888 0.013312 0.330752 0.0256 0.508928 0.037888l14.212096 0c10.365952 0.0512 18.719744 8.507392 18.656256 18.873344 0 0.191488 0 0.395264-0.013312 0.598016L146.533376 875.973632zM918.116352 916.661248c10.186752-10.175488 10.200064-26.691584 0.012288-36.87936 0 0 0-0.013312-0.012288-0.013312l-264.38144-262.73792c-10.365952-10.008576-26.86976-9.729024-36.87936 0.636928-9.766912 10.110976-9.766912 26.131456 0 36.242432L881.22368 916.661248c10.186752 10.186752 26.703872 10.186752 36.891648 0.013312L918.115328 916.661248 918.116352 916.661248zM878.281728 875.973632l-161.168384 0.433152c-11.270144-0.292864-20.845568 8.213504-21.890048 19.458048l0 13.38368c0.306176 10.672128 8.889344 19.241984 19.560448 19.561472l187.030528-0.828416c0.1792 0.037888 0.357376 0.075776 0.523264 0.089088l9.549824 0.229376c5.005312 0.152576 9.843712-1.782784 13.372416-5.336064 3.32288-3.629056 4.978688-8.493056 4.545536-13.395968l-1.032192-9.537536c0-0.191488 0.70144-0.330752 0.70144-0.509952l-0.534528-188.278784c-0.54784-9.984-9.092096-17.637376-19.076096-17.089536-0.165888 0.013312-0.319488 0.0256-0.484352 0.037888L896.009216 694.19008c-10.379264 0.0512-18.733056 8.507392-18.681856 18.885632 0 0.191488 0.013312 0.381952 0.013312 0.584704L878.281728 875.973632zM105.884672 107.409408c-10.187776 10.175488-10.187776 26.691584 0 36.87936l265.19552 262.750208c10.187776 10.187776 26.691584 10.187776 36.87936 0s10.175488-26.703872-0.012288-36.891648l-264.368128-262.73792C133.072896 97.222656 116.3776 97.222656 105.884672 107.409408L105.884672 107.409408zM146.533376 148.096l161.154048-0.44544c11.283456 0.292864 20.85888-8.213504 21.891072-19.458048l0-13.421568c-0.306176-10.671104-8.889344-19.241984-19.560448-19.560448l-187.858944 0.827392c-0.165888-0.0512-0.344064-0.0768-0.509952-0.089088l-9.550848-0.229376c-5.004288-0.152576-9.831424 1.782784-13.35808 5.336064-3.323904 3.629056-4.979712 8.49408-4.54656 13.40928l1.031168 9.537536c0 0.191488-0.712704 0.318464-0.700416 0.49664l0.534528 188.279808c0.534528 9.970688 9.066496 17.624064 19.050496 17.089536 0.165888-0.012288 0.330752-0.0256 0.508928-0.037888l14.212096 0c10.365952-0.0512 18.719744-8.506368 18.656256-18.87232 0-0.191488 0-0.395264-0.013312-0.598016L146.533376 148.096z"),n.appendChild(r),document.body.appendChild(n),n}generateExitFullScreenButton(t=20,e=20){const n=document.createElementNS("http://www.w3.org/2000/svg","svg");ir(n,{height:t+"px",width:e+"px"}),n.setAttributeNS(null,"width",e.toString()),n.setAttributeNS(null,"height",t.toString()),n.setAttributeNS(null,"viewBox","0 0 1024 1024");const r=document.createElementNS("http://www.w3.org/2000/svg","path"),o=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttributeNS(null,"d","M716.8 998.4a25.6 25.6 0 0 1-25.6-25.6v-256a25.6 25.6 0 0 1 25.6-25.6h256a25.6 25.6 0 1 1 0 51.2h-230.4v230.4a25.6 25.6 0 0 1-25.6 25.6zM307.2 998.4a25.6 25.6 0 0 1-25.6-25.6v-230.4H51.2a25.6 25.6 0 1 1 0-51.2h256a25.6 25.6 0 0 1 25.6 25.6v256a25.6 25.6 0 0 1-25.6 25.6zM972.8 332.8h-256a25.6 25.6 0 0 1-25.6-25.6v-256a25.6 25.6 0 1 1 51.2 0v230.4h230.4a25.6 25.6 0 1 1 0 51.2zM307.2 332.8h-256a25.6 25.6 0 1 1 0-51.2h230.4V51.2a25.6 25.6 0 1 1 51.2 0v256a25.6 25.6 0 0 1-25.6 25.6z"),o.setAttributeNS(null,"d","M307.2 332.8a25.6 25.6 0 0 1-18.112-7.488L56.896 93.12a25.6 25.6 0 0 1 36.224-36.224l232.192 232.192A25.6 25.6 0 0 1 307.2 332.8zM716.8 332.8a25.6 25.6 0 0 1-18.112-43.712L930.88 56.896a25.6 25.6 0 0 1 36.224 36.224l-232.192 232.192a25.472 25.472 0 0 1-18.112 7.488zM948.992 974.592a25.6 25.6 0 0 1-18.112-7.488l-232.192-232.192a25.6 25.6 0 0 1 36.224-36.224l232.192 232.192a25.6 25.6 0 0 1-18.112 43.712zM75.008 974.592a25.6 25.6 0 0 1-18.112-43.712l232.192-232.192a25.6 25.6 0 0 1 36.224 36.224l-232.192 232.192a25.472 25.472 0 0 1-18.112 7.488z"),n.appendChild(r),n.appendChild(o),document.body.appendChild(n),n}createButton(){const t={marginLeft:"15px",marginRight:"10px",fontSize:"0",height:"20px",display:"flex",justifyContent:"center",alignItems:"center"};ir(this.playButton,Object.assign(Object.assign({},t),{display:"block"}));const e=this.generatePlayButton();ir(e,{height:"20px"}),this.playButton.appendChild(e),ir(this.pauseButton,Object.assign(Object.assign({},t),{display:"none"}));const n=this.generatePauseButton();if(ir(n,{height:"20px"}),this.pauseButton.appendChild(n),!this.isVideo)return;const r=this.generateFullScreenButton(20,20);this.fullScreenButton.appendChild(r),ir(this.fullScreenButton,Object.assign(Object.assign({},t),{display:"block"}));const o=this.generateExitFullScreenButton(20,20);this.exitFullScreenButton.appendChild(o),ir(this.exitFullScreenButton,Object.assign(Object.assign({},t),{display:"none"}))}createTimer(){const t=document.createElement("div");ir(t,{width:"100px"}),this.currentTime.innerText="00:00";const e=document.createElement("span");return e.innerText="/",t.append(this.currentTime,e,this.totalTime),t}createProgress(){const t={flex:"1",position:"relative"};this.isVideo||(t.marginRight="10px"),ir(this.progress,t);const e=document.createElement("div");ir(e,{background:"#D9D9D9",position:"relative",height:"10px",display:"flex"}),this.progress.appendChild(e),ir(this.currentProgress,{background:"#4F4F4F",top:"0px",left:"0",height:"10px",flex:"0"}),e.appendChild(this.currentProgress)}changeBookmarkIndex(t,e){if(this.bookmarkList&&this.bookmarkList.length!==0){if(this.pickBookmarkIndex>0){for(let n=0;n<this.pickBookmarkIndex;n++)if(this.bookmarkList[n].time>t){this.pickBookmarkIndex=n;break}}if(e){let n=this.pickBookmarkIndex-1;for(let r=0;r<this.bookmarkList.length;r++)this.bookmarkList[r].time<t&&(n=r);for(let r=this.pickBookmarkIndex;r<=n;r++){const o=this.bookmarkList[r];o&&this.ctx.timingEventHub.emit(`shape ${this.shapeId} onMediaBookmark ${o.name}`)}this.pickBookmarkIndex=n+1}}}playMediaFromCtrl(t){this.ctx.isPlayerPaused()?this.ctx.logger.info("Media controller prevent play event with paused state",this.ctx.taskId):(this.ctx.mode!=="interactive"&&this.playMedia(),this.ctx.mode!=="local"&&this.ctx.eventHub.emit(Qe.mediaPlay,{id:this.targetId,time:this.media.currentTime-this.start,_stateOnly:t}))}pauseMediaFromCtrl(t){this.ctx.isPlayerPaused()?this.ctx.logger.info("Media controller prevent pause event with paused state",this.ctx.taskId):(this.ctx.mode!=="interactive"&&this.pauseMedia(),this.ctx.mode==="local"||this.ctx.isRendering||this.ctx.eventHub.emit(Qe.mediaPause,{id:this.targetId,time:this.media.currentTime-this.start,_stateOnly:t}))}setControllerPosition(){var t;const{target:e}=this,{portalWidth:n,portalHeight:r}=Uo,{stageWidth:o,stageHeight:s}=this.ctx,a=e.getGlobalPosition(),h=Number((t=this.container)===null||t===void 0?void 0:t.getAttribute("data-scale")),l=o*h,u=1/h*(n>l?l/n:1);a.y=a.y+this.height-r,a.x=Math.max(a.x,0),a.x=Math.min(a.x,o-n*u),a.y=Math.max(a.y,0),a.y=Math.min(a.y,s-r),ir(this.mediaController,{height:r+"px",borderRadius:r/2+"px",width:n+"px",flexDirection:"row",alignItems:"center",position:"absolute",left:a.x+"px",top:a.y+"px",background:"#fff",zIndex:"2",border:"1px solid #ccc",transform:`scale(${u})`,transformOrigin:"0 100%"}),this.fullscreenStatus&&ir(this.mediaController,{left:"0",top:s-r+"px"})}createMediaController(){this.setControllerPosition(),ir(this.mediaController,{display:"none",transition:`opacity ${Uo.opacityAnimationTime}s`}),this.createButton();const t=this.createTimer();this.createProgress(),this.mediaController.append(this.playButton,this.pauseButton,t,this.progress),this.isVideo&&this.mediaController.append(this.fullScreenButton,this.exitFullScreenButton),this.container.appendChild(this.mediaController),this.bindEvent()}addPlayCallBack(t){this.playCallBackList.push(t)}fullscreenPlay(){this.fullscreenStatus=!0,this.ctx.mode!=="interactive"&&this.media.requestFullscreen(),this.ctx.mode!=="local"&&this.ctx.eventHub.emit(Qe.fullscreenChange,{targetId:this.targetId,state:!0}),this.delayHide()}changeFullScreenState(t,e,n){n===this.ctx.slideIndex&&(t&&this.targetId===e?this.fullscreenStatus=t:this.fullscreenStatus=!1,this.fullscreenStatus?(this.fullScreenButton.style.display="none",this.exitFullScreenButton.style.display="block"):(this.fullScreenButton.style.display="block",this.exitFullScreenButton.style.display="none"),this.setControllerPosition())}bindEvent(){us.isDesktop()&&(this.mediaController.addEventListener("mouseout",this.onMouseOut,!1),this.mediaController.addEventListener("mouseover",this.showController,!1)),this.progress.addEventListener("click",this.changeMediaProgress,!1),this.playButton.addEventListener("click",this._playMediaFromCtrl,!1),this.pauseButton.addEventListener("click",this._pauseMediaFromCtrl,!1),this.media.on("durationchange",this.getMediaDuration,!1),this.media.on("timeupdate",this.mediaTimeUpdate,!1),this.media.on("pause",this.onPauseMedia,!1),this.media.on("play",this.onPlayMedia,!1),this.containerObserver=new MutationObserver(this.onContainerSizeChange),this.container&&this.containerObserver.observe(this.container,{attributes:!0,attributeFilter:["data-scale","style"]}),this.isVideo&&(this.ctx.globalEventHub.on("onFullscreenChange",this.onFullScreenChange),this.ctx.globalEventHub.on("controllerShowStatusChange",this.onControllerShowStatusChange),this.fullScreenButton.addEventListener("click",this.onClickFullScreenButtonHandle,!1),this.exitFullScreenButton.addEventListener("click",this.onClickCancelFullScreenButtonHandle,!1))}unbindEvent(){var t;us.isDesktop()&&(this.mediaController.removeEventListener("mouseout",this.onMouseOut,!1),this.mediaController.removeEventListener("mouseover",this.showController,!1)),this.progress.removeEventListener("click",this.changeMediaProgress,!1),this.playButton.removeEventListener("click",this._playMediaFromCtrl,!1),this.pauseButton.removeEventListener("click",this._pauseMediaFromCtrl,!1),this.media.removeAllListeners(),(t=this.containerObserver)===null||t===void 0||t.disconnect(),this.isVideo&&(this.ctx.globalEventHub.removeListener("onFullscreenChange",this.onFullScreenChange),this.ctx.globalEventHub.removeListener("controllerShowStatusChange",this.onControllerShowStatusChange),this.fullScreenButton.removeEventListener("click",this.onClickFullScreenButtonHandle,!1),this.exitFullScreenButton.removeEventListener("click",this.onClickCancelFullScreenButtonHandle,!1))}show(){this.setControllerPosition(),this.mediaController.style.opacity=Uo.hoverOpacity,this.fullscreenStatus||(this.mediaController.style.display="flex"),this.delayHide()}hide(){this.fullscreenStatus?this.mediaController.style.opacity=Uo.hiddenOpacity:this.mediaController.style.display="none"}delayHide(){clearTimeout(this.autoHiddenTimer),this.autoHiddenTimer=setTimeout(()=>{this.hide()},Uo.hoverHiddeDelay)}destroy(){var t;this.unbindEvent(),this.playCallBackList=[],(t=this.container)===null||t===void 0||t.removeChild(this.mediaController)}}var K1=v(120);class tc extends yi.a{constructor(t,e){super(),this.isGlobalPause=!1,this.lastTime=-1,this.howl=null,this.rctClient=null,this.isHowlEnd=!1,this.isHowlLoadEmit=!1,this.url=t,this.runningAudio=e,ar.RtcAudioClazz?(this.rctClient=new ar.RtcAudioClazz(t),this.rctClient.on("load",()=>this.emit("load")),this.rctClient.on("pause",()=>this.emit("pause")),this.rctClient.on("play",()=>this.emit("play"))):(this.howl=new K1.Howl({src:[t]}),this.howl.load(),this.howl.on("load",()=>{this.isHowlLoadEmit=!0,this.emit("load")}),this.howl.on("pause",()=>this.emit("pause")),this.howl.on("play",()=>{this.isHowlLoadEmit||this.emit("load"),this.isHowlEnd=!1,this.emit("play")}),this.howl.on("end",()=>{this.isHowlEnd=!0}))}startTimeChangeEmit(){this.currentTime!==this.lastTime&&(this.lastTime=this.currentTime,this.emit("timeupdate")),(!this.isEnded||this.duration<=0)&&setTimeout(()=>this.startTimeChangeEmit(),300)}play(){var t,e,n;this.runningAudio.has(this.url)&&((t=this.runningAudio.get(this.url))===null||t===void 0||t.stop(),this.runningAudio.delete(this.url)),this.isHowlEnd=!1,this.lastTime=-1,(e=this.howl)===null||e===void 0||e.play(),(n=this.rctClient)===null||n===void 0||n.play(),this.startTimeChangeEmit(),this.runningAudio.set(this.url,this)}pause(){var t,e;(t=this.howl)===null||t===void 0||t.pause(),(e=this.rctClient)===null||e===void 0||e.pause(),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}globalPause(){this.isPaused||(this.isGlobalPause=!0,this.pause())}globalResume(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}stop(){var t;(t=this.howl)===null||t===void 0||t.stop(),this.rctClient&&(this.rctClient.pause(),this.rctClient.currentTime=0),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}destroy(){var t,e,n,r,o,s,a;(t=this.howl)===null||t===void 0||t.pause(),(e=this.howl)===null||e===void 0||e.unload(),(n=this.rctClient)===null||n===void 0||n.pause(),(r=this.rctClient)===null||r===void 0||r.destroy(),(o=this.rctClient)===null||o===void 0||o.removeAllListeners("load"),(s=this.rctClient)===null||s===void 0||s.removeAllListeners("play"),(a=this.rctClient)===null||a===void 0||a.removeAllListeners("pause"),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}get currentTime(){return this.rctClient?this.rctClient.currentTime:this.howl?this.howl.seek():-1}set currentTime(t){this.rctClient?this.rctClient.currentTime=t:this.howl&&this.howl.seek(t)}get duration(){return this.rctClient?this.rctClient.duration:this.howl?this.howl.duration():0}get isEnded(){return this.howl?this.isHowlEnd:Math.abs(this.currentTime-this.duration)<.001}get isPaused(){return this.rctClient?this.rctClient.isPaused:!!this.howl&&this.howl.playing()}volume(t){this.rctClient?this.rctClient.volume(t):this.howl&&this.howl.volume(t)}}var Jm=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};class Z1 extends yi.a{constructor(t){var e,n,r,o,s;super(),this.type="video",this.sprite=new di,this.isPlaying=!1,this.isGlobalPause=!1,this.fullscreen=!1,this.url="",this.isLoaded=!1,this.onVideoResourceLoaded=()=>{this.isLoaded=!0},this.onVideoStalled=()=>{this.ctx.logger.warn(this.url+", Failed to fetch data, but trying.",this.ctx.taskId)},this.updateVolume=E=>{this.rtcAudio.volume(E)},this.syncFullscreenVideoState=E=>{const{targetId:A,state:C,slideIndex:W}=E;W===this.ctx.slideIndex&&A===this.id&&(C?(this.requestFullscreen(),this.ctx.latestChangeFullscreenTargetId=A):this.requestCancelFullscreen())},this.id=t.id,this.start=(e=t.video.cut)===null||e===void 0?void 0:e.start,this.end=(n=t.video.cut)===null||n===void 0?void 0:n.end,this.fullscreen=(r=t.video.fullscreen)!==null&&r!==void 0&&r,this.container=t.container,this.ctx=t.ctx,this.ctx.medias[this.id]=this;const a=t.video.src;this.videoResource=new ce.w(a,{autoLoad:!0,autoPlay:!1,updateFPS:30,crossorigin:!0}),(o=this.videoElement)===null||o===void 0||o.addEventListener("stalled",this.onVideoStalled),(s=this.videoElement)===null||s===void 0||s.addEventListener("loadedmetadata",this.onVideoResourceLoaded),this.url=t.video.src;let h=t.video.src.replace(/4$/,"3");this.ctx.loaderDelegate&&(h=this.ctx.loaderDelegate.redirectMedia(h),this.ctx.logger.info(`redirect media url from ${t.video.src.replace(/4$/,"3")} to ${h} by delegate.`,t.ctx.taskId)),this.rtcAudio=new tc(h,t.ctx.runningAudio);const{video:l,width:u,height:p,target:y}=t;this.controller=new Na({targetId:t.id,shapeId:t.shapeId,ctx:t.ctx,width:u,height:p,target:y,media:this,info:l,canvasElement:t.canvasElement}),this.controller.addPlayCallBack(()=>{this.sprite.width=u,this.sprite.height=p,this.ctx.clock.setTimeout(()=>{this.sprite.visible=!0},50)});const x=new ce.c(null,{height:p,width:u});x.resource=this.videoResource,this.videoResource.bind(x),this.sprite=new di,this.sprite.visible=!1,this.sprite.texture=new ce.t(x),this.sprite.interactive=!0,this.container.addChild(this.sprite),this.sprite.on("mouseover",E=>{E.stopPropagation(),this.controller.show()}),this.sprite.on("mouseout",E=>{E.stopPropagation(),this.controller.hide()}),["durationchange","timeupdate","pause","play"].forEach(E=>{var A;(A=this.videoElement)===null||A===void 0||A.addEventListener(E,()=>{E==="timeupdate"&&this.isPlaying,this.emit(E)})}),this.ctx.activeMedia.add(this),this.ctx.volumeAdjuster.on("update",this.updateVolume),this.ctx.globalEventHub.on("syncFullscreenVideoState",this.syncFullscreenVideoState)}get videoElement(){return this.videoResource.source}get currentTime(){var t,e;return(e=(t=this.videoElement)===null||t===void 0?void 0:t.currentTime)!==null&&e!==void 0?e:0}set currentTime(t){this.rtcAudio.currentTime=t,this.videoElement&&(this.videoElement.currentTime=t)}get paused(){var t,e;return(e=(t=this.videoElement)===null||t===void 0?void 0:t.paused)===null||e===void 0||e}get ended(){var t,e;return(e=(t=this.videoElement)===null||t===void 0?void 0:t.ended)===null||e===void 0||e}get duration(){var t,e;return(e=(t=this.videoElement)===null||t===void 0?void 0:t.duration)!==null&&e!==void 0?e:0}get clippedDuration(){return this.controller.clippedDuration}showController(){this.controller.show()}hideController(){this.controller.hide()}play(){return Jm(this,void 0,void 0,function*(){this.isPlaying=!0,this.updateVolume(this.ctx.volumeAdjuster.volume),yield this.load(),yield this.ctx.clock.waitUntil(()=>{const e=this.videoElement;return!!(e&&e.videoWidth>0)},3e3);const t=this.videoElement;t&&t.videoWidth<=0||(this.videoElement&&(this.videoElement.volume=0,this.videoElement.muted=!0),this.rtcAudio.once("play",()=>{var e;(e=this.videoElement)===null||e===void 0||e.play(),this.fullscreen&&this.controller.fullscreenPlay()}),this.rtcAudio.play())})}load(){return this.videoResource.load()}pause(){this.isPlaying=!1,this.ctx.logger.warn(this.url+", pause video manual.",this.ctx.taskId),this.ctx.logger.warn(this.url+", pause rtc audio manual.",this.ctx.taskId),this.rtcAudio.once("pause",()=>{var t;(t=this.videoElement)===null||t===void 0||t.pause()}),this.rtcAudio.pause()}globalPause(){this.isPlaying&&(this.isGlobalPause=!0,this.pause())}globalResume(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}togglePause(){this.isPlaying?this.pause():this.play()}seek(t){this.controller.jumpToTime(t)}stop(){this.seek(0),this.pause(),this.ctx.eventHub.emit(Qe.mediaStop)}requestFullscreen(){return Jm(this,void 0,void 0,function*(){yield Xl(()=>this.isLoaded,5e3);const t=new ce.t(this.sprite.texture.baseTexture);this.ctx.globalEventHub.emit("requestFullscreen",{texture:t,index:this.ctx.slideIndex,targetId:this.id})})}requestCancelFullscreen(){this.ctx.globalEventHub.emit("requestCancelFullscreen",{targetId:this.id,index:this.ctx.slideIndex})}destroy(){var t,e,n;this.ctx.volumeAdjuster.removeListener("update",this.updateVolume),this.ctx.globalEventHub.removeListener("syncFullscreenVideoState",this.syncFullscreenVideoState),(t=this.videoElement)===null||t===void 0||t.removeEventListener("stalled",this.onVideoStalled),(e=this.videoElement)===null||e===void 0||e.removeEventListener("loadedmetadata",this.onVideoResourceLoaded),this.sprite.interactive=!1,this.sprite.destroy({texture:!0,baseTexture:!0}),(n=this.videoResource)===null||n===void 0||n.destroy(),this.rtcAudio.destroy(),this.stop(),this.controller.destroy(),this.ctx.activeMedia.delete(this)}}var Q1=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};class $1 extends yi.a{constructor(t){super(),this.type="audio",this.isPlaying=!1,this.isGlobalPause=!1,this.updateVolume=s=>{this.audioPlayer.volume(s)},this.id=t.id;const e=t.audio.src;this.audioPlayer=new tc(e,t.ctx.runningAudio),t.audio.cut&&(this.start=t.audio.cut.start,this.end=t.audio.cut.end),this.ctx=t.ctx,this.ctx.medias[this.id]=this;const{width:n,height:r,target:o}=t;this.controller=new Na({targetId:t.id,shapeId:t.shapeId,ctx:t.ctx,height:r,width:n,target:o,media:this,info:t.audio,canvasElement:t.canvasElement}),this.audioPlayer.on("load",()=>this.emit("durationchange")),this.audioPlayer.on("timeupdate",()=>this.emit("timeupdate")),this.audioPlayer.on("pause",()=>this.emit("pause")),this.audioPlayer.on("play",()=>this.emit("play")),this.ctx.activeMedia.add(this),this.ctx.volumeAdjuster.on("update",this.updateVolume)}get currentTime(){return this.audioPlayer.currentTime}set currentTime(t){this.audioPlayer.currentTime=t}get clippedDuration(){return this.controller.clippedDuration}get paused(){return this.audioPlayer.isPaused}get isPaused(){return this.audioPlayer.isPaused}get ended(){return this.audioPlayer.isEnded}get duration(){return this.audioPlayer.duration}load(){return Promise.resolve()}showController(){this.controller.show()}hideController(){this.controller.hide()}play(){return Q1(this,void 0,void 0,function*(){this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent play event with paused state",this.ctx.taskId):(this.updateVolume(this.ctx.volumeAdjuster.volume),this.isPlaying=!0,this.audioPlayer.play())})}pause(){this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent pause event with paused state",this.ctx.taskId):(this.isPlaying=!1,this.audioPlayer.pause())}globalPause(){this.isPlaying&&(this.isGlobalPause=!0,this.pause())}globalResume(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}togglePause(){this.isPlaying?this.pause():this.play()}seek(t){this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent seek event with paused state",this.ctx.taskId):this.controller.jumpToTime(t)}stop(){this.seek(0),this.pause(),this.ctx.eventHub.emit(Qe.mediaStop)}requestFullscreen(){}requestCancelFullscreen(){}destroy(){this.ctx.volumeAdjuster.removeListener("update",this.updateVolume),this.stop(),this.controller.destroy(),this.ctx.activeMedia.delete(this)}}var Km=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};class tT extends qm{constructor(t,e,n,r){super(Object.assign(Object.assign({},t),{type:"Shape",useBgFill:!1,textRotateWithShape:!0,isPicture:!0}),e,n,r),this.isInteractiveOutside=!1,this.cmd=new Xb(this),this.media=t==null?void 0:t.media,this.container.name=t.id+"_container_[Picture]",this.renderContainer.name=t.id+"_render_container_[Picture]",this.picFill=new uo(this.ctx,t.picFill,t.width,t.height,{useFilter:!0,useSlideBackgroundFill:!1})}applyCommand(t,e){var n,r,o,s;if(e==="call")if(/playFrom\(([0-9.]+)\)/.test(t)){const a=t.match(/playFrom\(([0-9.]+)\)/),h=Number(a[1]||"0");(n=this.mediaPlayer)===null||n===void 0||n.controller.playMediaFromCtrl(!0),Math.abs(h)>.1&&((r=this.mediaPlayer)===null||r===void 0||r.controller.jumpToTime(h))}else t==="custom-pause"?(o=this.mediaPlayer)===null||o===void 0||o.controller.pauseMediaFromCtrl(!0):t==="togglePause"?this.mediaPlayer&&(this.mediaPlayer.isPlaying?this.mediaPlayer.controller.pauseMediaFromCtrl(!0):this.mediaPlayer.controller.playMediaFromCtrl(!0)):t==="stop"&&((s=this.mediaPlayer)===null||s===void 0||s.stop())}renderPic(){var t,e,n,r,o,s;return Km(this,void 0,void 0,function*(){const{displayObject:a}=this.picFill;if(a){a.name=this.json.id+"_pic_fill_[Picture]";const h=(t=this.backgroundGraphics)===null||t===void 0?void 0:t.getClonedDisplayObject();if(((e=this.backgroundGraphics)===null||e===void 0?void 0:e.isNeedMask(a.width,a.height))&&h&&(a.mask=h,this.effectContainer.addChild(h)),a.width=this.designWidth,a.height=this.designHeight,a instanceof Gu&&this.ctx.slideScopeEventHub.once("slide-render",l=>{var u;this.ctx.slideIndex===l&&((u=this.effectObject)===null||u===void 0||u.setFrameCount(a.totalFrames),a.play(),a.onFrameChange=p=>{if(this.effectObject)if(this.effectObject.hasFrame(p))this.effectObject.updateFrame(p);else{const y=this.getEffectTexture();y&&(this.effectObject.createFrame(p,y.texture),this.effectObject.setFrameOffset(y.offsetX,y.offsetY))}})}),this.effectContainer.addChild(a),this.media){let l=this.media.src;if(this.media.type==="audio"&&/mp4$/.test(l)&&(l=l.replace(/mp4$/,"mp3")),this.ctx.urlInterrupter){const u=Date.now();l=yield this.ctx.urlInterrupter(l),this.ctx.logger.info("redirect media url by interrupter. time: "+(Date.now()-u),this.ctx.taskId)}this.ctx.loaderDelegate&&(l=this.ctx.loaderDelegate.redirectMedia(l),this.ctx.logger.info(`redirect media url to ${l} by delegate.`,this.ctx.taskId)),this.media.src=l}if(((n=this.media)===null||n===void 0?void 0:n.type)==="video"&&this.media.src){if(this.mediaPlayer=new Z1({id:this.json.id+"-video",shapeId:this.json.id,ctx:this.ctx,video:this.media,height:this.designHeight,width:this.designWidth,target:a,container:this.effectContainer,canvasElement:this.ctx.view}),((r=this.mediaPlayer)===null||r===void 0?void 0:r.sprite)&&h){const l=(o=this.backgroundGraphics)===null||o===void 0?void 0:o.getClonedDisplayObject();l&&(this.mediaPlayer.sprite.mask=l,this.container.addChild(l))}}else((s=this.media)===null||s===void 0?void 0:s.type)==="audio"&&this.media.src&&(this.mediaPlayer=new $1({id:this.json.id+"-audio",shapeId:this.json.id,ctx:this.ctx,audio:this.media,height:this.designHeight,width:this.designWidth,target:a,canvasElement:this.ctx.view}));this.mediaPlayer&&(this.isInteractiveOutside=!!this.container.interactive,this.container.interactive=!0,us.isDesktop()?(this.container.on("mouseover",()=>{this.mediaPlayer.showController()}),this.container.on("mouseout",()=>{this.mediaPlayer.hideController()},!1)):this.container.on("pointerdown",()=>{this.mediaPlayer.showController()}))}})}preRender(t){super.preRender(t)}subClassRender(){return Km(this,void 0,void 0,function*(){yield this.renderPic()})}clearOnSlideChange(){super.clearOnSlideChange(),this.mediaPlayer&&(this.container.interactive=!1,this.mediaPlayer.stop(),this.mediaPlayer.hideController())}initOnReuse(){super.initOnReuse(),this.mediaPlayer&&(this.container.interactive=!0)}destroy(){this.mediaPlayer&&(this.picFill.displayObject&&!this.isInteractiveOutside&&(this.container.interactive=!1),this.mediaPlayer.destroy(),this.mediaPlayer=void 0),this.picFill.destroy()}}var oh=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};class ec extends Wu{constructor(t,e,n,r,o){super(t,e,n),this.children=[],this.cacheSprite=new di,this.cacheContainer=new Cn.b,this.json=t,this.json.fillStyle&&this.json.fillStyle.fillType==="groupFill"&&r&&(this.json.fillStyle=r),this.container.name=t.id+"_container_[Container]",this.cacheContainer.name=t.id+"_cache_container_[Container]",this.ctx.timingTargets.addTarget(t.id,this),this.updateTransform(this.json),this.fillObject=new uo(this.ctx,t.fillStyle,t.width,t.height,{useFilter:!1,useSlideBackgroundFill:!1}),this.createChildren(o)}createChildren(t){var e,n,r,o;const s={x:(n=(e=this.json.position)===null||e===void 0?void 0:e.x)!==null&&n!==void 0?n:0,y:(o=(r=this.json.position)===null||r===void 0?void 0:r.y)!==null&&o!==void 0?o:0};for(let a=0,h=this.json.children.length;a<h;a++)t.addSubMTask(()=>oh(this,void 0,void 0,function*(){const l=this.json.children[a];let u=null;(l==null?void 0:l.type)==="Shape"?u=new qm(l,this.ctx,s,this.json.fillStyle):(l==null?void 0:l.type)==="Picture"?u=new tT(l,this.ctx,s,this.json.fillStyle):(l==null?void 0:l.type)==="Container"&&(u=new ec(l,this.ctx,s,this.json.fillStyle,t)),u&&this.children.push(u)}),"@ContainerImpl[child.init]")}get interactiveContainer(){return this.container}get renderContainer(){return this.container}preRender(t){for(const e of this.children)t.addSubMTask(()=>oh(this,void 0,void 0,function*(){e.preRender(t)}),"@ContainerImpl[child.preRender]")}getBgElement(){return null}getIterateEntry(t,e,n){return e===0?this:(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null)}getTextElement(){return null}render(t){for(const e of this.children)e.render(t),t.addSubMTask(()=>oh(this,void 0,void 0,function*(){var n;this.cacheContainer.addChild(e.renderContainer),(e.json.hlinkHover||e.json.hlinkClick)&&((n=e.hyperlink)===null||n===void 0||n.addProxy(this.container))}),"@ContainerImpl[child.render]");t.addSubMTask(()=>oh(this,void 0,void 0,function*(){this.container.addChild(this.cacheContainer)}),"@ContainerImpl[child.append]")}clearOnSlideChange(){this.children.forEach(t=>t.clearOnSlideChange())}initOnReuse(){this.children.forEach(t=>t.initOnReuse())}isChildrenInteractive(){for(const t of this.json.children)if((t==null?void 0:t.type)==="Container"||(t==null?void 0:t.type)==="Stage"||(t==null?void 0:t.hlinkHover)||(t==null?void 0:t.hlinkClick))return!0;return!1}destroy(){this.cacheSprite&&this.cacheSprite.destroy({texture:!0}),this.children.forEach(t=>t.destroy()),this.container.destroy({children:!0,texture:!0,baseTexture:!0}),this.cacheContainer.destroy({children:!0,texture:!0,baseTexture:!0})}}class La extends yi.a{constructor(t,e,n,r){super(),this.cond={},this.timeoutIds=[],this.condHandle=(o,s={})=>{if(o)if(o.delay&&o.delay>0){const a=this.ctx.clock.setTimeout(()=>{o.event&&(this.cond[o.event]=!0,this.detectTrigger(s))},o.delay);this.timeoutIds.push(a)}else this.cond[o.event]=!0,this.detectTrigger(s);else this.detectTrigger(s)},this.id=t,this.ctx=r,this.eventHubs=n,e.forEach(o=>{this.addCond(o)})}setTriggerParams(t){this.triggerParams=t}addCond(t){const e=(...n)=>{this.condHandle(t,n)};t.event&&(/^shape/.test(t.event)||/^time/.test(t.event)?(this.cond[t.event]=!1,this.eventHubs.global.addListener(t.event,e)):/^runtime/.test(t.event)?(this.cond[t.event]=!1,this.eventHubs.runtime.addListener(t.event,e)):/^self/.test(t.event)?t.delay&&t.delay>0&&(this.cond[t.event]=!1,this.eventHubs.runtime.addListener(t.event,e)):this.cond[t.event]=!1)}isTrigger(){return Object.keys(this.cond).every(t=>!!this.cond[t])}isTriggerWithoutParent(){return Object.keys(this.cond).filter(t=>t!=="self").every(t=>!!this.cond[t])}detectTrigger(t){if(Object.keys(this.cond).every(e=>!!this.cond[e])){Object.keys(this.cond).forEach(n=>{this.cond[n]=!1});const e=this.triggerParams;this.triggerParams=void 0,this.emit("active",e,t)}}reset(){Object.keys(this.cond).forEach(t=>{this.cond[t]=!1}),this.timeoutIds.forEach(t=>this.ctx.clock.clearTimeout(t))}}class eT extends yi.a{constructor(t){super(),this.isTimeNodeEndSync=!1,this.interactiveListeners=[],this.runtimeNodeEventHub=new yi.a,this._currentSeqIndex=0,this._currentSeqState="idle",this.isForward=!0,this.autoPlay=!1,this.handlePrev=(y=!1)=>{var x,E,A,C,W,Q;this.hasPrev()||!this.isMainSeq?this.currentSeqState==="idle"?(this.decrSeqIndex(),(x=this.commonTimeNode.children[this.currentSeqIndex])===null||x===void 0||x.commonTimeNode.seekToStart(),(E=this.commonTimeNode.children[this.currentSeqIndex])===null||E===void 0||E.commonTimeNode.clearSubList(),this.currentSeqState="idle"):this.currentSeqState==="running"?((A=this.commonTimeNode.children[this.currentSeqIndex])===null||A===void 0||A.commonTimeNode.seekToStart(),(C=this.commonTimeNode.children[this.currentSeqIndex])===null||C===void 0||C.commonTimeNode.clearSubList(),this.currentSeqState="idle"):this.currentSeqState==="end"&&(this.currentSeqIndex>=this.commonTimeNode.children.length&&(this.currentSeqIndex=this.commonTimeNode.children.length-1),(W=this.commonTimeNode.children[this.currentSeqIndex])===null||W===void 0||W.commonTimeNode.seekToStart(),(Q=this.commonTimeNode.children[this.currentSeqIndex])===null||Q===void 0||Q.commonTimeNode.clearSubList(),this.currentSeqState="idle"):this.globalEventHub.emit("c:prev slide",y)},this.handleNext=(y,x)=>{var E,A,C,W;if(this.isTimeNodeEndSync&&(this.isTimeNodeEndSync=!1,this.currentSeqState="idle",this.currentSeqIndex=0),!this.hasNext()&&this.isMainSeq&&x)this.globalEventHub.emit("c:next slide",y);else{if(this.isInteractiveSeq){this.globalEventHub.emit("shape slide onNext"+(this.json.ctn.id||""));const Q={result:null};this.findChildInfiniteRepeat(this.commonTimeNode,Q),this.commonTimeNode.children.length===1&&Q.result&&(Q.result.json.subTnLst||[]).length>0&&this.currentSeqIndex===0&&this.currentSeqState==="running"&&this.commonTimeNode.allChildrenEndHandle()}this.currentSeqState==="idle"?(E=this.commonTimeNode.children[this.currentSeqIndex])===null||E===void 0||E.commonTimeNode.startTimeNodeForce():this.currentSeqState==="running"?((A=this.commonTimeNode.children[this.currentSeqIndex])===null||A===void 0||A.commonTimeNode.seekToEnd(!1,!0),this.currentSeqState="end",this.incrSeqIndex(),(C=this.commonTimeNode.children[this.currentSeqIndex])===null||C===void 0||C.commonTimeNode.startTimeNodeForce()):this.currentSeqState==="end"&&(this.incrSeqIndex(),(W=this.commonTimeNode.children[this.currentSeqIndex])===null||W===void 0||W.commonTimeNode.startTimeNodeForce())}};const{json:e,iterateType:n,isIterate:r,isSub:o,parent:s,ctx:a,eventHub:h,iterateIndex:l,iterateId:u,isInInteractiveSeq:p}=t;this.isMainSeq=e.ctn.nodeType==="mainSeq",this.isInteractiveSeq=e.ctn.nodeType==="interactiveSeq",this.id=e.ctn.id,this.isIterate=r,this.json=e,this.ctx=a,this.globalEventHub=h,this.commonTimeNode=new Ys({json:e.ctn,isSub:o,eventHubs:{global:h,runtime:this.runtimeNodeEventHub},ctx:a,parent:s,isIterate:!1,iterateType:n,iterateIndex:l,iterateId:u,isInInteractiveSeq:p||this.isInteractiveSeq,fromSeqId:this.isInteractiveSeq?this.json.ctn.id:""}),this.bindShapeEvent(),this.nextConds=new La("mainSeq",e.nextCondLst,{global:h,runtime:this.runtimeNodeEventHub},this.ctx),this.prevConds=new La("mainSeq",e.preCondLst,{global:h,runtime:this.runtimeNodeEventHub},this.ctx),this.commonTimeNode.on("timeNodeRestart",()=>{this.currentSeqIndex=0,this.currentSeqState="idle"}),this.commonTimeNode.on("childTimeNodeStart",y=>{const x=this.commonTimeNode.children.findIndex(E=>E.commonTimeNode.uuid===y.id);x>=0&&(this.currentSeqIndex=x),this.currentSeqState="running",this.isMainSeq&&this.ctx.eventHub.emit(Qe.mainSeqStepStart,x)}),this.commonTimeNode.on("childTimeNodeEnd",y=>{const x=this.commonTimeNode.children.findIndex(E=>E.commonTimeNode.uuid===y.id);x>=0&&(this.currentSeqIndex=x),this.currentSeqState="end",this.autoPlay&&this.ctx.clock.setTimeout(()=>{this.handleNext(!1,!0)}),this.isMainSeq&&this.ctx.eventHub.emit(Qe.mainSeqStepEnd,x)}),this.commonTimeNode.on("timeNodeEndSync",()=>{this.isTimeNodeEndSync=!0,this.commonTimeNode.resetForRepeat()}),this.commonTimeNode.on("timeNodeDestroy",()=>{this.interactiveListeners.forEach(([y,x])=>{y&&x&&y.interactiveContainer.removeListener("pointerdown",x)}),this.interactiveListeners=[]}),this.nextConds.on("active",(y,x)=>{Array.isArray(x)?this.handleNext(x[0],x[1]):this.handleNext(x,!0)}),this.prevConds.on("active",(y,x)=>{Array.isArray(x)?this.handlePrev(x[0]):this.handlePrev(x)})}get currentSeqIndex(){return this._currentSeqIndex}set currentSeqIndex(t){this._currentSeqIndex=t,this.isMainSeq?this.ctx.eventHub.emit(Qe.mainSeqStepChange,t):this.isInteractiveSeq&&this.ctx.eventHub.emit(Qe.interactiveSeqStateChange,{id:this.json.ctn.id,state:{step:t,state:this._currentSeqState}})}get currentSeqState(){return this._currentSeqState}set currentSeqState(t){this._currentSeqState=t,this.isMainSeq?this.ctx.eventHub.emit(Qe.mainSeqStateChange,t):this.isInteractiveSeq&&this.ctx.eventHub.emit(Qe.interactiveSeqStateChange,{id:this.json.ctn.id,state:{step:this._currentSeqIndex,state:t}})}get stepLength(){return this.commonTimeNode.children.length}get currentStep(){return this.currentSeqIndex}get currentState(){return this.currentSeqState}startAutoPlay(){this.autoPlay=!0,this.commonTimeNode.children[0].commonTimeNode.startTimeNodeForce()}incrSeqIndex(){this.currentSeqIndex+1<=this.commonTimeNode.children.length&&(this.currentSeqIndex+=1)}decrSeqIndex(){this.currentSeqIndex-1>=-1&&(this.currentSeqIndex-=1)}hasPrev(){return!(this.currentSeqIndex<=0&&this.currentSeqState==="idle")}hasNext(){return!(this.currentSeqIndex>=this.commonTimeNode.children.length||this.currentSeqIndex===this.commonTimeNode.children.length-1&&this.currentSeqState==="end")}findChildInfiniteRepeat(t,e){t.isInfiniteRepeat()?e.result=t:t.children.map(n=>n.commonTimeNode).forEach(n=>this.findChildInfiniteRepeat(n,e))}bindShapeEvent(){this.json.ctn.nodeType==="interactiveSeq"&&this.json.nextCondLst.forEach(t=>{if(/^shape/.test(t.event)){const e=t.event.split(" ")[1];if(e){const n=this.ctx.timingTargets.getTargetById(e);if(n){n.interactiveContainer.interactive=!0,n.interactiveContainer.cursor="pointer";const r=()=>{this.ctx.eventHub.emit(Qe.userInput);const o=`shape ${e} onClick`,{mode:s}=this.ctx;s!=="interactive"&&s!=="sync"||this.ctx.eventHub.emit(Qe.interactiveSeqAction,{action:o,seqId:this.json.ctn.id}),s!=="sync"&&s!=="local"||this.globalEventHub.emit(o)};n.interactiveContainer.on("pointerdown",r),this.interactiveListeners.push([n,r])}}}})}setCurrentStep(t,e){const{length:n}=this.commonTimeNode.children;if(t>n)return;this.isInteractiveSeq&&this.commonTimeNode.applyCount===0&&(this.commonTimeNode.applyCount=1);let r=t;if(this.commonTimeNode.seekToStart(),r===-1&&(r=n-1),r!==0||e!=="start"){if(r>=0&&r<n)for(let o=0;o<=r;o++){const s=this.commonTimeNode.children[o];o!==r?s.commonTimeNode.seekToEnd(!1,!0):e==="start"?s.commonTimeNode.seekToStart():e==="end"&&s.commonTimeNode.seekToEnd(!1,!0)}this.currentSeqIndex=r,this.currentSeqState=e==="start"?"idle":"end"}}}function Zr(i,t,e){const n=t.split(".");n.reduce((r,o,s)=>{if(r)return s!==n.length-1?r[o]:void(r[o]=e);console.warn(`${i} not support ${t}`)},i)}function sh(i,t){return t?t.split(".").reduce((e,n)=>{if(e)return e[n];console.warn(`${i} not support ${t}`)},i):null}class ko{constructor(t){this.timingTarget=null,this.runtimeNodeEventHub=new yi.a,this.basicOnTimeNodeEnd=()=>{if(this.isConflict){const{target:x}=this.json.cBhvr,E=this.getTargetId(x);this.ctx.conflictTimeNodeManager.removeRunningTimeNode(E,this.modifyAttrKey)}},this.basicOnTimeLineStart=()=>{if(this.isConflict){const{target:x}=this.json.cBhvr;if(this.activeWhenConflict==="next"){const E=this.getTargetId(x);this.ctx.conflictTimeNodeManager.addRunningTimeNode(E,this.modifyAttrKey,this.commonTimeNode)}else this.activeWhenConflict==="prev"&&this.commonTimeNode.dispose()}};const{isIterate:e,isSub:n,json:r,ctx:o,parent:s,eventHub:a,iterateType:h,iterateIndex:l,iterateId:u,isInInteractiveSeq:p,fromSeqId:y}=t;this.json=r,this.id=r.cBhvr.ctn.id,this.ctx=o,this.globalEventHub=a,this.commonTimeNode=new Ys({json:r.cBhvr.ctn,isSub:n,eventHubs:{global:a,runtime:this.runtimeNodeEventHub},ctx:o,parent:s,isIterate:e,iterateType:h,iterateIndex:l,iterateId:u,isInInteractiveSeq:p,fromSeqId:y}),this.timingTarget=this.ctx.timingTargets.getTarget(r.cBhvr.target,e,{type:h,index:l,id:u}),this.commonTimeNode.on("seekToStart",()=>this.onSeekToStart()),this.commonTimeNode.on("seekToEnd",()=>this.onSeekToEnd()),this.commonTimeNode.on("timelineStart",this.basicOnTimeLineStart),this.commonTimeNode.on("timeNodeEnd",this.basicOnTimeNodeEnd)}getTargetId(t){let e=t.id;return t.type==="shape"&&t.txEl&&(e=`${e}-txEl-${t.txEl.range[0]}`),this.commonTimeNode.isIterate&&(e=`${e}-iterate-${this.commonTimeNode.iterateIndex}`),e}}class nT extends ko{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.startVal=null,this.updateStartValue=()=>{this.timingTarget&&(this.startVal=sh(this.timingTarget,this.json.cBhvr.attrList[0]))},this.onSeekToStart=()=>{const e=this.json.cBhvr.attrList[0];this.startVal!==null&&this.timingTarget&&Zr(this.timingTarget,e,this.startVal)},this.onSeekToEnd=()=>{const e=this.json.cBhvr.attrList[0],n=this.json.cBhvr.to||this.json.to;n&&this.timingTarget&&Zr(this.timingTarget,e,n)},this.commonTimeNode.on("timeNodeStart",this.updateStartValue),this.commonTimeNode.on("timeNodeCreate",this.updateStartValue),this.commonTimeNode.on("timeUpdate",({duration:e,delta:n})=>{if(n/e>=1){const r=this.json.cBhvr.attrList[0];this.json.cBhvr.attrList.length>1&&console.warn("this.json.cBhvr.attrList.length > 0");const o=this.json.cBhvr.to||this.json.to;o&&this.timingTarget&&Zr(this.timingTarget,r,o)}})}get modifyAttrKey(){return this.json.cBhvr.attrList[0]}}var ah=function(i,t,e,n){var r,o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(t,e,s):r(t,e))||s);return o>3&&s&&Object.defineProperty(t,e,s),s};class lh{constructor(t,e){this.math={pi:Math.PI,e:Math.E,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,ceil:Math.ceil,cos:Math.cos,cosh:Math.cosh,deg:n=>n/Math.PI*180,exp:Math.exp,floor:Math.floor,ln:Math.log,max:Math.max,min:Math.min,rad:n=>n/180*Math.PI,rand:Math.random,sin:Math.sin,sinh:Math.sinh,sqrt:Math.sqrt,tan:Math.tan,tanh:Math.tanh},this.timingTarget=e,this.val=t.val.value,this.time=t.time,t.fmla&&(this.fmla=this.parseFmla(t.fmla))}parseFmla(t){let e=t.replace(/#ppt_h/g,`(${this.timingTarget.design_ppt_h})`);return e=e.replace(/#ppt_w/g,`(${this.timingTarget.design_ppt_w})`),e=e.replace(/#ppt_x/g,`(${this.timingTarget.design_ppt_x})`),e=e.replace(/#ppt_y/g,`(${this.timingTarget.design_ppt_y})`),e=e.replace(/ppt_w/g,"vars.ppt_w"),e=e.replace(/ppt_h/g,"vars.ppt_h"),e=e.replace(/ppt_x/g,"vars.ppt_x"),e=e.replace(/ppt_y/g,"vars.ppt_y"),e=e.replace(/#/g,"vars."),["abs","acos","asin","atan","ceil","cos","cosh","deg","exp","floor","ln","max","min","rad","rand","sin","sinh","sqrt","tan","tanh","pi","e"].forEach(n=>{const r=new RegExp(`([^a-z])${n}([^a-z])`,"g");e=e.replace(r,(o,s,a)=>`${s}math.${n}${a}`)}),new Function("vars","math","$","return "+e)}}class Zm extends lh{constructor(t,e,n){super(t,e),this.value=t.val.value,n&&(this.fmla=this.parseFmla(n))}resolveValue(){return this.value}interpolationFrom(t,e,n){const r=t.resolveValue(n),o=r+(this.resolveValue()-r)*e;return t.fmla?t.fmla(n,this.math,o):o}}ah([Wl()],Zm.prototype,"interpolationFrom",null);class Qm extends lh{constructor(t,e){var n;super(t,e),this.value=(n=t.val)===null||n===void 0?void 0:n.value}interpolationFrom(t,e,n){let r=t.resolveValue(n);return e>this.time&&(r=this.resolveValue()),r}resolveValue(){return this.value||""}}ah([Wl()],Qm.prototype,"interpolationFrom",null);class Xs extends lh{constructor(t,e){super(t,e),this.fn=this.parseFmla(this.val)}resolveValue(t){return this.fn(t,this.math,1)}interpolationFrom(t,e,n){const r=t.resolveValue(n),o=r+(this.resolveValue(n)-r)*e;return t.fmla?t.fmla(n,this.math,o):o}}ah([Wl()],Xs.prototype,"interpolationFrom",null);class $m extends lh{constructor(t,e){super(t,e),this.value=t.val.value}interpolationFrom(t,e){return Ra(t.resolveValue(),this.value,e)}resolveValue(){return this.value}}ah([Wl()],$m.prototype,"interpolationFrom",null);class iT extends ko{constructor(t){super(t),this.isConflict=!0,this.activeWhenConflict="next",this.startVal=null,this.vars={ppt_x:0,ppt_y:0,ppt_w:0,ppt_h:0},this.keyFrames=[],this.isColorAnim=!1,this.onTimeNodeStart=()=>{this.timingTarget&&(this.startVal=sh(this.timingTarget,this.json.cBhvr.attrList[0]))},this.updateVars=()=>{var e,n,r,o;!((e=this.timingTarget)===null||e===void 0)&&e.ppt_h&&(this.vars.ppt_h=this.timingTarget.ppt_h),!((n=this.timingTarget)===null||n===void 0)&&n.ppt_w&&(this.vars.ppt_w=this.timingTarget.ppt_w),!((r=this.timingTarget)===null||r===void 0)&&r.ppt_x&&(this.vars.ppt_x=this.timingTarget.ppt_x),!((o=this.timingTarget)===null||o===void 0)&&o.ppt_y&&(this.vars.ppt_y=this.timingTarget.ppt_y),this.isColorAnim},this.onTimeUpdate=({duration:e,delta:n})=>{const r=n/e,o=this.keyFrames.findIndex(y=>r<=y[0]),{attrList:s}=this.json.cBhvr;if(o<0){const y=this.keyFrames[this.keyFrames.length-1];return void(this.timingTarget&&s&&s[0]&&Zr(this.timingTarget,s[0],y[1].resolveValue(this.vars)))}const a=o-1,h=this.keyFrames[o],l=this.keyFrames[a]||h,u=h[0]-l[0]==0?1:(r-l[0])/(h[0]-l[0]),p=h[1].interpolationFrom(l[1],u,this.vars);this.timingTarget&&s&&s[0]&&Zr(this.timingTarget,s[0],p)},this.onSeekToStart=()=>{this.startVal!==null&&this.timingTarget&&Zr(this.timingTarget,this.json.cBhvr.attrList[0],this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.initKeyFrames(),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("timelineStart",this.updateVars),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart)}get modifyAttrKey(){return this.json.cBhvr.attrList[0]}initKeyFrames(){var t;const{valueType:e}=this.json;if(this.json.tavLst.length<=0){if(this.json.to){if(this.json.from||this.startVal){const r={time:0,val:{type:"string",value:this.json.from||this.startVal.toString()},fmla:""};if(e==="num"&&this.timingTarget){const o=new Xs(r,this.timingTarget);this.keyFrames.push([r.time,o])}}const n={time:1,val:{type:"string",value:this.json.to},fmla:""};if(e==="num"&&this.timingTarget){const r=new Xs(n,this.timingTarget);this.keyFrames.push([n.time,r])}}else if(this.json.by){const n={time:0,val:{type:"string",value:this.json.cBhvr.attrList[0]},fmla:""};if(e==="num"&&this.timingTarget){const o=new Xs(n,this.timingTarget);this.keyFrames.push([n.time,o])}const r={time:1,val:{type:"string",value:(((t=n.val)===null||t===void 0?void 0:t.value)||"")+"+"+this.json.by},fmla:""};if(e==="num"&&this.timingTarget){const o=new Xs(r,this.timingTarget);this.keyFrames.push([r.time,o])}}}if(this.json.tavLst.length>0){for(const n of this.json.tavLst)if(n.val&&this.timingTarget){let r=null;n.val.type==="string"?e==="num"?r=new Xs(n,this.timingTarget):e==="str"&&(r=new Qm(n,this.timingTarget)):n.val.type==="number"?r=new Zm(n,this.timingTarget):n.val.type==="color"?(this.isColorAnim=!0,r=new $m(n,this.timingTarget)):n.val.type==="boolean"&&console.warn("not implements"),r&&this.keyFrames.push([n.time,r])}}}}class ur extends ce.k{constructor(t,e,n){super(t,e,n)}set percent(t){this.uniforms.percent=t}set transition(t){this.uniforms.transition=t}}var rT=v(121),oT=v.n(rT),sT=v(122),aT=v.n(sT),lT=v(123),hT=v.n(lT),uT=v(124),cT=v.n(uT),dT=v(9),Pr=v.n(dT),pT=v(125),fT=v.n(pT),mT=v(126),gT=v.n(mT);const tg="data:image/png;base64,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";var vT=v(127),_T=v.n(vT),yT=v(128),xT=v.n(yT),bT=v(129),TT=v.n(bT),ET=v(130),ST=v.n(ET),wT=v(131),AT=v.n(wT),MT=v(132),CT=v.n(MT),RT=v(133),IT=v.n(RT),PT=v(134),OT=v.n(PT),NT=v(135),LT=v.n(NT);const eg={wipe:class extends ur{constructor(i){super(aT.a,oT.a,{percent:0,direction:1,transition:0});let t=1;i==="up"?t=1:i==="down"?t=2:i==="left"?t=3:i==="right"&&(t=4),this.uniforms.direction=t}},fade:class extends ur{constructor(i){super(void 0,hT.a,{percent:0,transition:1});let t=1;i==="out"?t=-1:i==="in"&&(t=1),this.uniforms.transition=Math.pow(t,t)}},blinds:class extends ur{constructor(i){super(Pr.a,cT.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="vertical"?1:0}},checkerboard:class extends ur{constructor(i){super(Pr.a,fT.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="down"?1:0}},dissolve:class extends ur{constructor(i){super(Pr.a,gT.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.setTextTure()}setTextTure(){this.uniforms.dissolveSampler=ce.t.from(tg)}},randombar:class extends ur{constructor(i){super(Pr.a,_T.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="vertical"?1:0,this.setTextTure()}setTextTure(){this.uniforms.dissolveSampler=ce.t.from(tg)}},circle:class extends ur{constructor(i){super(Pr.a,xT.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="out"?1:0}},box:class extends ur{constructor(i){super(Pr.a,TT.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="out"?1:0}},diamond:class extends ur{constructor(i){super(Pr.a,ST.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="out"?1:0}},plus:class extends ur{constructor(i){super(Pr.a,AT.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="out"?1:0}},barn:class extends ur{constructor(i){super(Pr.a,CT.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="inHorizontal"?1:i==="outHorizontal"?2:i==="outVertical"?3:0}},strips:class extends ur{constructor(i){super(Pr.a,IT.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="upLeft"?1:i==="downRight"?2:i==="upRight"?3:0}},wedge:class extends ur{constructor(i){super(Pr.a,OT.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})}},wheel:class extends ur{constructor(i){super(Pr.a,LT.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=Number(i)||1}}};class DT extends ko{constructor(t){var e;super(t),this.filterType="",this.isConflict=!1,this.activeWhenConflict="prev",this.onTimeUpdate=({duration:o,delta:s})=>{var a;const h=s/o;if(this.filter){this.filter.percent=this.commonTimeNode.applyTimeFilter(h);const l=(a=this.timingTarget)===null||a===void 0?void 0:a.container.getBounds();l&&(this.filter.uniforms.uBoundRect=new Float32Array([l.x,l.y,l.width,l.height]))}h>=1&&this.timingTarget&&this.ctx.clock.setTimeout(()=>{var l;if(((l=this.timingTarget)===null||l===void 0?void 0:l.container.filters)&&this.filter){this.timingTarget.removeAnimationFilterQueue(this.filter);const u=this.timingTarget.getFirstAnimationFilter();this.timingTarget.container.filters=u?[u]:[]}})},this.onSeekToStart=()=>{this.timingTarget&&(this.timingTarget.container.filters=[],this.filter&&this.timingTarget.removeAnimationFilterQueue(this.filter))},this.onSeekToEnd=()=>{this.timingTarget&&(this.timingTarget.container.filters=[],this.filter&&this.timingTarget.removeAnimationFilterQueue(this.filter))},this.commonTimeNode.on("timelineStart",()=>{this.filter&&this.timingTarget&&(this.timingTarget.addToAnimationFilterQueue(this.filter),this.timingTarget.container.filters&&this.timingTarget.container.filters.length!==0||(this.timingTarget.container.filters=[this.filter]))}),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate);let n=1;t.json.transition==="out"&&(n=-1);const r=(e=t.json.filter)===null||e===void 0?void 0:e.match(/^([a-zA-Z]+)(\((.+)\))?/);if(r){const o=r[1],s=r[3];eg[o]&&(this.filter=new eg[o](s),this.filterType=`${o}-${s}`,this.filter&&(this.filter.transition=n))}}get modifyAttrKey(){return this.filterType}}class FT extends ko{constructor(t){super(t),this.isConflict=!0,this.activeWhenConflict="next",this.startPos=null,this.onTimeNodeStart=()=>{var e,n;this.startPos={x:((e=this.timingTarget)===null||e===void 0?void 0:e.ppt_x)||0,y:((n=this.timingTarget)===null||n===void 0?void 0:n.ppt_y)||0}},this.onTimeUpdate=({duration:e,delta:n})=>{var r;const o=n/e,s=(r=this.path)===null||r===void 0?void 0:r.getPoint(o);this.timingTarget&&s&&(this.timingTarget.ppt_x=s.x+this.timingTarget.design_ppt_x,this.timingTarget.ppt_y=s.y+ +this.timingTarget.design_ppt_y)},this.onSeekToStart=()=>{this.timingTarget&&this.startPos&&(this.timingTarget.ppt_x=this.startPos.x,this.timingTarget.ppt_y=this.startPos.y)},this.onSeekToEnd=()=>{var e,n,r;const o=(n=(e=this.commonTimeNode.json)===null||e===void 0?void 0:e.spd)!==null&&n!==void 0?n:1,s=(r=this.path)===null||r===void 0?void 0:r.getPoint(o>0?1:0);this.timingTarget&&s&&(this.timingTarget.ppt_x=s.x+this.timingTarget.design_ppt_x,this.timingTarget.ppt_y=s.y+this.timingTarget.design_ppt_y)},this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.createPath()}get modifyAttrKey(){return"motion"}createPath(){var t;const e=new Ps,n=(t=this.json.path)===null||t===void 0?void 0:t.match(/[MLCmlc][^MLCmlc]+/g);if(n)for(const r of n){const[o,...s]=r.trim().replace(/\s+/g," ").split(" ");if(o==="M"){const[a,h]=s.map(l=>Number(l));e.moveTo(a,h)}else if(o==="L"){const[a,h]=s.map(l=>Number(l));e.lineTo(a,h)}else if(o==="C"){const[a,h,l,u,p,y]=s.map(x=>Number(x));e.bezierCurveTo(a,h,l,u,p,y)}else if(o==="Z")e.closePath();else if(o==="E")console.warn("not implements");else if(o==="c"){const[a,h,l,u,p,y]=s.map(E=>Number(E)),x=e.currentPoint;e.bezierCurveTo(a+x.x,h+x.y,l+x.x,u+x.y,p+x.x,y+x.y)}else if(o==="l"){const a=e.currentPoint,[h,l]=s.map(u=>Number(u));e.lineTo(h+a.x,l+a.y)}else if(o==="m"){const a=e.currentPoint,[h,l]=s.map(u=>Number(u));e.moveTo(h+a.x,l+a.y)}}this.path=e}}class BT extends ko{constructor(t){super(t),this.isConflict=!0,this.activeWhenConflict="next",this.startVal=null,this.onTimelineStart=e=>{e.isReverse||this.updateCurrentValue()},this.onTimeUpdate=({duration:e,delta:n})=>{var r,o,s,a,h;const l=n/e,u={x:1,y:1};if(this.to){const p=(r=this.from)!==null&&r!==void 0?r:{x:(s=(o=this.startVal)===null||o===void 0?void 0:o.x)!==null&&s!==void 0?s:1,y:(h=(a=this.startVal)===null||a===void 0?void 0:a.y)!==null&&h!==void 0?h:1};u.x=p.x+(this.to.x-p.x)*l,u.y=p.y+(this.to.y-p.y)*l}else if(this.by){const p={x:this.by.x,y:this.by.y};u.x=1+(p.x-1)*l,u.y=1+(p.y-1)*l}this.timingTarget&&(this.timingTarget.scale=u)},this.onTimeNodeStart=()=>{this.timingTarget&&(this.startVal={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})},this.onSeekToStart=()=>{this.timingTarget&&this.startVal&&(this.timingTarget.scale=this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.from=t.json.from,this.to=t.json.to,this.by=t.json.by,this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart)}get modifyAttrKey(){return"scale"}updateCurrentValue(){this.timingTarget&&(this.current={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})}}class UT extends ko{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.isTimelineStart=!1,this.startColorString=null,this.currentColorString="#FFFFFFFF",this.onTimelineStart=e=>{if(this.isTimelineStart)return;this.isTimelineStart=!0,e.isReverse||this.updateCurrentValue(),this.from.isInit()||this.from.fromHexString(this.currentColorString),this.to.isInit()||this.from.by(this.by,this.to);const n=this.json.cBhvr.attrList[0],[r]=n.split(".");Zr(this.timingTarget,r+".on","true")},this.onTimeNodeEnd=()=>{const e=this.json.cBhvr.attrList[0];if(this.json.cBhvr.ctn.fill==="remove"){const[n]=e.split(".");Zr(this.timingTarget,n+".on","false")}this.isTimelineStart=!1},this.onSeekToStart=()=>{var e;const n=this.json.cBhvr.attrList[0];if(this.timingTarget){this.onTimeUpdate({duration:1,delta:0});const r=n==="ppt_c.color"||n==="text.color";if(((e=this.timingTarget.fill)===null||e===void 0?void 0:e.designColor.toUpperCase())===this.from.toHexString().toUpperCase()||r){const[o]=n.split(".");Zr(this.timingTarget,o+".on","false")}}},this.onTimeNodeStart=()=>{if(this.timingTarget){const e=this.json.cBhvr.attrList[0],n=sh(this.timingTarget,e);n&&(this.startColorString=n)}},this.onTimeUpdate=({delta:e,duration:n})=>{const r=e/n;if(this.to.interpolationFrom(this.from,r,this.target),this.timingTarget){const o=this.json.cBhvr.attrList[0];Zr(this.timingTarget,o,this.target.toHexString())}},this.onSeekToEnd=()=>{this.isTimelineStart||this.onTimelineStart({isReverse:!1,activeCount:0,id:""}),this.onTimeUpdate({duration:1,delta:1})},this.replaceAttrToRelation(),this.json.clrSpc==="rgb"?(this.from=new Zl(this.json.from),this.to=new Zl(this.json.to),this.by=new Zl(this.json.by),this.target=new Zl):(this.from=new Kl(this.json.from),this.to=new Kl(this.json.to),this.by=new Kl(this.json.by),this.target=new Kl),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeNodeEnd",this.onTimeNodeEnd),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate)}replaceAttrToRelation(){const t=this.json.cBhvr.attrList[0];t!=="ppt_c"?t==="style.color"&&(this.json.cBhvr.attrList[0]="text.color"):this.json.cBhvr.attrList[0]="ppt_c.color"}get modifyAttrKey(){return this.json.cBhvr.attrList[0]}updateCurrentValue(){if(this.timingTarget){const t=this.json.cBhvr.attrList[0],e=sh(this.timingTarget,t);e&&(this.currentColorString=e)}}}class kT extends ko{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.startVal=null,this.lastVal=null,this.onTimelineStart=e=>{this.lastVal=null,e.isReverse||this.updateCurrentValue()},this.onTimeUpdate=({duration:e,delta:n})=>{const r=n/e;let o=0,s=0;if(this.from!==void 0&&this.to!==void 0){o=this.from,s=this.to;const a=o+(s-o)*r;this.timingTarget&&(this.timingTarget.r=a)}else if(this.by!==void 0){this.lastVal||(this.lastVal=0);const a=this.by*r-this.lastVal;this.lastVal=this.by*r,this.timingTarget&&(this.timingTarget.r+=a)}},this.onTimeNodeStart=()=>{var e;as()((e=this.timingTarget)===null||e===void 0?void 0:e.r)&&(this.startVal=this.timingTarget.r)},this.onSeekToStart=()=>{this.timingTarget&&this.startVal!==null&&(this.timingTarget.r=this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.from=this.json.from,this.to=this.json.to,this.by=this.json.by,this.by?this.isConflict=!1:this.isConflict=!0,this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate)}get modifyAttrKey(){return"rotate"}updateCurrentValue(){var t;this.currentVal=(t=this.timingTarget)===null||t===void 0?void 0:t.r}}class GT extends ko{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.isApplied=!1,this.onTimeUpdate=()=>{var e,n;const{cmd:r,cmdType:o}=this.json;!this.isApplied&&r&&o&&(this.isApplied=!0,(n=(e=this.timingTarget)===null||e===void 0?void 0:e.cmd)===null||n===void 0||n.applyCommand(r,o))},this.onSeekToStart=()=>{var e,n;this.commonTimeNode.isInInteractiveSeq||(n=(e=this.timingTarget)===null||e===void 0?void 0:e.cmd)===null||n===void 0||n.applyCommand("custom-pause","call")},this.onSeekToEnd=()=>{},this.commonTimeNode.on("timeNodeStart",()=>{this.isApplied=!1}),this.commonTimeNode.on("timeNodeEnd",()=>{this.isApplied=!1}),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("seekToStart",this.onSeekToStart),this.commonTimeNode.on("seekToEnd",this.onSeekToEnd)}get modifyAttrKey(){var t,e,n,r;return((e=(t=this.json)===null||t===void 0?void 0:t.cmd)!==null&&e!==void 0?e:"")+((r=(n=this.json)===null||n===void 0?void 0:n.cmdType)!==null&&r!==void 0?r:"")}}class HT{constructor(t){this.runtimeNodeEventHub=new yi.a,this.onVolumeUpdate=E=>{this.audio.volume(E)},this.stopAudio=()=>{this.audio.stop()},this.destroy=()=>{this.stopAudio(),this.audio.destroy(),this.ctx.activeMedia.delete(this.audio),this.ctx.volumeAdjuster.off("update",this.onVolumeUpdate)};const{json:e,isIterate:n,isSub:r,eventHub:o,ctx:s,parent:a,iterateType:h,iterateIndex:l,iterateId:u,isInInteractiveSeq:p,fromSeqId:y}=t;this.json=e,this.id=e.cMediaNode.ctn.id,this.commonTimeNode=new Ys({json:e.cMediaNode.ctn,isSub:r,eventHubs:{global:o,runtime:this.runtimeNodeEventHub},ctx:s,parent:a,isIterate:n,iterateType:h,iterateIndex:l,iterateId:u,isInInteractiveSeq:p,fromSeqId:y});let x=e.cMediaNode.tgtEl;s.loaderDelegate&&(x=s.loaderDelegate.redirectMedia(x),s.logger.info(`redirect media url from ${e.cMediaNode.tgtEl} to ${x} by delegate.`,s.taskId)),this.audio=new tc(x,s.runningAudio),s.activeMedia.add(this.audio),this.commonTimeNode.on("timelineStart",()=>{this.audio.volume(s.volumeAdjuster.volume),this.audio.play()}),this.commonTimeNode.on("seekToStart",this.stopAudio),this.commonTimeNode.on("seekToEnd",this.stopAudio),this.commonTimeNode.on("timeNodeDestroy",this.destroy),this.ctx=s,this.ctx.volumeAdjuster.on("update",this.onVolumeUpdate)}}var jT=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};class Ys extends yi.a{constructor(t){var e,n;super(),this.uuid=ss(),this.isSub=!1,this.isShadow=!1,this.startCount=0,this.applyCount=0,this.isReverse=!1,this.isConflictDispose=!1,this.isIterateEnd=!1,this.parentTimeNode=null,this.isActive=!1,this.isDestroy=!1,this.shouldSeekOnStart=!1,this.repeatTimeoutId="",this.iterateShadows=[],this.isEndEventsEmitted=!1,this.tmFilter=[],this.timeDelta=0,this.isIterate=!1,this.iterateType="el",this.iterateIndex=0,this.children=[],this.subList=[],this.duration=0,this.isNegativeSpeed=!1,this.handleEndCond=()=>{this.isActive&&(this.isActive=!1,this.isInfiniteRepeat()?this.repeatTimeNodeEnd():this.seekToEnd(!1,!0))},this.handleActive=(W=!0)=>{if(this.isActive=!0,this.isConflictDispose=!1,this.applyCount+=1,this.json.iterate||this.emit("timeNodeStart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.startCount>0&&this.json.restart){if(this.json.restart==="never")return;this.json.restart!=="whenNotActive"&&this.json.restart!=="always"||(this.seekToStart(),this.emit("timeNodeRestart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.startTimeLine(W))}else this.startTimeLine(W)},this.updateTimeLine=W=>{const Q=W/(yr.b.TARGET_FPMS||.06);this.timeDelta+=Q,this.duration-this.timeDelta<=Q&&(this.timeDelta=this.duration),this.timeDelta<this.duration?this.emit("timeUpdate",{delta:this.isReverse||this.isNegativeSpeed?this.duration-this.timeDelta:this.timeDelta,duration:this.duration,isReverse:this.isReverse}):(this.emit("timeUpdate",{delta:this.isReverse||this.isNegativeSpeed?0:this.duration,duration:this.duration,isReverse:this.isReverse}),this.onTimeLineEnd())},this.handleEnd=(W=!1)=>{(this.isTimeNodeEnd()||W)&&(this.isActive=!1,this.isSub&&this.destroy(),this.emitEndEvents())};const{isSub:r,isIterate:o,ctx:s,eventHubs:a,parent:h,json:l,iterateType:u,iterateId:p,iterateIndex:y,isInInteractiveSeq:x,fromSeqId:E}=t;this.isSub=r,this.fromSeqId=E,this.isInInteractiveSeq=x,this.isIterate=o,this.parentTimeNode=h,this.json=l,this.ctx=s,this.iterateIndex=y,this.eventHubs=a,this.iterateType=u,this.iterateId=p,this.tmFilter=(n=(e=l.tmFilter)===null||e===void 0?void 0:e.split(";").map(W=>W.split(",").map(Q=>parseFloat(Q.trim()))))!==null&&n!==void 0?n:[];const A=Number(this.json.dur),C=this.json.spd||1;if(this.isNegativeSpeed=C<0,Number.isNaN(A)||(this.duration=A/Math.abs(C)),this.uuid+="--"+this.json.id,this.setPreStyle(),l.childTnLst&&this.createChildren(l.childTnLst),this.startConds=new La(this.json.id||"",l.stCondLst,a,this.ctx),this.endConds=new La(this.json.id||"",l.endCondLst,a,this.ctx),l.endSync&&(this.endSync=new La(this.json.id||"",[l.endSync],a,this.ctx),this.endSync.on("active",()=>{var W;this.json.nodeType==="interactiveSeq"&&(this.isActive=!1,this.shouldSeekOnStart=!0,this.emit("timeNodeEndSync"),(W=this.endSync)===null||W===void 0||W.reset())})),this.startConds.on("active",W=>{this.isActive||(this.shouldSeekOnStart&&(this.shouldSeekOnStart=!1,this.seekToStart()),this.handleActive(W))}),this.endConds.on("active",()=>{this.handleEndCond(),this.children.forEach(W=>W.commonTimeNode.handleEndCond())}),this.parentTimeNode&&this.parentTimeNode.on("timeNodeStart",()=>{this.applyCount=0}),this.isSub&&this.json.masterRel==="nextClick"){const W="shape slide onNext"+this.fromSeqId;this.startConds.addCond({event:W})}this.json.iterate&&this.isIterate===!1&&this.createIterateShadow()}createIterateShadow(){const t=ss();let e=!0,n=0;const r=o=>{o===t&&(e=!1,this.ctx.eventHub.removeListener("IterateTimeNodeEnd",r))};for(this.ctx.eventHub.on("IterateTimeNodeEnd",r);e;){const o=JSON.parse(JSON.stringify(this.json)),s=new Ys({json:o,isSub:!1,eventHubs:this.eventHubs,ctx:this.ctx,parent:null,isIterate:!0,iterateType:o.iterate.type,iterateIndex:n,iterateId:t,isInInteractiveSeq:this.isInInteractiveSeq,fromSeqId:this.fromSeqId});this.iterateShadows[n]=s,n+=1}}isInfiniteRepeat(){return this.json.repeatCount>999999998}getReverse(){return this.isReverse}setReverse(t){this.isReverse=t}createTimeNode(t,e){let n=null;const r={json:t,isSub:e,isIterate:this.isIterate,eventHub:this.eventHubs.global,ctx:this.ctx,parent:this,iterateType:this.iterateType,iterateIndex:this.iterateIndex,iterateId:this.iterateId,isInInteractiveSeq:this.isInInteractiveSeq,fromSeqId:this.fromSeqId};return t.type==="seq"?n=new eT(r):t.type==="par"?n=new ng(r):t.type==="set"?n=new nT(r):t.type==="anim"?n=new iT(r):t.type==="animEffect"?n=new DT(r):t.type==="animMotion"?n=new FT(r):t.type==="animScale"?n=new BT(r):t.type==="animClr"?n=new UT(r):t.type==="animRot"?n=new kT(r):t.type==="cmd"?n=new GT(r):t.type==="audio"&&(n=new HT(r)),n}createSubList(t){this.subList&&this.subList.forEach(e=>e.commonTimeNode.destroy()),this.subList=[],t.forEach(e=>{const n=this.createTimeNode(e,!0);n&&this.subList.push(n)})}bindCommonTimeNodeEvent(t){t.commonTimeNode.on("timeNodeStart",e=>{this.emit("childTimeNodeStart",e)}),t.commonTimeNode.on("timeNodeEnd",e=>{this.emit("childTimeNodeEnd",e),this.children.every(n=>n.commonTimeNode.isTimeNodeEndWhenDetectEndSync())&&(this.json.iterate||this.allChildrenEndHandle())})}createChildren(t){function e(n){return(r=n,function(o){var s;return!!(!((s=o)===null||s===void 0)&&s.cBhvr)}(r)?r.cBhvr.ctn:function(o){var s,a;return!!(!((a=(s=o)===null||s===void 0?void 0:s.cMediaNode)===null||a===void 0)&&a.ctn)}(r)?r.cMediaNode.ctn:r.ctn).presetOrder;var r}t&&t[0]&&e(t[0])?[...t].sort((n,r)=>{var o,s;return((o=e(n))!==null&&o!==void 0?o:0)-((s=e(r))!==null&&s!==void 0?s:0)}).forEach(n=>{const r=this.createTimeNode(n,!1);r&&(this.bindCommonTimeNodeEvent(r),this.children.push(r))}):t.forEach(n=>{const r=this.createTimeNode(n,!1);r&&(this.bindCommonTimeNodeEvent(r),this.children.push(r))})}playReverse(){this.isReverse=!0,this.startReverseTimeLine(),this.children.forEach(t=>t.commonTimeNode.playReverse())}allChildrenEndHandle(){if(!this.isDestroy){if(this.json.autoRev&&!this.isReverse)return this.isReverse=!0,void this.playReverse();this.isReverse&&(this.isReverse=!1),this.json.repeatCount&&this.json.repeatCount>this.applyCount?this.repeatTimeoutId=this.ctx.clock.setTimeout(()=>{this.seekToStart(!1),this.resetForRepeat(),this.startTimeNodeRepeat()}):(this.json.iterate&&!this.isIterate&&(this.isIterateEnd=!0),this.eventHubs.runtime.emit("runtime all end"),this.startSubList(),this.handleEnd())}}resetForRepeat(){this.isInInteractiveSeq&&this.isInfiniteRepeat()&&this.repeatTimeNodeEnd(),this.timeDelta=0,this.children.forEach(t=>t.commonTimeNode.resetForRepeat())}startSubList(){this.subList.forEach(t=>t.commonTimeNode.startTimeNode())}startReverseTimeLine(){this.isEndEventsEmitted=!1,this.timeDelta=0;const t=1e3/this.ctx.ticker.maxFPS;this.duration<=t&&this.duration>0?(this.emit("timeUpdate",{delta:this.duration,duration:this.duration,isReverse:this.isReverse}),this.ctx.eventHub.emit(Qe.animateEnd),this.ctx.ticker.remove(this.updateTimeLine)):this.duration>t&&(this.ctx.eventHub.emit(Qe.animateStart),this.ctx.ticker.add(this.updateTimeLine))}startTimeLine(t=!0){if(t&&(this.isEndEventsEmitted=!1,this.eventHubs.global.emit(`time ${this.json.id} begin`),this.eventHubs.global.emit(`time ${this.json.id} onBegin`),this.eventHubs.runtime.emit(`runtime ${this.json.id} begin`)),this.json.iterate)return void this.startIterate();this.timeDelta=0,this.emit("timelineStart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse});const e=1e3/this.ctx.ticker.maxFPS;this.duration<=e&&this.duration>0?(this.timeDelta=this.isReverse?0:this.duration,this.emit("timeUpdate",{delta:this.timeDelta,duration:this.duration,isReverse:this.isReverse}),this.emit("timelineEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.ctx.ticker.addOnce(()=>{this.onTimeLineEnd()})):this.duration>e&&(this.ctx.eventHub.emit(Qe.animateStart),this.updateTimeLine(0),this.ctx.ticker.add(this.updateTimeLine))}startIterate(){return jT(this,void 0,void 0,function*(){if(this.json.iterate){this.isIterateEnd=!1;for(const t of this.iterateShadows){if(this.isIterateEnd)break;t.children.forEach(e=>{e.commonTimeNode.startTimeNode()}),t.applyCount+=1,yield this.ctx.clock.delay(this.json.iterate.interval)}this.onTimeLineEnd()}})}applyTimeFilter(t){if(!this.tmFilter.every(e=>as()(e[0])&&as()(e[1])))return t;for(let e=0;e<this.tmFilter.length;e++){const n=this.tmFilter[e];if(t<n[0]){const r=this.tmFilter[e-1];return(t-r[0])/(n[0]-r[0])*(n[1]-r[1])+r[1]}}return this.tmFilter.length>0?this.tmFilter[this.tmFilter.length-1][1]:t}isNatureTimeEnd(){return this.duration>=0&&this.timeDelta>=this.duration}findTargets(){const t=[],e=n=>{n.forEach(r=>{var o,s,a;r.cBhvr&&r.cBhvr.target&&t.findIndex(h=>h.id===r.cBhvr.target.id)<0&&t.push(r.cBhvr.target),((s=(o=r==null?void 0:r.cBhvr)===null||o===void 0?void 0:o.ctn)===null||s===void 0?void 0:s.childTnLst)&&r.cBhvr.ctn.childTnLst.length>0&&e(r.cBhvr.ctn.childTnLst),((a=r==null?void 0:r.ctn)===null||a===void 0?void 0:a.childTnLst)&&r.ctn.childTnLst.length>0&&e(r.ctn.childTnLst)})};return e(this.json.childTnLst||[]),t}setPreStyle(){this.json.presetClass&&this.findTargets().forEach(t=>{if(this.json.iterate){let e=0,n=!0;for(;n;){const r=this.ctx.timingTargets.getTarget(t,!0,{type:this.json.iterate.type,index:e,id:""});r&&(this.setPreStyleForTarget(r),e+=1),n=!!r}}else{const e=this.ctx.timingTargets.getTarget(t,!1);e&&this.setPreStyleForTarget(e)}})}setPreStyleForTarget(t){var e,n;if(t&&this.json.presetSubtype&&(t.presetSubType=this.json.presetSubtype),t&&!t.hasPreset)if(this.json.presetClass==="entr"){const r=(n=(e=this.json)===null||e===void 0?void 0:e.childTnLst)===null||n===void 0?void 0:n.filter(o=>o.type==="set"&&o.to==="visible");r!=null&&r.length&&(t.hasPreset=!0,t.style.visibility="hidden")}else(this.json.presetClass==="exit"||this.json.presetClass==="path"||this.json.presetClass==="emph")&&(t.hasPreset=!0,t.style.visibility="visible")}startTimeNodeRepeat(){this.timeDelta=0,this.isActive=!0,this.applyCount+=1,this.startTimeLine(!1),this.json.iterate||this.emit("timeNodeRepeat",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse})}startTimeNodeForce(){this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.timeDelta=0,this.isActive=!0,this.handleActive(!1)}startTimeNode(t=!0){if(this.isDestroy)return;this.collectStartValue(),this.timeDelta=0,this.isReverse=!1,this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.startConds.setTriggerParams(t);const e=this.json.stCondLst.filter(r=>/^self/.test(r.event||""))[0];e&&this.startConds.condHandle(e);const n=this.json.endCondLst.filter(r=>/^self/.test(r.event||""))[0];n&&this.endConds.condHandle(n),this.startConds.condHandle()}onTimeLineEnd(){this.dispose(),(this.children.length===0||this.json.iterate)&&this.allChildrenEndHandle()}clearSubList(){this.subList.forEach(t=>t.commonTimeNode.destroy())}seekToStart(t=!0){if(this.isEndEventsEmitted=!1,this.isActive=!1,this.dispose(),this.timeDelta=0,this.emit("seekToStart"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach(e=>e.seekToStart(t));if(t)for(let e=this.subList.length-1;e>=0;e--){const n=this.subList[e];n==null||n.commonTimeNode.seekToStart()}for(let e=this.children.length-1;e>=0;e--){const n=this.children[e];n==null||n.commonTimeNode.seekToStart()}if(this.children.length>1)for(let e=this.children.length-1;e>=0;e--){const n=this.children[e];n==null||n.commonTimeNode.seekToStart()}}repeatTimeNodeEnd(){this.dispose(),this.children.forEach(t=>{t.commonTimeNode.isActive=!1,t.commonTimeNode.dispose()})}dispose(t=!1){this.isConflictDispose=t,this.ctx.clock.clearTimeout(this.repeatTimeoutId),this.ctx.eventHub.emit(Qe.animateEnd);try{this.ctx.ticker.remove(this.updateTimeLine)}catch{}this.startConds.reset(),this.endConds.reset()}seekToEnd(t,e=!1){if(this.isInfiniteRepeat())return;!this.isActive&&this.applyCount<=0&&this.collectStartValue(),this.applyCount=this.json.repeatCount,this.json.autoRev&&(this.isReverse=!0),this.timeDelta=this.duration,this.isActive=!1,this.dispose();const n=this.json.autoRev||t;if(n?this.emit("seekToStart"):this.emit("seekToEnd"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach(r=>r.seekToEnd(n,e));this.children.length===0&&(this.eventHubs.runtime.emit("runtime all end"),this.handleEnd()),this.children.forEach(r=>r.commonTimeNode.seekToEnd(n,e)),e&&this.json.subTnLst&&(this.subList.length<=0&&this.createSubList(this.json.subTnLst),this.subList.forEach(r=>r.commonTimeNode.seekToEnd(!1)),this.clearSubList())}isTimeNodeEndWhenDetectEndSync(){if(this.isInInteractiveSeq&&this.isInfiniteRepeat())return!0;let t=!0;return this.children.length>0&&(t=t&&this.children.every(e=>e.commonTimeNode.isTimeNodeEndWhenDetectEndSync())),this.json.repeatCount&&(t=t&&this.applyCount>=this.json.repeatCount),this.json.autoRev&&(t=t&&!this.isReverse),t=t&&this.isNatureTimeEnd(),!!this.isConflictDispose||!(!this.isIterateEnd||!this.json.iterate)||t}isTimeNodeEnd(){let t=!0;return this.children.length>0&&(t=t&&this.children.every(e=>e.commonTimeNode.isTimeNodeEnd())),this.json.repeatCount&&(t=t&&this.applyCount>=this.json.repeatCount),this.json.autoRev&&(t=t&&!this.isReverse),t=t&&this.isNatureTimeEnd(),!!this.isConflictDispose||!(!this.isIterateEnd||!this.json.iterate)||t}emitEndEvents(){this.isEndEventsEmitted||(this.isEndEventsEmitted=!0,this.eventHubs.global.emit(`time ${this.json.id} end`),this.eventHubs.global.emit(`time ${this.json.id} onEnd`),this.eventHubs.runtime.emit(`runtime ${this.json.id} end`),this.emit("timeNodeEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}))}collectStartValue(){this.emit("timeNodeCreate"),this.children.forEach(t=>t.commonTimeNode.collectStartValue())}destroy(){this.emit("timeNodeDestroy"),this.isDestroy=!0,this.dispose(),this.startConds.removeAllListeners(),this.endConds.removeAllListeners(),this.children.forEach(t=>t.commonTimeNode.destroy()),this.clearSubList()}}class ng extends yi.a{constructor(t){super(),this.isRunning=!1,this.runtimeNodeEventHub=new yi.a;const{json:e,iterateType:n,isIterate:r,isSub:o,parent:s,ctx:a,eventHub:h,iterateIndex:l,iterateId:u,isInInteractiveSeq:p,fromSeqId:y}=t;this.id=e.ctn.id,this.json=e,this.ctx=a,this.isIterate=r,this.globalEventHub=h,this.commonTimeNode=new Ys({json:e.ctn,isSub:o,eventHubs:{global:h,runtime:this.runtimeNodeEventHub},ctx:a,parent:s,isIterate:!1,iterateType:n,iterateIndex:l,iterateId:u,isInInteractiveSeq:p,fromSeqId:y}),this.commonTimeNode.on("timeNodeStart",()=>{this.commonTimeNode.children.forEach(x=>{x.commonTimeNode.setReverse(this.commonTimeNode.getReverse()),x.commonTimeNode.startTimeNode()}),this.isRunning||(this.isRunning=!0,this.globalEventHub.emit(`runtime ${this.id} begin`),this.emit("begin"))}),this.commonTimeNode.on("timeNodeRepeat",()=>{this.commonTimeNode.children.forEach(x=>{x.commonTimeNode.startTimeNode(!1)})}),this.commonTimeNode.on("timeNodeEnd",()=>{this.commonTimeNode.isTimeNodeEnd()&&this.isRunning&&(this.isRunning=!1,this.globalEventHub.emit(`runtime ${this.id} end`),this.emit("end"))})}}var zT=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};class VT{constructor(t,e,n){this.json=t,this.ctx=n,this.globalEventHub=e;const r=t.timeNodeList.find(o=>o.type==="par"&&o.ctn.nodeType==="tmRoot");r&&(this.tmRoot=new ng({json:r,isSub:!1,isIterate:!1,eventHub:e,ctx:n,parent:null,iterateType:"el",iterateIndex:0,iterateId:"",isInInteractiveSeq:!1,fromSeqId:""}),this.mainSeq=this.tmRoot.commonTimeNode.children.find(o=>{var s,a,h;return((s=o.json)===null||s===void 0?void 0:s.type)==="seq"&&((h=(a=o.json)===null||a===void 0?void 0:a.ctn)===null||h===void 0?void 0:h.nodeType)==="mainSeq"}))}findSeq(t){var e;return(e=this.tmRoot)===null||e===void 0?void 0:e.commonTimeNode.children.find(n=>{var r,o,s;return((r=n.json)===null||r===void 0?void 0:r.type)==="seq"&&((s=(o=n.json)===null||o===void 0?void 0:o.ctn)===null||s===void 0?void 0:s.id)===t})}start(){var t,e;return zT(this,void 0,void 0,function*(){this.json.autoPlayMainSeq?(yield this.ctx.clock.delay(16),(t=this.mainSeq)===null||t===void 0||t.commonTimeNode.startTimeNode()):(e=this.mainSeq)===null||e===void 0||e.commonTimeNode.startTimeNode()})}setMainSeqApplied(){this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1)}collectMainSeqStartValue(){var t;(t=this.mainSeq)===null||t===void 0||t.commonTimeNode.collectStartValue()}setMainSeqStep(t,e){var n;t===-1&&this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1),(n=this.mainSeq)===null||n===void 0||n.setCurrentStep(t,e)}destroy(){var t;this.globalEventHub.removeAllListeners(),(t=this.tmRoot)===null||t===void 0||t.commonTimeNode.destroy()}hasMainSeq(){return!!this.mainSeq&&this.mainSeq.commonTimeNode.children.length>0}currentMainSeqState(){return this.mainSeq?this.mainSeq.currentState:null}currentMainSeqStep(){return this.mainSeq?this.mainSeq.currentStep:0}currentMainSeqLength(){return this.mainSeq?this.mainSeq.stepLength:0}mainSeqHasNextStep(){return!!this.mainSeq&&this.mainSeq.hasNext()}mainSeqHasPrevStep(){return!!this.mainSeq&&this.mainSeq.hasPrev()}seekInteractiveSeqToEnd(t){const e=this.findSeq(t);e&&e.commonTimeNode.seekToEnd(!1,!0)}setInteractiveSeqState(t,e,n){const r=this.findSeq(t);r&&r.setCurrentStep(e,n)}resetAllInteractiveSeq(){var t;(((t=this.tmRoot)===null||t===void 0?void 0:t.commonTimeNode.children.filter(e=>{var n,r,o;return((n=e.json)===null||n===void 0?void 0:n.type)==="seq"&&((o=(r=e.json)===null||r===void 0?void 0:r.ctn)===null||o===void 0?void 0:o.nodeType)==="interactiveSeq"}))||[]).forEach(e=>{e.setCurrentStep(0,"start")})}applyInteractiveAction(t){this.globalEventHub.emit(t)}}var ig=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};class WT extends ec{constructor(t,e,n,r){super({id:"stage",width:t.width,height:t.height,type:"Container",children:t.children},e,n,void 0,r),this.isRendered=!1,this.isTimingStartValueCollected=!1,this.json=t,e.hasBackgroundFillShape=this.detectUseBackgroundFill(this.json),this.container.visible=!1,this.ctx=e;const o=new qi;o.beginFill(16777215),o.drawRect(0,0,t.width,t.height),o.endFill(),this.container.addChild(o)}detectUseBackgroundFill(t){return!!t&&(t.type==="Picture"||t.type==="Shape"?t.useBgFill:!(!t.children||!Array.isArray(t.children))&&t.children.some(e=>this.detectUseBackgroundFill(e)))}initOnReuse(){super.initOnReuse(),this.ctx.timingEventHub.on("c:prev slide",t=>{this.ctx.eventHub.emit(Qe.requestPrevSlide,t)}),this.ctx.timingEventHub.on("c:next slide",(t,e)=>{this.ctx.eventHub.emit(Qe.requestNextSlide,t,e)})}get interactiveContainer(){return this.container}render(t){this.isRendered||(this.collectAnimatedIds().forEach(e=>this.ctx.animatedIds.add(e)),this.isRendered=!0,super.render(t),t.addSubMTask(()=>ig(this,void 0,void 0,function*(){this.ctx.eventHub.emit("StageRenderEnd")}),"@StageImpl[emit.StageRenderEnd]"))}isListTimeNode(t){return["excel","seq","par"].indexOf(t.type)>=0}isAnimatedTimeNode(t){return!!t.cBhvr}collectAnimatedIdsForTimeNode(t,e){var n;this.isListTimeNode(t)?(n=t.ctn.childTnLst)===null||n===void 0||n.forEach(r=>{this.collectAnimatedIdsForTimeNode(r,e)}):this.isAnimatedTimeNode(t)&&e.push(t.cBhvr.target.id)}collectAnimatedIds(){const t=[];return this.json.timing&&this.json.timing.timeNodeList.forEach(e=>{this.collectAnimatedIdsForTimeNode(e,t)}),t}createTiming(){this.json.timing&&!this.timing&&(this.timing=new VT(this.json.timing,this.ctx.timingEventHub,this.ctx))}startTiming(){var t;return((t=this.timing)===null||t===void 0?void 0:t.start())||Promise.resolve()}setMainSeqApplied(){var t;(t=this.timing)===null||t===void 0||t.setMainSeqApplied()}setMainSeqStep(t,e){var n;(n=this.timing)===null||n===void 0||n.setMainSeqStep(t,e)}collectMainSeqStartValue(){var t;this.isTimingStartValueCollected||(this.isTimingStartValueCollected=!0,(t=this.timing)===null||t===void 0||t.collectMainSeqStartValue())}hasTiming(){return!!this.timing}clearOnSlideChange(){this.ctx.eventHub.removeAllListeners(),this.ctx.timingEventHub.removeAllListeners(),super.clearOnSlideChange()}clearOnTransactionEnd(){var t,e;this.ctx.timingTargets.getTargets().forEach(n=>{n.hasPreset=!1}),(t=this.timing)===null||t===void 0||t.resetAllInteractiveSeq(),(e=this.timing)===null||e===void 0||e.destroy(),this.timing=void 0}destroy(){var t,e;this.isTimingStartValueCollected=!1,this.isRendered=!1,this.ctx.eventHub.removeAllListeners(),this.ctx.graphicsTexture.destroy(),(t=this.ctx.bgTexture)===null||t===void 0||t.destroy(!0),this.ctx.spriteTexture.destroy(),this.ctx.timingEventHub.removeAllListeners(),(e=this.timing)===null||e===void 0||e.destroy(),this.timing=void 0,super.destroy()}mainSeqStep(){var t,e;return(e=(t=this.timing)===null||t===void 0?void 0:t.currentMainSeqStep())!==null&&e!==void 0?e:0}mainSeqLength(){var t,e;return(e=(t=this.timing)===null||t===void 0?void 0:t.currentMainSeqLength())!==null&&e!==void 0?e:0}mainSeqHasNextStep(){var t,e;return(e=(t=this.timing)===null||t===void 0?void 0:t.mainSeqHasNextStep())!==null&&e!==void 0&&e}mainSeqHasPrevStep(){var t,e;return(e=(t=this.timing)===null||t===void 0?void 0:t.mainSeqHasPrevStep())!==null&&e!==void 0&&e}mainSeqState(){return this.timing?this.timing.currentMainSeqState():null}nextStep(t,e){var n;this.hasTiming()&&((n=this.timing)===null||n===void 0?void 0:n.hasMainSeq())?(this.ctx.timingEventHub.emit("shape slide onStopAudio"),this.ctx.timingEventHub.emit("shape slide onNext",t,e)):this.ctx.eventHub.emit(Qe.requestNextSlide,t,e)}prevStep(t=!1){var e;this.hasTiming()&&((e=this.timing)===null||e===void 0?void 0:e.hasMainSeq())?(this.ctx.timingEventHub.emit("shape slide onStopAudio"),this.ctx.timingEventHub.emit("shape slide onPrev",t)):this.ctx.eventHub.emit(Qe.requestPrevSlide,t)}applyInteractiveAction(t){var e;(e=this.timing)===null||e===void 0||e.applyInteractiveAction(t)}seekInteractiveSeqToEnd(t){var e;(e=this.timing)===null||e===void 0||e.seekInteractiveSeqToEnd(t)}setInteractiveSeqState(t,e,n){var r;(r=this.timing)===null||r===void 0||r.setInteractiveSeqState(t,e,n)}setMediaState(t,e,n){return ig(this,void 0,void 0,function*(){const r=this.ctx.medias[t];r&&(e?n?(yield Xl(()=>r.clippedDuration>0,5e3),n<r.clippedDuration&&(r.once("play",()=>{r.seek(n)}),yield r.play())):yield r.play():(n&&r.seek(n),yield r.pause()))})}setMediaCurrentTime(t,e){const n=this.ctx.medias[t];n&&n.seek(e)}}class XT{constructor(t){this.ticker=t,this.tasks=[],this.couldRunning=!1,this.applyNext=()=>{const e=this.tasks[0];e&&e.applyNext()},t.add(this.applyNext)}addTask(t){this.tasks.push(t),t.once("task-finish",()=>{const e=this.tasks.indexOf(t);e>=0&&this.tasks.splice(e,1)}),t.once("task-error",()=>{const e=this.tasks.indexOf(t);e>=0&&this.tasks.splice(e,1)})}start(){this.couldRunning=!0}stop(){this.couldRunning=!1}}var YT=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};const qT=i=>new Promise(t=>setTimeout(t,i));class JT extends yi.a{constructor(t,e,n){super(),this.slideIndex=t,this.taskId=e,this.logger=n,this.uuid=ss(),this.isCancel=!1,this.tasks=[]}addMTask(t,e){this.tasks.push({fn:t,state:"wait",sub:[],name:e})}addSubMTask(t,e){let n=this.tasks.findIndex(r=>r.state==="running");n<0&&(n=0),this.tasks[n].sub.push({fn:t,state:"wait",sub:[],name:e})}cancel(){this.tasks=[],this.isCancel=!0}applyNext(){if(this.tasks.some(e=>e.state==="running")||this.tasks.some(e=>e.state==="error"))return;if(this.tasks.every(e=>e.state==="finish"))return void(this.isCancel||this.emit("task-finish"));const t=this.tasks.find(e=>e.state==="wait");t&&(t.state="running",t.fn.apply(null).then(()=>{if(t.state="finish",t.sub.length>0){const e=this.tasks.findIndex(n=>n===t);this.tasks.splice(e+1,0,...t.sub)}}).catch(e=>{t.state="error",this.logger.error(`${e} ${e.stack}`,this.taskId),this.emit("task-error",wi.transform(e),this.slideIndex)}))}applyAll(){return YT(this,void 0,void 0,function*(){for(;!this.tasks.every(t=>t.state==="finish");)if(this.tasks.some(t=>t.state==="running"))yield qT(16);else{if(this.tasks.some(t=>t.state==="error"))return;{const t=this.tasks.find(e=>e.state==="wait");if(t){t.state="running";try{if((yield js(()=>t.fn.apply(null),6e4))===ho)throw new wi(er.RuntimeError,`subtask ${t.name} apply timeout`);if(t.state="finish",t.sub.length>0){const e=this.tasks.findIndex(n=>n===t);this.tasks.splice(e+1,0,...t.sub)}}catch(e){let n;n=e!=null&&e.errorType?e:new wi(er.RuntimeError,`subtask ${t.name} error. ${e}`),t.state="error",this.logger.error(`${e} ${e.stack}`,this.taskId),this.emit("task-error",wi.transform(n),this.slideIndex);break}}}}!this.isCancel&&this.tasks.every(t=>t.state==="finish")&&this.emit("task-finish")})}}var KT=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};class co{constructor(t,e){if(this.renderer=t,this.localStorage=e,this.outputData=new Map,this.loadingSdfKeys=new Set,!co.worker){const n=new Blob([`
7829
+ `),{arg1:Float32Array.from(e)})}}class uo{constructor(t,e,n,r,o){this.ctx=t,this.fillStyle=e,this.width=n,this.height=r,this.config=o,this.clonedObjects=[],this._displayObject=null,this.gradientHash=Jl()(`${JSON.stringify(e)}${Math.ceil(n)}${Math.ceil(r)}`)}get displayObject(){return this._displayObject||(this._displayObject=this.createDisplayObject()),this._displayObject}set displayObject(t){this._displayObject&&this._displayObject.destroy({children:!0,texture:!0}),this._displayObject=t}get hasFill(){return!!this.fillStyle&&this.fillStyle.fillType!=="noFill"}createDisplayObject(){var t;if(!this.fillStyle)return null;if(this.config.useSlideBackgroundFill&&this.ctx.bgTexture){const e=new di;return e.texture=this.ctx.bgTexture,e}if(this.fillStyle.fillType==="solidFill"||this.fillStyle.fillType==="noFill")return null;if(this.fillStyle.fillType==="gradientFill"){const e=new di,n=r1(this.fillStyle,this.width,this.height),r=ce.p.create({width:this.width,height:this.height,resolution:this.ctx.renderer.resolution});return this.ctx.renderer.render(n,{renderTexture:r}),n.destroy({children:!0,texture:!0}),e.texture=r,e}if(this.fillStyle.fillType==="blipFill"){const{src:e,filters:n}=this.fillStyle,r=this.ctx.spriteTexture.getTexture(e),o=this.ctx.spriteTexture.getFrameData(e);if(r){const s=new di;if(s.texture=r,n.length>0&&this.config.useFilter&&(this.ctx.featureList||{}).filter&&(s.filters=function(a,h){const l=[];return a.forEach(u=>{const p=((h==null?void 0:h.filter)||[]).indexOf(u.type)>=0;if(["biLevel","alphaBiLevel","alphaCeiling","alphaModFix","alphaFloor","grayscl"].indexOf(u.type)>=0&&p)l.push(new a1(u.type,u.args[0]||0));else if(["clrChange","changeBulletColor","duotone"].indexOf(u.type)>=0&&p){const y=br(u.args[0]),x=br(u.args[1]);l.push(new u1(u.type,y,x))}else if(u.type==="lum"&&p)l.push(new p1(u.type,u.args[0],u.args[1]));else if(u.type==="alphaInv"&&p){const y=br(u.args[0]);l.push(new g1(u.type,y))}}),l}(n,this.ctx.featureList)),this.config.fillFloat){const{l:a,t:h,r:l,b:u}=this.config.fillFloat.fillRect,p=this.width*(1-a-l),y=this.height*(1-h-u),x=(t=this.config.shapeRotation)!==null&&t!==void 0?t:0,E=new qi;E.drawRect(0,0,p,y),E.pivot.x=p/2,E.pivot.y=y/2,E.rotation=x;const A=E.getBounds(),C=A.width,W=A.height;s.width=C,s.height=W,s.anchor.x=.5,s.anchor.y=.5,s.rotation=-1*x,s.name="math-texture",x===0?(s.position.x=C/2+a*this.width,s.position.y=W/2+h*this.height):(s.position.x=this.width/2,s.position.y=this.height/2)}else s.width=this.width,s.height=this.height,o.rotate&&(s.position.x=this.width/2,s.position.y=this.height/2,s.anchor.x=.5,s.anchor.y=.5,s.rotation=o.rotate/180*Math.PI);return s}}else if(this.fillStyle.fillType==="gifFill"){const{src:e,delays:n}=this.fillStyle,r=this.ctx.spriteTexture.getGifFrames(e).map((h,l)=>({texture:h,time:n[l]||20})),o=new Gu(r,!0);o.name=ss(),o.width=this.width,o.height=this.height;const s=this.fillStyle.loop;let a=1;return o.onLoop=()=>{a+=1,s>0&&a>s&&o.gotoAndStop(o.totalFrames)},o}return null}isSolidFill(){var t;return((t=this.fillStyle)===null||t===void 0?void 0:t.fillType)==="solidFill"}getSolidFillColor(){var t;return((t=this.fillStyle)===null||t===void 0?void 0:t.fillType)==="solidFill"?this.fillStyle.color:"#000000"}getClonedDisplayObject(){const t=this.createDisplayObject();return this.clonedObjects.push(t),t}destroy(){var t;(t=this._displayObject)===null||t===void 0||t.destroy(),this._displayObject=null,this.clonedObjects.forEach(e=>{e==null||e.destroy()}),this.clonedObjects=[]}}var v1=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};class _1 extends Xu{constructor(t,e,n){var r;super(t,e,n),this.textureContainer=new Cn.b,this.underline=null,this.cacheSprite=new di;const{shapeId:o,paragraphIndex:s,lineIndex:a,unitIndex:h,lineHeight:l,width:u,underLine:p,fill:y,height:x,isHorz:E,lineWidth:A}=t,C=((r=y==null?void 0:y.fill)===null||r===void 0?void 0:r.fillType)==="solidFill"?y.fill.color:null;if(p){const W=E?l/16:A/16;this.underline=new Qb(e,p.type,W,u,x,C,E,o,s,a,h)}this.textGraphics=this.createTextGraphics(),this.textFill=this.createTextFill(),this.strokeGraphics=this.createStrokeGraphics(),this.strokeFill=this.createStrokeFill()}createStrokeFill(){const{stroke:t,lineWidth:e,lineHeight:n}=this.json;return new uo(this.ctx,t==null?void 0:t.fill,e,n,{useFilter:!1,useSlideBackgroundFill:!1})}createStrokeGraphics(){const{stroke:t}=this.json,e=t!=null&&t.key?{fillType:"blipFill",src:t.key,filters:[]}:void 0;return new uo(this.ctx,e,(t==null?void 0:t.width)||0,(t==null?void 0:t.height)||0,{useFilter:!1,useSlideBackgroundFill:!1})}createTextFill(){const{isHorz:t,fill:e,lineWidth:n,lineHeight:r,fillLineHeight:o}=this.json;return t?new uo(this.ctx,e==null?void 0:e.fill,n,Math.max(o,r),{useFilter:!1,useSlideBackgroundFill:!1}):new uo(this.ctx,e==null?void 0:e.fill,o,r,{useFilter:!1,useSlideBackgroundFill:!1})}createTextGraphics(){var t;const{fill:e,content:n}=this.json;let r="#000000";((t=e==null?void 0:e.fill)===null||t===void 0?void 0:t.fillType)==="solidFill"&&(r=e.fill.color);const o=e!=null&&e.key?{fillType:"blipFill",src:e.key,filters:[{type:"changeBulletColor",args:["#000000",r]}]}:void 0;return new uo(this.ctx,o,(e==null?void 0:e.width)||0,(e==null?void 0:e.height)||0,{useFilter:n==="\u25FE",useSlideBackgroundFill:!1})}getIterateEntry(){return null}getBgElement(){return null}updateTransform(t){var e,n,r,o;const{isHorz:s}=this.json;t.position={x:s&&(n=(e=t.position)===null||e===void 0?void 0:e.x)!==null&&n!==void 0?n:0,y:s?0:(o=(r=t.position)===null||r===void 0?void 0:r.y)!==null&&o!==void 0?o:0},t.width=s?this.json.width:this.json.lineWidth,t.height=s?this.json.lineHeight:this.json.height,super.updateTransform(t)}preRender(){var t;(t=this.underline)===null||t===void 0||t.preRender()}render(t){t.addSubMTask(()=>v1(this,void 0,void 0,function*(){this.doRender()}),"@TextUnitImpl[doRender]")}doRender(){let t=!1;const{lineWidth:e,lineHeight:n,baseLine:r,isHorz:o,underline:s,height:a,width:h,highlightColor:l,x:u,y:p,content:y,fillLineHeight:x,fill:E}=this.json;let A=this.json.needFill!==!1;if(E&&E.fill&&E.fill.fillType!=="solidFill"&&(A=!0),l){const C=new qi,[W,Q]=Om(l);C.beginFill(W,Q),C.drawRect(0,0,o?h:e,o?n:a),C.endFill(),this.textureContainer.addChild(C)}if(this.textGraphics.displayObject){const C=this.textGraphics.displayObject;if(o&&(C.position.y=p>0?p:0),A){const W=this.textFill.displayObject;if(W)W.mask=C,W.addChild(C),W.position.x=-u,C.position.x+=u,t=!0,this.textureContainer.addChild(W);else if(this.textFill.isSolidFill()){const Q=new ls;Q.color=this.textFill.getSolidFillColor(),C.filters=[Q],t=!0,this.textureContainer.addChild(C)}}else this.textureContainer.addChild(C)}if(this.strokeGraphics.displayObject){const C=this.strokeGraphics.displayObject;if(A){const W=this.strokeFill.displayObject;if(W)W.mask=C,W.addChild(C),o?W.position.y=p>0?p:0:W.position.x=u,this.textureContainer.addChild(W);else if(this.strokeFill.isSolidFill()){o?C.position.y=p>0?p:0:C.position.x=u;const Q=new ls;Q.color=this.strokeFill.getSolidFillColor(),C.filters=[Q],t=!0,this.textureContainer.addChild(C)}}else o?C.position.y=p>0?p:0:C.position.x=u,this.textureContainer.addChild(C)}if(this.underline&&(this.underline.render(),this.underline.sprite)){o?(this.underline.sprite.position.y=s?s-n/16:r,this.underline.sprite.position.x=0):(this.underline.sprite.position.x=0,this.underline.sprite.position.y=0);const C=this.textFill.getClonedDisplayObject();C?(C.mask=this.underline.sprite,C.addChild(this.underline.sprite),this.textureContainer.addChild(C)):this.textureContainer.addChild(this.underline.sprite)}if(t){const C=ce.p.create({width:o?h:e,height:o?Math.max(x,n):a,resolution:this.ctx.renderer.resolution});this.ctx.renderer.render(this.textureContainer,{renderTexture:C}),this.cacheSprite.texture=C,o&&p<0&&(this.cacheSprite.position.y=p),this.container.addChild(this.cacheSprite)}else this.container.addChild(this.textureContainer);this.container.name=y}destroy(){this.textFill.destroy(),this.textGraphics.destroy(),this.strokeFill.destroy(),this.strokeGraphics.destroy(),this.cacheSprite.texture.destroy(!0),this.cacheSprite.destroy(),this.textureContainer.destroy(),this.container.destroy()}}var zm=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};class y1 extends Xu{constructor(){super(...arguments),this.units=[],this.isHorz=!0,this.hyperLinkMap=new Map,this.hyperLinkContainerMap=new Map}getIterateElements(){return this.units}getIterateEntry(t,e,n){return this.units[e]?this.units[e]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null)}preRender(){}createUnits(t,e,n,r){for(let o=0,s=this.json.textUnits.length;o<s;o++)r.addSubMTask(()=>zm(this,void 0,void 0,function*(){var a;const h=this.json.textUnits[o],{height:l,width:u,fillHeight:p,baseline:y,y:x,underline:E}=this.json,A=new _1(Object.assign(Object.assign({},h),{lineHeight:l,lineWidth:u,baseLine:y-x,underline:E,fillLineHeight:p||l,isHorz:this.isHorz,shapeId:t,paragraphIndex:e,lineIndex:n,unitIndex:o}),this.ctx,this.global);if(A.preRender(),this.units.push(A),h.hyperlink||h.hlinkHover){const C=h.hyperlink?"click-"+JSON.stringify({action:h.hyperlink.action,target:h.hyperlink.target}):"hover-"+JSON.stringify({action:h.hlinkHover.action,target:h.hlinkHover.target}),W=this.hyperLinkContainerMap.has(C),Q=(a=this.hyperLinkContainerMap.get(C))!==null&&a!==void 0?a:new Cn.b;Q.name=C,Q.hitArea=new De.j(0,0,this.json.width,this.json.height);const rt=this.hyperLinkMap.get(C)||new Pm(this.container,this.ctx),pt=new qi;pt.beginFill(0,1e-5).drawRect(h.x,h.y,h.width,h.height).endFill(),Q.addChild(pt),W||(h.hyperlink&&rt.addAction(h.hyperlink,"click"),h.hlinkHover&&rt.addAction(h.hlinkHover,"hover"),rt.addProxy(Q),Q.zIndex=999,this.container.addChild(Q),this.container.sortableChildren=!0,this.hyperLinkContainerMap.set(C,Q),this.hyperLinkMap.set(C,rt))}}),"@TextLineImpl[createUnits]")}render(t){for(const e of this.units.reverse())e.render(t),t.addSubMTask(()=>zm(this,void 0,void 0,function*(){this.container.addChild(e.container)}),"@TextLineImpl[container.addChild]")}destroy(){this.units.forEach(t=>{t.destroy()}),this.container.destroy({children:!1}),this.hyperLinkMap.clear();for(const t of this.hyperLinkContainerMap.values())t.destroy({children:!0,baseTexture:!0,texture:!0});this.hyperLinkContainerMap.clear()}}var Vm=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};class x1 extends Xu{constructor(){super(...arguments),this.iterateElements=[],this.lines=[],this.isHorz=!0}getIterateElements(){if(this.iterateElements.length>0)return this.iterateElements;const t=this.lines.reduce((e,n)=>e=e.concat(n.getIterateElements()),[]);return this.iterateElements=t,t}getIterateEntry(t,e,n){const r=this.getIterateElements();return r[e]?r[e]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null)}preRender(){}createLines(t,e,n){for(let r=0,o=this.json.lines.length;r<o;r++)n.addSubMTask(()=>Vm(this,void 0,void 0,function*(){const s=this.json.lines[r],a=new y1(s,this.ctx,this.global);a.isHorz=this.isHorz,a.container.name="line-"+r,a.createUnits(t,e,r,n),this.lines.push(a)}),"@TextParagraphImpl[createLines]")}render(t){for(const e of this.lines)e.render(t),t.addSubMTask(()=>Vm(this,void 0,void 0,function*(){this.container.addChild(e.container)}),"@TextParagraphImpl[container.addChild]")}destroy(){this.lines.forEach(t=>{t.destroy()}),this.container.destroy({children:!1})}}function b1(i,t,e){let n,r;const o=Math.round(i)%360;if(o%180==0)n=Math.cos(o*(Math.PI/180))*t,r=0;else if(o%90==0)n=0,r=-Math.sin(o*(Math.PI/180))*e;else{const s=Math.tan(o*Math.PI/180);n=t*e/Math.sqrt(Math.pow(e,2)+Math.pow(t*s,2)),(o>90&&o<270||o<-90&&o>-270)&&(n=-n),r=-s*n}return{x:n,y:r}}function T1(i,t,e,n,r,o){const s=b1((r=-r)/Math.PI*180,e,n),a=i.x-s.x,h=i.y-s.y;return{centerX:a/9525*t.x,centerY:h/9525*t.y,rx:e/9525*t.x,ry:n/9525*t.y,st:-r,end:-r+o,aClockWise:o<0}}function Wm(i){const t=new Ps,{scale:e}=i;let n={x:0,y:0};const r=i.path.trim().split(" ");for(let o=0;o<r.length;o+=2){const s=r[o],a=r[o+1];if(s==="M"){let[h,l]=a.split(",").map(u=>Number(u));n={x:h,y:l},h=h/9525*e.x,l=l/9525*e.y,t.moveTo(h,l)}else if(s==="A"){const[h,l,u,p]=a.split(",").map(rt=>Number(rt)),{centerX:y,centerY:x,rx:E,ry:A,st:C,end:W,aClockWise:Q}=T1(n,e,h,l,u,p);t.absellipse(y,x,E,A,C,W,Q,0)}else if(s==="L"){let[h,l]=a.split(",").map(u=>Number(u));n={x:h,y:l},h=h/9525*e.x,l=l/9525*e.y,t.lineTo(h,l)}else if(s==="QB"){let[h,l,u,p]=a.split(",").map(y=>Number(y));n={x:u,y:p},h=h/9525*e.x,l=l/9525*e.y,u=u/9525*e.x,p=p/9525*e.y,t.quadraticCurveTo(h,l,u,p)}else if(s==="CB"){let[h,l,u,p,y,x]=a.split(",").map(E=>Number(E));n={x:y,y:x},h=h/9525*e.x,l=l/9525*e.y,u=u/9525*e.x,p=p/9525*e.y,y=y/9525*e.x,x=x/9525*e.y,t.bezierCurveTo(h,l,u,p,y,x)}else if(s==="C")try{t.closePath()}catch{}}return t}function Bn(i,t){return i.curves.map(e=>e.getPoints(t)).reduce((e,n)=>e.concat(n),[])}const Ku={textCirclePour:{top:i=>i.getPoints(360),bottom:i=>i.getPoints(360)},textStop:{top:i=>Bn(i,100),bottom:i=>Bn(i,100)},textPlain:{top:i=>Bn(i,100),bottom:i=>Bn(i,100)},textTriangle:{top:i=>Bn(i,50),bottom:i=>Bn(i,101)},textTriangleInverted:{bottom:i=>Bn(i,50),top:i=>Bn(i,101)},textChevron:{bottom:i=>Bn(i,50),top:i=>Bn(i,50)},textChevronInverted:{bottom:i=>Bn(i,50),top:i=>Bn(i,50)},textRingInside:{top:i=>i.getPoints(360),bottom:i=>i.getPoints(360)},textRingOutside:{top:i=>i.getPoints(360),bottom:i=>i.getPoints(360)},textArchUpPour:{top:i=>i.getPoints(360),bottom:i=>i.getPoints(360)},textArchDownPour:{top:i=>i.getPoints(360),bottom:i=>i.getPoints(360)},textCurveUp:{top:i=>i.getPoints(360),bottom:i=>i.getPoints(360)},textCurveDown:{top:i=>i.getPoints(360),bottom:i=>i.getPoints(360)},textCanUp:{top:i=>i.getPoints(360),bottom:i=>i.getPoints(360)},textCanDown:{top:i=>i.getPoints(360),bottom:i=>i.getPoints(360)},textWave1:{top:i=>i.getPoints(180),bottom:i=>i.getPoints(180)},textWave2:{top:i=>i.getPoints(180),bottom:i=>i.getPoints(180)},textDoubleWave1:{top:i=>i.getPoints(360),bottom:i=>i.getPoints(360)},textWave4:{top:i=>i.getPoints(360),bottom:i=>i.getPoints(360)},textInflate:{top:i=>i.getPoints(180),bottom:i=>i.getPoints(180)},textDeflate:{top:i=>i.getPoints(180),bottom:i=>i.getPoints(180)},textInflateBottom:{top:i=>Bn(i,180),bottom:i=>i.getPoints(180)},textDeflateBottom:{top:i=>Bn(i,180),bottom:i=>i.getPoints(180)},textInflateTop:{bottom:i=>Bn(i,180),top:i=>i.getPoints(180)},textDeflateTop:{bottom:i=>Bn(i,180),top:i=>i.getPoints(180)},textFadeRight:{bottom:i=>Bn(i,180),top:i=>Bn(i,180)},textFadeLeft:{bottom:i=>Bn(i,180),top:i=>Bn(i,180)},textFadeUp:{bottom:i=>Bn(i,180),top:i=>Bn(i,180)},textFadeDown:{bottom:i=>Bn(i,180),top:i=>Bn(i,180)},textSlantUp:{bottom:i=>Bn(i,180),top:i=>Bn(i,180)},textSlantDown:{bottom:i=>Bn(i,180),top:i=>Bn(i,180)},textCascadeUp:{bottom:i=>Bn(i,180),top:i=>Bn(i,180)},textCascadeDown:{bottom:i=>Bn(i,180),top:i=>Bn(i,180)},textArchUp:{bottom:i=>Bn(i,180),top:i=>Bn(i,180)},textArchDown:{bottom:i=>Bn(i,180),top:i=>Bn(i,180)},textCircle:{bottom:i=>Bn(i,180),top:i=>Bn(i,180)}};function E1(i,t,e,n,r){const o=i.trim().split(" "),[s,a]=o[1].split(",").map(Q=>parseFloat(Q)),[h,l,u,p]=o[3].split(",").map(Q=>parseFloat(Q)),y=function(Q,rt,pt,it,gt,ht){const ft=Math.abs(ht*Math.sqrt((pt*pt+it*it)/2)),jt=Math.ceil(ft/9525/10);let Lt=0,At=gt,Rt={x:Q+pt*Math.cos(At),y:rt+it*Math.sin(At)};for(let Nt=0;Nt<jt;Nt+=1){At+=ht/jt;const Ot={x:Q+pt*Math.cos(At),y:rt+it*Math.sin(At)};Lt+=Math.sqrt(Math.pow(Ot.x-Rt.x,2)+Math.pow(Ot.y-Rt.y,2)),Rt=Ot}return Lt}(s,a,h,l,u,p);r*=Math.min(1,y/9525/n);const x=new De.d;x.translate(r+t/2,0),x.rotate(2*Math.PI-u);const E=new De.g(0,0),A=x.apply(E);A.x+=t/2,A.y=e/2-A.y;const C=h+9525*r,W=l+9525*r;return`M ${9525*A.x},${9525*A.y} A ${C},${W},${u},${p}`}var Oa=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};class S1{constructor(t,e,n,r,o){this.iterateElements=[],this.paragraphs=[],this.container=new Cn.b,this.textContainer=new Cn.b,this.textColorFilter=new ls,this.json=t,this.ctx=e,this.shapeRotation=o,this.parentGlobalPos=r,this.iterateType=n,this.container.name="textBody",this.global={x:this.parentGlobalPos.x+t.position.x,y:this.parentGlobalPos.y+t.position.y},this.container.position.x=t.position.x,this.container.position.y=t.position.y,this.container.scale.x=t.scale.x,this.container.scale.y=t.scale.y;const s=new qi;s.drawRect(0,0,t.width,t.height),this.container.addChild(s),this.container.addChild(this.textContainer),this.textColorFilter.currentColor="#000000FF",this.textColorFilter.designColor="#000000FF"}get width(){return this.json.width}get height(){return this.json.height}get x(){return this.json.position.x}get y(){return this.json.position.y}set color(t){var e;((e=this.container.filters)!==null&&e!==void 0?e:[]).length>0&&(this.textColorFilter.color=t)}get color(){return this.textColorFilter.color}get on(){var t;return((t=this.container.filters)!==null&&t!==void 0?t:[]).length>0?"true":"false"}set on(t){var e;t==="true"?((e=this.container.filters)!==null&&e!==void 0?e:[]).indexOf(this.textColorFilter)<0&&(this.container.filters=[this.textColorFilter]):this.container.filters=[]}getTextElement(t,e){return t==="paragraph"?this.paragraphs[e[0]]:null}getIterateEntry(t,e){return this.iterateElements[t]?this.iterateElements[t]:(this.ctx.eventHub.emit("IterateTimeNodeEnd",e),null)}destroy(){this.paragraphs.forEach(t=>{t.destroy()}),this.textColorFilter.destroy()}createParagraphs(t,e){for(let n=0,r=this.json.paragraphs.length;n<r;n++)e.addSubMTask(()=>Oa(this,void 0,void 0,function*(){var o;const s=this.json.paragraphs[n],a=new x1(s,this.ctx,this.global);a.isHorz=(o=this.json.isHorz)===null||o===void 0||o,a.createLines(t,n,e),e.addSubMTask(()=>Oa(this,void 0,void 0,function*(){this.iterateElements=this.iterateElements.concat(a.getIterateElements()),a.container.name="\u6BB5\u843D-"+n,this.paragraphs.push(a)}),"@TextBodyImpl[paragraphs.push]")}),"@TextBodyImpl[createParagraphs]")}render(t){for(const e of this.paragraphs)e.render(t),t.addSubMTask(()=>Oa(this,void 0,void 0,function*(){this.textContainer.addChild(e.container)}),"@TextBodyImpl[container.addChild]");t.addSubMTask(()=>Oa(this,void 0,void 0,function*(){const{width:e}=this.container;this.container.scale.x<0&&(this.container.x+=-1*e)}),"@TextBodyImpl[reset width]"),t.addSubMTask(()=>Oa(this,void 0,void 0,function*(){if(this.json.presetTextShape){const e=this.json.paragraphs.map(l=>l.x).reduce((l,u)=>Math.min(l,u)),n=this.json.paragraphs[0].y,r=this.textContainer.getBounds(),{width:o,height:s}=r,{geometry:a,type:h}=this.json.presetTextShape;if(a.paths){const l=ce.p.create({width:o,height:s,resolution:this.ctx.renderer.resolution}),u=new De.d;u.translate(-e,-n),this.ctx.renderer.render(this.textContainer,{renderTexture:l,transform:u});const p=this.json.isHorz!==void 0&&!this.json.isHorz;if(["textCircle","textArchUp","textArchDown"].indexOf(this.json.presetTextShape.type)>=0){const x=E1(a.paths[0].path,this.json.width,this.json.height,o,s);a.paths.unshift(Object.assign(Object.assign({},a.paths[0]),{path:x}))}const y=function(x,E,A,C){if(!Ku[A])return null;const W=Ku[A].top(Wm(E)),Q=Ku[A].bottom(Wm(x));if(W.length!==Q.length)return null;const rt=Math.min(W.length,Q.length),pt=1/(rt-1),it=[],gt=[],ht=new Array(2*rt).fill("").map((ft,jt)=>jt);for(let ft=0;ft<rt;ft++)it.push(W[ft].x,W[ft].y),C?gt.push(1,pt*ft):gt.push(pt*ft,0),it.push(Q[ft].x,Q[ft].y),C?gt.push(0,pt*ft):gt.push(pt*ft,1);return{vertices:new Float32Array(it),uvs:new Float32Array(gt),drawMode:gn.f.TRIANGLE_STRIP,indices:new Uint16Array(ht)}}(a.paths[1],a.paths[0],h,p);if(y){const x=new Sb.b(l,y.vertices,y.uvs,y.indices,y.drawMode);this.textContainer.visible=!1,this.container.addChild(x)}}}}),"presetTextShape")}}class w1{constructor(t){this.scaleX=1,this.scaleY=1,this.pivot={x:0,y:0},this.paths=[],this.hash="",this.width=0,this.height=0,this.graphicsId="",this.textureId="",this.id=t.id,this.type=t.type,this.heightSize=t.heightSize,this.widthSize=t.widthSize,this.fillStyle=t.fillStyle||{fillType:"solidFill",color:"#ffffffff"},this.lineWidth=t.lineWidth||1,this.position=t.position||{x:0,y:0},this.rotate=t.rotation||1,this.path=this.getUnitPath(),this.setScaleFromLineWidth(),this.setScaleFromSize(),this.generatePaths(),this.setPivot()}setPivot(){switch(this.type){case"oval":case"diamond":this.pivot={x:this.width/2,y:this.height/2};break;case"triangle":this.pivot={x:.7*this.width,y:this.height/2};break;case"arrow":case"stealth":default:this.pivot={x:this.width,y:this.height/2}}}generatePaths(){this.hash="arrow-"+Jl()(this.path+this.scaleX+this.scaleY),this.paths=[{id:this.id,path:this.path,fill:"norm",hasStroke:!1,hash:this.hash,scale:{x:this.scaleX,y:this.scaleY}}]}getUnitPath(){switch(this.type){case"stealth":return"M 0,0 L 95250,47625 L 0,95250 L 28575,47625 C C";case"oval":return"M 0,47625 A 47625,47625,-3.14159265,6.2831853 C C";case"diamond":return"M 47625,0 L 95250,47625 L 47625,95250 L 0,47625 C C";case"arrow":return"M 9525,0 L 95250,47625 L 9525,95250 L 0,85725 L 68389.5,47625 L 0,9525 C C";case"triangle":return"M 0,0 L 95250,47625 L 0,95250 C C";default:return""}}setScaleFromLineWidth(){switch(this.type){case"stealth":case"oval":case"diamond":case"arrow":case"triangle":this.scaleX*=.29*this.lineWidth+.7,this.scaleY*=.29*this.lineWidth+.7;break;default:throw new Error("can't match any arrow type!")}}setScaleFromSize(){switch(this.type){case"stealth":case"oval":case"diamond":case"arrow":case"triangle":this.scaleX*=1,this.scaleY*=1;break;default:throw new Error("can't match any arrow type!")}switch(this.widthSize){case"sm":this.scaleX*=3/4;break;case"lg":this.scaleX*=1.25;break;case"med":this.scaleX*=1}switch(this.heightSize){case"sm":this.scaleY*=3/4;break;case"lg":this.scaleY*=1.25;break;case"med":this.scaleY*=1}this.width=10*this.scaleX,this.height=10*this.scaleY}}class Zu{constructor(t,e,n,r,o,s,a,h,l,u,p){this.id=t,this.ctx=e,this.paths=n,this.hash=r,this.nept=o,this.width=s,this.height=a,this.lineStyle=h,this.shouldFill=l,this.bgColor=u,this.lnColor=p,this.clonedObjects=[],this._displayObject=null,this.isRectangle=!1,this.isPureRect=!1,this.isColoredPureRect=!1,this.isRectangle=this.rectangleDetect(n),this.isRectangle&&l?this.bgColor?this.isColoredPureRect=!0:this.isPureRect=!0:this.ctx.graphicsTexture.addGraphics(this.id,this.paths,this.hash,this.nept,this.width,this.height,this.lineStyle,this.ctx.objectPoolGroup,this.shouldFill,this.bgColor,this.lnColor)}get displayObject(){return this._displayObject}pointDis(t,e){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)}rectangleDetect(t){if(t.length!==1)return!1;const e=t[0].path.trim().split(" ");if(e.length!==10)return!1;const n=[],r=[];for(let h=0;h<e.length;h+=2){const l=e[h],u=e[h+1],[p,y]=u.split(",").map(x=>Number(x)/100);n.push(l),r.push({x:p,y})}if(n.join("")!=="MLLLC")return!1;for(let h=0;h<3;h++){const l=r[h],u=r[h+1];if(l.x!==u.x&&l.y!==u.y)return!1}const o=r.slice(0,4).reduce((h,l)=>h+l.x,0)/4,s=r.slice(0,4).reduce((h,l)=>h+l.y,0)/4;if(Number.isNaN(o)||Number.isNaN(s))return!1;const a={x:o,y:s};return xr(this.pointDis(a,r[0]),this.pointDis(a,r[1]))&&xr(this.pointDis(a,r[0]),this.pointDis(a,r[2]))&&xr(this.pointDis(a,r[0]),this.pointDis(a,r[3]))&&this.pointDis(a,r[0])===this.pointDis(a,r[1])}createDisplayObject(){if(this.isPureRect){const t=new qi;return t.beginFill(0,1),t.drawRect(0,0,this.width,this.height),t}if(this.isColoredPureRect&&this.bgColor){const t=new qi,[e,n]=Om(this.bgColor);return t.beginFill(e,n),t.drawRect(0,0,this.width,this.height),t}{const t=new di,e=this.ctx.graphicsTexture.getGraphicsData(this.id);return e?(t.texture=e.texture,t.pivot.x=e.pivot.x,t.pivot.y=e.pivot.y,t):null}}getClonedDisplayObject(){const t=this.createDisplayObject();return this.clonedObjects.push(t),t}render(){this._displayObject=this.createDisplayObject()}isNeedMask(t,e){let n=!1;return this._displayObject&&(n=!(this.isRectangle&&Math.abs(t-this._displayObject.width)<2&&Math.abs(e-this._displayObject.height)<2&&this.shouldFill)),n}addArrows(t){var e;(e=this._displayObject)===null||e===void 0||e.addChild(t)}destroy(){var t;(t=this._displayObject)===null||t===void 0||t.destroy(),this._displayObject=null,this.clonedObjects.forEach(e=>{e==null||e.destroy()}),this.clonedObjects=[]}}class Qu extends ce.k{}var A1=v(113),M1=v.n(A1),C1=v(114),R1=v.n(C1);class I1 extends Qu{constructor(t){super(M1.a,R1.a,{uShapeFilterArea:new Float32Array([0,0,0,0]),uGlowColor:br(t.color),uSdfSampler:ce.t.WHITE,uSdfReady:0,uSdfMaxDis:0,uRad:t.rad/2,uSdfPosition:new Float32Array([0,0])}),this.priority=3,this.json=t}filterAreaJustify(t){const e=Math.ceil(this.json.rad),n=Math.ceil(t.width+2*e),r=Math.ceil(t.height+2*e);return new De.j(t.x-e,t.y-e,n,r)}sdfBox(t,e){const n=Math.ceil(this.json.rad),r=Math.ceil(t+2*n),o=Math.ceil(e+2*n);return new De.j(n,n,r,o)}}var P1=v(19),eh=v.n(P1),O1=v(115),N1=v.n(O1);class L1 extends Qu{constructor(t){super(eh.a,N1.a,{uShapeFilterArea:new Float32Array([0,0,0,0]),uRad:t.rad,uSdfSampler:ce.t.WHITE,uSdfReady:0,uSdfMaxDis:1}),this.priority=2,this.json=t}filterAreaJustify(t){return t}sdfBox(t,e){return new De.j(0,0,t,e)}}class Xm{}var D1=v(116),F1=v.n(D1);class B1 extends ce.k{constructor(t){super(eh.a,F1.a,{uColor:br(t)})}}class U1 extends Xm{constructor(t,e,n){super(),this.order=1,this.outputTexture=ce.t.WHITE,this.frameTextures=[],this.json=t,this.effectContainer=e,this.outputSprite=new di,this.targetScale=n,this.outputSprite.scale.x=this.json.sx,this.outputSprite.scale.y=this.json.sy,this.outputSprite.skew.x=(this.targetScale.x>0?1:-1)*this.json.kx,this.outputSprite.skew.y=(this.targetScale.y>0?1:-1)*this.json.ky,this.outputSprite.filters=[new Hs.BlurFilter(this.json.blurRad/2,4),new B1(this.json.color)]}updateFrame(t){const e=this.frameTextures[t];if(e){const n=this.effectContainer.getBounds(),r=(this.effectContainer.width-e.width)/2,o=(this.effectContainer.height-e.height)/2,s=new De.g(n.x,n.y),a=new De.g(n.x,n.y);switch(this.json.align){case"tl":a.x=n.x,a.y=n.y;break;case"t":a.x=n.x+n.width/2,a.y=n.y,s.x+=n.width/2;break;case"tr":a.x=n.x+n.width,a.y=n.y,s.x+=n.width;break;case"l":a.x=n.x,a.y=n.y+n.height/2,s.y+=n.height/2;break;case"ctr":a.x=n.x+n.width/2,a.y=n.y+n.height/2,s.x+=n.width/2,s.y+=n.height/2;break;case"r":a.x=n.x+n.width,a.y=n.y+n.height/2,s.x+=n.width,s.y+=n.height/2;break;case"bl":a.x=n.x,a.y=n.y+n.height,s.y+=n.height;break;case"b":a.x=n.x+n.width/2,a.y=n.y+n.height,s.x+=n.width/2,s.y+=n.height;break;case"br":a.x=n.x+n.width,a.y=n.y+n.height,s.x+=n.width,s.y+=n.height}const h=this.effectContainer.toLocal(a);this.outputSprite.pivot.x=h.x,this.outputSprite.pivot.y=h.y;const l=new De.g(this.json.dist,0),u=new De.d;u.rotate(this.json.dir),u.translate(s.x+r,s.y+o),u.apply({x:l.x,y:l.y},l);const p=this.effectContainer.toLocal(l);this.outputSprite.position.x=p.x,this.outputSprite.position.y=p.y,this.outputSprite.texture=e}}createOutput(t,e){this.frameTextures[e]=t}setFrameOffset(t,e){console.log(t,e)}}var k1=v(117),G1=v.n(k1);class H1 extends ce.k{constructor(t,e){super(eh.a,G1.a,{uStartAlpha:t.startAlpha,uEndAlpha:t.endAlpha,uStartPos:t.startPos,uEndPos:t.endPos,uHeight:e}),console.log(this)}}class j1 extends Xm{constructor(t,e,n,r,o){super(),this.order=2,this.outputSprite=new di,this.outputTexture=ce.t.WHITE,this.frameTextures=[],this.json=t,this.shapeScaleX=r,this.effectContainer=e,this.rotation=n,this.ctx=o,this.outputSprite.anchor.x=.5,this.outputSprite.anchor.y=.5;const s=this.effectContainer.getBounds();this.outputSprite.filters=[new Hs.BlurFilter(this.json.blurRad/2,4),new H1(this.json,s.height)],this.outputSprite.alpha=.5,this.outputSprite.rotation=this.shapeScaleX===-1?Math.PI+2*this.rotation:Math.PI-2*this.rotation,this.outputSprite.scale.x=-1}updateFrame(t){const e=this.frameTextures[t];e&&(this.outputSprite.texture=e)}createOutput(t,e){this.frameTextures[e]=t}setFrameOffset(t,e){const n=this.effectContainer.getBounds(),r=new De.g(n.x+n.width/2,n.y+n.height/2),o=new De.g(r.x,r.y+n.height+this.json.dist),s=this.effectContainer.toLocal(o);this.outputSprite.position.x=s.x+t,this.outputSprite.position.y=s.y+e}}var z1=v(118),V1=v.n(z1);class W1 extends Qu{constructor(t){super(eh.a,V1.a,{}),this.priority=1,this.json=t}filterAreaJustify(t){return t}sdfBox(){return null}}var Ym=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};class X1 extends yi.a{constructor(t,e,n,r,o,s){super(),this.effects=[],this.attachs=[],this.frames=new Map,this._targetContainer=new Cn.b,this.frameCount=1,this.ctx=r,this.originWidth=t.width,this.originHeight=t.height,this.cacheKey=n,this.sourceSprite=new di;for(const x of e)switch(x.type){case"innerShadow":this.effects.push(new W1(x));break;case"softEdge":this.effects.push(new L1(x));break;case"glow":this.effects.push(new I1(x));break;case"reflection":this.attachs.push(new j1(x,t,o,s.x,this.ctx));break;case"outerShadow":this.attachs.push(new U1(x,t,s))}this.effects=this.effects.sort((x,E)=>x.priority-E.priority),this.attachs=this.attachs.sort((x,E)=>x.order-E.order);for(const x of this.attachs)this._targetContainer.addChild(x.outputSprite);this.sourceSprite.name="effect-sprite";const a=new De.j(0,0,this.originWidth,this.originHeight),h=this.effects.map(x=>x.filterAreaJustify(a)),l=h.map(x=>x.x),u=h.map(x=>x.y),p=h.map(x=>x.width),y=h.map(x=>x.height);this.filterArea=new De.j(Math.min(...l,0),Math.min(...u,0),Math.max(...p,this.originWidth),Math.max(...y,this.originHeight)),this.sourceSprite.filters=this.effects,this.sourceSprite.filterArea=new De.j(0,0,this.filterArea.width,this.filterArea.height),this._targetSprite=new di,this._targetSprite.name="effect-sprite",this._targetContainer.sortableChildren=!0,this._targetSprite.zIndex=999,this._targetContainer.addChild(this._targetSprite)}get container(){return this._targetContainer}getSdfTexture(t,e){return Ym(this,void 0,void 0,function*(){const n=`${this.cacheKey}_${t}`,r=this.effects.map(o=>({sdfRect:o.sdfBox(e.width,e.height)})).reduce((o,s)=>(s.sdfRect&&(o.width<s.sdfRect.width&&(o.width=s.sdfRect.width),o.height<s.sdfRect.height&&(o.height=s.sdfRect.height)),o),new De.j(0,0));return r.width===0||r.height===0?null:this.ctx.sdfManager.getSdf(e,r,n)})}setFrameCount(t){this.frameCount=t}updateFrame(t){const e=this.frames.get(t);if(e){this._targetSprite.texture=e.texture,this._targetSprite.pivot.x=e.pivotX,this._targetSprite.pivot.y=e.pivotY;for(const n of this.attachs)n.updateFrame(t)}}hasFrame(t){return this.frames.has(t)}setFrameOffset(t,e){this._targetContainer.position.x=-1*t,this._targetContainer.position.y=-1*e,this.attachs.forEach(n=>n.setFrameOffset(t,e))}createFrame(t,e){var n,r;return Ym(this,void 0,void 0,function*(){const o=e.width,s=e.height;if(this.frames.has(t))return;const a=yield this.getSdfTexture(t,e),h=(n=a==null?void 0:a.texture.width)!==null&&n!==void 0?n:0,l=(r=a==null?void 0:a.texture.height)!==null&&r!==void 0?r:0;for(const A of this.effects){const C=A.sdfBox(e.width,e.height);C&&a&&(A.uniforms.uSdfSampler=a.texture,A.uniforms.uSdfIsReady=1,A.uniforms.uSdfMaxDis=a.maxDis,A.uniforms.uSdfPosition=new Float32Array([(a.texture.width-C.width)/2/a.texture.width,(a.texture.height-C.height)/2/a.texture.height])),A.uniforms.uShapeFilterArea=new Float32Array([0,0,this.filterArea.width,this.filterArea.height])}this.sourceSprite.texture=e;const u=(this.filterArea.width-this.sourceSprite.width)/2,p=(this.filterArea.height-this.sourceSprite.height)/2;this.sourceSprite.x=u,this.sourceSprite.y=p;const y=Math.max(o,h,this.filterArea.width),x=Math.max(s,l,this.filterArea.height),E=ce.p.create({width:y,height:x,resolution:this.ctx.renderer.resolution});this.ctx.renderer.render(this.sourceSprite,{renderTexture:E}),this.frames.set(t,{texture:E,pivotX:-1*(this.originWidth-y)/2,pivotY:-1*(this.originWidth-y)/2});for(const A of this.attachs)A.createOutput(E,t);Array.from(this.frames.keys()).length===this.frameCount&&this.emit("ready")})}}var nh=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};const hs={pivot:{x:0,y:0},width:0,height:0};class qm extends Wu{constructor(t,e,n,r){var o,s,a,h,l,u,p,y,x;super(t,e,n),this.renderContainer=new Cn.b,this.needCacheAsBitMap=!1,this.backgroundGraphics=null,this.effectList=[],this.strokeGraphics=null,this.ghco=null,this.arrowList=[],this.fillColorFilter=new ls,this.strokeColorFilter=new ls,this.pptColorFilter=new ls,this.id="",this.ppt_c=new Yb(this),this.fill=new Im(this),this.stroke=new Wb(this),this.effectObject=null,this.effectContainer=new Cn.b,this.effectDisposer=()=>{},this.json=t,this.json.fillStyle&&this.json.fillStyle.fillType==="groupFill"&&r&&(this.json.fillStyle=r),this.id=t.id;const{fillStyle:E,lineStyle:A}=this.json;this.container.sortableChildren=!0,this.container.name=t.id+"_container_[Shape]",this.effectContainer.name="effect-container",this.effectContainer.zIndex=1,this.container.addChild(this.effectContainer),this.renderContainer.name=t.id+"_render_container_[Shape]",this.generateArrowList(),this.backgroundFill=this.createBackgroundFill(),this.backgroundGraphics=this.createBackgroundGraphics(),this.strokeFill=this.createStrokeFill(),this.strokeGraphics=this.createStrokeGraphics();try{this.ghco=new Zu(this.json.id+"-path-graphics-text-wrap",this.ctx,(a=(s=(o=this.json.textBody)===null||o===void 0?void 0:o.presetTextShape)===null||s===void 0?void 0:s.geometry.paths)!==null&&a!==void 0?a:[],(u=(l=(h=this.json.textBody)===null||h===void 0?void 0:h.presetTextShape)===null||l===void 0?void 0:l.geometry.hash)!==null&&u!==void 0?u:"",{x:0,y:0},((p=this.json.textBody)===null||p===void 0?void 0:p.width)||100,((y=this.json.textBody)===null||y===void 0?void 0:y.height)||100,{width:2,fill:{fillType:"solidFill",color:"#FF0000FF"}},!1,null,null)}catch(C){this.ctx.logger.error(C.message,this.ctx.taskId)}this.ctx.timingTargets.addTarget(this.id,this),(E==null?void 0:E.fillType)==="solidFill"&&(this.fillColorFilter.currentColor=E.color,this.fillColorFilter.designColor=E.color),((x=A==null?void 0:A.fill)===null||x===void 0?void 0:x.fillType)==="solidFill"&&(this.strokeColorFilter.currentColor=A.fill.color,this.strokeColorFilter.designColor=A.fill.color),this.updateTransform(this.json),t.textBody&&(this.text=new S1(t.textBody,this.ctx,t.textBody.iterateType,{x:this.designGlobalPosition.x,y:this.designGlobalPosition.y},this.json.rotation||0)),this.container.hitArea=new De.k(1,1,this.json.width,this.json.height),this.ctx.slideScopeEventHub.once("slide-render",C=>{if(this.ctx.slideIndex===C&&this.effectObject){const W=this.getEffectTexture();if(W){const{texture:Q,offsetX:rt,offsetY:pt}=W;this.effectObject.setFrameOffset(rt,pt),this.effectObject.createFrame(1,Q)}}})}get interactiveContainer(){return this.renderContainer}get strokeActive(){var t,e,n,r,o,s,a;return this.strokeFill.displayObject?((n=(e=(t=this.strokeFill.displayObject)===null||t===void 0?void 0:t.filters)===null||e===void 0?void 0:e.length)!==null&&n!==void 0?n:-1)>0:((a=(s=(o=(r=this.strokeGraphics)===null||r===void 0?void 0:r.displayObject)===null||o===void 0?void 0:o.filters)===null||s===void 0?void 0:s.length)!==null&&a!==void 0?a:-1)>0}set strokeActive(t){var e,n,r,o,s,a;const{displayObject:h}=this.strokeFill;t?h&&((n=(e=h.filters)===null||e===void 0?void 0:e.indexOf(this.strokeColorFilter))!==null&&n!==void 0?n:-1)<0?h.filters=[this.strokeColorFilter]:((r=this.strokeGraphics)===null||r===void 0?void 0:r.displayObject)&&((s=(o=this.strokeGraphics.displayObject.filters)===null||o===void 0?void 0:o.indexOf(this.strokeColorFilter))!==null&&s!==void 0?s:-1)<0&&(this.strokeGraphics.displayObject.filters=[this.strokeColorFilter]):h?h.filters=[]:!((a=this.strokeGraphics)===null||a===void 0)&&a.displayObject&&(this.strokeGraphics.displayObject.filters=[])}get pptColorActive(){var t,e;return((e=(t=this.renderContainer.filters)===null||t===void 0?void 0:t.length)!==null&&e!==void 0?e:-1)>0}set pptColorActive(t){this.renderContainer.filters=t?[this.pptColorFilter]:[]}get fillActive(){var t,e,n,r,o,s,a;return this.backgroundFill.displayObject?((n=(e=(t=this.backgroundFill.displayObject)===null||t===void 0?void 0:t.filters)===null||e===void 0?void 0:e.length)!==null&&n!==void 0?n:-1)>0:((a=(s=(o=(r=this.backgroundGraphics)===null||r===void 0?void 0:r.displayObject)===null||o===void 0?void 0:o.filters)===null||s===void 0?void 0:s.length)!==null&&a!==void 0?a:-1)>0}set fillActive(t){var e,n,r,o,s,a;t?this.backgroundFill.displayObject&&((n=(e=this.backgroundFill.displayObject.filters)===null||e===void 0?void 0:e.indexOf(this.fillColorFilter))!==null&&n!==void 0?n:-1)<0?this.backgroundFill.displayObject.filters=[this.fillColorFilter]:((r=this.backgroundGraphics)===null||r===void 0?void 0:r.displayObject)&&((s=(o=this.backgroundGraphics.displayObject.filters)===null||o===void 0?void 0:o.indexOf(this.fillColorFilter))!==null&&s!==void 0?s:-1)<0&&(this.backgroundGraphics.displayObject.filters=[this.fillColorFilter]):this.backgroundFill.displayObject?this.backgroundFill.displayObject.filters=[]:!((a=this.backgroundGraphics)===null||a===void 0)&&a.displayObject&&(this.backgroundGraphics.displayObject.filters=[])}getTextElement(t,e){var n,r;return(r=(n=this.text)===null||n===void 0?void 0:n.getTextElement(t,e))!==null&&r!==void 0?r:null}getBgElement(){return this}getIterateEntry(t,e,n){return e===0?this:t==="el"?(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null):this.text?this.text.getIterateEntry(e-1,n)||null:(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null)}getEffectTexture(){const t=this.effectContainer.getLocalBounds();let e=0,n=0;for(const s of this.effectContainer.children)s.pivot.x>e&&(e=s.pivot.x),s.pivot.y>n&&(n=s.pivot.y);const r=new De.d;if(r.translate(e,n),this.effectContainer.children.length===0)return null;const o=ce.p.create({width:t.width,height:t.height,resolution:this.ctx.renderer.resolution});return this.ctx.renderer.render(this.effectContainer,{renderTexture:o,transform:r}),{texture:o,offsetX:e,offsetY:n}}createStrokeGraphics(){var t,e,n,r;const{id:o,geometry:s,lineStyle:a}=this.json,{width:h,height:l,pivot:u}=(s==null?void 0:s.lineTransform)||hs,p=h||this.json.width,y=l||this.json.height,x=((t=a==null?void 0:a.fill)===null||t===void 0?void 0:t.fillType)==="solidFill"?a.fill.color:null;return a&&((e=a.fill)===null||e===void 0?void 0:e.fillType)!=="noFill"?new Zu(o+"-path-graphics",this.ctx,(n=s==null?void 0:s.paths)!==null&&n!==void 0?n:[],(r=s==null?void 0:s.hash)!==null&&r!==void 0?r:"",u||{x:0,y:0},p,y,a,!1,null,x):null}createStrokeFill(){const[t,e]=this.calculateFillObjectOffset(),{geometry:n,lineStyle:r,width:o,height:s}=this.json,a=(n==null?void 0:n.lineTransform)||hs,h=as()(r==null?void 0:r.width)?r.width:1;return new uo(this.ctx,r==null?void 0:r.fill,(a.width||o)+h+t,Math.max((a.height||s)+h,e),{useFilter:!0,useSlideBackgroundFill:!1})}createBackgroundGraphics(){var t;const{geometry:e,lineStyle:n,fillStyle:r,id:o}=this.json,{width:s,height:a,pivot:h}=(e==null?void 0:e.lineTransform)||hs,l=s||this.json.width,u=a||this.json.height,p=(r==null?void 0:r.fillType)==="solidFill"?r.color:null;return r&&r.fillType!=="noFill"||this.json.isPicture?new Zu(o+"-bg-graphics",this.ctx,(t=e==null?void 0:e.paths)!==null&&t!==void 0?t:[],(e==null?void 0:e.hash)||"",h||{x:0,y:0},l,u,n,!0,p,null):null}createBackgroundFill(){var t,e;const{fillStyle:n,width:r,height:o,lineStyle:s,geometry:a}=this.json,h=(a==null?void 0:a.fillTransform)||hs;return new uo(this.ctx,n,(h.width||r)+((t=s==null?void 0:s.width)!==null&&t!==void 0?t:0),(h.height||o)+((e=s==null?void 0:s.width)!==null&&e!==void 0?e:0),{useFilter:!0,useSlideBackgroundFill:this.json.useBgFill,fillFloat:this.json.fillFloat,shapeRotation:this.json.rotation})}createBackground(){var t,e,n,r,o,s,a,h;const{pivot:l,width:u,height:p}=((t=this.json.geometry)===null||t===void 0?void 0:t.fillTransform)||hs,{displayObject:y}=this.backgroundFill;y?(this.json.useBgFill&&((n=this.backgroundGraphics)===null||n===void 0?void 0:n.displayObject)?(this.needCacheAsBitMap=!0,y.mask=this.backgroundGraphics.displayObject,y.pivot.x=((r=this.json.position)===null||r===void 0?void 0:r.x)||0,y.pivot.y=((o=this.json.position)===null||o===void 0?void 0:o.y)||0,this.effectContainer.addChild(this.backgroundGraphics.displayObject)):((s=this.json.fillStyle)===null||s===void 0?void 0:s.fillType)==="gifFill"?(y.height=p||this.designHeight,y.width=u||this.designWidth,y instanceof Gu&&y.play(),!((a=this.backgroundGraphics)===null||a===void 0)&&a.isNeedMask(y.width,y.height)&&(y.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.effectContainer.addChild(this.backgroundGraphics.displayObject))):!((h=this.backgroundGraphics)===null||h===void 0)&&h.isNeedMask(y.width,y.height)&&(this.json.fillFloat||(this.needCacheAsBitMap=!0,y.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.effectContainer.addChild(this.backgroundGraphics.displayObject))),this.json.fillFloat||(y.x=l.x,y.y=l.y),this.effectContainer.addChild(y)):this.backgroundFill.hasFill&&((e=this.backgroundGraphics)===null||e===void 0?void 0:e.displayObject)&&this.effectContainer.addChild(this.backgroundGraphics.displayObject)}createPathFill(){var t,e,n;const{displayObject:r}=this.strokeFill,o=(t=this.strokeGraphics)===null||t===void 0?void 0:t.displayObject,[s,a]=this.calculateFillObjectOffset();r?(((e=this.strokeGraphics)===null||e===void 0?void 0:e.isNeedMask(r.width,r.height))&&o&&(this.needCacheAsBitMap=!0,r.pivot.x=o.pivot.x,r.pivot.y=o.pivot.y,o.pivot.x=0,o.pivot.y=0,r.mask=o,r.addChild(o),r.position.x=-s/2,r.position.y=-a/2,o.position.x=s/2,o.position.y=a/2),this.effectContainer.addChild(r)):this.strokeFill.hasFill&&((n=this.strokeGraphics)===null||n===void 0?void 0:n.displayObject)&&this.effectContainer.addChild(this.strokeGraphics.displayObject)}createFilledPathMask(){var t,e,n;const r=((e=(t=this.json.geometry)===null||t===void 0?void 0:t.paths)===null||e===void 0?void 0:e.filter(o=>o.fill!=="none"&&o.fill!=="norm"))||[];for(const o of r){const s=this.ctx.graphicsTexture.getGraphicsData(o.id);if(s){const a=new di(s.texture);a.pivot.x=s.pivot.x,a.pivot.y=s.pivot.y;const h=this.backgroundFill.getClonedDisplayObject(),l=(n=this.backgroundGraphics)===null||n===void 0?void 0:n.getClonedDisplayObject(),u=h||l;u&&(this.backgroundFill.displayObject&&(u.pivot.x=this.backgroundFill.displayObject.pivot.x,u.pivot.y=this.backgroundFill.displayObject.pivot.y),u.mask=a,u.filters=[Zb[o.fill]],this.needCacheAsBitMap=!0,this.effectContainer.addChild(u),this.effectContainer.addChild(a))}}}createArrow(){this.arrowList.length&&this.arrowList.forEach(t=>{var e;const n=this.ctx.graphicsTexture.getGraphicsData(t.graphicsId);if(n){const{texture:r}=n,o=new di(r);o.pivot.x=t.pivot.x,o.pivot.y=t.pivot.y,o.position.x=t.position.x,o.position.y=t.position.y,o.rotation=t.rotate/180*Math.PI,(e=this.backgroundGraphics)===null||e===void 0||e.addArrows(o)}})}generateArrowList(){var t,e;const{lineArrowList:n,lineStyle:r,id:o}=this.json,s=((t=r==null?void 0:r.fill)===null||t===void 0?void 0:t.fillType)==="solidFill"?r.fill.color:null;(e=n||[])===null||e===void 0||e.forEach((a,h)=>{var l,u;const p=new w1(Object.assign(Object.assign({},a),{fillStyle:r==null?void 0:r.fill,lineWidth:(l=r==null?void 0:r.width)!==null&&l!==void 0?l:0}));p.graphicsId=`${o}-arrow-${h}-graphics`,p.textureId=`${o}-arrow-${h}-fill`,this.ctx.graphicsTexture.addGraphics(p.graphicsId,(u=p.paths)!==null&&u!==void 0?u:[],p.hash,{x:0,y:0},p.width,p.height,void 0,this.ctx.objectPoolGroup,!0,s,null),this.arrowList.push(p)})}calculateFillObjectOffset(){let[t,e]=[0,0];return this.arrowList.length&&(t=this.arrowList.reduce((n,r)=>Math.max(n,r.width),0),e=this.arrowList.reduce((n,r)=>Math.max(n,r.height),0)),[t,e]}preRender(t){var e,n,r;const{lineStyle:o,geometry:s}=this.json,{width:a,height:h}=(s==null?void 0:s.lineTransform)||hs,l=a||this.json.width,u=h||this.json.height,p=((e=s==null?void 0:s.paths)===null||e===void 0?void 0:e.filter(x=>x.fill!=="none"&&x.fill!=="norm"))||[],y=((n=o==null?void 0:o.fill)===null||n===void 0?void 0:n.fillType)==="solidFill"?o.fill.color:null;t.addSubMTask(()=>nh(this,void 0,void 0,function*(){for(const x of p)this.ctx.graphicsTexture.addGraphics(x.id,[x],x.hash,((s==null?void 0:s.lineTransform)||hs).pivot,l,u,o,this.ctx.objectPoolGroup,!0,null,y)}),"@ShapeImpl[addGraphics]"),(r=this.text)===null||r===void 0||r.createParagraphs(this.json.id,t)}subClassRender(){return nh(this,void 0,void 0,function*(){})}render(t){t.addSubMTask(()=>nh(this,void 0,void 0,function*(){var e,n;(e=this.strokeGraphics)===null||e===void 0||e.render(),(n=this.backgroundGraphics)===null||n===void 0||n.render(),this.createBackground(),yield this.subClassRender(),this.createFilledPathMask(),this.createPathFill(),this.createArrow()}),"@ShapeImpl[render]"),this.text&&this.text.render(t),t.addSubMTask(()=>nh(this,void 0,void 0,function*(){var e,n,r,o,s,a,h,l,u,p,y,x,E;if(((e=this.json.textBody)===null||e===void 0?void 0:e.iterateType)==="wd"||((n=this.json.textBody)===null||n===void 0?void 0:n.iterateType)==="lt"){if(this.renderContainer.addChild(this.container),this.text){const{x:A,y:C}=(r=this.json.scale)!==null&&r!==void 0?r:{x:1,y:1};this.text.container.scale.x=C<0?-Math.abs(A):Math.abs(A),this.text.container.scale.y=C,this.text.container.position.x=((s=(o=this.json.position)===null||o===void 0?void 0:o.x)!==null&&s!==void 0?s:0)+this.text.x,this.text.container.position.y=((h=(a=this.json.position)===null||a===void 0?void 0:a.y)!==null&&h!==void 0?h:0)+this.text.y,this.text.container.scale.y<0&&(this.text.container.position.y+=this.text.height),this.text.container.scale.x<0&&(this.text.container.position.x+=this.json.width),this.renderContainer.addChild(this.text.container)}}else{if(this.text){if(Kb()(this.json.textRotateWithShape)&&!this.json.textRotateWithShape){const Q=this.json.rotation||0;this.text.container.rotation=-Q;const{width:rt}=this.text;this.text.container.position.x=rt}this.text.container.zIndex=100;const A=(l=this.json.effectList)===null||l===void 0?void 0:l.find(Q=>Q.type==="outerShadow"),C=(u=this.json.effectList)===null||u===void 0?void 0:u.find(Q=>Q.type==="softEdge"),W=(p=this.json.effectList)===null||p===void 0?void 0:p.find(Q=>Q.type==="glow");A&&A.sx!==1||C||W?this.container.addChild(this.text.container):this.effectContainer.addChild(this.text.container)}this.renderContainer.addChild(this.container)}if(this.needCacheAsBitMap,this.json.id==="background"&&this.ctx.hasBackgroundFillShape){const A=ce.p.create({width:this.json.width,height:this.json.height,resolution:Math.ceil(this.ctx.renderer.resolution)});this.ctx.renderer.render(this.renderContainer,{renderTexture:A}),this.ctx.bgTexture=A}this.json.effectList&&this.json.effectList.length>0&&((y=this.ctx.featureList)===null||y===void 0?void 0:y.effect)&&!this.ctx.forceCanvas&&!this.json.media&&(this.effectObject=new X1(this.effectContainer,this.json.effectList,`${this.ctx.taskId}_${this.ctx.slideIndex}_${this.json.id}`,this.ctx,this.json.rotation||0,new De.g(((x=this.json.scale)===null||x===void 0?void 0:x.x)||1,((E=this.json.scale)===null||E===void 0?void 0:E.y)||1)),function(A){var C,W,Q;return((C=A.fillStyle)===null||C===void 0?void 0:C.fillType)==="gifFill"||((Q=(W=A.lineStyle)===null||W===void 0?void 0:W.fill)===null||Q===void 0?void 0:Q.fillType)==="gifFill"||!!A.picFill&&A.picFill.fillType==="gifFill"}(this.json)&&this.effectObject.setFrameCount(-1),this.effectObject.on("ready",()=>{var A;this.effectContainer.visible=!1,this.effectObject.container.zIndex=10,this.container.addChild(this.effectObject.container),(A=this.effectObject)===null||A===void 0||A.updateFrame(1)}))}),"@ShapeImpl[post.render]")}clearOnSlideChange(){}initOnReuse(){}destroy(){var t,e,n,r;(t=this.text)===null||t===void 0||t.destroy(),this.fillColorFilter.destroy(),this.strokeColorFilter.destroy(),this.backgroundFill.destroy(),(e=this.backgroundGraphics)===null||e===void 0||e.destroy(),this.strokeFill.destroy(),(n=this.strokeGraphics)===null||n===void 0||n.destroy(),this.renderContainer.destroy(),(r=this.arrowRenderTexture)===null||r===void 0||r.destroy(!0),this.arrowList=[],this.effectDisposer()}}var Y1=v(119);const $u=new(v.n(Y1)).a,q1=$u.getDevice(),J1=$u.getBrowser(),ih=$u.getOS(),us={isDesktop(){let i=!0;return q1.type==="mobile"&&(i=!1),/Samsung/.test(J1.name||"")&&(i=!1),window.__nativeTags&&window.__nativeTags.platform&&(i=!1),i},isIOS(){let i=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^ios/i.test(window.__nativeTags.platform)&&(i=!0),ih.name&&/iOS/.test(ih.name)&&(i=!0),i},isAndroid(){let i=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^android/i.test(window.__nativeTags.platform)&&(i=!0),ih.name&&/android/i.test(ih.name)&&(i=!0),i},isLowGpuMemory(){var i,t;const e=(t=(i=window.__nativeTags)===null||i===void 0?void 0:i.platform)!==null&&t!==void 0?t:"";if(e){const n=e.split(" ");if(n[1]){if(/^iPad/.test(n[1])){const r=n[1].match(/^iPad(\d+)/);return!(r&&r[1]&&parseInt(r[1],10)>=6)}if(/^iPhone/.test(n[1])){const r=n[1].match(/^iPhone(\d+)/);return!(r&&r[1]&&parseInt(r[1],10)>=9)}return!1}return!1}return!0}};var rh=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};function ir(i,t){for(const e in t)i.style[e]=t[e]}const Uo={medianContainerClass:"median-container",hoverHiddeDelay:1500,portalWidth:300,portalHeight:50,hiddenOpacity:"0",hoverOpacity:"1",opacityAnimationTime:.4};class Na{constructor(t){var e,n;this.progress=document.createElement("div"),this.totalTime=document.createElement("span"),this.playButton=document.createElement("div"),this.pauseButton=document.createElement("div"),this.currentTime=document.createElement("span"),this.mediaController=document.createElement("div"),this.currentProgress=document.createElement("div"),this.fullScreenButton=document.createElement("div"),this.exitFullScreenButton=document.createElement("div"),this.medianIsEnd=!1,this.pickBookmarkIndex=0,this.playCallBackList=[],this.duration=0,this.isVideo=!1,this.start=0,this.end=0,this.fullscreenStatus=!1,this.changeMediaProgress=r=>{if(this.ctx.isPlayerPaused())return void this.ctx.logger.info("Media controller prevent seek event with paused state",this.ctx.taskId);r.stopPropagation();const o=r.offsetX/this.progress.clientWidth*this.duration;this.medianIsEnd=!1,this.ctx.mode!=="interactive"&&this.jumpToTime(o),this.ctx.mode!=="local"&&this.ctx.eventHub.emit(Qe.mediaSeek,{id:this.targetId,time:o,isPlaying:this.media.isPlaying}),this.delayHide()},this.jumpToTime=(r=0)=>rh(this,void 0,void 0,function*(){yield Xl(()=>!!this.duration,3e3);const o=Math.floor(r)+this.start;this.media.currentTime!==o&&(this.media.currentTime=o,this.changeBookmarkIndex(o,o>this.media.currentTime))}),this.showController=r=>{r.stopPropagation(),this.show()},this.getMediaDuration=()=>{this.duration&&!Number.isNaN(this.duration)||(this.duration=this.media.duration,this.start&&(this.duration-=this.start,this.jumpToTime()),this.end&&(this.duration-=this.end)),this.totalTime.innerText=Na.formatTime(this.duration)},this.playMedia=()=>rh(this,void 0,void 0,function*(){this.playButton.style.display="none",this.pauseButton.style.display="block",yield this.media.play(),this.medianIsEnd&&(this.medianIsEnd=!1,this.jumpToTime()),this.playCallBackList.forEach(r=>{r()}),this.delayHide()}),this.pauseMedia=()=>rh(this,void 0,void 0,function*(){this.playButton.style.display="block",this.pauseButton.style.display="none",yield this.media.pause()}),this.onMouseOut=r=>{r.stopPropagation(),this.hide()},this.mediaTimeUpdate=()=>rh(this,void 0,void 0,function*(){const r=this.media.currentTime-this.start;if(this.duration>0&&(r>this.duration||this.media.ended)&&(yield this.pauseMedia(),this.medianIsEnd=!0,this.jumpToTime(),this.ctx.eventHub.emit(Qe.mediaStop,{id:this.targetId}),this.onClickCancelFullScreenButtonHandle()),this.currentTime.innerText=Na.formatTime(r),this.currentProgress.style.flex=(r/this.duration).toString(),!this.bookmarkList||this.bookmarkList.length===0)return;const o=this.bookmarkList[this.pickBookmarkIndex];o&&o.time.toFixed(0)===this.media.currentTime.toFixed(0)&&(this.ctx.timingEventHub.emit(`shape ${this.shapeId} onMediaBookmark ${o.name}`),this.pickBookmarkIndex+=1)}),this.onPauseMedia=()=>{this.playButton.style.display="block",this.pauseButton.style.display="none"},this.onPlayMedia=()=>{this.playButton.style.display="none",this.pauseButton.style.display="block",this.playCallBackList.forEach(r=>{r()})},this._playMediaFromCtrl=()=>{this.playMediaFromCtrl(!1)},this._pauseMediaFromCtrl=()=>{this.pauseMediaFromCtrl(!1),this.delayHide()},this.onClickFullScreenButtonHandle=()=>{this.fullscreenPlay()},this.onClickCancelFullScreenButtonHandle=()=>{this.fullscreenStatus=!1,this.media.requestCancelFullscreen(),this.ctx.eventHub.emit(Qe.fullscreenChange,{targetId:this.targetId,state:!1}),this.delayHide()},this.onFullScreenChange=r=>{const{status:o,targetId:s,slideIndex:a}=r;this.changeFullScreenState(o,s,a),this.delayHide()},this.onContainerSizeChange=()=>{this.setControllerPosition()},this.onControllerShowStatusChange=({slideIndex:r,targetId:o,status:s})=>{if(r===this.ctx.slideIndex){if(this.targetId===o){const{hiddenOpacity:a,hoverOpacity:h}=Uo;s?(this.mediaController.style.opacity=h,this.mediaController.style.display="flex"):this.mediaController.style.opacity=a}this.delayHide()}},this.targetId=t.targetId,this.ctx=t.ctx,this.height=t.height,this.width=t.width,this.target=t.target,this.media=t.media,this.info=t.info,this.shapeId=t.shapeId,this.canvasElement=t.canvasElement,this.media.type==="video"&&(this.isVideo=!0),this.getMedianContainer(),this.createMediaController(),this.info.cut&&(this.start=(e=this.info.cut.start)!==null&&e!==void 0?e:0,this.end=(n=this.info.cut.end)!==null&&n!==void 0?n:0),this.info.bookmarkList&&(this.bookmarkList=this.info.bookmarkList.sort((r,o)=>r.time-o.time))}get clippedDuration(){return this.duration}getMedianContainer(){var t;const{medianContainerClass:e}=Uo;let n=(t=this.canvasElement.parentElement)===null||t===void 0?void 0:t.querySelector("."+e);n||(n=document.createElement("div"),n.className=e,this.canvasElement.parentElement.appendChild(n)),this.container=n}static formatTime(t){let e="00:00";if(t){const n=Math.floor(t/60),r=String(n<0?0:n).padStart(2,"0"),o=Math.floor(t%60);e=`${r}:${String(o<0?0:o).padStart(2,"0")}`}return e}generatePlayButton(t=20,e=20){const n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttributeNS(null,"viewBox","0 0 512 512"),n.setAttributeNS(null,"height",t.toString()),n.setAttributeNS(null,"width",e.toString());const r=document.createElementNS("http://www.w3.org/2000/svg","polyline");return r.setAttributeNS(null,"points","35 0, 477 256, 35 512"),r.setAttributeNS(null,"fill","#000000"),n.appendChild(r),n}generatePauseButton(t=20,e=20){const n=document.createElementNS("http://www.w3.org/2000/svg","svg");ir(n,{height:t+"px"}),n.setAttributeNS(null,"viewBox","0 0 512 512"),n.setAttributeNS(null,"height",t.toString()),n.setAttributeNS(null,"width",e.toString());const r=document.createElementNS("http://www.w3.org/2000/svg","rect");r.setAttributeNS(null,"x","35"),r.setAttributeNS(null,"y","0"),r.setAttributeNS(null,"width","148"),r.setAttributeNS(null,"height","512");const o=r.cloneNode(!0);return o.setAttributeNS(null,"x","330"),n.append(r,o),n}generateFullScreenButton(t=20,e=20){const n=document.createElementNS("http://www.w3.org/2000/svg","svg");ir(n,{height:t+"px",width:e+"px"}),n.setAttributeNS(null,"width",e.toString()),n.setAttributeNS(null,"height",t.toString()),n.setAttributeNS(null,"viewBox","0 0 1024 1024");const r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttributeNS(null,"d","M918.116352 107.409408c10.186752 10.175488 10.186752 26.691584 0 36.87936L653.734912 407.038976c-10.187776 10.187776-26.703872 10.187776-36.891648 0-10.175488-10.187776-10.175488-26.703872 0.013312-36.891648l264.38144-262.73792c10.174464-10.187776 26.69056-10.200064 36.87936-0.013312L918.117376 107.409408zM878.281728 148.096l-161.155072-0.44544c-11.283456 0.279552-20.85888-8.226816-21.90336-19.458048l0-13.421568c0.318464-10.671104 8.889344-19.241984 19.560448-19.560448l187.030528 0.827392c0.1792-0.037888 0.357376-0.0768 0.523264-0.089088l9.549824-0.229376c5.005312-0.152576 9.843712 1.770496 13.372416 5.336064 3.32288 3.629056 4.9664 8.49408 4.545536 13.40928l-1.032192 9.537536c0 0.191488 0.70144 0.318464 0.70144 0.49664l-0.534528 188.279808c-0.54784 9.984-9.092096 17.637376-19.076096 17.089536-0.165888-0.012288-0.319488-0.0256-0.484352-0.037888L896.009216 329.8304c-10.379264-0.0512-18.733056-8.506368-18.681856-18.885632 0.013312-0.191488 0.013312-0.381952 0.013312-0.585728L878.281728 148.096zM105.884672 916.661248c-10.187776-10.175488-10.200064-26.691584-0.013312-36.87936 0 0 0-0.013312 0.013312-0.013312l265.19552-262.73792c10.35264-10.008576 26.86976-9.729024 36.866048 0.636928 9.766912 10.110976 9.766912 26.131456 0 36.242432L143.579136 916.661248C133.072896 926.848 116.3776 926.848 105.884672 916.661248L105.884672 916.661248zM146.533376 875.973632l161.154048 0.433152c11.283456-0.292864 20.85888 8.213504 21.891072 19.458048l0 13.38368c-0.292864 10.672128-8.876032 19.255296-19.560448 19.561472l-187.858944-0.828416c-0.165888 0.037888-0.344064 0.075776-0.509952 0.089088l-9.550848 0.229376c-5.004288 0.152576-9.831424-1.782784-13.35808-5.336064-3.323904-3.629056-4.979712-8.493056-4.54656-13.395968l1.031168-9.537536c0-0.191488-0.712704-0.330752-0.700416-0.509952l0.534528-188.278784c0.534528-9.984 9.066496-17.625088 19.050496-17.089536 0.165888 0.013312 0.330752 0.0256 0.508928 0.037888l14.212096 0c10.365952 0.0512 18.719744 8.507392 18.656256 18.873344 0 0.191488 0 0.395264-0.013312 0.598016L146.533376 875.973632zM918.116352 916.661248c10.186752-10.175488 10.200064-26.691584 0.012288-36.87936 0 0 0-0.013312-0.012288-0.013312l-264.38144-262.73792c-10.365952-10.008576-26.86976-9.729024-36.87936 0.636928-9.766912 10.110976-9.766912 26.131456 0 36.242432L881.22368 916.661248c10.186752 10.186752 26.703872 10.186752 36.891648 0.013312L918.115328 916.661248 918.116352 916.661248zM878.281728 875.973632l-161.168384 0.433152c-11.270144-0.292864-20.845568 8.213504-21.890048 19.458048l0 13.38368c0.306176 10.672128 8.889344 19.241984 19.560448 19.561472l187.030528-0.828416c0.1792 0.037888 0.357376 0.075776 0.523264 0.089088l9.549824 0.229376c5.005312 0.152576 9.843712-1.782784 13.372416-5.336064 3.32288-3.629056 4.978688-8.493056 4.545536-13.395968l-1.032192-9.537536c0-0.191488 0.70144-0.330752 0.70144-0.509952l-0.534528-188.278784c-0.54784-9.984-9.092096-17.637376-19.076096-17.089536-0.165888 0.013312-0.319488 0.0256-0.484352 0.037888L896.009216 694.19008c-10.379264 0.0512-18.733056 8.507392-18.681856 18.885632 0 0.191488 0.013312 0.381952 0.013312 0.584704L878.281728 875.973632zM105.884672 107.409408c-10.187776 10.175488-10.187776 26.691584 0 36.87936l265.19552 262.750208c10.187776 10.187776 26.691584 10.187776 36.87936 0s10.175488-26.703872-0.012288-36.891648l-264.368128-262.73792C133.072896 97.222656 116.3776 97.222656 105.884672 107.409408L105.884672 107.409408zM146.533376 148.096l161.154048-0.44544c11.283456 0.292864 20.85888-8.213504 21.891072-19.458048l0-13.421568c-0.306176-10.671104-8.889344-19.241984-19.560448-19.560448l-187.858944 0.827392c-0.165888-0.0512-0.344064-0.0768-0.509952-0.089088l-9.550848-0.229376c-5.004288-0.152576-9.831424 1.782784-13.35808 5.336064-3.323904 3.629056-4.979712 8.49408-4.54656 13.40928l1.031168 9.537536c0 0.191488-0.712704 0.318464-0.700416 0.49664l0.534528 188.279808c0.534528 9.970688 9.066496 17.624064 19.050496 17.089536 0.165888-0.012288 0.330752-0.0256 0.508928-0.037888l14.212096 0c10.365952-0.0512 18.719744-8.506368 18.656256-18.87232 0-0.191488 0-0.395264-0.013312-0.598016L146.533376 148.096z"),n.appendChild(r),document.body.appendChild(n),n}generateExitFullScreenButton(t=20,e=20){const n=document.createElementNS("http://www.w3.org/2000/svg","svg");ir(n,{height:t+"px",width:e+"px"}),n.setAttributeNS(null,"width",e.toString()),n.setAttributeNS(null,"height",t.toString()),n.setAttributeNS(null,"viewBox","0 0 1024 1024");const r=document.createElementNS("http://www.w3.org/2000/svg","path"),o=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttributeNS(null,"d","M716.8 998.4a25.6 25.6 0 0 1-25.6-25.6v-256a25.6 25.6 0 0 1 25.6-25.6h256a25.6 25.6 0 1 1 0 51.2h-230.4v230.4a25.6 25.6 0 0 1-25.6 25.6zM307.2 998.4a25.6 25.6 0 0 1-25.6-25.6v-230.4H51.2a25.6 25.6 0 1 1 0-51.2h256a25.6 25.6 0 0 1 25.6 25.6v256a25.6 25.6 0 0 1-25.6 25.6zM972.8 332.8h-256a25.6 25.6 0 0 1-25.6-25.6v-256a25.6 25.6 0 1 1 51.2 0v230.4h230.4a25.6 25.6 0 1 1 0 51.2zM307.2 332.8h-256a25.6 25.6 0 1 1 0-51.2h230.4V51.2a25.6 25.6 0 1 1 51.2 0v256a25.6 25.6 0 0 1-25.6 25.6z"),o.setAttributeNS(null,"d","M307.2 332.8a25.6 25.6 0 0 1-18.112-7.488L56.896 93.12a25.6 25.6 0 0 1 36.224-36.224l232.192 232.192A25.6 25.6 0 0 1 307.2 332.8zM716.8 332.8a25.6 25.6 0 0 1-18.112-43.712L930.88 56.896a25.6 25.6 0 0 1 36.224 36.224l-232.192 232.192a25.472 25.472 0 0 1-18.112 7.488zM948.992 974.592a25.6 25.6 0 0 1-18.112-7.488l-232.192-232.192a25.6 25.6 0 0 1 36.224-36.224l232.192 232.192a25.6 25.6 0 0 1-18.112 43.712zM75.008 974.592a25.6 25.6 0 0 1-18.112-43.712l232.192-232.192a25.6 25.6 0 0 1 36.224 36.224l-232.192 232.192a25.472 25.472 0 0 1-18.112 7.488z"),n.appendChild(r),n.appendChild(o),document.body.appendChild(n),n}createButton(){const t={marginLeft:"15px",marginRight:"10px",fontSize:"0",height:"20px",display:"flex",justifyContent:"center",alignItems:"center"};ir(this.playButton,Object.assign(Object.assign({},t),{display:"block"}));const e=this.generatePlayButton();ir(e,{height:"20px"}),this.playButton.appendChild(e),ir(this.pauseButton,Object.assign(Object.assign({},t),{display:"none"}));const n=this.generatePauseButton();if(ir(n,{height:"20px"}),this.pauseButton.appendChild(n),!this.isVideo)return;const r=this.generateFullScreenButton(20,20);this.fullScreenButton.appendChild(r),ir(this.fullScreenButton,Object.assign(Object.assign({},t),{display:"block"}));const o=this.generateExitFullScreenButton(20,20);this.exitFullScreenButton.appendChild(o),ir(this.exitFullScreenButton,Object.assign(Object.assign({},t),{display:"none"}))}createTimer(){const t=document.createElement("div");ir(t,{width:"100px"}),this.currentTime.innerText="00:00";const e=document.createElement("span");return e.innerText="/",t.append(this.currentTime,e,this.totalTime),t}createProgress(){const t={flex:"1",position:"relative"};this.isVideo||(t.marginRight="10px"),ir(this.progress,t);const e=document.createElement("div");ir(e,{background:"#D9D9D9",position:"relative",height:"10px",display:"flex"}),this.progress.appendChild(e),ir(this.currentProgress,{background:"#4F4F4F",top:"0px",left:"0",height:"10px",flex:"0"}),e.appendChild(this.currentProgress)}changeBookmarkIndex(t,e){if(this.bookmarkList&&this.bookmarkList.length!==0){if(this.pickBookmarkIndex>0){for(let n=0;n<this.pickBookmarkIndex;n++)if(this.bookmarkList[n].time>t){this.pickBookmarkIndex=n;break}}if(e){let n=this.pickBookmarkIndex-1;for(let r=0;r<this.bookmarkList.length;r++)this.bookmarkList[r].time<t&&(n=r);for(let r=this.pickBookmarkIndex;r<=n;r++){const o=this.bookmarkList[r];o&&this.ctx.timingEventHub.emit(`shape ${this.shapeId} onMediaBookmark ${o.name}`)}this.pickBookmarkIndex=n+1}}}playMediaFromCtrl(t){this.ctx.isPlayerPaused()?this.ctx.logger.info("Media controller prevent play event with paused state",this.ctx.taskId):(this.ctx.mode!=="interactive"&&this.playMedia(),this.ctx.mode!=="local"&&this.ctx.eventHub.emit(Qe.mediaPlay,{id:this.targetId,time:this.media.currentTime-this.start,_stateOnly:t}))}pauseMediaFromCtrl(t){this.ctx.isPlayerPaused()?this.ctx.logger.info("Media controller prevent pause event with paused state",this.ctx.taskId):(this.ctx.mode!=="interactive"&&this.pauseMedia(),this.ctx.mode==="local"||this.ctx.isRendering||this.ctx.eventHub.emit(Qe.mediaPause,{id:this.targetId,time:this.media.currentTime-this.start,_stateOnly:t}))}setControllerPosition(){var t;const{target:e}=this,{portalWidth:n,portalHeight:r}=Uo,{stageWidth:o,stageHeight:s}=this.ctx,a=e.getGlobalPosition(),h=Number((t=this.container)===null||t===void 0?void 0:t.getAttribute("data-scale")),l=o*h,u=1/h*(n>l?l/n:1);a.y=a.y+this.height-r,a.x=Math.max(a.x,0),a.x=Math.min(a.x,o-n*u),a.y=Math.max(a.y,0),a.y=Math.min(a.y,s-r),ir(this.mediaController,{height:r+"px",borderRadius:r/2+"px",width:n+"px",flexDirection:"row",alignItems:"center",position:"absolute",left:a.x+"px",top:a.y+"px",background:"#fff",zIndex:"2",border:"1px solid #ccc",transform:`scale(${u})`,transformOrigin:"0 100%"}),this.fullscreenStatus&&ir(this.mediaController,{left:"0",top:s-r+"px"})}createMediaController(){this.setControllerPosition(),ir(this.mediaController,{display:"none",transition:`opacity ${Uo.opacityAnimationTime}s`}),this.createButton();const t=this.createTimer();this.createProgress(),this.mediaController.append(this.playButton,this.pauseButton,t,this.progress),this.isVideo&&this.mediaController.append(this.fullScreenButton,this.exitFullScreenButton),this.container.appendChild(this.mediaController),this.bindEvent()}addPlayCallBack(t){this.playCallBackList.push(t)}fullscreenPlay(){this.fullscreenStatus=!0,this.ctx.mode!=="interactive"&&this.media.requestFullscreen(),this.ctx.mode!=="local"&&this.ctx.eventHub.emit(Qe.fullscreenChange,{targetId:this.targetId,state:!0}),this.delayHide()}changeFullScreenState(t,e,n){n===this.ctx.slideIndex&&(t&&this.targetId===e?this.fullscreenStatus=t:this.fullscreenStatus=!1,this.fullscreenStatus?(this.fullScreenButton.style.display="none",this.exitFullScreenButton.style.display="block"):(this.fullScreenButton.style.display="block",this.exitFullScreenButton.style.display="none"),this.setControllerPosition())}bindEvent(){us.isDesktop()&&(this.mediaController.addEventListener("mouseout",this.onMouseOut,!1),this.mediaController.addEventListener("mouseover",this.showController,!1)),this.progress.addEventListener("click",this.changeMediaProgress,!1),this.playButton.addEventListener("click",this._playMediaFromCtrl,!1),this.pauseButton.addEventListener("click",this._pauseMediaFromCtrl,!1),this.media.on("durationchange",this.getMediaDuration,!1),this.media.on("timeupdate",this.mediaTimeUpdate,!1),this.media.on("pause",this.onPauseMedia,!1),this.media.on("play",this.onPlayMedia,!1),this.containerObserver=new MutationObserver(this.onContainerSizeChange),this.container&&this.containerObserver.observe(this.container,{attributes:!0,attributeFilter:["data-scale","style"]}),this.isVideo&&(this.ctx.globalEventHub.on("onFullscreenChange",this.onFullScreenChange),this.ctx.globalEventHub.on("controllerShowStatusChange",this.onControllerShowStatusChange),this.fullScreenButton.addEventListener("click",this.onClickFullScreenButtonHandle,!1),this.exitFullScreenButton.addEventListener("click",this.onClickCancelFullScreenButtonHandle,!1))}unbindEvent(){var t;us.isDesktop()&&(this.mediaController.removeEventListener("mouseout",this.onMouseOut,!1),this.mediaController.removeEventListener("mouseover",this.showController,!1)),this.progress.removeEventListener("click",this.changeMediaProgress,!1),this.playButton.removeEventListener("click",this._playMediaFromCtrl,!1),this.pauseButton.removeEventListener("click",this._pauseMediaFromCtrl,!1),this.media.removeAllListeners(),(t=this.containerObserver)===null||t===void 0||t.disconnect(),this.isVideo&&(this.ctx.globalEventHub.removeListener("onFullscreenChange",this.onFullScreenChange),this.ctx.globalEventHub.removeListener("controllerShowStatusChange",this.onControllerShowStatusChange),this.fullScreenButton.removeEventListener("click",this.onClickFullScreenButtonHandle,!1),this.exitFullScreenButton.removeEventListener("click",this.onClickCancelFullScreenButtonHandle,!1))}show(){this.setControllerPosition(),this.mediaController.style.opacity=Uo.hoverOpacity,this.fullscreenStatus||(this.mediaController.style.display="flex"),this.delayHide()}hide(){this.fullscreenStatus?this.mediaController.style.opacity=Uo.hiddenOpacity:this.mediaController.style.display="none"}delayHide(){clearTimeout(this.autoHiddenTimer),this.autoHiddenTimer=setTimeout(()=>{this.hide()},Uo.hoverHiddeDelay)}destroy(){var t;this.unbindEvent(),this.playCallBackList=[],(t=this.container)===null||t===void 0||t.removeChild(this.mediaController)}}var K1=v(120);class tc extends yi.a{constructor(t,e){super(),this.isGlobalPause=!1,this.lastTime=-1,this.howl=null,this.rctClient=null,this.isHowlEnd=!1,this.isHowlLoadEmit=!1,this.staticEventId=1001,this.url=t,this.runningAudio=e,ar.RtcAudioClazz?(this.rctClient=new ar.RtcAudioClazz(t),this.rctClient.on("load",()=>this.emit("load")),this.rctClient.on("pause",()=>this.emit("pause")),this.rctClient.on("play",()=>this.emit("play"))):(this.howl=new K1.Howl({src:[t]}),[this.staticEventId]=this.howl._getSoundIds(),this.howl.load(),this.howl.on("load",()=>{this.isHowlLoadEmit=!0,this.emit("load")}),this.howl.on("pause",()=>this.emit("pause")),this.howl.on("play",()=>{this.isHowlLoadEmit||this.emit("load"),this.isHowlEnd=!1,this.emit("play")}),this.howl.on("end",()=>{this.isHowlEnd=!0}))}startTimeChangeEmit(){this.currentTime!==this.lastTime&&(this.lastTime=this.currentTime,this.emit("timeupdate")),(!this.isEnded||this.duration<=0)&&setTimeout(()=>this.startTimeChangeEmit(),300)}play(){var t,e,n;this.runningAudio.has(this.url)&&((t=this.runningAudio.get(this.url))===null||t===void 0||t.stop(),this.runningAudio.delete(this.url)),this.isHowlEnd=!1,this.lastTime=-1,(e=this.howl)===null||e===void 0||e.play(this.staticEventId),(n=this.rctClient)===null||n===void 0||n.play(),this.startTimeChangeEmit(),this.runningAudio.set(this.url,this)}pause(){var t,e;(t=this.howl)===null||t===void 0||t.pause(this.staticEventId),(e=this.rctClient)===null||e===void 0||e.pause(),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}globalPause(){this.isPaused||(this.isGlobalPause=!0,this.pause())}globalResume(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}stop(){var t;(t=this.howl)===null||t===void 0||t.pause(this.staticEventId),this.rctClient&&(this.rctClient.pause(),this.rctClient.currentTime=0),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}destroy(){var t,e,n,r,o,s,a;(t=this.howl)===null||t===void 0||t.stop(this.staticEventId),(e=this.howl)===null||e===void 0||e.unload(),(n=this.rctClient)===null||n===void 0||n.pause(),(r=this.rctClient)===null||r===void 0||r.destroy(),(o=this.rctClient)===null||o===void 0||o.removeAllListeners("load"),(s=this.rctClient)===null||s===void 0||s.removeAllListeners("play"),(a=this.rctClient)===null||a===void 0||a.removeAllListeners("pause"),this.runningAudio.has(this.url)&&this.runningAudio.delete(this.url)}get currentTime(){return this.rctClient?this.rctClient.currentTime:this.howl?this.howl.seek(this.staticEventId):-1}set currentTime(t){this.rctClient?this.rctClient.currentTime=t:this.howl&&this.howl.seek(t,this.staticEventId)}get duration(){return this.rctClient?this.rctClient.duration:this.howl?this.howl.duration(this.staticEventId):0}get isEnded(){return this.howl?this.isHowlEnd:Math.abs(this.currentTime-this.duration)<.001}get isPaused(){return this.rctClient?this.rctClient.isPaused:!!this.howl&&this.howl.playing(this.staticEventId)}volume(t){this.rctClient?this.rctClient.volume(t):this.howl&&this.howl.volume(t)}}var Jm=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};class Z1 extends yi.a{constructor(t){var e,n,r,o,s;super(),this.type="video",this.sprite=new di,this.isPlaying=!1,this.isGlobalPause=!1,this.fullscreen=!1,this.url="",this.isLoaded=!1,this.onVideoResourceLoaded=()=>{this.isLoaded=!0},this.onVideoStalled=()=>{this.ctx.logger.warn(this.url+", Failed to fetch data, but trying.",this.ctx.taskId)},this.updateVolume=E=>{this.rtcAudio.volume(E)},this.syncFullscreenVideoState=E=>{const{targetId:A,state:C,slideIndex:W}=E;W===this.ctx.slideIndex&&A===this.id&&(C?(this.requestFullscreen(),this.ctx.latestChangeFullscreenTargetId=A):this.requestCancelFullscreen())},this.id=t.id,this.start=(e=t.video.cut)===null||e===void 0?void 0:e.start,this.end=(n=t.video.cut)===null||n===void 0?void 0:n.end,this.fullscreen=(r=t.video.fullscreen)!==null&&r!==void 0&&r,this.container=t.container,this.ctx=t.ctx,this.ctx.medias[this.id]=this;const a=t.video.src;this.videoResource=new ce.w(a,{autoLoad:!0,autoPlay:!1,updateFPS:30,crossorigin:!0}),(o=this.videoElement)===null||o===void 0||o.addEventListener("stalled",this.onVideoStalled),(s=this.videoElement)===null||s===void 0||s.addEventListener("loadedmetadata",this.onVideoResourceLoaded),this.url=t.video.src;let h=t.video.src.replace(/4$/,"3");this.ctx.loaderDelegate&&(h=this.ctx.loaderDelegate.redirectMedia(h),this.ctx.logger.info(`redirect media url from ${t.video.src.replace(/4$/,"3")} to ${h} by delegate.`,t.ctx.taskId)),this.rtcAudio=new tc(h,t.ctx.runningAudio);const{video:l,width:u,height:p,target:y}=t;this.controller=new Na({targetId:t.id,shapeId:t.shapeId,ctx:t.ctx,width:u,height:p,target:y,media:this,info:l,canvasElement:t.canvasElement}),this.controller.addPlayCallBack(()=>{this.sprite.width=u,this.sprite.height=p,this.ctx.clock.setTimeout(()=>{this.sprite.visible=!0},50)});const x=new ce.c(null,{height:p,width:u});x.resource=this.videoResource,this.videoResource.bind(x),this.sprite=new di,this.sprite.visible=!1,this.sprite.texture=new ce.t(x),this.sprite.interactive=!0,this.container.addChild(this.sprite),this.sprite.on("mouseover",E=>{E.stopPropagation(),this.controller.show()}),this.sprite.on("mouseout",E=>{E.stopPropagation(),this.controller.hide()}),["durationchange","timeupdate","pause","play"].forEach(E=>{var A;(A=this.videoElement)===null||A===void 0||A.addEventListener(E,()=>{E==="timeupdate"&&this.isPlaying,this.emit(E)})}),this.ctx.activeMedia.add(this),this.ctx.volumeAdjuster.on("update",this.updateVolume),this.ctx.globalEventHub.on("syncFullscreenVideoState",this.syncFullscreenVideoState)}get videoElement(){return this.videoResource.source}get currentTime(){var t,e;return(e=(t=this.videoElement)===null||t===void 0?void 0:t.currentTime)!==null&&e!==void 0?e:0}set currentTime(t){this.rtcAudio.currentTime=t,this.videoElement&&(this.videoElement.currentTime=t)}get paused(){var t,e;return(e=(t=this.videoElement)===null||t===void 0?void 0:t.paused)===null||e===void 0||e}get ended(){var t,e;return(e=(t=this.videoElement)===null||t===void 0?void 0:t.ended)===null||e===void 0||e}get duration(){var t,e;return(e=(t=this.videoElement)===null||t===void 0?void 0:t.duration)!==null&&e!==void 0?e:0}get clippedDuration(){return this.controller.clippedDuration}showController(){this.controller.show()}hideController(){this.controller.hide()}play(){return Jm(this,void 0,void 0,function*(){this.isPlaying=!0,this.updateVolume(this.ctx.volumeAdjuster.volume),yield this.load(),yield this.ctx.clock.waitUntil(()=>{const e=this.videoElement;return!!(e&&e.videoWidth>0)},3e3);const t=this.videoElement;t&&t.videoWidth<=0||(this.videoElement&&(this.videoElement.volume=0,this.videoElement.muted=!0),this.rtcAudio.once("play",()=>{var e;(e=this.videoElement)===null||e===void 0||e.play(),this.fullscreen&&this.controller.fullscreenPlay()}),this.rtcAudio.play())})}load(){return this.videoResource.load()}pause(){this.isPlaying=!1,this.ctx.logger.warn(this.url+", pause video manual.",this.ctx.taskId),this.ctx.logger.warn(this.url+", pause rtc audio manual.",this.ctx.taskId),this.rtcAudio.once("pause",()=>{var t;(t=this.videoElement)===null||t===void 0||t.pause()}),this.rtcAudio.pause()}globalPause(){this.isPlaying&&(this.isGlobalPause=!0,this.pause())}globalResume(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}togglePause(){this.isPlaying?this.pause():this.play()}seek(t){this.controller.jumpToTime(t)}stop(){this.seek(0),this.pause(),this.ctx.eventHub.emit(Qe.mediaStop)}requestFullscreen(){return Jm(this,void 0,void 0,function*(){yield Xl(()=>this.isLoaded,5e3);const t=new ce.t(this.sprite.texture.baseTexture);this.ctx.globalEventHub.emit("requestFullscreen",{texture:t,index:this.ctx.slideIndex,targetId:this.id})})}requestCancelFullscreen(){this.ctx.globalEventHub.emit("requestCancelFullscreen",{targetId:this.id,index:this.ctx.slideIndex})}destroy(){var t,e,n;this.ctx.volumeAdjuster.removeListener("update",this.updateVolume),this.ctx.globalEventHub.removeListener("syncFullscreenVideoState",this.syncFullscreenVideoState),(t=this.videoElement)===null||t===void 0||t.removeEventListener("stalled",this.onVideoStalled),(e=this.videoElement)===null||e===void 0||e.removeEventListener("loadedmetadata",this.onVideoResourceLoaded),this.sprite.interactive=!1,this.sprite.destroy({texture:!0,baseTexture:!0}),(n=this.videoResource)===null||n===void 0||n.destroy(),this.rtcAudio.destroy(),this.stop(),this.controller.destroy(),this.ctx.activeMedia.delete(this)}}var Q1=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};class $1 extends yi.a{constructor(t){super(),this.type="audio",this.isPlaying=!1,this.isGlobalPause=!1,this.updateVolume=s=>{this.audioPlayer.volume(s)},this.id=t.id;const e=t.audio.src;this.audioPlayer=new tc(e,t.ctx.runningAudio),t.audio.cut&&(this.start=t.audio.cut.start,this.end=t.audio.cut.end),this.ctx=t.ctx,this.ctx.medias[this.id]=this;const{width:n,height:r,target:o}=t;this.controller=new Na({targetId:t.id,shapeId:t.shapeId,ctx:t.ctx,height:r,width:n,target:o,media:this,info:t.audio,canvasElement:t.canvasElement}),this.audioPlayer.on("load",()=>this.emit("durationchange")),this.audioPlayer.on("timeupdate",()=>this.emit("timeupdate")),this.audioPlayer.on("pause",()=>this.emit("pause")),this.audioPlayer.on("play",()=>this.emit("play")),this.ctx.activeMedia.add(this),this.ctx.volumeAdjuster.on("update",this.updateVolume)}get currentTime(){return this.audioPlayer.currentTime}set currentTime(t){this.audioPlayer.currentTime=t}get clippedDuration(){return this.controller.clippedDuration}get paused(){return this.audioPlayer.isPaused}get isPaused(){return this.audioPlayer.isPaused}get ended(){return this.audioPlayer.isEnded}get duration(){return this.audioPlayer.duration}load(){return Promise.resolve()}showController(){this.controller.show()}hideController(){this.controller.hide()}play(){return Q1(this,void 0,void 0,function*(){this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent play event with paused state",this.ctx.taskId):(this.updateVolume(this.ctx.volumeAdjuster.volume),this.isPlaying=!0,this.audioPlayer.play())})}pause(){this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent pause event with paused state",this.ctx.taskId):(this.isPlaying=!1,this.audioPlayer.pause())}globalPause(){this.isPlaying&&(this.isGlobalPause=!0,this.pause())}globalResume(){this.isGlobalPause&&(this.isGlobalPause=!1,this.play())}togglePause(){this.isPlaying?this.pause():this.play()}seek(t){this.ctx.isPlayerPaused()?this.ctx.logger.info("Audio player prevent seek event with paused state",this.ctx.taskId):this.controller.jumpToTime(t)}stop(){this.seek(0),this.pause(),this.ctx.eventHub.emit(Qe.mediaStop)}requestFullscreen(){}requestCancelFullscreen(){}destroy(){this.ctx.volumeAdjuster.removeListener("update",this.updateVolume),this.stop(),this.controller.destroy(),this.ctx.activeMedia.delete(this)}}var Km=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};class tT extends qm{constructor(t,e,n,r){super(Object.assign(Object.assign({},t),{type:"Shape",useBgFill:!1,textRotateWithShape:!0,isPicture:!0}),e,n,r),this.isInteractiveOutside=!1,this.cmd=new Xb(this),this.media=t==null?void 0:t.media,this.container.name=t.id+"_container_[Picture]",this.renderContainer.name=t.id+"_render_container_[Picture]",this.picFill=new uo(this.ctx,t.picFill,t.width,t.height,{useFilter:!0,useSlideBackgroundFill:!1})}applyCommand(t,e){var n,r,o,s;if(e==="call")if(/playFrom\(([0-9.]+)\)/.test(t)){const a=t.match(/playFrom\(([0-9.]+)\)/),h=Number(a[1]||"0");(n=this.mediaPlayer)===null||n===void 0||n.controller.playMediaFromCtrl(!0),Math.abs(h)>.1&&((r=this.mediaPlayer)===null||r===void 0||r.controller.jumpToTime(h))}else t==="custom-pause"?(o=this.mediaPlayer)===null||o===void 0||o.controller.pauseMediaFromCtrl(!0):t==="togglePause"?this.mediaPlayer&&(this.mediaPlayer.isPlaying?this.mediaPlayer.controller.pauseMediaFromCtrl(!0):this.mediaPlayer.controller.playMediaFromCtrl(!0)):t==="stop"&&((s=this.mediaPlayer)===null||s===void 0||s.stop())}renderPic(){var t,e,n,r,o,s;return Km(this,void 0,void 0,function*(){const{displayObject:a}=this.picFill;if(a){a.name=this.json.id+"_pic_fill_[Picture]";const h=(t=this.backgroundGraphics)===null||t===void 0?void 0:t.getClonedDisplayObject();if(((e=this.backgroundGraphics)===null||e===void 0?void 0:e.isNeedMask(a.width,a.height))&&h&&(a.mask=h,this.effectContainer.addChild(h)),a.width=this.designWidth,a.height=this.designHeight,a instanceof Gu&&this.ctx.slideScopeEventHub.once("slide-render",l=>{var u;this.ctx.slideIndex===l&&((u=this.effectObject)===null||u===void 0||u.setFrameCount(a.totalFrames),a.play(),a.onFrameChange=p=>{if(this.effectObject)if(this.effectObject.hasFrame(p))this.effectObject.updateFrame(p);else{const y=this.getEffectTexture();y&&(this.effectObject.createFrame(p,y.texture),this.effectObject.setFrameOffset(y.offsetX,y.offsetY))}})}),this.effectContainer.addChild(a),this.media){let l=this.media.src;if(this.media.type==="audio"&&/mp4$/.test(l)&&(l=l.replace(/mp4$/,"mp3")),this.ctx.urlInterrupter){const u=Date.now();l=yield this.ctx.urlInterrupter(l),this.ctx.logger.info("redirect media url by interrupter. time: "+(Date.now()-u),this.ctx.taskId)}this.ctx.loaderDelegate&&(l=this.ctx.loaderDelegate.redirectMedia(l),this.ctx.logger.info(`redirect media url to ${l} by delegate.`,this.ctx.taskId)),this.media.src=l}if(((n=this.media)===null||n===void 0?void 0:n.type)==="video"&&this.media.src){if(this.mediaPlayer=new Z1({id:this.json.id+"-video",shapeId:this.json.id,ctx:this.ctx,video:this.media,height:this.designHeight,width:this.designWidth,target:a,container:this.effectContainer,canvasElement:this.ctx.view}),((r=this.mediaPlayer)===null||r===void 0?void 0:r.sprite)&&h){const l=(o=this.backgroundGraphics)===null||o===void 0?void 0:o.getClonedDisplayObject();l&&(this.mediaPlayer.sprite.mask=l,this.container.addChild(l))}}else((s=this.media)===null||s===void 0?void 0:s.type)==="audio"&&this.media.src&&(this.mediaPlayer=new $1({id:this.json.id+"-audio",shapeId:this.json.id,ctx:this.ctx,audio:this.media,height:this.designHeight,width:this.designWidth,target:a,canvasElement:this.ctx.view}));this.mediaPlayer&&(this.isInteractiveOutside=!!this.container.interactive,this.container.interactive=!0,us.isDesktop()?(this.container.on("mouseover",()=>{this.mediaPlayer.showController()}),this.container.on("mouseout",()=>{this.mediaPlayer.hideController()},!1)):this.container.on("pointerdown",()=>{this.mediaPlayer.showController()}))}})}preRender(t){super.preRender(t)}subClassRender(){return Km(this,void 0,void 0,function*(){yield this.renderPic()})}clearOnSlideChange(){super.clearOnSlideChange(),this.mediaPlayer&&(this.container.interactive=!1,this.mediaPlayer.stop(),this.mediaPlayer.hideController())}initOnReuse(){super.initOnReuse(),this.mediaPlayer&&(this.container.interactive=!0)}destroy(){this.mediaPlayer&&(this.picFill.displayObject&&!this.isInteractiveOutside&&(this.container.interactive=!1),this.mediaPlayer.destroy(),this.mediaPlayer=void 0),this.picFill.destroy()}}var oh=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};class ec extends Wu{constructor(t,e,n,r,o){super(t,e,n),this.children=[],this.cacheSprite=new di,this.cacheContainer=new Cn.b,this.json=t,this.json.fillStyle&&this.json.fillStyle.fillType==="groupFill"&&r&&(this.json.fillStyle=r),this.container.name=t.id+"_container_[Container]",this.cacheContainer.name=t.id+"_cache_container_[Container]",this.ctx.timingTargets.addTarget(t.id,this),this.updateTransform(this.json),this.fillObject=new uo(this.ctx,t.fillStyle,t.width,t.height,{useFilter:!1,useSlideBackgroundFill:!1}),this.createChildren(o)}createChildren(t){var e,n,r,o;const s={x:(n=(e=this.json.position)===null||e===void 0?void 0:e.x)!==null&&n!==void 0?n:0,y:(o=(r=this.json.position)===null||r===void 0?void 0:r.y)!==null&&o!==void 0?o:0};for(let a=0,h=this.json.children.length;a<h;a++)t.addSubMTask(()=>oh(this,void 0,void 0,function*(){const l=this.json.children[a];let u=null;(l==null?void 0:l.type)==="Shape"?u=new qm(l,this.ctx,s,this.json.fillStyle):(l==null?void 0:l.type)==="Picture"?u=new tT(l,this.ctx,s,this.json.fillStyle):(l==null?void 0:l.type)==="Container"&&(u=new ec(l,this.ctx,s,this.json.fillStyle,t)),u&&this.children.push(u)}),"@ContainerImpl[child.init]")}get interactiveContainer(){return this.container}get renderContainer(){return this.container}preRender(t){for(const e of this.children)t.addSubMTask(()=>oh(this,void 0,void 0,function*(){e.preRender(t)}),"@ContainerImpl[child.preRender]")}getBgElement(){return null}getIterateEntry(t,e,n){return e===0?this:(this.ctx.eventHub.emit("IterateTimeNodeEnd",n),null)}getTextElement(){return null}render(t){for(const e of this.children)e.render(t),t.addSubMTask(()=>oh(this,void 0,void 0,function*(){var n;this.cacheContainer.addChild(e.renderContainer),(e.json.hlinkHover||e.json.hlinkClick)&&((n=e.hyperlink)===null||n===void 0||n.addProxy(this.container))}),"@ContainerImpl[child.render]");t.addSubMTask(()=>oh(this,void 0,void 0,function*(){this.container.addChild(this.cacheContainer)}),"@ContainerImpl[child.append]")}clearOnSlideChange(){this.children.forEach(t=>t.clearOnSlideChange())}initOnReuse(){this.children.forEach(t=>t.initOnReuse())}isChildrenInteractive(){for(const t of this.json.children)if((t==null?void 0:t.type)==="Container"||(t==null?void 0:t.type)==="Stage"||(t==null?void 0:t.hlinkHover)||(t==null?void 0:t.hlinkClick))return!0;return!1}destroy(){this.cacheSprite&&this.cacheSprite.destroy({texture:!0}),this.children.forEach(t=>t.destroy()),this.container.destroy({children:!0,texture:!0,baseTexture:!0}),this.cacheContainer.destroy({children:!0,texture:!0,baseTexture:!0})}}class La extends yi.a{constructor(t,e,n,r){super(),this.cond={},this.timeoutIds=[],this.condHandle=(o,s={})=>{if(o)if(o.delay&&o.delay>0){const a=this.ctx.clock.setTimeout(()=>{o.event&&(this.cond[o.event]=!0,this.detectTrigger(s))},o.delay);this.timeoutIds.push(a)}else this.cond[o.event]=!0,this.detectTrigger(s);else this.detectTrigger(s)},this.id=t,this.ctx=r,this.eventHubs=n,e.forEach(o=>{this.addCond(o)})}setTriggerParams(t){this.triggerParams=t}addCond(t){const e=(...n)=>{this.condHandle(t,n)};t.event&&(/^shape/.test(t.event)||/^time/.test(t.event)?(this.cond[t.event]=!1,this.eventHubs.global.addListener(t.event,e)):/^runtime/.test(t.event)?(this.cond[t.event]=!1,this.eventHubs.runtime.addListener(t.event,e)):/^self/.test(t.event)?t.delay&&t.delay>0&&(this.cond[t.event]=!1,this.eventHubs.runtime.addListener(t.event,e)):this.cond[t.event]=!1)}isTrigger(){return Object.keys(this.cond).every(t=>!!this.cond[t])}isTriggerWithoutParent(){return Object.keys(this.cond).filter(t=>t!=="self").every(t=>!!this.cond[t])}detectTrigger(t){if(Object.keys(this.cond).every(e=>!!this.cond[e])){Object.keys(this.cond).forEach(n=>{this.cond[n]=!1});const e=this.triggerParams;this.triggerParams=void 0,this.emit("active",e,t)}}reset(){Object.keys(this.cond).forEach(t=>{this.cond[t]=!1}),this.timeoutIds.forEach(t=>this.ctx.clock.clearTimeout(t))}}class eT extends yi.a{constructor(t){super(),this.isTimeNodeEndSync=!1,this.interactiveListeners=[],this.runtimeNodeEventHub=new yi.a,this._currentSeqIndex=0,this._currentSeqState="idle",this.isForward=!0,this.autoPlay=!1,this.handlePrev=(y=!1)=>{var x,E,A,C,W,Q;this.hasPrev()||!this.isMainSeq?this.currentSeqState==="idle"?(this.decrSeqIndex(),(x=this.commonTimeNode.children[this.currentSeqIndex])===null||x===void 0||x.commonTimeNode.seekToStart(),(E=this.commonTimeNode.children[this.currentSeqIndex])===null||E===void 0||E.commonTimeNode.clearSubList(),this.currentSeqState="idle"):this.currentSeqState==="running"?((A=this.commonTimeNode.children[this.currentSeqIndex])===null||A===void 0||A.commonTimeNode.seekToStart(),(C=this.commonTimeNode.children[this.currentSeqIndex])===null||C===void 0||C.commonTimeNode.clearSubList(),this.currentSeqState="idle"):this.currentSeqState==="end"&&(this.currentSeqIndex>=this.commonTimeNode.children.length&&(this.currentSeqIndex=this.commonTimeNode.children.length-1),(W=this.commonTimeNode.children[this.currentSeqIndex])===null||W===void 0||W.commonTimeNode.seekToStart(),(Q=this.commonTimeNode.children[this.currentSeqIndex])===null||Q===void 0||Q.commonTimeNode.clearSubList(),this.currentSeqState="idle"):this.globalEventHub.emit("c:prev slide",y)},this.handleNext=(y,x)=>{var E,A,C,W;if(this.isTimeNodeEndSync&&(this.isTimeNodeEndSync=!1,this.currentSeqState="idle",this.currentSeqIndex=0),!this.hasNext()&&this.isMainSeq&&x)this.globalEventHub.emit("c:next slide",y);else{if(this.isInteractiveSeq){this.globalEventHub.emit("shape slide onNext"+(this.json.ctn.id||""));const Q={result:null};this.findChildInfiniteRepeat(this.commonTimeNode,Q),this.commonTimeNode.children.length===1&&Q.result&&(Q.result.json.subTnLst||[]).length>0&&this.currentSeqIndex===0&&this.currentSeqState==="running"&&this.commonTimeNode.allChildrenEndHandle()}this.currentSeqState==="idle"?(E=this.commonTimeNode.children[this.currentSeqIndex])===null||E===void 0||E.commonTimeNode.startTimeNodeForce():this.currentSeqState==="running"?((A=this.commonTimeNode.children[this.currentSeqIndex])===null||A===void 0||A.commonTimeNode.seekToEnd(!1,!0),this.currentSeqState="end",this.incrSeqIndex(),(C=this.commonTimeNode.children[this.currentSeqIndex])===null||C===void 0||C.commonTimeNode.startTimeNodeForce()):this.currentSeqState==="end"&&(this.incrSeqIndex(),(W=this.commonTimeNode.children[this.currentSeqIndex])===null||W===void 0||W.commonTimeNode.startTimeNodeForce())}};const{json:e,iterateType:n,isIterate:r,isSub:o,parent:s,ctx:a,eventHub:h,iterateIndex:l,iterateId:u,isInInteractiveSeq:p}=t;this.isMainSeq=e.ctn.nodeType==="mainSeq",this.isInteractiveSeq=e.ctn.nodeType==="interactiveSeq",this.id=e.ctn.id,this.isIterate=r,this.json=e,this.ctx=a,this.globalEventHub=h,this.commonTimeNode=new Ys({json:e.ctn,isSub:o,eventHubs:{global:h,runtime:this.runtimeNodeEventHub},ctx:a,parent:s,isIterate:!1,iterateType:n,iterateIndex:l,iterateId:u,isInInteractiveSeq:p||this.isInteractiveSeq,fromSeqId:this.isInteractiveSeq?this.json.ctn.id:""}),this.bindShapeEvent(),this.nextConds=new La("mainSeq",e.nextCondLst,{global:h,runtime:this.runtimeNodeEventHub},this.ctx),this.prevConds=new La("mainSeq",e.preCondLst,{global:h,runtime:this.runtimeNodeEventHub},this.ctx),this.commonTimeNode.on("timeNodeRestart",()=>{this.currentSeqIndex=0,this.currentSeqState="idle"}),this.commonTimeNode.on("childTimeNodeStart",y=>{const x=this.commonTimeNode.children.findIndex(E=>E.commonTimeNode.uuid===y.id);x>=0&&(this.currentSeqIndex=x),this.currentSeqState="running",this.isMainSeq&&this.ctx.eventHub.emit(Qe.mainSeqStepStart,x)}),this.commonTimeNode.on("childTimeNodeEnd",y=>{const x=this.commonTimeNode.children.findIndex(E=>E.commonTimeNode.uuid===y.id);x>=0&&(this.currentSeqIndex=x),this.currentSeqState="end",this.autoPlay&&this.ctx.clock.setTimeout(()=>{this.handleNext(!1,!0)}),this.isMainSeq&&this.ctx.eventHub.emit(Qe.mainSeqStepEnd,x)}),this.commonTimeNode.on("timeNodeEndSync",()=>{this.isTimeNodeEndSync=!0,this.commonTimeNode.resetForRepeat()}),this.commonTimeNode.on("timeNodeDestroy",()=>{this.interactiveListeners.forEach(([y,x])=>{y&&x&&y.interactiveContainer.removeListener("pointerdown",x)}),this.interactiveListeners=[]}),this.nextConds.on("active",(y,x)=>{Array.isArray(x)?this.handleNext(x[0],x[1]):this.handleNext(x,!0)}),this.prevConds.on("active",(y,x)=>{Array.isArray(x)?this.handlePrev(x[0]):this.handlePrev(x)})}get currentSeqIndex(){return this._currentSeqIndex}set currentSeqIndex(t){this._currentSeqIndex=t,this.isMainSeq?this.ctx.eventHub.emit(Qe.mainSeqStepChange,t):this.isInteractiveSeq&&this.ctx.eventHub.emit(Qe.interactiveSeqStateChange,{id:this.json.ctn.id,state:{step:t,state:this._currentSeqState}})}get currentSeqState(){return this._currentSeqState}set currentSeqState(t){this._currentSeqState=t,this.isMainSeq?this.ctx.eventHub.emit(Qe.mainSeqStateChange,t):this.isInteractiveSeq&&this.ctx.eventHub.emit(Qe.interactiveSeqStateChange,{id:this.json.ctn.id,state:{step:this._currentSeqIndex,state:t}})}get stepLength(){return this.commonTimeNode.children.length}get currentStep(){return this.currentSeqIndex}get currentState(){return this.currentSeqState}startAutoPlay(){this.autoPlay=!0,this.commonTimeNode.children[0].commonTimeNode.startTimeNodeForce()}incrSeqIndex(){this.currentSeqIndex+1<=this.commonTimeNode.children.length&&(this.currentSeqIndex+=1)}decrSeqIndex(){this.currentSeqIndex-1>=-1&&(this.currentSeqIndex-=1)}hasPrev(){return!(this.currentSeqIndex<=0&&this.currentSeqState==="idle")}hasNext(){return!(this.currentSeqIndex>=this.commonTimeNode.children.length||this.currentSeqIndex===this.commonTimeNode.children.length-1&&this.currentSeqState==="end")}findChildInfiniteRepeat(t,e){t.isInfiniteRepeat()?e.result=t:t.children.map(n=>n.commonTimeNode).forEach(n=>this.findChildInfiniteRepeat(n,e))}bindShapeEvent(){this.json.ctn.nodeType==="interactiveSeq"&&this.json.nextCondLst.forEach(t=>{if(/^shape/.test(t.event)){const e=t.event.split(" ")[1];if(e){const n=this.ctx.timingTargets.getTargetById(e);if(n){n.interactiveContainer.interactive=!0,n.interactiveContainer.cursor="pointer";const r=()=>{this.ctx.eventHub.emit(Qe.userInput);const o=`shape ${e} onClick`,{mode:s}=this.ctx;s!=="interactive"&&s!=="sync"||this.ctx.eventHub.emit(Qe.interactiveSeqAction,{action:o,seqId:this.json.ctn.id}),s!=="sync"&&s!=="local"||this.globalEventHub.emit(o)};n.interactiveContainer.on("pointerdown",r),this.interactiveListeners.push([n,r])}}}})}setCurrentStep(t,e){const{length:n}=this.commonTimeNode.children;if(t>n)return;this.isInteractiveSeq&&this.commonTimeNode.applyCount===0&&(this.commonTimeNode.applyCount=1);let r=t;if(this.commonTimeNode.seekToStart(),r===-1&&(r=n-1),r!==0||e!=="start"){if(r>=0&&r<n)for(let o=0;o<=r;o++){const s=this.commonTimeNode.children[o];o!==r?s.commonTimeNode.seekToEnd(!1,!0):e==="start"?s.commonTimeNode.seekToStart():e==="end"&&s.commonTimeNode.seekToEnd(!1,!0)}this.currentSeqIndex=r,this.currentSeqState=e==="start"?"idle":"end"}}}function Zr(i,t,e){const n=t.split(".");n.reduce((r,o,s)=>{if(r)return s!==n.length-1?r[o]:void(r[o]=e);console.warn(`${i} not support ${t}`)},i)}function sh(i,t){return t?t.split(".").reduce((e,n)=>{if(e)return e[n];console.warn(`${i} not support ${t}`)},i):null}class ko{constructor(t){this.timingTarget=null,this.runtimeNodeEventHub=new yi.a,this.basicOnTimeNodeEnd=()=>{if(this.isConflict){const{target:x}=this.json.cBhvr,E=this.getTargetId(x);this.ctx.conflictTimeNodeManager.removeRunningTimeNode(E,this.modifyAttrKey)}},this.basicOnTimeLineStart=()=>{if(this.isConflict){const{target:x}=this.json.cBhvr;if(this.activeWhenConflict==="next"){const E=this.getTargetId(x);this.ctx.conflictTimeNodeManager.addRunningTimeNode(E,this.modifyAttrKey,this.commonTimeNode)}else this.activeWhenConflict==="prev"&&this.commonTimeNode.dispose()}};const{isIterate:e,isSub:n,json:r,ctx:o,parent:s,eventHub:a,iterateType:h,iterateIndex:l,iterateId:u,isInInteractiveSeq:p,fromSeqId:y}=t;this.json=r,this.id=r.cBhvr.ctn.id,this.ctx=o,this.globalEventHub=a,this.commonTimeNode=new Ys({json:r.cBhvr.ctn,isSub:n,eventHubs:{global:a,runtime:this.runtimeNodeEventHub},ctx:o,parent:s,isIterate:e,iterateType:h,iterateIndex:l,iterateId:u,isInInteractiveSeq:p,fromSeqId:y}),this.timingTarget=this.ctx.timingTargets.getTarget(r.cBhvr.target,e,{type:h,index:l,id:u}),this.commonTimeNode.on("seekToStart",()=>this.onSeekToStart()),this.commonTimeNode.on("seekToEnd",()=>this.onSeekToEnd()),this.commonTimeNode.on("timelineStart",this.basicOnTimeLineStart),this.commonTimeNode.on("timeNodeEnd",this.basicOnTimeNodeEnd)}getTargetId(t){let e=t.id;return t.type==="shape"&&t.txEl&&(e=`${e}-txEl-${t.txEl.range[0]}`),this.commonTimeNode.isIterate&&(e=`${e}-iterate-${this.commonTimeNode.iterateIndex}`),e}}class nT extends ko{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.startVal=null,this.updateStartValue=()=>{this.timingTarget&&(this.startVal=sh(this.timingTarget,this.json.cBhvr.attrList[0]))},this.onSeekToStart=()=>{const e=this.json.cBhvr.attrList[0];this.startVal!==null&&this.timingTarget&&Zr(this.timingTarget,e,this.startVal)},this.onSeekToEnd=()=>{const e=this.json.cBhvr.attrList[0],n=this.json.cBhvr.to||this.json.to;n&&this.timingTarget&&Zr(this.timingTarget,e,n)},this.commonTimeNode.on("timeNodeStart",this.updateStartValue),this.commonTimeNode.on("timeNodeCreate",this.updateStartValue),this.commonTimeNode.on("timeUpdate",({duration:e,delta:n})=>{if(n/e>=1){const r=this.json.cBhvr.attrList[0];this.json.cBhvr.attrList.length>1&&console.warn("this.json.cBhvr.attrList.length > 0");const o=this.json.cBhvr.to||this.json.to;o&&this.timingTarget&&Zr(this.timingTarget,r,o)}})}get modifyAttrKey(){return this.json.cBhvr.attrList[0]}}var ah=function(i,t,e,n){var r,o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(t,e,s):r(t,e))||s);return o>3&&s&&Object.defineProperty(t,e,s),s};class lh{constructor(t,e){this.math={pi:Math.PI,e:Math.E,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,ceil:Math.ceil,cos:Math.cos,cosh:Math.cosh,deg:n=>n/Math.PI*180,exp:Math.exp,floor:Math.floor,ln:Math.log,max:Math.max,min:Math.min,rad:n=>n/180*Math.PI,rand:Math.random,sin:Math.sin,sinh:Math.sinh,sqrt:Math.sqrt,tan:Math.tan,tanh:Math.tanh},this.timingTarget=e,this.val=t.val.value,this.time=t.time,t.fmla&&(this.fmla=this.parseFmla(t.fmla))}parseFmla(t){let e=t.replace(/#ppt_h/g,`(${this.timingTarget.design_ppt_h})`);return e=e.replace(/#ppt_w/g,`(${this.timingTarget.design_ppt_w})`),e=e.replace(/#ppt_x/g,`(${this.timingTarget.design_ppt_x})`),e=e.replace(/#ppt_y/g,`(${this.timingTarget.design_ppt_y})`),e=e.replace(/ppt_w/g,"vars.ppt_w"),e=e.replace(/ppt_h/g,"vars.ppt_h"),e=e.replace(/ppt_x/g,"vars.ppt_x"),e=e.replace(/ppt_y/g,"vars.ppt_y"),e=e.replace(/#/g,"vars."),["abs","acos","asin","atan","ceil","cos","cosh","deg","exp","floor","ln","max","min","rad","rand","sin","sinh","sqrt","tan","tanh","pi","e"].forEach(n=>{const r=new RegExp(`([^a-z])${n}([^a-z])`,"g");e=e.replace(r,(o,s,a)=>`${s}math.${n}${a}`)}),new Function("vars","math","$","return "+e)}}class Zm extends lh{constructor(t,e,n){super(t,e),this.value=t.val.value,n&&(this.fmla=this.parseFmla(n))}resolveValue(){return this.value}interpolationFrom(t,e,n){const r=t.resolveValue(n),o=r+(this.resolveValue()-r)*e;return t.fmla?t.fmla(n,this.math,o):o}}ah([Wl()],Zm.prototype,"interpolationFrom",null);class Qm extends lh{constructor(t,e){var n;super(t,e),this.value=(n=t.val)===null||n===void 0?void 0:n.value}interpolationFrom(t,e,n){let r=t.resolveValue(n);return e>this.time&&(r=this.resolveValue()),r}resolveValue(){return this.value||""}}ah([Wl()],Qm.prototype,"interpolationFrom",null);class Xs extends lh{constructor(t,e){super(t,e),this.fn=this.parseFmla(this.val)}resolveValue(t){return this.fn(t,this.math,1)}interpolationFrom(t,e,n){const r=t.resolveValue(n),o=r+(this.resolveValue(n)-r)*e;return t.fmla?t.fmla(n,this.math,o):o}}ah([Wl()],Xs.prototype,"interpolationFrom",null);class $m extends lh{constructor(t,e){super(t,e),this.value=t.val.value}interpolationFrom(t,e){return Ra(t.resolveValue(),this.value,e)}resolveValue(){return this.value}}ah([Wl()],$m.prototype,"interpolationFrom",null);class iT extends ko{constructor(t){super(t),this.isConflict=!0,this.activeWhenConflict="next",this.startVal=null,this.vars={ppt_x:0,ppt_y:0,ppt_w:0,ppt_h:0},this.keyFrames=[],this.isColorAnim=!1,this.onTimeNodeStart=()=>{this.timingTarget&&(this.startVal=sh(this.timingTarget,this.json.cBhvr.attrList[0]))},this.updateVars=()=>{var e,n,r,o;!((e=this.timingTarget)===null||e===void 0)&&e.ppt_h&&(this.vars.ppt_h=this.timingTarget.ppt_h),!((n=this.timingTarget)===null||n===void 0)&&n.ppt_w&&(this.vars.ppt_w=this.timingTarget.ppt_w),!((r=this.timingTarget)===null||r===void 0)&&r.ppt_x&&(this.vars.ppt_x=this.timingTarget.ppt_x),!((o=this.timingTarget)===null||o===void 0)&&o.ppt_y&&(this.vars.ppt_y=this.timingTarget.ppt_y),this.isColorAnim},this.onTimeUpdate=({duration:e,delta:n})=>{const r=n/e,o=this.keyFrames.findIndex(y=>r<=y[0]),{attrList:s}=this.json.cBhvr;if(o<0){const y=this.keyFrames[this.keyFrames.length-1];return void(this.timingTarget&&s&&s[0]&&Zr(this.timingTarget,s[0],y[1].resolveValue(this.vars)))}const a=o-1,h=this.keyFrames[o],l=this.keyFrames[a]||h,u=h[0]-l[0]==0?1:(r-l[0])/(h[0]-l[0]),p=h[1].interpolationFrom(l[1],u,this.vars);this.timingTarget&&s&&s[0]&&Zr(this.timingTarget,s[0],p)},this.onSeekToStart=()=>{this.startVal!==null&&this.timingTarget&&Zr(this.timingTarget,this.json.cBhvr.attrList[0],this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.initKeyFrames(),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("timelineStart",this.updateVars),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart)}get modifyAttrKey(){return this.json.cBhvr.attrList[0]}initKeyFrames(){var t;const{valueType:e}=this.json;if(this.json.tavLst.length<=0){if(this.json.to){if(this.json.from||this.startVal){const r={time:0,val:{type:"string",value:this.json.from||this.startVal.toString()},fmla:""};if(e==="num"&&this.timingTarget){const o=new Xs(r,this.timingTarget);this.keyFrames.push([r.time,o])}}const n={time:1,val:{type:"string",value:this.json.to},fmla:""};if(e==="num"&&this.timingTarget){const r=new Xs(n,this.timingTarget);this.keyFrames.push([n.time,r])}}else if(this.json.by){const n={time:0,val:{type:"string",value:this.json.cBhvr.attrList[0]},fmla:""};if(e==="num"&&this.timingTarget){const o=new Xs(n,this.timingTarget);this.keyFrames.push([n.time,o])}const r={time:1,val:{type:"string",value:(((t=n.val)===null||t===void 0?void 0:t.value)||"")+"+"+this.json.by},fmla:""};if(e==="num"&&this.timingTarget){const o=new Xs(r,this.timingTarget);this.keyFrames.push([r.time,o])}}}if(this.json.tavLst.length>0){for(const n of this.json.tavLst)if(n.val&&this.timingTarget){let r=null;n.val.type==="string"?e==="num"?r=new Xs(n,this.timingTarget):e==="str"&&(r=new Qm(n,this.timingTarget)):n.val.type==="number"?r=new Zm(n,this.timingTarget):n.val.type==="color"?(this.isColorAnim=!0,r=new $m(n,this.timingTarget)):n.val.type==="boolean"&&console.warn("not implements"),r&&this.keyFrames.push([n.time,r])}}}}class ur extends ce.k{constructor(t,e,n){super(t,e,n)}set percent(t){this.uniforms.percent=t}set transition(t){this.uniforms.transition=t}}var rT=v(121),oT=v.n(rT),sT=v(122),aT=v.n(sT),lT=v(123),hT=v.n(lT),uT=v(124),cT=v.n(uT),dT=v(9),Pr=v.n(dT),pT=v(125),fT=v.n(pT),mT=v(126),gT=v.n(mT);const tg="data:image/png;base64,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";var vT=v(127),_T=v.n(vT),yT=v(128),xT=v.n(yT),bT=v(129),TT=v.n(bT),ET=v(130),ST=v.n(ET),wT=v(131),AT=v.n(wT),MT=v(132),CT=v.n(MT),RT=v(133),IT=v.n(RT),PT=v(134),OT=v.n(PT),NT=v(135),LT=v.n(NT);const eg={wipe:class extends ur{constructor(i){super(aT.a,oT.a,{percent:0,direction:1,transition:0});let t=1;i==="up"?t=1:i==="down"?t=2:i==="left"?t=3:i==="right"&&(t=4),this.uniforms.direction=t}},fade:class extends ur{constructor(i){super(void 0,hT.a,{percent:0,transition:1});let t=1;i==="out"?t=-1:i==="in"&&(t=1),this.uniforms.transition=Math.pow(t,t)}},blinds:class extends ur{constructor(i){super(Pr.a,cT.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="vertical"?1:0}},checkerboard:class extends ur{constructor(i){super(Pr.a,fT.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="down"?1:0}},dissolve:class extends ur{constructor(i){super(Pr.a,gT.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.setTextTure()}setTextTure(){this.uniforms.dissolveSampler=ce.t.from(tg)}},randombar:class extends ur{constructor(i){super(Pr.a,_T.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="vertical"?1:0,this.setTextTure()}setTextTure(){this.uniforms.dissolveSampler=ce.t.from(tg)}},circle:class extends ur{constructor(i){super(Pr.a,xT.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="out"?1:0}},box:class extends ur{constructor(i){super(Pr.a,TT.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="out"?1:0}},diamond:class extends ur{constructor(i){super(Pr.a,ST.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="out"?1:0}},plus:class extends ur{constructor(i){super(Pr.a,AT.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="out"?1:0}},barn:class extends ur{constructor(i){super(Pr.a,CT.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="inHorizontal"?1:i==="outHorizontal"?2:i==="outVertical"?3:0}},strips:class extends ur{constructor(i){super(Pr.a,IT.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="upLeft"?1:i==="downRight"?2:i==="upRight"?3:0}},wedge:class extends ur{constructor(i){super(Pr.a,OT.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})}},wheel:class extends ur{constructor(i){super(Pr.a,LT.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=Number(i)||1}}};class DT extends ko{constructor(t){var e;super(t),this.filterType="",this.isConflict=!1,this.activeWhenConflict="prev",this.onTimeUpdate=({duration:o,delta:s})=>{var a;const h=s/o;if(this.filter){this.filter.percent=this.commonTimeNode.applyTimeFilter(h);const l=(a=this.timingTarget)===null||a===void 0?void 0:a.container.getBounds();l&&(this.filter.uniforms.uBoundRect=new Float32Array([l.x,l.y,l.width,l.height]))}h>=1&&this.timingTarget&&this.ctx.clock.setTimeout(()=>{var l;if(((l=this.timingTarget)===null||l===void 0?void 0:l.container.filters)&&this.filter){this.timingTarget.removeAnimationFilterQueue(this.filter);const u=this.timingTarget.getFirstAnimationFilter();this.timingTarget.container.filters=u?[u]:[]}})},this.onSeekToStart=()=>{this.timingTarget&&(this.timingTarget.container.filters=[],this.filter&&this.timingTarget.removeAnimationFilterQueue(this.filter))},this.onSeekToEnd=()=>{this.timingTarget&&(this.timingTarget.container.filters=[],this.filter&&this.timingTarget.removeAnimationFilterQueue(this.filter))},this.commonTimeNode.on("timelineStart",()=>{this.filter&&this.timingTarget&&(this.timingTarget.addToAnimationFilterQueue(this.filter),this.timingTarget.container.filters&&this.timingTarget.container.filters.length!==0||(this.timingTarget.container.filters=[this.filter]))}),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate);let n=1;t.json.transition==="out"&&(n=-1);const r=(e=t.json.filter)===null||e===void 0?void 0:e.match(/^([a-zA-Z]+)(\((.+)\))?/);if(r){const o=r[1],s=r[3];eg[o]&&(this.filter=new eg[o](s),this.filterType=`${o}-${s}`,this.filter&&(this.filter.transition=n))}}get modifyAttrKey(){return this.filterType}}class FT extends ko{constructor(t){super(t),this.isConflict=!0,this.activeWhenConflict="next",this.startPos=null,this.onTimeNodeStart=()=>{var e,n;this.startPos={x:((e=this.timingTarget)===null||e===void 0?void 0:e.ppt_x)||0,y:((n=this.timingTarget)===null||n===void 0?void 0:n.ppt_y)||0}},this.onTimeUpdate=({duration:e,delta:n})=>{var r;const o=n/e,s=(r=this.path)===null||r===void 0?void 0:r.getPoint(o);this.timingTarget&&s&&(this.timingTarget.ppt_x=s.x+this.timingTarget.design_ppt_x,this.timingTarget.ppt_y=s.y+ +this.timingTarget.design_ppt_y)},this.onSeekToStart=()=>{this.timingTarget&&this.startPos&&(this.timingTarget.ppt_x=this.startPos.x,this.timingTarget.ppt_y=this.startPos.y)},this.onSeekToEnd=()=>{var e,n,r;const o=(n=(e=this.commonTimeNode.json)===null||e===void 0?void 0:e.spd)!==null&&n!==void 0?n:1,s=(r=this.path)===null||r===void 0?void 0:r.getPoint(o>0?1:0);this.timingTarget&&s&&(this.timingTarget.ppt_x=s.x+this.timingTarget.design_ppt_x,this.timingTarget.ppt_y=s.y+this.timingTarget.design_ppt_y)},this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.createPath()}get modifyAttrKey(){return"motion"}createPath(){var t;const e=new Ps,n=(t=this.json.path)===null||t===void 0?void 0:t.match(/[MLCmlc][^MLCmlc]+/g);if(n)for(const r of n){const[o,...s]=r.trim().replace(/\s+/g," ").split(" ");if(o==="M"){const[a,h]=s.map(l=>Number(l));e.moveTo(a,h)}else if(o==="L"){const[a,h]=s.map(l=>Number(l));e.lineTo(a,h)}else if(o==="C"){const[a,h,l,u,p,y]=s.map(x=>Number(x));e.bezierCurveTo(a,h,l,u,p,y)}else if(o==="Z")e.closePath();else if(o==="E")console.warn("not implements");else if(o==="c"){const[a,h,l,u,p,y]=s.map(E=>Number(E)),x=e.currentPoint;e.bezierCurveTo(a+x.x,h+x.y,l+x.x,u+x.y,p+x.x,y+x.y)}else if(o==="l"){const a=e.currentPoint,[h,l]=s.map(u=>Number(u));e.lineTo(h+a.x,l+a.y)}else if(o==="m"){const a=e.currentPoint,[h,l]=s.map(u=>Number(u));e.moveTo(h+a.x,l+a.y)}}this.path=e}}class BT extends ko{constructor(t){super(t),this.isConflict=!0,this.activeWhenConflict="next",this.startVal=null,this.onTimelineStart=e=>{e.isReverse||this.updateCurrentValue()},this.onTimeUpdate=({duration:e,delta:n})=>{var r,o,s,a,h;const l=n/e,u={x:1,y:1};if(this.to){const p=(r=this.from)!==null&&r!==void 0?r:{x:(s=(o=this.startVal)===null||o===void 0?void 0:o.x)!==null&&s!==void 0?s:1,y:(h=(a=this.startVal)===null||a===void 0?void 0:a.y)!==null&&h!==void 0?h:1};u.x=p.x+(this.to.x-p.x)*l,u.y=p.y+(this.to.y-p.y)*l}else if(this.by){const p={x:this.by.x,y:this.by.y};u.x=1+(p.x-1)*l,u.y=1+(p.y-1)*l}this.timingTarget&&(this.timingTarget.scale=u)},this.onTimeNodeStart=()=>{this.timingTarget&&(this.startVal={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})},this.onSeekToStart=()=>{this.timingTarget&&this.startVal&&(this.timingTarget.scale=this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.from=t.json.from,this.to=t.json.to,this.by=t.json.by,this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart)}get modifyAttrKey(){return"scale"}updateCurrentValue(){this.timingTarget&&(this.current={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})}}class UT extends ko{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.isTimelineStart=!1,this.startColorString=null,this.currentColorString="#FFFFFFFF",this.onTimelineStart=e=>{if(this.isTimelineStart)return;this.isTimelineStart=!0,e.isReverse||this.updateCurrentValue(),this.from.isInit()||this.from.fromHexString(this.currentColorString),this.to.isInit()||this.from.by(this.by,this.to);const n=this.json.cBhvr.attrList[0],[r]=n.split(".");Zr(this.timingTarget,r+".on","true")},this.onTimeNodeEnd=()=>{const e=this.json.cBhvr.attrList[0];if(this.json.cBhvr.ctn.fill==="remove"){const[n]=e.split(".");Zr(this.timingTarget,n+".on","false")}this.isTimelineStart=!1},this.onSeekToStart=()=>{var e;const n=this.json.cBhvr.attrList[0];if(this.timingTarget){this.onTimeUpdate({duration:1,delta:0});const r=n==="ppt_c.color"||n==="text.color";if(((e=this.timingTarget.fill)===null||e===void 0?void 0:e.designColor.toUpperCase())===this.from.toHexString().toUpperCase()||r){const[o]=n.split(".");Zr(this.timingTarget,o+".on","false")}}},this.onTimeNodeStart=()=>{if(this.timingTarget){const e=this.json.cBhvr.attrList[0],n=sh(this.timingTarget,e);n&&(this.startColorString=n)}},this.onTimeUpdate=({delta:e,duration:n})=>{const r=e/n;if(this.to.interpolationFrom(this.from,r,this.target),this.timingTarget){const o=this.json.cBhvr.attrList[0];Zr(this.timingTarget,o,this.target.toHexString())}},this.onSeekToEnd=()=>{this.isTimelineStart||this.onTimelineStart({isReverse:!1,activeCount:0,id:""}),this.onTimeUpdate({duration:1,delta:1})},this.replaceAttrToRelation(),this.json.clrSpc==="rgb"?(this.from=new Zl(this.json.from),this.to=new Zl(this.json.to),this.by=new Zl(this.json.by),this.target=new Zl):(this.from=new Kl(this.json.from),this.to=new Kl(this.json.to),this.by=new Kl(this.json.by),this.target=new Kl),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeNodeEnd",this.onTimeNodeEnd),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate)}replaceAttrToRelation(){const t=this.json.cBhvr.attrList[0];t!=="ppt_c"?t==="style.color"&&(this.json.cBhvr.attrList[0]="text.color"):this.json.cBhvr.attrList[0]="ppt_c.color"}get modifyAttrKey(){return this.json.cBhvr.attrList[0]}updateCurrentValue(){if(this.timingTarget){const t=this.json.cBhvr.attrList[0],e=sh(this.timingTarget,t);e&&(this.currentColorString=e)}}}class kT extends ko{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.startVal=null,this.lastVal=null,this.onTimelineStart=e=>{this.lastVal=null,e.isReverse||this.updateCurrentValue()},this.onTimeUpdate=({duration:e,delta:n})=>{const r=n/e;let o=0,s=0;if(this.from!==void 0&&this.to!==void 0){o=this.from,s=this.to;const a=o+(s-o)*r;this.timingTarget&&(this.timingTarget.r=a)}else if(this.by!==void 0){this.lastVal||(this.lastVal=0);const a=this.by*r-this.lastVal;this.lastVal=this.by*r,this.timingTarget&&(this.timingTarget.r+=a)}},this.onTimeNodeStart=()=>{var e;as()((e=this.timingTarget)===null||e===void 0?void 0:e.r)&&(this.startVal=this.timingTarget.r)},this.onSeekToStart=()=>{this.timingTarget&&this.startVal!==null&&(this.timingTarget.r=this.startVal)},this.onSeekToEnd=()=>{this.onTimeUpdate({duration:1,delta:1,isReverse:!1})},this.from=this.json.from,this.to=this.json.to,this.by=this.json.by,this.by?this.isConflict=!1:this.isConflict=!0,this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate)}get modifyAttrKey(){return"rotate"}updateCurrentValue(){var t;this.currentVal=(t=this.timingTarget)===null||t===void 0?void 0:t.r}}class GT extends ko{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.isApplied=!1,this.onTimeUpdate=()=>{var e,n;const{cmd:r,cmdType:o}=this.json;!this.isApplied&&r&&o&&(this.isApplied=!0,(n=(e=this.timingTarget)===null||e===void 0?void 0:e.cmd)===null||n===void 0||n.applyCommand(r,o))},this.onSeekToStart=()=>{var e,n;this.commonTimeNode.isInInteractiveSeq||(n=(e=this.timingTarget)===null||e===void 0?void 0:e.cmd)===null||n===void 0||n.applyCommand("custom-pause","call")},this.onSeekToEnd=()=>{},this.commonTimeNode.on("timeNodeStart",()=>{this.isApplied=!1}),this.commonTimeNode.on("timeNodeEnd",()=>{this.isApplied=!1}),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("seekToStart",this.onSeekToStart),this.commonTimeNode.on("seekToEnd",this.onSeekToEnd)}get modifyAttrKey(){var t,e,n,r;return((e=(t=this.json)===null||t===void 0?void 0:t.cmd)!==null&&e!==void 0?e:"")+((r=(n=this.json)===null||n===void 0?void 0:n.cmdType)!==null&&r!==void 0?r:"")}}class HT{constructor(t){this.runtimeNodeEventHub=new yi.a,this.onVolumeUpdate=E=>{this.audio.volume(E)},this.stopAudio=()=>{this.audio.stop()},this.destroy=()=>{this.stopAudio(),this.audio.destroy(),this.ctx.activeMedia.delete(this.audio),this.ctx.volumeAdjuster.off("update",this.onVolumeUpdate)};const{json:e,isIterate:n,isSub:r,eventHub:o,ctx:s,parent:a,iterateType:h,iterateIndex:l,iterateId:u,isInInteractiveSeq:p,fromSeqId:y}=t;this.json=e,this.id=e.cMediaNode.ctn.id,this.commonTimeNode=new Ys({json:e.cMediaNode.ctn,isSub:r,eventHubs:{global:o,runtime:this.runtimeNodeEventHub},ctx:s,parent:a,isIterate:n,iterateType:h,iterateIndex:l,iterateId:u,isInInteractiveSeq:p,fromSeqId:y});let x=e.cMediaNode.tgtEl;s.loaderDelegate&&(x=s.loaderDelegate.redirectMedia(x),s.logger.info(`redirect media url from ${e.cMediaNode.tgtEl} to ${x} by delegate.`,s.taskId)),this.audio=new tc(x,s.runningAudio),s.activeMedia.add(this.audio),this.commonTimeNode.on("timelineStart",()=>{this.audio.volume(s.volumeAdjuster.volume),this.audio.play()}),this.commonTimeNode.on("seekToStart",this.stopAudio),this.commonTimeNode.on("seekToEnd",this.stopAudio),this.commonTimeNode.on("timeNodeDestroy",this.destroy),this.ctx=s,this.ctx.volumeAdjuster.on("update",this.onVolumeUpdate)}}var jT=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};class Ys extends yi.a{constructor(t){var e,n;super(),this.uuid=ss(),this.isSub=!1,this.isShadow=!1,this.startCount=0,this.applyCount=0,this.isReverse=!1,this.isConflictDispose=!1,this.isIterateEnd=!1,this.parentTimeNode=null,this.isActive=!1,this.isDestroy=!1,this.shouldSeekOnStart=!1,this.repeatTimeoutId="",this.iterateShadows=[],this.isEndEventsEmitted=!1,this.tmFilter=[],this.timeDelta=0,this.isIterate=!1,this.iterateType="el",this.iterateIndex=0,this.children=[],this.subList=[],this.duration=0,this.isNegativeSpeed=!1,this.handleEndCond=()=>{this.isActive&&(this.isActive=!1,this.isInfiniteRepeat()?this.repeatTimeNodeEnd():this.seekToEnd(!1,!0))},this.handleActive=(W=!0)=>{if(this.isActive=!0,this.isConflictDispose=!1,this.applyCount+=1,this.json.iterate||this.emit("timeNodeStart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.startCount>0&&this.json.restart){if(this.json.restart==="never")return;this.json.restart!=="whenNotActive"&&this.json.restart!=="always"||(this.seekToStart(),this.emit("timeNodeRestart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.startTimeLine(W))}else this.startTimeLine(W)},this.updateTimeLine=W=>{const Q=W/(yr.b.TARGET_FPMS||.06);this.timeDelta+=Q,this.duration-this.timeDelta<=Q&&(this.timeDelta=this.duration),this.timeDelta<this.duration?this.emit("timeUpdate",{delta:this.isReverse||this.isNegativeSpeed?this.duration-this.timeDelta:this.timeDelta,duration:this.duration,isReverse:this.isReverse}):(this.emit("timeUpdate",{delta:this.isReverse||this.isNegativeSpeed?0:this.duration,duration:this.duration,isReverse:this.isReverse}),this.onTimeLineEnd())},this.handleEnd=(W=!1)=>{(this.isTimeNodeEnd()||W)&&(this.isActive=!1,this.isSub&&this.destroy(),this.emitEndEvents())};const{isSub:r,isIterate:o,ctx:s,eventHubs:a,parent:h,json:l,iterateType:u,iterateId:p,iterateIndex:y,isInInteractiveSeq:x,fromSeqId:E}=t;this.isSub=r,this.fromSeqId=E,this.isInInteractiveSeq=x,this.isIterate=o,this.parentTimeNode=h,this.json=l,this.ctx=s,this.iterateIndex=y,this.eventHubs=a,this.iterateType=u,this.iterateId=p,this.tmFilter=(n=(e=l.tmFilter)===null||e===void 0?void 0:e.split(";").map(W=>W.split(",").map(Q=>parseFloat(Q.trim()))))!==null&&n!==void 0?n:[];const A=Number(this.json.dur),C=this.json.spd||1;if(this.isNegativeSpeed=C<0,Number.isNaN(A)||(this.duration=A/Math.abs(C)),this.uuid+="--"+this.json.id,this.setPreStyle(),l.childTnLst&&this.createChildren(l.childTnLst),this.startConds=new La(this.json.id||"",l.stCondLst,a,this.ctx),this.endConds=new La(this.json.id||"",l.endCondLst,a,this.ctx),l.endSync&&(this.endSync=new La(this.json.id||"",[l.endSync],a,this.ctx),this.endSync.on("active",()=>{var W;this.json.nodeType==="interactiveSeq"&&(this.isActive=!1,this.shouldSeekOnStart=!0,this.emit("timeNodeEndSync"),(W=this.endSync)===null||W===void 0||W.reset())})),this.startConds.on("active",W=>{this.isActive||(this.shouldSeekOnStart&&(this.shouldSeekOnStart=!1,this.seekToStart()),this.handleActive(W))}),this.endConds.on("active",()=>{this.handleEndCond(),this.children.forEach(W=>W.commonTimeNode.handleEndCond())}),this.parentTimeNode&&this.parentTimeNode.on("timeNodeStart",()=>{this.applyCount=0}),this.isSub&&this.json.masterRel==="nextClick"){const W="shape slide onNext"+this.fromSeqId;this.startConds.addCond({event:W})}this.json.iterate&&this.isIterate===!1&&this.createIterateShadow()}createIterateShadow(){const t=ss();let e=!0,n=0;const r=o=>{o===t&&(e=!1,this.ctx.eventHub.removeListener("IterateTimeNodeEnd",r))};for(this.ctx.eventHub.on("IterateTimeNodeEnd",r);e;){const o=JSON.parse(JSON.stringify(this.json)),s=new Ys({json:o,isSub:!1,eventHubs:this.eventHubs,ctx:this.ctx,parent:null,isIterate:!0,iterateType:o.iterate.type,iterateIndex:n,iterateId:t,isInInteractiveSeq:this.isInInteractiveSeq,fromSeqId:this.fromSeqId});this.iterateShadows[n]=s,n+=1}}isInfiniteRepeat(){return this.json.repeatCount>999999998}getReverse(){return this.isReverse}setReverse(t){this.isReverse=t}createTimeNode(t,e){let n=null;const r={json:t,isSub:e,isIterate:this.isIterate,eventHub:this.eventHubs.global,ctx:this.ctx,parent:this,iterateType:this.iterateType,iterateIndex:this.iterateIndex,iterateId:this.iterateId,isInInteractiveSeq:this.isInInteractiveSeq,fromSeqId:this.fromSeqId};return t.type==="seq"?n=new eT(r):t.type==="par"?n=new ng(r):t.type==="set"?n=new nT(r):t.type==="anim"?n=new iT(r):t.type==="animEffect"?n=new DT(r):t.type==="animMotion"?n=new FT(r):t.type==="animScale"?n=new BT(r):t.type==="animClr"?n=new UT(r):t.type==="animRot"?n=new kT(r):t.type==="cmd"?n=new GT(r):t.type==="audio"&&(n=new HT(r)),n}createSubList(t){this.subList&&this.subList.forEach(e=>e.commonTimeNode.destroy()),this.subList=[],t.forEach(e=>{const n=this.createTimeNode(e,!0);n&&this.subList.push(n)})}bindCommonTimeNodeEvent(t){t.commonTimeNode.on("timeNodeStart",e=>{this.emit("childTimeNodeStart",e)}),t.commonTimeNode.on("timeNodeEnd",e=>{this.emit("childTimeNodeEnd",e),this.children.every(n=>n.commonTimeNode.isTimeNodeEndWhenDetectEndSync())&&(this.json.iterate||this.allChildrenEndHandle())})}createChildren(t){function e(n){return(r=n,function(o){var s;return!!(!((s=o)===null||s===void 0)&&s.cBhvr)}(r)?r.cBhvr.ctn:function(o){var s,a;return!!(!((a=(s=o)===null||s===void 0?void 0:s.cMediaNode)===null||a===void 0)&&a.ctn)}(r)?r.cMediaNode.ctn:r.ctn).presetOrder;var r}t&&t[0]&&e(t[0])?[...t].sort((n,r)=>{var o,s;return((o=e(n))!==null&&o!==void 0?o:0)-((s=e(r))!==null&&s!==void 0?s:0)}).forEach(n=>{const r=this.createTimeNode(n,!1);r&&(this.bindCommonTimeNodeEvent(r),this.children.push(r))}):t.forEach(n=>{const r=this.createTimeNode(n,!1);r&&(this.bindCommonTimeNodeEvent(r),this.children.push(r))})}playReverse(){this.isReverse=!0,this.startReverseTimeLine(),this.children.forEach(t=>t.commonTimeNode.playReverse())}allChildrenEndHandle(){if(!this.isDestroy){if(this.json.autoRev&&!this.isReverse)return this.isReverse=!0,void this.playReverse();this.isReverse&&(this.isReverse=!1),this.json.repeatCount&&this.json.repeatCount>this.applyCount?this.repeatTimeoutId=this.ctx.clock.setTimeout(()=>{this.seekToStart(!1),this.resetForRepeat(),this.startTimeNodeRepeat()}):(this.json.iterate&&!this.isIterate&&(this.isIterateEnd=!0),this.eventHubs.runtime.emit("runtime all end"),this.startSubList(),this.handleEnd())}}resetForRepeat(){this.isInInteractiveSeq&&this.isInfiniteRepeat()&&this.repeatTimeNodeEnd(),this.timeDelta=0,this.children.forEach(t=>t.commonTimeNode.resetForRepeat())}startSubList(){this.subList.forEach(t=>t.commonTimeNode.startTimeNode())}startReverseTimeLine(){this.isEndEventsEmitted=!1,this.timeDelta=0;const t=1e3/this.ctx.ticker.maxFPS;this.duration<=t&&this.duration>0?(this.emit("timeUpdate",{delta:this.duration,duration:this.duration,isReverse:this.isReverse}),this.ctx.eventHub.emit(Qe.animateEnd),this.ctx.ticker.remove(this.updateTimeLine)):this.duration>t&&(this.ctx.eventHub.emit(Qe.animateStart),this.ctx.ticker.add(this.updateTimeLine))}startTimeLine(t=!0){if(t&&(this.isEndEventsEmitted=!1,this.eventHubs.global.emit(`time ${this.json.id} begin`),this.eventHubs.global.emit(`time ${this.json.id} onBegin`),this.eventHubs.runtime.emit(`runtime ${this.json.id} begin`)),this.json.iterate)return void this.startIterate();this.timeDelta=0,this.emit("timelineStart",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse});const e=1e3/this.ctx.ticker.maxFPS;this.duration<=e&&this.duration>0?(this.timeDelta=this.isReverse?0:this.duration,this.emit("timeUpdate",{delta:this.timeDelta,duration:this.duration,isReverse:this.isReverse}),this.emit("timelineEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}),this.ctx.ticker.addOnce(()=>{this.onTimeLineEnd()})):this.duration>e&&(this.ctx.eventHub.emit(Qe.animateStart),this.updateTimeLine(0),this.ctx.ticker.add(this.updateTimeLine))}startIterate(){return jT(this,void 0,void 0,function*(){if(this.json.iterate){this.isIterateEnd=!1;for(const t of this.iterateShadows){if(this.isIterateEnd)break;t.children.forEach(e=>{e.commonTimeNode.startTimeNode()}),t.applyCount+=1,yield this.ctx.clock.delay(this.json.iterate.interval)}this.onTimeLineEnd()}})}applyTimeFilter(t){if(!this.tmFilter.every(e=>as()(e[0])&&as()(e[1])))return t;for(let e=0;e<this.tmFilter.length;e++){const n=this.tmFilter[e];if(t<n[0]){const r=this.tmFilter[e-1];return(t-r[0])/(n[0]-r[0])*(n[1]-r[1])+r[1]}}return this.tmFilter.length>0?this.tmFilter[this.tmFilter.length-1][1]:t}isNatureTimeEnd(){return this.duration>=0&&this.timeDelta>=this.duration}findTargets(){const t=[],e=n=>{n.forEach(r=>{var o,s,a;r.cBhvr&&r.cBhvr.target&&t.findIndex(h=>h.id===r.cBhvr.target.id)<0&&t.push(r.cBhvr.target),((s=(o=r==null?void 0:r.cBhvr)===null||o===void 0?void 0:o.ctn)===null||s===void 0?void 0:s.childTnLst)&&r.cBhvr.ctn.childTnLst.length>0&&e(r.cBhvr.ctn.childTnLst),((a=r==null?void 0:r.ctn)===null||a===void 0?void 0:a.childTnLst)&&r.ctn.childTnLst.length>0&&e(r.ctn.childTnLst)})};return e(this.json.childTnLst||[]),t}setPreStyle(){this.json.presetClass&&this.findTargets().forEach(t=>{if(this.json.iterate){let e=0,n=!0;for(;n;){const r=this.ctx.timingTargets.getTarget(t,!0,{type:this.json.iterate.type,index:e,id:""});r&&(this.setPreStyleForTarget(r),e+=1),n=!!r}}else{const e=this.ctx.timingTargets.getTarget(t,!1);e&&this.setPreStyleForTarget(e)}})}setPreStyleForTarget(t){var e,n;if(t&&this.json.presetSubtype&&(t.presetSubType=this.json.presetSubtype),t&&!t.hasPreset)if(this.json.presetClass==="entr"){const r=(n=(e=this.json)===null||e===void 0?void 0:e.childTnLst)===null||n===void 0?void 0:n.filter(o=>o.type==="set"&&o.to==="visible");r!=null&&r.length&&(t.hasPreset=!0,t.style.visibility="hidden")}else(this.json.presetClass==="exit"||this.json.presetClass==="path"||this.json.presetClass==="emph")&&(t.hasPreset=!0,t.style.visibility="visible")}startTimeNodeRepeat(){this.timeDelta=0,this.isActive=!0,this.applyCount+=1,this.startTimeLine(!1),this.json.iterate||this.emit("timeNodeRepeat",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse})}startTimeNodeForce(){this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.timeDelta=0,this.isActive=!0,this.handleActive(!1)}startTimeNode(t=!0){if(this.isDestroy)return;this.collectStartValue(),this.timeDelta=0,this.isReverse=!1,this.json.subTnLst&&this.createSubList(this.json.subTnLst),this.startConds.setTriggerParams(t);const e=this.json.stCondLst.filter(r=>/^self/.test(r.event||""))[0];e&&this.startConds.condHandle(e);const n=this.json.endCondLst.filter(r=>/^self/.test(r.event||""))[0];n&&this.endConds.condHandle(n),this.startConds.condHandle()}onTimeLineEnd(){this.dispose(),(this.children.length===0||this.json.iterate)&&this.allChildrenEndHandle()}clearSubList(){this.subList.forEach(t=>t.commonTimeNode.destroy())}seekToStart(t=!0){if(this.isEndEventsEmitted=!1,this.isActive=!1,this.dispose(),this.timeDelta=0,this.emit("seekToStart"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach(e=>e.seekToStart(t));if(t)for(let e=this.subList.length-1;e>=0;e--){const n=this.subList[e];n==null||n.commonTimeNode.seekToStart()}for(let e=this.children.length-1;e>=0;e--){const n=this.children[e];n==null||n.commonTimeNode.seekToStart()}if(this.children.length>1)for(let e=this.children.length-1;e>=0;e--){const n=this.children[e];n==null||n.commonTimeNode.seekToStart()}}repeatTimeNodeEnd(){this.dispose(),this.children.forEach(t=>{t.commonTimeNode.isActive=!1,t.commonTimeNode.dispose()})}dispose(t=!1){this.isConflictDispose=t,this.ctx.clock.clearTimeout(this.repeatTimeoutId),this.ctx.eventHub.emit(Qe.animateEnd);try{this.ctx.ticker.remove(this.updateTimeLine)}catch{}this.startConds.reset(),this.endConds.reset()}seekToEnd(t,e=!1){if(this.isInfiniteRepeat())return;!this.isActive&&this.applyCount<=0&&this.collectStartValue(),this.applyCount=this.json.repeatCount,this.json.autoRev&&(this.isReverse=!0),this.timeDelta=this.duration,this.isActive=!1,this.dispose();const n=this.json.autoRev||t;if(n?this.emit("seekToStart"):this.emit("seekToEnd"),this.json.iterate&&!this.isIterate)return this.isIterateEnd=!0,void this.iterateShadows.forEach(r=>r.seekToEnd(n,e));this.children.length===0&&(this.eventHubs.runtime.emit("runtime all end"),this.handleEnd()),this.children.forEach(r=>r.commonTimeNode.seekToEnd(n,e)),e&&this.json.subTnLst&&(this.subList.length<=0&&this.createSubList(this.json.subTnLst),this.subList.forEach(r=>r.commonTimeNode.seekToEnd(!1)),this.clearSubList())}isTimeNodeEndWhenDetectEndSync(){if(this.isInInteractiveSeq&&this.isInfiniteRepeat())return!0;let t=!0;return this.children.length>0&&(t=t&&this.children.every(e=>e.commonTimeNode.isTimeNodeEndWhenDetectEndSync())),this.json.repeatCount&&(t=t&&this.applyCount>=this.json.repeatCount),this.json.autoRev&&(t=t&&!this.isReverse),t=t&&this.isNatureTimeEnd(),!!this.isConflictDispose||!(!this.isIterateEnd||!this.json.iterate)||t}isTimeNodeEnd(){let t=!0;return this.children.length>0&&(t=t&&this.children.every(e=>e.commonTimeNode.isTimeNodeEnd())),this.json.repeatCount&&(t=t&&this.applyCount>=this.json.repeatCount),this.json.autoRev&&(t=t&&!this.isReverse),t=t&&this.isNatureTimeEnd(),!!this.isConflictDispose||!(!this.isIterateEnd||!this.json.iterate)||t}emitEndEvents(){this.isEndEventsEmitted||(this.isEndEventsEmitted=!0,this.eventHubs.global.emit(`time ${this.json.id} end`),this.eventHubs.global.emit(`time ${this.json.id} onEnd`),this.eventHubs.runtime.emit(`runtime ${this.json.id} end`),this.emit("timeNodeEnd",{id:this.uuid,activeCount:this.applyCount,isReverse:this.isReverse}))}collectStartValue(){this.emit("timeNodeCreate"),this.children.forEach(t=>t.commonTimeNode.collectStartValue())}destroy(){this.emit("timeNodeDestroy"),this.isDestroy=!0,this.dispose(),this.startConds.removeAllListeners(),this.endConds.removeAllListeners(),this.children.forEach(t=>t.commonTimeNode.destroy()),this.clearSubList()}}class ng extends yi.a{constructor(t){super(),this.isRunning=!1,this.runtimeNodeEventHub=new yi.a;const{json:e,iterateType:n,isIterate:r,isSub:o,parent:s,ctx:a,eventHub:h,iterateIndex:l,iterateId:u,isInInteractiveSeq:p,fromSeqId:y}=t;this.id=e.ctn.id,this.json=e,this.ctx=a,this.isIterate=r,this.globalEventHub=h,this.commonTimeNode=new Ys({json:e.ctn,isSub:o,eventHubs:{global:h,runtime:this.runtimeNodeEventHub},ctx:a,parent:s,isIterate:!1,iterateType:n,iterateIndex:l,iterateId:u,isInInteractiveSeq:p,fromSeqId:y}),this.commonTimeNode.on("timeNodeStart",()=>{this.commonTimeNode.children.forEach(x=>{x.commonTimeNode.setReverse(this.commonTimeNode.getReverse()),x.commonTimeNode.startTimeNode()}),this.isRunning||(this.isRunning=!0,this.globalEventHub.emit(`runtime ${this.id} begin`),this.emit("begin"))}),this.commonTimeNode.on("timeNodeRepeat",()=>{this.commonTimeNode.children.forEach(x=>{x.commonTimeNode.startTimeNode(!1)})}),this.commonTimeNode.on("timeNodeEnd",()=>{this.commonTimeNode.isTimeNodeEnd()&&this.isRunning&&(this.isRunning=!1,this.globalEventHub.emit(`runtime ${this.id} end`),this.emit("end"))})}}var zT=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};class VT{constructor(t,e,n){this.json=t,this.ctx=n,this.globalEventHub=e;const r=t.timeNodeList.find(o=>o.type==="par"&&o.ctn.nodeType==="tmRoot");r&&(this.tmRoot=new ng({json:r,isSub:!1,isIterate:!1,eventHub:e,ctx:n,parent:null,iterateType:"el",iterateIndex:0,iterateId:"",isInInteractiveSeq:!1,fromSeqId:""}),this.mainSeq=this.tmRoot.commonTimeNode.children.find(o=>{var s,a,h;return((s=o.json)===null||s===void 0?void 0:s.type)==="seq"&&((h=(a=o.json)===null||a===void 0?void 0:a.ctn)===null||h===void 0?void 0:h.nodeType)==="mainSeq"}))}findSeq(t){var e;return(e=this.tmRoot)===null||e===void 0?void 0:e.commonTimeNode.children.find(n=>{var r,o,s;return((r=n.json)===null||r===void 0?void 0:r.type)==="seq"&&((s=(o=n.json)===null||o===void 0?void 0:o.ctn)===null||s===void 0?void 0:s.id)===t})}start(){var t,e;return zT(this,void 0,void 0,function*(){this.json.autoPlayMainSeq?(yield this.ctx.clock.delay(16),(t=this.mainSeq)===null||t===void 0||t.commonTimeNode.startTimeNode()):(e=this.mainSeq)===null||e===void 0||e.commonTimeNode.startTimeNode()})}setMainSeqApplied(){this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1)}collectMainSeqStartValue(){var t;(t=this.mainSeq)===null||t===void 0||t.commonTimeNode.collectStartValue()}setMainSeqStep(t,e){var n;t===-1&&this.mainSeq&&(this.mainSeq.commonTimeNode.applyCount=1),(n=this.mainSeq)===null||n===void 0||n.setCurrentStep(t,e)}destroy(){var t;this.globalEventHub.removeAllListeners(),(t=this.tmRoot)===null||t===void 0||t.commonTimeNode.destroy()}hasMainSeq(){return!!this.mainSeq&&this.mainSeq.commonTimeNode.children.length>0}currentMainSeqState(){return this.mainSeq?this.mainSeq.currentState:null}currentMainSeqStep(){return this.mainSeq?this.mainSeq.currentStep:0}currentMainSeqLength(){return this.mainSeq?this.mainSeq.stepLength:0}mainSeqHasNextStep(){return!!this.mainSeq&&this.mainSeq.hasNext()}mainSeqHasPrevStep(){return!!this.mainSeq&&this.mainSeq.hasPrev()}seekInteractiveSeqToEnd(t){const e=this.findSeq(t);e&&e.commonTimeNode.seekToEnd(!1,!0)}setInteractiveSeqState(t,e,n){const r=this.findSeq(t);r&&r.setCurrentStep(e,n)}resetAllInteractiveSeq(){var t;(((t=this.tmRoot)===null||t===void 0?void 0:t.commonTimeNode.children.filter(e=>{var n,r,o;return((n=e.json)===null||n===void 0?void 0:n.type)==="seq"&&((o=(r=e.json)===null||r===void 0?void 0:r.ctn)===null||o===void 0?void 0:o.nodeType)==="interactiveSeq"}))||[]).forEach(e=>{e.setCurrentStep(0,"start")})}applyInteractiveAction(t){this.globalEventHub.emit(t)}}var ig=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};class WT extends ec{constructor(t,e,n,r){super({id:"stage",width:t.width,height:t.height,type:"Container",children:t.children},e,n,void 0,r),this.isRendered=!1,this.isTimingStartValueCollected=!1,this.json=t,e.hasBackgroundFillShape=this.detectUseBackgroundFill(this.json),this.container.visible=!1,this.ctx=e;const o=new qi;o.beginFill(16777215),o.drawRect(0,0,t.width,t.height),o.endFill(),this.container.addChild(o)}detectUseBackgroundFill(t){return!!t&&(t.type==="Picture"||t.type==="Shape"?t.useBgFill:!(!t.children||!Array.isArray(t.children))&&t.children.some(e=>this.detectUseBackgroundFill(e)))}initOnReuse(){super.initOnReuse(),this.ctx.timingEventHub.on("c:prev slide",t=>{this.ctx.eventHub.emit(Qe.requestPrevSlide,t)}),this.ctx.timingEventHub.on("c:next slide",(t,e)=>{this.ctx.eventHub.emit(Qe.requestNextSlide,t,e)})}get interactiveContainer(){return this.container}render(t){this.isRendered||(this.collectAnimatedIds().forEach(e=>this.ctx.animatedIds.add(e)),this.isRendered=!0,super.render(t),t.addSubMTask(()=>ig(this,void 0,void 0,function*(){this.ctx.eventHub.emit("StageRenderEnd")}),"@StageImpl[emit.StageRenderEnd]"))}isListTimeNode(t){return["excel","seq","par"].indexOf(t.type)>=0}isAnimatedTimeNode(t){return!!t.cBhvr}collectAnimatedIdsForTimeNode(t,e){var n;this.isListTimeNode(t)?(n=t.ctn.childTnLst)===null||n===void 0||n.forEach(r=>{this.collectAnimatedIdsForTimeNode(r,e)}):this.isAnimatedTimeNode(t)&&e.push(t.cBhvr.target.id)}collectAnimatedIds(){const t=[];return this.json.timing&&this.json.timing.timeNodeList.forEach(e=>{this.collectAnimatedIdsForTimeNode(e,t)}),t}createTiming(){this.json.timing&&!this.timing&&(this.timing=new VT(this.json.timing,this.ctx.timingEventHub,this.ctx))}startTiming(){var t;return((t=this.timing)===null||t===void 0?void 0:t.start())||Promise.resolve()}setMainSeqApplied(){var t;(t=this.timing)===null||t===void 0||t.setMainSeqApplied()}setMainSeqStep(t,e){var n;(n=this.timing)===null||n===void 0||n.setMainSeqStep(t,e)}collectMainSeqStartValue(){var t;this.isTimingStartValueCollected||(this.isTimingStartValueCollected=!0,(t=this.timing)===null||t===void 0||t.collectMainSeqStartValue())}hasTiming(){return!!this.timing}clearOnSlideChange(){this.ctx.eventHub.removeAllListeners(),this.ctx.timingEventHub.removeAllListeners(),super.clearOnSlideChange()}clearOnTransactionEnd(){var t,e;this.ctx.timingTargets.getTargets().forEach(n=>{n.hasPreset=!1}),(t=this.timing)===null||t===void 0||t.resetAllInteractiveSeq(),(e=this.timing)===null||e===void 0||e.destroy(),this.timing=void 0}destroy(){var t,e;this.isTimingStartValueCollected=!1,this.isRendered=!1,this.ctx.eventHub.removeAllListeners(),this.ctx.graphicsTexture.destroy(),(t=this.ctx.bgTexture)===null||t===void 0||t.destroy(!0),this.ctx.spriteTexture.destroy(),this.ctx.timingEventHub.removeAllListeners(),(e=this.timing)===null||e===void 0||e.destroy(),this.timing=void 0,super.destroy()}mainSeqStep(){var t,e;return(e=(t=this.timing)===null||t===void 0?void 0:t.currentMainSeqStep())!==null&&e!==void 0?e:0}mainSeqLength(){var t,e;return(e=(t=this.timing)===null||t===void 0?void 0:t.currentMainSeqLength())!==null&&e!==void 0?e:0}mainSeqHasNextStep(){var t,e;return(e=(t=this.timing)===null||t===void 0?void 0:t.mainSeqHasNextStep())!==null&&e!==void 0&&e}mainSeqHasPrevStep(){var t,e;return(e=(t=this.timing)===null||t===void 0?void 0:t.mainSeqHasPrevStep())!==null&&e!==void 0&&e}mainSeqState(){return this.timing?this.timing.currentMainSeqState():null}nextStep(t,e){var n;this.hasTiming()&&((n=this.timing)===null||n===void 0?void 0:n.hasMainSeq())?(this.ctx.timingEventHub.emit("shape slide onStopAudio"),this.ctx.timingEventHub.emit("shape slide onNext",t,e)):this.ctx.eventHub.emit(Qe.requestNextSlide,t,e)}prevStep(t=!1){var e;this.hasTiming()&&((e=this.timing)===null||e===void 0?void 0:e.hasMainSeq())?(this.ctx.timingEventHub.emit("shape slide onStopAudio"),this.ctx.timingEventHub.emit("shape slide onPrev",t)):this.ctx.eventHub.emit(Qe.requestPrevSlide,t)}applyInteractiveAction(t){var e;(e=this.timing)===null||e===void 0||e.applyInteractiveAction(t)}seekInteractiveSeqToEnd(t){var e;(e=this.timing)===null||e===void 0||e.seekInteractiveSeqToEnd(t)}setInteractiveSeqState(t,e,n){var r;(r=this.timing)===null||r===void 0||r.setInteractiveSeqState(t,e,n)}setMediaState(t,e,n){return ig(this,void 0,void 0,function*(){const r=this.ctx.medias[t];r&&(e?n?(yield Xl(()=>r.clippedDuration>0,5e3),n<r.clippedDuration&&(r.once("play",()=>{r.seek(n)}),yield r.play())):yield r.play():(n&&r.seek(n),yield r.pause()))})}setMediaCurrentTime(t,e){const n=this.ctx.medias[t];n&&n.seek(e)}}class XT{constructor(t){this.ticker=t,this.tasks=[],this.couldRunning=!1,this.applyNext=()=>{const e=this.tasks[0];e&&e.applyNext()},t.add(this.applyNext)}addTask(t){this.tasks.push(t),t.once("task-finish",()=>{const e=this.tasks.indexOf(t);e>=0&&this.tasks.splice(e,1)}),t.once("task-error",()=>{const e=this.tasks.indexOf(t);e>=0&&this.tasks.splice(e,1)})}start(){this.couldRunning=!0}stop(){this.couldRunning=!1}}var YT=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};const qT=i=>new Promise(t=>setTimeout(t,i));class JT extends yi.a{constructor(t,e,n){super(),this.slideIndex=t,this.taskId=e,this.logger=n,this.uuid=ss(),this.isCancel=!1,this.tasks=[]}addMTask(t,e){this.tasks.push({fn:t,state:"wait",sub:[],name:e})}addSubMTask(t,e){let n=this.tasks.findIndex(r=>r.state==="running");n<0&&(n=0),this.tasks[n].sub.push({fn:t,state:"wait",sub:[],name:e})}cancel(){this.tasks=[],this.isCancel=!0}applyNext(){if(this.tasks.some(e=>e.state==="running")||this.tasks.some(e=>e.state==="error"))return;if(this.tasks.every(e=>e.state==="finish"))return void(this.isCancel||this.emit("task-finish"));const t=this.tasks.find(e=>e.state==="wait");t&&(t.state="running",t.fn.apply(null).then(()=>{if(t.state="finish",t.sub.length>0){const e=this.tasks.findIndex(n=>n===t);this.tasks.splice(e+1,0,...t.sub)}}).catch(e=>{t.state="error",this.logger.error(`${e} ${e.stack}`,this.taskId),this.emit("task-error",wi.transform(e),this.slideIndex)}))}applyAll(){return YT(this,void 0,void 0,function*(){for(;!this.tasks.every(t=>t.state==="finish");)if(this.tasks.some(t=>t.state==="running"))yield qT(16);else{if(this.tasks.some(t=>t.state==="error"))return;{const t=this.tasks.find(e=>e.state==="wait");if(t){t.state="running";try{if((yield js(()=>t.fn.apply(null),6e4))===ho)throw new wi(er.RuntimeError,`subtask ${t.name} apply timeout`);if(t.state="finish",t.sub.length>0){const e=this.tasks.findIndex(n=>n===t);this.tasks.splice(e+1,0,...t.sub)}}catch(e){let n;n=e!=null&&e.errorType?e:new wi(er.RuntimeError,`subtask ${t.name} error. ${e}`),t.state="error",this.logger.error(`${e} ${e.stack}`,this.taskId),this.emit("task-error",wi.transform(n),this.slideIndex);break}}}}!this.isCancel&&this.tasks.every(t=>t.state==="finish")&&this.emit("task-finish")})}}var KT=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})};class co{constructor(t,e){if(this.renderer=t,this.localStorage=e,this.outputData=new Map,this.loadingSdfKeys=new Set,!co.worker){const n=new Blob([`
7830
7830
  self.onmessage = function(e) {
7831
7831
  var data = e.data.data;
7832
7832
  var key = e.data.key;
@@ -7945,12 +7945,12 @@ self.onmessage = function(e) {
7945
7945
  </div>
7946
7946
 
7947
7947
  </div>`,AE=function(i,t){var e=i[t];return Ne.isArray(arguments[2])||Ne.isObject(arguments[2])?new bE(i,t,arguments[2]):Ne.isNumber(e)?Ne.isNumber(arguments[2])&&Ne.isNumber(arguments[3])?Ne.isNumber(arguments[4])?new dc(i,t,arguments[2],arguments[3],arguments[4]):new dc(i,t,arguments[2],arguments[3]):Ne.isNumber(arguments[4])?new fh(i,t,{min:arguments[2],max:arguments[3],step:arguments[4]}):new fh(i,t,{min:arguments[2],max:arguments[3]}):Ne.isString(e)?new TE(i,t):Ne.isFunction(e)?new Pg(i,t,""):Ne.isBoolean(e)?new Mg(i,t):null},ME=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(i){setTimeout(i,1e3/60)},CE=function(){function i(){Hr(this,i),this.backgroundElement=document.createElement("div"),Ne.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),de.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),Ne.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var t=this;de.bind(this.backgroundElement,"click",function(){t.hide()})}return jr(i,[{key:"show",value:function(){var t=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),Ne.defer(function(){t.backgroundElement.style.opacity=1,t.domElement.style.opacity=1,t.domElement.style.webkitTransform="scale(1)"})}},{key:"hide",value:function(){var t=this,e=function n(){t.domElement.style.display="none",t.backgroundElement.style.display="none",de.unbind(t.domElement,"webkitTransitionEnd",n),de.unbind(t.domElement,"transitionend",n),de.unbind(t.domElement,"oTransitionEnd",n)};de.bind(this.domElement,"webkitTransitionEnd",e),de.bind(this.domElement,"transitionend",e),de.bind(this.domElement,"oTransitionEnd",e),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"}},{key:"layout",value:function(){this.domElement.style.left=window.innerWidth/2-de.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-de.getHeight(this.domElement)/2+"px"}}]),i}();SE(function(i){if(i&&typeof window!="undefined"){var t=document.createElement("style");return t.setAttribute("type","text/css"),t.innerHTML=i,document.head.appendChild(t),i}}(`.dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .cr.function .property-name{width:100%}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}
7948
- `));var Ga=function(){try{return!!window.localStorage}catch{return!1}}(),mh=void 0,Ng=!0,Zs=void 0,fc=!1,Lg=[],si=function i(t){var e=this,n=t||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),de.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],n=Ne.defaults(n,{closeOnTop:!1,autoPlace:!0,width:i.DEFAULT_WIDTH}),n=Ne.defaults(n,{resizable:n.autoPlace,hideable:n.autoPlace}),Ne.isUndefined(n.load)?n.load={preset:"Default"}:n.preset&&(n.load.preset=n.preset),Ne.isUndefined(n.parent)&&n.hideable&&Lg.push(this),n.resizable=Ne.isUndefined(n.parent)&&n.resizable,n.autoPlace&&Ne.isUndefined(n.scrollable)&&(n.scrollable=!0);var r,o=Ga&&localStorage.getItem(Qs(this,"isLocal"))==="true",s=void 0,a=void 0;if(Object.defineProperties(this,{parent:{get:function(){return n.parent}},scrollable:{get:function(){return n.scrollable}},autoPlace:{get:function(){return n.autoPlace}},closeOnTop:{get:function(){return n.closeOnTop}},preset:{get:function(){return e.parent?e.getRoot().preset:n.load.preset},set:function(u){e.parent?e.getRoot().preset=u:n.load.preset=u,function(p){for(var y=0;y<p.__preset_select.length;y++)p.__preset_select[y].value===p.preset&&(p.__preset_select.selectedIndex=y)}(this),e.revert()}},width:{get:function(){return n.width},set:function(u){n.width=u,_c(e,u)}},name:{get:function(){return n.name},set:function(u){n.name=u,a&&(a.innerHTML=n.name)}},closed:{get:function(){return n.closed},set:function(u){n.closed=u,n.closed?de.addClass(e.__ul,i.CLASS_CLOSED):de.removeClass(e.__ul,i.CLASS_CLOSED),this.onResize(),e.__closeButton&&(e.__closeButton.innerHTML=u?i.TEXT_OPEN:i.TEXT_CLOSED)}},load:{get:function(){return n.load}},useLocalStorage:{get:function(){return o},set:function(u){Ga&&(o=u,u?de.bind(window,"unload",s):de.unbind(window,"unload",s),localStorage.setItem(Qs(e,"isLocal"),u))}}}),Ne.isUndefined(n.parent)){if(this.closed=n.closed||!1,de.addClass(this.domElement,i.CLASS_MAIN),de.makeSelectable(this.domElement,!1),Ga&&o){e.useLocalStorage=!0;var h=localStorage.getItem(Qs(this,"gui"));h&&(n.load=JSON.parse(h))}this.__closeButton=document.createElement("div"),this.__closeButton.innerHTML=i.TEXT_CLOSED,de.addClass(this.__closeButton,i.CLASS_CLOSE_BUTTON),n.closeOnTop?(de.addClass(this.__closeButton,i.CLASS_CLOSE_TOP),this.domElement.insertBefore(this.__closeButton,this.domElement.childNodes[0])):(de.addClass(this.__closeButton,i.CLASS_CLOSE_BOTTOM),this.domElement.appendChild(this.__closeButton)),de.bind(this.__closeButton,"click",function(){e.closed=!e.closed})}else{n.closed===void 0&&(n.closed=!0);var l=document.createTextNode(n.name);de.addClass(l,"controller-name"),a=mc(e,l),de.addClass(this.__ul,i.CLASS_CLOSED),de.addClass(a,"title"),de.bind(a,"click",function(u){return u.preventDefault(),e.closed=!e.closed,!1}),n.closed||(this.closed=!1)}n.autoPlace&&(Ne.isUndefined(n.parent)&&(Ng&&(Zs=document.createElement("div"),de.addClass(Zs,"dg"),de.addClass(Zs,i.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(Zs),Ng=!1),Zs.appendChild(this.domElement),de.addClass(this.domElement,i.CLASS_AUTO_PLACE)),this.parent||_c(e,n.width)),this.__resizeHandler=function(){e.onResizeDebounced()},de.bind(window,"resize",this.__resizeHandler),de.bind(this.__ul,"webkitTransitionEnd",this.__resizeHandler),de.bind(this.__ul,"transitionend",this.__resizeHandler),de.bind(this.__ul,"oTransitionEnd",this.__resizeHandler),this.onResize(),n.resizable&&IE(this),s=function(){Ga&&localStorage.getItem(Qs(e,"isLocal"))==="true"&&localStorage.setItem(Qs(e,"gui"),JSON.stringify(e.getSaveObject()))},this.saveToLocalStorageIfPossible=s,n.parent||((r=e.getRoot()).width+=1,Ne.defer(function(){r.width-=1}))};function mc(i,t,e){var n=document.createElement("li");return t&&n.appendChild(t),e?i.__ul.insertBefore(n,e):i.__ul.appendChild(n),i.onResize(),n}function Dg(i){de.unbind(window,"resize",i.__resizeHandler),i.saveToLocalStorageIfPossible&&de.unbind(window,"unload",i.saveToLocalStorageIfPossible)}function gc(i,t){var e=i.__preset_select[i.__preset_select.selectedIndex];e.innerHTML=t?e.value+"*":e.value}function Fg(i,t){var e=i.getRoot(),n=e.__rememberedObjects.indexOf(t.object);if(n!==-1){var r=e.__rememberedObjectIndecesToControllers[n];if(r===void 0&&(r={},e.__rememberedObjectIndecesToControllers[n]=r),r[t.property]=t,e.load&&e.load.remembered){var o=e.load.remembered,s=void 0;if(o[i.preset])s=o[i.preset];else{if(!o.Default)return;s=o.Default}if(s[n]&&s[n][t.property]!==void 0){var a=s[n][t.property];t.initialValue=a,t.setValue(a)}}}}function Ha(i,t,e,n){if(t[e]===void 0)throw new Error('Object "'+t+'" has no property "'+e+'"');var r=void 0;if(n.color)r=new pc(t,e);else{var o=[t,e].concat(n.factoryArgs);r=AE.apply(i,o)}n.before instanceof ps&&(n.before=n.before.__li),Fg(i,r),de.addClass(r.domElement,"c");var s=document.createElement("span");de.addClass(s,"property-name"),s.innerHTML=r.property;var a=document.createElement("div");a.appendChild(s),a.appendChild(r.domElement);var h=mc(i,a,n.before);return de.addClass(h,si.CLASS_CONTROLLER_ROW),r instanceof pc?de.addClass(h,"color"):de.addClass(h,yE(r.getValue())),function(l,u,p){if(p.__li=u,p.__gui=l,Ne.extend(p,{options:function(E){if(arguments.length>1){var A=p.__li.nextElementSibling;return p.remove(),Ha(l,p.object,p.property,{before:A,factoryArgs:[Ne.toArray(arguments)]})}if(Ne.isArray(E)||Ne.isObject(E)){var C=p.__li.nextElementSibling;return p.remove(),Ha(l,p.object,p.property,{before:C,factoryArgs:[E]})}},name:function(E){return p.__li.firstElementChild.firstElementChild.innerHTML=E,p},listen:function(){return p.__gui.listen(p),p},remove:function(){return p.__gui.remove(p),p}}),p instanceof dc){var y=new fh(p.object,p.property,{min:p.__min,max:p.__max,step:p.__step});Ne.each(["updateDisplay","onChange","onFinishChange","step","min","max"],function(E){var A=p[E],C=y[E];p[E]=y[E]=function(){var W=Array.prototype.slice.call(arguments);return C.apply(y,W),A.apply(p,W)}}),de.addClass(u,"has-slider"),p.domElement.insertBefore(y.domElement,p.domElement.firstElementChild)}else if(p instanceof fh){var x=function(E){if(Ne.isNumber(p.__min)&&Ne.isNumber(p.__max)){var A=p.__li.firstElementChild.firstElementChild.innerHTML,C=p.__gui.__listening.indexOf(p)>-1;p.remove();var W=Ha(l,p.object,p.property,{before:p.__li.nextElementSibling,factoryArgs:[p.__min,p.__max,p.__step]});return W.name(A),C&&W.listen(),W}return E};p.min=Ne.compose(x,p.min),p.max=Ne.compose(x,p.max)}else p instanceof Mg?(de.bind(u,"click",function(){de.fakeEvent(p.__checkbox,"click")}),de.bind(p.__checkbox,"click",function(E){E.stopPropagation()})):p instanceof Pg?(de.bind(u,"click",function(){de.fakeEvent(p.__button,"click")}),de.bind(u,"mouseover",function(){de.addClass(p.__button,"hover")}),de.bind(u,"mouseout",function(){de.removeClass(p.__button,"hover")})):p instanceof pc&&(de.addClass(u,"color"),p.updateDisplay=Ne.compose(function(E){return u.style.borderLeftColor=p.__color.toString(),E},p.updateDisplay),p.updateDisplay());p.setValue=Ne.compose(function(E){return l.getRoot().__preset_select&&p.isModified()&&gc(l.getRoot(),!0),E},p.setValue)}(i,h,r),i.__controllers.push(r),r}function Qs(i,t){return document.location.href+"."+t}function vc(i,t,e){var n=document.createElement("option");n.innerHTML=t,n.value=t,i.__preset_select.appendChild(n),e&&(i.__preset_select.selectedIndex=i.__preset_select.length-1)}function Bg(i,t){t.style.display=i.useLocalStorage?"block":"none"}function RE(i){var t=i.__save_row=document.createElement("li");de.addClass(i.domElement,"has-save"),i.__ul.insertBefore(t,i.__ul.firstChild),de.addClass(t,"save-row");var e=document.createElement("span");e.innerHTML="&nbsp;",de.addClass(e,"button gears");var n=document.createElement("span");n.innerHTML="Save",de.addClass(n,"button"),de.addClass(n,"save");var r=document.createElement("span");r.innerHTML="New",de.addClass(r,"button"),de.addClass(r,"save-as");var o=document.createElement("span");o.innerHTML="Revert",de.addClass(o,"button"),de.addClass(o,"revert");var s=i.__preset_select=document.createElement("select");if(i.load&&i.load.remembered?Ne.each(i.load.remembered,function(u,p){vc(i,p,p===i.preset)}):vc(i,"Default",!1),de.bind(s,"change",function(){for(var u=0;u<i.__preset_select.length;u++)i.__preset_select[u].innerHTML=i.__preset_select[u].value;i.preset=this.value}),t.appendChild(s),t.appendChild(e),t.appendChild(n),t.appendChild(r),t.appendChild(o),Ga){var a=document.getElementById("dg-local-explain"),h=document.getElementById("dg-local-storage");document.getElementById("dg-save-locally").style.display="block",localStorage.getItem(Qs(0,"isLocal"))==="true"&&h.setAttribute("checked","checked"),Bg(i,a),de.bind(h,"change",function(){i.useLocalStorage=!i.useLocalStorage,Bg(i,a)})}var l=document.getElementById("dg-new-constructor");de.bind(l,"keydown",function(u){!u.metaKey||u.which!==67&&u.keyCode!==67||mh.hide()}),de.bind(e,"click",function(){l.innerHTML=JSON.stringify(i.getSaveObject(),void 0,2),mh.show(),l.focus(),l.select()}),de.bind(n,"click",function(){i.save()}),de.bind(r,"click",function(){var u=prompt("Enter a new preset name.");u&&i.saveAs(u)}),de.bind(o,"click",function(){i.revert()})}function IE(i){var t=void 0;function e(o){return o.preventDefault(),i.width+=t-o.clientX,i.onResize(),t=o.clientX,!1}function n(){de.removeClass(i.__closeButton,si.CLASS_DRAG),de.unbind(window,"mousemove",e),de.unbind(window,"mouseup",n)}function r(o){return o.preventDefault(),t=o.clientX,de.addClass(i.__closeButton,si.CLASS_DRAG),de.bind(window,"mousemove",e),de.bind(window,"mouseup",n),!1}i.__resize_handle=document.createElement("div"),Ne.extend(i.__resize_handle.style,{width:"6px",marginLeft:"-3px",height:"200px",cursor:"ew-resize",position:"absolute"}),de.bind(i.__resize_handle,"mousedown",r),de.bind(i.__closeButton,"mousedown",r),i.domElement.insertBefore(i.__resize_handle,i.domElement.firstElementChild)}function _c(i,t){i.domElement.style.width=t+"px",i.__save_row&&i.autoPlace&&(i.__save_row.style.width=t+"px"),i.__closeButton&&(i.__closeButton.style.width=t+"px")}function gh(i,t){var e={};return Ne.each(i.__rememberedObjects,function(n,r){var o={},s=i.__rememberedObjectIndecesToControllers[r];Ne.each(s,function(a,h){o[h]=t?a.initialValue:a.getValue()}),e[r]=o}),e}si.toggleHide=function(){fc=!fc,Ne.each(Lg,function(i){i.domElement.style.display=fc?"none":""})},si.CLASS_AUTO_PLACE="a",si.CLASS_AUTO_PLACE_CONTAINER="ac",si.CLASS_MAIN="main",si.CLASS_CONTROLLER_ROW="cr",si.CLASS_TOO_TALL="taller-than-window",si.CLASS_CLOSED="closed",si.CLASS_CLOSE_BUTTON="close-button",si.CLASS_CLOSE_TOP="close-top",si.CLASS_CLOSE_BOTTOM="close-bottom",si.CLASS_DRAG="drag",si.DEFAULT_WIDTH=245,si.TEXT_CLOSED="Close Controls",si.TEXT_OPEN="Open Controls",si._keydownHandler=function(i){document.activeElement.type==="text"||i.which!==72&&i.keyCode!==72||si.toggleHide()},de.bind(window,"keydown",si._keydownHandler,!1),Ne.extend(si.prototype,{add:function(i,t){return Ha(this,i,t,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(i,t){return Ha(this,i,t,{color:!0})},remove:function(i){this.__ul.removeChild(i.__li),this.__controllers.splice(this.__controllers.indexOf(i),1);var t=this;Ne.defer(function(){t.onResize()})},destroy:function(){if(this.parent)throw new Error("Only the root GUI should be removed with .destroy(). For subfolders, use gui.removeFolder(folder) instead.");this.autoPlace&&Zs.removeChild(this.domElement);var i=this;Ne.each(this.__folders,function(t){i.removeFolder(t)}),de.unbind(window,"keydown",si._keydownHandler,!1),Dg(this)},addFolder:function(i){if(this.__folders[i]!==void 0)throw new Error('You already have a folder in this GUI by the name "'+i+'"');var t={name:i,parent:this};t.autoPlace=this.autoPlace,this.load&&this.load.folders&&this.load.folders[i]&&(t.closed=this.load.folders[i].closed,t.load=this.load.folders[i]);var e=new si(t);this.__folders[i]=e;var n=mc(this,e.domElement);return de.addClass(n,"folder"),e},removeFolder:function(i){this.__ul.removeChild(i.domElement.parentElement),delete this.__folders[i.name],this.load&&this.load.folders&&this.load.folders[i.name]&&delete this.load.folders[i.name],Dg(i);var t=this;Ne.each(i.__folders,function(e){i.removeFolder(e)}),Ne.defer(function(){t.onResize()})},open:function(){this.closed=!1},close:function(){this.closed=!0},hide:function(){this.domElement.style.display="none"},show:function(){this.domElement.style.display=""},onResize:function(){var i=this.getRoot();if(i.scrollable){var t=de.getOffset(i.__ul).top,e=0;Ne.each(i.__ul.childNodes,function(n){i.autoPlace&&n===i.__save_row||(e+=de.getHeight(n))}),window.innerHeight-t-20<e?(de.addClass(i.domElement,si.CLASS_TOO_TALL),i.__ul.style.height=window.innerHeight-t-20+"px"):(de.removeClass(i.domElement,si.CLASS_TOO_TALL),i.__ul.style.height="auto")}i.__resize_handle&&Ne.defer(function(){i.__resize_handle.style.height=i.__ul.offsetHeight+"px"}),i.__closeButton&&(i.__closeButton.style.width=i.width+"px")},onResizeDebounced:Ne.debounce(function(){this.onResize()},50),remember:function(){if(Ne.isUndefined(mh)&&((mh=new CE).domElement.innerHTML=wE),this.parent)throw new Error("You can only call remember on a top level GUI.");var i=this;Ne.each(Array.prototype.slice.call(arguments),function(t){i.__rememberedObjects.length===0&&RE(i),i.__rememberedObjects.indexOf(t)===-1&&i.__rememberedObjects.push(t)}),this.autoPlace&&_c(this,this.width)},getRoot:function(){for(var i=this;i.parent;)i=i.parent;return i},getSaveObject:function(){var i=this.load;return i.closed=this.closed,this.__rememberedObjects.length>0&&(i.preset=this.preset,i.remembered||(i.remembered={}),i.remembered[this.preset]=gh(this)),i.folders={},Ne.each(this.__folders,function(t,e){i.folders[e]=t.getSaveObject()}),i},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=gh(this),gc(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(i){this.load.remembered||(this.load.remembered={},this.load.remembered.Default=gh(this,!0)),this.load.remembered[i]=gh(this),this.preset=i,vc(this,i,!0),this.saveToLocalStorageIfPossible()},revert:function(i){Ne.each(this.__controllers,function(t){this.getRoot().load.remembered?Fg(i||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())},this),Ne.each(this.__folders,function(t){t.revert(t)}),i||gc(this.getRoot(),!1)},listen:function(i){var t=this.__listening.length===0;this.__listening.push(i),t&&function e(n){n.length!==0&&ME.call(window,function(){e(n)}),Ne.each(n,function(r){r.updateDisplay()})}(this.__listening)},updateDisplay:function(){Ne.each(this.__controllers,function(i){i.updateDisplay()}),Ne.each(this.__folders,function(i){i.updateDisplay()})}});var PE=si,OE=function(){function i(t){this.player=t}return Object.defineProperty(i.prototype,"frameRate",{get:function(){return this.player.fps.value},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"drawFrames",{get:function(){return this.player.runtime.fps},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"drawCall",{get:function(){return this.player.runtime.drawCall},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"resolution",{get:function(){return this.player.config.resolution},set:function(t){this.player.updateConfig({resolution:t})},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"size",{get:function(){var t,e;return((t=this.player.view)===null||t===void 0?void 0:t.width)+"*"+((e=this.player.view)===null||e===void 0?void 0:e.height)},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"minFPS",{get:function(){return this.player.config.minFPS},set:function(t){this.player.updateConfig({minFPS:t})},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"maxFPS",{get:function(){return this.player.config.maxFPS},set:function(t){this.player.updateConfig({maxFPS:t})},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"autoResolution",{get:function(){return this.player.config.autoResolution},set:function(t){this.player.updateConfig({autoResolution:t})},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"autoFPS",{get:function(){return this.player.config.autoFPS},set:function(t){this.player.updateConfig({autoFPS:t})},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"backgroundColor",{get:function(){return this.player.config.transactionBgColor},set:function(t){this.player.updateConfig({transactionBgColor:t})},enumerable:!1,configurable:!0}),i}(),NE=function(){function i(t,e){var n;this.config=new OE(t),this.anchor=e,n=this.createControllerGUI(),this.gui=n[0],this.controller=n[1],this.createStats()}return i.prototype.createStats=function(){var t=this;this.stateId=setInterval(function(){t.controller.frameRate.updateDisplay(),t.controller.size.updateDisplay(),t.controller.minFPS.updateDisplay(),t.controller.drawFrames.updateDisplay(),t.controller.maxFPS.updateDisplay(),t.controller.resolution.updateDisplay(),t.controller.autoFps.updateDisplay(),t.controller.autoResolution.updateDisplay(),t.controller.drawCall.updateDisplay()},16)},i.prototype.createControllerGUI=function(){var t=new PE({autoPlace:!0,closed:!0});t.domElement.style.opacity=".6",t.domElement.style.transformOrigin="100% 0",t.domElement.style.transform="scale(1)",this.anchor.appendChild(t.domElement),t.domElement.style.position="absolute",t.domElement.style.right="0",t.domElement.style.top="0",t.domElement.style.zIndex="2";var e={frameRate:t.add(this.config,"frameRate"),drawFrames:t.add(this.config,"drawFrames"),drawCall:t.add(this.config,"drawCall"),size:t.add(this.config,"size"),minFPS:t.add(this.config,"minFPS",0,60),maxFPS:t.add(this.config,"maxFPS",0,60),resolution:t.add(this.config,"resolution",.5,8,.5),autoResolution:t.add(this.config,"autoResolution"),autoFps:t.add(this.config,"autoFPS"),transactionBgColor:t.addColor(this.config,"backgroundColor")};return[t,e]},i.prototype.destroy=function(){try{window.clearInterval(this.stateId),this.anchor.removeChild(this.gui.domElement),this.gui.destroy()}catch{}},i}(),LE=function(){function i(t){var e=this;this.tasks=[],this.isDestroy=!1,this.isScheduling=!1,this.schedule=function(){e.isScheduling=!0;var n=e.tasks.shift();n&&!e.isDestroy&&e.fn(n).then(function(){e.tasks.length>0?window.requestAnimationFrame(e.schedule):e.isScheduling=!1})},this.fn=t}return i.prototype.destroy=function(){this.isDestroy=!0},i.prototype.addTask=function(t){this.tasks.push(t),this.isScheduling||this.schedule()},i}(),DE=function(){function i(t){this.autoUnlock=Object.create(null),this.locks=Object.create(null),this.available=!1,this.available=t}return i.prototype.addLock=function(t,e){var n=this;this.available&&(this.locks[t]=e,this.autoUnlock[t]=window.setTimeout(function(){delete n.locks[t]},3e3))},i.prototype.unlock=function(t,e){this.available&&e&&this.locks[t]&&this.locks[t]===e&&(window.clearTimeout(this.autoUnlock[t]),delete this.locks[t])},i.prototype.isLocked=function(t){return!!this.available&&!!this.locks[t]},i}(),FE=function(){function i(){var t=this;this.tasks=[],this.isDestroy=!1,this.isScheduling=!1,this.schedule=function(){t.isScheduling=!0;var e=t.tasks.shift();e&&!t.isDestroy&&(e.status="running",e.fn.apply(null).then(function(){t.tasks.length>0?window.requestAnimationFrame(t.schedule):t.isScheduling=!1}).catch(function(){t.tasks.length>0?window.requestAnimationFrame(t.schedule):t.isScheduling=!1}))}}return i.prototype.getRunningTask=function(){return this.tasks[0]&&this.tasks[0].status==="running"?this.tasks[0]:null},i.prototype.addTask=function(t,e){var n={type:t,status:"wait",fn:e},r=this.getRunningTask();r&&t===r.type||(this.tasks=this.tasks.filter(function(o){return o.type!==t}),this.tasks.push(n),this.isScheduling||this.schedule())},i.prototype.destroy=function(){this.isDestroy=!0},i}(),BE=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})},UE=function(i,t){var e,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(h){return function(l){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;s;)try{if(e=1,n&&(r=2&u[0]?n.return:u[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,u[1])).done)return r;switch(n=0,r&&(u=[2&u[0],r.value]),u[0]){case 0:case 1:r=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,n=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(r=s.trys,!((r=r.length>0&&r[r.length-1])||u[0]!==6&&u[0]!==2)){s=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){s.label=u[1];break}if(u[0]===6&&s.label<r[1]){s.label=r[1],r=u;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(u);break}r[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(i,s)}catch(p){u=[6,p],n=0}finally{e=r=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([h,l])}}};function kE(i,t,e){return BE(this,void 0,void 0,function(){var n,r,o,s;return UE(this,function(a){switch(a.label){case 0:return n=document.createElement("div"),(r=new po({anchor:n,renderOptions:{minFPS:1,maxFPS:1,resolution:1},mode:"local",interactive:!1,useLocalCache:!0})).setResource(i,t),[4,r.getSlideCountAsync()];case 1:o=a.sent(),s=1,a.label=2;case 2:return s<=o?[4,r.player.stagePool.preload(s,!0)]:[3,5];case 3:a.sent(),e(Math.round(s/o*100)/100),a.label=4;case 4:return s++,[3,2];case 5:return r.destroy(),[2]}})})}var GE=function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])})(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),ja=function(){return(ja=Object.assign||function(i){for(var t,e=1,n=arguments.length;e<n;e++)for(var r in t=arguments[e])Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r]);return i}).apply(this,arguments)},HE=function(i,t,e,n){var r,o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(t,e,s):r(t,e))||s);return o>3&&s&&Object.defineProperty(t,e,s),s},Ji=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})},Ki=function(i,t){var e,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(h){return function(l){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;s;)try{if(e=1,n&&(r=2&u[0]?n.return:u[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,u[1])).done)return r;switch(n=0,r&&(u=[2&u[0],r.value]),u[0]){case 0:case 1:r=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,n=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(r=s.trys,!((r=r.length>0&&r[r.length-1])||u[0]!==6&&u[0]!==2)){s=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){s.label=u[1];break}if(u[0]===6&&s.label<r[1]){s.label=r[1],r=u;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(u);break}r[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(i,s)}catch(p){u=[6,p],n=0}finally{e=r=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([h,l])}}},jE=window.ResizeObserver||pE,vh=function(i){return new Promise(function(t){return setTimeout(t,i)})};function zE(i,t){return Ji(this,void 0,void 0,function(){var e;return Ki(this,function(n){switch(n.label){case 0:e=Date.now(),n.label=1;case 1:return!i()&&Date.now()-e<t?[4,vh(50)]:[3,3];case 2:return n.sent(),e=Date.now(),[3,1];case 3:return[2]}})})}var lr={syncDispatch:"syncDispatch",syncReceive:"syncReceive",syncEventLag:"syncEventLag",renderStart:"renderStart",renderEnd:"renderEnd",renderError:"renderError",slideChange:"slideChange",mainSeqStepStart:"mainSeqStepStart",mainSeqStepEnd:"mainSeqStepEnd",animateStart:"animateStart",animateEnd:"animateEnd",stateChange:"stateChange",slideStepEnd:"slideEnd",slideStepStart:"slideStart"},Ug={taskId:"",url:"",currentSlideIndex:-1,mainSeqStep:-1,mainSeqState:null,mediaState:Object.create(null),interactiveSeqState:Object.create(null)},yc="";try{yc="1.0.0"}catch{yc="-dev"}var cr=null;try{(cr=I.createInstance({name:"__slide_local_log__",driver:I.INDEXEDDB,version:1})).ready(function(i){}).catch(function(i){})}catch{}var po=function(i){function t(r){var o=i.call(this)||this;return o.iosResetCache=[],o.needClearCacheImage=!1,o.version=yc,o.__slideState=lg()(Ug),o.userInputTime=0,o.isSyncingSlideState=!1,o.frozenTaskManager=new FE,o.randomId=M(),o.resize=!1,o.isAnimating=!1,o.renderingTaskManager=new vE,o.isLoading=!1,o.interactive=!0,o.renderingIndex=0,o.frameWidth=1,o.frameHeight=1,o.frame=document.createElement("div"),o.canvasContainer=document.createElement("div"),o.medianController=document.createElement("div"),o.frameResizeObserver=new jE(function(){return o.frameResizeHandler()}),o.timestamp=function(){return Date.now()},o.mode="local",o.enableGlobalClick=!1,o.lastEmitedState=null,o.playerController=null,o.isInitResized=!1,o.cacheImage=document.createElement("img"),o.isTouchStart=!1,o.touchStartId=void 0,o.taskId="",o.volumeAdjuster=new og,o.designWidth=0,o.designHeight=0,o._slideCount=0,o._dispatchIncrId=0,o._receiveIncrId=0,o._updateVolumeByStaticAdjuster=function(s){o.volumeAdjuster.volume=s},o.recoverHandler=function(s){if(s.data.type==="@slide/_recover_"&&s.data.slideId===o.randomId){var a=s.data,h=a.recoverBy,l=a.payload;if(!l)return;h==="renderOtherPage"&&l.slideIndex?o.doRenderSlide(l.slideIndex).catch(function(u){o.logger.error(u,o.taskId)}):h==="reloadCurrentPage"&&o.doRenderSlide(o.renderingIndex).catch(function(u){o.logger.error(u,o.taskId)})}},o.userInputHandle=function(){o.userInputTime=Date.now()},o.handleViewClick=function(){setTimeout(function(){var s=Date.now();Math.abs(s-o.userInputTime)>500&&o.enableGlobalClick&&o.nextStep()})},o.handleViewTouchStart=function(){window.clearTimeout(o.touchStartId),o.isTouchStart=!0,o.touchStartId=setTimeout(function(){o.isTouchStart=!1},350)},o.handleViewTouchEnd=function(){o.isTouchStart&&(o.isTouchStart=!1,o.handleViewClick())},o.handleSlideRef=function(){console.log(o),window.__slide=o},o.receiveSyncHandler=function(s){return Ji(o,void 0,void 0,function(){var a,h,l,u,p,y=this;return Ki(this,function(x){switch(x.label){case 0:return as()(s.incrId)&&(s.incrId&&s.incrId-this._receiveIncrId!=1&&this.emit(lr.syncEventLag),this._receiveIncrId=s.incrId||0),this.logger.info("sync receive "+JSON.stringify(s),this.taskId),s.type!=="nextStep"?[3,1]:(this.mainSeqStep!==s.next-1&&this.mainSeqStep+1!==this.mainSeqLength&&this.player?(this.setMainSeqStep(s.next,"start"),this.player.nextTick(function(){y.doNextStep(!0,s.clientId||"")})):this.doNextStep(!0,s.clientId||""),[3,6]);case 1:return s.type!=="prevStep"?[3,2]:(this.mainSeqStep===0&&this.mainSeqState==="idle"||this.mainSeqStep===s.next+1||this.mainSeqStep+1===this.mainSeqLength?this.doPrevStep(!0):(this.setMainSeqStep(s.next+1,"start"),(a=this.player)===null||a===void 0||a.nextTick(function(){y.doPrevStep(!0)})),[3,6]);case 2:return s.type!=="interactiveAnim"?[3,3]:(this.player?this.player.applyInteractiveAction(s.action):this.__slideState.interactiveSeqState[s.seqId]?this.__slideState.interactiveSeqState[s.seqId].step+=1:this.__slideState.interactiveSeqState[s.seqId]={step:0,state:"end"},[3,6]);case 3:return s.type!=="renderSlide"?[3,5]:[4,this.doRenderSlide(s.index,s.isForward)];case 4:return x.sent(),[3,6];case 5:s.type==="mediaPlay"?((h=this.player)===null||h===void 0||h.setMediaState(s.id,!0),this.__slideState.mediaState[s.id]=s.state):s.type==="mediaPause"?((l=this.player)===null||l===void 0||l.setMediaState(s.id,!1),this.__slideState.mediaState[s.id]=s.state):s.type==="mediaSeek"?((u=this.player)===null||u===void 0||u.setMediaCurrentTime(s.id,s.time),this.__slideState.mediaState[s.id]=s.state):s.type==="mediaFullscreen"&&(s.targetId&&this.__slideState.mediaState[s.targetId]?this.__slideState.mediaState[s.targetId].fullscreen=s.state:this.__slideState.mediaState[s.targetId]={fullscreen:s.state,type:"pause",time:0},(p=this.player)===null||p===void 0||p.syncFullscreenVideoState({targetId:s.targetId,state:s.state,slideIndex:s.slideIndex})),x.label=6;case 6:return[2]}})})},o.handlePrevSlide=function(s){return s===void 0&&(s=!1),Ji(o,void 0,void 0,function(){var a;return Ki(this,function(h){return this.player?((a=this.player.prevSlideIndex)>=1&&(this.config.navigatorDelegate?this.config.navigatorDelegate.gotoPage(a):s?this.doRenderSlide(a,!1):this.renderSlide(a,!1)),[2]):[2]})})},o.handleNextSlide=function(s){return s===void 0&&(s=!1),Ji(o,void 0,void 0,function(){var a;return Ki(this,function(h){return this.player?((a=this.player.nextSlideIndex)<=this.slideCount&&(this.config.navigatorDelegate?this.config.navigatorDelegate.gotoPage(a):s?this.doRenderSlide(a,!0):this.renderSlide(a,!0)),[2]):[2]})})},o.handleGotoSlide=function(s){if(s<=o.slideCount&&s>=1){var a=o.slideState.currentSlideIndex<=s;o.renderSlide(s,a)}else s===-1&&o.renderSlide(o.slideCount,!0)},t.instances.push(o),o.config=o.initSlideConfig(r),o.logger={info:function(s,a){var h;t.appendLogString("INFO - "+new Date().toISOString()+" - {"+o.randomId+"}["+a+"] "+s+`
7948
+ `));var Ga=function(){try{return!!window.localStorage}catch{return!1}}(),mh=void 0,Ng=!0,Zs=void 0,fc=!1,Lg=[],si=function i(t){var e=this,n=t||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),de.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],n=Ne.defaults(n,{closeOnTop:!1,autoPlace:!0,width:i.DEFAULT_WIDTH}),n=Ne.defaults(n,{resizable:n.autoPlace,hideable:n.autoPlace}),Ne.isUndefined(n.load)?n.load={preset:"Default"}:n.preset&&(n.load.preset=n.preset),Ne.isUndefined(n.parent)&&n.hideable&&Lg.push(this),n.resizable=Ne.isUndefined(n.parent)&&n.resizable,n.autoPlace&&Ne.isUndefined(n.scrollable)&&(n.scrollable=!0);var r,o=Ga&&localStorage.getItem(Qs(this,"isLocal"))==="true",s=void 0,a=void 0;if(Object.defineProperties(this,{parent:{get:function(){return n.parent}},scrollable:{get:function(){return n.scrollable}},autoPlace:{get:function(){return n.autoPlace}},closeOnTop:{get:function(){return n.closeOnTop}},preset:{get:function(){return e.parent?e.getRoot().preset:n.load.preset},set:function(u){e.parent?e.getRoot().preset=u:n.load.preset=u,function(p){for(var y=0;y<p.__preset_select.length;y++)p.__preset_select[y].value===p.preset&&(p.__preset_select.selectedIndex=y)}(this),e.revert()}},width:{get:function(){return n.width},set:function(u){n.width=u,_c(e,u)}},name:{get:function(){return n.name},set:function(u){n.name=u,a&&(a.innerHTML=n.name)}},closed:{get:function(){return n.closed},set:function(u){n.closed=u,n.closed?de.addClass(e.__ul,i.CLASS_CLOSED):de.removeClass(e.__ul,i.CLASS_CLOSED),this.onResize(),e.__closeButton&&(e.__closeButton.innerHTML=u?i.TEXT_OPEN:i.TEXT_CLOSED)}},load:{get:function(){return n.load}},useLocalStorage:{get:function(){return o},set:function(u){Ga&&(o=u,u?de.bind(window,"unload",s):de.unbind(window,"unload",s),localStorage.setItem(Qs(e,"isLocal"),u))}}}),Ne.isUndefined(n.parent)){if(this.closed=n.closed||!1,de.addClass(this.domElement,i.CLASS_MAIN),de.makeSelectable(this.domElement,!1),Ga&&o){e.useLocalStorage=!0;var h=localStorage.getItem(Qs(this,"gui"));h&&(n.load=JSON.parse(h))}this.__closeButton=document.createElement("div"),this.__closeButton.innerHTML=i.TEXT_CLOSED,de.addClass(this.__closeButton,i.CLASS_CLOSE_BUTTON),n.closeOnTop?(de.addClass(this.__closeButton,i.CLASS_CLOSE_TOP),this.domElement.insertBefore(this.__closeButton,this.domElement.childNodes[0])):(de.addClass(this.__closeButton,i.CLASS_CLOSE_BOTTOM),this.domElement.appendChild(this.__closeButton)),de.bind(this.__closeButton,"click",function(){e.closed=!e.closed})}else{n.closed===void 0&&(n.closed=!0);var l=document.createTextNode(n.name);de.addClass(l,"controller-name"),a=mc(e,l),de.addClass(this.__ul,i.CLASS_CLOSED),de.addClass(a,"title"),de.bind(a,"click",function(u){return u.preventDefault(),e.closed=!e.closed,!1}),n.closed||(this.closed=!1)}n.autoPlace&&(Ne.isUndefined(n.parent)&&(Ng&&(Zs=document.createElement("div"),de.addClass(Zs,"dg"),de.addClass(Zs,i.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(Zs),Ng=!1),Zs.appendChild(this.domElement),de.addClass(this.domElement,i.CLASS_AUTO_PLACE)),this.parent||_c(e,n.width)),this.__resizeHandler=function(){e.onResizeDebounced()},de.bind(window,"resize",this.__resizeHandler),de.bind(this.__ul,"webkitTransitionEnd",this.__resizeHandler),de.bind(this.__ul,"transitionend",this.__resizeHandler),de.bind(this.__ul,"oTransitionEnd",this.__resizeHandler),this.onResize(),n.resizable&&IE(this),s=function(){Ga&&localStorage.getItem(Qs(e,"isLocal"))==="true"&&localStorage.setItem(Qs(e,"gui"),JSON.stringify(e.getSaveObject()))},this.saveToLocalStorageIfPossible=s,n.parent||((r=e.getRoot()).width+=1,Ne.defer(function(){r.width-=1}))};function mc(i,t,e){var n=document.createElement("li");return t&&n.appendChild(t),e?i.__ul.insertBefore(n,e):i.__ul.appendChild(n),i.onResize(),n}function Dg(i){de.unbind(window,"resize",i.__resizeHandler),i.saveToLocalStorageIfPossible&&de.unbind(window,"unload",i.saveToLocalStorageIfPossible)}function gc(i,t){var e=i.__preset_select[i.__preset_select.selectedIndex];e.innerHTML=t?e.value+"*":e.value}function Fg(i,t){var e=i.getRoot(),n=e.__rememberedObjects.indexOf(t.object);if(n!==-1){var r=e.__rememberedObjectIndecesToControllers[n];if(r===void 0&&(r={},e.__rememberedObjectIndecesToControllers[n]=r),r[t.property]=t,e.load&&e.load.remembered){var o=e.load.remembered,s=void 0;if(o[i.preset])s=o[i.preset];else{if(!o.Default)return;s=o.Default}if(s[n]&&s[n][t.property]!==void 0){var a=s[n][t.property];t.initialValue=a,t.setValue(a)}}}}function Ha(i,t,e,n){if(t[e]===void 0)throw new Error('Object "'+t+'" has no property "'+e+'"');var r=void 0;if(n.color)r=new pc(t,e);else{var o=[t,e].concat(n.factoryArgs);r=AE.apply(i,o)}n.before instanceof ps&&(n.before=n.before.__li),Fg(i,r),de.addClass(r.domElement,"c");var s=document.createElement("span");de.addClass(s,"property-name"),s.innerHTML=r.property;var a=document.createElement("div");a.appendChild(s),a.appendChild(r.domElement);var h=mc(i,a,n.before);return de.addClass(h,si.CLASS_CONTROLLER_ROW),r instanceof pc?de.addClass(h,"color"):de.addClass(h,yE(r.getValue())),function(l,u,p){if(p.__li=u,p.__gui=l,Ne.extend(p,{options:function(E){if(arguments.length>1){var A=p.__li.nextElementSibling;return p.remove(),Ha(l,p.object,p.property,{before:A,factoryArgs:[Ne.toArray(arguments)]})}if(Ne.isArray(E)||Ne.isObject(E)){var C=p.__li.nextElementSibling;return p.remove(),Ha(l,p.object,p.property,{before:C,factoryArgs:[E]})}},name:function(E){return p.__li.firstElementChild.firstElementChild.innerHTML=E,p},listen:function(){return p.__gui.listen(p),p},remove:function(){return p.__gui.remove(p),p}}),p instanceof dc){var y=new fh(p.object,p.property,{min:p.__min,max:p.__max,step:p.__step});Ne.each(["updateDisplay","onChange","onFinishChange","step","min","max"],function(E){var A=p[E],C=y[E];p[E]=y[E]=function(){var W=Array.prototype.slice.call(arguments);return C.apply(y,W),A.apply(p,W)}}),de.addClass(u,"has-slider"),p.domElement.insertBefore(y.domElement,p.domElement.firstElementChild)}else if(p instanceof fh){var x=function(E){if(Ne.isNumber(p.__min)&&Ne.isNumber(p.__max)){var A=p.__li.firstElementChild.firstElementChild.innerHTML,C=p.__gui.__listening.indexOf(p)>-1;p.remove();var W=Ha(l,p.object,p.property,{before:p.__li.nextElementSibling,factoryArgs:[p.__min,p.__max,p.__step]});return W.name(A),C&&W.listen(),W}return E};p.min=Ne.compose(x,p.min),p.max=Ne.compose(x,p.max)}else p instanceof Mg?(de.bind(u,"click",function(){de.fakeEvent(p.__checkbox,"click")}),de.bind(p.__checkbox,"click",function(E){E.stopPropagation()})):p instanceof Pg?(de.bind(u,"click",function(){de.fakeEvent(p.__button,"click")}),de.bind(u,"mouseover",function(){de.addClass(p.__button,"hover")}),de.bind(u,"mouseout",function(){de.removeClass(p.__button,"hover")})):p instanceof pc&&(de.addClass(u,"color"),p.updateDisplay=Ne.compose(function(E){return u.style.borderLeftColor=p.__color.toString(),E},p.updateDisplay),p.updateDisplay());p.setValue=Ne.compose(function(E){return l.getRoot().__preset_select&&p.isModified()&&gc(l.getRoot(),!0),E},p.setValue)}(i,h,r),i.__controllers.push(r),r}function Qs(i,t){return document.location.href+"."+t}function vc(i,t,e){var n=document.createElement("option");n.innerHTML=t,n.value=t,i.__preset_select.appendChild(n),e&&(i.__preset_select.selectedIndex=i.__preset_select.length-1)}function Bg(i,t){t.style.display=i.useLocalStorage?"block":"none"}function RE(i){var t=i.__save_row=document.createElement("li");de.addClass(i.domElement,"has-save"),i.__ul.insertBefore(t,i.__ul.firstChild),de.addClass(t,"save-row");var e=document.createElement("span");e.innerHTML="&nbsp;",de.addClass(e,"button gears");var n=document.createElement("span");n.innerHTML="Save",de.addClass(n,"button"),de.addClass(n,"save");var r=document.createElement("span");r.innerHTML="New",de.addClass(r,"button"),de.addClass(r,"save-as");var o=document.createElement("span");o.innerHTML="Revert",de.addClass(o,"button"),de.addClass(o,"revert");var s=i.__preset_select=document.createElement("select");if(i.load&&i.load.remembered?Ne.each(i.load.remembered,function(u,p){vc(i,p,p===i.preset)}):vc(i,"Default",!1),de.bind(s,"change",function(){for(var u=0;u<i.__preset_select.length;u++)i.__preset_select[u].innerHTML=i.__preset_select[u].value;i.preset=this.value}),t.appendChild(s),t.appendChild(e),t.appendChild(n),t.appendChild(r),t.appendChild(o),Ga){var a=document.getElementById("dg-local-explain"),h=document.getElementById("dg-local-storage");document.getElementById("dg-save-locally").style.display="block",localStorage.getItem(Qs(0,"isLocal"))==="true"&&h.setAttribute("checked","checked"),Bg(i,a),de.bind(h,"change",function(){i.useLocalStorage=!i.useLocalStorage,Bg(i,a)})}var l=document.getElementById("dg-new-constructor");de.bind(l,"keydown",function(u){!u.metaKey||u.which!==67&&u.keyCode!==67||mh.hide()}),de.bind(e,"click",function(){l.innerHTML=JSON.stringify(i.getSaveObject(),void 0,2),mh.show(),l.focus(),l.select()}),de.bind(n,"click",function(){i.save()}),de.bind(r,"click",function(){var u=prompt("Enter a new preset name.");u&&i.saveAs(u)}),de.bind(o,"click",function(){i.revert()})}function IE(i){var t=void 0;function e(o){return o.preventDefault(),i.width+=t-o.clientX,i.onResize(),t=o.clientX,!1}function n(){de.removeClass(i.__closeButton,si.CLASS_DRAG),de.unbind(window,"mousemove",e),de.unbind(window,"mouseup",n)}function r(o){return o.preventDefault(),t=o.clientX,de.addClass(i.__closeButton,si.CLASS_DRAG),de.bind(window,"mousemove",e),de.bind(window,"mouseup",n),!1}i.__resize_handle=document.createElement("div"),Ne.extend(i.__resize_handle.style,{width:"6px",marginLeft:"-3px",height:"200px",cursor:"ew-resize",position:"absolute"}),de.bind(i.__resize_handle,"mousedown",r),de.bind(i.__closeButton,"mousedown",r),i.domElement.insertBefore(i.__resize_handle,i.domElement.firstElementChild)}function _c(i,t){i.domElement.style.width=t+"px",i.__save_row&&i.autoPlace&&(i.__save_row.style.width=t+"px"),i.__closeButton&&(i.__closeButton.style.width=t+"px")}function gh(i,t){var e={};return Ne.each(i.__rememberedObjects,function(n,r){var o={},s=i.__rememberedObjectIndecesToControllers[r];Ne.each(s,function(a,h){o[h]=t?a.initialValue:a.getValue()}),e[r]=o}),e}si.toggleHide=function(){fc=!fc,Ne.each(Lg,function(i){i.domElement.style.display=fc?"none":""})},si.CLASS_AUTO_PLACE="a",si.CLASS_AUTO_PLACE_CONTAINER="ac",si.CLASS_MAIN="main",si.CLASS_CONTROLLER_ROW="cr",si.CLASS_TOO_TALL="taller-than-window",si.CLASS_CLOSED="closed",si.CLASS_CLOSE_BUTTON="close-button",si.CLASS_CLOSE_TOP="close-top",si.CLASS_CLOSE_BOTTOM="close-bottom",si.CLASS_DRAG="drag",si.DEFAULT_WIDTH=245,si.TEXT_CLOSED="Close Controls",si.TEXT_OPEN="Open Controls",si._keydownHandler=function(i){document.activeElement.type==="text"||i.which!==72&&i.keyCode!==72||si.toggleHide()},de.bind(window,"keydown",si._keydownHandler,!1),Ne.extend(si.prototype,{add:function(i,t){return Ha(this,i,t,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(i,t){return Ha(this,i,t,{color:!0})},remove:function(i){this.__ul.removeChild(i.__li),this.__controllers.splice(this.__controllers.indexOf(i),1);var t=this;Ne.defer(function(){t.onResize()})},destroy:function(){if(this.parent)throw new Error("Only the root GUI should be removed with .destroy(). For subfolders, use gui.removeFolder(folder) instead.");this.autoPlace&&Zs.removeChild(this.domElement);var i=this;Ne.each(this.__folders,function(t){i.removeFolder(t)}),de.unbind(window,"keydown",si._keydownHandler,!1),Dg(this)},addFolder:function(i){if(this.__folders[i]!==void 0)throw new Error('You already have a folder in this GUI by the name "'+i+'"');var t={name:i,parent:this};t.autoPlace=this.autoPlace,this.load&&this.load.folders&&this.load.folders[i]&&(t.closed=this.load.folders[i].closed,t.load=this.load.folders[i]);var e=new si(t);this.__folders[i]=e;var n=mc(this,e.domElement);return de.addClass(n,"folder"),e},removeFolder:function(i){this.__ul.removeChild(i.domElement.parentElement),delete this.__folders[i.name],this.load&&this.load.folders&&this.load.folders[i.name]&&delete this.load.folders[i.name],Dg(i);var t=this;Ne.each(i.__folders,function(e){i.removeFolder(e)}),Ne.defer(function(){t.onResize()})},open:function(){this.closed=!1},close:function(){this.closed=!0},hide:function(){this.domElement.style.display="none"},show:function(){this.domElement.style.display=""},onResize:function(){var i=this.getRoot();if(i.scrollable){var t=de.getOffset(i.__ul).top,e=0;Ne.each(i.__ul.childNodes,function(n){i.autoPlace&&n===i.__save_row||(e+=de.getHeight(n))}),window.innerHeight-t-20<e?(de.addClass(i.domElement,si.CLASS_TOO_TALL),i.__ul.style.height=window.innerHeight-t-20+"px"):(de.removeClass(i.domElement,si.CLASS_TOO_TALL),i.__ul.style.height="auto")}i.__resize_handle&&Ne.defer(function(){i.__resize_handle.style.height=i.__ul.offsetHeight+"px"}),i.__closeButton&&(i.__closeButton.style.width=i.width+"px")},onResizeDebounced:Ne.debounce(function(){this.onResize()},50),remember:function(){if(Ne.isUndefined(mh)&&((mh=new CE).domElement.innerHTML=wE),this.parent)throw new Error("You can only call remember on a top level GUI.");var i=this;Ne.each(Array.prototype.slice.call(arguments),function(t){i.__rememberedObjects.length===0&&RE(i),i.__rememberedObjects.indexOf(t)===-1&&i.__rememberedObjects.push(t)}),this.autoPlace&&_c(this,this.width)},getRoot:function(){for(var i=this;i.parent;)i=i.parent;return i},getSaveObject:function(){var i=this.load;return i.closed=this.closed,this.__rememberedObjects.length>0&&(i.preset=this.preset,i.remembered||(i.remembered={}),i.remembered[this.preset]=gh(this)),i.folders={},Ne.each(this.__folders,function(t,e){i.folders[e]=t.getSaveObject()}),i},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=gh(this),gc(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(i){this.load.remembered||(this.load.remembered={},this.load.remembered.Default=gh(this,!0)),this.load.remembered[i]=gh(this),this.preset=i,vc(this,i,!0),this.saveToLocalStorageIfPossible()},revert:function(i){Ne.each(this.__controllers,function(t){this.getRoot().load.remembered?Fg(i||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())},this),Ne.each(this.__folders,function(t){t.revert(t)}),i||gc(this.getRoot(),!1)},listen:function(i){var t=this.__listening.length===0;this.__listening.push(i),t&&function e(n){n.length!==0&&ME.call(window,function(){e(n)}),Ne.each(n,function(r){r.updateDisplay()})}(this.__listening)},updateDisplay:function(){Ne.each(this.__controllers,function(i){i.updateDisplay()}),Ne.each(this.__folders,function(i){i.updateDisplay()})}});var PE=si,OE=function(){function i(t){this.player=t}return Object.defineProperty(i.prototype,"frameRate",{get:function(){return this.player.fps.value},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"drawFrames",{get:function(){return this.player.runtime.fps},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"drawCall",{get:function(){return this.player.runtime.drawCall},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"resolution",{get:function(){return this.player.config.resolution},set:function(t){this.player.updateConfig({resolution:t})},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"size",{get:function(){var t,e;return((t=this.player.view)===null||t===void 0?void 0:t.width)+"*"+((e=this.player.view)===null||e===void 0?void 0:e.height)},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"minFPS",{get:function(){return this.player.config.minFPS},set:function(t){this.player.updateConfig({minFPS:t})},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"maxFPS",{get:function(){return this.player.config.maxFPS},set:function(t){this.player.updateConfig({maxFPS:t})},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"autoResolution",{get:function(){return this.player.config.autoResolution},set:function(t){this.player.updateConfig({autoResolution:t})},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"autoFPS",{get:function(){return this.player.config.autoFPS},set:function(t){this.player.updateConfig({autoFPS:t})},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"backgroundColor",{get:function(){return this.player.config.transactionBgColor},set:function(t){this.player.updateConfig({transactionBgColor:t})},enumerable:!1,configurable:!0}),i}(),NE=function(){function i(t,e){var n;this.config=new OE(t),this.anchor=e,n=this.createControllerGUI(),this.gui=n[0],this.controller=n[1],this.createStats()}return i.prototype.createStats=function(){var t=this;this.stateId=setInterval(function(){t.controller.frameRate.updateDisplay(),t.controller.size.updateDisplay(),t.controller.minFPS.updateDisplay(),t.controller.drawFrames.updateDisplay(),t.controller.maxFPS.updateDisplay(),t.controller.resolution.updateDisplay(),t.controller.autoFps.updateDisplay(),t.controller.autoResolution.updateDisplay(),t.controller.drawCall.updateDisplay()},16)},i.prototype.createControllerGUI=function(){var t=new PE({autoPlace:!0,closed:!0});t.domElement.style.opacity=".6",t.domElement.style.transformOrigin="100% 0",t.domElement.style.transform="scale(1)",this.anchor.appendChild(t.domElement),t.domElement.style.position="absolute",t.domElement.style.right="0",t.domElement.style.top="0",t.domElement.style.zIndex="2";var e={frameRate:t.add(this.config,"frameRate"),drawFrames:t.add(this.config,"drawFrames"),drawCall:t.add(this.config,"drawCall"),size:t.add(this.config,"size"),minFPS:t.add(this.config,"minFPS",0,60),maxFPS:t.add(this.config,"maxFPS",0,60),resolution:t.add(this.config,"resolution",.5,8,.5),autoResolution:t.add(this.config,"autoResolution"),autoFps:t.add(this.config,"autoFPS"),transactionBgColor:t.addColor(this.config,"backgroundColor")};return[t,e]},i.prototype.destroy=function(){try{window.clearInterval(this.stateId),this.anchor.removeChild(this.gui.domElement),this.gui.destroy()}catch{}},i}(),LE=function(){function i(t){var e=this;this.tasks=[],this.isDestroy=!1,this.isScheduling=!1,this.schedule=function(){e.isScheduling=!0;var n=e.tasks.shift();n&&!e.isDestroy&&e.fn(n).then(function(){e.tasks.length>0?window.requestAnimationFrame(e.schedule):e.isScheduling=!1})},this.fn=t}return i.prototype.destroy=function(){this.isDestroy=!0},i.prototype.addTask=function(t){this.tasks.push(t),this.isScheduling||this.schedule()},i}(),DE=function(){function i(t){this.autoUnlock=Object.create(null),this.locks=Object.create(null),this.available=!1,this.available=t}return i.prototype.addLock=function(t,e){var n=this;this.available&&(this.locks[t]=e,this.autoUnlock[t]=window.setTimeout(function(){delete n.locks[t]},3e3))},i.prototype.unlock=function(t,e){this.available&&e&&this.locks[t]&&this.locks[t]===e&&(window.clearTimeout(this.autoUnlock[t]),delete this.locks[t])},i.prototype.isLocked=function(t){return!!this.available&&!!this.locks[t]},i}(),FE=function(){function i(){var t=this;this.tasks=[],this.isDestroy=!1,this.isScheduling=!1,this.schedule=function(){t.isScheduling=!0;var e=t.tasks.shift();e&&!t.isDestroy&&(e.status="running",e.fn.apply(null).then(function(){t.tasks.length>0?window.requestAnimationFrame(t.schedule):t.isScheduling=!1}).catch(function(){t.tasks.length>0?window.requestAnimationFrame(t.schedule):t.isScheduling=!1}))}}return i.prototype.getRunningTask=function(){return this.tasks[0]&&this.tasks[0].status==="running"?this.tasks[0]:null},i.prototype.addTask=function(t,e){var n={type:t,status:"wait",fn:e},r=this.getRunningTask();r&&t===r.type||(this.tasks=this.tasks.filter(function(o){return o.type!==t}),this.tasks.push(n),this.isScheduling||this.schedule())},i.prototype.destroy=function(){this.isDestroy=!0},i}(),BE=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})},UE=function(i,t){var e,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(h){return function(l){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;s;)try{if(e=1,n&&(r=2&u[0]?n.return:u[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,u[1])).done)return r;switch(n=0,r&&(u=[2&u[0],r.value]),u[0]){case 0:case 1:r=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,n=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(r=s.trys,!((r=r.length>0&&r[r.length-1])||u[0]!==6&&u[0]!==2)){s=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){s.label=u[1];break}if(u[0]===6&&s.label<r[1]){s.label=r[1],r=u;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(u);break}r[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(i,s)}catch(p){u=[6,p],n=0}finally{e=r=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([h,l])}}};function kE(i,t,e){return BE(this,void 0,void 0,function(){var n,r,o,s;return UE(this,function(a){switch(a.label){case 0:return n=document.createElement("div"),(r=new po({anchor:n,renderOptions:{minFPS:1,maxFPS:1,resolution:1},mode:"local",interactive:!1,useLocalCache:!0})).setResource(i,t),[4,r.getSlideCountAsync()];case 1:o=a.sent(),s=1,a.label=2;case 2:return s<=o?[4,r.player.stagePool.preload(s,!0)]:[3,5];case 3:a.sent(),e(Math.round(s/o*100)/100),a.label=4;case 4:return s++,[3,2];case 5:return r.destroy(),[2]}})})}var GE=function(){var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])})(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),ja=function(){return(ja=Object.assign||function(i){for(var t,e=1,n=arguments.length;e<n;e++)for(var r in t=arguments[e])Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r]);return i}).apply(this,arguments)},HE=function(i,t,e,n){var r,o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,t,e,n);else for(var a=i.length-1;a>=0;a--)(r=i[a])&&(s=(o<3?r(s):o>3?r(t,e,s):r(t,e))||s);return o>3&&s&&Object.defineProperty(t,e,s),s},Ji=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(l){try{h(n.next(l))}catch(u){o(u)}}function a(l){try{h(n.throw(l))}catch(u){o(u)}}function h(l){var u;l.done?r(l.value):(u=l.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}h((n=n.apply(i,t||[])).next())})},Ki=function(i,t){var e,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(h){return function(l){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;s;)try{if(e=1,n&&(r=2&u[0]?n.return:u[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,u[1])).done)return r;switch(n=0,r&&(u=[2&u[0],r.value]),u[0]){case 0:case 1:r=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,n=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(r=s.trys,!((r=r.length>0&&r[r.length-1])||u[0]!==6&&u[0]!==2)){s=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){s.label=u[1];break}if(u[0]===6&&s.label<r[1]){s.label=r[1],r=u;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(u);break}r[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(i,s)}catch(p){u=[6,p],n=0}finally{e=r=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([h,l])}}},jE=window.ResizeObserver||pE,vh=function(i){return new Promise(function(t){return setTimeout(t,i)})};function zE(i,t){return Ji(this,void 0,void 0,function(){var e;return Ki(this,function(n){switch(n.label){case 0:e=Date.now(),n.label=1;case 1:return!i()&&Date.now()-e<t?[4,vh(50)]:[3,3];case 2:return n.sent(),e=Date.now(),[3,1];case 3:return[2]}})})}var lr={syncDispatch:"syncDispatch",syncReceive:"syncReceive",syncEventLag:"syncEventLag",renderStart:"renderStart",renderEnd:"renderEnd",renderError:"renderError",slideChange:"slideChange",mainSeqStepStart:"mainSeqStepStart",mainSeqStepEnd:"mainSeqStepEnd",animateStart:"animateStart",animateEnd:"animateEnd",stateChange:"stateChange",slideStepEnd:"slideEnd",slideStepStart:"slideStart"},Ug={taskId:"",url:"",currentSlideIndex:-1,mainSeqStep:-1,mainSeqState:null,mediaState:Object.create(null),interactiveSeqState:Object.create(null)},yc="";try{yc="1.0.1-beta.1"}catch{yc="-dev"}var cr=null;try{(cr=I.createInstance({name:"__slide_local_log__",driver:I.INDEXEDDB,version:1})).ready(function(i){}).catch(function(i){})}catch{}var po=function(i){function t(r){var o=i.call(this)||this;return o.iosResetCache=[],o.needClearCacheImage=!1,o.version=yc,o.__slideState=lg()(Ug),o.userInputTime=0,o.isSyncingSlideState=!1,o.frozenTaskManager=new FE,o.randomId=M(),o.resize=!1,o.isAnimating=!1,o.renderingTaskManager=new vE,o.isLoading=!1,o.interactive=!0,o.renderingIndex=0,o.frameWidth=1,o.frameHeight=1,o.frame=document.createElement("div"),o.canvasContainer=document.createElement("div"),o.medianController=document.createElement("div"),o.frameResizeObserver=new jE(function(){return o.frameResizeHandler()}),o.timestamp=function(){return Date.now()},o.mode="local",o.enableGlobalClick=!1,o.lastEmitedState=null,o.playerController=null,o.isInitResized=!1,o.cacheImage=document.createElement("img"),o.isTouchStart=!1,o.touchStartId=void 0,o.taskId="",o.volumeAdjuster=new og,o.designWidth=0,o.designHeight=0,o._slideCount=0,o._dispatchIncrId=0,o._receiveIncrId=0,o._updateVolumeByStaticAdjuster=function(s){o.volumeAdjuster.volume=s},o.recoverHandler=function(s){if(s.data.type==="@slide/_recover_"&&s.data.slideId===o.randomId){var a=s.data,h=a.recoverBy,l=a.payload;if(!l)return;h==="renderOtherPage"&&l.slideIndex?o.doRenderSlide(l.slideIndex).catch(function(u){o.logger.error(u,o.taskId)}):h==="reloadCurrentPage"&&o.doRenderSlide(o.renderingIndex).catch(function(u){o.logger.error(u,o.taskId)})}},o.userInputHandle=function(){o.userInputTime=Date.now()},o.handleViewClick=function(){setTimeout(function(){var s=Date.now();Math.abs(s-o.userInputTime)>500&&o.enableGlobalClick&&o.nextStep()})},o.handleViewTouchStart=function(){window.clearTimeout(o.touchStartId),o.isTouchStart=!0,o.touchStartId=setTimeout(function(){o.isTouchStart=!1},350)},o.handleViewTouchEnd=function(){o.isTouchStart&&(o.isTouchStart=!1,o.handleViewClick())},o.handleSlideRef=function(){console.log(o),window.__slide=o},o.receiveSyncHandler=function(s){return Ji(o,void 0,void 0,function(){var a,h,l,u,p,y=this;return Ki(this,function(x){switch(x.label){case 0:return as()(s.incrId)&&(s.incrId&&s.incrId-this._receiveIncrId!=1&&this.emit(lr.syncEventLag),this._receiveIncrId=s.incrId||0),this.logger.info("sync receive "+JSON.stringify(s),this.taskId),s.type!=="nextStep"?[3,1]:(this.mainSeqStep!==s.next-1&&this.mainSeqStep+1!==this.mainSeqLength&&this.player?(this.setMainSeqStep(s.next,"start"),this.player.nextTick(function(){y.doNextStep(!0,s.clientId||"")})):this.doNextStep(!0,s.clientId||""),[3,6]);case 1:return s.type!=="prevStep"?[3,2]:(this.mainSeqStep===0&&this.mainSeqState==="idle"||this.mainSeqStep===s.next+1||this.mainSeqStep+1===this.mainSeqLength?this.doPrevStep(!0):(this.setMainSeqStep(s.next+1,"start"),(a=this.player)===null||a===void 0||a.nextTick(function(){y.doPrevStep(!0)})),[3,6]);case 2:return s.type!=="interactiveAnim"?[3,3]:(this.player?this.player.applyInteractiveAction(s.action):this.__slideState.interactiveSeqState[s.seqId]?this.__slideState.interactiveSeqState[s.seqId].step+=1:this.__slideState.interactiveSeqState[s.seqId]={step:0,state:"end"},[3,6]);case 3:return s.type!=="renderSlide"?[3,5]:[4,this.doRenderSlide(s.index,s.isForward)];case 4:return x.sent(),[3,6];case 5:s.type==="mediaPlay"?((h=this.player)===null||h===void 0||h.setMediaState(s.id,!0),this.__slideState.mediaState[s.id]=s.state):s.type==="mediaPause"?((l=this.player)===null||l===void 0||l.setMediaState(s.id,!1),this.__slideState.mediaState[s.id]=s.state):s.type==="mediaSeek"?((u=this.player)===null||u===void 0||u.setMediaCurrentTime(s.id,s.time),this.__slideState.mediaState[s.id]=s.state):s.type==="mediaFullscreen"&&(s.targetId&&this.__slideState.mediaState[s.targetId]?this.__slideState.mediaState[s.targetId].fullscreen=s.state:this.__slideState.mediaState[s.targetId]={fullscreen:s.state,type:"pause",time:0},(p=this.player)===null||p===void 0||p.syncFullscreenVideoState({targetId:s.targetId,state:s.state,slideIndex:s.slideIndex})),x.label=6;case 6:return[2]}})})},o.handlePrevSlide=function(s){return s===void 0&&(s=!1),Ji(o,void 0,void 0,function(){var a;return Ki(this,function(h){return this.player?((a=this.player.prevSlideIndex)>=1&&(this.config.navigatorDelegate?this.config.navigatorDelegate.gotoPage(a):s?this.doRenderSlide(a,!1):this.renderSlide(a,!1)),[2]):[2]})})},o.handleNextSlide=function(s){return s===void 0&&(s=!1),Ji(o,void 0,void 0,function(){var a;return Ki(this,function(h){return this.player?((a=this.player.nextSlideIndex)<=this.slideCount&&(this.config.navigatorDelegate?this.config.navigatorDelegate.gotoPage(a):s?this.doRenderSlide(a,!0):this.renderSlide(a,!0)),[2]):[2]})})},o.handleGotoSlide=function(s){if(s<=o.slideCount&&s>=1){var a=o.slideState.currentSlideIndex<=s;o.renderSlide(s,a)}else s===-1&&o.renderSlide(o.slideCount,!0)},t.instances.push(o),o.config=o.initSlideConfig(r),o.logger={info:function(s,a){var h;t.appendLogString("INFO - "+new Date().toISOString()+" - {"+o.randomId+"}["+a+"] "+s+`
7949
7949
  `);var l=(h=o.config.logger)===null||h===void 0?void 0:h.info;l&&l("["+a+"] "+s)},warn:function(s,a){var h;t.appendLogString("WARN - "+new Date().toISOString()+" - {"+o.randomId+"}["+a+"] "+s+`
7950
7950
  `);var l=(h=o.config.logger)===null||h===void 0?void 0:h.warn;l&&l("["+a+"] "+s)},error:function(s,a){var h;t.appendLogString("ERROR - "+new Date().toISOString()+" - {"+o.randomId+"}["+a+"] "+s+`
7951
7951
  `);var l=(h=o.config.logger)===null||h===void 0?void 0:h.error;l&&l("["+a+"] "+s)}},o.logger.info("new slide with clientId: "+o.config.clientId,o.taskId),o.anchor=o.config.anchor,o.syncQueue=new LE(o.receiveSyncHandler),o.lock=new DE(o.mode==="interactive"),o.cacheImage.style.position="absolute",o.cacheImage.style.zIndex="100",o.setMedianControllerAttribute(),o.canvasContainer.style.position="relative",o.canvasContainer.style.fontSize="0",o.canvasContainer.appendChild(o.medianController),o.frame.appendChild(o.canvasContainer),o.frameResizeObserver.observe(o.frame),o.on(lr.syncReceive,function(s){o.lock.unlock(s.type,s.uuid),o.syncQueue.addTask(s)}),o.renderingTaskManager.eventHub.on("task-error",function(s){var a=s.error,h=s.task,l=wi.transform(a);l.errorType===er.RuntimeWarn?o.logger.warn(l.message,o.taskId):o.logger.error(l.message,o.taskId),o.isLoading=!1,o.reportError(l,h.slideIndex)}),window.addEventListener("__slide_ref__",o.handleSlideRef),o.resizeView=ag()(o.resizeView.bind(o),50),o.player=o.initPlayer(o.config),o.config.controller&&o.createController(),o.player.view&&o.canvasContainer.appendChild(o.player.view),o.handleViewClick=ag()(o.handleViewClick,300),o.player.errorChannel.on("error",function(s,a){var h=wi.transform(s);h.errorType===er.RuntimeWarn?o.logger.warn(h.message,o.taskId):o.logger.error(h.message,o.taskId),o.isLoading=!1,a===o.renderingIndex&&o.reportError(s,a)}),window.addEventListener("message",o.recoverHandler),t.volumeAdjuster.on("update",o._updateVolumeByStaticAdjuster),o}var e,n;return GE(t,i),t.flushLog=function(r){return r===void 0&&(r=!1),Ji(this,void 0,void 0,function(){return Ki(this,function(o){switch(o.label){case 0:if(!(t._tempLog.length>131072||r&&t._tempLog.length>0))return[3,5];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,cr==null?void 0:cr.setItem("run_time_log_"+t._tempLogIndex,t._tempLog)];case 2:return o.sent(),[3,4];case 3:return o.sent(),[3,4];case 4:t._tempLog="",t._tempLogIndex+=1,o.label=5;case 5:return[2]}})})},t.stopRemoteLog=function(){t.remoteLogAddress=null},t.startRemoteLog=function(r){return Ji(this,void 0,void 0,function(){var o,s,a,h,l;return Ki(this,function(u){switch(u.label){case 0:return t.remoteLogAddress=r,[4,t.flushLog(!0)];case 1:if(u.sent(),!cr)return[3,13];o=[],u.label=2;case 2:return u.trys.push([2,4,,5]),[4,cr.keys()];case 3:return o=(u.sent()||[]).sort(function(p,y){return parseInt(p.replace("run_time_log_",""))-parseInt(y.replace("run_time_log_",""))}),[3,5];case 4:return u.sent(),[3,5];case 5:s=0,a=o,u.label=6;case 6:if(!(s<a.length))return[3,13];h=a[s],h.replace("run_time_log_",""),l="",u.label=7;case 7:return u.trys.push([7,9,,10]),[4,cr.getItem(h)];case 8:return l=u.sent()||"",[3,10];case 9:return u.sent(),[3,10];case 10:return[4,fetch(t.remoteLogAddress+"/logs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({log:l})})];case 11:u.sent(),u.label=12;case 12:return s++,[3,6];case 13:return[2]}})})},t.appendLogString=function(r){t._tempLog+=r,t.remoteLogAddress&&fetch(t.remoteLogAddress+"/logs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({log:r})}).catch(function(){})},Object.defineProperty(t.prototype,"dispatchIncrId",{get:function(){return this._dispatchIncrId++},enumerable:!1,configurable:!0}),t.prototype.reportError=function(r,o){this.emit(lr.renderError,{error:r,index:o}),window.postMessage({type:"@slide/_error_",errorType:r.errorType,errorMsg:r.errorMsg,slideId:this.randomId,slideIndex:o,customMessage:"@slide/_error_"},"*")},t.prototype.initSlideConfig=function(r){return r.timestamp&&(this.timestamp=r.timestamp),r.rtcAudio&&(ar.RtcAudioClazz=r.rtcAudio),this.mode=r.mode,this.anchor=r.anchor,this.anchor.appendChild(this.frame),this.enableGlobalClick=!Gi()(r.enableGlobalClick)&&r.enableGlobalClick,this.resize=r.resize||!1,this.interactive=r.interactive,this.frame.style.cssText=r.fixedFrameSize?"width:"+r.fixedFrameSize.width+"px;height:"+r.fixedFrameSize.height+"px;":"width:100%;height:100%",this.frame.style.cssText+="display:flex;justify-content:center;align-items:center;visibility:hidden;position:relative;z-index:1;",r.fixedFrameSize&&(this.frameWidth=r.fixedFrameSize.width,this.frameHeight=r.fixedFrameSize.height),r},t.prototype.initPlayer=function(r){var o,s,a,h=this,l=new ar({mode:this.mode,useLocalCache:!!Gi()(this.config.useLocalCache)||this.config.useLocalCache,logger:this.logger,resourceTimeout:Gi()(this.config.resourceTimeout)?15e3:this.config.resourceTimeout,loadDelegate:this.config.loaderDelegate,volumeAdjuster:this.volumeAdjuster,urlInterrupter:this.config.urlInterrupter},r.renderOptions);return l.setInteractive(this.interactive),l.updateConfig(r.renderOptions||{}),l.on(Qe.renderStart,function(u){h.isLoading=!0,h.emit(lr.renderStart,u)}),l.on(Qe.renderEnd,function(u){h.isLoading=!1,h.player&&(h.designHeight=h.player.designHeight,h.designWidth=h.player.designWidth,h.cacheImage.style.width=h.player.designWidth+"px",h.cacheImage.style.height=h.player.designHeight+"px",h._slideCount=h.player.slideCount),h.emit(lr.renderEnd,u)}),l.on(Qe.slideChange,function(u){h.__slideState.currentSlideIndex=u,h.emitStateChange(),h.emit(lr.slideChange,u)}),l.on(Qe.mainSeqStateChange,function(u){h.__slideState.mainSeqState=u,h.emitStateChange()}),l.on(Qe.mainSeqStepChange,function(u){h.__slideState.mainSeqStep=u,h.emitStateChange()}),l.on(Qe.interactiveSeqStateChange,function(u){var p=u.id,y=u.state;h.__slideState.interactiveSeqState[p]=y,h.emitStateChange()}),l.on(Qe.animateStart,function(){h.isAnimating!==!0&&(h.isAnimating=!0,h.emit(lr.animateStart))}),l.on(Qe.animateEnd,function(){h.isAnimating!==!1&&(h.isAnimating=!1,h.emit(lr.animateEnd))}),l.on(Qe.interactiveSeqAction,function(u){var p=u.action,y=u.seqId;h.emitSyncDispatch({slideIndex:h.__slideState.currentSlideIndex,type:"interactiveAnim",action:p,seqId:y}),h.emitStateChange()}),l.on(Qe.mainSeqStepStart,function(u){h.emit(lr.mainSeqStepStart,u)}),l.on(Qe.mainSeqStepEnd,function(u){h.emit(lr.mainSeqStepEnd,u)}),l.on(Qe.mediaPlay,function(u){var p,y=(p=h.__slideState.mediaState[u.id])!==null&&p!==void 0?p:{};y.type="play",y.time=h.timestamp()-1e3*u.time,h.__slideState.mediaState[u.id]=y,u._stateOnly?h.config.mode==="interactive"&&h.receiveSyncHandler({slideIndex:h.__slideState.currentSlideIndex,type:"mediaPlay",id:u.id,state:y}).catch(function(x){h.logger.error(x==null?void 0:x.message,h.taskId)}):h.emitSyncDispatch({slideIndex:h.__slideState.currentSlideIndex,type:"mediaPlay",id:u.id,state:y}),h.emitStateChange()}),l.on(Qe.mediaStop,function(u){delete h.__slideState.mediaState[u.id],h.emitStateChange()}),l.on(Qe.mediaPause,function(u){var p,y=(p=h.__slideState.mediaState[u.id])!==null&&p!==void 0?p:{};y.type="pause",y.time=u.time,h.__slideState.mediaState[u.id]=y,u._stateOnly?h.config.mode==="interactive"&&h.receiveSyncHandler({slideIndex:h.__slideState.currentSlideIndex,type:"mediaPause",id:u.id,state:y}).catch(function(x){h.logger.error(x==null?void 0:x.message,h.taskId)}):h.emitSyncDispatch({slideIndex:h.__slideState.currentSlideIndex,type:"mediaPause",id:u.id,state:y}),h.emitStateChange()}),l.on(Qe.mediaSeek,function(u){var p,y=(p=h.__slideState.mediaState[u.id])!==null&&p!==void 0?p:{};u.isPlaying?(y.type="play",y.time=h.timestamp()-1e3*u.time):(y.type="pause",y.time=u.time),h.__slideState.mediaState[u.id]=y,h.emitSyncDispatch({slideIndex:h.__slideState.currentSlideIndex,type:"mediaSeek",id:u.id,time:u.time,state:y}),h.emitStateChange()}),l.on(Qe.requestPrevSlide,function(u){h.handlePrevSlide(u)}),l.on(Qe.requestNextSlide,function(u){h.handleNextSlide(u)}),l.on(Qe.requestGotoSlide,function(u){h.config.navigatorDelegate?h.config.navigatorDelegate.gotoPage(u):h.handleGotoSlide(u)}),l.on(Qe.fullscreenChange,function(u){var p,y=u.targetId,x=u.state;h.emitSyncDispatch({slideIndex:h.__slideState.currentSlideIndex,type:"mediaFullscreen",targetId:y,state:x});var E=(p=h.__slideState.mediaState[y])!==null&&p!==void 0?p:{};E.fullscreen=x,h.__slideState.mediaState[y]=E,h.emitStateChange()}),l.on(Qe.changeLocalFullscreenState,function(u){u.slideIndex===h.__slideState.currentSlideIndex?(u.targetId&&h.__slideState.mediaState[u.targetId]&&(h.__slideState.mediaState[u.targetId].fullscreen=u.status),h.emitStateChange()):h.logger.info("event slideIndex: "+u.slideIndex+", current slideIndex: "+h.__slideState.currentSlideIndex,h.taskId)}),(o=l.view)===null||o===void 0||o.addEventListener("touchend",this.handleViewTouchEnd),(s=l.view)===null||s===void 0||s.addEventListener("touchstart",this.handleViewTouchStart),(a=l.view)===null||a===void 0||a.addEventListener("click",this.handleViewClick),l.on(Qe.userInput,this.userInputHandle),l},t.prototype.createController=function(){this.player&&(this.playerController=new NE(this.player,this.frame))},t.prototype.setMedianControllerAttribute=function(){this.medianController.className="median-container",this.medianController.style.position="absolute",this.medianController.style.left="0",this.medianController.style.top="0",this.medianController.style.zIndex="2",this.medianController.style.fontSize="16px"},t.prototype.frameResizeHandler=function(){if(!this.config.fixedFrameSize){var r=this.frame.getBoundingClientRect(),o=r.width,s=r.height;this.frameWidth=o,this.frameHeight=s,this.resizeView()}},t.prototype.updateFixedFrameSize=function(r,o,s){this.config.fixedFrameSize&&(this.frameWidth=r,this.frameHeight=o,this.frame.style.width=r+"px",this.frame.style.height=o+"px",this.resizeView(s))},t.prototype.resizeView=function(r){var o,s,a=this,h=this.width,l=this.height;if(h>0&&l>0){var u=this.frameWidth/h,p=u*l;p>this.frameHeight&&(u*=this.frameHeight/p),(o=this.player)===null||o===void 0||o.scaleView(u,this.resize,r),this.cacheImage.style.transform="scale("+u+")",this.medianController.style.transform="scale("+u+")",this.medianController.setAttribute("data-scale",u.toString()),this.isInitResized||(this.isInitResized=!0,(s=this.player)===null||s===void 0||s.clock.setTimeout(function(){a.frame.style.visibility="visible"},32))}},t.prototype.setSlideState=function(r){var o,s,a;return Ji(this,void 0,void 0,function(){var h,l=this;return Ki(this,function(u){switch(u.label){case 0:return this.isSyncingSlideState=!0,this.logger.info("stateChange receive "+JSON.stringify(r),this.taskId),r.taskId&&r.taskId!==this.__slideState.taskId&&(this.__slideState.taskId=r.taskId,(o=this.player)===null||o===void 0||o.setResourceData(r.taskId,this.__slideState.url)),r.url&&r.url!==this.__slideState.url&&(this.__slideState.url=r.url,(s=this.player)===null||s===void 0||s.setResourceData(this.__slideState.taskId,r.url)),Number.isInteger(r.currentSlideIndex)&&r.currentSlideIndex!==this.__slideState.currentSlideIndex?(this.__slideState.currentSlideIndex=r.currentSlideIndex,[4,this.doRenderSlide(r.currentSlideIndex)]):[3,2];case 1:u.sent(),u.label=2;case 2:return[4,(a=this.player)===null||a===void 0?void 0:a.clock.waitUntil(function(){var p,y;return((p=l.player)===null||p===void 0?void 0:p.currentIndex)===r.currentSlideIndex&&((y=l.player)===null||y===void 0?void 0:y.currentStage)},3e3)];case 3:return u.sent(),h=!1,Number.isInteger(r.mainSeqStep)&&r.mainSeqStep!==this.__slideState.mainSeqStep&&(h=!0,this.__slideState.mainSeqStep=r.mainSeqStep),r.mainSeqState&&r.mainSeqState!==this.__slideState.mainSeqState&&(h=!0,this.__slideState.mainSeqState=r.mainSeqState),h&&this.setMainSeqStep(this.__slideState.mainSeqStep,this.__slideState.mainSeqState==="idle"?"start":"end"),r.interactiveSeqState&&(this.initInteractiveSeq(r),this.__slideState.interactiveSeqState=r.interactiveSeqState),[4,vh(1500)];case 4:return u.sent(),r.mediaState&&(this.initMedia(r),this.__slideState.mediaState=r.mediaState),this.isSyncingSlideState=!1,[2]}})})},t.prototype.initInteractiveSeq=function(r){var o;for(var s in r.interactiveSeqState){var a=r.interactiveSeqState[s];(o=this.player)===null||o===void 0||o.setInteractiveSeqState(s,a.step,a.state==="idle"?"start":"end")}},t.prototype.initMedia=function(r){var o,s,a;for(var h in r.mediaState){var l=r.mediaState[h],u=this.__slideState.mediaState[h];if((o=this.player)===null||o===void 0||o.syncFullscreenVideoState({targetId:h,state:!!l.fullscreen,slideIndex:this.slideState.currentSlideIndex}),!u||l.type!==u.type||l.time!==u.time)if(l.type==="play"){var p=(this.timestamp()-l.time)/1e3;(s=this.player)===null||s===void 0||s.setMediaState(h,!0,p)}else(a=this.player)===null||a===void 0||a.setMediaState(h,!1,l.time)}},Object.defineProperty(t.prototype,"slideCount",{get:function(){return this._slideCount},enumerable:!1,configurable:!0}),t.prototype.getSizeAsync=function(){return Ji(this,void 0,void 0,function(){var r;return Ki(this,function(o){switch(o.label){case 0:if(this.width>0&&this.height>0)return[2,[this.width,this.height]];o.label=1;case 1:return o.trys.push([1,4,,5]),[4,fetch(this.__slideState.url+"/"+this.__slideState.taskId+"/jsonOutput/slide-1.json")];case 2:return[4,o.sent().json()];case 3:return[2,[(r=o.sent()).width,r.height]];case 4:return o.sent(),[2,[0,0]];case 5:return[2]}})})},t.prototype.getSlideCountAsync=function(){return Ji(this,void 0,void 0,function(){return Ki(this,function(r){switch(r.label){case 0:if(this._slideCount>0)return[2,this._slideCount];r.label=1;case 1:return r.trys.push([1,4,,5]),[4,fetch(this.__slideState.url+"/"+this.__slideState.taskId+"/jsonOutput/slide-1.json")];case 2:return[4,r.sent().json()];case 3:return[2,r.sent().slideCount];case 4:return r.sent(),[2,0];case 5:return[2]}})})},Object.defineProperty(t.prototype,"slideState",{get:function(){return this.__slideState.mainSeqState=this.mainSeqState,this.__slideState.mainSeqStep=this.mainSeqStep,JSON.parse(JSON.stringify(this.__slideState))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqLength",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.mainSeqLength())||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqStep",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.mainSeqStep())||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mainSeqState",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.mainSeqState())||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderOptions",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.config)||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"drawCall",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.runtime.drawCall)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderFps",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.runtime.fps)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"runtimeFps",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.fps.value)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){var r;return((r=this.player)===null||r===void 0?void 0:r.view)||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.designWidth},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.designHeight},enumerable:!1,configurable:!0}),t.prototype.updateRenderOption=function(r){this.player&&(this.player.updateConfig(r),this.renderOptions&&(this.config.renderOptions=this.renderOptions))},t.prototype.setResource=function(r,o){var s;this.taskId=r,(s=this.player)===null||s===void 0||s.setResourceData(r,o),this.__slideState.taskId=r,this.__slideState.url=o,this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"setResource",taskId:r,url:o})},t.prototype._renderSlide=function(r){var o;return Ji(this,void 0,void 0,function(){var s=this;return Ki(this,function(a){switch(a.label){case 0:return this.renderingIndex=r,this.player&&r===this.player.currentIndex?[2]:((ar.platform.isIOS()||ar.platform.isAndroid())&&this.iosResetCache.indexOf(r)<0&&this.iosResetCache.push(r),[4,(o=this.player)===null||o===void 0?void 0:o.renderSlide(r)]);case 1:return a.sent(),this.__slideState.currentSlideIndex=r,this.resizeView(),this.__slideState.interactiveSeqState={},this.__slideState.mediaState={},this.emitStateChange(),setTimeout(function(){var h,l;if(((l=(h=s.player)===null||h===void 0?void 0:h.view)===null||l===void 0?void 0:l.style.visibility)==="hidden"&&(s.player.view.style.visibility="visible"),s.frame.style.visibility==="hidden"&&(s.frame.style.visibility="visible"),s.needClearCacheImage)try{s.frame.removeChild(s.cacheImage)}catch{}},100),[2]}})})},t.prototype.renderSlide=function(r,o){if(o===void 0&&(o=!0),this.player){var s=Number(r);(s!==this.player.currentIndex||this.renderingTaskManager.hasStartTask())&&(s>this.slideCount&&this.slideCount>0||this.poseRenderSlide(s,o))}},t.prototype.needCreateNewPlayer=function(){var r=ar.platform.isLowGpuMemory()?15:30;return(ar.platform.isIOS()||ar.platform.isAndroid())&&this.iosResetCache.length>r},t.prototype.poseRenderSlide=function(r,o){this.mode==="interactive"?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:r,isForward:o}):this.mode==="sync"?(this.doRenderSlide(r,o),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"renderSlide",index:r,isForward:o})):this.doRenderSlide(r,o)},t.prototype.doRenderSlide=function(r,o){var s,a,h,l=this;if(o===void 0&&(o=!0),!this.player)return Promise.resolve();if(this.needCreateNewPlayer()&&(this.iosResetCache=[],this.iosNewPlayer=this.initPlayer(this.config),this.iosNewPlayer.setResourceData(this.__slideState.taskId,this.__slideState.url)),this.iosNewPlayer){var u=this.player.getSnapshot();this.cacheImage.src=u,this.frame.appendChild(this.cacheImage),this.player.destroy(),(s=this.playerController)===null||s===void 0||s.destroy(),this.player=this.iosNewPlayer,this.iosNewPlayer=void 0,!((a=this.config)===null||a===void 0)&&a.controller&&this.createController(),this.needClearCacheImage=!0,!((h=this==null?void 0:this.player)===null||h===void 0)&&h.view&&(this.player.view.style.visibility="hidden",this.canvasContainer.appendChild(this.player.view))}var p=Math.random().toString(32).substr(2);return this.player.isForward=o,this.renderingTaskManager.addTask(function(){return l._renderSlide(r)},r,p),new Promise(function(y){l.renderingTaskManager.eventHub.once("task-end-"+p,y)})},t.prototype.getSnapshot=function(){var r,o;return(o=(r=this.player)===null||r===void 0?void 0:r.getSnapshot())!==null&&o!==void 0?o:null},t.prototype.nextStep=function(){!this.isLoading&&this.player&&this.interactive?(this.hasNextStep()||this.emit(lr.slideStepEnd),this.player.mainSeqHasNextStep()?this.mode==="interactive"?this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"nextStep",next:this.player.mainSeqStep()+1}):this.mode==="sync"?(this.doNextStep(!1,""),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"nextStep",next:this.player.mainSeqStep()})):this.doNextStep(!1,""):this.handleNextSlide()):this.logger.info("prevent nextStep. "+this.isLoading+" "+this.player+" "+this.interactive,this.taskId)},t.prototype.doNextStep=function(r,o){if(this.player){var s=!this.config.clientId||o===this.config.clientId;this.player.nextStep(r,s);var a=this.player.mainSeqStep();this.__slideState.mainSeqStep=a,this.emitStateChange()}},t.prototype.prevStep=function(){!this.isLoading&&this.player&&this.interactive?(this.hasPrevStep()||this.emit(lr.slideStepStart),this.player.mainSeqHasPrevStep()?this.mode==="interactive"?this.emitSyncDispatch({type:"prevStep",slideIndex:this.__slideState.currentSlideIndex,next:this.player.mainSeqStep()-1}):this.mode==="sync"?(this.doPrevStep(),this.emitSyncDispatch({slideIndex:this.__slideState.currentSlideIndex,type:"prevStep",next:this.player.mainSeqStep()})):this.doPrevStep():this.handlePrevSlide()):this.logger.info("prevent nextStep. "+this.isLoading+" "+this.player+" "+this.interactive,this.taskId)},t.prototype.doPrevStep=function(r){if(r===void 0&&(r=!1),this.player){this.player.prevStep(r);var o=this.player.mainSeqStep();this.__slideState.mainSeqStep=o,this.emitStateChange()}},t.prototype.isSlideStateReady=function(r){return r.taskId.length>0&&r.url.length>0&&r.currentSlideIndex>0},t.prototype.emitStateChange=function(){if(this.mode!=="local"&&!this.isSyncingSlideState){var r=this.slideState;!tE()(this.lastEmitedState,r)&&this.isSlideStateReady(r)&&(this.lastEmitedState=r,this.emit(lr.stateChange,r),this.logger.info("stateChange dispatch "+JSON.stringify(this.slideState),this.taskId))}},t.prototype.emitSyncDispatch=function(r){if(!this.lock.isLocked(r.type)){var o=Math.random().toString(32).substr(2);this.lock.addLock(r.type,o);var s=ja(ja({},r),{uuid:o,clientId:this.config.clientId});this.config.mode==="sync"&&(s.incrId=this.dispatchIncrId),this.emit(lr.syncDispatch,s),this.logger.info("sync dispatch "+JSON.stringify(s),this.taskId)}},t.prototype.setMainSeqStep=function(r,o){var s;(s=this.player)===null||s===void 0||s.setMainSeqStep(r,o)},t.prototype.setInteractive=function(r){var o;this.interactive=r,(o=this.player)===null||o===void 0||o.setInteractive(r)},t.prototype.pause=function(){var r;(r=this.player)===null||r===void 0||r.pause()},t.prototype.resume=function(){var r;(r=this.player)===null||r===void 0||r.resume()},t.prototype._doFrozen=function(){var r;return Ji(this,void 0,void 0,function(){var o,s,a,h=this;return Ki(this,function(l){switch(l.label){case 0:return this.logger.info("frozen with player["+!!this.player+"]",this.taskId),this.view&&this.player?[4,this.player.clock.waitUntil(function(){return!h.isLoading},6e4)]:[3,2];case 1:for(s in l.sent(),o=this.player.getSnapshot()||"",this.cacheImage.src=o,this.frame.appendChild(this.cacheImage),this.player.destroy(),(r=this.playerController)===null||r===void 0||r.destroy(),this.player=void 0,this.__slideState.mediaState)a=this.__slideState.mediaState[s],this.__slideState.mediaState[s]=ja(ja({},a),{frozenTime:this.timestamp()});l.label=2;case 2:return[2]}})})},t.prototype.frozen=function(){var r=this;this.frozenTaskManager.addTask("frozen",function(){return r._doFrozen()})},t.prototype._doRelease=function(){var r,o;return Ji(this,void 0,void 0,function(){var s,a,h,l;return Ki(this,function(u){switch(u.label){case 0:if(this.logger.info("do release slide",this.taskId),this.player)return[2];for(a in this.player=this.initPlayer(this.config),!((r=this.config)===null||r===void 0)&&r.controller&&this.createController(),this.player.view&&(this.canvasContainer.appendChild(this.player.view),this.player.view.style.visibility="hidden"),s=this.__slideState,this.__slideState=lg()(Ug),s.mediaState)(h=s.mediaState[a]).type==="play"&&(l=Math.max((o=h.frozenTime)!==null&&o!==void 0?o:0,h.time),h.time=this.timestamp()-(l-h.time),h.frozenTime=void 0);return[4,this.setSlideState(s)];case 1:return u.sent(),[4,this.player.clock.delay(333)];case 2:u.sent(),this.player.view&&(this.player.view.style.visibility="visible");try{this.frame.removeChild(this.cacheImage)}catch{}return[2]}})})},t.prototype.release=function(){var r=this;this.frozenTaskManager.addTask("release",function(){return r._doRelease()})},t.prototype._doDestroy=function(){var r,o,s,a,h=this;this.logger.info("do destroy slide",this.taskId);var l=t.instances.findIndex(function(u){return u.randomId===h.randomId});l>=0&&t.instances.splice(l,1),this.playerController&&this.playerController.destroy(),this.frameResizeObserver.disconnect(),(r=this.player)===null||r===void 0||r.removeAllListeners(),(o=this.player)===null||o===void 0||o.destroy(),(s=this.player)===null||s===void 0||s.removeAllListeners(),this.logger={warn:function(){return{}},info:function(){return{}},error:function(){return{}}},this.syncQueue.destroy(),this.renderingTaskManager.destroy(),this.frozenTaskManager.destroy(),window.removeEventListener("__slide_ref__",this.handleSlideRef),window.removeEventListener("message",this.recoverHandler),this.removeAllListeners();try{!((a=this.player)===null||a===void 0)&&a.view&&this.anchor.removeChild(this.player.view),this.anchor.removeChild(this.frame)}catch{}t.volumeAdjuster.off("update",this._updateVolumeByStaticAdjuster)},t.prototype.waitLoadEnd=function(){return Ji(this,void 0,void 0,function(){var r;return Ki(this,function(o){switch(o.label){case 0:r=0,o.label=1;case 1:return this.isLoading&&r<10?[4,vh(100)]:[3,3];case 2:return o.sent(),r+=1,[3,1];case 3:return[2]}})})},t.prototype.preload=function(r){return this.player?this.player.preload(r):Promise.resolve()},t.prototype.destroy=function(){var r=this;this.logger.info("pre destroy slide",""),this.isLoading?this.waitLoadEnd().then(function(){r._doDestroy()}):this._doDestroy()},t.prototype.clearSlideCache=function(){var r;(r=this.player)===null||r===void 0||r.clearLocalCache()},t.prototype.hasNextStep=function(){if(!this.player)return!1;var r=this.player.currentIndex===this.slideCount,o=this.mainSeqLength===0||this.mainSeqStep>=this.mainSeqLength-1,s=this.mainSeqState==="end"||this.mainSeqState==="running"||this.mainSeqState==null;return!(r&&o&&s)},t.prototype.hasPrevStep=function(){if(!this.player)return!1;var r=this.player.currentIndex===1,o=this.mainSeqLength===0||this.mainSeqStep===0,s=this.mainSeqState==="idle"||this.mainSeqState===null;return!(r&&o&&s)},t.prototype.snapshot=function(){return Ji(this,void 0,void 0,function(){return Ki(this,function(r){return this.player?[2,this.player.getSnapshot()]:[2,null]})})},t.prototype.snapshotWithTimingEnd=function(r){return Ji(this,void 0,void 0,function(){return Ki(this,function(o){return this.player?[2,this.player.snapshotWithTimingEnd(r)]:[2,null]})})},t.prototype.updateGlobalVolume=function(r){this.volumeAdjuster.volume=r},t.prototype.getGlobalVolume=function(){return this.volumeAdjuster.volume},t.clearLocalCache=function(){ar.clearLocalCache()},t.disposeLocalCache=function(){},e=t,t.instances=[],t._tempFrozenIds=[],t._tempLog="",t._tempLogIndex=1,t.remoteLogAddress=null,t.usePlugin=function(r){r.context({logger:{info:function(o){t.appendLogString("INFO - "+new Date().toISOString()+" - "+o+`
7952
7952
  `)},warn:function(o){t.appendLogString("WARN - "+new Date().toISOString()+" - "+o+`
7953
7953
  `)},error:function(o){t.appendLogString("ERROR - "+new Date().toISOString()+" - "+o+`
7954
7954
  `)}}}),function(o){var s=ic.get(o.hookPoint)||[];s.push(o),ic.set(o.hookPoint,s)}(r)},t.volumeAdjuster=new og,t.handleFrozenAllSlide=function(){t.instances.forEach(function(r){r.player&&(t._tempFrozenIds.push(r.randomId),r.frozen())})},t.handleReleaseAllSlide=function(){t._tempFrozenIds.forEach(function(r){var o=t.instances.find(function(s){return s.randomId===r});o&&o.release()}),t._tempFrozenIds=[]},t.handleLogReport=function(r){return Ji(void 0,void 0,void 0,function(){var o,s,a,h,l,u;return Ki(e,function(p){switch(p.label){case 0:return[4,t.flushLog(!0)];case 1:if(p.sent(),!cr)return[3,12];o=[],p.label=2;case 2:return p.trys.push([2,4,,5]),[4,cr.keys()];case 3:return o=(p.sent()||[]).sort(function(y,x){return parseInt(y.replace("run_time_log_",""))-parseInt(x.replace("run_time_log_",""))}),[3,5];case 4:return p.sent(),[3,5];case 5:if(o.length===0)return window.postMessage({type:"@slide/_report_log_",log:"",index:1,total:1,customMessage:"@slide/_report_log_",sessionId:r},"*"),[2];s=0,a=o,p.label=6;case 6:if(!(s<a.length))return[3,12];h=a[s],l=h.replace("run_time_log_",""),u="",p.label=7;case 7:return p.trys.push([7,9,,10]),[4,cr.getItem(h)];case 8:return u=p.sent()||"",[3,10];case 9:return p.sent(),[3,10];case 10:window.postMessage({type:"@slide/_report_log_",log:u,index:parseInt(l,10),total:o.length,customMessage:"@slide/_report_log_",sessionId:r},"*"),p.label=11;case 11:return s++,[3,6];case 12:return[2]}})})},t.handleLogDownload=function(){return Ji(void 0,void 0,void 0,function(){var r,o,s,a,h,l,u;return Ki(e,function(p){switch(p.label){case 0:return p.trys.push([0,7,,8]),[4,t.flushLog(!0)];case 1:return p.sent(),r="",cr?[4,cr.keys()]:[3,6];case 2:o=(p.sent()||[]).sort(function(y,x){return parseInt(y.replace("run_time_log_",""))-parseInt(x.replace("run_time_log_",""))}),s=0,a=o,p.label=3;case 3:return s<a.length?(h=a[s],l=r,[4,cr.getItem(h)]):[3,6];case 4:r=l+(p.sent()||""),p.label=5;case 5:return s++,[3,3];case 6:return(u=document.createElement("a")).setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(r)),u.setAttribute("download","slide_log"),u.style.display="none",document.body.appendChild(u),u.click(),document.body.removeChild(u),[3,8];case 7:return p.sent(),[3,8];case 8:return[2]}})})},HE([(n="Slide.initConfig",function(r,o,s){var a=s.value;s.value=function(){for(var h=[],l=0;l<arguments.length;l++)h[l]=arguments[l];for(var u=ic.get(n)||[],p=h,y=0,x=u;y<x.length;y++){var E=x[y];try{p=E.before(p)}catch{}if(!Array.isArray(p)||p.length!==h.length)throw new Error("plugin before hook return invalid args")}for(var A=a.bind(this).apply(void 0,p),C=0,W=u.reverse();C<W.length;C++){E=W[C];try{A=E.after(A)}catch{}if(!A)throw new Error("plugin after hook return undefined result")}return A}})],t.prototype,"initSlideConfig",null),t}(yi.a);cr==null||cr.clear().catch(function(){}),window.addEventListener("__slide_log__",po.handleLogDownload),window.addEventListener("message",function(i){i.data.type==="@slide/_request_log_"&&po.handleLogReport(i.data.sessionId).catch(function(){})}),window.addEventListener("message",function(i){i.data.type==="@slide/_request_frozen_"&&po.handleFrozenAllSlide()}),window.addEventListener("message",function(i){i.data.type==="@slide/_request_release_"&&po.handleReleaseAllSlide()}),window.addEventListener("message",function(i){if(i.data.type==="@slide/_update_volume_"){var t=.5;try{t=parseFloat(i.data.volume.toString())}catch{}po.volumeAdjuster.volume=t}}),window.addEventListener("message",function(i){i.data.type==="@slide/_get_volume_"&&window.postMessage({type:"@slide/_report_volume_",volume:po.volumeAdjuster.volume,customMessage:"@slide/_report_volume_"},"*")}),window.setInterval(function(){po.flushLog().catch(function(){})},2e3)}]);const KE="!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",ZE=87,QE=20,Qg=[],$E=()=>{for(let b=0;b<QE;b++)Qg[b]=KE.charAt(Math.random()*ZE);return Qg.join("")};function sv(b){try{return b()}catch(w){console.error(w)}}class Ka{constructor(){this.push=this.addDisposer,this.disposers=new Map}addDisposer(w,v=this.genUID()){return this.flush(v),this.disposers.set(v,Array.isArray(w)?tS(w):w),v}add(w,v=this.genUID()){const O=w();return O?this.addDisposer(O,v):v}addEventListener(w,v,O,M,I=this.genUID()){return w.addEventListener(v,O,M),this.addDisposer(()=>w.removeEventListener(v,O,M),I),I}setTimeout(w,v,O=this.genUID()){const M=window.setTimeout(()=>{this.remove(O),w()},v);return this.addDisposer(()=>window.clearTimeout(M),O)}setInterval(w,v,O=this.genUID()){const M=window.setInterval(w,v);return this.addDisposer(()=>window.clearInterval(M),O)}remove(w){const v=this.disposers.get(w);return this.disposers.delete(w),v}flush(w){const v=this.remove(w);v&&v()}flushAll(){this.disposers.forEach(sv),this.disposers.clear()}genUID(){let w;do w=$E();while(this.disposers.has(w));return w}}function tS(b){return()=>b.forEach(sv)}function av(b,w,v){return Math.min(Math.max(b,w),v)}function eS(b){return typeof b=="object"&&b!==null}var lv={exports:{}},nS={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},hv={exports:{}},iS=function(w){return!w||typeof w=="string"?!1:w instanceof Array||Array.isArray(w)||w.length>=0&&(w.splice instanceof Function||Object.getOwnPropertyDescriptor(w,w.length-1)&&w.constructor.name!=="String")},rS=iS,oS=Array.prototype.concat,sS=Array.prototype.slice,$g=hv.exports=function(w){for(var v=[],O=0,M=w.length;O<M;O++){var I=w[O];rS(I)?v=oS.call(v,sS.call(I)):v.push(I)}return v};$g.wrap=function(b){return function(){return b($g(arguments))}};var qa=nS,Za=hv.exports,uv=Object.hasOwnProperty,cv=Object.create(null);for(var Ec in qa)uv.call(qa,Ec)&&(cv[qa[Ec]]=Ec);var Sr=lv.exports={to:{},get:{}};Sr.get=function(b){var w=b.substring(0,3).toLowerCase(),v,O;switch(w){case"hsl":v=Sr.get.hsl(b),O="hsl";break;case"hwb":v=Sr.get.hwb(b),O="hwb";break;default:v=Sr.get.rgb(b),O="rgb";break}return v?{model:O,value:v}:null};Sr.get.rgb=function(b){if(!b)return null;var w=/^#([a-f0-9]{3,4})$/i,v=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,O=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,M=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,I=/^(\w+)$/,D=[0,0,0,1],U,V,j;if(U=b.match(v)){for(j=U[2],U=U[1],V=0;V<3;V++){var J=V*2;D[V]=parseInt(U.slice(J,J+2),16)}j&&(D[3]=parseInt(j,16)/255)}else if(U=b.match(w)){for(U=U[1],j=U[3],V=0;V<3;V++)D[V]=parseInt(U[V]+U[V],16);j&&(D[3]=parseInt(j+j,16)/255)}else if(U=b.match(O)){for(V=0;V<3;V++)D[V]=parseInt(U[V+1],0);U[4]&&(U[5]?D[3]=parseFloat(U[4])*.01:D[3]=parseFloat(U[4]))}else if(U=b.match(M)){for(V=0;V<3;V++)D[V]=Math.round(parseFloat(U[V+1])*2.55);U[4]&&(U[5]?D[3]=parseFloat(U[4])*.01:D[3]=parseFloat(U[4]))}else return(U=b.match(I))?U[1]==="transparent"?[0,0,0,0]:uv.call(qa,U[1])?(D=qa[U[1]],D[3]=1,D):null:null;for(V=0;V<3;V++)D[V]=zo(D[V],0,255);return D[3]=zo(D[3],0,1),D};Sr.get.hsl=function(b){if(!b)return null;var w=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,v=b.match(w);if(v){var O=parseFloat(v[4]),M=(parseFloat(v[1])%360+360)%360,I=zo(parseFloat(v[2]),0,100),D=zo(parseFloat(v[3]),0,100),U=zo(isNaN(O)?1:O,0,1);return[M,I,D,U]}return null};Sr.get.hwb=function(b){if(!b)return null;var w=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,v=b.match(w);if(v){var O=parseFloat(v[4]),M=(parseFloat(v[1])%360+360)%360,I=zo(parseFloat(v[2]),0,100),D=zo(parseFloat(v[3]),0,100),U=zo(isNaN(O)?1:O,0,1);return[M,I,D,U]}return null};Sr.to.hex=function(){var b=Za(arguments);return"#"+yh(b[0])+yh(b[1])+yh(b[2])+(b[3]<1?yh(Math.round(b[3]*255)):"")};Sr.to.rgb=function(){var b=Za(arguments);return b.length<4||b[3]===1?"rgb("+Math.round(b[0])+", "+Math.round(b[1])+", "+Math.round(b[2])+")":"rgba("+Math.round(b[0])+", "+Math.round(b[1])+", "+Math.round(b[2])+", "+b[3]+")"};Sr.to.rgb.percent=function(){var b=Za(arguments),w=Math.round(b[0]/255*100),v=Math.round(b[1]/255*100),O=Math.round(b[2]/255*100);return b.length<4||b[3]===1?"rgb("+w+"%, "+v+"%, "+O+"%)":"rgba("+w+"%, "+v+"%, "+O+"%, "+b[3]+")"};Sr.to.hsl=function(){var b=Za(arguments);return b.length<4||b[3]===1?"hsl("+b[0]+", "+b[1]+"%, "+b[2]+"%)":"hsla("+b[0]+", "+b[1]+"%, "+b[2]+"%, "+b[3]+")"};Sr.to.hwb=function(){var b=Za(arguments),w="";return b.length>=4&&b[3]!==1&&(w=", "+b[3]),"hwb("+b[0]+", "+b[1]+"%, "+b[2]+"%"+w+")"};Sr.to.keyword=function(b){return cv[b.slice(0,3)]};function zo(b,w,v){return Math.min(Math.max(w,b),v)}function yh(b){var w=Math.round(b).toString(16).toUpperCase();return w.length<2?"0"+w:w}var aS=lv.exports;class lS{constructor(w){this.enable=w,this.apps={},this.level="debug",this.roomLogger=null,this._onMessage=v=>{let O;v instanceof CustomEvent?O=v.detail:eS(v.data)&&(O=v.data),O&&(typeof O.slide=="boolean"?this.enable=O.slide:O.slide==="__instance"?console.log(this):O.slide==="__debug"&&Object.values(this.apps).forEach(M=>{var I,D;(D=(I=M.controller)==null?void 0:I.slide)==null||D.createController()}))},this.initialize()}setAppContext(w,v){var O;((O=this.apps)[w]||(O[w]={})).context=v,this.log(`[Slide] new ${w}`)}setAppController(w,v){var O;((O=this.apps)[w]||(O[w]={})).controller=v}deleteApp(w){delete this.apps[w],this.log(`[Slide] delete ${w}`)}initialize(){window.addEventListener("message",this._onMessage)}dispose(){window.removeEventListener("message",this._onMessage)}log(...w){this.roomLogger?this.roomLogger.info(...w):this.enable&&console.log(...w)}verbose(...w){this.roomLogger?this.roomLogger.debug(...w):this.enable&&this.level==="verbose"&&console.log(...w)}warn(...w){this.roomLogger?this.roomLogger.warn(...w):console.warn(...w)}}const Nr=new lS(!1),ji=Nr.log.bind(Nr),Sc=Nr.verbose.bind(Nr),hS=b=>{Nr.roomLogger=b.logger};function dv(b){try{const w=window.getComputedStyle(b).backgroundColor;if(w!=="rgba(0, 0, 0, 0)"&&w!=="transparent")return w;if(b.parentElement)return dv(b.parentElement)}catch{}return"#ffffff"}function uS(b){const w=aS.get(b);if(w&&w.model==="rgb"){const v=w.value,M=(((Math.round(v[0])&255)<<16)+((Math.round(v[1])&255)<<8)+(Math.round(v[2])&255)).toString(16);return"#"+"000000".substring(M.length)+M}else return b}let xh="";function pv(b){return xh||(xh=uS(dv(b)),ji("[Slide] guess bg color",xh)),xh}function fv(b){const{width:w,height:v,slideCount:O,slideState:M}=b,{taskId:I,url:D}=M,U=[];for(let V=1;V<=O;++V)U.push({width:w,height:v,thumbnail:`${D}/${I}/preview/${V}.png`,src:"ppt"});return U}function tv(b,w,v,O){var U;const M=v.slideState.currentSlideIndex;if(!(M>0)||!w.getIsWritable())return;const I=[O,M].join("/");if(b.scenePathType(I)!=="page"){b.removeScenes(O);const V=v.slideCount,j=[];for(let J=1;J<=V;++J)j.push({name:`${J}`});b.putScenes(O,j)}let D;w.getBox().focus?D=b.state.sceneState.scenePath:D=((U=w.getView())==null?void 0:U.focusScenePath)||"",D!==I&&w.setScenePath(I)}const Pc="https://convertcdn.netless.link/dynamicConvert",cS=40,wc={taskId:"",url:"",state:null};class dS{constructor({context:w,anchor:v,onPageChanged:O,onTransitionStart:M,onTransitionEnd:I,onError:D,onRenderError:U,showRenderError:V}){this.sideEffect=new Ka,this.ready=!1,this.readyPromise=new Promise(j=>{this.resolveReady=()=>{this.ready?ji("[Slide] render end"):setTimeout(()=>{this.ready=!0,j()},1e3)}}),this.onSyncDispatch=j=>{if(this.context.getIsWritable()&&this.room){const J={type:li.SLIDE_EVENTS.syncDispatch,payload:j};Sc("[Slide] dispatch",JSON.stringify(j)),this.context.dispatchMagixEvent(li.SLIDE_EVENTS.syncDispatch,J)}},this.magixEventListener=j=>{const{type:J,payload:et}=j.payload;J===li.SLIDE_EVENTS.syncDispatch&&(this.syncStateOnce(),Sc("[Slide] receive",JSON.stringify(et)),this.slide.emit(li.SLIDE_EVENTS.syncReceive,et))},this.onStateChange=j=>{this.context.getIsWritable()&&(Sc("[Slide] state change",JSON.stringify(j,null,2)),this.context.storage.setState({state:j}))},this.pollCount=0,this.pollReadyState=()=>{this.ready?this._toFreeze===1?this.freeze():this._toFreeze===-1&&this.unfreeze():this.pollCount<cS?(this.pollCount++,setTimeout(this.pollReadyState,500)):(this.pollCount=0,ji("[Slide] renderSlide 1 (retry after timeout)"),this.slide.renderSlide(1))},this._pageCount=0,this.destroyed=!1,this.timestamp=()=>this.room&&this.room.calibrationTimestamp?this.room.calibrationTimestamp:this.player?this.player.beginTimestamp+this.player.progressTime:Date.now(),this.isFrozen=!1,this._toFreeze=0,this.freeze=()=>{this.isFrozen=!0,this.ready?(ji("[Slide] freeze",this.context.appId),this.slide.frozen()):this._toFreeze=1},this.unfreeze=async()=>{!this.visible||(this.isFrozen=!1,this.ready?(ji("[Slide] unfreeze",this.context.appId),this.slide.release()):this._toFreeze=-1)},this.onVisibilityChange=async()=>{(this.visible=document.visibilityState==="visible")?(ji("[Slide] unfreeze because tab becomes visible",{savedIsFrozen:this.savedIsFrozen}),this.savedIsFrozen||this.unfreeze()):(this.savedIsFrozen=this.isFrozen,ji("[Slide] freeze because tab becomes invisible"),this.freeze())},this.onPageChanged=O,this.onTransitionStart=M,this.onTransitionEnd=I,this.onError=D,this.onRenderError=U,this.showRenderError=V!=null?V:!0,this.context=w,this.room=w.getRoom(),this.player=this.room?void 0:w.getDisplayer(),hS(this.room||this.player),this.slide=this.createSlide(v),this.syncStateOnceFlag=!this.context.isAddApp,this.visible=document.visibilityState==="visible",this.savedIsFrozen=!1,this.initialize()}jumpToPage(w){this.ready&&(w=av(w,1,this.pageCount),this.slide.renderSlide(w))}initialize(){this.registerEventListeners(),this.kickStart()}kickStart(){const{context:w,slide:v}=this;w.getIsWritable()&&w.storage.ensureState(wc);const{taskId:O,url:M,state:I}=w.storage.state;v.setResource(O,M||Pc),I?(ji("[Slide] init with state",JSON.stringify(I)),this.syncStateOnceFlag=!1,v.setSlideState(I)):w.isAddApp&&(ji("[Slide] init by renderSlide",1),v.renderSlide(1)),this.pollReadyState()}registerEventListeners(){const{context:w,slide:v}=this,O=this.sideEffect.addDisposer(w.storage.addStateChangedListener(()=>{w.storage.state.state&&(this.syncStateOnce(),this.sideEffect.flush(O))}));this.sideEffect.add(()=>w.addMagixEventListener(li.SLIDE_EVENTS.syncDispatch,this.magixEventListener,{fireSelfEventAfterCommit:!0})),v.on(li.SLIDE_EVENTS.slideChange,this.onPageChanged),v.on(li.SLIDE_EVENTS.renderStart,this.onTransitionStart),v.on(li.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),v.on(li.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),v.on(li.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),v.on(li.SLIDE_EVENTS.renderError,this.onError),v.on(li.SLIDE_EVENTS.stateChange,this.onStateChange),v.on(li.SLIDE_EVENTS.syncDispatch,this.onSyncDispatch),v.on(li.SLIDE_EVENTS.renderEnd,this.resolveReady),this.sideEffect.add(()=>(document.addEventListener("visibilitychange",this.onVisibilityChange),()=>document.removeEventListener("visibilitychange",this.onVisibilityChange)))}syncStateOnce(){if(this.syncStateOnceFlag){this.context.getIsWritable()&&this.context.storage.ensureState(wc);const{state:w}=this.context.storage.state;w&&(ji("[Slide] sync with state (once)",JSON.stringify(w)),this.slide.setSlideState(w),this.syncStateOnceFlag=!1)}}get pageCount(){return this._pageCount>0?this._pageCount:(this._pageCount=this.slide.slideCount,this._pageCount)}get page(){return this.slide.slideState.currentSlideIndex}createSlide(w){var M,I;const v=this.context.getAppOptions()||{};return new li.Slide({anchor:w,interactive:!0,mode:"interactive",controller:Nr.enable,enableGlobalClick:!0,renderOptions:{minFPS:v.minFPS||25,maxFPS:v.maxFPS||30,autoFPS:(M=v.autoFPS)!=null?M:!0,autoResolution:(I=v.autoResolution)!=null?I:!0,resolution:v.resolution,transactionBgColor:v.bgColor||pv(w),maxResolutionLevel:v.maxResolutionLevel,forceCanvas:v.forceCanvas,enableNvidiaDetect:v.enableNvidiaDetect},fixedFrameSize:v.fixedFrameSize,loaderDelegate:v.loaderDelegate,navigatorDelegate:v.navigatorDelegate,urlInterrupter:v.urlInterrupter,resourceTimeout:v.resourceTimeout,rtcAudio:v.rtcAudio,useLocalCache:v.useLocalCache,logger:v.logger,timestamp:this.timestamp})}destroy(){this.sideEffect.flushAll(),this.destroyed||(ji("[Slide] destroy slide (once)"),this.slide.destroy(),this.destroyed=!0)}}function pS(b){const w="http://www.w3.org/2000/svg",v=document.createElementNS(w,"svg");v.setAttribute("class",`${b}-footer-icon-sidebar`),v.setAttribute("viewBox","0 0 64 64");const O=document.createElementNS(w,"path");return O.setAttribute("fill","currentColor"),O.setAttribute("d","M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z"),v.appendChild(O),v}function fS(b){const w="http://www.w3.org/2000/svg",v=document.createElementNS(w,"svg");v.setAttribute("class",`${b}-footer-icon-arrow-left`),v.setAttribute("viewBox","0 0 500 500");const O=document.createElementNS(w,"path");return O.setAttribute("fill","currentColor"),O.setAttribute("d","M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z"),v.appendChild(O),v}function mS(b){const w="http://www.w3.org/2000/svg",v=document.createElementNS(w,"svg");v.setAttribute("class",`${b}-footer-icon-arrow-right`),v.setAttribute("viewBox","0 0 500 500");const O=document.createElementNS(w,"path");return O.setAttribute("fill","currentColor"),O.setAttribute("d","M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z"),v.appendChild(O),v}function gS(b){const w="http://www.w3.org/2000/svg",v=document.createElementNS(w,"svg");v.setAttribute("class",`${b}-footer-icon-play`),v.setAttribute("viewBox","0 0 500 500");const O=document.createElementNS(w,"path");return O.setAttribute("fill","currentColor"),O.setAttribute("d","M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z"),v.appendChild(O),v}function vS(b){const w="http://www.w3.org/2000/svg",v=document.createElementNS(w,"svg");v.setAttribute("class",`${b}-footer-icon-pause`),v.setAttribute("viewBox","0 0 500 500");const O=document.createElementNS(w,"path");return O.setAttribute("fill","currentColor"),O.setAttribute("d","M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"),v.appendChild(O),v}const Wo=typeof window!="undefined",mv=Wo&&!("onscroll"in window)||typeof navigator!="undefined"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),gv=Wo&&"IntersectionObserver"in window,vv=Wo&&"classList"in document.createElement("p"),_v=Wo&&window.devicePixelRatio>1,_S={elements_selector:".lazy",container:mv||Wo?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},yv=b=>Object.assign({},_S,b),ev=function(b,w){let v;const O="LazyLoad::Initialized",M=new b(w);try{v=new CustomEvent(O,{detail:{instance:M}})}catch{v=document.createEvent("CustomEvent"),v.initCustomEvent(O,!1,!1,{instance:M})}window.dispatchEvent(v)},yS=(b,w)=>{if(!!w)if(!w.length)ev(b,w);else for(let v=0,O;O=w[v];v+=1)ev(b,O)},fo="src",Oc="srcset",Nc="sizes",xv="poster",Qa="llOriginalAttrs",bv="data",Lc="loading",Tv="loaded",Ev="applied",xS="entered",Dc="error",Sv="native",wv="data-",Av="ll-status",fr=(b,w)=>b.getAttribute(wv+w),bS=(b,w,v)=>{var O=wv+w;if(v===null){b.removeAttribute(O);return}b.setAttribute(O,v)},$a=b=>fr(b,Av),gs=(b,w)=>bS(b,Av,w),Eh=b=>gs(b,null),Fc=b=>$a(b)===null,TS=b=>$a(b)===Lc,ES=b=>$a(b)===Dc,Bc=b=>$a(b)===Sv,SS=[Lc,Tv,Ev,Dc],wS=b=>SS.indexOf($a(b))>=0,Xo=(b,w,v,O)=>{if(!!b){if(O!==void 0){b(w,v,O);return}if(v!==void 0){b(w,v);return}b(w)}},ta=(b,w)=>{if(vv){b.classList.add(w);return}b.className+=(b.className?" ":"")+w},eo=(b,w)=>{if(vv){b.classList.remove(w);return}b.className=b.className.replace(new RegExp("(^|\\s+)"+w+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},AS=b=>{b.llTempImage=document.createElement("IMG")},MS=b=>{delete b.llTempImage},Mv=b=>b.llTempImage,Sh=(b,w)=>{if(!w)return;const v=w._observer;!v||v.unobserve(b)},CS=b=>{b.disconnect()},RS=(b,w,v)=>{w.unobserve_entered&&Sh(b,v)},Uc=(b,w)=>{!b||(b.loadingCount+=w)},IS=b=>{!b||(b.toLoadCount-=1)},Cv=(b,w)=>{!b||(b.toLoadCount=w)},PS=b=>b.loadingCount>0,OS=b=>b.toLoadCount>0,Rv=b=>{let w=[];for(let v=0,O;O=b.children[v];v+=1)O.tagName==="SOURCE"&&w.push(O);return w},kc=(b,w)=>{const v=b.parentNode;if(!v||v.tagName!=="PICTURE")return;Rv(v).forEach(w)},Iv=(b,w)=>{Rv(b).forEach(w)},wh=[fo],Pv=[fo,xv],Ja=[fo,Oc,Nc],Ov=[bv],Ah=b=>!!b[Qa],Nv=b=>b[Qa],Lv=b=>delete b[Qa],$s=(b,w)=>{if(Ah(b))return;const v={};w.forEach(O=>{v[O]=b.getAttribute(O)}),b[Qa]=v},NS=b=>{Ah(b)||(b[Qa]={backgroundImage:b.style.backgroundImage})},LS=(b,w,v)=>{if(!v){b.removeAttribute(w);return}b.setAttribute(w,v)},ms=(b,w)=>{if(!Ah(b))return;const v=Nv(b);w.forEach(O=>{LS(b,O,v[O])})},DS=b=>{if(!Ah(b))return;const w=Nv(b);b.style.backgroundImage=w.backgroundImage},Dv=(b,w,v)=>{ta(b,w.class_applied),gs(b,Ev),v&&(w.unobserve_completed&&Sh(b,w),Xo(w.callback_applied,b,v))},Fv=(b,w,v)=>{ta(b,w.class_loading),gs(b,Lc),v&&(Uc(v,1),Xo(w.callback_loading,b,v))},Vo=(b,w,v)=>{!v||b.setAttribute(w,v)},nv=(b,w)=>{Vo(b,Nc,fr(b,w.data_sizes)),Vo(b,Oc,fr(b,w.data_srcset)),Vo(b,fo,fr(b,w.data_src))},FS=(b,w)=>{kc(b,v=>{$s(v,Ja),nv(v,w)}),$s(b,Ja),nv(b,w)},BS=(b,w)=>{$s(b,wh),Vo(b,fo,fr(b,w.data_src))},US=(b,w)=>{Iv(b,v=>{$s(v,wh),Vo(v,fo,fr(v,w.data_src))}),$s(b,Pv),Vo(b,xv,fr(b,w.data_poster)),Vo(b,fo,fr(b,w.data_src)),b.load()},kS=(b,w)=>{$s(b,Ov),Vo(b,bv,fr(b,w.data_src))},GS=(b,w,v)=>{const O=fr(b,w.data_bg),M=fr(b,w.data_bg_hidpi),I=_v&&M?M:O;!I||(b.style.backgroundImage=`url("${I}")`,Mv(b).setAttribute(fo,I),Fv(b,w,v))},HS=(b,w,v)=>{const O=fr(b,w.data_bg_multi),M=fr(b,w.data_bg_multi_hidpi),I=_v&&M?M:O;!I||(b.style.backgroundImage=I,Dv(b,w,v))},jS=(b,w,v)=>{const O=fr(b,w.data_bg_set);if(!O)return;const M=O.split("|");let I=M.map(D=>`image-set(${D})`);b.style.backgroundImage=I.join(),b.style.backgroundImage===""&&(I=M.map(D=>`-webkit-image-set(${D})`),b.style.backgroundImage=I.join()),Dv(b,w,v)},Bv={IMG:FS,IFRAME:BS,VIDEO:US,OBJECT:kS},zS=(b,w)=>{const v=Bv[b.tagName];!v||v(b,w)},VS=(b,w,v)=>{const O=Bv[b.tagName];!O||(O(b,w),Fv(b,w,v))},WS=["IMG","IFRAME","VIDEO","OBJECT"],XS=b=>WS.indexOf(b.tagName)>-1,Uv=(b,w)=>{w&&!PS(w)&&!OS(w)&&Xo(b.callback_finish,w)},iv=(b,w,v)=>{b.addEventListener(w,v),b.llEvLisnrs[w]=v},YS=(b,w,v)=>{b.removeEventListener(w,v)},Gc=b=>!!b.llEvLisnrs,qS=(b,w,v)=>{Gc(b)||(b.llEvLisnrs={});const O=b.tagName==="VIDEO"?"loadeddata":"load";iv(b,O,w),iv(b,"error",v)},Ac=b=>{if(!Gc(b))return;const w=b.llEvLisnrs;for(let v in w){const O=w[v];YS(b,v,O)}delete b.llEvLisnrs},kv=(b,w,v)=>{MS(b),Uc(v,-1),IS(v),eo(b,w.class_loading),w.unobserve_completed&&Sh(b,v)},JS=(b,w,v,O)=>{const M=Bc(w);kv(w,v,O),ta(w,v.class_loaded),gs(w,Tv),Xo(v.callback_loaded,w,O),M||Uv(v,O)},KS=(b,w,v,O)=>{const M=Bc(w);kv(w,v,O),ta(w,v.class_error),gs(w,Dc),Xo(v.callback_error,w,O),v.restore_on_error&&ms(w,Ja),M||Uv(v,O)},Hc=(b,w,v)=>{const O=Mv(b)||b;if(Gc(O))return;qS(O,D=>{JS(D,b,w,v),Ac(O)},D=>{KS(D,b,w,v),Ac(O)})},ZS=(b,w,v)=>{AS(b),Hc(b,w,v),NS(b),GS(b,w,v),HS(b,w,v),jS(b,w,v)},QS=(b,w,v)=>{Hc(b,w,v),VS(b,w,v)},jc=(b,w,v)=>{XS(b)?QS(b,w,v):ZS(b,w,v)},$S=(b,w,v)=>{b.setAttribute("loading","lazy"),Hc(b,w,v),zS(b,w),gs(b,Sv)},rv=b=>{b.removeAttribute(fo),b.removeAttribute(Oc),b.removeAttribute(Nc)},tw=b=>{kc(b,w=>{rv(w)}),rv(b)},Gv=b=>{kc(b,w=>{ms(w,Ja)}),ms(b,Ja)},ew=b=>{Iv(b,w=>{ms(w,wh)}),ms(b,Pv),b.load()},nw=b=>{ms(b,wh)},iw=b=>{ms(b,Ov)},rw={IMG:Gv,IFRAME:nw,VIDEO:ew,OBJECT:iw},ow=b=>{const w=rw[b.tagName];if(!w){DS(b);return}w(b)},sw=(b,w)=>{Fc(b)||Bc(b)||(eo(b,w.class_entered),eo(b,w.class_exited),eo(b,w.class_applied),eo(b,w.class_loading),eo(b,w.class_loaded),eo(b,w.class_error))},aw=(b,w)=>{ow(b),sw(b,w),Eh(b),Lv(b)},lw=(b,w,v,O)=>{!v.cancel_on_exit||!TS(b)||b.tagName==="IMG"&&(Ac(b),tw(b),Gv(b),eo(b,v.class_loading),Uc(O,-1),Eh(b),Xo(v.callback_cancel,b,w,O))},hw=(b,w,v,O)=>{const M=wS(b);gs(b,xS),ta(b,v.class_entered),eo(b,v.class_exited),RS(b,v,O),Xo(v.callback_enter,b,w,O),!M&&jc(b,v,O)},uw=(b,w,v,O)=>{Fc(b)||(ta(b,v.class_exited),lw(b,w,v,O),Xo(v.callback_exit,b,w,O))},cw=["IMG","IFRAME","VIDEO"],Hv=b=>b.use_native&&"loading"in HTMLImageElement.prototype,dw=(b,w,v)=>{b.forEach(O=>{cw.indexOf(O.tagName)!==-1&&$S(O,w,v)}),Cv(v,0)},pw=b=>b.isIntersecting||b.intersectionRatio>0,fw=b=>({root:b.container===document?null:b.container,rootMargin:b.thresholds||b.threshold+"px"}),mw=(b,w,v)=>{b.forEach(O=>pw(O)?hw(O.target,O,w,v):uw(O.target,O,w,v))},gw=(b,w)=>{w.forEach(v=>{b.observe(v)})},vw=(b,w)=>{CS(b),gw(b,w)},_w=(b,w)=>{!gv||Hv(b)||(w._observer=new IntersectionObserver(v=>{mw(v,b,w)},fw(b)))},jv=b=>Array.prototype.slice.call(b),bh=b=>b.container.querySelectorAll(b.elements_selector),yw=b=>jv(b).filter(Fc),xw=b=>ES(b),bw=b=>jv(b).filter(xw),ov=(b,w)=>yw(b||bh(w)),Tw=(b,w)=>{bw(bh(b)).forEach(O=>{eo(O,b.class_error),Eh(O)}),w.update()},Ew=(b,w)=>{!Wo||(w._onlineHandler=()=>{Tw(b,w)},window.addEventListener("online",w._onlineHandler))},Sw=b=>{!Wo||window.removeEventListener("online",b._onlineHandler)},tl=function(b,w){const v=yv(b);this._settings=v,this.loadingCount=0,_w(v,this),Ew(v,this),this.update(w)};tl.prototype={update:function(b){const w=this._settings,v=ov(b,w);if(Cv(this,v.length),mv||!gv){this.loadAll(v);return}if(Hv(w)){dw(v,w,this);return}vw(this._observer,v)},destroy:function(){this._observer&&this._observer.disconnect(),Sw(this),bh(this._settings).forEach(b=>{Lv(b)}),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(b){const w=this._settings;ov(b,w).forEach(O=>{Sh(O,this),jc(O,w,this)})},restoreAll:function(){const b=this._settings;bh(b).forEach(w=>{aw(w,b)})}};tl.load=(b,w)=>{const v=yv(w);jc(b,v)};tl.resetStatus=b=>{Eh(b)};Wo&&yS(tl,window.lazyLoadOptions);class zv{constructor({readonly:w,onNewPageIndex:v,onPlay:O}){this._pages=[],this.pageIndex=0,this.setPaused=()=>{this.$btnPlay.classList.toggle(this.wrapClassName("footer-btn-playing"),!1)},this.setPlaying=()=>{this.$btnPlay.classList.toggle(this.wrapClassName("footer-btn-playing"),!0)},this.namespace="netless-app-slide",this.isShowPreview=!1,this.isSmallBox=!1,this.sideEffect=new Ka,this.readonly=w,this.onNewPageIndex=v,this.onPlay=O,this.render()}set pages(w){this._pages=w,this.refreshPreview(),this.refreshTotalPage(),this.refreshBtnSidebar()}get pages(){return this._pages}unmount(){this.$content.remove(),this.$footer.remove()}setReadonly(w){this.readonly=w,this.$content.classList.toggle(this.wrapClassName("readonly"),w),this.$footer.classList.toggle(this.wrapClassName("readonly"),w),this.$pageNumberInput.disabled=w}destroy(){var w;(w=this.previewLazyLoad)==null||w.destroy(),this.sideEffect.flushAll(),this.unmount()}setPageIndex(w){Number.isNaN(w)||(this.pageIndex=w,this.$pageNumberInput.value=String(w+1))}refreshTotalPage(){this.pages.length?this.$totalPage.textContent=" / "+this.pages.length:this.$totalPage.textContent=""}setSmallBox(w){this.isSmallBox!==w&&(this.isSmallBox=w,this.$footer.classList.toggle(this.wrapClassName("float-footer"),w))}render(){return this.renderContent(),this.renderFooter(),this.$content}renderContent(){if(!this.$content){const w=document.createElement("div");w.className=this.wrapClassName("content"),this.$content=w,this.readonly&&w.classList.add(this.wrapClassName("readonly")),w.appendChild(this.renderPreviewMask()),w.appendChild(this.renderPreview())}return this.$content}renderPreview(){if(!this.$preview){const w=document.createElement("div");w.className=this.wrapClassName("preview")+" tele-fancy-scrollbar",this.$preview=w,this.refreshPreview(),this.sideEffect.addEventListener(w,"click",v=>{var M;if(this.readonly)return;const O=(M=v.target.dataset)==null?void 0:M.pageIndex;O&&(v.preventDefault(),v.stopPropagation(),v.stopImmediatePropagation(),this.onNewPageIndex(Number(O)),this.togglePreview(!1))})}return this.$preview}refreshPreview(){var M;const{$preview:w}=this,v=this.wrapClassName("preview-page"),O=this.wrapClassName("preview-page-name");for(;w.firstChild;)w.firstChild.remove();this.pages.forEach((I,D)=>{var mt;const U=(mt=I.thumbnail)!=null?mt:I.src.startsWith("ppt")?void 0:I.src;if(!U)return;const V=String(D),j=document.createElement("a");j.className=v+" "+this.wrapClassName(`preview-page-${D}`),j.setAttribute("href","#"),j.dataset.pageIndex=V;const J=document.createElement("span");J.className=O,J.textContent=String(D+1),J.dataset.pageIndex=V;const et=document.createElement("img");et.width=I.width,et.height=I.height,et.dataset.src=U,et.dataset.pageIndex=V,j.appendChild(et),j.appendChild(J),w.appendChild(j)}),(M=this.previewLazyLoad)==null||M.update()}renderPreviewMask(){return this.$previewMask||(this.$previewMask=document.createElement("div"),this.$previewMask.className=this.wrapClassName("preview-mask"),this.sideEffect.addEventListener(this.$previewMask,"click",w=>{this.readonly||w.target===this.$previewMask&&this.togglePreview(!1)})),this.$previewMask}refreshBtnSidebar(){this.$btnSidebar.style.display=this.pages.length>0?"":"none"}renderFooter(){if(!this.$footer){const w=document.createElement("div");w.className=this.wrapClassName("footer"),this.$footer=w,this.readonly&&w.classList.add(this.wrapClassName("readonly")),this.isSmallBox&&w.classList.add(this.wrapClassName("float-footer"));const v=this.renderFooterBtn("btn-sidebar",pS(this.namespace));this.sideEffect.addEventListener(v,"click",()=>{this.readonly||this.togglePreview()}),this.$btnSidebar=v,this.$btnSidebar.style.display="none",this.$footer.appendChild(v);const O=document.createElement("div");O.className=this.wrapClassName("page-jumps");const M=this.renderFooterBtn("btn-page-back",fS(this.namespace));if(this.sideEffect.addEventListener(M,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex-1)}),O.appendChild(M),this.onPlay){const j=this.renderFooterBtn("btn-page-play",gS(this.namespace),vS(this.namespace));this.$btnPlay=j,this.sideEffect.addEventListener(j,"click",()=>{this.readonly||(this.setPlaying(),this.onPlay&&this.onPlay())}),O.appendChild(j)}const I=this.renderFooterBtn("btn-page-next",mS(this.namespace));this.sideEffect.addEventListener(I,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex+1)}),O.appendChild(I);const D=document.createElement("div");D.className=this.wrapClassName("page-number");const U=document.createElement("input");U.className=this.wrapClassName("page-number-input"),U.value=String(this.pageIndex+1),this.readonly&&(U.disabled=!0),this.$pageNumberInput=U,this.sideEffect.addEventListener(U,"focus",()=>{U.select()}),this.sideEffect.addEventListener(U,"change",()=>{this.readonly||U.value&&this.onNewPageIndex(Number(U.value)-1)});const V=document.createElement("span");this.$totalPage=V,D.appendChild(U),D.appendChild(V),this.$footer.appendChild(O),this.$footer.appendChild(D)}return this.$footer}renderFooterBtn(w,v,O){const M=document.createElement("button");return M.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(w),M.appendChild(v),O&&M.appendChild(O),M}togglePreview(w){if(this.isShowPreview=w!=null?w:!this.isShowPreview,this.$content.classList.toggle(this.wrapClassName("preview-active"),this.isShowPreview),this.isShowPreview){const v=this.$preview.querySelector("."+this.wrapClassName(`preview-page-${this.pageIndex}`));v&&(this.previewLazyLoad||(this.previewLazyLoad=new tl({container:this.$preview,elements_selector:`.${this.wrapClassName("preview-page>img")}`})),this.$preview.scrollTo({top:v.offsetTop-16}))}}wrapClassName(w){return`${this.namespace}-${w}`}}const ww=new Set(["clicker"]);class Aw{constructor({box:w,view:v,mountSlideController:O,mountWhiteboard:M,baseScenePath:I,appId:D}){this.slideController=null,this.isViewMounted=!1,this.onError=({error:U,index:V})=>{var j,J;this.viewer.setPaused(),(j=this.slideController)!=null&&j.showRenderError&&(this.$overlay.textContent=`Error on slide[page=${this.slideController.page}]: ${U.message}`,this.$overlay.style.opacity="1"),(J=this.slideController)!=null&&J.onRenderError&&this.slideController.onRenderError(U,V),Nr.warn("[Slide] render error",U)},this.onRenderEnd=()=>{this.$overlay.style.opacity=""},this.refreshPages=()=>{this.slideController&&(this.viewer.pages=fv(this.slideController.slide),this.viewer.setPageIndex(this.getPageIndex(this.slideController.page)),this.scaleDocsToFit())},this.scaleDocsToFit=()=>{if(this.slideController){const{width:U,height:V}=this.slideController.slide;U&&V&&(this.whiteboardView.moveCameraToContain({originX:-U/2,originY:-V/2,width:U,height:V,animationMode:"immediately"}),this.whiteboardView.setCameraBound({damping:1,maxContentMode:()=>this.whiteboardView.camera.scale,minContentMode:()=>this.whiteboardView.camera.scale,centerX:0,centerY:0,width:U,height:V}),this.isViewMounted||(this.isViewMounted=!0,console.log("[Slide] mount whiteboard view"),this.mountWhiteboard(this.$whiteboardView)))}},this.onPlay=()=>{this.slideController&&this.slideController.slide.nextStep()},this.onNewPageIndex=U=>{this.slideController&&this.slideController.jumpToPage(U+1)},this.sideEffect=new Ka,this.namespace="netless-app-slide",this.toPdf=async()=>{if(!this.slideController){this.reportProgress(100,null);return}const{slide:U}=this.slideController,V=1920,j=document.createElement("canvas"),J=j.getContext("2d"),{slideCount:et,width:mt,height:Bt}=U;let wt=Math.floor(mt),L=Math.floor(Bt);wt>V&&(wt=V,L=Math.floor(Bt*wt/mt)),L>V&&(L=V,wt=Math.floor(mt*L/Bt)),j.width=wt,j.height=L;const R=document.createElement("canvas");R.width=mt,R.height=Bt;const k=R.getContext("2d");if(!k||!this.getWhiteSnapshot||!J)return this.reportProgress(100,null),null;const X=wt>L?"l":"p",{jsPDF:P}=await Promise.resolve().then(function(){return JE(require("jspdf"))}),H=new P({format:[wt,L],orientation:X,compress:!0});for(let Ct=1;Ct<=et;Ct++){let Vt=null;try{Vt=await this.slideController.slide.snapshotWithTimingEnd(Ct)}catch{}if(Vt){const B=document.createElement("img");B.src=Vt,await new Promise(dt=>B.onload=dt),J.drawImage(B,0,0,wt,L)}k.clearRect(0,0,mt,Bt),this.getWhiteSnapshot(Ct,R,k);try{const B=R.toDataURL("image/png"),dt=document.createElement("img");dt.src=B,await new Promise($=>dt.onload=$),J.drawImage(dt,0,0,wt,L)}catch{}const st=j.toDataURL("image/jpeg",.6);Ct>1&&H.addPage(),H.addImage(st,"JPEG",0,0,wt,L,"","FAST"),J.clearRect(0,0,wt,L),Math.ceil(Ct/et*100)<100&&this.reportProgress(Math.ceil(Ct/et*100),null)}const tt=H.output("arraybuffer"),G=this.box.title;this.reportProgress(100,{pdf:tt,title:G})},this.box=w,this.whiteboardView=v,this.mountSlideController=O,this.mountWhiteboard=M,this.baseScenePath=I,this.appId=D,this.viewer=new zv({readonly:w.readonly,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay}),this.sideEffect.add(()=>{const U=V=>{this.setReadonly(V)};return w.events.on("readonly",U),()=>w.events.off("readonly",U)}),this.sideEffect.add(()=>{const U=V=>{V.data.type==="@netless/_request_save_pdf_"&&V.data.appId===this.appId&&this.toPdf().catch(()=>this.reportProgress(100,null))};return window.addEventListener("message",U),()=>{window.removeEventListener("message",U)}}),this.render()}render(){this.viewer.$content.appendChild(this.renderSlideContainer()),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.viewer.$content.appendChild(this.renderOverlay()),this.sideEffect.addEventListener(window,"keydown",w=>{if(this.box.focus&&this.slideController)switch(w.key){case"ArrowUp":case"ArrowLeft":{this.slideController.slide.prevStep();break}case"ArrowRight":case"ArrowDown":{this.slideController.slide.nextStep();break}}})}renderOverlay(){if(!this.$overlay){const w=document.createElement("div");w.className=this.wrapClassName("overlay"),this.$overlay=w}return this.$overlay}renderSlideContainer(){if(!this.$slide){const w=document.createElement("div");w.className=this.wrapClassName("slide"),w.dataset.appKind="Slide",this.$slide=w}return this.$slide}renderWhiteboardView(){return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view")),this.$whiteboardView}mount(){return this.box.mountContent(this.viewer.$content),this.box.mountFooter(this.viewer.$footer),this.slideController=this.mountSlideController({anchor:this.$slide,onRenderEnd:this.onRenderEnd,onTransitionStart:this.viewer.setPlaying,onTransitionEnd:this.viewer.setPaused,onReady:this.refreshPages,onError:this.onError}),this.scaleDocsToFit(),this.sideEffect.add(()=>(this.whiteboardView.callbacks.on("onSizeUpdated",this.scaleDocsToFit),()=>this.whiteboardView.callbacks.off("onSizeUpdated",this.scaleDocsToFit))),this}getPageIndex(w){return(w>0?w:1)-1}unmount(){return this.slideController&&(this.slideController.destroy(),this.slideController=null),this.viewer.unmount(),this}setReadonly(w){this.viewer.setReadonly(w)}destroy(){this.sideEffect.flushAll(),this.unmount(),this.viewer.destroy()}toggleClickThrough(w){this.$whiteboardView.style.pointerEvents=!w||ww.has(w)?"none":"auto"}wrapClassName(w){return`${this.namespace}-${w}`}getWhiteSnapshot(w,v,O){const{width:M,height:I}=this.whiteboardView.size;v.width=M,v.height=I,this.whiteboardView.screenshotToCanvas(O,`${this.baseScenePath}/${w}`,M,I,{centerX:0,centerY:0,scale:this.whiteboardView.camera.scale})}reportProgress(w,v){window.postMessage({type:"@netless/_result_save_pdf_",appId:this.appId,progress:w,result:v})}}let Mc=!1;exports.FreezerLength=2;function Mw(){return exports.FreezerLength}function Cw(b){exports.FreezerLength=b<1?1/0:b}const Ya=b=>"["+b+"]",Th={map:new Map,boxes:new Map,queue:[],validateQueue(){for(this.queue.sort((b,w)=>{var M,I,D,U;const v=(I=(M=this.boxes.get(b))==null?void 0:M.zIndex)!=null?I:0,O=(U=(D=this.boxes.get(w))==null?void 0:D.zIndex)!=null?U:0;return-(v-O)}),ji("[Slide] freezer: validate",Ya(this.queue));this.queue.length>exports.FreezerLength;){const b=this.queue.pop(),w=this.map.get(b);w&&(ji("[Slide] freezer: validate-freeze",b,Ya(this.queue)),w.freeze())}},set(b,w,v){ji("[Slide] freezer: add",b,Ya(this.queue)),this.map.set(b,w),this.boxes.set(b,v),this.queue.includes(b)||this.queue.unshift(b),this.validateQueue()},delete(b){this.map.delete(b),this.boxes.delete(b),this.queue=this.queue.filter(w=>w!==b),ji("[Slide] freezer: delete",b,Ya(this.queue))},focus(b){const w=this.map.get(b),v=this.queue.indexOf(b);v>-1&&this.queue.splice(v,1),this.queue.unshift(b),this.validateQueue(),ji("[Slide] freezer: focus",b,Ya(this.queue)),w&&w.unfreeze()}},Cc=new Set;function Rw(b){return Cc.add(b),()=>Cc.delete(b)}const Rc=new Set;function Iw(b){return Rc.add(b),()=>Rc.delete(b)}const Pw=b=>{Mc=!0,b.on("focus",({appId:w})=>{Th.focus(w)}),b.on("created",({appId:w})=>{Cc.forEach(v=>v(w))}),b.on("destroy",({appId:w})=>{Rc.forEach(v=>v(w))})};var Vv=(()=>`.netless-app-slide-content{position:relative;height:100%;overflow:hidden}.netless-app-slide-preview-mask{display:none;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%}.netless-app-slide-preview{display:flex;flex-direction:column;align-items:center;position:absolute;z-index:300;top:0;left:0;width:33%;max-width:200px;height:100%;padding-top:10px;transform:translate(-100%);background:rgba(237,237,240,.9);box-shadow:inset -1px 0 #0000001c;transition:transform .4s}.netless-app-slide-preview-active .netless-app-slide-preview-mask{display:block}.netless-app-slide-preview-active .netless-app-slide-preview{transform:translate(0)}.netless-app-slide-preview-page{position:relative;display:block;width:55%;margin-bottom:10px;font-size:0;color:transparent;outline:none;border:7px solid transparent;border-radius:4px;transition:border-color .3s;user-select:none}.netless-app-slide-preview-page:hover,.netless-app-slide-preview-page.netless-app-slide-preview-page-active{border-color:#444e601a}.netless-app-slide-preview-page>img{width:100%;height:auto;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);border-radius:1px;background-color:#fff;box-shadow:0 2px 8px #0000004d}.netless-app-slide-preview-page-name{position:absolute;top:1px;left:-10px;transform:translate(-100%);text-align:right;font-size:12px;color:#5f5f5f;user-select:none}.netless-app-slide-footer{box-sizing:border-box;height:26px;display:flex;align-items:center;padding:0 16px;border-top:1px solid #eeeef7;color:#191919}.netless-app-slide-float-footer{width:100%;min-height:26px;position:absolute;left:0;bottom:0;z-index:2000;background:rgba(249,249,252,.9);transition:opacity .4s}.netless-app-slide-footer-btn{box-sizing:border-box;width:26px;height:26px;font-size:0;margin:0;padding:3px;border:none;border-radius:1px;outline:none;color:currentColor;background:transparent;transition:background .4s;cursor:pointer;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-footer-btn:hover{background:rgba(237,237,240,.9)}@media (hover: none){.netless-app-slide-footer-btn:hover{background:transparent!important}}.netless-app-slide-footer-btn>svg{width:100%;height:100%}.netless-app-slide-footer-btn>svg:nth-of-type(2){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(1){display:none}.netless-app-slide-footer-btn.netless-app-slide-footer-btn-playing>svg:nth-of-type(2){display:initial}.netless-app-slide-footer-btn~.netless-app-slide-footer-btn{margin-left:15px}.netless-app-slide-page-jumps{flex:1;display:flex;justify-content:center;align-items:center}.netless-app-slide-page-number{margin-left:auto;font-size:13px;user-select:none;white-space:nowrap;word-break:keep-all}.netless-app-slide-page-number-input{border:none;outline:none;width:3em;margin:0;padding:0 2px;text-align:right;font-size:13px;line-height:1;font-weight:400;font-family:inherit;border-radius:2px;color:currentColor;background:transparent;transition:background .4s;user-select:text;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-slide-page-number-input:hover,.netless-app-slide-page-number-input:focus,.netless-app-slide-page-number-input:active{background:#fff;box-shadow:#63636333 0 2px 8px}.netless-app-slide-readonly.netless-app-slide-footer{display:none}.telebox-color-scheme-dark .netless-app-slide-page-number-input{color:#a6a6a8}.telebox-color-scheme-dark .netless-app-slide-page-number-input:active,.telebox-color-scheme-dark .netless-app-slide-page-number-input:focus,.telebox-color-scheme-dark .netless-app-slide-page-number-input:hover{color:#222}.telebox-color-scheme-dark .netless-app-slide-footer{color:#a6a6a8;background:#2d2d33;border-top:none}.telebox-color-scheme-dark .netless-app-slide-footer-btn:hover{background:#212126}.telebox-color-scheme-dark .netless-app-slide-preview{background:rgba(50,50,50,.9)}.netless-app-slide-wb-view{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;overflow:hidden}.netless-app-slide-overlay{display:flex;align-items:center;justify-content:center;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%;padding:8px;background:rgba(255,0,0,.25);transition:opacity .3s;opacity:0;pointer-events:none}.netless-app-slide-slide{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.netless-app-slide-slide canvas{transform:scale(var(--netless-app-slide-scale, 1))}
7955
- `)();function Ow({container:b,taskId:w,url:v=Pc,debug:O=!1}){if(!w)throw new Error("[Slide] taskId is required");b.style.cssText+="display:flex;flex-direction:column";const M=new Wv({target:b});return M.debug=!!O,M.mount(w,v),M}class Wv{constructor(w){this.slide=null,this.debug=!1,this.sideEffect=new Ka,this.ready=!1,this.readyPromise=new Promise(v=>{this.resolveReady=()=>{this.ready=!0,v()}}),this.hotkeyListener=v=>{if(this.slide)switch(v.key){case"ArrowUp":case"ArrowLeft":{this.slide.prevStep();break}case"ArrowRight":case"ArrowDown":{this.slide.nextStep();break}}},this.onPageChanged=v=>{this.viewer.setPageIndex(v-1)},this.onTransitionStart=()=>{this.viewer.setPlaying()},this.onTransitionEnd=()=>{this.viewer.setPaused()},this.onError=({error:v})=>{this.viewer.setPaused(),console.warn("[Slide] render error",v)},this.destroyed=!1,this.refreshPages=()=>{this.slide&&(this.viewer.pages=fv(this.slide),this.viewer.setPageIndex(this.getPageIndex(this.slide.slideState.currentSlideIndex)))},this.onPlay=()=>{this.slide&&this.slide.nextStep()},this.onNewPageIndex=v=>{this.slide&&this.slide.slideCount>0&&this.slide.renderSlide(av(v+1,1,this.slide.slideCount))},this.namespace="netless-app-slide",this.target=w.target,this.bgColor=pv(this.target),this.viewer=new zv({readonly:!1,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay}),this.render()}render(){this.viewer.$content.appendChild(this.renderSlideContainer()),this.registerHotKeys(window)}registerHotKeys(w){this.sideEffect.addEventListener(w,"keydown",this.hotkeyListener,void 0,"hotkey")}mount(w,v){this.target.appendChild(this.renderStyle()),this.target.appendChild(this.viewer.$content),this.target.appendChild(this.viewer.$footer),this.slide=new li.Slide({anchor:this.$slide,interactive:!0,mode:"local",controller:this.debug,enableGlobalClick:!0,renderOptions:{minFPS:25,maxFPS:30,autoFPS:!0,autoResolution:!0,transactionBgColor:this.bgColor}}),this.registerEventListeners(),this.slide.setResource(w,v),this.slide.renderSlide(1)}renderStyle(){const w=document.createElement("style");return w.appendChild(document.createTextNode(Vv)),w}registerEventListeners(){if(!this.slide)return;const{slide:w}=this;w.on(li.SLIDE_EVENTS.slideChange,this.onPageChanged),w.on(li.SLIDE_EVENTS.renderStart,this.onTransitionStart),w.on(li.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),w.on(li.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),w.on(li.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),w.on(li.SLIDE_EVENTS.renderError,this.onError),w.on(li.SLIDE_EVENTS.renderEnd,this.resolveReady),this.readyPromise.then(this.refreshPages)}destroy(){this.sideEffect.flushAll(),this.slide&&!this.destroyed&&(this.slide.destroy(),this.destroyed=!0),this.viewer.destroy()}getPageIndex(w){return(w>0?w:1)-1}renderSlideContainer(){if(!this.$slide){const w=document.createElement("div");w.className=this.wrapClassName("slide"),w.dataset.appKind="Slide",this.$slide=w}return this.$slide}wrapClassName(w){return`${this.namespace}-${w}`}}const Nw=li.Slide.usePlugin.bind(li.Slide),Ic="0.2.34-beta.2",Lw={kind:"Slide",setup(b){if(console.log("[Slide] setup @ "+Ic),b.getIsWritable()&&b.storage.ensureState(wc),!b.storage.state.taskId)throw new Error("[Slide] no taskId");const w=b.getView();if(!w)throw new Error("[Slide] no view, please set scenePath on addApp()");w.disableCameraTransform=!0;const v=b.getBox();v.mountStyles(Vv);try{v.$content.dataset.appSlideVersion=Ic}catch{}const O=b.getInitScenePath();let M=null;const I=j=>{const J=b.getRoom();if(M&&M.slideController){let et=!1;J&&b.getIsWritable()&&(tv(J,b,M.slideController.slide,O),et=!0),ji("[Slide] page to",j,et?"(synced)":""),M.viewer.setPageIndex(j-1)}},D=j=>{const J=b.getAppOptions()||{},et=new dS(Zg(Tc({context:b},j),{onPageChanged:I,onRenderError:J.onRenderError,showRenderError:J.showRenderError}));return Mc&&Th.set(b.appId,et,v),Nr.setAppController(b.appId,et),et.readyPromise.then(j.onReady).then(()=>{const mt=b.getRoom();let Bt=!1;mt&&b.getIsWritable()&&(tv(mt,b,et.slide,O),Bt=!0);const wt=et.slide.slideState.currentSlideIndex;ji("[Slide] page to",wt,Bt?"(synced)":"","(on ready)"),et.slide.on("renderEnd",j.onRenderEnd)}),et};M=new Aw({box:v,view:w,mountSlideController:D,mountWhiteboard:b.mountView.bind(b),baseScenePath:O,appId:b.appId});const U=b.getRoom(),V=new Ka;return V.add(()=>{var j;return Nr.setAppContext(b.appId,b),Nr.enable=((j=b.getAppOptions())==null?void 0:j.debug)||!1,Nr.level="debug",()=>Nr.deleteApp(b.appId)}),U&&(M.toggleClickThrough(U.state.memberState.currentApplianceName),V.add(()=>{const j=J=>{J.memberState&&M&&M.toggleClickThrough(J.memberState.currentApplianceName)};return U.callbacks.on("onRoomStateChanged",j),()=>U.callbacks.off("onRoomStateChanged",j)})),b.emitter.on("destroy",()=>{ji("[Slide] destroy",b.appId),Mc&&Th.delete(b.appId),V.flushAll(),M&&(M.destroy(),M=null)}),M.mount(),{viewer:()=>M,controller:()=>M==null?void 0:M.slideController,slide:()=>{var j;return(j=M==null?void 0:M.slideController)==null?void 0:j.slide},nextStep:()=>{var j;return M&&M.slideController?((j=M==null?void 0:M.slideController)==null||j.slide.nextStep(),!0):!1},prevStep:()=>{var j;return M&&M.slideController?((j=M==null?void 0:M.slideController)==null||j.slide.prevStep(),!0):!1},position:()=>{const j=M==null?void 0:M.slideController;if(j)return[j.page,j.pageCount]},nextPage:()=>{const j=M==null?void 0:M.slideController;if(j){const{page:J,pageCount:et}=j;if(et>0&&J<et)return j.jumpToPage(J+1),!0}return!1},prevPage:()=>{const j=M==null?void 0:M.slideController;if(j){const{page:J,pageCount:et}=j;if(et>0&&J>1)return j.jumpToPage(J-1),!0}return!1},jumpToPage:j=>{const J=M==null?void 0:M.slideController;if(J){const{page:et,pageCount:mt}=J;if(mt>0&&et>0&&et<=mt)return J.jumpToPage(j),!0}return!1}}}};exports.DefaultUrl=Pc;exports.Slide=li.Slide;exports.SlidePreviewer=Wv;exports.addHooks=Pw;exports.apps=Th;exports.default=Lw;exports.getFreezerLength=Mw;exports.onCreated=Rw;exports.onDestroyed=Iw;exports.previewSlide=Ow;exports.setFreezerLength=Cw;exports.usePlugin=Nw;exports.version=Ic;
7955
+ `)();function Ow({container:b,taskId:w,url:v=Pc,debug:O=!1}){if(!w)throw new Error("[Slide] taskId is required");b.style.cssText+="display:flex;flex-direction:column";const M=new Wv({target:b});return M.debug=!!O,M.mount(w,v),M}class Wv{constructor(w){this.slide=null,this.debug=!1,this.sideEffect=new Ka,this.ready=!1,this.readyPromise=new Promise(v=>{this.resolveReady=()=>{this.ready=!0,v()}}),this.hotkeyListener=v=>{if(this.slide)switch(v.key){case"ArrowUp":case"ArrowLeft":{this.slide.prevStep();break}case"ArrowRight":case"ArrowDown":{this.slide.nextStep();break}}},this.onPageChanged=v=>{this.viewer.setPageIndex(v-1)},this.onTransitionStart=()=>{this.viewer.setPlaying()},this.onTransitionEnd=()=>{this.viewer.setPaused()},this.onError=({error:v})=>{this.viewer.setPaused(),console.warn("[Slide] render error",v)},this.destroyed=!1,this.refreshPages=()=>{this.slide&&(this.viewer.pages=fv(this.slide),this.viewer.setPageIndex(this.getPageIndex(this.slide.slideState.currentSlideIndex)))},this.onPlay=()=>{this.slide&&this.slide.nextStep()},this.onNewPageIndex=v=>{this.slide&&this.slide.slideCount>0&&this.slide.renderSlide(av(v+1,1,this.slide.slideCount))},this.namespace="netless-app-slide",this.target=w.target,this.bgColor=pv(this.target),this.viewer=new zv({readonly:!1,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay}),this.render()}render(){this.viewer.$content.appendChild(this.renderSlideContainer()),this.registerHotKeys(window)}registerHotKeys(w){this.sideEffect.addEventListener(w,"keydown",this.hotkeyListener,void 0,"hotkey")}mount(w,v){this.target.appendChild(this.renderStyle()),this.target.appendChild(this.viewer.$content),this.target.appendChild(this.viewer.$footer),this.slide=new li.Slide({anchor:this.$slide,interactive:!0,mode:"local",controller:this.debug,enableGlobalClick:!0,renderOptions:{minFPS:25,maxFPS:30,autoFPS:!0,autoResolution:!0,transactionBgColor:this.bgColor}}),this.registerEventListeners(),this.slide.setResource(w,v),this.slide.renderSlide(1)}renderStyle(){const w=document.createElement("style");return w.appendChild(document.createTextNode(Vv)),w}registerEventListeners(){if(!this.slide)return;const{slide:w}=this;w.on(li.SLIDE_EVENTS.slideChange,this.onPageChanged),w.on(li.SLIDE_EVENTS.renderStart,this.onTransitionStart),w.on(li.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),w.on(li.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),w.on(li.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),w.on(li.SLIDE_EVENTS.renderError,this.onError),w.on(li.SLIDE_EVENTS.renderEnd,this.resolveReady),this.readyPromise.then(this.refreshPages)}destroy(){this.sideEffect.flushAll(),this.slide&&!this.destroyed&&(this.slide.destroy(),this.destroyed=!0),this.viewer.destroy()}getPageIndex(w){return(w>0?w:1)-1}renderSlideContainer(){if(!this.$slide){const w=document.createElement("div");w.className=this.wrapClassName("slide"),w.dataset.appKind="Slide",this.$slide=w}return this.$slide}wrapClassName(w){return`${this.namespace}-${w}`}}const Nw=li.Slide.usePlugin.bind(li.Slide),Ic="0.2.34",Lw={kind:"Slide",setup(b){if(console.log("[Slide] setup @ "+Ic),b.getIsWritable()&&b.storage.ensureState(wc),!b.storage.state.taskId)throw new Error("[Slide] no taskId");const w=b.getView();if(!w)throw new Error("[Slide] no view, please set scenePath on addApp()");w.disableCameraTransform=!0;const v=b.getBox();v.mountStyles(Vv);try{v.$content.dataset.appSlideVersion=Ic}catch{}const O=b.getInitScenePath();let M=null;const I=j=>{const J=b.getRoom();if(M&&M.slideController){let et=!1;J&&b.getIsWritable()&&(tv(J,b,M.slideController.slide,O),et=!0),ji("[Slide] page to",j,et?"(synced)":""),M.viewer.setPageIndex(j-1)}},D=j=>{const J=b.getAppOptions()||{},et=new dS(Zg(Tc({context:b},j),{onPageChanged:I,onRenderError:J.onRenderError,showRenderError:J.showRenderError}));return Mc&&Th.set(b.appId,et,v),Nr.setAppController(b.appId,et),et.readyPromise.then(j.onReady).then(()=>{const mt=b.getRoom();let Bt=!1;mt&&b.getIsWritable()&&(tv(mt,b,et.slide,O),Bt=!0);const wt=et.slide.slideState.currentSlideIndex;ji("[Slide] page to",wt,Bt?"(synced)":"","(on ready)"),et.slide.on("renderEnd",j.onRenderEnd)}),et};M=new Aw({box:v,view:w,mountSlideController:D,mountWhiteboard:b.mountView.bind(b),baseScenePath:O,appId:b.appId});const U=b.getRoom(),V=new Ka;return V.add(()=>{var j;return Nr.setAppContext(b.appId,b),Nr.enable=((j=b.getAppOptions())==null?void 0:j.debug)||!1,Nr.level="debug",()=>Nr.deleteApp(b.appId)}),U&&(M.toggleClickThrough(U.state.memberState.currentApplianceName),V.add(()=>{const j=J=>{J.memberState&&M&&M.toggleClickThrough(J.memberState.currentApplianceName)};return U.callbacks.on("onRoomStateChanged",j),()=>U.callbacks.off("onRoomStateChanged",j)})),b.emitter.on("destroy",()=>{ji("[Slide] destroy",b.appId),Mc&&Th.delete(b.appId),V.flushAll(),M&&(M.destroy(),M=null)}),M.mount(),{viewer:()=>M,controller:()=>M==null?void 0:M.slideController,slide:()=>{var j;return(j=M==null?void 0:M.slideController)==null?void 0:j.slide},nextStep:()=>{var j;return M&&M.slideController?((j=M==null?void 0:M.slideController)==null||j.slide.nextStep(),!0):!1},prevStep:()=>{var j;return M&&M.slideController?((j=M==null?void 0:M.slideController)==null||j.slide.prevStep(),!0):!1},position:()=>{const j=M==null?void 0:M.slideController;if(j)return[j.page,j.pageCount]},nextPage:()=>{const j=M==null?void 0:M.slideController;if(j){const{page:J,pageCount:et}=j;if(et>0&&J<et)return j.jumpToPage(J+1),!0}return!1},prevPage:()=>{const j=M==null?void 0:M.slideController;if(j){const{page:J,pageCount:et}=j;if(et>0&&J>1)return j.jumpToPage(J-1),!0}return!1},jumpToPage:j=>{const J=M==null?void 0:M.slideController;if(J){const{page:et,pageCount:mt}=J;if(mt>0&&et>0&&et<=mt)return J.jumpToPage(j),!0}return!1}}}};exports.DefaultUrl=Pc;exports.Slide=li.Slide;exports.SlidePreviewer=Wv;exports.addHooks=Pw;exports.apps=Th;exports.default=Lw;exports.getFreezerLength=Mw;exports.onCreated=Rw;exports.onDestroyed=Iw;exports.previewSlide=Ow;exports.setFreezerLength=Cw;exports.usePlugin=Nw;exports.version=Ic;
7956
7956
  //# sourceMappingURL=main.cjs.js.map