diff --git a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/.gitattributes b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/.gitattributes new file mode 100644 index 0000000..8bca8e4 --- /dev/null +++ b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/.gitattributes @@ -0,0 +1,8 @@ +# Ignore HTML files in Resources and subdirectories +Resources/**/*.html linguist-vendored + +# Ignore CSS files in Resources and subdirectories +Resources/**/*.css linguist-vendored + +# Ignore JS files in Resources and subdirectories +Resources/**/*.js linguist-vendored diff --git a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/QuickLook.Plugin.ImageViewer.csproj b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/QuickLook.Plugin.ImageViewer.csproj index 7ddf26d..3e7687f 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/QuickLook.Plugin.ImageViewer.csproj +++ b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/QuickLook.Plugin.ImageViewer.csproj @@ -92,7 +92,7 @@ - + QuickLook.Plugin.ImageViewer.Resources.%(RecursiveDir)%(Filename)%(Extension) diff --git a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Resources/Web/lottie2html.js b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Resources/Web/js/lottie2html.js similarity index 100% rename from QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Resources/Web/lottie2html.js rename to QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Resources/Web/js/lottie2html.js diff --git a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Resources/Web/svg2html.js b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Resources/Web/js/svg2html.js similarity index 100% rename from QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Resources/Web/svg2html.js rename to QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Resources/Web/js/svg2html.js diff --git a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Resources/Web/svga2html.js b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Resources/Web/js/svga2html.js similarity index 100% rename from QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Resources/Web/svga2html.js rename to QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Resources/Web/js/svga2html.js diff --git a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Resources/Web/lottie-web/lottie.min.js b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Resources/Web/lottie-web/lottie.min.js new file mode 100644 index 0000000..0510559 --- /dev/null +++ b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Resources/Web/lottie-web/lottie.min.js @@ -0,0 +1 @@ +"undefined"!=typeof document&&"undefined"!=typeof navigator&&function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).lottie=e()}(this,(function(){"use strict";var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(t){_useWebWorker=!!t},getWebWorker=function(){return _useWebWorker},setLocationHref=function(t){locationHref=t},getLocationHref=function(){return locationHref};function createTag(t){return document.createElement(t)}function extendPrototype(t,e){var i,r,s=t.length;for(i=0;i1?i[1]=1:i[1]<=0&&(i[1]=0),HSVtoRGB(i[0],i[1],i[2])}function addBrightnessToRGB(t,e){var i=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return i[2]+=e,i[2]>1?i[2]=1:i[2]<0&&(i[2]=0),HSVtoRGB(i[0],i[1],i[2])}function addHueToRGB(t,e){var i=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return i[0]+=e/360,i[0]>1?i[0]-=1:i[0]<0&&(i[0]+=1),HSVtoRGB(i[0],i[1],i[2])}var rgbToHex=function(){var t,e,i=[];for(t=0;t<256;t+=1)e=t.toString(16),i[t]=1===e.length?"0"+e:e;return function(t,e,r){return t<0&&(t=0),e<0&&(e=0),r<0&&(r=0),"#"+i[t]+i[e]+i[r]}}(),setSubframeEnabled=function(t){subframeEnabled=!!t},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(t){expressionsPlugin=t},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(t){expressionsInterfaces=t},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(t){defaultCurveSegments=t},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(t){idPrefix$1=t},getIdPrefix=function(){return idPrefix$1};function createNS(t){return document.createElementNS(svgNS,t)}function _typeof$5(t){return _typeof$5="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof$5(t)}var dataManager=function(){var t,e,i=1,r=[],s={onmessage:function(){},postMessage:function(e){t({data:e})}},a={postMessage:function(t){s.onmessage({data:t})}};function n(){e||(e=function(e){if(window.Worker&&window.Blob&&getWebWorker()){var i=new Blob(["var _workerSelf = self; self.onmessage = ",e.toString()],{type:"text/javascript"}),r=URL.createObjectURL(i);return new Worker(r)}return t=e,s}((function(t){if(a.dataManager||(a.dataManager=function(){function t(s,a){var n,o,h,l,p,m,c=s.length;for(o=0;o=0;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)r(t[e].ks.k);else for(a=t[e].ks.k.length,s=0;si[0]||!(i[0]>t[0])&&(t[1]>i[1]||!(i[1]>t[1])&&(t[2]>i[2]||!(i[2]>t[2])&&null))}var a,n=function(){var t=[4,4,14];function e(t){var e,i,r,s=t.length;for(e=0;e=0;i-=1)if("sh"===t[i].ty)if(t[i].ks.k.i)t[i].ks.k.c=t[i].closed;else for(s=t[i].ks.k.length,r=0;r500)&&(this._imageLoaded(),clearInterval(i)),e+=1}.bind(this),50)}function a(t){var e={assetData:t},i=r(t,this.assetsPath,this.path);return dataManager.loadData(i,function(t){e.img=t,this._footageLoaded()}.bind(this),function(){e.img={},this._footageLoaded()}.bind(this)),e}function n(){this._imageLoaded=e.bind(this),this._footageLoaded=i.bind(this),this.testImageLoaded=s.bind(this),this.createFootageData=a.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return n.prototype={loadAssets:function(t,e){var i;this.imagesLoadedCb=e;var r=t.length;for(i=0;ithis.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,i,r=this.animationData.layers,s=r.length,a=t.layers,n=a.length;for(i=0;ithis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(!1!==this.isLoaded&&this.renderer)try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},AnimationItem.prototype.play=function(t){t&&this.name!==t||!0===this.isPaused&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(t){t&&this.name!==t||!1===this.isPaused&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(t){t&&this.name!==t||(!0===this.isPaused?this.play():this.pause())},AnimationItem.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(t){for(var e,i=0;i=this.totalFrames-1&&this.frameModifier>0?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(i=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(i=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(e),i&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(t,e){var i=-1;this.isPaused&&(this.currentRawFrame+this.firstFramee&&(i=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,-1!==i&&this.goToAndStop(i,!0)},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),"object"===_typeof$4(t[0])){var i,r=t.length;for(i=0;i=0;i-=1)e[i].animation.destroy(t)},t.freeze=function(){n=!0},t.unfreeze=function(){n=!1,d()},t.setVolume=function(t,i){var s;for(s=0;s=.001?function(t,e,i,r){for(var s=0;s<4;++s){var a=l(e,i,r);if(0===a)return e;e-=(h(e,i,r)-t)/a}return e}(t,f,e,s):0===m?f:function(t,e,i,r,s){var a,n,o=0;do{(a=h(n=e+(i-e)/2,r,s)-t)>0?i=n:e=n}while(Math.abs(a)>1e-7&&++o<10);return n}(t,n,n+r,e,s)}},t}(),pooling={double:function(t){return t.concat(createSizedArray(t.length))}},poolFactory=function(t,e,i){var r=0,s=t,a=createSizedArray(s);return{newElement:function(){return r?a[r-=1]:e()},release:function(t){r===s&&(a=pooling.double(a),s*=2),i&&i(t),a[r]=t,r+=1}}},bezierLengthPool=poolFactory(8,(function(){return{addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}})),segmentsLengthPool=poolFactory(8,(function(){return{lengths:[],totalLength:0}}),(function(t){var e,i=t.lengths.length;for(e=0;e-.001&&n<.001}var i=function(t,e,i,r){var s,a,n,o,h,l,p=getDefaultCurveSegments(),f=0,m=[],c=[],d=bezierLengthPool.newElement();for(n=i.length,s=0;sn?-1:1,l=!0;l;)if(r[a]<=n&&r[a+1]>n?(o=(n-r[a])/(r[a+1]-r[a]),l=!1):a+=h,a<0||a>=s-1){if(a===s-1)return i[a];l=!1}return i[a]+(i[a+1]-i[a])*o}var h=createTypedArray("float32",8);return{getSegmentsLength:function(t){var e,r=segmentsLengthPool.newElement(),s=t.c,a=t.v,n=t.o,o=t.i,h=t._length,l=r.lengths,p=0;for(e=0;e1&&(a=1);var p,f=o(a,l),m=o(n=n>1?1:n,l),c=e.length,d=1-f,u=1-m,y=d*d*d,g=f*d*d*3,v=f*f*d*3,b=f*f*f,x=d*d*u,P=f*d*u+d*f*u+d*d*m,E=f*f*u+d*f*m+f*d*m,S=f*f*m,C=d*u*u,_=f*u*u+d*m*u+d*u*m,A=f*m*u+d*m*m+f*u*m,T=f*m*m,M=u*u*u,k=m*u*u+u*m*u+u*u*m,D=m*m*u+u*m*m+m*u*m,F=m*m*m;for(p=0;pc?m>d?m-c-d:d-c-m:d>c?d-c-m:c-m-d)>-1e-4&&f<1e-4}}}var bez=bezFunction(),initFrame=initialDefaultFrame,mathAbs=Math.abs;function interpolateValue(t,e){var i,r=this.offsetTime;"multidimensional"===this.propType&&(i=createTypedArray("float32",this.pv.length));for(var s,a,n,o,h,l,p,f,m,c=e.lastIndex,d=c,u=this.keyframes.length-1,y=!0;y;){if(s=this.keyframes[d],a=this.keyframes[d+1],d===u-1&&t>=a.t-r){s.h&&(s=a),c=0;break}if(a.t-r>t){c=d;break}d=v||t=v?x.points.length-1:0;for(h=x.points[P].point.length,o=0;o=C&&S=v)i[0]=g[0],i[1]=g[1],i[2]=g[2];else if(t<=b)i[0]=s.s[0],i[1]=s.s[1],i[2]=s.s[2];else{quaternionToEuler(i,slerp(createQuaternion(s.s),createQuaternion(g),(t-b)/(v-b)))}else for(d=0;d=v?l=1:t1e-6?(r=Math.acos(s),a=Math.sin(r),n=Math.sin((1-i)*r)/a,o=Math.sin(i*r)/a):(n=1-i,o=i),h[0]=n*l+o*c,h[1]=n*p+o*d,h[2]=n*f+o*u,h[3]=n*m+o*y,h}function quaternionToEuler(t,e){var i=e[0],r=e[1],s=e[2],a=e[3],n=Math.atan2(2*r*a-2*i*s,1-2*r*r-2*s*s),o=Math.asin(2*i*r+2*s*a),h=Math.atan2(2*i*a-2*r*s,1-2*i*i-2*s*s);t[0]=n/degToRads,t[1]=o/degToRads,t[2]=h/degToRads}function createQuaternion(t){var e=t[0]*degToRads,i=t[1]*degToRads,r=t[2]*degToRads,s=Math.cos(e/2),a=Math.cos(i/2),n=Math.cos(r/2),o=Math.sin(e/2),h=Math.sin(i/2),l=Math.sin(r/2);return[o*h*n+s*a*l,o*a*n+s*h*l,s*h*n-o*a*l,s*a*n-o*h*l]}function getValueAtCurrentTime(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,i=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=i&&t>=i||this._caching.lastFrame=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var r=this.interpolateValue(t,this._caching);this.pv=r}return this._caching.lastFrame=t,this.pv}function setVValue(t){var e;if("unidimensional"===this.propType)e=t*this.mult,mathAbs(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);else for(var i=0,r=this.v.length;i1e-5&&(this.v[i]=e,this._mdf=!0),i+=1}function processEffectsSequence(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var t;this.lock=!0,this._mdf=this._isFirstFrame;var e=this.effectsSequence.length,i=this.kf?this.pv:this.data.k;for(t=0;t=this._maxLength&&this.doubleArrayLength(),i){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o;break;default:a=[]}(!a[r]||a[r]&&!s)&&(a[r]=pointPool.newElement()),a[r][0]=t,a[r][1]=e},ShapePath.prototype.setTripleAt=function(t,e,i,r,s,a,n,o){this.setXYAt(t,e,"v",n,o),this.setXYAt(i,r,"o",n,o),this.setXYAt(s,a,"i",n,o)},ShapePath.prototype.reverse=function(){var t=new ShapePath;t.setPathData(this.c,this._length);var e=this.v,i=this.o,r=this.i,s=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],r[0][0],r[0][1],i[0][0],i[0][1],0,!1),s=1);var a,n=this._length-1,o=this._length;for(a=s;a=c[c.length-1].t-this.offsetTime)r=c[c.length-1].s?c[c.length-1].s[0]:c[c.length-2].e[0],a=!0;else{for(var d,u,y,g=m,v=c.length-1,b=!0;b&&(d=c[g],!((u=c[g+1]).t-this.offsetTime>t));)g=u.t-this.offsetTime)p=1;else if(tr&&e>r)||(this._caching.lastIndex=s0||t>-1e-6&&t<0?r(1e4*t)/1e4:t}function I(){var t=this.props;return"matrix("+w(t[0])+","+w(t[1])+","+w(t[4])+","+w(t[5])+","+w(t[12])+","+w(t[13])+")"}return function(){this.reset=s,this.rotate=a,this.rotateX=n,this.rotateY=o,this.rotateZ=h,this.skew=p,this.skewFromAxis=f,this.shear=l,this.scale=m,this.setTransform=c,this.translate=d,this.transform=u,this.multiply=y,this.applyToPoint=P,this.applyToX=E,this.applyToY=S,this.applyToZ=C,this.applyToPointArray=k,this.applyToTriplePoints=M,this.applyToPointStringified=D,this.toCSS=F,this.to2dCSS=I,this.clone=b,this.cloneFromProps=x,this.equals=v,this.inversePoints=T,this.inversePoint=A,this.getInverseMatrix=_,this._t=this.transform,this.isIdentity=g,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();function _typeof$3(t){return _typeof$3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof$3(t)}var lottie={},standalone="__[STANDALONE]__",animationData="__[ANIMATIONDATA]__",renderer="";function setLocation(t){setLocationHref(t)}function searchAnimations(){!0===standalone?animationManager.searchAnimations(animationData,standalone,renderer):animationManager.searchAnimations()}function setSubframeRendering(t){setSubframeEnabled(t)}function setPrefix(t){setIdPrefix(t)}function loadAnimation(t){return!0===standalone&&(t.animationData=JSON.parse(animationData)),animationManager.loadAnimation(t)}function setQuality(t){if("string"==typeof t)switch(t){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10)}else!isNaN(t)&&t>1&&setDefaultCurveSegments(t);getDefaultCurveSegments()>=50?roundValues(!1):roundValues(!0)}function inBrowser(){return"undefined"!=typeof navigator}function installPlugin(t,e){"expressions"===t&&setExpressionsPlugin(e)}function getFactory(t){switch(t){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}function checkReady(){"complete"===document.readyState&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(t){for(var e=queryString.split("&"),i=0;i=1?a.push({s:t-1,e:e-1}):(a.push({s:t,e:1}),a.push({s:0,e:e-1}));var n,o,h=[],l=a.length;for(n=0;nr+i))p=o.s*s<=r?0:(o.s*s-r)/i,f=o.e*s>=r+i?1:(o.e*s-r)/i,h.push([p,f])}return h.length||h.push([0,0]),h},TrimModifier.prototype.releasePathsData=function(t){var e,i=t.length;for(e=0;e1?1+a:this.s.v<0?0+a:this.s.v+a)>(i=this.e.v>1?1+a:this.e.v<0?0+a:this.e.v+a)){var n=e;e=i,i=n}e=1e-4*Math.round(1e4*e),i=1e-4*Math.round(1e4*i),this.sValue=e,this.eValue=i}else e=this.sValue,i=this.eValue;var o,h,l,p,f,m=this.shapes.length,c=0;if(i===e)for(s=0;s=0;s-=1)if((d=this.shapes[s]).shape._mdf){for((u=d.localShapeCollection).releaseShapes(),2===this.m&&m>1?(g=this.calculateShapeEdges(e,i,d.totalShapeLength,x,c),x+=d.totalShapeLength):g=[[v,b]],h=g.length,o=0;o=1?y.push({s:d.totalShapeLength*(v-1),e:d.totalShapeLength*(b-1)}):(y.push({s:d.totalShapeLength*v,e:d.totalShapeLength}),y.push({s:0,e:d.totalShapeLength*(b-1)}));var P=this.addShapes(d,y[0]);if(y[0].s!==y[0].e){if(y.length>1)if(d.shape.paths.shapes[d.shape.paths._length-1].c){var E=P.pop();this.addPaths(P,u),P=this.addShapes(d,y[1],E)}else this.addPaths(P,u),P=this.addShapes(d,y[1]);this.addPaths(P,u)}}d.shape.paths=u}}},TrimModifier.prototype.addPaths=function(t,e){var i,r=t.length;for(i=0;ie.e){i.c=!1;break}e.s<=d&&e.e>=d+n.addedLength?(this.addSegment(m[r].v[s-1],m[r].o[s-1],m[r].i[s],m[r].v[s],i,o,y),y=!1):(l=bez.getNewSegment(m[r].v[s-1],m[r].v[s],m[r].o[s-1],m[r].i[s],(e.s-d)/n.addedLength,(e.e-d)/n.addedLength,h[s-1]),this.addSegmentFromArray(l,i,o,y),y=!1,i.c=!1),d+=n.addedLength,o+=1}if(m[r].c&&h.length){if(n=h[s-1],d<=e.e){var g=h[s-1].addedLength;e.s<=d&&e.e>=d+g?(this.addSegment(m[r].v[s-1],m[r].o[s-1],m[r].i[0],m[r].v[0],i,o,y),y=!1):(l=bez.getNewSegment(m[r].v[s-1],m[r].v[0],m[r].o[s-1],m[r].i[0],(e.s-d)/g,(e.e-d)/g,h[s-1]),this.addSegmentFromArray(l,i,o,y),y=!1,i.c=!1)}else i.c=!1;d+=n.addedLength,o+=1}if(i._length&&(i.setXYAt(i.v[p][0],i.v[p][1],"i",p),i.setXYAt(i.v[i._length-1][0],i.v[i._length-1][1],"o",i._length-1)),d>e.e)break;r=this.p.keyframes[this.p.keyframes.length-1].t?(r=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/i,0),s=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/i,0)):(r=this.p.pv,s=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/i,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){r=[],s=[];var a=this.px,n=this.py;a._caching.lastFrame+a.offsetTime<=a.keyframes[0].t?(r[0]=a.getValueAtTime((a.keyframes[0].t+.01)/i,0),r[1]=n.getValueAtTime((n.keyframes[0].t+.01)/i,0),s[0]=a.getValueAtTime(a.keyframes[0].t/i,0),s[1]=n.getValueAtTime(n.keyframes[0].t/i,0)):a._caching.lastFrame+a.offsetTime>=a.keyframes[a.keyframes.length-1].t?(r[0]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/i,0),r[1]=n.getValueAtTime(n.keyframes[n.keyframes.length-1].t/i,0),s[0]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/i,0),s[1]=n.getValueAtTime((n.keyframes[n.keyframes.length-1].t-.01)/i,0)):(r=[a.pv,n.pv],s[0]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/i,a.offsetTime),s[1]=n.getValueAtTime((n._caching.lastFrame+n.offsetTime-.01)/i,n.offsetTime))}else r=s=t;this.v.rotate(-Math.atan2(r[1]-s[1],r[0]-s[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}},autoOrient:function(){}},extendPrototype([DynamicPropertyContainer],e),e.prototype.addDynamicProperty=function(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0},e.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function(t,i,r){return new e(t,i,r)}}}();function RepeaterModifier(){}function RoundCornersModifier(){}function floatEqual(t,e){return 1e5*Math.abs(t-e)<=Math.min(Math.abs(t),Math.abs(e))}function floatZero(t){return Math.abs(t)<=1e-5}function lerp(t,e,i){return t*(1-i)+e*i}function lerpPoint(t,e,i){return[lerp(t[0],e[0],i),lerp(t[1],e[1],i)]}function quadRoots(t,e,i){if(0===t)return[];var r=e*e-4*t*i;if(r<0)return[];var s=-e/(2*t);if(0===r)return[s];var a=Math.sqrt(r)/(2*t);return[s-a,s+a]}function polynomialCoefficients(t,e,i,r){return[3*e-t-3*i+r,3*t-6*e+3*i,-3*t+3*e,t]}function singlePoint(t){return new PolynomialBezier(t,t,t,t,!1)}function PolynomialBezier(t,e,i,r,s){s&&pointEqual(t,e)&&(e=lerpPoint(t,r,1/3)),s&&pointEqual(i,r)&&(i=lerpPoint(t,r,2/3));var a=polynomialCoefficients(t[0],e[0],i[0],r[0]),n=polynomialCoefficients(t[1],e[1],i[1],r[1]);this.a=[a[0],n[0]],this.b=[a[1],n[1]],this.c=[a[2],n[2]],this.d=[a[3],n[3]],this.points=[t,e,i,r]}function extrema(t,e){var i=t.points[0][e],r=t.points[t.points.length-1][e];if(i>r){var s=r;r=i,i=s}for(var a=quadRoots(3*t.a[e],2*t.b[e],t.c[e]),n=0;n0&&a[n]<1){var o=t.point(a[n])[e];or&&(r=o)}return{min:i,max:r}}function intersectData(t,e,i){var r=t.boundingBox();return{cx:r.cx,cy:r.cy,width:r.width,height:r.height,bez:t,t:(e+i)/2,t1:e,t2:i}}function splitData(t){var e=t.bez.split(.5);return[intersectData(e[0],t.t1,t.t),intersectData(e[1],t.t,t.t2)]}function boxIntersect(t,e){return 2*Math.abs(t.cx-e.cx)=a||t.width<=r&&t.height<=r&&e.width<=r&&e.height<=r)s.push([t.t,e.t]);else{var n=splitData(t),o=splitData(e);intersectsImpl(n[0],o[0],i+1,r,s,a),intersectsImpl(n[0],o[1],i+1,r,s,a),intersectsImpl(n[1],o[0],i+1,r,s,a),intersectsImpl(n[1],o[1],i+1,r,s,a)}}function crossProduct(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function lineIntersection(t,e,i,r){var s=[t[0],t[1],1],a=[e[0],e[1],1],n=[i[0],i[1],1],o=[r[0],r[1],1],h=crossProduct(crossProduct(s,a),crossProduct(n,o));return floatZero(h[2])?null:[h[0]/h[2],h[1]/h[2]]}function polarOffset(t,e,i){return[t[0]+Math.cos(e)*i,t[1]-Math.sin(e)*i]}function pointDistance(t,e){return Math.hypot(t[0]-e[0],t[1]-e[1])}function pointEqual(t,e){return floatEqual(t[0],e[0])&&floatEqual(t[1],e[1])}function ZigZagModifier(){}function setPoint(t,e,i,r,s,a,n){var o=i-Math.PI/2,h=i+Math.PI/2,l=e[0]+Math.cos(i)*r*s,p=e[1]-Math.sin(i)*r*s;t.setTripleAt(l,p,l+Math.cos(o)*a,p-Math.sin(o)*a,l+Math.cos(h)*n,p-Math.sin(h)*n,t.length())}function getPerpendicularVector(t,e){var i=[e[0]-t[0],e[1]-t[1]],r=.5*-Math.PI;return[Math.cos(r)*i[0]-Math.sin(r)*i[1],Math.sin(r)*i[0]+Math.cos(r)*i[1]]}function getProjectingAngle(t,e){var i=0===e?t.length()-1:e-1,r=(e+1)%t.length(),s=getPerpendicularVector(t.v[i],t.v[r]);return Math.atan2(0,1)-Math.atan2(s[1],s[0])}function zigZagCorner(t,e,i,r,s,a,n){var o=getProjectingAngle(e,i),h=e.v[i%e._length],l=e.v[0===i?e._length-1:i-1],p=e.v[(i+1)%e._length],f=2===a?Math.sqrt(Math.pow(h[0]-l[0],2)+Math.pow(h[1]-l[1],2)):0,m=2===a?Math.sqrt(Math.pow(h[0]-p[0],2)+Math.pow(h[1]-p[1],2)):0;setPoint(t,e.v[i%e._length],o,n,r,m/(2*(s+1)),f/(2*(s+1)),a)}function zigZagSegment(t,e,i,r,s,a){for(var n=0;n1&&e.length>1&&(s=getIntersection(t[0],e[e.length-1]))?[[t[0].split(s[0])[0]],[e[e.length-1].split(s[1])[1]]]:[i,r]}function pruneIntersections(t){for(var e,i=1;i1&&(e=pruneSegmentIntersection(t[t.length-1],t[0]),t[t.length-1]=e[0],t[0]=e[1]),t}function offsetSegmentSplit(t,e){var i,r,s,a,n=t.inflectionPoints();if(0===n.length)return[offsetSegment(t,e)];if(1===n.length||floatEqual(n[1],1))return i=(s=t.split(n[0]))[0],r=s[1],[offsetSegment(i,e),offsetSegment(r,e)];i=(s=t.split(n[0]))[0];var o=(n[1]-n[0])/(1-n[0]);return a=(s=s[1].split(o))[0],r=s[1],[offsetSegment(i,e),offsetSegment(a,e),offsetSegment(r,e)]}function OffsetPathModifier(){}function getFontProperties(t){for(var e=t.fStyle?t.fStyle.split(" "):[],i="normal",r="normal",s=e.length,a=0;a0;)i-=1,this._elements.unshift(e[i]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(t){var e,i=t.length;for(e=0;e0?Math.floor(m):Math.ceil(m),u=this.pMatrix.props,y=this.rMatrix.props,g=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var v,b,x=0;if(m>0){for(;xd;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),x-=1;c&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-c,!0),x-=c)}for(r=1===this.data.m?0:this._currentCopies-1,s=1===this.data.m?1:-1,a=this._currentCopies;a;){if(b=(i=(e=this.elemsData[r].it)[e.length-1].transform.mProps.v.props).length,e[e.length-1].transform.mProps._mdf=!0,e[e.length-1].transform.op._mdf=!0,e[e.length-1].transform.op.v=1===this._currentCopies?this.so.v:this.so.v+(this.eo.v-this.so.v)*(r/(this._currentCopies-1)),0!==x){for((0!==r&&1===s||r!==this._currentCopies-1&&-1===s)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(y[0],y[1],y[2],y[3],y[4],y[5],y[6],y[7],y[8],y[9],y[10],y[11],y[12],y[13],y[14],y[15]),this.matrix.transform(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]),this.matrix.transform(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],u[8],u[9],u[10],u[11],u[12],u[13],u[14],u[15]),v=0;v0&&r<1?[e]:[]:[e-r,e+r].filter((function(t){return t>0&&t<1}))},PolynomialBezier.prototype.split=function(t){if(t<=0)return[singlePoint(this.points[0]),this];if(t>=1)return[this,singlePoint(this.points[this.points.length-1])];var e=lerpPoint(this.points[0],this.points[1],t),i=lerpPoint(this.points[1],this.points[2],t),r=lerpPoint(this.points[2],this.points[3],t),s=lerpPoint(e,i,t),a=lerpPoint(i,r,t),n=lerpPoint(s,a,t);return[new PolynomialBezier(this.points[0],e,s,n,!0),new PolynomialBezier(n,a,r,this.points[3],!0)]},PolynomialBezier.prototype.bounds=function(){return{x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var t=this.bounds();return{left:t.x.min,right:t.x.max,top:t.y.min,bottom:t.y.max,width:t.x.max-t.x.min,height:t.y.max-t.y.min,cx:(t.x.max+t.x.min)/2,cy:(t.y.max+t.y.min)/2}},PolynomialBezier.prototype.intersections=function(t,e,i){void 0===e&&(e=2),void 0===i&&(i=7);var r=[];return intersectsImpl(intersectData(this,0,1),intersectData(t,0,1),0,e,r,i),r},PolynomialBezier.shapeSegment=function(t,e){var i=(e+1)%t.length();return new PolynomialBezier(t.v[e],t.o[e],t.i[i],t.v[i],!0)},PolynomialBezier.shapeSegmentInverted=function(t,e){var i=(e+1)%t.length();return new PolynomialBezier(t.v[i],t.i[i],t.o[e],t.v[e],!0)},extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(t,e.s,0,null,this),this.frequency=PropertyFactory.getProp(t,e.r,0,null,this),this.pointsType=PropertyFactory.getProp(t,e.pt,0,null,this),this._isAnimated=0!==this.amplitude.effectsSequence.length||0!==this.frequency.effectsSequence.length||0!==this.pointsType.effectsSequence.length},ZigZagModifier.prototype.processPath=function(t,e,i,r){var s=t._length,a=shapePool.newElement();if(a.c=t.c,t.c||(s-=1),0===s)return a;var n=-1,o=PolynomialBezier.shapeSegment(t,0);zigZagCorner(a,t,0,e,i,r,n);for(var h=0;h=0;a-=1)o=PolynomialBezier.shapeSegmentInverted(t,a),l.push(offsetSegmentSplit(o,e));l=pruneIntersections(l);var p=null,f=null;for(a=0;a=55296&&i<=56319){var r=t.charCodeAt(1);r>=56320&&r<=57343&&(e=1024*(i-55296)+r-56320+65536)}return e}function o(t){var e=n(t);return e>=127462&&e<=127487}var h=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};h.isModifier=function(t,e){var i=t.toString(16)+e.toString(16);return-1!==r.indexOf(i)},h.isZeroWidthJoiner=function(t){return 8205===t},h.isFlagEmoji=function(t){return o(t.substr(0,2))&&o(t.substr(2,2))},h.isRegionalCode=o,h.isCombinedCharacter=function(t){return-1!==e.indexOf(t)},h.isRegionalFlag=function(t,e){var r=n(t.substr(e,2));if(r!==i)return!1;var s=0;for(e+=2;s<5;){if((r=n(t.substr(e,2)))<917601||r>917626)return!1;s+=1,e+=2}return 917631===n(t.substr(e,2))},h.isVariationSelector=function(t){return 65039===t},h.BLACK_FLAG_CODE_POINT=i;var l={addChars:function(t){if(t){var e;this.chars||(this.chars=[]);var i,r,s=t.length,a=this.chars.length;for(e=0;e0&&(p=!1),p){var f=createTag("style");f.setAttribute("f-forigin",r[i].fOrigin),f.setAttribute("f-origin",r[i].origin),f.setAttribute("f-family",r[i].fFamily),f.type="text/css",f.innerText="@font-face {font-family: "+r[i].fFamily+"; font-style: normal; src: url('"+r[i].fPath+"');}",e.appendChild(f)}}else if("g"===r[i].fOrigin||1===r[i].origin){for(h=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),l=0;lt?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(t){this.audio.rate(t)},AudioElement.prototype.volume=function(t){this._volumeMultiplier=t,this._previousVolume=t*this._volume,this.audio.volume(this._previousVolume)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){},BaseRenderer.prototype.checkLayers=function(t){var e,i,r=this.layers.length;for(this.completeLayers=!0,e=r-1;e>=0;e-=1)this.elements[e]||(i=this.layers[e]).ip-i.st<=t-this.layers[e].st&&i.op-i.st>t-this.layers[e].st&&this.buildItem(e),this.completeLayers=!!this.elements[e]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:default:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t);case 15:return this.createFootage(t)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(t){return new AudioElement(t,this.globalData,this)},BaseRenderer.prototype.createFootage=function(t){return new FootageElement(t,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t0&&(this.maskElement.setAttribute("id",y),this.element.maskedElement.setAttribute(v,"url("+getLocationHref()+"#"+y+")"),a.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}TransformElement.prototype={initTransform:function(){var t=new Matrix;this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_localMatMdf:!1,_opMdf:!1,mat:t,localMat:t,localOpacity:1},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var t,e=this.finalTransform.mat,i=0,r=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;i1&&(a+=" C"+e.o[r-1][0]+","+e.o[r-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),i.lastPath!==a){var n="";i.elem&&(e.c&&(n=t.inv?this.solidPath+a:a),i.elem.setAttribute("d",n)),i.lastPath=a}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var filtersFactory=function(){var t={};return t.createFilter=function(t,e){var i=createNS("filter");i.setAttribute("id",t),!0!==e&&(i.setAttribute("filterUnits","objectBoundingBox"),i.setAttribute("x","0%"),i.setAttribute("y","0%"),i.setAttribute("width","100%"),i.setAttribute("height","100%"));return i},t.createAlphaToLuminanceFilter=function(){var t=createNS("feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),t},t}(),featureSupport=function(){var t={maskType:!0,svgLumaHidden:!0,offscreenCanvas:"undefined"!=typeof OffscreenCanvas};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.maskType=!1),/firefox/i.test(navigator.userAgent)&&(t.svgLumaHidden=!1),t}(),registeredEffects$1={},idPrefix="filter_result_";function SVGEffects(t){var e,i,r="SourceGraphic",s=t.data.ef?t.data.ef.length:0,a=createElementID(),n=filtersFactory.createFilter(a,!0),o=0;for(this.filters=[],e=0;e=0&&!this.shapeModifiers[t].processShapes(this._isFirstFrame);t-=1);}},searchProcessedElement:function(t){for(var e=this.processedElements,i=0,r=e.length;i.01)return!1;i+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t0;)h=r.transformers[d].mProps._mdf||h,c-=1,d-=1;if(h)for(c=y-r.styles[p].lvl,d=r.transformers.length-1;c>0;)m.multiply(r.transformers[d].mProps.v),c-=1,d-=1}else m=t;if(n=(f=r.sh.paths)._length,h){for(o="",a=0;a=1?v=.99:v<=-1&&(v=-.99);var b=o*v,x=Math.cos(g+e.a.v)*b+p[0],P=Math.sin(g+e.a.v)*b+p[1];h.setAttribute("fx",x),h.setAttribute("fy",P),l&&!e.g._collapsable&&(e.of.setAttribute("fx",x),e.of.setAttribute("fy",P))}}function h(t,e,i){var r=e.style,s=e.d;s&&(s._mdf||i)&&s.dashStr&&(r.pElem.setAttribute("stroke-dasharray",s.dashStr),r.pElem.setAttribute("stroke-dashoffset",s.dashoffset[0])),e.c&&(e.c._mdf||i)&&r.pElem.setAttribute("stroke","rgb("+bmFloor(e.c.v[0])+","+bmFloor(e.c.v[1])+","+bmFloor(e.c.v[2])+")"),(e.o._mdf||i)&&r.pElem.setAttribute("stroke-opacity",e.o.v),(e.w._mdf||i)&&(r.pElem.setAttribute("stroke-width",e.w.v),r.msElem&&r.msElem.setAttribute("stroke-width",e.w.v))}return{createRenderFunction:function(t){switch(t.ty){case"fl":return a;case"gf":return o;case"gs":return n;case"st":return h;case"sh":case"el":case"rc":case"sr":return s;case"tr":return i;case"no":return r;default:return null}}}}();function SVGShapeElement(t,e,i){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,i),this.prevViewData=[]}function LetterProps(t,e,i,r,s,a){this.o=t,this.sw=e,this.sc=i,this.fc=r,this.m=s,this.p=a,this._mdf={o:!0,sw:!!e,sc:!!i,fc:!!r,m:!0,p:!0}}function TextProperty(t,e){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,e.d&&e.d.sid&&(e.d=t.globalData.slotManager.getProp(e.d)),this.data=e,this.elem=t,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var t,e,i,r,s=this.shapes.length,a=this.stylesList.length,n=[],o=!1;for(i=0;i1&&o&&this.setShapesAsAnimated(n)}},SVGShapeElement.prototype.setShapesAsAnimated=function(t){var e,i=t.length;for(e=0;e=0;o-=1){if((m=this.searchProcessedElement(t[o]))?e[o]=i[m-1]:t[o]._render=n,"fl"===t[o].ty||"st"===t[o].ty||"gf"===t[o].ty||"gs"===t[o].ty||"no"===t[o].ty)m?e[o].style.closed=t[o].hd:e[o]=this.createStyleElement(t[o],s),t[o]._render&&e[o].style.pElem.parentNode!==r&&r.appendChild(e[o].style.pElem),u.push(e[o].style);else if("gr"===t[o].ty){if(m)for(l=e[o].it.length,h=0;h1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(t){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||t){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e=this.currentData,i=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{var r;this.lock=!0,this._mdf=!1;var s=this.effectsSequence.length,a=t||this.data.d.k[this.keysIndex].s;for(r=0;re);)i+=1;return this.keysIndex!==i&&(this.keysIndex=i),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(t){for(var e,i,r=[],s=0,a=t.length,n=!1,o=!1,h="";s=55296&&e<=56319?FontManager.isRegionalFlag(t,s)?h=t.substr(s,14):(i=t.charCodeAt(s+1))>=56320&&i<=57343&&(FontManager.isModifier(e,i)?(h=t.substr(s,2),n=!0):h=FontManager.isFlagEmoji(t.substr(s,4))?t.substr(s,4):t.substr(s,2)):e>56319?(i=t.charCodeAt(s+1),FontManager.isVariationSelector(e)&&(n=!0)):FontManager.isZeroWidthJoiner(e)&&(n=!0,o=!0),n?(r[r.length-1]+=h,n=!1):r.push(h),s+=h.length;return r},TextProperty.prototype.completeTextData=function(t){t.__complete=!0;var e,i,r,s,a,n,o,h=this.elem.globalData.fontManager,l=this.data,p=[],f=0,m=l.m.g,c=0,d=0,u=0,y=[],g=0,v=0,b=h.getFontByName(t.f),x=0,P=getFontProperties(b);t.fWeight=P.weight,t.fStyle=P.style,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),i=t.finalText.length,t.finalLineHeight=t.lh;var E,S=t.tr/1e3*t.finalSize;if(t.sz)for(var C,_,A=!0,T=t.sz[0],M=t.sz[1];A;){C=0,g=0,i=(_=this.buildFinalText(t.t)).length,S=t.tr/1e3*t.finalSize;var k=-1;for(e=0;eT&&" "!==_[e]?(-1===k?i+=1:e=k,C+=t.finalLineHeight||1.2*t.finalSize,_.splice(e,k===e?1:0,"\r"),k=-1,g=0):(g+=x,g+=S);C+=b.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&Mv?g:v,g=-2*S,s="",r=!0,u+=1):s=D,h.chars?(o=h.getCharData(D,b.fStyle,h.getFontByName(t.f).fFamily),x=r?0:o.w*t.finalSize/100):x=h.measureText(s,t.f,t.finalSize)," "===D?F+=x+S:(g+=x+S+F,F=0),p.push({l:x,an:x,add:c,n:r,anIndexes:[],val:s,line:u,animatorJustifyOffset:0}),2==m){if(c+=x,""===s||" "===s||e===i-1){for(""!==s&&" "!==s||(c-=x);d<=e;)p[d].an=c,p[d].ind=f,p[d].extra=x,d+=1;f+=1,c=0}}else if(3==m){if(c+=x,""===s||e===i-1){for(""===s&&(c-=x);d<=e;)p[d].an=c,p[d].ind=f,p[d].extra=x,d+=1;c=0,f+=1}}else p[f].ind=f,p[f].extra=0,f+=1;if(t.l=p,v=g>v?g:v,y.push(g),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=v,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=y;var w,I,V,B,R=l.a;n=R.length;var L=[];for(a=0;a0?s=this.ne.v/100:a=-this.ne.v/100,this.xe.v>0?n=1-this.xe.v/100:o=1+this.xe.v/100;var h=BezierFactory.getBezierEasing(s,a,n,o).get,l=0,p=this.finalS,f=this.finalE,m=this.data.sh;if(2===m)l=h(l=f===p?r>=f?1:0:t(0,e(.5/(f-p)+(r-p)/(f-p),1)));else if(3===m)l=h(l=f===p?r>=f?0:1:1-t(0,e(.5/(f-p)+(r-p)/(f-p),1)));else if(4===m)f===p?l=0:(l=t(0,e(.5/(f-p)+(r-p)/(f-p),1)))<.5?l*=2:l=1-2*(l-.5),l=h(l);else if(5===m){if(f===p)l=0;else{var c=f-p,d=-c/2+(r=e(t(0,r+.5-p),f-p)),u=c/2;l=Math.sqrt(1-d*d/(u*u))}l=h(l)}else 6===m?(f===p?l=0:(r=e(t(0,r+.5-p),f-p),l=(1+Math.cos(Math.PI+2*Math.PI*r/(f-p)))/2),l=h(l)):(r>=i(p)&&(l=t(0,e(r-p<0?e(f,1)-(p-r):f-r,1))),l=h(l));if(100!==this.sm.v){var y=.01*this.sm.v;0===y&&(y=1e-8);var g=.5-.5*y;l1&&(l=1)}return l*this.a.v},getValue:function(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,t&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this.data.totalChars,i=this.o.v/e,r=this.s.v/e+i,s=this.e.v/e+i;if(r>s){var a=r;r=s,s=a}this.finalS=r,this.finalE=s}},extendPrototype([DynamicPropertyContainer],r),{getTextSelectorProp:function(t,e,i){return new r(t,e,i)}}}();function TextAnimatorDataProperty(t,e,i){var r={propType:!1},s=PropertyFactory.getProp,a=e.a;this.a={r:a.r?s(t,a.r,0,degToRads,i):r,rx:a.rx?s(t,a.rx,0,degToRads,i):r,ry:a.ry?s(t,a.ry,0,degToRads,i):r,sk:a.sk?s(t,a.sk,0,degToRads,i):r,sa:a.sa?s(t,a.sa,0,degToRads,i):r,s:a.s?s(t,a.s,1,.01,i):r,a:a.a?s(t,a.a,1,0,i):r,o:a.o?s(t,a.o,0,.01,i):r,p:a.p?s(t,a.p,1,0,i):r,sw:a.sw?s(t,a.sw,0,0,i):r,sc:a.sc?s(t,a.sc,1,0,i):r,fc:a.fc?s(t,a.fc,1,0,i):r,fh:a.fh?s(t,a.fh,0,0,i):r,fs:a.fs?s(t,a.fs,0,.01,i):r,fb:a.fb?s(t,a.fb,0,.01,i):r,t:a.t?s(t,a.t,0,0,i):r},this.s=TextSelectorProp.getTextSelectorProp(t,e.s,i),this.s.t=e.s.t}function TextAnimatorProperty(t,e,i){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=i,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(i)}function ITextElement(){}TextAnimatorProperty.prototype.searchProperties=function(){var t,e,i=this._textData.a.length,r=PropertyFactory.getProp;for(t=0;t=o+ot||!d?(v=(o+ot-l)/h.partialLength,G=c.point[0]+(h.point[0]-c.point[0])*v,z=c.point[1]+(h.point[1]-c.point[1])*v,C.translate(-P[0]*T[s].an*.005,-P[1]*B*.01),p=!1):d&&(l+=h.partialLength,(f+=1)>=d.length&&(f=0,u[m+=1]?d=u[m].points:x.v.c?(f=0,d=u[m=0].points):(l-=h.partialLength,d=null)),d&&(c=h,y=(h=d[f]).partialLength));L=T[s].an/2-T[s].add,C.translate(-L,0,0)}else L=T[s].an/2-T[s].add,C.translate(-L,0,0),C.translate(-P[0]*T[s].an*.005,-P[1]*B*.01,0);for(F=0;Ft?this.textSpans[t].span:createNS(h?"g":"text"),y<=t){if(n.setAttribute("stroke-linecap","butt"),n.setAttribute("stroke-linejoin","round"),n.setAttribute("stroke-miterlimit","4"),this.textSpans[t].span=n,h){var g=createNS("g");n.appendChild(g),this.textSpans[t].childSpan=g}this.textSpans[t].span=n,this.layerElement.appendChild(n)}n.style.display="inherit"}if(l.reset(),p&&(o[t].n&&(f=-d,m+=i.yOffset,m+=c?1:0,c=!1),this.applyTextPropertiesToMatrix(i,l,o[t].line,f,m),f+=o[t].l||0,f+=d),h){var v;if(1===(u=this.globalData.fontManager.getCharData(i.finalText[t],r.fStyle,this.globalData.fontManager.getFontByName(i.f).fFamily)).t)v=new SVGCompElement(u.data,this.globalData,this);else{var b=emptyShapeData;u.data&&u.data.shapes&&(b=this.buildShapeData(u.data,i.finalSize)),v=new SVGShapeElement(b,this.globalData,this)}if(this.textSpans[t].glyph){var x=this.textSpans[t].glyph;this.textSpans[t].childSpan.removeChild(x.layerElement),x.destroy()}this.textSpans[t].glyph=v,v._debug=!0,v.prepareFrame(0),v.renderFrame(),this.textSpans[t].childSpan.appendChild(v.layerElement),1===u.t&&this.textSpans[t].childSpan.setAttribute("transform","scale("+i.finalSize/100+","+i.finalSize/100+")")}else p&&n.setAttribute("transform","translate("+l.props[12]+","+l.props[13]+")"),n.textContent=o[t].val,n.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve")}p&&n&&n.setAttribute("d","")}else{var P=this.textContainer,E="start";switch(i.j){case 1:E="end";break;case 2:E="middle";break;default:E="start"}P.setAttribute("text-anchor",E),P.setAttribute("letter-spacing",d);var S=this.buildTextContents(i.finalText);for(e=S.length,m=i.ps?i.ps[1]+i.ascent:0,t=0;t=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e=0;i-=1)(this.completeLayers||this.elements[i])&&(this.elements[i].prepareFrame(this.renderedFrame-this.layers[i].st),this.elements[i]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t=0;i-=1)t.finalTransform.multiply(t.transforms[i].transform.mProps.v);t._mdf=s},processSequences:function(t){var e,i=this.sequenceList.length;for(e=0;e=1){this.buffers=[];var t=this.globalData.canvasContext,e=assetLoader.createCanvas(t.canvas.width,t.canvas.height);this.buffers.push(e);var i=assetLoader.createCanvas(t.canvas.width,t.canvas.height);this.buffers.push(i),this.data.tt>=3&&!document._isProxy&&assetLoader.loadLumaCanvas()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new CVEffects(this),this.searchEffectTransforms()},createContent:function(){},setBlendMode:function(){var t=this.globalData;if(t.blendMode!==this.data.bm){t.blendMode=this.data.bm;var e=getBlendMode(this.data.bm);t.canvasContext.globalCompositeOperation=e}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT)},hideElement:function(){this.hidden||this.isInRange&&!this.isTransparent||(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},clearCanvas:function(t){t.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)},prepareLayer:function(){if(this.data.tt>=1){var t=this.buffers[0].getContext("2d");this.clearCanvas(t),t.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}},exitLayer:function(){if(this.data.tt>=1){var t=this.buffers[1],e=t.getContext("2d");if(this.clearCanvas(e),e.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform),this.comp.getElementById("tp"in this.data?this.data.tp:this.data.ind-1).renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var i=assetLoader.getLumaCanvas(this.canvasContext.canvas);i.getContext("2d").drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(i,0,0)}this.canvasContext.globalCompositeOperation=operationsMap[this.data.tt],this.canvasContext.drawImage(t,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over"}},renderFrame:function(t){if(!this.hidden&&!this.data.hd&&(1!==this.data.td||t)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var e=0===this.data.ty;this.prepareLayer(),this.globalData.renderer.save(e),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(e),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement,CVShapeData.prototype.setAsAnimated=SVGShapeData.prototype.setAsAnimated,extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement],CVShapeElement),CVShapeElement.prototype.initElement=RenderableDOMElement.prototype.initElement,CVShapeElement.prototype.transformHelper={opacity:1,_opMdf:!1},CVShapeElement.prototype.dashResetter=[],CVShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])},CVShapeElement.prototype.createStyleElement=function(t,e){var i={data:t,type:t.ty,preTransforms:this.transformsManager.addTransformSequence(e),transforms:[],elements:[],closed:!0===t.hd},r={};if("fl"===t.ty||"st"===t.ty?(r.c=PropertyFactory.getProp(this,t.c,1,255,this),r.c.k||(i.co="rgb("+bmFloor(r.c.v[0])+","+bmFloor(r.c.v[1])+","+bmFloor(r.c.v[2])+")")):"gf"!==t.ty&&"gs"!==t.ty||(r.s=PropertyFactory.getProp(this,t.s,1,null,this),r.e=PropertyFactory.getProp(this,t.e,1,null,this),r.h=PropertyFactory.getProp(this,t.h||{k:0},0,.01,this),r.a=PropertyFactory.getProp(this,t.a||{k:0},0,degToRads,this),r.g=new GradientProperty(this,t.g,this)),r.o=PropertyFactory.getProp(this,t.o,0,.01,this),"st"===t.ty||"gs"===t.ty){if(i.lc=lineCapEnum[t.lc||2],i.lj=lineJoinEnum[t.lj||2],1==t.lj&&(i.ml=t.ml),r.w=PropertyFactory.getProp(this,t.w,0,null,this),r.w.k||(i.wi=r.w.v),t.d){var s=new DashProperty(this,t.d,"canvas",this);r.d=s,r.d.k||(i.da=r.d.dashArray,i.do=r.d.dashoffset[0])}}else i.r=2===t.r?"evenodd":"nonzero";return this.stylesList.push(i),r.style=i,r},CVShapeElement.prototype.createGroupElement=function(){return{it:[],prevViewData:[]}},CVShapeElement.prototype.createTransformElement=function(t){return{transform:{opacity:1,_opMdf:!1,key:this.transformsManager.getNewKey(),op:PropertyFactory.getProp(this,t.o,0,.01,this),mProps:TransformPropertyFactory.getTransformProperty(this,t,this)}}},CVShapeElement.prototype.createShapeElement=function(t){var e=new CVShapeData(this,t,this.stylesList,this.transformsManager);return this.shapes.push(e),this.addShapeToModifiers(e),e},CVShapeElement.prototype.reloadShapes=function(){var t;this._isFirstFrame=!0;var e=this.itemsData.length;for(t=0;t=0;a-=1){if((h=this.searchProcessedElement(t[a]))?e[a]=i[h-1]:t[a]._shouldRender=r,"fl"===t[a].ty||"st"===t[a].ty||"gf"===t[a].ty||"gs"===t[a].ty)h?e[a].style.closed=!1:e[a]=this.createStyleElement(t[a],d),m.push(e[a].style);else if("gr"===t[a].ty){if(h)for(o=e[a].it.length,n=0;n=0;s-=1)"tr"===e[s].ty?(a=i[s].transform,this.renderShapeTransform(t,a)):"sh"===e[s].ty||"el"===e[s].ty||"rc"===e[s].ty||"sr"===e[s].ty?this.renderPath(e[s],i[s]):"fl"===e[s].ty?this.renderFill(e[s],i[s],a):"st"===e[s].ty?this.renderStroke(e[s],i[s],a):"gf"===e[s].ty||"gs"===e[s].ty?this.renderGradientFill(e[s],i[s],a):"gr"===e[s].ty?this.renderShape(a,e[s].it,i[s].it):e[s].ty;r&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(t,e){if(this._isFirstFrame||e._mdf||t.transforms._mdf){var i,r,s,a=t.trNodes,n=e.paths,o=n._length;a.length=0;var h=t.transforms.finalTransform;for(s=0;s=1?f=.99:f<=-1&&(f=-.99);var m=l*f,c=Math.cos(p+e.a.v)*m+o[0],d=Math.sin(p+e.a.v)*m+o[1];r=n.createRadialGradient(c,d,0,o[0],o[1],l)}var u=t.g.p,y=e.g.c,g=1;for(a=0;ao&&"xMidYMid slice"===h||ns&&"meet"===o||as&&"slice"===o)?(i-this.transformCanvas.w*(r/this.transformCanvas.h))/2*this.renderConfig.dpr:"xMax"===l&&(as&&"slice"===o)?(i-this.transformCanvas.w*(r/this.transformCanvas.h))*this.renderConfig.dpr:0,this.transformCanvas.ty="YMid"===p&&(a>s&&"meet"===o||as&&"meet"===o||a=0;t-=1)this.elements[t]&&this.elements[t].destroy&&this.elements[t].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRendererBase.prototype.renderFrame=function(t,e){if((this.renderedFrame!==t||!0!==this.renderConfig.clearCanvas||e)&&!this.destroyed&&-1!==t){var i;this.renderedFrame=t,this.globalData.frameNum=t-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||e,this.globalData.projectInterface.currentFrame=t;var r=this.layers.length;for(this.completeLayers||this.checkLayers(t),i=r-1;i>=0;i-=1)(this.completeLayers||this.elements[i])&&this.elements[i].prepareFrame(t-this.layers[i].st);if(this.globalData._mdf){for(!0===this.renderConfig.clearCanvas?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),i=r-1;i>=0;i-=1)(this.completeLayers||this.elements[i])&&this.elements[i].renderFrame();!0!==this.renderConfig.clearCanvas&&this.restore()}}},CanvasRendererBase.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!==this.layers[t].ty){var i=this.createItem(this.layers[t],this,this.globalData);e[t]=i,i.initExpressions()}},CanvasRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){this.pendingElements.pop().checkParenting()}},CanvasRendererBase.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRendererBase.prototype.show=function(){this.animationItem.container.style.display="block"},CVContextData.prototype.duplicate=function(){var t=2*this._length,e=0;for(e=this._length;e=0;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},CVCompElement.prototype.destroy=function(){var t;for(t=this.layers.length-1;t>=0;t-=1)this.elements[t]&&this.elements[t].destroy();this.layers=null,this.elements=null},CVCompElement.prototype.createComp=function(t){return new CVCompElement(t,this.globalData,this)},extendPrototype([CanvasRendererBase],CanvasRenderer),CanvasRenderer.prototype.createComp=function(t){return new CVCompElement(t,this.globalData,this)},HBaseElement.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement)},createContainerElements:function(){this.renderableEffectsManager=new CVEffects(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0!==this.data.bm&&this.setBlendMode()},renderElement:function(){var t=this.transformedElement?this.transformedElement.style:{};if(this.finalTransform._matMdf){var e=this.finalTransform.mat.toCSS();t.transform=e,t.webkitTransform=e}this.finalTransform._opMdf&&(t.opacity=this.finalTransform.mProp.o.v)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData)},addEffects:function(){},setMatte:function(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=BaseRenderer.prototype.buildElementParenting,extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var t;this.data.hasMask?((t=createNS("rect")).setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):((t=createTag("div")).style.width=this.data.sw+"px",t.style.height=this.data.sh+"px",t.style.backgroundColor=this.data.sc),this.layerElement.appendChild(t)},extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var t;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),t=this.svgElement;else{t=createNS("svg");var e=this.comp.data?this.comp.data:this.globalData.compSize;t.setAttribute("width",e.w),t.setAttribute("height",e.h),t.appendChild(this.shapesContainer),this.layerElement.appendChild(t)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=t},HShapeElement.prototype.getTransformedPoint=function(t,e){var i,r=t.length;for(i=0;i0&&o<1&&f[m].push(this.calculateF(o,t,e,i,r,m)):(h=a*a-4*n*s)>=0&&((l=(-a+bmSqrt(h))/(2*s))>0&&l<1&&f[m].push(this.calculateF(l,t,e,i,r,m)),(p=(-a-bmSqrt(h))/(2*s))>0&&p<1&&f[m].push(this.calculateF(p,t,e,i,r,m))));this.shapeBoundingBox.left=bmMin.apply(null,f[0]),this.shapeBoundingBox.top=bmMin.apply(null,f[1]),this.shapeBoundingBox.right=bmMax.apply(null,f[0]),this.shapeBoundingBox.bottom=bmMax.apply(null,f[1])},HShapeElement.prototype.calculateF=function(t,e,i,r,s,a){return bmPow(1-t,3)*e[a]+3*bmPow(1-t,2)*t*i[a]+3*(1-t)*bmPow(t,2)*r[a]+bmPow(t,3)*s[a]},HShapeElement.prototype.calculateBoundingBox=function(t,e){var i,r=t.length;for(i=0;ii&&(i=s)}i*=t.mult}else i=t.v*t.mult;e.x-=i,e.xMax+=i,e.y-=i,e.yMax+=i},HShapeElement.prototype.currentBoxContains=function(t){return this.currentBBox.x<=t.x&&this.currentBBox.y<=t.y&&this.currentBBox.width+this.currentBBox.x>=t.x+t.width&&this.currentBBox.height+this.currentBBox.y>=t.y+t.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var t=this.tempBoundingBox,e=999999;if(t.x=e,t.xMax=-e,t.y=e,t.yMax=-e,this.calculateBoundingBox(this.itemsData,t),t.width=t.xMax=0;t-=1){var r=this.hierarchy[t].finalTransform.mProp;this.mat.translate(-r.p.v[0],-r.p.v[1],r.p.v[2]),this.mat.rotateX(-r.or.v[0]).rotateY(-r.or.v[1]).rotateZ(r.or.v[2]),this.mat.rotateX(-r.rx.v).rotateY(-r.ry.v).rotateZ(r.rz.v),this.mat.scale(1/r.s.v[0],1/r.s.v[1],1/r.s.v[2]),this.mat.translate(r.a.v[0],r.a.v[1],r.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var s;s=this.p?[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var a=Math.sqrt(Math.pow(s[0],2)+Math.pow(s[1],2)+Math.pow(s[2],2)),n=[s[0]/a,s[1]/a,s[2]/a],o=Math.sqrt(n[2]*n[2]+n[0]*n[0]),h=Math.atan2(n[1],o),l=Math.atan2(n[0],-n[2]);this.mat.rotateY(l).rotateX(-h)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var p=!this._prevMat.equals(this.mat);if((p||this.pe._mdf)&&this.comp.threeDElements){var f,m,c;for(e=this.comp.threeDElements.length,t=0;t=t)return this.threeDElements[e].perspectiveElem;e+=1}return null},HybridRendererBase.prototype.createThreeDContainer=function(t,e){var i,r,s=createTag("div");styleDiv(s);var a=createTag("div");if(styleDiv(a),"3d"===e){(i=s.style).width=this.globalData.compSize.w+"px",i.height=this.globalData.compSize.h+"px";var n="50% 50%";i.webkitTransformOrigin=n,i.mozTransformOrigin=n,i.transformOrigin=n;var o="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";(r=a.style).transform=o,r.webkitTransform=o}s.appendChild(a);var h={container:a,perspectiveElem:s,startPos:t,endPos:t,type:e};return this.threeDElements.push(h),h},HybridRendererBase.prototype.build3dContainers=function(){var t,e,i=this.layers.length,r="";for(t=0;t=0;t-=1)this.resizerElem.appendChild(this.threeDElements[t].perspectiveElem)},HybridRendererBase.prototype.addTo3dContainer=function(t,e){for(var i=0,r=this.threeDElements.length;in?(t=s/this.globalData.compSize.w,e=s/this.globalData.compSize.w,i=0,r=(a-this.globalData.compSize.h*(s/this.globalData.compSize.w))/2):(t=a/this.globalData.compSize.h,e=a/this.globalData.compSize.h,i=(s-this.globalData.compSize.w*(a/this.globalData.compSize.h))/2,r=0);var o=this.resizerElem.style;o.webkitTransform="matrix3d("+t+",0,0,0,0,"+e+",0,0,0,0,1,0,"+i+","+r+",0,1)",o.transform=o.webkitTransform},HybridRendererBase.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRendererBase.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRendererBase.prototype.show=function(){this.resizerElem.style.display="block"},HybridRendererBase.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var t,e=this.globalData.compSize.w,i=this.globalData.compSize.h,r=this.threeDElements.length;for(t=0;t=h;)t/=2,e/=2,i>>>=1;return(t+i)/e};return x.int32=function(){return 0|b.g(4)},x.quick=function(){return b.g(4)/4294967296},x.double=x,c(d(b.S),t),(u.pass||y||function(t,i,r,s){return s&&(s.S&&f(s,b),t.state=function(){return f(b,{})}),r?(e[a]=t,i):t})(x,v,"global"in u?u.global:this==e,u.state)},c(e.random(),t)}function initialize$2(t){seedRandom([],t)}var propTypes={SHAPE:"shape"};function _typeof$1(t){return _typeof$1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof$1(t)}var ExpressionManager=function(){var ob={},Math=BMMath,window=null,document=null,XMLHttpRequest=null,fetch=null,frames=null,_lottieGlobal={};function resetFrame(){_lottieGlobal={}}function $bm_isInstanceOfArray(t){return t.constructor===Array||t.constructor===Float32Array}function isNumerable(t,e){return"number"===t||e instanceof Number||"boolean"===t||"string"===t}function $bm_neg(t){var e=_typeof$1(t);if("number"===e||t instanceof Number||"boolean"===e)return-t;if($bm_isInstanceOfArray(t)){var i,r=t.length,s=[];for(i=0;ii){var r=i;i=e,e=r}return Math.min(Math.max(t,e),i)}function radiansToDegrees(t){return t/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(t){return t*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(t,e){if("number"==typeof t||t instanceof Number)return e=e||0,Math.abs(t-e);var i;e||(e=helperLengthArray);var r=Math.min(t.length,e.length),s=0;for(i=0;i.5?l/(2-n-o):l/(n+o),n){case r:e=(s-a)/l+(s1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function hslToRgb(t){var e,i,r,s=t[0],a=t[1],n=t[2];if(0===a)e=n,r=n,i=n;else{var o=n<.5?n*(1+a):n+a-n*a,h=2*n-o;e=hue2rgb(h,o,s+1/3),i=hue2rgb(h,o,s),r=hue2rgb(h,o,s-1/3)}return[e,i,r,t[3]]}function linear(t,e,i,r,s){if(void 0!==r&&void 0!==s||(r=e,s=i,e=0,i=1),i=i)return s;var n,o=i===e?0:(t-e)/(i-e);if(!r.length)return r+(s-r)*o;var h=r.length,l=createTypedArray("float32",h);for(n=0;n1){for(r=0;r1?e=1:e<0&&(e=0);var n=t(e);if($bm_isInstanceOfArray(s)){var o,h=s.length,l=createTypedArray("float32",h);for(o=0;odata.k[e].t&&tdata.k[e+1].t-t?(i=e+2,r=data.k[e+1].t):(i=e+1,r=data.k[e].t);break}}-1===i&&(i=e+1,r=data.k[e].t)}else i=0,r=0;var a={};return a.index=i,a.time=r/elem.comp.globalData.frameRate,a}function key(t){var e,i,r;if(!data.k.length||"number"==typeof data.k[0])throw new Error("The property has no keyframe at index "+t);t-=1,e={time:data.k[t].t/elem.comp.globalData.frameRate,value:[]};var s=Object.prototype.hasOwnProperty.call(data.k[t],"s")?data.k[t].s:data.k[t-1].e;for(r=s.length,i=0;il.length-1)&&(e=l.length-1),r=p-(s=l[l.length-1-e].t)),"pingpong"===t){if(Math.floor((h-s)/r)%2!=0)return this.getValueAtTime((r-(h-s)%r+s)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var f=this.getValueAtTime(s/this.comp.globalData.frameRate,0),m=this.getValueAtTime(p/this.comp.globalData.frameRate,0),c=this.getValueAtTime(((h-s)%r+s)/this.comp.globalData.frameRate,0),d=Math.floor((h-s)/r);if(this.pv.length){for(n=(o=new Array(f.length)).length,a=0;a=p)return this.pv;if(i?s=p+(r=e?Math.abs(this.elem.comp.globalData.frameRate*e):Math.max(0,this.elem.data.op-p)):((!e||e>l.length-1)&&(e=l.length-1),r=(s=l[e].t)-p),"pingpong"===t){if(Math.floor((p-h)/r)%2==0)return this.getValueAtTime(((p-h)%r+p)/this.comp.globalData.frameRate,0)}else{if("offset"===t){var f=this.getValueAtTime(p/this.comp.globalData.frameRate,0),m=this.getValueAtTime(s/this.comp.globalData.frameRate,0),c=this.getValueAtTime((r-(p-h)%r+p)/this.comp.globalData.frameRate,0),d=Math.floor((p-h)/r)+1;if(this.pv.length){for(n=(o=new Array(f.length)).length,a=0;a1?(s+t-a)/(e-1):1,o=0,h=0;for(i=this.pv.length?createTypedArray("float32",this.pv.length):0;on){var p=o,f=i.c&&o===h-1?0:o+1,m=(n-l)/a[o].addedLength;r=bez.getPointInSegment(i.v[p],i.v[f],i.o[p],i.i[f],m,a[o]);break}l+=a[o].addedLength,o+=1}return r||(r=i.c?[i.v[0][0],i.v[0][1]]:[i.v[i._length-1][0],i.v[i._length-1][1]]),r},vectorOnPath:function(t,e,i){1==t?t=this.v.c:0==t&&(t=.999);var r=this.pointOnPath(t,e),s=this.pointOnPath(t+.001,e),a=s[0]-r[0],n=s[1]-r[1],o=Math.sqrt(Math.pow(a,2)+Math.pow(n,2));return 0===o?[0,0]:"tangent"===i?[a/o,n/o]:[-n/o,a/o]},tangentOnPath:function(t,e){return this.vectorOnPath(t,e,"tangent")},normalOnPath:function(t,e){return this.vectorOnPath(t,e,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([l],o),extendPrototype([l],h),h.prototype.getValueAtTime=function(t){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shapePool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime=l?c<0?r:s:r+m*Math.pow((a-t)/c,1/i),p[f]=n,f+=1,o+=256/255;return p.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e,i=this.filterManager.effectElements;this.feFuncRComposed&&(t||i[3].p._mdf||i[4].p._mdf||i[5].p._mdf||i[6].p._mdf||i[7].p._mdf)&&(e=this.getTableValue(i[3].p.v,i[4].p.v,i[5].p.v,i[6].p.v,i[7].p.v),this.feFuncRComposed.setAttribute("tableValues",e),this.feFuncGComposed.setAttribute("tableValues",e),this.feFuncBComposed.setAttribute("tableValues",e)),this.feFuncR&&(t||i[10].p._mdf||i[11].p._mdf||i[12].p._mdf||i[13].p._mdf||i[14].p._mdf)&&(e=this.getTableValue(i[10].p.v,i[11].p.v,i[12].p.v,i[13].p.v,i[14].p.v),this.feFuncR.setAttribute("tableValues",e)),this.feFuncG&&(t||i[17].p._mdf||i[18].p._mdf||i[19].p._mdf||i[20].p._mdf||i[21].p._mdf)&&(e=this.getTableValue(i[17].p.v,i[18].p.v,i[19].p.v,i[20].p.v,i[21].p.v),this.feFuncG.setAttribute("tableValues",e)),this.feFuncB&&(t||i[24].p._mdf||i[25].p._mdf||i[26].p._mdf||i[27].p._mdf||i[28].p._mdf)&&(e=this.getTableValue(i[24].p.v,i[25].p.v,i[26].p.v,i[27].p.v,i[28].p.v),this.feFuncB.setAttribute("tableValues",e)),this.feFuncA&&(t||i[31].p._mdf||i[32].p._mdf||i[33].p._mdf||i[34].p._mdf||i[35].p._mdf)&&(e=this.getTableValue(i[31].p.v,i[32].p.v,i[33].p.v,i[34].p.v,i[35].p.v),this.feFuncA.setAttribute("tableValues",e))}},extendPrototype([SVGComposableEffect],SVGDropShadowEffect),SVGDropShadowEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){if((t||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),t||this.filterManager.effectElements[0].p._mdf){var e=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(255*e[0]),Math.round(255*e[1]),Math.round(255*e[2])))}if((t||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),t||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var i=this.filterManager.effectElements[3].p.v,r=(this.filterManager.effectElements[2].p.v-90)*degToRads,s=i*Math.cos(r),a=i*Math.sin(r);this.feOffset.setAttribute("dx",s),this.feOffset.setAttribute("dy",a)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(t,e,i){this.initialized=!1,this.filterManager=e,this.filterElem=t,this.elem=i,i.matteElement=createNS("g"),i.matteElement.appendChild(i.layerElement),i.matteElement.appendChild(i.transformedElement),i.baseElement=i.matteElement}function SVGGaussianBlurEffect(t,e,i,r){t.setAttribute("x","-100%"),t.setAttribute("y","-100%"),t.setAttribute("width","300%"),t.setAttribute("height","300%"),this.filterManager=e;var s=createNS("feGaussianBlur");s.setAttribute("result",r),t.appendChild(s),this.feGaussianBlur=s}function TransformEffect(){}function SVGTransformEffect(t,e){this.init(e)}function CVTransformEffect(t){this.init(t)}return SVGMatte3Effect.prototype.findSymbol=function(t){for(var e=0,i=_svgMatteSymbols.length;e
- - + + + diff --git a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Resources/Web/svg2html.html b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Resources/Web/svg2html.html index e5f23a2..9f8cb63 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Resources/Web/svg2html.html +++ b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Resources/Web/svg2html.html @@ -24,6 +24,6 @@
- + diff --git a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Resources/Web/svga/index.min.js b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Resources/Web/svga/index.min.js new file mode 100644 index 0000000..833083e --- /dev/null +++ b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Resources/Web/svga/index.min.js @@ -0,0 +1,2 @@ +// SVGA.Lite v2.1.1 +function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e,t){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).SVGA={})}(this,(function(exports){"use strict";function __awaiter(e,t,r,i){return new(r||(r=Promise))((function(n,o){function a(e){try{u(i.next(e))}catch(e){o(e)}}function s(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((i=i.apply(e,t||[])).next())}))}function __generator(e,t){var r,i,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]0?0:2147483648,r,i);else if(isNaN(e))t(2143289344,r,i);else if(e>34028234663852886e22)t((n<<31|2139095040)>>>0,r,i);else if(e<11754943508222875e-54)t((n<<31|Math.round(e/1401298464324817e-60))>>>0,r,i);else{var s=Math.floor(Math.log(e)/Math.LN2);t((n<<31|s+127<<23|8388607&Math.round(e*Math.pow(2,-s)*8388608))>>>0,r,i)}}function r(t,e,r){var i=t(e,r),n=2*(i>>31)+1,s=i>>>23&255,o=8388607&i;return 255===s?o?NaN:n*(1/0):0===s?1401298464324817e-60*n*o:n*Math.pow(2,s-150)*(o+8388608)}t.writeFloatLE=e.bind(null,v),t.writeFloatBE=e.bind(null,m),t.readFloatLE=r.bind(null,g),t.readFloatBE=r.bind(null,b)}(),\"undefined\"!=typeof Float64Array?function(){var e=new Float64Array([-0]),r=new Uint8Array(e.buffer),i=128===r[7];function n(t,i,n){e[0]=t,i[n]=r[0],i[n+1]=r[1],i[n+2]=r[2],i[n+3]=r[3],i[n+4]=r[4],i[n+5]=r[5],i[n+6]=r[6],i[n+7]=r[7]}function s(t,i,n){e[0]=t,i[n]=r[7],i[n+1]=r[6],i[n+2]=r[5],i[n+3]=r[4],i[n+4]=r[3],i[n+5]=r[2],i[n+6]=r[1],i[n+7]=r[0]}function o(t,i){return r[0]=t[i],r[1]=t[i+1],r[2]=t[i+2],r[3]=t[i+3],r[4]=t[i+4],r[5]=t[i+5],r[6]=t[i+6],r[7]=t[i+7],e[0]}function a(t,i){return r[7]=t[i],r[6]=t[i+1],r[5]=t[i+2],r[4]=t[i+3],r[3]=t[i+4],r[2]=t[i+5],r[1]=t[i+6],r[0]=t[i+7],e[0]}t.writeDoubleLE=i?n:s,t.writeDoubleBE=i?s:n,t.readDoubleLE=i?o:a,t.readDoubleBE=i?a:o}():function(){function e(t,e,r,i,n,s){var o=i<0?1:0;if(o&&(i=-i),0===i)t(0,n,s+e),t(1/i>0?0:2147483648,n,s+r);else if(isNaN(i))t(0,n,s+e),t(2146959360,n,s+r);else if(i>17976931348623157e292)t(0,n,s+e),t((o<<31|2146435072)>>>0,n,s+r);else{var a;if(i<22250738585072014e-324)t((a=i/5e-324)>>>0,n,s+e),t((o<<31|a/4294967296)>>>0,n,s+r);else{var l=Math.floor(Math.log(i)/Math.LN2);1024===l&&(l=1023),t(4503599627370496*(a=i*Math.pow(2,-l))>>>0,n,s+e),t((o<<31|l+1023<<20|1048576*a&1048575)>>>0,n,s+r)}}}function r(t,e,r,i,n){var s=t(i,n+e),o=t(i,n+r),a=2*(o>>31)+1,l=o>>>20&2047,f=4294967296*(1048575&o)+s;return 2047===l?f?NaN:a*(1/0):0===l?5e-324*a*f:a*Math.pow(2,l-1075)*(f+4503599627370496)}t.writeDoubleLE=e.bind(null,v,0,4),t.writeDoubleBE=e.bind(null,m,4,0),t.readDoubleLE=r.bind(null,g,0,4),t.readDoubleBE=r.bind(null,b,4,0)}(),t}function v(t,e,r){e[r]=255&t,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function m(t,e,r){e[r]=t>>>24,e[r+1]=t>>>16&255,e[r+2]=t>>>8&255,e[r+3]=255&t}function g(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function b(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}var w={};!function(t){var e=t;e.length=function(t){for(var e=0,r=0,i=0;i191&&i<224?s[o++]=(31&i)<<6|63&t[e++]:i>239&&i<365?(i=((7&i)<<18|(63&t[e++])<<12|(63&t[e++])<<6|63&t[e++])-65536,s[o++]=55296+(i>>10),s[o++]=56320+(1023&i)):s[o++]=(15&i)<<12|(63&t[e++])<<6|63&t[e++],o>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,s)),o=0);return n?(o&&n.push(String.fromCharCode.apply(String,s.slice(0,o))),n.join(\"\")):String.fromCharCode.apply(String,s.slice(0,o))},e.write=function(t,e,r){for(var i,n,s=r,o=0;o>6|192,e[r++]=63&i|128):55296==(64512&i)&&56320==(64512&(n=t.charCodeAt(o+1)))?(i=65536+((1023&i)<<10)+(1023&n),++o,e[r++]=i>>18|240,e[r++]=i>>12&63|128,e[r++]=i>>6&63|128,e[r++]=63&i|128):(e[r++]=i>>12|224,e[r++]=i>>6&63|128,e[r++]=63&i|128);return r-s}}(w),function(t){var e=t;e.float=c,e.utf8=w,e.emptyArray=Object.freeze?Object.freeze([]):[],e.emptyObject=Object.freeze?Object.freeze({}):{},e.isInteger=Number.isInteger||function(t){return\"number\"==typeof t&&isFinite(t)&&Math.floor(t)===t},e.isString=function(t){return\"string\"==typeof t||t instanceof String},e.isObject=function(t){return t&&\"object\"===_typeof(t)},e.Array=\"undefined\"!=typeof Uint8Array?Uint8Array:Array,e._configure=function(){var t=e.Buffer;t?(e._Buffer_from=t.from!==Uint8Array.from&&t.from||function(e,r){return new t(e,r)},e._Buffer_allocUnsafe=t.allocUnsafe||function(e){return new t(e)}):e._Buffer_from=e._Buffer_allocUnsafe=null}}(d);var A=k;function k(t,e){\"string\"==typeof t&&(e=t,t=void 0);var r=[];function i(t){if(\"string\"!=typeof t){var e=n();if(k.verbose&&console.log(\"codegen: \"+e),e=\"return \"+e,t){for(var s=Object.keys(t),o=new Array(s.length+1),a=new Array(s.length),l=0;l=e)return!0;return!1},P.isReservedName=function(t,e){if(t)for(var r=0;r-1)return i}else if(i instanceof P&&(i=i.lookup(t.slice(1),e,!0)))return i}else for(var n=0;n-1&&this.oneof.splice(e,1),t.partOf=null,this},H.prototype.onAdd=function(t){V.prototype.onAdd.call(this,t);for(var e=0;e \"+t.len)}function ct(t){this.buf=t,this.pos=0,this.len=t.length}var yt,vt=\"undefined\"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new ct(t);throw Error(\"illegal buffer\")}:function(t){if(Array.isArray(t))return new ct(t);throw Error(\"illegal buffer\")};function mt(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}ct.create=ut.Buffer?function(t){return(ct.create=function(t){return ut.Buffer.isBuffer(t)?new(void 0)(t):vt(t)})(t)}:vt,ct.prototype._slice=ut.Array.prototype.subarray||ut.Array.prototype.slice,ct.prototype.uint32=(yt=4294967295,function(){if(yt=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return yt;if(yt=(yt|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return yt;if(yt=(yt|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return yt;if(yt=(yt|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return yt;if(yt=(yt|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return yt;if((this.pos+=5)>this.len)throw this.pos=this.len,dt(this,10);return yt}),ct.prototype.int32=function(){return 0|this.uint32()},ct.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},ct.prototype.bool=function(){return 0!==this.uint32()},ct.prototype.fixed32=function(){if(this.pos+4>this.len)throw dt(this,4);return mt(this.buf,this.pos+=4)},ct.prototype.sfixed32=function(){if(this.pos+4>this.len)throw dt(this,4);return 0|mt(this.buf,this.pos+=4)},ct.prototype.float=function(){if(this.pos+4>this.len)throw dt(this,4);var t=ut.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},ct.prototype.double=function(){if(this.pos+8>this.len)throw dt(this,4);var t=ut.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},ct.prototype.bytes=function(){var t=this.uint32(),e=this.pos,r=this.pos+t;if(r>this.len)throw dt(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(e,r):e===r?new this.buf.constructor(0):this._slice.call(this.buf,e,r)},ct.prototype.string=function(){var t=this.bytes();return pt.read(t,0,t.length)},ct.prototype.skip=function(t){if(\"number\"==typeof t){if(this.pos+t>this.len)throw dt(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw dt(this)}while(128&this.buf[this.pos++]);return this},ct.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error(\"invalid wire type \"+t+\" at offset \"+this.pos)}return this};var gt=function(t){var e=At.codegen([\"r\",\"l\"],t.name+\"$decode\")(\"if(!(r instanceof Reader))\")(\"r=Reader.create(r)\")(\"var c=l===undefined?r.len:r.pos+l,m=new this.ctor\"+(t.fieldsArray.filter((function(t){return t.map})).length?\",k\":\"\"))(\"while(r.pos>>3){\");for(var r=0;rd&&(d=t[f]),t[f]>=1;for(u=n<<16|f,h=a;h>>=1){case 0:var r=this.input,s=this.a,l=this.c,f=this.b,h=r.length,u=t,d=l.length,c=t;if(this.d=this.f=0,s+1>=h)throw Error(\"invalid uncompressed block header: LEN\");if(u=r[s++]|r[s++]<<8,s+1>=h)throw Error(\"invalid uncompressed block header: NLEN\");if(u===~(r[s++]|r[s++]<<8))throw Error(\"invalid uncompressed block header: length verify\");if(s+u>r.length)throw Error(\"input buffer is broken\");switch(this.i){case o:for(;f+u>l.length;){if(u-=c=d-f,i)l.set(r.subarray(s,s+c),f),f+=c,s+=c;else for(;c--;)l[f++]=r[s++];this.b=f,l=this.e(),f=this.b}break;case a:for(;f+u>l.length;)l=this.e({p:2});break;default:throw Error(\"invalid inflate mode\")}if(i)l.set(r.subarray(s,s+u),f),f+=u,s+=u;else for(;u--;)l[f++]=r[s++];this.a=s,this.b=f,this.c=l;break;case 1:this.j(O,x);break;case 2:var y,v,m,g,b=_(this,5)+257,w=_(this,5)+1,A=_(this,4)+4,k=new(i?Uint8Array:Array)(p.length),E=t,S=t,T=t,N=t,j=t;for(j=0;j=f?8:255>=f?9:279>=f?7:8;var k,E,O=n(A),S=new(i?Uint8Array:Array)(30);for(k=0,E=S.length;k=a)throw Error(\"input buffer is broken\");i|=s[o++]<>>e,t.d=n-e,t.a=o,r}function I(t,e){for(var r,i,n=t.f,s=t.d,o=t.input,a=t.a,l=o.length,f=e[0],h=e[1];s=l);)n|=o[a++]<>>16)>s)throw Error(\"invalid code length: \"+i);return t.f=n>>i,t.d=s-i,t.a=a,65535&r}function T(t,e){var r,i;switch(this.input=t,this.a=0,!e&&(e={})||(e.index&&(this.a=e.index),e.verify&&(this.A=e.verify)),r=t[this.a++],i=t[this.a++],15&r){case N:this.method=N;break;default:throw Error(\"unsupported compression method\")}if(0!=((r<<8)+i)%31)throw Error(\"invalid fcheck flag:\"+((r<<8)+i)%31);if(32&i)throw Error(\"fdict flag is not supported\");this.q=new s(t,{index:this.a,bufferSize:e.bufferSize,bufferType:e.bufferType,resize:e.resize})}s.prototype.j=function(t,e){var r=this.c,i=this.b;this.o=t;for(var n,s,o,a,l=r.length-258;256!==(n=I(this,t));)if(256>n)i>=l&&(this.b=i,r=this.e(),i=this.b),r[i++]=n;else for(a=c[s=n-257],0=l&&(this.b=i,r=this.e(),i=this.b);a--;)r[i]=r[i++-o];for(;8<=this.d;)this.d-=8,this.a--;this.b=i},s.prototype.w=function(t,e){var r=this.c,i=this.b;this.o=t;for(var n,s,o,a,l=r.length;256!==(n=I(this,t));)if(256>n)i>=l&&(l=(r=this.e()).length),r[i++]=n;else for(a=c[s=n-257],0l&&(l=(r=this.e()).length);a--;)r[i]=r[i++-o];for(;8<=this.d;)this.d-=8,this.a--;this.b=i},s.prototype.e=function(){var t,e,r=new(i?Uint8Array:Array)(this.b-32768),n=this.b-32768,s=this.c;if(i)r.set(s.subarray(32768,r.length));else for(t=0,e=r.length;tt;++t)s[t]=s[n+t];return this.b=32768,s},s.prototype.z=function(t){var e,r,n,s=this.input.length/this.a+1|0,o=this.input,a=this.c;return t&&(\"number\"==typeof t.p&&(s=t.p),\"number\"==typeof t.u&&(s+=t.u)),2>s?r=(n=(o.length-this.a)/this.o[2]/2*258|0)e&&(this.c.length=e),t=this.c),this.buffer=t},T.prototype.k=function(){var t,e,r=this.input;if(t=this.q.k(),this.a=this.q.a,this.A){e=(r[this.a++]<<24|r[this.a++]<<16|r[this.a++]<<8|r[this.a++])>>>0;var i=t;if(\"string\"==typeof i){var n,s,o=i.split(\"\");for(n=0,s=o.length;n>>0;i=o}for(var a,l=1,f=0,h=i.length,u=0;0>>0)throw Error(\"invalid adler-32 checksum\")}return t};var N=8;r(\"Zlib.Inflate\",T),r(\"Zlib.Inflate.prototype.decompress\",T.prototype.k);var j,B,D,L,R={ADAPTIVE:l.s,BLOCK:l.t};if(Object.keys)j=Object.keys(R);else for(B in j=[],D=0,R)j[D++]=B;for(D=0,L=j.length;D0&&c.push(d.lineDashI),null!==d.lineDashII&&d.lineDashII>0&&(c.length<1&&c.push(0),c.push(d.lineDashII)),null!==d.lineDashIII&&d.lineDashIII>0&&(c.length<2&&(c.push(0),c.push(0)),c[2]=d.lineDashIII);var y=null;switch(d.lineCap){case 0:y=\"butt\";break;case 1:y=\"round\";break;case 2:y=\"square\"}var v=null;switch(d.lineJoin){case 2:v=\"bevel\";break;case 1:v=\"round\";break;case 0:v=\"miter\"}var m=null;null!==d.fill&&(m=\"rgba(\".concat(parseInt((255*d.fill.r).toString()),\", \").concat(parseInt((255*d.fill.g).toString()),\", \").concat(parseInt((255*d.fill.b).toString()),\", \").concat(parseInt((1*d.fill.a).toString()),\")\"));var g=null;null!==d.stroke&&(g=\"rgba(\".concat(parseInt((255*d.stroke.r).toString()),\", \").concat(parseInt((255*d.stroke.g).toString()),\", \").concat(parseInt((255*d.stroke.b).toString()),\", \").concat(parseInt((1*d.stroke.a).toString()),\")\"));var b={lineDash:c,fill:m,stroke:g,lineCap:y,lineJoin:v,strokeWidth:d.strokeWidth,miterLimit:d.miterLimit},w={a:null!==(r=null===(e=t.transform)||void 0===e?void 0:e.a)&&void 0!==r?r:1,b:null!==(n=null===(i=t.transform)||void 0===i?void 0:i.b)&&void 0!==n?n:0,c:null!==(o=null===(s=t.transform)||void 0===s?void 0:s.c)&&void 0!==o?o:0,d:null!==(l=null===(a=t.transform)||void 0===a?void 0:a.d)&&void 0!==l?l:1,tx:null!==(h=null===(f=t.transform)||void 0===f?void 0:f.tx)&&void 0!==h?h:0,ty:null!==(p=null===(u=t.transform)||void 0===u?void 0:u.ty)&&void 0!==p?p:0};0===t.type&&null!==t.shape?I.push({type:\"shape\",path:t.shape,styles:b,transform:w}):1===t.type&&null!==t.rect?I.push({type:\"rect\",path:t.rect,styles:b,transform:w}):2===t.type&&null!==t.ellipse&&I.push({type:\"ellipse\",path:t.ellipse,styles:b,transform:w})}})),void 0!==t.shapes[0]&&3===t.shapes[0].type&&void 0!==e?I=e:e=I;var T=x.a*S.x+x.c*S.y+x.tx,N=x.a*(S.x+S.width)+x.c*S.y+x.tx,j=x.a*S.x+x.c*(S.y+S.height)+x.tx,B=x.a*(S.x+S.width)+x.c*(S.y+S.height)+x.tx,D=x.b*S.x+x.d*S.y+x.ty,L=x.b*(S.x+S.width)+x.d*S.y+x.ty,R=x.b*S.x+x.d*(S.y+S.height)+x.ty,U=x.b*(S.x+S.width)+x.d*(S.y+S.height)+x.ty,J=Math.min(Math.min(j,B),Math.min(T,N)),C=Math.min(Math.min(R,U),Math.min(D,L)),F=_.length>0?{d:_,transform:void 0,styles:{fill:\"rgba(0, 0, 0, 0)\",stroke:null,strokeWidth:null,lineCap:null,lineJoin:null,miterLimit:null,lineDash:null}}:null;i.frames.push({alpha:null!==(O=t.alpha)&&void 0!==O?O:0,layout:S,transform:x,clipPath:_,shapes:I,nx:J,ny:C,maskPath:F})})),r.sprites.push(i)})),this.images=e},Jt=function(t){var e=new Uint8Array(t,0,4);return 80===e[0]&&75===e[1]&&3===e[2]&&4===e[3]?1:2};\n/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */var Ct,Ft=Lt.Root.fromJSON({nested:{com:{nested:{opensource:{nested:{svga:{options:{objc_class_prefix:\"SVGAProto\",java_package:\"com.opensource.svgaplayer\"},nested:{MovieParams:{fields:{viewBoxWidth:{type:\"float\",id:1},viewBoxHeight:{type:\"float\",id:2},fps:{type:\"int32\",id:3},frames:{type:\"int32\",id:4}}},SpriteEntity:{fields:{imageKey:{type:\"string\",id:1},frames:{rule:\"repeated\",type:\"FrameEntity\",id:2}}},Layout:{fields:{x:{type:\"float\",id:1},y:{type:\"float\",id:2},width:{type:\"float\",id:3},height:{type:\"float\",id:4}}},Transform:{fields:{a:{type:\"float\",id:1},b:{type:\"float\",id:2},c:{type:\"float\",id:3},d:{type:\"float\",id:4},tx:{type:\"float\",id:5},ty:{type:\"float\",id:6}}},ShapeEntity:{oneofs:{args:{oneof:[\"shape\",\"rect\",\"ellipse\"]}},fields:{type:{type:\"ShapeType\",id:1},shape:{type:\"ShapeArgs\",id:2},rect:{type:\"RectArgs\",id:3},ellipse:{type:\"EllipseArgs\",id:4},styles:{type:\"ShapeStyle\",id:10},transform:{type:\"Transform\",id:11}},nested:{ShapeType:{values:{SHAPE:0,RECT:1,ELLIPSE:2,KEEP:3}},ShapeArgs:{fields:{d:{type:\"string\",id:1}}},RectArgs:{fields:{x:{type:\"float\",id:1},y:{type:\"float\",id:2},width:{type:\"float\",id:3},height:{type:\"float\",id:4},cornerRadius:{type:\"float\",id:5}}},EllipseArgs:{fields:{x:{type:\"float\",id:1},y:{type:\"float\",id:2},radiusX:{type:\"float\",id:3},radiusY:{type:\"float\",id:4}}},ShapeStyle:{fields:{fill:{type:\"RGBAColor\",id:1},stroke:{type:\"RGBAColor\",id:2},strokeWidth:{type:\"float\",id:3},lineCap:{type:\"LineCap\",id:4},lineJoin:{type:\"LineJoin\",id:5},miterLimit:{type:\"float\",id:6},lineDashI:{type:\"float\",id:7},lineDashII:{type:\"float\",id:8},lineDashIII:{type:\"float\",id:9}},nested:{RGBAColor:{fields:{r:{type:\"float\",id:1},g:{type:\"float\",id:2},b:{type:\"float\",id:3},a:{type:\"float\",id:4}}},LineCap:{values:{LineCap_BUTT:0,LineCap_ROUND:1,LineCap_SQUARE:2}},LineJoin:{values:{LineJoin_MITER:0,LineJoin_ROUND:1,LineJoin_BEVEL:2}}}}}},FrameEntity:{fields:{alpha:{type:\"float\",id:1},layout:{type:\"Layout\",id:2},transform:{type:\"Transform\",id:3},clipPath:{type:\"string\",id:4},shapes:{rule:\"repeated\",type:\"ShapeEntity\",id:5}}},MovieEntity:{fields:{version:{type:\"string\",id:1},params:{type:\"MovieParams\",id:2},images:{keyType:\"string\",type:\"bytes\",id:3},sprites:{rule:\"repeated\",type:\"SpriteEntity\",id:4}}}}}}}}}}}).lookupType(\"com.opensource.svga.MovieEntity\");function Mt(r){return t(this,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,new Promise((function(t,e){var i=new XMLHttpRequest;i.open(\"GET\",r,!0),i.responseType=\"arraybuffer\",i.onloadend=function(){void 0===i.response||200!==i.status&&304!==i.status?e(new Error(\"XMLHttpRequest, \".concat(i.statusText))):t(i.response)},i.send()}))];case 1:return[2,t.sent()]}}))}))}function Pt(r){return t(this,void 0,void 0,(function(){var t,i,n,s,o,a,l,f,h,u,p,d,c,y,v,m,g,b,w;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,7,,8]),t=r.data,i=t.url,n=t.options,[4,Mt(i)];case 1:if(s=e.sent(),o=new Uint8Array(s,0,4),2!==Jt(o))throw new Error(\"this parser only support version@2 of SVGA.\");for(p in a=new Rt.Inflate(new Uint8Array(s)).decompress(),l=Ft.decode(a),f={},h=l.images,u=[],h)u.push(p);d=0,e.label=2;case 2:return d=this.loopStart+(this.duration-this.loopStart)*this.loop?(this.currentFrication=1===this.fillRule?0:1,this.isRunning=!1):this.currentFrication=e<=this.duration?e/this.duration:((e-this.loopStart)%(this.duration-this.loopStart)+this.loopStart)/this.duration,this.onUpdate(this.animatedValue),this.isRunning||(null!==this.worker&&(this.worker.terminate(),this.worker=null),this.onEnd())},e}(),validMethods="MLHVCSQRZmlhvcsqrz";function render(e,t,r,i,n,o){var a=e.getContext("2d");if(null===a)throw new Error("Render Context cannot be null");if(!("save"in a))throw new Error("Render Context is not context2d");n.sprites.forEach((function(e){var n=t[e.imageKey],s=i[e.imageKey],u=r[e.imageKey];drawSprite(a,e,o,n,s,u)}))}function drawSprite(e,t,r,i,n,o){var a,s,u,l,c,h,d,f,m,v,p,y,b=t.frames[r];b.alpha<.05||(e.save(),e.globalAlpha=b.alpha,e.transform(null!==(s=null===(a=b.transform)||void 0===a?void 0:a.a)&&void 0!==s?s:1,null!==(l=null===(u=b.transform)||void 0===u?void 0:u.b)&&void 0!==l?l:0,null!==(h=null===(c=b.transform)||void 0===c?void 0:c.c)&&void 0!==h?h:0,null!==(f=null===(d=b.transform)||void 0===d?void 0:d.d)&&void 0!==f?f:1,null!==(v=null===(m=b.transform)||void 0===m?void 0:m.tx)&&void 0!==v?v:0,null!==(y=null===(p=b.transform)||void 0===p?void 0:p.ty)&&void 0!==y?y:0),void 0!==i&&(null!==b.maskPath&&(drawBezier(e,b.maskPath.d,b.maskPath.transform,b.maskPath.styles),e.clip()),void 0!==n?e.drawImage(n,0,0,b.layout.width,b.layout.height):e.drawImage(i,0,0,b.layout.width,b.layout.height)),void 0!==o&&e.drawImage(o,(b.layout.width-o.width)/2,(b.layout.height-o.height)/2),b.shapes.forEach((function(t){return drawShape(e,t)})),e.restore())}function drawShape(e,t){var r,i,n,o,a,s,u,l,c;switch(t.type){case"shape":drawBezier(e,t.path.d,t.transform,t.styles);break;case"ellipse":drawEllipse(e,null!==(r=t.path.x)&&void 0!==r?r:0,null!==(i=t.path.y)&&void 0!==i?i:0,null!==(n=t.path.radiusX)&&void 0!==n?n:0,null!==(o=t.path.radiusY)&&void 0!==o?o:0,t.transform,t.styles);break;case"rect":drawRect(e,null!==(a=t.path.x)&&void 0!==a?a:0,null!==(s=t.path.y)&&void 0!==s?s:0,null!==(u=t.path.width)&&void 0!==u?u:0,null!==(l=t.path.height)&&void 0!==l?l:0,null!==(c=t.path.cornerRadius)&&void 0!==c?c:0,t.transform,t.styles)}}function resetShapeStyles(e,t){void 0!==t&&(null!==t.stroke?e.strokeStyle=t.stroke:e.strokeStyle="transparent",null!==t.strokeWidth&&t.strokeWidth>0&&(e.lineWidth=t.strokeWidth),null!==t.miterLimit&&t.miterLimit>0&&(e.miterLimit=t.miterLimit),null!==t.lineCap&&(e.lineCap=t.lineCap),null!==t.lineJoin&&(e.lineJoin=t.lineJoin),null!==t.fill?e.fillStyle=t.fill:e.fillStyle="transparent",null!==t.lineDash&&e.setLineDash(t.lineDash))}function drawBezier(e,t,r,i){e.save(),resetShapeStyles(e,i),void 0!==r&&e.transform(r.a,r.b,r.c,r.d,r.tx,r.ty);var n={x:0,y:0,x1:0,y1:0,x2:0,y2:0};e.beginPath(),(t=t.replace(/([a-zA-Z])/g,"|||$1 ").replace(/,/g," ")).split("|||").forEach((function(t){if(0!==t.length){var r=t.substr(0,1);if(validMethods.includes(r)){var i=t.substr(1).trim().split(" ");drawBezierElement(e,n,r,i)}}})),null!==i.fill&&e.fill(),null!==i.stroke&&e.stroke(),e.restore()}function drawBezierElement(e,t,r,i){switch(r){case"M":t.x=Number(i[0]),t.y=Number(i[1]),e.moveTo(t.x,t.y);break;case"m":t.x+=Number(i[0]),t.y+=Number(i[1]),e.moveTo(t.x,t.y);break;case"L":t.x=Number(i[0]),t.y=Number(i[1]),e.lineTo(t.x,t.y);break;case"l":t.x+=Number(i[0]),t.y+=Number(i[1]),e.lineTo(t.x,t.y);break;case"H":t.x=Number(i[0]),e.lineTo(t.x,t.y);break;case"h":t.x+=Number(i[0]),e.lineTo(t.x,t.y);break;case"V":t.y=Number(i[0]),e.lineTo(t.x,t.y);break;case"v":t.y+=Number(i[0]),e.lineTo(t.x,t.y);break;case"C":t.x1=Number(i[0]),t.y1=Number(i[1]),t.x2=Number(i[2]),t.y2=Number(i[3]),t.x=Number(i[4]),t.y=Number(i[5]),e.bezierCurveTo(t.x1,t.y1,t.x2,t.y2,t.x,t.y);break;case"c":t.x1=t.x+Number(i[0]),t.y1=t.y+Number(i[1]),t.x2=t.x+Number(i[2]),t.y2=t.y+Number(i[3]),t.x+=Number(i[4]),t.y+=Number(i[5]),e.bezierCurveTo(t.x1,t.y1,t.x2,t.y2,t.x,t.y);break;case"S":void 0!==t.x1&&void 0!==t.y1&&void 0!==t.x2&&void 0!==t.y2?(t.x1=t.x-t.x2+t.x,t.y1=t.y-t.y2+t.y,t.x2=Number(i[0]),t.y2=Number(i[1]),t.x=Number(i[2]),t.y=Number(i[3]),e.bezierCurveTo(t.x1,t.y1,t.x2,t.y2,t.x,t.y)):(t.x1=Number(i[0]),t.y1=Number(i[1]),t.x=Number(i[2]),t.y=Number(i[3]),e.quadraticCurveTo(t.x1,t.y1,t.x,t.y));break;case"s":void 0!==t.x1&&void 0!==t.y1&&void 0!==t.x2&&void 0!==t.y2?(t.x1=t.x-t.x2+t.x,t.y1=t.y-t.y2+t.y,t.x2=t.x+Number(i[0]),t.y2=t.y+Number(i[1]),t.x+=Number(i[2]),t.y+=Number(i[3]),e.bezierCurveTo(t.x1,t.y1,t.x2,t.y2,t.x,t.y)):(t.x1=t.x+Number(i[0]),t.y1=t.y+Number(i[1]),t.x+=Number(i[2]),t.y+=Number(i[3]),e.quadraticCurveTo(t.x1,t.y1,t.x,t.y));break;case"Q":t.x1=Number(i[0]),t.y1=Number(i[1]),t.x=Number(i[2]),t.y=Number(i[3]),e.quadraticCurveTo(t.x1,t.y1,t.x,t.y);break;case"q":t.x1=t.x+Number(i[0]),t.y1=t.y+Number(i[1]),t.x+=Number(i[2]),t.y+=Number(i[3]),e.quadraticCurveTo(t.x1,t.y1,t.x,t.y);break;case"A":case"a":break;case"Z":case"z":e.closePath()}}function drawEllipse(e,t,r,i,n,o,a){e.save(),resetShapeStyles(e,a),void 0!==o&&e.transform(o.a,o.b,o.c,o.d,o.tx,o.ty);var s=2*i,u=2*n,l=s/2*.5522848,c=u/2*.5522848,h=(t-=i)+s,d=(r-=n)+u,f=t+s/2,m=r+u/2;e.beginPath(),e.moveTo(t,m),e.bezierCurveTo(t,m-c,f-l,r,f,r),e.bezierCurveTo(f+l,r,h,m-c,h,m),e.bezierCurveTo(h,m+c,f+l,d,f,d),e.bezierCurveTo(f-l,d,t,m+c,t,m),null!==a.fill&&e.fill(),null!==a.stroke&&e.stroke(),e.restore()}function drawRect(e,t,r,i,n,o,a,s){e.save(),resetShapeStyles(e,s),void 0!==a&&e.transform(a.a,a.b,a.c,a.d,a.tx,a.ty);var u=o;i<2*u&&(u=i/2),n<2*u&&(u=n/2),e.beginPath(),e.moveTo(t+u,r),e.arcTo(t+i,r,t+i,r+n,u),e.arcTo(t+i,r+n,t,r+n,u),e.arcTo(t,r+n,t,r,u),e.arcTo(t,r,t+i,r,u),e.closePath(),null!==s.fill&&e.fill(),null!==s.stroke&&e.stroke(),e.restore()}var inBrowser="undefined"!=typeof window,hasIntersectionObserver=inBrowser&&"IntersectionObserver"in window,Player=function(){function e(e){var t,r=this;this.currentFrame=0,this.totalFrames=0,this.videoEntity=void 0,this.config={container:document.createElement("canvas"),loop:0,fillMode:"forwards",playMode:"forwards",startFrame:0,endFrame:0,loopStartFrame:0,isCacheFrames:!1,isUseIntersectionObserver:!1,isOpenNoExecutionDelay:!1},this.isBeIntersection=!0,this.intersectionObserver=null,this.bitmapsCache={},this.cacheFrames={},this.animator=new Animator,this.animator.onEnd=function(){void 0!==r.onEnd&&r.onEnd()},e instanceof HTMLCanvasElement?t=e:void 0!==e.container&&(t=e.container,this.setConfig(e)),this.config.container=null!=t?t:this.config.container,this.ofsCanvas=void 0!==window.OffscreenCanvas?new window.OffscreenCanvas(this.config.container.width,this.config.container.height):document.createElement("canvas")}return e.prototype.setConfig=function(e){var t,r,i,n,o,a,s,u,l,c,h;if(void 0!==e.startFrame&&void 0!==e.endFrame&&e.startFrame>e.endFrame)throw new Error("StartFrame should > EndFrame");this.config.container=null!==(t=e.container)&&void 0!==t?t:this.config.container,this.config.loop=null!==(r=e.loop)&&void 0!==r?r:0,this.config.fillMode=null!==(i=e.fillMode)&&void 0!==i?i:"forwards",this.config.playMode=null!==(n=e.playMode)&&void 0!==n?n:"forwards",this.config.startFrame=null!==(o=e.startFrame)&&void 0!==o?o:0,this.config.endFrame=null!==(a=e.endFrame)&&void 0!==a?a:0,this.config.loopStartFrame=null!==(s=e.loopStartFrame)&&void 0!==s?s:0,this.config.isCacheFrames=null!==(u=e.isCacheFrames)&&void 0!==u&&u,this.config.isUseIntersectionObserver=null!==(l=e.isUseIntersectionObserver)&&void 0!==l&&l,this.config.isOpenNoExecutionDelay=null!==(c=e.isOpenNoExecutionDelay)&&void 0!==c&&c,this.animator.isOpenNoExecutionDelay=null!==(h=e.isOpenNoExecutionDelay)&&void 0!==h&&h,this.setIntersectionObserver()},e.prototype.setIntersectionObserver=function(){var e=this;hasIntersectionObserver&&this.config.isUseIntersectionObserver?(this.intersectionObserver=new IntersectionObserver((function(t){e.isBeIntersection=!(t[0].intersectionRatio<=0)}),{rootMargin:"0px",threshold:[0,.5,1]}),this.intersectionObserver.observe(this.config.container)):(null!==this.intersectionObserver&&this.intersectionObserver.disconnect(),this.config.isUseIntersectionObserver=!1,this.isBeIntersection=!0)},e.prototype.mount=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(r){switch(r.label){case 0:return[4,new Promise((function(r,i){if(t.currentFrame=0,t.totalFrames=e.frames-1,t.videoEntity=e,t.clearContainer(),t.setSize(),t.bitmapsCache={},void 0!==t.videoEntity)if(0!==Object.keys(t.videoEntity.images).length){var n=0,o=0;for(var a in t.videoEntity.images){var s=t.videoEntity.images[a];if("string"==typeof s){n++;var u=document.createElement("img");u.src="data:image/png;base64,"+s,t.bitmapsCache[a]=u,u.onload=function(){++o===n&&r()}}else t.bitmapsCache[a]=s,n++,++o===n&&r()}}else r();else r()}))];case 1:return[2,r.sent()]}}))}))},e.prototype.clearContainer=function(){var e=this.config.container.width;this.config.container.width=e},e.prototype.start=function(){if(void 0===this.videoEntity)throw new Error("videoEntity undefined");this.clearContainer(),this.startAnimation(),void 0!==this.onStart&&this.onStart()},e.prototype.resume=function(){this.startAnimation(),void 0!==this.onResume&&this.onResume()},e.prototype.pause=function(){this.animator.stop(),void 0!==this.onPause&&this.onPause()},e.prototype.stop=function(){this.animator.stop(),this.currentFrame=0,this.clearContainer(),void 0!==this.onStop&&this.onStop()},e.prototype.clear=function(){this.clearContainer()},e.prototype.destroy=function(){this.animator.stop(),this.clearContainer(),this.animator=null,this.videoEntity=null},e.prototype.startAnimation=function(){var e=this;if(void 0===this.videoEntity)throw new Error("videoEntity undefined");var t=this.config,r=this.totalFrames,i=this.videoEntity,n=t.playMode,o=t.startFrame,a=t.endFrame,s=t.loopStartFrame,u=t.fillMode,l=t.loop;this.currentFrame===r&&(this.currentFrame=o>0?o:0),"forwards"===n?(this.animator.startValue=o>0?o:0,this.animator.endValue=a>0?a:r):(this.animator.startValue=a>0?a:r,this.animator.endValue=o>0?o:0);var c=i.frames;a>0&&a>o?c=a-o:a<=0&&o>0&&(c=i.frames-o),this.animator.duration=c*(1/i.fps)*1e3,this.animator.loopStart=s>o?(s-o)*(1/i.fps)*1e3:0,this.animator.loop=!0===l||l<=0?1/0:!1===l?1:l,this.animator.fillRule="backwards"===u?1:0,this.animator.onUpdate=function(t){e.currentFrame!==t&&(e.currentFrame=t,e.drawFrame(e.currentFrame),void 0!==e.onProcess&&e.onProcess())},this.animator.start()},e.prototype.setSize=function(){if(void 0===this.videoEntity)throw new Error("videoEntity undefined");var e=this.videoEntity.size;this.config.container.width=e.width,this.config.container.height=e.height},e.prototype.drawFrame=function(e){if(void 0===this.videoEntity)throw new Error("Player VideoEntity undefined");if(!this.config.isUseIntersectionObserver||this.isBeIntersection){this.clearContainer();var t=this.config.container.getContext("2d");if(null===t)throw new Error("Canvas Context cannot be null");if(this.config.isCacheFrames&&void 0!==this.cacheFrames[e]){var r=this.cacheFrames[e];t.drawImage(r,0,0,r.width,r.height,0,0,r.width,r.height)}else{var i=this.ofsCanvas;if(void 0!==window.OffscreenCanvas&&window.navigator.userAgent.includes("Firefox")&&(i=new window.OffscreenCanvas(this.config.container.width,this.config.container.height)),i.width=this.config.container.width,i.height=this.config.container.height,render(i,this.bitmapsCache,this.videoEntity.dynamicElements,this.videoEntity.replaceElements,this.videoEntity,this.currentFrame),t.drawImage(i,0,0,i.width,i.height,0,0,i.width,i.height),this.config.isCacheFrames)if("toDataURL"in i){var n=i.toDataURL(),o=new Image;o.src=n,this.cacheFrames[e]=o}else this.cacheFrames[e]=i.transferToImageBitmap()}}},e}(),DB=function(){function e(e){var t=void 0===e?{name:"SVGA.DB",version:1,storeName:"files"}:e,r=t.name,i=t.version,n=t.storeName;this.storeName=n,this.dbPromise=new Promise((function(e,t){if(void 0===window.indexedDB)throw new Error("[SVGA.DB] indexedDB not supported");var o=window.indexedDB.open(r,i);o.onerror=function(e){return t(new Error("[SVGA.DB] indexedDB open fail, ".concat(e.type)))},o.onsuccess=function(){return e(o.result)},o.onupgradeneeded=function(){o.result.createObjectStore(n)}}))}return e.prototype.find=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(r){switch(r.label){case 0:return[4,this.dbPromise.then((function(r){return __awaiter(t,void 0,void 0,(function(){var t=this;return __generator(this,(function(i){switch(i.label){case 0:return[4,new Promise((function(i,n){var o=r.transaction([t.storeName],"readonly").objectStore(t.storeName).get(e);o.onsuccess=function(){"string"==typeof o.result?i(JSON.parse(o.result)):i(void 0)},o.onerror=function(){return n(new Error("find error"))}}))];case 1:return[2,i.sent()]}}))}))}))];case 1:return[2,r.sent()]}}))}))},e.prototype.insert=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r=this;return __generator(this,(function(i){switch(i.label){case 0:return[4,this.dbPromise.then((function(i){return __awaiter(r,void 0,void 0,(function(){var r=this;return __generator(this,(function(n){switch(n.label){case 0:return[4,new Promise((function(n,o){var a=i.transaction([r.storeName],"readwrite"),s=a.objectStore(r.storeName).put(JSON.stringify(t),e);a.oncomplete=function(){return n()},s.onerror=function(){return o(new Error("insert error"))}}))];case 1:return[2,n.sent()]}}))}))}))];case 1:return[2,i.sent()]}}))}))},e.prototype.delete=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(r){switch(r.label){case 0:return[4,this.dbPromise.then((function(r){return __awaiter(t,void 0,void 0,(function(){var t=this;return __generator(this,(function(i){switch(i.label){case 0:return[4,new Promise((function(i,n){var o=r.transaction([t.storeName],"readwrite").objectStore(t.storeName).delete(e);o.onsuccess=function(){return i()},o.onerror=function(){return n(new Error("delete error"))}}))];case 1:return[2,i.sent()]}}))}))}))];case 1:return[2,r.sent()]}}))}))},e}();exports.DB=DB,exports.Parser=Parser,exports.Player=Player,Object.defineProperty(exports,"__esModule",{value:!0})})); diff --git a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Resources/Web/svga2html.html b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Resources/Web/svga2html.html index 22349b2..65e9176 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Resources/Web/svga2html.html +++ b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/Resources/Web/svga2html.html @@ -18,7 +18,8 @@ - - + + +