@netless/app-slide 0.2.53 → 0.2.54
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 +3 -3
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +3 -3
- package/dist/main.es.js.map +1 -1
- package/dist/main.iife.js +3 -3
- package/dist/main.iife.js.map +1 -1
- package/package.json +2 -2
package/dist/main.iife.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)})}}function zg(i,t){const e=[];return i.forEach(n=>{const r=((t==null?void 0:t.filter)||[]).indexOf(n.type)>=0;if(["biLevel","alphaBiLevel","alphaCeiling","alphaModFix","alphaFloor","grayscl"].indexOf(n.type)>=0&&r)e.push(new eE(n.type,n.args[0]||0));else if(["clrChange","changeBulletColor","duotone"].indexOf(n.type)>=0&&r){const o=Er(n.args[0]),s=Er(n.args[1]);e.push(new rE(n.type,o,s))}else if(n.type==="lum"&&r)e.push(new aE(n.type,n.args[0],n.args[1]));else if(n.type==="alphaInv"&&r){const o=Er(n.args[0]);e.push(new uE(n.type,o))}}),e}class mo{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=sh()(`${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 pi;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 pi,n=QT(JSON.parse(JSON.stringify(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 pi;if(s.texture=r,n.length>0&&this.config.useFilter&&(this.ctx.featureList||{}).filter&&(s.filters=zg(n,this.ctx.featureList)),this.config.fillFloat){const{l:a,t:l,r:h,b:u}=this.config.fillFloat.fillRect,p=this.width*(1-a-h),y=this.height*(1-l-u),x=(t=this.config.shapeRotation)!==null&&t!==void 0?t:0,E=new er;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,j=A.height;s.width=C,s.height=j,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=j/2+l*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,filters:r}=this.fillStyle,o=this.ctx.spriteTexture.getGifFrames(e).map((h,u)=>({texture:h,time:n[u]||20})),s=new lc(o,!0);s.name=cs(),s.width=this.width,s.height=this.height,r.length>0&&this.config.useFilter&&(this.ctx.featureList||{}).filter&&(s.filters=zg(r,this.ctx.featureList));const a=this.fillStyle.loop;let l=1;return s.onLoop=()=>{l+=1,a>0&&l>a&&s.gotoAndStop(s.totalFrames)},s}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=[]}}class _c extends ce.k{}var cE=v(113),dE=v.n(cE),pE=v(114),fE=v.n(pE);class mE extends _c{constructor(t){super(dE.a,fE.a,{uShapeFilterArea:new Float32Array([0,0,0,0]),uGlowColor:Er(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 gE=v(19),dh=v.n(gE),vE=v(115),_E=v.n(vE);class yE extends _c{constructor(t){super(dh.a,_E.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 Vg{}var xE=v(116),bE=v.n(xE);class TE extends ce.k{constructor(t){super(dh.a,bE.a,{uColor:Er(t)})}}class EE extends Vg{constructor(t,e,n){super(),this.order=1,this.outputTexture=ce.t.WHITE,this.frameTextures=[],this.json=t,this.effectContainer=e,this.outputSprite=new pi,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 Xs.BlurFilter(this.json.blurRad/2,4),new TE(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 l=this.effectContainer.toLocal(a);this.outputSprite.pivot.x=l.x,this.outputSprite.pivot.y=l.y;const h=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:h.x,y:h.y},h);const p=this.effectContainer.toLocal(h);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){}}var SE=v(117),wE=v.n(SE);class AE extends ce.k{constructor(t,e){super(dh.a,wE.a,{uStartAlpha:t.startAlpha,uEndAlpha:t.endAlpha,uStartPos:t.startPos,uEndPos:t.endPos,uHeight:e}),console.log(this)}}class ME extends Vg{constructor(t,e,n,r,o){super(),this.order=2,this.outputSprite=new pi,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 Xs.BlurFilter(this.json.blurRad/2,4),new AE(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 CE=v(118),RE=v.n(CE);class IE extends _c{constructor(t){super(dh.a,RE.a,{}),this.priority=1,this.json=t}filterAreaJustify(t){return t}sdfBox(){return null}}var Wg=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};class Xg extends xi.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 pi;for(const x of e)switch(x.type){case"innerShadow":this.effects.push(new IE(x));break;case"softEdge":this.effects.push(new yE(x));break;case"glow":this.effects.push(new mE(x));break;case"reflection":this.attachs.push(new ME(x,t,o,s.x,this.ctx));break;case"outerShadow":this.attachs.push(new EE(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),l=this.effects.map(x=>x.filterAreaJustify(a)),h=l.map(x=>x.x),u=l.map(x=>x.y),p=l.map(x=>x.width),y=l.map(x=>x.height);this.filterArea=new De.j(Math.min(...h,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 pi,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 Wg(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 Wg(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),l=(n=a==null?void 0:a.texture.width)!==null&&n!==void 0?n:0,h=(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,l,this.filterArea.width),x=Math.max(s,h,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 Yg=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};class PE extends fc{constructor(t,e,n){var r;super(t,e,n),this.textureContainer=new Cn.b,this.underline=null,this.cacheSprite=new pi,this.effectContainer=new Cn.b,this.effectObject=null;const{shapeId:o,paragraphIndex:s,lineIndex:a,unitIndex:l,lineHeight:h,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 j=E?h/16:A/16;this.underline=new XT(e,p.type,j,u,x,C,E,o,s,a,l)}if(this.textGraphics=this.createTextGraphics(),this.textFill=this.createTextFill(),this.strokeGraphics=this.createStrokeGraphics(),this.strokeFill=this.createStrokeFill(),this.effectContainer.name="effect-container",this.effectContainer.zIndex=1,this.container.addChild(this.effectContainer),t.effectIndexList&&t.effectIndexList.length&&n.effectList){const{effectList:j}=n;this.effectList=t.effectIndexList.map(Z=>{const rt=j[Z];return rt.type==="outerShadow"&&rt.dist>5&&(rt.dist=5),j[Z]}),this.ctx.slideScopeEventHub.once("slide-render",Z=>{if(this.ctx.slideIndex===Z&&this.effectObject){const rt=this.getEffectTexture();if(rt){const{texture:ct,offsetX:nt,offsetY:vt}=rt;this.effectObject.setFrameOffset(nt,vt),this.effectObject.createFrame(1,ct)}}})}}getEffectTexture(){const{lineHeight:t,fillLineHeight:e,isHorz:n,lineWidth:r}=this.json,o=this.effectContainer.getLocalBounds();let s=0,a=0;for(const u of this.effectContainer.children)u.pivot.x>s&&(s=u.pivot.x),u.pivot.y>a&&(a=u.pivot.y);const l=new De.d;l.translate(s,a);const h=ce.p.create({width:n?o.width:r,height:n?Math.max(e,t):o.height,resolution:2});return this.ctx.renderer.render(this.effectContainer,{renderTexture:h,transform:l}),{texture:h,offsetX:s,offsetY:a}}createStrokeFill(){const{stroke:t,lineWidth:e,lineHeight:n}=this.json;return new mo(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 mo(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 mo(this.ctx,e==null?void 0:e.fill,n,Math.max(o,r),{useFilter:!1,useSlideBackgroundFill:!1}):new mo(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 mo(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(()=>Yg(this,void 0,void 0,function*(){this.doRender()}),"@TextUnitImpl[doRender]"),t.addSubMTask(()=>Yg(this,void 0,void 0,function*(){var e;if(this.effectList&&this.effectList.length>0){const n=`${this.ctx.taskId}_${this.ctx.slideIndex}_${(e=this.json.fill)===null||e===void 0?void 0:e.key}_${this.json.effectIndexList}`;this.effectObject=new Xg(this.effectContainer,this.effectList,n,this.ctx,0,new De.g(1,1)),this.effectObject.on("ready",()=>{var r;this.effectContainer.visible=!1,this.effectObject.container.zIndex=10,this.container.addChild(this.effectObject.container),(r=this.effectObject)===null||r===void 0||r.updateFrame(1)})}}),"@ShapeImpl[post.render]")}doRender(){let t=!1;const{lineWidth:e,lineHeight:n,baseLine:r,isHorz:o,underline:s,height:a,width:l,highlightColor:h,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),h){const C=new er,[j,Z]=Og(h);C.beginFill(j,Z),C.drawRect(0,0,o?l: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 j=this.textFill.displayObject;if(j)j.mask=C,j.addChild(C),j.position.x=-u,C.position.x+=u,t=!0,this.textureContainer.addChild(j);else if(this.textFill.isSolidFill()){const Z=new ds;Z.color=this.textFill.getSolidFillColor(),C.filters=[Z],t=!0,this.textureContainer.addChild(C)}}else this.textureContainer.addChild(C)}if(this.strokeGraphics.displayObject){const C=this.strokeGraphics.displayObject;if(A){const j=this.strokeFill.displayObject;if(j)j.mask=C,j.addChild(C),o?j.position.y=p>0?p:0:j.position.x=u,this.textureContainer.addChild(j);else if(this.strokeFill.isSolidFill()){o?C.position.y=p>0?p:0:C.position.x=u;const Z=new ds;Z.color=this.strokeFill.getSolidFillColor(),C.filters=[Z],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?l: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.effectContainer.addChild(this.cacheSprite)}else this.effectContainer.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 qg=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};class OE extends fc{constructor(t,e,n){super(t,e,n),this.units=[],this.isHorz=!0,this.hyperLinkMap=new Map,this.hyperLinkContainerMap=new Map,this.effectList=[],n.effectList&&(this.effectList=n.effectList)}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(()=>qg(this,void 0,void 0,function*(){const a=this.json.textUnits[o],{height:l,width:h,fillHeight:u,baseline:p,y,underline:x}=this.json,E=new PE(Object.assign(Object.assign({},a),{lineHeight:l,lineWidth:h,baseLine:p-y,underline:x,fillLineHeight:u||l,isHorz:this.isHorz,shapeId:t,paragraphIndex:e,lineIndex:n,unitIndex:o}),this.ctx,{parentGlobalPos:this.global,effectList:this.effectList});if(E.preRender(),this.units.push(E),a.hyperlink||a.hlinkHover){const A=new Pg(E.container,this.ctx);a.hyperlink&&A.addAction(a.hyperlink,"click"),a.hlinkHover&&A.addAction(a.hlinkHover,"hover"),this.container.sortableChildren=!0}}),"@TextLineImpl[createUnits]")}render(t){for(const e of this.units.reverse())e.render(t),t.addSubMTask(()=>qg(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 Jg=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};class NE extends fc{constructor(t,e,n){super(t,e,n),this.iterateElements=[],this.lines=[],this.effectList=[],this.isHorz=!0,n.effectList&&(this.effectList=n.effectList)}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(()=>Jg(this,void 0,void 0,function*(){const s=this.json.lines[r],a=new OE(s,this.ctx,{parentGlobalPos:this.global,effectList:this.effectList});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(()=>Jg(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 LE(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 DE(i,t,e,n,r,o){const s=LE((r=-r)/Math.PI*180,e,n),a=i.x-s.x,l=i.y-s.y;return{centerX:a/9525*t.x,centerY:l/9525*t.y,rx:e/9525*t.x,ry:n/9525*t.y,st:-r,end:-r+o,aClockWise:o<0}}function Kg(i){const t=new Fs,{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[l,h]=a.split(",").map(u=>Number(u));n={x:l,y:h},l=l/9525*e.x,h=h/9525*e.y,t.moveTo(l,h)}else if(s==="A"){const[l,h,u,p]=a.split(",").map(rt=>Number(rt)),{centerX:y,centerY:x,rx:E,ry:A,st:C,end:j,aClockWise:Z}=DE(n,e,l,h,u,p);t.absellipse(y,x,E,A,C,j,Z,0)}else if(s==="L"){let[l,h]=a.split(",").map(u=>Number(u));n={x:l,y:h},l=l/9525*e.x,h=h/9525*e.y,t.lineTo(l,h)}else if(s==="QB"){let[l,h,u,p]=a.split(",").map(y=>Number(y));n={x:u,y:p},l=l/9525*e.x,h=h/9525*e.y,u=u/9525*e.x,p=p/9525*e.y,t.quadraticCurveTo(l,h,u,p)}else if(s==="CB"){let[l,h,u,p,y,x]=a.split(",").map(E=>Number(E));n={x:y,y:x},l=l/9525*e.x,h=h/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(l,h,u,p,y,x)}else if(s==="C")try{t.closePath()}catch{}}return t}function Un(i,t){return i.curves.map(e=>e.getPoints(t)).reduce((e,n)=>e.concat(n),[])}const yc={textCirclePour:{top:i=>i.getPoints(360),bottom:i=>i.getPoints(360)},textStop:{top:i=>Un(i,100),bottom:i=>Un(i,100)},textPlain:{top:i=>Un(i,100),bottom:i=>Un(i,100)},textTriangle:{top:i=>Un(i,50),bottom:i=>Un(i,101)},textTriangleInverted:{bottom:i=>Un(i,50),top:i=>Un(i,101)},textChevron:{bottom:i=>Un(i,50),top:i=>Un(i,50)},textChevronInverted:{bottom:i=>Un(i,50),top:i=>Un(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=>Un(i,180),bottom:i=>i.getPoints(180)},textDeflateBottom:{top:i=>Un(i,180),bottom:i=>i.getPoints(180)},textInflateTop:{bottom:i=>Un(i,180),top:i=>i.getPoints(180)},textDeflateTop:{bottom:i=>Un(i,180),top:i=>i.getPoints(180)},textFadeRight:{bottom:i=>Un(i,180),top:i=>Un(i,180)},textFadeLeft:{bottom:i=>Un(i,180),top:i=>Un(i,180)},textFadeUp:{bottom:i=>Un(i,180),top:i=>Un(i,180)},textFadeDown:{bottom:i=>Un(i,180),top:i=>Un(i,180)},textSlantUp:{bottom:i=>Un(i,180),top:i=>Un(i,180)},textSlantDown:{bottom:i=>Un(i,180),top:i=>Un(i,180)},textCascadeUp:{bottom:i=>Un(i,180),top:i=>Un(i,180)},textCascadeDown:{bottom:i=>Un(i,180),top:i=>Un(i,180)},textArchUp:{bottom:i=>Un(i,180),top:i=>Un(i,180)},textArchDown:{bottom:i=>Un(i,180),top:i=>Un(i,180)},textCircle:{bottom:i=>Un(i,180),top:i=>Un(i,180)}};function FE(i,t,e,n,r){const o=i.trim().split(" "),[s,a]=o[1].split(",").map(Z=>parseFloat(Z)),[l,h,u,p]=o[3].split(",").map(Z=>parseFloat(Z)),y=function(Z,rt,ct,nt,vt,ht){const mt=Math.abs(ht*Math.sqrt((ct*ct+nt*nt)/2)),jt=Math.ceil(mt/9525/10);let Ft=0,Mt=vt,wt={x:Z+ct*Math.cos(Mt),y:rt+nt*Math.sin(Mt)};for(let Ot=0;Ot<jt;Ot+=1){Mt+=ht/jt;const Nt={x:Z+ct*Math.cos(Mt),y:rt+nt*Math.sin(Mt)};Ft+=Math.sqrt(Math.pow(Nt.x-wt.x,2)+Math.pow(Nt.y-wt.y,2)),wt=Nt}return Ft}(s,a,l,h,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=l+9525*r,j=h+9525*r;return`M ${9525*A.x},${9525*A.y} A ${C},${j},${u},${p}`}var za=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};class BE{constructor(t,e,n,r,o){var s;this.iterateElements=[],this.paragraphs=[],this.effectList=[],this.container=new Cn.b,this.textContainer=new Cn.b,this.textColorFilter=new ds,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 a=new er;a.drawRect(0,0,t.width,t.height),this.container.addChild(a),this.container.addChild(this.textContainer),this.textColorFilter.currentColor="#000000FF",this.textColorFilter.designColor="#000000FF",this.effectList=(s=t.effectList)!==null&&s!==void 0?s:[]}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(()=>za(this,void 0,void 0,function*(){var o;const s=this.json.paragraphs[n],a=new NE(s,this.ctx,{parentGlobalPos:this.global,effectList:this.effectList});a.isHorz=(o=this.json.isHorz)===null||o===void 0||o,a.createLines(t,n,e),e.addSubMTask(()=>za(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(()=>za(this,void 0,void 0,function*(){this.textContainer.addChild(e.container)}),"@TextBodyImpl[container.addChild]");t.addSubMTask(()=>za(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(()=>za(this,void 0,void 0,function*(){if(this.json.presetTextShape){const e=this.json.paragraphs.map(h=>h.x).reduce((h,u)=>Math.min(h,u)),n=this.json.paragraphs[0].y,r=this.textContainer.getBounds(),{width:o,height:s}=r,{geometry:a,type:l}=this.json.presetTextShape;if(a.paths){const h=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:h,transform:u});const p=this.json.isHorz!==void 0&&!this.json.isHorz;if(["textCircle","textArchUp","textArchDown"].indexOf(this.json.presetTextShape.type)>=0){const x=FE(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(!yc[A])return null;const j=yc[A].top(Kg(E)),Z=yc[A].bottom(Kg(x));if(j.length!==Z.length)return null;const rt=Math.min(j.length,Z.length),ct=1/(rt-1),nt=[],vt=[],ht=new Array(2*rt).fill("").map((mt,jt)=>jt);for(let mt=0;mt<rt;mt++)nt.push(j[mt].x,j[mt].y),C?vt.push(1,ct*mt):vt.push(ct*mt,0),nt.push(Z[mt].x,Z[mt].y),C?vt.push(0,ct*mt):vt.push(ct*mt,1);return{vertices:new Float32Array(nt),uvs:new Float32Array(vt),drawMode:gn.f.TRIANGLE_STRIP,indices:new Uint16Array(ht)}}(a.paths[1],a.paths[0],l,p);if(y){const x=new _T.b(h,y.vertices,y.uvs,y.indices,y.drawMode);this.textContainer.visible=!1,this.container.addChild(x)}}}}),"presetTextShape")}}class UE{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-"+sh()(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*=.75;break;case"lg":this.scaleX*=1.25;break;case"med":this.scaleX*=1}switch(this.heightSize){case"sm":this.scaleY*=.75;break;case"lg":this.scaleY*=1.25;break;case"med":this.scaleY*=1}this.width=10*this.scaleX,this.height=10*this.scaleY}}class xc{constructor(t,e,n,r,o,s,a,l,h,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=l,this.shouldFill=h,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&&h?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)}isPoint(t){return Number.isNaN(Number(t.x))||Number.isNaN(Number(t.y))}isSquare(t,e){if(t.join("")!=="MLLLC"&&t.join("")!=="MLLLCC")return!1;const n=e.filter(l=>!this.isPoint(l));if(n.length!==4)return!1;const r=Math.min(...n.map(l=>l.x)),o=Math.min(...n.map(l=>l.y)),s=Math.max(...n.map(l=>l.x)),a=Math.max(...n.map(l=>l.y));for(const l of n)if(l.x!==r&&l.x!==s||l.y!==o&&l.y!==a)return!1;return!0}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 l=0;l<e.length;l+=2){const h=e[l],u=e[l+1],[p,y]=u.split(",").map(x=>Number(x)/100);n.push(h),r.push({x:p,y})}if(this.isSquare(n,r))return!1;for(let l=0;l<3;l++){const h=r[l],u=r[l+1];if(h.x!==u.x&&h.y!==u.y)return!1}const o=r.slice(0,4).reduce((l,h)=>l+h.x,0)/4,s=r.slice(0,4).reduce((l,h)=>l+h.y,0)/4;if(Number.isNaN(o)||Number.isNaN(s))return!1;const a={x:o,y:s};return Tr(this.pointDis(a,r[0]),this.pointDis(a,r[1]))&&Tr(this.pointDis(a,r[0]),this.pointDis(a,r[2]))&&Tr(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 er;return t.beginFill(0,1),t.drawRect(0,0,this.width,this.height),t}if(this.isColoredPureRect&&this.bgColor){const t=new er,[e,n]=Og(this.bgColor);return t.beginFill(e,n),t.drawRect(0,0,this.width,this.height),t}{const t=new pi,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.scale.x=e.scale,t.scale.y=e.scale,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=[]}}var ph=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};const ps={pivot:{x:0,y:0},width:0,height:0};class Zg extends pc{constructor(t,e,n){var r,o,s,a,l,h,u,p,y;super(t,e,n),this.renderContainer=new Cn.b,this.needCacheAsBitMap=!1,this.backgroundGraphics=null,this.effectList=[],this.strokeGraphics=null,this.ghco=null,this.useGroupFill=!1,this.arrowList=[],this.fillColorFilter=new ds,this.strokeColorFilter=new ds,this.pptColorFilter=new ds,this.id="",this.ppt_c=new HT(this),this.fill=new Ig(this),this.stroke=new kT(this),this.effectObject=null,this.effectContainer=new Cn.b,this.effectDisposer=()=>{},this.json=t,this.option=n,this.json.fillStyle&&this.json.fillStyle.fillType==="groupFill"&&n.groupFillStyle&&(this.json.fillStyle=n.groupFillStyle,this.useGroupFill=!0),this.id=t.id;const{fillStyle:x,lineStyle:E}=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 xc(this.json.id+"-path-graphics-text-wrap",this.ctx,(s=(o=(r=this.json.textBody)===null||r===void 0?void 0:r.presetTextShape)===null||o===void 0?void 0:o.geometry.paths)!==null&&s!==void 0?s:[],(h=(l=(a=this.json.textBody)===null||a===void 0?void 0:a.presetTextShape)===null||l===void 0?void 0:l.geometry.hash)!==null&&h!==void 0?h:"",{x:0,y:0},((u=this.json.textBody)===null||u===void 0?void 0:u.width)||100,((p=this.json.textBody)===null||p===void 0?void 0:p.height)||100,{width:2,fill:{fillType:"solidFill",color:"#FF0000FF"}},!1,null,null)}catch(A){this.ctx.logger.error(A.message,this.ctx.taskId)}this.ctx.timingTargets.addTarget(this.id,this),(x==null?void 0:x.fillType)==="solidFill"&&(this.fillColorFilter.currentColor=x.color,this.fillColorFilter.designColor=x.color),((y=E==null?void 0:E.fill)===null||y===void 0?void 0:y.fillType)==="solidFill"&&(this.strokeColorFilter.currentColor=E.fill.color,this.strokeColorFilter.designColor=E.fill.color),this.updateTransform(this.json),t.textBody&&(this.text=new BE(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",A=>{if(this.ctx.slideIndex===A&&this.effectObject){const C=this.getEffectTexture();if(C){const{texture:j,offsetX:Z,offsetY:rt}=C;this.effectObject.setFrameOffset(Z,rt),this.effectObject.createFrame(1,j)}}})}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:l}=this.strokeFill;t?l&&((n=(e=l.filters)===null||e===void 0?void 0:e.indexOf(this.strokeColorFilter))!==null&&n!==void 0?n:-1)<0?l.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]):l?l.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;if(this.json.isMathFallback){if(!this.json.textBody)return this;const o=()=>this.json.textBody.paragraphs[0].lines.length<=1,s=()=>this.json.textBody.paragraphs[0].lines[0].textUnits.length<=1,a=()=>this.json.textBody.paragraphs[0].lines[0].textUnits[0].content.trim()==="";if((()=>this.json.textBody.paragraphs.length<=1)()&&o()&&s()&&a())return this}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:l,height:h,pivot:u}=(s==null?void 0:s.lineTransform)||ps,p=l||this.json.width,y=h||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 xc(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)||ps,l=zo()(r==null?void 0:r.width)?r.width:1;return new mo(this.ctx,r==null?void 0:r.fill,(a.width||o)+l+t,Math.max((a.height||s)+l,e),{useFilter:!0,useSlideBackgroundFill:!1})}createBackgroundGraphics(){var t;const{geometry:e,lineStyle:n,fillStyle:r,id:o}=this.json,{width:s,height:a,pivot:l}=(e==null?void 0:e.lineTransform)||ps,h=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 xc(o+"-bg-graphics",this.ctx,(t=e==null?void 0:e.paths)!==null&&t!==void 0?t:[],(e==null?void 0:e.hash)||"",l||{x:0,y:0},h,u,n,!0,p,null):null}createBackgroundFill(){var t,e,n,r;const{fillStyle:o,width:s,height:a,lineStyle:l,geometry:h}=this.json,u=(h==null?void 0:h.fillTransform)||ps,p={useFilter:!0,useSlideBackgroundFill:this.json.useBgFill,fillFloat:this.json.fillFloat,shapeRotation:this.json.rotation},y=this.useGroupFill&&((t=this.option.groupSize)===null||t===void 0?void 0:t.w)?this.option.groupSize.w:u.width||s,x=this.useGroupFill&&((e=this.option.groupSize)===null||e===void 0?void 0:e.h)?this.option.groupSize.h:u.height||a;return new mo(this.ctx,o,y+((n=l==null?void 0:l.width)!==null&&n!==void 0?n:0),x+((r=l==null?void 0:l.width)!==null&&r!==void 0?r:0),p)}createBackground(){var t,e,n,r,o,s,a,l,h,u,p,y;const{pivot:x,width:E,height:A}=((t=this.json.geometry)===null||t===void 0?void 0:t.fillTransform)||ps,{displayObject:C}=this.backgroundFill;C?(this.json.useBgFill&&((n=this.backgroundGraphics)===null||n===void 0?void 0:n.displayObject)?(this.needCacheAsBitMap=!0,C.mask=this.backgroundGraphics.displayObject,C.pivot.x=((r=this.json.position)===null||r===void 0?void 0:r.x)||0,C.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"?(C.height=A||this.designHeight,C.width=E||this.designWidth,C instanceof lc&&C.play(),!((a=this.backgroundGraphics)===null||a===void 0)&&a.isNeedMask(C.width,C.height)&&(C.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.effectContainer.addChild(this.backgroundGraphics.displayObject))):!((l=this.backgroundGraphics)===null||l===void 0)&&l.isNeedMask(C.width,C.height)&&(this.json.fillFloat||(this.needCacheAsBitMap=!0,C.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.effectContainer.addChild(this.backgroundGraphics.displayObject))),this.json.fillFloat||(C.x=x.x,C.y=x.y),this.useGroupFill&&(C.x-=(u=(h=this.json.position)===null||h===void 0?void 0:h.x)!==null&&u!==void 0?u:0,C.y-=(y=(p=this.json.position)===null||p===void 0?void 0:p.y)!==null&&y!==void 0?y:0),this.effectContainer.addChild(C)):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 pi(s.texture);a.pivot.x=s.pivot.x,a.pivot.y=s.pivot.y,a.scale.x=s.scale,a.scale.y=s.scale;const l=this.backgroundFill.getClonedDisplayObject(),h=(n=this.backgroundGraphics)===null||n===void 0?void 0:n.getClonedDisplayObject(),u=l||h;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=[WT[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 pi(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,o.scale.x=n.scale,o.scale.y=n.scale,(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,l)=>{var h,u;const p=new UE(Object.assign(Object.assign({},a),{fillStyle:r==null?void 0:r.fill,lineWidth:(h=r==null?void 0:r.width)!==null&&h!==void 0?h:0}));p.graphicsId=`${o}-arrow-${l}-graphics`,p.textureId=`${o}-arrow-${l}-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:l}=(s==null?void 0:s.lineTransform)||ps,h=a||this.json.width,u=l||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(()=>ph(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)||ps).pivot,h,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 ph(this,void 0,void 0,function*(){})}render(t){t.addSubMTask(()=>ph(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(()=>ph(this,void 0,void 0,function*(){var e,n,r,o,s,a,l,h,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=((l=(a=this.json.position)===null||a===void 0?void 0:a.y)!==null&&l!==void 0?l: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.json.textRotation&&(this.text.container.rotation=this.json.textRotation),this.renderContainer.addChild(this.text.container)}}else{if(this.text){if(this.json.textRotation){this.text.container.rotation=this.json.textRotation;const{width:Z,height:rt}=this.text,{x:ct,y:nt}=this.text.container.position;this.text.container.pivot.x=Z/2,this.text.container.pivot.y=rt/2,this.text.container.x=ct+Z/2,this.text.container.y=nt+rt/2}if(VT()(this.json.textRotateWithShape)&&!this.json.textRotateWithShape){const Z=this.json.rotation||0;this.text.container.rotation=-Z;const{width:rt}=this.text;this.text.container.position.x=rt}this.text.container.zIndex=100;const A=(h=this.json.effectList)===null||h===void 0?void 0:h.find(Z=>Z.type==="outerShadow"),C=(u=this.json.effectList)===null||u===void 0?void 0:u.find(Z=>Z.type==="softEdge"),j=(p=this.json.effectList)===null||p===void 0?void 0:p.find(Z=>Z.type==="glow");A&&A.sx!==1||C||j?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 Xg(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,j,Z;return((C=A.fillStyle)===null||C===void 0?void 0:C.fillType)==="gifFill"||((Z=(j=A.lineStyle)===null||j===void 0?void 0:j.fill)===null||Z===void 0?void 0:Z.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 kE=v(119);const bc=new(v.n(kE)).a,GE=bc.getDevice(),HE=bc.getBrowser(),fh=bc.getOS(),fs={isDesktop(){let i=!0;return GE.type==="mobile"&&(i=!1),/Samsung/.test(HE.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),fh.name&&/iOS/.test(fh.name)&&(i=!0),i},isAndroid(){let i=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^android/i.test(window.__nativeTags.platform)&&(i=!0),fh.name&&/android/i.test(fh.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 mh=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};function rr(i,t){for(const e in t)i.style[e]=t[e]}const Wo={medianContainerClass:"median-container",hoverHiddeDelay:1500,portalWidth:300,portalHeight:50,hiddenOpacity:"0",hoverOpacity:"1",opacityAnimationTime:.4};class Va{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.fadeState={in:!1,out:!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(Ke.mediaSeek,{id:this.targetId,time:o,isPlaying:this.media.isPlaying}),this.delayHide()},this.jumpToTime=(r=0)=>mh(this,void 0,void 0,function*(){yield ih(()=>!!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=Va.formatTime(this.duration)},this.playMedia=()=>mh(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=()=>mh(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=()=>mh(this,void 0,void 0,function*(){const r=this.media.currentTime-this.start;if(console.log("duration",this.duration,"current",r),this.duration>0&&(Math.abs(r-this.duration)<.3||r>this.duration)&&(yield this.pauseMedia(),this.medianIsEnd=!0,this.jumpToTime(),this.ctx.eventHub.emit(Ke.mediaStop,{id:this.targetId}),this.onClickCancelFullScreenButtonHandle()),this.currentTime.innerText=Va.formatTime(r),this.currentProgress.style.flex=(r/this.duration).toString(),this.bookmarkList&&this.bookmarkList.length>0){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.fadeHit(r)}),this.onPauseMedia=()=>{this.playButton.style.display="block",this.pauseButton.style.display="none"},this.onPlayMedia=()=>{this.fadeState={in:!1,out:!1},this.fadeHit(0),this.playButton.style.display="none",this.pauseButton.style.display="block",this.playCallBackList.forEach(r=>{r()}),this.media.currentTime<this.start&&this.jumpToTime()},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(Ke.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:l}=Wo;s?(this.mediaController.style.opacity=l,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}=Wo;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");rr(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");rr(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");rr(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"};rr(this.playButton,Object.assign(Object.assign({},t),{display:"block"}));const e=this.generatePlayButton();rr(e,{height:"20px"}),this.playButton.appendChild(e),rr(this.pauseButton,Object.assign(Object.assign({},t),{display:"none"}));const n=this.generatePauseButton();if(rr(n,{height:"20px"}),this.pauseButton.appendChild(n),!this.isVideo)return;const r=this.generateFullScreenButton(20,20);this.fullScreenButton.appendChild(r),rr(this.fullScreenButton,Object.assign(Object.assign({},t),{display:"block"}));const o=this.generateExitFullScreenButton(20,20);this.exitFullScreenButton.appendChild(o),rr(this.exitFullScreenButton,Object.assign(Object.assign({},t),{display:"none"}))}createTimer(){const t=document.createElement("div");rr(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"),rr(this.progress,t);const e=document.createElement("div");rr(e,{background:"#D9D9D9",position:"relative",height:"10px",display:"flex"}),this.progress.appendChild(e),rr(this.currentProgress,{background:"#4F4F4F",top:"0px",left:"0",height:"10px",flex:"0"}),e.appendChild(this.currentProgress)}fadeHit(t){if(!this.info.fade)return;const{start:e,end:n}=this.info.fade;e&&!this.fadeState.in&&t>=0&&(this.fadeState.in=!0,this.media.fadeIn(0,e)),n&&!this.fadeState.out&&t>=this.duration-n/1e3&&(this.fadeState.out=!0,this.media.fadeOut(0,n))}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(Ke.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(Ke.mediaPause,{id:this.targetId,time:this.media.currentTime-this.start,_stateOnly:t}))}setControllerPosition(){var t;const{target:e}=this,{portalWidth:n,portalHeight:r}=Wo,{stageWidth:o,stageHeight:s}=this.ctx,a=e.getGlobalPosition(),l=Number((t=this.container)===null||t===void 0?void 0:t.getAttribute("data-scale")),h=o*l,u=1/l*(n>h?h/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),rr(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&&rr(this.mediaController,{left:"0",top:s-r+"px"})}createMediaController(){this.setControllerPosition(),rr(this.mediaController,{display:"none",transition:`opacity ${Wo.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(Ke.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(){fs.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;fs.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=Wo.hoverOpacity,this.fullscreenStatus||(this.mediaController.style.display="flex"),this.delayHide()}hide(){this.fullscreenStatus?this.mediaController.style.opacity=Wo.hiddenOpacity:this.mediaController.style.display="none"}delayHide(){clearTimeout(this.autoHiddenTimer),this.autoHiddenTimer=setTimeout(()=>{this.hide()},Wo.hoverHiddeDelay)}destroy(){var t;this.unbindEvent(),this.playCallBackList=[],(t=this.container)===null||t===void 0||t.removeChild(this.mediaController)}}var jE=v(120);class Tc extends xi.a{constructor(t,e,n){var r,o;super(),this.isGlobalPause=!1,this.lastTime=-1,this.howl=null,this.rctClient=null,this.isHowlEnd=!1,this.isHowlLoadEmit=!1,this.staticEventId=1001,this._catParams=void 0,this.url=t,this.runningAudio=e,n&&(this._catParams=n),lr.RtcAudioClazz?(this.rctClient=new lr.RtcAudioClazz(t,(r=this._catParams)===null||r===void 0?void 0:r.start,(o=this._catParams)===null||o===void 0?void 0:o.end),this.rctClient.on("load",()=>this.emit("load")),this.rctClient.on("pause",()=>this.emit("pause")),this.rctClient.on("play",()=>{this.startTimeChangeEmit(),this.emit("play")}),this.rctClient.on("resumeAllAudioInterruptByAudioSessionChanged",()=>{this.emit("resumeAllAudioInterruptByAudioSessionChanged")})):(this.howl=new jE.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.startTimeChangeEmit(),this.emit("play")}),this.howl.on("end",()=>{this.isHowlEnd=!0}))}startTimeChangeEmit(){this.currentTime!==this.lastTime&&(this.lastTime=this.currentTime,this.emit("timeupdate",this.lastTime)),this.isPaused||setTimeout(()=>{this.isPaused||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.runningAudio.set(this.url,this)}fade(t,e,n){this.howl&&this.howl.fade(t,e,n)}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,l;(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"),(l=this.rctClient)===null||l===void 0||l.removeAllListeners("resumeAllAudioInterruptByAudioSessionChanged"),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 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 Qg=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};class zE extends xi.a{constructor(t){var e,n,r,o,s,a,l;super(),this.type="video",this.sprite=new pi,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=C=>{this.rtcAudio.volume(C)},this.syncFullscreenVideoState=C=>{const{targetId:j,state:Z,slideIndex:rt}=C;rt===this.ctx.slideIndex&&j===this.id&&(Z?(this.requestFullscreen(),this.ctx.latestChangeFullscreenTargetId=j):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 h=t.video.src;this.videoResource=new ce.w(h,{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 u=t.video.src.replace(/4$/,"3");this.ctx.loaderDelegate&&(u=this.ctx.loaderDelegate.redirectMedia(u),this.ctx.logger.info(`redirect media url from ${t.video.src.replace(/4$/,"3")} to ${u} by delegate.`,t.ctx.taskId)),this.rtcAudio=new Tc(u,t.ctx.runningAudio,{start:(a=t.video.cut)===null||a===void 0?void 0:a.start,end:(l=t.video.cut)===null||l===void 0?void 0:l.end}),this.rtcAudio.on("timeupdate",C=>{if(this.videoElement){const j=this.videoElement.currentTime;Math.abs(j-C)>.5&&(this.videoElement.currentTime=C)}}),this.rtcAudio.on("resumeAllAudioInterruptByAudioSessionChanged",()=>{var C;(C=this.videoElement)===null||C===void 0||C.pause(),setTimeout(()=>{var j;this.rtcAudio.isPaused||(j=this.videoElement)===null||j===void 0||j.play()},200)});const{video:p,width:y,height:x,target:E}=t;this.controller=new Va({targetId:t.id,shapeId:t.shapeId,ctx:t.ctx,width:y,height:x,target:E,media:this,info:p,canvasElement:t.canvasElement}),this.controller.addPlayCallBack(()=>{this.sprite.width=y,this.sprite.height=x,this.ctx.clock.setTimeout(()=>{this.sprite.visible=!0},50)});const A=new ce.c(null,{height:x,width:y});A.resource=this.videoResource,this.videoResource.bind(A),this.sprite=new pi,this.sprite.visible=!1,this.sprite.texture=new ce.t(A),this.sprite.interactive=!0,this.container.addChild(this.sprite),this.sprite.on("mouseover",C=>{C.stopPropagation(),this.controller.show()}),this.sprite.on("mouseout",C=>{C.stopPropagation(),this.controller.hide()}),["durationchange","timeupdate","pause","play"].forEach(C=>{var j;(j=this.videoElement)===null||j===void 0||j.addEventListener(C,()=>{C==="timeupdate"&&this.isPlaying,this.emit(C)})}),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 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 Qg(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.on("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.rtcAudio.stop(),this.seek(0),this.pause(),this.ctx.eventHub.emit(Ke.mediaStop,{id:this.id})}requestFullscreen(){return Qg(this,void 0,void 0,function*(){yield ih(()=>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)}fadeIn(t,e){this.rtcAudio.fade(t,this.ctx.volumeAdjuster.volume,e)}fadeOut(t,e){this.rtcAudio.fade(this.ctx.volumeAdjuster.volume,t,e)}}var VE=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};class WE extends xi.a{constructor(t){var e,n;super(),this.type="audio",this.isPlaying=!1,this.isGlobalPause=!1,this.updateVolume=l=>{this.audioPlayer.volume(l)},this.id=t.id;const r=t.audio.src;this.audioPlayer=new Tc(r,t.ctx.runningAudio,{start:(e=t.audio.cut)===null||e===void 0?void 0:e.start,end:(n=t.audio.cut)===null||n===void 0?void 0:n.end}),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:o,height:s,target:a}=t;this.controller=new Va({targetId:t.id,shapeId:t.shapeId,ctx:t.ctx,height:s,width:o,target:a,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 duration(){return this.audioPlayer.duration}load(){return Promise.resolve()}showController(){this.controller.show()}hideController(){this.controller.hide()}play(){return VE(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.audioPlayer.stop(),this.seek(0),this.pause(),this.ctx.eventHub.emit(Ke.mediaStop,{id:this.id})}requestFullscreen(){}requestCancelFullscreen(){}destroy(){this.ctx.volumeAdjuster.removeListener("update",this.updateVolume),this.stop(),this.controller.destroy(),this.ctx.activeMedia.delete(this),this.audioPlayer.destroy()}fadeIn(t,e){this.audioPlayer.fade(t,this.ctx.volumeAdjuster.volume,e)}fadeOut(t,e){this.audioPlayer.fade(this.ctx.volumeAdjuster.volume,t,e)}}var $g=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};class XE extends Zg{constructor(t,e,n){super(Object.assign(Object.assign({},t),{type:"Shape",useBgFill:!1,textRotateWithShape:!0,isPicture:!0}),e,n),this.isInteractiveOutside=!1,this.cmd=new GT(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 mo(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.]+)\)/),l=Number(a[1]||"0");(n=this.mediaPlayer)===null||n===void 0||n.controller.playMediaFromCtrl(!0),Math.abs(l)>.1&&((r=this.mediaPlayer)===null||r===void 0||r.controller.jumpToTime(l))}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 $g(this,void 0,void 0,function*(){const{displayObject:a}=this.picFill;if(a){a.name=this.json.id+"_pic_fill_[Picture]";const l=(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))&&l&&(a.mask=l,this.effectContainer.addChild(l)),a.width=this.designWidth,a.height=this.designHeight,a instanceof lc&&this.ctx.slideScopeEventHub.once("slide-render",h=>{var u;this.ctx.slideIndex===h&&((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 h=this.media.src;if(this.media.type==="audio"&&/mp4$/.test(h)&&(h=h.replace(/mp4$/,"mp3")),this.ctx.urlInterrupter){const u=Date.now();h=yield this.ctx.urlInterrupter(h),this.ctx.logger.info("redirect media url by interrupter. time: "+(Date.now()-u),this.ctx.taskId)}this.ctx.loaderDelegate&&(h=this.ctx.loaderDelegate.redirectMedia(h),this.ctx.logger.info(`redirect media url to ${h} by delegate.`,this.ctx.taskId)),this.media.src=h}if(((n=this.media)===null||n===void 0?void 0:n.type)==="video"&&this.media.src){if(this.mediaPlayer=new zE({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)&&l){const h=(o=this.backgroundGraphics)===null||o===void 0?void 0:o.getClonedDisplayObject();h&&(this.mediaPlayer.sprite.mask=h,this.container.addChild(h))}}else((s=this.media)===null||s===void 0?void 0:s.type)==="audio"&&this.media.src&&(this.mediaPlayer=new WE({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,fade:this.media.fade}));this.mediaPlayer&&(this.isInteractiveOutside=!!this.container.interactive,this.container.interactive=!0,fs.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 $g(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 gh=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};class Ec extends pc{constructor(t,e,n,r){super(t,e,n),this.children=[],this.cacheSprite=new pi,this.cacheContainer=new Cn.b,this.json=t,this.json.fillStyle&&this.json.fillStyle.fillType==="groupFill"&&n.groupFillStyle&&(this.json.fillStyle=n.groupFillStyle),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 mo(this.ctx,t.fillStyle,t.width,t.height,{useFilter:!1,useSlideBackgroundFill:!1}),this.createChildren(r)}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,l=this.json.children.length;a<l;a++)t.addSubMTask(()=>gh(this,void 0,void 0,function*(){let h=this.json.children[a],u=null;if(!(!this.ctx.featureList||!this.ctx.featureList.smartArt)&&((h==null?void 0:h.type)==="Shape"||(h==null?void 0:h.type)==="Picture")&&this.ctx.smartArtShapeList){const{id:y}=h,x=this.ctx.smartArtShapeList.find(E=>E.id===y);x&&(h=x)}const p={parentGlobalPos:s,groupFillStyle:this.json.fillStyle,groupSize:{w:this.json.width,h:this.json.height}};(h==null?void 0:h.type)==="Shape"?u=new Zg(h,this.ctx,p):(h==null?void 0:h.type)==="Picture"?u=new XE(h,this.ctx,p):(h==null?void 0:h.type)==="Container"&&(u=new Ec(h,this.ctx,p,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(()=>gh(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(()=>gh(this,void 0,void 0,function*(){this.cacheContainer.addChild(e.renderContainer)}),"@ContainerImpl[child.render]");t.addSubMTask(()=>gh(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 Wa extends xi.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 YE extends xi.a{constructor(t){super(),this.isTimeNodeEndSync=!1,this.interactiveListeners=[],this.runtimeNodeEventHub=new xi.a,this._currentSeqIndex=0,this._currentSeqState="idle",this.isForward=!0,this.autoPlay=!1,this.handlePrev=(y=!1)=>{var x,E,A,C,j,Z;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),(j=this.commonTimeNode.children[this.currentSeqIndex])===null||j===void 0||j.commonTimeNode.seekToStart(),(Z=this.commonTimeNode.children[this.currentSeqIndex])===null||Z===void 0||Z.commonTimeNode.clearSubList(),this.currentSeqState="idle"):this.globalEventHub.emit("c:prev slide",y)},this.handleNext=(y,x)=>{var E,A,C,j;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 Z={result:null};this.findChildInfiniteRepeat(this.commonTimeNode,Z),this.commonTimeNode.children.length===1&&Z.result&&(Z.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(),(j=this.commonTimeNode.children[this.currentSeqIndex])===null||j===void 0||j.commonTimeNode.startTimeNodeForce())}};const{json:e,iterateType:n,isIterate:r,isSub:o,parent:s,ctx:a,eventHub:l,iterateIndex:h,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=l,this.commonTimeNode=new Qs({json:e.ctn,isSub:o,eventHubs:{global:l,runtime:this.runtimeNodeEventHub},ctx:a,parent:s,isIterate:!1,iterateType:n,iterateIndex:h,iterateId:u,isInInteractiveSeq:p||this.isInteractiveSeq,fromSeqId:this.isInteractiveSeq?this.json.ctn.id:""}),this.bindShapeEvent(),this.nextConds=new Wa("mainSeq",e.nextCondLst,{global:l,runtime:this.runtimeNodeEventHub},this.ctx),this.prevConds=new Wa("mainSeq",e.preCondLst,{global:l,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(Ke.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(Ke.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(Ke.mainSeqStepChange,t):this.isInteractiveSeq&&this.ctx.eventHub.emit(Ke.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(Ke.mainSeqStateChange,t):this.isInteractiveSeq&&this.ctx.eventHub.emit(Ke.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(Ke.userInput);const o=`shape ${e} onClick`,{mode:s}=this.ctx;s!=="interactive"&&s!=="sync"||this.ctx.eventHub.emit(Ke.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 Xa(i,t){return t?t.split(".").reduce((e,n)=>e?e[n]:(console.warn(`${i} not support ${t}`),null),i):null}class Xo{constructor(t){this.timingTarget=null,this.runtimeNodeEventHub=new xi.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:l,iterateIndex:h,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 Qs({json:r.cBhvr.ctn,isSub:n,eventHubs:{global:a,runtime:this.runtimeNodeEventHub},ctx:o,parent:s,isIterate:e,iterateType:l,iterateIndex:h,iterateId:u,isInInteractiveSeq:p,fromSeqId:y}),this.timingTarget=this.ctx.timingTargets.getTarget(r.cBhvr.target,e,{type:l,index:h,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 Sc extends Xo{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.startVal=null,this.updateStartValue=()=>{this.timingTarget&&(this.startVal=Xa(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 vh=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 _h{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 tv extends _h{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}}vh([nh()],tv.prototype,"interpolationFrom",null);class ev extends _h{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&&["hidden","visible"].indexOf(r)<0&&(r=this.resolveValue()),r}resolveValue(){return this.value||""}}vh([nh()],ev.prototype,"interpolationFrom",null);class Zs extends _h{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}}vh([nh()],Zs.prototype,"interpolationFrom",null);class nv extends _h{constructor(t,e){super(t,e),this.value=t.val.value}interpolationFrom(t,e){return Ga(t.resolveValue(),this.value,e)}resolveValue(){return this.value}}vh([nh()],nv.prototype,"interpolationFrom",null);class qE extends Xo{constructor(t){super(t),this.isConflict=!0,this.activeWhenConflict="next",this.startVal=null,this.createVal=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=Xa(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,l=this.keyFrames[o],h=this.keyFrames[a]||l,u=l[0]-h[0]==0?1:(r-h[0])/(l[0]-h[0]),p=l[1].interpolationFrom(h[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.onDestroy=()=>{this.createVal!==null&&this.timingTarget&&zr(this.timingTarget,this.json.cBhvr.attrList[0],this.createVal)},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),this.commonTimeNode.on("timeNodeDestroy",this.onDestroy),this.createVal=Xa(this.timingTarget,this.json.cBhvr.attrList[0])}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 Zs(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 Zs(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 Zs(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 Zs(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 Zs(n,this.timingTarget):e==="str"&&(r=new ev(n,this.timingTarget)):n.val.type==="number"?r=new tv(n,this.timingTarget):n.val.type==="color"?(this.isColorAnim=!0,r=new nv(n,this.timingTarget)):n.val.type==="boolean"&&console.warn("not implements"),r&&this.keyFrames.push([n.time,r])}}}}class dr 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 JE=v(121),KE=v.n(JE),ZE=v(122),QE=v.n(ZE),$E=v(123),tS=v.n($E),eS=v(124),nS=v.n(eS),iS=v(9),Lr=v.n(iS),rS=v(125),oS=v.n(rS),sS=v(126),aS=v.n(sS);const iv="data:image/png;base64,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";var lS=v(127),hS=v.n(lS),uS=v(128),cS=v.n(uS),dS=v(129),pS=v.n(dS),fS=v(130),mS=v.n(fS),gS=v(131),vS=v.n(gS),_S=v(132),yS=v.n(_S),xS=v(133),bS=v.n(xS),TS=v(134),ES=v.n(TS),SS=v(135),wS=v.n(SS);const rv={wipe:class extends dr{constructor(i){super(QE.a,KE.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 dr{constructor(i){super(void 0,tS.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 dr{constructor(i){super(Lr.a,nS.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="vertical"?1:0}},checkerboard:class extends dr{constructor(i){super(Lr.a,oS.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="down"?1:0}},dissolve:class extends dr{constructor(i){super(Lr.a,aS.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.setTextTure()}setTextTure(){this.uniforms.dissolveSampler=ce.t.from(iv)}},randombar:class extends dr{constructor(i){super(Lr.a,hS.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(iv)}},circle:class extends dr{constructor(i){super(Lr.a,cS.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="out"?1:0}},box:class extends dr{constructor(i){super(Lr.a,pS.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="out"?1:0}},diamond:class extends dr{constructor(i){super(Lr.a,mS.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="out"?1:0}},plus:class extends dr{constructor(i){super(Lr.a,vS.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="out"?1:0}},barn:class extends dr{constructor(i){super(Lr.a,yS.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 dr{constructor(i){super(Lr.a,bS.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 dr{constructor(i){super(Lr.a,ES.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})}},wheel:class extends dr{constructor(i){super(Lr.a,wS.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=Number(i)||1}}};class AS extends Xo{constructor(t){var e;super(t),this.filterType="",this.isConflict=!1,this.activeWhenConflict="prev",this.onTimeUpdate=({duration:o,delta:s})=>{var a;const l=s/o;if(this.filter){this.filter.percent=this.commonTimeNode.applyTimeFilter(l);const h=(a=this.timingTarget)===null||a===void 0?void 0:a.container.getBounds();h&&(this.filter.uniforms.uBoundRect=new Float32Array([h.x,h.y,h.width,h.height]))}l>=1&&this.timingTarget&&this.ctx.clock.setTimeout(()=>{this.removeFilter()},34)},this.onSeekToStart=()=>{this.timingTarget&&this.removeFilter()},this.onSeekToEnd=()=>{this.timingTarget&&this.removeFilter()},this.onDestroy=()=>{this.removeFilter()},this.commonTimeNode.on("timelineStart",()=>{this.filter&&this.timingTarget&&(this.timingTarget.container.filters&&this.timingTarget.container.filters.length!==0?this.timingTarget.container.filters.push(this.filter):this.timingTarget.container.filters=[this.filter])}),this.commonTimeNode.on("timeNodeDestroy",this.onDestroy),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];rv[o]&&(this.filter=new rv[o](s),this.filterType=`${o}-${s}`,this.filter&&(this.filter.transition=n))}}get modifyAttrKey(){return this.filterType}removeFilter(){var t;if(!(!((t=this.timingTarget)===null||t===void 0)&&t.container.filters)||!this.filter)return;const e=this.timingTarget.container.filters.findIndex(n=>n===this.filter);e>=0&&this.timingTarget.container.filters.splice(e,1)}}class MS extends Xo{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.commonTimeNode.on("timeNodeDestroy",this.onSeekToStart),this.createPath()}get modifyAttrKey(){return"motion"}createPath(){var t;const e=new Fs,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,l]=s.map(h=>Number(h));e.moveTo(a,l)}else if(o==="L"){const[a,l]=s.map(h=>Number(h));e.lineTo(a,l)}else if(o==="C"){const[a,l,h,u,p,y]=s.map(x=>Number(x));e.bezierCurveTo(a,l,h,u,p,y)}else if(o==="Z")e.closePath();else if(o==="E")console.warn("not implements");else if(o==="c"){const[a,l,h,u,p,y]=s.map(E=>Number(E)),x=e.currentPoint;e.bezierCurveTo(a+x.x,l+x.y,h+x.x,u+x.y,p+x.x,y+x.y)}else if(o==="l"){const a=e.currentPoint,[l,h]=s.map(u=>Number(u));e.lineTo(l+a.x,h+a.y)}else if(o==="m"){const a=e.currentPoint,[l,h]=s.map(u=>Number(u));e.moveTo(l+a.x,h+a.y)}}this.path=e}}class CS extends Xo{constructor(t){var e;super(t),this.isConflict=!0,this.activeWhenConflict="next",this.startVal=null,this.createVal=null,this.onTimelineStart=n=>{n.isReverse||this.updateCurrentValue()},this.onTimeUpdate=({duration:n,delta:r})=>{var o,s,a,l,h;const u=r/n,p={x:1,y:1};if(this.to){const y=(o=this.from)!==null&&o!==void 0?o:{x:(a=(s=this.startVal)===null||s===void 0?void 0:s.x)!==null&&a!==void 0?a:1,y:(h=(l=this.startVal)===null||l===void 0?void 0:l.y)!==null&&h!==void 0?h:1};p.x=y.x+(this.to.x-y.x)*u,p.y=y.y+(this.to.y-y.y)*u}else if(this.by){const y={x:this.by.x,y:this.by.y};p.x=1+(y.x-1)*u,p.y=1+(y.y-1)*u}this.timingTarget&&(this.timingTarget.scale=p)},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.onDestroy=()=>{this.createVal!==null&&this.timingTarget&&(this.timingTarget.scale=this.createVal)},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),this.commonTimeNode.on("timeNodeDestroy",this.onSeekToStart),!((e=this.timingTarget)===null||e===void 0)&&e.scale.x&&(this.createVal={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})}get modifyAttrKey(){return"scale"}updateCurrentValue(){this.timingTarget&&(this.current={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})}}class RS extends Xo{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=Xa(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 lh(this.json.from),this.to=new lh(this.json.to),this.by=new lh(this.json.by),this.target=new lh):(this.from=new ah(this.json.from),this.to=new ah(this.json.to),this.by=new ah(this.json.by),this.target=new ah),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),this.commonTimeNode.on("timeNodeDestroy",this.onSeekToStart)}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=Xa(this.timingTarget,t);e&&(this.currentColorString=e)}}}class IS extends Xo{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.startVal=null,this.createVal=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.onTimeNodeCreate=()=>{var e;zo()((e=this.timingTarget)===null||e===void 0?void 0:e.r)&&(this.createVal=this.timingTarget.r)},this.onTimeNodeStart=()=>{var e;zo()((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.onDestroy=()=>{this.timingTarget&&this.createVal!==null&&(this.timingTarget.r=this.createVal),this.startVal=null},this.from=this.json.from,this.to=this.json.to,this.by=this.json.by,this.by?this.isConflict=!1:this.isConflict=!0,this.onTimeNodeCreate(),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("timeNodeDestroy",this.onDestroy)}get modifyAttrKey(){return"rotate"}updateCurrentValue(){var t;this.currentVal=(t=this.timingTarget)===null||t===void 0?void 0:t.r}}class PS extends Xo{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 OS{constructor(t){this.runtimeNodeEventHub=new xi.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:l,iterateIndex:h,iterateId:u,isInInteractiveSeq:p,fromSeqId:y}=t;this.json=e,this.id=e.cMediaNode.ctn.id,this.commonTimeNode=new Qs({json:e.cMediaNode.ctn,isSub:r,eventHubs:{global:o,runtime:this.runtimeNodeEventHub},ctx:s,parent:a,isIterate:n,iterateType:l,iterateIndex:h,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)}}function wc(i){return function(t){var e;return!!(!((e=t)===null||e===void 0)&&e.cBhvr)}(i)?i.cBhvr.ctn:function(t){var e,n;return!!(!((n=(e=t)===null||e===void 0?void 0:e.cMediaNode)===null||n===void 0)&&n.ctn)}(i)?i.cMediaNode.ctn:i.ctn}var NS=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};class Qs extends xi.a{constructor(t){var e,n;super(),this.uuid=cs(),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=(j=!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(j))}else this.startTimeLine(j)},this.updateTimeLine=j=>{const Z=j/(br.b.TARGET_FPMS||.06);this.timeDelta+=Z,this.duration-this.timeDelta<=Z&&(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=(j=!1)=>{(this.isTimeNodeEnd()||j)&&(this.isActive=!1,this.isSub&&this.destroy(),this.emitEndEvents())};const{isSub:r,isIterate:o,ctx:s,eventHubs:a,parent:l,json:h,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=l,this.json=h,this.ctx=s,this.iterateIndex=y,this.eventHubs=a,this.iterateType=u,this.iterateId=p,this.tmFilter=(n=(e=h.tmFilter)===null||e===void 0?void 0:e.split(";").map(j=>j.split(",").map(Z=>parseFloat(Z.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(),h.childTnLst&&this.createChildren(h.childTnLst),this.startConds=new Wa(this.json.id||"",h.stCondLst,a,this.ctx),this.endConds=new Wa(this.json.id||"",h.endCondLst,a,this.ctx),h.endSync&&(this.endSync=new Wa(this.json.id||"",[h.endSync],a,this.ctx),this.endSync.on("active",()=>{var j;this.json.nodeType==="interactiveSeq"&&(this.isActive=!1,this.shouldSeekOnStart=!0,this.emit("timeNodeEndSync"),(j=this.endSync)===null||j===void 0||j.reset())})),this.startConds.on("active",j=>{this.isActive||(this.shouldSeekOnStart&&(this.shouldSeekOnStart=!1,this.seekToStart()),this.handleActive(j))}),this.endConds.on("active",()=>{this.handleEndCond(),this.children.forEach(j=>j.commonTimeNode.handleEndCond())}),this.parentTimeNode&&this.parentTimeNode.on("timeNodeStart",()=>{this.applyCount=0}),this.isSub&&this.json.masterRel==="nextClick"){const j="shape slide onNext"+this.fromSeqId;this.startConds.addCond({event:j})}this.json.iterate&&this.isIterate===!1&&this.createIterateShadow()}createIterateShadow(){const t=cs();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 Qs({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 YE(r):t.type==="par"?n=new ov(r):t.type==="set"?n=new Sc(r):t.type==="anim"?n=new qE(r):t.type==="animEffect"?n=new AS(r):t.type==="animMotion"?n=new MS(r):t.type==="animScale"?n=new CS(r):t.type==="animClr"?n=new RS(r):t.type==="animRot"?n=new IS(r):t.type==="cmd"?n=new PS(r):t.type==="audio"&&(n=new OS(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(o){return wc(o).presetOrder}function n(o){return/^slide/.test(o)?"slide":/^layout/.test(o)?"layout":/^master/.test(o)?"master":"unknow"}const r=["master","layout","slide","unknow"];t&&t[0]&&e(t[0])?[...t].sort((o,s)=>{var a,l,h,u;const p=wc(o).id,y=wc(s).id;if(p&&y){const x=n(p),E=n(y);return x===E?((a=e(o))!==null&&a!==void 0?a:0)-((l=e(s))!==null&&l!==void 0?l:0):r.indexOf(x)-r.indexOf(E)}return((h=e(o))!==null&&h!==void 0?h:0)-((u=e(s))!==null&&u!==void 0?u:0)}).forEach(o=>{const s=this.createTimeNode(o,!1);s&&(this.bindCommonTimeNodeEvent(s),this.children.push(s))}):t.forEach(o=>{const s=this.createTimeNode(o,!1);s&&(this.bindCommonTimeNodeEvent(s),this.children.push(s))})}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(Ke.animateEnd),this.ctx.ticker.remove(this.updateTimeLine)):this.duration>t&&(this.ctx.eventHub.emit(Ke.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(Ke.animateStart),this.updateTimeLine(0),this.ctx.ticker.add(this.updateTimeLine))}startIterate(){return NS(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=>zo()(e[0])&&zo()(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(l=>l.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(Ke.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 ov extends xi.a{constructor(t){super(),this.isRunning=!1,this.runtimeNodeEventHub=new xi.a;const{json:e,iterateType:n,isIterate:r,isSub:o,parent:s,ctx:a,eventHub:l,iterateIndex:h,iterateId:u,isInInteractiveSeq:p,fromSeqId:y}=t;this.id=e.ctn.id,this.json=e,this.ctx=a,this.isIterate=r,this.globalEventHub=l,this.commonTimeNode=new Qs({json:e.ctn,isSub:o,eventHubs:{global:l,runtime:this.runtimeNodeEventHub},ctx:a,parent:s,isIterate:!1,iterateType:n,iterateIndex:h,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")),this.commonTimeNode.json.presetClass==="exit"&&this.commonTimeNode.children.length>=1&&this.commonTimeNode.children[this.commonTimeNode.children.length-1]instanceof Sc&&this.commonTimeNode.children.forEach(x=>{x instanceof Sc||typeof x.onSeekToStart!="function"||x.onSeekToStart()})})}}var LS=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};class DS{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 ov({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,l;return((s=o.json)===null||s===void 0?void 0:s.type)==="seq"&&((l=(a=o.json)===null||a===void 0?void 0:a.ctn)===null||l===void 0?void 0:l.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 LS(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 sv=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};class FS extends Ec{constructor(t,e,n,r){super({id:"stage",width:t.width,height:t.height,type:"Container",children:t.children},e,{parentGlobalPos:n},r),this.isRendered=!1,this.isTimingStartValueCollected=!1,this.json=t,this.json.smartArtShapeList&&(e.smartArtShapeList=this.json.smartArtShapeList),e.hasBackgroundFillShape=this.detectUseBackgroundFill(this.json),this.container.visible=!1,this.ctx=e;const o=new er;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(Ke.requestPrevSlide,t)}),this.ctx.timingEventHub.on("c:next slide",(t,e)=>{this.ctx.eventHub.emit(Ke.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(()=>sv(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 DS(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(Ke.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(Ke.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 sv(this,void 0,void 0,function*(){const r=this.ctx.medias[t];r&&(e?n?(yield ih(()=>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 BS{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 US=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};const kS=i=>new Promise(t=>setTimeout(t,i));class GS extends xi.a{constructor(t,e,n){super(),this.slideIndex=t,this.taskId=e,this.logger=n,this.uuid=cs(),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",Ai.transform(e),this.slideIndex)}))}applyAll(){return US(this,void 0,void 0,function*(){for(;!this.tasks.every(t=>t.state==="finish");)if(this.tasks.some(t=>t.state==="running"))yield kS(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 Ys(()=>t.fn.apply(null),6e4))===fo)throw new Ai(nr.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 Ai(nr.RuntimeError,`subtask ${t.name} error. ${e}`),t.state="error",this.logger.error(`${e} ${e.stack}`,this.taskId),this.emit("task-error",Ai.transform(n),this.slideIndex);break}}}}!this.isCancel&&this.tasks.every(t=>t.state==="finish")&&this.emit("task-finish")})}}var HS=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};class go{constructor(t,e){if(this.renderer=t,this.localStorage=e,this.outputData=new Map,this.loadingSdfKeys=new Set,!go.worker){const n=new Blob([`
|
|
7829
|
+
`),{arg1:Float32Array.from(e)})}}function zg(i,t){const e=[];return i.forEach(n=>{const r=((t==null?void 0:t.filter)||[]).indexOf(n.type)>=0;if(["biLevel","alphaBiLevel","alphaCeiling","alphaModFix","alphaFloor","grayscl"].indexOf(n.type)>=0&&r)e.push(new eE(n.type,n.args[0]||0));else if(["clrChange","changeBulletColor","duotone"].indexOf(n.type)>=0&&r){const o=Er(n.args[0]),s=Er(n.args[1]);e.push(new rE(n.type,o,s))}else if(n.type==="lum"&&r)e.push(new aE(n.type,n.args[0],n.args[1]));else if(n.type==="alphaInv"&&r){const o=Er(n.args[0]);e.push(new uE(n.type,o))}}),e}class mo{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=sh()(`${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 pi;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 pi,n=QT(JSON.parse(JSON.stringify(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 pi;if(s.texture=r,n.length>0&&this.config.useFilter&&(this.ctx.featureList||{}).filter&&(s.filters=zg(n,this.ctx.featureList)),this.config.fillFloat){const{l:a,t:l,r:h,b:u}=this.config.fillFloat.fillRect,p=this.width*(1-a-h),y=this.height*(1-l-u),x=(t=this.config.shapeRotation)!==null&&t!==void 0?t:0,E=new er;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,j=A.height;s.width=C,s.height=j,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=j/2+l*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,filters:r}=this.fillStyle,o=this.ctx.spriteTexture.getGifFrames(e).map((h,u)=>({texture:h,time:n[u]||20})),s=new lc(o,!0);s.name=cs(),s.width=this.width,s.height=this.height,r.length>0&&this.config.useFilter&&(this.ctx.featureList||{}).filter&&(s.filters=zg(r,this.ctx.featureList));const a=this.fillStyle.loop;let l=1;return s.onLoop=()=>{l+=1,a>0&&l>a&&s.gotoAndStop(s.totalFrames)},s}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=[]}}class _c extends ce.k{}var cE=v(113),dE=v.n(cE),pE=v(114),fE=v.n(pE);class mE extends _c{constructor(t){super(dE.a,fE.a,{uShapeFilterArea:new Float32Array([0,0,0,0]),uGlowColor:Er(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 gE=v(19),dh=v.n(gE),vE=v(115),_E=v.n(vE);class yE extends _c{constructor(t){super(dh.a,_E.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 Vg{}var xE=v(116),bE=v.n(xE);class TE extends ce.k{constructor(t){super(dh.a,bE.a,{uColor:Er(t)})}}class EE extends Vg{constructor(t,e,n){super(),this.order=1,this.outputTexture=ce.t.WHITE,this.frameTextures=[],this.json=t,this.effectContainer=e,this.outputSprite=new pi,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 Xs.BlurFilter(this.json.blurRad/2,4),new TE(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 l=this.effectContainer.toLocal(a);this.outputSprite.pivot.x=l.x,this.outputSprite.pivot.y=l.y;const h=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:h.x,y:h.y},h);const p=this.effectContainer.toLocal(h);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){}}var SE=v(117),wE=v.n(SE);class AE extends ce.k{constructor(t,e){super(dh.a,wE.a,{uStartAlpha:t.startAlpha,uEndAlpha:t.endAlpha,uStartPos:t.startPos,uEndPos:t.endPos,uHeight:e}),console.log(this)}}class ME extends Vg{constructor(t,e,n,r,o){super(),this.order=2,this.outputSprite=new pi,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 Xs.BlurFilter(this.json.blurRad/2,4),new AE(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 CE=v(118),RE=v.n(CE);class IE extends _c{constructor(t){super(dh.a,RE.a,{}),this.priority=1,this.json=t}filterAreaJustify(t){return t}sdfBox(){return null}}var Wg=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};class Xg extends xi.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 pi;for(const x of e)switch(x.type){case"innerShadow":this.effects.push(new IE(x));break;case"softEdge":this.effects.push(new yE(x));break;case"glow":this.effects.push(new mE(x));break;case"reflection":this.attachs.push(new ME(x,t,o,s.x,this.ctx));break;case"outerShadow":this.attachs.push(new EE(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),l=this.effects.map(x=>x.filterAreaJustify(a)),h=l.map(x=>x.x),u=l.map(x=>x.y),p=l.map(x=>x.width),y=l.map(x=>x.height);this.filterArea=new De.j(Math.min(...h,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 pi,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 Wg(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 Wg(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),l=(n=a==null?void 0:a.texture.width)!==null&&n!==void 0?n:0,h=(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,l,this.filterArea.width),x=Math.max(s,h,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 Yg=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};class PE extends fc{constructor(t,e,n){var r;super(t,e,n),this.textureContainer=new Cn.b,this.underline=null,this.cacheSprite=new pi,this.effectContainer=new Cn.b,this.effectObject=null;const{shapeId:o,paragraphIndex:s,lineIndex:a,unitIndex:l,lineHeight:h,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 j=E?h/16:A/16;this.underline=new XT(e,p.type,j,u,x,C,E,o,s,a,l)}if(this.textGraphics=this.createTextGraphics(),this.textFill=this.createTextFill(),this.strokeGraphics=this.createStrokeGraphics(),this.strokeFill=this.createStrokeFill(),this.effectContainer.name="effect-container",this.effectContainer.zIndex=1,this.container.addChild(this.effectContainer),t.effectIndexList&&t.effectIndexList.length&&n.effectList){const{effectList:j}=n;this.effectList=t.effectIndexList.map(Z=>{const rt=j[Z];return rt.type==="outerShadow"&&rt.dist>5&&(rt.dist=5),j[Z]}),this.ctx.slideScopeEventHub.once("slide-render",Z=>{if(this.ctx.slideIndex===Z&&this.effectObject){const rt=this.getEffectTexture();if(rt){const{texture:ct,offsetX:nt,offsetY:vt}=rt;this.effectObject.setFrameOffset(nt,vt),this.effectObject.createFrame(1,ct)}}})}}getEffectTexture(){const{lineHeight:t,fillLineHeight:e,isHorz:n,lineWidth:r}=this.json,o=this.effectContainer.getLocalBounds();let s=0,a=0;for(const u of this.effectContainer.children)u.pivot.x>s&&(s=u.pivot.x),u.pivot.y>a&&(a=u.pivot.y);const l=new De.d;l.translate(s,a);const h=ce.p.create({width:n?o.width:r,height:n?Math.max(e,t):o.height,resolution:2});return this.ctx.renderer.render(this.effectContainer,{renderTexture:h,transform:l}),{texture:h,offsetX:s,offsetY:a}}createStrokeFill(){const{stroke:t,lineWidth:e,lineHeight:n}=this.json;return new mo(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 mo(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 mo(this.ctx,e==null?void 0:e.fill,n,Math.max(o,r),{useFilter:!1,useSlideBackgroundFill:!1}):new mo(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 mo(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(()=>Yg(this,void 0,void 0,function*(){this.doRender()}),"@TextUnitImpl[doRender]"),t.addSubMTask(()=>Yg(this,void 0,void 0,function*(){var e;if(this.effectList&&this.effectList.length>0){const n=`${this.ctx.taskId}_${this.ctx.slideIndex}_${(e=this.json.fill)===null||e===void 0?void 0:e.key}_${this.json.effectIndexList}`;this.effectObject=new Xg(this.effectContainer,this.effectList,n,this.ctx,0,new De.g(1,1)),this.effectObject.on("ready",()=>{var r;this.effectContainer.visible=!1,this.effectObject.container.zIndex=10,this.container.addChild(this.effectObject.container),(r=this.effectObject)===null||r===void 0||r.updateFrame(1)})}}),"@ShapeImpl[post.render]")}doRender(){let t=!1;const{lineWidth:e,lineHeight:n,baseLine:r,isHorz:o,underline:s,height:a,width:l,highlightColor:h,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),h){const C=new er,[j,Z]=Og(h);C.beginFill(j,Z),C.drawRect(0,0,o?l: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 j=this.textFill.displayObject;if(j)j.mask=C,j.addChild(C),j.position.x=-u,C.position.x+=u,t=!0,this.textureContainer.addChild(j);else if(this.textFill.isSolidFill()){const Z=new ds;Z.color=this.textFill.getSolidFillColor(),C.filters=[Z],t=!0,this.textureContainer.addChild(C)}}else this.textureContainer.addChild(C)}if(this.strokeGraphics.displayObject){const C=this.strokeGraphics.displayObject;if(A){const j=this.strokeFill.displayObject;if(j)j.mask=C,j.addChild(C),o?j.position.y=p>0?p:0:j.position.x=u,this.textureContainer.addChild(j);else if(this.strokeFill.isSolidFill()){o?C.position.y=p>0?p:0:C.position.x=u;const Z=new ds;Z.color=this.strokeFill.getSolidFillColor(),C.filters=[Z],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?l: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.effectContainer.addChild(this.cacheSprite)}else this.effectContainer.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 qg=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};class OE extends fc{constructor(t,e,n){super(t,e,n),this.units=[],this.isHorz=!0,this.hyperLinkMap=new Map,this.hyperLinkContainerMap=new Map,this.effectList=[],n.effectList&&(this.effectList=n.effectList)}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(()=>qg(this,void 0,void 0,function*(){const a=this.json.textUnits[o],{height:l,width:h,fillHeight:u,baseline:p,y,underline:x}=this.json,E=new PE(Object.assign(Object.assign({},a),{lineHeight:l,lineWidth:h,baseLine:p-y,underline:x,fillLineHeight:u||l,isHorz:this.isHorz,shapeId:t,paragraphIndex:e,lineIndex:n,unitIndex:o}),this.ctx,{parentGlobalPos:this.global,effectList:this.effectList});if(E.preRender(),this.units.push(E),a.hyperlink||a.hlinkHover){const A=new Pg(E.container,this.ctx);a.hyperlink&&A.addAction(a.hyperlink,"click"),a.hlinkHover&&A.addAction(a.hlinkHover,"hover"),this.container.sortableChildren=!0}}),"@TextLineImpl[createUnits]")}render(t){for(const e of this.units.reverse())e.render(t),t.addSubMTask(()=>qg(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 Jg=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};class NE extends fc{constructor(t,e,n){super(t,e,n),this.iterateElements=[],this.lines=[],this.effectList=[],this.isHorz=!0,n.effectList&&(this.effectList=n.effectList)}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(()=>Jg(this,void 0,void 0,function*(){const s=this.json.lines[r],a=new OE(s,this.ctx,{parentGlobalPos:this.global,effectList:this.effectList});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(()=>Jg(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 LE(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 DE(i,t,e,n,r,o){const s=LE((r=-r)/Math.PI*180,e,n),a=i.x-s.x,l=i.y-s.y;return{centerX:a/9525*t.x,centerY:l/9525*t.y,rx:e/9525*t.x,ry:n/9525*t.y,st:-r,end:-r+o,aClockWise:o<0}}function Kg(i){const t=new Fs,{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[l,h]=a.split(",").map(u=>Number(u));n={x:l,y:h},l=l/9525*e.x,h=h/9525*e.y,t.moveTo(l,h)}else if(s==="A"){const[l,h,u,p]=a.split(",").map(rt=>Number(rt)),{centerX:y,centerY:x,rx:E,ry:A,st:C,end:j,aClockWise:Z}=DE(n,e,l,h,u,p);t.absellipse(y,x,E,A,C,j,Z,0)}else if(s==="L"){let[l,h]=a.split(",").map(u=>Number(u));n={x:l,y:h},l=l/9525*e.x,h=h/9525*e.y,t.lineTo(l,h)}else if(s==="QB"){let[l,h,u,p]=a.split(",").map(y=>Number(y));n={x:u,y:p},l=l/9525*e.x,h=h/9525*e.y,u=u/9525*e.x,p=p/9525*e.y,t.quadraticCurveTo(l,h,u,p)}else if(s==="CB"){let[l,h,u,p,y,x]=a.split(",").map(E=>Number(E));n={x:y,y:x},l=l/9525*e.x,h=h/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(l,h,u,p,y,x)}else if(s==="C")try{t.closePath()}catch{}}return t}function Un(i,t){return i.curves.map(e=>e.getPoints(t)).reduce((e,n)=>e.concat(n),[])}const yc={textCirclePour:{top:i=>i.getPoints(360),bottom:i=>i.getPoints(360)},textStop:{top:i=>Un(i,100),bottom:i=>Un(i,100)},textPlain:{top:i=>Un(i,100),bottom:i=>Un(i,100)},textTriangle:{top:i=>Un(i,50),bottom:i=>Un(i,101)},textTriangleInverted:{bottom:i=>Un(i,50),top:i=>Un(i,101)},textChevron:{bottom:i=>Un(i,50),top:i=>Un(i,50)},textChevronInverted:{bottom:i=>Un(i,50),top:i=>Un(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=>Un(i,180),bottom:i=>i.getPoints(180)},textDeflateBottom:{top:i=>Un(i,180),bottom:i=>i.getPoints(180)},textInflateTop:{bottom:i=>Un(i,180),top:i=>i.getPoints(180)},textDeflateTop:{bottom:i=>Un(i,180),top:i=>i.getPoints(180)},textFadeRight:{bottom:i=>Un(i,180),top:i=>Un(i,180)},textFadeLeft:{bottom:i=>Un(i,180),top:i=>Un(i,180)},textFadeUp:{bottom:i=>Un(i,180),top:i=>Un(i,180)},textFadeDown:{bottom:i=>Un(i,180),top:i=>Un(i,180)},textSlantUp:{bottom:i=>Un(i,180),top:i=>Un(i,180)},textSlantDown:{bottom:i=>Un(i,180),top:i=>Un(i,180)},textCascadeUp:{bottom:i=>Un(i,180),top:i=>Un(i,180)},textCascadeDown:{bottom:i=>Un(i,180),top:i=>Un(i,180)},textArchUp:{bottom:i=>Un(i,180),top:i=>Un(i,180)},textArchDown:{bottom:i=>Un(i,180),top:i=>Un(i,180)},textCircle:{bottom:i=>Un(i,180),top:i=>Un(i,180)}};function FE(i,t,e,n,r){const o=i.trim().split(" "),[s,a]=o[1].split(",").map(Z=>parseFloat(Z)),[l,h,u,p]=o[3].split(",").map(Z=>parseFloat(Z)),y=function(Z,rt,ct,nt,vt,ht){const mt=Math.abs(ht*Math.sqrt((ct*ct+nt*nt)/2)),jt=Math.ceil(mt/9525/10);let Ft=0,Mt=vt,wt={x:Z+ct*Math.cos(Mt),y:rt+nt*Math.sin(Mt)};for(let Ot=0;Ot<jt;Ot+=1){Mt+=ht/jt;const Nt={x:Z+ct*Math.cos(Mt),y:rt+nt*Math.sin(Mt)};Ft+=Math.sqrt(Math.pow(Nt.x-wt.x,2)+Math.pow(Nt.y-wt.y,2)),wt=Nt}return Ft}(s,a,l,h,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=l+9525*r,j=h+9525*r;return`M ${9525*A.x},${9525*A.y} A ${C},${j},${u},${p}`}var za=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};class BE{constructor(t,e,n,r,o){var s;this.iterateElements=[],this.paragraphs=[],this.effectList=[],this.container=new Cn.b,this.textContainer=new Cn.b,this.textColorFilter=new ds,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 a=new er;a.drawRect(0,0,t.width,t.height),this.container.addChild(a),this.container.addChild(this.textContainer),this.textColorFilter.currentColor="#000000FF",this.textColorFilter.designColor="#000000FF",this.effectList=(s=t.effectList)!==null&&s!==void 0?s:[]}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(()=>za(this,void 0,void 0,function*(){var o;const s=this.json.paragraphs[n],a=new NE(s,this.ctx,{parentGlobalPos:this.global,effectList:this.effectList});a.isHorz=(o=this.json.isHorz)===null||o===void 0||o,a.createLines(t,n,e),e.addSubMTask(()=>za(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(()=>za(this,void 0,void 0,function*(){this.textContainer.addChild(e.container)}),"@TextBodyImpl[container.addChild]");t.addSubMTask(()=>za(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(()=>za(this,void 0,void 0,function*(){if(this.json.presetTextShape){const e=this.json.paragraphs.map(h=>h.x).reduce((h,u)=>Math.min(h,u)),n=this.json.paragraphs[0].y,r=this.textContainer.getBounds(),{width:o,height:s}=r,{geometry:a,type:l}=this.json.presetTextShape;if(a.paths){const h=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:h,transform:u});const p=this.json.isHorz!==void 0&&!this.json.isHorz;if(["textCircle","textArchUp","textArchDown"].indexOf(this.json.presetTextShape.type)>=0){const x=FE(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(!yc[A])return null;const j=yc[A].top(Kg(E)),Z=yc[A].bottom(Kg(x));if(j.length!==Z.length)return null;const rt=Math.min(j.length,Z.length),ct=1/(rt-1),nt=[],vt=[],ht=new Array(2*rt).fill("").map((mt,jt)=>jt);for(let mt=0;mt<rt;mt++)nt.push(j[mt].x,j[mt].y),C?vt.push(1,ct*mt):vt.push(ct*mt,0),nt.push(Z[mt].x,Z[mt].y),C?vt.push(0,ct*mt):vt.push(ct*mt,1);return{vertices:new Float32Array(nt),uvs:new Float32Array(vt),drawMode:gn.f.TRIANGLE_STRIP,indices:new Uint16Array(ht)}}(a.paths[1],a.paths[0],l,p);if(y){const x=new _T.b(h,y.vertices,y.uvs,y.indices,y.drawMode);this.textContainer.visible=!1,this.container.addChild(x)}}}}),"presetTextShape")}}class UE{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-"+sh()(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*=.75;break;case"lg":this.scaleX*=1.25;break;case"med":this.scaleX*=1}switch(this.heightSize){case"sm":this.scaleY*=.75;break;case"lg":this.scaleY*=1.25;break;case"med":this.scaleY*=1}this.width=10*this.scaleX,this.height=10*this.scaleY}}class xc{constructor(t,e,n,r,o,s,a,l,h,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=l,this.shouldFill=h,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&&h?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)}isPoint(t){return Number.isNaN(Number(t.x))||Number.isNaN(Number(t.y))}isSquare(t,e){if(t.join("")!=="MLLLC"&&t.join("")!=="MLLLCC")return!1;const n=e.filter(l=>!this.isPoint(l));if(n.length!==4)return!1;const r=Math.min(...n.map(l=>l.x)),o=Math.min(...n.map(l=>l.y)),s=Math.max(...n.map(l=>l.x)),a=Math.max(...n.map(l=>l.y));for(const l of n)if(l.x!==r&&l.x!==s||l.y!==o&&l.y!==a)return!1;return!0}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 l=0;l<e.length;l+=2){const h=e[l],u=e[l+1],[p,y]=u.split(",").map(x=>Number(x)/100);n.push(h),r.push({x:p,y})}if(this.isSquare(n,r))return!1;for(let l=0;l<3;l++){const h=r[l],u=r[l+1];if(h.x!==u.x&&h.y!==u.y)return!1}const o=r.slice(0,4).reduce((l,h)=>l+h.x,0)/4,s=r.slice(0,4).reduce((l,h)=>l+h.y,0)/4;if(Number.isNaN(o)||Number.isNaN(s))return!1;const a={x:o,y:s};return Tr(this.pointDis(a,r[0]),this.pointDis(a,r[1]))&&Tr(this.pointDis(a,r[0]),this.pointDis(a,r[2]))&&Tr(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 er;return t.beginFill(0,1),t.drawRect(0,0,this.width,this.height),t}if(this.isColoredPureRect&&this.bgColor){const t=new er,[e,n]=Og(this.bgColor);return t.beginFill(e,n),t.drawRect(0,0,this.width,this.height),t}{const t=new pi,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.scale.x=e.scale,t.scale.y=e.scale,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=[]}}var ph=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};const ps={pivot:{x:0,y:0},width:0,height:0};class Zg extends pc{constructor(t,e,n){var r,o,s,a,l,h,u,p,y;super(t,e,n),this.renderContainer=new Cn.b,this.needCacheAsBitMap=!1,this.backgroundGraphics=null,this.effectList=[],this.strokeGraphics=null,this.ghco=null,this.useGroupFill=!1,this.arrowList=[],this.fillColorFilter=new ds,this.strokeColorFilter=new ds,this.pptColorFilter=new ds,this.id="",this.ppt_c=new HT(this),this.fill=new Ig(this),this.stroke=new kT(this),this.effectObject=null,this.effectContainer=new Cn.b,this.effectDisposer=()=>{},this.json=t,this.option=n,this.json.fillStyle&&this.json.fillStyle.fillType==="groupFill"&&n.groupFillStyle&&(this.json.fillStyle=n.groupFillStyle,this.useGroupFill=!0),this.id=t.id;const{fillStyle:x,lineStyle:E}=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 xc(this.json.id+"-path-graphics-text-wrap",this.ctx,(s=(o=(r=this.json.textBody)===null||r===void 0?void 0:r.presetTextShape)===null||o===void 0?void 0:o.geometry.paths)!==null&&s!==void 0?s:[],(h=(l=(a=this.json.textBody)===null||a===void 0?void 0:a.presetTextShape)===null||l===void 0?void 0:l.geometry.hash)!==null&&h!==void 0?h:"",{x:0,y:0},((u=this.json.textBody)===null||u===void 0?void 0:u.width)||100,((p=this.json.textBody)===null||p===void 0?void 0:p.height)||100,{width:2,fill:{fillType:"solidFill",color:"#FF0000FF"}},!1,null,null)}catch(A){this.ctx.logger.error(A.message,this.ctx.taskId)}this.ctx.timingTargets.addTarget(this.id,this),(x==null?void 0:x.fillType)==="solidFill"&&(this.fillColorFilter.currentColor=x.color,this.fillColorFilter.designColor=x.color),((y=E==null?void 0:E.fill)===null||y===void 0?void 0:y.fillType)==="solidFill"&&(this.strokeColorFilter.currentColor=E.fill.color,this.strokeColorFilter.designColor=E.fill.color),this.updateTransform(this.json),t.textBody&&(this.text=new BE(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",A=>{if(this.ctx.slideIndex===A&&this.effectObject){const C=this.getEffectTexture();if(C){const{texture:j,offsetX:Z,offsetY:rt}=C;this.effectObject.setFrameOffset(Z,rt),this.effectObject.createFrame(1,j)}}})}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:l}=this.strokeFill;t?l&&((n=(e=l.filters)===null||e===void 0?void 0:e.indexOf(this.strokeColorFilter))!==null&&n!==void 0?n:-1)<0?l.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]):l?l.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;if(this.json.isMathFallback){if(!this.json.textBody)return this;const o=()=>this.json.textBody.paragraphs[0].lines.length<=1,s=()=>this.json.textBody.paragraphs[0].lines[0].textUnits.length<=1,a=()=>this.json.textBody.paragraphs[0].lines[0].textUnits[0].content.trim()==="";if((()=>this.json.textBody.paragraphs.length<=1)()&&o()&&s()&&a())return this}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:l,height:h,pivot:u}=(s==null?void 0:s.lineTransform)||ps,p=l||this.json.width,y=h||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 xc(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)||ps,l=zo()(r==null?void 0:r.width)?r.width:1;return new mo(this.ctx,r==null?void 0:r.fill,(a.width||o)+l+t,Math.max((a.height||s)+l,e),{useFilter:!0,useSlideBackgroundFill:!1})}createBackgroundGraphics(){var t;const{geometry:e,lineStyle:n,fillStyle:r,id:o}=this.json,{width:s,height:a,pivot:l}=(e==null?void 0:e.lineTransform)||ps,h=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 xc(o+"-bg-graphics",this.ctx,(t=e==null?void 0:e.paths)!==null&&t!==void 0?t:[],(e==null?void 0:e.hash)||"",l||{x:0,y:0},h,u,n,!0,p,null):null}createBackgroundFill(){var t,e,n,r;const{fillStyle:o,width:s,height:a,lineStyle:l,geometry:h}=this.json,u=(h==null?void 0:h.fillTransform)||ps,p={useFilter:!0,useSlideBackgroundFill:this.json.useBgFill,fillFloat:this.json.fillFloat,shapeRotation:this.json.rotation},y=this.useGroupFill&&((t=this.option.groupSize)===null||t===void 0?void 0:t.w)?this.option.groupSize.w:u.width||s,x=this.useGroupFill&&((e=this.option.groupSize)===null||e===void 0?void 0:e.h)?this.option.groupSize.h:u.height||a;return new mo(this.ctx,o,y+((n=l==null?void 0:l.width)!==null&&n!==void 0?n:0),x+((r=l==null?void 0:l.width)!==null&&r!==void 0?r:0),p)}createBackground(){var t,e,n,r,o,s,a,l,h,u,p,y;const{pivot:x,width:E,height:A}=((t=this.json.geometry)===null||t===void 0?void 0:t.fillTransform)||ps,{displayObject:C}=this.backgroundFill;C?(this.json.useBgFill&&((n=this.backgroundGraphics)===null||n===void 0?void 0:n.displayObject)?(this.needCacheAsBitMap=!0,C.mask=this.backgroundGraphics.displayObject,C.pivot.x=((r=this.json.position)===null||r===void 0?void 0:r.x)||0,C.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"?(C.height=A||this.designHeight,C.width=E||this.designWidth,C instanceof lc&&C.play(),!((a=this.backgroundGraphics)===null||a===void 0)&&a.isNeedMask(C.width,C.height)&&(C.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.effectContainer.addChild(this.backgroundGraphics.displayObject))):!((l=this.backgroundGraphics)===null||l===void 0)&&l.isNeedMask(C.width,C.height)&&(this.json.fillFloat||(this.needCacheAsBitMap=!0,C.mask=this.backgroundGraphics.displayObject,this.backgroundGraphics.displayObject&&this.effectContainer.addChild(this.backgroundGraphics.displayObject))),this.json.fillFloat||(C.x=x.x,C.y=x.y),this.useGroupFill&&(C.x-=(u=(h=this.json.position)===null||h===void 0?void 0:h.x)!==null&&u!==void 0?u:0,C.y-=(y=(p=this.json.position)===null||p===void 0?void 0:p.y)!==null&&y!==void 0?y:0),this.effectContainer.addChild(C)):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 pi(s.texture);a.pivot.x=s.pivot.x,a.pivot.y=s.pivot.y,a.scale.x=s.scale,a.scale.y=s.scale;const l=this.backgroundFill.getClonedDisplayObject(),h=(n=this.backgroundGraphics)===null||n===void 0?void 0:n.getClonedDisplayObject(),u=l||h;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=[WT[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 pi(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,o.scale.x=n.scale,o.scale.y=n.scale,(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,l)=>{var h,u;const p=new UE(Object.assign(Object.assign({},a),{fillStyle:r==null?void 0:r.fill,lineWidth:(h=r==null?void 0:r.width)!==null&&h!==void 0?h:0}));p.graphicsId=`${o}-arrow-${l}-graphics`,p.textureId=`${o}-arrow-${l}-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:l}=(s==null?void 0:s.lineTransform)||ps,h=a||this.json.width,u=l||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(()=>ph(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)||ps).pivot,h,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 ph(this,void 0,void 0,function*(){})}render(t){t.addSubMTask(()=>ph(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(()=>ph(this,void 0,void 0,function*(){var e,n,r,o,s,a,l,h,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=((l=(a=this.json.position)===null||a===void 0?void 0:a.y)!==null&&l!==void 0?l: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.json.textRotation&&(this.text.container.rotation=this.json.textRotation),this.renderContainer.addChild(this.text.container)}}else{if(this.text){if(this.json.textRotation){this.text.container.rotation=this.json.textRotation;const{width:Z,height:rt}=this.text,{x:ct,y:nt}=this.text.container.position;this.text.container.pivot.x=Z/2,this.text.container.pivot.y=rt/2,this.text.container.x=ct+Z/2,this.text.container.y=nt+rt/2}if(VT()(this.json.textRotateWithShape)&&!this.json.textRotateWithShape){const Z=this.json.rotation||0;this.text.container.rotation=-Z;const{width:rt}=this.text;this.text.container.position.x=rt}this.text.container.zIndex=100;const A=(h=this.json.effectList)===null||h===void 0?void 0:h.find(Z=>Z.type==="outerShadow"),C=(u=this.json.effectList)===null||u===void 0?void 0:u.find(Z=>Z.type==="softEdge"),j=(p=this.json.effectList)===null||p===void 0?void 0:p.find(Z=>Z.type==="glow");A&&A.sx!==1||C||j?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 Xg(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,j,Z;return((C=A.fillStyle)===null||C===void 0?void 0:C.fillType)==="gifFill"||((Z=(j=A.lineStyle)===null||j===void 0?void 0:j.fill)===null||Z===void 0?void 0:Z.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 kE=v(119);const bc=new(v.n(kE)).a,GE=bc.getDevice(),HE=bc.getBrowser(),fh=bc.getOS(),fs={isDesktop(){let i=!0;return GE.type==="mobile"&&(i=!1),/Samsung/.test(HE.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),fh.name&&/iOS/.test(fh.name)&&(i=!0),i},isAndroid(){let i=!1;return window.__nativeTags&&window.__nativeTags.platform&&/^android/i.test(window.__nativeTags.platform)&&(i=!0),fh.name&&/android/i.test(fh.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 mh=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};function rr(i,t){for(const e in t)i.style[e]=t[e]}const Wo={medianContainerClass:"median-container",hoverHiddeDelay:1500,portalWidth:300,portalHeight:50,hiddenOpacity:"0",hoverOpacity:"1",opacityAnimationTime:.4};class Va{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.fadeState={in:!1,out:!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(Ke.mediaSeek,{id:this.targetId,time:o,isPlaying:this.media.isPlaying}),this.delayHide()},this.jumpToTime=(r=0)=>mh(this,void 0,void 0,function*(){yield ih(()=>!!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=Va.formatTime(this.duration)},this.playMedia=()=>mh(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=()=>mh(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=()=>mh(this,void 0,void 0,function*(){const r=this.media.currentTime-this.start;if(this.duration>0&&(Math.abs(r-this.duration)<.3||r>this.duration)&&(yield this.pauseMedia(),this.medianIsEnd=!0,this.jumpToTime(),this.ctx.eventHub.emit(Ke.mediaStop,{id:this.targetId}),this.onClickCancelFullScreenButtonHandle()),this.currentTime.innerText=Va.formatTime(r),this.currentProgress.style.flex=(r/this.duration).toString(),this.bookmarkList&&this.bookmarkList.length>0){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.fadeHit(r)}),this.onPauseMedia=()=>{this.playButton.style.display="block",this.pauseButton.style.display="none"},this.onPlayMedia=()=>{this.fadeState={in:!1,out:!1},this.fadeHit(0),this.playButton.style.display="none",this.pauseButton.style.display="block",this.playCallBackList.forEach(r=>{r()}),this.media.currentTime<this.start&&this.jumpToTime()},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(Ke.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:l}=Wo;s?(this.mediaController.style.opacity=l,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}=Wo;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");rr(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");rr(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");rr(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"};rr(this.playButton,Object.assign(Object.assign({},t),{display:"block"}));const e=this.generatePlayButton();rr(e,{height:"20px"}),this.playButton.appendChild(e),rr(this.pauseButton,Object.assign(Object.assign({},t),{display:"none"}));const n=this.generatePauseButton();if(rr(n,{height:"20px"}),this.pauseButton.appendChild(n),!this.isVideo)return;const r=this.generateFullScreenButton(20,20);this.fullScreenButton.appendChild(r),rr(this.fullScreenButton,Object.assign(Object.assign({},t),{display:"block"}));const o=this.generateExitFullScreenButton(20,20);this.exitFullScreenButton.appendChild(o),rr(this.exitFullScreenButton,Object.assign(Object.assign({},t),{display:"none"}))}createTimer(){const t=document.createElement("div");rr(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"),rr(this.progress,t);const e=document.createElement("div");rr(e,{background:"#D9D9D9",position:"relative",height:"10px",display:"flex"}),this.progress.appendChild(e),rr(this.currentProgress,{background:"#4F4F4F",top:"0px",left:"0",height:"10px",flex:"0"}),e.appendChild(this.currentProgress)}fadeHit(t){if(!this.info.fade)return;const{start:e,end:n}=this.info.fade;e&&!this.fadeState.in&&t>=0&&(this.fadeState.in=!0,this.media.fadeIn(0,e)),n&&!this.fadeState.out&&t>=this.duration-n/1e3&&(this.fadeState.out=!0,this.media.fadeOut(0,n))}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(Ke.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(Ke.mediaPause,{id:this.targetId,time:this.media.currentTime-this.start,_stateOnly:t}))}setControllerPosition(){var t;const{target:e}=this,{portalWidth:n,portalHeight:r}=Wo,{stageWidth:o,stageHeight:s}=this.ctx,a=e.getGlobalPosition(),l=Number((t=this.container)===null||t===void 0?void 0:t.getAttribute("data-scale")),h=o*l,u=1/l*(n>h?h/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),rr(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&&rr(this.mediaController,{left:"0",top:s-r+"px"})}createMediaController(){this.setControllerPosition(),rr(this.mediaController,{display:"none",transition:`opacity ${Wo.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(Ke.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(){fs.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;fs.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=Wo.hoverOpacity,this.fullscreenStatus||(this.mediaController.style.display="flex"),this.delayHide()}hide(){this.fullscreenStatus?this.mediaController.style.opacity=Wo.hiddenOpacity:this.mediaController.style.display="none"}delayHide(){clearTimeout(this.autoHiddenTimer),this.autoHiddenTimer=setTimeout(()=>{this.hide()},Wo.hoverHiddeDelay)}destroy(){var t;this.unbindEvent(),this.playCallBackList=[],(t=this.container)===null||t===void 0||t.removeChild(this.mediaController)}}var jE=v(120);class Tc extends xi.a{constructor(t,e,n){var r,o;super(),this.isGlobalPause=!1,this.lastTime=-1,this.howl=null,this.rctClient=null,this.isHowlEnd=!1,this.isHowlLoadEmit=!1,this.staticEventId=1001,this._catParams=void 0,this.url=t,this.runningAudio=e,n&&(this._catParams=n),lr.RtcAudioClazz?(this.rctClient=new lr.RtcAudioClazz(t,(r=this._catParams)===null||r===void 0?void 0:r.start,(o=this._catParams)===null||o===void 0?void 0:o.end),this.rctClient.on("load",()=>this.emit("load")),this.rctClient.on("pause",()=>this.emit("pause")),this.rctClient.on("play",()=>{this.startTimeChangeEmit(),this.emit("play")}),this.rctClient.on("resumeAllAudioInterruptByAudioSessionChanged",()=>{this.emit("resumeAllAudioInterruptByAudioSessionChanged")})):(this.howl=new jE.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.startTimeChangeEmit(),this.emit("play")}),this.howl.on("end",()=>{this.isHowlEnd=!0}))}startTimeChangeEmit(){this.currentTime!==this.lastTime&&(this.lastTime=this.currentTime,this.emit("timeupdate",this.lastTime)),this.isPaused||setTimeout(()=>{this.isPaused||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.runningAudio.set(this.url,this)}fade(t,e,n){this.howl&&this.howl.fade(t,e,n)}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,l;(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"),(l=this.rctClient)===null||l===void 0||l.removeAllListeners("resumeAllAudioInterruptByAudioSessionChanged"),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 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 Qg=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};class zE extends xi.a{constructor(t){var e,n,r,o,s,a,l;super(),this.type="video",this.sprite=new pi,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=C=>{this.rtcAudio.volume(C)},this.syncFullscreenVideoState=C=>{const{targetId:j,state:Z,slideIndex:rt}=C;rt===this.ctx.slideIndex&&j===this.id&&(Z?(this.requestFullscreen(),this.ctx.latestChangeFullscreenTargetId=j):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 h=t.video.src;this.videoResource=new ce.w(h,{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 u=t.video.src.replace(/4$/,"3");this.ctx.loaderDelegate&&(u=this.ctx.loaderDelegate.redirectMedia(u),this.ctx.logger.info(`redirect media url from ${t.video.src.replace(/4$/,"3")} to ${u} by delegate.`,t.ctx.taskId)),this.rtcAudio=new Tc(u,t.ctx.runningAudio,{start:(a=t.video.cut)===null||a===void 0?void 0:a.start,end:(l=t.video.cut)===null||l===void 0?void 0:l.end}),this.rtcAudio.on("timeupdate",C=>{if(this.videoElement){const j=this.videoElement.currentTime;Math.abs(j-C)>.5&&(this.videoElement.currentTime=C)}}),this.rtcAudio.on("resumeAllAudioInterruptByAudioSessionChanged",()=>{var C;(C=this.videoElement)===null||C===void 0||C.pause(),setTimeout(()=>{var j;this.rtcAudio.isPaused||(j=this.videoElement)===null||j===void 0||j.play()},200)});const{video:p,width:y,height:x,target:E}=t;this.controller=new Va({targetId:t.id,shapeId:t.shapeId,ctx:t.ctx,width:y,height:x,target:E,media:this,info:p,canvasElement:t.canvasElement}),this.controller.addPlayCallBack(()=>{this.sprite.width=y,this.sprite.height=x,this.ctx.clock.setTimeout(()=>{this.sprite.visible=!0},50)});const A=new ce.c(null,{height:x,width:y});A.resource=this.videoResource,this.videoResource.bind(A),this.sprite=new pi,this.sprite.visible=!1,this.sprite.texture=new ce.t(A),this.sprite.interactive=!0,this.container.addChild(this.sprite),this.sprite.on("mouseover",C=>{C.stopPropagation(),this.controller.show()}),this.sprite.on("mouseout",C=>{C.stopPropagation(),this.controller.hide()}),["durationchange","timeupdate","pause","play"].forEach(C=>{var j;(j=this.videoElement)===null||j===void 0||j.addEventListener(C,()=>{C==="timeupdate"&&this.isPlaying,this.emit(C)})}),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 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 Qg(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.on("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.rtcAudio.stop(),this.seek(0),this.pause(),this.ctx.eventHub.emit(Ke.mediaStop,{id:this.id})}requestFullscreen(){return Qg(this,void 0,void 0,function*(){yield ih(()=>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)}fadeIn(t,e){this.rtcAudio.fade(t,this.ctx.volumeAdjuster.volume,e)}fadeOut(t,e){this.rtcAudio.fade(this.ctx.volumeAdjuster.volume,t,e)}}var VE=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};class WE extends xi.a{constructor(t){var e,n;super(),this.type="audio",this.isPlaying=!1,this.isGlobalPause=!1,this.updateVolume=l=>{this.audioPlayer.volume(l)},this.id=t.id;const r=t.audio.src;this.audioPlayer=new Tc(r,t.ctx.runningAudio,{start:(e=t.audio.cut)===null||e===void 0?void 0:e.start,end:(n=t.audio.cut)===null||n===void 0?void 0:n.end}),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:o,height:s,target:a}=t;this.controller=new Va({targetId:t.id,shapeId:t.shapeId,ctx:t.ctx,height:s,width:o,target:a,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 duration(){return this.audioPlayer.duration}load(){return Promise.resolve()}showController(){this.controller.show()}hideController(){this.controller.hide()}play(){return VE(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.audioPlayer.stop(),this.seek(0),this.pause(),this.ctx.eventHub.emit(Ke.mediaStop,{id:this.id})}requestFullscreen(){}requestCancelFullscreen(){}destroy(){this.ctx.volumeAdjuster.removeListener("update",this.updateVolume),this.stop(),this.controller.destroy(),this.ctx.activeMedia.delete(this),this.audioPlayer.destroy()}fadeIn(t,e){this.audioPlayer.fade(t,this.ctx.volumeAdjuster.volume,e)}fadeOut(t,e){this.audioPlayer.fade(this.ctx.volumeAdjuster.volume,t,e)}}var $g=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};class XE extends Zg{constructor(t,e,n){super(Object.assign(Object.assign({},t),{type:"Shape",useBgFill:!1,textRotateWithShape:!0,isPicture:!0}),e,n),this.isInteractiveOutside=!1,this.cmd=new GT(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 mo(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.]+)\)/),l=Number(a[1]||"0");(n=this.mediaPlayer)===null||n===void 0||n.controller.playMediaFromCtrl(!0),Math.abs(l)>.1&&((r=this.mediaPlayer)===null||r===void 0||r.controller.jumpToTime(l))}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 $g(this,void 0,void 0,function*(){const{displayObject:a}=this.picFill;if(a){a.name=this.json.id+"_pic_fill_[Picture]";const l=(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))&&l&&(a.mask=l,this.effectContainer.addChild(l)),a.width=this.designWidth,a.height=this.designHeight,a instanceof lc&&this.ctx.slideScopeEventHub.once("slide-render",h=>{var u;this.ctx.slideIndex===h&&((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 h=this.media.src;if(this.media.type==="audio"&&/mp4$/.test(h)&&(h=h.replace(/mp4$/,"mp3")),this.ctx.urlInterrupter){const u=Date.now();h=yield this.ctx.urlInterrupter(h),this.ctx.logger.info("redirect media url by interrupter. time: "+(Date.now()-u),this.ctx.taskId)}this.ctx.loaderDelegate&&(h=this.ctx.loaderDelegate.redirectMedia(h),this.ctx.logger.info(`redirect media url to ${h} by delegate.`,this.ctx.taskId)),this.media.src=h}if(((n=this.media)===null||n===void 0?void 0:n.type)==="video"&&this.media.src){if(this.mediaPlayer=new zE({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)&&l){const h=(o=this.backgroundGraphics)===null||o===void 0?void 0:o.getClonedDisplayObject();h&&(this.mediaPlayer.sprite.mask=h,this.container.addChild(h))}}else((s=this.media)===null||s===void 0?void 0:s.type)==="audio"&&this.media.src&&(this.mediaPlayer=new WE({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,fade:this.media.fade}));this.mediaPlayer&&(this.isInteractiveOutside=!!this.container.interactive,this.container.interactive=!0,fs.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 $g(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 gh=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};class Ec extends pc{constructor(t,e,n,r){super(t,e,n),this.children=[],this.cacheSprite=new pi,this.cacheContainer=new Cn.b,this.json=t,this.json.fillStyle&&this.json.fillStyle.fillType==="groupFill"&&n.groupFillStyle&&(this.json.fillStyle=n.groupFillStyle),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 mo(this.ctx,t.fillStyle,t.width,t.height,{useFilter:!1,useSlideBackgroundFill:!1}),this.createChildren(r)}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,l=this.json.children.length;a<l;a++)t.addSubMTask(()=>gh(this,void 0,void 0,function*(){let h=this.json.children[a],u=null;if(!(!this.ctx.featureList||!this.ctx.featureList.smartArt)&&((h==null?void 0:h.type)==="Shape"||(h==null?void 0:h.type)==="Picture")&&this.ctx.smartArtShapeList){const{id:y}=h,x=this.ctx.smartArtShapeList.find(E=>E.id===y);x&&(h=x)}const p={parentGlobalPos:s,groupFillStyle:this.json.fillStyle,groupSize:{w:this.json.width,h:this.json.height}};(h==null?void 0:h.type)==="Shape"?u=new Zg(h,this.ctx,p):(h==null?void 0:h.type)==="Picture"?u=new XE(h,this.ctx,p):(h==null?void 0:h.type)==="Container"&&(u=new Ec(h,this.ctx,p,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(()=>gh(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(()=>gh(this,void 0,void 0,function*(){this.cacheContainer.addChild(e.renderContainer)}),"@ContainerImpl[child.render]");t.addSubMTask(()=>gh(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 Wa extends xi.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 YE extends xi.a{constructor(t){super(),this.isTimeNodeEndSync=!1,this.interactiveListeners=[],this.runtimeNodeEventHub=new xi.a,this._currentSeqIndex=0,this._currentSeqState="idle",this.isForward=!0,this.autoPlay=!1,this.handlePrev=(y=!1)=>{var x,E,A,C,j,Z;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),(j=this.commonTimeNode.children[this.currentSeqIndex])===null||j===void 0||j.commonTimeNode.seekToStart(),(Z=this.commonTimeNode.children[this.currentSeqIndex])===null||Z===void 0||Z.commonTimeNode.clearSubList(),this.currentSeqState="idle"):this.globalEventHub.emit("c:prev slide",y)},this.handleNext=(y,x)=>{var E,A,C,j;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 Z={result:null};this.findChildInfiniteRepeat(this.commonTimeNode,Z),this.commonTimeNode.children.length===1&&Z.result&&(Z.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(),(j=this.commonTimeNode.children[this.currentSeqIndex])===null||j===void 0||j.commonTimeNode.startTimeNodeForce())}};const{json:e,iterateType:n,isIterate:r,isSub:o,parent:s,ctx:a,eventHub:l,iterateIndex:h,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=l,this.commonTimeNode=new Qs({json:e.ctn,isSub:o,eventHubs:{global:l,runtime:this.runtimeNodeEventHub},ctx:a,parent:s,isIterate:!1,iterateType:n,iterateIndex:h,iterateId:u,isInInteractiveSeq:p||this.isInteractiveSeq,fromSeqId:this.isInteractiveSeq?this.json.ctn.id:""}),this.bindShapeEvent(),this.nextConds=new Wa("mainSeq",e.nextCondLst,{global:l,runtime:this.runtimeNodeEventHub},this.ctx),this.prevConds=new Wa("mainSeq",e.preCondLst,{global:l,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(Ke.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(Ke.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(Ke.mainSeqStepChange,t):this.isInteractiveSeq&&this.ctx.eventHub.emit(Ke.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(Ke.mainSeqStateChange,t):this.isInteractiveSeq&&this.ctx.eventHub.emit(Ke.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(Ke.userInput);const o=`shape ${e} onClick`,{mode:s}=this.ctx;s!=="interactive"&&s!=="sync"||this.ctx.eventHub.emit(Ke.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 Xa(i,t){return t?t.split(".").reduce((e,n)=>e?e[n]:(console.warn(`${i} not support ${t}`),null),i):null}class Xo{constructor(t){this.timingTarget=null,this.runtimeNodeEventHub=new xi.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:l,iterateIndex:h,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 Qs({json:r.cBhvr.ctn,isSub:n,eventHubs:{global:a,runtime:this.runtimeNodeEventHub},ctx:o,parent:s,isIterate:e,iterateType:l,iterateIndex:h,iterateId:u,isInInteractiveSeq:p,fromSeqId:y}),this.timingTarget=this.ctx.timingTargets.getTarget(r.cBhvr.target,e,{type:l,index:h,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 Sc extends Xo{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.startVal=null,this.updateStartValue=()=>{this.timingTarget&&(this.startVal=Xa(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 vh=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 _h{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 tv extends _h{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}}vh([nh()],tv.prototype,"interpolationFrom",null);class ev extends _h{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&&["hidden","visible"].indexOf(r)<0&&(r=this.resolveValue()),r}resolveValue(){return this.value||""}}vh([nh()],ev.prototype,"interpolationFrom",null);class Zs extends _h{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}}vh([nh()],Zs.prototype,"interpolationFrom",null);class nv extends _h{constructor(t,e){super(t,e),this.value=t.val.value}interpolationFrom(t,e){return Ga(t.resolveValue(),this.value,e)}resolveValue(){return this.value}}vh([nh()],nv.prototype,"interpolationFrom",null);class qE extends Xo{constructor(t){super(t),this.isConflict=!0,this.activeWhenConflict="next",this.startVal=null,this.createVal=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=Xa(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,l=this.keyFrames[o],h=this.keyFrames[a]||l,u=l[0]-h[0]==0?1:(r-h[0])/(l[0]-h[0]),p=l[1].interpolationFrom(h[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.onDestroy=()=>{this.createVal!==null&&this.timingTarget&&zr(this.timingTarget,this.json.cBhvr.attrList[0],this.createVal)},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),this.commonTimeNode.on("timeNodeDestroy",this.onDestroy),this.createVal=Xa(this.timingTarget,this.json.cBhvr.attrList[0])}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 Zs(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 Zs(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 Zs(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 Zs(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 Zs(n,this.timingTarget):e==="str"&&(r=new ev(n,this.timingTarget)):n.val.type==="number"?r=new tv(n,this.timingTarget):n.val.type==="color"?(this.isColorAnim=!0,r=new nv(n,this.timingTarget)):n.val.type==="boolean"&&console.warn("not implements"),r&&this.keyFrames.push([n.time,r])}}}}class dr 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 JE=v(121),KE=v.n(JE),ZE=v(122),QE=v.n(ZE),$E=v(123),tS=v.n($E),eS=v(124),nS=v.n(eS),iS=v(9),Lr=v.n(iS),rS=v(125),oS=v.n(rS),sS=v(126),aS=v.n(sS);const iv="data:image/png;base64,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";var lS=v(127),hS=v.n(lS),uS=v(128),cS=v.n(uS),dS=v(129),pS=v.n(dS),fS=v(130),mS=v.n(fS),gS=v(131),vS=v.n(gS),_S=v(132),yS=v.n(_S),xS=v(133),bS=v.n(xS),TS=v(134),ES=v.n(TS),SS=v(135),wS=v.n(SS);const rv={wipe:class extends dr{constructor(i){super(QE.a,KE.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 dr{constructor(i){super(void 0,tS.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 dr{constructor(i){super(Lr.a,nS.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="vertical"?1:0}},checkerboard:class extends dr{constructor(i){super(Lr.a,oS.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="down"?1:0}},dissolve:class extends dr{constructor(i){super(Lr.a,aS.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.setTextTure()}setTextTure(){this.uniforms.dissolveSampler=ce.t.from(iv)}},randombar:class extends dr{constructor(i){super(Lr.a,hS.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(iv)}},circle:class extends dr{constructor(i){super(Lr.a,cS.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="out"?1:0}},box:class extends dr{constructor(i){super(Lr.a,pS.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="out"?1:0}},diamond:class extends dr{constructor(i){super(Lr.a,mS.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="out"?1:0}},plus:class extends dr{constructor(i){super(Lr.a,vS.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=i==="out"?1:0}},barn:class extends dr{constructor(i){super(Lr.a,yS.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 dr{constructor(i){super(Lr.a,bS.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 dr{constructor(i){super(Lr.a,ES.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])})}},wheel:class extends dr{constructor(i){super(Lr.a,wS.a,{percent:0,transition:1,rect:new Float32Array([0,0,0,0])}),this.uniforms.option=Number(i)||1}}};class AS extends Xo{constructor(t){var e;super(t),this.filterType="",this.isConflict=!1,this.activeWhenConflict="prev",this.onTimeUpdate=({duration:o,delta:s})=>{var a;const l=s/o;if(this.filter){this.filter.percent=this.commonTimeNode.applyTimeFilter(l);const h=(a=this.timingTarget)===null||a===void 0?void 0:a.container.getBounds();h&&(this.filter.uniforms.uBoundRect=new Float32Array([h.x,h.y,h.width,h.height]))}l>=1&&this.timingTarget&&this.ctx.clock.setTimeout(()=>{this.removeFilter()},34)},this.onSeekToStart=()=>{this.timingTarget&&this.removeFilter()},this.onSeekToEnd=()=>{this.timingTarget&&this.removeFilter()},this.onDestroy=()=>{this.removeFilter()},this.commonTimeNode.on("timelineStart",()=>{this.filter&&this.timingTarget&&(this.timingTarget.container.filters&&this.timingTarget.container.filters.length!==0?this.timingTarget.container.filters.push(this.filter):this.timingTarget.container.filters=[this.filter])}),this.commonTimeNode.on("timeNodeDestroy",this.onDestroy),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];rv[o]&&(this.filter=new rv[o](s),this.filterType=`${o}-${s}`,this.filter&&(this.filter.transition=n))}}get modifyAttrKey(){return this.filterType}removeFilter(){var t;if(!(!((t=this.timingTarget)===null||t===void 0)&&t.container.filters)||!this.filter)return;const e=this.timingTarget.container.filters.findIndex(n=>n===this.filter);e>=0&&this.timingTarget.container.filters.splice(e,1)}}class MS extends Xo{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.commonTimeNode.on("timeNodeDestroy",this.onSeekToStart),this.createPath()}get modifyAttrKey(){return"motion"}createPath(){var t;const e=new Fs,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,l]=s.map(h=>Number(h));e.moveTo(a,l)}else if(o==="L"){const[a,l]=s.map(h=>Number(h));e.lineTo(a,l)}else if(o==="C"){const[a,l,h,u,p,y]=s.map(x=>Number(x));e.bezierCurveTo(a,l,h,u,p,y)}else if(o==="Z")e.closePath();else if(o==="E")console.warn("not implements");else if(o==="c"){const[a,l,h,u,p,y]=s.map(E=>Number(E)),x=e.currentPoint;e.bezierCurveTo(a+x.x,l+x.y,h+x.x,u+x.y,p+x.x,y+x.y)}else if(o==="l"){const a=e.currentPoint,[l,h]=s.map(u=>Number(u));e.lineTo(l+a.x,h+a.y)}else if(o==="m"){const a=e.currentPoint,[l,h]=s.map(u=>Number(u));e.moveTo(l+a.x,h+a.y)}}this.path=e}}class CS extends Xo{constructor(t){var e;super(t),this.isConflict=!0,this.activeWhenConflict="next",this.startVal=null,this.createVal=null,this.onTimelineStart=n=>{n.isReverse||this.updateCurrentValue()},this.onTimeUpdate=({duration:n,delta:r})=>{var o,s,a,l,h;const u=r/n,p={x:1,y:1};if(this.to){const y=(o=this.from)!==null&&o!==void 0?o:{x:(a=(s=this.startVal)===null||s===void 0?void 0:s.x)!==null&&a!==void 0?a:1,y:(h=(l=this.startVal)===null||l===void 0?void 0:l.y)!==null&&h!==void 0?h:1};p.x=y.x+(this.to.x-y.x)*u,p.y=y.y+(this.to.y-y.y)*u}else if(this.by){const y={x:this.by.x,y:this.by.y};p.x=1+(y.x-1)*u,p.y=1+(y.y-1)*u}this.timingTarget&&(this.timingTarget.scale=p)},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.onDestroy=()=>{this.createVal!==null&&this.timingTarget&&(this.timingTarget.scale=this.createVal)},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),this.commonTimeNode.on("timeNodeDestroy",this.onSeekToStart),!((e=this.timingTarget)===null||e===void 0)&&e.scale.x&&(this.createVal={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})}get modifyAttrKey(){return"scale"}updateCurrentValue(){this.timingTarget&&(this.current={x:this.timingTarget.scale.x,y:this.timingTarget.scale.y})}}class RS extends Xo{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=Xa(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 lh(this.json.from),this.to=new lh(this.json.to),this.by=new lh(this.json.by),this.target=new lh):(this.from=new ah(this.json.from),this.to=new ah(this.json.to),this.by=new ah(this.json.by),this.target=new ah),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),this.commonTimeNode.on("timeNodeDestroy",this.onSeekToStart)}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=Xa(this.timingTarget,t);e&&(this.currentColorString=e)}}}class IS extends Xo{constructor(t){super(t),this.isConflict=!1,this.activeWhenConflict="next",this.startVal=null,this.createVal=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.onTimeNodeCreate=()=>{var e;zo()((e=this.timingTarget)===null||e===void 0?void 0:e.r)&&(this.createVal=this.timingTarget.r)},this.onTimeNodeStart=()=>{var e;zo()((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.onDestroy=()=>{this.timingTarget&&this.createVal!==null&&(this.timingTarget.r=this.createVal),this.startVal=null},this.from=this.json.from,this.to=this.json.to,this.by=this.json.by,this.by?this.isConflict=!1:this.isConflict=!0,this.onTimeNodeCreate(),this.commonTimeNode.on("timeNodeStart",this.onTimeNodeStart),this.commonTimeNode.on("timeNodeCreate",this.onTimeNodeStart),this.commonTimeNode.on("timelineStart",this.onTimelineStart),this.commonTimeNode.on("timeUpdate",this.onTimeUpdate),this.commonTimeNode.on("timeNodeDestroy",this.onDestroy)}get modifyAttrKey(){return"rotate"}updateCurrentValue(){var t;this.currentVal=(t=this.timingTarget)===null||t===void 0?void 0:t.r}}class PS extends Xo{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 OS{constructor(t){this.runtimeNodeEventHub=new xi.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:l,iterateIndex:h,iterateId:u,isInInteractiveSeq:p,fromSeqId:y}=t;this.json=e,this.id=e.cMediaNode.ctn.id,this.commonTimeNode=new Qs({json:e.cMediaNode.ctn,isSub:r,eventHubs:{global:o,runtime:this.runtimeNodeEventHub},ctx:s,parent:a,isIterate:n,iterateType:l,iterateIndex:h,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)}}function wc(i){return function(t){var e;return!!(!((e=t)===null||e===void 0)&&e.cBhvr)}(i)?i.cBhvr.ctn:function(t){var e,n;return!!(!((n=(e=t)===null||e===void 0?void 0:e.cMediaNode)===null||n===void 0)&&n.ctn)}(i)?i.cMediaNode.ctn:i.ctn}var NS=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};class Qs extends xi.a{constructor(t){var e,n;super(),this.uuid=cs(),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=(j=!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(j))}else this.startTimeLine(j)},this.updateTimeLine=j=>{const Z=j/(br.b.TARGET_FPMS||.06);this.timeDelta+=Z,this.duration-this.timeDelta<=Z&&(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=(j=!1)=>{(this.isTimeNodeEnd()||j)&&(this.isActive=!1,this.isSub&&this.destroy(),this.emitEndEvents())};const{isSub:r,isIterate:o,ctx:s,eventHubs:a,parent:l,json:h,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=l,this.json=h,this.ctx=s,this.iterateIndex=y,this.eventHubs=a,this.iterateType=u,this.iterateId=p,this.tmFilter=(n=(e=h.tmFilter)===null||e===void 0?void 0:e.split(";").map(j=>j.split(",").map(Z=>parseFloat(Z.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(),h.childTnLst&&this.createChildren(h.childTnLst),this.startConds=new Wa(this.json.id||"",h.stCondLst,a,this.ctx),this.endConds=new Wa(this.json.id||"",h.endCondLst,a,this.ctx),h.endSync&&(this.endSync=new Wa(this.json.id||"",[h.endSync],a,this.ctx),this.endSync.on("active",()=>{var j;this.json.nodeType==="interactiveSeq"&&(this.isActive=!1,this.shouldSeekOnStart=!0,this.emit("timeNodeEndSync"),(j=this.endSync)===null||j===void 0||j.reset())})),this.startConds.on("active",j=>{this.isActive||(this.shouldSeekOnStart&&(this.shouldSeekOnStart=!1,this.seekToStart()),this.handleActive(j))}),this.endConds.on("active",()=>{this.handleEndCond(),this.children.forEach(j=>j.commonTimeNode.handleEndCond())}),this.parentTimeNode&&this.parentTimeNode.on("timeNodeStart",()=>{this.applyCount=0}),this.isSub&&this.json.masterRel==="nextClick"){const j="shape slide onNext"+this.fromSeqId;this.startConds.addCond({event:j})}this.json.iterate&&this.isIterate===!1&&this.createIterateShadow()}createIterateShadow(){const t=cs();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 Qs({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 YE(r):t.type==="par"?n=new ov(r):t.type==="set"?n=new Sc(r):t.type==="anim"?n=new qE(r):t.type==="animEffect"?n=new AS(r):t.type==="animMotion"?n=new MS(r):t.type==="animScale"?n=new CS(r):t.type==="animClr"?n=new RS(r):t.type==="animRot"?n=new IS(r):t.type==="cmd"?n=new PS(r):t.type==="audio"&&(n=new OS(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(o){return wc(o).presetOrder}function n(o){return/^slide/.test(o)?"slide":/^layout/.test(o)?"layout":/^master/.test(o)?"master":"unknow"}const r=["master","layout","slide","unknow"];t&&t[0]&&e(t[0])?[...t].sort((o,s)=>{var a,l,h,u;const p=wc(o).id,y=wc(s).id;if(p&&y){const x=n(p),E=n(y);return x===E?((a=e(o))!==null&&a!==void 0?a:0)-((l=e(s))!==null&&l!==void 0?l:0):r.indexOf(x)-r.indexOf(E)}return((h=e(o))!==null&&h!==void 0?h:0)-((u=e(s))!==null&&u!==void 0?u:0)}).forEach(o=>{const s=this.createTimeNode(o,!1);s&&(this.bindCommonTimeNodeEvent(s),this.children.push(s))}):t.forEach(o=>{const s=this.createTimeNode(o,!1);s&&(this.bindCommonTimeNodeEvent(s),this.children.push(s))})}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(Ke.animateEnd),this.ctx.ticker.remove(this.updateTimeLine)):this.duration>t&&(this.ctx.eventHub.emit(Ke.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(Ke.animateStart),this.updateTimeLine(0),this.ctx.ticker.add(this.updateTimeLine))}startIterate(){return NS(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=>zo()(e[0])&&zo()(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(l=>l.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(Ke.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 ov extends xi.a{constructor(t){super(),this.isRunning=!1,this.runtimeNodeEventHub=new xi.a;const{json:e,iterateType:n,isIterate:r,isSub:o,parent:s,ctx:a,eventHub:l,iterateIndex:h,iterateId:u,isInInteractiveSeq:p,fromSeqId:y}=t;this.id=e.ctn.id,this.json=e,this.ctx=a,this.isIterate=r,this.globalEventHub=l,this.commonTimeNode=new Qs({json:e.ctn,isSub:o,eventHubs:{global:l,runtime:this.runtimeNodeEventHub},ctx:a,parent:s,isIterate:!1,iterateType:n,iterateIndex:h,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")),this.commonTimeNode.json.presetClass==="exit"&&this.commonTimeNode.children.length>=1&&this.commonTimeNode.children[this.commonTimeNode.children.length-1]instanceof Sc&&this.commonTimeNode.children.forEach(x=>{x instanceof Sc||typeof x.onSeekToStart!="function"||x.onSeekToStart()})})}}var LS=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};class DS{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 ov({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,l;return((s=o.json)===null||s===void 0?void 0:s.type)==="seq"&&((l=(a=o.json)===null||a===void 0?void 0:a.ctn)===null||l===void 0?void 0:l.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 LS(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 sv=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};class FS extends Ec{constructor(t,e,n,r){super({id:"stage",width:t.width,height:t.height,type:"Container",children:t.children},e,{parentGlobalPos:n},r),this.isRendered=!1,this.isTimingStartValueCollected=!1,this.json=t,this.json.smartArtShapeList&&(e.smartArtShapeList=this.json.smartArtShapeList),e.hasBackgroundFillShape=this.detectUseBackgroundFill(this.json),this.container.visible=!1,this.ctx=e;const o=new er;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(Ke.requestPrevSlide,t)}),this.ctx.timingEventHub.on("c:next slide",(t,e)=>{this.ctx.eventHub.emit(Ke.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(()=>sv(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 DS(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(Ke.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(Ke.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 sv(this,void 0,void 0,function*(){const r=this.ctx.medias[t];r&&(e?n?(yield ih(()=>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 BS{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 US=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};const kS=i=>new Promise(t=>setTimeout(t,i));class GS extends xi.a{constructor(t,e,n){super(),this.slideIndex=t,this.taskId=e,this.logger=n,this.uuid=cs(),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",Ai.transform(e),this.slideIndex)}))}applyAll(){return US(this,void 0,void 0,function*(){for(;!this.tasks.every(t=>t.state==="finish");)if(this.tasks.some(t=>t.state==="running"))yield kS(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 Ys(()=>t.fn.apply(null),6e4))===fo)throw new Ai(nr.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 Ai(nr.RuntimeError,`subtask ${t.name} error. ${e}`),t.state="error",this.logger.error(`${e} ${e.stack}`,this.taskId),this.emit("task-error",Ai.transform(n),this.slideIndex);break}}}}!this.isCancel&&this.tasks.every(t=>t.state==="finish")&&this.emit("task-finish")})}}var HS=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})};class go{constructor(t,e){if(this.renderer=t,this.localStorage=e,this.outputData=new Map,this.loadingSdfKeys=new Set,!go.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>`,vw=function(i,t){var e=i[t];return Ne.isArray(arguments[2])||Ne.isObject(arguments[2])?new dw(i,t,arguments[2]):Ne.isNumber(e)?Ne.isNumber(arguments[2])&&Ne.isNumber(arguments[3])?Ne.isNumber(arguments[4])?new Fc(i,t,arguments[2],arguments[3],arguments[4]):new Fc(i,t,arguments[2],arguments[3]):Ne.isNumber(arguments[4])?new Sh(i,t,{min:arguments[2],max:arguments[3],step:arguments[4]}):new Sh(i,t,{min:arguments[2],max:arguments[3]}):Ne.isString(e)?new pw(i,t):Ne.isFunction(e)?new Lv(i,t,""):Ne.isBoolean(e)?new Iv(i,t):null},_w=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(i){setTimeout(i,1e3/60)},yw=function(){function i(){Vr(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 Wr(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}();mw(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 Qa=function(){try{return!!window.localStorage}catch{return!1}}(),wh=void 0,Fv=!0,na=void 0,Uc=!1,Bv=[],li=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&&Bv.push(this),n.resizable=Ne.isUndefined(n.parent)&&n.resizable,n.autoPlace&&Ne.isUndefined(n.scrollable)&&(n.scrollable=!0);var r,o=Qa&&localStorage.getItem(ia(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,jc(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){Qa&&(o=u,u?de.bind(window,"unload",s):de.unbind(window,"unload",s),localStorage.setItem(ia(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),Qa&&o){e.useLocalStorage=!0;var l=localStorage.getItem(ia(this,"gui"));l&&(n.load=JSON.parse(l))}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 h=document.createTextNode(n.name);de.addClass(h,"controller-name"),a=kc(e,h),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)&&(Fv&&(na=document.createElement("div"),de.addClass(na,"dg"),de.addClass(na,i.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(na),Fv=!1),na.appendChild(this.domElement),de.addClass(this.domElement,i.CLASS_AUTO_PLACE)),this.parent||jc(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&&bw(this),s=function(){Qa&&localStorage.getItem(ia(e,"isLocal"))==="true"&&localStorage.setItem(ia(e,"gui"),JSON.stringify(e.getSaveObject()))},this.saveToLocalStorageIfPossible=s,n.parent||((r=e.getRoot()).width+=1,Ne.defer(function(){r.width-=1}))};function kc(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 Uv(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 kv(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 $a(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 Bc(t,e);else{var o=[t,e].concat(n.factoryArgs);r=vw.apply(i,o)}n.before instanceof vs&&(n.before=n.before.__li),kv(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 l=kc(i,a,n.before);return de.addClass(l,li.CLASS_CONTROLLER_ROW),r instanceof Bc?de.addClass(l,"color"):de.addClass(l,uw(r.getValue())),function(h,u,p){if(p.__li=u,p.__gui=h,Ne.extend(p,{options:function(E){if(arguments.length>1){var A=p.__li.nextElementSibling;return p.remove(),$a(h,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(),$a(h,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 Fc){var y=new Sh(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 j=Array.prototype.slice.call(arguments);return C.apply(y,j),A.apply(p,j)}}),de.addClass(u,"has-slider"),p.domElement.insertBefore(y.domElement,p.domElement.firstElementChild)}else if(p instanceof Sh){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 j=$a(h,p.object,p.property,{before:p.__li.nextElementSibling,factoryArgs:[p.__min,p.__max,p.__step]});return j.name(A),C&&j.listen(),j}return E};p.min=Ne.compose(x,p.min),p.max=Ne.compose(x,p.max)}else p instanceof Iv?(de.bind(u,"click",function(){de.fakeEvent(p.__checkbox,"click")}),de.bind(p.__checkbox,"click",function(E){E.stopPropagation()})):p instanceof Lv?(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 Bc&&(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 h.getRoot().__preset_select&&p.isModified()&&Gc(h.getRoot(),!0),E},p.setValue)}(i,l,r),i.__controllers.push(r),r}function ia(i,t){return document.location.href+"."+t}function Hc(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 Gv(i,t){t.style.display=i.useLocalStorage?"block":"none"}function xw(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=" ",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){Hc(i,p,p===i.preset)}):Hc(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),Qa){var a=document.getElementById("dg-local-explain"),l=document.getElementById("dg-local-storage");document.getElementById("dg-save-locally").style.display="block",localStorage.getItem(ia(0,"isLocal"))==="true"&&l.setAttribute("checked","checked"),Gv(i,a),de.bind(l,"change",function(){i.useLocalStorage=!i.useLocalStorage,Gv(i,a)})}var h=document.getElementById("dg-new-constructor");de.bind(h,"keydown",function(u){!u.metaKey||u.which!==67&&u.keyCode!==67||wh.hide()}),de.bind(e,"click",function(){h.innerHTML=JSON.stringify(i.getSaveObject(),void 0,2),wh.show(),h.focus(),h.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 bw(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,li.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,li.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 jc(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 Ah(i,t){var e={};return Ne.each(i.__rememberedObjects,function(n,r){var o={},s=i.__rememberedObjectIndecesToControllers[r];Ne.each(s,function(a,l){o[l]=t?a.initialValue:a.getValue()}),e[r]=o}),e}li.toggleHide=function(){Uc=!Uc,Ne.each(Bv,function(i){i.domElement.style.display=Uc?"none":""})},li.CLASS_AUTO_PLACE="a",li.CLASS_AUTO_PLACE_CONTAINER="ac",li.CLASS_MAIN="main",li.CLASS_CONTROLLER_ROW="cr",li.CLASS_TOO_TALL="taller-than-window",li.CLASS_CLOSED="closed",li.CLASS_CLOSE_BUTTON="close-button",li.CLASS_CLOSE_TOP="close-top",li.CLASS_CLOSE_BOTTOM="close-bottom",li.CLASS_DRAG="drag",li.DEFAULT_WIDTH=245,li.TEXT_CLOSED="Close Controls",li.TEXT_OPEN="Open Controls",li._keydownHandler=function(i){document.activeElement.type==="text"||i.which!==72&&i.keyCode!==72||li.toggleHide()},de.bind(window,"keydown",li._keydownHandler,!1),Ne.extend(li.prototype,{add:function(i,t){return $a(this,i,t,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(i,t){return $a(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&&na.removeChild(this.domElement);var i=this;Ne.each(this.__folders,function(t){i.removeFolder(t)}),de.unbind(window,"keydown",li._keydownHandler,!1),Uv(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 li(t);this.__folders[i]=e;var n=kc(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],Uv(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,li.CLASS_TOO_TALL),i.__ul.style.height=window.innerHeight-t-20+"px"):(de.removeClass(i.domElement,li.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(wh)&&((wh=new yw).domElement.innerHTML=gw),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&&xw(i),i.__rememberedObjects.indexOf(t)===-1&&i.__rememberedObjects.push(t)}),this.autoPlace&&jc(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]=Ah(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]=Ah(this),Gc(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(i){this.load.remembered||(this.load.remembered={},this.load.remembered.Default=Ah(this,!0)),this.load.remembered[i]=Ah(this),this.preset=i,Hc(this,i,!0),this.saveToLocalStorageIfPossible()},revert:function(i){Ne.each(this.__controllers,function(t){this.getRoot().load.remembered?kv(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&&_w.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 Tw=li,Ew=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,maxFPS:this.player.config.maxFPS})},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"maxFPS",{get:function(){return this.player.config.maxFPS},set:function(t){this.player.updateConfig({maxFPS:t,minFPS:this.player.config.minFPS})},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}(),Sw=function(){function i(t,e){var n;this.config=new Ew(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 Tw({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}(),ww=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}(),Aw=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}(),Mw=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}(),zc=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})},Vc=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(l){return function(h){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}}([l,h])}}},Cw=function(){function i(){var t=this;this.logList=[],this.checkTimer=null,this.retryTimes=0,this.enable=!1,this.uploadLoggerGlobalEvent=function(e){e.data.type==="@slide/_upload_log_"&&t.start()},this.config={checkTime:3e3,buffer:300},window.addEventListener("message",this.uploadLoggerGlobalEvent),this.start()}return i.prototype.start=function(){return zc(this,void 0,void 0,function(){var t=this;return Vc(this,function(e){return clearInterval(this.checkTimer),this.checkTimer=setInterval(function(){return zc(t,void 0,void 0,function(){return Vc(this,function(n){switch(n.label){case 0:return[4,this.uploadLog()];case 1:return n.sent(),[2]}})})},this.config.checkTime),[2]})})},i.prototype.pause=function(){clearInterval(this.checkTimer)},i.prototype.addLog=function(t,e,n,r){this.logList.push({level:e,taskId:n,message:t,randomId:r})},i.prototype.destroy=function(){clearInterval(this.checkTimer),window.removeEventListener("message",this.uploadLoggerGlobalEvent)},i.prototype.uploadLog=function(t){return t===void 0&&(t=!1),zc(this,void 0,void 0,function(){var e,n,r,o=this;return Vc(this,function(s){switch(s.label){case 0:if(!(this.logList.length>=this.config.buffer||t))return[2];e=this.logList.splice(0),n=function(){o.logList=e.concat(o.logList),o.retryTimes>3&&o.pause(),o.retryTimes+=1},s.label=1;case 1:return s.trys.push([1,3,,4]),[4,fetch("https://netless-ppt-plugin-dev.cn-hangzhou.log.aliyuncs.com/logstores/netless-ppt-plugin-dev/track",{method:"POST",headers:{"x-log-apiversion":"0.6.0","Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify({__topic__:"netless-ppt-plugin-dev",__source__:"netless-ppt-plugin-dev",__logs__:e})})];case 2:return s.sent().ok?this.retryTimes=0:n(),[3,4];case 3:return r=s.sent(),console.warn(r),n(),[3,4];case 4:return[2]}})})},i.prototype.setEnable=function(t){this.enable!==t&&(t?this.start():this.pause())},i}(),Rw=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})},Iw=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(l){return function(h){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}}([l,h])}}};function Pw(i,t,e){return Rw(this,void 0,void 0,function(){var n,r,o,s;return Iw(this,function(a){switch(a.label){case 0:return n=document.createElement("div"),(r=new io({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 Ow=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)}}(),_s=function(){return(_s=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)},Nw=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(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((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(l){return function(h){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}}([l,h])}}},Lw=window.ResizeObserver||rw,Mh=function(i){return new Promise(function(t){return setTimeout(t,i)})};function Dw(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,Mh(50)]:[3,3];case 2:return n.sent(),e=Date.now(),[3,1];case 3:return[2]}})})}var hr={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"},Hv={taskId:"",url:"",currentSlideIndex:-1,mainSeqStep:-1,mainSeqState:null,mediaState:Object.create(null),interactiveSeqState:Object.create(null)},Wc="";try{Wc="1.2.2-alpha.6"}catch{Wc="dev -"}var pr=null;try{(pr=I.createInstance({name:"__slide_local_log__",driver:I.INDEXEDDB,version:1})).ready(function(i){}).catch(function(i){})}catch{}var io=function(i){function t(r){var o=i.call(this)||this;return o.iosResetCache=[],o.needClearCacheImage=!1,o.version=Wc,o.__slideState=cv()(Hv),o.userInputTime=0,o.isSyncingSlideState=!1,o.frozenTaskManager=new Mw,o.randomId=M(),o.resize=!1,o.isAnimating=!1,o.renderingTaskManager=new lw,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 Lw(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 lv,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,l=a.recoverBy,h=a.payload;if(!h)return;l==="renderOtherPage"&&h.slideIndex?o.doRenderSlide(h.slideIndex).catch(function(u){o.logger.error(u,o.taskId)}):l==="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,l,h,u,p,y=this;return Ki(this,function(x){switch(x.label){case 0:return zo()(s.incrId)&&(s.incrId&&s.incrId-this._receiveIncrId!=1&&this.emit(hr.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"?((l=this.player)===null||l===void 0||l.setMediaState(s.id,!0),this.__slideState.mediaState[s.id]=s.state):s.type==="mediaPause"?((h=this.player)===null||h===void 0||h.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,l;return Ki(this,function(h){return this.player?((a=this.player.prevSlideIndex)>=1&&(!((l=this.config.navigatorDelegate)===null||l===void 0)&&l.gotoPage?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,l;return Ki(this,function(h){return this.player?((a=this.player.nextSlideIndex)<=this.slideCount&&(!((l=this.config.navigatorDelegate)===null||l===void 0)&&l.gotoPage?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.tracker=function(s){r.whiteTracker&&r.whiteTracker.commit({name:s.name,reason:s.reason,result:s.result,payload:_s(_s({},s.payload),{slideId:o.randomId,taskId:o.taskId})},{slideVersion:o.version||""})},t.trackLogger.setEnable(!!o.config.enableTracking),o.logger={info:function(s,a){var l;t.appendLogString("INFO - "+new Date().toISOString()+" - {"+o.randomId+"}["+a+"] "+s+`
|
|
7948
|
+
`));var Qa=function(){try{return!!window.localStorage}catch{return!1}}(),wh=void 0,Fv=!0,na=void 0,Uc=!1,Bv=[],li=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&&Bv.push(this),n.resizable=Ne.isUndefined(n.parent)&&n.resizable,n.autoPlace&&Ne.isUndefined(n.scrollable)&&(n.scrollable=!0);var r,o=Qa&&localStorage.getItem(ia(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,jc(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){Qa&&(o=u,u?de.bind(window,"unload",s):de.unbind(window,"unload",s),localStorage.setItem(ia(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),Qa&&o){e.useLocalStorage=!0;var l=localStorage.getItem(ia(this,"gui"));l&&(n.load=JSON.parse(l))}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 h=document.createTextNode(n.name);de.addClass(h,"controller-name"),a=kc(e,h),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)&&(Fv&&(na=document.createElement("div"),de.addClass(na,"dg"),de.addClass(na,i.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(na),Fv=!1),na.appendChild(this.domElement),de.addClass(this.domElement,i.CLASS_AUTO_PLACE)),this.parent||jc(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&&bw(this),s=function(){Qa&&localStorage.getItem(ia(e,"isLocal"))==="true"&&localStorage.setItem(ia(e,"gui"),JSON.stringify(e.getSaveObject()))},this.saveToLocalStorageIfPossible=s,n.parent||((r=e.getRoot()).width+=1,Ne.defer(function(){r.width-=1}))};function kc(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 Uv(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 kv(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 $a(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 Bc(t,e);else{var o=[t,e].concat(n.factoryArgs);r=vw.apply(i,o)}n.before instanceof vs&&(n.before=n.before.__li),kv(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 l=kc(i,a,n.before);return de.addClass(l,li.CLASS_CONTROLLER_ROW),r instanceof Bc?de.addClass(l,"color"):de.addClass(l,uw(r.getValue())),function(h,u,p){if(p.__li=u,p.__gui=h,Ne.extend(p,{options:function(E){if(arguments.length>1){var A=p.__li.nextElementSibling;return p.remove(),$a(h,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(),$a(h,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 Fc){var y=new Sh(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 j=Array.prototype.slice.call(arguments);return C.apply(y,j),A.apply(p,j)}}),de.addClass(u,"has-slider"),p.domElement.insertBefore(y.domElement,p.domElement.firstElementChild)}else if(p instanceof Sh){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 j=$a(h,p.object,p.property,{before:p.__li.nextElementSibling,factoryArgs:[p.__min,p.__max,p.__step]});return j.name(A),C&&j.listen(),j}return E};p.min=Ne.compose(x,p.min),p.max=Ne.compose(x,p.max)}else p instanceof Iv?(de.bind(u,"click",function(){de.fakeEvent(p.__checkbox,"click")}),de.bind(p.__checkbox,"click",function(E){E.stopPropagation()})):p instanceof Lv?(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 Bc&&(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 h.getRoot().__preset_select&&p.isModified()&&Gc(h.getRoot(),!0),E},p.setValue)}(i,l,r),i.__controllers.push(r),r}function ia(i,t){return document.location.href+"."+t}function Hc(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 Gv(i,t){t.style.display=i.useLocalStorage?"block":"none"}function xw(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=" ",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){Hc(i,p,p===i.preset)}):Hc(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),Qa){var a=document.getElementById("dg-local-explain"),l=document.getElementById("dg-local-storage");document.getElementById("dg-save-locally").style.display="block",localStorage.getItem(ia(0,"isLocal"))==="true"&&l.setAttribute("checked","checked"),Gv(i,a),de.bind(l,"change",function(){i.useLocalStorage=!i.useLocalStorage,Gv(i,a)})}var h=document.getElementById("dg-new-constructor");de.bind(h,"keydown",function(u){!u.metaKey||u.which!==67&&u.keyCode!==67||wh.hide()}),de.bind(e,"click",function(){h.innerHTML=JSON.stringify(i.getSaveObject(),void 0,2),wh.show(),h.focus(),h.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 bw(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,li.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,li.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 jc(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 Ah(i,t){var e={};return Ne.each(i.__rememberedObjects,function(n,r){var o={},s=i.__rememberedObjectIndecesToControllers[r];Ne.each(s,function(a,l){o[l]=t?a.initialValue:a.getValue()}),e[r]=o}),e}li.toggleHide=function(){Uc=!Uc,Ne.each(Bv,function(i){i.domElement.style.display=Uc?"none":""})},li.CLASS_AUTO_PLACE="a",li.CLASS_AUTO_PLACE_CONTAINER="ac",li.CLASS_MAIN="main",li.CLASS_CONTROLLER_ROW="cr",li.CLASS_TOO_TALL="taller-than-window",li.CLASS_CLOSED="closed",li.CLASS_CLOSE_BUTTON="close-button",li.CLASS_CLOSE_TOP="close-top",li.CLASS_CLOSE_BOTTOM="close-bottom",li.CLASS_DRAG="drag",li.DEFAULT_WIDTH=245,li.TEXT_CLOSED="Close Controls",li.TEXT_OPEN="Open Controls",li._keydownHandler=function(i){document.activeElement.type==="text"||i.which!==72&&i.keyCode!==72||li.toggleHide()},de.bind(window,"keydown",li._keydownHandler,!1),Ne.extend(li.prototype,{add:function(i,t){return $a(this,i,t,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(i,t){return $a(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&&na.removeChild(this.domElement);var i=this;Ne.each(this.__folders,function(t){i.removeFolder(t)}),de.unbind(window,"keydown",li._keydownHandler,!1),Uv(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 li(t);this.__folders[i]=e;var n=kc(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],Uv(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,li.CLASS_TOO_TALL),i.__ul.style.height=window.innerHeight-t-20+"px"):(de.removeClass(i.domElement,li.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(wh)&&((wh=new yw).domElement.innerHTML=gw),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&&xw(i),i.__rememberedObjects.indexOf(t)===-1&&i.__rememberedObjects.push(t)}),this.autoPlace&&jc(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]=Ah(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]=Ah(this),Gc(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(i){this.load.remembered||(this.load.remembered={},this.load.remembered.Default=Ah(this,!0)),this.load.remembered[i]=Ah(this),this.preset=i,Hc(this,i,!0),this.saveToLocalStorageIfPossible()},revert:function(i){Ne.each(this.__controllers,function(t){this.getRoot().load.remembered?kv(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&&_w.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 Tw=li,Ew=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,maxFPS:this.player.config.maxFPS})},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"maxFPS",{get:function(){return this.player.config.maxFPS},set:function(t){this.player.updateConfig({maxFPS:t,minFPS:this.player.config.minFPS})},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}(),Sw=function(){function i(t,e){var n;this.config=new Ew(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 Tw({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}(),ww=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}(),Aw=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}(),Mw=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}(),zc=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})},Vc=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(l){return function(h){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}}([l,h])}}},Cw=function(){function i(){var t=this;this.logList=[],this.checkTimer=null,this.retryTimes=0,this.enable=!1,this.uploadLoggerGlobalEvent=function(e){e.data.type==="@slide/_upload_log_"&&t.start()},this.config={checkTime:3e3,buffer:300},window.addEventListener("message",this.uploadLoggerGlobalEvent),this.start()}return i.prototype.start=function(){return zc(this,void 0,void 0,function(){var t=this;return Vc(this,function(e){return clearInterval(this.checkTimer),this.checkTimer=setInterval(function(){return zc(t,void 0,void 0,function(){return Vc(this,function(n){switch(n.label){case 0:return[4,this.uploadLog()];case 1:return n.sent(),[2]}})})},this.config.checkTime),[2]})})},i.prototype.pause=function(){clearInterval(this.checkTimer)},i.prototype.addLog=function(t,e,n,r){this.logList.push({level:e,taskId:n,message:t,randomId:r})},i.prototype.destroy=function(){clearInterval(this.checkTimer),window.removeEventListener("message",this.uploadLoggerGlobalEvent)},i.prototype.uploadLog=function(t){return t===void 0&&(t=!1),zc(this,void 0,void 0,function(){var e,n,r,o=this;return Vc(this,function(s){switch(s.label){case 0:if(!(this.logList.length>=this.config.buffer||t))return[2];e=this.logList.splice(0),n=function(){o.logList=e.concat(o.logList),o.retryTimes>3&&o.pause(),o.retryTimes+=1},s.label=1;case 1:return s.trys.push([1,3,,4]),[4,fetch("https://netless-ppt-plugin-dev.cn-hangzhou.log.aliyuncs.com/logstores/netless-ppt-plugin-dev/track",{method:"POST",headers:{"x-log-apiversion":"0.6.0","Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify({__topic__:"netless-ppt-plugin-dev",__source__:"netless-ppt-plugin-dev",__logs__:e})})];case 2:return s.sent().ok?this.retryTimes=0:n(),[3,4];case 3:return r=s.sent(),console.warn(r),n(),[3,4];case 4:return[2]}})})},i.prototype.setEnable=function(t){this.enable!==t&&(t?this.start():this.pause())},i}(),Rw=function(i,t,e,n){return new(e||(e=Promise))(function(r,o){function s(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((n=n.apply(i,t||[])).next())})},Iw=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(l){return function(h){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}}([l,h])}}};function Pw(i,t,e){return Rw(this,void 0,void 0,function(){var n,r,o,s;return Iw(this,function(a){switch(a.label){case 0:return n=document.createElement("div"),(r=new io({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 Ow=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)}}(),_s=function(){return(_s=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)},Nw=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(h){try{l(n.next(h))}catch(u){o(u)}}function a(h){try{l(n.throw(h))}catch(u){o(u)}}function l(h){var u;h.done?r(h.value):(u=h.value,u instanceof e?u:new e(function(p){p(u)})).then(s,a)}l((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(l){return function(h){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}}([l,h])}}},Lw=window.ResizeObserver||rw,Mh=function(i){return new Promise(function(t){return setTimeout(t,i)})};function Dw(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,Mh(50)]:[3,3];case 2:return n.sent(),e=Date.now(),[3,1];case 3:return[2]}})})}var hr={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"},Hv={taskId:"",url:"",currentSlideIndex:-1,mainSeqStep:-1,mainSeqState:null,mediaState:Object.create(null),interactiveSeqState:Object.create(null)},Wc="";try{Wc="1.2.1"}catch{Wc="dev -"}var pr=null;try{(pr=I.createInstance({name:"__slide_local_log__",driver:I.INDEXEDDB,version:1})).ready(function(i){}).catch(function(i){})}catch{}var io=function(i){function t(r){var o=i.call(this)||this;return o.iosResetCache=[],o.needClearCacheImage=!1,o.version=Wc,o.__slideState=cv()(Hv),o.userInputTime=0,o.isSyncingSlideState=!1,o.frozenTaskManager=new Mw,o.randomId=M(),o.resize=!1,o.isAnimating=!1,o.renderingTaskManager=new lw,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 Lw(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 lv,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,l=a.recoverBy,h=a.payload;if(!h)return;l==="renderOtherPage"&&h.slideIndex?o.doRenderSlide(h.slideIndex).catch(function(u){o.logger.error(u,o.taskId)}):l==="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,l,h,u,p,y=this;return Ki(this,function(x){switch(x.label){case 0:return zo()(s.incrId)&&(s.incrId&&s.incrId-this._receiveIncrId!=1&&this.emit(hr.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"?((l=this.player)===null||l===void 0||l.setMediaState(s.id,!0),this.__slideState.mediaState[s.id]=s.state):s.type==="mediaPause"?((h=this.player)===null||h===void 0||h.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,l;return Ki(this,function(h){return this.player?((a=this.player.prevSlideIndex)>=1&&(!((l=this.config.navigatorDelegate)===null||l===void 0)&&l.gotoPage?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,l;return Ki(this,function(h){return this.player?((a=this.player.nextSlideIndex)<=this.slideCount&&(!((l=this.config.navigatorDelegate)===null||l===void 0)&&l.gotoPage?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.tracker=function(s){r.whiteTracker&&r.whiteTracker.commit({name:s.name,reason:s.reason,result:s.result,payload:_s(_s({},s.payload),{slideId:o.randomId,taskId:o.taskId})},{slideVersion:o.version||""})},t.trackLogger.setEnable(!!o.config.enableTracking),o.logger={info:function(s,a){var l;t.appendLogString("INFO - "+new Date().toISOString()+" - {"+o.randomId+"}["+a+"] "+s+`
|
|
7949
7949
|
`),t.trackLogger.addLog(s,"info",a,o.randomId);var h=(l=o.config.logger)===null||l===void 0?void 0:l.info;h&&h("["+a+"] "+s)},warn:function(s,a){var l;t.appendLogString("WARN - "+new Date().toISOString()+" - {"+o.randomId+"}["+a+"] "+s+`
|
|
7950
7950
|
`),t.trackLogger.addLog(s,"warn",a,o.randomId);var h=(l=o.config.logger)===null||l===void 0?void 0:l.warn;h&&h("["+a+"] "+s)},error:function(s,a){var l;t.appendLogString("ERROR - "+new Date().toISOString()+" - {"+o.randomId+"}["+a+"] "+s+`
|
|
7951
7951
|
`),t.trackLogger.addLog(s,"error",a,o.randomId);var h=(l=o.config.logger)===null||l===void 0?void 0:l.error;h&&h("["+a+"] "+s)}},o.logger.info("new slide with clientId: "+o.config.clientId+", version: "+o.version,o.taskId),o.tracker({name:"initSlide",result:"",reason:"",payload:{taskId:o.taskId}}),o.anchor=o.config.anchor,o.syncQueue=new ww(o.receiveSyncHandler),o.lock=new Aw(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(hr.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,l=s.task,h=Ai.transform(a);h.errorType===nr.RuntimeWarn?o.logger.warn(h.message,o.taskId):o.logger.error(h.message,o.taskId),o.isLoading=!1,o.reportError(h,l.slideIndex)}),window.addEventListener("__slide_ref__",o.handleSlideRef),o.resizeView=uv()(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=uv()(o.handleViewClick,300),o.player.errorChannel.on("error",function(s,a){var l=Ai.transform(s);l.errorType===nr.RuntimeWarn?o.logger.warn(l.message,o.taskId):o.logger.error(l.message,o.taskId),o.isLoading=!1,o.reportError(s,a),o.tracker({name:"slideError",reason:l.errorMsg,result:"",payload:{code:l.errorType}})}),window.addEventListener("message",o.recoverHandler),t.volumeAdjuster.on("update",o._updateVolumeByStaticAdjuster),o.volumeAdjuster.volume=t.volumeAdjuster.volume,o}var e,n;return Ow(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,pr==null?void 0:pr.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,l,h;return Ki(this,function(u){switch(u.label){case 0:return t.remoteLogAddress=r,[4,t.flushLog(!0)];case 1:if(u.sent(),!pr)return[3,13];o=[],u.label=2;case 2:return u.trys.push([2,4,,5]),[4,pr.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];l=a[s],l.replace("run_time_log_",""),h="",u.label=7;case 7:return u.trys.push([7,9,,10]),[4,pr.getItem(l)];case 8:return h=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:h})})];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(hr.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.trackLogger.uploadLog(!0)},t.prototype.initSlideConfig=function(r){return r.timestamp&&(this.timestamp=r.timestamp),r.rtcAudio&&(lr.RtcAudioClazz=r.rtcAudio),this.mode=r.mode,this.anchor=r.anchor,this.anchor.appendChild(this.frame),this.enableGlobalClick=!ji()(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,l=this,h=new lr({mode:this.mode,useLocalCache:!!ji()(this.config.useLocalCache)||this.config.useLocalCache,logger:this.logger,resourceTimeout:ji()(this.config.resourceTimeout)?15e3:this.config.resourceTimeout,loadDelegate:this.config.loaderDelegate,volumeAdjuster:this.volumeAdjuster,urlInterrupter:this.config.urlInterrupter,tracker:this.tracker},r.renderOptions);return h.setInteractive(this.interactive),h.updateConfig(r.renderOptions||{}),h.on(Ke.renderStart,function(u){l.isLoading=!0,l.emit(hr.renderStart,u),window.postMessage({type:"@slide/_render_start_",taskId:l.taskId,index:u},"*")}),h.on(Ke.renderEnd,function(u){l.isLoading=!1,l.player&&(l.designHeight=l.player.designHeight,l.designWidth=l.player.designWidth,l.cacheImage.style.width=l.player.designWidth+"px",l.cacheImage.style.height=l.player.designHeight+"px",l._slideCount=l.player.slideCount),l.emit(hr.renderEnd,u),window.postMessage({type:"@slide/_render_end_",taskId:l.taskId,index:u},"*")}),h.on(Ke.slideChange,function(u){l.__slideState.currentSlideIndex=u,l.emitStateChange(),l.emit(hr.slideChange,u)}),h.on(Ke.mainSeqStateChange,function(u){l.__slideState.mainSeqState=u,l.emitStateChange()}),h.on(Ke.mainSeqStepChange,function(u){l.__slideState.mainSeqStep=u,l.emitStateChange()}),h.on(Ke.interactiveSeqStateChange,function(u){var p=u.id,y=u.state;l.__slideState.interactiveSeqState[p]=y,l.emitStateChange()}),h.on(Ke.animateStart,function(){l.isAnimating!==!0&&(l.isAnimating=!0,l.emit(hr.animateStart))}),h.on(Ke.animateEnd,function(){l.isAnimating!==!1&&(l.isAnimating=!1,l.emit(hr.animateEnd))}),h.on(Ke.interactiveSeqAction,function(u){var p=u.action,y=u.seqId;l.emitSyncDispatch({slideIndex:l.__slideState.currentSlideIndex,type:"interactiveAnim",action:p,seqId:y}),l.emitStateChange()}),h.on(Ke.mainSeqStepStart,function(u){l.emit(hr.mainSeqStepStart,u)}),h.on(Ke.mainSeqStepEnd,function(u){l.emit(hr.mainSeqStepEnd,u)}),h.on(Ke.mediaPlay,function(u){var p,y=(p=l.__slideState.mediaState[u.id])!==null&&p!==void 0?p:{};y.type="play",y.time=l.timestamp()-1e3*u.time,l.__slideState.mediaState[u.id]=y,u._stateOnly?l.config.mode==="interactive"&&l.receiveSyncHandler({slideIndex:l.__slideState.currentSlideIndex,type:"mediaPlay",id:u.id,state:y}).catch(function(x){l.logger.error(x==null?void 0:x.message,l.taskId)}):l.emitSyncDispatch({slideIndex:l.__slideState.currentSlideIndex,type:"mediaPlay",id:u.id,state:y}),l.emitStateChange()}),h.on(Ke.mediaStop,function(u){delete l.__slideState.mediaState[u.id],l.emitStateChange()}),h.on(Ke.mediaPause,function(u){var p,y=(p=l.__slideState.mediaState[u.id])!==null&&p!==void 0?p:{};y.type="pause",y.time=u.time,l.__slideState.mediaState[u.id]=y,u._stateOnly?l.config.mode==="interactive"&&l.receiveSyncHandler({slideIndex:l.__slideState.currentSlideIndex,type:"mediaPause",id:u.id,state:y}).catch(function(x){l.logger.error(x==null?void 0:x.message,l.taskId)}):l.emitSyncDispatch({slideIndex:l.__slideState.currentSlideIndex,type:"mediaPause",id:u.id,state:y}),l.emitStateChange()}),h.on(Ke.mediaSeek,function(u){var p,y=(p=l.__slideState.mediaState[u.id])!==null&&p!==void 0?p:{};u.isPlaying?(y.type="play",y.time=l.timestamp()-1e3*u.time):(y.type="pause",y.time=u.time),l.__slideState.mediaState[u.id]=y,l.emitSyncDispatch({slideIndex:l.__slideState.currentSlideIndex,type:"mediaSeek",id:u.id,time:u.time,state:y}),l.emitStateChange()}),h.on(Ke.requestPrevSlide,function(u){l.handlePrevSlide(u)}),h.on(Ke.requestNextSlide,function(u){l.handleNextSlide(u)}),h.on(Ke.requestGotoSlide,function(u){var p;!((p=l.config.navigatorDelegate)===null||p===void 0)&&p.gotoPage?l.config.navigatorDelegate.gotoPage(u):l.handleGotoSlide(u)}),h.on(Ke.requestOpenUrl,function(u){var p;console.log(l.config.navigatorDelegate),!((p=l.config.navigatorDelegate)===null||p===void 0)&&p.openUrl&&l.config.navigatorDelegate.openUrl(u)}),h.on(Ke.fullscreenChange,function(u){var p,y=u.targetId,x=u.state;l.emitSyncDispatch({slideIndex:l.__slideState.currentSlideIndex,type:"mediaFullscreen",targetId:y,state:x});var E=(p=l.__slideState.mediaState[y])!==null&&p!==void 0?p:{};E.fullscreen=x,l.__slideState.mediaState[y]=E,l.emitStateChange()}),h.on(Ke.changeLocalFullscreenState,function(u){u.slideIndex===l.__slideState.currentSlideIndex?(u.targetId&&l.__slideState.mediaState[u.targetId]&&(l.__slideState.mediaState[u.targetId].fullscreen=u.status),l.emitStateChange()):l.logger.info("event slideIndex: "+u.slideIndex+", current slideIndex: "+l.__slideState.currentSlideIndex,l.taskId)}),(o=h.view)===null||o===void 0||o.addEventListener("touchend",this.handleViewTouchEnd),(s=h.view)===null||s===void 0||s.addEventListener("touchstart",this.handleViewTouchStart),(a=h.view)===null||a===void 0||a.addEventListener("click",this.handleViewClick),h.on(Ke.userInput,this.userInputHandle),h},t.prototype.createController=function(){this.player&&(this.playerController=new Sw(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,l=this.width,h=this.height;if(l>0&&h>0){var u=this.frameWidth/l,p=u*h;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 l,h=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=h.player)===null||p===void 0?void 0:p.currentIndex)===r.currentSlideIndex&&((y=h.player)===null||y===void 0?void 0:y.currentStage)},3e3)];case 3:return u.sent(),l=!1,Number.isInteger(r.mainSeqStep)&&r.mainSeqStep!==this.__slideState.mainSeqStep&&(l=!0,this.__slideState.mainSeqStep=r.mainSeqStep),r.mainSeqState&&r.mainSeqState!==this.__slideState.mainSeqState&&(l=!0,this.__slideState.mainSeqState=r.mainSeqState),l&&this.setMainSeqStep(this.__slideState.mainSeqStep,this.__slideState.mainSeqState==="idle"?"start":"end"),r.interactiveSeqState&&(this.initInteractiveSeq(r),this.__slideState.interactiveSeqState=r.interactiveSeqState),[4,Mh(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 l in r.mediaState){var h=r.mediaState[l],u=this.__slideState.mediaState[l];if((o=this.player)===null||o===void 0||o.syncFullscreenVideoState({targetId:l,state:!!h.fullscreen,slideIndex:this.slideState.currentSlideIndex}),!u||h.type!==u.type||h.time!==u.time)if(h.type==="play"){var p=(this.timestamp()-h.time)/1e3;(s=this.player)===null||s===void 0||s.setMediaState(l,!0,p)}else(a=this.player)===null||a===void 0||a.setMediaState(l,!1,h.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]:((lr.platform.isIOS()||lr.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 l,h;if(((h=(l=s.player)===null||l===void 0?void 0:l.view)===null||h===void 0?void 0:h.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=lr.platform.isLowGpuMemory()?15:30;return(lr.platform.isIOS()||lr.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,l,h=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,!((l=this==null?void 0:this.player)===null||l===void 0)&&l.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 h._renderSlide(r)},r,p),new Promise(function(y){h.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(hr.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. isLoading: "+this.isLoading+", player: "+!!this.player+", interactive: "+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(hr.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. isLoading: "+this.isLoading+", player: "+this.player+", interactive: "+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;!WS()(this.lastEmitedState,r)&&this.isSlideStateReady(r)&&(this.lastEmitedState=r,this.emit(hr.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=_s(_s({},r),{uuid:o,clientId:this.config.clientId});this.config.mode==="sync"&&(s.incrId=this.dispatchIncrId),this.emit(hr.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,l=this;return Ki(this,function(h){switch(h.label){case 0:return this.logger.info("frozen with player["+!!this.player+"]",this.taskId),this.tracker({name:"frozenSlide",reason:"",result:"",payload:{taskId:this.taskId}}),this.view&&this.player?[4,this.player.clock.waitUntil(function(){return!l.isLoading},6e4)]:[3,2];case 1:for(s in h.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]=_s(_s({},a),{frozenTime:this.timestamp()});h.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,l,h;return Ki(this,function(u){switch(u.label){case 0:if(this.logger.info("do release slide",this.taskId),this.tracker({name:"releaseSlide",reason:"",result:"",payload:{taskId: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=cv()(Hv),s.mediaState)(l=s.mediaState[a]).type==="play"&&(h=Math.max((o=l.frozenTime)!==null&&o!==void 0?o:0,l.time),l.time=this.timestamp()-(h-l.time),l.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,l=this;this.logger.info("do destroy slide",this.taskId),this.tracker({name:"destroySlide",reason:"",result:"",payload:{taskId:this.taskId}});var h=t.instances.findIndex(function(u){return u.randomId===l.randomId});h>=0&&t.instances.splice(h,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,Mh(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(){lr.clearLocalCache()},t.disposeLocalCache=function(){},e=t,t.preloadResource=Pw,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=Mc.get(o.hookPoint)||[];s.push(o),Mc.set(o.hookPoint,s)}(r)},t.volumeAdjuster=new lv,t.trackLogger=new Cw,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,l,h,u;return Ki(e,function(p){switch(p.label){case 0:return[4,t.flushLog(!0)];case 1:if(p.sent(),!pr)return[3,12];o=[],p.label=2;case 2:return p.trys.push([2,4,,5]),[4,pr.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];l=a[s],h=l.replace("run_time_log_",""),u="",p.label=7;case 7:return p.trys.push([7,9,,10]),[4,pr.getItem(l)];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(h,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,l,h,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="",pr?[4,pr.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?(l=a[s],h=r,[4,pr.getItem(l)]):[3,6];case 4:r=h+(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]}})})},Nw([(n="Slide.initConfig",function(r,o,s){var a=s.value;s.value=function(){for(var l=[],h=0;h<arguments.length;h++)l[h]=arguments[h];for(var u=Mc.get(n)||[],p=l,y=0,x=u;y<x.length;y++){var E=x[y];try{p=E.before(p)}catch{}if(!Array.isArray(p)||p.length!==l.length)throw new Error("plugin before hook return invalid args")}for(var A=a.bind(this).apply(void 0,p),C=0,j=u.reverse();C<j.length;C++){E=j[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}(xi.a);pr==null||pr.clear().catch(function(){}),window.addEventListener("__slide_log__",io.handleLogDownload),window.addEventListener("message",function(i){if(i.data.type==="@slide/_request_log_")io.handleLogReport(i.data.sessionId).catch(function(){});else if(i.data.type==="@slide/_request_frozen_")io.handleFrozenAllSlide();else if(i.data.type==="@slide/_request_release_")io.handleReleaseAllSlide();else if(i.data.type==="@slide/_update_volume_"){var t=.5;try{t=parseFloat(i.data.volume.toString())}catch{}io.volumeAdjuster.volume=t}else i.data.type==="@slide/_get_volume_"?window.postMessage({type:"@slide/_report_volume_",volume:io.volumeAdjuster.volume,customMessage:"@slide/_report_volume_"},"*"):i.data.type==="@slide/_preload_slide_"&&io.preloadResource(i.data.taskId,i.data.prefix,function(e){window.postMessage({type:"@slide/_preload_slide_progress_",taskId:i.data.taskId,progress:e},"*")}).catch(function(e){window.postMessage({type:"@slide/_preload_slide_error_",taskId:i.data.taskId,error:e},"*")})}),window.setInterval(function(){io.flushLog().catch(function(){})},2e3)}]);const Ar="!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e0=87,n0=20,Jc=[],i0=()=>{for(let b=0;b<n0;b++)Jc[b]=Ar.charAt(Math.random()*e0);return Jc.join("")};function Kc(b){try{return b()}catch(w){console.error(w)}}class ra{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)?r0(w):w),v}add(w,v=this.genUID()){const P=w();return P?this.addDisposer(P,v):v}addEventListener(w,v,P,M,I=this.genUID()){return w.addEventListener(v,P,M),this.addDisposer(()=>w.removeEventListener(v,P,M),I),I}setTimeout(w,v,P=this.genUID()){const M=window.setTimeout(()=>{this.remove(P),w()},v);return this.addDisposer(()=>window.clearTimeout(M),P)}setInterval(w,v,P=this.genUID()){const M=window.setInterval(w,v);return this.addDisposer(()=>window.clearInterval(M),P)}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(Kc),this.disposers.clear()}genUID(){let w;do w=i0();while(this.disposers.has(w));return w}}function r0(b){return()=>b.forEach(Kc)}function Zc(b,w,v){return Math.min(Math.max(b,w),v)}function o0(b){return typeof b=="object"&&b!==null}function s0(b){if(!b)return!1;const w=b.tagName;return w==="INPUT"||w==="TEXTAREA"||w==="SELECT"}var Qc={exports:{}},a0={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]},$c={exports:{}},l0=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")},h0=l0,u0=Array.prototype.concat,c0=Array.prototype.slice,td=$c.exports=function(w){for(var v=[],P=0,M=w.length;P<M;P++){var I=w[P];h0(I)?v=u0.call(v,c0.call(I)):v.push(I)}return v};td.wrap=function(b){return function(){return b(td(arguments))}};var oa=a0,sa=$c.exports,ed=Object.hasOwnProperty,nd=Object.create(null);for(var Rh in oa)ed.call(oa,Rh)&&(nd[oa[Rh]]=Rh);var gr=Qc.exports={to:{},get:{}};gr.get=function(b){var w=b.substring(0,3).toLowerCase(),v,P;switch(w){case"hsl":v=gr.get.hsl(b),P="hsl";break;case"hwb":v=gr.get.hwb(b),P="hwb";break;default:v=gr.get.rgb(b),P="rgb";break}return v?{model:P,value:v}:null},gr.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,P=/^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],k,W,J;if(k=b.match(v)){for(J=k[2],k=k[1],W=0;W<3;W++){var V=W*2;D[W]=parseInt(k.slice(V,V+2),16)}J&&(D[3]=parseInt(J,16)/255)}else if(k=b.match(w)){for(k=k[1],J=k[3],W=0;W<3;W++)D[W]=parseInt(k[W]+k[W],16);J&&(D[3]=parseInt(J+J,16)/255)}else if(k=b.match(P)){for(W=0;W<3;W++)D[W]=parseInt(k[W+1],0);k[4]&&(k[5]?D[3]=parseFloat(k[4])*.01:D[3]=parseFloat(k[4]))}else if(k=b.match(M)){for(W=0;W<3;W++)D[W]=Math.round(parseFloat(k[W+1])*2.55);k[4]&&(k[5]?D[3]=parseFloat(k[4])*.01:D[3]=parseFloat(k[4]))}else return(k=b.match(I))?k[1]==="transparent"?[0,0,0,0]:ed.call(oa,k[1])?(D=oa[k[1]],D[3]=1,D):null:null;for(W=0;W<3;W++)D[W]=vo(D[W],0,255);return D[3]=vo(D[3],0,1),D},gr.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 P=parseFloat(v[4]),M=(parseFloat(v[1])%360+360)%360,I=vo(parseFloat(v[2]),0,100),D=vo(parseFloat(v[3]),0,100),k=vo(isNaN(P)?1:P,0,1);return[M,I,D,k]}return null},gr.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 P=parseFloat(v[4]),M=(parseFloat(v[1])%360+360)%360,I=vo(parseFloat(v[2]),0,100),D=vo(parseFloat(v[3]),0,100),k=vo(isNaN(P)?1:P,0,1);return[M,I,D,k]}return null},gr.to.hex=function(){var b=sa(arguments);return"#"+rl(b[0])+rl(b[1])+rl(b[2])+(b[3]<1?rl(Math.round(b[3]*255)):"")},gr.to.rgb=function(){var b=sa(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]+")"},gr.to.rgb.percent=function(){var b=sa(arguments),w=Math.round(b[0]/255*100),v=Math.round(b[1]/255*100),P=Math.round(b[2]/255*100);return b.length<4||b[3]===1?"rgb("+w+"%, "+v+"%, "+P+"%)":"rgba("+w+"%, "+v+"%, "+P+"%, "+b[3]+")"},gr.to.hsl=function(){var b=sa(arguments);return b.length<4||b[3]===1?"hsl("+b[0]+", "+b[1]+"%, "+b[2]+"%)":"hsla("+b[0]+", "+b[1]+"%, "+b[2]+"%, "+b[3]+")"},gr.to.hwb=function(){var b=sa(arguments),w="";return b.length>=4&&b[3]!==1&&(w=", "+b[3]),"hwb("+b[0]+", "+b[1]+"%, "+b[2]+"%"+w+")"},gr.to.keyword=function(b){return nd[b.slice(0,3)]};function vo(b,w,v){return Math.min(Math.max(w,b),v)}function rl(b){var w=Math.round(b).toString(16).toUpperCase();return w.length<2?"0"+w:w}var d0=Qc.exports;class p0{constructor(w){this.enable=w,this.apps={},this.level="debug",this.roomLogger=null,this._onMessage=v=>{let P;v instanceof CustomEvent?P=v.detail:o0(v.data)&&(P=v.data),P&&(typeof P.slide=="boolean"?this.enable=P.slide:P.slide==="__instance"?console.log(this):P.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 P;((P=this.apps)[w]||(P[w]={})).context=v,this.log(`[Slide] new ${w}`)}setAppController(w,v){var P;((P=this.apps)[w]||(P[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 Mr=new p0(!1),Oi=Mr.log.bind(Mr),Ih=Mr.verbose.bind(Mr),f0=b=>{Mr.roomLogger=b.logger};function id(b){try{const w=window.getComputedStyle(b).backgroundColor;if(w!=="rgba(0, 0, 0, 0)"&&w!=="transparent")return w;if(b.parentElement)return id(b.parentElement)}catch{}return"#ffffff"}function m0(b){const w=d0.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 ol="";function rd(b){return ol||(ol=m0(id(b)),Oi("[Slide] guess bg color",ol)),ol}const g0=b=>b.tracker;function od(b){const{width:w,height:v,slideCount:P,slideState:M}=b,{taskId:I,url:D}=M,k=[];for(let W=1;W<=P;++W)k.push({width:w,height:v,thumbnail:`${D}/${I}/preview/${W}.png`,src:"ppt"});return k}function sd(b,w,v,P){var k;const M=v.slideState.currentSlideIndex;if(!(M>0)||!w.getIsWritable())return;const I=[P,M].join("/");if(b.scenePathType(I)!=="page"){b.removeScenes(P);const W=v.slideCount,J=[];for(let V=1;V<=W;++V)J.push({name:`${V}`});b.putScenes(P,J)}let D;w.getBox().focus?D=b.state.sceneState.scenePath:D=((k=w.getView())==null?void 0:k.focusScenePath)||"",D!==I&&w.setScenePath(I)}const Ph="https://convertcdn.netless.link/dynamicConvert",v0=40,Oh={taskId:"",url:"",state:null},_0=function(){};class y0{constructor({context:w,anchor:v,onRenderStart:P,onPageChanged:M,onTransitionStart:I,onTransitionEnd:D,onNavigate:k,onError:W,onRenderError:J,showRenderError:V}){this.sideEffect=new ra,this.ready=!1,this.readyPromise=new Promise(et=>{this.resolveReady=()=>{this.ready?Oi("[Slide] render end"):setTimeout(()=>{this.ready=!0,et()},1e3)}}),this.onSyncDispatch=et=>{if(this.context.getIsWritable()&&this.room){const pt={type:Dn.SLIDE_EVENTS.syncDispatch,payload:et};Ih("[Slide] dispatch",JSON.stringify(et)),this.context.dispatchMagixEvent(Dn.SLIDE_EVENTS.syncDispatch,pt)}},this.magixEventListener=et=>{const{type:pt,payload:Lt}=et.payload;pt===Dn.SLIDE_EVENTS.syncDispatch&&(this.syncStateOnce(),Ih("[Slide] receive",JSON.stringify(Lt)),this.slide.emit(Dn.SLIDE_EVENTS.syncReceive,Lt))},this.onStateChange=et=>{this.context.getIsWritable()&&(Ih("[Slide] state change",JSON.stringify(et,null,2)),this.context.storage.setState({state:et}))},this.pollCount=0,this.pollReadyState=()=>{this.ready?this._toFreeze===1?this.freeze():this._toFreeze===-1&&this.unfreeze():this.pollCount<v0?(this.pollCount++,setTimeout(this.pollReadyState,500)):(this.pollCount=0,Oi("[Slide] init timeout"))},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?(Oi("[Slide] freeze",this.context.appId),this.slide.frozen()):this._toFreeze=1},this.unfreeze=async()=>{!this.visible||(this.isFrozen=!1,this.ready?(Oi("[Slide] unfreeze",this.context.appId),this.slide.release()):this._toFreeze=-1)},this.onVisibilityChange=async()=>{(this.visible=document.visibilityState==="visible")?(Oi("[Slide] unfreeze because tab becomes visible",{savedIsFrozen:this.savedIsFrozen}),this.savedIsFrozen||this.unfreeze()):(this.savedIsFrozen=this.isFrozen,Oi("[Slide] freeze because tab becomes invisible"),this.freeze())},this.onRenderStart=P,this.onPageChanged=M,this.onTransitionStart=I,this.onTransitionEnd=D,this.onNavigate=k||_0,this.onError=W,this.onRenderError=J,this.showRenderError=V!=null?V:!0,this.context=w,this.room=w.getRoom(),this.player=this.room?void 0:w.getDisplayer(),f0(this.room||this.player),this.slide=this.createSlide(v,{whiteTracker:g0(w.getDisplayer())}),this.syncStateOnceFlag=!this.context.isAddApp,this.visible=document.visibilityState==="visible",this.savedIsFrozen=!1,this.initialize()}jumpToPage(w,v){this.ready&&(w=Zc(w,1,this.pageCount),this.onNavigate(w,v),this.slide.renderSlide(w))}initialize(){this.registerEventListeners(),this.kickStart()}kickStart(){const{context:w,slide:v}=this;w.getIsWritable()&&w.storage.ensureState(Oh);const{taskId:P,url:M,state:I}=w.storage.state;v.setResource(P,M||Ph),I?(Oi("[Slide] init with state",JSON.stringify(I)),this.syncStateOnceFlag=!1,v.setSlideState(I)):w.isAddApp&&(Oi("[Slide] init by renderSlide",1),v.renderSlide(1)),this.pollReadyState()}registerEventListeners(){const{context:w,slide:v}=this,P=this.sideEffect.addDisposer(w.storage.addStateChangedListener(()=>{w.storage.state.state&&(this.syncStateOnce(),this.sideEffect.flush(P))}));this.sideEffect.add(()=>w.addMagixEventListener(Dn.SLIDE_EVENTS.syncDispatch,this.magixEventListener,{fireSelfEventAfterCommit:!0})),v.on(Dn.SLIDE_EVENTS.renderStart,this.onRenderStart),v.on(Dn.SLIDE_EVENTS.slideChange,this.onPageChanged),v.on(Dn.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),v.on(Dn.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),v.on(Dn.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),v.on(Dn.SLIDE_EVENTS.renderError,this.onError),v.on(Dn.SLIDE_EVENTS.stateChange,this.onStateChange),v.on(Dn.SLIDE_EVENTS.syncDispatch,this.onSyncDispatch),v.on(Dn.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(Oh);const{state:w}=this.context.storage.state;w&&(Oi("[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,v={}){var I,D,k;const P=this.context.getAppOptions()||{};return new Dn.Slide({anchor:w,interactive:!0,mode:"interactive",controller:Mr.enable,enableGlobalClick:(I=P.enableGlobalClick)!=null?I:!0,renderOptions:{minFPS:P.minFPS||25,maxFPS:P.maxFPS||30,autoFPS:(D=P.autoFPS)!=null?D:!0,autoResolution:(k=P.autoResolution)!=null?k:!0,resolution:P.resolution,transactionBgColor:P.bgColor||rd(w),maxResolutionLevel:P.maxResolutionLevel,forceCanvas:P.forceCanvas,enableNvidiaDetect:P.enableNvidiaDetect},fixedFrameSize:P.fixedFrameSize,loaderDelegate:P.loaderDelegate,navigatorDelegate:P.navigatorDelegate,urlInterrupter:P.urlInterrupter,resourceTimeout:P.resourceTimeout,rtcAudio:P.rtcAudio,useLocalCache:P.useLocalCache,logger:P.logger,whiteTracker:v.whiteTracker,timestamp:this.timestamp})}destroy(){this.sideEffect.flushAll(),this.destroyed||(Oi("[Slide] destroy slide (once)"),this.slide.destroy(),this.destroyed=!0)}}function x0(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 P=document.createElementNS(w,"path");return P.setAttribute("fill","currentColor"),P.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(P),v}function b0(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 P=document.createElementNS(w,"path");return P.setAttribute("fill","currentColor"),P.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(P),v}function T0(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 P=document.createElementNS(w,"path");return P.setAttribute("fill","currentColor"),P.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(P),v}function E0(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 P=document.createElementNS(w,"path");return P.setAttribute("fill","currentColor"),P.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(P),v}function S0(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 P=document.createElementNS(w,"path");return P.setAttribute("fill","currentColor"),P.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(P),v}const _o=typeof window!="undefined",ad=_o&&!("onscroll"in window)||typeof navigator!="undefined"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),ld=_o&&"IntersectionObserver"in window,hd=_o&&"classList"in document.createElement("p"),ud=_o&&window.devicePixelRatio>1,w0={elements_selector:".lazy",container:ad||_o?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},cd=b=>Object.assign({},w0,b),dd=function(b,w){let v;const P="LazyLoad::Initialized",M=new b(w);try{v=new CustomEvent(P,{detail:{instance:M}})}catch{v=document.createEvent("CustomEvent"),v.initCustomEvent(P,!1,!1,{instance:M})}window.dispatchEvent(v)},A0=(b,w)=>{if(!!w)if(!w.length)dd(b,w);else for(let v=0,P;P=w[v];v+=1)dd(b,P)},oo="src",Nh="srcset",Lh="sizes",pd="poster",aa="llOriginalAttrs",fd="data",Dh="loading",md="loaded",gd="applied",M0="entered",Fh="error",vd="native",_d="data-",yd="ll-status",cr=(b,w)=>b.getAttribute(_d+w),C0=(b,w,v)=>{var P=_d+w;if(v===null){b.removeAttribute(P);return}b.setAttribute(P,v)},la=b=>cr(b,yd),Ko=(b,w)=>C0(b,yd,w),sl=b=>Ko(b,null),Bh=b=>la(b)===null,R0=b=>la(b)===Dh,I0=b=>la(b)===Fh,Uh=b=>la(b)===vd,P0=[Dh,md,gd,Fh],O0=b=>P0.indexOf(la(b))>=0,yo=(b,w,v,P)=>{if(!!b){if(P!==void 0){b(w,v,P);return}if(v!==void 0){b(w,v);return}b(w)}},xs=(b,w)=>{if(hd){b.classList.add(w);return}b.className+=(b.className?" ":"")+w},Yr=(b,w)=>{if(hd){b.classList.remove(w);return}b.className=b.className.replace(new RegExp("(^|\\s+)"+w+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},N0=b=>{b.llTempImage=document.createElement("IMG")},L0=b=>{delete b.llTempImage},xd=b=>b.llTempImage,al=(b,w)=>{if(!w)return;const v=w._observer;!v||v.unobserve(b)},D0=b=>{b.disconnect()},F0=(b,w,v)=>{w.unobserve_entered&&al(b,v)},kh=(b,w)=>{!b||(b.loadingCount+=w)},B0=b=>{!b||(b.toLoadCount-=1)},bd=(b,w)=>{!b||(b.toLoadCount=w)},U0=b=>b.loadingCount>0,k0=b=>b.toLoadCount>0,Td=b=>{let w=[];for(let v=0,P;P=b.children[v];v+=1)P.tagName==="SOURCE"&&w.push(P);return w},Gh=(b,w)=>{const v=b.parentNode;if(!v||v.tagName!=="PICTURE")return;Td(v).forEach(w)},Ed=(b,w)=>{Td(b).forEach(w)},ll=[oo],Sd=[oo,pd],ha=[oo,Nh,Lh],wd=[fd],hl=b=>!!b[aa],Ad=b=>b[aa],Md=b=>delete b[aa],bs=(b,w)=>{if(hl(b))return;const v={};w.forEach(P=>{v[P]=b.getAttribute(P)}),b[aa]=v},G0=b=>{hl(b)||(b[aa]={backgroundImage:b.style.backgroundImage})},H0=(b,w,v)=>{if(!v){b.removeAttribute(w);return}b.setAttribute(w,v)},Zo=(b,w)=>{if(!hl(b))return;const v=Ad(b);w.forEach(P=>{H0(b,P,v[P])})},j0=b=>{if(!hl(b))return;const w=Ad(b);b.style.backgroundImage=w.backgroundImage},Cd=(b,w,v)=>{xs(b,w.class_applied),Ko(b,gd),v&&(w.unobserve_completed&&al(b,w),yo(w.callback_applied,b,v))},Rd=(b,w,v)=>{xs(b,w.class_loading),Ko(b,Dh),v&&(kh(v,1),yo(w.callback_loading,b,v))},xo=(b,w,v)=>{!v||b.setAttribute(w,v)},Id=(b,w)=>{xo(b,Lh,cr(b,w.data_sizes)),xo(b,Nh,cr(b,w.data_srcset)),xo(b,oo,cr(b,w.data_src))},z0=(b,w)=>{Gh(b,v=>{bs(v,ha),Id(v,w)}),bs(b,ha),Id(b,w)},V0=(b,w)=>{bs(b,ll),xo(b,oo,cr(b,w.data_src))},W0=(b,w)=>{Ed(b,v=>{bs(v,ll),xo(v,oo,cr(v,w.data_src))}),bs(b,Sd),xo(b,pd,cr(b,w.data_poster)),xo(b,oo,cr(b,w.data_src)),b.load()},X0=(b,w)=>{bs(b,wd),xo(b,fd,cr(b,w.data_src))},Y0=(b,w,v)=>{const P=cr(b,w.data_bg),M=cr(b,w.data_bg_hidpi),I=ud&&M?M:P;!I||(b.style.backgroundImage=`url("${I}")`,xd(b).setAttribute(oo,I),Rd(b,w,v))},q0=(b,w,v)=>{const P=cr(b,w.data_bg_multi),M=cr(b,w.data_bg_multi_hidpi),I=ud&&M?M:P;!I||(b.style.backgroundImage=I,Cd(b,w,v))},J0=(b,w,v)=>{const P=cr(b,w.data_bg_set);if(!P)return;const M=P.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()),Cd(b,w,v)},Pd={IMG:z0,IFRAME:V0,VIDEO:W0,OBJECT:X0},K0=(b,w)=>{const v=Pd[b.tagName];!v||v(b,w)},Z0=(b,w,v)=>{const P=Pd[b.tagName];!P||(P(b,w),Rd(b,w,v))},Q0=["IMG","IFRAME","VIDEO","OBJECT"],$0=b=>Q0.indexOf(b.tagName)>-1,Od=(b,w)=>{w&&!U0(w)&&!k0(w)&&yo(b.callback_finish,w)},Nd=(b,w,v)=>{b.addEventListener(w,v),b.llEvLisnrs[w]=v},t_=(b,w,v)=>{b.removeEventListener(w,v)},Hh=b=>!!b.llEvLisnrs,e_=(b,w,v)=>{Hh(b)||(b.llEvLisnrs={});const P=b.tagName==="VIDEO"?"loadeddata":"load";Nd(b,P,w),Nd(b,"error",v)},jh=b=>{if(!Hh(b))return;const w=b.llEvLisnrs;for(let v in w){const P=w[v];t_(b,v,P)}delete b.llEvLisnrs},Ld=(b,w,v)=>{L0(b),kh(v,-1),B0(v),Yr(b,w.class_loading),w.unobserve_completed&&al(b,v)},n_=(b,w,v,P)=>{const M=Uh(w);Ld(w,v,P),xs(w,v.class_loaded),Ko(w,md),yo(v.callback_loaded,w,P),M||Od(v,P)},i_=(b,w,v,P)=>{const M=Uh(w);Ld(w,v,P),xs(w,v.class_error),Ko(w,Fh),yo(v.callback_error,w,P),v.restore_on_error&&Zo(w,ha),M||Od(v,P)},zh=(b,w,v)=>{const P=xd(b)||b;if(Hh(P))return;e_(P,D=>{n_(D,b,w,v),jh(P)},D=>{i_(D,b,w,v),jh(P)})},r_=(b,w,v)=>{N0(b),zh(b,w,v),G0(b),Y0(b,w,v),q0(b,w,v),J0(b,w,v)},o_=(b,w,v)=>{zh(b,w,v),Z0(b,w,v)},Vh=(b,w,v)=>{$0(b)?o_(b,w,v):r_(b,w,v)},s_=(b,w,v)=>{b.setAttribute("loading","lazy"),zh(b,w,v),K0(b,w),Ko(b,vd)},Dd=b=>{b.removeAttribute(oo),b.removeAttribute(Nh),b.removeAttribute(Lh)},a_=b=>{Gh(b,w=>{Dd(w)}),Dd(b)},Fd=b=>{Gh(b,w=>{Zo(w,ha)}),Zo(b,ha)},l_={IMG:Fd,IFRAME:b=>{Zo(b,ll)},VIDEO:b=>{Ed(b,w=>{Zo(w,ll)}),Zo(b,Sd),b.load()},OBJECT:b=>{Zo(b,wd)}},h_=b=>{const w=l_[b.tagName];if(!w){j0(b);return}w(b)},u_=(b,w)=>{Bh(b)||Uh(b)||(Yr(b,w.class_entered),Yr(b,w.class_exited),Yr(b,w.class_applied),Yr(b,w.class_loading),Yr(b,w.class_loaded),Yr(b,w.class_error))},c_=(b,w)=>{h_(b),u_(b,w),sl(b),Md(b)},d_=(b,w,v,P)=>{!v.cancel_on_exit||!R0(b)||b.tagName==="IMG"&&(jh(b),a_(b),Fd(b),Yr(b,v.class_loading),kh(P,-1),sl(b),yo(v.callback_cancel,b,w,P))},p_=(b,w,v,P)=>{const M=O0(b);Ko(b,M0),xs(b,v.class_entered),Yr(b,v.class_exited),F0(b,v,P),yo(v.callback_enter,b,w,P),!M&&Vh(b,v,P)},f_=(b,w,v,P)=>{Bh(b)||(xs(b,v.class_exited),d_(b,w,v,P),yo(v.callback_exit,b,w,P))},m_=["IMG","IFRAME","VIDEO"],Bd=b=>b.use_native&&"loading"in HTMLImageElement.prototype,g_=(b,w,v)=>{b.forEach(P=>{m_.indexOf(P.tagName)!==-1&&s_(P,w,v)}),bd(v,0)},v_=b=>b.isIntersecting||b.intersectionRatio>0,__=b=>({root:b.container===document?null:b.container,rootMargin:b.thresholds||b.threshold+"px"}),y_=(b,w,v)=>{b.forEach(P=>v_(P)?p_(P.target,P,w,v):f_(P.target,P,w,v))},x_=(b,w)=>{w.forEach(v=>{b.observe(v)})},b_=(b,w)=>{D0(b),x_(b,w)},T_=(b,w)=>{!ld||Bd(b)||(w._observer=new IntersectionObserver(v=>{y_(v,b,w)},__(b)))},Ud=b=>Array.prototype.slice.call(b),ul=b=>b.container.querySelectorAll(b.elements_selector),E_=b=>Ud(b).filter(Bh),S_=b=>I0(b),w_=b=>Ud(b).filter(S_),kd=(b,w)=>E_(b||ul(w)),A_=(b,w)=>{w_(ul(b)).forEach(P=>{Yr(P,b.class_error),sl(P)}),w.update()},M_=(b,w)=>{!_o||(w._onlineHandler=()=>{A_(b,w)},window.addEventListener("online",w._onlineHandler))},C_=b=>{!_o||window.removeEventListener("online",b._onlineHandler)},ua=function(b,w){const v=cd(b);this._settings=v,this.loadingCount=0,T_(v,this),M_(v,this),this.update(w)};ua.prototype={update:function(b){const w=this._settings,v=kd(b,w);if(bd(this,v.length),ad||!ld){this.loadAll(v);return}if(Bd(w)){g_(v,w,this);return}b_(this._observer,v)},destroy:function(){this._observer&&this._observer.disconnect(),C_(this),ul(this._settings).forEach(b=>{Md(b)}),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(b){const w=this._settings;kd(b,w).forEach(P=>{al(P,this),Vh(P,w,this)})},restoreAll:function(){const b=this._settings;ul(b).forEach(w=>{c_(w,b)})}},ua.load=(b,w)=>{const v=cd(w);Vh(b,v)},ua.resetStatus=b=>{sl(b)},_o&&A0(ua,window.lazyLoadOptions);class Gd{constructor({readonly:w,onNewPageIndex:v,onPlay:P,onPagesReady:M,urlInterrupter:I}){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 ra,this.readonly=w,this.onNewPageIndex=v,this.onPlay=P,this.onPagesReady=M,this.urlInterrupter=I||(D=>D),this.render()}set pages(w){this._pages=w,this.refreshPreview().then(this.refreshBtnSidebar.bind(this)),this.refreshTotalPage(),this.onPagesReady&&this.onPagesReady(w)}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 P=(M=v.target.dataset)==null?void 0:M.pageIndex;P&&(v.preventDefault(),v.stopPropagation(),v.stopImmediatePropagation(),this.onNewPageIndex(Number(P),"preview"),this.togglePreview(!1))})}return this.$preview}async refreshPreview(){var I,D;const{$preview:w}=this,v=this.wrapClassName("preview-page"),P=this.wrapClassName("preview-page-name");for(;w.firstChild;)w.firstChild.remove();const M=[];for(let k=0,W=this.pages.length;k<W;k++){const J=this.pages[k],V=(I=J.thumbnail)!=null?I:J.src.startsWith("ppt")?void 0:J.src;V&&(M[k]=this.urlInterrupter(V))}for(let k=0,W=this.pages.length;k<W;k++)M[k]=await M[k];this.pages.forEach((k,W)=>{const J=M[W];if(!J)return;const V=String(W),et=document.createElement("a");et.className=v+" "+this.wrapClassName(`preview-page-${W}`),et.setAttribute("href","#"),et.dataset.pageIndex=V;const pt=document.createElement("span");pt.className=P,pt.textContent=String(W+1),pt.dataset.pageIndex=V;const Lt=document.createElement("img");Lt.width=k.width,Lt.height=k.height,Lt.dataset.src=J,Lt.dataset.pageIndex=V,et.appendChild(Lt),et.appendChild(pt),w.appendChild(et)}),(D=this.previewLazyLoad)==null||D.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",x0(this.namespace));this.sideEffect.addEventListener(v,"click",()=>{this.readonly||this.togglePreview()}),this.$btnSidebar=v,this.$btnSidebar.style.display="none",this.$footer.appendChild(v);const P=document.createElement("div");P.className=this.wrapClassName("page-jumps");const M=this.renderFooterBtn("btn-page-back",b0(this.namespace));if(this.sideEffect.addEventListener(M,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex-1,"navigation")}),P.appendChild(M),this.onPlay){const J=this.renderFooterBtn("btn-page-play",E0(this.namespace),S0(this.namespace));this.$btnPlay=J,this.sideEffect.addEventListener(J,"click",()=>{this.readonly||(this.setPlaying(),this.onPlay&&this.onPlay())}),P.appendChild(J)}const I=this.renderFooterBtn("btn-page-next",T0(this.namespace));this.sideEffect.addEventListener(I,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex+1,"navigation")}),P.appendChild(I);const D=document.createElement("div");D.className=this.wrapClassName("page-number");const k=document.createElement("input");k.className=this.wrapClassName("page-number-input"),k.value=String(this.pageIndex+1),this.readonly&&(k.disabled=!0),this.$pageNumberInput=k,this.sideEffect.addEventListener(k,"focus",()=>{k.select()}),this.sideEffect.addEventListener(k,"change",()=>{this.readonly||k.value&&this.onNewPageIndex(Number(k.value)-1,"input")});const W=document.createElement("span");this.$totalPage=W,D.appendChild(k),D.appendChild(W),this.$footer.appendChild(P),this.$footer.appendChild(D)}return this.$footer}renderFooterBtn(w,v,P){const M=document.createElement("button");return M.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(w),M.appendChild(v),P&&M.appendChild(P),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 ua({container:this.$preview,elements_selector:`.${this.wrapClassName("preview-page>img")}`})),this.$preview.scrollTo({top:v.offsetTop-16}))}}wrapClassName(w){return`${this.namespace}-${w}`}}const R_=new Set(["clicker"]),I_=function(){};class P_{constructor({box:w,view:v,mountSlideController:P,mountWhiteboard:M,baseScenePath:I,appId:D,urlInterrupter:k,onPagesReady:W,onNavigate:J}){this.slideController=null,this.isViewMounted=!1,this.onError=({error:V,index:et})=>{var pt,Lt;this.viewer.setPaused(),(pt=this.slideController)!=null&&pt.showRenderError&&(this.$overlay.textContent=`Error on slide[page=${this.slideController.page}]: ${V.message}`,this.$overlay.style.opacity="1"),(Lt=this.slideController)!=null&&Lt.onRenderError&&this.slideController.onRenderError(V,et),Mr.warn("[Slide] render error",V)},this.onRenderStart=()=>{this.$whiteboardView.classList.add(this.wrapClassName("wb-view-hidden")),this.viewer.setPlaying()},this.onRenderEnd=()=>{},this.onPageChanged=()=>{clearTimeout(this._onPageChangedTimer),this._onPageChangedTimer=setTimeout(this._onPageChanged,200)},this._onPageChangedTimer=0,this._onPageChanged=()=>{this.$overlay.style.opacity="",this.$whiteboardView.classList.remove(this.wrapClassName("wb-view-hidden"))},this.refreshPages=()=>{this.slideController&&(this.viewer.pages=od(this.slideController.slide),this.viewer.setPageIndex(this.getPageIndex(this.slideController.page)),this.scaleDocsToFit())},this.scaleDocsToFit=()=>{if(this.slideController){const{width:V,height:et}=this.slideController.slide;V&&et&&(this.whiteboardView.moveCameraToContain({originX:-V/2,originY:-et/2,width:V,height:et,animationMode:"immediately"}),this.whiteboardView.setCameraBound({damping:1,maxContentMode:()=>this.whiteboardView.camera.scale,minContentMode:()=>this.whiteboardView.camera.scale,centerX:0,centerY:0,width:V,height:et}),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=(V,et)=>{this.slideController&&this.slideController.jumpToPage(V+1,et)},this.sideEffect=new ra,this.namespace="netless-app-slide",this.toPdf=async()=>{if(!this.slideController){this.reportProgress(100,null);return}const{slide:V}=this.slideController,et=1920,pt=document.createElement("canvas"),Lt=pt.getContext("2d"),{slideCount:At,width:L,height:R}=V;let F=Math.floor(L),X=Math.floor(R);F>et&&(F=et,X=Math.floor(R*F/L)),X>et&&(X=et,F=Math.floor(L*X/R)),pt.width=F,pt.height=X;const O=document.createElement("canvas");O.width=F,O.height=X;const H=O.getContext("2d");if(!H||!this.getWhiteSnapshot||!Lt)return this.reportProgress(100,null),null;const tt=F>X?"l":"p",{jsPDF:G}=await import("jspdf"),Pt=new G({format:[F,X],orientation:tt,compress:!0});for(let z=1;z<=At;z++){let U=null;try{U=await this.slideController.slide.snapshotWithTimingEnd(z)}catch{}if(U){const gt=document.createElement("img");gt.src=U,await new Promise(Dt=>gt.onload=Dt),Lt.drawImage(gt,0,0,F,X)}H.clearRect(0,0,F,X),this.getWhiteSnapshot(z,O,H,L,R);try{const gt=O.toDataURL("image/png"),Dt=document.createElement("img");Dt.src=gt,await new Promise(K=>Dt.onload=K),Lt.drawImage(Dt,0,0,F,X)}catch{}const ft=pt.toDataURL("image/jpeg",.6);z>1&&Pt.addPage(),Pt.addImage(ft,"JPEG",0,0,F,X,"","FAST"),Lt.clearRect(0,0,F,X),Math.ceil(z/At*100)<100&&this.reportProgress(Math.ceil(z/At*100),null)}const Vt=Pt.output("arraybuffer"),st=this.box.title;this.reportProgress(100,{pdf:Vt,title:st})},this.box=w,this.whiteboardView=v,this.mountSlideController=P,this.mountWhiteboard=M,this.onNavigate=J||I_,this.baseScenePath=I,this.appId=D,this.viewer=new Gd({readonly:w.readonly,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlay,urlInterrupter:k,onPagesReady:W}),this.sideEffect.add(()=>{const V=et=>{this.setReadonly(et)};return w.events.on("readonly",V),()=>w.events.off("readonly",V)}),this.sideEffect.add(()=>{const V=et=>{et.data.type==="@netless/_request_save_pdf_"&&et.data.appId===this.appId&&this.toPdf().catch(()=>this.reportProgress(100,null))};return window.addEventListener("message",V),()=>{window.removeEventListener("message",V)}}),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&&!s0(w.target))switch(w.key){case"ArrowUp":case"ArrowLeft":{this.slideController.slide.prevStep(),this.onNavigate(this.slideController.page,"keydown");break}case"ArrowRight":case"ArrowDown":{this.slideController.slide.nextStep(),this.onNavigate(this.slideController.page,"keydown");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,onRenderStart:this.onRenderStart,onRenderEnd:this.onRenderEnd,onTransitionStart:this.viewer.setPlaying,onTransitionEnd:this.viewer.setPaused,onReady:this.refreshPages,onNavigate:this.onNavigate,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||R_.has(w)?"none":"auto"}wrapClassName(w){return`${this.namespace}-${w}`}getWhiteSnapshot(w,v,P,M,I){this.whiteboardView.screenshotToCanvas(P,`${this.baseScenePath}/${w}`,v.width,v.height,{centerX:0,centerY:0,scale:Math.min(v.width/M,v.height/I)})}reportProgress(w,v){window.postMessage({type:"@netless/_result_save_pdf_",appId:this.appId,progress:w,result:v})}}let Wh=!1;Zn.FreezerLength=2;function O_(){return Zn.FreezerLength}function N_(b){Zn.FreezerLength=b<1?1/0:b}const ca=b=>"["+b+"]",cl={map:new Map,boxes:new Map,queue:[],validateQueue(){for(this.queue.sort((b,w)=>{var M,I,D,k;const v=(I=(M=this.boxes.get(b))==null?void 0:M.zIndex)!=null?I:0,P=(k=(D=this.boxes.get(w))==null?void 0:D.zIndex)!=null?k:0;return-(v-P)}),Oi("[Slide] freezer: validate",ca(this.queue));this.queue.length>Zn.FreezerLength;){const b=this.queue.pop(),w=this.map.get(b);w&&(Oi("[Slide] freezer: validate-freeze",b,ca(this.queue)),w.freeze())}},set(b,w,v){Oi("[Slide] freezer: add",b,ca(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),Oi("[Slide] freezer: delete",b,ca(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(),Oi("[Slide] freezer: focus",b,ca(this.queue)),w&&w.unfreeze()}},Xh=new Set;function L_(b){return Xh.add(b),()=>Xh.delete(b)}const Yh=new Set;function D_(b){return Yh.add(b),()=>Yh.delete(b)}const F_=b=>{Wh=!0,b.on("focus",({appId:w})=>{cl.focus(w)}),b.on("created",({appId:w})=>{Xh.forEach(v=>v(w))}),b.on("destroy",({appId:w})=>{Yh.forEach(v=>v(w))})};var Hd=(()=>`.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;transition:opacity .2s}.netless-app-slide-wb-view-hidden{opacity:0}.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 B_({container:b,taskId:w,url:v=Ph,debug:P=!1}){if(!w)throw new Error("[Slide] taskId is required");b.style.cssText+="display:flex;flex-direction:column";const M=new jd({target:b});return M.debug=!!P,M.mount(w,v),M}class jd{constructor(w){this.slide=null,this.debug=!1,this.sideEffect=new ra,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=od(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(Zc(v+1,1,this.slide.slideCount))},this.namespace="netless-app-slide",this.target=w.target,this.bgColor=rd(this.target),this.viewer=new Gd({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 Dn.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(Hd)),w}registerEventListeners(){if(!this.slide)return;const{slide:w}=this;w.on(Dn.SLIDE_EVENTS.slideChange,this.onPageChanged),w.on(Dn.SLIDE_EVENTS.renderStart,this.onTransitionStart),w.on(Dn.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),w.on(Dn.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),w.on(Dn.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),w.on(Dn.SLIDE_EVENTS.renderError,this.onError),w.on(Dn.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 U_=Dn.Slide.usePlugin.bind(Dn.Slide),qh="0.2.
|
|
7955
|
+
`)();function B_({container:b,taskId:w,url:v=Ph,debug:P=!1}){if(!w)throw new Error("[Slide] taskId is required");b.style.cssText+="display:flex;flex-direction:column";const M=new jd({target:b});return M.debug=!!P,M.mount(w,v),M}class jd{constructor(w){this.slide=null,this.debug=!1,this.sideEffect=new ra,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=od(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(Zc(v+1,1,this.slide.slideCount))},this.namespace="netless-app-slide",this.target=w.target,this.bgColor=rd(this.target),this.viewer=new Gd({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 Dn.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(Hd)),w}registerEventListeners(){if(!this.slide)return;const{slide:w}=this;w.on(Dn.SLIDE_EVENTS.slideChange,this.onPageChanged),w.on(Dn.SLIDE_EVENTS.renderStart,this.onTransitionStart),w.on(Dn.SLIDE_EVENTS.renderEnd,this.onTransitionEnd),w.on(Dn.SLIDE_EVENTS.mainSeqStepStart,this.onTransitionStart),w.on(Dn.SLIDE_EVENTS.mainSeqStepEnd,this.onTransitionEnd),w.on(Dn.SLIDE_EVENTS.renderError,this.onError),w.on(Dn.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 U_=Dn.Slide.usePlugin.bind(Dn.Slide),qh="0.2.54",k_={kind:"Slide",setup(b){var J;if(console.log("[Slide] setup @ "+qh),b.getIsWritable()&&b.storage.ensureState(Oh),!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(Hd);try{v.$content.dataset.appSlideVersion=qh}catch{}const P=b.getInitScenePath();let M=null;const I=V=>{const et=b.getRoom();if(M&&M.slideController){let pt=!1;et&&b.getIsWritable()&&(sd(et,b,M.slideController.slide,P),pt=!0),Oi("[Slide] page to",V,pt?"(synced)":""),M.viewer.setPageIndex(V-1),M.viewer.setPaused(),M.onPageChanged();const Lt=M.viewer.pages.length;Lt>0&&b.dispatchAppEvent("pageStateChange",{index:V-1,length:Lt})}},D=V=>{const et=b.getAppOptions()||{},pt=new y0(t0(qc({context:b},V),{onPageChanged:I,onNavigate:V.onNavigate,onRenderError:et.onRenderError,showRenderError:et.showRenderError}));return Wh&&cl.set(b.appId,pt,v),Mr.setAppController(b.appId,pt),pt.readyPromise.then(V.onReady).then(()=>{const Lt=b.getRoom();let At=!1;Lt&&b.getIsWritable()&&(sd(Lt,b,pt.slide,P),At=!0);const L=pt.slide.slideState.currentSlideIndex;Oi("[Slide] page to",L,At?"(synced)":"","(on ready)"),pt.slide.on("renderEnd",V.onRenderEnd)}),pt};M=new P_({box:v,view:w,mountSlideController:D,mountWhiteboard:b.mountView.bind(b),baseScenePath:P,appId:b.appId,urlInterrupter:(J=b.getAppOptions())==null?void 0:J.urlInterrupter,onPagesReady:({length:V})=>{const et=(M==null?void 0:M.viewer.pageIndex)||0;b.dispatchAppEvent("pageStateChange",{index:et,length:V})},onNavigate:(V,et)=>{Oi("[Slide] user navigate to",V,et?`(${et})`:"")}});const k=b.getRoom(),W=new ra;return W.add(()=>{var V;return Mr.setAppContext(b.appId,b),Mr.enable=((V=b.getAppOptions())==null?void 0:V.debug)||!1,Mr.level="debug",()=>Mr.deleteApp(b.appId)}),k&&(M.toggleClickThrough(k.state.memberState.currentApplianceName),W.add(()=>{const V=et=>{et.memberState&&M&&M.toggleClickThrough(et.memberState.currentApplianceName)};return k.callbacks.on("onRoomStateChanged",V),()=>k.callbacks.off("onRoomStateChanged",V)})),b.emitter.on("destroy",()=>{Oi("[Slide] destroy",b.appId),Wh&&cl.delete(b.appId),W.flushAll(),M&&(M.destroy(),M=null)}),M.mount(),{viewer:()=>M,controller:()=>M==null?void 0:M.slideController,slide:()=>{var V;return(V=M==null?void 0:M.slideController)==null?void 0:V.slide},nextStep:()=>{var V;return M&&M.slideController?((V=M==null?void 0:M.slideController)==null||V.slide.nextStep(),!0):!1},prevStep:()=>{var V;return M&&M.slideController?((V=M==null?void 0:M.slideController)==null||V.slide.prevStep(),!0):!1},position:()=>{const V=M==null?void 0:M.slideController;if(V)return[V.page,V.pageCount]},nextPage:()=>{const V=M==null?void 0:M.slideController;if(V){const{page:et,pageCount:pt}=V;if(pt>0&&et<pt)return V.jumpToPage(et+1),!0}return!1},prevPage:()=>{const V=M==null?void 0:M.slideController;if(V){const{page:et,pageCount:pt}=V;if(pt>0&&et>1)return V.jumpToPage(et-1),!0}return!1},jumpToPage:V=>{const et=M==null?void 0:M.slideController;if(et){const{page:pt,pageCount:Lt}=et;if(Lt>0&&pt>0&&pt<=Lt)return et.jumpToPage(V),!0}return!1}}}};return Zn.DefaultUrl=Ph,Zn.Slide=Dn.Slide,Zn.SlidePreviewer=jd,Zn.addHooks=F_,Zn.apps=cl,Zn.default=k_,Zn.getFreezerLength=O_,Zn.onCreated=L_,Zn.onDestroyed=D_,Zn.previewSlide=B_,Zn.setFreezerLength=N_,Zn.usePlugin=U_,Zn.version=qh,Object.defineProperties(Zn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),Zn}({});
|
|
7956
7956
|
//# sourceMappingURL=main.iife.js.map
|