lottie-web
Version:
After Effects plugin for exporting animations to SVG + JavaScript or canvas + JavaScript
13 lines • 316 kB
JavaScript
(typeof navigator !== "undefined") && (function(root, factory) {
if (typeof define === "function" && define.amd) {
define(function() {
return factory(root);
});
} else if (typeof module === "object" && module.exports) {
module.exports = factory(root);
} else {
root.lottie = factory(root);
root.bodymovin = root.lottie;
}
}((self || {}), function(window) {
function workerContent(){function extendPrototype(t,e){for(var i,r=t.length,s=0;s<r;s+=1)for(var a in i=t[s].prototype)Object.prototype.hasOwnProperty.call(i,a)&&(e.prototype[a]=i[a])}function ProxyElement(t,e){this._state="init",this._isDirty=!1,this._isProxy=!0,this._changedStyles=[],this._changedAttributes=[],this._changedElements=[],this._textContent=null,this.type=t,this.namespace=e,this.children=[],localIdCounter+=1,this.attributes={id:"l_d_"+localIdCounter},this.style=new Style(this)}ProxyElement.prototype={appendChild:function(t){(t.parentNode=this).children.push(t),this._isDirty=!0,this._changedElements.push([t,this.attributes.id])},insertBefore:function(t,e){for(var i=this.children,r=0;r<i.length;r+=1)if(i[r]===e)return i.splice(r,0,t),this._isDirty=!0,void this._changedElements.push([t,this.attributes.id,e.attributes.id]);i.push(e)},setAttribute:function(t,e){this.attributes[t]=e,this._isDirty||(this._isDirty=!0),this._changedAttributes.push(t)},serialize:function(){return{type:this.type,namespace:this.namespace,style:this.style.serialize(),attributes:this.attributes,children:this.children.map(function(t){return t.serialize()}),textContent:this._textContent}},addEventListener:function(t,e){setTimeout(e,1)},setAttributeNS:function(t,e,i){this.attributes[e]=i,this._isDirty||(this._isDirty=!0),this._changedAttributes.push(e)}},Object.defineProperty(ProxyElement.prototype,"textContent",{set:function(t){this._isDirty=!0,this._textContent=t}});var localIdCounter=0,animations={},styleProperties=["width","height","display","transform","opacity","contentVisibility","mix-blend-mode"];function convertArguments(t){for(var e=[],i=t.length,r=0;r<i;r+=1)e.push(t[r]);return e}function Style(t){this.element=t}function CanvasContext(t){this.element=t}Style.prototype={serialize:function(){for(var t={},e=0;e<styleProperties.length;e+=1){var i=styleProperties[e],r="_"+i;r in this&&(t[i]=this[r])}return t}},styleProperties.forEach(function(e){Object.defineProperty(Style.prototype,e,{set:function(t){this.element._isDirty||(this.element._isDirty=!0),this.element._changedStyles.push(e),this["_"+e]=t},get:function(){return this["_"+e]}})}),CanvasContext.prototype={createRadialGradient:function(){var t={t:"rGradient",a:convertArguments(arguments),stops:[]};return this.element.instructions.push(t),{addColorStop:function(){t.stops.push(convertArguments(arguments))}}},createLinearGradient:function(){var t={t:"lGradient",a:convertArguments(arguments),stops:[]};return this.element.instructions.push(t),{addColorStop:function(){t.stops.push(convertArguments(arguments))}}}},Object.defineProperties(CanvasContext.prototype,{canvas:{enumerable:!0,get:function(){return this.element}}});var canvasContextMethods=["fillRect","setTransform","drawImage","beginPath","moveTo","save","restore","fillText","setLineDash","clearRect","clip","rect","stroke","fill","closePath","bezierCurveTo","lineTo"],canvasContextProperties=(canvasContextMethods.forEach(function(t){CanvasContext.prototype[t]=function(){this.element.instructions.push({t:t,a:convertArguments(arguments)})}}),["globalAlpha","strokeStyle","fillStyle","lineCap","lineJoin","lineWidth","miterLimit","lineDashOffset","globalCompositeOperation"]);function CanvasElement(t,e){ProxyElement.call(this,t,e),this.instructions=[],this.width=0,this.height=0,this.context=new CanvasContext(this)}function createElement(t,e){return new("canvas"===e?CanvasElement:ProxyElement)(e,t)}canvasContextProperties.forEach(function(e){Object.defineProperty(CanvasContext.prototype,e,{set:function(t){this.element.instructions.push({t:e,a:t})}})}),CanvasElement.prototype={getContext:function(){return this.context},resetInstructions:function(){this.instructions.length=0}},extendPrototype([ProxyElement],CanvasElement);var window=self,document={createElementNS:function(t,e){return createElement(t,e)},createElement:function(t){return createElement("",t)},getElementsByTagName:function(){return[]},body:createElement("","body"),_isProxy:!0},lottieInternal=function(){function addElementToList(t,e){e.push(t),t._isDirty=!1,t._changedStyles.length=0,t._changedAttributes.length=0,t._changedElements.length=0,t._textContent=null,t.children.forEach(function(t){addElementToList(t,e)})}function addChangedAttributes(t){for(var e,i=t._changedAttributes,r=[],s=0;s<i.length;s+=1)e=i[s],r.push([e,t.attributes[e]]);return r}function addChangedStyles(t){for(var e,i=t._changedStyles,r=[],s=0;s<i.length;s+=1)e=i[s],r.push([e,t.style[e]]);return r}function addChangedElements(t,e){for(var i,r=t._changedElements,s=[],a=0;a<r.length;a+=1)i=r[a],s.push([i[0].serialize(),i[1],i[2]]),addElementToList(i[0],e);return s}function loadAnimation(a){var e,t,i,r,s=a.params,n=[];"svg"===s.renderer?(e=document.createElement("div"),s.container=e):((i=s.rendererSettings.canvas)||((i=document.createElement("canvas")).width=s.animationData.w,i.height=s.animationData.h),r=i.getContext("2d"),s.rendererSettings.context=r),(t=lottie.loadAnimation(s)).addEventListener("error",function(t){console.log(t)}),t.onError=function(t){console.log("ERRORO",t)},t.addEventListener("_play",function(){self.postMessage({type:"playing",payload:{id:a.id}})}),t.addEventListener("_pause",function(){self.postMessage({type:"paused",payload:{id:a.id}})}),"svg"===s.renderer?(t.addEventListener("DOMLoaded",function(){var t=e.serialize();addElementToList(e,n),self.postMessage({type:"SVGloaded",payload:{id:a.id,tree:t.children[0]}})}),t.addEventListener("drawnFrame",function(t){for(var e,i,r=[],s=0;s<n.length;s+=1)(i=n[s])._isDirty&&(e={id:i.attributes.id,styles:addChangedStyles(i),attributes:addChangedAttributes(i),elements:addChangedElements(i,n),textContent:i._textContent||void 0},r.push(e),i._isDirty=!1,i._changedAttributes.length=0,i._changedStyles.length=0,i._changedElements.length=0,i._textContent=null);self.postMessage({type:"SVGupdated",payload:{elements:r,id:a.id,currentTime:t.currentTime}})})):i._isProxy&&t.addEventListener("drawnFrame",function(t){self.postMessage({type:"CanvasUpdated",payload:{instructions:i.instructions,id:a.id,currentTime:t.currentTime}}),i.resetInstructions()}),t.addEventListener("DOMLoaded",function(){self.postMessage({type:"DOMLoaded",payload:{id:a.id,totalFrames:t.totalFrames,frameRate:t.frameRate,firstFrame:t.firstFrame,currentFrame:t.currentFrame,playDirection:t.playDirection,isSubframeEnabled:t.isSubframeEnabled,currentRawFrame:t.currentRawFrame,timeCompleted:t.timeCompleted}})}),animations[a.id]={animation:t,events:{}}}return void 0!==document&&"undefined"!=typeof navigator&&((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(){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){for(var i,r=t.length,s=0;s<r;s+=1)for(var a in i=t[s].prototype)Object.prototype.hasOwnProperty.call(i,a)&&(e.prototype[a]=i[a])}function getDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)}function createProxyFunction(t){function e(){}return e.prototype=t,e}var audioControllerFactory=(()=>{function t(t){this.audios=[],this.audioFactory=t,this._volume=1,this._isMuted=!1}return t.prototype={addAudio:function(t){this.audios.push(t)},pause:function(){for(var t=this.audios.length,e=0;e<t;e+=1)this.audios[e].pause()},resume:function(){for(var t=this.audios.length,e=0;e<t;e+=1)this.audios[e].resume()},setRate:function(t){for(var e=this.audios.length,i=0;i<e;i+=1)this.audios[i].setRate(t)},createAudio:function(t){return this.audioFactory?this.audioFactory(t):window.Howl?new window.Howl({src:[t]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(t){this.audioFactory=t},setVolume:function(t){this._volume=t,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){for(var t=this.audios.length,e=0;e<t;e+=1)this.audios[e].volume(this._volume*(this._isMuted?0:1))}},function(){return new t}})(),createTypedArray=(()=>{function i(t,e){var i,r=0,s=[];switch(t){case"int16":case"uint8c":i=1;break;default:i=1.1}for(r=0;r<e;r+=1)s.push(i);return s}return"function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(t,e){return"float32"===t?new Float32Array(e):"int16"===t?new Int16Array(e):"uint8c"===t?new Uint8ClampedArray(e):i(t,e)}:i})();function createSizedArray(t){return Array.apply(null,{length:t})}function _typeof$6(t){return(_typeof$6="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})(t)}var subframeEnabled=!0,expressionsPlugin=null,expressionsInterfaces=null,idPrefix$1="",isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),_shouldRoundValues=!1,bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};function ProjectInterface$1(){}(()=>{for(var t=["abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","cbrt","expm1","clz32","cos","cosh","exp","floor","fround","hypot","imul","log","log1p","log2","log10","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc","E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"],e=t.length,i=0;i<e;i+=1)BMMath[t[i]]=Math[t[i]]})(),BMMath.random=Math.random,BMMath.abs=function(t){if("object"===_typeof$6(t)&&t.length){for(var e=createSizedArray(t.length),i=t.length,r=0;r<i;r+=1)e[r]=Math.abs(t[r]);return e}return Math.abs(t)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function roundValues(t){_shouldRoundValues=!!t}function bmRnd(t){if(_shouldRoundValues)return Math.round(t)}function styleDiv(t){t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.display="block",t.style.transformOrigin="0 0",t.style.webkitTransformOrigin="0 0",t.style.backfaceVisibility="visible",t.style.webkitBackfaceVisibility="visible",t.style.transformStyle="preserve-3d",t.style.webkitTransformStyle="preserve-3d",t.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(t,e,i,r){this.type=t,this.currentTime=e,this.totalTime=i,this.direction=r<0?-1:1}function BMCompleteEvent(t,e){this.type=t,this.direction=e<0?-1:1}function BMCompleteLoopEvent(t,e,i,r){this.type=t,this.currentLoop=i,this.totalLoops=e,this.direction=r<0?-1:1}function BMSegmentStartEvent(t,e,i){this.type=t,this.firstFrame=e,this.totalFrames=i}function BMDestroyEvent(t,e){this.type=t,this.target=e}function BMRenderFrameErrorEvent(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}function BMConfigErrorEvent(t){this.type="configError",this.nativeError=t}function BMAnimationConfigErrorEvent(t,e){this.type=t,this.nativeError=e}var createElementID=(()=>{var t=0;return function(){return idPrefix$1+"__lottie_element_"+(t+=1)}})();function HSVtoRGB(t,e,i){var r,s,a,n=Math.floor(6*t),t=6*t-n,o=i*(1-e),h=i*(1-t*e),l=i*(1-(1-t)*e);switch(n%6){case 0:r=i,s=l,a=o;break;case 1:r=h,s=i,a=o;break;case 2:r=o,s=i,a=l;break;case 3:r=o,s=h,a=i;break;case 4:r=l,s=o,a=i;break;case 5:r=i,s=o,a=h}return[r,s,a]}function RGBtoHSV(t,e,i){var r,s=Math.max(t,e,i),a=Math.min(t,e,i),n=s-a,o=0===s?0:n/s,h=s/255;switch(s){case a:r=0;break;case t:r=e-i+n*(e<i?6:0),r/=6*n;break;case e:r=i-t+2*n,r/=6*n;break;case i:r=t-e+4*n,r/=6*n}return[r,o,h]}function addSaturationToRGB(t,e){t=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return t[1]+=e,1<t[1]?t[1]=1:t[1]<=0&&(t[1]=0),HSVtoRGB(t[0],t[1],t[2])}function addBrightnessToRGB(t,e){t=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return t[2]+=e,1<t[2]?t[2]=1:t[2]<0&&(t[2]=0),HSVtoRGB(t[0],t[1],t[2])}function addHueToRGB(t,e){t=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return t[0]+=e/360,1<t[0]?--t[0]:t[0]<0&&(t[0]+=1),HSVtoRGB(t[0],t[1],t[2])}var rgbToHex=(()=>{for(var t,r=[],e=0;e<256;e+=1)t=e.toString(16),r[e]=1===t.length?"0"+t:t;return function(t,e,i){return"#"+r[t=t<0?0:t]+r[e=e<0?0:e]+r[i=i<0?0:i]}})(),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})(t)}var dataManager=(()=>{var i,r,s=1,a=[],n={onmessage:function(){},postMessage:function(t){i({data:t})}},o={postMessage:function(t){n.onmessage({data:t})}};function h(){var t,e;r||(t=function(e){function t(){function p(t,e){for(var i,r,s,a=t.length,n=0;n<a;n+=1)if("ks"in(s=t[n])&&!s.completed){if(s.completed=!0,s.hasMask)for(var o=s.masksProperties,h=o.length,l=0;l<h;l+=1)if(o[l].pt.k.i)c(o[l].pt.k);else for(r=o[l].pt.k.length,i=0;i<r;i+=1)o[l].pt.k[i].s&&c(o[l].pt.k[i].s[0]),o[l].pt.k[i].e&&c(o[l].pt.k[i].e[0]);0===s.ty?(s.layers=m(s.refId,e),p(s.layers,e)):4===s.ty?f(s.shapes):5===s.ty&&0===(s=s).t.a.length&&0 in s.t.p}}function m(t,e){t=((t,e)=>{for(var i=0,r=e.length;i<r;){if(e[i].id===t)return e[i];i+=1}return null})(t,e);return t?t.layers.__used?JSON.parse(JSON.stringify(t.layers)):(t.layers.__used=!0,t.layers):null}function f(t){for(var e,i,r=t.length-1;0<=r;--r)if("sh"===t[r].ty)if(t[r].ks.k.i)c(t[r].ks.k);else for(i=t[r].ks.k.length,e=0;e<i;e+=1)t[r].ks.k[e].s&&c(t[r].ks.k[e].s[0]),t[r].ks.k[e].e&&c(t[r].ks.k[e].e[0]);else"gr"===t[r].ty&&f(t[r].it)}function c(t){for(var e=t.i.length,i=0;i<e;i+=1)t.i[i][0]+=t.v[i][0],t.i[i][1]+=t.v[i][1],t.o[i][0]+=t.v[i][0],t.o[i][1]+=t.v[i][1]}function s(t,e){e=e?e.split("."):[100,100,100];return t[0]>e[0]||!(t[0]<e[0])&&(e[1]<t[1]||!(t[1]<e[1])&&e[2]<t[2])}r=[4,4,14];var r,a=function(t){if(s(r,t.v)&&(n(t.layers),t.assets))for(var e=t.assets.length,i=0;i<e;i+=1)t.assets[i].layers&&n(t.assets[i].layers)};function n(t){for(var e,i,r=t.length,s=0;s<r;s+=1)5===t[s].ty&&(e=t[s],i=void 0,i=e.t.d,e.t.d={k:[{s:i,t:0}]})}o=[4,7,99];var o,h,l=function(t){if(t.chars&&!s(o,t.v))for(var e=t.chars.length,i=0;i<e;i+=1){var r=t.chars[i];r.data&&r.data.shapes&&(f(r.data.shapes),r.data.ip=0,r.data.op=99999,r.data.st=0,r.data.sr=1,r.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},t.chars[i].t||(r.data.shapes.push({ty:"no"}),r.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})))}},d=(h=[5,7,15],function(t){if(s(h,t.v)&&(u(t.layers),t.assets))for(var e=t.assets.length,i=0;i<e;i+=1)t.assets[i].layers&&u(t.assets[i].layers)});function u(t){for(var e,i=t.length,r=0;r<i;r+=1)5===t[r].ty&&("number"==typeof(e=(e=t[r]).t.p).a&&(e.a={a:0,k:e.a}),"number"==typeof e.p&&(e.p={a:0,k:e.p}),"number"==typeof e.r)&&(e.r={a:0,k:e.r})}y=[4,1,9];var y,g=function(t){if(s(y,t.v)&&(v(t.layers),t.assets))for(var e=t.assets.length,i=0;i<e;i+=1)t.assets[i].layers&&v(t.assets[i].layers)};function v(t){for(var e=t.length,i=0;i<e;i+=1)4===t[i].ty&&!function t(e){for(var i,r,s=e.length,a=0;a<s;a+=1)if("gr"===e[a].ty)t(e[a].it);else if("fl"===e[a].ty||"st"===e[a].ty)if(e[a].c.k&&e[a].c.k[0].i)for(r=e[a].c.k.length,i=0;i<r;i+=1)e[a].c.k[i].s&&(e[a].c.k[i].s[0]/=255,e[a].c.k[i].s[1]/=255,e[a].c.k[i].s[2]/=255,e[a].c.k[i].s[3]/=255),e[a].c.k[i].e&&(e[a].c.k[i].e[0]/=255,e[a].c.k[i].e[1]/=255,e[a].c.k[i].e[2]/=255,e[a].c.k[i].e[3]/=255);else e[a].c.k[0]/=255,e[a].c.k[1]/=255,e[a].c.k[2]/=255,e[a].c.k[3]/=255}(t[i].shapes)}b=[4,4,18];var b,x=function(t){if(s(b,t.v)&&(P(t.layers),t.assets))for(var e=t.assets.length,i=0;i<e;i+=1)t.assets[i].layers&&P(t.assets[i].layers)};function P(t){for(var e,i,r,s=t.length,a=0;a<s;a+=1){if((e=t[a]).hasMask)for(var n=e.masksProperties,o=n.length,h=0;h<o;h+=1)if(n[h].pt.k.i)n[h].pt.k.c=n[h].cl;else for(r=n[h].pt.k.length,i=0;i<r;i+=1)n[h].pt.k[i].s&&(n[h].pt.k[i].s[0].c=n[h].cl),n[h].pt.k[i].e&&(n[h].pt.k[i].e[0].c=n[h].cl);4===e.ty&&!function t(e){for(var i,r,s=e.length-1;0<=s;--s)if("sh"===e[s].ty)if(e[s].ks.k.i)e[s].ks.k.c=e[s].closed;else for(r=e[s].ks.k.length,i=0;i<r;i+=1)e[s].ks.k[i].s&&(e[s].ks.k[i].s[0].c=e[s].closed),e[s].ks.k[i].e&&(e[s].ks.k[i].e[0].c=e[s].closed);else"gr"===e[s].ty&&t(e[s].it)}(e.shapes)}}var t={};return t.completeData=function(t){if(!t.__complete){g(t),a(t),l(t),d(t),x(t),p(t.layers,t.assets);var e=t.chars,i=t.assets;if(e)for(var r=0,s=e.length,r=0;r<s;r+=1)1===e[r].t&&(e[r].data.layers=m(e[r].data.refId,i),p(e[r].data.layers,i));t.__complete=!0}},t.checkColors=g,t.checkChars=l,t.checkPathProperties=d,t.checkShapes=x,t.completeLayers=p,t}function n(t){var e=t.getResponseHeader("content-type");return e&&"json"===t.responseType&&-1!==e.indexOf("json")||t.response&&"object"===_typeof$5(t.response)?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):null}var i;o.dataManager||(o.dataManager=t()),o.assetLoader||(o.assetLoader={load:function(e,i,t,r){var s,a=new XMLHttpRequest;try{a.responseType="json"}catch(t){}a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status)s=n(a),t(s);else try{s=n(a),t(s)}catch(t){r&&r(t)}};try{a.open(["G","E","T"].join(""),e,!0)}catch(t){a.open(["G","E","T"].join(""),i+"/"+e,!0)}a.send()}}),"loadAnimation"===e.data.type?o.assetLoader.load(e.data.path,e.data.fullPath,function(t){o.dataManager.completeData(t),o.postMessage({id:e.data.id,payload:t,status:"success"})},function(){o.postMessage({id:e.data.id,status:"error"})}):"complete"===e.data.type?(i=e.data.animation,o.dataManager.completeData(i),o.postMessage({id:e.data.id,payload:i,status:"success"})):"loadData"===e.data.type&&o.assetLoader.load(e.data.path,e.data.fullPath,function(t){o.postMessage({id:e.data.id,payload:t,status:"success"})},function(){o.postMessage({id:e.data.id,status:"error"})})},(r=window.Worker&&window.Blob&&getWebWorker()?(e=new Blob(["var _workerSelf = self; self.onmessage = ",t.toString()],{type:"text/javascript"}),e=URL.createObjectURL(e),new Worker(e)):(i=t,n)).onmessage=function(t){var t=t.data,e=t.id,i=a[e];a[e]=null,"success"===t.status?i.onComplete(t.payload):i.onError&&i.onError()})}function l(t,e){var i="processId_"+(s+=1);return a[i]={onComplete:t,onError:e},i}return{loadAnimation:function(t,e,i){h(),e=l(e,i),r.postMessage({type:"loadAnimation",path:t,fullPath:window.location.origin+window.location.pathname,id:e})},loadData:function(t,e,i){h(),e=l(e,i),r.postMessage({type:"loadData",path:t,fullPath:window.location.origin+window.location.pathname,id:e})},completeAnimation:function(t,e,i){h(),e=l(e,i),r.postMessage({type:"complete",animation:t,id:e})}}})(),ImagePreloader=(()=>{(t=createTag("canvas")).width=1,t.height=1,(e=t.getContext("2d")).fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1);var t,e,s=t;function i(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function r(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function a(t,e,i){var r="";return r=t.e?t.p:e?e+(e=-1!==(e=t.p).indexOf("images/")?e.split("/")[1]:e):(r=i,(r+=t.u||"")+t.p)}function n(){this._imageLoaded=i.bind(this),this._footageLoaded=r.bind(this),this.testImageLoaded=function(t){var e=0,i=setInterval(function(){(t.getBBox().width||500<e)&&(this._imageLoaded(),clearInterval(i)),e+=1}.bind(this),50)}.bind(this),this.createFootageData=function(t){var e={assetData:t},t=a(t,this.assetsPath,this.path);return dataManager.loadData(t,function(t){e.img=t,this._footageLoaded()}.bind(this),function(){e.img={},this._footageLoaded()}.bind(this)),e}.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){this.imagesLoadedCb=e;for(var i=t.length,r=0;r<i;r+=1)t[r].layers||(t[r].t&&"seq"!==t[r].t?3===t[r].t&&(this.totalFootages+=1,this.images.push(this.createFootageData(t[r]))):(this.totalImages+=1,this.images.push(this._createImageData(t[r]))))},setAssetsPath:function(t){this.assetsPath=t||""},setPath:function(t){this.path=t||""},loadedImages:function(){return this.totalImages===this.loadedAssets},loadedFootages:function(){return this.totalFootages===this.loadedFootagesCount},destroy:function(){this.imagesLoadedCb=null,this.images.length=0},getAsset:function(t){for(var e=0,i=this.images.length;e<i;){if(this.images[e].assetData===t)return this.images[e].img;e+=1}return null},createImgData:function(t){var e=a(t,this.assetsPath,this.path),i=createTag("img"),r=(i.crossOrigin="anonymous",i.addEventListener("load",this._imageLoaded,!1),i.addEventListener("error",function(){r.img=s,this._imageLoaded()}.bind(this),!1),i.src=e,{img:i,assetData:t});return r},createImageData:function(t){var e=a(t,this.assetsPath,this.path),i=createNS("image"),r=(isSafari?this.testImageLoaded(i):i.addEventListener("load",this._imageLoaded,!1),i.addEventListener("error",function(){r.img=s,this._imageLoaded()}.bind(this),!1),i.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this._elementHelper.append?this._elementHelper.append(i):this._elementHelper.appendChild(i),{img:i,assetData:t});return r},imageLoaded:i,footageLoaded:r,setCacheType:function(t,e){"svg"===t?(this._elementHelper=e,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}},n})();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var i=this._cbs[t],r=0;r<i.length;r+=1)i[r](e)},addEventListener:function(t,e){return this._cbs[t]||(this._cbs[t]=[]),this._cbs[t].push(e),function(){this.removeEventListener(t,e)}.bind(this)},removeEventListener:function(t,e){if(e){if(this._cbs[t]){for(var i=0,r=this._cbs[t].length;i<r;)this._cbs[t][i]===e&&(this._cbs[t].splice(i,1),--i,--r),i+=1;this._cbs[t].length||(this._cbs[t]=null)}}else this._cbs[t]=null}};var markerParser=function(e){for(var t=[],i=0;i<e.length;i+=1){var r=e[i],r={time:r.tm,duration:r.dr};try{r.payload=JSON.parse(e[i].cm)}catch(t){try{r.payload=(t=>{for(var e,i=t.split("\r\n"),r={},s=0,a=0;a<i.length;a+=1)2===(e=i[a].split(":")).length&&(r[e[0]]=e[1].trim(),s+=1);if(0===s)throw new Error;return r})(e[i].cm)}catch(t){r.payload={name:e[i].cm}}}t.push(r)}return t},ProjectInterface=(()=>{function e(t){this.compositions.push(t)}return function(){function t(t){for(var e=0,i=this.compositions.length;e<i;){if(this.compositions[e].data&&this.compositions[e].data.nm===t)return this.compositions[e].prepareFrame&&this.compositions[e].data.xt&&this.compositions[e].prepareFrame(this.currentFrame),this.compositions[e].compInterface;e+=1}return null}return t.compositions=[],t.currentFrame=0,t.registerComposition=e,t}})(),renderers={},registerRenderer=function(t,e){renderers[t]=e};function getRenderer(t){return renderers[t]}function getRegisteredRenderer(){if(renderers.canvas)return"canvas";for(var t in renderers)if(renderers[t])return t;return""}function _typeof$4(t){return(_typeof$4="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})(t)}var AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=getSubframeEnabled(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory(),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new BMEnterFrameEvent("drawnFrame",0,0,0),this.expressionsPlugin=getExpressionsPlugin()},animationManager=(extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(t){(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var e="svg",i=(t.animType?e=t.animType:t.renderer&&(e=t.renderer),getRenderer(e));this.renderer=new i(this,t.rendererSettings),this.imagePreloader.setCacheType(e,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=e,""===t.loop||null==t.loop||!0===t.loop?this.loop=!0:!1===t.loop?this.loop=!1:this.loop=parseInt(t.loop,10),this.autoplay=!("autoplay"in t)||t.autoplay,this.name=t.name||"",this.autoloadSegments=!Object.prototype.hasOwnProperty.call(t,"autoloadSegments")||t.autoloadSegments,this.assetsPath=t.assetsPath,this.initialSegment=t.initialSegment,t.audioFactory&&this.audioController.setAudioFactory(t.audioFactory),t.animationData?this.setupAnimation(t.animationData):t.path&&(-1!==t.path.lastIndexOf("\\")?this.path=t.path.substr(0,t.path.lastIndexOf("\\")+1):this.path=t.path.substr(0,t.path.lastIndexOf("/")+1),this.fileName=t.path.substr(t.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),dataManager.loadAnimation(t.path,this.configAnimation,this.onSetupError))},AnimationItem.prototype.onSetupError=function(){this.trigger("data_failed")},AnimationItem.prototype.setupAnimation=function(t){dataManager.completeAnimation(t,this.configAnimation)},AnimationItem.prototype.setData=function(t,e){var e={wrapper:t,animationData:e=e&&"object"!==_typeof$4(e)?JSON.parse(e):e},t=t.attributes,i=(e.path=t.getNamedItem("data-animation-path")?t.getNamedItem("data-animation-path").value:t.getNamedItem("data-bm-path")?t.getNamedItem("data-bm-path").value:t.getNamedItem("bm-path")?t.getNamedItem("bm-path").value:"",e.animType=t.getNamedItem("data-anim-type")?t.getNamedItem("data-anim-type").value:t.getNamedItem("data-bm-type")?t.getNamedItem("data-bm-type").value:t.getNamedItem("bm-type")?t.getNamedItem("bm-type").value:t.getNamedItem("data-bm-renderer")?t.getNamedItem("data-bm-renderer").value:t.getNamedItem("bm-renderer")?t.getNamedItem("bm-renderer").value:getRegisteredRenderer()||"canvas",t.getNamedItem("data-anim-loop")?t.getNamedItem("data-anim-loop").value:t.getNamedItem("data-bm-loop")?t.getNamedItem("data-bm-loop").value:t.getNamedItem("bm-loop")?t.getNamedItem("bm-loop").value:""),i=("false"===i?e.loop=!1:"true"===i?e.loop=!0:""!==i&&(e.loop=parseInt(i,10)),t.getNamedItem("data-anim-autoplay")?t.getNamedItem("data-anim-autoplay").value:t.getNamedItem("data-bm-autoplay")?t.getNamedItem("data-bm-autoplay").value:!t.getNamedItem("bm-autoplay")||t.getNamedItem("bm-autoplay").value);e.autoplay="false"!==i,e.name=t.getNamedItem("data-name")?t.getNamedItem("data-name").value:t.getNamedItem("data-bm-name")?t.getNamedItem("data-bm-name").value:t.getNamedItem("bm-name")?t.getNamedItem("bm-name").value:"","false"===(t.getNamedItem("data-anim-prerender")?t.getNamedItem("data-anim-prerender").value:t.getNamedItem("data-bm-prerender")?t.getNamedItem("data-bm-prerender").value:t.getNamedItem("bm-prerender")?t.getNamedItem("bm-prerender").value:"")&&(e.prerender=!1),e.path?this.setParams(e):this.trigger("destroy")},AnimationItem.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));for(var e,i=this.animationData.layers,r=i.length,s=t.layers,a=s.length,n=0;n<a;n+=1)for(e=0;e<r;){if(i[e].id===s[n].id){i[e]=s[n];break}e+=1}if((t.chars||t.fonts)&&(this.renderer.globalData.fontManager.addChars(t.chars),this.renderer.globalData.fontManager.addFonts(t.fonts,this.renderer.globalData.defs)),t.assets)for(r=t.assets.length,e=0;e<r;e+=1)this.animationData.assets.push(t.assets[e]);this.animationData.__complete=!1,dataManager.completeAnimation(this.animationData,this.onSegmentComplete)},AnimationItem.prototype.onSegmentComplete=function(t){this.animationData=t;t=getExpressionsPlugin();t&&t.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var t=this.animationData.segments;t&&0!==t.length&&this.autoloadSegments?(t=t.shift(),this.timeCompleted=t.time*this.frameRate,t=this.path+this.fileName+"_"+this.segmentPos+".json",this.segmentPos+=1,dataManager.loadData(t,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))):(this.trigger("data_ready"),this.timeCompleted=this.totalFrames)},AnimationItem.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(t){if(this.renderer)try{this.animationData=t,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(t),t.assets||(t.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(t.assets),this.markers=markerParser(t.markers||[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(t){this.triggerConfigError(t)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){var t;!this.isLoaded&&this.renderer.globalData.fontManager.isLoaded&&(this.imagePreloader.loadedImages()||"canvas"!==this.renderer.rendererType)&&this.imagePreloader.loadedFootages()&&(this.isLoaded=!0,(t=getExpressionsPlugin())&&t.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay)&&this.play()},AnimationItem.prototype.resize=function(t,e){this.renderer.updateContainerSize("number"==typeof t?t:void 0,"number"==typeof e?e:void 0)},AnimationItem.prototype.setSubframe=function(t){this.isSubframeEnabled=!!t},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.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.markers.length;i+=1)if((e=this.markers[i]).payload&&e.payload.name===t)return e;return null},AnimationItem.prototype.goToAndStop=function(t,e,i){i&&this.name!==i||(i=Number(t),isNaN(i)?(i=this.getMarkerData(t))&&this.goToAndStop(i.time,!0):e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier),this.pause())},AnimationItem.prototype.goToAndPlay=function(t,e,i){var r;i&&this.name!==i||(r=Number(t),isNaN(r)?(t=this.getMarkerData(t))&&(t.duration?this.playSegments([t.time,t.time+t.duration],!0):this.goToAndStop(t.time,!0)):this.goToAndStop(r,e,i),this.play())},AnimationItem.prototype.advanceTime=function(t){var e;!0!==this.isPaused&&!1!==this.isLoaded&&(e=!1,(t=this.currentRawFrame+t*this.frameModifier)>=this.totalFrames-1&&0<this.frameModifier?this.loop&&this.playCount!==this.loop?t>=this.totalFrames?(this.playCount+=1,this.checkSegments(t%this.totalFrames)||(this.setCurrentRawFrameValue(t%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(t):this.checkSegments(t>this.totalFrames?t%this.totalFrames:0)||(e=!0,t=this.totalFrames-1):t<0?this.checkSegments(t%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(e=!0,t=0):(this.setCurrentRawFrameValue(this.totalFrames+t%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(t),e)&&(this.setCurrentRawFrameValue(t),this.pause(),this.trigger("complete"))},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]<t[0]?(0<this.frameModifier&&(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.firstFrame<t?i=t:this.currentRawFrame+this.firstFrame>e&&(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]))for(var i=t.length,r=0;r<i;r+=1)this.segments.push(t[r]);else this.segments.push(t);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(t){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),t),!0)},AnimationItem.prototype.destroy=function(t){t&&this.name!==t||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.expressionsPlugin=null,this.imagePreloader=null,this.projectInterface=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.setLoop=function(t){this.loop=t},AnimationItem.prototype.setVolume=function(t,e){e&&this.name!==e||this.audioController.setVolume(t)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(t){t&&this.name!==t||this.audioController.mute()},AnimationItem.prototype.unmute=function(t){t&&this.name!==t||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(t){var e,i="";return i=t.e?t.p:this.assetsPath?(-1!==(e=t.p).indexOf("images/")&&(e=e.split("/")[1]),this.assetsPath+e):(i=this.path,(i+=t.u||"")+t.p)},AnimationItem.prototype.getAssetData=function(t){for(var e=0,i=this.assets.length;e<i;){if(t===this.assets[e].id)return this.assets[e];e+=1}return null},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.updateDocumentData=function(t,e,i){try{this.renderer.getElementByPath(t).updateDocumentData(e,i)}catch(t){}},AnimationItem.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameModifier));break;case"drawnFrame":this.drawnFrameEvent.currentTime=this.currentFrame,this.drawnFrameEvent.totalTime=this.totalFrames,this.drawnFrameEvent.direction=this.frameModifier,this.triggerEvent(t,this.drawnFrameEvent);break;case"loopComplete":this.triggerEvent(t,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new BMCompleteEvent(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new BMDestroyEvent(t,this));break;default:this.triggerEvent(t)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(t,this))},AnimationItem.prototype.triggerRenderFrameError=function(t){t=new BMRenderFrameErrorEvent(t,this.currentFrame);this.triggerEvent("error",t),this.onError&&this.onError.call(this,t)},AnimationItem.prototype.triggerConfigError=function(t){t=new BMConfigErrorEvent(t,this.currentFrame);this.triggerEvent("error",t),this.onError&&this.onError.call(this,t)},(()=>{var t={},s=[],r=0,a=0,n=0,o=!0,h=!1;function i(t){for(var e=0,i=t.target;e<a;)s[e].animation===i&&(s.splice(e,1),--e,--a,i.isPaused||m()),e+=1}function l(t,e){if(!t)return null;for(var i=0;i<a;){if(s[i].elem===t&&null!==s[i].elem)return s[i].animation;i+=1}var r=new AnimationItem;return f(r,t),r.setData(t,e),r}function p(){n+=1,d()}function m(){--n}function f(t,e){t.addEventListener("destroy",i),t.addEventListener("_active",p),t.addEventListener("_idle",m),s.push({elem:e,animation:t}),a+=1}function c(t){for(var e=t-r,i=0;i<a;i+=1)s[i].animation.advanceTime(e);r=t,n&&!h?window.requestAnimationFrame(c):o=!0}function e(t){r=t,window.requestAnimationFrame(c)}function d(){!h&&n&&o&&(window.requestAnimationFrame(e),o=!1)}return t.registerAnimation=l,t.loadAnimation=function(t){var e=new AnimationItem;return f(e,null),e.setParams(t),e},t.setSpeed=function(t,e){for(var i=0;i<a;i+=1)s[i].animation.setSpeed(t,e)},t.setDirection=function(t,e){for(var i=0;i<a;i+=1)s[i].animation.setDirection(t,e)},t.play=function(t){for(var e=0;e<a;e+=1)s[e].animation.play(t)},t.pause=function(t){for(var e=0;e<a;e+=1)s[e].animation.pause(t)},t.stop=function(t){for(var e=0;e<a;e+=1)s[e].animation.stop(t)},t.togglePause=function(t){for(var e=0;e<a;e+=1)s[e].animation.togglePause(t)},t.searchAnimations=function(t,e,i){for(var r,s=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),a=s.length,n=0;n<a;n+=1)i&&s[n].setAttribute("data-bm-type",i),l(s[n],t);e&&0===a&&(i=i||"svg",(e=document.getElementsByTagName("body")[0]).innerText="",(r=createTag("div")).style.width="100%",r.style.height="100%",r.setAttribute("data-bm-type",i),e.appendChild(r),l(r,t))},t.resize=function(){for(var t=0;t<a;t+=1)s[t].animation.resize()},t.goToAndStop=function(t,e,i){for(var r=0;r<a;r+=1)s[r].animation.goToAndStop(t,e,i)},t.destroy=function(t){for(var e=a-1;0<=e;--e)s[e].animation.destroy(t)},t.freeze=function(){h=!0},t.unfreeze=function(){h=!1,d()},t.setVolume=function(t,e){for(var i=0;i<a;i+=1)s[i].animation.setVolume(t,e)},t.mute=function(t){for(var e=0;e<a;e+=1)s[e].animation.mute(t)},t.unmute=function(t){for(var e=0;e<a;e+=1)s[e].animation.unmute(t)},t.getRegisteredAnimations=function(){for(var t=s.length,e=[],i=0;i<t;i+=1)e.push(s[i].animation);return e},t})()),BezierFactory=(()=>{var t={getBezierEasing:function(t,e,i,r,s){s=s||("bez_"+t+"_"+e+"_"+i+"_"+r).replace(/\./g,"p");if(a[s])return a[s];t=new n([t,e,i,r]);return a[s]=t}},a={},S=4,C=1e-7,_=10,A=11,T=1/(A-1),e="function"==typeof Float32Array;function r(t,e){return 1-3*e+3*t}function M(t,e,i){return((r(e,i)*t+(3*i-6*e))*t+3*e)*t}function k(t,e,i){return 3*r(e,i)*t*t+2*(3*i-6*e)*t+3*e}function n(t){this._p=t,this._mSampleValues=new(e?Float32Array:Array)(A),this._precomputed=!1,this.get=this.get.bind(this)}return n.prototype={get:function(t){var e=this._p[0],i=this._p[1],r=this._p[2],s=this._p[3];return this._precomputed||this._precompute(),e===i&&r===s?t:0===t?0:1===t?1:M(this._getTForX(t),i,s)},_precompute:function(){var t=this._p[0],e=this._p[1],i=this._p[2],r=this._p[3];this._precomputed=!0,t===e&&i===r||this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],i=0;i<A;++i)this._mSampleValues[i]=M(i*T,t,e)},_getTForX:function(t){for(var e=this._p[0],i=this._p[2],r=this._mSampleValues,s=0,a=1,n=A-1;a!==n&&r[a]<=t;++a)s+=T;var o=s+(t-r[--a])/(r[a+1]-r[a])*T,h=k(o,e,i);if(.001<=h){for(var l=t,p=o,m=e,f=i,c=0;c<S;++c){var d=k(p,m,f);if(0===d)return p;p-=(M(p,m,f)-l)/d}return p}if(0===h)return o;for(var u,y,g=t,v=s,b=s+T,x=e,P=i,E=0;0<(u=M(y=v+(b-v)/2,x,P)-g)?b=y:v=y,Math.abs(u)>C&&++E<_;);return y}},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(){var t;t=r?a[--r]:e();return t},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){for(var e=t.lengths.length,i=0;i<e;i+=1)bezierLengthPool.release(t.lengths[i]);t.lengths.length=0});function bezFunction(){var A=Math;function y(t,e,i,r,s,a){s=t*r+e*s+i*a-s*r-a*t-i*e;return-.001<s&&s<.001}var p=function(t,e,i,r){for(var s,a,n,o,h=getDefaultCurveSegments(),l=0,p=[],m=[],f=bezierLengthPool.newElement(),c=i.length,d=0;d<h;d+=1){for(n=d/(h-1),s=o=0;s<c;s+=1)a=bmPow(1-n,3)*t[s]+3*bmPow(1-n,2)*n*i[s]+3*(1-n)*bmPow(n,2)*r[s]+bmPow(n,3)*e[s],p[s]=a,null!==m[s]&&(o+=bmPow(p[s]-m[s],2)),m[s]=p[s];o&&(l+=o=bmSqrt(o)),f.percents[d]=n,f.lengths[d]=l}return f.addedLength=l,f};function g(t){this.segmentLength=0,this.points=new Array(t)}function v(t,e){this.partialLength=t,this.point=e}function t(t,e,i,r){var s=(t[0]+"_"+t[1]+"_"+e[0]+"_"+e[1]+"_"+i[0]+"_"+i[1]+"_"+r[0]+"_"+r[1]).replace(/\./g,"p");if(!b[s]){for(var a,n,o,h,l,p=getDefaultCurveSegments(),m=0,f=null,c=new g(p=2===t.length&&(t[0]!==e[0]||t[1]!==e[1])&&y(t[0],t[1],e[0],e[1],t[0]+i[0],t[1]+i[1])&&y(t[0],t[1],e[0],e[1],e[0]+r[0],e[1]+r[1])?2:p),d=i.length,u=0;u<p;u+=1){for(l=createSizedArray(d),o=u/(p-1),a=h=0;a<d;a+=1)n=bmPow(1-o,3)*t[a]+3*bmPow(1-o,2)*o*(t[a]+i[a])+3*(1-o)*bmPow(o,2)*(e[a]+r[a])+bmPow(o,3)*e[a],l[a]=n,null!==f&&(h+=bmPow(l[a]-f[a],2));m+=h=bmSqrt(h),c.points[u]=new v(h,l),f=l}c.segmentLength=m,b[s]=c}return b[s]}var b;b={};function T(t,e){var i=e.percents,r=e.lengths,s=i.length,a=bmFloor((s-1)*t),n=t*e.addedLength,o=0;if(a===s-1||0===a||n===r[a])return i[a];for(var h=r[a]>n?-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||s-1<=a){if(a===s-1)return i[a];l=!1}return i[a]+(i[a+1]-i[a])*o}var M=createTypedArray("float32",8);return{getSegmentsLength:function(t){for(var e=segmentsLengthPool.newElement(),i=t.c,r=t.v,s=t.o,a=t.i,n=t._length,o=e.lengths,h=0,l=0;l<n-1;l+=1)o[l]=p(r[l],r[l+1],s[l],a[l+1]),h+=o[l].addedLength;return i&&n&&(o[l]=p(r[l],r[0],s[l],a[0]),h+=o[l].addedLength),e.totalLength=h,e},getNewSegment:function(t,e,i,r,s,a,n){s<0?s=0:1<s&&(s=1);for(var s=T(s,n),a=T(a=1<a?1:a,n),o=t.length,h=1-a,l=(n=1-s)*n*n,p=s*n*n*3,m=s*s*n*3,f=s*s*s,c=n*n*h,d=s*n*h+n*s*h+n*n*a,u=s*s*h+n*s*a+s*n*a,y=s*s*a,g=n*h*h,v=s*h*h+n*a*h+n*h*a,b=s*a*h+n*a*a+s*h*a,x=s*a*a,P=h*h*h,E=a*h*h+h*a*h+h*h*a,S=a*a*h+h*a*a+a*h*a,C=a*a*a,_=0;_<o;_+=1)M[4*_]=A.round(1e3*(l*t[_]+p*i[_]+m*r[_]+f*e[_]))/1e3,M[4*_+1]=A.round(1e3*(c*t[_]+d*i[_]+u*r[_]+y*e[_]))/1e3,M[4*_+2]=A.round(1e3*(g*t[_]+v*i[_]+b*r[_]+x*e[_]))/1e3,M[4*_+3]=A.round(1e3*(P*t[_]+E*i[_]+S*r[_]+C*e[_]))/1e3;return M},getPointInSegment:function(t,e,i,r,s,a){return s=T(s,a),a=1-s,[A.round(1e3*(a*a*a*t[0]+(s*a*a+a*s*a+a*a*s)*i[0]+(s*s*a+a*s*s+s*a*s)*r[0]+s*s*s*e[0]))/1e3,A.round(1e3*(a*a*a*t[1]+(s*a*a+a*s*a+a*a*s)*i[1]+(s*s*a+a*s*s+s*a*s)*r[1]+s*s*s*e[1]))/1e3]},buildBezierData:t,pointOnLine2D:y,pointOnLine3D:function(t,e,i,r,s,a,n,o,h){var l;return 0===i&&0===a&&0===h?y(t,e,r,s,n,o):(l=A.sqrt(A.pow(r-t,2)+A.pow(s-e,2)+A.pow(a-i,2)),t=A.sqrt(A.pow(n-t,2)+A.pow(o-e,2)+A.pow(h-i,2)),e=A.sqrt(A.pow(n-r,2)+A.pow(o-s,2)+A.pow(h-a,2)),-1e-4<(i=t<l?e<l?l-t-e:e-t-l:t<e?e-t-l:t-l-e)&&i<1e-4)}}}var bez=bezFunction(),initFrame=initialDefaultFrame,mathAbs=Math.abs;function interpolateValue(t,e){for(var i,r,s,a,n=this.offsetTime,o=("multidimensional"===this.propType&&(i=createTypedArray("float32",this.pv.length)),e.lastIndex),h=o,l=this.keyframes.length-1,p=!0;p;){if(r=this.keyframes[h],s=this.keyframes[h+1],h===l-1&&t>=s.t-n){r.h&&(r=s),o=0;break}if(s.t-n>t){o=h;break}h<l-1?h+=1:(o=0,p=!1)}var m=this.keyframesMetadata[h]||{},f=s.t-n,c=r.t-n;if(r.to){m.bezierData||(m.bezierData=bez.buildBezierData(r.s,s.s||r.e,r.to,r.ti));var d=m.bezierData;if(f<=t||t<c)for(var u=f<=t?d.points.length-1:0,y=d.points[u].point.length,g=0;g<y;g+=1)i[g]=d.points[u].point[g];else{m.__fnct?a=m.__fnct:(a=BezierFactory.getBezierEasing(r.o.x,r.o.y,r.i.x,r.i.y,r.n).get,m.__fnct=a);for(var v,b=a((t-c)/(f-c)),x=d.segmentLength*b,P=e.lastFrame<t&&e._lastKeyframeIndex===h?e._lastAddedLength:0,E=e.lastFrame<t&&e._lastKeyframeIndex===h?e._lastPoint:0,p=!0,S=d.points.length;p;){if(P+=d.points[E].partialLength,0==x||0===b||E===d.points.length-1){for(y=d.points[E].point.length,g=0;g<y;g+=1)i[g]=d.points[E].point[g];break}if(P<=x&&x<P+d.points[E+1].partialLength){for(v=(x-P)/d.points[E+1].partialLength,y=d.points[E].point.length,g=0;g<y;g+=1)i[g]=d.points[E].point[g]+(d.points[E+1].point[g]-d.points[E].point[g])*v;break}E<S-1?E+=1:p=!1}e._lastPoint=E,e._lastAddedLength=P-d.points[E].partialLength,e._lastKeyframeIndex=h}}else{var C,_,A,T,M,l=r.s.length,k=s.s||r.e;if(this.sh&&1!==r.h)f<=t?(i[0]=k[0],i[1]=k[1],i[2]=k[2]):t<=c?(i[0]=r.s[0],i[1]=r.s[1],i[2]=r.s[2]):quaternionToEuler(i,slerp(createQuaternion(r.s),createQuaternion(k),(t-c)/(f-c)));else for(h=0;h<l;h+=1)1!==r.h&&(b=f<=t?1:t<c?0:(r.o.x.constructor===Array?(m.__fnct||(m.__fnct=[]),m.__fnct[h]?a=m.__fnct[h]:(C=void 0===r.o.x[h]?r.o.x[0]:r.o.x[h],_=void 0===r.o.y[h]?r.o.y[0]:r.o.y[h],A=void 0===r.i.x[h]?r.i.x[0]:r.i.x[h],T=void 0===r.i.y[h]?r.i.y[0]:r.i.y[h],a=BezierFactory.getBezierEasing(C,_,A,T).get,m.__fnct[h]=a)):m.__fnct?a=m.__fnct:(C=r.o.x,_=r.o.y,A=r.i.x,T=r.i.y,a=BezierFactory.getBezierEasing(C,_,A,T).get,r.keyframeMetadata=a),a((t-c)/(f-c)))),k=s.s||r.e,M=1===r.h?r.s[h]:r.s[h]+(k[h]-r.s[h])*b,"multidimensional"===this.propType?i[h]=M:i=M}return e.lastIndex=o,i}function slerp(t,e,i){var r,s,a=[],n=t[0],o=t[1],h=t[2],t=t[3],l=e[0],p=e[1],m=e[2],e=e[3],f=n*l+o*p+h*m+t*e;return f<0&&(f=-f,l=-l,p=-p,m=-m,e=-e),f=1e-6<1-f?(f=Math.acos(f),r=Math.sin(f),s=Math.