1"use strict";(self.webpackChunklightx=self.webpackChunklightx||[]).push([[4174],{96545:(Yt,ft,p)=>{p.d(ft,{_:()=>nt});var Y=p(45312),J=p(21413),st=p(54438),_t=p(95301);let nt=(()=>{var at;class et{constructor(L){this.dataService=L,this._onExportApiResponse=new J.B,this.onExportApiResponse=this._onExportApiResponse.asObservable(),this.baseUrl=Y.c.baseUrl,this.urlPath="andorsocial-1.0/job/"}setExportApiResponse(L){this._onExportApiResponse.next(L)}invokeCreateVideo(L,Z,X,G,i,ct){this.dataService.postApi(this.baseUrl+"andorsocial-1.0/job/invokeCreateVideoAPI",{assetId:L,resolution:Z,designName:X,systemRefKey:G}).subscribe(jt=>{i(jt)},jt=>{ct()})}createJobId(L,Z,X,G,i,ct){this.dataService.postApi(this.baseUrl+"andorsocial-1.0/job/createJobId",{assetId:L,resolution:Z,designName:X,systemRefKey:G}).subscribe(jt=>{i(jt)},jt=>{ct()})}generatePresignedUrlForExport(L,Z,X){this.dataService.post(this.baseUrl+this.urlPath+"generatePresignedUrl",L).subscribe(i=>{i&&"SUCCESS"===i.status?Z(i):X(i)},i=>{X()})}getUploadedVideoStatusExport(L,Z,X){this.dataService.post(this.baseUrl+"andorsocial-1.0/job/getUploadedVideoStatus",{jobId:L}).subscribe(mt=>{mt&&"SUCCESS"===mt.status?Z(mt):X(mt)},mt=>{X()})}upload(L,Z){return new Promise((X,G)=>{const i=new XMLHttpRequest;i.open("PUT",Z,!0),i.send(L),i.onload=function(){200===this.status?X(!0):G(this.responseText)}})}}return(at=et).\u0275fac=function(L){return new(L||at)(st.KVO(_t.u))},at.\u0275prov=st.jDH({token:at,factory:at.\u0275fac}),et})()},94329:(Yt,ft,p)=>{p.d(ft,{M:()=>et,p:()=>rt});var Y=p(21413),J=p(43836),st=p(16478),_t=p(16471),nt=p(54438),at=p(33391);let et=(()=>{var L;class Z{constructor(G){this.modalService=G}canDeactivate(G){if(G?.canDeactivate())return!0;{let i=this.openCanActivateConfirmDialog();return i.subscribe(ct=>{ct||G.saveProject()}),i}}openCanActivateConfirmDialog(){const G=new Y.B,i=this.modalService.open(J.wR,{centered:!0,windowClass:"confirm-modal"});return i.componentInstance.title=st.b.message.unsavedTitle,i.componentInstance.message=st.b.message.unsavedMessages,i.componentInstance.subject=G,G.asObservable()}}return(L=Z).\u0275fac=function(G){return new(G||L)(nt.KVO(at.Bq))},L.\u0275prov=nt.jDH({token:L,factory:L.\u0275fac,providedIn:"root"}),Z})(),rt=(()=>{var L;class Z{constructor(G){this.modalService=G}canDeactivate(G){if(G?.canDeactivate())return!0;{let i=this.openCanActivatePhotoEditor(G?.getEditorType());return i.subscribe(ct=>{}),i}}openCanActivatePhotoEditor(G=null){const i=new Y.B,ct=this.modalService.open(J.nb,{centered:!0,windowClass:"confirm-modal"});let mt="";return mt=G&&G==_t._Y.AIPhoto?st.b.message.warningAiLostMessage:st.b.message.warningMessage,ct.componentInstance.title=mt,ct.componentInstance.subject=i,i.asObservable()}}return(L=Z).\u0275fac=function(G){return new(G||L)(nt.KVO(at.Bq))},L.\u0275prov=nt.jDH({token:L,factory:L.\u0275fac,providedIn:"root"}),Z})()},32594:(Yt,ft,p)=>{p.d(ft,{d:()=>_t});var Y=p(16471),J=p(54438),st=p(32764);let _t=(()=>{var nt;class at{constructor(rt){this.templateService=rt,this.templateType=1}getResizeContent(rt=null){this.templateService.getCreateFromScratchData(this.templateType,!0,L=>{const X=(L.body.socialPlatformsList||[]).concat(this.getCustomLayouts());X&&X.forEach(G=>{G.title=G.socialLabelType.replace(" ","").toLowerCase();let i=[];G.title===Y.zu.SocialMedia&&(G.socialPlatformFormats.forEach((ct,mt)=>{const Ot=ct.socialPlatform.split(" ")[0];-1===i.findIndex(jt=>jt.title===Ot.toLowerCase())&&i.push({id:++mt,title:Ot.toLowerCase(),socialPlatform:ct.socialPlatform,iconName:ct.iconName})}),G.socialMediaLayout=i)}),this.setBoxWidthHeight(X),rt&&rt(X)},L=>{console.log(L)})}getCustomLayouts(){return[{socialLabelType:"Custom",parentMediaType:"1",socialPlatformFormats:[{title:"custom",shortName:"Custom",format:0,wRatio:0,hRatio:0,width:0,height:0,socialPlatformId:26,thumbUrl:"https://d2v5dzhdg4zhx3.cloudfront.net/provideo-web-banner/travel.png"}]}]}setBoxWidthHeight(rt){let L=1;rt&&rt.forEach(Z=>{Z.socialPlatformFormats.forEach(X=>{X.id=L++,X.width>X.height?(X.boxHeight=Math.round(70*X.height/X.width),X.boxWidth=70):(X.boxWidth=Math.round(70*X.width/X.height),X.boxHeight=70)})})}}return(nt=at).\u0275fac=function(rt){return new(rt||nt)(J.KVO(st.I))},nt.\u0275prov=J.jDH({token:nt,factory:nt.\u0275fac}),at})()},74343:(Yt,ft,p)=>{p.d(ft,{_:()=>at});var Y=p(16478),J=p(54438),st=p(74710),_t=p(74983),nt=p(55349);let at=(()=>{var et;class rt{constructor(Z,X,G,i){this._router=Z,this.route=X,this.toastService=G,this.editoruiservice=i}saveProject(Z,X,G,i=null){G.isSaving||this.toastService.showProcess("Saving...",{});let ct=!G.design.assetId;G.isUserQuotaFull=!1,G.save(Z.systemRefKey,mt=>{this.toastService.removeAll(),this.toastService.showSuccess(Y.b.message.saveSuccess),ct&&G.design.assetId&&this._router.navigate([],{replaceUrl:!0,relativeTo:this.route,queryParams:{action:"",project_id:G.design.assetId},queryParamsHandling:""}),X&&X()},mt=>{this.toastService.removeAll(),G.isUserQuotaFull&&this.editoruiservice.showStorageLimitError(),i&&i()})}isSaved(Z){return Z.isSaved()}}return(et=rt).\u0275fac=function(Z){return new(Z||et)(J.KVO(st.Ix),J.KVO(st.nX),J.KVO(_t.f),J.KVO(nt.f))},et.\u0275prov=J.jDH({token:et,factory:et.\u0275fac}),rt})()},90866:(Yt,ft,p)=>{p.d(ft,{R:()=>de});var Y=p(60177),J=p(84341),st=p(83339),_t=p(48928),nt=p(21626),at=p(33391),et=p(72913),rt=p(89818),L=p(19338),Z=p(85188),X=p(21652),G=p(43387),i=p(55349),ct=p(74710),mt=p(74343),Ot=p(79421),Xt=p(24269),jt=p(90521),bi=p(8708),yi=p(23486),Ti=p(23679),ki=p(7060),Zt=p(32594),Ci=p(86820),ot=p(54438);let de=(()=>{var Nt;class ue{}return(Nt=ue).\u0275fac=function(xi){return new(xi||Nt)},Nt.\u0275mod=ot.$C({type:Nt}),Nt.\u0275inj=ot.G2t({providers:[i.f,mt._,jt.K,Zt.d,(0,nt.$R)((0,nt.Sx)())],imports:[Y.MD,st.G,at.UN,at._f,J.YN,ct.iI,J.X1,et.s,_t.RI,rt.MQ,L.di,Z.mB.forRoot(),X.YG,G.y,bi.vo,Ot.r,Xt.S,yi.v9,Ti.Y,ki.U,Ci.e]}),ue})()},13227:(Yt,ft,p)=>{p.d(ft,{K:()=>et});var Y=p(60177),J=p(84341),st=p(94449),_t=p(83339),nt=p(33391),at=p(54438);let et=(()=>{var rt;class L{}return(rt=L).\u0275fac=function(X){return new(X||rt)},rt.\u0275mod=at.$C({type:rt}),rt.\u0275inj=at.G2t({providers:[st.r],imports:[Y.MD,J.YN,_t.G,nt.UN]}),L})()},76696:(Yt,ft,p)=>{p.d(ft,{$:()=>Y});const Y=()=>Math.random().toString(36).substr(2,9)},54174:(Yt,ft,p)=>{p.r(ft),p.d(ft,{MyHammerConfig:()=>ro,VideoEditorUiModule:()=>Ef});var Y=p(60177),J=p(84341),st=p(83339),_t=p(48928),nt=p(21626),at=p(34870),et=p(33391),rt=p(72913),L=p(89818),Z=p(19338),X=p(85188),G=p(21652),i=p(54438);let ct=(()=>{var t;class n{}return(t=n).\u0275fac=function(e){return new(e||t)},t.\u0275mod=i.$C({type:t}),t.\u0275inj=i.G2t({}),n})();var mt=p(96545),Ot=p(61053),Xt=p(90866),jt=p(79421),bi=p(13227),yi=p(24269),Ti=p(80186),ki=p(54556),Zt=p(74710),Ci=p(94329),ot=p(10467),de=p(1408),Nt=p(3781),ue=p(32294),Ce=p(28567),xi=p(63065),Ht=p(59176),St=p(93552),wi=p(28662),oo=p(21413),q=p(88450),Mi=p(20999),Jt=p(16471),so=p(85269),ht=p(16478),It=p(50585),ao=p(9095),lo=p(76696);class $t{constructor(n,o){this.id=n,this.trackItems=o,n||(this.id=(0,lo.$)(),o.forEach(e
1=>{e.setTrackId(this.id)})),o.forEach(e=>{e.onEndTimeChange=r=>this.handleTrackItemEndTimeChange(),this.type="video"===e.trackItemType?At.VIDEO:"audio"===e.trackItemType?At.AUDIO:At.NONVIDEO}),this.trackItems.sort((e,r)=>e.startTime-r.startTime),this.order=o[0].getOrder()}handleTrackItemEndTimeChange(){let n=0;this.trackItems.forEach(o=>{n<o.endTime&&(n=o.endTime)}),this.ontEndTimeChange(this)}deleteEmptySpace(n){let o=null;this.trackItems.forEach(r=>{r.startTime>n&&(o?r.startTime<o.startTime&&(o=r):o=r)});const e=o.startTime-n;this.trackItems.forEach(r=>{r.startTime>n&&r.changeStartTime(r.startTime-e,!1)}),this.handleTrackItemEndTimeChange()}isSpaceAvailableForNewTrackItem(n,o){const e=n,r=n+o;let s=!0;for(const a of this.trackItems)(a.startTime<=e&&a.endTime>=e||a.startTime<=r&&a.endTime>=r||a.startTime>=e&&a.endTime<=r)&&(s=!1);return s}fromJson(n){}getOrder(){return this.order}setZorder(n){this.order!=n&&(this.order=n,this.trackItems.forEach(o=>{o.setOrder(this.order)}))}addTrackItem(n){n.onEndTimeChange=o=>this.handleTrackItemEndTimeChange(),this.trackItems.push(n),n.setTrackId(this.id),n.setOrder(this.order),this.arrangeTrackItemsAfterNewItem(),this.handleTrackItemEndTimeChange()}arrangeTrackItemsAfterNewItem(){this.trackItems.sort((e,r)=>e.startTime===r.startTime?-1:e.startTime-r.startTime);let n=-1,o=null;for(const e of this.trackItems)o&&e.startTime<o.endTime&&(n=o.endTime-e.startTime,e.changeStartTime(e.startTime+n,!1)),o=e}arrangeTempTrackItems(n,o,e){let r=[{trackItemId:-1,startTime:n,tempStartTime:0,endTime:n+o}].concat(this.trackItems);r.sort((l,c)=>l.startTime-c.startTime);let s=-1,a=null;for(const l of r)l.tempStartTime=0,l.trackItemId!=e&&(a&&l.startTime<a.endTime&&(s=a.endTime-l.startTime,l.tempStartTime=l.startTime+s),a=l)}removeTrackItem(n,o){throw new Error("Method not implemented.")}shiftTrackItem(n,o,e){throw new Error("Method not implemented.")}updateTrackTypeByType(n){this.type="video"===n?At.VIDEO:"audio"===n?At.AUDIO:At.NONVIDEO}updateTrackType(){for(let n of this.trackItems){if("video"===n.trackItemType){this.type=At.VIDEO;break}this.type="audio"===n.trackItemType?At.AUDIO:At.NONVIDEO}}seekToTime(n,o){var e=this;return(0,ot.A)(function*(){for(const r of e.trackItems)r.startTime<=n&&r.endTime>=n?yield r.show(!0,n,o):yield r.show(!1,n,o)})()}}var At=function(t){return t[t.VIDEO=1]="VIDEO",t[t.NONVIDEO=2]="NONVIDEO",t[t.AUDIO=3]="AUDIO",t}(At||{}),Ii=p(87320);class co{constructor(n,o,e,r){var s=this;this.canvas=o,this.thumbwidth=0,this.numOfthumb=0,this.canvasWidth=0,this.originalWidth=0,this.signleThumbCoveredDuration=0,this.videointerval=0,this.scale=1,this.canvasHeight=54,this.thumbs=[],this.canvasHeight=o.clientHeight;const a=n.getMedia();this.designItem=n.getDesignItem(),this.defaultWidth=r,e.getVideoElement(a.src,n.getDesignItem().designEntityId+"_0").promise.then(function(){var l=(0,ot.A)(function*(c){s.video=c;const d=s.video.videoWidth,u=s.video.videoHeight;s.videointerval=s.video.duration,s.originalWidth=s.canvas.clientWidth,s.thumbwidth=d/u*s.canvasHeight,s.ctx=s.canvas.getContext("2d"),s.scale=s.canvasHeight/u,s.configureGenCanvas(),s.resizeCanvas(),setTimeout(()=>{s.drawAndGenerateThumbs(0)},100)});return function(c){return l.apply(this,arguments)}}())}configureGenCanvas(){this.genCanvas=document.createElement("canvas"),this.genContext=this.genCanvas.getContext("2d",{willReadFrequently:!0}),this.genCanvas.width=this.thumbwidth,this.genCanvas.height=52,this.genContext.scale(this.scale,this.scale)}resizeCanvas(){this.canvasWidth=this.canvas.clientWidth,this.numOfthumb=Math.ceil(this.defaultWidth/this.thumbwidth),this.signleThumbCoveredDuration=this.videointerval/this.defaultWidth*this.thumbwidth,this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight}setZoom(){var n=this;return(0,ot.A)(function*(){n.resizeCanvas(),n.updateThumbs(0,0)})()}drawAndGenerateThumbs(n){let e=1027/this.videointerval*n;e/=this.scale,this.video.onseeked=()=>{this.genContext.clearRect(0,0,this.genCanvas.width,this.genCanvas.height),this.genContext.drawImage(this.video,0,0);let r=this.genContext.getImageData(0,0,this.genCanvas.width,this.genCanvas.height);
1this.thumbs.push(r),0===n&&this.defaultThumbGeneratedCb&&this.defaultThumbGeneratedCb(this.genCanvas.toDataURL());const s=n+this.signleThumbCoveredDuration;s<this.videointerval?this.drawAndGenerateThumbs(s):(n=0,this.updateThumbs(0,0))},this.video.currentTime=n}destroy(){this.video&&(this.video.pause(),this.video.removeAttribute("src"),this.video.load(),this.video.remove(),this.video=null,this.thumbs=[],this.genCanvas.remove(),this.genCanvas=null)}updateThumbs(n,o){let r=this.thumbs.length,s=this.canvas.width/this.defaultWidth,a=Math.ceil(s);var d=0;if(this.ctx.scale(this.scale,this.scale),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.canvas.clientWidth<1027){let u=this.canvas.clientWidth/this.thumbwidth,h=0,f=Math.ceil(u),m=this.canvas.clientWidth/f;do{this.ctx.putImageData(this.thumbs[h],d,0,0,0,this.thumbs[h].width,this.thumbs[h].height),d+=m,h+=Math.floor(r/u)}while(h<r)}else{s<1&&(s=1);for(let u=0;u<r;u++){d=u*this.thumbwidth*s;for(let h=0;h<a;h++)this.ctx.putImageData(this.thumbs[u],d,0,0,0,this.thumbs[u].width,this.thumbs[u].height),d+=this.thumbwidth}}this.video&&(this.video.pause(),this.video.removeAttribute("src"),this.video.load(),this.video.remove(),this.video=null)}drawVideoOnCanvas(n){let o=this.canvas.width/this.videointerval*n;o/=this.scale,this.video.onseeked=()=>{this.ctx.clearRect(o,0,this.thumbwidth/this.scale,this.canvas.height),this.ctx.drawImage(this.video,o,0);const e=n+this.signleThumbCoveredDuration;e<this.videointerval?this.drawVideoOnCanvas(e):n=0},this.video.currentTime=n}drawInitVideoOnCanvas(){return new Promise((n,o)=>{this.video.onseeked=()=>{this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height);for(let e=0;e<this.numOfthumb;e++)this.ctx.drawImage(this.video,e*this.thumbwidth/this.scale,0);n()},this.video.currentTime=0})}}var Et=p(63232),Ge=p(55918);class hn{constructor(n,o,e){this.mixedGroup=n,this.animationMapArr=o,this.textIdmap=new Map,this.linkedObjectsIdmap=new Map,this.lineSplitedTextIdmap=new Map,this.wordSplitedTextIdmap=new Map,this.charSplitedTextIdmap=new Map,this.designItemTimeLine=null,this.orignalValues=[],this.outerAnimationIdMap=e||new Map;for(const r of this.animationMapArr)this.outerAnimationIdMap.set(r.aID,r);this.designItemTimeLine=Ge.os.timeline({paused:!0})}getTimeLine(){return this.designItemTimeLine}configureTimeline(n,o){return new Promise((e,r)=>{this.canvas=n,this.createIdObjectMaps().then(()=>{this.parseAnimationMapArr(),this.setOuterStartTime(),this.setStateBeforeAnimConfig();for(const s of this.animationMapArr)if(s.loop>0){const a=Ge.os.timeline();for(const[l,c]of s.animationEntityMap.entries())if(this.textIdmap.has(+l)){let d=!0;1===s.animationCatType&&c.forEach(u=>{const h=this.isAnimating(u.meta);d=d&&h}),d&&(this.configureTextTimeline(c,a,s.animationCatType),a.vars.onStart=()=>{this.checkOtherTextObjectWithSameId(c[0].entityId,c[0].splitType)})}else for(let d=0;d<c.length;d++){const u=c[d],h=this.linkedObjectsIdmap.get(u.entityId);h&&(h.length>1?this.configureSplitAnimation(u,h,a,!1,s.animationCatType):this.configureObjectAnimation(u,h[0],a,s.animationCatType))}a.timeScale(s.timeScaleDueToloopNumber?s.timeScale*s.timeScaleDueToloopNumber:s.timeScale),a.repeat(s.loop-1),this.designItemTimeLine.add(a,(s.startTime-this.animationMapArr[0].startTime)/1e3)}o&&o.add(this.designItemTimeLine,this.animationMapArr[0].startTime/1e3),e()})})}saveOriganalState(n){this.orignalValues.push({obj:n,value:{left:n.left,top:n.top,scaleX:n.scaleX,scaleY:n.scaleY,angle:n.angle,opacity:n.opacity,selectable:!0}})}restoreOriganal(){this.orignalValues.forEach(n=>{n.obj.set(n.value),n.obj.clipPath=null,n.obj.dirty=!0,n.obj._resetOrigin()}),this.removeExtra(),this.orignalValues=[]}removeExtra(){const n=[];for(const[o,e]of this.lineSplitedTextIdmap.entries())n.push(...e);for(const[o,e]of this.wordSplitedTextIdmap.entries())n.push(...e);for(const[o,e]of this.charSplitedTextIdmap.entries())n.push(...e);this.canvas.remove(...n)}createIdObjectMaps(){return new Promise((n,o)=>{const r=this.mixedGroup.getLinkedObjects().getLinkedObjectsArray();for(const s of r)this.linkedObjectsIdmap.set(s.uid,[s]),s._setOriginToCenter(),this.saveOriganalState(s);for(const s of this.mixedGroup.getTextGroups())if("textgroup"===s.type){const a=s.getBaseText();this.textIdmap.set(a.uid,a);const l=s.getLinkedObjects().getLinkedObjectsArray();for(const d of l)this.linkedObjectsIdmap.set(d.uid,[d]),d._setOriginToCenter(),this.saveOriganalState(d);const c=s.getTextboxLinkedObjects();for(const d of c){const u=d.getLinkedObjectsArray();for(const h of u)this.linkedObjectsIdmap.has(h.uid)?this.linkedObjectsIdmap.get(h.uid).push(h):this.linkedObjectsIdmap.set(h.uid,[h]),h._setOriginToCenter(),this.saveOriganalState(h)}}else{const a=s.getLinkedObjects().getLinkedObjectsArray();for(const l of a)this.linkedObjectsIdmap.set(l.uid,[l]),l._setOriginToCenter(),this.saveOriganalState(l)}for(const s of this.animationMapArr){const a=s.map,l=new Map;for(const c in a)a.hasOwnProperty(c)&&l.set(c,a[c]);s.mapN=l}n()})}parseAnimationMapArr(){for(const n of this.animationMapArr)this.configureTextAnimationDuration(n.mapN),this.configureLinkedAnimationDuration(n.mapN),n.animationEntityMap=this.configureAnimationEntityMap(n.mapN)}setOuterStartTime(){for(const o of this.animationMapArr)if(-1===o.startAt){let e=o.startAfter,r=o.delay;for(;-1!==e;){const s=this.outerAnimationIdMap.get(e.toString());-1!==s.startAt?(e=-1,r+=s.startAt):e=s.startAfter,r+=s.delay+s.duration}o.startTime=r}else o.startTime=o.startAt+o.delay;let n=0;for(const o of this.animationMapArr){if(1===n&&(-1===o.loopTill||o.loopTill.toString()===o.aID)&&(o.loopTill=parseInt(this.animationMapArr[2].aID)),-1!==o.loopTill){const r=this.outerAnimationIdMap.get(o.loopTill.toString()).startTime-o.startTime;let s=r/o.duration;const a=Math.round(s);o.timeScaleDueToloopNumber=a*o.duration>r?o.duration/(o.duration-(a*o.duration-r)/a):o.duration/(o.duration+(r-a*o.duration)/
1a),o.continuousAnimation&&-1!=o.continuousAnimation?(o.timeScaleDueToloopNumber=1,o.loop=s):o.loop=a}else o.loop=1;this.configureTimeScale(o),n++}}configureTimeScale(n){let o=0;const e=n.mapN;for(const r of e.keys()){const s=e.get(r),a=s.startTime+(s.animationDuration?s.animationDuration:s.duration);a>o&&(o=a)}n.timeScale=o/n.duration,n.continuousAnimation&&-1!=n.continuousAnimation&&(n.timeScale=1/n.loop,n.loop=1)}setStateBeforeAnimConfig(){for(const n of this.textIdmap.values()){n._setOriginToCenter(),this.saveOriganalState(n);const o=new St.fabric.Rect({width:0,height:n.height,left:n.width/2-n.width,top:n.height/2-n.height});n.clipPath=o,n.dirty=!0}for(const n of this.linkedObjectsIdmap.keys()){const o=this.linkedObjectsIdmap.get(n);for(const e of o){const s=new St.fabric.Rect({width:e.width*e.scaleX,height:e.height*e.scaleY,left:e.left,top:e.top,angle:e.angle,absolutePositioned:!0,originX:"center",originY:"center"});e.clipPath=s,e.dirty=!0}}}configureTextTimeline(n,o,e){for(let r=0;r<n.length;r++){const s=n[r];switch(s.splitType){case 0:this.configureSplitAnimation(s,[...this.lineSplitedTextIdmap.get(s.entity
1Id)],o,!0,e);break;case 1:this.configureSplitAnimation(s,[...this.wordSplitedTextIdmap.get(s.entityId)],o,!0,e);break;case 2:this.configureSplitAnimation(s,[...this.charSplitedTextIdmap.get(s.entityId)],o,!0,e);break;case 3:const a=this.textIdmap.get(s.entityId);this.configureObjectAnimation(s,a,o,e)}}}configureSplitAnimation(n,o,e,r,s){let a=this.textIdmap.get(n.entityId);r||(a=o[0]);const l=1.2;let c=0,d=[];n.reversed&&o.reverse();let u=n.duration;n.duration!==n.freqDuration&&(u=n.freqDuration);const h=n.duration/n.freqDuration,f=Et.W.getGSAPEasyType(n.easingType,n.numberOFBounces,n.stiffness,n.shake,this.mixedGroup.getDesignItem().designEntityId+"_"+n.entityId),m=o;r&&(o=Et.W.arrayDeepClone(o));for(let T=0;T<n.meta.length;T++){const b=n.meta[T],_=a.angle+b.angle,v=a.scaleX*b.scale,C=a.scaleY*b.scale,y=b.yOff?-b.yOff:b.y,w=b.xOff?-b.xOff:b.x;if(0===T)m.forEach((x,E)=>{const N=Et.W.getOffset(n,w,y,E,o,this.canvas,a,!!b.xOff,!!b.yOff),A={left:N.x,top:N.y,scaleX:r?v:x.scaleX*b.scale,scaleY:r?C:x.scaleY*b.scale,angle:_,objectCaching:!1,opacity:b.alpha*a.opacity,selectable:!1,dirty:!0};let I;if(b.yOff){let P=x.height/2-x.height;b.yOff>0?P*=3:P=-P,I={width:x.width,height:x.height,left:x.width/2-x.width,top:P}}else if(b.xOff){let P=x.width/2-x.width;b.xOff>0?P*=3:P=-P,I={width:x.width,height:x.height,left:P,top:x.height/2-x.height}}else I={width:x.width*b.wMask*l,height:x.height*b.hMask*l,left:x.width*b.xMask*l-x.width*l/2,top:x.height*b.yMask*l-x.height*l/2,absolutePositioned:!1,originX:"left",originY:"top"};2===s?(e.call(P=>x.set(P),[A],n.startTime/1e3),e.call(P=>x.clipPath.set(P),[I],n.startTime/1e3)):(e.call(P=>x.set(P),[A],(n.startTime+E*n.delaySplit)/1e3),e.call(P=>{x.clipPath.set(P),x.set({dirty:!0})},[I],(n.startTime+E*n.delaySplit)/1e3)),d[E]=I,E++});else if(T>0){const x=u*(b.startFactor-c),E=n.startTime+c*u;c=b.startFactor;for(let N=0;N<h;N++)m.forEach((A,I)=>{const P=Et.W.getOffset(n,w,y,I,o,this.canvas,a,!!b.xOff,!!b.yOff),z={duration:x/1e3,left:P.x,top:P.y,scaleX:r?v:A.scaleX*b.scale,scaleY:r?C:A.scaleY*b.scale,angle:_,opacity:b.alpha*a.opacity,ease:f};n.meta.length-1===T&&h-1===N&&1===s&&o[I].set(z),e.to(A,z,(E+I*n.delaySplit+N*u)/1e3)}),d.forEach((A,I)=>{let P;if(b.yOff){let z=m[I].height/2-m[I].height;b.yOff>0?z*=3:z=-z,P={width:m[I].width,height:m[I].height,left:m[I].width/2-m[I].width,top:z}}else if(b.xOff){let z=m[I].width/2-m[I].width;b.xOff>0?z*=3:z=-z,P={width:m[I].width,height:m[I].height,left:z,top:m[I].height/2-m[I].height}}else P={width:m[I].width*b.wMask*l,height:m[I].height*b.hMask*l,left:m[I].width*b.xMask*l-m[I].width*l/2,top:m[I].height*b.yMask*l-m[I].height*l/2};e.to(A,{duration:x/1e3,left:P.left,top:P.top,width:P.width,height:P.height,stagger:n.delaySplit/1e3,ease:f,absolutePositioned:!1,originX:"left",originY:"top",onUpdate(){m[I].clipPath.set(A),m[I].set("dirty",!0)}},(E+I*n.delaySplit+N*u)/1e3)})}}}configureObjectAnimation(n,o,e,r){const s=o;let a=n.duration;n.duration!==n.freqDuration&&(a=n.freqDuration);const l=n.duration/n.freqDuration,c=Et.W.getGSAPEasyType(n.easingType,n.numberOFBounces,n.stiffness,n.shake,this.mixedGroup.getDesignItem().designEntityId+"_"+n.entityId),u=o;let h=null,f=0;for(let m=0;m<n.meta.length;m++){const T=n.meta[m],b=s.angle+T.angle;let _=s.scaleX*T.scale,v=s.scaleY*T.scale;if(0===_&&(_=1e-4),0===v&&(v=1e-4),0===m){const C=Et.W.getOffset(n,T.x,T.y,0,[o],this.canvas,this.mixedGroup.baseContainer),y={left:C.x,top:C.y,scaleX:_,scaleY:v,angle:b,opacity:T.alpha*s.opacity,selectable:!1};h={width:u.width*y.scaleX*T.wMask,height:u.height*y.scaleY*T.hMask,left:y.left-u.width*(1-T.wMask)*u.scaleX/2+u.width*u.scaleX*T.xMask,top:y.top-u.height*(1-T.hMask)*u.scaleY/2+u.height*u.scaleY*T.yMask,angle:b,absolutePositioned:!0,originX:"center",originY:"center"},e.call(w=>{u.set(w)},[y],0)}else if(m>0){const C=a*(T.startFactor-f),y=n.startTime+f*a;f=T.startFactor;const w=Et.W.getOffset(n,T.x,T.y,0,[o],this.canvas,this.mixedGroup.baseContainer);for(let x=0;x<l;x++){const E={duration:C/1e3,left:w.x,top:w.y,scaleX:_,scaleY:v,angle:b,opacity:T.alpha*s.opacity,stagger:n.delaySplit/1e3,ease:c};n.meta.length-1===m&&l-1===x&&1===r&&o.set(E),e.to(u,E,(y+x*a)/1e3),e.to(h,{duration:C/1e3,left:E.left-u.width*(1-T.wMask)*u.scaleX/2+u.width*u.scaleX*T.xMask,top:E.top-u.height*(1-T.hMask)*u.scaleY/2+u.height*u.scaleY*T.yMask,width:u.width*E.scaleX*T.wMask,height:u.height*E.scaleY*T.hMask,angle:b,ease:c,absolutePositioned:!0,originX:"center",originY:"center",onStart(){if
1(!u.clipPath){const A=new St.fabric.Rect(h);u.clipPath=A}},onUpdate(){if(!u.clipPath){const A=new St.fabric.Rect(h);u.clipPath=A}u.clipPath&&(u.clipPath.set(h),u.set("dirty",!0))},onComplete(){}},(y+x*a)/1e3)}}}}configureTextAnimationDuration(n){for(const o of n.keys()){const e=n.get(o);if(e.splitType>=0&&this.textIdmap.has(e.entityId)){const r=this.textIdmap.get(e.entityId);let s=[];switch(e.splitType){case 0:if(this.lineSplitedTextIdmap.has(r.uid))s=this.lineSplitedTextIdmap.get(r.uid);else{s=Et.W.splitLines(r),this.lineSplitedTextIdmap.set(r.uid,s);const l=this.canvas.getIndexOf(r);this.canvas.add(...s);for(let c=s.length-1;c>=0;c--)this.canvas.moveTo(s[c],l)}break;case 1:if(this.wordSplitedTextIdmap.has(r.uid))s=this.wordSplitedTextIdmap.get(r.uid);else{s=Et.W.splitWords(r),this.wordSplitedTextIdmap.set(r.uid,s);const l=this.canvas.getIndexOf(r);this.canvas.add(...s);for(let c=s.length-1;c>=0;c--)this.canvas.moveTo(s[c],l)}break;case 2:if(this.charSplitedTextIdmap.has(r.uid))s=this.charSplitedTextIdmap.get(r.uid);else{s=Et.W.splitChars(r),this.charSplitedTextIdmap.set(r.uid,s);const l=this.canvas.getIndexOf(r);this.canvas.add(...s);for(let c=s.length-1;c>=0;c--)this.canvas.moveTo(s[c],l)}}e.animationDuration=e.duration+e.delaySplit*(s.length-1)}}}configureLinkedAnimationDuration(n){for(const o of n.keys()){const e=n.get(o);if(e.hasOwnProperty("durationLinkedToAnimationId")){let r=e.durationLinkedToAnimationId;for(;-1!==r&&n.has(r.toString());){const s=n[r];s?s.hasOwnProperty("durationLinkedToAnimationId")?-1===s.durationLinkedToAnimationId?(e.duration=s.animationDuration?s.animationDuration:s.duration,e.duration=e.duration*e.durationScale,r=-1):r=s.durationLinkedToAnimationId:(r=-1,e.duration=s.animationDuration?s.animationDuration:s.duration,e.duration=e.duration*e.durationScale):(r=-1,e.duration=0)}}}}configureAnimationEntityMap(n){const o=new Map;for(const e of n.keys()){const r=n.get(e);if(-1===r.startAt){let s=r.startAfter,a=r.delay;for(;-1!==s;){const l=n.get(s.toString());s=-1!==l.startAt?-1:l.startAfter,a+=l.delay+(l.animationDuration?l.animationDuration:l.duration)}r.startTime=a}else r.startTime=r.startAt+r.delay;if(o.has(r.entityId)){const s=o.get(r.entityId);s.length>0&&r.startTime<s[0].startTime?s.unshift(r):s.push(r)}else{const s=new Array;s.push(r),o.set(r.entityId,s)}}return o}checkOtherTextObjectWithSameId(n,o){if(0!==o){let e=this.lineSplitedTextIdmap.get(n);e&&e.length>0&&e.forEach(r=>{const s={width:0,height:0,left:r.width-r.width/2,top:r.height-r.height/2};r.set({dirty:!0}),r.clipPath.set(s)})}if(1!==o){let e=this.wordSplitedTextIdmap.get(n);e&&e.length>0&&e.forEach(r=>{const s={width:0,height:0,left:r.width-r.width/2,top:r.height-r.height/2};r.set({dirty:!0}),r.clipPath.set(s)})}if(2!==o){let e=this.charSplitedTextIdmap.get(n);e&&e.length>0&&e.forEach(r=>{const s={width:0,height:0,left:r.width-r.width/2,top:r.height-r.height/2};r.set({dirty:!0}),r.clipPath.set(s)})}if(3!==o){let e=this.textIdmap.get(n);const r=new St.fabric.Rect({width:0,height:0,left:e.width-e.width/2,top:e.height-e.height/2});e.set({dirty:!0}),e.clipPath=r}}isclipPathEqual(n,o){return n.left===o.left&&n.top===o.top&&n.width===o.width&&n.height===o.height}makeCloneImage(n){return new Promise((o,e)=>{const r=n.angle;n.set({scaleX:4*n.scaleX,scaleY:4*n.scaleY}),!0===n.strokeUniform&&n.set({strokeWidth:4*n.strokeWidth}),n.rotate(0),n.cloneAsImage(s=>{s.width>0&&s.height>0?(s.uid=n.uid,s.originX="center",s.originY="center",s.left=n.left,s.top=n.top,s.set({scaleX:s.scaleX/4,scaleY:s.scaleY/4}),s.zOrder=n.zOrder,s.rotate(r),o(s)):e(n)},{})})}setLoop(n){this.loop=n,n?(this.designItemTimeLine.repeat(-1),this.designItemTimeLine.vars.onRepeat=()=>{this.invisibleFromCanvas()}):this.designItemTimeLine.vars.onComplete=()=>{}}invisibleFromCanvas(){const n=[];for(const[o,e]of this.textIdmap.entries())n.push(e);for(const[o,e]of this.lineSplitedTextIdmap.entries())n.push(...e);for(const[o,e]of this.wordSplitedTextIdmap.entries())n.push(...e);for(const[o,e]of this.charSplitedTextIdmap.entries())n.push(...e);
1for(const[o,e]of this.linkedObjectsIdmap.entries())n.push(...e);n.forEach(o=>{const e=new St.fabric.Rect({width:0,height:0,left:o.width-o.width/2,top:o.height-o.height/2});o.clipPath=e,o.set({dirty:!0})})}play(){this.designItemTimeLine.vars.onStart=()=>{},this.designItemTimeLine.play()}pause(){this.designItemTimeLine.pause()}stop(){this.designItemTimeLine.kill()}seek(n){this.designItemTimeLine.seek(n,!1)}addToCanvas(n){for(const[o,e]of this.lineSplitedTextIdmap.entries()){const r=this.textIdmap.get(o),s=this.canvas.getIndexOf(r);this.canvas.add(...e);for(let a=e.length-1;a>=0;a--)this.canvas.moveTo(e[a],s)}for(const[o,e]of this.wordSplitedTextIdmap.entries()){const r=this.textIdmap.get(o),s=this.canvas.getIndexOf(r);this.canvas.add(...e);for(let a=e.length-1;a>=0;a--)this.canvas.moveTo(e[a],s)}for(const[o,e]of this.charSplitedTextIdmap.entries()){const r=this.textIdmap.get(o),s=this.canvas.getIndexOf(r);this.canvas.add(...e);for(let a=e.length-1;a>=0;a--)this.canvas.moveTo(e[a],s)}}isAnimating(n){let o=!1;for(let e=1;e<n.length&&!o;e++)n[e-1].scale!==n[e].scale&&(o=!0),n[e-1].x!==n[e].x&&(o=!0),n[e-1].xMask!==n[e].xMask&&(o=!0),n[e-1].y!==n[e].y&&(o=!0),n[e-1].hMask!==n[e].hMask&&(o=!0),n[e-1].angle!==n[e].angle&&(o=!0),n[e-1].yMask!==n[e].yMask&&(o=!0),n[e-1].alpha!==n[e].alpha&&(o=!0),n[e-1].wMask!==n[e].wMask&&(o=!0);return o}}class uo{constructor(n,o,e){this.mediaContainer=n,this.animationMapArr=o,this._timeline=null,this.mediaIdmap=new Map,this.maskAnimationMap=new Map,this.objectFrame=null,this.objectMask=null,this.objectInAnimationStateMap=new Map,this.containerAnimationState=null,this.orignalValues=[],this.outerAnimationIdMap=e||new Map;for(const s of this.animationMapArr){let a=s.map;const l=new Map;for(const c in a)a.hasOwnProperty(c)&&a[c]&&l.set(c,a[c]);s.mapN=l}const r=this.mediaContainer.getMediaObjects();for(const s of r)s._setOriginToCenter(),this.saveOriganalState(s),this.mediaIdmap.set(s.uid,[s]);this.objectFrame=this.mediaContainer.getFrameObject(),this.objectMask=this.mediaContainer._svgMask.getBaseSVGObject(),this.objectMask._setOriginToCenter(),this.saveOriganalState(this.objectMask);for(const s of this.animationMapArr)this.outerAnimationIdMap.set(s.aID,s)}addToCanvas(n){throw new Error("Method not implemented.")}getTimeLine(){return this._timeline}configureTimeline(n){return new Promise((o,e)=>{this.canvas=n,this._timeline=Ge.os.timeline({paused:!0});for(const r of this.animationMapArr)r.animationEntityMap=this.configureAnimationEntityMap(r.mapN);this.setOuterStartTime(),this.mergeMaskAndObjectMeta(),this.configureAnimation(),o()})}configureAnimationEntityMap(n){const o=new Map;for(const e of n.keys()){const r=n.get(e);if(r){if(-1===r.startAt){let s=r.startAfter,a=r.delay;for(;-1!==s;){const l=n.get(s.toString());s=-1!==l.startAt?-1:l.startAfter,a+=l.delay+(l.animationDuration?l.animationDuration:l.duration)}r.startTime=a}else r.startTime=r.startAt+r.delay;if(o.has(r.entityId)){const s=o.get(r.entityId);s.length>0&&r.startTime<s[0].startTime?s.unshift(r):s.push(r)}else{const s=new Array;s.push(r),o.set(r.entityId,s)}}}return o}getInAnimationStateMap(){return this.objectInAnimationStateMap}getContainerStateObject(){return this.containerAnimationState}configureAnimation(){for(const n of this.animationMapArr)if(n.duration>0&&n.loop>0){const o=Ge.os.timeline();for(const[e,r]of n.animationEntityMap.entries())for(let s=0;s<r.length;s++){const a=r[s];let l=null;l=this.mediaIdmap.has(e)?this.mediaIdmap.get(a.entityId):[this.objectMask];for(let c of l)this.configureObjectAnimation(a,c,n,o)}o.timeScale(n.timeScaleDueToloopNumber?n.timeScale*n.timeScaleDueToloopNumber:n.timeScale),o.repeat(n.loop-1),this._timeline.add(o,(n.startTime-this.animationMapArr[0].startTime)/1e3)}}mergeMaskAndObjectMeta(){for(const n of this.animationMapArr){let o=null,e=!1;for(const[r,s]of n.animationEntityMap.entries())for(let a=0;a<s.length;a++)if(!this.mediaIdmap.has(r)){o=s[a];let l=0,c=0,d=0,u=1;for(let h=0;h<o.meta.length;h++)h>0&&(l!=o.meta[h].x||c!=o.meta[h].y||d!=o.meta[h].angle||u!=o.meta[h].scale)&&(e=!0),l=o.meta[h].x,c=o.meta[h].y,d=o.meta[h].angle,u=o.meta[h].scale}e&&this.maskAnimationMap.set(n.animationCatType,!0)}}configureObjectAnimation(n,o,e,r){const s=o;let a=n.duration,l=n.duration/n.freqDuration;l>1&&(a=n.freqDuration);const c=Et.W.getGSAPEasyType(n.easingType,n.numberOFBounces,n.stiffness,n.shake,this.mediaContainer.getDesignItem().designEntityId+"_"+n.entity
1Id),d=this,u=o;let h=null,f=0;for(let m=0;m<n.meta.length;m++){const T=n.meta[m];let b=s.angle+T.angle,_=T.scale,v=s.scaleX*_,C=s.scaleY*_,y=o;o!==d.objectFrame&&o!==d.objectMask&&d.maskAnimationMap.has(e.animationCatType)&&(y=d.objectFrame);let w=s.left+Et.W.getXOffset(n,T.x,0,[y],this.canvas,y),x=s.top-Et.W.getYOffset(n,T.y,0,[y],this.canvas,y);if(o==d.objectMask&&(v=s.scaleX*_*T.wMask,C=s.scaleY*_*T.hMask,w=w-u.width*(1-T.wMask)*u.scaleX/2+u.width*u.scaleX*T.xMask,x=x-u.height*(1-T.hMask)*u.scaleY/2+u.height*u.scaleY*T.yMask),0===m)h={left:w,top:x,scaleX:v,scaleY:C,angle:b,objectCaching:!1,opacity:T.alpha*s.opacity,dirty:!0,selectable:!1},r.set(u,h,0);else if(m>0){const E=a*(T.startFactor-f);let N=n.startTime+f*a;1===e.multiImageType&&(N=f*a),f=T.startFactor;for(let A=0;A<l;A++)(w!=h.leftPos||x!=h.topPos||v!=h.scaleX||C!=h.scaleY||b!=h.angle||T.alpha!==h.opacity)&&r.to(u,{duration:E/1e3,left:w+0,top:x+0,scaleX:v,scaleY:C,angle:b,opacity:T.alpha*s.opacity,stagger:n.delaySplit/1e3,ease:c},(N+A*a)/1e3)}}}setOuterStartTime(){for(const o of this.animationMapArr)if(-1===o.startAt){let e=o.startAfter,r=o.delay;for(;-1!==e;){const s=this.outerAnimationIdMap.get(e.toString());-1!==s.startAt?(e=-1,r+=s.startAt):e=s.startAfter,r+=s.delay+s.duration}o.startTime=r}else o.startTime=o.startAt+o.delay;let n=0;for(const o of this.animationMapArr){if(1===n&&(-1===o.loopTill||o.loopTill.toString()===o.aID)&&(o.loopTill=parseInt(this.animationMapArr[2].aID)),-1===o.loopTill||o.parallaxType>0||1===o.multiImageType)o.loop=1;else{const r=this.outerAnimationIdMap.get(o.loopTill.toString()).startTime-o.startTime;let s=r/o.duration;const a=Math.round(s);o.timeScaleDueToloopNumber=a*o.duration>r?o.duration/(o.duration-(a*o.duration-r)/a):o.duration/(o.duration+(r-a*o.duration)/a),o.continuousAnimation&&-1!=o.continuousAnimation?(o.timeScaleDueToloopNumber=1,o.loop=s):o.loop=a}this.configureTimeScale(o),n++}}configureTimeScale(n){if(n.duration>0){let o=0;const e=n.mapN;for(const r of e.keys()){const s=e.get(r),a=s.startTime+(s.animationDuration?s.animationDuration:s.duration);a>o&&(o=a)}n.timeScale=o/n.duration,n.continuousAnimation&&-1!=n.continuousAnimation&&(n.timeScale=1/n.loop,n.loop=1)}else n.timeScale=1}saveOriganalState(n){this.orignalValues.push({obj:n,value:{left:n.left,top:n.top,scaleX:n.scaleX,scaleY:n.scaleY,angle:n.angle,opacity:n.opacity,selectable:!0}})}restoreOriganal(){this.orignalValues.forEach(n=>{n.obj.set(n.value),n.obj._resetOrigin()}),this.orignalValues=[]}}class mn{constructor(){this.tempStartTime=0}get endTime(){return this.startTime+this.duration}isVideo(){return"video"===this.trackItemType}getTrackId(){return this.trackId}get track(){return this._track}set track(n){this._track=n}}class Qt extends mn{constructor(n,o=!1,e){super(),this.designItem=n,this.creatingTimeLine=!1,this.showing=!0;const r=n.getAnimationMapArr();if(this.animationMapArray=r,this.attachedObject=n,this.trackId=n.getDesignItem().trackId,this.setTrackItemType(n),o){if("video"===this.trackItemType){const s=this.attachedObject.getDesignItem().box.imgArray[0];r[2].startAt=e.duration<s.trimEnd?e.endTime-r[2].duration:s.trimEnd-r[2].duration}else if("text"===this.trackItemType){const s=e.attachedObject.getAnimationMapArr();r[0].Orignalduration=r[0].duration,r[2].Orignalduration=r[2].duration,r[0].duration=s[0].duration,r[2].duration=s[2].duration,r[2].startAt=s[2].startTime,r[0].startAt=s[0].startTime}this.onEndTimeChange=e.onEndTimeChange}this.startTime=r[0].startAt,r[0].startTime=r[0].startAt,r[2].startTime=r[2].startAt,this.duration=r[2].startAt+r[2].duration-r[0].startAt,"animated"===this.trackItemType&&this.attachedObject.pauseLottie(),this.attachedObject.trackItemId=this.trackItemId,this.attachedObject.trackItemDurationChanged=s=>{this.duration=r[2].startAt+r[2].duration-r[0].startAt,this.onEndTimeChange(this),s&&this.zoom()}}get endTime(){return this.startTime+this.duration}isVideo(){return"video"===this.trackItemType}makeThumbGanarator(n,o,e,r){"video"===this.trackItemType&&(this.thumbGenerator=new co(this.attachedObject,n,o,e),this.thumbGenerator.defaultThumbGeneratedCb=s=>{r(s)})}zoom(){setTimeout(()=>{this.thumbGenerator.setZoom()},0)}setTrackItemType(n){const o=n.getDesignItem();if(o.itemType===It.SP.MEDIA_CONTAINER)this.animationTitle="media",this.trackItemType=n.getMedia()instanceof HTMLVideoElement?"video":"image";
1else if(o.itemType===It.SP.CANVAS)switch(o.canvas.itemType){case Ht.Q.ILLUSTRATIONS:this.animationTitle="illustration",this.trackItemType="element";break;case Ht.Q.TEXT:this.animationTitle="text",this.trackItemType="text";break;case Ht.Q.SHAPE:this.animationTitle="shape",this.trackItemType="element";break;case Ht.Q.STICKERS:this.animationTitle="sticker",this.trackItemType="sticker"}else o.itemType===It.SP.LOTTIE&&(this.animationTitle="animated",this.trackItemType="animated")}isCutable(n){throw new Error("Method not implemented.")}split(n){throw new Error("Method not implemented.")}getOrder(){return this.designItem.getDesignItem().designZOrder}getTrackId(){return this.trackId}setOrder(n){this.designItem.getDesignItem().designZOrder=n,this.attachedObject.ansureZindex(20*n)}setTrackId(n){this.trackId=n,this.attachedObject.getDesignItem().trackId=n}get track(){return this._track}set track(n){this._track=n}changeStartTime(n,o=!0){const e=this.designItem.getAnimationMapArr(),r=n-e[0].startAt;e[0].startAt+=r,e[2].startAt+=r,e[0].startTime+=r,e[1].startTime+=r,e[2].startTime+=r,this.startTime=e[0].startAt,o&&this.onEndTimeChange(this),this.tempStartTime=0}changeDuration(n,o,e,r=!0){const s=this.animationMapArray[0],a=this.animationMapArray[2],l=this.designItem.getAnimationMapArr(),c=l[2].startAt+l[2].duration-l[0].startAt;let d=-1;if("video"===this.trackItemType){const f=this.attachedObject.getDesignItem().box.imgArray[0],T=1e3*this.attachedObject.getMedia().duration;d="left"===e?f.trimEnd:T-f.trimStart,d/=f.speedFactor?f.speedFactor:1}let u=s.duration+a.duration;if(s.Orignalduration&&a.Orignalduration&&(u=s.Orignalduration+a.Orignalduration),u>n||ht.b.VE_TRACK_ITEM_MINIMUM_DURATION>n?"animated"===this.trackItemType?n=u:(n<ht.b.VE_TRACK_ITEM_MINIMUM_DURATION&&(n=ht.b.VE_TRACK_ITEM_MINIMUM_DURATION),s.Orignalduration||(s.Orignalduration=s.duration),a.Orignalduration||(a.Orignalduration=a.duration),s.duration=s.Orignalduration*n/u,a.duration=a.Orignalduration*n/u):-1!=d&&d<n&&(n=d),s.Orignalduration&&a.Orignalduration){const f=s.Orignalduration+a.Orignalduration;n>=f&&f>s.duration+a.duration&&(s.duration=s.Orignalduration,a.duration=a.Orignalduration)}const h=c-n;"left"===e?(l[0].startAt+=h,l[0].startTime=l[0].startAt,this.startTime=l[0].startAt,l[2].startAt=l[0].startAt+n-l[2].duration,l[2].startTime=l[2].startAt):(l[2].startAt=l[0].startAt+n-l[2].duration,l[2].startTime=l[2].startAt),this.checkVideoTrim(h,e),this.duration=n,o&&o.arrangeTrackItemsAfterNewItem(),r&&this.onEndTimeChange(this)}checkVideoTrim(n,o){if("video"===this.trackItemType){const e=this.attachedObject.getDesignItem().box.imgArray[0],r=e.speedFactor?e.speedFactor:1;"left"==o?e.trimStart+=n*r:e.trimEnd-=n*r}}parserTimeLine(){throw new Error("Method not implemented.")}get trackItemId(){return this.attachedObject.getDesignItem().designEntityId}show(n,o,e){var r=this;return(0,ot.A)(function*(){if(!r.showing&&n?(r.showing=!0,r.attachedObject.showOnCanvas(!0)):r.showing&&!n&&(r.showing=!1,r.attachedObject.showOnCanvas(!1)),e){if("animated"!==r.trackItemType)if(!r.anim&&n)r.createTimeline(o);else if(r.anim&&n){const s=(o-r.animationMapArray[0].startAt)/1e3;r.anim.getTimeLine().seek(s,!1)}else r.anim&&!n&&r.anim instanceof hn&&r.anim.invisibleFromCanvas()}else r.creatingTimeLine=!1,r.anim&&r.anim.restoreOriganal(),r.anim=null;n&&("animated"===r.trackItemType||"video"===r.trackItemType)&&(yield r.attachedObject.seek(o,!0))})()}createTimeline(n){if(!this.creatingTimeLine)if(this.creatingTimeLine=!0,this.designItem.getDesignItem().itemType===It.SP.CANVAS){const o=new hn(this.designItem,this.designItem.getAnimationMapArr());o.configureTimeline(this.designItem.getCanvas()).then(()=>{this.anim=o,o.getTimeLine().seek(n-this.animationMapArray[0].startAt/1e3,!1)})}else if(this.designItem.getDesignItem().itemType===It.SP.MEDIA_CONTAINER){const o=new uo(this.designItem,this.designItem.getAnimationMapArr());o.configureTimeline(this.designItem.getCanvas()).then(()=>{this.anim=o,o.getTimeLine().seek(n-this.animationMapArray[0].startAt/1e3,!1)})}}}class xe extends mn{constructor(n,o=!1,e){super(),this.audioObject=n,this.attachedObject=n,this.trackId=n.trackId,this.animationTitle="music",this.trackItemType="audio",o?(n.startTime=e.attachedObject.
1startTime,this.onEndTimeChange=e.onEndTimeChange,n.trackItemId=e.trackItemId):n.trackItemId||(n.trackItemId=Math.floor(1e6*Math.random()+1)),this.startTime=n.startTime,this.duration=n.trimEnd-n.trimStart,this.attachedObject.trackItemDurationChanged=r=>{this.duration=n.trimEnd-n.trimStart,this.onEndTimeChange(this)}}get endTime(){return this.startTime+this.duration}isVideo(){return!1}makeThumbGanarator(n,o,e,r){}zoom(){}isCutable(n){throw new Error("Method not implemented.")}split(n){throw new Error("Method not implemented.")}getOrder(){return this.attachedObject.order}getTrackId(){return this.trackId}setOrder(n){this.attachedObject.order=n}setTrackId(n){this.trackId=n,this.attachedObject.trackId=n}get track(){return this._track}set track(n){this._track=n}changeStartTime(n,o=!0){this.startTime=n,this.attachedObject.startTime=n,o&&this.onEndTimeChange(this),this.tempStartTime=0}changeDuration(n,o,e,r=!0){let s=-1;const a=this.attachedObject.speedFactor?this.attachedObject.speedFactor:1;s="left"===e?this.attachedObject.trimEnd/a:this.attachedObject.audioElementDuration/a-this.attachedObject.trimStart;let c=ht.b.VE_TRACK_ITEM_MINIMUM_DURATION;-1!=s&&s<n?n=s:c>n&&(n=c);const u=this.attachedObject.trimEnd-this.attachedObject.trimStart-n;"left"===e?(this.attachedObject.startTime+=u,this.startTime=this.attachedObject.startTime,this.attachedObject.trimStart=(this.attachedObject.trimStart+u)*a):this.attachedObject.trimEnd=(this.attachedObject.trimEnd-u)*a,this.duration=n,o&&o.arrangeTrackItemsAfterNewItem(),r&&this.onEndTimeChange(this)}parserTimeLine(){throw new Error("Method not implemented.")}get trackItemId(){return this.attachedObject.trackItemId}show(n,o,e){return(0,ot.A)(function*(){})()}createTimeline(n){}}class fn{constructor(n,o,e,r,s,a,l,c){var d=this;this.timeLine=o,this.timelineParser=e,this.sceneAnimationObj=r,this.sceneController=s,this.videoService=a,this.http=l,this.audioToolService=c,this.currentTime=0,this.duration=0,this.mute=!1,this.displayedDuration=0,this.isPlaying=!1,this.playingInprogress=!1,this.minDuration=0,this.seekinProgress=!1,this.tracks=n,this.tracks.forEach(u=>u.ontEndTimeChange=h=>this.handleTrackEndTimeChange(h)),this.ansureTracksOrder(),this.updateDuration(),this.videoService.addTrackItemFn=function(){var u=(0,ot.A)(function*(h,f={}){if(Array.isArray(h)){let m=yield d.addMultipleNewTrackItem(h);d.updateDuration();for(const T of m)d.checkDoAction(T);m&&m.length>0&&d.setHistory()}else if("audioobject"==h.type)if(h.isReplace){const m=d.tracks.find(T=>T.trackItems.find(b=>b.trackItemId===h.trackItemId));if(m){const T=m.trackItems.find(v=>v.trackItemId===h.trackItemId),b=m.trackItems.indexOf(T),_=new xe(h,!0,T);b>-1&&(m.trackItems.splice(b,1,_),m.arrangeTrackItemsAfterNewItem(),m.handleTrackItemEndTimeChange()),d.updateDuration(),d.checkDoAction(_),d.setAudio(),d.setHistory()}}else{let m=yield d.addNewTrackItemAduio(h,f);d.updateDuration(),d.checkDoAction(m),d.setAudio(),d.setHistory()}else if(h.isReplace){const m=d.tracks.find(T=>T.trackItems.find(b=>b.trackItemId===h.getDesignItem().designEntityId));if(m){const T=m.trackItems.find(v=>v.trackItemId===h.getDesignItem().designEntityId),b=m.trackItems.indexOf(T),_=new Qt(h,!0,T);b>-1&&(m.trackItems.splice(b,1,_),m.arrangeTrackItemsAfterNewItem(),m.handleTrackItemEndTimeChange()),d.updateDuration(),m.updateTrackType(),d.checkDoAction(_),h.isTextEdit||d.setHistory()}}else{let m=yield d.addNewTrackItem(h);d.updateDuration(),d.checkDoAction(m),m&&d.setHistory()}});return function(h){return u.apply(this,arguments)}}(),this.videoService.deleteAudioFn=()=>{this.updateDuration(),this.setAudio()}}checkDoAction(n){("video"===n.trackItemType||"audio"===n.trackItemType)&&(this.isAlreadyVideoOrAudioAdded(1)||this.videoService.doActionFn&&this.videoService.doActionFn({action:"ruler-fit"}))}isAlreadyVideoOrAudioAdded(n=0){let o=0;for(let e=0;e<this.tracks.length;e++)for(let r=0;r<this.tracks[e].trackItems.length;r++)if(("video"===this.tracks[e].trackItems[r].trackItemType||"audio"===this.tracks[e].trackItems[r].trackItemType)&&(o+=1,o-n>=1))return!0;return!1}addMultipleNewTrackItem(n){var o=this;return(0,ot.A)(function*(){const e=o.tracks.length&&o.duration===o.currentTime?o.currentTime+1:o.currentTime;let r=e,s=0;const a=[];for(const l of n){const c=l.getAnimationMapArr();o.calculateDurationForNewTrackItem(l);const d=c[2].startAt+c[2].duration-c[0].startAt;s+=d,c[2].startAt+=r,c[0].startAt+=r,r+=d+1;const u=new Qt(l);a.push(u)}if(o.tracks.length>0&&o.tracks[0].isSpaceAvailableForNewTrackItem(e,s)){for(const l of a)o.tracks[0].addTrackItem(l);o.tracks[0].updateTrackType()}else{const l=o.tracks.length>0?o.tracks[0].getOrder()+1:1;a.forEach(d=>d.setOrder(l)),o.sceneController.getCanvas().requestRenderAll();const c=new $t(null,a);c.ontEndTimeChange=d=>o.handleTrackEndTimeChange(d),o.tracks.unshift(c),c.updateTrackType()}return a})()}addNewTrackItem(n){var o=this;return(0,ot.A)(function*(){const e=n.getAnimationMapArr();o.calculateDurationForNewTrackItem(n);const r=o.tracks.length&&o.duration===o.currentTime?o.currentTime+1:o.currentTime,s=e[2].startAt+e[2].duration-e[0].startAt;e[2].startAt+=r,e[0].startAt+=r;const a=new Qt(n);if(o.tracks.length>
10&&o.tracks[0].isSpaceAvailableForNewTrackItem(r,s))o.tracks[0].addTrackItem(a),o.tracks[0].updateTrackType();else{const l=o.tracks.length>0?o.tracks[0].getOrder()+1:1;a.setOrder(l),o.sceneController.getCanvas().requestRenderAll();const c=new $t(null,[a]);c.ontEndTimeChange=d=>o.handleTrackEndTimeChange(d),o.tracks.unshift(c),c.updateTrackType()}return a})()}addNewTrackItemAduio(n){var o=this;return(0,ot.A)(function*(e,r={}){let s;const a=e.audioElementDuration;typeof r.startTime<"u"?s=e.startTime:(e.startTime=o.currentTime,s=o.currentTime);const l=new xe(e);let c=!1;if(r.isDetach&&(c=r.isDetach),!c&&o.tracks.length>0&&o.tracks[o.tracks.length-1].isSpaceAvailableForNewTrackItem(s,a))o.tracks[o.tracks.length-1].addTrackItem(l),o.tracks[o.tracks.length-1].updateTrackType();else{const d=o.tracks.length>0?o.tracks[o.tracks.length-1].getOrder()-1:1;l.setOrder(d);const u=new $t(null,[l]);if(u.ontEndTimeChange=h=>o.handleTrackEndTimeChange(h),c){let h=o.getAudioFirstIndex();o.tracks.splice(h,0,u)}else o.tracks.push(u);u.updateTrackType()}return l}).apply(this,arguments)}getAudioFirstIndex(){for(let n=0;n<this.tracks.length;n++)if(3===this.tracks[n].type)return n;return this.tracks.length}handleTrackEndTimeChange(n){this.updateDuration(),this.seekToTime(this.currentTime,!1)}calculateDurationForNewTrackItem(n){const o=n.getAnimationMapArr();let e;e=this.displayedDuration>this.duration?(this.duration||this.displayedDuration)/4:this.displayedDuration/4;const r=o[0].duration+o[2].duration;if("andorLottie"===n.type&&(e=Math.round(e/o[0].duration)*o[0].duration,o[2].startAt=e-o[2].duration),"mediacontainer"===n.type){const s=n.getMedia();s instanceof HTMLVideoElement?(e=1e3*s.duration,o[2].startAt=e-o[2].duration):(e=5e3,o[2].startAt=e-o[2].duration)}else o[2].startAt=e<r?o[0].duration:e-o[2].duration}animationRenderAll(n,o){const e=()=>{n.renderAll();const r=this.duration;let s=o.progress();if(this.currentTime=r*s,this.isPlaying){this.videoService.doActionFn&&this.videoService.doActionFn({action:"current-time"});const a=St.fabric.util.requestAnimFrame(e);this.playObject&&(this.playObject.req=a)}};St.fabric.util.requestAnimFrame(e)}play(n){var o=this;return(0,ot.A)(function*(){if(!o.isPlaying){o.isPlaying=!0,o.playingInprogress=!0;const e=yield o.timelineParser.parseTimelineAtPlay(o.sceneController,o.currentTime,o.mute);o.playObject=e,e.timeline.seek(o.currentTime/1e3,!1),e.timeline.vars.onComplete=r=>{o.currentTime=0,n&&n()},e.timeline.play(),o.playingScene=e.scene,e.zone.runOutsideAngular(()=>o.animationRenderAll(e.canvas,e.timeline)),o.playingInprogress=!1}})()}pause(){var n=this;return(0,ot.A)(function*(){if(n.isPlaying&&!n.playingInprogress&&n.playObject&&n.playObject.scene&&n.playObject.timeline&&n.playObject.canvas){n.playObject.scene.pauseVideoMedia(),St.fabric.util.cancelAnimFrame(n.playObject.req),yield n.seekToTime(n.currentTime,!1),n.playObject.timeline.pause();const o=n.audioObjects;if(o&&o.length>0)for(const e of o)e.pause();n.playObject.canvas.clear(),n.playObject=null,n.isPlaying=!1}})()}addTrack(n,o){n.setOrder(o);const e=new $t(null,[n]);e.ontEndTimeChange=r=>this.handleTrackEndTimeChange(r),this.tracks.unshift(e),this.ansureTracksOrder()}seekToTimeOld(n){return this.currentTime=n,this.timeLine.seek(n/1e3,!1),Promise.resolve()}seekToTime(n,o){var e=this;return(0,ot.A)(function*(){if(!e.seekinProgress||!o){e.seekinProgress=!0,e.currentTime=n;const r=[];return e.tracks.forEach(s=>{r.push(s.seekToTime(n,o))}),yield Promise.all(r),e.seekinProgress=!1,Promise.resolve()}})()}ansureTracksOrder(){this.tracks.sort((n,o)=>o.getOrder()-n.getOrder())}getTracks(){return this.tracks}deleteTrackItem(n=null){if(n){const o=this.tracks.find(r=>r.trackItems.find(s=>s.attachedObject===n)),e=o.trackItems.find(r=>r.attachedObject.trackItemId===n.trackItemId);if(n instanceof Ii.Y?this.sceneController.deleteAudioFromProject():this.sceneController.deleteSeletedDesignItem(),o){const r=o.trackItems.indexOf(e);if(r>-1&&o.trackItems.splice(r,1),0===o.trackItems.length){const s=this.tracks.indexOf(o);s>-1&&this.tracks.splice(s,1)}o.updateTrackType()}}this.updateAudioDuration(),this.tracks&&0===this.tracks.length&&(this.sceneController.tempMarkSaved(),this.sceneController.dirty=!1)}splitTrackItem(n,o){return new Promise((e,r)=>{if(n){const s=this.tracks.find(l=>l.trackItems.find(c=>c.attachedObject===n)),a=s.trackItems.find(l=>l.attachedObject.trackItemId===n.trackItemId);n instanceof Ii.Y?this.audioToolService.duplicate(o).then(l=>{const c=a.duration;let d=this.currentTime-n.startTime;d--,d<ht.b.VE_TRACK_ITEM_MINIMUM_DURATION&&(d=ht.b.VE_TRACK_ITEM_MINIMUM_DURATION);let u=new xe(l),h=c-d;h<ht.b.VE_TRACK_ITEM_MINIMUM_DURATION&&(h=ht.b.VE_TRACK_ITEM_MINIMUM_DURATION,d=c-h),a.changeDuration(d,null,"right",!1),u.changeDuration(h,null,"left",!1),s.addTrackItem(u),s.arrangeTrackItemsAfterNewItem(),this.updateDuration(),this.setAudio(),this.setHistory(),e()}):this.sceneController.duplicateVideoEditor(l=>{const c=a.duration,d=a.attachedObject.getAnimationMapArr();
1let u=d[0].startAt?this.currentTime-d[0].startAt:d[0].startAt+this.currentTime;u--,u<ht.b.VE_TRACK_ITEM_MINIMUM_DURATION&&(u=ht.b.VE_TRACK_ITEM_MINIMUM_DURATION);let h=new Qt(l),f=c-u;f<ht.b.VE_TRACK_ITEM_MINIMUM_DURATION&&(f=ht.b.VE_TRACK_ITEM_MINIMUM_DURATION,u=c-f);const m=this.updateAnim("assets/json/anim_option/IS_OUT_0.json","out",a),T=this.updateAnim("assets/json/anim_option/IS_IN_0.json","in",h);Promise.all([m,T]).then(()=>{a.changeDuration(u,null,"right",!1),h.changeDuration(f,null,"left",!1),s.addTrackItem(h),s.arrangeTrackItemsAfterNewItem(),this.updateDuration(),this.setHistory(),e()})})}else e()})}updateAnim(n,o,e){return new Promise((r,s)=>{this.http.get(n).subscribe(a=>{this.UpdateCanvasTypeAnimation(a,o,e),r()})})}UpdateCanvasTypeAnimation(n,o,e){const r=e.attachedObject.getAnimationMapArr(),s=e.attachedObject.getDesignItem();let a=null;switch(o){case"in":a=r[0];break;case"overall":a=r[1];break;case"out":a=r[2]}if(s.itemType===It.SP.CANVAS){const l=a.map[0],c=n.map[Object.keys(n.map)[0]];a.map[0]=JSON.parse(JSON.stringify(c)),a.map[0].entityId=l.entityId,a.map[0].splitType=3}else{const l=a.map;a.map=JSON.parse(JSON.stringify(n.map)),a.map.parallaxType=l.parallaxType,a.map.parallaxScale=l.parallaxScale,"NONE"===a.animationOption?("out"===o&&(a.startAt=a.startAt-a.duration,a.startTime=a.startAt),a.duration=0):0==a.duration&&(a.duration=1e3,"out"===o&&(a.startAt=a.startAt-a.duration))}a.animationOption="NONE",a.animationOptionVariant=null}getTrackById(n){for(let o=0;o<this.tracks.length;o++)if(this.tracks[o].id===n)return this.tracks[o];return null}addDuplicateTrackItem(n,o=null){o&&!n&&(n=this.tracks.find(r=>r.trackItems.find(s=>s.attachedObject===o)).trackItems.find(r=>r.attachedObject.trackItemId===o.trackItemId)),"audio"===n.trackItemType?this.audioToolService.duplicate(this.sceneController).then(e=>{let r=new xe(e);r.setOrder(this.sceneController.selectedAudioObject.order-1);const a=new $t(null,[r]);a.ontEndTimeChange=d=>this.handleTrackEndTimeChange(d);const l=this.tracks.find(d=>d.trackItems.find(u=>u===n)),c=this.tracks.indexOf(l);c>-1&&this.tracks.splice(c+1,0,a),this.updateDuration(),this.setAudio(),this.setHistory()}):this.sceneController.duplicateVideoEditor(e=>{e.getAnimationMapArr();let s=new Qt(e);const a=this.tracks.length>0?this.tracks[0].getOrder()+1:1;s.setOrder(a);const l=new $t(null,[s]);l.ontEndTimeChange=u=>this.handleTrackEndTimeChange(u);const c=this.tracks.find(u=>u.trackItems.find(h=>h===n)),d=this.tracks.indexOf(c);d>-1&&this.tracks.splice(d,0,l),this.updateDuration(),this.setHistory()})}updateDuration(n=0){let o=0,e=0;this.tracks.forEach(r=>{r.trackItems.forEach(s=>{o<s.endTime&&(o=s.endTime),(0===e||e>s.duration)&&(e=s.duration)})}),this.duration=o,this.minDuration=e,setTimeout(()=>{this.videoService.updateDurationFn&&this.videoService.updateDurationFn({})}),this.seekToTime(this.currentTime,!1)}get audioObjects(){return this.sceneController.getAudioObject()}get audioObject(){const n=this.audioObjects;return n&&n.length>0?n[0]:null}updateAudioDuration(n=null,o=null){this.updateDuration(n),o&&o()}setDirty(){this.sceneController.dirty=!0}toggleMediaVolume(){this.isPlaying&&this.playingScene&&this.playingScene.toggleMediaVolumeAtplay(this.mute)}ansureZorder(){let n=-1;this.tracks.slice().reverse().forEach(o=>{if(n>=o.getOrder()){const e=n+1;o.setZorder(e),n=e}else n=o.getOrder()}),this.sceneController.getCanvas().renderAll()}setHistory(){this.sceneController.addHistory(this.sceneController.design)}setAudio(){let n=this.sceneController.getAudioJson();n&&n.length>0?(this.sceneController.design.metadata.data.veMusic=n,this.sceneController.design.metadata.data.music=n[0]):(this.sceneController.design.metadata.data.music=null,this.sceneController.design.metadata.data.veMusic=null)}}var ho=p(84301),Fe=p(49159);let pn=(()=>{var t;class n{constructor(e,r,s,a,l,c){this.stateService=e,this.sceneParser=r,this.videoEditorService=s,this.zone=a,this.http=l,this.audioToolService=c}parseTimeLineOld(e){var r=this;return(0,ot.A)(function*(){const s=r.stateService.mainCanvas,a=e.getSelectedScene();r.sceneParser.parseAnimation(a),yield a.getSceneAnimation().configureTimeline(s),s.clear();const l=a.getSceneAnimation().getTimeLine();a.getSceneAnimation().addToCanvas(s);const c=r.parseTrack(e);return new fn(c,l,r,a.getSceneAnimation(),e,r.videoEditorService,r.http,r.audioToolService)})()}parseTimeLine(e){var r=this;return(0,ot.A)(function*(){const s=e.getSelectedScene(),a=r.parseTrack(e);return new fn(a,null,r,s.getSceneAnimation(),e,r.videoEditorService,r.http,r.audioToolService)})()}parseTimelineAtPlay(e,r,s){var a=this;return(0,ot.A)(function*(){const l=a.stateService.previewCanvas,c=e.getUpdatedProjectJson(),d=a.stateService.mainCanvas;l.setHeight(d.clipPath.height*d.getZoom()),l.setWidth(d.clipPath.width*d.getZoom());const h=d.viewportTransform[5];l.getElement().style.top=h+"px";const m=(yield a.sceneParser.parseProject(c,l,!1))[0];yield m.seekVideoMedia(r),m.addToCanvas(l),a.sceneParser.parseAnimation(m,!1,!0),yield m.getSce
1neAnimation().configureTimeline(l,s);const T=m.getSceneAnimation().getTimeLine(),b=e.getAudioObject();if(b&&b.length>0)for(const _ of b)_.configureTimeline(T,r,!s);return{timeline:T,canvas:l,zone:a.zone,scene:m}})()}parseTrack(e){const r=[],s=e.getSelectedScene(),a=[];s.getDesignItemList().forEach(c=>{a.push(new Qt(c))}),e.getAudioObject().forEach(c=>{a.push(new xe(c))});const l=new Map;for(const c of a)l.has(c.getTrackId())?l.get(c.getTrackId()).push(c):l.set(c.getTrackId(),[c]);for(const c of l.keys())r.push(new $t(c,l.get(c)));return r}parseDesignIteamAnimation(e){var r=this;return(0,ot.A)(function*(s,a=!1,l,c){const d=r.stateService.mainCanvas;r.sceneParser.parseDesignItemAnimation(s,a,l),yield s.getAnimationObj().configureTimeline(d,c),s.getAnimationObj().addToCanvas(d)}).apply(this,arguments)}}return(t=n).\u0275fac=function(e){return new(e||t)(i.KVO(Nt.X),i.KVO(ho.q),i.KVO(Fe.M),i.KVO(i.SKi),i.KVO(nt.Qq),i.KVO(Ot._))},t.\u0275prov=i.jDH({token:t,factory:t.\u0275fac}),n})();var mo=p(24886),fo=p(78987),po=p(93448),Be=p(71971),go=p(66518),Le=p(74983),Ei=p(45944),Pi=p(68010),gn=p(74343),vn=p(91367),vo=p(22154),_n=p(11497),_o=p(44525),Oi=p(32764),bo=p(45975),bn=p(41300),yo=p(68287),To=p(3408),ko=p(13316),Co=p(90858),xo=p(71897),qt=p(68064),wo=p(38957),Mo=p(69698),Io=p(76291),Eo=p(81058),Po=p(72619),Oo=p(49679),So=p(10561),Ao=p(99939),jo=p(52411),Do=p(41153),Ro=p(19945),Vo=p(20702),No=p(27649),Uo=p(67294),yn=p(33645);const Go=t=>({"pe-none":t}),Tn=t=>({"check-active":t});function Fo(t,n){1&t&&i.nrm(0,"pi",31)}function Bo(t,n){1&t&&i.nrm(0,"pi",32)}let Lo=(()=>{var t;class n{constructor(e){this.editorService=e,this.activePane="edit",this.changeAudioDuration=new i.bkB,this.audioVolume=30,this.audioSpeed=1,this.mute=!0,this.audioEffect="fadeOut"}ngOnChanges(){this.activeObject&&(this.audioSpeed=this.activeObject.speedFactor,this.audioVolume=Math.round(100*this.activeObject.volume),this.oldAudioVolume=Math.round(100*this.activeObject.oldVolume),this.mute=0!=this.audioVolume)}activatePane(e){this.activePane=e}replace(){this.editorService.replace=!0,this.editorService.setActiveToolPanel(Uo.sv.MUSIC)}inputAudioVolume(e){let r;r=e.newValue||0===e.newValue?e.newValue:e,Number.isNaN(r)&&(r=100),this.mute=0!=r,r||0===r?r>100?setTimeout(()=>{this.activeObject.updateVolume(1),this.oldAudioVolume=this.audioVolume=Math.round(100*this.activeObject.volume),this.activeObject.oldVolume=this.activeObject.volume},0):r<=0?setTimeout(()=>{this.activeObject.updateVolume(0),this.oldAudioVolume=this.audioVolume=Math.round(100*this.activeObject.volume),this.activeObject.oldVolume=this.activeObject.volume},0):setTimeout(()=>{this.activeObject.updateVolume(r/100),this.oldAudioVolume=this.audioVolume=Math.round(100*this.activeObject.volume),this.activeObject.oldVolume=this.activeObject.volume},0):setTimeout(()=>{this.activeObject.updateVolume(1),this.oldAudioVolume=this.audioVolume=Math.round(100*this.activeObject.volume),this.activeObject.oldVolume=this.activeObject.volume},0)}fade(e){this.audioEffect=e,this.activeObject.fade(e)}toggleMute(){this.audioVolume=this.mute?0:this.oldAudioVolume,this.mute=!this.mute,this.activeObject.updateVolume(this.audioVolume/100)}inputAudioSpeed(e){let r,s;e.newValue||0===e.newValue?(r=e.newValue,s=!1):(r=e,s=!0),Number.isNaN(r)&&(r=.5),r||0===r?r>2?setTimeout(()=>{this.activeObject.changeSpeedFactor(2,s),this.audioSpeed=this.activeObject.speedFactor,this.changeAudioDuration.emit()},0):r<=.5?setTimeout(()=>{this.activeObject.changeSpeedFactor(.5,s),this.audioSpeed=this.activeObject.speedFactor,this.changeAudioDuration.emit()},0):setTimeout(()=>{this.activeObject.changeSpeedFactor(r,s),this.audioSpeed=this.activeObject.speedFactor,this.changeAudioDuration.emit()},0):setTimeout(()=>{this.activeObject.changeSpeedFactor(1,s),this.audioSpeed=this.activeObject.speedFactor,this.changeAudioDuration.emit()},0)}}return(t=n).\u0275fac=function(e){return new(e||t)(i.rXU(de.x))},t.\u0275cmp=i.VBU({type:t,selectors:[["music-edit-tools"]],inputs:{activePane:"activePane",activeObject:"activeObject"},outputs:{changeAudioDuration:"changeAudioDuration"},features:[i.OA$],decls:48,vars:22,consts:[["target",""],[1,"pane-section","edit-section"],[1,"edit-content","h-100"],["customScrollDir","",1,"scroll-container","pt-3","pb-3"],[1,"card","drawer-card","mt-0","mb-10"],[1,"card-body"],[1,"d-flex","align-items-center","mt-1"],[1,"wp-100","d-flex","align-items-center"],[1,"btn-all","btn-outline-primary","btn-h40","text-13","w-100",3,"click"],[1,"card","drawer-card","mb-9"],[1,"card-title","m-0","text-semi"],[1,"d-flex","mt-9","align-items-center"],[1,"opacity-slider",2,"width","100%",3,"change","slideStop","value","min","max","step"],[1,"ml-9"],["disabled","","type","text",1,"form-control","text-normal","text-black","form-input-sm",3,"value"],[1,"card","drawer-card","mb-9","mt-0"],[1,"d-flex","mt-2","align-items-center"],[1,"d-flex","align-items-center","mr-9"],[1,"btn","btn-grey","hw-40","border-0","text-primary","p-0",3,"click","ngClass"],["name","unmute","class","f-24",4,"ngIf"],["name","mute","class","f-24",4,"ngIf"],[1,"opacity-slider",2,"width","100%",3,"change","value","min","max","step"],["type","text","mask","000","disabled","",1,"form-control","text-normal","text-black","form-input-sm",3,"ngModelChange","ngModel"],[1,"card","drawer-card","mb-9","mt-0","audio-effect","d-none"],["for","FadeIn",1,"d-flex","align-items-center","btn","btn-editor-primary","text-13","mr-9",3,"ngClass"],[1,"checkboxc","d-flex","align-items-center","me-2"],["type","radio","id","FadeIn","name","FadeIn","value","audioEffect",1,"marked-check",3,"click"],["for","FadeIn"],["for","FadeOut",1,"d-flex","align-items-center","btn","btn-editor-primary","text-13",3,"ngClass"],["type","radio","id","FadeOut","name","FadeIn","checked","","value","audioEffect",1,"marked-check",3,"click"],["for","FadeOut"],["name","unmute",1,"f-24"],["name","mute",1,"f-24"]],template:function(e,r){if(1&e){const s=i.RV6();i.j41(0,"div",1)(1,"div",2)(2,"div",3)(3,"div")(4,"div",4)(5,"div",5)(6,"div",6)(7,"div",7)(8,"button",8),i.bIt("click",function(){return i.eBV(s),i.Njj(r.replace())}),i.EFF(9,"Replace"),i.k0s()()()()(),i.j41(10,"div",9)(11,"div",5)(12,"h5",10),i.EFF(13,"Audio
1Speed"),i.k0s(),i.j41(14,"div",11)(15,"div",7)(16,"mv-slider",12),i.bIt("change",function(l){return i.eBV(s),i.Njj(r.inputAudioSpeed(l))})("slideStop",function(l){return i.eBV(s),i.Njj(r.inputAudioSpeed(l))}),i.k0s()(),i.j41(17,"div",13),i.nrm(18,"input",14),i.k0s()()()(),i.j41(19,"div",15)(20,"div",5)(21,"h5",10),i.EFF(22,"Volume"),i.k0s(),i.j41(23,"div",16)(24,"div",17)(25,"button",18,0),i.bIt("click",function(){return i.eBV(s),i.Njj(r.toggleMute())}),i.DNE(27,Fo,1,0,"pi",19)(28,Bo,1,0,"pi",20),i.k0s()(),i.j41(29,"div",7)(30,"mv-slider",21),i.bIt("change",function(l){return i.eBV(s),i.Njj(r.inputAudioVolume(l))}),i.k0s()(),i.j41(31,"div",13)(32,"input",22),i.bIt("ngModelChange",function(l){return i.eBV(s),i.Njj(r.inputAudioVolume(l))}),i.k0s()()()()(),i.j41(33,"div",23)(34,"div",5)(35,"h5",10),i.EFF(36,"Audio Effect"),i.k0s(),i.j41(37,"div",11)(38,"label",24)(39,"div",25)(40,"input",26),i.bIt("click",function(){return i.eBV(s),i.Njj(r.fade("fadeIn"))}),i.k0s()(),i.j41(41,"label",27),i.EFF(42,"Fade In"),i.k0s()(),i.j41(43,"label",28)(44,"div",25)(45,"input",29),i.bIt("click",function(){return i.eBV(s),i.Njj(r.fade("fadeOut"))}),i.k0s()(),i.j41(46,"label",30),i.EFF(47,"Fade Out"),i.k0s()()()()()()()()()}2&e&&(i.R7$(16),i.Y8G("value",r.audioSpeed)("min",.5)("max",2)("step",.25),i.R7$(2),i.Mz_("value","",r.audioSpeed,"x"),i.R7$(7),i.Y8G("ngClass",i.eq3(16,Go,0==r.oldAudioVolume)),i.R7$(2),i.Y8G("ngIf",r.mute),i.R7$(),i.Y8G("ngIf",!r.mute),i.R7$(2),i.Y8G("value",r.audioVolume)("min",0)("max",100)("step",1),i.R7$(2),i.Y8G("ngModel",r.audioVolume),i.R7$(6),i.Y8G("ngClass",i.eq3(18,Tn,"fadeIn"===r.audioEffect)),i.R7$(5),i.Y8G("ngClass",i.eq3(20,Tn,"fadeOut"===r.audioEffect)))},dependencies:[Y.YU,Y.bT,yn.q,J.me,J.BC,J.vS,Z.d1,X.Zr,qt.b],styles:[".button-row[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:table-cell;margin-right:8px}.button-row[_ngcontent-%COMP%]{display:inline-block}.tool-card[_ngcontent-%COMP%]{margin-bottom:10px}.rotate-button[_ngcontent-%COMP%]{text-align:center;cursor:pointer;margin:0 5px;padding:5px;width:45px;height:45px;flex-shrink:0;border-radius:4px;border:1px solid #eee;background-color:#fff;transition:box-shadow .3s ease}.animation-type-section[_ngcontent-%COMP%]{margin-top:20px}.in-animation-section[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{font-size:13px;padding-left:8px}.anim-tool[_ngcontent-%COMP%]{display:inline-block;margin:auto;width:25%}.slider[_ngcontent-%COMP%]{display:flex;align-items:center}.is-active[_ngcontent-%COMP%]{border:2px solid #007AFF!important}button[_ngcontent-%COMP%]:focus{outline:#007AFF auto 1px}.media-filter[_ngcontent-%COMP%] .inner[_ngcontent-%COMP%]{width:100%;text-align:center}.media-filter[_ngcontent-%COMP%] .inner[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{border-radius:.5rem;width:100%}.media-filter[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{height:auto;width:100%;text-align:center;padding-top:6px}.checkboxc[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{border:1px solid #E2E3E9}.audio-effect[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{cursor:pointer}.audio-effect[_ngcontent-%COMP%] .checkboxc[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{cursor:pointer;-webkit-appearance:none;appearance:none;background-color:#fff6;position:relative;width:30px;height:30px;border:1px solid #B0B3BF;border-radius:8px}.audio-effect[_ngcontent-%COMP%] .marked-check[_ngcontent-%COMP%]{height:24px!important;width:24px!important;background-color:#626adf0d;border:1px solid rgb(176,179,191)!important}.audio-effect[_ngcontent-%COMP%] .marked-check[_ngcontent-%COMP%]:checked{background:url(https://static.lightxeditor.com/assets/icons/checkbox-active.svg) center no-repeat!important;border:0px!important}.audio-effect[_ngcontent-%COMP%] .check-active[_ngcontent-%COMP%]{background:#626adf0d;border:2px solid rgb(98,106,223)!important}"]}),n})();var zo=p(64141),Wt=p(49969);const Yo=t=>({"is-active-tool":t}),Xo=t=>({new_item:t});function Ho(t,n){if(1&t&&(i.j41(0,"a",8)(1,"div",9),i.nrm(2,"pi",10),i.k0s(),i.j41(3,"span",11),i.EFF(4),i.k0s()()),2&t){const o=i.XpG(2).$implicit;i.R7$(),i.Y8G("ngClass",i.eq3(3,Xo,"animated"==o.name)),i.R7$(),i.Y8G("name",o.icon),i.R7$(2),i.JRh(o.title)}}function $o(t,n){if(1&t&&(i.j41(0,"div"),i.DNE(1,Ho,5,5,"a",7),i.k0s()),2&t){const o=i.XpG().$implicit;
1i.R7$(),i.Y8G("ngIf",0==o.subNavs.length&&o.enable)}}function Wo(t,n){if(1&t){const o=i.RV6();i.j41(0,"div",3),i.bIt("click",function(){const r=i.eBV(o).$implicit,s=i.XpG();return i.Njj(s.executeAction(r))}),i.DNE(1,$o,2,1,"div",4),i.nrm(2,"span",5)(3,"span",6),i.k0s()}if(2&t){const o=n.$implicit,e=i.XpG();i.Y8G("ngClass",i.eq3(2,Yo,e.activeTool==o.name)),i.R7$(),i.Y8G("ngIf",o.visible&&!(e.backgroundDrawerDisabled&&"background"===o.name))}}let Ko=(()=>{var t;class n{constructor(e){this.editorService=e,this.tools=[],this.backgroundDrawerDisabled=!0,this.toggleSliderEvent=new i.bkB}ngOnInit(){}ngOnChanges(e){this.editorService.replace&&(this.activeTool=""),this.backgroundDrawerDisabled=this.projectType===wi.gM.VideoEditor}executeAction(e){this.editorService.replace=!1,this.editorService.setActiveToolPanel({panel:e.action,from:"nav"})}toggleSliderOpen(e){this.toggleSliderEvent.emit(e)}}return(t=n).\u0275fac=function(e){return new(e||t)(i.rXU(de.x))},t.\u0275cmp=i.VBU({type:t,selectors:[["toolbar-navigation"]],inputs:{tools:"tools",projectType:"projectType",activeTool:"activeTool",sldBtn:"sldBtn"},outputs:{toggleSliderEvent:"toggleSliderEvent"},features:[i.OA$],decls:3,vars:1,consts:[[1,"menu",2,"height","calc(100% - 0rem)"],["customScrollDir","",1,"is-popover-tb-n","p-0","pb-3","darkscroll","scroll-container"],["class","inner-nav mt-11",3,"ngClass","click",4,"ngFor","ngForOf"],[1,"inner-nav","mt-11",3,"click","ngClass"],[4,"ngIf"],[1,"curve-before","curve"],[1,"curve-after","curve"],["class","nav",4,"ngIf"],[1,"nav"],[1,"hw-40","icon","m-auto",3,"ngClass"],[1,"f-24",3,"name"],[1,"nav-title","text-semi","d-inline-flex","mt-1"]],template:function(e,r){1&e&&(i.j41(0,"div",0)(1,"div",1),i.DNE(2,Wo,4,4,"div",2),i.k0s()()),2&e&&(i.R7$(2),i.Y8G("ngForOf",r.tools))},dependencies:[Y.YU,Y.Sq,Y.bT,yn.q,qt.b],styles:[".menu[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] .nav-title[_ngcontent-%COMP%]{color:#939aa9}.menu[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%]:hover .nav-title[_ngcontent-%COMP%]{visibility:visible;position:relative;color:#939aa9}.menu[_ngcontent-%COMP%] .is-active-tool[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] .nav-title[_ngcontent-%COMP%]{visibility:visible;position:relative}.new_item[_ngcontent-%COMP%]:after{position:absolute;top:1px;padding-left:44px}"],data:{animation:[(0,Wt.hZ)("controlsAnimation",[(0,Wt.kY)(":enter",[(0,Wt.iF)({opacity:0}),(0,Wt.i0)("225ms cubic-bezier(.4,0,.2,1)",(0,Wt.iF)({opacity:1}))]),(0,Wt.kY)(":leave",[(0,Wt.i0)("0ms cubic-bezier(.4,0,.2,1)",(0,Wt.iF)({opacity:0}))])])]}}),n})();var kn=p(40605),Cn=p(74282),Zo=p(23021),Jo=p(80197),Qo=p(49449),qo=p(68887),ts=p(75360),es=p(6755),xn=p(79301),Si=p(23486);const is=["maskDiv"],ns=["inputRef"],rs=t=>[t],os=t=>({"text-eclipse":t}),ss=t=>({"text-danger":t});function as(t,n){1&t&&(i.j41(0,"button",27),i.EFF(1,"My Projects"),i.k0s())}function ls(t,n){if(1&t){const o=i.RV6();i.j41(0,"div",28),i.bIt("click",function(){i.eBV(o);const r=i.XpG();return i.Njj(r.upgradePlan())}),i.nrm(1,"pi",29),i.EFF(2,"\xa0 Try Lightx Pro "),i.k0s()}}function cs(t,n){if(1&t){const o=i.RV6();i.j41(0,"div",28),i.bIt("click",function(){i.eBV(o);const r=i.XpG();return i.Njj(r.upgradePlan())}),i.nrm(1,"pi",29),i.EFF(2,"\xa0 Try Lightx Pro "),i.k0s()}}function ds(t,n){if(1&t){const o=i.RV6();i.j41(0,"input",33,2),i.mxI("ngModelChange",function(r){i.eBV(o);const s=i.XpG(2);return i.DH7(s.projectName,r)||(s.projectName=r),i.Njj(r)}),i.bIt("focusout",function(){i.eBV(o);const r=i.XpG(2);return i.Njj(r.renameProjectName())})("focus",function(){i.eBV(o);const r=i.XpG(2);return i.Njj(r.inFocus())})("input",function(){i.eBV(o);const r=i.XpG(2);return i.Njj(r.onInput())}),i.k0s()}if(2&t){const o=i.XpG(2);i.xc7("width",o.inputWidth,"px"),i.R50("ngModel",o.projectName),i.Y8G("ngClass",i.eq3(4,os,o.inputWidth>200))}}function us(t,n){if(1&t&&(i.j41(0,"div",30),i.DNE(1,ds,2,6,"input",31),i.j41(2,"div",32,1),i.EFF(4),i.k0s()()),2&t){const o=i.XpG();i.xc7("width",o.inputWidth,"px"),i.R7$(),i.Y8G("ngIf",o.user),i.R7$(3),i.JRh(o.projectName)}}function hs(t,n){if(1&t){const o=i.RV6();i.j41(0,"ei",38),i.bIt("click",function(){i.eBV(o);const r=i.XpG(3);return i.Njj(r.save())}),i.k0s()}if(2&t){const o=i.XpG(3);i.Y8G("ngClass",i.eq3(1,ss,!o.sceneController.isSaved()))}}function ms(t,n){if(1&t&&(i.j41(0,"button",36),i.DNE(1,hs,1,3,"ei",37),i.k0s()),2&t){const o=i.XpG(2);i.R7$(),i.Y8G("ngIf",o.user)}}function fs(t,n){if(1&t&&(i.j41(0,"div",34),i.DNE(1,ms,2,1,"button",35),i.k0s()),2&t){const o=i.XpG();i.R7$(),i.Y8G("ngIf",!o.isTyping)}}function ps(t,n){if(1&t){const o=i.RV6();i.j41(0,"button",39),i.bIt("click",function(){i.eBV(o);const r=i.XpG();return i.Njj(r.loginToSave())}),i.EFF(1,"Login to Save"),i.k0s()}}function gs(t,n){if(1&t){const o=i.RV6();i.j41(0,"button",40),i.bIt("click",function(){i.eBV(o);const r=i.XpG();return i.Njj(r.export())}),i.nrm(1,"pi",41),i.EFF(2,"Export "),i.k0s()}}function vs(t,n){if(1&t){const o=i.RV6();i.j41(0,"button",42),i.bIt("click",function(){i.eBV(o);const r=i.XpG();return i.Njj(r.exportRender())}),i.nrm(1,"pi",43),i.EFF(2,"Rendering... "),i.k0s()}}function _s(t,n){if(1&t){const o=i.RV6();i.j41(0,"button",40),i.bIt("click",function(){i.eBV(o);const r=i.XpG();return i.Njj(r.export())}),i.nrm(1,"pi",41),i.EFF(2,"Export "),i.k0s()}}function bs(t,n){if(1&t){const o=i.RV6();i.j41(0,"div",44)(1,"div",45)(2,"div",46),i.EFF(3," Video export complete "),i.k0s(),i.j41(4,"div",47),i.bIt("click",function(){i.eBV(o);const r=i.XpG();return i.Njj(r.toggleMenubarclose())}),i.nrm(5,"pi",48),i.k0s()(),i.j41(6,"div",49)(7,"div",50),i.EFF(8),i.k0s(),i.j41(9,"div",51)(10,"button",52)(11,"pi",53),i.bIt("click",function(){i.eBV(o);const r=i.XpG();return i.Njj(r.RenderingExport())}),i.k0s()()()()()}if(2&t){const o=i.XpG();i.R7$(8),i.SpI(" ",o.imagename," ")}}function ys(t,n){if(1&t){const o=i.RV6();i.j41(0,"div",44)(1,"div",45)(2,"div",46),i.EFF(3," Error while exporting "),i.k0s(),i.j41(4,"div",47),i.bIt("click",function(){i.eBV(o);const r=i.XpG();return i.Njj(r.toggleMenubarclose())}),i.nrm(5,"pi",48),i.k0s()(),i.j41(6,"div",54)(7,"div",50),i.EFF(8),i.k0s(),i.j41(9,"div",51)(10,"button",55),i.nrm(11,"pi",56),i.k0s()()()()}if(2&t){const o=i.XpG();i.R7$(8),i.SpI(" ",o.imagename," ")}}let Ts=(()=>{var t;class n{constructor(e,r,s,a,l,c,d,u,h,f,m,T,b,_,v,C,y,w){this.document=e,this.sceneController=r,this.toastService=s,this.modalService=a,this.authService=l,this.subsService=c,this.projectSyncService=d,this.projectSaveService=u,this.exportService=h,this.loginService=f,this.editorHeaderService=m,this.uploadImageService=T,this.tostr
1=b,this.templateService=_,this.commonService=v,this.renderer=C,this.uploadVideoService=y,this.confirmDialogService=w,this.ntfInProgress=!1,this.markAsRead=new i.bkB,this.isexportbtn=!1,this.projectName="",this.projectId="",this.actionIcon="editdone",this.maxWidth=200,this.inputWidth=75,this.isTyping=!1,this.isNeedUpgrade=!1,this.isexportstatus=!1,this.supportedExt="webm",this.imagename="",this.istost=!1,this.webmSupport=!1,this.jobId="",this.fileUploadAccept="video/mp4, image/*",this.inProgress=!1,this.homeURL="/",this.user=this.authService.currentUser(),this.setHomeUrl(),this.loggedInObserver=this.authService.loggedIn.subscribe(x=>{this.user=this.authService.currentUser(),this.setHomeUrl()}),this.usrPropChangedObserver=this.authService.usrPropChanged.subscribe(x=>{this.user=this.authService.currentUser(),this.setHomeUrl()})}setHomeUrl(){this.homeURL=this.user?ht.b.AFTER_LOGIN_REDIRATION_URI:"/"}setimagename(){this.imagename=this.sceneController.design.name?this.sceneController.design.name+"."+this.supportedExt:ht.b.label.blankProjectName+"."+this.supportedExt}saveProject(e=null,r=null){const s=this.timelineController.currentTime;this.projectSaveService.saveProject(this.user,a=>{this.timelineController.seekToTime(s,!1),e&&e(),this.inProgress=!1},this.sceneController,()=>{this.inProgress=!1,this.toastService.showError(ht.b.message.somethingWrong),r&&r()})}save(){this.inProgress||(this.inProgress=!0,this.saveProject(()=>{this.inProgress=!1},()=>{this.inProgress=!1}))}logout(){}ngOnDestroy(){this.loggedInObserver&&this.loggedInObserver.unsubscribe(),this.onExportApiResponse.unsubscribe(),this.myval&&this.myval.unsubscribe(),this.usrPropChangedObserver&&this.usrPropChangedObserver.unsubscribe()}ngOnInit(){MediaRecorder.isTypeSupported("video/webm")?(this.supportedExt="webm",this.webmSupport=!0):MediaRecorder.isTypeSupported("video/mp4;codecs:h264")&&(this.supportedExt="mp4",this.webmSupport=!1),this.onExportApiResponse=this.exportService.onExportApiResponse.subscribe(s=>{if(s&&s.exportCached)this.exportdata=this.sceneController.getExportedVideoUrl(s.resolution),this.isexportstatus=!0,this.toggleMenubar();else if(s&&s.invokeCreateVideo){let a=s.jobId;this.isexportbtn=!0;let l=0;this.myval=(0,kn.Y)(5e3).subscribe(()=>{this.exportService.getUploadedVideoStatusExport(a,c=>{l>250?(this.myval.unsubscribe(),this.myval=null):l++,c&&c.body.jobId&&"active"==c.body.status&&(this.exportdata=c.body,this.sceneController.setExportedVideoUrl(s.resolution,this.exportdata),this.isexportstatus=!0,this.toggleMenubar(),this.myval.unsubscribe(),this.myval=null)},c=>{console.log("error in getUploadedVideoStatusExport")})})}else this.isexportbtn=!1}),this.setlocastorage()}setlocastorage(){let e=JSON.parse(localStorage.getItem("safariexportVideo"));e&&this.projectId==e.assetId&&(this.isexportbtn=!0,this.myval=(0,kn.Y)(5e3).subscribe(()=>{this.exportService.getUploadedVideoStatusExport(e.jobId,r=>{r&&r.body.jobId&&"active"==r.body.status&&(this.exportdata=r.body,this.sceneController.setExportedVideoUrl(1,this.exportdata),this.isexportstatus=!0,this.toggleMenubar(),this.myval.unsubscribe(),this.myval=null,localStorage.removeItem("safariexportVideo"))},r=>{console.log("error in getUploadedVideoStatusExport"),localStorage.removeItem("safariexportVideo")})}))}loadVideo(e){return new Promise((r,s)=>{const a=new XMLHttpRequest;a.open("GET",e,!0),a.responseType="blob",a.onload=function(){200===this.status&&r(this.response)},a.addEventListener("progress",c=>{c&&c.lengthComputable&&this.sceneController&&-1!=this.sceneController.inProgressCount&&(this.sceneController.inProgressCount=Math.ceil(c.loaded/c.total*100))},!1),a.onerror=c=>{s()},a.onabort=c=>{s(),console.log(c)},a.send()})}loginToSave(){this.loginService.openLoginDialog(e=>{this.user=this.authService.currentUser(),this.checkUserSubscription(this.user),this.user&&this.save()})}RenderingExport(){this.loadVideo(this.exportdata.videoUrl).then(e=>{(0,Jo.saveAs)(e,this.sceneController.design.name?this.sceneController.design.name+".mp4":ht.b.label.blankProjectName+".mp4"),this.toggleMenubarclose()})}exportRender(){const e=this.modalService.open(Cn.f,{centered:!1,size:"sm",backdrop:!0,windowClass:"export-project-dialog",backdropClass:"show-header-backdrop"});e.componentInstance.isRendering=this.isexportbtn,e.componentInstance.exportdata=this.exportdata,e.componentInstance.sceneController=this.sceneController,e.result.then(r=>{}).catch(()=>{})}export(){this.authService.checkLoginLocal()?this.__export():this.loginService.openLoginDialog(r=>{this.user=this.authService.currentUser(),this.checkUserSubscription(this.user),this.user&&this.__export()})}__export(){const e=this.editorHeaderService.browserSupport();this.authService.checkSubscription(()=>
1{if(this.user=this.authService.currentUser(),this.user.subscribed)"yes"===e?this.openExportSettings():this.editorHeaderService.openExportNotSupport(e);else{let r=this.editorHeaderService.checkPremiumItems(this.sceneController);r.length>0?this.openExportDialog(r):"yes"===e?this.openExportSettings():this.editorHeaderService.openExportNotSupport(e)}})}openExportSettings(){this.isexportstatus=!1,this.isexportbtn=!1,this.exportdata="",this.isNeedUpgrade=!(!this.sceneController.design||!this.sceneController.design.properties||!this.sceneController.design.properties.pro&&!this.sceneController.design.properties.hasProElements||this.user.subscribed),this.modalRef=this.modalService.open(Cn.f,{size:"sm",windowClass:"export-project-dialog",backdropClass:"show-header-backdrop"}),this.modalRef.componentInstance.isNeedUpgrade=this.isNeedUpgrade,this.modalRef.componentInstance.proTemplate=this.sceneController.design.properties.pro,this.modalRef.componentInstance.sceneController=this.sceneController,this.modalRef.result.then(e=>{if("upgrade"===e){this.toastService.removeAll();let r=this.editorHeaderService.getUrl();this.subsService.upgradePlanCheckout(r,"","Upgrade_Export"+this.activeTool,s=>{this.user=this.authService.currentUser(),this.checkUserSubscription(this.user),"close"==s&&this.markSaved()})}else this.webmSupport||(this.isexportbtn=!0)}).catch(()=>{})}toggleMenubarclose(){this.document.getElementById("export-template-content").classList.remove("show")}toggleMenubar(){const e=this.document.getElementById("export-template-content");this.setimagename(),e.classList.toggle("show")}openExportDialog(e){const r=this.modalService.open(Zo.u,{size:"sm",windowClass:"export-project-dialog",backdropClass:"show-header-backdrop"});r.componentInstance.proItems=e,r.result.then(s=>{if("ok"===s){this.toastService.removeAll();let a=this.editorHeaderService.getUrl();this.subsService.upgradePlanCheckout(a,"","",l=>{this.user=this.authService.currentUser(),this.checkUserSubscription(this.user),"close"==l&&this.markSaved()})}}).catch(()=>{})}upgradePlan(){this.user?this.subsService.upgradePlanCheckout("","","Try_LightX_Pro_"+this.activeTool,e=>{this.user=this.authService.currentUser(),this.checkUserSubscription(this.user),"close"==e&&this.markSaved()}):this.loginService.openLoginDialog(e=>{this.user=this.authService.currentUser(),this.checkUserSubscription(this.user),this.user&&!this.user.subscribed&&this.subsService.upgradePlanCheckout("","","",r=>{this.user=this.authService.currentUser(),this.checkUserSubscription(this.user),"close"==r&&this.markSaved()})})}renameProjectName(){if(this.isTyping=!1,!this.projectName.trim()||this.sceneController.design.name===this.projectName.trim()||this.sceneController.design.assetId)if(this.projectName.trim()&&this.sceneController.design.name!==this.projectName.trim()){let e={assetId:this.sceneController.design.assetId,name:this.projectName.trim()};this.projectSyncService.updateDesign(e,r=>{this.toastService.showSuccess(ht.b.message.projectRenameSuccess),this.sceneController.design.name=this.projectName.trim()},r=>{this.toastService.showError(r.description||r.message)})}else this.sceneController.design.name!==this.projectName.trim()&&this.toastService.showSuccess(ht.b.message.invali
1dProjectName);else this.sceneController.design.name=this.projectName.trim()}inFocus(){this.actionIcon="editinprogress",this.isTyping=!0}checkUserSubscription(e){e&&e.subscribed&&this.sceneController.setUserSubscribed()}markSaved(){for(const e of this.sceneController.scenes)e.dirty=!1}openMedia(e){this.sceneController.isSaved()?e.click():this.confirmDialogService.open({title:ht.b.message.warningMessage,okButtonText:"Okay"},()=>{e.click()},()=>{e.value=""})}onFileUploaded(e){e&&this.uploadVideoService.loadMultipleFilesUpload(e,{slug:this.imgQueryParams?.slug,editorType:Jt._Y.VideoEditor,toolName:this.imgQueryParams?.tabName,from:"header"})}handleKeyboardEventDown(e){if(!(this.sceneController&&this.sceneController.getSelectedScene().selectedDesignItem&&this.sceneController.getSelectedScene().selectedDesignItem.isEditing()))if((e.metaKey||e.ctrlKey)&&"e"===e.key)this.modalRef&&this.modalRef.dismiss(),this.export(),e.preventDefault();else if(this.sceneController.getSelectedScene().selectedDesignItem&&"BODY"!==(e.target||e.srcElement).tagName)return}onInput(){this.isTyping=!0,this.maskDiv&&(this.renderer.setProperty(this.maskDiv.nativeElement,"textContent",this.projectName),this.inputWidth=Math.max(22,this.maskDiv.nativeElement.offsetWidth),this.inputWidth=this.inputWidth+24)}}return(t=n).\u0275fac=function(e){return new(e||t)(i.rXU(Y.qQ),i.rXU(ue.Z),i.rXU(Le.f),i.rXU(et.Bq),i.rXU(Pi.u),i.rXU(Qo.n),i.rXU(qo.A),i.rXU(gn._),i.rXU(mt._),i.rXU(vn.H),i.rXU(ts.S),i.rXU(es.A),i.rXU(Le.f),i.rXU(Oi.I),i.rXU(xn.h),i.rXU(i.sFG),i.rXU(_n.k),i.rXU(bn.g))},t.\u0275cmp=i.VBU({type:t,selectors:[["editor-header"]],viewQuery:function(e,r){if(1&e&&(i.GBs(is,5),i.GBs(ns,5)),2&e){let s;i.mGM(s=i.lsd())&&(r.maskDiv=s.first),i.mGM(s=i.lsd())&&(r.inputElement=s.first)}},hostBindings:function(e,r){1&e&&i.bIt("keydown",function(a){return r.handleKeyboardEventDown(a)},!1,i.tSv)},inputs:{alerts:"alerts",alertCount:"alertCount",projectName:"projectName",projectId:"projectId",timelineController:"timelineController",imgQueryParams:"imgQueryParams",activeTool:"activeTool"},outputs:{markAsRead:"markAsRead"},decls:31,vars:15,consts:[["file",""],["maskDiv",""],["inputRef",""],[1,"header","navbar-fixed-top"],["role","banner",1,"editor-header","d-flex","align-items-center","justify-content-between","w-100","position-relative","bg-white","pl-10","pr-10",2,"height","56px"],[1,"navbar-brand-box","text-start","p-0","align-items-center",2,"display","inline-flex"],[1,"logo","link","lh-normal",3,"routerLink"],[1,"logo-sm"],["src","https://static.lightxeditor.com/assets/images/new-logo-editor.png","alt","Lightxeditor Logo","width","40px","height","40px"],[1,"logo-lg"],["class","btn btn-grey text-13 btn-h40 ml-10 border-0 text-primary ps-3 pe-3","color","primary","routerLink","/my/projects","placement","bottom",4,"ngIf"],["color","primary","placement","bottom",1,"btn","btn-grey","text-13","ms-2","border-0","text-primary","btnHeight",2,"padding","11px 1rem",3,"click"],["id","fileInputId","name","fileInputId","type","file","multiple","",1,"custom-file-input","d-none",3,"change","click","accept"],["class","btn border-btn-gradiant text-normal d-flex align-items-center border-0 text-semi ms-2 h-40",3,"click",4,"ngIf"],[1,"projectTitle","text-semi","d-flex","align-items-center","justify-content-center"],["class","projectfiled me-1 d-flex align-items-center",3,"width",4,"ngIf"],["class","hw-40 d-flex align-items-center justify-content-center",4,"ngIf"],["class","btn-all btn-outline-primary text-13 btn-h40","color","primary","placement","bottom",3,"click",4,"ngIf"],[1,"d-flex","pe-0"],["class","btn btn-primary btn-h40 ps-3 pe-3 d-flex align-items-center text-13 text-semi","color","primary",3,"click",4,"ngIf"],["class","btn btn-primary btn-download btn-auto text-normal ml-8","color","primary",3,"click",4,"ngIf"],["id","export-template-content",1,"navbar-expand-lg","topnav-menu","active","p-0","collapse","navbar-collapse","active","bg-white","position-absolute","complete-download","mt-2"],[1,"nav-small-device"],[1,"align-items-center","p-3","pt-0"],[1,"row","g-0"],[1,"wp-100","mx-auto","mb-2"],["class","pt-0 h-100",4,"ngIf"],["color","primary","routerLink","/my/projects","placement","bottom",1,"btn","btn-grey","text-13","btn-h40","ml-10","border-0","text-primary","ps-3","pe-3"],[1,"btn","border-btn-gradiant","text-normal","d-flex","align-items-center","border-0","text-semi","ms-2","h-40",3,"click"],["name","prousernew",1,"f-24"],[1,"projectfiled","me-1","d-flex","align-items-center"],["type","text","maxlength","40",3,"ngModel","width","ngClass","ngModelChange","focusout","focus","input",4,"ngIf"],[1,"mask"],["type","text","maxlength","40",3,"ngModelChange","focusout","focus","input","ngModel","ngClass"],[1,"hw-40","d-flex","align-items-center","justify-content-center"],["class","btn-all btn-bottom","placement","bottom","ngbTooltip","Save to Cloud","tooltipClass","tooltip-custom-all","container","body",4,"ngIf"],["placement","bottom","ngbTooltip","Save to Cloud","tooltipClass","tooltip-custom-all","container","body",1,"btn-all","btn-bottom"],["name","cloudsave","class","text-success","style","cursor: pointer;",3,"ngClass","click",4,"ngIf"],["name","cloudsave",1,"text-success",2,"cursor","pointer",3,"click","ngClass"],["color","primary","placement","bottom",1,"btn-all","btn-outline-primary","text-13","btn-h40",3,"click"],["color","primary",1,"btn","btn-primary","btn-h40","ps-3","pe-3","d-flex","align-items-center","text-13","text-semi",3,"click"],["name","export",1,"f-24","me-2"],["color","primary",1,"btn","btn-primary","btn-download","btn-auto","text-normal","ml-8",3,"click"],["name","rendering",1,"icon","f-24","me-2","text-white"],[1,"pt-0","h-100"],[1,"d-flex","align-items-center"],[1,"wp-100","project-title","text-bold"],[1,"pointer",3,"click"],["name","closeexport",1,"f-24"],[1,"d-flex","align-items-center","complete-bg","mt-3"],[1,"wp-100","ms-4"],[1,""],[1,"btn","btn-primary","btn-small","me-1","border-0"],["name","downloadwhite",1,"icon",3,"click"],[1,"d-flex","align-items-center","error-bg","mt-3"],[1,"btn","btn-primary","btn-small","bg-error","me-1","border-0"],["name","replacedownload",1,"icon","f-24"]],template:function(e,r){if(1&e){const s=i.RV6();i.j41(0,"nav",3)(1,"div",4)(2,"div",5)(3,"a",6)(4,"span",7),i.nrm(5,"img",8),i.k0s(),i.j41(6,"span",9),i.nrm(7,"img",8),i.k0s()(),i.DNE(8,as,2,0,"button",10),i.j41(9,"label",11),i.bIt("click",function(){i.eBV(s);const l=i.sdS(12);return i.Njj(r.openMedia(l))}),i.EFF(10,"Open Media "),i.k0s(),i.j41(11,"input",12,0),i.bIt("change",function(l){return i.eBV(s),i.Njj(r.onFileUploaded(l.srcElement.files))})("click",function(){i.eBV(s);const l=i.sdS(12);return i.Njj(l.value="")}
1),i.k0s(),i.DNE(13,ls,3,0,"div",13)(14,cs,3,0,"div",13),i.k0s(),i.j41(15,"div",14),i.DNE(16,us,5,4,"div",15)(17,fs,2,1,"div",16)(18,ps,2,0,"button",17),i.k0s(),i.j41(19,"div",18)(20,"div"),i.DNE(21,gs,3,0,"button",19)(22,vs,3,0,"button",20)(23,_s,3,0,"button",19),i.k0s()()()(),i.j41(24,"nav",21)(25,"div",22)(26,"div",23)(27,"div",24)(28,"div",25),i.DNE(29,bs,12,1,"div",26)(30,ys,12,1,"div",26),i.k0s()()()()()}2&e&&(i.R7$(3),i.Y8G("routerLink",i.eq3(13,rs,r.homeURL)),i.R7$(5),i.Y8G("ngIf",r.user),i.R7$(3),i.Y8G("accept",r.fileUploadAccept),i.R7$(2),i.Y8G("ngIf",!r.user),i.R7$(),i.Y8G("ngIf",r.user&&!r.user.subscribed),i.R7$(2),i.Y8G("ngIf",r.user),i.R7$(),i.Y8G("ngIf",r.user),i.R7$(),i.Y8G("ngIf",!r.user),i.R7$(3),i.Y8G("ngIf",!r.isexportbtn),i.R7$(),i.Y8G("ngIf",r.isexportbtn&&!r.isexportstatus&&!r.webmSupport),i.R7$(),i.Y8G("ngIf",r.isexportstatus),i.R7$(6),i.Y8G("ngIf",r.exportdata),i.R7$(),i.Y8G("ngIf",!r.exportdata))},dependencies:[Y.YU,Y.bT,et.md,J.me,J.BC,J.tU,J.vS,Zt.Wk,qt.b,Si.KK],styles:[".project-heading[_ngcontent-%COMP%]{font-size:1.375rem;color:#111113}.btn-edit-icon[_ngcontent-%COMP%]{color:#959aa7;cursor:pointer}.btn-edit-icon[_ngcontent-%COMP%]:hover{color:#475ae7}.editMenuLinks[_ngcontent-%COMP%]{color:#626adf;display:inline-flex;cursor:pointer;align-items:center;white-space:nowrap}.projectTitle[_ngcontent-%COMP%]{margin:auto;position:relative;min-width:240px}.projectTitle[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{height:40px;border:1px solid transparent;background:none;text-align:center;border-radius:12px;padding:12px;font-size:13px;outline:none;font-weight:400;color:#606576;max-width:200px;min-width:22px;-webkit-appearance:none;appearance:none;background:transparent;box-sizing:border-box;font-variant-ligatures:none;left:auto;margin:0;outline:0 none;position:absolute;top:0;width:100%}.projectTitle[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus, .projectTitle[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:hover{background:#626adf0d;color:#272b34}.projectTitle[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:hover{border:1px solid transparent}.projectTitle[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus{border:1px solid #626ADF}.projectTitle[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus:hover{background:#626adf1a;color:#272b34}.header[_ngcontent-%COMP%]{background:linear-gradient(90deg,#eea8ff -4%,#83e1ff) bottom/100% 1px no-repeat;height:57px}.header[_ngcontent-%COMP%] .btnHeight[_ngcontent-%COMP%]{height:40px;align-self:center;white-space:nowrap}.btn-download[_ngcontent-%COMP%]{min-width:149px;font-size:14px!important;display:flex;align-items:center}.btn-small[_ngcontent-%COMP%]{width:40px;height:40px;padding:0;border-radius:8px;line-height:0}.complete-bg[_ngcontent-%COMP%]{background:#626adf0d;height:48px;border-radius:10px}.error-bg[_ngcontent-%COMP%]{background:#fcc;height:48px;border-radius:10px}.bg-error[_ngcontent-%COMP%]{background:#f25555!important}.complete-download[_ngcontent-%COMP%]{z-index:999;width:359px;right:20px;box-shadow:0 -2px 12px #00000026;border-radius:16px}.projectfiled[_ngcontent-%COMP%]{position:relative;max-width:200px}.projectfiled[_ngcontent-%COMP%] .mask[_ngcontent-%COMP%]{opacity:0;pointer-events:none;position:relative;white-space:pre;-webkit-appearance:none;appearance:none;background:transparent;box-sizing:border-box;font-variant-ligatures:none;left:0;margin:0;outline:0 none;text-overflow:ellipsis;top:0;height:40px;max-width:200px}.btn-bottom[_ngcontent-%COMP%]{width:40px;height:40px;padding:0rem;border-radius:12px;background:transparent}.btn-bottom[_ngcontent-%COMP%]:hover{background:#626adf0d}.btn-bottom[_ngcontent-%COMP%]:focus-visible{outline:none}.text-eclipse[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),n})();var ks=p(40813);function Cs(t,n){if(1&t&&(i.j41(0,"div",35),i.EFF(1),i.k0s()),2&t){const o=i.XpG().item;i.R7$(),i.Lme("",o.wratio," : ",o.hratio,"")}}function xs(t,n){if(1&t&&(i.j41(0,"ul",28)(1,"li")(2,"div",29)(3,"div",30),i.nrm(4,"pi",31),i.k0s(),i.j41(5,"div",32)(6,"div",33),i.EFF(7),i.k0s(),i.DNE(8,Cs,2,2,"div",34),i.k0s()()()()),2&t){const o=n.item;i.R7$(4),i.FS9("name",o.iconName),i.R7$(3),i.JRh(o.socialPlatform),i.R7$(),i.Y8G("ngIf",o.socialPlatformId)}}function ws(t,n){if(1&t&&(i.j41(0,"div",35),i.EFF(1),i.k0s()),2&t){const o=i.XpG().item;i.R7$(),i.Lme("",o.wratio," : ",o.hratio,"")}}function Ms(t,n){if(1&t&&(i.j41(0,"ul",28)(1,"li")(2,"div",36)(3,"div",30),i.nrm(4,"pi",31),i.k0s(),i.j41(5,"div",32)(6,"div",33),i.EFF(7),i.k0s(),i.DNE(8,ws,2,2,"div",34),i.k0s()()()()),2&t){const o=n.item;i.R7$(4),i.FS9("name",o.iconName),i.R7$(3),i.JRh(o.socialPlatform),i.R7$(),i.Y8G("ngIf",o.socialPlatformId)}}function Is(t,n){if(1&t){const o=i.RV6();i.qex(0),i.j41(1,"div",3)(2,"span",4),i.EFF(3,"Canvas Size"),i.k0s()(),i.j41(4,"div",5)(5,"div",6)(6,"ng-select",7),i.mxI("ngModelChange",function(r){i.eBV(o);const s=i.XpG();return i.DH7(s.socialPlatformId,r)||(s.socialPlatformId=r),i.Njj(r)}),i.bIt("change",function(r){i.eBV(o);const s=i.XpG();return i.Njj(s.layoutSelect(r))}),i.DNE(7,xs,9,3,"ng-template",8)(8,Ms,9,3,"ng-template",9),i.k0s()(),i.j41(9,"div",10)(10,"div",11)(11,"span",4),i.EFF(12,"Duration"),i.k0s()(),i.j41(13,"div",12)(14,"div",13),i.nrm(15,"input",14),i.j41(16,"label",15),i.EFF(17,"Automatic"),i.k0s(),i.j41(18,"span",16),i.EFF(19),i.k0s()(),i.nrm(20,"hr",17),i.j41(21,"div",13),i.nrm(22,"input",18),i.j41(23,"label",19),i.EFF(24,"Fixed"),i.k0s(),i.j41(25,"span",16),i.EFF(26),i.k0s()()()(),i.j41(27,"div",20)(28,"div",11)(29,"span",4),i.EFF(30,"Backgroun
1d Color"),i.k0s()(),i.j41(31,"div",21)(32,"div",22)(33,"div",23)(34,"button",24),i.bIt("click",function(){i.eBV(o);const r=i.XpG();return i.Njj(r.colorPanelVisible=!0)}),i.nrm(35,"pi",25),i.k0s()(),i.j41(36,"div",26)(37,"input",27),i.bIt("blur",function(r){i.eBV(o);const s=i.XpG();return i.Njj(s.focusOut(r))}),i.k0s()()()()()(),i.bVm()}if(2&t){const o=i.XpG();i.R7$(6),i.Y8G("items",o.layoutFormats),i.R50("ngModel",o.socialPlatformId),i.Y8G("searchable",!1)("clearable",!1),i.R7$(13),i.JRh(o.duration),i.R7$(7),i.JRh(o.duration),i.R7$(8),i.xc7("background",o.bgColor),i.R7$(3),i.Y8G("value",o.bgColor)}}function Es(t,n){if(1&t){const o=i.RV6();i.qex(0),i.j41(1,"div",5)(2,"div",37)(3,"app-color",38),i.bIt("colorEnable",function(){i.eBV(o);const r=i.XpG();return i.Njj(r.enableColor())})("changed",function(r){i.eBV(o);const s=i.XpG();return i.Njj(s.changeColor(r))}),i.k0s()()(),i.bVm()}if(2&t){const o=i.XpG();i.R7$(3),i.Y8G("panel",o.colorPanelVisible)("selectedColor",o.bgColor)("documentPanel",!1)("colorMap",o.colorMap)}}let Ps=(()=>{var t;class n{constructor(e){this.commonService=e,this.isColorEdited=!1,this.evented=!1,this.duration="01:45 :9",this.errorsmsg="",this.colorPanelVisible=!1,this.changeColorEvent=new i.bkB,this.layoutSelectEvent=new i.bkB}ngOnChanges(e){this.evented?this.evented=!1:this.isColorEdited=!1}ngOnDestroy(){this.isColorEdited&&this.changeColorEvent.emit({color:this.bgColor,final:!0})}layoutSelect(e){e&&this.layoutSelectEvent.emit(e)}changeColor(e){this.isColorEdited=!0,this.bgColor=e,this.evented=!0,this.changeColorEvent.emit({color:this.bgColor,final:!1})}enableColor(){this.colorPanelVisible=!1,this.changeColorEvent.emit({color:this.bgColor,final:!0})}focusOut(e){const r=this.commonService.isValidHexaCode(e.target.value);e.target.value&&r?(this.bgColor=r,this.changeColorEvent.emit({color:this.bgColor,final:!0})):(e.target.value=this.bgColor,this.changeColorEvent.emit({color:this.bgColor,final:!1}))}}return(t=n).\u0275fac=function(e){return new(e||t)(i.rXU(xn.h))},t.\u0275cmp=i.VBU({type:t,selectors:[["project-drawer"]],inputs:{socialPlatformId:"socialPlatformId",layoutFormats:"layoutFormats",isLoaded:"isLoaded",bgColor:"bgColor"},outputs:{changeColorEvent:"changeColorEvent",layoutSelectEvent:"layoutSelectEvent"},features:[i.OA$],decls:4,vars:2,consts:[[1,"pane-section"],[1,"scroll-content","drawer-elements"],[4,"ngIf"],[1,"d-flex","align-items-center","justify-content-between","common-container","pt-10","mb-9"],[1,"text-normal","text-dark","text-semi","lh-125"],[1,"common-container"],[1,"d-flex","w-100"],["bindLabel","socialPlatform","bindValue","socialPlatformId",1,"w-100","c-ng-select","project-drawer-select",3,"ngModelChange","change","items","ngModel","searchable","clearable"],["ng-label-tmp",""],["ng-option-tmp",""],[1,"d-flex","w-100","flex-column","d-none"],[1,"d-flex","align-items-center","justify-content-between","pt-10","mb-9","w-100"],[1,"d-flex","bg-white","duration-box","p-2","align-items-center","w-100","flex-column"],[1,"duration-items","w-100","d-flex","align-items-center","h-40"],["id","automatic","type","radio","value","Automatic","name","duration",1,"me-2"],["for","automatic",1,"text-normal","text-dark","text-semi","lh-125"],[1,"text-semi","ms-auto"],[1,"mt-2","mb-2","w-100"],["id","fixed","type","radio","value","Fixed","name","duration",1,"me-2"],["for","fixed",1,"text-normal","text-dark","text-semi","lh-125"],[1,"d-flex","w-100","flex-column"],[1,"d-flex","w-100","flex-column","bg-color-box","p-1"],[1,"row","g-0","m-0","align-items-center"],[1,"col-lg-8","pe-1","h-40"],["placement","top","ngbTooltip","Change Color","tooltipClass","tooltip-custom-all min-82",1,"no-style","color","control","p-0","color-box","w-100","border-radius-12",3,"click"],["name","currentcoloricon",1,"f-24"],[1,"col-lg-4","ps-1","h-40"],["type","text","maxlength","7",1,"w-100","text-semi","border-radius-12",3,"blur","value"],[1,"list-unstyled","w-100","mb-0"],[1,"row","g-0","align-items-center"],[1,"col-1","me-3","text-center"],[1,"f-28",3,"name"],[1,"col-10"],[1,"text-normal","text-dark","text-semi"],["class","text-sm grey-300 text-semi",4,"ngIf"],[1,"text-sm","grey-300","text-semi"],[1,"row","g-0","align-items-center","h-48"],[1,"d-flex","w-100","flex-column","app-color"],[3,"colorEnable","changed","panel","selectedColor","documentPanel","colorMap"]],template:function(e,r){1&e&&(i.j41(0,"div",0)(1,"div",1),i.DNE(2,Is,38,9,"ng-container",2)(3,Es,4,4,"ng-container",2),i.k0s()()),2&e&&(i.R7$(2),i.Y8G("ngIf",r.isLoaded&&!r.colorPanelVisible),i.R7$(),i.Y8G("ngIf",r.colorPanelVisible))},dependencies:[Y.bT,et.md,J.BC,J.vS,L.vr,L.Uq,L.ZZ,ks.X,qt.b],styles:[".sticker-thumb[_ngcontent-%COMP%]{height:120px;width:50%;float:right;margin-bottom:10px}.sticker-thumb[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;padding:10px;height:100%}.sticker-thumb[_ngcontent-%COMP%] .inner[_ngcontent-%COMP%]{background:#fff;margin:5px;height:100%}"]}),n})();function Os(t){return t}function Ss(t){return"translate("+t+",0)"}function As(t){return"translate(0,"+t+")"}function js(t){return n=>+t(n)}function Ds(t,n){return n=Math.max(0,t.bandwidth()-2*n)/2,t.round()&&(n=Math.round(n)),o=>+t(o)+n}function Rs(){return!this.__axis}function Xe(t,n){var o=[],e=null,r=null,s=6,a=6,l=3,c=typeof window<"u"&&window.devicePixelRatio>1?0:.5,d=1===t||4===t?-1:1,u=4===t||2===t?"x":"y",h=1===t||3===t?Ss:As;function f(m){var T=e??(n.ticks?n.ticks.apply(n,o):n.domain()),b=r??(n.tickFormat?n.tick
vendor: 7,659 bytes, line 1
1Format.apply(n,o):Os),_=Math.max(s,0)+l,v=n.range(),C=+v[0]+c,y=+v[v.length-1]+c,w=(n.bandwidth?Ds:js)(n.copy(),c),x=m.selection?m.selection():m,E=x.selectAll(".domain").data([null]),N=x.selectAll(".tick").data(T,n).order(),A=N.exit(),I=N.enter().append("g").attr("class","tick"),P=N.select("line"),z=N.select("text");E=E.merge(E.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),N=N.merge(I),P=P.merge(I.append("line").attr("stroke","currentColor").attr(u+"2",d*s)),z=z.merge(I.append("text").attr("fill","currentColor").attr(u,d*_).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),m!==x&&(E=E.transition(m),N=N.transition(m),P=P.transition(m),z=z.transition(m),A=A.transition(m).attr("opacity",1e-6).attr("transform",function(V){return isFinite(V=w(V))?h(V+c):this.getAttribute("transform")}),I.attr("opacity",1e-6).attr("transform",function(V){var W=this.parentNode.__axis;return h((W&&isFinite(W=W(V))?W:w(V))+c)})),A.remove(),E.attr("d",4===t||2===t?a?"M"+d*a+","+C+"H"+c+"V"+y+"H"+d*a:"M"+c+","+C+"V"+y:a?"M"+C+","+d*a+"V"+c+"H"+y+"V"+d*a:"M"+C+","+c+"H"+y),N.attr("opacity",1).attr("transform",function(V){return h(w(V)+c)}),P.attr(u+"2",d*s),z.attr(u,d*_).text(b),x.filter(Rs).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),x.each(function(){this.__axis=w})}return f.scale=function(m){return arguments.length?(n=m,f):n},f.ticks=function(){return o=Array.from(arguments),f},f.tickArguments=function(m){return arguments.length?(o=null==m?[]:Array.from(m),f):o.slice()},f.tickValues=function(m){return arguments.length?(e=null==m?null:Array.from(m),f):e&&e.slice()},f.tickFormat=function(m){return arguments.length?(r=m,f):r},f.tickSize=function(m){return arguments.length?(s=a=+m,f):s},f.tickSizeInner=function(m){return arguments.length?(s=+m,f):s},f.tickSizeOuter=function(m){return arguments.length?(a=+m,f):a},f.tickPadding=function(m){return arguments.length?(l=+m,f):l},f.offset=function(m){return arguments.length?(c=+m,f):c},f}function Ns(){}function ji(t){return null==t?Ns:function(){return this.querySelector(t)}}function Fs(){return[]}function Mn(t){return null==t?Fs:function(){return this.querySelectorAll(t)}}function In(t){return function(){return this.matches(t)}}function En(t){return function(n){return n.matches(t)}}var zs=Array.prototype.find;function Xs(){return this.firstElementChild}var $s=Array.prototype.filter;function Ws(){return Array.from(this.children)}function Pn(t){return new Array(t.length)}function He(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function ta(t,n,o,e,r,s){for(var l,a=0,c=n.length,d=s.length;a<d;++a)(l=n[a])?(l.__data__=s[a],e[a]=l):o[a]=new He(t,s[a]);for(;a<c;++a)(l=n[a])&&(r[a]=l)}function ea(t,n,o,e,r,s,a){var l,c,m,d=new Map,u=n.length,h=s.length,f=new Array(u);for(l=0;l<u;++l)(c=n[l])&&(f[l]=m=a.call(c,c.__data__,l,n)+"",d.has(m)?r[l]=c:d.set(m,c));for(l=0;l<h;++l)m=a.call(t,s[l],l,s)+"",(c=d.get(m))?(e[l]=c,c.__data__=s[l],d.delete(m)):o[l]=new He(t,s[l]);for(l=0;l<u;++l)(c=n[l])&&d.get(f[l])===c&&(r[l]=c)}function ia(t){return t.__data__}function ra(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function da(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}He.prototype={constructor:He,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var Di="http://www.w3.org/1999/xhtml";const On={svg:"http://www.w3.org/2000/svg",xhtml:Di,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function $e(t){var n=t+="",o=n.indexOf(":");return o>=0&&"xmlns"!==(n=t.slice(0,o))&&(t=t.slice(o+1)),On.hasOwnProperty(n)?{space:On[n],local:t}:t}function va(t){return function(){this.removeAttribute(t)}}function _a(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ba(t,n){return function(){this.setAttribute(t,n)}}function ya(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function Ta(t,n){return function(){var o=n.apply(this,arguments);null==o?this.removeAttribute(t):this.setAttribute(t,o)}}function ka(t,n){return function(){var o=n.apply(this,arguments);null==o?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,o)}}function Sn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function xa(t){return function(){this.style.removeProperty(t)}}function wa(t,n,o){return function(){this.style.setProperty(t,n,o)}}function Ma(t,n,o){return function(){var e=n.apply(this,arguments);null==e?this.style.removeProperty(t):this.style.setProperty(t,e,o)}}function he(t,n){return t.style.getPropertyValue(n)||Sn(t).getComputedStyle(t,null).getPropertyValue(n)}function Ea(t){return function(){delete this[t]}}function Pa(t,n){return function(){this[t]=n}}function Oa(t,n){return function(){var o=n.apply(this,arguments);null==o?delete this[t]:this[t]=o}}function An(t){return t.trim().split(/^|\s+/)}function Ri(t){return t.classList||new jn(t)}function jn(t){this._node=t,this._names=An(t.getAttribute("class")||"")}function Dn(t,n){for(var o=Ri(t),e=-1,r=n.length;++e<r;)o.add(n[e])}function Rn(t,n){for(var o=Ri(t),e=-1,r=n.length;++e<r;)o.remove(n[e])}function Aa(t){return function(){Dn(this,t)}}function ja(t){return function(){Rn(this,t)}}function Da(t,n){return function(){(n.apply(this,arguments)?Dn:Rn)(this,t)}}function Va(){this.textContent=""}function Na(t){return function(){this.textContent=t}}function Ua(t){return function(){var n=t.apply(this,arguments);this.textContent=n??""}}function Fa(){this.innerHTML=""}function Ba(t){return function(){this.innerHTML=t}}function La(t){return function(){var n=t.apply(this,arguments);this.innerHTML=n??""}}function Ya(){this.nextSibling&&this.parentNode.appendChild(this)}function Ha(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Wa(t){return function(){var n=this.ownerDocument,o=this.namespaceURI;return o===Di&&n.documentElement.namespaceURI===Di?n.createElement(t):n.createElementNS(o,t)}}function Ka(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Vn(t){var n=$e(t);return(n.local?Ka:Wa)(n)}function Ja(){return null}function qa(){var t=this.parentNode;t&&t.removeChild(this)}function el(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function il(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function al(t){return function(){var n=this.__on;if(n){for(var s,o=0,e=-1,r=n.length;o<r;++o)s=n[o],t.type&&s.type!==t.type||s.name!==t.name?n[++e]=s:this.removeEventListener(s.type,s.listener,s.options);++e?n.length=e:delete this.__on}}}function ll(t,n,o){return function(){var r,e=this.__on,s=function ol(t){return function(n){t.call(this,n,this.__data__)}}(n);if(e)for(var a=0,l=e.length;a<l;++a)if((r=e[a]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=s,r.options=o),void(r.value=n);this.addEventListener(t.type,s,o),r={type:t.type,name:t.name,value:n,listener:s,options:o},e?e.push(r):this.__on=[r]}}function Nn(t,n,o){var e=Sn(t),r=e.CustomEvent;"function"==typeof r?r=new r(n,o):(r=e.document.createEvent("Event"),o?(r.initEvent(n,o.bubbles,o.cancelable),r.detail=o.detail):r.initEvent(n,!1,!1)),t.dis
1patchEvent(r)}function dl(t,n){return function(){return Nn(this,t,n)}}function ul(t,n){return function(){return Nn(this,t,n.apply(this,arguments))}}jn.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Un=[null];function Pt(t,n){this._groups=t,this._parents=n}function Gn(){return new Pt([[document.documentElement]],Un)}Pt.prototype=Gn.prototype={constructor:Pt,select:function Us(t){"function"!=typeof t&&(t=ji(t));for(var n=this._groups,o=n.length,e=new Array(o),r=0;r<o;++r)for(var c,d,s=n[r],a=s.length,l=e[r]=new Array(a),u=0;u<a;++u)(c=s[u])&&(d=t.call(c,c.__data__,u,s))&&("__data__"in c&&(d.__data__=c.__data__),l[u]=d);return new Pt(e,this._parents)},selectAll:function Ls(t){t="function"==typeof t?function Bs(t){return function(){return function Gs(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}(t.apply(this,arguments))}}(t):Mn(t);for(var n=this._groups,o=n.length,e=[],r=[],s=0;s<o;++s)for(var c,a=n[s],l=a.length,d=0;d<l;++d)(c=a[d])&&(e.push(t.call(c,c.__data__,d,a)),r.push(c));return new Pt(e,r)},selectChild:function Hs(t){return this.select(null==t?Xs:function Ys(t){return function(){return zs.call(this.children,t)}}("function"==typeof t?t:En(t)))},selectChildren:function Zs(t){return this.selectAll(null==t?Ws:function Ks(t){return function(){return $s.call(this.children,t)}}("function"==typeof t?t:En(t)))},filter:function Js(t){"function"!=typeof t&&(t=In(t));for(var n=this._groups,o=n.length,e=new Array(o),r=0;r<o;++r)for(var c,s=n[r],a=s.length,l=e[r]=[],d=0;d<a;++d)(c=s[d])&&t.call(c,c.__data__,d,s)&&l.push(c);return new Pt(e,this._parents)},data:function na(t,n){if(!arguments.length)return Array.from(this,ia);var o=n?ea:ta,e=this._parents,r=this._groups;"function"!=typeof t&&(t=function qs(t){return function(){return t}}(t));for(var s=r.length,a=new Array(s),l=new Array(s),c=new Array(s),d=0;d<s;++d){var u=e[d],h=r[d],f=h.length,m=ra(t.call(u,u&&u.__data__,d,e)),T=m.length,b=l[d]=new Array(T),_=a[d]=new Array(T);o(u,h,b,_,c[d]=new Array(f),m,n);for(var w,x,C=0,y=0;C<T;++C)if(w=b[C]){for(C>=y&&(y=C+1);!(x=_[y])&&++y<T;);w._next=x||null}}return(a=new Pt(a,e))._enter=l,a._exit=c,a},enter:function Qs(){return new Pt(this._enter||this._groups.map(Pn),this._parents)},exit:function oa(){return new Pt(this._exit||this._groups.map(Pn),this._parents)},join:function sa(t,n,o){var e=this.enter(),r=this,s=this.exit();return"function"==typeof t?(e=t(e))&&(e=e.selection()):e=e.append(t+""),null!=n&&(r=n(r))&&(r=r.selection()),null==o?s.remove():o(s),e&&r?e.merge(r).order():r},merge:function aa(t){for(var n=t.selection?t.selection():t,o=this._groups,e=n._groups,r=o.length,a=Math.min(r,e.length),l=new Array(r),c=0;c<a;++c)for(var m,d=o[c],u=e[c],h=d.length,f=l[c]=new Array(h),T=0;T<h;++T)(m=d[T]||u[T])&&(f[T]=m);for(;c<r;++c)l[c]=o[c];return new Pt(l,this._parents)},selection:function fl(){return this},order:function la(){for(var t=this._groups,n=-1,o=t.length;++n<o;)for(var a,e=t[n],r=e.length-1,s=e[r];--r>=0;)(a=e[r])&&(s&&4^a.compareDocumentPosition(s)&&s.parentNode.insertBefore(a,s),s=a);return this},sort:function ca(t){function n(h,f){return h&&f?t(h.__data__,f.__data__):!h-!f}t||(t=da);for(var o=this._groups,e=o.length,r=new Array(e),s=0;s<e;++s){for(var d,a=o[s],l=a.length,c=r[s]=new Array(l),u=0;u<l;++u)(d=a[u])&&(c[u]=d);c.sort(n)}return new Pt(r,this._parents).order()},call:function ua(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function ha(){return Array.from(this)},node:function ma(){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var e=t[n],r=0,s=e.length;r<s;++r){var a=e[r];if(a)return a}return null},size:function fa(){let t=0;for(const n of this)++t;return t},empty:function pa(){return!this.node()},each:function ga(t){for(var n=this._groups,o=0,e=n.length;o<e;++o)for(var l,r=n[o],s=0,a=r.length;s<a;++s)(l=r[s])&&t.call(l,l.__data__,s,r);return this},attr:function Ca(t,n){var o=$e(t);if(arguments.length<2){var e=this.node();return o.local?e.getAttributeNS(o.space,o.local):e.getAttribute(o)}return this.each((null==n?o.local?_a:va:"function"==typeof n?o.local?ka:Ta:o.local?ya:ba)(o,n))},style:function Ia(t,n,o){return arguments.length>1?this.each((null==n?xa:"function"==typeof n?Ma:wa)(t,n,o??"")):he(this.node(),t)},property:function Sa(t,n){return arguments.length>1?this.each((null==n?Ea:"function"==typeof n?Oa:Pa)(t,n)):this.node()[t]},classed:function Ra(t,n){var o=An(t+"");
1if(arguments.length<2){for(var e=Ri(this.node()),r=-1,s=o.length;++r<s;)if(!e.contains(o[r]))return!1;return!0}return this.each(("function"==typeof n?Da:n?Aa:ja)(o,n))},text:function Ga(t){return arguments.length?this.each(null==t?Va:("function"==typeof t?Ua:Na)(t)):this.node().textContent},html:function za(t){return arguments.length?this.each(null==t?Fa:("function"==typeof t?La:Ba)(t)):this.node().innerHTML},raise:function Xa(){return this.each(Ya)},lower:function $a(){return this.each(Ha)},append:function Za(t){var n="function"==typeof t?t:Vn(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})},insert:function Qa(t,n){var o="function"==typeof t?t:Vn(t),e=null==n?Ja:"function"==typeof n?n:ji(n);return this.select(function(){return this.insertBefore(o.apply(this,arguments),e.apply(this,arguments)||null)})},remove:function tl(){return this.each(qa)},clone:function nl(t){return this.select(t?il:el)},datum:function rl(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function cl(t,n,o){var r,a,e=function sl(t){return t.trim().split(/^|\s+/).map(function(n){var o="",e=n.indexOf(".");return e>=0&&(o=n.slice(e+1),n=n.slice(0,e)),{type:n,name:o}})}(t+""),s=e.length;if(!(arguments.length<2)){for(l=n?ll:al,r=0;r<s;++r)this.each(l(e[r],n,o));return this}var l=this.node().__on;if(l)for(var u,c=0,d=l.length;c<d;++c)for(r=0,u=l[c];r<s;++r)if((a=e[r]).type===u.type&&a.name===u.name)return u.value},dispatch:function hl(t,n){return this.each(("function"==typeof n?ul:dl)(t,n))},[Symbol.iterator]:function*ml(){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var a,e=t[n],r=0,s=e.length;r<s;++r)(a=e[r])&&(yield a)}};const Me=Gn;var pl={value:()=>{}};function Fn(){for(var e,t=0,n=arguments.length,o={};t<n;++t){if(!(e=arguments[t]+"")||e in o||/[\s.]/.test(e))throw new Error("illegal type: "+e);o[e]=[]}return new We(o)}function We(t){this._=t}function vl(t,n){for(var r,o=0,e=t.length;o<e;++o)if((r=t[o]).name===n)return r.value}function Bn(t,n,o){for(var e=0,r=t.length;e<r;++e)if(t[e].name===n){t[e]=pl,t=t.slice(0,e).concat(t.slice(e+1));break}return null!=o&&t.push({name:n,value:o}),t}We.prototype=Fn.prototype={constructor:We,on:function(t,n){var r,o=this._,e=function gl(t,n){return t.trim().split(/^|\s+/).map(function(o){var e="",r=o.indexOf(".");if(r>=0&&(e=o.slice(r+1),o=o.slice(0,r)),o&&!n.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:e}})}(t+"",o),s=-1,a=e.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++s<a;)if(r=(t=e[s]).type)o[r]=Bn(o[r],t.name,n);else if(null==n)for(r in o)o[r]=Bn(o[r],t.name,null);return this}for(;++s<a;)if((r=(t=e[s]).type)&&(r=vl(o[r],t.name)))return r},copy:function(){var t={},n=this._;for(var o in n)t[o]=n[o].slice();return new We(t)},call:function(t,n){if((r=arguments.length-2)>0)for(var r,s,o=new Array(r),e=0;e<r;++e)o[e]=arguments[e+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(e=0,r=(s=this._[t]).length;e<r;++e)s[e].value.apply(n,o)},apply:function(t,n,o){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var e=this._[t],r=0,s=e.length;r<s;++r)e[r].value.apply(n,o)}};const _l=Fn;var Ke,Pe,me=0,Ie=0,Ee=0,Ln=1e3,Ze=0,te=0,Je=0,Oe="object"==typeof performance&&performance.now?performance:Date,zn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Vi(){return te||(zn(bl),te=Oe.now()+Je)}function bl(){te=0}function Qe(){this._call=this._time=this._next=null}function Yn(t,n,o){var e=new Qe;return e.restart(t,n,o),e}function Xn(){te=(Ze=Oe.now())+Je,me=Ie=0;try{!function yl(){Vi(),++me;for(var n,t=Ke;t;)(n=te-t._time)>=0&&t._call.call(void 0,n),t=t._next;--me}()}finally{me=0,function kl(){for(var t,o,n=Ke,e=1/0;n;)n._call?(e>n._time&&(e=n._time),t=n,n=n._next):(o=n._next,n._next=null,n=t?t._next=o:Ke=o);Pe=t,Ni(e)}(),te=0}}function Tl(){var t=Oe.now(),n=t-Ze;n>Ln&&(Je-=n,Ze=t)}function Ni(t){me||(Ie&&(Ie=clearTimeout(Ie)),t-te>24?(t<1/0&&(Ie=setTimeout(Xn,t-Oe.now()-Je)),Ee&&(Ee=clearInterval(Ee))):(Ee||(Ze=Oe.now(),Ee=setInterval(Tl,Ln)),me=1,zn(Xn)))}function Hn(t,n,o){var e=new Qe;return e.restart(r=>
vendor: 9,832 bytes, line 1
1{e.stop(),t(r+n)},n=null==n?0:+n,o),e}Qe.prototype=Yn.prototype={constructor:Qe,restart:function(t,n,o){if("function"!=typeof t)throw new TypeError("callback is not a function");o=(null==o?Vi():+o)+(null==n?0:+n),!this._next&&Pe!==this&&(Pe?Pe._next=this:Ke=this,Pe=this),this._call=t,this._time=o,Ni()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ni())}};var Cl=_l("start","end","cancel","interrupt"),xl=[],$n=0,qe=3;function ei(t,n,o,e,r,s){var a=t.__transition;if(a){if(o in a)return}else t.__transition={};!function wl(t,n,o){var r,e=t.__transition;function a(d){var u,h,f,m;if(1!==o.state)return c();for(u in e)if((m=e[u]).name===o.name){if(m.state===qe)return Hn(a);4===m.state?(m.state=6,m.timer.stop(),m.on.call("interrupt",t,t.__data__,m.index,m.group),delete e[u]):+u<n&&(m.state=6,m.timer.stop(),m.on.call("cancel",t,t.__data__,m.index,m.group),delete e[u])}if(Hn(function(){o.state===qe&&(o.state=4,o.timer.restart(l,o.delay,o.time),l(d))}),o.state=2,o.on.call("start",t,t.__data__,o.index,o.group),2===o.state){for(o.state=qe,r=new Array(f=o.tween.length),u=0,h=-1;u<f;++u)(m=o.tween[u].value.call(t,t.__data__,o.index,o.group))&&(r[++h]=m);r.length=h+1}}function l(d){for(var u=d<o.duration?o.ease.call(null,d/o.duration):(o.timer.restart(c),o.state=5,1),h=-1,f=r.length;++h<f;)r[h].call(t,u);5===o.state&&(o.on.call("end",t,t.__data__,o.index,o.group),c())}function c(){for(var d in o.state=6,o.timer.stop(),delete e[n],e)return;delete t.__transition}e[n]=o,o.timer=Yn(function s(d){o.state=1,o.timer.restart(a,o.delay,o.time),o.delay<=d&&a(d-o.delay)},0,o.time)}(t,o,{name:n,index:e,group:r,on:Cl,tween:xl,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:$n})}function Fi(t,n){var o=Dt(t,n);if(o.state>$n)throw new Error("too late; already scheduled");return o}function Ut(t,n){var o=Dt(t,n);if(o.state>qe)throw new Error("too late; already running");return o}function Dt(t,n){var o=t.__transition;if(!o||!(o=o[n]))throw new Error("transition not found");return o}function Rt(t,n){return t=+t,n=+n,function(o){return t*(1-o)+n*o}}var ii,Zn=180/Math.PI,Bi={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Jn(t,n,o,e,r,s){var a,l,c;return(a=Math.sqrt(t*t+n*n))&&(t/=a,n/=a),(c=t*o+n*e)&&(o-=t*c,e-=n*c),(l=Math.sqrt(o*o+e*e))&&(o/=l,e/=l,c/=l),t*e<n*o&&(t=-t,n=-n,c=-c,a=-a),{translateX:r,translateY:s,rotate:Math.atan2(n,t)*Zn,skewX:Math.atan(c)*Zn,scaleX:a,scaleY:l}}function Qn(t,n,o,e){function r(d){return d.length?d.pop()+" ":""}return function(d,u){var h=[],f=[];return d=t(d),u=t(u),function s(d,u,h,f,m,T){if(d!==h||u!==f){var b=m.push("translate(",null,n,null,o);T.push({i:b-4,x:Rt(d,h)},{i:b-2,x:Rt(u,f)})}else(h||f)&&m.push("translate("+h+n+f+o)}(d.translateX,d.translateY,u.translateX,u.translateY,h,f),function a(d,u,h,f){d!==u?(d-u>180?u+=360:u-d>180&&(d+=360),f.push({i:h.push(r(h)+"rotate(",null,e)-2,x:Rt(d,u)})):u&&h.push(r(h)+"rotate("+u+e)}(d.rotate,u.rotate,h,f),function l(d,u,h,f){d!==u?f.push({i:h.push(r(h)+"skewX(",null,e)-2,x:Rt(d,u)}):u&&h.push(r(h)+"skewX("+u+e)}(d.skewX,u.skewX,h,f),function c(d,u,h,f,m,T){if(d!==h||u!==f){var b=m.push(r(m)+"scale(",null,",",null,")");T.push({i:b-4,x:Rt(d,h)},{i:b-2,x:Rt(u,f)})}else(1!==h||1!==f)&&m.push(r(m)+"scale("+h+","+f+")")}(d.scaleX,d.scaleY,u.scaleX,u.scaleY,h,f),d=u=null,function(m){for(var _,T=-1,b=f.length;++T<b;)h[(_=f[T]).i]=_.x(m);return h.join("")}}}var Ol=Qn(function El(t){const n=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return n.isIdentity?Bi:Jn(n.a,n.b,n.c,n.d,n.e,n.f)},"px, ","px)","deg)"),Sl=Qn(function Pl(t){return null!=t&&(ii||(ii=document.createElementNS("http://www.w3.org/2000/svg","g")),ii.setAttribute("transform",t),t=ii.transform.baseVal.consolidate())?Jn((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Bi},", ",")",")");function Al(t,n){var o,e;return function(){var r=Ut(this,t),s=r.tween;if(s!==o)for(var a=0,l=(e=o=s).length;a<l;++a)if(e[a].name===n){(e=e.slice()).splice(a,1);break}r.tween=e}}function jl(t,n,o){var e,r;if("function"!=typeof o)throw new Error;return function(){var s=Ut(this,t),a=s.tween;if(a!==e){r=(e=a).slice();for(var l={name:n,value:o},c=0,d=r.length;c<d;++c)if(r[c].name===n){r[c]=l;break}c===d&&r.push(l)}s.tween=r}}function Li(t,n,o){var e=t._id;return t.each(function(){var r=Ut(this,e);(r.value||(r.value={}))[n]=o.apply(this,arguments)}),function(r){return Dt(r,e).value[n]}}function zi(t,n,o){t.prototype=n.prototype=o,o.constructor=t}function qn(t,n){var o=Object.create(t.prototype);for(var e in n)o[e]=n[e];return o}function Se(){}var ni=1/.7,fe="\\s*([+-]?\\d+)\\s*",je="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Gt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Rl=/^#([0-9a-f]{3,8})$/,Vl=new RegExp(`^rgb\\(${fe},${fe},${fe}\\)$`),Nl=new RegExp(`^rgb\\(${Gt},${Gt},${Gt}\\)$`),Ul=new RegExp(`^rgba\\(${fe},${fe},${fe},${je}\\)$`),Gl=new RegExp(`^rgba\\(${Gt},${Gt},${Gt},${je}\\)$`),Fl=new RegExp(`^hsl\\(${je},${Gt},${Gt}\\)$`),Bl=new RegExp(`^hsla\\(${je},${Gt},${Gt},${je}\\)$`),tr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function er(){return this.rgb().formatHex()}function ir(){return this.rgb().formatRgb()}function ee(t){var n,o;return t=(t+"").trim().toLowerCase(),(n=Rl.exec(t))?(o=n[1].length,n=parseInt(n[1],16),6===o?nr(n):3===o?new Mt(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===o?ri(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===o?ri(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=Vl.exec(t))?new Mt(n[1],n[2],n[3],1):(n=Nl.exec(t))?new Mt(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=Ul.exec(t))?ri(n[1],n[2],n[3],n[4]):(n=Gl.exec(t))?ri(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=Fl.exec(t))?sr(n[1],n[2]/100,n[3]/100,1):(n=Bl.exec(t))?sr(n[1],n[2]/100,n[3]/100,n[4]):tr.hasOwnProperty(t)?nr(tr[t]):"transparent"===t?new Mt(NaN,NaN,NaN,0):null}function nr(t){return new Mt(t>>16&255,t>>8&255,255&t,1)}function ri(t,n,o,e){return e<=0&&(t=n=o=NaN),new Mt(t,n,o,e)}function oi(t,n,o,e){return 1===arguments.length?function Yl(t){return t instanceof Se||(t=ee(t)),t?new Mt((t=t.rgb()).r,t.g,t.b,t.opacity):new Mt}(t):new Mt(t,n,o,e??1)}function Mt(t,n,o,e){this.r=+t,this.g=+n,this.b=+o,this.opacity=+e}function rr(){return`#${ne(this.r)}${ne(this.g)}${ne(this.b)}`}function or(){const t=si(this.opacity);return`${1===t?"rgb(":"rgba("}${ie(this.r)}, ${ie(this.g)}, ${ie(this.b)}${1===t?")":`, ${t})`}`}function si(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ie(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ne(t){return((t=ie(t))<16?"0":"")+t.toString(16)}function sr(t,n,o,e){return e<=0?t=n=o=NaN:o<=0||o>=1?t=n=NaN:n<=0&&(t=NaN),new Vt(t,n,o,e)}function ar(t){if(t instanceof Vt)return new Vt(t.h,t.s,t.l,t.opacity);if(t instanceof Se||(t=ee(t)),!t)return new Vt;if(t instanceof Vt)return t;var n=(t=t.rgb()).r/255,o=t.g/255,e=t.b/255,r=Math.min(n,o,e),s=Math.max(n,o,e),a=NaN,l=s-r,c=(s+r)/2;return l?(a=n===s?(o-e)/l+6*(o<e):o===s?(e-n)/l+2:(n-o)/l+4,l/=c<.5?s+r:2-s-r,a*=60):l=c>0&&c<1?0:a,new Vt(a,l,c,t.opacity)}function Vt(t,n,o,e){this.h=+t,this.s=+n,this.l=+o,this.opacity=+e}function lr(t){return(t=(t||0)%360)<0?t+360:t}
1function ai(t){return Math.max(0,Math.min(1,t||0))}function Yi(t,n,o){return 255*(t<60?n+(o-n)*t/60:t<180?o:t<240?n+(o-n)*(240-t)/60:n)}function cr(t,n,o,e,r){var s=t*t,a=s*t;return((1-3*t+3*s-a)*n+(4-6*s+3*a)*o+(1+3*t+3*s-3*a)*e+a*r)/6}zi(Se,ee,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:er,formatHex:er,formatHex8:function Ll(){return this.rgb().formatHex8()},formatHsl:function zl(){return ar(this).formatHsl()},formatRgb:ir,toString:ir}),zi(Mt,oi,qn(Se,{brighter(t){return t=null==t?ni:Math.pow(ni,t),new Mt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new Mt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Mt(ie(this.r),ie(this.g),ie(this.b),si(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:rr,formatHex:rr,formatHex8:function Xl(){return`#${ne(this.r)}${ne(this.g)}${ne(this.b)}${ne(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:or,toString:or})),zi(Vt,function Hl(t,n,o,e){return 1===arguments.length?ar(t):new Vt(t,n,o,e??1)},qn(Se,{brighter(t){return t=null==t?ni:Math.pow(ni,t),new Vt(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new Vt(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,o=this.l,e=o+(o<.5?o:1-o)*n,r=2*o-e;return new Mt(Yi(t>=240?t-240:t+120,r,e),Yi(t,r,e),Yi(t<120?t+240:t-120,r,e),this.opacity)},clamp(){return new Vt(lr(this.h),ai(this.s),ai(this.l),si(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=si(this.opacity);return`${1===t?"hsl(":"hsla("}${lr(this.h)}, ${100*ai(this.s)}%, ${100*ai(this.l)}%${1===t?")":`, ${t})`}`}}));const Xi=t=>()=>t;function ur(t,n){var o=n-t;return o?function dr(t,n){return function(o){return t+o*n}}(t,o):Xi(isNaN(t)?n:t)}const li=function t(n){var o=function Zl(t){return 1==(t=+t)?ur:function(n,o){return o-n?function Kl(t,n,o){return t=Math.pow(t,o),n=Math.pow(n,o)-t,o=1/o,function(e){return Math.pow(t+e*n,o)}}(n,o,t):Xi(isNaN(n)?o:n)}}(n);function e(r,s){var a=o((r=oi(r)).r,(s=oi(s)).r),l=o(r.g,s.g),c=o(r.b,s.b),d=ur(r.opacity,s.opacity);return function(u){return r.r=a(u),r.g=l(u),r.b=c(u),r.opacity=d(u),r+""}}return e.gamma=t,e}(1);function hr(t){return function(n){var a,l,o=n.length,e=new Array(o),r=new Array(o),s=new Array(o);for(a=0;a<o;++a)l=oi(n[a]),e[a]=l.r||0,r[a]=l.g||0,s[a]=l.b||0;return e=t(e),r=t(r),s=t(s),l.opacity=1,function(c){return l.r=e(c),l.g=r(c),l.b=s(c),l+""}}}hr(function $l(t){var n=t.length-1;return function(o){var e=o<=0?o=0:o>=1?(o=1,n-1):Math.floor(o*n),r=t[e],s=t[e+1];return cr((o-e/n)*n,e>0?t[e-1]:2*r-s,r,s,e<n-1?t[e+2]:2*s-r)}}),hr(function Wl(t){var n=t.length;return function(o){var e=Math.floor(((o%=1)<0?++o:o)*n);return cr((o-e/n)*n,t[(e+n-1)%n],t[e%n],t[(e+1)%n],t[(e+2)%n])}});var Hi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,$i=new RegExp(Hi.source,"g");function mr(t,n){var e,r,s,o=Hi.lastIndex=$i.lastIndex=0,a=-1,l=[],c=[];for(t+="",n+="";(e=Hi.exec(t))&&(r=$i.exec(n));)(s=r.index)>o&&(s=n.slice(o,s),l[a]?l[a]+=s:l[++a]=s),(e=e[0])===(r=r[0])?l[a]?l[a]+=r:l[++a]=r:(l[++a]=null,c.push({i:a,x:Rt(e,r)})),o=$i.lastIndex;return o<n.length&&(s=n.slice(o),l[a]?l[a]+=s:l[++a]=s),l.length<2?c[0]?function Ql(t){return function(n){return t(n)+""}}(c[0].x):function Jl(t){return function(){return t}}(n):(n=c.length,function(d){for(var h,u=0;u<n;++u)l[(h=c[u]).i]=h.x(d);return l.join("")})}function fr(t,n){var o;return("number"==typeof n?Rt:n instanceof ee?li:(o=ee(n))?(n=o,li):mr)(t,n)}function ql(t){return function(){this.removeAttribute(t)}}function tc(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ec(t,n,o){var e,s,r=o+"";return function(){var a=this.getAttribute(t);return a===r?null:a===e?s:s=n(e=a,o)}}function ic(t,n,o){var e,s,r=o+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===r?null:a===e?s:s=n(e=a,o)}}function nc(t,n,o){var e,r,s;return function(){var a,c,l=o(this);return null==l?void this.removeAttribute(t):(a=this.getAttribute(t))===(c=l+"")?null:a===e&&c===r?s:(r=c,s=n(e=a,l))}}function rc(t,n,o){var e,r,s;return function(){var a,c,l=o(this);return null==l?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local))===(c=l+"")?null:a===e&&c===r?s:(r=c,s=n(e=a,l))}}function lc(t,n){var o,e;function r(){var s=n.apply(this,arguments);return s!==e&&(o=(e=s)&&function ac(t,n){return function(o){this.setAttributeNS(t.space,t.local,n.call(this,o))}}(t,s)),o}return r._value=n,r}function cc(t,n){var o,e;function r(){var s=n.apply(this,arguments);return s!==e&&(o=(e=s)&&function sc(t,n){return function(o){this.setAttribute(t,n.call(this,o))}}(t,s)),o}return r._value=n,r}function uc(t,n){return function(){Fi(this,t).delay=+n.apply(this,arguments)}}function hc(t,n){return n=+n,function(){Fi(this,t).delay=n}}function fc(t,n){return function(){Ut(this,t).duration=+n.apply(this,arguments)}}function pc(t,n){return n=+n,function(){Ut(this,t).duration=n}}var Oc=Me.prototype.constructor;function pr(t){return function(){this.style.removeProperty(t)}}var Wc=0;function Bt(t,n,o,e){this._groups=t,this._parents=n,this._name=o,this._id=e}function gr(){return++Wc}var Lt=Me.prototype;Bt.prototype=function Kc(t){return Me().transition(t)}.prototype={constructor:Bt,select:function Ec(t){var n=this._name,o=this._id;"function"!=typeof t&&(t=ji(t));for(var e=this._groups,r=e.length,s=new Array(r),a=0;a<r;++a)for(var u,h,l=e[a],c=l.length,d=s[a]=new Array(c),f=0;f<c;++f)(u=l[f])&&(h=t.call(u,u.__data__,f,l))&&("__data__"in u&&(h.__data__=u.__data__),d[f]=h,ei(d[f],n,o,f,d,Dt(u,o)));return new Bt(s,this._parents,n,o)},selectAll:function Pc(t){var n=this._name,o=this._id;"function"!=typeof t&&(t=Mn(t));for(var e=this._groups,r=e.length,s=[],a=[],l=0;l<r;++l)for(var u,c=e[l],d=c.length,h=0;h<d;++h)if(u=c[h]){for(var m,f=t.call(u,u.__data__,h,c),T=Dt(u,o),b=0,_=f.length;b<_;++b)(m=f[b])&&ei(m,n,o,b,f,T);s.push(f),a.push(u)}return new Bt(s,a,n,o)},selectChild:Lt.selectChild,selectChildren:Lt.selectChildren,filter:function Tc(t){"function"!=typeof t&&(t=In(t));for(var n=this._groups,o=n.length,e=new Array(o),r=0;r<o;++r)for(var c,s=n[r],a=s.length,l=e[r]=[],d=0;d<a;++d)(c=s[d])&&t.call(c,c.__data__,d,s)&&l.push(c);return new Bt(e,this._parents,this._name,this._id)},merge:function kc(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,o=t._groups,e=n.length,s=Math.min(e,o.length),a=new Array(e),l=0;l<s;++l)for(var f,c=n[l],d=o[l],u=c.length,h=a[l]=new Array(u),m=0;m<u;++m)(f=c[m]||d[m])&&(h[m]=f);for(;l<e;++l)a[l]=n[l];return new Bt(a,this._parents,this._name,this._id)},selection:function Sc(){return new Oc(this._groups,this._parents)},transition:function Hc(){for(var t=this._name,n=this._id,o=gr(),e=this._groups,r=e.length,s=0;s<r;++s)for(var c,a=e[s],l=a.length,d=0;d<l;++d)if(c=a[d]){var u=Dt(c,n);ei(c,t,o,d,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Bt(e,this._parents,t,o)},call:Lt.call,nodes:Lt.nodes,node:Lt.node,size:Lt.size,empty:Lt.empty,each:Lt.each,on:function wc(t,n){var o=this._id;return arguments.length<2?Dt(this.node(),o).on.on(t):this.each(function xc(t,n,o){var e,r,s=function Cc(t){return(t+"").trim().split(/^|\s+/).every(function(n){var o=n.indexOf(".");return o>=0&&(n=n.slice(0,o)),!n||"start"===n})}(n)?Fi:Ut;return function(){var a=s(this,t),l=a.on;l!==e&&(r=(e=l).copy()).on(n,o),a.on=r}}(o,t,n))},attr:function oc(t,n){var o=$e(t),e="transform"===o?Sl:fr;return this.attrTween(t,"function"==typeof n?(o.local?rc:nc)(o,e,Li(this,"attr."+t,n)):null==n?(o.local?tc:ql)(o):(o.local?ic:ec)(o,e,n))},attrTween:function dc(t,n){var o="attr."+t;
1if(arguments.length<2)return(o=this.tween(o))&&o._value;if(null==n)return this.tween(o,null);if("function"!=typeof n)throw new Error;var e=$e(t);return this.tween(o,(e.local?lc:cc)(e,n))},style:function Vc(t,n,o){var e="transform"==(t+="")?Ol:fr;return null==n?this.styleTween(t,function Ac(t,n){var o,e,r;return function(){var s=he(this,t),a=(this.style.removeProperty(t),he(this,t));return s===a?null:s===o&&a===e?r:r=n(o=s,e=a)}}(t,e)).on("end.style."+t,pr(t)):"function"==typeof n?this.styleTween(t,function Dc(t,n,o){var e,r,s;return function(){var a=he(this,t),l=o(this),c=l+"";return null==l&&(this.style.removeProperty(t),c=l=he(this,t)),a===c?null:a===e&&c===r?s:(r=c,s=n(e=a,l))}}(t,e,Li(this,"style."+t,n))).each(function Rc(t,n){var o,e,r,l,s="style."+n,a="end."+s;return function(){var c=Ut(this,t),d=c.on,u=null==c.value[s]?l||(l=pr(n)):void 0;(d!==o||r!==u)&&(e=(o=d).copy()).on(a,r=u),c.on=e}}(this._id,t)):this.styleTween(t,function jc(t,n,o){var e,s,r=o+"";return function(){var a=he(this,t);return a===r?null:a===e?s:s=n(e=a,o)}}(t,e,n),o).on("end.style."+t,null)},styleTween:function Gc(t,n,o){var e="style."+(t+="");if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;return this.tween(e,function Uc(t,n,o){var e,r;function s(){var a=n.apply(this,arguments);return a!==r&&(e=(r=a)&&function Nc(t,n,o){return function(e){this.style.setProperty(t,n.call(this,e),o)}}(t,a,o)),e}return s._value=n,s}(t,n,o??""))},text:function Lc(t){return this.tween("text","function"==typeof t?function Bc(t){return function(){var n=t(this);this.textContent=n??""}}(Li(this,"text",t)):function Fc(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function Xc(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;return this.tween(n,function Yc(t){var n,o;function e(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&function zc(t){return function(n){this.textContent=t.call(this,n)}}(r)),n}return e._value=t,e}(t))},remove:function Ic(){return this.on("end.remove",function Mc(t){return function(){var n=this.parentNode;for(var o in this.__transition)if(+o!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function Dl(t,n){var o=this._id;if(t+="",arguments.length<2){for(var a,e=Dt(this.node(),o).tween,r=0,s=e.length;r<s;++r)if((a=e[r]).name===t)return a.value;return null}return this.each((null==n?Al:jl)(o,t,n))},delay:function mc(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?uc:hc)(n,t)):Dt(this.node(),n).delay},duration:function gc(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?fc:pc)(n,t)):Dt(this.node(),n).duration},ease:function _c(t){var n=this._id;return arguments.length?this.each(function vc(t,n){if("function"!=typeof n)throw new Error;return function(){Ut(this,t).ease=n}}(n,t)):Dt(this.node(),n).ease},easeVarying:function yc(t){if("function"!=typeof t)throw new Error;return this.each(function bc(t,n){return function(){var o=n.apply(this,arguments);if("function"!=typeof o)throw new Error;Ut(this,t).ease=o}}(this._id,t))},end:function $c(){var t,n,o=this,e=o._id,r=o.size();return new Promise(function(s,a){var l={value:a},c={value:function(){0==--r&&s()}};o.each(function(){var d=Ut(this,e),u=d.on;u!==t&&((n=(t=u).copy())._.cancel.push(l),n._.interrupt.push(l),n._.end.push(c)),d.on=n}),0===r&&s()})},[Symbol.iterator]:Lt[Symbol.iterator]};var Jc={time:null,delay:0,duration:250,ease:function Zc(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Qc(t,n){for(var o;!(o=t.__transition)||!(o=o[n]);)if(!(t=t.parentNode))throw new Error(`transition ${n} not found`);return o}Me.prototype.interrupt=function Il(t){return this.each(function(){!function Ml(t,n){var e,r,a,o=t.__transition,s=!0;if(o){for(a in n=null==n?null:n+"",o)(e=o[a]).name===n?(r=e.state>2&&e.state<5,e.state=6,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete o[a]):s=!1;s&&delete t.__transition}}(this,t)})},Me.prototype.transition=function qc(t){var n,o;t instanceof Bt?(n=t._id,t=t._name):(n=gr(),(o=Jc).time=Vi(),t=null==t?null:t+"");for(var e=this._groups,r=e.length,s=0;s<r;++s)for(var c,a=e[s],l=a.length,d=0;d<l;++d)(c=a[d])&&ei(c,t,n,d,a,o||Qc(c,n));return new Bt(e,this._parents,t,n)};Math;function De(t){return{type:t}}["w","e"].map(De),["n","s"].map(De),["n","w","e","s","nw","ne","sw","se"].map(De);const ad=Math.sqrt(50),ld=Math.sqrt(10),cd=Math.sqrt(2);function ui(t,n,o){const e=(n-t)/Math.max(0,o),r=Math.floor(Math.log10(e)),s=e/Math.pow(10,r),a=s>=ad?10:s>=ld?5:s>=cd?2:1;let l,c,d;return r<0?(d=Math.pow(10,-r)/a,l=Math.round(t*d),c=Math.round(n*d),l/d<t&&++l,c/d>n&&--c,d=-d):(d=Math.pow(10,r)*a,l=Math.round(t/d),c=Math.round(n/d),l*d<t&&++l,c*d>n&&--c),c<l&&.5<=o&&o<2?ui(t,n,2*o):[l,c,d]}function Qi(t,n,o){return ui(t=+t,n=+n,o=+o)[2]}function hi(t,n){return null==t||null==n?NaN:t<n?-1:t>n?1:t>=n?0:NaN}function hd(t,n){return null==t||null==n?NaN:n<t?-1:n>t?1:n>=t?0:NaN}function kr(t){let n,o,e;function r(l,c,d=0,u=l.length){if(d<u){if(0!==n(c,c))return u;do{const h=d+u>>>1;o(l[h],c)<0?d=h+1:u=h}while(d<u)}return d}return 2!==t.length?(n=hi,o=(l,c)=>hi(t(l),c),e=(l,c)=>t(l)-c):(n=t===hi||t===hd?t:md,o=t,e=t),{left:r,center:function a(l,c,d=0,u=l.length){const h=r(l,c,d,u-1);return h>d&&e(l[h-1],c)>-e(l[h],c)?h-1:h},right:function s(l,c,d=0,u=l.length){if(d<u){if(0!==n(c,c))return u;do{const h=d+u>>>1;o(l[h],c)<=0?d=h+1:u=h}while(d<u)}return d}}}function md(){return 0}const pd=kr(hi).right,gd=(kr(function fd(t){return null===t?NaN:+t}),pd);function xr(t,n){var a,o=n?n.length:0,e=t?Math.min(o,t.length):0,r=new Array(e),s=new Array(o);for(a=0;a<e;++a)r[a]=qi(t[a],n[a]);for(;a<o;++a)s[a]=n[a];return function(l){for(a=0;a<e;++a)s[a]=r[a](l);return s}}function vd(t,n){var o=new Date;return t=+t,n=+n,function(e){return o.setTime(t*(1-e)+n*e),o}}function _d(t,n){var r,o={},e={};for(r in(null===t||"object"!=typeof t)&&(t={}),(null===n||"object"!=typeof n)&&(n={}),n)r in t?o[r]=qi(t[r],n[r]):e[r]=n[r];return function(s){for(r in o)e[r]=o[r](s);return e}}function bd(t,n){n||(n=[]);var r,o=t?Math.min(n.length,t.length):0,e=n.slice();return function(s){for(r=0;r<o;++r)e[r]=t[r]*(1-s)+n[r]*s;return e}}
1function qi(t,n){var e,o=typeof n;return null==n||"boolean"===o?Xi(n):("number"===o?Rt:"string"===o?(e=ee(n))?(n=e,li):mr:n instanceof ee?li:n instanceof Date?vd:function yd(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}(n)?bd:Array.isArray(n)?xr:"function"!=typeof n.valueOf&&"function"!=typeof n.toString||isNaN(n)?_d:Rt)(t,n)}function Td(t,n){return t=+t,n=+n,function(o){return Math.round(t*(1-o)+n*o)}}function Cd(t){return+t}var wr=[0,1];function ve(t){return t}function tn(t,n){return(n-=t=+t)?function(o){return(o-t)/n}:function kd(t){return function(){return t}}(isNaN(n)?NaN:.5)}function wd(t,n,o){var e=t[0],r=t[1],s=n[0],a=n[1];return r<e?(e=tn(r,e),s=o(a,s)):(e=tn(e,r),s=o(s,a)),function(l){return s(e(l))}}function Md(t,n,o){var e=Math.min(t.length,n.length)-1,r=new Array(e),s=new Array(e),a=-1;for(t[e]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());++a<e;)r[a]=tn(t[a],t[a+1]),s[a]=o(n[a],n[a+1]);return function(l){var c=gd(t,l,1,e)-1;return s[c](r[c](l))}}function Od(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t)}return this}var pi,Sd=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function mi(t){if(!(n=Sd.exec(t)))throw new Error("invalid format: "+t);var n;return new en({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}function en(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function fi(t,n){if(!isFinite(t)||0===t)return null;var o=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"),e=t.slice(0,o);return[e.length>1?e[0]+e.slice(2):e,+t.slice(o+1)]}function _e(t){return(t=fi(Math.abs(t)))?t[1]:NaN}function Mr(t,n){var o=fi(t,n);if(!o)return t+"";var e=o[0],r=o[1];return r<0?"0."+new Array(-r).join("0")+e:e.length>r+1?e.slice(0,r+1)+"."+e.slice(r+1):e+new Array(r-e.length+2).join("0")}mi.prototype=en.prototype,en.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const Ir={"%":(t,n)=>(100*t).toFixed(n),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function Ad(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,n)=>t.toExponential(n),f:(t,n)=>t.toFixed(n),g:(t,n)=>t.toPrecision(n),o:t=>Math.round(t).toString(8),p:(t,n)=>Mr(100*t,n),r:Mr,s:function Nd(t,n){var o=fi(t,n);if(!o)return pi=void 0,t.toPrecision(n);var e=o[0],r=o[1],s=r-(pi=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,a=e.length;return s===a?e:s>a?e+new Array(s-a+1).join("0"):s>0?e.slice(0,s)+"."+e.slice(s):"0."+new Array(1-s).join("0")+fi(t,Math.max(0,n+s-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Er(t){return t}var gi,Sr,Ar,Pr=Array.prototype.map,Or=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function zd(t){var n=t.domain;return t.ticks=function(o){var e=n();return function dd(t,n,o){if(!((o=+o)>0))return[];if((t=+t)==(n=+n))return[t];const e=n<t,[r,s,a]=e?ui(n,t,o):ui(t,n,o);if(!(s>=r))return[];const l=s-r+1,c=new Array(l);if(e)if(a<0)for(let d=0;d<l;++d)c[d]=(s-d)/-a;else for(let d=0;d<l;++d)c[d]=(s-d)*a;else if(a<0)for(let d=0;d<l;++d)c[d]=(r+d)/-a;else for(let d=0;d<l;++d)c[d]=(r+d)*a;return c}(e[0],e[e.length-1],o??10)},t.tickFormat=function(o,e){var r=n();return function Ld(t,n,o,e){var s,r=function ud(t,n,o){o=+o;const e=(n=+n)<(t=+t),r=e?Qi(n,t,o):Qi(t,n,o);return(e?-1:1)*(r<0?1/-r:r)}(t,n,o);switch((e=mi(e??",f")).type){case"s":var a=Math.max(Math.abs(t),Math.abs(n));return null==e.precision&&!isNaN(s=function jd(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(_e(n)/3)))-_e(Math.abs(t)))}(r,a))&&(e.precision=s),Ar(e,a);case"":case"e":case"g":case"p":case"r":null==e.precision&&!isNaN(s=function Fd(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,_e(n)-_e(t))+1}
1(r,Math.max(Math.abs(t),Math.abs(n))))&&(e.precision=s-("e"===e.type));break;case"f":case"%":null==e.precision&&!isNaN(s=function Bd(t){return Math.max(0,-_e(Math.abs(t)))}(r))&&(e.precision=s-2*("%"===e.type))}return Sr(e)}(r[0],r[r.length-1],o??10,e)},t.nice=function(o){null==o&&(o=10);var c,d,e=n(),r=0,s=e.length-1,a=e[r],l=e[s],u=10;for(l<a&&(d=a,a=l,l=d,d=r,r=s,s=d);u-- >0;){if((d=Qi(a,l,o))===c)return e[r]=a,e[s]=l,n(e);if(d>0)a=Math.floor(a/d)*d,l=Math.ceil(l/d)*d;else{if(!(d<0))break;a=Math.ceil(a*d)/d,l=Math.floor(l*d)/d}c=d}return t},t}function jr(){var t=function Pd(){return function Ed(){var e,r,s,l,c,d,t=wr,n=wr,o=qi,a=ve;function u(){var f=Math.min(t.length,n.length);return a!==ve&&(a=function xd(t,n){var o;return t>n&&(o=t,t=n,n=o),function(e){return Math.max(t,Math.min(n,e))}}(t[0],t[f-1])),l=f>2?Md:wd,c=d=null,h}function h(f){return null==f||isNaN(f=+f)?s:(c||(c=l(t.map(e),n,o)))(e(a(f)))}return h.invert=function(f){return a(r((d||(d=l(n,t.map(e),Rt)))(f)))},h.domain=function(f){return arguments.length?(t=Array.from(f,Cd),u()):t.slice()},h.range=function(f){return arguments.length?(n=Array.from(f),u()):n.slice()},h.rangeRound=function(f){return n=Array.from(f),o=Td,u()},h.clamp=function(f){return arguments.length?(a=!!f||ve,u()):a!==ve},h.interpolate=function(f){return arguments.length?(o=f,u()):o},h.unknown=function(f){return arguments.length?(s=f,h):s},function(f,m){return e=f,r=m,u()}}()(ve,ve)}();return t.copy=function(){return function Id(t,n){return n.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}(t,jr())},Od.apply(t,arguments),zd(t)}!function Gd(t){gi=function Ud(t){var n=void 0===t.grouping||void 0===t.thousands?Er:function Dd(t,n){return function(o,e){for(var r=o.length,s=[],a=0,l=t[0],c=0;r>0&&l>0&&(c+l+1>e&&(l=Math.max(1,e-c)),s.push(o.substring(r-=l,r+l)),!((c+=l+1)>e));)l=t[a=(a+1)%t.length];return s.reverse().join(n)}}(Pr.call(t.grouping,Number),t.thousands+""),o=void 0===t.currency?"":t.currency[0]+"",e=void 0===t.currency?"":t.currency[1]+"",r=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?Er:function Rd(t){return function(n){return n.replace(/[0-9]/g,function(o){return t[+o]})}}(Pr.call(t.numerals,String)),a=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"\u2212":t.minus+"",c=void 0===t.nan?"NaN":t.nan+"";function d(h,f){var m=(h=mi(h)).fill,T=h.align,b=h.sign,_=h.symbol,v=h.zero,C=h.width,y=h.comma,w=h.precision,x=h.trim,E=h.type;"n"===E?(y=!0,E="g"):Ir[E]||(void 0===w&&(w=12),x=!0,E="g"),(v||"0"===m&&"="===T)&&(v=!0,m="0",T="=");var N=(f&&void 0!==f.prefix?f.prefix:"")+("$"===_?o:"#"===_&&/[boxX]/.test(E)?"0"+E.toLowerCase():""),A=("$"===_?e:/[%p]/.test(E)?a:"")+(f&&void 0!==f.suffix?f.suffix:""),I=Ir[E],P=/[defgprs%]/.test(E);function z(V){var O,k,S,W=N,g=A;if("c"===E)g=I(V)+g,V="";else{var U=(V=+V)<0||1/V<0;if(V=isNaN(V)?c:I(Math.abs(V),w),x&&(V=function Vd(t){t:for(var r,n=t.length,o=1,e=-1;o<n;++o)switch(t[o]){case".":e=r=o;break;case"0":0===e&&(e=o),r=o;break;default:if(!+t[o])break t;e>0&&(e=0)}return e>0?t.slice(0,e)+t.slice(r+1):t}(V)),U&&0==+V&&"+"!==b&&(U=!1),W=(U?"("===b?b:l:"-"===b||"("===b?"":b)+W,g=("s"!==E||isNaN(V)||void 0===pi?"":Or[8+pi/3])+g+(U&&"("===b?")":""),P)for(O=-1,k=V.length;++O<k;)if(48>(S=V.charCodeAt(O))||S>57){g=(46===S?r+V.slice(O+1):V.slice(O))+g,V=V.slice(0,O);break}}y&&!v&&(V=n(V,1/0));var R=W.length+V.length+g.length,D=R<C?new Array(C-R+1).join(m):"";switch(y&&v&&(V=n(D+V,D.length?C-g.length:1/0),D=""),T){case"<":V=W+V+g+D;break;case"=":V=W+D+V+g;break;case"^":V=D.slice(0,R=D.length>>1)+W+V+g+D.slice(R);break;default:V=D+W+V+g}return s(V)}return w=void 0===w?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w)),z.toString=function(){return h+""},z}return{format:d,formatPrefix:function u(h,f){var m=3*Math.max(-8,Math.min(8,Math.floor(_e(f)/3))),T=Math.pow(10,-m),b=d(((h=mi(h)).type="f",h),{suffix:Or[8+m/3]});return function(_){return b(T*_)}}}}(t),Sr=gi.format,Ar=gi.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const nn=new Date,rn=new Date;function Ft(t,n,o,e){function r(s){return t(s=0===arguments.length?new Date:new Date(+s)),s}return r.floor=s=>(t(s=new Date(+s)),s),r.ceil=s=>(t(s=new Date(s-1)),n(s,1),t(s),s),r.round=s=>{const a=r(s),l=r.ceil(s);return s-a<l-s?a:l},r.offset=(s,a)=>(n(s=new Date(+s),null==a?1:Math.floor(a)),s),r.range=(s,a,l)=>{const c=[];if(s=r.ceil(s),l=null==l?1:Math.floor(l),!(s<a&&l>0))return c;let d;do{c.push(d=new Date(+s)),n(s,l),t(s)}while(d<s&&s<a);return c},r.filter=s=>Ft(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,l)=>{if(a>=a)if(l<0)for(;++l<=0;)for(;n(a,-1),!s(a););else for(;--l>=0;)for(;n(a,1),!s(a););}),o&&(r.count=(s,a)=>(nn.setTime(+s),rn.setTime(+a),t(nn),t(rn),Math.floor(o(nn,rn))),r.every=s=>(s=Math.floor(s),isFinite(s)&&s>0?s>1?r.filter(e?a=>e(a)%s==0:a=>r.count(0,a)%s==0):r:null)),r}const re=864e5,Dr=7*re;function oe(t){return Ft(n=>{n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)},(n,o)=>{n.setDate(n.getDate()+7*o)},(n,o)=>(o-n-6e4*(o.getTimezoneOffset()-n.getTimezoneOffset()))/Dr)}const Rr=oe(0),vi=oe(1),be=(oe(2),oe(3),oe(4));function se(t){return Ft(n=>{n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)},(n,o)=>{n.setUTCDate(n.getUTCDate()+7*o)},(n,o)=>(o-n)/Dr)}oe(5),oe(6);const Vr=se(0),_i=se(1),ye=(se(2),se(3),se(4)),sn=(se(5),se(6),Ft(t=>t.setHours(0,0,0,0),(t,n)=>t.setDate(t.getDate()+n),(t,n)=>(n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/re,t=>t.getDate()-1)),an=Ft(t=>{t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n)},(t,n)=>(n-t)/re,t=>t.getUTCDate()-1),ae=(Ft(t=>{t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n)},(t,n)=>(n-t)/re,t=>Math.floor(t/re)),Ft(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n)},(t,n)=>n.getFullYear()-t.getFullYear(),t=>t.getFullYear()));ae.every=t=>isFinite(t=Math.floor(t))&&t>0?Ft(n=>{n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)},(n,o)=>{n.setFullYear(n.getFullYear()+o*t)}):null;const le=Ft(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n)},(t,n)=>n.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());function ln(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function cn(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Re(t,n,o){return{y:t,m:n,d:o,H:0,M:0,S:0,L:0}}le.every=t=>isFinite(t=Math.floor(t))&&t>0?Ft(n=>{n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},(n,o)=>{n.setUTCFullYear(n.getUTCFullYear()+o*t)}):null;var Te,Jr,Nr={"-":"",_:" ",0:"0"},pt=/^\s*\d+/,tu=/^%/,eu=/[\\^$*+?|[\]().{}]/g;function Q(t,n,o){var e=t<0?"-":"",r=(e?-t:t)+"",s=r.length;return e+(s<o?new Array(o-s+1).join(n)+r:r)}function iu(t){return t.replace(eu,"\\$&")}function Ve(t){return new RegExp("^(?:"+t.map(iu).join("|")+")","i")}function Ne(t){return new Map(t.map((n,o)=>[n.toLowerCase(),o]))}function nu(t,n,o){var e=pt.exec(n.slice(o,o+1));return e?(t.w=+e[0],o+e[0].length):-1}function ru(t,n,o){var e=pt.exec(n.slice(o,o+1));return e?(t.u=+e[0],o+e[0].length):-1}function ou(t,n,o){var e=pt.exec(n.slice(o,o+2));return e?(t.U=+e[0],o+e[0].length):-1}function su(t,n,o){var e=pt.exec(n.slice(o,o+2));return e?(t.V=+e[0],o+e[0].length):-1}function au(t,n,o){var e=pt.exec(n.slice(o,o+2));return e?(t.W=+e[0],o+e[0].length):-1}function Ur(t,n,o){var e=pt.exec(n.slice(o,o+4));return e?(t.y=+e[0],o+e[0].length):-1}function Gr(t,n,o){var e=pt.exec(n.slice(o,o+2));return e?(t.y=+e[0]+(+e[0]>68?1900:2e3),o+e[0].length):-1}function lu(t,n,o){var e=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(o,o+6));return e?(t.Z=e[1]?0:-(e[2]+(e[3]||"00")),o+e[0].length):-1}function cu(t,n,o){var e=pt.exec(n.slice(o,o+1));return e?(t.q=3*e[0]-3,o+e[0].length):-1}function du(t,n,o){var e=pt.exec(n.slice(o,o+2));return e?(t.m=e[0]-1,o+e[0].length):-1}function Fr(t,n,o){var e=pt.exec(n.slice(o,o+2));return e?(t.d=+e[0],o+e[0].length):-1}function uu(t,n,o){var e=pt.exec(n.slice(o,o+3));return e?(t.m=0,t.d=+e[0],o+e[0].length):-1}function Br(t,n,o){var e=pt.exec(n.slice(o,o+2));return e?(t.H=+e[0],o+e[0].length):-1}function hu(t,n,o){var e=pt.exec(n.slice(o,o+2));return e?(t.M=+e[0],o+e[0].length):-1}function mu(t,n,o){var e=pt.exec(n.slice(o,o+2));return e?(t.S=+e[0],o+e[0].length):-1}function fu(t,n,o){var e=pt.exec(n.slice(o,o+3));return e?(t.L=+e[0],o+e[0].length):-1}function pu(t,n,o){var e=pt.exec(n.slice(o,o+6));return e?(t.L=Math.floor(e[0]/1e3),o+e[0].length):-1}function gu(t,n,o){var e=tu.exec(n.slice(o,o+1));return e?o+e[0].length:-1}function vu(t,n,o){var e=pt.exec(n.slice(o));return e?(t.Q=+e[0],o+e[0].length):-1}function _u(t,n,o){var e=pt.exec(n.slice(o));return e?(t.s=+e[0],o+e[0].length):-1}function Lr(t,n){return Q(t.getDate(),n,2)}function bu(t,n){return Q(t.getHours(),n,2)}function yu(t,n){return Q(t.getHours()%12||12,n,2)}function Tu(t,n){return Q(1+sn.count(ae(t),t),n,3)}function zr(t,n){return Q(t.getMilliseconds(),n,3)}function ku(t,n){return zr(t,n)+"000"}function Cu(t,n){return Q(t.getMonth()+1,n,2)}function xu(t,n){return Q(t.getMinutes(),n,2)}function wu(t,n){return Q(t.getSeconds(),n,2)}function Mu(t){var n=t.getDay();return 0===n?7:n}function Iu(t,n){return Q(Rr.count(ae(t)-1,t),n,2)}function Yr(t){var n=t.getDay();return n>=4||0===n?be(t):be.ceil(t)}function Eu(t,n){return t=Yr(t),Q(be.count(ae(t),t)+(4===ae(t).getDay()),n,2)}function Pu(t){return t.getDay()}function Ou(t,n){return Q(vi.count(ae(t)-1,t),n,2)}function Su(t,n){return Q(t.getFullYear()%100,n,2)}function Au(t,n){return Q((t=Yr(t)).getFullYear()%100,n,2)}function ju(t,n){return Q(t.getFullYear()%1e4,n,4)}function Du(t,n){var o=t.getDay();return Q((t=o>=4||0===o?be(t):be.ceil(t)).getFullYear()%1e4,n,4)}function Ru(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+Q(n/60|0,"0",2)+Q(n%60,"0",2)}function Xr(t,n){return Q(t.getUTCDate(),n,2)}function Vu(t,n){return Q(t.getUTCHours(),n,2)}function Nu(t,n){return Q(t.getUTCHours()%12||12,n,2)}function Uu(t,n){return Q(1+an.count(le(t),t),n,3)}function Hr(t,n){return Q(t.getUTCMilliseconds(),n,3)}function Gu(t,n){return Hr(t,n)+"000"}function Fu(t,n){return Q(t.getUTCMonth()+1,n,2)}function Bu(t,n){return Q(t.getUTCMinutes(),n,2)}function Lu(t,n){return Q(t.getUTCSeconds(),n,2)}function zu(t){var n=t.getUTCDay();return 0===n?7:n}function Yu(t,n){return Q(Vr.count(le(t)-1,t),n,2)}function $r(t){var n=t.getUTCDay();return n>=4||0===n?ye(t):ye.ceil(t)}function Xu(t,n){return t=$r(t),Q(ye.count(le(t),t)+(4===le(t).getUTCDay()),n,2)}function Hu(t){return t.getUTCDay()}function $u(t,n){return Q(_i.count(le(t)-1,t),n,2)}function Wu(t,n){return Q(t.getUTCFullYear()%100,n,2)}function Ku(t,n){return Q((t=$r(t)).getUTCFullYear()%100,n,2)}function Zu(t,n){return Q(t.getUTCFullYear()%1e4,n,4)}function Ju(t,n){var o=t.getUTCDay();return Q((t=o>=4||0===o?ye(t):ye.ceil(t)).getUTCFullYear()%1e4,n,4)}function Qu(){return"+0000"}function Wr(){return"%"}function Kr(t){return+t}function Zr(t){return Math.floor(+t/1e3)}function ke(t,n,o){this.k=t,this.x=n,this.y=o}!function ih(t){Te=function qd(t){var n=t.dateTime,o=t.date,e=t.time,r=t.periods,s=t.days,a=t.shortDays,l=t.months,c=t.shortMonths,d=Ve(r),u=Ne(r),h=Ve(s),f=Ne(s),m=Ve(a),T=Ne(a),b=Ve(l),_=Ne(l),v=Ve(c),C=Ne(c),y={a:function S(j){return a[j.getDay()]},A:function U(j){return s[j.getDay()]},b:function R(j){return c[j.getMonth()]},B:function D(j){return l[j.getMonth()]},c:null,d:Lr,e:Lr,f:ku,g:Au,G:Du,H:bu,I:yu,j:Tu,L:zr,m:Cu,M:xu,p:function B(j){return r[+(j.getHours()>=12)]},q:function H(j){return 1+~~(j.getMonth()/3)},Q:Kr,s:Zr,S:wu,u:Mu,U:Iu,V:Eu,w:Pu,W:Ou,x:null,X:null,y:Su,Y:ju,Z:Ru,"%":Wr},w={a:function Tt(j){return a[j.getUTCDay()]},A:function lt(j){return s[j.getUTCDay()]},b:function gt(j){return c[j.getUTCMonth()]},B:function kt(j){return l[j.getUTCMonth()]},c:null,d:Xr,e:Xr,f:Gu,g:Ku,G:Ju,H:Vu,I:Nu,j:Uu,L:Hr,m:Fu,M:Bu,p:function it(j){return r[+(j.getUTCHours()>=12)]},q:function vt(j){return 1+~~(j.getUTCMonth()/3)},Q:Kr,s:Zr,S:Lu,u:zu,U:Yu,V:Xu,w:Hu,W:$u,x:null,X:null,y:Wu,Y:Zu,Z:Qu,"%":Wr},x={a:function P(j,$,K){var M=m.exec($.slice(K));return M?(j.w=T.get(M[0].toLowerCase()),K+M[0].length):-1},A:function z(j,$,K){var M=h.exec($.slice(K));
1return M?(j.w=f.get(M[0].toLowerCase()),K+M[0].length):-1},b:function V(j,$,K){var M=v.exec($.slice(K));return M?(j.m=C.get(M[0].toLowerCase()),K+M[0].length):-1},B:function W(j,$,K){var M=b.exec($.slice(K));return M?(j.m=_.get(M[0].toLowerCase()),K+M[0].length):-1},c:function g(j,$,K){return A(j,n,$,K)},d:Fr,e:Fr,f:pu,g:Gr,G:Ur,H:Br,I:Br,j:uu,L:fu,m:du,M:hu,p:function I(j,$,K){var M=d.exec($.slice(K));return M?(j.p=u.get(M[0].toLowerCase()),K+M[0].length):-1},q:cu,Q:vu,s:_u,S:mu,u:ru,U:ou,V:su,w:nu,W:au,x:function O(j,$,K){return A(j,o,$,K)},X:function k(j,$,K){return A(j,e,$,K)},y:Gr,Y:Ur,Z:lu,"%":gu};function E(j,$){return function(K){var wt,F,ut,M=[],dt=-1,tt=0,xt=j.length;for(K instanceof Date||(K=new Date(+K));++dt<xt;)37===j.charCodeAt(dt)&&(M.push(j.slice(tt,dt)),null!=(F=Nr[wt=j.charAt(++dt)])?wt=j.charAt(++dt):F="e"===wt?" ":"0",(ut=$[wt])&&(wt=ut(K,F)),M.push(wt),tt=dt+1);return M.push(j.slice(tt,dt)),M.join("")}}function N(j,$){return function(K){var tt,xt,M=Re(1900,void 0,1);if(A(M,j,K+="",0)!=K.length)return null;if("Q"in M)return new Date(M.Q);if("s"in M)return new Date(1e3*M.s+("L"in M?M.L:0));if($&&!("Z"in M)&&(M.Z=0),"p"in M&&(M.H=M.H%12+12*M.p),void 0===M.m&&(M.m="q"in M?M.q:0),"V"in M){if(M.V<1||M.V>53)return null;"w"in M||(M.w=1),"Z"in M?(xt=(tt=cn(Re(M.y,0,1))).getUTCDay(),tt=xt>4||0===xt?_i.ceil(tt):_i(tt),tt=an.offset(tt,7*(M.V-1)),M.y=tt.getUTCFullYear(),M.m=tt.getUTCMonth(),M.d=tt.getUTCDate()+(M.w+6)%7):(xt=(tt=ln(Re(M.y,0,1))).getDay(),tt=xt>4||0===xt?vi.ceil(tt):vi(tt),tt=sn.offset(tt,7*(M.V-1)),M.y=tt.getFullYear(),M.m=tt.getMonth(),M.d=tt.getDate()+(M.w+6)%7)}else("W"in M||"U"in M)&&("w"in M||(M.w="u"in M?M.u%7:"W"in M?1:0),xt="Z"in M?cn(Re(M.y,0,1)).getUTCDay():ln(Re(M.y,0,1)).getDay(),M.m=0,M.d="W"in M?(M.w+6)%7+7*M.W-(xt+5)%7:M.w+7*M.U-(xt+6)%7);return"Z"in M?(M.H+=M.Z/100|0,M.M+=M.Z%100,cn(M)):ln(M)}}function A(j,$,K,M){for(var wt,F,dt=0,tt=$.length,xt=K.length;dt<tt;){if(M>=xt)return-1;if(37===(wt=$.charCodeAt(dt++))){if(wt=$.charAt(dt++),!(F=x[wt in Nr?$.charAt(dt++):wt])||(M=F(j,K,M))<0)return-1}else if(wt!=K.charCodeAt(M++))return-1}return M}return y.x=E(o,y),y.X=E(e,y),y.c=E(n,y),w.x=E(o,w),w.X=E(e,w),w.c=E(n,w),{format:function(j){var $=E(j+="",y);return $.toString=function(){return j},$},parse:function(j){var $=N(j+="",!1);return $.toString=function(){return j},$},utcFormat:function(j){var $=E(j+="",w);return $.toString=function(){return j},$},utcParse:function(j){var $=N(j+="",!0);return $.toString=function(){return j},$}}}(t),Jr=Te.format}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),ke.prototype={constructor:ke,scale:function(t){return 1===t?this:new ke(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new ke(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Qr=new ke(1,0,0),ch=p(55349),Ct=p(33726);const dh=["hh"],uh=["mm"],hh=["ss"],mh=["tt"],fh=t=>({"edit-active":t});function ph(t,n){if(1&t&&(i.j41(0,"div",15),i.EFF(1),i.k0s()),2&t){const o=i.XpG();i.R7$(),i.JRh(o.hhVal)}}function gh(t,n){1&t&&(i.j41(0,"span",11),i.EFF(1,":"),i.k0s())}function vh(t,n){if(1&t&&(i.j41(0,"div",16),i.EFF(1),i.k0s()),2&t){const o=i.XpG();i.R7$(),i.JRh(o.mmVal)}}function _h(t,n){if(1&t&&(i.j41(0,"div",16),i.EFF(1),i.k0s()),2&t){const o=i.XpG();i.R7$(),i.JRh(o.ssVal)}}function bh(t,n){if(1&t&&(i.j41(0,"div",16),i.EFF(1),i.k0s()),2&t){const o=i.XpG();i.R7$(),i.JRh(o.ttVal)}}let to=(()=>{var t;class n{set currentTime(e){this._currentTime=e,this.transform()}constructor(e,r){this.ngZone=e,this.authSevice=r,this.isEdit=!1,this.isHover=!1,this.editLeft="unset",this.editTop="unset",this.hhVal="00",this.mmV
1al="00",this.ssVal="00",this.ttVal="00",this.seekMove=new i.bkB,this.theme="light",this.varient="d-timeline",this.showhh=!1,this.inputid=Date.now()}ngAfterViewInit(){this.setValue()}ngOnInit(){this.transform()}hoverAll(){this.isHover=!0}leaveAll(){this.isHover=!1}makeEdit(){this.setValue(),this.isEdit=!0}setValue(){this.hhInput&&(this.hhInput.nativeElement.value=this.hhVal),this.mmInput&&(this.mmInput.nativeElement.value=this.mmVal),this.ssInput&&(this.ssInput.nativeElement.value=this.ssVal),this.ttInput&&(this.ttInput.nativeElement.value=this.ttVal),this.totalTime>36e5&&(this.showhh=!0)}change(e,r){let s=e.target.value.replaceAll(/\D/g,"");if(("ss"===r||"mm"===r)&&Number(s)>59&&(s="59"),""===s)switch(r){case"hh":this.hhInput.nativeElement.value=s;break;case"mm":this.mmInput.nativeElement.value=s;break;case"ss":this.ssInput.nativeElement.value=s;break;case"tt":this.ttInput.nativeElement.value=s}if(2==s.length)switch(r){case"hh":this.mmInput.nativeElement.focus(),this.mmInput.nativeElement.select();break;case"mm":this.mmInput.nativeElement.value=s,this.ssInput.nativeElement.focus(),this.ssInput.nativeElement.select();break;case"ss":this.ssInput.nativeElement.value=s,this.ttInput.nativeElement.focus(),this.ttInput.nativeElement.select()}}validate(e){var r=e||window.event;if("paste"===r.type)s=event.clipboardData.getData("text/plain");else{var s=r.keyCode||r.which;s=String.fromCharCode(s)}/[0-9]|\./.test(s)||(r.returnValue=!1,r.preventDefault&&r.preventDefault())}keyDownCtrl(e,r){let s=0,a=[this.hhInput.nativeElement,this.mmInput.nativeElement,this.ssInput.nativeElement,this.ttInput.nativeElement];switch(r){case"hh":s=0;break;case"mm":s=1;break;case"ss":s=2;break;case"tt":s=3}switch(e.key){case"ArrowLeft":e.preventDefault(),a[s-1]?.focus(),a[s-1]?.select();break;case"ArrowRight":e.preventDefault(),a[s+1]?.focus(),a[s+1]?.select();break;case"Tab":if(0==s){e.shiftKey&&(e.preventDefault(),a[3]?.focus(),a[3]?.select());break}if(1==s&&!this.showhh){e.shiftKey&&(e.preventDefault(),a[3]?.focus(),a[3]?.select());break}3===s&&(e.shiftKey||(e.preventDefault(),this.showhh?(a[0]?.focus(),a[0]?.select()):(a[1]?.focus(),a[1]?.select())))}if("Backspace"===e.key&&0===e.currentTarget.value.length)switch(r){case"tt":this.ssInput.focus();break;case"seconds":this.mmInput.focus();break;case"minutes":this.hhInput?.focus()}"Enter"===e.key&&(a[s].blur(),this.setNewTime())}focus(e,r){switch(this.isEdit=!0,r){case"hh":this.hhInput.nativeElement.select();break;case"mm":this.mmInput.nativeElement.select();break;case"ss":this.ssInput.nativeElement.select();break;case"tt":this.ttInput.nativeElement.select()}}blur(e,r){(!e.relatedTarget||!e.relatedTarget||!e.relatedTarget.dataset||e.relatedTarget.dataset.inputid!=this.inputid)&&(this.isEdit=!1,this.setNewTime())}transform(){let s,e=this._currentTime;if(e||0===e){s=Math.floor(e/10)/100;const a=Math.floor(s/60),l=Math.floor(a/60);let u,h,c=(s-60*a).toFixed(2),d=(a-60*l).toString(),f=c.split(".");f.length>1?(u=f[0],this.ssVal=1==u.toString().length?"0"+u.toString():u,h=f[1],this.ttVal=1==h.toString().length?"0"+u.toString():h):(u=f[0],this.ssVal=1==u.toString().length?"0"+u.toString():u),this.mmV
1al=1==d.toString().length?"0"+d:d;let m=l.toString();return this.hhVal=1==m.toString().length?"0"+m:m,this.setValue(),l?m+":"+d+":"+u:a?d+":"+u:"00:"+u}return""}setNewTime(){if(0===this.totalTime)return void this.transform();let e,r,s,a;e=this.hhInput.nativeElement.value,r=this.mmInput.nativeElement.value,s=this.ssInput.nativeElement.value,a=this.ttInput.nativeElement.value;let l=0;Number.isNaN(parseInt(e))||(l+=60*parseInt(e)*60*1e3),Number.isNaN(parseInt(r))||(l+=60*parseInt(r)*1e3),Number.isNaN(parseInt(s))||(l+=1e3*parseInt(s)),Number.isNaN(parseInt(a))||(l+=10*parseInt(a)),"d-timeline"===this.varient?this.seekMove.emit(l>this.totalTime?this.totalTime+1:l):(0===l&&(l=10),this.seekMove.emit(l),setTimeout(()=>{this.transform()},200))}}return(t=n).\u0275fac=function(e){return new(e||t)(i.rXU(i.SKi),i.rXU(Pi.u))},t.\u0275cmp=i.VBU({type:t,selectors:[["duration-control"]],viewQuery:function(e,r){if(1&e&&(i.GBs(dh,5),i.GBs(uh,5),i.GBs(hh,5),i.GBs(mh,5)),2&e){let s;i.mGM(s=i.lsd())&&(r.hhInput=s.first),i.mGM(s=i.lsd())&&(r.mmInput=s.first),i.mGM(s=i.lsd())&&(r.ssInput=s.first),i.mGM(s=i.lsd())&&(r.ttInput=s.first)}},inputs:{currentTime:"currentTime",type:"type",totalTime:"totalTime",theme:"theme",varient:"varient"},outputs:{seekMove:"seekMove"},decls:19,vars:20,consts:[["hh",""],["mm",""],["ss",""],["tt",""],[1,"duration-parent","d-flex","align-items-center","justify-content-center",3,"mouseenter","mouseleave","ngClass"],["data-testid","current-time","role","textbox","aria-label","Player time input","aria-disabled","false",1,"duration-ctrl",2,"border","0px"],["class","sc-erUUZj eBOZcZ text-semi text-color",4,"ngIf"],["maxlength","2","placeholder","--","role","textbox","aria-label","hours","value","00","tabindex","0",1,"d-ctrl-input","text-semi","input-color",3,"input","keydown","focus","blur","keypress","hidden"],["class","sc-dGHkRN eckRYy span-color s-1",4,"ngIf"],["class","sc-erUUZj eBOZcZ text-semi div-color",4,"ngIf"],["maxlength","2","placeholder","--","role","textbox","aria-label","Minutes","value","00","tabindex","0",1,"d-ctrl-input","text-semi","input-color",3,"input","keydown","focus","blur","keypress","hidden"],[1,"sc-dGHkRN","eckRYy","span-color","s-1"],["maxlength","2","placeholder","--","role","textbox","aria-label","Seconds","value","00","tabindex","0",1,"d-ctrl-input","text-semi","input-color",3,"input","keydown","focus","blur","keypress","hidden"],[1,"sc-dGHkRN","eckRYy","span-color","s-2"],["maxlength","2","placeholder","--","role","textbox","aria-label","Milliseconds","value","00","tabindex","0",1,"d-ctrl-input","text-semi","input-color",3,"input","keydown","focus","blur","keypress","hidden"],[1,"sc-erUUZj","eBOZcZ","text-semi","text-color"],[1,"sc-erUUZj","eBOZcZ","text-semi","div-color"]],template:function(e,r){if(1&e){const s=i.RV6();i.j41(0,"div",4),i.bIt("mouseenter",function(){return i.eBV(s),i.Njj(r.hoverAll())})("mouseleave",function(){return i.eBV(s),i.Njj(r.leaveAll())}),i.j41(1,"div",5),i.DNE(2,ph,2,1,"div",6),i.j41(3,"input",7,0),i.bIt("input",function(l){return i.eBV(s),i.Njj(r.change(l,"hh"))})("keydown",function(l){return i.eBV(s),i.Njj(r.keyDownCtrl(l,"hh"))})("focus",function(l){return i.eBV(s),i.Njj(r.focus(l,"hh"))})("blur",function(l){return i.eBV(s),i.Njj(r.blur(l,"hh"))})("keypress",function(l){return i.eBV(s),i.Njj(r.validate(l))}),i.k0s(),i.DNE(5,gh,2,0,"span",8)(6,vh,2,1,"div",9),i.j41(7,"input",10,1),i.bIt("input",function(l){return i.eBV(s),i.Njj(r.change(l,"mm"))})("keydown",function(l){return i.eBV(s),i.Njj(r.keyDownCtrl(l,"mm"))})("focus",function(l){return i.eBV(s),i.Njj(r.focus(l,"mm"))})("blur",function(l){return i.eBV(s),i.Njj(r.blur(l,"mm"))})("keypress",function(l){return i.eBV(s),i.Njj(r.validate(l))}),i.k0s(),i.j41(9,"span",11),i.EFF(10,":"),i.k0s(),i.DNE(11,_h,2,1,"div",9),i.j41(12,"input",12,2),i.bIt("input",function(l){return i.eBV(s),i.Njj(r.change(l,"ss"))})("keydown",function(l){return i.eBV(s),i.Njj(r.keyDownCtrl(l,"ss"))})("focus",function(l){return i.eBV(s),i.Njj(r.focus(l,"ss"))})("blur",function(l){return i.eBV(s),i.Njj(r.blur(l,"ss"))})("keypress",function(l){return i.eBV(s),i.Njj(r.validate(l))}),i.k0s(),i.j41(14,"span",13),i.EFF(15,"."),i.k0s(),i.DNE(16,bh,2,1,"div",9),i.j41(17,"input",14,3),i.bIt("input",function(l){return i.eBV(s),i.Njj(r.change(l,"tt"))})("keydown",function(l){return i.eBV(s),i.Njj(r.keyDownCtrl(l,"tt"))})("focus",function(l){return i.eBV(s),i.Njj(r.focus(l,"tt"))})("blur",function(l){return i.eBV(s),i.Njj(r.blur(l,"tt"))})("keypress",function(l){return i.eBV(s),i.Njj(r.validate(l))}),i.k0s()()()}2&e&&(i.STu("",r.theme," ",r.varient,""),i.Y8G("ngClass",i.eq3(18,fh,r.isEdit)),i.R7$(2),i.Y8G("ngIf",r.showhh&&!r.isEdit&&!r.isHover),i.R7$(),i.Y8G("hidden",!r.showhh||!(r.isEdit||r.isHover)),i.BMQ("data-inputid",r.inputid),i.R7$(2),i.Y8G("ngIf",r.showhh),i.R7$(),i.Y8G("ngIf",!r.isEdit&&!r.isHover),i.R7$(),i.Y8G("hidden",!(r.isEdit||r.isHover)),i.BMQ("data-inputid",r.inputid),i.R7$(4),i.Y8G("ngIf",!r.isEdit&&!r.isHover),i.R7$(),i.Y8G("hidden",!(r.isEdit||r.isHover)),i.BMQ("data-inputid",r.inputid),i.R7$(4),i.Y8G("ngIf",!r.isEdit&&!r.isHover),i.R7$(),i.Y8G("hidden",!(r.isEdit||r.isHover)),i.BMQ("data-inputid",r.inputid))},dependencies:[Y.YU,Y.bT],styles:[".duration-parent[_ngcontent-%COMP%]{padding:0 8px;height:28px;line-height:normal}.edit-active[_ngcontent-%COMP%]{border-radius:8px;border:1px solid #626ADF}.edit-active[_ngcontent-%COMP%] .input-color[_ngcontent-%COMP%], .edit-active[_ngcontent-%COMP%] .span-color[_ngcontent-%COMP%]{color:#181a20}.div-color[_ngcontent-%COMP%]{color:#4a4f5e;justify-content:center}.span-color[_ngcontent-%COMP%]{color:#4a4f5e}.duration-parent[_ngcontent-%COMP%]:hover{border-radius:8px;border:1px solid #626ADF;background:#626adf0d}.eBOZcZ[_ngcontent-%COMP%]{display:flex;align-items:center;-webkit-appearance:none;appearance:none;border:none;outline:none;background:none;width:19px;height:28px}.duration-ctrl[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;transition:all .15s ease-in-out 0s;border:1px solid transparent;border-radius:1px}.d-ctrl-input[_ngcontent-%COMP%]{display:flex;align-items:center;height:28px;width:19px;-webkit-appearance:none;appearance:none;border:none;outline:none;background:none;padding:0;color:#4a4f5e;justify-content:center;text-align:center}.duration-parent.d-trackitem[_ngcontent-%COMP%] .d-ctrl-input[_ngcontent-%COMP%]{height:14px}.duration-parent.d-trackitem[_ngcontent-%COMP%]{padding:unset!important;height:17px;border-radius:4px;background:#272b3480;padding:0 8px!important;border:1px solid transparent}.duration-parent.d-trackitem[_ngcontent-%COMP%] .s-1[_ngcontent-%COMP%], .duration-parent.d-trackitem[_ngcontent-%COMP%] .s-2[_ngcontent-%COMP%]{line-height:16px}.duration-parent.d-trackitem[_ngcontent-%COMP%] .div-color[_ngcontent-%COMP%]{color:#ffffffb3;height:17px;width:14px!important;justify-content:center}.duration-parent.d-trackitem[_ngcontent-%COMP%] .span-color[_ngcontent-%COMP%]{color:#ffffffb3;height:17px}.duration-parent.d-trackitem[_ngcontent-%COMP%] .input-color[_ngcontent-%COMP%]{color:#ffffffb3;height:17px;width:14px!important}.duration-parent.d-trackitem[_ngcontent-%COMP%]:hover{border:1px solid #272B34!important;background:#272b34cc!important}.duration-parent.d-trackitem[_ngcontent-%COMP%]:hover .div-color[_ngcontent-%COMP%]{width:14px!important}.duration-parent.d-trackitem.edit-active[_ngcontent-%COMP%] .div-color[_ngcontent-%COMP%]{color:#fff;justify-content:center}.duration-parent.d-trackitem.edit-active[_ngcontent-%COMP%] .span-color[_ngcontent-%COMP%], .duration-parent.d-trackitem.edit-active[_ngcontent-%COMP%] .input-color[_ngcontent-%COMP%]{color:#fff}.duration-parent.d-trackitem.edit-active[_ngcontent-%COMP%] .input-color[_ngcontent-%COMP%]::placeholder{color:#fff}.input-color[_ngcontent-%COMP%]::placeholder{color:#181a20}"]}),n})();var dn=p(54124);const yh=["canvas"],Th=["ve-trackitem2",""];
1function kh(t,n){1&t&&(i.j41(0,"div",11),i.nrm(1,"canvas",12,0),i.k0s())}function Ch(t,n){if(1&t&&(i.j41(0,"div",13),i.nrm(1,"div",14),i.j41(2,"div",15),i.EFF(3),i.nI1(4,"msve"),i.k0s()()),2&t){const o=i.XpG();i.xc7("left",o.startTimePx,"px")("top",o.topPx,"px"),i.R7$(3),i.SpI(" ",i.bMT(4,5,o.startTime),"")}}function xh(t,n){if(1&t&&(i.j41(0,"div",16),i.nrm(1,"div",14),i.j41(2,"div",15),i.EFF(3),i.nI1(4,"msve"),i.k0s()()),2&t){const o=i.XpG();i.xc7("left",o.endTimePx,"px")("top",o.topPx,"px"),i.R7$(3),i.JRh(i.bMT(4,5,o.endTime))}}function wh(t,n){if(1&t){const o=i.RV6();i.j41(0,"pi",17),i.bIt("click",function(){i.eBV(o);const r=i.XpG();return i.Njj(r.split())}),i.k0s()}if(2&t){const o=i.XpG();i.xc7("left",o.pixelPerTime*o.currentTime-o.left-13.5,"px")}}let Mh=(()=>{var t;class n{set pixelPerTime(e){this._pixelPerTime=e,this.el&&this.el.nativeElement&&(this.left=parseFloat(this.el.nativeElement.style.left))}get pixelPerTime(){return this._pixelPerTime}set content(e){this.canvas=e}constructor(e,r,s,a){this.el=e,this.renderer=r,this.videoService=s,this.videoRepository=a,this.isDragging=!1,this.hideLeftTooltip=!1,this.isSelected=!1,this.isVideoPlay=!1,this.startTime=0,this.endTime=0,this.startTimePx=0,this.endTimePx=0,this.topPx=0,this.draggingSub=null,this.changeIsResizing=new i.bkB,this.movingOffset=new i.bkB,this.endOffset=new i.bkB,this.autoScroll=new i.bkB,this.movingResize=new i.bkB,this.endResizing=new i.bkB,this.fileName="",this.splitTrackItem=new i.bkB,this.endMouseDown=new i.bkB,this.isResizing=!1,this.left=0,this.tRight=!1,this.tLeft=!1,this.isVideo=!1,this.inScroll=!1,this.minResizeWidth=15,this.isSplitEnable=!1,this.resizeMouseDiff=0}ngAfterViewInit(){if(this.isVideo){var e=this.getDragEl();let r=1e3*this.trackItem.designItem.getMedia().duration*this.pixelPerTime,s=-1*this.trackItem.attachedObject.designItem.box.imgArray[0].trimStart*this.pixelPerTime;this.renderer.setStyle(this.canvas.nativeElement,"width",r+"px"),this.renderer.setStyle(this.canvas.nativeElement,"left",s+"px"),this.trackItem.makeThumbGanarator(this.canvas.nativeElement,this.videoRepository,this.displayedWidth,a=>{this.bgUrl=a,this.renderer.setStyle(e,"background-image",`url(${a})`),this.renderer.setStyle(e,"background-repeat","repeat")})}}ngOnInit(){let e=this.getDragEl();this.isVideo=!this.audioType&&this.trackItem&&this.trackItem.isVideo(),this.isVideo&&(this.zoomSubscription=this.videoService.zoomed.subscribe(()=>{setTimeout(()=>{this.refreshThumbs()},0)})),this.left=parseFloat(e.style.left),this.isSplitEnable=this.trackItem&&"text"==this.trackItem.trackItemType?"simple"==this.trackItem?.designItem?.designItem?.canvas?.textType:!(!this.trackItem||"animated"==this.trackItem.trackItemType),this.trackItem&&"text"==this.trackItem.trackItemType&&!this.audioType?this.fileName=this.trackItem?.designItem?.activeTextGroup.canvasGlobalObject.textToRender:this.trackItem.audioObject&&(this.fileName=this.trackItem.audioObject.name)}refreshThumbs(){if(this.isVideo){let e=1e3*this.trackItem.designItem.getMedia().duration*this.pixelPerTime,r=-1*this.trackItem.attachedObject.designItem.box.imgArray[0].trimStart*this.pixelPerTime;this.renderer.setStyle(this.canvas.nativeElement,"width",e+"px"),this.renderer.setStyle(this.canvas.nativeElement,"left",r+"px"),this.trackItem.zoom()}}ngOnDestroy(){this.draggingSub&&(this.draggingSub.unsubscribe(),this.draggingSub=null),this.zoomSubscription&&(this.zoomSubscription.unsubscribe(),this.zoomSubscription=null),this.isVideo&&this.trackItem.thumbGenerator.destroy()}getDragEl(){return this.el.nativeElement}onMouseDown(e){if(e instanceof MouseEvent&&2===e.button)return;let r=e.target;if("rect"===r.tagName||"path"===r.tagName||"pi"===r.tagName||"INPUT"===r.tagName)return;r&&r.dataset&&"resize"===r.dataset.type?(this.isResizing=!0,"left"===r.dataset.dir?(this.tLeft=!0,this.tRight=!1,this.resizeDirection="left"):(this.tLeft=!1,this.tRight=!0,this.resizeDirection="right"),this.renderer.addClass(this.el.nativeElement,"resizing"),this.changeIsResizing.emit({enable:1,target:this.el})):(this.isResizing=!1,this.changeIsResizing.emit({enable:0,target:this.el}));let s=this.getDragEl(),a=s.getBoundingClientRect(),l=a.x+a.width;this.isDragging=!0,this.lastDownX=e.clientX,this.lastDownY=e.clientY,this.resizeMouseDiff=l-this.lastDownX,s.dataset&&(this.originalTrimEnd=s.dataset.end,this.originalTrimStart=s.dataset.start),this.offsetX=e.clientX-s.offsetLeft,this.offsetY=e.clientY-s.offsetTop,this.originalWidth=parseFloat(getComputedStyle(s,null).getPropertyValue("width")),this.originalLeft=parseFloat(getComputedStyle(s,null).getPropertyValue("left")),this.draggingSub=(0,Ct.R)(document,"mousemove",{passive:!1}).subscribe(c=>this.onMouseMove(c)),this.draggingSub.add((0,Ct.R)(document,"touchmove",{passive:!1}).subscribe(c=>this.onMouseMove(c))),this.draggingSub.add((0,Ct.R)(document,"touchend",{passive:!1}).subscribe(c=>this.drop(c))),this.draggingSub.add((0,Ct.R)(document,"touchcancel",{passive:!1}).subscribe(c=>this.drop(c))),this.draggingSub.add((0,Ct.R)(document,"mouseup",{passive:!1}).subscribe(c=>this.drop(c))),s.style.zIndex=5}onMouseMove(e){if(this.isDragging){let a=this.getDragEl();if(this.isResizing){let h,f;if("left"===this.resizeDirection){h=e.clientX-this.lastDownX;let T=parseFloat(this.originalTrimStart)+h;f=this.originalWidth-h;const b=this.originalLeft+h;if(this.max&&(T>=this.max||T<0)||b<0||f<this.minResizeWidth)return;this.renderer.setAttribute(a,"data-start",T),a.style.width=`${f}px`,a.style.left=`${b}px`,this.movingResize.emit({ElementRef:this.el,isResizing:this.isResizing,direction:this.resizeDirection,diff:h})}else{let m=a.getBoundingClientRect();h=e.clientX+this.resizeMouseDiff-(m.x+m.width);let _=parseFloat(this.originalTrimEnd)+h,C=parseFloat(getComputedStyle(a,null).getPropertyValue("width"))+h;if(this.max&&(_>=this.max||_<0)){if(!(_>=this.max))return;_=this.max-.01,C=this.max-parseFloat(this.originalTrimStart)-.01}if(C<this.minResizeWidth)return;this.originalTrimEnd=_,this.renderer.setAttribute(a,"data-end",_),a.style.width=`${C}px`,this.movingResize.emit({ElementRef:this.el,isResizing:this.isResizing,direction:this.resizeDirection,diff:h})}}else{var r=e.clientX-this.offsetX,s=e.clientY-this.offsetY;r<0&&(r=0),a.style.left=r+"px",a.style.top=s+"px",this.tLeft=!0,this.movingOffset.emit({ElementRef:this.el,isResizing:this.isResizing,clientX:e.clientX})}this.startTime=parseFloat(a.style.left)/this.pixelPerTime,this.endTime=(parseFloat(a.style.left)+parseFloat(a.style.width))/this.pixelPerTime;let l=a.getBoundingClientRect();this.startTimePx=l.x-20,this.endTimePx=l.x+12+l.width-50,this.topPx=l.y;let c=this.bounds.getBoundingClientRect(),d=this.bounds.scrollLeft,u=e.clientX-c.x;this.hideLeftTooltip=l.x<c.x||l.y<c.y,window.innerWidth-e.clientX<30?this.inScroll||(this.inScroll=!0,this.scroll(null)):u<20&&d>0?this.inScroll||(this.inScroll=!0,this.scrollLeft(null)):this.inScroll=!1}}scrollLeft(e){if(this.inScroll){let r=4;this.autoScroll.emit({marginLeft:e,left:!0});let s=this.getDragEl();if(this.offsetX=this.offsetX+r,this.isResizing)return;parseFloat(s.style.left)>0&&(s.style.left=parseFloat(s.style.left)-r+"px",this.movingOffset.emit({ElementRef:this.el,isResizing:this.isResizing,clientX:null})),this.startTime=parseFloat(s.style.left)/this.pixelPerTime,this.endTime=(parseFloat(s.style.left)+parseFloat(s.style.width))/this.pixelPerTime;let a=s.getBoundingClientRect();this.startTimePx=a.x-20,this.endTimePx=a.x+12+a.width-50,this.topPx=a.y,setTimeout(()=>{this.scrollLeft(null)},10)}}scroll(e){if(this.inScroll){let r=4;this.autoScroll.emit({marginLeft:e,left:!1});let s=this.getDragEl();if(this.offsetX=this.offsetX-r,this.isResizing){let l=parseFloat(getComputedStyle(s,null).getPropertyValue("width")),d=parseFloat(this.originalTrimEnd)+r,u=l+r;if(this.max&&(d>
1=this.max||d<0)){if(!(d>=this.max))return;d=this.max-.01,u=this.max-parseFloat(this.originalTrimStart)-.01}if(u<this.minResizeWidth)return;this.renderer.setAttribute(s,"data-end",d.toString()),s.style.width=`${u}px`,this.originalWidth=u,this.movingResize.emit({ElementRef:this.el,isResizing:this.isResizing,direction:this.resizeDirection,diff:r})}else s.style.left=parseFloat(s.style.left)+r+"px",this.movingOffset.emit({ElementRef:this.el,isResizing:this.isResizing,clientX:null});this.startTime=parseFloat(s.style.left)/this.pixelPerTime,this.endTime=(parseFloat(s.style.left)+parseFloat(s.style.width))/this.pixelPerTime;let a=s.getBoundingClientRect();this.startTimePx=a.x-21,this.endTimePx=a.x+12+a.width-50,this.topPx=a.y,setTimeout(()=>{this.scroll(null)},10)}}changeDuration(e){this.endResizing.emit({ElementRef:this.el,diff:0,direction:"right",duration:e})}drop(e){let r=this.getDragEl();if(r.style.zIndex="unset",this.tLeft=!1,this.tRight=!1,this.inScroll=!1,this.draggingSub){this.draggingSub.unsubscribe(),this.draggingSub=null;let s=e.clientY,a=e.clientX;this.isResizing?(this.endResizing.emit({ElementRef:this.el,diff:a-this.lastDownX,direction:this.resizeDirection,duration:0}),this.refreshThumbs()):a!==this.lastDownX||s!==this.lastDownY?this.endOffset.emit({ElementRef:this.el}):this.endMouseDown.emit(),this.changeIsResizing.emit({enable:0,target:this.el}),this.renderer.removeClass(this.el.nativeElement,"resizing"),this.isDragging=!1}else this.endMouseDown.emit();this.left=parseFloat(r.style.left)}split(){this.splitTrackItem.emit()}}return(t=n).\u0275fac=function(e){return new(e||t)(i.rXU(i.aKT),i.rXU(i.sFG),i.rXU(Fe.M),i.rXU(Ei.I))},t.\u0275cmp=i.VBU({type:t,selectors:[["","ve-trackitem2",""]],viewQuery:function(e,r){if(1&e&&i.GBs(yh,5),2&e){let s;i.mGM(s=i.lsd())&&(r.content=s.first)}},hostBindings:function(e,r){1&e&&i.bIt("mousedown",function(a){return r.onMouseDown(a)})("touchstart",function(a){return r.onMouseDown(a)})},inputs:{duration:"duration",bounds:"bounds",max:"max",pixelPerTime:"pixelPerTime",isSelected:"isSelected",isVideoPlay:"isVideoPlay",displayedWidth:"displayedWidth",trackItem:"trackItem",fileName:"fileName",currentTime:"currentTime",audioType:"audioType"},outputs:{changeIsResizing:"changeIsResizing",movingOffset:"movingOffset",endOffset:"endOffset",autoScroll:"autoScroll",movingResize:"movingResize",endResizing:"endResizing",splitTrackItem:"splitTrackItem",endMouseDown:"endMouseDown"},attrs:Th,decls:11,vars:9,consts:[["canvas",""],["style","width: 100%; height:100%;position: absolute;left: 0;\n overflow: hidden;display:flex; border-radius: 8px;",4,"ngIf"],[1,"only-video",2,"overflow","hidden"],[1,"middle-track","d-flex","align-items-center","ps-2","pe-2"],[1,"align-items-center","justify-content-center","time-tile","text-semi","p-0","bg-hide",3,"seekMove","theme","varient","totalTime","currentTime"],[1,"align-items-center","justify-content-center","file-tile","text-semi","ms-2"],["data-type","resize","data-dir","left",1,"ng-resizable-handle","ng-resizable-w"],["role","tooltip","x-placement","top","class","tooltip fade bs-tooltip-top show ng-star-inserted",3,"left","top",4,"ngIf"],["data-type","resize","data-dir","right",1,"ng-resizable-handle","ng-resizable-e"],["role","tooltip","x-placement","top","class","tooltip fade bs-tooltip-top show ng-star-inserted","style","min-width: 63.5px;",3,"left","top",4,"ngIf"],["name","splitlayer","class","split-icon f-28",3,"left","click",4,"ngIf"],[2,"width","100%","height","100%","position","absolute","left","0","overflow","hidden","display","flex","border-radius","8px"],[1,"canvas-track",2,"position","absolute","border-radius","8px"],["role","tooltip","x-placement","top",1,"tooltip","fade","bs-tooltip-top","show","ng-star-inserted"],[1,"arrow"],[1,"tooltip-inner","text-semi"],["role","tooltip","x-placement","top",1,"tooltip","fade","bs-tooltip-top","show","ng-star-inserted",2,"min-width","63.5px"],["name","splitlayer",1,"split-icon","f-28",3,"click"]],template:function(e,r){1&e&&(i.DNE(0,kh,3,0,"div",1),i.j41(1,"div",2)(2,"div",3)(3,"duration-control",4),i.bIt("seekMove",function(a){return r.changeDuration(a)}),i.k0s(),i.j41(4,"span",5),i.EFF(5),i.k0s()(),i.j41(6,"div",6),i.DNE(7,Ch,5,7,"div",7),i.k0s(),i.j41(8,"div",8),i.DNE(9,x
1h,5,7,"div",9),i.k0s()(),i.DNE(10,wh,1,2,"pi",10)),2&e&&(i.Y8G("ngIf",r.isVideo),i.R7$(3),i.Y8G("theme","dark")("varient","d-trackitem")("totalTime",r.max)("currentTime",r.duration),i.R7$(2),i.JRh(r.fileName),i.R7$(2),i.Y8G("ngIf",r.tLeft&&!r.hideLeftTooltip),i.R7$(2),i.Y8G("ngIf",r.tRight),i.R7$(),i.Y8G("ngIf",!r.isDragging&&!r.isVideoPlay&&r.isSelected&&r.isSplitEnable&&r.trackItem.startTime<=r.currentTime-500&&r.trackItem.startTime+r.trackItem.duration>=r.currentTime+500))},dependencies:[Y.bT,qt.b,to,dn.gn],styles:['duration-control[_ngcontent-%COMP%]:has( > .edit-active)[_ngcontent-%COMP%]{position:absolute;z-index:999}duration-control[_ngcontent-%COMP%]:has( > .edit-active)[_ngcontent-%COMP%] ~ span[_ngcontent-%COMP%]{padding-left:93px;display:inline-flex}.bs-tooltip-top[_ngcontent-%COMP%]{will-change:transform;position:fixed;width:auto;cursor:text;padding:0;margin-top:-30px;padding-bottom:0!important}.bs-tooltip-top[_ngcontent-%COMP%] .tooltip-inner[_ngcontent-%COMP%]{background-color:#4a4f5e;border-radius:6px;padding:3px 5px!important;font-size:12px!important}.bs-tooltip-top[_ngcontent-%COMP%] .arrow[_ngcontent-%COMP%]{position:absolute;bottom:0;width:.6rem;height:.4rem;top:23px;left:41%!important;transform:translate(0);display:block}.bs-tooltip-top[_ngcontent-%COMP%] .arrow[_ngcontent-%COMP%]:before{position:absolute;content:"";border:0px;background:url(https://static.lightxeditor.com/assets/images/tool-tip-arrow.svg) no-repeat!important;height:7px;width:9px;top:-1px}pi.split-icon[_ngcontent-%COMP%]{position:absolute;width:21px;height:28px;cursor:pointer;z-index:10}.canvas-track[_ngcontent-%COMP%]{position:relative;top:0;height:99%;width:100%;border-radius:8px}.bg-hide[_ngcontent-%COMP%]{background:transparent!important}']}),n})();const Ih=["ve-seekbar",""];function Eh(t,n){if(1&t&&(i.j41(0,"div",5),i.nrm(1,"div",6),i.j41(2,"div",7),i.EFF(3),i.nI1(4,"msve"),i.k0s()()),2&t){const o=i.XpG();i.xc7("left",o.eX,"px")("top",o.eY,"px"),i.R7$(3),i.JRh(i.bMT(4,5,o.currentTime))}}let Ph=(()=>{var t;class n{constructor(e,r){this.el=e,this.renderer=r,this.isDragging=!1,this.seekMove=new i.bkB,this.seekStop=new i.bkB}ngOnInit(){this.getDragEl().style.left="-6px"}ngOnDestroy(){}changeLeftPos(e){this.getDragEl().style.left=e-6+"px"}getDragEl(){return this.el.nativeElement}onMouseDown(e){if(e instanceof MouseEvent&&2===e.button)return;let r=this.getDragEl();this.isDragging=!0,this.eX=e.clientX-28,this.eY=e.clientY,this.offsetX=e.clientX-r.offsetLeft,this.offsetY=e.clientY-r.offsetTop,this.eY=r.getBoundingClientRect().top-50,this.draggingSub=(0,Ct.R)(document,"mousemove",{passive:!1}).subscribe(s=>this.onMouseMove(s)),this.draggingSub.add((0,Ct.R)(document,"touchmove",{passive:!1}).subscribe(s=>this.onMouseMove(s))),this.draggingSub.add((0,Ct.R)(document,"touchend",{passive:!1}).subscribe(()=>this.drop())),this.draggingSub.add((0,Ct.R)(document,"touchcancel",{passive:!1}).subscribe(()=>this.drop())),this.draggingSub.add((0,Ct.R)(document,"mouseup",{passive:!1}).subscribe(()=>this.drop()))}onMouseMove(e){if(this.isDragging){var r=e.clientX-this.offsetX;let a=this.getDragEl();return r<-6?(r=-6,this.eX=a.getBoundingClientRect().left-20):this.eX=e.clientX-28,a.style.left=r+"px",void this.seekMove.emit(r+6)}}drop(){this.draggingSub&&(this.draggingSub.unsubscribe(),this.seekStop.emit(0)),this.isDragging=!1}}return(t=n).\u0275fac=function(e){return new(e||t)(i.rXU(i.aKT),i.rXU(i.sFG))},t.\u0275cmp=i.VBU({type:t,selectors:[["","ve-seekbar",""]],hostBindings:function(e,r){1&e&&i.bIt("mousedown",function(a){return r.onMouseDown(a)})("touchstart",function(a){return r.onMouseDown(a)})},inputs:{currentTime:"currentTime",bounds:"bounds"},outputs:{seekMove:"seekMove",seekStop:"seekStop"},attrs:Ih,decls:5,vars:1,consts:[["id","seeker",1,"seeker",2,"z-index","12","pointer-events","auto"],["role","tooltip","x-placement","top","class","tooltip fade bs-tooltip-top show ng-star-inserted","style","will-change: transform; position: fixed; width: auto;",3,"left","top",4,"ngIf"],["viewBox","0 0 10 13","fill","none","xmlns","http://www.w3.org/2000/svg",1,"Seeker-module_cursorImage_-g8kh"],["d","M1.8 12H8.2C8.64183 12 9 11.6418 9 11.2V6.08964C9 5.90249 8.93439 5.72126 8.81458 5.57749L5 1L1.18542 5.57749C1.06561 5.72126 1 5.90249 1 6.08964V11.2C1 11.6418 1.35817 12 1.8 12Z","fill","currentColor","stroke","currentColor","stroke-width","0.8"],[1,"seeker-line"],["role","tooltip","x-placement","top",1,"tooltip","fade","bs-tooltip-top","show","ng-star-inserted",2,"will-change","transform","position","fixed","width","auto"],[1,"arrow",2,"left","25px"],[1,"tooltip-inner","text-semi"]],template:function(e,r){1&e&&(i.j41(0,"div",0),i.DNE(1,Eh,5,7,"div",1),i.qSk(),i.j41(2,"svg",2),i.nrm(3,"path",3),i.k0s(),i.joV(),i.nrm(4,"div",4),i.k0s()),2&e&&(i.R7$(),i.Y8G("ngIf",r.isDragging))},dependencies:[Y.bT,dn.gn],styles:['.seeker[_ngcontent-%COMP%]{height:100%;width:2px;display:flex;justify-content:center}.seeker[_ngcontent-%COMP%] .seeker-line[_ngcontent-%COMP%]{margin-top:16px;width:2px;background:#626adf}.seeker[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{transform:rotate(180deg);position:absolute;top:0;height:20px;user-select:none;-moz-user-select:none;-webkit-user-select:none;pointer-events:none;margin-top:-2px}.seeker[_ngcontent-%COMP%] .bs-tooltip-top[_ngcontent-%COMP%]{top:auto!important;margin-top:-33px}.seeker[_ngcontent-%COMP%] .bs-tooltip-top[_ngcontent-%COMP%] .tooltip-inner[_ngcontent-%COMP%]{background-color:#4a4f5e;border-radius:6px;padding:3px 5px!important;font-size:12px}.seeker[_ngcontent-%COMP%] .bs-tooltip-top[_ngcontent-%COMP%] .arrow[_ngcontent-%COMP%]{position:absolute;bottom:0;width:9px;height:7px;left:42%!important;transform:none;display:block}.seeker[_ngcontent-%COMP%] .bs-tooltip-top[_ngcontent-%COMP%] .arrow[_ngcontent-%COMP%]:before{position:absolute;content:"";border:0px;background:url(https://static.lightxeditor.com/assets/images/tool-tip-arrow.svg) no-repeat!important;height:7px;width:9px;top:-2px}']}),n})();const Oh=["originalA"],Sh=["timelineA"],Ah=["tracksArea"],jh=["emptySpace"],Dh=["refElem"],Rh=["seek"],Vh=["contextMenu"],Nh=["musicTrack"],Uh=["lastBlankTrack"],Gh=["timelineWrapper"],eo=t=>({"grey-300 pe-none":t}),io=t=>({"pe-none disabled":t}),un=t=>({"pe-none":t}),Fh=t=>({"active-mute":t}),Bh=t=>({"active-item":t}),Lh=t=>({"disabled-all":t});function zh(t,n){1&t&&(i.j41(0,"div",67),i.nrm(1,"pi",68),i.k0s())}function Yh(t,n){1&t&&(i.j41(0,"div",69),i.nrm(1,"pi",70),i.k0s())}function Xh(t,n){if(1&t){const o=i.RV6();i.j41(0,"pi",74),i.bIt("click",function(r){i.eBV(o);const s=i.XpG(2);return i.Njj(s.toggleMute(r))}),i.k0s()}}function Hh(t,n){if(1&t){const o=i.RV6();i.j41(0,"pi",75),i.bIt("click",function(r){i.eBV(o);const s=i.XpG(2);return i.Njj(s.toggleMute(r))}),i.k0s()}if(2&t){const o=i.XpG(2);i.Y8G("ngClass",i.eq3(1,Fh,o.timeline.mute))}}function $h(t,n){if(1&t){const o=i.RV6();i.j41(0,"button",71),i.bIt("keydown",function(r){i.eBV(o);const s=i.XpG();return i.Njj(s.onKeyDown(r))}),i.DNE(1,Xh,1,0,"pi",72)(2,Hh,1,3,"pi",73),i.k0s()}if(2&t){const o=i.XpG();i.Y8G("ngClass",i.eq3(3,un,o.timeline&&0===o.timeline.tracks.length&&!(null!=o.timeline&&o.timeline.audioObjects&&(null==o.timeline?null:o.timeline.audioObjects.length)>0))),i.R7$(),i.Y8G("ngIf",!o.timeline.mute),i.R7$(),i.Y8G("ngIf",o.timeline.mute)}}function Wh(t,n){if(1&t){const o=i.RV6();i.j41(0,"button",76),i.bIt("click",function(){i.eBV(o);const r=i.XpG();return i.Njj(r.play())}),i.nrm(1,"pi",77),i.k0s()}if(2&t){const o=i.XpG();i.Y8G("ngClass",i.eq3(1,un,o.timeline&&0===o.timeline.tracks.length&&!(null!=o.timeline&&o.timeline.audioObjects&&(null==o.timeline?null:o.timeline.audioObjects.length)>0)))}}
1function Kh(t,n){1&t&&(i.j41(0,"div",80)(1,"span",81),i.EFF(2,"Loading..."),i.k0s()())}function Zh(t,n){if(1&t&&(i.j41(0,"button",78),i.DNE(1,Kh,3,0,"div",79),i.k0s()),2&t){const o=i.XpG();i.Y8G("ngClass",i.eq3(2,un,o.timeline&&0===o.timeline.tracks.length&&!(null!=o.timeline&&o.timeline.audioObjects&&(null==o.timeline?null:o.timeline.audioObjects.length)>0))),i.R7$(),i.Y8G("ngIf",o.videoPlayProgress)}}function Jh(t,n){1&t&&(i.j41(0,"button",82),i.nrm(1,"pi",83),i.k0s())}function Qh(t,n){if(1&t){const o=i.RV6();i.j41(0,"duration-control",84),i.bIt("seekMove",function(r){i.eBV(o);const s=i.XpG();return i.Njj(s.changeCurrentTime(r))}),i.k0s()}if(2&t){const o=i.XpG();i.Y8G("totalTime",o.timeline.duration)("currentTime",o.timeline.currentTime)}}function qh(t,n){if(1&t){const o=i.RV6();i.j41(0,"div",85,5),i.bIt("seekMove",function(r){i.eBV(o);const s=i.XpG();return i.Njj(s.seekMove(r,!0))})("seekStop",function(r){i.eBV(o);const s=i.XpG();return i.Njj(s.seekStop(r))}),i.k0s()}if(2&t){const o=i.XpG();i.xc7("left",o.timeline.currentTime*o.pixelPerTime-6,"px"),i.Y8G("currentTime",o.timeline.currentTime)}}function tm(t,n){if(1&t){const o=i.RV6();i.qex(0),i.j41(1,"div",86),i.bIt("click",function(){i.eBV(o);const r=i.XpG();return i.Njj(r.addMedia())}),i.nrm(2,"pi",87),i.EFF(3,"Click to add media "),i.k0s(),i.bVm()}}function em(t,n){if(1&t){const o=i.RV6();i.qex(0),i.j41(1,"div",99),i.bIt("movingOffset",function(r){i.eBV(o);const s=i.XpG(3);return i.Njj(s.movingOffset(r))})("endOffset",function(r){const s=i.eBV(o),a=s.$implicit,l=s.index,c=i.XpG().index,d=i.XpG(2);return i.Njj(d.endOffset(r,a,c,l))})("changeIsResizing",function(r){const s=i.eBV(o).$implicit,a=i.XpG(3);return i.Njj(a.changeIsResizing(r,s))})("movingResize",function(r){i.eBV(o);const s=i.XpG(3);return i.Njj(s.movingResize(r))})("endResizing",function(r){const s=i.eBV(o),a=s.$implicit,l=s.index,c=i.XpG().index,d=i.XpG(2);return i.Njj(d.endResizing(r,a,c,l))})("autoScroll",function(r){i.eBV(o);const s=i.XpG(3);return i.Njj(s.autoScroll(r))})("splitTrackItem",function(){i.eBV(o);const r=i.XpG(3);return i.Njj(r.splitTrackItem())})("contextmenu",function(r){const s=i.eBV(o).$implicit,a=i.XpG(3);return i.Njj(a.showMenu(r,s))})("endMouseDown",function(){i.eBV(o);const r=i.XpG(3);return i.Njj(r.endMouseDown())}),i.k0s(),i.bVm()}if(2&t){const o=n.$implicit,e=i.XpG(3),r=i.sdS(48);i.R7$(),i.ZvI("i-",o.trackItemType," "),i.xc7("left",(o.tempStartTime||o.startTime)*e.pixelPerTime,"px")("width",o.duration*e.pixelPerTime,"px"),i.FS9("id",o.trackItemId),i.Y8G("duration",o.duration)("trackItem",o)("bounds",r)("pixelPerTime",e.pixelPerTime)("currentTime",e.currentTime)("displayedWidth",e.width)("isSelected",e.activeObject&&e.activeObject.trackItemId===o.trackItemId)("isVideoPlay",e.isVideoPlay)("ngClass",i.eq3(19,Bh,e.activeObject&&e.activeObject.trackItemId===o.trackItemId)),i.BMQ("data-left",o.startTime)("data-type",o.trackItemType)}}function im(t,n){if(1&t&&(i.j41(0,"div",100,10),i.nrm(2,"div",101),i.k0s()),2&t){const o=i.XpG().index;i.BMQ("data-index",o+1)}}function nm(t,n){if(1&t){const o=i.RV6();i.qex(0),i.j41(1,"div",95),i.nrm(2,"div",96),i.k0s(),i.j41(3,"div",97),i.bIt("mouseover",function(r){const s=i.eBV(o).$implicit,a=i.XpG(2);return i.Njj(a.mouseTrackEnter(r,s))})("mousedown",function(r){i.eBV(o);const s=i.XpG(2);return i.Njj(s.onStartRecording(r))}),i.DNE(4,em,2,21,"ng-container",89),i.k0s(),i.DNE(5,im,3,1,"div",98),i.bVm()}if(2&t){const o=n.$implicit,e=n.index,r=n.last;i.R7$(),i.BMQ("data-index",e)("data-tracktype",o.type),i.R7$(2),i.ZvI("track d-flex type-",o.type,""),i.BMQ("data-index",e)("data-id",o.id),i.R7$(),i.Y8G("ngForOf",o.trackItems),i.R7$(),i.Y8G("ngIf",r)}}function rm(t,n){if(1&t){const o=i.RV6();i.j41(0,"div",102),i.bIt("click",function(){i.eBV(o);const r=i.XpG(2);return i.Njj(r.addMusic())}),i.nrm(1,"pi",87),i.EFF(2,"Click to add music "),i.k0s()}}function om(t,n){if(1&t){const o=i.RV6();i.qex(0),i.j41(1,"div",88,6),i.DNE(3,nm,6,9,"ng-container",89),i.qex(4),i.j41(5,"div",90,7),i.bIt("mousedown",function(r){i.eBV(o);const s=i.XpG();return i.Njj(s.onStartRecording(r))}),i.DNE(7,rm,3,0,"div",91),i.k0s(),i.bVm(),i.j41(8,"div",92,8),i.bIt("mouseleave",function(){i.eBV(o);const r=i.XpG();return i.Njj(r.hideEmptySpace())}),i.j41(10,"div",93),i.bIt("click",function(r){i.eBV(o);const s=i.XpG();
1return i.Njj(s.removeEmptySpace(r))}),i.k0s()(),i.nrm(11,"div",94,9),i.k0s(),i.bVm()}if(2&t){const o=i.XpG();i.R7$(3),i.Y8G("ngForOf",o.timeline.tracks),i.R7$(2),i.BMQ("data-index",100),i.R7$(2),i.Y8G("ngIf",!(null!=o.timeline&&o.timeline.audioObject))}}function sm(t,n){if(1&t){const o=i.RV6();i.j41(0,"li",103),i.bIt("click",function(){i.eBV(o);const r=i.XpG();return i.Njj(r.detachAudio())}),i.j41(1,"a"),i.nrm(2,"pi",104),i.EFF(3,"Detach Audio "),i.k0s()()}if(2&t){const o=i.XpG();i.Y8G("ngClass",i.eq3(1,Lh,1!==o.contextTrackItem._showDetachedAudio))}}let am=(()=>{var t;class n{constructor(e,r,s,a,l,c,d){this.ngZone=e,this.renderer=r,this.videoService=s,this.templateService=a,this.audioService=l,this.toast=c,this.editorUiService=d,this.width=0,this.currentValue=0,this.min=0,this.max=6e4,this.step=1,this.zoomRange=[0,4],this.zoomTranslateExtent=1,this.zoomScaleExtent=1,this.zoomDisabled=1,this.height=15,this.duration=6e4,this.oldDuration=6e4,this.init=!1,this.pixelPerTick=120,this.pixelPerTime=0,this.pptOnThumbGeneration=0,this.zoomVal=50,this.targetTrack=null,this.designItems=[],this.currentTime=0,this.isVideoPlay=!1,this.videoPlayProgress=!1,this.zoomInner=!1,this.isResizing=!1,this.contextTrackItem=null,this.gridActive=!1,this.testVal="",this.changeEditMode=new i.bkB,this.changeShowGrid=new i.bkB,this.playing=new i.bkB,this.undo=new i.bkB,this.redo=new i.bkB,this.activeTrackItem=null,this.prevScrollLeft=0,this.isNoClickTime=!1,this.pinchStartDistance=0,this.evCache=[],this.prevDiff=-1,this.scale=1,this.snapping={top:0,left:0,height:0},this.nextElementLeft=-1,this.initialResizeRight=-1,this.elemRanged=!1,this.videoService.updateDurationFn=u=>{this.updateRuler(),this.tracksArea?.nativeElement&&this.hideRefElem(),this.timeline&&this.currentTime>this.timeline.duration&&(this.currentTime=this.timeline.duration,this.timeline.seekToTime(this.currentTime,!1))},this.videoService.doActionFn=u=>{if("ruler-fit"===u.action)this.changePixelPerTime({},!0);else if("current-time"===u.action){let h=Math.floor(this.timeline.currentTime/((this.width-50)/this.pixelPerTime)),f=h*(this.width-50);this.prevScrollLeft!==f&&(this.smoothForcecroll(h*(this.width-50),400),this.prevScrollLeft=f)}}}pinchTrackPad(){this.originalA.nativeElement.addEventListener("wheel",e=>{if(e.ctrlKey){e.preventDefault(),isFinite(this.maxPixelPerTime)||this.setZoomBoundary(null,!0);let r=this.scale-.01*e.deltaY;Math.abs(this.scale-r)>.01&&(r>this.scale?this.zoomIn(.4):r<this.scale&&this.zoomOut(.4)),this.scale-=.01*e.deltaY}})}smoothForcecroll(e,r){let s=this.originalA.nativeElement;var a=this.originalA.nativeElement.scrollLeft,l=null;null==r&&(r=500),e=+e,r=+r,window.requestAnimationFrame(function c(d){var u=d-(l=l||d);s.scrollTo(a<e?{left:(e-a)*u/r+a}:{left:a-(a-e)*u/r}),u<r?window.requestAnimationFrame(c):s.scrollTo({left:e})})}ngOnChanges(e){e.init&&!0===e.init.currentValue?(this.duration=this.timeline.duration,this.oldDuration=this.timeline.duration,this.max=this.duration,this.width=this.timelineA.nativeElement.clientWidth,this.setZoomBoundary(),setTimeout(()=>{this.zoomVal=50},100),this.timeRuler=function Yd(t){return"string"==typeof t?new Pt([[document.querySelector(t)]],[document.documentElement]):new Pt([[t]],Un)}("#ruler").append("svg").attr("viewBox",[0,1,this.width,21]).attr("width",this.width),this._drawScale(this.timeRuler,this.width,this.duration)):e.activeObject&&(this.activeTrackItem=this.selectTrackItem(e.activeObject),this.activeTrackItem&&"video"==this.activeTrackItem.trackItemType)&&this.tracksArea.nativeElement.getElementsByClassName("active-item")}selectTrackItem(e){if(e&&e.currentValue)for(let r=0;r<this.timeline.tracks.length;r++){let s=this.timeline.tracks[r];for(let a=0;a<s.trackItems.length;a++){let l=s.trackItems[a];if(e.currentValue.trackItemId===l.trackItemId)return l}}return null}zoomOpen(e){(this.duration&&e||0===this.timeline.tracks.length)&&this.setZoomBoundary(null,!0)}getMaxPixelPerTime(){return this.width/4/this.timeline.minDuration}setZoomBoundary(e=null,r=!1){this.ngZone.run(()=>{let s=this.duration;this.duration<=0&&(s=6e4);let a=this.width/s;if(this.maxPixelPerTime=this.timeline.minDuration*a*5<this.width/4?this.width/4/this.timeline.minDuration:this.parseNumber(5*a),this.minPixelPerTime=this.parseNumber(this.width/4/s),this.stepPixelPerTime=this.parseNumber((this.maxPixelPerTime-this.minPixelPerTime)/100),r)if(a<=this.pixelPerTime)this.zoomVal=(this.pixelPerTime-a)/((this.maxPixelPerTime-a)/50)+50;else{let d;d=49+(this.pixelPerTime-a)/((a-this.minPixelPerTime)/50),this.zoomVal=d}else this.pixelPerTime=this.parseNumber(a),this.setDisplayedDuration()})}zoomIn(e=2){let r=this.zoomVal+e;r<=100&&(this.zoomVal=r,this.changePixelPerTime({newValue:r}))}zoomOut(e=2){let r=this.zoomVal-e;r>=0&&(this.zoomVal=r,this.changePixelPerTime({newValue:r}))}changePixelPerTime(e,r=!1,s=!0){if(r)this.duration=this.timeline.duration,this.max=this.duration,this.setZoomBoundary(),this.tracksArea&&this.renderer.removeStyle(this.timelineA.nativeElement,"width"),this.originalA&&(this.originalA.nativeElement.scrollLeft=0),setTimeout(()=>{this.zoomVal=50},200);else{let d,u,c=this.width/this.duration;e.newValue<50?(d=this.minPixelPerTime,u=(c-d)/50*(49-e.newValue),this.pixelPerTime=c-u,this.setDisplayedDuration()):e.newValue>50&&(d=this.maxPixelPerTime,u=(d-c)/50*(e.newValue-50),this.pixelPerTime=c+u,this.setDisplayedDuration())}this.hideRefElem(),this.updateRuler(),s&&this.pptOnThumbGeneration!==this.pixelPerTime&&(this.videoService.zoomed.next(),this.pptOnThumbGeneration=this.pixelPerTime)}setDisplayedDuration(){this.timeline.displayedDuration=this.width/this.pixelPerTime}ngOnInit(){this.pinchTrackPad()}changeIsResizing(e,r){this.activeVideoTool(r,e),this.isResizing=e.enable,e.enable?(this.hideRefElem(),this.calculateNextElementLeft(e.target),this.initialResizeRight=e.target.nativeElement.offsetLeft+e.target.nativeElement.clientWidth):this.initialResizeRight=-1}calculateNextElementLeft(e){for(var r=e.nativeElement.nextSibling;r&&1!=r.nodeType;)r=r.nextSibling;this.nextElementLeft=r?r.offsetLeft:-1}getFirstAudioTrack(e){for(let r=0;r<e.length;r++){let s=e[r];if("3"==s.dataset.tracktype)return s}return null}movingOffset(e){let r,s,a=e.ElementRef.nativeElement,l=a.getBoundingClientRect(),c=this.tracksArea.nativeElement.children;r=l.top+14,s=l.bottom-8;let d=!1;this.hideEmptySpace();let h=this.musicTrack.nativeElement.getBoundingClientRect().top-4,f=!1;"audio"===a.dataset.type&&(f=!0);let m=this.getFirstAudioTrack(c);if(m){let _=m.getBoundingClientRect().top+4;if(f&&r<_){d=!0,this.targetTrack=m;for(let v=0;v<c.length;v++)c[v].classList.remove("target-row");return this.targetTrack.classList.add("target-row"),void this.showRefElem(e,this.targetTrack)}if(!f&&r>_){d=!0,this.targetTrack=m;for(let v=0;v<c.length;v++)c[v].classList.remove("target-row");return this.targetTrack.classList.add("target-row"),void this.showRefElem(e,this.targetTrack)}}if(r>h){d=!0,this.targetTrack=this.lastBlankTrack.nativeElement;for(let b=0;b<c.length;b++)c[b].classList.remove("target-row");return this.targetTrack.classList.add("target-row"),void this.showRefElem(e,this.targetTrack)}for(let b=0;b<c.length;b++){let _=c[b],v=_.getBoundingClientRect(),C=v.top+2,y=v.bottom-2;"new"===_.dataset.type&&(C=v.top-2,y=v.bottom+2),C<r&&y>r?(_.classList.add("target-row"),d=!0,this.targetTrack=_,this.showRefElem(e,_)):_.classList.remove("target-row")}if(d||this.targetTrack.classList.add("target-row"),!d&&"new"===this.targetTrack.dataset.type&&0==this.targetTrack.dataset.index)return this.snapping.height=0,void this.renderer.removeClass(this.seekElem.el.nativeElement,"aligned");this.initGuidlines(e,!1)}clearContext(){}isInRange(e,r){e=Math.round(e),r=Math.round(r);for(var s=e-10,a=e+10;s<=a;s++)if(s===r)return!0;return!1}initGuidlines(e,r=!0){let s=this.tracksArea.nativeElement.children;this.clearContext();var a=e.ElementRef.nativeElement;let c=this.originalA.nativeElement.getBoundingClientRect().top,d=!1;for(let u=0;u<s.length;u++){let h=s[u];for(let f=0;f<h.children.length;f++){let m=h.children[f];if(m.dataset&&"elem"===m.dataset.cat&&m.id!==a.id){let T=a.getBoundingClientRect(),b=m.getBoundingClientRect(),_=this.seekElem.el.nativeElement.getBoundingClientRect(),v=b.left,C=b.to
1p,y=b.bottom,w=b.right,x=T.left,E=T.right,N=T.top,A=T.bottom;if(this.isInRange(v,x)&&(this.renderer.removeClass(this.seekElem.el.nativeElement,"aligned"),d=!0,this.snapping.left=b.left-1,this.setTopAndHeight(N,A,C,y,c),r?(a.style.width=a.offsetWidth-(m.offsetLeft-a.offsetLeft)+"px",a.style.left=`${m.offsetLeft}px`):this.renderer.setStyle(this.refElem.nativeElement,"left",m.offsetLeft+"px")),this.isInRange(w,x))if(d=!0,this.renderer.removeClass(this.seekElem.el.nativeElement,"aligned"),this.snapping.left=w,this.setTopAndHeight(N,A,C,y,c),r){let I=b.right-T.left;a.style.width=a.offsetWidth-I+"px",a.style.left=`${a.offsetLeft+I}px`}else this.renderer.setStyle(this.refElem.nativeElement,"left",m.offsetLeft+b.width+"px");if(this.isInRange(v,E)&&(d=!0,this.renderer.removeClass(this.seekElem.el.nativeElement,"aligned"),this.snapping.left=v,this.setTopAndHeight(N,A,C,y,c),r?m.parentElement.dataset.id===a.parentElement.dataset.id&&this.elemRanged||(a.style.width=`${a.offsetWidth+(m.offsetLeft-(a.offsetWidth+a.offsetLeft))}px`,this.elemRanged=!0):this.renderer.setStyle(this.refElem.nativeElement,"left",this.refElem.nativeElement.offsetLeft+(m.offsetLeft-(this.refElem.nativeElement.offsetWidth+this.refElem.nativeElement.offsetLeft))+"px")),this.isInRange(w,E)&&(d=!0,this.renderer.removeClass(this.seekElem.el.nativeElement,"aligned"),this.snapping.left=w,this.setTopAndHeight(N,A,C,y,c),r?a.style.width=`${a.offsetWidth+(m.offsetWidth+m.offsetLeft-(a.offsetWidth+a.offsetLeft))}px`:this.renderer.setStyle(this.refElem.nativeElement,"left",this.refElem.nativeElement.offsetLeft+(m.offsetWidth+m.offsetLeft-(this.refElem.nativeElement.offsetWidth+this.refElem.nativeElement.offsetLeft))+"px")),this.isInRange(_.left+6,x)&&(d&&(this.snapping.height=0),d=!0,this.renderer.addClass(this.seekElem.el.nativeElement,"aligned"),r?(a.style.width=a.offsetWidth-(this.seekElem.el.nativeElement.offsetLeft+5-a.offsetLeft)+"px",a.style.left=`${this.seekElem.el.nativeElement.offsetLeft+5}px`):this.renderer.setStyle(this.refElem.nativeElement,"left",this.seekElem.el.nativeElement.offsetLeft+6+"px")),this.isInRange(_.left+6,E)){d&&(this.snapping.height=0),d=!0,this.renderer.addClass(this.seekElem.el.nativeElement,"aligned");let I=this.seekElem.el.nativeElement.offsetLeft+5-(this.refElem.nativeElement.offsetWidth+this.refElem.nativeElement.offsetLeft);r?a.style.width=`${a.offsetWidth+(this.seekElem.el.nativeElement.offsetLeft+6-(a.offsetWidth+a.offsetLeft))}px`:this.renderer.setStyle(this.refElem.nativeElement,"left",this.refElem.nativeElement.offsetLeft+I+"px")}}}}d||(this.snapping.height=0,this.renderer.removeClass(this.seekElem.el.nativeElement,"aligned"),this.elemRanged=!1)}setTopAndHeight(e,r,s,a,l){this.snapping.top=e<s?e:s,s<l&&(s=l),e<s?(this.snapping.top=e,this.snapping.height=a-e):(this.snapping.top=s,this.snapping.height=r-s)}movingResize(e){this.testVal=e.diff;let s=e.ElementRef.nativeElement;if(this.initGuidlines(e),this.targetTrack){for(var a=s.nextSibling;a&&1!=a.nodeType;)a=a.nextSibling;let l=s.offsetLeft,c=s.offsetLeft+s.clientWidth,d=this.targetTrack.getElementsByClassName("track-item"),u=0;for(let h=0;h<d.length;h++){let f=d[h],m=f.offsetLeft;l<m&&-1!==this.nextElementLeft&&(this.nextElementLeft<=c&&0===u?(u=c-m,0===u&&(u=1)):a.offsetLeft!==this.nextElementLeft&&this.nextElementLeft>c&&(u=this.nextElementLeft-a.offsetLeft),u&&this.renderer.setStyle(f,"left",m+u+"px"))}}}autoScroll(e){e.marginLeft||(e.marginLeft=0),e.left?(this.timelineA.nativeElement.style.width=this.timelineA.nativeElement.scrollWidth-e.marginLeft+"px",this.originalA.nativeElement.scrollLeft=this.originalA.nativeElement.scrollLeft-4):(this.timelineA.nativeElement.style.width=this.timelineA.nativeElement.scrollWidth+e.marginLeft+"px",this.originalA.nativeElement.scrollLeft=this.originalA.nativeElement.scrollLeft+4)}onDivScroll(e){}showRefElem(e,r){if("new"===this.targetTrack.dataset.type)return void this.hideRefElem();let s=r.getElementsByClassName("track-item"),l=e.ElementRef.nativeElement.offsetLeft,c=0,d=e.ElementRef.nativeElement.clientWidth;c=this.getOverlappedStart(l,l+d,d,s),-1==c&&(c=l),this.renderer.appendChild(this.targetTrack,this.refElem.nativeElement),this.renderer.setStyle(this.refElem.nativeElement,"left",c+"px"),this.renderer.setStyle(this.refElem.nativeElement,"width",e.ElementRef.nativeElement.clientWidth+"px"),this.renderer.setStyle(this.refElem.nativeElement,"display","block")}tempShifting(e,r,s){this.targetTrack&&this.timeline.getTrackById(this.targetTrack.dataset.id).arrangeTempTrackItems(e/this.pixelPerTime,r/this.pixelPerTime,s)}getOverlappedStart(e,r,s,a){let l=-1;for(let c=0;c<a.length;c++){let d=a[c],u=d.offsetLeft,h=u+d.clientWidth;if(e>u&&e<h||r>u&&r<h||e<u&&r>h)return e>u?l=h:(l=u-s,l<0&&(l=0)),l}return l}insertTrack(){const e=this.renderer.createElement("div");this.renderer.insertBefore(this.tracksArea.nativeElement,e,this.targetTrack),this.renderer.addClass(e,"track");const r=this.renderer.createElement("div");return this.renderer.insertBefore(this.tracksArea.nativeElement,r,e),this.renderer.addClass(r,"blank-track"),this.renderer.setAttribute(r,"data-type","new"),e}endOffset(e,r,s,a){if(this.isResizing=!1,this.renderer.removeStyle(this.timelineA.nativeElement,"width"),this.targetTrack){if("new"===this.targetTrack.dataset.type&&r.trackItemType){this.renderer.removeClass(this.targetTrack,"target-row");let c=this.targetTrack.dataset.index;r.changeStartTime(e.ElementRef.nativeElement.offsetLeft/this.pixelPerTime,!0);let h=new $t(null,[r]);h.ontEndTimeChange=m=>this.timeline.handleTrackEndTimeChange(m);let f=this.timeline.tracks[s];f.trackItems.splice(a,1),f.updateTrackType(),this.timeline.tracks.splice(c,0,h),this._checkAndRemoveBlankTrack(s),this.timeline.ansureZorder(),this.updateRuler()}else{let c=this.targetTrack.dataset.index,d=this.timeline.tracks[s];if(d){d.trackItems.splice(a,1);let u=this.refElem.nativeElement.offsetLeft,h=u/this.pixelPerTime;this.renderer.setStyle(e.ElementRef.nativeElement,"left",u+"px"),d.updateTrackType(),r.changeStartTime(h,!1);let f=this.timeline.tracks[c];f.addTrackItem(r),f.updateTrackType(),this.renderer.setStyle(e.ElementRef.nativeElement,"top","0px"),this._checkAndRemoveBlankTrack(s),this.updateRuler()}}setTimeout(()=>{this.timeline.seekToTime(this.currentTime,!1)},500),this.timeline.setDirty(),this.timeline.setHistory()}this.hideRefElem()}endMouseDown(){this.hideRefElem()}endResizing(e,r,s,a){if(this.renderer.removeStyle(this.timelineA.nativeElement,"width"),this.isNoClickTime=!0,e.ElementRef){let l,c;if(e.duration?c=e.duration:(l=e.ElementRef.nativeElement.offsetWidth,c=l/this.pixelPerTime),r.trackItemType){r.changeDuration(c,this.timeline.tracks[s],e.direction),l=r.duration*this.pixelPerTime;let d=r.startTime*this.pixelPerTime;this.renderer.setStyle(e.ElementRef.nativeElement,"width",l+"px"),this.renderer.setStyle(e.ElementRef.nativeElement,"left",d+"px"),this.updateRuler()}else{let d=e.ElementRef.nativeElement.dataset.start,u=e.ElementRef.nativeElement.dataset.end;d=parseFloat(d)/this.pixelPerTime/1e3,u=parseFloat(u)/this.pixelPerTime/1e3,this.timeline.audioObject.trimStart=d,this.timeline.audioObject.trimEnd=u;let h=e.ElementRef.nativeElement.style.left;h=parseFloat(h)/this.pixelPerTime,this.timeline.audioObject.startTime=h,this.timeline.updateDuration()}this.timeline.setHistory()}this.timeline.setDirty(),this.isResizing=!1,this.hideRefElem(),setTimeout(()=>{this.isNoClickTime=!1},100)}isSpaceAvailableForNewTrackItem(e,r,s){const a=e,l=e+r;let d=this.getFirstOrDefaultOverlappedItem(a,l,s);if(d){let u=l-d.startTime;for(const h of s.trackItems)h.startTime>=a&&h.changeStartTime(h.startTime+u)}return!0}clickTimeline(e){let r=e.srcElement;!this.isNoClickTime&&r&&("timelineGrid"===r.id||"track"===r.dataset.role)&&(this.clickRuler(e),e.preventDefault())}getFirstOrDefaultOverlappedItem(e,r,s){for(const a of s.trackItems){if(a.startTime<=e&&a.endTime>=e)return a;
1if(a.startTime<=r&&a.endTime>=r||a.startTime>=e&&a.endTime<=r)return a}}mouseTrackEnter(e,r){if(this.isResizing)return;let s=this.tracksArea.nativeElement.getBoundingClientRect().left;if(e.target?.closest&&e.target.closest(".empty-space")||e.target.classList.contains("track-item")||e.target.classList.contains("empty")||""==e.target.classList)return;let a=e.currentTarget;var l=e.currentTarget.getElementsByClassName("track-item"),c=e.clientX+this.timelineA.nativeElement.scrollLeft-s;let u,h,d=this._getChildRects(l);for(var f=0;f<d.length-1;f++)if(u=d[f],h=d[f+1],c>=u.right&&c<=h.left)return void this.addEmpltyMarker(u.elem.offsetLeft+u.elem.clientWidth,h.elem.offsetLeft,a,r)}_getChildRects(e){let s,a,r=[{right:0,left:-1,width:0,elem:{offsetLeft:0,clientWidth:0}}];for(var l=0;l<e.length;l++)s=e[l],a=s.getBoundingClientRect(),r.push({left:parseFloat(s.style.left),right:parseFloat(s.style.left)+a.width,width:a.width,elem:s});return r.sort((c,d)=>c.left>d.left?1:-1),r}removeEmptySpace(e){let r=e.currentTarget.parentElement;if(r){let s=r.dataset.trackid;if(s){let a=this.timeline.tracks.find(l=>l.id===s);a&&(this.hideRefElem(),a.deleteEmptySpace(r.offsetLeft/this.pixelPerTime),this.hideEmptySpace())}}}addEmpltyMarker(e,r,s,a){let l=this.emptySpace.nativeElement;this.renderer.appendChild(s,l),this.renderer.setStyle(l,"left",e+"px"),this.renderer.setStyle(l,"width",r-e+"px"),this.renderer.setStyle(l,"display","flex"),this.renderer.setAttribute(l,"data-trackid",a.id)}hideEmptySpace(){"none"!==this.emptySpace.nativeElement.style.display&&(this.renderer.setStyle(this.emptySpace.nativeElement,"display","none"),this.renderer.appendChild(this.timelineA.nativeElement,this.emptySpace.nativeElement))}hideRefElem(){this.tracksArea&&(this.renderer.appendChild(this.tracksArea.nativeElement,this.refElem.nativeElement),this.renderer.setStyle(this.refElem.nativeElement,"display","none")),this.snapping.height=0,this.seekElem&&this.seekElem.el&&this.renderer.removeClass(this.seekElem.el.nativeElement,"aligned")}_getOverlappedTrackItem(e,r){let s;for(let a=0;a<e.trackItems.length;a++)s=e.trackItems[a],s.startTime<r&&s.changeStartTime(r)}setTrackWidth(){}_checkAndRemoveBlankTrack(e){for(let r=0;r<this.timeline.tracks.length;r++)0===this.timeline.tracks[r].trackItems.length&&this.timeline.tracks.splice(r,1)}_shiftTrackItem(e,r,s){this.timeline.tracks.splice(r,1),this.timeline.tracks[s].trackItems.push(e)}clickRuler(e){var r=this;return(0,ot.A)(function*(){r.isVideoPlay&&(yield r.pause()),r.seekMove(e.offsetX)&&r.seekElem.changeLeftPos(e.offsetX)})()}seekMove(e,r=!1){let a=Math.floor(e/this.pixelPerTime);return a>this.timeline.duration?(this.seekElem&&this.seekElem.changeLeftPos(this.timeline.duration*this.pixelPerTime),this.currentTime=this.timeline.duration,!1):(this.currentTime=a,this.timeline.seekToTime(this.currentTime,r),!0)}changeCurrentTime(e){return e>this.timeline.duration?(this.seekElem&&this.seekElem.changeLeftPos(this.timeline.duration*this.pixelPerTime),this.currentTime=this.timeline.duration,this.timeline.seekToTime(this.currentTime,!1),!1):(this.currentTime=e,this.timeline.seekToTime(this.currentTime,!1),!0)}updateTrackType(e){e.trackItems.forEach(r=>{e.type="video"===r.trackItemType?At.VIDEO:At.NONVIDEO})}splitTrackItem(){this.activeObject&&this.timeline.splitTrackItem(this.activeObject,this.sceneController).then(()=>{})}seekStop(e){this.timeline.seekToTime(this.currentTime,!1)}moveTo(e,r,s){this.renderer.setStyle(e,"top","0px")}updateRuler(){if(this.timeline){this.duration=this.timeline.duration;let e=this.duration*this.pixelPerTime,r=this.width,s=e>r?e:r,a=r/this.pixelPerTime,l=this.duration>a?this.duration:a;this.timeRuler.attr("viewBox",[0,1,s,21]).attr("width",s),this._drawScale(this.timeRuler,s,l)}}_drawScale(e,r,s){let l=this.duration;this.duration*this.pixelPerTime+1<this.width&&(l=this.width/this.pixelPerTime),this.duration<=0&&(l=6e4,this.setZoomBoundary(null,!1)),this._createScale(e,{zoomRange:[0,l],height:this.height,width:this.width,min:0,max:l})}onStartRecording(e){this.targetTrack=e.currentTarget}_createScale(e,{zoomRange:r,height:s,width:a,margin:{top:l=0,bottom:c=0}={}}){(a=this.duration*this.pixelPerTime)<this.width&&(a=this.width);let h=Math.floor(a/this.pixelPerTick);h<2&&(h=2),Jr("%M:%S");const b=function Vs(t){return Xe(3,t)}(jr().domain(r).range([0,a])).ticks(2*h).tickFormat((C,y)=>{if(y%2!=0)return"";let x;if(C||0===C){x=Math.floor(100*C/1e3)/100;const E=Math.floor(x/60),N=Math.floor(E/60);if(N){let I,A=(E-60*N).toString(),P=N.toString();return I=1==A.toString().length?"0"+A.toString():A,1==P.toString().length&&(P="0"+P.toString()),1==A.toString().length&&(A="0"+A.toString()),P+":"+A+":"+I}if(E){let I,A=x-60*E;return I=1==A.toString().length?"0"+A.toString():Math.round(100*A)/100,E+":"+I}{let I,A=x-60*E;return I=1==A.toString().length?"0"+A.toString():Math.round(100*A)/100,"00:"
1+I}}return""}).tickSizeInner(s-l-c).tickSizeOuter(0);e.selectAll("g.scale").remove();const v=e.append("g").attr("transform",`translate(0,${l})`).attr("class","scale").lower().append("g").attr("class","axis");return b(v),v.selectAll(".tick").style("color","#E2E3E9").style("stroke-width",2).filter((C,y)=>y%2!=0).selectAll("line").attr("y2",8),v.selectAll(".axis text").attr("y",16).style("transform","translate(3.5ch, -1em)").style("font-size","11px").style("color","#4A4F5E").style("font-family","'Inter'").style("font-weight","'600'").style("user-select","none"),e}getTransformFromZoomRange(e){const[r,s]=e,a=this.width/(s-r);return Qr.translate(-r*a,0).scale(a)}updateZoom(e){}play(){this.duration&&!this.isVideoPlay&&(this.isVideoPlay=!0,this.videoPlayProgress=!0,this.timeline.currentTime===this.timeline.duration&&(this.currentTime=0,this.timeline.seekToTime(this.currentTime,!1)),this.playing.emit(!0),this.timeline.play(e=>{this.pause(),this.originalA.nativeElement.scrollLeft=0}).then(()=>{this.changeEditMode.emit({isEdit:1,isPlay:1,isReplace:0,selectTab:null}),this.videoPlayProgress=!1}))}pause(){var e=this;return(0,ot.A)(function*(){e.currentTime=e.timeline.currentTime,e.duration&&e.isVideoPlay&&!e.videoPlayProgress&&(e.playing.emit(!1),yield e.timeline.pause(),e.changeEditMode.emit({isEdit:0,isPlay:0,isReplace:0,selectTab:null}),e.isVideoPlay=!1)})()}activeVideoTool(e,r){e&&e instanceof Qt&&e.trackItemType?e.attachedObject.activeThisOnCanvas():this.sceneController.selectAudio(e.attachedObject)}replace(){this.changeEditMode.emit("audio"===this.contextTrackItem.trackItemType?{isEdit:0,isPlay:0,isReplace:1,selectTab:"music"}:{isEdit:0,isPlay:0,isReplace:1,selectTab:null})}detachAudio(){let e=this.contextTrackItem,r=e.attachedObject.designItem.box,s=r.imgArray[0];if(s.detachedAudio&&0==s.volumeFactor||e.attachedObject._audioError)return void(this.contextTrackItem._showDetachedAudio=0);var a;let d=16e3,u=1;this.toast.show("Detaching audio"),a=new(window.AudioContext||window.webkitAudioContext),new FileReader;let f=e.attachedObject.videoRepository.map.get(r.imgArray[0].imgName);f&&f.arrayBuffer().then(m=>{var T=m;try{a.decodeAudioData(T).then(b=>{d=b.sampleRate?b.sampleRate:d,u=b.numberOfChannels?b.numberOfChannels:u;var v=new OfflineAudioContext(u,d*b.duration,d),C=v.createBufferSource();C.buffer=b,C.connect(v.destination),C.start(),v.startRendering().then(y=>{var w=this.audioBufferToWav(y,{}),x=new window.Blob([new DataView(w)],{type:"audio/wav"});let E=r.imgArray[0],N=E.trimEnd;e.attachedObject&&e.attachedObject.animationMapArr&&e.attachedObject.animationMapArr.length>1&&(N=E.trimStart+e.duration);var A=window.URL.createObjectURL(x);this.audioService.addAudio(0,A,"wav","Untitled ",this.sceneController,null,{startTime:e.startTime,trimStart:E.trimStart,trimEnd:N,isDetach:!0}).then(P=>{this.sceneController.selectedAudioObject=P,e.attachedObject.setDetachedAudio(1),e.attachedObject.changeVolume(0,!1),this.sceneController.setDirty(!1),setTimeout(()=>{this.activeObject=P,this.activeTrackItem=this.selectTrackItem({currentValue:P}),this.sceneController.selectAudio(P)},0),this.toast.removeAll(),this.toast.showSuccess("Audio has been detached")})}).catch(y=>{e.attachedObject._audioError=1,this.toast.showError("Error in detaching audio"),console.log(y)})}).catch(b=>{e.attachedObject._audioError=1,this.toast.showError("Error in detaching audio"),console.log(b)})}catch{e.attachedObject._audioError=1,this.toast.showError("Error in detaching audio")}})}audioBufferToWav(e,r){var d,s=e.numberOfChannels,a=e.sampleRate,l=(r=r||{}).float32?3:1,c=3===l?32:16;return d=2===s?this.interleave(e.getChannelData(0),e.getChannelData(1)):e.getChannelData(0),this.encodeWAV(d,l,a,s,c)}encodeWAV(e,r,s,a,l){var c=l/8,d=a*c,u=new ArrayBuffer(44+e.length*c),h=new DataView(u);return this.writeString(h,0,"RIFF"),h.setUint32(4,36+e.length*c,!0),this.writeString(h,8,"WAVE"),this.writeString(h,12,"fmt "),h.setUint32(16,16,!0),h.setUint16(20,r,!0),h.setUint16(22,a,!0),h.setUint32(24,s,!0),h.setUint32(28,s*d,!0),h.setUint16(32,d,!0),h.setUint16(34,l,!0),this.writeString(h,36,"data"),h.setUint32(40,e.length*c,!0),1===r?this.floatTo16BitPCM(h,44,e):this.writeFloat32(h,44,e),u}interleave(e,r){for(var s=e.length+r.length,a=new Float32Array(s),l=0,c=0;l<s;)a[l++]=e[c],a[l++]=r[c],c++;return a}writeFloat32(e,r,s){for(var a=0;a<s.length;a++,r+=4)e.setFloat32(r,s[a],!0)}floatTo16BitPCM(e,r,s){for(var a=0;a<s.length;a++,r+=2){var l=Math.max(-1,Math.min(1,s[a]));e.setInt16(r,l<0?32768*l:32767*l,!0)}}writeString(e,r,s){for(var a=0;a<s.length;
1a++)e.setUint8(r+a,s.charCodeAt(a))}duplicate(){const e=this.contextTrackItem;e&&this.timeline.addDuplicateTrackItem(e,this.activeObject)}delete(){if(this.contextTrackItem||this.activeObject){const r=this.sceneController.selectedAudioObject;this.timeline.deleteTrackItem(this.activeObject),this.updateRuler(),this.hideRefElem(),r&&this.changeEditMode.emit({isEdit:0,isPlay:0,isReplace:1,selectTab:"music"})}}addMusic(){this.changeEditMode.emit({isEdit:0,isPlay:0,isReplace:1,selectTab:"music"})}addMedia(){this.changeEditMode.emit({isEdit:0,isPlay:0,isReplace:1,selectTab:"media",extras:{uploadType:"upload"}}),this.editorUiService.uploadModal("video/mp4,image/*",6,!!this.sceneController.getSelectedScene().selectedDesignItem)}showzoomDiv(){this.zoomInner=!0}showMenu(e,r){if(event.preventDefault(),this.activeVideoTool(r,e),this.contextTrackItem=r,r&&"video"===r.trackItemType){let a=r.attachedObject.designItem.box.imgArray[0];typeof a.detachedAudio>"u"||0!==a.volumeFactor?(this.contextTrackItem._showDetachedAudio=1,r.attachedObject._audioError&&(this.contextTrackItem._showDetachedAudio=0)):this.contextTrackItem._showDetachedAudio=0}this.renderer.removeAttribute(this.contextMenu.nativeElement,"hidden"),this.setPositionMenu(!1,e,this.contextMenu.nativeElement)}hideMenu(e){e.target.classList.contains("track-context-menu")||(this.contextTrackItem=null,this.renderer.setAttribute(this.contextMenu.nativeElement,"hidden","true"))}setPositionMenu(e,r,s){e?(s.style.left=r.target.offsetLeft+s.offsetWidth>=window.innerWidth?r.target.offsetLeft-s.offsetWidth+r.target.offsetWidth+"px":r.target.offsetLeft+"px",s.style.top=r.target.offsetTop+s.offsetHeight>=window.innerHeight?r.target.offsetTop-s.offsetHeight+"px":r.target.offsetHeight+r.target.offsetTop+"px"):(s.style.left=r.clientX+s.offsetWidth>=window.innerWidth?r.clientX-s.offsetWidth+"px":r.clientX+"px",s.style.top=r.clientY+s.offsetHeight>=window.innerHeight?r.clientY-s.offsetHeight+"px":r.clientY+"px")}toggleMute(e){e&&e.preventDefault(),this.timeline.mute=!this.timeline.mute,this.timeline.audioObjects&&this.timeline.audioObjects.forEach(r=>{r.toggleVolume(this.timeline.mute?0:1)}),this.timeline.tracks&&this.timeline.tracks.length>0&&this.timeline.toggleMediaVolume()}showGrid(){this.gridActive=!this.gridActive,this.changeShowGrid.emit(this.gridActive)}parseNumber(e){return e}handleKeyboardEventUp(e){if("BODY"===(e.target||e.srcElement).tagName)switch(e.code){case"Backspace":case"Delete":this.delete(),this.isVideoPlay&&this.pause();break;case"Space":this.isVideoPlay?this.pause():this.play()}}handleKeyboardEventDown(e){if("BODY"!==(e.target||e.srcElement).tagName)return;let s=e.key.toLowerCase();(e.metaKey||e.ctrlKey)&&"d"===s?(this.activeObject&&this.timeline.addDuplicateTrackItem(null,this.activeObject),this.isVideoPlay&&this.pause(),e.preventDefault()):e.shiftKey&&"m"===s?(this.toggleMute(null),e.preventDefault()):e.metaKey&&e.shiftKey&&"z"===s?(this.redoable&&this.redo.emit(),e.preventDefault()):(e.metaKey||e.ctrlKey)&&"z"===s?(this.undoable&&this.undo.emit(),e.preventDefault()):e.ctrlKey&&"y"===s?(this.redoable&&this.redo.emit(),e.preventDefault()):e.shiftKey&&"+"===s?(this.zoomIn(),e.preventDefault()):!e.shiftKey||189!==e.keyCode&&109!==e.keyCode?(e.shiftKey&&48===e.keyCode||!e.shiftKey&&"Insert"===e.key&&45===e.keyCode)&&(this.changePixelPerTime(null,!0),e.preventDefault()):(this.zoomOut(),e.preventDefault())}ngOnDestroy(){}onPopState(e){this.isVideoPlay&&this.pause()}get undoable(){return!this.templateService.undoRedoInprogress&&this.sceneController&&this.sceneController.getHistoryPointer()>0}get redoable(){return!this.templateService.undoRedoInprogress&&this.sceneController&&this.sceneController.getHistory().length-1>this.sceneController.getHistoryPointer()}onKeyDown(e){("Enter"===e.key||"Space"!==e.key)&&(e.preventDefault(),this.isVideoPlay?this.pause():this.play())}clickUndo(){this.undo.emit()}clickRedo(){this.redo.emit()}}return(t=n).\u0275fac=function(e){return new(e||t)(i.rXU(i.SKi),i.rXU(i.sFG),i.rXU(Fe.M),i.rXU(Oi.I),i.rXU(Ot._),i.rXU(Le.f),i.rXU(ch.f))},t.\u0275cmp=i.VBU({type:t,selectors:[["ve-timeline"]],viewQuery:function(e,r){if(1&e&&(i.GBs(Oh,7),i.GBs(Sh,7),i.GBs(Ah,5),i.GBs(jh,5),i.GBs(Dh,5),i.GBs(Rh,5),i.GBs(Vh,7),i.GBs(Nh,5),i.GBs(Uh,5),i.GBs(Gh,7)),2&e){let s;i.mGM(s=i.lsd())&&(r.originalA=s.first),i.mGM(s=i.lsd())&&(r.timelineA=s.first),i.mGM(s=i.lsd())&&(r.tracksArea=s.first),i.mGM(s=i.lsd())&&(r.emptySpace=s.first),i.mGM(s=i.lsd())&&(r.refElem=s.first),i.mGM(s=i.lsd())&&(r.seekElem=s.first),i.mGM(s=i.lsd())&&(r.contextMenu=s.first),i.mGM(s=i.lsd())&&(r.musicTrack=s.first),i.mGM(s=i.lsd())&&(r.lastBlankTrack=s.first),i.mGM(s=i.lsd())&&(r.timelineWrapper=s.first)}},hostBindings:function(e,r){1&e&&i.bIt("scroll",function(a){return r.onDivScroll(a)})("click",function(a){return r.hideMenu(a)},!1,i.EBC)("keyup",function(a){return r.handleKeyboardEventUp(a)},!1,i.tSv)("keydown",function(a){return r.handleKeyboardEventDown(a)},!1,i.tSv)("popstate",function(a){return r.onPopState(a)},!1,i.tSv)},inputs:{init:"init",sceneController:"sceneController",timeline:"timeline",activeObject:"activeObject"},outputs:{changeEditMode:"changeEditMode",changeShowGrid:"changeShowGrid",playing:"playing",undo:"undo",redo:"redo"},features:[i.OA$],decls:79,vars:40,consts:[["timelineWrapper",""],["originalA",""],["t
1imelineA",""],["designItemBounds",""],["contextMenu",""],["seek",""],["tracksArea",""],["musicTrack",""],["emptySpace",""],["refElem",""],["lastBlankTrack",""],["ngbDropdown","",1,"d-flex","flex-column","canvas-action-right","v-action-editor",3,"openChange"],["ngbDropdownMenu","","aria-labelledby","dropdownBasic1",1,"zoom-inner","me-2"],[1,"d-flex","align-items-center","p-1","h-48"],[1,"master-slider","d-flex","align-items-center"],["placement","top","ngbTooltip","Zoom Out","tooltipClass","tooltip-custom-all",1,"btn-blank","hw-40","mr-9",3,"click","keydown"],["name","zoomoutnew",1,"f-24"],[1,"range-slide"],[1,"opacity-slider",2,"width","100%",3,"valueChange","change","slideStop","value","min","max","step"],["placement","top","ngbTooltip","Zoom In","tooltipClass","tooltip-custom-all",1,"btn-blank","hw-40","ml-9",3,"keydown","click"],["name","zoominnew",1,"f-24"],["placement","top","ngbTooltip","Fit to timeline","tooltipClass","tooltip-custom-all",1,"btn-blank","hw-40","ms-2",3,"click","keydown"],["name","fillfit",1,"f-24"],[1,"canvas-action-btn","me-2"],["placement","top","ngbTooltip","Undo","tooltipClass","tooltip-custom-all",1,"btn-blank","hw-40","me-1",3,"keydown","click","ngClass"],["name","undo",1,"f-24"],["placement","top","ngbTooltip","Redo","tooltipClass","tooltip-custom-all",1,"btn-blank","hw-40","ms-1",3,"keydown","click","ngClass"],["name","redo",1,"f-24"],[1,"btn-blank","hw-40",3,"keydown","click","ngClass"],["class","hw-40 d-flex align-items-center justify-content-center","placement","top","ngbTooltip","Show Grid","tooltipClass","tooltip-custom-all",4,"ngIf"],["class","hw-40 d-flex align-items-center justify-content-center","placement","top","ngbTooltip","Hide Grid","tooltipClass","tooltip-custom-all",4,"ngIf"],[1,"canvas-action-btn","bg-hide"],[1,"d-flex","align-items-center","justify-content-center","hw-40"],["id","dropdownBasic1","ngbDropdownToggle","",1,"btn-blank","hw-40",3,"ngClass"],["name","zoominout",1,"f-24"],["placement","top","ngbTooltip","Close","tooltipClass","tooltip-custom-all",1,"btn-blank","close",2,"display","none"],["name","offerclose",1,"f-24"],[1,"timeline-wrapper",2,"overflow","hidden","min-height","186px"],[1,"timeline-base","h-100"],[1,"v-editor-section","d-flex","justify-content-start","h-100"],[1,"v-editor-left","d-flex","align-items-center","justify-content-center"],["id","btn-mute","class","btn-all icon mutebtn p-0 position-relative mb-1","style","z-index: 99;",3,"ngClass","keydown",4,"ngIf"],["placement","top","ngbTooltip","Play","tooltipClass","tooltip-custom-all","class","btn icon mutebtn p-0 mt-9 btn-play-pause",3,"ngClass","click",4,"ngIf"],["placement","top","ngbTooltip","Play","class","btn icon mutebtn p-0 mt-9 btn-play-pause",3,"ngClass",4,"ngIf"],["placement","top","ngbTooltip","Pause","tooltipClass","tooltip-custom-all","class","btn p-0 btn-icon btn-play-pause mt-9",4,"ngIf"],[1,"text-semi","text-center","mt-9"],[3,"totalTime","currentTime","seekMove",4,"ngIf"],[1,"text-regular","w-100"],[1,"ve","v-editor-right"],[1,"timeline-area","position-relative",3,"scroll"],[2,"width","100%","position","absolute","height","0"],[1,"timeline-scroll"],["id","timelineGrid","role","grid",1,"grid-role",3,"click"],[1,"ruler-guide"],["id","ruler",3,"click"],[1,"disabled-ruler"],["class","seekbar-wrapper","style","height:185px;left:0;","ve-seekbar","",3,"currentTime","left","seekMove","seekStop",4,"ngIf"],["data-testid","snapping-guide",1,"snapping-guide"],[1,"timelineA"],[1,"designItemBounds"],[4,"ngIf"],["hidden","",1,"track-context-menu","nav-small-device","dropdown-menu","show","position-fixed"],[3,"click"],["name","replace",1,"me-2","f-20","replace"],[3,"ngClass","click",4,"ngIf"],["name","duplicateother",1,"me-2","f-20"],["name","deleteoth",1,"me-2","f-20"],["placement","top","ngbTooltip","Show Grid","tooltipClass","tooltip-custom-all",1,"hw-40","d-flex","align-items-center","justify-content-center"],["name","gridiconnew",1,"f-24",2,"color","#272B34"],["placement","top","ngbTooltip","Hide Grid","tooltipClass","tooltip-custom-all",1,"hw-40","d-flex","align-items-center","justify-content-center"],["name","gridiconnew",1,"f-24",2,"color","#626ADF !important"],["id","btn-mute",1,"btn-all","icon","mutebtn","p-0","position-relative","mb-1",2,"z-index","99",3,"keydown","ngClass"],["
1id","unmute","name","unmute","placement","right","ngbTooltip","Mute","tooltipClass","tooltip-custom-all","class","f-24",3,"click",4,"ngIf"],["id","mute","name","mute","placement","right","ngbTooltip","Unmute","tooltipClass","tooltip-custom-all","class","f-24",3,"ngClass","click",4,"ngIf"],["id","unmute","name","unmute","placement","right","ngbTooltip","Mute","tooltipClass","tooltip-custom-all",1,"f-24",3,"click"],["id","mute","name","mute","placement","right","ngbTooltip","Unmute","tooltipClass","tooltip-custom-all",1,"f-24",3,"click","ngClass"],["placement","top","ngbTooltip","Play","tooltipClass","tooltip-custom-all",1,"btn","icon","mutebtn","p-0","mt-9","btn-play-pause",3,"click","ngClass"],["name","playnew",1,"f-20"],["placement","top","ngbTooltip","Play",1,"btn","icon","mutebtn","p-0","mt-9","btn-play-pause",3,"ngClass"],["class","spinner-border spinner-border-lg text-white hw-24","style","border-width: 0.15rem;","role","status",4,"ngIf"],["role","status",1,"spinner-border","spinner-border-lg","text-white","hw-24",2,"border-width","0.15rem"],[1,"sr-only","text-nowrap","border-0","position-absolute","overflow-hidden"],["placement","top","ngbTooltip","Pause","tooltipClass","tooltip-custom-all",1,"btn","p-0","btn-icon","btn-play-pause","mt-9"],["name","pausenew",1,"f-20"],[3,"seekMove","totalTime","currentTime"],["ve-seekbar","",1,"seekbar-wrapper",2,"height","185px","left","0",3,"seekMove","seekStop","currentTime"],[1,"add-audio-track","d-flex","align-items-center","w-100","text-semi",2,"height","54px","margin-top","-95px",3,"click"],["name","addnew",1,"me-2","f-20"],["id","tracks-area",1,"tracks-area",2,"align-self","end"],[4,"ngFor","ngForOf"],["data-tracktype","music",1,"track-music-wrapper","d-flex","type-2",3,"mousedown"],["class","add-audio-track d-flex align-items-center w-100 text-semi",3,"click",4,"ngIf"],["placement","top","ngbTooltip","Remove Empty",1,"empty-space","empty",2,"min-height","24px","display","none","overflow","hidden",3,"mouseleave"],[1,"empty-inner",3,"click"],[1,"ref-elem",2,"min-height","24px","display","none"],["data-role","track","data-type","new",1,"blank-track"],["data-role","track",1,"inner"],["data-role","track",3,"mouseover","mousedown"],["class","blank-track","data-type","new",4,"ngIf"],["ve-trackitem2","","data-cat","elem",1,"track-item","design-item",2,"width","100px",3,"movingOffset","endOffset","changeIsResizing","movingResize","endResizing","autoScroll","splitTrackItem","contextmenu","endMouseDown","id","duration","trackItem","bounds","pixelPerTime","currentTime","displayedWidth","isSelected","isVideoPlay","ngClass"],["data-type","new",1,"blank-track"],[1,"inner"],[1,"add-audio-track","d-flex","align-items-center","w-100","text-semi",3,"click"],[3,"click","ngClass"],["name","detech",1,"me-2","f-20","replace"]],template:function(e,r){if(1&e){const s=i.RV6();i.j41(0,"div",11),i.bIt("openChange",function(l){return i.eBV(s),i.Njj(r.zoomOpen(l))}),i.j41(1,"div",12)(2,"div",13)(3,"div",14)(4,"button",15),i.bIt("click",function(){return i.eBV(s),i.Njj(r.zoomOut())})("keydown",function(l){return i.eBV(s),i.Njj(r.onKeyDown(l))}),i.nrm(5,"pi",16),i.k0s(),i.j41(6,"div",17)(7,"mv-slider",18),i.mxI("valueChange",function(l){return i.eBV(s),i.DH7(r.zoomVal,l)||(r.zoomVal=l),i.Njj(l)}),i.bIt("change",function(l){return i.eBV(s),i.Njj(r.changePixelPerTime(l,!1,!1))})("slideStop",function(l){return i.eBV(s),i.Njj(r.changePixelPerTime(l,!1,!0))}),i.k0s()(),i.j41(8,"button",19),i.bIt("keydown",function(l){return i.eBV(s),i.Njj(r.onKeyDown(l))})("click",function(){return i.eBV(s),i.Njj(r.zoomIn())}),i.nrm(9,"pi",20),i.k0s()(),i.j41(10,"button",21),i.bIt("click",function(l){return i.eBV(s),i.Njj(r.changePixelPerTime(l,!0))})("keydown",function(l){return i.eBV(s),i.Njj(r.onKeyDown(l))}),i.nrm(11,"pi",22),i.k0s()()(),i.j41(12,"div",23)(13,"ul")(14,"li")(15,"button",24),i.bIt("keydown",function(l){return i.eBV(s),i.Njj(r.onKeyDown(l))})("click",function(){return i.eBV(s),i.Njj(r.clickUndo())}),i.nrm(16,"pi",25),i.k0s(),i.j41(17,"button",26),i.bIt("keydown",function(l){return i.eBV(s),i.Njj(r.onKeyDown(l))})("click",function(){return i.eBV(s),i.Njj(r.clickRedo())}),i.nrm(18,"pi",27),i.k0s()()()(),i.j41(19,"div",23)(20,"ul")(21,"li")(22,"button",28),i.bIt("keydown",function(l){return i.eBV(s),i.Njj(r.onKeyDown(l))})("click",function(){return i.eBV(s),i.Njj(r.showGrid())}),i.DNE(23,zh,2,0,"div",29)(24,Yh,2,0,"div",30),i.k0s()()()(),i.j41(25,"div",31)(26,"ul")(27,"li",32)(28,"button",33),i.nrm(29,"ei",34),i.k0s(),i.j41(30,"button",35),i.nrm(31,"pi",36),i.k0s()()()()(),i.j41(32,"div",37,0)(34,"div",38)(35,"div",39)(36,"div",40),i.DNE(37,$h,3,5,"button",41)(38,Wh,2,3,"button",42)(39,Zh,2,4,"button",43)(40,Jh,2,0,"button",44),i.j41(4
11,"p",45),i.DNE(42,Qh,1,2,"duration-control",46),i.j41(43,"span",47),i.EFF(44),i.nI1(45,"msve"),i.k0s()()(),i.j41(46,"div",48)(47,"div",49,1),i.bIt("scroll",function(l){return i.eBV(s),i.Njj(r.onDivScroll(l))}),i.nrm(49,"div",50),i.j41(50,"div",51)(51,"div",52),i.bIt("click",function(l){return i.eBV(s),i.Njj(r.clickTimeline(l))}),i.j41(52,"div",53)(53,"div",54),i.bIt("click",function(l){return i.eBV(s),i.Njj(r.clickRuler(l))}),i.nrm(54,"div",55),i.k0s(),i.DNE(55,qh,2,3,"div",56),i.k0s(),i.nrm(56,"div",57),i.j41(57,"div",58,2)(59,"div",59,3),i.DNE(61,tm,4,0,"ng-container",60)(62,om,13,3,"ng-container",60),i.k0s()()()()()()(),i.j41(63,"div",61,4)(65,"ul")(66,"li",62),i.bIt("click",function(){return i.eBV(s),i.Njj(r.replace())}),i.j41(67,"a"),i.nrm(68,"pi",63),i.EFF(69,"Replace "),i.k0s()(),i.DNE(70,sm,4,3,"li",64),i.j41(71,"li",62),i.bIt("click",function(){return i.eBV(s),i.Njj(r.duplicate())}),i.j41(72,"a"),i.nrm(73,"pi",65),i.EFF(74,"Duplicate "),i.k0s()(),i.j41(75,"li",62),i.bIt("click",function(){return i.eBV(s),i.Njj(r.delete())}),i.j41(76,"a"),i.nrm(77,"pi",66),i.EFF(78,"Delete "),i.k0s()()()()()()}2&e&&(i.R7$(7),i.R50("value",r.zoomVal),i.Y8G("min",1)("max",100)("step",1),i.R7$(8),i.Y8G("ngClass",i.eq3(32,eo,!r.undoable)),i.R7$(2),i.Y8G("ngClass",i.eq3(34,eo,!r.redoable)),i.R7$(5),i.Y8G("ngClass",i.eq3(36,io,r.timeline&&0===r.timeline.tracks.length&&!(null!=r.timeline&&r.timeline.audioObject))),i.R7$(),i.Y8G("ngIf",!r.gridActive),i.R7$(),i.Y8G("ngIf",r.gridActive&&!r.isVideoPlay),i.R7$(4),i.Y8G("ngClass",i.eq3(38,io,r.timeline&&0===r.timeline.tracks.length&&!(null!=r.timeline&&r.timeline.audioObjects&&(null==r.timeline?null:r.timeline.audioObjects.length)>0))),i.R7$(9),i.Y8G("ngIf",r.timeline),i.R7$(),i.Y8G("ngIf",!r.isVideoPlay),i.R7$(),i.Y8G("ngIf",r.videoPlayProgress),i.R7$(),i.Y8G("ngIf",!r.videoPlayProgress&&r.isVideoPlay),i.R7$(2),i.Y8G("ngIf",r.timeline),i.R7$(2),i.SpI(" ",i.bMT(45,30,r.timeline&&r.timeline.duration)," "),i.R7$(10),i.xc7("left",r.duration*r.pixelPerTime,"px"),i.R7$(),i.Y8G("ngIf",r.timeline&&r.timeline.tracks.length||r.timeline.audioObjects&&r.timeline.audioObjects.length>0),i.R7$(),i.xc7("left",r.snapping.left,"px")("top",r.snapping.top,"px")("height",r.snapping.height,"px")("border-width",r.snapping.height?1:0,"px"),i.R7$(5),i.Y8G("ngIf",r.timeline&&0===r.timeline.tracks.length&&!(r.timeline.audioObjects&&r.timeline.audioObjects.length>0)),i.R7$(),i.Y8G("ngIf",r.timeline&&r.timeline.tracks.length>0||r.timeline&&r.timeline.audioObjects&&r.timeline.audioObjects.length>0),i.R7$(8),i.Y8G("ngIf",r.contextTrackItem&&"video"===r.contextTrackItem.trackItemType))},dependencies:[Y.YU,Y.Sq,Y.bT,et.tg,et.do,et.U0,et.md,Z.d1,qt.b,Si.KK,Mh,Ph,to,dn.gn],styles:['.timeline-wrapper[_ngcontent-%COMP%]{width:100%;overflow-x:auto;-webkit-user-select:none;-o-user-select:none;user-select:none}.thumb-scene[_ngcontent-%COMP%]{width:300px;border:2px solid #626ADF;border-radius:12px;background-size:contain;background-repeat:no-repeat;background-position:center}.thumb-scene[_ngcontent-%COMP%] .move-scene-svg[_ngcontent-%COMP%]{visibility:visible}.thumb-scene.sm[_ngcontent-%COMP%] .move-scene-svg[_ngcontent-%COMP%]{visibility:hidden}.thumb-scene.sm[_ngcontent-%COMP%] .scene-action-btn-container[_ngcontent-%COMP%]{right:calc(50% - 16px)}.scene-area-wrapper[_ngcontent-%COMP%]{height:28px;width:100%;display:flex;align-items:center;border-radius:6px}.scene-area[_ngcontent-%COMP%]{height:100%;width:100%;background:#e2e3e9 0% 0% no-repeat padding-box;border-radius:6px}.timeline-base[_ngcontent-%COMP%]{width:100%}.timeline-base[_ngcontent-%COMP%] .nav-small-device[_ngcontent-%COMP%]{margin:0;padding:8px;height:auto!important;border:0px}.timeline-base[_ngcontent-%COMP%] .nav-small-device[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{padding:6px 8px}.timeline-base[_ngcontent-%COMP%] .nav-small-device[_ngcontent-%COMP%] a[_ngcontent-%COMP%] pi[_ngcontent-%COMP%]{color:#272b34}.timeline-header[_ngcontent-%COMP%]{height:28px;width:100%;background:#f8f8fb 0% 0% no-repeat padding-box;border:1px solid #707070;display:flex;align-items:center}.timeline-container[_ngcontent-%COMP%]{width:100%;display:flex}.thumbline[_ngcontent-%COMP%]{height:100%;display:inline-flex}.musicline[_ngcontent-%COMP%]{height:100%;width:100%;background:#fff 0% 0% no-repeat padding-box;border-radius:8px}.music-top[_ngcontent-%COMP%]{height:2.5rem;width:100%}.music-bottom[_ngcontent-%COMP%] .drag-boundary[_ngcontent-%COMP%]{width:100%;height:80%;position:relative;overflow:hidden}.music-bottom[_ngcontent-%COMP%] .trim-info[_ngcontent-%COMP%]{height:1.5rem;width:50px;position:relative}.music-bottom[_ngcontent-%COMP%] .audio-item[_ngcontent-%COMP%]{width:100%;background:url(https://static.lightxeditor.com/assets/images/waveform.png);background-repeat:no-repeat;background-repeat:repeat-x;opacity:.7;padding:6px 0;background-position-y:center}.music-bottom[_ngcontent-%COMP%] .video-thumb[_ngcontent-%COMP%]{position:absolute;width:500px;top:0;left:40px;height:100%;outline:4px solid #626ADF;transform:translate(0);padding:6px 0}.music-bottom[_ngcontent-%COMP%] .short-audio[_ngcontent-%COMP%]{left:40px;position:absolute}.play-cursor[_ngcontent-%COMP%]{transform:translate(5px);background:#626adf;width:1px;height:100%;position:absolute}.thumbline-wrapper[_ngcontent-%COMP%]{position:relative;margin:0;overflow:hidden;display:block;overflow-x:auto}.thumb-scene[_ngcontent-%COMP%]{flex:0 0 auto;position:relative;will-change:width,transform;transform-origin:0 0;-webkit-backface-visibility:hidden;backface-visibility:hidden;-ms-perspective:1000;perspective:1000;border:2px solid transparent}.timeline-icon[_ngcontent-%COMP%]{height:5.5rem}.scene-wrapper[_ngcontent-%COMP%] .active[_ngcontent-%COMP%]{border:2px solid #626ADF!important}.design-item[_ngcontent-%COMP%]{height:100%;background:#c3a6ff 0% 0% no-repeat padding-box;border-radius:6px;text-align:center;color:#4a4f5e}.design-item.i-video[_ngcontent-%COMP%]{overflow:inherit!important}.design-item.i-video[_ngcontent-%COMP%] .only-video[_ngcontent-%COMP%]{position:absolute;z-index:unset;height:100%;overflow:hidden;width:100%;border-radius:6px;display:flex}.design-item.i-video[_ngcontent-%COMP%] .only-video[_ngcontent-%COMP%] .ng-resizable-handle[_ngcontent-%COMP%]{z-index:1}.scene-index[_ngcontent-%COMP%]{position:absolute;bottom:10px}.scene-index[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{background:#606765;color:#fff;padding:2px 10px;border-radius:8px;font-size:12px;margin-left:10px}.btn-add-scene[_ngcontent-%COMP%]{position:relative;width:60px;height:60px;top:32px;font-size:24px;background:#e2e3e966;border-radius:12px;border:0px!important}.btn-add-scene[_ngcontent-%COMP%]:hover, .btn-add-scene[_ngcontent-%COMP%]:focus, .btn-add-scene[_ngcontent-%COMP%]:active, .btn-add-scene[_ngcontent-%COMP%]:visited{background-color:#e2e3e980!important}.design-item-content[_ngcontent-%COMP%]{text-align:center;padding:3px 14px;display:flex;overflow:hidden}.scene-menu[_ngcontent-%COMP%]{background:#272b34;opacity:.6;border-radius:4px;
1height:16px;width:24px}.scene-menu[_ngcontent-%COMP%]:hover{opacity:1}.scene-action-btn-container[_ngcontent-%COMP%]{position:absolute;right:45px;padding:2px}.btn-scene[_ngcontent-%COMP%]{height:20px;width:20px;border-radius:4px;background-color:#fff;opacity:.6;margin:0 4px;border:none;padding:0 4px;color:#475ae7}.btn-scene[disabled][_ngcontent-%COMP%]{opacity:.6!important;color:#aaa}.btn-scene[_ngcontent-%COMP%]:hover{opacity:1}.scene-action-btn-container[_ngcontent-%COMP%] .trash-scene-icon[_ngcontent-%COMP%], .copy-scene-icon[_ngcontent-%COMP%], .add-scene-icon[_ngcontent-%COMP%]{background-size:12px 14px;background-repeat:no-repeat;background-position:center}.scenes-marker[_ngcontent-%COMP%]{height:10px;left:40px;position:relative;display:flex;align-items:baseline;margin-top:8px;width:fit-content}.scenes-marker[_ngcontent-%COMP%] .scene-line[_ngcontent-%COMP%] .inner[_ngcontent-%COMP%]{background:#9eabff;height:4px;margin:0 2px;border-radius:2px}.scenes-marker[_ngcontent-%COMP%] .scene-line.active[_ngcontent-%COMP%] .inner[_ngcontent-%COMP%]{height:6px;background:#626adf}.di-time[_ngcontent-%COMP%]{line-height:24px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0 8px;font-size:11px}.timeline-scroll[_ngcontent-%COMP%] .thumb-scene[_ngcontent-%COMP%]{background-repeat:repeat-x;border:2px solid #ebeaf9}.move-scene-svg[_ngcontent-%COMP%]{color:#272b34}.move-scene-svg[_ngcontent-%COMP%]:hover{color:#000}.btn-prev-next-hidden[_ngcontent-%COMP%]{visibility:collapse}.img-thumb[_ngcontent-%COMP%]{position:absolute;width:500px;top:0;left:40px;height:100%;transform:translate(0);padding:6px 0}.photo-music[_ngcontent-%COMP%] .timeline-icon[_ngcontent-%COMP%]{height:6rem!important}.photo-music[_ngcontent-%COMP%] .timeline-icon[_ngcontent-%COMP%] .only-music[_ngcontent-%COMP%], .photo-music[_ngcontent-%COMP%] .drag-boundary[_ngcontent-%COMP%]{height:100%!important}.photo-music[_ngcontent-%COMP%] .drag-boundary[_ngcontent-%COMP%] .img-thumb[_ngcontent-%COMP%]{padding:0}.photo-music[_ngcontent-%COMP%] .scene-w[_ngcontent-%COMP%]{width:94%!important}.v-editor-section[_ngcontent-%COMP%]{flex-direction:row}.v-editor-section[_ngcontent-%COMP%] .v-editor-left[_ngcontent-%COMP%]{width:96px;flex-direction:column;padding:25px 28px;min-height:186px}.v-editor-section[_ngcontent-%COMP%] .v-editor-left[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:14px;color:#4a4f5e}.v-editor-section[_ngcontent-%COMP%] .v-editor-left[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;font-size:11px}.v-editor-section[_ngcontent-%COMP%] .v-editor-left[_ngcontent-%COMP%] .btn-play-pause[_ngcontent-%COMP%]{height:40px;width:40px;border:0px;display:flex;align-items:center;justify-content:center;background-color:#626adf;border-radius:50px;min-height:40px;min-width:40px}.v-editor-section[_ngcontent-%COMP%] .v-editor-left[_ngcontent-%COMP%] .btn-play-pause[_ngcontent-%COMP%]:hover, .v-editor-section[_ngcontent-%COMP%] .v-editor-left[_ngcontent-%COMP%] .btn-play-pause[_ngcontent-%COMP%]:focus{background-color:#4d55d2;border:0px}.v-editor-section[_ngcontent-%COMP%] .v-editor-right[_ngcontent-%COMP%]{flex:1 1 0%;display:flex;overflow:hidden;position:relative;width:calc(100% - 96px)}.v-editor-section[_ngcontent-%COMP%] .v-editor-right[_ngcontent-%COMP%] .timeline-area[_ngcontent-%COMP%]{flex:1 1 0%;display:flex;overflow:auto;overscroll-behavior:none;touch-action:pan-x pan-y;visibility:visible;min-height:186px}.v-editor-section[_ngcontent-%COMP%] .v-editor-right[_ngcontent-%COMP%] .timeline-area[_ngcontent-%COMP%] .timeline-scroll[_ngcontent-%COMP%]{position:relative;flex:1 1 0%;display:flex;flex-direction:column;padding-left:7.5px;padding-right:5.5px;padding-bottom:6px}.v-editor-section[_ngcontent-%COMP%] .v-editor-right[_ngcontent-%COMP%] .timeline-area[_ngcontent-%COMP%] .timeline-scroll[_ngcontent-%COMP%] .add-audio-track[_ngcontent-%COMP%]{background:#626adf0d;border:1px solid #E2E3E9;border-radius:8px;padding:4px 8px;font-size:10px;color:#272b34}.v-editor-section[_ngcontent-%COMP%] .v-editor-right[_ngcontent-%COMP%] .timeline-area[_ngcontent-%COMP%] .timeline-scroll[_ngcontent-%COMP%] .add-audio-track[_ngcontent-%COMP%]:hover{background:#626adf1a;border:1px solid transparent}.v-editor-section[_ngcontent-%COMP%] .v-editor-right[_ngcontent-%COMP%] .timeline-area[_ngcontent-%COMP%] .timeline-scroll[_ngcontent-%COMP%] .ruler-guide[_ngcontent-%COMP%]{position:sticky;top:0;z-index:5;background-color:#fff}.v-editor-section[_ngcontent-%COMP%] .v-editor-right[_ngcontent-%COMP%] .timeline-area[_ngcontent-%COMP%] .timeline-scroll[_ngcontent-%COMP%] .ruler-guide[_ngcontent-%COMP%] #ruler[_ngcontent-%COMP%]{position:relative}.v-editor-section[_ngcontent-%COMP%] .v-editor-right[_ngcontent-%COMP%] .timeline-area[_ngcontent-%COMP%] .timeline-scroll[_ngcontent-%COMP%] .presentation[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%}.v-editor-section[_ngcontent-%COMP%] .v-editor-right[_ngcontent-%COMP%] .timeline-area[_ngcontent-%COMP%] .timeline-scroll[_ngcontent-%COMP%] .grid-role[_ngcontent-%COMP%]{flex:1 1 0%;display:flex;flex-direction:column;justify-content:space-between}.v-editor-section[_ngcontent-%COMP%] .v-editor-right[_ngcontent-%COMP%] .timeline-area[_ngcontent-%COMP%] .timeline-scroll[_ngcontent-%COMP%] .grid-role[_ngcontent-%COMP%] .track[_ngcontent-%COMP%]{display:flex;justify-items:flex-start;align-content:center;position:relative;transition:width .2s ease-out 0s;width:100%}.v-editor-section[_ngcontent-%COMP%] .v-editor-right[_ngcontent-%COMP%] .timeline-area[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px;height:6px;border-radius:20px}.v-editor-section[_ngcontent-%COMP%] .v-editor-right[_ngcontent-%COMP%] .timeline-area[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent;border-radius:20px}.v-editor-section[_ngcontent-%COMP%] .v-editor-right[_ngcontent-%COMP%] .timeline-area[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#4a4f5e80;border-radius:20px}.v-editor-section[_ngcontent-%COMP%] .v-editor-right[_ngcontent-%COMP%] .timeline-area[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#4a4f5e80;border-radius:20px}.seekbar-wrapper[_ngcontent-%COMP%]{pointer-events:auto;top:0;height:100%;width:13px;display:flex;justify-content:center;position:absolute;-webkit-user-select:none;user-select:none;z-index:9999;
1left:0;color:#626adf}.tracks-area[_ngcontent-%COMP%] .track[_ngcontent-%COMP%] .track-item[_ngcontent-%COMP%]{display:flex;align-items:center;background-position:8px center;background-repeat:no-repeat}.tracks-area[_ngcontent-%COMP%] .track[_ngcontent-%COMP%] .track-item.i-text[_ngcontent-%COMP%]{background-image:url(https://static.lightxeditor.com/assets/images/ve-tt-text.png);background-size:20px 20px}.tracks-area[_ngcontent-%COMP%] .track[_ngcontent-%COMP%] .track-item.i-animated[_ngcontent-%COMP%]{background-image:url(https://static.lightxeditor.com/assets/images/ve-t-anim.png);background-size:20px 20px}.tracks-area[_ngcontent-%COMP%] .track[_ngcontent-%COMP%] .track-item.i-sticker[_ngcontent-%COMP%], .tracks-area[_ngcontent-%COMP%] .track[_ngcontent-%COMP%] .track-item.i-element[_ngcontent-%COMP%]{background-image:url(https://static.lightxeditor.com/assets/images/ve-t-sticker.png);background-size:20px 20px}.tracks-area[_ngcontent-%COMP%] .track[_ngcontent-%COMP%] .track-item.i-image[_ngcontent-%COMP%]{background-image:url(https://static.lightxeditor.com/assets/images/ve-t-image.png);background-size:20px 20px}.tracks-area[_ngcontent-%COMP%] .track[_ngcontent-%COMP%] .track-item.i-audio[_ngcontent-%COMP%]:after{height:28px;width:100%;content:"";background:url(https://static.lightxeditor.com/assets/images/ve-wavelength.png) center center repeat-x;min-width:3500px}.tracks-area[_ngcontent-%COMP%] .track[_ngcontent-%COMP%] .track-item.i-audioobject[_ngcontent-%COMP%]{position:relative}.tracks-area[_ngcontent-%COMP%] .track[_ngcontent-%COMP%] .track-item.i-audioobject[_ngcontent-%COMP%]:after{position:absolute;height:28px;width:100%;content:"";background:url(https://static.lightxeditor.com/assets/images/ve-wavelength.png) center center repeat-x;min-width:3500px}.tracks-area[_ngcontent-%COMP%] .track[_ngcontent-%COMP%] .active-item.i-text[_ngcontent-%COMP%]{background-image:url(https://static.lightxeditor.com/assets/images/ve-tt-text-hov.png);background-size:20px 20px}.tracks-area[_ngcontent-%COMP%] .track[_ngcontent-%COMP%] .active-item.i-animated[_ngcontent-%COMP%]{background-image:url(https://static.lightxeditor.com/assets/images/ve-t-anim-hov.png);background-size:20px 20px}.tracks-area[_ngcontent-%COMP%] .track[_ngcontent-%COMP%] .active-item.i-sticker[_ngcontent-%COMP%], .tracks-area[_ngcontent-%COMP%] .track[_ngcontent-%COMP%] .active-item.i-element[_ngcontent-%COMP%]{background-image:url(https://static.lightxeditor.com/assets/images/ve-t-sticker-hov.png);background-size:20px 20px}.tracks-area[_ngcontent-%COMP%] .track[_ngcontent-%COMP%] .active-item.i-image[_ngcontent-%COMP%]{background-image:url(https://static.lightxeditor.com/assets/images/ve-t-image-hov.png);background-size:20px 20px}.v-action-editor[_ngcontent-%COMP%]{flex-direction:row!important;height:auto;top:-48px;right:13px;z-index:5}.v-action-editor[_ngcontent-%COMP%] .canvas-action-btn[_ngcontent-%COMP%]{width:auto;background:#fffc;box-shadow:none}.v-action-editor[_ngcontent-%COMP%] .zoom-inner[_ngcontent-%COMP%]{position:absolute!important;z-index:9999;width:auto;border-radius:12px;background:#fff;box-shadow:0 4px 8px #0000000d;transform:none!important;height:auto!important;padding:0!important;inset:auto!important;right:40px!important;top:-4px!important;border:0px}.v-action-editor[_ngcontent-%COMP%] .zoom-inner[_ngcontent-%COMP%] .master-slider[_ngcontent-%COMP%]{background:#626adf0d;border-radius:12px}.v-action-editor[_ngcontent-%COMP%] .zoom-inner[_ngcontent-%COMP%] .master-slider[_ngcontent-%COMP%] .range-slide[_ngcontent-%COMP%]{width:136px}.v-action-editor[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{background:#272b34cc;border-radius:50%;width:32px;height:32px;background-size:contain;padding:0;border:0px;transition:all .3s ease}.v-action-editor[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]:hover{background:#272b34;transition:all .3s ease}.show.dropdown[_ngcontent-%COMP%] .bg-hide[_ngcontent-%COMP%]{background-color:transparent}.show.dropdown[_ngcontent-%COMP%] button.dropdown-toggle[_ngcontent-%COMP%]{display:none}.show.dropdown[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{display:block!important}.disabled-ruler[_ngcontent-%COMP%]{position:absolute;background:url(https://static.lightxeditor.com/assets/svg/disabled-ruler.svg) repeat left top;height:21px;width:-webkit-fill-available;z-index:-1}pi.split-icon[_ngcontent-%COMP%]{position:absolute;width:21px;height:28px;cursor:pointer;z-index:10}.active-grid[_ngcontent-%COMP%] pi[_ngcontent-%COMP%]{color:#626adf!important}.grey-300[_ngcontent-%COMP%]{color:#b0b3bf;opacity:.3}.snapping-guide[_ngcontent-%COMP%]{position:fixed;top:calc(2.5rem + 16px);left:0;bottom:0;width:0px;z-index:5;border:1px dashed #A400F1}button[_ngcontent-%COMP%]:focus-visible{outline:none}.track-music-wrapper[_ngcontent-%COMP%]{width:100%;min-height:1px;background:#626adf0d;position:relative;border-radius:8px}']}
1),n})();const lm=["ve-trackitem-resize",""];let cm=(()=>{var t;class n{constructor(e,r,s){this.el=e,this.renderer=r,this.document=s,this.hideLeftTooltip=!1,this.topPx=0,this.draggingSub=null,this.movingResize=new i.bkB,this.endResizing=new i.bkB,this.endMouseDown=new i.bkB,this.isResizing=!1,this.left=0,this.tRight=!1,this.tLeft=!1,this.inScroll=!1,this.minResizeWidth=15}ngOnInit(){let e=this.getDragEl();this.left=parseFloat(e.style.left)}ngOnDestroy(){this.draggingSub&&this.draggingSub.unsubscribe(),this.document.body.style.cursor="default"}getDragEl(){return this.el.nativeElement}onMouseDown(e){if(e instanceof MouseEvent&&2===e.button)return;let r=e.target;if("rect"===r.tagName||"path"===r.tagName||"pi"===r.tagName)return;this.isResizing=!0;let s=this.getDragEl();this.lastDownX=e.clientX,this.lastDownY=e.clientY,this.isResizing=!0,this.offsetX=e.clientX-s.offsetLeft,this.offsetY=e.clientY-s.offsetTop,this.originalWidth=parseFloat(getComputedStyle(s,null).getPropertyValue("width")),this.originalLeft=parseFloat(getComputedStyle(s,null).getPropertyValue("left")),this.draggingSub=(0,Ct.R)(document,"mousemove",{passive:!1}).subscribe(a=>this.onMouseMove(a)),this.draggingSub.add((0,Ct.R)(document,"touchmove",{passive:!1}).subscribe(a=>this.onMouseMove(a))),this.draggingSub.add((0,Ct.R)(document,"touchend",{passive:!1}).subscribe(a=>this.drop(a))),this.draggingSub.add((0,Ct.R)(document,"touchcancel",{passive:!1}).subscribe(a=>this.drop(a))),this.draggingSub.add((0,Ct.R)(document,"mouseup",{passive:!1}).subscribe(a=>this.drop(a))),s.style.zIndex=5,this.renderer.addClass(this.el.nativeElement,"bg-primary"),this.document.body.style.cursor="ns-resize"}onMouseMove(e){let r=this.getDragEl();if(this.isResizing){let s,a=r.getBoundingClientRect();s=a.y+a.height-e.clientY,this.movingResize.emit({ElementRef:this.el,isResizing:this.isResizing,direction:this.resizeDirection,diff:s})}}drop(e){this.getDragEl().style.zIndex="unset",this.tLeft=!1,this.tRight=!1,this.inScroll=!1,this.draggingSub&&(this.draggingSub.unsubscribe(),this.draggingSub=null,this.isResizing&&this.endResizing.emit(),this.renderer.removeClass(this.el.nativeElement,"bg-primary")),this.document.body.style.cursor="default"}}return(t=n).\u0275fac=function(e){return new(e||t)(i.rXU(i.aKT),i.rXU(i.sFG),i.rXU(Y.qQ))},t.\u0275cmp=i.VBU({type:t,selectors:[["","ve-trackitem-resize",""]],hostBindings:function(e,r){1&e&&i.bIt("mousedown",function(a){return r.onMouseDown(a)})("touchstart",function(a){return r.onMouseDown(a)})},inputs:{max:"max"},outputs:{movingResize:"movingResize",endResizing:"endResizing",endMouseDown:"endMouseDown"},attrs:lm,decls:1,vars:0,consts:[[1,"handler-resize"]],template:function(e,r){1&e&&i.nrm(0,"div",0)},styles:[".handler-resize[_ngcontent-%COMP%]{width:100%;height:2px;background-color:transparent;cursor:ns-resize}.handler-resize[_ngcontent-%COMP%]:hover, .handler-resize[_ngcontent-%COMP%]:focus, .handler-resize[_ngcontent-%COMP%]:focus-visible, .handler-resize[_ngcontent-%COMP%] .resizing[_ngcontent-%COMP%]{background-color:#626adf;box-shadow:0 1px 2px #626adf}"]}),n})();const dm=["canvasWrapper"],um=["canvasMaskWrapper"],hm=["mainCanvas"],mm=["canvasMaskWrapperLoaded"],fm=["canvasBackground"],pm=["previewCanvas"],gm=["canvasPreview"],vm=["page"],_m=["videoheader"],bm=["scrollContent"],ym=["veTimeline"],Tm=["originalA"],km=["scrollableDiv"],Cm=["navsdrawer"],xm=["editNavInner"],wm=["editNavUpper"],Mm=t=>({"timeline-collapse":t}),Im=t=>({"layers-on":t}),Em=t=>({"bg-white":t}),Pm=t=>({loaded:t}),ce=t=>({"drawer-active":t}),Om=t=>({"ul-bottom-pd":t}),Sm=t=>({"max-height":t}),Am=t=>({"text-primary":t}),jm=(t,n)=>({active:t,opacityactive:n}),Dm=t=>({background:t});function Rm(t,n){if(1&t){const o=i.RV6();i.j41(0,"project-drawer",57),i.bIt("changeColorEvent",function(r){i.eBV(o);const s=i.XpG(2);return i.Njj(s.changeColor(r))})("layoutSelectEvent",function(r){i.eBV(o);const s=i.XpG(2);return i.Njj(s.layoutSelect(r))}),i.k0s()}if(2&t){const o=i.XpG(2);i.Y8G("bgColor",o.selectedBgColor)("socialPlatformId",o.socialPlatformId)("layoutFormats",o.layoutFormats)("isLoaded",o.isDataLoaded)}}function Vm(t,n){if(1&t){const o=i.RV6();i.j41(0,"media-drawer",58),i.bIt("progressChanged",function(r){i.eBV(o);const s=i.XpG(2);return i.Njj(s.progressChanged(r))}),i.k0s()}if(2&t){const o=i.XpG(2);i.Y8G("editorType",o.EditorType.VideoEditor)("activePane",o.uploadType?"upload":"stock")}}function Nm(t,n){1&t&&i.nrm(0,"text-drawer")}function Um(t,n){1&t&&i.nrm(0,"illustration-drawer")}function Gm(t,n){if(1&t){const o=i.RV6();i.j41(0,"element-drawer",59),i.mxI("activePaneChange",function(r){i.eBV(o);const s=i.XpG(2);return i.DH7(s.elementactiveSubPane,r)||(s.elementactiveSubPane=r),i.Njj(r)}),i.k0s()}if(2&t){const o=i.XpG(2);i.R50("activePane",o.elementactiveSubPane)}}function Fm(t,n){if(1&t&&i.nrm(0,"animated-drawer",60),2&t){const o=i.XpG(2);i.Y8G("activePane",o.animateActivePanel)}}function Bm(t,n){if(1&t){const o=i.RV6();i.j41(0,"music-drawer",61),i.bIt("sceneAudio",function(r){i.eBV(o);const s=i.XpG(2);return i.Njj(s.sceneAudio(r))})("sceneResized",function(r){i.eBV(o);const s=i.XpG(2);return i.Njj(s.sceneResizedAtAbsu(r))}),i.k0s()}}function Lm(t,n){if(1&t&&i.nrm(0,"illustration-edit-tools",62),2&t){const o=i.XpG(2);i.Y8G("activePane",o.activeEditSubPane)("activeObject",o.activeObject)}}function zm(t,n){if(1&t&&i.nrm(0,"sticker-edit-tools",62),2&t){const o=i.XpG(2);i.Y8G("activePane",o.activeEditSubPane)("activeObject",o.activeObject)}}function Ym(t,n){if(1&t&&i.nrm(0,"text-edit-tools",62),2&t){const o=i.XpG(2);i.Y8G("activePane",o.activeEditSubPane)("activeObject",o.activeObject)}}function Xm(t,n){if(1&t&&i.nrm(0,"remove-bg-edit-tool",63),2&t){const o=i.XpG(2);i.Y8G("activeObject",o.activeObject)}}function Hm(t,n){if(1&t&&i.nrm(0,"shape-edit-tools",62),2&t){const o=i.XpG(2);i.Y8G("activePane",o.activeEditSubPane)("activeObject",o.activeObject)}}function $m(t,n){if(1&t&&i.nrm(0,"image-edit-tools",64),2&t){const o=i.XpG(2);i.Y8G("isPlay",o.isPlay)("activePane",o.activeEditSubPane)("activeObject",o.activeObject)}}function Wm(t,n){if(1&t){const o=i.RV6();i.j41(0,"video-edit-tools",65),i.bIt("videoEditMute",function(){i.eBV(o);const r=i.XpG(2);return i.Njj(r.toggleMute())}),i.k0s()}if(2&t){const o=i.XpG(2);
1i.Y8G("inBackgroundAdjustMode",o.inBackgroundAdjustMode)}}function Km(t,n){if(1&t&&i.nrm(0,"lottie_illustration-edit-tools",62),2&t){const o=i.XpG(2);i.Y8G("activePane",o.activeEditSubPane)("activeObject",o.activeObject)}}function Zm(t,n){if(1&t){const o=i.RV6();i.j41(0,"music-edit-tools",66),i.bIt("changeAudioDuration",function(){i.eBV(o);const r=i.XpG(2);return i.Njj(r.changeAudioDuration())}),i.k0s()}if(2&t){const o=i.XpG(2);i.Y8G("activePane",o.activeEditSubPane)("activeObject",o.sceneController.selectedAudioObject)}}function Jm(t,n){if(1&t){const o=i.RV6();i.j41(0,"div",44,8),i.bIt("click",function(r){i.eBV(o);const s=i.XpG();return i.Njj(s.editToolsWrapperClick(r))}),i.j41(2,"div",45),i.DNE(3,Rm,1,4,"project-drawer",46),i.k0s(),i.j41(4,"div",45),i.DNE(5,Vm,1,2,"media-drawer",47),i.k0s(),i.j41(6,"div",45),i.DNE(7,Nm,1,0,"text-drawer",48),i.k0s(),i.j41(8,"div",45),i.DNE(9,Um,1,0,"illustration-drawer",48),i.k0s(),i.j41(10,"div",45),i.DNE(11,Gm,1,1,"element-drawer",49),i.k0s(),i.j41(12,"div",45),i.DNE(13,Fm,1,1,"animated-drawer",50),i.k0s(),i.j41(14,"div",45),i.DNE(15,Bm,1,0,"music-drawer",51),i.k0s(),i.DNE(16,Lm,1,2,"illustration-edit-tools",52)(17,zm,1,2,"sticker-edit-tools",52)(18,Ym,1,2,"text-edit-tools",52)(19,Xm,1,1,"remove-bg-edit-tool",53)(20,Hm,1,2,"shape-edit-tools",52)(21,$m,1,3,"image-edit-tools",54)(22,Wm,1,1,"video-edit-tools",55)(23,Km,1,2,"lottie_illustration-edit-tools",52)(24,Zm,1,2,"music-edit-tools",56),i.k0s()}if(2&t){const o=i.XpG();i.Y8G("ngSwitch",o.activeToolPanel),i.R7$(2),i.HbH(o.drawerClassArray.project),i.Y8G("ngClass",i.eq3(38,ce,"project"==o.activeToolPanel)),i.R7$(),i.Y8G("ngSwitchCase","project"),i.R7$(),i.HbH(o.drawerClassArray.media),i.Y8G("ngClass",i.eq3(40,ce,"media"==o.activeToolPanel)),i.R7$(),i.Y8G("ngSwitchCase","media"),i.R7$(),i.HbH(o.drawerClassArray.text),i.Y8G("ngClass",i.eq3(42,ce,"text"==o.activeToolPanel)),i.R7$(),i.Y8G("ngSwitchCase","text"),i.R7$(),i.HbH(o.drawerClassArray.illustration),i.Y8G("ngClass",i.eq3(44,ce,"illustration"==o.activeToolPanel)),i.R7$(),i.Y8G("ngSwitchCase","illustration"),i.R7$(),i.HbH(o.drawerClassArray.element),i.Y8G("ngClass",i.eq3(46,ce,"element"==o.activeToolPanel)),i.R7$(),i.Y8G("ngSwitchCase","element"),i.R7$(),i.HbH(o.drawerClassArray.animated),i.Y8G("ngClass",i.eq3(48,ce,"animated"==o.activeToolPanel)),i.R7$(),i.Y8G("ngSwitchCase","animated"),i.R7$(),i.HbH(o.drawerClassArray.music),i.Y8G("ngClass",i.eq3(50,ce,"music"==o.activeToolPanel)),i.R7$(),i.Y8G("ngSwitchCase","music"),i.R7$(),i.Y8G("ngSwitchCase","illustration_edit"),i.R7$(),i.Y8G("ngSwitchCase","sticker_edit"),i.R7$(),i.Y8G("ngSwitchCase","text_edit"),i.R7$(),i.Y8G("ngSwitchCase","remove_bg"),i.R7$(),i.Y8G("ngSwitchCase","shape_edit"),i.R7$(),i.Y8G("ngSwitchCase","image_edit"),i.R7$(),i.Y8G("ngSwitchCase","video_edit"),i.R7$(),i.Y8G("ngSwitchCase","lottie_illustration_edit"),i.R7$(),i.Y8G("ngSwitchCase","music_edit")}}function Qm(t,n){if(1&t){const o=i.RV6();i.j41(0,"div",76),i.bIt("click",function(){i.eBV(o);const r=i.XpG(2);return i.Njj(r.topScroll())}),i.nrm(1,"pi",77),i.k0s()}}function qm(t,n){if(1&t){const o=i.RV6();i.j41(0,"li",78),i.bIt("click",function(){const r=i.eBV(o).$implicit,s=i.XpG(2);return i.Njj(s.activateEditTool(r))}),i.j41(1,"a",79),i.nrm(2,"pi",80),i.k0s(),i.EFF(3),i.k0s()}if(2&t){const o=n.$implicit,e=i.XpG(2);i.ZvI("mt-3 mb-3 ",o.name,""),i.Y8G("ngClass",i.eq3(7,Am,e.activeEditSubPane==o.name||o.name==e.opacityPane&&e.Showopacity||o.name==e.blurPane&&e.Showblur)),i.R7$(),i.Y8G("ngClass",i.l_i(9,jm,e.activeEditSubPane==o.name,o.name==e.opacityPane&&e.Showopacity||o.name==e.blurPane&&e.Showblur)),i.R7$(),i.Y8G("name",o.icon),i.R7$(),i.SpI(" ",o.title," ")}}function tf(t,n){if(1&t){const o=i.RV6();i.j41(0,"div",81),i.bIt("click",function(){i.eBV(o);const r=i.XpG(2);return i.Njj(r.buttomScroll())}),i.nrm(1,"pi",82),i.k0s()}}function ef(t,n){if(1&t){const o=i.RV6();i.j41(0,"div",83),i.bIt("mousedown",function(){i.eBV(o);const r=i.XpG(2);return i.Njj(r.editNavDown())}),i.nrm(1,"opacity-tool",84),i.k0s()}if(2&t){const o=i.XpG(2);i.R7$(),i.Y8G("activeObject",o.activeObject)("verticalOrientation",!0)}}function nf(t,n){if(1&t&&(i.j41(0,"div",85),i.nrm(1,"blur-tool",86),i.k0s()),2&t){const o=i.XpG(2);i.R7$(),i.Y8G("verticalOrientation",!0)("imageFilterUtil",null==o.selectedBgMedia?null:o.selectedBgMedia.imageFilterUtil)}}function rf(t,n){if(1&t&&(i.j41(0,"div",67,9)(2,"div",68,10),i.DNE(4,Qm,2,0,"div",69),i.j41(5,"div",70)(6,"div",null,11)(8,"ul",71,12),i.DNE(10,qm,4,12,"li",72),i.k0s()()(),i.DNE(11,tf,2,0,"div",73)(12,ef,2,2,"div",74)(13,nf,2,2,"div",75),i.k0s()()),2&t){const o=i.sdS(1),e=i.sdS(7
1),r=i.XpG();i.R7$(4),i.Y8G("ngIf",o.clientHeight<e.clientHeight),i.R7$(4),i.Y8G("ngClass",i.eq3(7,Om,o.clientHeight<e.clientHeight||r.editNavs.length>4&&r.windowHeight>685&&r.windowHeight<720))("ngStyle",i.eq3(9,Sm,o.clientHeight+1+"px")),i.R7$(2),i.Y8G("ngForOf",r.editNavs),i.R7$(),i.Y8G("ngIf",o.clientHeight<e.clientHeight),i.R7$(),i.Y8G("ngIf",r.Showopacity),i.R7$(),i.Y8G("ngIf",r.Showblur)}}function of(t,n){1&t&&(i.j41(0,"div",87)(1,"div",88),i.nrm(2,"pi",89),i.EFF(3,"Drag Image to pan "),i.k0s()())}function sf(t,n){1&t&&(i.j41(0,"div",90),i.EFF(1," Loading... "),i.k0s())}function af(t,n){1&t&&(i.j41(0,"div",91)(1,"div",92)(2,"div",93)(3,"span",94),i.EFF(4,"Loading..."),i.k0s()()()())}function lf(t,n){if(1&t&&(i.j41(0,"div",95)(1,"div",96)(2,"div",92)(3,"div",93)(4,"span",94),i.EFF(5,"Loading..."),i.k0s()()()()()),2&t){const o=i.XpG();i.R7$(),i.Y8G("ngStyle",i.eq3(1,Dm,o.selectedBgColor?o.selectedBgColor:"#000000"))}}function cf(t,n){if(1&t){const o=i.RV6();i.j41(0,"div",97),i.nrm(1,"div",98),i.j41(2,"div",99)(3,"p"),i.nrm(4,"
1ngb-progressbar",100),i.k0s(),i.j41(5,"span",101),i.EFF(6,"Loading media... "),i.k0s(),i.j41(7,"button",102),i.bIt("click",function(){i.eBV(o);const r=i.XpG();return i.Njj(r.sceneController.cancelDownloading())}),i.EFF(8,"Cancel"),i.k0s()()()}if(2&t){const o=i.XpG();i.R7$(4),i.Y8G("value",o.sceneController.inProgressCount)("showValue",!0)}}function df(t,n){1&t&&(i.j41(0,"div",103),i.nrm(1,"div",104)(2,"div",105),i.k0s())}function uf(t,n){if(1&t){const o=i.RV6();i.j41(0,"div",106)(1,"div",107),i.bIt("endResizing",function(){i.eBV(o);const r=i.XpG();return i.Njj(r.endResizing())})("movingResize",function(r){i.eBV(o);const s=i.XpG();return i.Njj(s.movingResize(r))}),i.k0s(),i.j41(2,"ve-timeline",108,13),i.bIt("changeEditMode",function(r){i.eBV(o);const s=i.XpG();return i.Njj(s.changeEditMode(r))})("changeShowGrid",function(r){i.eBV(o);const s=i.XpG();return i.Njj(s.grid(r))})("playing",function(r){i.eBV(o);const s=i.XpG();return i.Njj(s.registerPlayingEvent(r))})("undo",function(){i.eBV(o);const r=i.XpG();return i.Njj(r.undo())})("redo",function(){i.eBV(o);const r=i.XpG();return i.Njj(r.redo())}),i.k0s()()}if(2&t){const o=i.XpG();i.R7$(2),i.Y8G("activeObject",o.activeObject)("timeline",o.timelineController)("init",o.timelineUpdated)("sceneController",o.sceneController)}}const hf=[{path:"",redirectTo:"edit",pathMatch:"full"},{path:"edit",component:(()=>{var t;class n extends ao.l{constructor(e,r,s,a,l,c,d,u,h,f,m,T,b,_,v,C,y,w,x,E,N,A,I,P,z,V,W){super(m,T,b,_,Jt._Y.VideoEditor,a,v,s,c,f),this.toolhistoryservice=e,this.renderer=r,this.route=l,this.videoRepository=d,this.createProjectService=u,this._location=h,this.sceneController=f,this.timelineParser=C,this.uploadVideoService=y,this.resizeLayoutService=w,this.templateService=x,this.modalService=E,this.uploadService=N,this.dialogService=A,this.envService=I,this.router=P,this.document=z,this.videoEditorService=V,this.mixedGroupBuilder=W,this.projectType=null,this.ProjectTypeNum=wi.gM,this.activeEditSubPane="edit",this.elementactiveSubPane=q.s.ILLUSTRATION,this.opacityPane="opacity",this.blurPane="Blur",this.changingV
1alue=new oo.B,this.activeEditToolPanel="",this.inProgress=!1,this.stopAnimation=!0,this.isCanvasLoading=!1,this.isScenePlaying=!1,this.isEdit=!1,this.isLoaded=!1,this.editorVolume=!0,this.sldBtn=!0,this.selectedBgColor="#000000",this.socialPlatformId=26,this.Showopacity=!1,this.Showblur=!1,this.editNavs=[],this.lastSelectedEditSubPane="",this.showBgEditTools=!1,this.isLayersVisible=!1,this.BackgroundEdittools=!1,this.mediaType=1,this.animateActivePanel="animated-illustration",this.audioDisplayNmae="",this.drawerClassArray=[],this.layoutFormats=[],this.isDataLoaded=!1,this.timelineUpdated=!1,this.EditorType=Jt._Y,this.isSaving=!1,this.isLastEditNavDown=!1,this.windowHeight=window.innerHeight,this.isPlay=0,this.navTools=[],this.previousvalue=0,this.sceneController.onFormate=()=>{this.isGrid=!1,this.gridLines=[]},this.sceneController.onChange=g=>{g&&"music-volume"===g.name&&(this.musicVolume=Math.round(100*g.val))},this.setDirtySubscription=this.setDirty.subscribe(()=>{this.sceneController.getSelectedScene().setDirty()}),this.afterVideoLoadSubscription=this.uploadVideoService.afterVideoLoad.subscribe(g=>{g&&setTimeout(()=>{this.socialPlatformId=26,this.selectedBgColor="#000000",this.sceneController.resetTimeline(),setTimeout(()=>{this.loadProject(()=>{const k=this.calculateAspectRatio(this.width,this.height).aspectRatio.split(":");2===k.length&&(this.layoutFormats[0].wratio=k[0],this.layoutFormats[0].hratio=k[1],this.layoutFormats[0].width=this.width,this.layoutFormats[0].height=this.height)})})},1e3)}),this.cancelEventSubs=this.uploadService.cancelEvent.subscribe(g=>{g&&setTimeout(()=>{const O=this.route.snapshot.queryParamMap.get("from");O&&"header"!=O&&this.router.navigate(["/video-editing/"+O]),this.cancelEventSubs&&this.cancelEventSubs.unsubscribe()},200)}),this.editorService.getEditorUiConfig(this.editorService.videoTemplateUIJsonUrl,g=>{g&&(this.editorService.uiConfig=Object.assign({},{videoTemplate:g}),this.navTools=this.editorService.uiConfig.videoTemplate.toolbar.nav.videoItems,this.toolbar=this.editorService.uiConfig.videoTemplate.toolbar,this.pandingOpenDrawer&&this.openDrawers(this.pandingOpenDrawer),this.pandingOpenDrawer=null)})}onvisibilitychange(e){this.document.hidden||this.stateService&&this.stateService.mainCanvas&&this.stateService.mainCanvas.renderAll()}ngOnInit(){let e=this.route.snapshot.queryParamMap.get("img")||this.route.snapshot.queryParamMap.get("video");this.stateService.init(this.canvasWrapper,this.canvasMaskWrapper,this.mainCanvas,null,null,!0,this.previewCanvas),this.inProgress=!0,this.isLoaded=!1,this.user=this.authService.currentUser(),this.onInit(),this.reset();const r=this.route.snapshot.queryParamMap.get("project_type");this.projectType=r?Number(r):wi.gM.VideoEditor,this.editorService.isVideoEditorSupported()||(this.modalService.open(po.N,{size:"lg",centered:!0,windowClass:"confirm-modal"}).componentInstance.title=ht.b.message.exportNotSupportedWarninig),fo.o&&e&&e.includes("blob:http")?(this.uploadVideoService.makeProjectFromScratch(),setTimeout(()=>{this.loadProject(()=>{this.getSocialFormats()})},100)):this.loadProject(()=>{this.getSocialFormats()}),document.body.classList.add("overflow-hidden");const s=navigator.userAgent;s.includes("Mac")&&(s.includes("Safari")||s.includes("Chrome"))&&this.renderer.addClass(document.body,"for-mac-safari-chrome"),s.includes("Mac")&&s.includes("Firefox")&&this.renderer.addClass(document.body,"for-mac-firefox")}loadProject(){var e=this;return(0,ot.A)(function*(r=null){const s=yield e.findDesignJsonObj();let a;a=!!e.user&&e.user.subscribed>0;let l=0,c=0;if(s.properties.format===ht.b.customVideoFormatId)e.width=l=s.properties.width,e.height=c=s.properties.height;else{yield e.configService.waitForSettings();let h=e.configService.settings?.[Jt.jn.Formats]?.[s.properties.format];e.width=l=h?.width||1920,e.height=c=h?.height||1080}yield e.zoomService.init(26,l,c);let d=e.route.snapshot.queryParamMap.get("tab");e.editorService.setActiveToolPanel(d&&"resize"!=d&&"trim"!=d&&"mute"!=d?{panel:d,from:"default"}:{panel:q.s.PROJECT,from:"default"}),e.timelineController=null,e.videoRepository.setSceneController(e.sceneController);const u=e.route.snapshot.queryParamMap.get("action");e.sceneController.init(s,e.stateService.mainCanvas,e.editorService,h=>e.adjustMediaContainer(h),a,u,e.stateService,e.zoomService).then(()=>{e.projectType=e.sceneController.getProjectType(),e.zoomService.fitToScreen(),e.stateService.disableCanvasRightClick(),e.activeEditToolPanelSubscription=e.sceneController.activeEditToolPanel.subscribe(h=>{e.openEditTool(h),e.timelineView="scene"}),setTimeout(()=>
1{e.changingValue.next("video-duration")},0),"resize"===d&&e.videoheader.resize(),"blank_project"===u&&(e.socialPlatformId=84),setTimeout(()=>{initAligningGuidelines(e.stateService.mainCanvas,1)},200),e.projectId&&e.sceneController.getSelectedScene().getBackGroundColor()&&(e.selectedBgColor=e.sceneController.getSelectedScene().getBackGroundColor()),e.makeTimeline(u).then(()=>{e.uploadService.tempFiles&&e.uploadService.addFilesToTimeLine(e.uploadService.tempFiles,h=>{e.uploadService.tempFiles=null,e.addMultipleMedia(h,!0)})})}).catch(()=>{e._location.back()}),r&&r(),e.inProgress=!1,e.isLoaded=!0}).apply(this,arguments)}addMultipleMedia(e,r){var s=this;return(0,ot.A)(function*(){const a=[];for(const l of e){const c=l.file,d=l.metadata.contentUrl;let u=0;if("img"===l.assetType||"IMG"===l.assetType?u=0:("video"===l.assetType||"VIDEO"===l.assetType)&&(u=1,d.includes("blob:http")&&s.videoRepository.setVideoURLBlob(d,c)),-1===s.sceneController.inProgressCount){1===u?s.sceneController.inProgressCount=0:s.sceneController.inProgress=!0;const h=s.mixedGroupBuilder.addMediaContainerGroup(d,u,s.sceneController.getSelectedScene(),s.sceneController.getCanvas(),l.assetId,Jt._Y.VideoEditor,r);s.sceneController.setCancelDownloadingCallback(()=>h.cancel());try{a.push(yield h.promise),1===u?s.sceneController.inProgressCount=-1:s.sceneController.inProgress=!1}catch{}}}s.videoEditorService.addTrackItemFn&&(yield s.videoEditorService.addTrackItemFn(a))})()}makeTimeline(e){var r=this;return(0,ot.A)(function*(){if(r.timelineController=null,r.timelineController=yield r.timelineParser.parseTimeLine(r.sceneController),r.timelineUpdated=!0,"blank_project"===e){let s=r.route.snapshot.queryParamMap.get("duration");s&&(r.timelineController.duration=Number(s))}r.timelineController.updateDuration(),r.timelineController.tracks&&0===r.timelineController.tracks.length&&(r.sceneController.tempMarkSaved(),r.sceneController.dirty=!1)})()}findDesignJsonObj(){let e="";if(this.projectId=e=this.route.snapshot.queryParamMap.get("project_id"),e)return this.__loadProjectFromId();{const r=this.__getImgObj();return this.makeProjectFromScratch(r)}}__getImgObj(){let e=new Mi.fP;e.format=0;let r=this.route.snapshot.queryParamMap.get("w")?this.route.snapshot.queryParamMap.get("w"):this.route.snapshot.queryParamMap.get("width"),s=this.route.snapshot.queryParamMap.get("h")?this.route.snapshot.queryParamMap.get("h"):this.route.snapshot.queryParamMap.get("height");if(r&&(e.width=Number(r)),s&&(e.height=Number(s)),0==e.wRatio&&0==e.hRatio&&e.width&&e.height){let c=this.divideRatio(e.width,e.height);e.wRatio=c.wRatio,e.hRatio=c.hRatio}let a=this.route.snapshot.queryParamMap.get("video");a?(e.baseImageUrl=a,e.mediaType=1):this.route.snapshot.queryParamMap.get("img")&&(e.baseImageUrl=this.route.snapshot.queryParamMap.get("img"),e.mediaType=0,this.mediaType=0),e.socialPlatformId=26;let l=this.route.snapshot.queryParamMap.get("duration");return l&&(e.duration=Number(l)),e}__loadProjectFromId(){return new Promise((e,r)=>{let s=this.route.snapshot.queryParamMap.get("project_id");this.projectId=s,this.editorService.loadProject(s,a=>{"blank_project"===this.route.snapshot.queryParamMap.get("action")?a.properties.socialPlatformId=this.socialPlatformId=84:a.properties.socialPlatformId||(a.properties.socialPlatformId=this.socialPlatformId=26),e(a)},a=>{})})}makeProjectFromScratch(e){let r=this.user;return this.createProjectService.getTemplateProject(e,mo.If.OTHERS,r?r.systemRefKey:null,"",this.projectType,Jt._Y.VideoEditor)}ngOnDestroy(){this.onDestroy(),this.activeEditToolPanelSubscription&&this.activeEditToolPanelSubscription.unsubscribe(),this.sceneController.reset(),this.stateService.onDestory(),this.setDirtySubscription&&this.setDirtySubscription.unsubscribe(),this.afterVideoLoadSubscription&&this.afterVideoLoadSubscription.unsubscribe(),this.stateService.mainCanvas&&this.stateService.mainCanvas.clear(),this.cancelEventSubs&&this.cancelEventSubs.unsubscribe(),this.uploadService.localFiles=[],document.body.classList.remove("overflow-hidden"),this.uploadService.tempFiles=null}editNavDown(){this.isLastEditNavDown=!0}canvasWrapperClick(e){this.isLastEditNavDown?this.isLastEditNavDown=!1:(this.isLastEditNavDown=!1,(e.target===this.canvasWrapper.nativeElement||(e.target===this.canvasMaskWrapperLoaded.nativeElement||e.target===this.canvasMaskWrapper.nativeElement||this.editNavUpper.last&&e.target===this.editNavUpper.last.nativeElement||this.editNavInner.last&&e.target===this.editNavInner.last.nativeElement)&&this.sceneController.selectedScene.selectedDesignItem)&&(this.sceneController.deselectAll(),this.activeObject=null,this.editNavs=[],this.editorService.setActiveToolPanel({panel:this.lastSelectedToolPanel,from:""})))}openDrawers(e){let r=!1;if(this.toolbar&&this.toolbar.nav&&this.toolbar.nav.items){for(const s of this.toolbar.nav.items)s.name===e.panel?(this.drawerClassArray[s.name]="",r=!0):this.drawerClassArray[s.name]=r?"up-state":"down-state";this.activeToolPanel=e.panel,this.lastSelectedToolPanel=e.panel,"nav"===e.from&&(this.sldBtn=!0),(!e||"canvas"!==e.from)&&(this.timelineView="music"===this.activeToolPanel?"music":"scene",this.sceneController&&!this.editorService.replace&&(this.sceneController.deselectAll(),this.activeObject=null,this.editNavs=[]),this.Backgroun
1dEdittools=!1,this.showBgEditTools=!1)}else this.pandingOpenDrawer=e}openEditTool(e){this.activeToolPanel="",this.activeObject=e,this.Showopacity=!1,this.Showblur=!1;let r=null,s="",a=!1;if(e)if(e instanceof Ii.Y)r=[],this.lastSelectedToolPanel=q.s.MUSIC,this.activeToolPanel=q.s.MUSIC_EDIT;else if(e instanceof xi.$)switch(this.sceneController.selectedAudioObject=null,e.getDesignItem().canvas.itemType){case Ht.Q.STICKERS:r=JSON.parse(JSON.stringify(this.toolbar.editNavs.stickers)),this.activeToolPanel=this.editorService.replaceEdit?q.s.STICKERS:q.s.STICKERS_EDIT,this.lastSelectedToolPanel=q.s.STICKERS,s="transform","animated"==this.editorService.getActiveToolPanel().panel&&(r.items.pop(),this.lastSelectedToolPanel=q.s.ANIMATED,this.editorService.replaceEdit&&(this.activeToolPanel=q.s.ANIMATED));break;case Ht.Q.ILLUSTRATIONS:r=this.toolbar.editNavs.illustration,this.activeToolPanel=this.editorService.replaceEdit?q.s.ILLUSTRATION:q.s.ILLUSTRATION_EDIT,this.lastSelectedToolPanel=q.s.ILLUSTRATION,this.elementactiveSubPane=q.s.ILLUSTRATION,s="edit";break;case Ht.Q.TEXT:r=JSON.parse(JSON.stringify(this.toolbar.editNavs.text)),this.activeObject.isSimpleText()?r.items.shift():r.items.pop(),this.activeToolPanel=this.editorService.replaceEdit?q.s.TEXT:q.s.TEXT_EDIT,this.lastSelectedToolPanel=q.s.TEXT,s="text";break;case Ht.Q.SHAPE:r=this.toolbar.editNavs.shape,1===this.activeObject.getShapeType()?(r.items.shift(),s="transform"):s="color",this.activeToolPanel=q.s.SHAPE_EDIT}else e.getDesignItem().box?.entityType&&3===e.getDesignItem().box.entityType?(r=this.toolbar.editNavs.shapeMedia,this.activeToolPanel=q.s.SHAPE_MEDIA_EDIT,s="color"):e.getDesignItem().lottie?(r=this.toolbar.editNavs.lottie_Illustration,this.activeToolPanel=q.s.LOTTI_ILLUSTRATION_EDIT,s="transform",a=!0,this.animateActivePanel=e.getDesignItem().lottie.itemType==It.zs.LOTTIE_STICKER?"animated-sticker":"animated-illustration"):(0==this.activeObject.getDesignItem().box.imgArray[this.activeObject.selectedMediaItemIndex].imageType?r=this.activeObject.getIsUserAdded()?JSON.parse(JSON.stringify(this.toolbar.editNavs.image)):JSON.parse(JSON.stringify(this.toolbar.editNavs.templateImage)):(r=JSON.parse(JSON.stringify(this.toolbar.editNavs.video)),this.activeObject.getIsUserAdded()||(r.items.pop(),r.items.splice(2,1))),this.editorService.replaceEdit?(this.activeToolPanel=q.s.MEDIA,s="replace",this.lastSelectedToolPanel=q.s.MEDIA):(this.activeToolPanel=q.s.IMAGE_EDIT,this.editorService.removebgEdit?(this.activeToolPanel=q.s.REMOVE_BG,s="remove_bg",this.lastSelectedToolPanel=q.s.REMOVE_BG):s=0==this.activeObject.getDesignItem().box.imgArray[this.activeObject.selectedMediaItemIndex].imageType?"enhance":"edit",this.lastSelectedToolPanel=q.s.MEDIA));else this.sceneController.selectedAudioObject=null,this.editorService.setActiveToolPanel({panel:q.s.PROJECT,from:"nav"});r&&(this.editNavs=r.items),this.editorService.zOrderEdit?(this.editorService.zOrderEdit=!1,s="transform"):this.editorService.replaceEdit?(this.editorService.replaceEdit=!1,a?(a=!1,s="transform"):s="replace"):this.editorService.removebgEdit&&(this.editorService.removebgEdit=!1,s="remove_bg"),this.setActiveEditSubPane(s)}unloadNotification(e){this.canDeactivate()||(e.returnValue=!0)}setActiveEditSubPane(e){this.activeEditSubPane=e,e&&(this.lastSelectedEditSubPane=e),this.editorService.setActiveEditToolSubPanel(e)}activateEditTool(e){"opacity"==e.name?(this.Showopacity=!this.Showopacity,this.Showblur=!1):"Blur"==e.name?(this.Showblur=!this.Showblur,this.Showopacity=!1):(this.activeToolPanel=e.toolPanel,this.setActiveEditSubPane(e.name),this.Showopacity=!1,this.Showblur=!1,this.lastSelectedToolPanel=e.toolPanel),this.sldBtn=!0}sceneAudio(e){e&&(this.audioDisplayNmae=e?.displayName?e.displayName:e?.name?e.name:"")}sceneResizedAtAbsu(e){this.sceneController.getSelectedScene().chageDuration(e),this.changingV
1alue.next("scene-duration")}progressChanged(e){this.inProgress=e}changeEditMode(e){let r=e.isEdit;if(this.isPlay=e.isPlay,this.isEdit=r,e.selectTab&&e.isReplace)e.selectTab==q.s.MUSIC?(this.editorService.replace=!0,this.editorService.setActiveToolPanel(q.s.MUSIC)):e.selectTab==q.s.MEDIA?(e.extras&&e.extras.uploadType&&(this.uploadType=e.extras.uploadType),this.editorService.setActiveToolPanel(q.s.MEDIA)):this.openEditTool(null);else if(e.isReplace)for(const a of this.editNavs)if("replace"===a.name){this.activateEditTool(a);break}}changeColor(e){this.selectedBgColor=e.color,this.sceneController.getSelectedScene().setBackGroundColor(this.selectedBgColor,e.final)}layoutSelect(e){var r=this;return(0,ot.A)(function*(){e&&(r.socialPlatformId=e.socialPlatformId,yield r.resizeLayoutService.updateFormat(e,2,r.zoomService,r.sceneController))})()}animate(){this.sceneController.getSelectedScene().getSceneAnimation().getTimeLine().play()}stopAnimate(){this.isEdit=!0}animationRenderAll(e){const r=()=>{e.renderAll();const s=St.fabric.util.requestAnimFrame(r);this.stopAnimation&&St.fabric.util.cancelAnimFrame(s)};St.fabric.util.requestAnimFrame(r)}get videoDuration(){let e=0;for(let r=0;r<this.sceneController.scenes.length;r++)e+=this.sceneController.scenes[r].getDuration();return e}get selectedSceneDuration(){let e=this.sceneController.getSelectedScene();return e?e.getDuration():0}toggleMute(){this.editorVolume=!this.editorVolume,this.sceneController.editorVolume=this.editorVolume}toggleSliderOpen(e){this.sldBtn=e,this.setActiveEditSubPane(this.lastSelectedEditSubPane),setTimeout(()=>{this.zoomService.fitToScreen()},100)}toggleSliderClose(e){this.sldBtn=e,this.setActiveEditSubPane(null),setTimeout(()=>{this.zoomService.fitToScreen()},100)}editToolsWrapperClick(e){this.Showopacity=!1}deleteScene(e){this.sceneController.delete(e)}scrollDiv(e,r){e.scrollTop+=r}buttomScroll(){this.scrollContent.nativeElement.scrollTo({top:this.scrollContent.nativeElement.scrollTop+57,behavior:"smooth"})}topScroll(){this.scrollContent.nativeElement.scrollTo({top:this.scrollContent.nativeElement.scrollTop-57,behavior:"smooth"})}reset(){this.sceneController.audioObjs&&(this.sceneController.audioObjs=null)}registerPlayingEvent(e){var r=this;if(e){const s=function(){var a=(0,ot.A)(function*(l){if(l&&l.target&&l.target.parentElement)if(l.target.parentElement.attributes.id){const c=l.target.parentElement.attributes.id.value;if("mute"===c||"unmute"===c||"ruler"===c)return}else if("timelineGrid"===l.target.id){const d=l.target;if(!r.veTimeline.isNoClickTime&&d&&("timelineGrid"===d.id||"track"===d.dataset.role))return}yield r.veTimeline.pause()});return function(c){return a.apply(this,arguments)}}();this.eventPlayingHandler=s,this.page.nativeElement.addEventListener("mousedown",s)}else this.page.nativeElement.removeEventListener("mousedown",this.eventPlayingHandler)}getSocialFormats(){this.resizeLayoutService.getSocialFormats(2,!0,r=>{if(r.body?.socialPlatformsList&&r.body?.socialPlatformsList.length>0){r.body.socialPlatformsList.forEach(d=>{d.socialPlatformFormats.forEach(u=>{d.socialLabelType.toLowerCase()==Jt.zu.Standard?this.layoutFormats.unshift(u):this.layoutFormats.push(u)})});const a={width:this.width,height:this.height,socialPlatformId:26,iconName:"squareslider",socialPlatform:"Original Size",hratio:1,wratio:1,format:0},c=this.calculateAspectRatio(this.width,this.height).aspectRatio.split(":");2===c.length&&(a.wratio=c[0],a.hratio=c[1]),this.layoutFormats.unshift(a),this.isDataLoaded=!0}},()=>{})}calculateAspectRatio(e,r){return{aspectRatio:this.simplifyRatio(e,r)}}simplifyRatio(e,r){const s=this.calculateGCD(e,r);return`${e/s}:${r/s}`}calculateGCD(e,r){return 0===r?e:this.calculateGCD(r,e%r)}changeAudioDuration(){this.timelineController.updateDuration()}checkBlankTextbox(){this.activeObject&&this.activeObject.isTextEdit&&(this.sceneController.deselectAll(),this.activeObject=null,this.editNavs=[],this.editorService.setActiveToolPanel({panel:this.lastSelectedToolPanel,from:""}))}undo(){this.veTimeline.isVideoPlay&&this.veTimeline.pause(),this.checkBlankTextbox(),this.previousvalue=this.veTimeline.originalA.nativeElement.scrollTop,this.templateService.undoRedoInprogress||(this.templateService.undoRedoInprogress=!0,this.renderer.setStyle(this.veTimeline.originalA.nativeElement,"overflow","hidden"),this.sceneController.release(),this.sceneController.undo().then(()=>{this.socialPlatformId=this.sceneController.getDesign().properties.socialPlatformId,this.selectedBgColor=this.sceneController.selectedScene.getBackGroundColor();const e=this.timelineController.currentTime;setTimeout(()=>{this.makeTimeline(null).then(()=>{this.timelineController.seekToTime(e,!1).then(()=>{setTimeout(()=>{this.templateService.undoRedoInprogress=!1},200)}).catch(()=>{setTimeout(()=>{this.templateService.undoRedoInprogress=!1},200)}),this.veTimeline&&this.veTimeline.setDisplayedDuration(),setTimeout(()=>{this.veTimeline.originalA.nativeElement.scrollTo({top:this.previousvalue}),this.renderer.setStyle(this.veTimeline.originalA.nativeElement,"overflow","auto")},200),this.isGrid&&this.grid(this.isGrid)}).catch(()=>{console.log("Undo Error"),this.templateService.undoRedoInprogress=!1})},200)}))}movingResize(e){let r=e.diff;if(this.veTimeline.timelineWrapper.nativeElement.clientHeight+r<this.page.nativeElement.clientHeight/2){this.veTimeline.timelineWrapper.nativeElement.style.height=this.veTimeline.timelineWrapper.nativeElement.clientHeight+r+"px",this.veTimeline.seekElem.el.nativeElement.style.height=this.veTimeline.timelineWrapper.nativeElement.clientHeight-1+"px";let l=this.canvasWrapper.nativeElement.parentElement;this.renderer.setStyle(this.navsdrawer.nativeElement,"height","calc(100% - "+this.veTimeline.timelineWrapper.nativeElement.clientHeight+"px)"),this.renderer.setStyle(l,"height","calc(100% - "+this.veTimeline.timelineWrapper.nativeElement.clientHeight+"px)")}}endResizing(){this.zoomService.fitToScreen()}redo(){this.veTimeline.isVideoPlay&&this.veTimeline.pause(),this.templateService.undoRedoInprogress||(this.templateService.undoRedoInprogress=!0,this.checkBlankTextbox(),this.sceneController.release(),this.sceneController.redo().then(()=>{this.socialPlatformId=this.sceneController.getDesign().properties.socialPlatformId,this.selectedBgColor=this.sceneController.selectedScene.getBackGroundColor();const e=this.timelineController.currentTime;setTimeout(()=>{this.makeTimeline(null).then(()=>{this.timelineController.seekToTime(e,!1).then(()=>{setTimeout(()=>{this.templateService.undoRedoInprogress=!1},200)}).catch(()=>{setTimeout(()=>{this.templateService.undoRedoInprogress=!1},200)}),this.veTimeline&&this.veTimeline.setDisplayedDuration(),this.isGrid&&this.grid(this.isGrid)}).catch(()=>{console.log("Redo Error"),this.templateService.undoRedoInprogress=!1})},200)}))}toggleMediaVolume(e){this.timelineController&&this.timelineController.playingScene&&this.timelineController.playingScene.toggleSelectedMediaVolumeAtplay(!e,this.activeObject)}handleKeyboardEventDown(e){if(!(this.sceneController&&this.sceneController.getSelectedScene().selectedDesignItem&&this.sceneController.getSelectedScene().selectedDesignItem.isEditing()))if((e.metaKey||e.ctrlKey)&&"s"===e.key)this.isSaving||(this.isSaving=!0,this.saveProject(()=>{this.isSaving=!1})),e.preventDefault();else if(this.sceneController.getSelectedScene().selectedDesignItem){if("BODY"!==(e.target||e.srcElement).tagName)return;if(e.key.toLowerCase().includes("esc"))this.sceneController.deselectAll(),this.activeObject=null,this.editNavs=[],this.editorService.setActiveToolPanel({panel:this.lastSelectedToolPanel,from:""});else{const s=e.shiftKey?50:5;switch(e.key){case"ArrowRight":this.sceneController.getSelectedScene().selectedDesignItem.arrow(Be.i3.RIGHT,!1,s);break;case"ArrowDown":this.sceneController.getSelectedScene().selectedDesignItem.arrow(Be.i3.DOWN,!1,s);break;case"ArrowUp":this.sceneController.getSelectedScene().selectedDesignItem.arrow(Be.i3.UP,!1,s);break;case"ArrowLeft":this.sceneController.getSelectedScene().selectedDesignItem.arrow(Be.i3.LEFT,!1,s)}}}}onKeyDown(e){if("Enter"===e.key||" "===e.key){let r=e.target||e.currentTarget;if(r&&"INPUT"===r.tagName)return;e.preventDefault(),this.veTimeline.isVideoPlay?this.veTimeline.pause():this.veTimeline.play()}}}return(t=n).\u0275fac=function(e){return new(e||t)(i.rXU(go.k),i.rXU(i.sFG),i.rXU(Ce.n),i.rXU(de.x),i.rXU(Zt.nX),i.rXU(Le.f),i.rXU(Ei.I),i.rXU(Mi.Zg),i.rXU(Y.aZ),i.rXU(ue.Z),i.rXU(Pi.u),i.rXU(gn._),i.rXU(vn.H),i.rXU(Nt.X),i.rXU(vo.w),i.rXU(pn),i.rXU(_n.k),i.rXU(_o.i),i.rXU(Oi.I),i.rXU(et.Bq),i.rXU(bo.B),i.rXU(bn.g),i.rXU(yo.L),i.rXU(Zt.Ix),i.rXU(Y.qQ),i.rXU(Fe.M),i.rXU(To.I))},t.\u0275cmp=i.VBU({type:t,selectors:[["app-video-editor-ui"]],viewQuery:function(e,r){if(1&e&&(i.GBs(dm,7),i.GBs(um,7),i.GBs(hm,7),i.GBs(mm,7),i.GBs(fm,7),i.GBs(pm,7),i.GBs(gm,7),i.GBs(vm,7),i.GBs(_m,7),i.GBs(bm,5),i.GBs(ym,5),i.GBs(Tm,5),i.GBs(km,7),i.GBs(Cm,5),i.GBs(xm,5),i.GBs(wm,5)),2&e){let s;i.mGM(s=i.lsd())&&(r.canvasWrapper=s.first),i.mGM(s=i.lsd())&&(r.canvasMaskWrapper=s.first),i.mGM(s=i.lsd())&&(r.mainCanvas=s.first),i.mGM(s=i.lsd())&&(r.canvasMaskWrapperLoaded=s.first),i.mGM(s=i.lsd())&&(r.canvasBackgroun
1d=s.first),i.mGM(s=i.lsd())&&(r.previewCanvas=s.first),i.mGM(s=i.lsd())&&(r.canvasPreview=s.first),i.mGM(s=i.lsd())&&(r.page=s.first),i.mGM(s=i.lsd())&&(r.videoheader=s.first),i.mGM(s=i.lsd())&&(r.scrollContent=s.first),i.mGM(s=i.lsd())&&(r.veTimeline=s.first),i.mGM(s=i.lsd())&&(r.veTimelinescrollableDiv=s.first),i.mGM(s=i.lsd())&&(r.scrollableDiv=s.first),i.mGM(s=i.lsd())&&(r.navsdrawer=s.first),i.mGM(s=i.lsd())&&(r.editNavInner=s),i.mGM(s=i.lsd())&&(r.editNavUpper=s)}},hostBindings:function(e,r){1&e&&i.bIt("beforeunload",function(a){return r.unloadNotification(a)},!1,i.tSv)("keydown",function(a){return r.handleKeyboardEventDown(a)},!1,i.tSv)("keydown",function(a){return r.onKeyDown(a)})},features:[i.Jv_([ue.Z,de.x,Nt.X,{provide:Ce.n,useClass:Ce.B},so.D,pn]),i.Vt3],decls:40,vars:34,consts:[["page",""],["videoheader",""],["canvasWrapper",""],["canvasMaskWrapperLoaded",""],["canvasMaskWrapper",""],["mainCanvas",""],["previewCanvas",""],["canvasBackground",""],["navsdrawer",""],["editNavUpper",""],["editNavInner",""],["editNavContent",""],["scrollContent",""],["veTimeline",""],[1,"page","video-editor"],[1,"position-relative"],[3,"projectId","projectName","timelineController","activeTool"],["id","editor-view",1,"editor-view",3,"ngClass"],[1,"row","m-0","h-100","g-0",3,"ngClass"],[1,"col-i","left-panel",3,"ngClass"],[1,"row","m-0","h-100","g-0"],[1,"col-i","navs","h-100","d-flex","justify-content-center",2,"z-index","1"],[1,"w-100",3,"toggleSliderEvent","activeTool","sldBtn","projectType","tools"],[1,"col-i","navs-drawer","h-100","overflow-hidden",3,"hidden","ngClass"],["class","drawer-container col-animate",3,"ngSwitch","click",4,"ngIf"],[1,"col-i","wrapper-for-timeline",2,"position","relative",3,"click","ngClass"],["style","position:absolute;z-index:99;\n margin-top: 16px;height:calc(100% - 14rem);padding-left:8px;","class","d-flex flex-column text-center justify-content-center",4,"ngIf"],[1,"row","no-margin","main-content",2,"display","inline-flex","width","100%","height","calc(100% - 186px)"],[1,"canvas-wrapper","ps-0","pe-0","position-relative"],[1,"canvas-mask-wrapper","not-loaded","position-relative"],[2,"width","fit-content","margin","auto","position","relative"],[3,"ngClass"],["class","position-absolute w-100","style","bottom: 20px; z-index: 99;",4,"ngIf"],["id","vmx-canvas",3,"hidden"],[1,"position-absolute","w-100",2,"top","0",3,"hidden"],["id","vmx-canvas"],["class","text-normal text-semi","style","position: absolute;\n top: 45%;\n left: 45%;",4,"ngIf"],["class","canvas-progress",4,"ngIf"],["id","ram","style","position:absolute; padding: 10px 0;opacity:1","class","canvas-progress",4,"ngIf"],["class","canvas-progress ","style","background:transparent;opacity: 1;display: flex;",4,"ngIf"],["class","loader",4,"ngIf"],[2,"z-index","999","position","absolute","top","0"],[1,"bottom-panel-wrapper","position-absolute","bottom-0"],["class","row bottom-panel g-0",4,"ngIf"],[1,"drawer-container","col-animate",3,"click","ngSwitch"],[1,"child-drawer",3,"ngClass"],[3,"bgColor","socialPlatformId","layoutFormats","isLoaded","changeColorEvent","layoutSelectEvent",4,"ngSwitchCase"],[3,"editorType","activePane","progressChanged",4,"ngSwitchCase"],[4,"ngSwitchCase"],[3,"activePane","activePaneChange",4,"ngSwitchCase"],[3,"activePane",4,"ngSwitchCase"],[3,"sceneAudio","sceneResized",4,"ngSwitchCase"],[3,"activePane","activeObject",4,"ngSwitchCase"],[3,"activeObject",4,"ngSwitchCase"],[3,"isPlay","activePane","activeObject",4,"ngSwitchCase"],[3,"inBackgroundAdjustMode","videoEditMute",4,"ngSwitchCase"],[3,"activePane","activeObject","changeAudioDuration",4,"ngSwitchCase"],[3,"changeColorEvent","layoutSelectEvent","bgColor","socialPlatformId","layoutFormats","isLoaded"],[3,"progressChanged","editorType","activePane"],[3,"activePaneChange","activePane"],[3,"activePane"],[3,"sceneAudio","sceneResized"],[3,"activePane","activeObject"],[3,"activeObject"],[3,"isPlay","activePane","activeObject"],[3,"videoEditMute","inBackgroundAdjustMode"],[3,"changeAudioDuration","activePane","activeObject"],[1,"d-flex","flex-column","text-center","justify-content-center",2,"position","absolute","z-index","99","margin-top","16px","height","calc(100% - 14rem)","padding-left","8px"],[1,"d-flex","flex-column","text-center","justify-content-center","verticle-scroll","editNavInner",2,"align-self","start","position","relative","width","100%","max-height","100%"],["class","btn-up",3,"click",4,"ngIf"],["track","all",1,"canvas-action-left-tools","text-semi"],[3,"ngClass","ngStyle"],[3,"class","ngClass","click",4,"ngFor","ngForOf"],["class","btn-down",3,"click",4,"ngIf"],["class","canvas-action-left-tools sub-panel",3,"mousedown",4,"ngIf"],["class","canvas-action-left-tools sub-panel",4,"ngIf"],[1,"btn-up",3,"click"],["name","arrownext",1,"f-16"],[3,"click","ngClass"],["placement","top",1,"mt-3",3,"ngClass"],[1,"f-24",3,"name"],[1,"btn-down",3,"click"],["name","arrowprev",1,"f-16"],[1,"canvas-action-left-tools","sub-panel",3,"mousedown"],[3,"activeObject","verticalOrientation"],[1,"canvas-action-left-tools","sub-panel"],[3,"verticalOrientation","imageFilterUtil"],[1,"position-absolute","w-100",2,"bottom","20px","z-index","99"],[1,"btn","btn-primary","btn-h40","align-items-center","text-13",2,"border-radius","20px","padding","0.35rem 1rem","display","inline-flex"],["name","dragImageOpen",1,"f-28","me-1"],[1,"text-normal","text-semi",2,"position","absolute","top","45%","left","45%"],[1,"canvas-progress"],[1,"inner"],["role","status",1,"spinner-border","spinner-border-lg"],[1,"sr-only","text-nowrap","border-0","position-absolute","overflow-hidden"],["id","ram",1,"canvas-progress",2,"position","absolute","padding","10px 0","opacity","1"],[2,"width","100%","height","100%","opacity","1",3,"ngStyle"],[1,"canvas-progress",2,"background","transparent","opacity","1","display","flex"],[1,"pi-overlay-backdrop"],[1,"dl-progress","p-12"],["type","primary","textType","white",3,"value","showValue"],[1,"d-block","text-normal","text-bold"],[1,"btn","btn-outline-primary","h-40","mt-10","text-normal",2,"width","150px",3,"click"],[1,"loader"],[1,"cdk-overlay-backdrop","cdk-overlay-dark-backdrop","cdk-overlay-backdrop-showing"],[1,"loader-inner"],[1,"row","bottom-panel","g-0"],["ve-trackitem-resize","",3,"endResizing","movingResize"],[3,"changeEditMode","changeShowGrid","playing","undo","redo","activeObject","timeline","init","sceneController"]],template:function(e,r){if(1&e){const s=i.RV6();i.j41(0,"div",14,0),i.nrm(2,"app-top-strip",15)(3,"editor-header",16,1),i.j41(5,"div",17)(6,"div",18)(7,"aside",19)(8,"div",20)(9,"div",21)(10,"toolbar-navigation",22),i.bIt("toggleSliderEvent",function(l){return i.eBV(s),i.Njj(r.toggleSliderOpen(l))}),i.k0s()(),i.j41(11,"div",23),i.DNE(12,Jm,25,52,"div",24),i.k0s()()(),i.j41(13,"div",25),i.bIt("click",function(l){return i.eBV(s),i.Njj(r.canvasWrapperClick(l))}),i.DNE(14,rf,14,11,"div",26),i.j41(15,"div",27)(16,"div",28,2)(18,"div",29,3)(20,"div",30,4)(22,"div",31),i.DNE(23,of,4,0,"div",32),i.j41(24,"canvas",33,5),i.EFF(26," Your browser does not support the HTML5 canvas tag. "),i.k0s(),i.j41(27,"div",34)(28,"canvas",35,6),i.EFF(30," Your browser does not support the HTML5 canvas tag. "),i.k0s()(),i.DNE(31,sf,2,0,"div",36),i.k0s(),i.DNE(32,af,5,0,"div",37),i.k0s(),i.DNE(33,lf,6,3,"div",38),i.k0s(),i.DNE(34,cf,9,2,"div",39)(35,df,3,0,"div",40),i.nrm(36,"div",41,7),i.k0s()()(),i.j41(38,"div",42),i.DNE(39,uf,4,4,"div",43),i.k0s()()()()}2&e&&(i.R7$(3),i.Y8G("projectId",r.projectId)("projectName",null==r.sce
1neController.design?null:r.sceneController.design.name)("timelineController",r.timelineController)("activeTool",r.activeToolPanel),i.R7$(2),i.Y8G("ngClass",i.eq3(26,Mm,r.timelineCollapse)),i.R7$(),i.Y8G("ngClass",i.eq3(28,Im,r.isLayersVisible)),i.R7$(),i.Y8G("ngClass",r.sldBtn?"":"widthAdded"),i.R7$(3),i.Y8G("activeTool",r.activeToolPanel)("sldBtn",r.sldBtn)("projectType",r.projectType)("tools",r.navTools),i.R7$(),i.Y8G("hidden",!r.sldBtn)("ngClass",i.eq3(30,Em,"project"==r.activeToolPanel)),i.R7$(),i.Y8G("ngIf",r.activeToolPanel),i.R7$(),i.Y8G("ngClass",r.sldBtn?"":"widthRemoved ps-0"),i.R7$(),i.Y8G("ngIf",r.editNavs&&r.editNavs.length>0),i.R7$(8),i.Y8G("ngClass",i.eq3(32,Pm,r.isLoaded)),i.R7$(),i.Y8G("ngIf",r.dragImageOpenFlag),i.R7$(),i.Y8G("hidden",r.isEdit),i.R7$(3),i.Y8G("hidden",!r.isEdit),i.R7$(4),i.Y8G("ngIf",!r.isLoaded),i.R7$(),i.Y8G("ngIf",r.sceneController.inProgress),i.R7$(),i.Y8G("ngIf",r.templateService.undoRedoInprogress),i.R7$(),i.Y8G("ngIf",r.sceneController.inProgressCount>-1),i.R7$(),i.Y8G("ngIf",r.inProgress),i.R7$(4),i.Y8G("ngIf",r.timelineController))},dependencies:[Y.YU,Y.Sq,Y.bT,Y.B3,Y.ux,Y.e1,et.EH,ko.y,Co.V,xo.u,qt.b,wo.T,Mo.i,Io.x,Eo.y,Po.G,Oo.g,So.h,Ao.C,jo.N,Do.P,Ro.R,Vo.I,No.U,Lo,zo.Z,Ko,Ts,Ps,am,cm],styles:[".loaded[_ngcontent-%COMP%]{box-shadow:0 0 12px #0000001a}.editor-view[_ngcontent-%COMP%]{min-width:920px}.btn-play[_ngcontent-%COMP%]{border-radius:50%;padding:10px;background:url(https://static.lightxeditor.com/assets/icons/play.svg) no-repeat}.canvas-loader[_ngcontent-%COMP%], .scene-preview-back[_ngcontent-%COMP%]{position:fixed;width:100%;height:100%;top:0;left:0;background:#000c;z-index:10000}.bottom-panel-wrapper[_ngcontent-%COMP%]{box-shadow:0 0 12px #0000001a;left:80px;z-index:99;width:calc(100% - 80px)}.collapse-header[_ngcontent-%COMP%]{padding:1rem;border-bottom:solid 2px #e2e2e6}.timeline-canvas-wrapper[_ngcontent-%COMP%]{width:calc(100% - 51px);height:200px;overflow-x:auto}.timeline[_ngcontent-%COMP%]{width:100%}.bottom-panel[_ngcontent-%COMP%]{width:100%;display:block;background:#fff;overflow:hidden}.time-duration-container[_ngcontent-%COMP%]{border-radius:6px;width:118px;height:40px;background-color:#fff;border:solid 2px #475ae7}.time-duration-container[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{padding:0rem .5rem}.time-duration-container[_ngcontent-%COMP%] .btn.textblue[_ngcontent-%COMP%]{color:#475ae7}.layer-text[_ngcontent-%COMP%]{position:absolute;margin-top:64px}.collapse-header[_ngcontent-%COMP%]{padding:11px;border-bottom:1px solid #E2E3E9}.canvas-mask-wrapper[_ngcontent-%COMP%]{display:inline-flex;overflow:auto}.widthAdded[_ngcontent-%COMP%]{width:5.4rem}.widthRemoved[_ngcontent-%COMP%]{width:calc(100% - 5.4rem)}.widthRemoved.ps-0[_ngcontent-%COMP%]{padding-left:0!important}.layers-on[_ngcontent-%COMP%] .widthRemoved[_ngcontent-%COMP%]{width:calc(100% - 14.5rem)}.active[_ngcontent-%COMP%]{background:#626adf!important;border-radius:16px!important;color:#fff!important}.opacityactive[_ngcontent-%COMP%]{background:#626adf1a!important;color:#626adf!important;border-radius:16px!important}.opacitytext[_ngcontent-%COMP%], .nav-title-text[_ngcontent-%COMP%]{color:#626adf!important}.btn-bottom[_ngcontent-%COMP%]{width:40px;height:40px;padding:0rem;border-radius:12px;background:transparent}.canvas-progress[_ngcontent-%COMP%]{z-index:999;position:absolute;top:0;height:100%;width:100%;background:#fff;opacity:.7}.canvas-progress[_ngcontent-%COMP%] .inner[_ngcontent-%COMP%]{color:#898b8a;position:absolute;top:45%;left:45%}.dl-progress[_ngcontent-%COMP%]{width:320px;margin:auto;position:relative;background:#fff;opacity:.95}.pi-overlay-backdrop[_ngcontent-%COMP%]{position:fixed;height:100%;width:100%;top:0;left:0;background:#000c}.canvas-wrapper[_ngcontent-%COMP%]{position:relative}.audio-des[_ngcontent-%COMP%] .audio-n[_ngcontent-%COMP%]{font-size:16px;line-height:22px}.audio-des[_ngcontent-%COMP%] .audio-t[_ngcontent-%COMP%]{font-size:14px;line-height:19px;color:#000}.navs-drawer[_ngcontent-%COMP%] .drawer-container[_ngcontent-%COMP%]{height:calc(100% - 186px);position:relative;display:block}"]}),n})(),canDeactivate:[Ci.M]}];let mf=(()=>{var t;class n{}return(t=n).\u0275fac=function(e){return new(e||t)},t.\u0275mod=i.$C({type:t}),t.\u0275inj=i.G2t({imports:[Zt.iI.forChild(hf),Zt.iI]}),n})();var ff=p(13690),pf=p(35938),gf=p(21301),vf=p(77609),_f=p(38020),bf=p(75270),yf=p(38270),Tf=p(24139),kf=p(2043),Cf=p(7819);let xf=(()=>{var t;class n{constructor(e,r,s,a,l){this.textJsonParser=e,this.mediaJsonParser=r,this.lottieJsonParser=s,this.videoRepository=a,this.ngZone=l}
1parseScene(e,r,s=!1,a,l=!1,c=null){return new Promise((d,u)=>{let h=e.designItems.length,f=0;const m=[],T=[],b=[],_=[],v=new ff.Z(e,this.videoRepository,this.ngZone);v.onMediaAdjust=a;const C=()=>{T.forEach(y=>_.push(y)),b.forEach(y=>_.push(y)),m.forEach(y=>_.push(y)),v.setDesignItemList(_),this.isAnimatable(e)&&s&&v.setSceneAnimationEditUtil(new _f.f(v,c))};if(e.bgImageObj){let y,w;h+=1,r.clipPath?(y=r.clipPath.width,w=r.clipPath.height):(y=r.width/r.viewportTransform[0],w=r.height/r.viewportTransform[3]);const x=new bf.b(e.bgImageObj,y,w,0,0,this.videoRepository);x.parseBG(l).then(()=>{v.setbackgroundMedia(x),f+=1,f===h&&(C(),d(v))}).catch(()=>{u()})}else 0===h&&(v.setDesignItemList(_),d(v));e.designItems.forEach(y=>{y.itemType===It.SP.CANVAS&&this.textJsonParser.parseDesignItemCanvas(y,r).then(w=>{w.setCanvasRatio(v.widthRatio,v.heightRatio),T.push(w),f+=1,f===h&&(C(),d(v))}),y.itemType===It.SP.MEDIA_CONTAINER&&this.mediaJsonParser.parseDesignItemCanvas(y,r,l).then(w=>{w.setCanvasRatio(v.widthRatio,v.heightRatio),b.push(w),f+=1,f===h&&(C(),d(v))}),y.itemType===It.SP.LOTTIE&&this.lottieJsonParser.parseDesignItemLottie(y,r).then(w=>{w.setCanvasRatio(v.widthRatio,v.heightRatio),m.push(w),f+=1,f===h&&(C(),d(v))})})})}isAnimatable(e){let r=!0;if(e.designItems&&e.designItems.length>0)for(const s of e.designItems)s.box?s.box.animationMapArr||(r=!1):s.canvas?s.canvas.animationMapArr||(r=!1):s.lottie&&(s.lottie.animationMapArr||(r=!1));else r=!1;return r}parseVideoProject(e){for(let r=0;r<e.scenes.length;r++){let s=e.scenes[r];for(let a=0;a<s.tracks.length;a++);}}parseTrackItem(e){}parseProject(e,r,s,a,l=!1,c=null){return new Promise((d,u)=>{var h=[];let f=0;for(const m of e.sceneItems)h[f]=this.parseScene(m,r,s,a,l,c),f++;Promise.all(h).then(m=>d(m)).catch(()=>{u()})})}parseAnimation(e,r=!1){const s=new Map;for(const l of e.getDesignItemList())if(l.getDesignItem().itemType===It.SP.CANVAS){const c=l,d=new gf.R(c,c.getAnimationMapArr(),s);c.setAnimationObj(d)}else if(l.getDesignItem().itemType===It.SP.MEDIA_CONTAINER){const c=l,d=new vf.e(c,c.getAnimationMapArr(),s,r);c.setAnimationObj(d)}else if(l.getDesignItem().itemType===It.SP.LOTTIE){const c=l,d=new yf.a(c,c.getAnimationMapArr(),s,r);c.setAnimationObj(d)}const a=new pf.f(e,s);e.setSceneAnimation(a)}parseProjectWithAnimation(e,r){return new Promise((s,a)=>{let l=[];var c=[];e.sceneItems.forEach(d=>{c.push(this.parseScene(d,r,!1).then(u=>{l.push(u)}))}),Promise.all(c).then(()=>s(l))})}}return(t=n).\u0275fac=function(e){return new(e||t)(i.KVO(Tf.d),i.KVO(kf.Q),i.KVO(Cf.j),i.KVO(Ei.I),i.KVO(i.SKi))},t.\u0275prov=i.jDH({token:t,factory:t.\u0275fac}),n})();var wf=p(77183),Mf=p(23679),no=p(345),If=p(30832);class ro extends no.EZ{constructor(){super(...arguments),this.overrides={pinch:{enable:!0}}}}let Ef=(()=>{var t;class n{}return(t=n).\u0275fac=function(e){return new(e||t)},t.\u0275mod=i.$C({type:t}),t.\u0275inj=i.G2t({providers:[{provide:nt.a7,useClass:at.z,multi:!0},{provide:no.kQ,useClass:ro},mt._,Ot._,ki.d,xf,Mi.Zg,(0,nt.$R)((0,nt.Sx)())],imports:[Y.MD,st.G,et.UN,J.YN,J.X1,mf,rt.s,_t.RI,L.MQ,Z.di,X.mB.forRoot(),G.YG,ct,Xt.R,jt.r,bi.K,yi.S,Ti.K,wf.f,Mf.Y,If._,Si.v9]}),n})()},43387:(Yt,ft,p)=>{p.d(ft,{y:()=>J});var Y=p(54438);let J=(()=>{var st;class _t{}return(st=_t).\u0275fac=function(at){return new(at||st)},st.\u0275mod=Y.$C({type:st}),st.\u0275inj=Y.G2t({}),_t})()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.