@returningai/widget-sdk 1.8.0 → 1.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
- var RaiWidget=function(t){"use strict";var e=Object.defineProperty,i=(t,i,s)=>((t,i,s)=>i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[i]=s)(t,"symbol"!=typeof i?i+"":i,s);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function s(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var r,n,a={exports:{}};r=a,n=a.exports,"undefined"!=typeof document&&"undefined"!=typeof navigator&&(r.exports=function(){var t="http://www.w3.org/2000/svg",e="",i=!1,s=-999999,r=function(t){i=!!t},a=function(){return i},o=function(t){e=t},h=function(){return e};function l(t){return document.createElement(t)}function c(t,e){var i,s,r=t.length;for(i=0;i<r;i+=1)for(var n in s=t[i].prototype)Object.prototype.hasOwnProperty.call(s,n)&&(e.prototype[n]=s[n])}function p(t){function e(){}return e.prototype=t,e}var d=function(){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(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].pause()},resume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].resume()},setRate:function(t){var e,i=this.audios.length;for(e=0;e<i;e+=1)this.audios[e].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(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].volume(this._volume*(this._isMuted?0:1))}},function(){return new t}}(),f=function(){function t(t,e){var i,s=0,r=[];switch(t){case"int16":case"uint8c":i=1;break;default:i=1.1}for(s=0;s<e;s+=1)r.push(i);return r}function e(e,i){return"float32"===e?new Float32Array(i):"int16"===e?new Int16Array(i):"uint8c"===e?new Uint8ClampedArray(i):t(e,i)}return"function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?e:t}();function u(t){return Array.apply(null,{length:t})}var m=!0,g=null,y="",v=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),b=Math.pow,w=Math.sqrt,k=Math.floor,_=Math.min,T=150,x=Math.PI/180,A=.5519;function S(t,e,i,s){this.type=t,this.currentTime=e,this.totalTime=i,this.direction=s<0?-1:1}function E(t,e){this.type=t,this.direction=e<0?-1:1}function C(t,e,i,s){this.type=t,this.currentLoop=i,this.totalLoops=e,this.direction=s<0?-1:1}function P(t,e,i){this.type=t,this.firstFrame=e,this.totalFrames=i}function D(t,e){this.type=t,this.target=e}function I(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}function M(t){this.type="configError",this.nativeError=t}var L=function(){var t=0;return function(){return y+"__lottie_element_"+(t+=1)}}();function F(t,e,i){var s,r,n,a,o,h,l,c;switch(h=i*(1-e),l=i*(1-(o=6*t-(a=Math.floor(6*t)))*e),c=i*(1-(1-o)*e),a%6){case 0:s=i,r=c,n=h;break;case 1:s=l,r=i,n=h;break;case 2:s=h,r=i,n=c;break;case 3:s=h,r=l,n=i;break;case 4:s=c,r=h,n=i;break;case 5:s=i,r=h,n=l}return[s,r,n]}function R(t,e,i){var s,r=Math.max(t,e,i),n=Math.min(t,e,i),a=r-n,o=0===r?0:a/r,h=r/255;switch(r){case n:s=0;break;case t:s=e-i+a*(e<i?6:0),s/=6*a;break;case e:s=i-t+2*a,s/=6*a;break;case i:s=t-e+4*a,s/=6*a}return[s,o,h]}function N(t,e){var i=R(255*t[0],255*t[1],255*t[2]);return i[1]+=e,i[1]>1?i[1]=1:i[1]<=0&&(i[1]=0),F(i[0],i[1],i[2])}function O(t,e){var i=R(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),F(i[0],i[1],i[2])}function z(t,e){var i=R(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),F(i[0],i[1],i[2])}!function(){var t,e,i=[];for(t=0;t<256;t+=1)e=t.toString(16),i[t]=1===e.length?"0"+e:e}();var U=function(t){m=!!t},W=function(){return m},j=function(t){g=t},V=function(){return g},B=function(t){T=t},q=function(){return T},H=function(t){y=t};function $(e){return document.createElementNS(t,e)}function G(t){return(G="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 Y=function(){var t,e,i=1,s=[],r={onmessage:function(){},postMessage:function(e){t({data:e})}},n={postMessage:function(t){r.onmessage({data:t})}};function o(e){if(window.Worker&&window.Blob&&a()){var i=new Blob(["var _workerSelf = self; self.onmessage = ",e.toString()],{type:"text/javascript"}),s=URL.createObjectURL(i);return new Worker(s)}return t=e,r}function h(){e||((e=o(function(t){function e(){function t(e,i){var a,o,h,l,c,p,d=e.length;for(o=0;o<d;o+=1)if("ks"in(a=e[o])&&!a.completed){if(a.completed=!0,a.hasMask){var u=a.masksProperties;for(l=u.length,h=0;h<l;h+=1)if(u[h].pt.k.i)n(u[h].pt.k);else for(p=u[h].pt.k.length,c=0;c<p;c+=1)u[h].pt.k[c].s&&n(u[h].pt.k[c].s[0]),u[h].pt.k[c].e&&n(u[h].pt.k[c].e[0])}0===a.ty?(a.layers=s(a.refId,i),t(a.layers,i)):4===a.ty?r(a.shapes):5===a.ty&&f(a)}}function e(e,i){if(e){var r=0,n=e.length;for(r=0;r<n;r+=1)1===e[r].t&&(e[r].data.layers=s(e[r].data.refId,i),t(e[r].data.layers,i))}}function i(t,e){for(var i=0,s=e.length;i<s;){if(e[i].id===t)return e[i];i+=1}return null}function s(t,e){var s=i(t,e);return s?s.layers.__used?JSON.parse(JSON.stringify(s.layers)):(s.layers.__used=!0,s.layers):null}function r(t){var e,i,s;for(e=t.length-1;e>=0;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)n(t[e].ks.k);else for(s=t[e].ks.k.length,i=0;i<s;i+=1)t[e].ks.k[i].s&&n(t[e].ks.k[i].s[0]),t[e].ks.k[i].e&&n(t[e].ks.k[i].e[0]);else"gr"===t[e].ty&&r(t[e].it)}function n(t){var e,i=t.i.length;for(e=0;e<i;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function a(t,e){var i=e?e.split("."):[100,100,100];return t[0]>i[0]||!(i[0]>t[0])&&(t[1]>i[1]||!(i[1]>t[1])&&(t[2]>i[2]||!(i[2]>t[2])&&null))}var o=function(){var t=[4,4,14];function e(t){var e=t.t.d;t.t.d={k:[{s:e,t:0}]}}function i(t){var i,s=t.length;for(i=0;i<s;i+=1)5===t[i].ty&&e(t[i])}return function(e){if(a(t,e.v)&&(i(e.layers),e.assets)){var s,r=e.assets.length;for(s=0;s<r;s+=1)e.assets[s].layers&&i(e.assets[s].layers)}}}(),h=function(){var t=[4,7,99];return function(e){if(e.chars&&!a(t,e.v)){var i,s=e.chars.length;for(i=0;i<s;i+=1){var n=e.chars[i];n.data&&n.data.shapes&&(r(n.data.shapes),n.data.ip=0,n.data.op=99999,n.data.st=0,n.data.sr=1,n.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}},e.chars[i].t||(n.data.shapes.push({ty:"no"}),n.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"})))}}}}(),l=function(){var t=[5,7,15];function e(t){var e=t.t.p;"number"==typeof e.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})}function i(t){var i,s=t.length;for(i=0;i<s;i+=1)5===t[i].ty&&e(t[i])}return function(e){if(a(t,e.v)&&(i(e.layers),e.assets)){var s,r=e.assets.length;for(s=0;s<r;s+=1)e.assets[s].layers&&i(e.assets[s].layers)}}}(),c=function(){var t=[4,1,9];function e(t){var i,s,r,n=t.length;for(i=0;i<n;i+=1)if("gr"===t[i].ty)e(t[i].it);else if("fl"===t[i].ty||"st"===t[i].ty)if(t[i].c.k&&t[i].c.k[0].i)for(r=t[i].c.k.length,s=0;s<r;s+=1)t[i].c.k[s].s&&(t[i].c.k[s].s[0]/=255,t[i].c.k[s].s[1]/=255,t[i].c.k[s].s[2]/=255,t[i].c.k[s].s[3]/=255),t[i].c.k[s].e&&(t[i].c.k[s].e[0]/=255,t[i].c.k[s].e[1]/=255,t[i].c.k[s].e[2]/=255,t[i].c.k[s].e[3]/=255);else t[i].c.k[0]/=255,t[i].c.k[1]/=255,t[i].c.k[2]/=255,t[i].c.k[3]/=255}function i(t){var i,s=t.length;for(i=0;i<s;i+=1)4===t[i].ty&&e(t[i].shapes)}return function(e){if(a(t,e.v)&&(i(e.layers),e.assets)){var s,r=e.assets.length;for(s=0;s<r;s+=1)e.assets[s].layers&&i(e.assets[s].layers)}}}(),p=function(){var t=[4,4,18];function e(t){var i,s,r;for(i=t.length-1;i>=0;i-=1)if("sh"===t[i].ty)if(t[i].ks.k.i)t[i].ks.k.c=t[i].closed;else for(r=t[i].ks.k.length,s=0;s<r;s+=1)t[i].ks.k[s].s&&(t[i].ks.k[s].s[0].c=t[i].closed),t[i].ks.k[s].e&&(t[i].ks.k[s].e[0].c=t[i].closed);else"gr"===t[i].ty&&e(t[i].it)}function i(t){var i,s,r,n,a,o,h=t.length;for(s=0;s<h;s+=1){if((i=t[s]).hasMask){var l=i.masksProperties;for(n=l.length,r=0;r<n;r+=1)if(l[r].pt.k.i)l[r].pt.k.c=l[r].cl;else for(o=l[r].pt.k.length,a=0;a<o;a+=1)l[r].pt.k[a].s&&(l[r].pt.k[a].s[0].c=l[r].cl),l[r].pt.k[a].e&&(l[r].pt.k[a].e[0].c=l[r].cl)}4===i.ty&&e(i.shapes)}}return function(e){if(a(t,e.v)&&(i(e.layers),e.assets)){var s,r=e.assets.length;for(s=0;s<r;s+=1)e.assets[s].layers&&i(e.assets[s].layers)}}}();function d(i){i.__complete||(c(i),o(i),h(i),l(i),p(i),t(i.layers,i.assets),e(i.chars,i.assets),i.__complete=!0)}function f(t){0===t.t.a.length&&t.t.p}var u={};return u.completeData=d,u.checkColors=c,u.checkChars=h,u.checkPathProperties=l,u.checkShapes=p,u.completeLayers=t,u}if(n.dataManager||(n.dataManager=e()),n.assetLoader||(n.assetLoader=function(){function t(t){var e=t.getResponseHeader("content-type");return e&&"json"===t.responseType&&-1!==e.indexOf("json")||t.response&&"object"===G(t.response)?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):null}function e(e,i,s,r){var n,a=new XMLHttpRequest;try{a.responseType="json"}catch(o){}a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status)n=t(a),s(n);else try{n=t(a),s(n)}catch(o){r&&r(o)}};try{a.open(["G","E","T"].join(""),e,!0)}catch(h){a.open(["G","E","T"].join(""),i+"/"+e,!0)}a.send()}return{load:e}}()),"loadAnimation"===t.data.type)n.assetLoader.load(t.data.path,t.data.fullPath,function(e){n.dataManager.completeData(e),n.postMessage({id:t.data.id,payload:e,status:"success"})},function(){n.postMessage({id:t.data.id,status:"error"})});else if("complete"===t.data.type){var i=t.data.animation;n.dataManager.completeData(i),n.postMessage({id:t.data.id,payload:i,status:"success"})}else"loadData"===t.data.type&&n.assetLoader.load(t.data.path,t.data.fullPath,function(e){n.postMessage({id:t.data.id,payload:e,status:"success"})},function(){n.postMessage({id:t.data.id,status:"error"})})})).onmessage=function(t){var e=t.data,i=e.id,r=s[i];s[i]=null,"success"===e.status?r.onComplete(e.payload):r.onError&&r.onError()})}function l(t,e){var r="processId_"+(i+=1);return s[r]={onComplete:t,onError:e},r}function c(t,i,s){h();var r=l(i,s);e.postMessage({type:"loadAnimation",path:t,fullPath:window.location.origin+window.location.pathname,id:r})}function p(t,i,s){h();var r=l(i,s);e.postMessage({type:"loadData",path:t,fullPath:window.location.origin+window.location.pathname,id:r})}function d(t,i,s){h();var r=l(i,s);e.postMessage({type:"complete",animation:t,id:r})}return{loadAnimation:c,loadData:p,completeAnimation:d}}(),X=function(){var t=function(){var t=l("canvas");t.width=1,t.height=1;var e=t.getContext("2d");return e.fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1),t}();function e(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function i(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function s(t,e,i){var s="";if(t.e)s=t.p;else if(e){var r=t.p;-1!==r.indexOf("images/")&&(r=r.split("/")[1]),s=e+r}else s=i,s+=t.u?t.u:"",s+=t.p;return s}function r(t){var e=0,i=setInterval(function(){(t.getBBox().width||e>500)&&(this._imageLoaded(),clearInterval(i)),e+=1}.bind(this),50)}function n(e){var i=s(e,this.assetsPath,this.path),r=$("image");v?this.testImageLoaded(r):r.addEventListener("load",this._imageLoaded,!1),r.addEventListener("error",function(){n.img=t,this._imageLoaded()}.bind(this),!1),r.setAttributeNS("http://www.w3.org/1999/xlink","href",i),this._elementHelper.append?this._elementHelper.append(r):this._elementHelper.appendChild(r);var n={img:r,assetData:e};return n}function a(e){var i=s(e,this.assetsPath,this.path),r=l("img");r.crossOrigin="anonymous",r.addEventListener("load",this._imageLoaded,!1),r.addEventListener("error",function(){n.img=t,this._imageLoaded()}.bind(this),!1),r.src=i;var n={img:r,assetData:e};return n}function o(t){var e={assetData:t},i=s(t,this.assetsPath,this.path);return Y.loadData(i,function(t){e.img=t,this._footageLoaded()}.bind(this),function(){e.img={},this._footageLoaded()}.bind(this)),e}function h(t,e){var i;this.imagesLoadedCb=e;var s=t.length;for(i=0;i<s;i+=1)t[i].layers||(t[i].t&&"seq"!==t[i].t?3===t[i].t&&(this.totalFootages+=1,this.images.push(this.createFootageData(t[i]))):(this.totalImages+=1,this.images.push(this._createImageData(t[i]))))}function c(t){this.path=t||""}function p(t){this.assetsPath=t||""}function d(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}function f(){this.imagesLoadedCb=null,this.images.length=0}function u(){return this.totalImages===this.loadedAssets}function m(){return this.totalFootages===this.loadedFootagesCount}function g(t,e){"svg"===t?(this._elementHelper=e,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}function y(){this._imageLoaded=e.bind(this),this._footageLoaded=i.bind(this),this.testImageLoaded=r.bind(this),this.createFootageData=o.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return y.prototype={loadAssets:h,setAssetsPath:p,setPath:c,loadedImages:u,loadedFootages:m,destroy:f,getAsset:d,createImgData:a,createImageData:n,imageLoaded:e,footageLoaded:i,setCacheType:g},y}();function K(){}K.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var i=this._cbs[t],s=0;s<i.length;s+=1)i[s](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,s=this._cbs[t].length;i<s;)this._cbs[t][i]===e&&(this._cbs[t].splice(i,1),i-=1,s-=1),i+=1;this._cbs[t].length||(this._cbs[t]=null)}}else this._cbs[t]=null}};var J=function(){function t(t){for(var e,i=t.split("\r\n"),s={},r=0,n=0;n<i.length;n+=1)2===(e=i[n].split(":")).length&&(s[e[0]]=e[1].trim(),r+=1);if(0===r)throw new Error;return s}return function(e){for(var i=[],s=0;s<e.length;s+=1){var r=e[s],n={time:r.tm,duration:r.dr};try{n.payload=JSON.parse(e[s].cm)}catch(a){try{n.payload=t(e[s].cm)}catch(o){n.payload={name:e[s].cm}}}i.push(n)}return i}}(),Z=function(){function t(t){this.compositions.push(t)}return function(){function e(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 e.compositions=[],e.currentFrame=0,e.registerComposition=t,e}}(),Q={},tt=function(t,e){Q[t]=e};function et(t){return Q[t]}function it(){if(Q.canvas)return"canvas";for(var t in Q)if(Q[t])return t;return""}function st(t){return(st="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 rt=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=L(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=W(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=Z(),this.imagePreloader=new X,this.audioController=d(),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new S("drawnFrame",0,0,0),this.expressionsPlugin=V()};c([K],rt),rt.prototype.setParams=function(t){(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var e="svg";t.animType?e=t.animType:t.renderer&&(e=t.renderer);var i=et(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||void 0===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?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")),Y.loadAnimation(t.path,this.configAnimation,this.onSetupError))},rt.prototype.onSetupError=function(){this.trigger("data_failed")},rt.prototype.setupAnimation=function(t){Y.completeAnimation(t,this.configAnimation)},rt.prototype.setData=function(t,e){e&&"object"!==st(e)&&(e=JSON.parse(e));var i={wrapper:t,animationData:e},s=t.attributes;i.path=s.getNamedItem("data-animation-path")?s.getNamedItem("data-animation-path").value:s.getNamedItem("data-bm-path")?s.getNamedItem("data-bm-path").value:s.getNamedItem("bm-path")?s.getNamedItem("bm-path").value:"",i.animType=s.getNamedItem("data-anim-type")?s.getNamedItem("data-anim-type").value:s.getNamedItem("data-bm-type")?s.getNamedItem("data-bm-type").value:s.getNamedItem("bm-type")?s.getNamedItem("bm-type").value:s.getNamedItem("data-bm-renderer")?s.getNamedItem("data-bm-renderer").value:s.getNamedItem("bm-renderer")?s.getNamedItem("bm-renderer").value:it()||"canvas";var r=s.getNamedItem("data-anim-loop")?s.getNamedItem("data-anim-loop").value:s.getNamedItem("data-bm-loop")?s.getNamedItem("data-bm-loop").value:s.getNamedItem("bm-loop")?s.getNamedItem("bm-loop").value:"";"false"===r?i.loop=!1:"true"===r?i.loop=!0:""!==r&&(i.loop=parseInt(r,10));var n=s.getNamedItem("data-anim-autoplay")?s.getNamedItem("data-anim-autoplay").value:s.getNamedItem("data-bm-autoplay")?s.getNamedItem("data-bm-autoplay").value:!s.getNamedItem("bm-autoplay")||s.getNamedItem("bm-autoplay").value;i.autoplay="false"!==n,i.name=s.getNamedItem("data-name")?s.getNamedItem("data-name").value:s.getNamedItem("data-bm-name")?s.getNamedItem("data-bm-name").value:s.getNamedItem("bm-name")?s.getNamedItem("bm-name").value:"","false"===(s.getNamedItem("data-anim-prerender")?s.getNamedItem("data-anim-prerender").value:s.getNamedItem("data-bm-prerender")?s.getNamedItem("data-bm-prerender").value:s.getNamedItem("bm-prerender")?s.getNamedItem("bm-prerender").value:"")&&(i.prerender=!1),i.path?this.setParams(i):this.trigger("destroy")},rt.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,i,s=this.animationData.layers,r=s.length,n=t.layers,a=n.length;for(i=0;i<a;i+=1)for(e=0;e<r;){if(s[e].id===n[i].id){s[e]=n[i];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,Y.completeAnimation(this.animationData,this.onSegmentComplete)},rt.prototype.onSegmentComplete=function(t){this.animationData=t;var e=V();e&&e.initExpressions(this),this.loadNextSegment()},rt.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||0===t.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var e=t.shift();this.timeCompleted=e.time*this.frameRate;var i=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,Y.loadData(i,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},rt.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},rt.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},rt.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},rt.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=J(t.markers||[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(e){this.triggerConfigError(e)}},rt.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},rt.prototype.checkLoaded=function(){if(!this.isLoaded&&this.renderer.globalData.fontManager.isLoaded&&(this.imagePreloader.loadedImages()||"canvas"!==this.renderer.rendererType)&&this.imagePreloader.loadedFootages()){this.isLoaded=!0;var t=V();t&&t.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play()}},rt.prototype.resize=function(t,e){var i="number"==typeof t?t:void 0,s="number"==typeof e?e:void 0;this.renderer.updateContainerSize(i,s)},rt.prototype.setSubframe=function(t){this.isSubframeEnabled=!!t},rt.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")},rt.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)}},rt.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")))},rt.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())},rt.prototype.togglePause=function(t){t&&this.name!==t||(!0===this.isPaused?this.play():this.pause())},rt.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},rt.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},rt.prototype.goToAndStop=function(t,e,i){if(!i||this.name===i){var s=Number(t);if(isNaN(s)){var r=this.getMarkerData(t);r&&this.goToAndStop(r.time,!0)}else e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier);this.pause()}},rt.prototype.goToAndPlay=function(t,e,i){if(!i||this.name===i){var s=Number(t);if(isNaN(s)){var r=this.getMarkerData(t);r&&(r.duration?this.playSegments([r.time,r.time+r.duration],!0):this.goToAndStop(r.time,!0))}else this.goToAndStop(s,e,i);this.play()}},rt.prototype.advanceTime=function(t){if(!0!==this.isPaused&&!1!==this.isLoaded){var e=this.currentRawFrame+t*this.frameModifier,i=!1;e>=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"))}},rt.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]<t[0]?(this.frameModifier>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")},rt.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)},rt.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),"object"===st(t[0])){var i,s=t.length;for(i=0;i<s;i+=1)this.segments.push(t[i])}else this.segments.push(t);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},rt.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)},rt.prototype.checkSegments=function(t){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),t),!0)},rt.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)},rt.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame()},rt.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},rt.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier()},rt.prototype.setLoop=function(t){this.loop=t},rt.prototype.setVolume=function(t,e){e&&this.name!==e||this.audioController.setVolume(t)},rt.prototype.getVolume=function(){return this.audioController.getVolume()},rt.prototype.mute=function(t){t&&this.name!==t||this.audioController.mute()},rt.prototype.unmute=function(t){t&&this.name!==t||this.audioController.unmute()},rt.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},rt.prototype.getPath=function(){return this.path},rt.prototype.getAssetsPath=function(t){var e="";if(t.e)e=t.p;else if(this.assetsPath){var i=t.p;-1!==i.indexOf("images/")&&(i=i.split("/")[1]),e=this.assetsPath+i}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},rt.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},rt.prototype.hide=function(){this.renderer.hide()},rt.prototype.show=function(){this.renderer.show()},rt.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},rt.prototype.updateDocumentData=function(t,e,i){try{this.renderer.getElementByPath(t).updateDocumentData(e,i)}catch(s){}},rt.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new S(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 C(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new E(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new P(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new D(t,this));break;default:this.triggerEvent(t)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new S(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new C(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new E(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new P(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new D(t,this))},rt.prototype.triggerRenderFrameError=function(t){var e=new I(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)},rt.prototype.triggerConfigError=function(t){var e=new M(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)};var nt=function(){var t={},e=[],i=0,s=0,r=0,n=!0,a=!1;function o(t){for(var i=0,r=t.target;i<s;)e[i].animation===r&&(e.splice(i,1),i-=1,s-=1,r.isPaused||d()),i+=1}function h(t,i){if(!t)return null;for(var r=0;r<s;){if(e[r].elem===t&&null!==e[r].elem)return e[r].animation;r+=1}var n=new rt;return f(n,t),n.setData(t,i),n}function c(){var t,i=e.length,s=[];for(t=0;t<i;t+=1)s.push(e[t].animation);return s}function p(){r+=1,E()}function d(){r-=1}function f(t,i){t.addEventListener("destroy",o),t.addEventListener("_active",p),t.addEventListener("_idle",d),e.push({elem:i,animation:t}),s+=1}function u(t){var e=new rt;return f(e,null),e.setParams(t),e}function m(t,i){var r;for(r=0;r<s;r+=1)e[r].animation.setSpeed(t,i)}function g(t,i){var r;for(r=0;r<s;r+=1)e[r].animation.setDirection(t,i)}function y(t){var i;for(i=0;i<s;i+=1)e[i].animation.play(t)}function v(t){var o,h=t-i;for(o=0;o<s;o+=1)e[o].animation.advanceTime(h);i=t,r&&!a?window.requestAnimationFrame(v):n=!0}function b(t){i=t,window.requestAnimationFrame(v)}function w(t){var i;for(i=0;i<s;i+=1)e[i].animation.pause(t)}function k(t,i,r){var n;for(n=0;n<s;n+=1)e[n].animation.goToAndStop(t,i,r)}function _(t){var i;for(i=0;i<s;i+=1)e[i].animation.stop(t)}function T(t){var i;for(i=0;i<s;i+=1)e[i].animation.togglePause(t)}function x(t){var i;for(i=s-1;i>=0;i-=1)e[i].animation.destroy(t)}function A(t,e,i){var s,r=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),n=r.length;for(s=0;s<n;s+=1)i&&r[s].setAttribute("data-bm-type",i),h(r[s],t);if(e&&0===n){i||(i="svg");var a=document.getElementsByTagName("body")[0];a.innerText="";var o=l("div");o.style.width="100%",o.style.height="100%",o.setAttribute("data-bm-type",i),a.appendChild(o),h(o,t)}}function S(){var t;for(t=0;t<s;t+=1)e[t].animation.resize()}function E(){!a&&r&&n&&(window.requestAnimationFrame(b),n=!1)}function C(){a=!0}function P(){a=!1,E()}function D(t,i){var r;for(r=0;r<s;r+=1)e[r].animation.setVolume(t,i)}function I(t){var i;for(i=0;i<s;i+=1)e[i].animation.mute(t)}function M(t){var i;for(i=0;i<s;i+=1)e[i].animation.unmute(t)}return t.registerAnimation=h,t.loadAnimation=u,t.setSpeed=m,t.setDirection=g,t.play=y,t.pause=w,t.stop=_,t.togglePause=T,t.searchAnimations=A,t.resize=S,t.goToAndStop=k,t.destroy=x,t.freeze=C,t.unfreeze=P,t.setVolume=D,t.mute=I,t.unmute=M,t.getRegisteredAnimations=c,t}(),at=function(){var t={};t.getBezierEasing=i;var e={};function i(t,i,s,r,n){var a=n||("bez_"+t+"_"+i+"_"+s+"_"+r).replace(/\./g,"p");if(e[a])return e[a];var o=new y([t,i,s,r]);return e[a]=o,o}var s=4,r=.001,n=1e-7,a=10,o=11,h=1/(o-1),l="function"==typeof Float32Array;function c(t,e){return 1-3*e+3*t}function p(t,e){return 3*e-6*t}function d(t){return 3*t}function f(t,e,i){return((c(e,i)*t+p(e,i))*t+d(e))*t}function u(t,e,i){return 3*c(e,i)*t*t+2*p(e,i)*t+d(e)}function m(t,e,i,s,r){var o,h,l=0;do{(o=f(h=e+(i-e)/2,s,r)-t)>0?i=h:e=h}while(Math.abs(o)>n&&++l<a);return h}function g(t,e,i,r){for(var n=0;n<s;++n){var a=u(e,i,r);if(0===a)return e;e-=(f(e,i,r)-t)/a}return e}function y(t){this._p=t,this._mSampleValues=l?new Float32Array(o):new Array(o),this._precomputed=!1,this.get=this.get.bind(this)}return y.prototype={get:function(t){var e=this._p[0],i=this._p[1],s=this._p[2],r=this._p[3];return this._precomputed||this._precompute(),e===i&&s===r?t:0===t?0:1===t?1:f(this._getTForX(t),i,r)},_precompute:function(){var t=this._p[0],e=this._p[1],i=this._p[2],s=this._p[3];this._precomputed=!0,t===e&&i===s||this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],i=0;i<o;++i)this._mSampleValues[i]=f(i*h,t,e)},_getTForX:function(t){for(var e=this._p[0],i=this._p[2],s=this._mSampleValues,n=0,a=1,l=o-1;a!==l&&s[a]<=t;++a)n+=h;var c=n+(t-s[--a])/(s[a+1]-s[a])*h,p=u(c,e,i);return p>=r?g(t,c,e,i):0===p?c:m(t,n,n+h,e,i)}},t}(),ot=function(){function t(t){return t.concat(u(t.length))}return{double:t}}(),ht=function(){return function(t,e,i){var s=0,r=t,n=u(r);function a(){return s?n[s-=1]:e()}function o(t){s===r&&(n=ot.double(n),r*=2),i&&i(t),n[s]=t,s+=1}return{newElement:a,release:o}}}(),lt=function(){function t(){return{addedLength:0,percents:f("float32",q()),lengths:f("float32",q())}}return ht(8,t)}(),ct=function(){function t(){return{lengths:[],totalLength:0}}function e(t){var e,i=t.lengths.length;for(e=0;e<i;e+=1)lt.release(t.lengths[e]);t.lengths.length=0}return ht(8,t,e)}();function pt(){var t=Math;function e(t,e,i,s,r,n){var a=t*s+e*r+i*n-r*s-n*t-i*e;return a>-.001&&a<.001}function i(i,s,r,n,a,o,h,l,c){if(0===r&&0===o&&0===c)return e(i,s,n,a,h,l);var p,d=t.sqrt(t.pow(n-i,2)+t.pow(a-s,2)+t.pow(o-r,2)),f=t.sqrt(t.pow(h-i,2)+t.pow(l-s,2)+t.pow(c-r,2)),u=t.sqrt(t.pow(h-n,2)+t.pow(l-a,2)+t.pow(c-o,2));return(p=d>f?d>u?d-f-u:u-f-d:u>f?u-f-d:f-d-u)>-1e-4&&p<1e-4}var s=function(){return function(t,e,i,s){var r,n,a,o,h,l,c=q(),p=0,d=[],f=[],u=lt.newElement();for(a=i.length,r=0;r<c;r+=1){for(h=r/(c-1),l=0,n=0;n<a;n+=1)o=b(1-h,3)*t[n]+3*b(1-h,2)*h*i[n]+3*(1-h)*b(h,2)*s[n]+b(h,3)*e[n],d[n]=o,null!==f[n]&&(l+=b(d[n]-f[n],2)),f[n]=d[n];l&&(p+=l=w(l)),u.percents[r]=h,u.lengths[r]=p}return u.addedLength=p,u}}();function r(t){var e,i=ct.newElement(),r=t.c,n=t.v,a=t.o,o=t.i,h=t._length,l=i.lengths,c=0;for(e=0;e<h-1;e+=1)l[e]=s(n[e],n[e+1],a[e],o[e+1]),c+=l[e].addedLength;return r&&h&&(l[e]=s(n[e],n[0],a[e],o[0]),c+=l[e].addedLength),i.totalLength=c,i}function n(t){this.segmentLength=0,this.points=new Array(t)}function a(t,e){this.partialLength=t,this.point=e}var o=function(){var t={};return function(i,s,r,o){var h=(i[0]+"_"+i[1]+"_"+s[0]+"_"+s[1]+"_"+r[0]+"_"+r[1]+"_"+o[0]+"_"+o[1]).replace(/\./g,"p");if(!t[h]){var l,c,p,d,f,m,g,y=q(),v=0,k=null;2===i.length&&(i[0]!==s[0]||i[1]!==s[1])&&e(i[0],i[1],s[0],s[1],i[0]+r[0],i[1]+r[1])&&e(i[0],i[1],s[0],s[1],s[0]+o[0],s[1]+o[1])&&(y=2);var _=new n(y);for(p=r.length,l=0;l<y;l+=1){for(g=u(p),f=l/(y-1),m=0,c=0;c<p;c+=1)d=b(1-f,3)*i[c]+3*b(1-f,2)*f*(i[c]+r[c])+3*(1-f)*b(f,2)*(s[c]+o[c])+b(f,3)*s[c],g[c]=d,null!==k&&(m+=b(g[c]-k[c],2));v+=m=w(m),_.points[l]=new a(m,g),k=g}_.segmentLength=v,t[h]=_}return t[h]}}();function h(t,e){var i=e.percents,s=e.lengths,r=i.length,n=k((r-1)*t),a=t*e.addedLength,o=0;if(n===r-1||0===n||a===s[n])return i[n];for(var h=s[n]>a?-1:1,l=!0;l;)if(s[n]<=a&&s[n+1]>a?(o=(a-s[n])/(s[n+1]-s[n]),l=!1):n+=h,n<0||n>=r-1){if(n===r-1)return i[n];l=!1}return i[n]+(i[n+1]-i[n])*o}function l(e,i,s,r,n,a){var o=h(n,a),l=1-o;return[t.round(1e3*(l*l*l*e[0]+(o*l*l+l*o*l+l*l*o)*s[0]+(o*o*l+l*o*o+o*l*o)*r[0]+o*o*o*i[0]))/1e3,t.round(1e3*(l*l*l*e[1]+(o*l*l+l*o*l+l*l*o)*s[1]+(o*o*l+l*o*o+o*l*o)*r[1]+o*o*o*i[1]))/1e3]}var c=f("float32",8);function p(e,i,s,r,n,a,o){n<0?n=0:n>1&&(n=1);var l,p=h(n,o),d=h(a=a>1?1:a,o),f=e.length,u=1-p,m=1-d,g=u*u*u,y=p*u*u*3,v=p*p*u*3,b=p*p*p,w=u*u*m,k=p*u*m+u*p*m+u*u*d,_=p*p*m+u*p*d+p*u*d,T=p*p*d,x=u*m*m,A=p*m*m+u*d*m+u*m*d,S=p*d*m+u*d*d+p*m*d,E=p*d*d,C=m*m*m,P=d*m*m+m*d*m+m*m*d,D=d*d*m+m*d*d+d*m*d,I=d*d*d;for(l=0;l<f;l+=1)c[4*l]=t.round(1e3*(g*e[l]+y*s[l]+v*r[l]+b*i[l]))/1e3,c[4*l+1]=t.round(1e3*(w*e[l]+k*s[l]+_*r[l]+T*i[l]))/1e3,c[4*l+2]=t.round(1e3*(x*e[l]+A*s[l]+S*r[l]+E*i[l]))/1e3,c[4*l+3]=t.round(1e3*(C*e[l]+P*s[l]+D*r[l]+I*i[l]))/1e3;return c}return{getSegmentsLength:r,getNewSegment:p,getPointInSegment:l,buildBezierData:o,pointOnLine2D:e,pointOnLine3D:i}}var dt=pt(),ft=s,ut=Math.abs;function mt(t,e){var i,s=this.offsetTime;"multidimensional"===this.propType&&(i=f("float32",this.pv.length));for(var r,n,a,o,h,l,c,p,d,u=e.lastIndex,m=u,g=this.keyframes.length-1,y=!0;y;){if(r=this.keyframes[m],n=this.keyframes[m+1],m===g-1&&t>=n.t-s){r.h&&(r=n),u=0;break}if(n.t-s>t){u=m;break}m<g-1?m+=1:(u=0,y=!1)}a=this.keyframesMetadata[m]||{};var v,b=n.t-s,w=r.t-s;if(r.to){a.bezierData||(a.bezierData=dt.buildBezierData(r.s,n.s||r.e,r.to,r.ti));var k=a.bezierData;if(t>=b||t<w){var _=t>=b?k.points.length-1:0;for(h=k.points[_].point.length,o=0;o<h;o+=1)i[o]=k.points[_].point[o]}else{a.__fnct?d=a.__fnct:(d=at.getBezierEasing(r.o.x,r.o.y,r.i.x,r.i.y,r.n).get,a.__fnct=d),l=d((t-w)/(b-w));var T,x=k.segmentLength*l,A=e.lastFrame<t&&e._lastKeyframeIndex===m?e._lastAddedLength:0;for(p=e.lastFrame<t&&e._lastKeyframeIndex===m?e._lastPoint:0,y=!0,c=k.points.length;y;){if(A+=k.points[p].partialLength,0===x||0===l||p===k.points.length-1){for(h=k.points[p].point.length,o=0;o<h;o+=1)i[o]=k.points[p].point[o];break}if(x>=A&&x<A+k.points[p+1].partialLength){for(T=(x-A)/k.points[p+1].partialLength,h=k.points[p].point.length,o=0;o<h;o+=1)i[o]=k.points[p].point[o]+(k.points[p+1].point[o]-k.points[p].point[o])*T;break}p<c-1?p+=1:y=!1}e._lastPoint=p,e._lastAddedLength=A-k.points[p].partialLength,e._lastKeyframeIndex=m}}else{var S,E,C,P,D;if(g=r.s.length,v=n.s||r.e,this.sh&&1!==r.h)t>=b?(i[0]=v[0],i[1]=v[1],i[2]=v[2]):t<=w?(i[0]=r.s[0],i[1]=r.s[1],i[2]=r.s[2]):yt(i,gt(vt(r.s),vt(v),(t-w)/(b-w)));else for(m=0;m<g;m+=1)1!==r.h&&(t>=b?l=1:t<w?l=0:(r.o.x.constructor===Array?(a.__fnct||(a.__fnct=[]),a.__fnct[m]?d=a.__fnct[m]:(S=void 0===r.o.x[m]?r.o.x[0]:r.o.x[m],E=void 0===r.o.y[m]?r.o.y[0]:r.o.y[m],C=void 0===r.i.x[m]?r.i.x[0]:r.i.x[m],P=void 0===r.i.y[m]?r.i.y[0]:r.i.y[m],d=at.getBezierEasing(S,E,C,P).get,a.__fnct[m]=d)):a.__fnct?d=a.__fnct:(S=r.o.x,E=r.o.y,C=r.i.x,P=r.i.y,d=at.getBezierEasing(S,E,C,P).get,r.keyframeMetadata=d),l=d((t-w)/(b-w)))),v=n.s||r.e,D=1===r.h?r.s[m]:r.s[m]+(v[m]-r.s[m])*l,"multidimensional"===this.propType?i[m]=D:i=D}return e.lastIndex=u,i}function gt(t,e,i){var s,r,n,a,o,h=[],l=t[0],c=t[1],p=t[2],d=t[3],f=e[0],u=e[1],m=e[2],g=e[3];return(r=l*f+c*u+p*m+d*g)<0&&(r=-r,f=-f,u=-u,m=-m,g=-g),1-r>1e-6?(s=Math.acos(r),n=Math.sin(s),a=Math.sin((1-i)*s)/n,o=Math.sin(i*s)/n):(a=1-i,o=i),h[0]=a*l+o*f,h[1]=a*c+o*u,h[2]=a*p+o*m,h[3]=a*d+o*g,h}function yt(t,e){var i=e[0],s=e[1],r=e[2],n=e[3],a=Math.atan2(2*s*n-2*i*r,1-2*s*s-2*r*r),o=Math.asin(2*i*s+2*r*n),h=Math.atan2(2*i*n-2*s*r,1-2*i*i-2*r*r);t[0]=a/x,t[1]=o/x,t[2]=h/x}function vt(t){var e=t[0]*x,i=t[1]*x,s=t[2]*x,r=Math.cos(e/2),n=Math.cos(i/2),a=Math.cos(s/2),o=Math.sin(e/2),h=Math.sin(i/2),l=Math.sin(s/2);return[o*h*a+r*n*l,o*n*a+r*h*l,r*h*a-o*n*l,r*n*a-o*h*l]}function bt(){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!==ft&&(this._caching.lastFrame>=i&&t>=i||this._caching.lastFrame<e&&t<e))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var s=this.interpolateValue(t,this._caching);this.pv=s}return this._caching.lastFrame=t,this.pv}function wt(t){var e;if("unidimensional"===this.propType)e=t*this.mult,ut(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);else for(var i=0,s=this.v.length;i<s;)e=t[i]*this.mult,ut(this.v[i]-e)>1e-5&&(this.v[i]=e,this._mdf=!0),i+=1}function kt(){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<e;t+=1)i=this.effectsSequence[t](i);this.setVValue(i),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function _t(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function Tt(t,e,i,s){this.propType="unidimensional",this.mult=i||1,this.data=e,this.v=i?e.k*i:e.k,this.pv=e.k,this._mdf=!1,this.elem=t,this.container=s,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=kt,this.setVValue=wt,this.addEffect=_t}function xt(t,e,i,s){var r;this.propType="multidimensional",this.mult=i||1,this.data=e,this._mdf=!1,this.elem=t,this.container=s,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var n=e.k.length;for(this.v=f("float32",n),this.pv=f("float32",n),this.vel=f("float32",n),r=0;r<n;r+=1)this.v[r]=e.k[r]*this.mult,this.pv[r]=e.k[r];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=kt,this.setVValue=wt,this.addEffect=_t}function At(t,e,i,s){this.propType="unidimensional",this.keyframes=e.k,this.keyframesMetadata=[],this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:ft,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=e,this.mult=i||1,this.elem=t,this.container=s,this.comp=t.comp,this.v=ft,this.pv=ft,this._isFirstFrame=!0,this.getValue=kt,this.setVValue=wt,this.interpolateValue=mt,this.effectsSequence=[bt.bind(this)],this.addEffect=_t}function St(t,e,i,s){var r;this.propType="multidimensional";var n,a,o,h,l=e.k.length;for(r=0;r<l-1;r+=1)e.k[r].to&&e.k[r].s&&e.k[r+1]&&e.k[r+1].s&&(n=e.k[r].s,a=e.k[r+1].s,o=e.k[r].to,h=e.k[r].ti,(2===n.length&&(n[0]!==a[0]||n[1]!==a[1])&&dt.pointOnLine2D(n[0],n[1],a[0],a[1],n[0]+o[0],n[1]+o[1])&&dt.pointOnLine2D(n[0],n[1],a[0],a[1],a[0]+h[0],a[1]+h[1])||3===n.length&&(n[0]!==a[0]||n[1]!==a[1]||n[2]!==a[2])&&dt.pointOnLine3D(n[0],n[1],n[2],a[0],a[1],a[2],n[0]+o[0],n[1]+o[1],n[2]+o[2])&&dt.pointOnLine3D(n[0],n[1],n[2],a[0],a[1],a[2],a[0]+h[0],a[1]+h[1],a[2]+h[2]))&&(e.k[r].to=null,e.k[r].ti=null),n[0]===a[0]&&n[1]===a[1]&&0===o[0]&&0===o[1]&&0===h[0]&&0===h[1]&&(2===n.length||n[2]===a[2]&&0===o[2]&&0===h[2])&&(e.k[r].to=null,e.k[r].ti=null));this.effectsSequence=[bt.bind(this)],this.data=e,this.keyframes=e.k,this.keyframesMetadata=[],this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=i||1,this.elem=t,this.container=s,this.comp=t.comp,this.getValue=kt,this.setVValue=wt,this.interpolateValue=mt,this.frameId=-1;var c=e.k[0].s.length;for(this.v=f("float32",c),this.pv=f("float32",c),r=0;r<c;r+=1)this.v[r]=ft,this.pv[r]=ft;this._caching={lastFrame:ft,lastIndex:0,value:f("float32",c)},this.addEffect=_t}var Et=function(){function t(t,e,i,s,r){var n;if(e.sid&&(e=t.globalData.slotManager.getProp(e)),e.k.length)if("number"==typeof e.k[0])n=new xt(t,e,s,r);else switch(i){case 0:n=new At(t,e,s,r);break;case 1:n=new St(t,e,s,r)}else n=new Tt(t,e,s,r);return n.effectsSequence.length&&r.addDynamicProperty(n),n}return{getProp:t}}();function Ct(){}Ct.prototype={addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){var t;this._mdf=!1;var e=this.dynamicProperties.length;for(t=0;t<e;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var Pt=function(){function t(){return f("float32",2)}return ht(8,t)}();function Dt(){this.c=!1,this._length=0,this._maxLength=8,this.v=u(this._maxLength),this.o=u(this._maxLength),this.i=u(this._maxLength)}Dt.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var i=0;i<e;)this.v[i]=Pt.newElement(),this.o[i]=Pt.newElement(),this.i[i]=Pt.newElement(),i+=1},Dt.prototype.setLength=function(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t},Dt.prototype.doubleArrayLength=function(){this.v=this.v.concat(u(this._maxLength)),this.i=this.i.concat(u(this._maxLength)),this.o=this.o.concat(u(this._maxLength)),this._maxLength*=2},Dt.prototype.setXYAt=function(t,e,i,s,r){var n;switch(this._length=Math.max(this._length,s+1),this._length>=this._maxLength&&this.doubleArrayLength(),i){case"v":n=this.v;break;case"i":n=this.i;break;case"o":n=this.o;break;default:n=[]}(!n[s]||n[s]&&!r)&&(n[s]=Pt.newElement()),n[s][0]=t,n[s][1]=e},Dt.prototype.setTripleAt=function(t,e,i,s,r,n,a,o){this.setXYAt(t,e,"v",a,o),this.setXYAt(i,s,"o",a,o),this.setXYAt(r,n,"i",a,o)},Dt.prototype.reverse=function(){var t=new Dt;t.setPathData(this.c,this._length);var e=this.v,i=this.o,s=this.i,r=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],s[0][0],s[0][1],i[0][0],i[0][1],0,!1),r=1);var n,a=this._length-1,o=this._length;for(n=r;n<o;n+=1)t.setTripleAt(e[a][0],e[a][1],s[a][0],s[a][1],i[a][0],i[a][1],n,!1),a-=1;return t},Dt.prototype.length=function(){return this._length};var It=function(){function t(){return new Dt}function e(t){var e,i=t._length;for(e=0;e<i;e+=1)Pt.release(t.v[e]),Pt.release(t.i[e]),Pt.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1}function i(t){var e,i=s.newElement(),r=void 0===t._length?t.v.length:t._length;for(i.setLength(r),i.c=t.c,e=0;e<r;e+=1)i.setTripleAt(t.v[e][0],t.v[e][1],t.o[e][0],t.o[e][1],t.i[e][0],t.i[e][1],e);return i}var s=ht(4,t,e);return s.clone=i,s}();function Mt(){this._length=0,this._maxLength=4,this.shapes=u(this._maxLength)}Mt.prototype.addShape=function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(u(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1},Mt.prototype.releaseShapes=function(){var t;for(t=0;t<this._length;t+=1)It.release(this.shapes[t]);this._length=0};var Lt=function(){var t={newShapeCollection:r,release:n},e=0,i=4,s=u(i);function r(){return e?s[e-=1]:new Mt}function n(t){var r,n=t._length;for(r=0;r<n;r+=1)It.release(t.shapes[r]);t._length=0,e===i&&(s=ot.double(s),i*=2),s[e]=t,e+=1}return t}(),Ft=function(){var t=-999999;function e(t,e,i){var s,r,n,a,o,h,l,c,p,d=i.lastIndex,f=this.keyframes;if(t<f[0].t-this.offsetTime)s=f[0].s[0],n=!0,d=0;else if(t>=f[f.length-1].t-this.offsetTime)s=f[f.length-1].s?f[f.length-1].s[0]:f[f.length-2].e[0],n=!0;else{for(var u,m,g,y=d,v=f.length-1,b=!0;b&&(u=f[y],!((m=f[y+1]).t-this.offsetTime>t));)y<v-1?y+=1:b=!1;if(g=this.keyframesMetadata[y]||{},d=y,!(n=1===u.h)){if(t>=m.t-this.offsetTime)c=1;else if(t<u.t-this.offsetTime)c=0;else{var w;g.__fnct?w=g.__fnct:(w=at.getBezierEasing(u.o.x,u.o.y,u.i.x,u.i.y).get,g.__fnct=w),c=w((t-(u.t-this.offsetTime))/(m.t-this.offsetTime-(u.t-this.offsetTime)))}r=m.s?m.s[0]:u.e[0]}s=u.s[0]}for(h=e._length,l=s.i[0].length,i.lastIndex=d,a=0;a<h;a+=1)for(o=0;o<l;o+=1)p=n?s.i[a][o]:s.i[a][o]+(r.i[a][o]-s.i[a][o])*c,e.i[a][o]=p,p=n?s.o[a][o]:s.o[a][o]+(r.o[a][o]-s.o[a][o])*c,e.o[a][o]=p,p=n?s.v[a][o]:s.v[a][o]+(r.v[a][o]-s.v[a][o])*c,e.v[a][o]=p}function i(){var e=this.comp.renderedFrame-this.offsetTime,i=this.keyframes[0].t-this.offsetTime,s=this.keyframes[this.keyframes.length-1].t-this.offsetTime,r=this._caching.lastFrame;return r!==t&&(r<i&&e<i||r>s&&e>s)||(this._caching.lastIndex=r<e?this._caching.lastIndex:0,this.interpolateShape(e,this.pv,this._caching)),this._caching.lastFrame=e,this.pv}function s(){this.paths=this.localShapeCollection}function r(t,e){if(t._length!==e._length||t.c!==e.c)return!1;var i,s=t._length;for(i=0;i<s;i+=1)if(t.v[i][0]!==e.v[i][0]||t.v[i][1]!==e.v[i][1]||t.o[i][0]!==e.o[i][0]||t.o[i][1]!==e.o[i][1]||t.i[i][0]!==e.i[i][0]||t.i[i][1]!==e.i[i][1])return!1;return!0}function n(t){r(this.v,t)||(this.v=It.clone(t),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function a(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var t,e;this.lock=!0,this._mdf=!1,t=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k;var i=this.effectsSequence.length;for(e=0;e<i;e+=1)t=this.effectsSequence[e](t);this.setVValue(t),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function o(t,e,i){this.propType="shape",this.comp=t.comp,this.container=t,this.elem=t,this.data=e,this.k=!1,this.kf=!1,this._mdf=!1;var r=3===i?e.pt.k:e.ks.k;this.v=It.clone(r),this.pv=It.clone(this.v),this.localShapeCollection=Lt.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=s,this.effectsSequence=[]}function h(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function l(e,r,n){this.propType="shape",this.comp=e.comp,this.elem=e,this.container=e,this.offsetTime=e.data.st,this.keyframes=3===n?r.pt.k:r.ks.k,this.keyframesMetadata=[],this.k=!0,this.kf=!0;var a=this.keyframes[0].s[0].i.length;this.v=It.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,a),this.pv=It.clone(this.v),this.localShapeCollection=Lt.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=t,this.reset=s,this._caching={lastFrame:t,lastIndex:0},this.effectsSequence=[i.bind(this)]}o.prototype.interpolateShape=e,o.prototype.getValue=a,o.prototype.setVValue=n,o.prototype.addEffect=h,l.prototype.getValue=a,l.prototype.interpolateShape=e,l.prototype.setVValue=n,l.prototype.addEffect=h;var p=function(){var t=A;function e(t,e){this.v=It.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=Lt.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=e.d,this.elem=t,this.comp=t.comp,this.frameId=-1,this.initDynamicPropertyContainer(t),this.p=Et.getProp(t,e.p,1,0,this),this.s=Et.getProp(t,e.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return e.prototype={reset:s,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var e=this.p.v[0],i=this.p.v[1],s=this.s.v[0]/2,r=this.s.v[1]/2,n=3!==this.d,a=this.v;a.v[0][0]=e,a.v[0][1]=i-r,a.v[1][0]=n?e+s:e-s,a.v[1][1]=i,a.v[2][0]=e,a.v[2][1]=i+r,a.v[3][0]=n?e-s:e+s,a.v[3][1]=i,a.i[0][0]=n?e-s*t:e+s*t,a.i[0][1]=i-r,a.i[1][0]=n?e+s:e-s,a.i[1][1]=i-r*t,a.i[2][0]=n?e+s*t:e-s*t,a.i[2][1]=i+r,a.i[3][0]=n?e-s:e+s,a.i[3][1]=i+r*t,a.o[0][0]=n?e+s*t:e-s*t,a.o[0][1]=i-r,a.o[1][0]=n?e+s:e-s,a.o[1][1]=i+r*t,a.o[2][0]=n?e-s*t:e+s*t,a.o[2][1]=i+r,a.o[3][0]=n?e-s:e+s,a.o[3][1]=i-r*t}},c([Ct],e),e}(),d=function(){function t(t,e){this.v=It.newElement(),this.v.setPathData(!0,0),this.elem=t,this.comp=t.comp,this.data=e,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),1===e.sy?(this.ir=Et.getProp(t,e.ir,0,0,this),this.is=Et.getProp(t,e.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=Et.getProp(t,e.pt,0,0,this),this.p=Et.getProp(t,e.p,1,0,this),this.r=Et.getProp(t,e.r,0,x,this),this.or=Et.getProp(t,e.or,0,0,this),this.os=Et.getProp(t,e.os,0,.01,this),this.localShapeCollection=Lt.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return t.prototype={reset:s,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var t,e,i,s,r=2*Math.floor(this.pt.v),n=2*Math.PI/r,a=!0,o=this.or.v,h=this.ir.v,l=this.os.v,c=this.is.v,p=2*Math.PI*o/(2*r),d=2*Math.PI*h/(2*r),f=-Math.PI/2;f+=this.r.v;var u=3===this.data.d?-1:1;for(this.v._length=0,t=0;t<r;t+=1){i=a?l:c,s=a?p:d;var m=(e=a?o:h)*Math.cos(f),g=e*Math.sin(f),y=0===m&&0===g?0:g/Math.sqrt(m*m+g*g),v=0===m&&0===g?0:-m/Math.sqrt(m*m+g*g);m+=+this.p.v[0],g+=+this.p.v[1],this.v.setTripleAt(m,g,m-y*s*i*u,g-v*s*i*u,m+y*s*i*u,g+v*s*i*u,t,!0),a=!a,f+=n*u}},convertPolygonToPath:function(){var t,e=Math.floor(this.pt.v),i=2*Math.PI/e,s=this.or.v,r=this.os.v,n=2*Math.PI*s/(4*e),a=.5*-Math.PI,o=3===this.data.d?-1:1;for(a+=this.r.v,this.v._length=0,t=0;t<e;t+=1){var h=s*Math.cos(a),l=s*Math.sin(a),c=0===h&&0===l?0:l/Math.sqrt(h*h+l*l),p=0===h&&0===l?0:-h/Math.sqrt(h*h+l*l);h+=+this.p.v[0],l+=+this.p.v[1],this.v.setTripleAt(h,l,h-c*n*r*o,l-p*n*r*o,h+c*n*r*o,l+p*n*r*o,t,!0),a+=i*o}this.paths.length=0,this.paths[0]=this.v}},c([Ct],t),t}(),f=function(){function t(t,e){this.v=It.newElement(),this.v.c=!0,this.localShapeCollection=Lt.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=t,this.comp=t.comp,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),this.p=Et.getProp(t,e.p,1,0,this),this.s=Et.getProp(t,e.s,1,0,this),this.r=Et.getProp(t,e.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return t.prototype={convertRectToPath:function(){var t=this.p.v[0],e=this.p.v[1],i=this.s.v[0]/2,s=this.s.v[1]/2,r=_(i,s,this.r.v),n=r*(1-A);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(t+i,e-s+r,t+i,e-s+r,t+i,e-s+n,0,!0),this.v.setTripleAt(t+i,e+s-r,t+i,e+s-n,t+i,e+s-r,1,!0),0!==r?(this.v.setTripleAt(t+i-r,e+s,t+i-r,e+s,t+i-n,e+s,2,!0),this.v.setTripleAt(t-i+r,e+s,t-i+n,e+s,t-i+r,e+s,3,!0),this.v.setTripleAt(t-i,e+s-r,t-i,e+s-r,t-i,e+s-n,4,!0),this.v.setTripleAt(t-i,e-s+r,t-i,e-s+n,t-i,e-s+r,5,!0),this.v.setTripleAt(t-i+r,e-s,t-i+r,e-s,t-i+n,e-s,6,!0),this.v.setTripleAt(t+i-r,e-s,t+i-n,e-s,t+i-r,e-s,7,!0)):(this.v.setTripleAt(t-i,e+s,t-i+n,e+s,t-i,e+s,2),this.v.setTripleAt(t-i,e-s,t-i,e-s+n,t-i,e-s,3))):(this.v.setTripleAt(t+i,e-s+r,t+i,e-s+n,t+i,e-s+r,0,!0),0!==r?(this.v.setTripleAt(t+i-r,e-s,t+i-r,e-s,t+i-n,e-s,1,!0),this.v.setTripleAt(t-i+r,e-s,t-i+n,e-s,t-i+r,e-s,2,!0),this.v.setTripleAt(t-i,e-s+r,t-i,e-s+r,t-i,e-s+n,3,!0),this.v.setTripleAt(t-i,e+s-r,t-i,e+s-n,t-i,e+s-r,4,!0),this.v.setTripleAt(t-i+r,e+s,t-i+r,e+s,t-i+n,e+s,5,!0),this.v.setTripleAt(t+i-r,e+s,t+i-n,e+s,t+i-r,e+s,6,!0),this.v.setTripleAt(t+i,e+s-r,t+i,e+s-r,t+i,e+s-n,7,!0)):(this.v.setTripleAt(t-i,e-s,t-i+n,e-s,t-i,e-s,1,!0),this.v.setTripleAt(t-i,e+s,t-i,e+s-n,t-i,e+s,2,!0),this.v.setTripleAt(t+i,e+s,t+i-n,e+s,t+i,e+s,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:s},c([Ct],t),t}();function u(t,e,i){var s;return 3===i||4===i?s=(3===i?e.pt:e.ks).k.length?new l(t,e,i):new o(t,e,i):5===i?s=new f(t,e):6===i?s=new p(t,e):7===i&&(s=new d(t,e)),s.k&&t.addDynamicProperty(s),s}function m(){return o}function g(){return l}var y={};return y.getShapeProp=u,y.getConstructorFunction=m,y.getKeyframedConstructorFunction=g,y}(),Rt=function(){var t=Math.cos,e=Math.sin,i=Math.tan,s=Math.round;function r(){return this.props[0]=1,this.props[1]=0,this.props[2]=0,this.props[3]=0,this.props[4]=0,this.props[5]=1,this.props[6]=0,this.props[7]=0,this.props[8]=0,this.props[9]=0,this.props[10]=1,this.props[11]=0,this.props[12]=0,this.props[13]=0,this.props[14]=0,this.props[15]=1,this}function n(i){if(0===i)return this;var s=t(i),r=e(i);return this._t(s,-r,0,0,r,s,0,0,0,0,1,0,0,0,0,1)}function a(i){if(0===i)return this;var s=t(i),r=e(i);return this._t(1,0,0,0,0,s,-r,0,0,r,s,0,0,0,0,1)}function o(i){if(0===i)return this;var s=t(i),r=e(i);return this._t(s,0,r,0,0,1,0,0,-r,0,s,0,0,0,0,1)}function h(i){if(0===i)return this;var s=t(i),r=e(i);return this._t(s,-r,0,0,r,s,0,0,0,0,1,0,0,0,0,1)}function l(t,e){return this._t(1,e,t,1,0,0)}function c(t,e){return this.shear(i(t),i(e))}function p(s,r){var n=t(r),a=e(r);return this._t(n,a,0,0,-a,n,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,i(s),1,0,0,0,0,1,0,0,0,0,1)._t(n,-a,0,0,a,n,0,0,0,0,1,0,0,0,0,1)}function d(t,e,i){return i||0===i||(i=1),1===t&&1===e&&1===i?this:this._t(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1)}function u(t,e,i,s,r,n,a,o,h,l,c,p,d,f,u,m){return this.props[0]=t,this.props[1]=e,this.props[2]=i,this.props[3]=s,this.props[4]=r,this.props[5]=n,this.props[6]=a,this.props[7]=o,this.props[8]=h,this.props[9]=l,this.props[10]=c,this.props[11]=p,this.props[12]=d,this.props[13]=f,this.props[14]=u,this.props[15]=m,this}function m(t,e,i){return i=i||0,0!==t||0!==e||0!==i?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1):this}function g(t,e,i,s,r,n,a,o,h,l,c,p,d,f,u,m){var g=this.props;if(1===t&&0===e&&0===i&&0===s&&0===r&&1===n&&0===a&&0===o&&0===h&&0===l&&1===c&&0===p)return g[12]=g[12]*t+g[15]*d,g[13]=g[13]*n+g[15]*f,g[14]=g[14]*c+g[15]*u,g[15]*=m,this._identityCalculated=!1,this;var y=g[0],v=g[1],b=g[2],w=g[3],k=g[4],_=g[5],T=g[6],x=g[7],A=g[8],S=g[9],E=g[10],C=g[11],P=g[12],D=g[13],I=g[14],M=g[15];return g[0]=y*t+v*r+b*h+w*d,g[1]=y*e+v*n+b*l+w*f,g[2]=y*i+v*a+b*c+w*u,g[3]=y*s+v*o+b*p+w*m,g[4]=k*t+_*r+T*h+x*d,g[5]=k*e+_*n+T*l+x*f,g[6]=k*i+_*a+T*c+x*u,g[7]=k*s+_*o+T*p+x*m,g[8]=A*t+S*r+E*h+C*d,g[9]=A*e+S*n+E*l+C*f,g[10]=A*i+S*a+E*c+C*u,g[11]=A*s+S*o+E*p+C*m,g[12]=P*t+D*r+I*h+M*d,g[13]=P*e+D*n+I*l+M*f,g[14]=P*i+D*a+I*c+M*u,g[15]=P*s+D*o+I*p+M*m,this._identityCalculated=!1,this}function y(t){var e=t.props;return this.transform(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function v(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function b(t){for(var e=0;e<16;){if(t.props[e]!==this.props[e])return!1;e+=1}return!0}function w(t){var e;for(e=0;e<16;e+=1)t.props[e]=this.props[e];return t}function k(t){var e;for(e=0;e<16;e+=1)this.props[e]=t[e]}function _(t,e,i){return{x:t*this.props[0]+e*this.props[4]+i*this.props[8]+this.props[12],y:t*this.props[1]+e*this.props[5]+i*this.props[9]+this.props[13],z:t*this.props[2]+e*this.props[6]+i*this.props[10]+this.props[14]}}function T(t,e,i){return t*this.props[0]+e*this.props[4]+i*this.props[8]+this.props[12]}function x(t,e,i){return t*this.props[1]+e*this.props[5]+i*this.props[9]+this.props[13]}function A(t,e,i){return t*this.props[2]+e*this.props[6]+i*this.props[10]+this.props[14]}function S(){var t=this.props[0]*this.props[5]-this.props[1]*this.props[4],e=this.props[5]/t,i=-this.props[1]/t,s=-this.props[4]/t,r=this.props[0]/t,n=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/t,a=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/t,o=new Rt;return o.props[0]=e,o.props[1]=i,o.props[4]=s,o.props[5]=r,o.props[12]=n,o.props[13]=a,o}function E(t){return this.getInverseMatrix().applyToPointArray(t[0],t[1],t[2]||0)}function C(t){var e,i=t.length,s=[];for(e=0;e<i;e+=1)s[e]=E(t[e]);return s}function P(t,e,i){var s=f("float32",6);if(this.isIdentity())s[0]=t[0],s[1]=t[1],s[2]=e[0],s[3]=e[1],s[4]=i[0],s[5]=i[1];else{var r=this.props[0],n=this.props[1],a=this.props[4],o=this.props[5],h=this.props[12],l=this.props[13];s[0]=t[0]*r+t[1]*a+h,s[1]=t[0]*n+t[1]*o+l,s[2]=e[0]*r+e[1]*a+h,s[3]=e[0]*n+e[1]*o+l,s[4]=i[0]*r+i[1]*a+h,s[5]=i[0]*n+i[1]*o+l}return s}function D(t,e,i){return this.isIdentity()?[t,e,i]:[t*this.props[0]+e*this.props[4]+i*this.props[8]+this.props[12],t*this.props[1]+e*this.props[5]+i*this.props[9]+this.props[13],t*this.props[2]+e*this.props[6]+i*this.props[10]+this.props[14]]}function I(t,e){if(this.isIdentity())return t+","+e;var i=this.props;return Math.round(100*(t*i[0]+e*i[4]+i[12]))/100+","+Math.round(100*(t*i[1]+e*i[5]+i[13]))/100}function M(){for(var t=0,e=this.props,i="matrix3d(",r=1e4;t<16;)i+=s(e[t]*r)/r,i+=15===t?")":",",t+=1;return i}function L(t){var e=1e4;return t<1e-6&&t>0||t>-1e-6&&t<0?s(t*e)/e:t}function F(){var t=this.props;return"matrix("+L(t[0])+","+L(t[1])+","+L(t[4])+","+L(t[5])+","+L(t[12])+","+L(t[13])+")"}return function(){this.reset=r,this.rotate=n,this.rotateX=a,this.rotateY=o,this.rotateZ=h,this.skew=c,this.skewFromAxis=p,this.shear=l,this.scale=d,this.setTransform=u,this.translate=m,this.transform=g,this.multiply=y,this.applyToPoint=_,this.applyToX=T,this.applyToY=x,this.applyToZ=A,this.applyToPointArray=D,this.applyToTriplePoints=P,this.applyToPointStringified=I,this.toCSS=M,this.to2dCSS=F,this.clone=w,this.cloneFromProps=k,this.equals=b,this.inversePoints=C,this.inversePoint=E,this.getInverseMatrix=S,this._t=this.transform,this.isIdentity=v,this._identity=!0,this._identityCalculated=!1,this.props=f("float32",16),this.reset()}}();function Nt(t){return(Nt="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 Ot={};function zt(t){o(t)}function Ut(){nt.searchAnimations()}function Wt(t){U(t)}function jt(t){H(t)}function Vt(t){return nt.loadAnimation(t)}function Bt(t){if("string"==typeof t)switch(t){case"high":B(200);break;default:case"medium":B(50);break;case"low":B(10)}else!isNaN(t)&&t>1&&B(t)}function qt(){return"undefined"!=typeof navigator}function Ht(t,e){"expressions"===t&&j(e)}function $t(t){switch(t){case"propertyFactory":return Et;case"shapePropertyFactory":return Ft;case"matrix":return Rt;default:return null}}function Gt(){"complete"===document.readyState&&(clearInterval(Qt),Ut())}function Yt(t){for(var e=Xt.split("&"),i=0;i<e.length;i+=1){var s=e[i].split("=");if(decodeURIComponent(s[0])==t)return decodeURIComponent(s[1])}return null}Ot.play=nt.play,Ot.pause=nt.pause,Ot.setLocationHref=zt,Ot.togglePause=nt.togglePause,Ot.setSpeed=nt.setSpeed,Ot.setDirection=nt.setDirection,Ot.stop=nt.stop,Ot.searchAnimations=Ut,Ot.registerAnimation=nt.registerAnimation,Ot.loadAnimation=Vt,Ot.setSubframeRendering=Wt,Ot.resize=nt.resize,Ot.goToAndStop=nt.goToAndStop,Ot.destroy=nt.destroy,Ot.setQuality=Bt,Ot.inBrowser=qt,Ot.installPlugin=Ht,Ot.freeze=nt.freeze,Ot.unfreeze=nt.unfreeze,Ot.setVolume=nt.setVolume,Ot.mute=nt.mute,Ot.unmute=nt.unmute,Ot.getRegisteredAnimations=nt.getRegisteredAnimations,Ot.useWebWorker=r,Ot.setIDPrefix=jt,Ot.__getFactory=$t,Ot.version="5.13.0";var Xt="",Kt=document.getElementsByTagName("script"),Jt=Kt.length-1,Zt=Kt[Jt]||{src:""};Xt=Zt.src?Zt.src.replace(/^[^\?]+\??/,""):"",Yt("renderer");var Qt=setInterval(Gt,100);try{"object"!==Nt(n)&&(window.bodymovin=Ot)}catch(Ji){}var te=function(){var t={},e={};function i(t,i){e[t]||(e[t]=i)}function s(t,i,s){return new e[t](i,s)}return t.registerModifier=i,t.getModifier=s,t}();function ee(){}function ie(){}function se(){}ee.prototype.initModifierProperties=function(){},ee.prototype.addShapeToModifier=function(){},ee.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:Lt.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated()}},ee.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=s,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ee.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},c([Ct],ee),c([ee],ie),ie.prototype.initModifierProperties=function(t,e){this.s=Et.getProp(t,e.s,0,.01,this),this.e=Et.getProp(t,e.e,0,.01,this),this.o=Et.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},ie.prototype.addShapeToModifier=function(t){t.pathsData=[]},ie.prototype.calculateShapeEdges=function(t,e,i,s,r){var n=[];e<=1?n.push({s:t,e:e}):t>=1?n.push({s:t-1,e:e-1}):(n.push({s:t,e:1}),n.push({s:0,e:e-1}));var a,o,h=[],l=n.length;for(a=0;a<l;a+=1){var c,p;(o=n[a]).e*r<s||o.s*r>s+i||(c=o.s*r<=s?0:(o.s*r-s)/i,p=o.e*r>=s+i?1:(o.e*r-s)/i,h.push([c,p]))}return h.length||h.push([0,0]),h},ie.prototype.releasePathsData=function(t){var e,i=t.length;for(e=0;e<i;e+=1)ct.release(t[e]);return t.length=0,t},ie.prototype.processShapes=function(t){var e,i,s,r;if(this._mdf||t){var n=this.o.v%360/360;if(n<0&&(n+=1),(e=this.s.v>1?1+n:this.s.v<0?0+n:this.s.v+n)>(i=this.e.v>1?1+n:this.e.v<0?0+n:this.e.v+n)){var a=e;e=i,i=a}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,c,p,d=this.shapes.length,f=0;if(i===e)for(r=0;r<d;r+=1)this.shapes[r].localShapeCollection.releaseShapes(),this.shapes[r].shape._mdf=!0,this.shapes[r].shape.paths=this.shapes[r].localShapeCollection,this._mdf&&(this.shapes[r].pathsData.length=0);else if(1===i&&0===e||0===i&&1===e){if(this._mdf)for(r=0;r<d;r+=1)this.shapes[r].pathsData.length=0,this.shapes[r].shape._mdf=!0}else{var u,m,g=[];for(r=0;r<d;r+=1)if((u=this.shapes[r]).shape._mdf||this._mdf||t||2===this.m){if(h=(s=u.shape.paths)._length,p=0,!u.shape._mdf&&u.pathsData.length)p=u.totalShapeLength;else{for(l=this.releasePathsData(u.pathsData),o=0;o<h;o+=1)c=dt.getSegmentsLength(s.shapes[o]),l.push(c),p+=c.totalLength;u.totalShapeLength=p,u.pathsData=l}f+=p,u.shape._mdf=!0}else u.shape.paths=u.localShapeCollection;var y,v=e,b=i,w=0;for(r=d-1;r>=0;r-=1)if((u=this.shapes[r]).shape._mdf){for((m=u.localShapeCollection).releaseShapes(),2===this.m&&d>1?(y=this.calculateShapeEdges(e,i,u.totalShapeLength,w,f),w+=u.totalShapeLength):y=[[v,b]],h=y.length,o=0;o<h;o+=1){v=y[o][0],b=y[o][1],g.length=0,b<=1?g.push({s:u.totalShapeLength*v,e:u.totalShapeLength*b}):v>=1?g.push({s:u.totalShapeLength*(v-1),e:u.totalShapeLength*(b-1)}):(g.push({s:u.totalShapeLength*v,e:u.totalShapeLength}),g.push({s:0,e:u.totalShapeLength*(b-1)}));var k=this.addShapes(u,g[0]);if(g[0].s!==g[0].e){if(g.length>1)if(u.shape.paths.shapes[u.shape.paths._length-1].c){var _=k.pop();this.addPaths(k,m),k=this.addShapes(u,g[1],_)}else this.addPaths(k,m),k=this.addShapes(u,g[1]);this.addPaths(k,m)}}u.shape.paths=m}}},ie.prototype.addPaths=function(t,e){var i,s=t.length;for(i=0;i<s;i+=1)e.addShape(t[i])},ie.prototype.addSegment=function(t,e,i,s,r,n,a){r.setXYAt(e[0],e[1],"o",n),r.setXYAt(i[0],i[1],"i",n+1),a&&r.setXYAt(t[0],t[1],"v",n),r.setXYAt(s[0],s[1],"v",n+1)},ie.prototype.addSegmentFromArray=function(t,e,i,s){e.setXYAt(t[1],t[5],"o",i),e.setXYAt(t[2],t[6],"i",i+1),s&&e.setXYAt(t[0],t[4],"v",i),e.setXYAt(t[3],t[7],"v",i+1)},ie.prototype.addShapes=function(t,e,i){var s,r,n,a,o,h,l,c,p=t.pathsData,d=t.shape.paths.shapes,f=t.shape.paths._length,u=0,m=[],g=!0;for(i?(o=i._length,c=i._length):(i=It.newElement(),o=0,c=0),m.push(i),s=0;s<f;s+=1){for(h=p[s].lengths,i.c=d[s].c,n=d[s].c?h.length:h.length+1,r=1;r<n;r+=1)if(u+(a=h[r-1]).addedLength<e.s)u+=a.addedLength,i.c=!1;else{if(u>e.e){i.c=!1;break}e.s<=u&&e.e>=u+a.addedLength?(this.addSegment(d[s].v[r-1],d[s].o[r-1],d[s].i[r],d[s].v[r],i,o,g),g=!1):(l=dt.getNewSegment(d[s].v[r-1],d[s].v[r],d[s].o[r-1],d[s].i[r],(e.s-u)/a.addedLength,(e.e-u)/a.addedLength,h[r-1]),this.addSegmentFromArray(l,i,o,g),g=!1,i.c=!1),u+=a.addedLength,o+=1}if(d[s].c&&h.length){if(a=h[r-1],u<=e.e){var y=h[r-1].addedLength;e.s<=u&&e.e>=u+y?(this.addSegment(d[s].v[r-1],d[s].o[r-1],d[s].i[0],d[s].v[0],i,o,g),g=!1):(l=dt.getNewSegment(d[s].v[r-1],d[s].v[0],d[s].o[r-1],d[s].i[0],(e.s-u)/y,(e.e-u)/y,h[r-1]),this.addSegmentFromArray(l,i,o,g),g=!1,i.c=!1)}else i.c=!1;u+=a.addedLength,o+=1}if(i._length&&(i.setXYAt(i.v[c][0],i.v[c][1],"i",c),i.setXYAt(i.v[i._length-1][0],i.v[i._length-1][1],"o",i._length-1)),u>e.e)break;s<f-1&&(i=It.newElement(),g=!0,m.push(i),o=0)}return m},c([ee],se),se.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=Et.getProp(t,e.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},se.prototype.processPath=function(t,e){var i=e/100,s=[0,0],r=t._length,n=0;for(n=0;n<r;n+=1)s[0]+=t.v[n][0],s[1]+=t.v[n][1];s[0]/=r,s[1]/=r;var a,o,h,l,c,p,d=It.newElement();for(d.c=t.c,n=0;n<r;n+=1)a=t.v[n][0]+(s[0]-t.v[n][0])*i,o=t.v[n][1]+(s[1]-t.v[n][1])*i,h=t.o[n][0]+(s[0]-t.o[n][0])*-i,l=t.o[n][1]+(s[1]-t.o[n][1])*-i,c=t.i[n][0]+(s[0]-t.i[n][0])*-i,p=t.i[n][1]+(s[1]-t.i[n][1])*-i,d.setTripleAt(a,o,h,l,c,p,n);return d},se.prototype.processShapes=function(t){var e,i,s,r,n,a,o=this.shapes.length,h=this.amount.v;if(0!==h)for(i=0;i<o;i+=1){if(a=(n=this.shapes[i]).localShapeCollection,n.shape._mdf||this._mdf||t)for(a.releaseShapes(),n.shape._mdf=!0,e=n.shape.paths.shapes,r=n.shape.paths._length,s=0;s<r;s+=1)a.addShape(this.processPath(e[s],h));n.shape.paths=n.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)};var re=function(){var t=[0,0];function e(t){var e=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||e,this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&t.skewFromAxis(-this.sk.v,this.sa.v),this.r?t.rotate(-this.r.v):t.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.data.p.s?this.data.p.z?t.translate(this.px.v,this.py.v,-this.pz.v):t.translate(this.px.v,this.py.v,0):t.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}function i(e){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||e){var i;if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&this.v.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.autoOriented){var s,r;if(i=this.elem.globalData.frameRate,this.p&&this.p.keyframes&&this.p.getValueAtTime)this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(s=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/i,0),r=this.p.getValueAtTime(this.p.keyframes[0].t/i,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(s=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/i,0),r=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/i,0)):(s=this.p.pv,r=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){s=[],r=[];var n=this.px,a=this.py;n._caching.lastFrame+n.offsetTime<=n.keyframes[0].t?(s[0]=n.getValueAtTime((n.keyframes[0].t+.01)/i,0),s[1]=a.getValueAtTime((a.keyframes[0].t+.01)/i,0),r[0]=n.getValueAtTime(n.keyframes[0].t/i,0),r[1]=a.getValueAtTime(a.keyframes[0].t/i,0)):n._caching.lastFrame+n.offsetTime>=n.keyframes[n.keyframes.length-1].t?(s[0]=n.getValueAtTime(n.keyframes[n.keyframes.length-1].t/i,0),s[1]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/i,0),r[0]=n.getValueAtTime((n.keyframes[n.keyframes.length-1].t-.01)/i,0),r[1]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/i,0)):(s=[n.pv,a.pv],r[0]=n.getValueAtTime((n._caching.lastFrame+n.offsetTime-.01)/i,n.offsetTime),r[1]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/i,a.offsetTime))}else s=r=t;this.v.rotate(-Math.atan2(s[1]-r[1],s[0]-r[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}}function s(){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)}}function r(){}function n(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0}function a(t,e,i){if(this.elem=t,this.frameId=-1,this.propType="transform",this.data=e,this.v=new Rt,this.pre=new Rt,this.appliedTransformations=0,this.initDynamicPropertyContainer(i||t),e.p&&e.p.s?(this.px=Et.getProp(t,e.p.x,0,0,this),this.py=Et.getProp(t,e.p.y,0,0,this),e.p.z&&(this.pz=Et.getProp(t,e.p.z,0,0,this))):this.p=Et.getProp(t,e.p||{k:[0,0,0]},1,0,this),e.rx){if(this.rx=Et.getProp(t,e.rx,0,x,this),this.ry=Et.getProp(t,e.ry,0,x,this),this.rz=Et.getProp(t,e.rz,0,x,this),e.or.k[0].ti){var s,r=e.or.k.length;for(s=0;s<r;s+=1)e.or.k[s].to=null,e.or.k[s].ti=null}this.or=Et.getProp(t,e.or,1,x,this),this.or.sh=!0}else this.r=Et.getProp(t,e.r||{k:0},0,x,this);e.sk&&(this.sk=Et.getProp(t,e.sk,0,x,this),this.sa=Et.getProp(t,e.sa,0,x,this)),this.a=Et.getProp(t,e.a||{k:[0,0,0]},1,0,this),this.s=Et.getProp(t,e.s||{k:[100,100,100]},1,.01,this),e.o?this.o=Et.getProp(t,e.o,0,.01,t):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}function o(t,e,i){return new a(t,e,i)}return a.prototype={applyToMatrix:e,getValue:i,precalculateMatrix:s,autoOrient:r},c([Ct],a),a.prototype.addDynamicProperty=n,a.prototype._addDynamicProperty=Ct.prototype.addDynamicProperty,{getTransformProperty:o}}();function ne(){}function ae(){}function oe(t,e){return 1e5*Math.abs(t-e)<=Math.min(Math.abs(t),Math.abs(e))}function he(t){return Math.abs(t)<=1e-5}function le(t,e,i){return t*(1-i)+e*i}function ce(t,e,i){return[le(t[0],e[0],i),le(t[1],e[1],i)]}function pe(t,e,i){if(0===t)return[];var s=e*e-4*t*i;if(s<0)return[];var r=-e/(2*t);if(0===s)return[r];var n=Math.sqrt(s)/(2*t);return[r-n,r+n]}function de(t,e,i,s){return[3*e-t-3*i+s,3*t-6*e+3*i,-3*t+3*e,t]}function fe(t){return new ue(t,t,t,t,!1)}function ue(t,e,i,s,r){r&&xe(t,e)&&(e=ce(t,s,1/3)),r&&xe(i,s)&&(i=ce(t,s,2/3));var n=de(t[0],e[0],i[0],s[0]),a=de(t[1],e[1],i[1],s[1]);this.a=[n[0],a[0]],this.b=[n[1],a[1]],this.c=[n[2],a[2]],this.d=[n[3],a[3]],this.points=[t,e,i,s]}function me(t,e){var i=t.points[0][e],s=t.points[t.points.length-1][e];if(i>s){var r=s;s=i,i=r}for(var n=pe(3*t.a[e],2*t.b[e],t.c[e]),a=0;a<n.length;a+=1)if(n[a]>0&&n[a]<1){var o=t.point(n[a])[e];o<i?i=o:o>s&&(s=o)}return{min:i,max:s}}function ge(t,e,i){var s=t.boundingBox();return{cx:s.cx,cy:s.cy,width:s.width,height:s.height,bez:t,t:(e+i)/2,t1:e,t2:i}}function ye(t){var e=t.bez.split(.5);return[ge(e[0],t.t1,t.t),ge(e[1],t.t,t.t2)]}function ve(t,e){return 2*Math.abs(t.cx-e.cx)<t.width+e.width&&2*Math.abs(t.cy-e.cy)<t.height+e.height}function be(t,e,i,s,r,n){if(ve(t,e))if(i>=n||t.width<=s&&t.height<=s&&e.width<=s&&e.height<=s)r.push([t.t,e.t]);else{var a=ye(t),o=ye(e);be(a[0],o[0],i+1,s,r,n),be(a[0],o[1],i+1,s,r,n),be(a[1],o[0],i+1,s,r,n),be(a[1],o[1],i+1,s,r,n)}}function we(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 ke(t,e,i,s){var r=[t[0],t[1],1],n=[e[0],e[1],1],a=[i[0],i[1],1],o=[s[0],s[1],1],h=we(we(r,n),we(a,o));return he(h[2])?null:[h[0]/h[2],h[1]/h[2]]}function _e(t,e,i){return[t[0]+Math.cos(e)*i,t[1]-Math.sin(e)*i]}function Te(t,e){return Math.hypot(t[0]-e[0],t[1]-e[1])}function xe(t,e){return oe(t[0],e[0])&&oe(t[1],e[1])}function Ae(){}function Se(t,e,i,s,r,n,a){var o=i-Math.PI/2,h=i+Math.PI/2,l=e[0]+Math.cos(i)*s*r,c=e[1]-Math.sin(i)*s*r;t.setTripleAt(l,c,l+Math.cos(o)*n,c-Math.sin(o)*n,l+Math.cos(h)*a,c-Math.sin(h)*a,t.length())}function Ee(t,e){var i=[e[0]-t[0],e[1]-t[1]],s=.5*-Math.PI;return[Math.cos(s)*i[0]-Math.sin(s)*i[1],Math.sin(s)*i[0]+Math.cos(s)*i[1]]}function Ce(t,e){var i=0===e?t.length()-1:e-1,s=(e+1)%t.length(),r=Ee(t.v[i],t.v[s]);return Math.atan2(0,1)-Math.atan2(r[1],r[0])}function Pe(t,e,i,s,r,n,a){var o=Ce(e,i),h=e.v[i%e._length],l=e.v[0===i?e._length-1:i-1],c=e.v[(i+1)%e._length],p=2===n?Math.sqrt(Math.pow(h[0]-l[0],2)+Math.pow(h[1]-l[1],2)):0,d=2===n?Math.sqrt(Math.pow(h[0]-c[0],2)+Math.pow(h[1]-c[1],2)):0;Se(t,e.v[i%e._length],o,a,s,d/(2*(r+1)),p/(2*(r+1)))}function De(t,e,i,s,r,n){for(var a=0;a<s;a+=1){var o=(a+1)/(s+1),h=2===r?Math.sqrt(Math.pow(e.points[3][0]-e.points[0][0],2)+Math.pow(e.points[3][1]-e.points[0][1],2)):0,l=e.normalAngle(o);Se(t,e.point(o),l,n,i,h/(2*(s+1)),h/(2*(s+1))),n=-n}return n}function Ie(t,e,i){var s=Math.atan2(e[0]-t[0],e[1]-t[1]);return[_e(t,s,i),_e(e,s,i)]}function Me(t,e){var i,s,r,n,a,o,h;i=(h=Ie(t.points[0],t.points[1],e))[0],s=h[1],r=(h=Ie(t.points[1],t.points[2],e))[0],n=h[1],a=(h=Ie(t.points[2],t.points[3],e))[0],o=h[1];var l=ke(i,s,r,n);null===l&&(l=s);var c=ke(a,o,r,n);return null===c&&(c=a),new ue(i,l,c,o)}function Le(t,e,i,s,r){var n=e.points[3],a=i.points[0];if(3===s)return n;if(xe(n,a))return n;if(2===s){var o=-e.tangentAngle(1),h=-i.tangentAngle(0)+Math.PI,l=ke(n,_e(n,o+Math.PI/2,100),a,_e(a,o+Math.PI/2,100)),c=l?Te(l,n):Te(n,a)/2,p=_e(n,o,2*c*A);return t.setXYAt(p[0],p[1],"o",t.length()-1),p=_e(a,h,2*c*A),t.setTripleAt(a[0],a[1],a[0],a[1],p[0],p[1],t.length()),a}var d=ke(xe(n,e.points[2])?e.points[0]:e.points[2],n,a,xe(a,i.points[1])?i.points[3]:i.points[1]);return d&&Te(d,n)<r?(t.setTripleAt(d[0],d[1],d[0],d[1],d[0],d[1],t.length()),d):n}function Fe(t,e){var i=t.intersections(e);return i.length&&oe(i[0][0],1)&&i.shift(),i.length?i[0]:null}function Re(t,e){var i=t.slice(),s=e.slice(),r=Fe(t[t.length-1],e[0]);return r&&(i[t.length-1]=t[t.length-1].split(r[0])[0],s[0]=e[0].split(r[1])[1]),t.length>1&&e.length>1&&(r=Fe(t[0],e[e.length-1]))?[[t[0].split(r[0])[0]],[e[e.length-1].split(r[1])[1]]]:[i,s]}function Ne(t){for(var e,i=1;i<t.length;i+=1)e=Re(t[i-1],t[i]),t[i-1]=e[0],t[i]=e[1];return t.length>1&&(e=Re(t[t.length-1],t[0]),t[t.length-1]=e[0],t[0]=e[1]),t}function Oe(t,e){var i,s,r,n,a=t.inflectionPoints();if(0===a.length)return[Me(t,e)];if(1===a.length||oe(a[1],1))return i=(r=t.split(a[0]))[0],s=r[1],[Me(i,e),Me(s,e)];i=(r=t.split(a[0]))[0];var o=(a[1]-a[0])/(1-a[0]);return n=(r=r[1].split(o))[0],s=r[1],[Me(i,e),Me(n,e),Me(s,e)]}function ze(){}function Ue(t){for(var e=t.fStyle?t.fStyle.split(" "):[],i="normal",s="normal",r=e.length,n=0;n<r;n+=1)switch(e[n].toLowerCase()){case"italic":s="italic";break;case"bold":i="700";break;case"black":i="900";break;case"medium":i="500";break;case"regular":case"normal":i="400";break;case"light":case"thin":i="200"}return{style:s,weight:t.fWeight||i}}c([ee],ne),ne.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.c=Et.getProp(t,e.c,0,null,this),this.o=Et.getProp(t,e.o,0,null,this),this.tr=re.getTransformProperty(t,e.tr,this),this.so=Et.getProp(t,e.tr.so,0,.01,this),this.eo=Et.getProp(t,e.tr.eo,0,.01,this),this.data=e,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Rt,this.rMatrix=new Rt,this.sMatrix=new Rt,this.tMatrix=new Rt,this.matrix=new Rt},ne.prototype.applyTransforms=function(t,e,i,s,r,n){var a=n?-1:1,o=s.s.v[0]+(1-s.s.v[0])*(1-r),h=s.s.v[1]+(1-s.s.v[1])*(1-r);t.translate(s.p.v[0]*a*r,s.p.v[1]*a*r,s.p.v[2]),e.translate(-s.a.v[0],-s.a.v[1],s.a.v[2]),e.rotate(-s.r.v*a*r),e.translate(s.a.v[0],s.a.v[1],s.a.v[2]),i.translate(-s.a.v[0],-s.a.v[1],s.a.v[2]),i.scale(n?1/o:o,n?1/h:h),i.translate(s.a.v[0],s.a.v[1],s.a.v[2])},ne.prototype.init=function(t,e,i,s){for(this.elem=t,this.arr=e,this.pos=i,this.elemsData=s,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e[i]);i>0;)i-=1,this._elements.unshift(e[i]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ne.prototype.resetElements=function(t){var e,i=t.length;for(e=0;e<i;e+=1)t[e]._processed=!1,"gr"===t[e].ty&&this.resetElements(t[e].it)},ne.prototype.cloneElements=function(t){var e=JSON.parse(JSON.stringify(t));return this.resetElements(e),e},ne.prototype.changeGroupRender=function(t,e){var i,s=t.length;for(i=0;i<s;i+=1)t[i]._render=e,"gr"===t[i].ty&&this.changeGroupRender(t[i].it,e)},ne.prototype.processShapes=function(t){var e,i,s,r,n,a=!1;if(this._mdf||t){var o,h=Math.ceil(this.c.v);if(this._groups.length<h){for(;this._groups.length<h;){var l={it:this.cloneElements(this._elements),ty:"gr"};l.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,l),this._groups.splice(0,0,l),this._currentCopies+=1}this.elem.reloadShapes(),a=!0}for(n=0,s=0;s<=this._groups.length-1;s+=1){if(o=n<h,this._groups[s]._render=o,this.changeGroupRender(this._groups[s].it,o),!o){var c=this.elemsData[s].it,p=c[c.length-1];0!==p.transform.op.v?(p.transform.op._mdf=!0,p.transform.op.v=0):p.transform.op._mdf=!1}n+=1}this._currentCopies=h;var d=this.o.v,f=d%1,u=d>0?Math.floor(d):Math.ceil(d),m=this.pMatrix.props,g=this.rMatrix.props,y=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var v,b,w=0;if(d>0){for(;w<u;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),w+=1;f&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,f,!1),w+=f)}else if(d<0){for(;w>u;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),w-=1;f&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-f,!0),w-=f)}for(s=1===this.data.m?0:this._currentCopies-1,r=1===this.data.m?1:-1,n=this._currentCopies;n;){if(b=(i=(e=this.elemsData[s].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)*(s/(this._currentCopies-1)),0!==w){for((0!==s&&1===r||s!==this._currentCopies-1&&-1===r)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),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(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(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15]),v=0;v<b;v+=1)i[v]=this.matrix.props[v];this.matrix.reset()}else for(this.matrix.reset(),v=0;v<b;v+=1)i[v]=this.matrix.props[v];w+=1,n-=1,s+=r}}else for(n=this._currentCopies,s=0,r=1;n;)i=(e=this.elemsData[s].it)[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,n-=1,s+=r;return a},ne.prototype.addShape=function(){},c([ee],ae),ae.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=Et.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},ae.prototype.processPath=function(t,e){var i,s=It.newElement();s.c=t.c;var r,n,a,o,h,l,c,p,d,f,u,m,g=t._length,y=0;for(i=0;i<g;i+=1)r=t.v[i],a=t.o[i],n=t.i[i],r[0]===a[0]&&r[1]===a[1]&&r[0]===n[0]&&r[1]===n[1]?0!==i&&i!==g-1||t.c?(o=0===i?t.v[g-1]:t.v[i-1],l=(h=Math.sqrt(Math.pow(r[0]-o[0],2)+Math.pow(r[1]-o[1],2)))?Math.min(h/2,e)/h:0,c=u=r[0]+(o[0]-r[0])*l,p=m=r[1]-(r[1]-o[1])*l,d=c-(c-r[0])*A,f=p-(p-r[1])*A,s.setTripleAt(c,p,d,f,u,m,y),y+=1,o=i===g-1?t.v[0]:t.v[i+1],l=(h=Math.sqrt(Math.pow(r[0]-o[0],2)+Math.pow(r[1]-o[1],2)))?Math.min(h/2,e)/h:0,c=d=r[0]+(o[0]-r[0])*l,p=f=r[1]+(o[1]-r[1])*l,u=c-(c-r[0])*A,m=p-(p-r[1])*A,s.setTripleAt(c,p,d,f,u,m,y),y+=1):(s.setTripleAt(r[0],r[1],a[0],a[1],n[0],n[1],y),y+=1):(s.setTripleAt(t.v[i][0],t.v[i][1],t.o[i][0],t.o[i][1],t.i[i][0],t.i[i][1],y),y+=1);return s},ae.prototype.processShapes=function(t){var e,i,s,r,n,a,o=this.shapes.length,h=this.rd.v;if(0!==h)for(i=0;i<o;i+=1){if(a=(n=this.shapes[i]).localShapeCollection,n.shape._mdf||this._mdf||t)for(a.releaseShapes(),n.shape._mdf=!0,e=n.shape.paths.shapes,r=n.shape.paths._length,s=0;s<r;s+=1)a.addShape(this.processPath(e[s],h));n.shape.paths=n.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},ue.prototype.point=function(t){return[((this.a[0]*t+this.b[0])*t+this.c[0])*t+this.d[0],((this.a[1]*t+this.b[1])*t+this.c[1])*t+this.d[1]]},ue.prototype.derivative=function(t){return[(3*t*this.a[0]+2*this.b[0])*t+this.c[0],(3*t*this.a[1]+2*this.b[1])*t+this.c[1]]},ue.prototype.tangentAngle=function(t){var e=this.derivative(t);return Math.atan2(e[1],e[0])},ue.prototype.normalAngle=function(t){var e=this.derivative(t);return Math.atan2(e[0],e[1])},ue.prototype.inflectionPoints=function(){var t=this.a[1]*this.b[0]-this.a[0]*this.b[1];if(he(t))return[];var e=-.5*(this.a[1]*this.c[0]-this.a[0]*this.c[1])/t,i=e*e-1/3*(this.b[1]*this.c[0]-this.b[0]*this.c[1])/t;if(i<0)return[];var s=Math.sqrt(i);return he(s)?s>0&&s<1?[e]:[]:[e-s,e+s].filter(function(t){return t>0&&t<1})},ue.prototype.split=function(t){if(t<=0)return[fe(this.points[0]),this];if(t>=1)return[this,fe(this.points[this.points.length-1])];var e=ce(this.points[0],this.points[1],t),i=ce(this.points[1],this.points[2],t),s=ce(this.points[2],this.points[3],t),r=ce(e,i,t),n=ce(i,s,t),a=ce(r,n,t);return[new ue(this.points[0],e,r,a,!0),new ue(a,n,s,this.points[3],!0)]},ue.prototype.bounds=function(){return{x:me(this,0),y:me(this,1)}},ue.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}},ue.prototype.intersections=function(t,e,i){void 0===e&&(e=2),void 0===i&&(i=7);var s=[];return be(ge(this,0,1),ge(t,0,1),0,e,s,i),s},ue.shapeSegment=function(t,e){var i=(e+1)%t.length();return new ue(t.v[e],t.o[e],t.i[i],t.v[i],!0)},ue.shapeSegmentInverted=function(t,e){var i=(e+1)%t.length();return new ue(t.v[i],t.i[i],t.o[e],t.v[e],!0)},c([ee],Ae),Ae.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amplitude=Et.getProp(t,e.s,0,null,this),this.frequency=Et.getProp(t,e.r,0,null,this),this.pointsType=Et.getProp(t,e.pt,0,null,this),this._isAnimated=0!==this.amplitude.effectsSequence.length||0!==this.frequency.effectsSequence.length||0!==this.pointsType.effectsSequence.length},Ae.prototype.processPath=function(t,e,i,s){var r=t._length,n=It.newElement();if(n.c=t.c,t.c||(r-=1),0===r)return n;var a=-1,o=ue.shapeSegment(t,0);Pe(n,t,0,e,i,s,a);for(var h=0;h<r;h+=1)a=De(n,o,e,i,s,-a),o=h!==r-1||t.c?ue.shapeSegment(t,(h+1)%r):null,Pe(n,t,h+1,e,i,s,a);return n},Ae.prototype.processShapes=function(t){var e,i,s,r,n,a,o=this.shapes.length,h=this.amplitude.v,l=Math.max(0,Math.round(this.frequency.v)),c=this.pointsType.v;if(0!==h)for(i=0;i<o;i+=1){if(a=(n=this.shapes[i]).localShapeCollection,n.shape._mdf||this._mdf||t)for(a.releaseShapes(),n.shape._mdf=!0,e=n.shape.paths.shapes,r=n.shape.paths._length,s=0;s<r;s+=1)a.addShape(this.processPath(e[s],h,l,c));n.shape.paths=n.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},c([ee],ze),ze.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=Et.getProp(t,e.a,0,null,this),this.miterLimit=Et.getProp(t,e.ml,0,null,this),this.lineJoin=e.lj,this._isAnimated=0!==this.amount.effectsSequence.length},ze.prototype.processPath=function(t,e,i,s){var r=It.newElement();r.c=t.c;var n,a,o,h=t.length();t.c||(h-=1);var l=[];for(n=0;n<h;n+=1)o=ue.shapeSegment(t,n),l.push(Oe(o,e));if(!t.c)for(n=h-1;n>=0;n-=1)o=ue.shapeSegmentInverted(t,n),l.push(Oe(o,e));l=Ne(l);var c=null,p=null;for(n=0;n<l.length;n+=1){var d=l[n];for(p&&(c=Le(r,p,d[0],i,s)),p=d[d.length-1],a=0;a<d.length;a+=1)o=d[a],c&&xe(o.points[0],c)?r.setXYAt(o.points[1][0],o.points[1][1],"o",r.length()-1):r.setTripleAt(o.points[0][0],o.points[0][1],o.points[1][0],o.points[1][1],o.points[0][0],o.points[0][1],r.length()),r.setTripleAt(o.points[3][0],o.points[3][1],o.points[3][0],o.points[3][1],o.points[2][0],o.points[2][1],r.length()),c=o.points[3]}return l.length&&Le(r,p,l[0][0],i,s),r},ze.prototype.processShapes=function(t){var e,i,s,r,n,a,o=this.shapes.length,h=this.amount.v,l=this.miterLimit.v,c=this.lineJoin;if(0!==h)for(i=0;i<o;i+=1){if(a=(n=this.shapes[i]).localShapeCollection,n.shape._mdf||this._mdf||t)for(a.releaseShapes(),n.shape._mdf=!0,e=n.shape.paths.shapes,r=n.shape.paths._length,s=0;s<r;s+=1)a.addShape(this.processPath(e[s],h,c,l));n.shape.paths=n.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)};var We=function(){var t=5e3,e={w:0,size:0,shapes:[],data:{shapes:[]}},i=[];i=i.concat([2304,2305,2306,2307,2362,2363,2364,2364,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2387,2388,2389,2390,2391,2402,2403]);var s=127988,r=917631,n=917601,a=917626,o=65039,h=8205,c=127462,p=127487,d=["d83cdffb","d83cdffc","d83cdffd","d83cdffe","d83cdfff"];function f(t){var e,i=t.split(","),s=i.length,r=[];for(e=0;e<s;e+=1)"sans-serif"!==i[e]&&"monospace"!==i[e]&&r.push(i[e]);return r.join(",")}function u(t,e){var i=l("span");i.setAttribute("aria-hidden",!0),i.style.fontFamily=e;var s=l("span");s.innerText="giItT1WQy@!-/#",i.style.position="absolute",i.style.left="-10000px",i.style.top="-10000px",i.style.fontSize="300px",i.style.fontVariant="normal",i.style.fontStyle="normal",i.style.fontWeight="normal",i.style.letterSpacing="0",i.appendChild(s),document.body.appendChild(i);var r=s.offsetWidth;return s.style.fontFamily=f(t)+", "+e,{node:s,w:r,parent:i}}function m(){var e,i,s,r=this.fonts.length,n=r;for(e=0;e<r;e+=1)this.fonts[e].loaded?n-=1:"n"===this.fonts[e].fOrigin||0===this.fonts[e].origin?this.fonts[e].loaded=!0:(i=this.fonts[e].monoCase.node,s=this.fonts[e].monoCase.w,i.offsetWidth!==s?(n-=1,this.fonts[e].loaded=!0):(i=this.fonts[e].sansCase.node,s=this.fonts[e].sansCase.w,i.offsetWidth!==s&&(n-=1,this.fonts[e].loaded=!0)),this.fonts[e].loaded&&(this.fonts[e].sansCase.parent.parentNode.removeChild(this.fonts[e].sansCase.parent),this.fonts[e].monoCase.parent.parentNode.removeChild(this.fonts[e].monoCase.parent)));0!==n&&Date.now()-this.initTime<t?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)}function g(t,e){var i,s=document.body&&e?"svg":"canvas",r=Ue(t);if("svg"===s){var n=$("text");n.style.fontSize="100px",n.setAttribute("font-family",t.fFamily),n.setAttribute("font-style",r.style),n.setAttribute("font-weight",r.weight),n.textContent="1",t.fClass?(n.style.fontFamily="inherit",n.setAttribute("class",t.fClass)):n.style.fontFamily=t.fFamily,e.appendChild(n),i=n}else{var a=new OffscreenCanvas(500,500).getContext("2d");a.font=r.style+" "+r.weight+" 100px "+t.fFamily,i=a}function o(t){return"svg"===s?(i.textContent=t,i.getComputedTextLength()):i.measureText(t).width}return{measureText:o}}function y(t,e){if(t){if(this.chars)return this.isLoaded=!0,void(this.fonts=t.list);if(!document.body)return this.isLoaded=!0,t.list.forEach(function(t){t.helper=g(t),t.cache={}}),void(this.fonts=t.list);var i,s=t.list,r=s.length,n=r;for(i=0;i<r;i+=1){var a,o,h=!0;if(s[i].loaded=!1,s[i].monoCase=u(s[i].fFamily,"monospace"),s[i].sansCase=u(s[i].fFamily,"sans-serif"),s[i].fPath){if("p"===s[i].fOrigin||3===s[i].origin){if((a=document.querySelectorAll('style[f-forigin="p"][f-family="'+s[i].fFamily+'"], style[f-origin="3"][f-family="'+s[i].fFamily+'"]')).length>0&&(h=!1),h){var c=l("style");c.setAttribute("f-forigin",s[i].fOrigin),c.setAttribute("f-origin",s[i].origin),c.setAttribute("f-family",s[i].fFamily),c.type="text/css",c.innerText="@font-face {font-family: "+s[i].fFamily+"; font-style: normal; src: url('"+s[i].fPath+"');}",e.appendChild(c)}}else if("g"===s[i].fOrigin||1===s[i].origin){for(a=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),o=0;o<a.length;o+=1)-1!==a[o].href.indexOf(s[i].fPath)&&(h=!1);if(h){var p=l("link");p.setAttribute("f-forigin",s[i].fOrigin),p.setAttribute("f-origin",s[i].origin),p.type="text/css",p.rel="stylesheet",p.href=s[i].fPath,document.body.appendChild(p)}}else if("t"===s[i].fOrigin||2===s[i].origin){for(a=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),o=0;o<a.length;o+=1)s[i].fPath===a[o].src&&(h=!1);if(h){var d=l("link");d.setAttribute("f-forigin",s[i].fOrigin),d.setAttribute("f-origin",s[i].origin),d.setAttribute("rel","stylesheet"),d.setAttribute("href",s[i].fPath),e.appendChild(d)}}}else s[i].loaded=!0,n-=1;s[i].helper=g(s[i],e),s[i].cache={},this.fonts.push(s[i])}0===n?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0}function v(t){if(t){var e;this.chars||(this.chars=[]);var i,s,r=t.length,n=this.chars.length;for(e=0;e<r;e+=1){for(i=0,s=!1;i<n;)this.chars[i].style===t[e].style&&this.chars[i].fFamily===t[e].fFamily&&this.chars[i].ch===t[e].ch&&(s=!0),i+=1;s||(this.chars.push(t[e]),n+=1)}}}function b(t,i,s){for(var r=0,n=this.chars.length;r<n;){if(this.chars[r].ch===t&&this.chars[r].style===i&&this.chars[r].fFamily===s)return this.chars[r];r+=1}return("string"==typeof t&&13!==t.charCodeAt(0)||!t)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",t,i,s)),e}function w(t,e,i){var s=this.getFontByName(e),r=t;if(!s.cache[r]){var n=s.helper;if(" "===t){var a=n.measureText("|"+t+"|"),o=n.measureText("||");s.cache[r]=(a-o)/100}else s.cache[r]=n.measureText(t)/100}return s.cache[r]*i}function k(t){for(var e=0,i=this.fonts.length;e<i;){if(this.fonts[e].fName===t)return this.fonts[e];e+=1}return this.fonts[0]}function _(t){var e=0,i=t.charCodeAt(0);if(i>=55296&&i<=56319){var s=t.charCodeAt(1);s>=56320&&s<=57343&&(e=1024*(i-55296)+s-56320+65536)}return e}function T(t,e){var i=t.toString(16)+e.toString(16);return-1!==d.indexOf(i)}function x(t){return t===h}function A(t){return t===o}function S(t){var e=_(t);return e>=c&&e<=p}function E(t){return S(t.substr(0,2))&&S(t.substr(2,2))}function C(t){return-1!==i.indexOf(t)}function P(t,e){var i=_(t.substr(e,2));if(i!==s)return!1;var o=0;for(e+=2;o<5;){if((i=_(t.substr(e,2)))<n||i>a)return!1;o+=1,e+=2}return _(t.substr(e,2))===r}function D(){this.isLoaded=!0}var I=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)};I.isModifier=T,I.isZeroWidthJoiner=x,I.isFlagEmoji=E,I.isRegionalCode=S,I.isCombinedCharacter=C,I.isRegionalFlag=P,I.isVariationSelector=A,I.BLACK_FLAG_CODE_POINT=s;var M={addChars:v,addFonts:y,getCharData:b,getFontByName:k,measureText:w,checkLoadedFonts:m,setIsLoaded:D};return I.prototype=M,I}();function je(t){this.animationData=t}function Ve(t){return new je(t)}function Be(){}je.prototype.getProp=function(t){return this.animationData.slots&&this.animationData.slots[t.sid]?Object.assign(t,this.animationData.slots[t.sid].p):t},Be.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(t){-1===this.renderableComponents.indexOf(t)&&this.renderableComponents.push(t)},removeRenderableComponent:function(t){-1!==this.renderableComponents.indexOf(t)&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)},prepareRenderableFrame:function(t){this.checkLayerLimits(t)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?!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<e;t+=1)this.renderableComponents[t].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}};var qe=function(){var t={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"};return function(e){return t[e]||""}}();function He(t,e,i){this.p=Et.getProp(e,t.v,0,0,i)}function $e(t,e,i){this.p=Et.getProp(e,t.v,0,0,i)}function Ge(t,e,i){this.p=Et.getProp(e,t.v,1,0,i)}function Ye(t,e,i){this.p=Et.getProp(e,t.v,1,0,i)}function Xe(t,e,i){this.p=Et.getProp(e,t.v,0,0,i)}function Ke(t,e,i){this.p=Et.getProp(e,t.v,0,0,i)}function Je(t,e,i){this.p=Et.getProp(e,t.v,0,0,i)}function Ze(){this.p={}}function Qe(t,e){var i,s=t.ef||[];this.effectElements=[];var r,n=s.length;for(i=0;i<n;i+=1)r=new ti(s[i],e),this.effectElements.push(r)}function ti(t,e){this.init(t,e)}function ei(){}function ii(){}function si(t,e,i){this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(t.refId),this.footageData=e.imageLoader.getAsset(this.assetData),this.initBaseData(t,e,i)}function ri(t,e,i){this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(t.refId),this.initBaseData(t,e,i),this._isPlaying=!1,this._canPlay=!1;var s=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(s),this._currentTime=0,this.globalData.audioController.addAudio(this),this._volumeMultiplier=1,this._volume=1,this._previousVolume=null,this.tm=t.tm?Et.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0},this.lv=Et.getProp(this,t.au&&t.au.lv?t.au.lv:{k:[100]},1,.01,this)}function ni(){}c([Ct],ti),ti.prototype.getValue=ti.prototype.iterateDynamicProperties,ti.prototype.init=function(t,e){var i;this.data=t,this.effectElements=[],this.initDynamicPropertyContainer(e);var s,r=this.data.ef.length,n=this.data.ef;for(i=0;i<r;i+=1){switch(s=null,n[i].ty){case 0:s=new He(n[i],e,this);break;case 1:s=new $e(n[i],e,this);break;case 2:s=new Ge(n[i],e,this);break;case 3:s=new Ye(n[i],e,this);break;case 4:case 7:s=new Je(n[i],e,this);break;case 10:s=new Xe(n[i],e,this);break;case 11:s=new Ke(n[i],e,this);break;case 5:s=new Qe(n[i],e);break;default:s=new Ze(n[i])}s&&this.effectElements.push(s)}},ei.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var t=0,e=this.data.masksProperties.length;t<e;){if("n"!==this.data.masksProperties[t].mode&&!1!==this.data.masksProperties[t].cl)return!0;t+=1}return!1},initExpressions:function(){},setBlendMode:function(){var t=qe(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=t},initBaseData:function(t,e,i){this.globalData=e,this.comp=i,this.data=t,this.layerId=L(),this.data.sr||(this.data.sr=1),this.effectsManager=new Qe(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}},ii.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(t,e){var i,s=this.dynamicProperties.length;for(i=0;i<s;i+=1)(e||this._isParent&&"transform"===this.dynamicProperties[i].propType)&&(this.dynamicProperties[i].getValue(),this.dynamicProperties[i]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&this.dynamicProperties.push(t)}},si.prototype.prepareFrame=function(){},c([Be,ei,ii],si),si.prototype.getBaseElement=function(){return null},si.prototype.renderFrame=function(){},si.prototype.destroy=function(){},si.prototype.initExpressions=function(){},si.prototype.getFootageData=function(){return this.footageData},ri.prototype.prepareFrame=function(t){if(this.prepareRenderableFrame(t,!0),this.prepareProperties(t,!0),this.tm._placeholder)this._currentTime=t/this.data.sr;else{var e=this.tm.v;this._currentTime=e}this._volume=this.lv.v[0];var i=this._volume*this._volumeMultiplier;this._previousVolume!==i&&(this._previousVolume=i,this.audio.volume(i))},c([Be,ei,ii],ri),ri.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek())>.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},ri.prototype.show=function(){},ri.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},ri.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},ri.prototype.resume=function(){this._canPlay=!0},ri.prototype.setRate=function(t){this.audio.rate(t)},ri.prototype.volume=function(t){this._volumeMultiplier=t,this._previousVolume=t*this._volume,this.audio.volume(this._previousVolume)},ri.prototype.getBaseElement=function(){return null},ri.prototype.destroy=function(){},ri.prototype.sourceRectAtTime=function(){},ri.prototype.initExpressions=function(){},ni.prototype.checkLayers=function(t){var e,i,s=this.layers.length;for(this.completeLayers=!0,e=s-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()},ni.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)}},ni.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},ni.prototype.createAudio=function(t){return new ri(t,this.globalData,this)},ni.prototype.createFootage=function(t){return new si(t,this.globalData,this)},ni.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.buildItem(t);this.checkPendingElements()},ni.prototype.includeLayers=function(t){var e;this.completeLayers=!1;var i,s=t.length,r=this.layers.length;for(e=0;e<s;e+=1)for(i=0;i<r;){if(this.layers[i].id===t[e].id){this.layers[i]=t[e];break}i+=1}},ni.prototype.setProjectInterface=function(t){this.globalData.projectInterface=t},ni.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},ni.prototype.buildElementParenting=function(t,e,i){for(var s=this.elements,r=this.layers,n=0,a=r.length;n<a;)r[n].ind==e&&(s[n]&&!0!==s[n]?(i.push(s[n]),s[n].setAsParent(),void 0!==r[n].parent?this.buildElementParenting(t,r[n].parent,i):t.setHierarchy(i)):(this.buildItem(n),this.addPendingElement(t))),n+=1},ni.prototype.addPendingElement=function(t){this.pendingElements.push(t)},ni.prototype.searchExtraCompositions=function(t){var e,i=t.length;for(e=0;e<i;e+=1)if(t[e].xt){var s=this.createComp(t[e]);s.initExpressions(),this.globalData.projectInterface.registerComposition(s)}},ni.prototype.getElementById=function(t){var e,i=this.elements.length;for(e=0;e<i;e+=1)if(this.elements[e].data.ind===t)return this.elements[e];return null},ni.prototype.getElementByPath=function(t){var e,i=t.shift();if("number"==typeof i)e=this.elements[i];else{var s,r=this.elements.length;for(s=0;s<r;s+=1)if(this.elements[s].data.nm===i){e=this.elements[s];break}}return 0===t.length?e:e.getElementByPath(t)},ni.prototype.setupGlobalData=function(t,e){this.globalData.fontManager=new We,this.globalData.slotManager=Ve(t),this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=t.fr,this.globalData.nm=t.nm,this.globalData.compSize={w:t.w,h:t.h}};var ai={TRANSFORM_EFFECT:"transformEFfect"};function oi(){}function hi(t,e,i){this.data=t,this.element=e,this.globalData=i,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var s,r,n=this.globalData.defs,a=this.masksProperties?this.masksProperties.length:0;this.viewData=u(a),this.solidPath="";var o,l,c,p,d,f,m=this.masksProperties,g=0,y=[],v=L(),b="clipPath",w="clip-path";for(s=0;s<a;s+=1)if(("a"!==m[s].mode&&"n"!==m[s].mode||m[s].inv||100!==m[s].o.k||m[s].o.x)&&(b="mask",w="mask"),"s"!==m[s].mode&&"i"!==m[s].mode||0!==g?c=null:((c=$("rect")).setAttribute("fill","#ffffff"),c.setAttribute("width",this.element.comp.data.w||0),c.setAttribute("height",this.element.comp.data.h||0),y.push(c)),r=$("path"),"n"===m[s].mode)this.viewData[s]={op:Et.getProp(this.element,m[s].o,0,.01,this.element),prop:Ft.getShapeProp(this.element,m[s],3),elem:r,lastPath:""},n.appendChild(r);else{var k;if(g+=1,r.setAttribute("fill","s"===m[s].mode?"#000000":"#ffffff"),r.setAttribute("clip-rule","nonzero"),0!==m[s].x.k?(b="mask",w="mask",f=Et.getProp(this.element,m[s].x,0,null,this.element),k=L(),(p=$("filter")).setAttribute("id",k),(d=$("feMorphology")).setAttribute("operator","erode"),d.setAttribute("in","SourceGraphic"),d.setAttribute("radius","0"),p.appendChild(d),n.appendChild(p),r.setAttribute("stroke","s"===m[s].mode?"#000000":"#ffffff")):(d=null,f=null),this.storedData[s]={elem:r,x:f,expan:d,lastPath:"",lastOperator:"",filterId:k,lastRadius:0},"i"===m[s].mode){l=y.length;var _=$("g");for(o=0;o<l;o+=1)_.appendChild(y[o]);var T=$("mask");T.setAttribute("mask-type","alpha"),T.setAttribute("id",v+"_"+g),T.appendChild(r),n.appendChild(T),_.setAttribute("mask","url("+h()+"#"+v+"_"+g+")"),y.length=0,y.push(_)}else y.push(r);m[s].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[s]={elem:r,lastPath:"",op:Et.getProp(this.element,m[s].o,0,.01,this.element),prop:Ft.getShapeProp(this.element,m[s],3),invRect:c},this.viewData[s].prop.k||this.drawPath(m[s],this.viewData[s].prop.v,this.viewData[s])}for(this.maskElement=$(b),a=y.length,s=0;s<a;s+=1)this.maskElement.appendChild(y[s]);g>0&&(this.maskElement.setAttribute("id",v),this.element.maskedElement.setAttribute(w,"url("+h()+"#"+v+")"),n.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}oi.prototype={initTransform:function(){var t=new Rt;this.finalTransform={mProp:this.data.ks?re.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,s=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;i<s;){if(this.hierarchy[i].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}i+=1}if(this.finalTransform._matMdf)for(t=this.finalTransform.mProp.v.props,e.cloneFromProps(t),i=0;i<s;i+=1)e.multiply(this.hierarchy[i].finalTransform.mProp.v)}this.localTransforms&&!this.finalTransform._matMdf||(this.finalTransform._localMatMdf=this.finalTransform._matMdf),this.finalTransform._opMdf&&(this.finalTransform.localOpacity=this.finalTransform.mProp.o.v)},renderLocalTransform:function(){if(this.localTransforms){var t=0,e=this.localTransforms.length;if(this.finalTransform._localMatMdf=this.finalTransform._matMdf,!this.finalTransform._localMatMdf||!this.finalTransform._opMdf)for(;t<e;)this.localTransforms[t]._mdf&&(this.finalTransform._localMatMdf=!0),this.localTransforms[t]._opMdf&&!this.finalTransform._opMdf&&(this.finalTransform.localOpacity=this.finalTransform.mProp.o.v,this.finalTransform._opMdf=!0),t+=1;if(this.finalTransform._localMatMdf){var i=this.finalTransform.localMat;for(this.localTransforms[0].matrix.clone(i),t=1;t<e;t+=1){var s=this.localTransforms[t].matrix;i.multiply(s)}i.multiply(this.finalTransform.mat)}if(this.finalTransform._opMdf){var r=this.finalTransform.localOpacity;for(t=0;t<e;t+=1)r*=.01*this.localTransforms[t].opacity;this.finalTransform.localOpacity=r}}},searchEffectTransforms:function(){if(this.renderableEffectsManager){var t=this.renderableEffectsManager.getEffects(ai.TRANSFORM_EFFECT);if(t.length){this.localTransforms=[],this.finalTransform.localMat=new Rt;var e=0,i=t.length;for(e=0;e<i;e+=1)this.localTransforms.push(t[e])}}},globalToLocal:function(t){var e=[];e.push(this.finalTransform);for(var i,s=!0,r=this.comp;s;)r.finalTransform?(r.data.hasMask&&e.splice(0,0,r.finalTransform),r=r.comp):s=!1;var n,a=e.length;for(i=0;i<a;i+=1)n=e[i].mat.applyToPointArray(0,0,0),t=[t[0]-n[0],t[1]-n[1],0];return t},mHelper:new Rt},hi.prototype.getMaskProperty=function(t){return this.viewData[t].prop},hi.prototype.renderFrame=function(t){var e,i=this.element.finalTransform.mat,s=this.masksProperties.length;for(e=0;e<s;e+=1)if((this.viewData[e].prop._mdf||t)&&this.drawPath(this.masksProperties[e],this.viewData[e].prop.v,this.viewData[e]),(this.viewData[e].op._mdf||t)&&this.viewData[e].elem.setAttribute("fill-opacity",this.viewData[e].op.v),"n"!==this.masksProperties[e].mode&&(this.viewData[e].invRect&&(this.element.finalTransform.mProp._mdf||t)&&this.viewData[e].invRect.setAttribute("transform",i.getInverseMatrix().to2dCSS()),this.storedData[e].x&&(this.storedData[e].x._mdf||t))){var r=this.storedData[e].expan;this.storedData[e].x.v<0?("erode"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="erode",this.storedData[e].elem.setAttribute("filter","url("+h()+"#"+this.storedData[e].filterId+")")),r.setAttribute("radius",-this.storedData[e].x.v)):("dilate"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="dilate",this.storedData[e].elem.setAttribute("filter",null)),this.storedData[e].elem.setAttribute("stroke-width",2*this.storedData[e].x.v))}},hi.prototype.getMaskelement=function(){return this.maskElement},hi.prototype.createLayerSolidPath=function(){var t="M0,0 ";return t+=" h"+this.globalData.compSize.w,t+=" v"+this.globalData.compSize.h,t+=" h-"+this.globalData.compSize.w,t+=" v-"+this.globalData.compSize.h+" "},hi.prototype.drawPath=function(t,e,i){var s,r,n=" M"+e.v[0][0]+","+e.v[0][1];for(r=e._length,s=1;s<r;s+=1)n+=" C"+e.o[s-1][0]+","+e.o[s-1][1]+" "+e.i[s][0]+","+e.i[s][1]+" "+e.v[s][0]+","+e.v[s][1];if(e.c&&r>1&&(n+=" C"+e.o[s-1][0]+","+e.o[s-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),i.lastPath!==n){var a="";i.elem&&(e.c&&(a=t.inv?this.solidPath+n:n),i.elem.setAttribute("d",a)),i.lastPath=n}},hi.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var li,ci=function(){var t={};function e(t,e){var i=$("filter");return 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%")),i}function i(){var t=$("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}return t.createFilter=e,t.createAlphaToLuminanceFilter=i,t}(),pi=(li={maskType:!0,svgLumaHidden:!0,offscreenCanvas:"undefined"!=typeof OffscreenCanvas},(/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))&&(li.maskType=!1),/firefox/i.test(navigator.userAgent)&&(li.svgLumaHidden=!1),li),di={},fi="filter_result_";function ui(t){var e,i,s="SourceGraphic",r=t.data.ef?t.data.ef.length:0,n=L(),a=ci.createFilter(n,!0),o=0;for(this.filters=[],e=0;e<r;e+=1){i=null;var l=t.data.ef[e].ty;di[l]&&(i=new(0,di[l].effect)(a,t.effectsManager.effectElements[e],t,fi+o,s),s=fi+o,di[l].countsAsEffect&&(o+=1)),i&&this.filters.push(i)}o&&(t.globalData.defs.appendChild(a),t.layerElement.setAttribute("filter","url("+h()+"#"+n+")")),this.filters.length&&t.addRenderableComponent(this)}function mi(){}function gi(){}function yi(){}function vi(t,e,i){this.assetData=e.getAssetData(t.refId),this.assetData&&this.assetData.sid&&(this.assetData=e.slotManager.getProp(this.assetData)),this.initElement(t,e,i),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function bi(t,e){this.elem=t,this.pos=e}function wi(){}ui.prototype.renderFrame=function(t){var e,i=this.filters.length;for(e=0;e<i;e+=1)this.filters[e].renderFrame(t)},ui.prototype.getEffects=function(t){var e,i=this.filters.length,s=[];for(e=0;e<i;e+=1)this.filters[e].type===t&&s.push(this.filters[e]);return s},mi.prototype={initRendererElement:function(){this.layerElement=$("g")},createContainerElements:function(){this.matteElement=$("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var t=null;if(this.data.td){this.matteMasks={};var e=$("g");e.setAttribute("id",this.layerId),e.appendChild(this.layerElement),t=e,this.globalData.defs.appendChild(e)}else this.data.tt?(this.matteElement.appendChild(this.layerElement),t=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var i=$("clipPath"),s=$("path");s.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var r=L();if(i.setAttribute("id",r),i.appendChild(s),this.globalData.defs.appendChild(i),this.checkMasks()){var n=$("g");n.setAttribute("clip-path","url("+h()+"#"+r+")"),n.appendChild(this.layerElement),this.transformedElement=n,t?t.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+h()+"#"+r+")")}0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._localMatMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.localMat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.localOpacity)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new hi(this.data,this,this.globalData),this.renderableEffectsManager=new ui(this),this.searchEffectTransforms()},getMatte:function(t){if(this.matteMasks||(this.matteMasks={}),!this.matteMasks[t]){var e,i,s,r,n=this.layerId+"_"+t;if(1===t||3===t){var a=$("mask");a.setAttribute("id",n),a.setAttribute("mask-type",3===t?"luminance":"alpha"),(s=$("use")).setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),a.appendChild(s),this.globalData.defs.appendChild(a),pi.maskType||1!==t||(a.setAttribute("mask-type","luminance"),e=L(),i=ci.createFilter(e),this.globalData.defs.appendChild(i),i.appendChild(ci.createAlphaToLuminanceFilter()),(r=$("g")).appendChild(s),a.appendChild(r),r.setAttribute("filter","url("+h()+"#"+e+")"))}else if(2===t){var o=$("mask");o.setAttribute("id",n),o.setAttribute("mask-type","alpha");var l=$("g");o.appendChild(l),e=L(),i=ci.createFilter(e);var c=$("feComponentTransfer");c.setAttribute("in","SourceGraphic"),i.appendChild(c);var p=$("feFuncA");p.setAttribute("type","table"),p.setAttribute("tableValues","1.0 0.0"),c.appendChild(p),this.globalData.defs.appendChild(i);var d=$("rect");d.setAttribute("width",this.comp.data.w),d.setAttribute("height",this.comp.data.h),d.setAttribute("x","0"),d.setAttribute("y","0"),d.setAttribute("fill","#ffffff"),d.setAttribute("opacity","0"),l.setAttribute("filter","url("+h()+"#"+e+")"),l.appendChild(d),(s=$("use")).setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),l.appendChild(s),pi.maskType||(o.setAttribute("mask-type","luminance"),i.appendChild(ci.createAlphaToLuminanceFilter()),r=$("g"),l.appendChild(d),r.appendChild(this.layerElement),l.appendChild(r)),this.globalData.defs.appendChild(o)}this.matteMasks[t]=n}return this.matteMasks[t]},setMatte:function(t){this.matteElement&&this.matteElement.setAttribute("mask","url("+h()+"#"+t+")")}},gi.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(t){this.hierarchy=t},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},c([Be,p({initElement:function(t,e,i){this.initFrame(),this.initBaseData(t,e,i),this.initTransform(t,e,i),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}})],yi),c([ei,oi,mi,gi,ii,yi],vi),vi.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData);this.innerElem=$("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.innerElem)},vi.prototype.sourceRectAtTime=function(){return this.sourceRect},wi.prototype={addShapeToModifiers:function(t){var e,i=this.shapeModifiers.length;for(e=0;e<i;e+=1)this.shapeModifiers[e].addShape(t)},isShapeInAnimatedModifiers:function(t){for(var e=0,i=this.shapeModifiers.length;e<i;)if(this.shapeModifiers[e].isAnimatedWithShape(t))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var t,e=this.shapes.length;for(t=0;t<e;t+=1)this.shapes[t].sh.reset();for(t=(e=this.shapeModifiers.length)-1;t>=0&&!this.shapeModifiers[t].processShapes(this._isFirstFrame);t-=1);}},searchProcessedElement:function(t){for(var e=this.processedElements,i=0,s=e.length;i<s;){if(e[i].elem===t)return e[i].pos;i+=1}return 0},addProcessedElement:function(t,e){for(var i=this.processedElements,s=i.length;s;)if(i[s-=1].elem===t)return void(i[s].pos=e);i.push(new bi(t,e))},prepareFrame:function(t){this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}};var ki={1:"butt",2:"round",3:"square"},_i={1:"miter",2:"round",3:"bevel"};function Ti(t,e,i){this.caches=[],this.styles=[],this.transformers=t,this.lStr="",this.sh=i,this.lvl=e,this._isAnimated=!!i.k;for(var s=0,r=t.length;s<r;){if(t[s].mProps.dynamicProperties.length){this._isAnimated=!0;break}s+=1}}function xi(t,e){this.data=t,this.type=t.ty,this.d="",this.lvl=e,this._mdf=!1,this.closed=!0===t.hd,this.pElem=$("path"),this.msElem=null}function Ai(t,e,i,s){var r;this.elem=t,this.frameId=-1,this.dataProps=u(e.length),this.renderer=i,this.k=!1,this.dashStr="",this.dashArray=f("float32",e.length?e.length-1:0),this.dashoffset=f("float32",1),this.initDynamicPropertyContainer(s);var n,a=e.length||0;for(r=0;r<a;r+=1)n=Et.getProp(t,e[r].v,0,0,this),this.k=n.k||this.k,this.dataProps[r]={n:e[r].n,p:n};this.k||this.getValue(!0),this._isAnimated=this.k}function Si(t,e,i){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=Et.getProp(t,e.o,0,.01,this),this.w=Et.getProp(t,e.w,0,null,this),this.d=new Ai(t,e.d||{},"svg",this),this.c=Et.getProp(t,e.c,1,255,this),this.style=i,this._isAnimated=!!this._isAnimated}function Ei(t,e,i){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=Et.getProp(t,e.o,0,.01,this),this.c=Et.getProp(t,e.c,1,255,this),this.style=i}function Ci(t,e,i){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.style=i}function Pi(t,e,i){this.data=e,this.c=f("uint8c",4*e.p);var s=e.k.k[0].s?e.k.k[0].s.length-4*e.p:e.k.k.length-4*e.p;this.o=f("float32",s),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=s,this.initDynamicPropertyContainer(i),this.prop=Et.getProp(t,e.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}function Di(t,e,i){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.initGradientData(t,e,i)}function Ii(t,e,i){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.w=Et.getProp(t,e.w,0,null,this),this.d=new Ai(t,e.d||{},"svg",this),this.initGradientData(t,e,i),this._isAnimated=!!this._isAnimated}function Mi(){this.it=[],this.prevViewData=[],this.gr=$("g")}function Li(t,e,i){this.transform={mProps:t,op:e,container:i},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}Ti.prototype.setAsAnimated=function(){this._isAnimated=!0},xi.prototype.reset=function(){this.d="",this._mdf=!1},Ai.prototype.getValue=function(t){if((this.elem.globalData.frameId!==this.frameId||t)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||t,this._mdf)){var e=0,i=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),e=0;e<i;e+=1)"o"!==this.dataProps[e].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[e].p.v:this.dashArray[e]=this.dataProps[e].p.v:this.dashoffset[0]=this.dataProps[e].p.v}},c([Ct],Ai),c([Ct],Si),c([Ct],Ei),c([Ct],Ci),Pi.prototype.comparePoints=function(t,e){for(var i=0,s=this.o.length/2;i<s;){if(Math.abs(t[4*i]-t[4*e+2*i])>.01)return!1;i+=1}return!0},Pi.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;t<e;){if(!this.comparePoints(this.data.k.k[t].s,this.data.p))return!1;t+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},Pi.prototype.getValue=function(t){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||t){var e,i,s,r=4*this.data.p;for(e=0;e<r;e+=1)i=e%4==0?100:255,s=Math.round(this.prop.v[e]*i),this.c[e]!==s&&(this.c[e]=s,this._cmdf=!t);if(this.o.length)for(r=this.prop.v.length,e=4*this.data.p;e<r;e+=1)i=e%2==0?100:1,s=e%2==0?Math.round(100*this.prop.v[e]):this.prop.v[e],this.o[e-4*this.data.p]!==s&&(this.o[e-4*this.data.p]=s,this._omdf=!t);this._mdf=!t}},c([Ct],Pi),Di.prototype.initGradientData=function(t,e,i){this.o=Et.getProp(t,e.o,0,.01,this),this.s=Et.getProp(t,e.s,1,null,this),this.e=Et.getProp(t,e.e,1,null,this),this.h=Et.getProp(t,e.h||{k:0},0,.01,this),this.a=Et.getProp(t,e.a||{k:0},0,x,this),this.g=new Pi(t,e.g,this),this.style=i,this.stops=[],this.setGradientData(i.pElem,e),this.setGradientOpacity(e,i),this._isAnimated=!!this._isAnimated},Di.prototype.setGradientData=function(t,e){var i=L(),s=$(1===e.t?"linearGradient":"radialGradient");s.setAttribute("id",i),s.setAttribute("spreadMethod","pad"),s.setAttribute("gradientUnits","userSpaceOnUse");var r,n,a,o=[];for(a=4*e.g.p,n=0;n<a;n+=4)r=$("stop"),s.appendChild(r),o.push(r);t.setAttribute("gf"===e.ty?"fill":"stroke","url("+h()+"#"+i+")"),this.gf=s,this.cst=o},Di.prototype.setGradientOpacity=function(t,e){if(this.g._hasOpacity&&!this.g._collapsable){var i,s,r,n=$("mask"),a=$("path");n.appendChild(a);var o=L(),l=L();n.setAttribute("id",l);var c=$(1===t.t?"linearGradient":"radialGradient");c.setAttribute("id",o),c.setAttribute("spreadMethod","pad"),c.setAttribute("gradientUnits","userSpaceOnUse"),r=t.g.k.k[0].s?t.g.k.k[0].s.length:t.g.k.k.length;var p=this.stops;for(s=4*t.g.p;s<r;s+=2)(i=$("stop")).setAttribute("stop-color","rgb(255,255,255)"),c.appendChild(i),p.push(i);a.setAttribute("gf"===t.ty?"fill":"stroke","url("+h()+"#"+o+")"),"gs"===t.ty&&(a.setAttribute("stroke-linecap",ki[t.lc||2]),a.setAttribute("stroke-linejoin",_i[t.lj||2]),1===t.lj&&a.setAttribute("stroke-miterlimit",t.ml)),this.of=c,this.ms=n,this.ost=p,this.maskId=l,e.msElem=a}},c([Ct],Di),c([Di,Ct],Ii);var Fi=function(t,e,i,s){if(0===e)return"";var r,n=t.o,a=t.i,o=t.v,h=" M"+s.applyToPointStringified(o[0][0],o[0][1]);for(r=1;r<e;r+=1)h+=" C"+s.applyToPointStringified(n[r-1][0],n[r-1][1])+" "+s.applyToPointStringified(a[r][0],a[r][1])+" "+s.applyToPointStringified(o[r][0],o[r][1]);return i&&e&&(h+=" C"+s.applyToPointStringified(n[r-1][0],n[r-1][1])+" "+s.applyToPointStringified(a[0][0],a[0][1])+" "+s.applyToPointStringified(o[0][0],o[0][1]),h+="z"),h},Ri=function(){var t=new Rt,e=new Rt;function i(t){switch(t.ty){case"fl":return a;case"gf":return h;case"gs":return o;case"st":return l;case"sh":case"el":case"rc":case"sr":return n;case"tr":return s;case"no":return r;default:return null}}function s(t,e,i){(i||e.transform.op._mdf)&&e.transform.container.setAttribute("opacity",e.transform.op.v),(i||e.transform.mProps._mdf)&&e.transform.container.setAttribute("transform",e.transform.mProps.v.to2dCSS())}function r(){}function n(i,s,r){var n,a,o,h,l,c,p,d,f,u,m=s.styles.length,g=s.lvl;for(c=0;c<m;c+=1){if(h=s.sh._mdf||r,s.styles[c].lvl<g){for(d=e.reset(),f=g-s.styles[c].lvl,u=s.transformers.length-1;!h&&f>0;)h=s.transformers[u].mProps._mdf||h,f-=1,u-=1;if(h)for(f=g-s.styles[c].lvl,u=s.transformers.length-1;f>0;)d.multiply(s.transformers[u].mProps.v),f-=1,u-=1}else d=t;if(a=(p=s.sh.paths)._length,h){for(o="",n=0;n<a;n+=1)(l=p.shapes[n])&&l._length&&(o+=Fi(l,l._length,l.c,d));s.caches[c]=o}else o=s.caches[c];s.styles[c].d+=!0===i.hd?"":o,s.styles[c]._mdf=h||s.styles[c]._mdf}}function a(t,e,i){var s=e.style;(e.c._mdf||i)&&s.pElem.setAttribute("fill","rgb("+k(e.c.v[0])+","+k(e.c.v[1])+","+k(e.c.v[2])+")"),(e.o._mdf||i)&&s.pElem.setAttribute("fill-opacity",e.o.v)}function o(t,e,i){h(t,e,i),l(t,e,i)}function h(t,e,i){var s,r,n,a,o,h=e.gf,l=e.g._hasOpacity,c=e.s.v,p=e.e.v;if(e.o._mdf||i){var d="gf"===t.ty?"fill-opacity":"stroke-opacity";e.style.pElem.setAttribute(d,e.o.v)}if(e.s._mdf||i){var f=1===t.t?"x1":"cx",u="x1"===f?"y1":"cy";h.setAttribute(f,c[0]),h.setAttribute(u,c[1]),l&&!e.g._collapsable&&(e.of.setAttribute(f,c[0]),e.of.setAttribute(u,c[1]))}if(e.g._cmdf||i){s=e.cst;var m=e.g.c;for(n=s.length,r=0;r<n;r+=1)(a=s[r]).setAttribute("offset",m[4*r]+"%"),a.setAttribute("stop-color","rgb("+m[4*r+1]+","+m[4*r+2]+","+m[4*r+3]+")")}if(l&&(e.g._omdf||i)){var g=e.g.o;for(n=(s=e.g._collapsable?e.cst:e.ost).length,r=0;r<n;r+=1)a=s[r],e.g._collapsable||a.setAttribute("offset",g[2*r]+"%"),a.setAttribute("stop-opacity",g[2*r+1])}if(1===t.t)(e.e._mdf||i)&&(h.setAttribute("x2",p[0]),h.setAttribute("y2",p[1]),l&&!e.g._collapsable&&(e.of.setAttribute("x2",p[0]),e.of.setAttribute("y2",p[1])));else if((e.s._mdf||e.e._mdf||i)&&(o=Math.sqrt(Math.pow(c[0]-p[0],2)+Math.pow(c[1]-p[1],2)),h.setAttribute("r",o),l&&!e.g._collapsable&&e.of.setAttribute("r",o)),e.s._mdf||e.e._mdf||e.h._mdf||e.a._mdf||i){o||(o=Math.sqrt(Math.pow(c[0]-p[0],2)+Math.pow(c[1]-p[1],2)));var y=Math.atan2(p[1]-c[1],p[0]-c[0]),v=e.h.v;v>=1?v=.99:v<=-1&&(v=-.99);var b=o*v,w=Math.cos(y+e.a.v)*b+c[0],k=Math.sin(y+e.a.v)*b+c[1];h.setAttribute("fx",w),h.setAttribute("fy",k),l&&!e.g._collapsable&&(e.of.setAttribute("fx",w),e.of.setAttribute("fy",k))}}function l(t,e,i){var s=e.style,r=e.d;r&&(r._mdf||i)&&r.dashStr&&(s.pElem.setAttribute("stroke-dasharray",r.dashStr),s.pElem.setAttribute("stroke-dashoffset",r.dashoffset[0])),e.c&&(e.c._mdf||i)&&s.pElem.setAttribute("stroke","rgb("+k(e.c.v[0])+","+k(e.c.v[1])+","+k(e.c.v[2])+")"),(e.o._mdf||i)&&s.pElem.setAttribute("stroke-opacity",e.o.v),(e.w._mdf||i)&&(s.pElem.setAttribute("stroke-width",e.w.v),s.msElem&&s.msElem.setAttribute("stroke-width",e.w.v))}return{createRenderFunction:i}}();function Ni(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 Oi(t,e,i,s,r,n){this.o=t,this.sw=e,this.sc=i,this.fc=s,this.m=r,this.p=n,this._mdf={o:!0,sw:!!e,sc:!!i,fc:!!s,m:!0,p:!0}}function zi(t,e){this._frameId=s,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)}c([ei,oi,mi,wi,gi,ii,yi],Ni),Ni.prototype.initSecondaryElement=function(){},Ni.prototype.identityMatrix=new Rt,Ni.prototype.buildExpressionInterface=function(){},Ni.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},Ni.prototype.filterUniqueShapes=function(){var t,e,i,s,r=this.shapes.length,n=this.stylesList.length,a=[],o=!1;for(i=0;i<n;i+=1){for(s=this.stylesList[i],o=!1,a.length=0,t=0;t<r;t+=1)-1!==(e=this.shapes[t]).styles.indexOf(s)&&(a.push(e),o=e._isAnimated||o);a.length>1&&o&&this.setShapesAsAnimated(a)}},Ni.prototype.setShapesAsAnimated=function(t){var e,i=t.length;for(e=0;e<i;e+=1)t[e].setAsAnimated()},Ni.prototype.createStyleElement=function(t,e){var i,s=new xi(t,e),r=s.pElem;return"st"===t.ty?i=new Si(this,t,s):"fl"===t.ty?i=new Ei(this,t,s):"gf"===t.ty||"gs"===t.ty?(i=new("gf"===t.ty?Di:Ii)(this,t,s),this.globalData.defs.appendChild(i.gf),i.maskId&&(this.globalData.defs.appendChild(i.ms),this.globalData.defs.appendChild(i.of),r.setAttribute("mask","url("+h()+"#"+i.maskId+")"))):"no"===t.ty&&(i=new Ci(this,t,s)),"st"!==t.ty&&"gs"!==t.ty||(r.setAttribute("stroke-linecap",ki[t.lc||2]),r.setAttribute("stroke-linejoin",_i[t.lj||2]),r.setAttribute("fill-opacity","0"),1===t.lj&&r.setAttribute("stroke-miterlimit",t.ml)),2===t.r&&r.setAttribute("fill-rule","evenodd"),t.ln&&r.setAttribute("id",t.ln),t.cl&&r.setAttribute("class",t.cl),t.bm&&(r.style["mix-blend-mode"]=qe(t.bm)),this.stylesList.push(s),this.addToAnimatedContents(t,i),i},Ni.prototype.createGroupElement=function(t){var e=new Mi;return t.ln&&e.gr.setAttribute("id",t.ln),t.cl&&e.gr.setAttribute("class",t.cl),t.bm&&(e.gr.style["mix-blend-mode"]=qe(t.bm)),e},Ni.prototype.createTransformElement=function(t,e){var i=re.getTransformProperty(this,t,this),s=new Li(i,i.o,e);return this.addToAnimatedContents(t,s),s},Ni.prototype.createShapeElement=function(t,e,i){var s=4;"rc"===t.ty?s=5:"el"===t.ty?s=6:"sr"===t.ty&&(s=7);var r=new Ti(e,i,Ft.getShapeProp(this,t,s,this));return this.shapes.push(r),this.addShapeToModifiers(r),this.addToAnimatedContents(t,r),r},Ni.prototype.addToAnimatedContents=function(t,e){for(var i=0,s=this.animatedContents.length;i<s;){if(this.animatedContents[i].element===e)return;i+=1}this.animatedContents.push({fn:Ri.createRenderFunction(t),element:e,data:t})},Ni.prototype.setElementStyles=function(t){var e,i=t.styles,s=this.stylesList.length;for(e=0;e<s;e+=1)-1!==i.indexOf(this.stylesList[e])||this.stylesList[e].closed||i.push(this.stylesList[e])},Ni.prototype.reloadShapes=function(){var t;this._isFirstFrame=!0;var e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers()},Ni.prototype.searchShapes=function(t,e,i,s,r,n,a){var o,h,l,c,p,d,f=[].concat(n),u=t.length-1,m=[],g=[];for(o=u;o>=0;o-=1){if((d=this.searchProcessedElement(t[o]))?e[o]=i[d-1]:t[o]._render=a,"fl"===t[o].ty||"st"===t[o].ty||"gf"===t[o].ty||"gs"===t[o].ty||"no"===t[o].ty)d?e[o].style.closed=t[o].hd:e[o]=this.createStyleElement(t[o],r),t[o]._render&&e[o].style.pElem.parentNode!==s&&s.appendChild(e[o].style.pElem),m.push(e[o].style);else if("gr"===t[o].ty){if(d)for(l=e[o].it.length,h=0;h<l;h+=1)e[o].prevViewData[h]=e[o].it[h];else e[o]=this.createGroupElement(t[o]);this.searchShapes(t[o].it,e[o].it,e[o].prevViewData,e[o].gr,r+1,f,a),t[o]._render&&e[o].gr.parentNode!==s&&s.appendChild(e[o].gr)}else"tr"===t[o].ty?(d||(e[o]=this.createTransformElement(t[o],s)),c=e[o].transform,f.push(c)):"sh"===t[o].ty||"rc"===t[o].ty||"el"===t[o].ty||"sr"===t[o].ty?(d||(e[o]=this.createShapeElement(t[o],f,r)),this.setElementStyles(e[o])):"tm"===t[o].ty||"rd"===t[o].ty||"ms"===t[o].ty||"pb"===t[o].ty||"zz"===t[o].ty||"op"===t[o].ty?(d?(p=e[o]).closed=!1:((p=te.getModifier(t[o].ty)).init(this,t[o]),e[o]=p,this.shapeModifiers.push(p)),g.push(p)):"rp"===t[o].ty&&(d?(p=e[o]).closed=!0:(p=te.getModifier(t[o].ty),e[o]=p,p.init(this,t,o,e),this.shapeModifiers.push(p),a=!1),g.push(p));this.addProcessedElement(t[o],o+1)}for(u=m.length,o=0;o<u;o+=1)m[o].closed=!0;for(u=g.length,o=0;o<u;o+=1)g[o].closed=!0},Ni.prototype.renderInnerContent=function(){var t;this.renderModifiers();var e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].reset();for(this.renderShape(),t=0;t<e;t+=1)(this.stylesList[t]._mdf||this._isFirstFrame)&&(this.stylesList[t].msElem&&(this.stylesList[t].msElem.setAttribute("d",this.stylesList[t].d),this.stylesList[t].d="M0 0"+this.stylesList[t].d),this.stylesList[t].pElem.setAttribute("d",this.stylesList[t].d||"M0 0"))},Ni.prototype.renderShape=function(){var t,e,i=this.animatedContents.length;for(t=0;t<i;t+=1)e=this.animatedContents[t],(this._isFirstFrame||e.element._isAnimated)&&!0!==e.data&&e.fn(e.data,e.element,this._isFirstFrame)},Ni.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null},Oi.prototype.update=function(t,e,i,s,r,n){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1,this._mdf.p=!1;var a=!1;return this.o!==t&&(this.o=t,this._mdf.o=!0,a=!0),this.sw!==e&&(this.sw=e,this._mdf.sw=!0,a=!0),this.sc!==i&&(this.sc=i,this._mdf.sc=!0,a=!0),this.fc!==s&&(this.fc=s,this._mdf.fc=!0,a=!0),this.m!==r&&(this.m=r,this._mdf.m=!0,a=!0),!n.length||this.p[0]===n[0]&&this.p[1]===n[1]&&this.p[4]===n[4]&&this.p[5]===n[5]&&this.p[12]===n[12]&&this.p[13]===n[13]||(this.p=n,this._mdf.p=!0,a=!0),a},zi.prototype.defaultBoxWidth=[0,0],zi.prototype.copyData=function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},zi.prototype.setCurrentData=function(t){t.__complete||this.completeTextData(t),this.currentData=t,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},zi.prototype.searchProperty=function(){return this.searchKeyframes()},zi.prototype.searchKeyframes=function(){return this.kf=this.data.d.k.length>1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},zi.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},zi.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 s;this.lock=!0,this._mdf=!1;var r=this.effectsSequence.length,n=t||this.data.d.k[this.keysIndex].s;for(s=0;s<r;s+=1)n=i!==this.keysIndex?this.effectsSequence[s](n,n.t):this.effectsSequence[s](this.currentData,n.t);e!==n&&this.setCurrentData(n),this.v=this.currentData,this.pv=this.v,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},zi.prototype.getKeyframeValue=function(){for(var t=this.data.d.k,e=this.elem.comp.renderedFrame,i=0,s=t.length;i<=s-1&&!(i===s-1||t[i+1].t>e);)i+=1;return this.keysIndex!==i&&(this.keysIndex=i),this.data.d.k[this.keysIndex].s},zi.prototype.buildFinalText=function(t){for(var e,i,s=[],r=0,n=t.length,a=!1,o=!1,h="";r<n;)a=o,o=!1,e=t.charCodeAt(r),h=t.charAt(r),We.isCombinedCharacter(e)?a=!0:e>=55296&&e<=56319?We.isRegionalFlag(t,r)?h=t.substr(r,14):(i=t.charCodeAt(r+1))>=56320&&i<=57343&&(We.isModifier(e,i)?(h=t.substr(r,2),a=!0):h=We.isFlagEmoji(t.substr(r,4))?t.substr(r,4):t.substr(r,2)):e>56319?(i=t.charCodeAt(r+1),We.isVariationSelector(e)&&(a=!0)):We.isZeroWidthJoiner(e)&&(a=!0,o=!0),a?(s[s.length-1]+=h,a=!1):s.push(h),r+=h.length;return s},zi.prototype.completeTextData=function(t){t.__complete=!0;var e,i,s,r,n,a,o,h=this.elem.globalData.fontManager,l=this.data,c=[],p=0,d=l.m.g,f=0,u=0,m=0,g=[],y=0,v=0,b=h.getFontByName(t.f),w=0,k=Ue(b);t.fWeight=k.weight,t.fStyle=k.style,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),i=t.finalText.length,t.finalLineHeight=t.lh;var _,T=t.tr/1e3*t.finalSize;if(t.sz)for(var x,A,S=!0,E=t.sz[0],C=t.sz[1];S;){x=0,y=0,i=(A=this.buildFinalText(t.t)).length,T=t.tr/1e3*t.finalSize;var P=-1;for(e=0;e<i;e+=1)_=A[e].charCodeAt(0),s=!1," "===A[e]?P=e:13!==_&&3!==_||(y=0,s=!0,x+=t.finalLineHeight||1.2*t.finalSize),h.chars?(o=h.getCharData(A[e],b.fStyle,b.fFamily),w=s?0:o.w*t.finalSize/100):w=h.measureText(A[e],t.f,t.finalSize),y+w>E&&" "!==A[e]?(-1===P?i+=1:e=P,x+=t.finalLineHeight||1.2*t.finalSize,A.splice(e,P===e?1:0,"\r"),P=-1,y=0):(y+=w,y+=T);x+=b.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&C<x?(t.finalSize-=1,t.finalLineHeight=t.finalSize*t.lh/t.s):(t.finalText=A,i=t.finalText.length,S=!1)}y=-T,w=0;var D,I=0;for(e=0;e<i;e+=1)if(s=!1,13===(_=(D=t.finalText[e]).charCodeAt(0))||3===_?(I=0,g.push(y),v=y>v?y:v,y=-2*T,r="",s=!0,m+=1):r=D,h.chars?(o=h.getCharData(D,b.fStyle,h.getFontByName(t.f).fFamily),w=s?0:o.w*t.finalSize/100):w=h.measureText(r,t.f,t.finalSize)," "===D?I+=w+T:(y+=w+T+I,I=0),c.push({l:w,an:w,add:f,n:s,anIndexes:[],val:r,line:m,animatorJustifyOffset:0}),2==d){if(f+=w,""===r||" "===r||e===i-1){for(""!==r&&" "!==r||(f-=w);u<=e;)c[u].an=f,c[u].ind=p,c[u].extra=w,u+=1;p+=1,f=0}}else if(3==d){if(f+=w,""===r||e===i-1){for(""===r&&(f-=w);u<=e;)c[u].an=f,c[u].ind=p,c[u].extra=w,u+=1;f=0,p+=1}}else c[p].ind=p,c[p].extra=0,p+=1;if(t.l=c,v=y>v?y:v,g.push(y),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=g;var M,L,F,R,N=l.a;a=N.length;var O=[];for(n=0;n<a;n+=1){for((M=N[n]).a.sc&&(t.strokeColorAnim=!0),M.a.sw&&(t.strokeWidthAnim=!0),(M.a.fc||M.a.fh||M.a.fs||M.a.fb)&&(t.fillColorAnim=!0),R=0,F=M.s.b,e=0;e<i;e+=1)(L=c[e]).anIndexes[n]=R,(1==F&&""!==L.val||2==F&&""!==L.val&&" "!==L.val||3==F&&(L.n||" "==L.val||e==i-1)||4==F&&(L.n||e==i-1))&&(1===M.s.rn&&O.push(R),R+=1);l.a[n].s.totalChars=R;var z,U=-1;if(1===M.s.rn)for(e=0;e<i;e+=1)U!=(L=c[e]).anIndexes[n]&&(U=L.anIndexes[n],z=O.splice(Math.floor(Math.random()*O.length),1)[0]),L.anIndexes[n]=z}t.yOffset=t.finalLineHeight||1.2*t.finalSize,t.ls=t.ls||0,t.ascent=b.ascent*t.finalSize/100},zi.prototype.updateDocumentData=function(t,e){e=void 0===e?this.keysIndex:e;var i=this.copyData({},this.data.d.k[e].s);i=this.copyData(i,t),this.data.d.k[e].s=i,this.recalculate(e),this.setCurrentData(i),this.elem.addDynamicProperty(this)},zi.prototype.recalculate=function(t){var e=this.data.d.k[t].s;e.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(e)},zi.prototype.canResizeFont=function(t){this.canResize=t,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},zi.prototype.setMinimumFontSize=function(t){this.minimumFontSize=Math.floor(t)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var Ui=function(){var t=Math.max,e=Math.min,i=Math.floor;function s(t,e){this._currentTextLength=-1,this.k=!1,this.data=e,this.elem=t,this.comp=t.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(t),this.s=Et.getProp(t,e.s||{k:0},0,0,this),this.e="e"in e?Et.getProp(t,e.e,0,0,this):{v:100},this.o=Et.getProp(t,e.o||{k:0},0,0,this),this.xe=Et.getProp(t,e.xe||{k:0},0,0,this),this.ne=Et.getProp(t,e.ne||{k:0},0,0,this),this.sm=Et.getProp(t,e.sm||{k:100},0,0,this),this.a=Et.getProp(t,e.a,0,.01,this),this.dynamicProperties.length||this.getValue()}function r(t,e,i){return new s(t,e)}return s.prototype={getMult:function(s){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var r=0,n=0,a=1,o=1;this.ne.v>0?r=this.ne.v/100:n=-this.ne.v/100,this.xe.v>0?a=1-this.xe.v/100:o=1+this.xe.v/100;var h=at.getBezierEasing(r,n,a,o).get,l=0,c=this.finalS,p=this.finalE,d=this.data.sh;if(2===d)l=h(l=p===c?s>=p?1:0:t(0,e(.5/(p-c)+(s-c)/(p-c),1)));else if(3===d)l=h(l=p===c?s>=p?0:1:1-t(0,e(.5/(p-c)+(s-c)/(p-c),1)));else if(4===d)p===c?l=0:(l=t(0,e(.5/(p-c)+(s-c)/(p-c),1)))<.5?l*=2:l=1-2*(l-.5),l=h(l);else if(5===d){if(p===c)l=0;else{var f=p-c,u=-f/2+(s=e(t(0,s+.5-c),p-c)),m=f/2;l=Math.sqrt(1-u*u/(m*m))}l=h(l)}else 6===d?(p===c?l=0:(s=e(t(0,s+.5-c),p-c),l=(1+Math.cos(Math.PI+2*Math.PI*s/(p-c)))/2),l=h(l)):(s>=i(c)&&(l=t(0,e(s-c<0?e(p,1)-(c-s):p-s,1))),l=h(l));if(100!==this.sm.v){var g=.01*this.sm.v;0===g&&(g=1e-8);var y=.5-.5*g;l<y?l=0:(l=(l-y)/g)>1&&(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,s=this.s.v/e+i,r=this.e.v/e+i;if(s>r){var n=s;s=r,r=n}this.finalS=s,this.finalE=r}},c([Ct],s),{getTextSelectorProp:r}}();function Wi(t,e,i){var s={propType:!1},r=Et.getProp,n=e.a;this.a={r:n.r?r(t,n.r,0,x,i):s,rx:n.rx?r(t,n.rx,0,x,i):s,ry:n.ry?r(t,n.ry,0,x,i):s,sk:n.sk?r(t,n.sk,0,x,i):s,sa:n.sa?r(t,n.sa,0,x,i):s,s:n.s?r(t,n.s,1,.01,i):s,a:n.a?r(t,n.a,1,0,i):s,o:n.o?r(t,n.o,0,.01,i):s,p:n.p?r(t,n.p,1,0,i):s,sw:n.sw?r(t,n.sw,0,0,i):s,sc:n.sc?r(t,n.sc,1,0,i):s,fc:n.fc?r(t,n.fc,1,0,i):s,fh:n.fh?r(t,n.fh,0,0,i):s,fs:n.fs?r(t,n.fs,0,.01,i):s,fb:n.fb?r(t,n.fb,0,.01,i):s,t:n.t?r(t,n.t,0,0,i):s},this.s=Ui.getTextSelectorProp(t,e.s,i),this.s.t=e.s.t}function ji(t,e,i){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=i,this._animatorsData=u(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(i)}function Vi(){}ji.prototype.searchProperties=function(){var t,e,i=this._textData.a.length,s=Et.getProp;for(t=0;t<i;t+=1)e=this._textData.a[t],this._animatorsData[t]=new Wi(this._elem,e,this);this._textData.p&&"m"in this._textData.p?(this._pathData={a:s(this._elem,this._textData.p.a,0,0,this),f:s(this._elem,this._textData.p.f,0,0,this),l:s(this._elem,this._textData.p.l,0,0,this),r:s(this._elem,this._textData.p.r,0,0,this),p:s(this._elem,this._textData.p.p,0,0,this),m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=s(this._elem,this._textData.m.a,1,0,this)},ji.prototype.getMeasures=function(t,e){if(this.lettersChangedFlag=e,this._mdf||this._isFirstFrame||e||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var i,s,r,n,a,o,h,l,c,p,d,f,u,m,g,y,v,b,w,k=this._moreOptions.alignment.v,_=this._animatorsData,T=this._textData,x=this.mHelper,A=this._renderType,S=this.renderedLetters.length,E=t.l;if(this._hasMaskedPath){if(w=this._pathData.m,!this._pathData.n||this._pathData._mdf){var C,P=w.v;for(this._pathData.r.v&&(P=P.reverse()),a={tLength:0,segments:[]},n=P._length-1,y=0,r=0;r<n;r+=1)C=dt.buildBezierData(P.v[r],P.v[r+1],[P.o[r][0]-P.v[r][0],P.o[r][1]-P.v[r][1]],[P.i[r+1][0]-P.v[r+1][0],P.i[r+1][1]-P.v[r+1][1]]),a.tLength+=C.segmentLength,a.segments.push(C),y+=C.segmentLength;r=n,w.v.c&&(C=dt.buildBezierData(P.v[r],P.v[0],[P.o[r][0]-P.v[r][0],P.o[r][1]-P.v[r][1]],[P.i[0][0]-P.v[0][0],P.i[0][1]-P.v[0][1]]),a.tLength+=C.segmentLength,a.segments.push(C),y+=C.segmentLength),this._pathData.pi=a}if(a=this._pathData.pi,o=this._pathData.f.v,d=0,p=1,l=0,c=!0,m=a.segments,o<0&&w.v.c)for(a.tLength<Math.abs(o)&&(o=-Math.abs(o)%a.tLength),p=(u=m[d=m.length-1].points).length-1;o<0;)o+=u[p].partialLength,(p-=1)<0&&(p=(u=m[d-=1].points).length-1);f=(u=m[d].points)[p-1],g=(h=u[p]).partialLength}n=E.length,i=0,s=0;var D,I,M,L,F,R=1.2*t.finalSize*.714,U=!0;M=_.length;var W,j,V,B,q,H,$,G,Y,X,K,J,Z=-1,Q=o,tt=d,et=p,it=-1,st="",rt=this.defaultPropsArray;if(2===t.j||1===t.j){var nt=0,at=0,ot=2===t.j?-.5:-1,ht=0,lt=!0;for(r=0;r<n;r+=1)if(E[r].n){for(nt&&(nt+=at);ht<r;)E[ht].animatorJustifyOffset=nt,ht+=1;nt=0,lt=!0}else{for(I=0;I<M;I+=1)(D=_[I].a).t.propType&&(lt&&2===t.j&&(at+=D.t.v*ot),(F=_[I].s.getMult(E[r].anIndexes[I],T.a[I].s.totalChars)).length?nt+=D.t.v*F[0]*ot:nt+=D.t.v*F*ot);lt=!1}for(nt&&(nt+=at);ht<r;)E[ht].animatorJustifyOffset=nt,ht+=1}for(r=0;r<n;r+=1){if(x.reset(),B=1,E[r].n)i=0,s+=t.yOffset,s+=U?1:0,o=Q,U=!1,this._hasMaskedPath&&(p=et,f=(u=m[d=tt].points)[p-1],g=(h=u[p]).partialLength,l=0),st="",K="",Y="",J="",rt=this.defaultPropsArray;else{if(this._hasMaskedPath){if(it!==E[r].line){switch(t.j){case 1:o+=y-t.lineWidths[E[r].line];break;case 2:o+=(y-t.lineWidths[E[r].line])/2}it=E[r].line}Z!==E[r].ind&&(E[Z]&&(o+=E[Z].extra),o+=E[r].an/2,Z=E[r].ind),o+=k[0]*E[r].an*.005;var ct=0;for(I=0;I<M;I+=1)(D=_[I].a).p.propType&&((F=_[I].s.getMult(E[r].anIndexes[I],T.a[I].s.totalChars)).length?ct+=D.p.v[0]*F[0]:ct+=D.p.v[0]*F),D.a.propType&&((F=_[I].s.getMult(E[r].anIndexes[I],T.a[I].s.totalChars)).length?ct+=D.a.v[0]*F[0]:ct+=D.a.v[0]*F);for(c=!0,this._pathData.a.v&&(o=.5*E[0].an+(y-this._pathData.f.v-.5*E[0].an-.5*E[E.length-1].an)*Z/(n-1),o+=this._pathData.f.v);c;)l+g>=o+ct||!u?(v=(o+ct-l)/h.partialLength,j=f.point[0]+(h.point[0]-f.point[0])*v,V=f.point[1]+(h.point[1]-f.point[1])*v,x.translate(-k[0]*E[r].an*.005,-k[1]*R*.01),c=!1):u&&(l+=h.partialLength,(p+=1)>=u.length&&(p=0,m[d+=1]?u=m[d].points:w.v.c?(p=0,u=m[d=0].points):(l-=h.partialLength,u=null)),u&&(f=h,g=(h=u[p]).partialLength));W=E[r].an/2-E[r].add,x.translate(-W,0,0)}else W=E[r].an/2-E[r].add,x.translate(-W,0,0),x.translate(-k[0]*E[r].an*.005,-k[1]*R*.01,0);for(I=0;I<M;I+=1)(D=_[I].a).t.propType&&(F=_[I].s.getMult(E[r].anIndexes[I],T.a[I].s.totalChars),0===i&&0===t.j||(this._hasMaskedPath?F.length?o+=D.t.v*F[0]:o+=D.t.v*F:F.length?i+=D.t.v*F[0]:i+=D.t.v*F));for(t.strokeWidthAnim&&(H=t.sw||0),t.strokeColorAnim&&(q=t.sc?[t.sc[0],t.sc[1],t.sc[2]]:[0,0,0]),t.fillColorAnim&&t.fc&&($=[t.fc[0],t.fc[1],t.fc[2]]),I=0;I<M;I+=1)(D=_[I].a).a.propType&&((F=_[I].s.getMult(E[r].anIndexes[I],T.a[I].s.totalChars)).length?x.translate(-D.a.v[0]*F[0],-D.a.v[1]*F[1],D.a.v[2]*F[2]):x.translate(-D.a.v[0]*F,-D.a.v[1]*F,D.a.v[2]*F));for(I=0;I<M;I+=1)(D=_[I].a).s.propType&&((F=_[I].s.getMult(E[r].anIndexes[I],T.a[I].s.totalChars)).length?x.scale(1+(D.s.v[0]-1)*F[0],1+(D.s.v[1]-1)*F[1],1):x.scale(1+(D.s.v[0]-1)*F,1+(D.s.v[1]-1)*F,1));for(I=0;I<M;I+=1){if(D=_[I].a,F=_[I].s.getMult(E[r].anIndexes[I],T.a[I].s.totalChars),D.sk.propType&&(F.length?x.skewFromAxis(-D.sk.v*F[0],D.sa.v*F[1]):x.skewFromAxis(-D.sk.v*F,D.sa.v*F)),D.r.propType&&(F.length?x.rotateZ(-D.r.v*F[2]):x.rotateZ(-D.r.v*F)),D.ry.propType&&(F.length?x.rotateY(D.ry.v*F[1]):x.rotateY(D.ry.v*F)),D.rx.propType&&(F.length?x.rotateX(D.rx.v*F[0]):x.rotateX(D.rx.v*F)),D.o.propType&&(F.length?B+=(D.o.v*F[0]-B)*F[0]:B+=(D.o.v*F-B)*F),t.strokeWidthAnim&&D.sw.propType&&(F.length?H+=D.sw.v*F[0]:H+=D.sw.v*F),t.strokeColorAnim&&D.sc.propType)for(G=0;G<3;G+=1)F.length?q[G]+=(D.sc.v[G]-q[G])*F[0]:q[G]+=(D.sc.v[G]-q[G])*F;if(t.fillColorAnim&&t.fc){if(D.fc.propType)for(G=0;G<3;G+=1)F.length?$[G]+=(D.fc.v[G]-$[G])*F[0]:$[G]+=(D.fc.v[G]-$[G])*F;D.fh.propType&&($=F.length?z($,D.fh.v*F[0]):z($,D.fh.v*F)),D.fs.propType&&($=F.length?N($,D.fs.v*F[0]):N($,D.fs.v*F)),D.fb.propType&&($=F.length?O($,D.fb.v*F[0]):O($,D.fb.v*F))}}for(I=0;I<M;I+=1)(D=_[I].a).p.propType&&(F=_[I].s.getMult(E[r].anIndexes[I],T.a[I].s.totalChars),this._hasMaskedPath?F.length?x.translate(0,D.p.v[1]*F[0],-D.p.v[2]*F[1]):x.translate(0,D.p.v[1]*F,-D.p.v[2]*F):F.length?x.translate(D.p.v[0]*F[0],D.p.v[1]*F[1],-D.p.v[2]*F[2]):x.translate(D.p.v[0]*F,D.p.v[1]*F,-D.p.v[2]*F));if(t.strokeWidthAnim&&(Y=H<0?0:H),t.strokeColorAnim&&(X="rgb("+Math.round(255*q[0])+","+Math.round(255*q[1])+","+Math.round(255*q[2])+")"),t.fillColorAnim&&t.fc&&(K="rgb("+Math.round(255*$[0])+","+Math.round(255*$[1])+","+Math.round(255*$[2])+")"),this._hasMaskedPath){if(x.translate(0,-t.ls),x.translate(0,k[1]*R*.01+s,0),this._pathData.p.v){b=(h.point[1]-f.point[1])/(h.point[0]-f.point[0]);var pt=180*Math.atan(b)/Math.PI;h.point[0]<f.point[0]&&(pt+=180),x.rotate(-pt*Math.PI/180)}x.translate(j,V,0),o-=k[0]*E[r].an*.005,E[r+1]&&Z!==E[r+1].ind&&(o+=E[r].an/2,o+=.001*t.tr*t.finalSize)}else{switch(x.translate(i,s,0),t.ps&&x.translate(t.ps[0],t.ps[1]+t.ascent,0),t.j){case 1:x.translate(E[r].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[E[r].line]),0,0);break;case 2:x.translate(E[r].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[E[r].line])/2,0,0)}x.translate(0,-t.ls),x.translate(W,0,0),x.translate(k[0]*E[r].an*.005,k[1]*R*.01,0),i+=E[r].l+.001*t.tr*t.finalSize}"html"===A?st=x.toCSS():"svg"===A?st=x.to2dCSS():rt=[x.props[0],x.props[1],x.props[2],x.props[3],x.props[4],x.props[5],x.props[6],x.props[7],x.props[8],x.props[9],x.props[10],x.props[11],x.props[12],x.props[13],x.props[14],x.props[15]],J=B}S<=r?(L=new Oi(J,Y,X,K,st,rt),this.renderedLetters.push(L),S+=1,this.lettersChangedFlag=!0):(L=this.renderedLetters[r],this.lettersChangedFlag=L.update(J,Y,X,K,st,rt)||this.lettersChangedFlag)}}},ji.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},ji.prototype.mHelper=new Rt,ji.prototype.defaultPropsArray=[],c([Ct],ji),Vi.prototype.initElement=function(t,e,i){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(t,e,i),this.textProperty=new zi(this,t.t,this.dynamicProperties),this.textAnimator=new ji(t.t,this.renderType,this),this.initTransform(t,e,i),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},Vi.prototype.prepareFrame=function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)},Vi.prototype.createPathShape=function(t,e){var i,s,r=e.length,n="";for(i=0;i<r;i+=1)"sh"===e[i].ty&&(s=e[i].ks.k,n+=Fi(s,s.i.length,!0,t));return n},Vi.prototype.updateDocumentData=function(t,e){this.textProperty.updateDocumentData(t,e)},Vi.prototype.canResizeFont=function(t){this.textProperty.canResizeFont(t)},Vi.prototype.setMinimumFontSize=function(t){this.textProperty.setMinimumFontSize(t)},Vi.prototype.applyTextPropertiesToMatrix=function(t,e,i,s,r){switch(t.ps&&e.translate(t.ps[0],t.ps[1]+t.ascent,0),e.translate(0,-t.ls,0),t.j){case 1:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[i]),0,0);break;case 2:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[i])/2,0,0)}e.translate(s,r,0)},Vi.prototype.buildColor=function(t){return"rgb("+Math.round(255*t[0])+","+Math.round(255*t[1])+","+Math.round(255*t[2])+")"},Vi.prototype.emptyProp=new Oi,Vi.prototype.destroy=function(){},Vi.prototype.validateText=function(){(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)};var Bi={shapes:[]};function qi(t,e,i){this.textSpans=[],this.renderType="svg",this.initElement(t,e,i)}function Hi(t,e,i){this.initElement(t,e,i)}function $i(t,e,i){this.initFrame(),this.initBaseData(t,e,i),this.initFrame(),this.initTransform(t,e,i),this.initHierarchy()}function Gi(){}function Yi(){}function Xi(t,e,i){this.layers=t.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?u(this.layers.length):[],this.initElement(t,e,i),this.tm=t.tm?Et.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function Ki(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.svgElement=$("svg");var i="";if(e&&e.title){var s=$("title"),r=L();s.setAttribute("id",r),s.textContent=e.title,this.svgElement.appendChild(s),i+=r}if(e&&e.description){var n=$("desc"),a=L();n.setAttribute("id",a),n.textContent=e.description,this.svgElement.appendChild(n),i+=" "+a}i&&this.svgElement.setAttribute("aria-labelledby",i);var o=$("defs");this.svgElement.appendChild(o);var h=$("g");this.svgElement.appendChild(h),this.layerElement=h,this.renderConfig={preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:e&&e.contentVisibility||"visible",progressiveLoad:e&&e.progressiveLoad||!1,hideOnTransparent:!(e&&!1===e.hideOnTransparent),viewBoxOnly:e&&e.viewBoxOnly||!1,viewBoxSize:e&&e.viewBoxSize||!1,className:e&&e.className||"",id:e&&e.id||"",focusable:e&&e.focusable,filterSize:{width:e&&e.filterSize&&e.filterSize.width||"100%",height:e&&e.filterSize&&e.filterSize.height||"100%",x:e&&e.filterSize&&e.filterSize.x||"0%",y:e&&e.filterSize&&e.filterSize.y||"0%"},width:e&&e.width,height:e&&e.height,runExpressions:!e||void 0===e.runExpressions||e.runExpressions},this.globalData={_mdf:!1,frameNum:-1,defs:o,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}return c([ei,oi,mi,gi,ii,yi,Vi],qi),qi.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=$("text"))},qi.prototype.buildTextContents=function(t){for(var e=0,i=t.length,s=[],r="";e<i;)t[e]===String.fromCharCode(13)||t[e]===String.fromCharCode(3)?(s.push(r),r=""):r+=t[e],e+=1;return s.push(r),s},qi.prototype.buildShapeData=function(t,e){if(t.shapes&&t.shapes.length){var i=t.shapes[0];if(i.it){var s=i.it[i.it.length-1];s.s&&(s.s.k[0]=e,s.s.k[1]=e)}}return t},qi.prototype.buildNewText=function(){var t,e;this.addDynamicProperty(this);var i=this.textProperty.currentData;this.renderedLetters=u(i?i.l.length:0),i.fc?this.layerElement.setAttribute("fill",this.buildColor(i.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),i.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(i.sc)),this.layerElement.setAttribute("stroke-width",i.sw)),this.layerElement.setAttribute("font-size",i.finalSize);var s=this.globalData.fontManager.getFontByName(i.f);if(s.fClass)this.layerElement.setAttribute("class",s.fClass);else{this.layerElement.setAttribute("font-family",s.fFamily);var r=i.fWeight,n=i.fStyle;this.layerElement.setAttribute("font-style",n),this.layerElement.setAttribute("font-weight",r)}this.layerElement.setAttribute("aria-label",i.t);var a,o=i.l||[],h=!!this.globalData.fontManager.chars;e=o.length;var l=this.mHelper,c="",p=this.data.singleShape,d=0,f=0,m=!0,g=.001*i.tr*i.finalSize;if(!p||h||i.sz){var y,v=this.textSpans.length;for(t=0;t<e;t+=1){if(this.textSpans[t]||(this.textSpans[t]={span:null,childSpan:null,glyph:null}),!h||!p||0===t){if(a=v>t?this.textSpans[t].span:$(h?"g":"text"),v<=t){if(a.setAttribute("stroke-linecap","butt"),a.setAttribute("stroke-linejoin","round"),a.setAttribute("stroke-miterlimit","4"),this.textSpans[t].span=a,h){var b=$("g");a.appendChild(b),this.textSpans[t].childSpan=b}this.textSpans[t].span=a,this.layerElement.appendChild(a)}a.style.display="inherit"}if(l.reset(),p&&(o[t].n&&(d=-g,f+=i.yOffset,f+=m?1:0,m=!1),this.applyTextPropertiesToMatrix(i,l,o[t].line,d,f),d+=o[t].l||0,d+=g),h){var w;if(1===(y=this.globalData.fontManager.getCharData(i.finalText[t],s.fStyle,this.globalData.fontManager.getFontByName(i.f).fFamily)).t)w=new Xi(y.data,this.globalData,this);else{var k=Bi;y.data&&y.data.shapes&&(k=this.buildShapeData(y.data,i.finalSize)),w=new Ni(k,this.globalData,this)}if(this.textSpans[t].glyph){var _=this.textSpans[t].glyph;this.textSpans[t].childSpan.removeChild(_.layerElement),_.destroy()}this.textSpans[t].glyph=w,w._debug=!0,w.prepareFrame(0),w.renderFrame(),this.textSpans[t].childSpan.appendChild(w.layerElement),1===y.t&&this.textSpans[t].childSpan.setAttribute("transform","scale("+i.finalSize/100+","+i.finalSize/100+")")}else p&&a.setAttribute("transform","translate("+l.props[12]+","+l.props[13]+")"),a.textContent=o[t].val,a.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve")}p&&a&&a.setAttribute("d",c)}else{var T=this.textContainer,x="start";switch(i.j){case 1:x="end";break;case 2:x="middle";break;default:x="start"}T.setAttribute("text-anchor",x),T.setAttribute("letter-spacing",g);var A=this.buildTextContents(i.finalText);for(e=A.length,f=i.ps?i.ps[1]+i.ascent:0,t=0;t<e;t+=1)(a=this.textSpans[t].span||$("tspan")).textContent=A[t],a.setAttribute("x",0),a.setAttribute("y",f),a.style.display="inherit",T.appendChild(a),this.textSpans[t]||(this.textSpans[t]={span:null,glyph:null}),this.textSpans[t].span=a,f+=i.finalLineHeight;this.layerElement.appendChild(T)}for(;t<this.textSpans.length;)this.textSpans[t].span.style.display="none",t+=1;this._sizeChanged=!0},qi.prototype.sourceRectAtTime=function(){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var t=this.layerElement.getBBox();this.bbox={top:t.y,left:t.x,width:t.width,height:t.height}}return this.bbox},qi.prototype.getValue=function(){var t,e,i=this.textSpans.length;for(this.renderedFrame=this.comp.renderedFrame,t=0;t<i;t+=1)(e=this.textSpans[t].glyph)&&(e.prepareFrame(this.comp.renderedFrame-this.data.st),e._mdf&&(this._mdf=!0))},qi.prototype.renderInnerContent=function(){if(this.validateText(),(!this.data.singleShape||this._mdf)&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){var t,e;this._sizeChanged=!0;var i,s,r,n=this.textAnimator.renderedLetters,a=this.textProperty.currentData.l;for(e=a.length,t=0;t<e;t+=1)a[t].n||(i=n[t],s=this.textSpans[t].span,(r=this.textSpans[t].glyph)&&r.renderFrame(),i._mdf.m&&s.setAttribute("transform",i.m),i._mdf.o&&s.setAttribute("opacity",i.o),i._mdf.sw&&s.setAttribute("stroke-width",i.sw),i._mdf.sc&&s.setAttribute("stroke",i.sc),i._mdf.fc&&s.setAttribute("fill",i.fc))}},c([vi],Hi),Hi.prototype.createContent=function(){var t=$("rect");t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.layerElement.appendChild(t)},$i.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},$i.prototype.renderFrame=function(){},$i.prototype.getBaseElement=function(){return null},$i.prototype.destroy=function(){},$i.prototype.sourceRectAtTime=function(){},$i.prototype.hide=function(){},c([ei,oi,gi,ii],$i),c([ni],Gi),Gi.prototype.createNull=function(t){return new $i(t,this.globalData,this)},Gi.prototype.createShape=function(t){return new Ni(t,this.globalData,this)},Gi.prototype.createText=function(t){return new qi(t,this.globalData,this)},Gi.prototype.createImage=function(t){return new vi(t,this.globalData,this)},Gi.prototype.createSolid=function(t){return new Hi(t,this.globalData,this)},Gi.prototype.configAnimation=function(t){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.svgElement.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+t.w+" "+t.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",t.w),this.svgElement.setAttribute("height",t.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)",this.svgElement.style.contentVisibility=this.renderConfig.contentVisibility),this.renderConfig.width&&this.svgElement.setAttribute("width",this.renderConfig.width),this.renderConfig.height&&this.svgElement.setAttribute("height",this.renderConfig.height),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var e=this.globalData.defs;this.setupGlobalData(t,e),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=t;var i=$("clipPath"),s=$("rect");s.setAttribute("width",t.w),s.setAttribute("height",t.h),s.setAttribute("x",0),s.setAttribute("y",0);var r=L();i.setAttribute("id",r),i.appendChild(s),this.layerElement.setAttribute("clip-path","url("+h()+"#"+r+")"),e.appendChild(i),this.layers=t.layers,this.elements=u(t.layers.length)},Gi.prototype.destroy=function(){var t;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var e=this.layers?this.layers.length:0;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy&&this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},Gi.prototype.updateContainerSize=function(){},Gi.prototype.findIndexByInd=function(t){var e=0,i=this.layers.length;for(e=0;e<i;e+=1)if(this.layers[e].ind===t)return e;return-1},Gi.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!==this.layers[t].ty){e[t]=!0;var i=this.createItem(this.layers[t]);if(e[t]=i,V()&&(0===this.layers[t].ty&&this.globalData.projectInterface.registerComposition(i),i.initExpressions()),this.appendElementInPos(i,t),this.layers[t].tt){var s="tp"in this.layers[t]?this.findIndexByInd(this.layers[t].tp):t-1;if(-1===s)return;if(this.elements[s]&&!0!==this.elements[s]){var r=e[s].getMatte(this.layers[t].tt);i.setMatte(r)}else this.buildItem(s),this.addPendingElement(i)}}},Gi.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();if(t.checkParenting(),t.data.tt)for(var e=0,i=this.elements.length;e<i;){if(this.elements[e]===t){var s="tp"in t.data?this.findIndexByInd(t.data.tp):e-1,r=this.elements[s].getMatte(this.layers[e].tt);t.setMatte(r);break}e+=1}}},Gi.prototype.renderFrame=function(t){if(this.renderedFrame!==t&&!this.destroyed){var e;null===t?t=this.renderedFrame:this.renderedFrame=t,this.globalData.frameNum=t,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=t,this.globalData._mdf=!1;var i=this.layers.length;for(this.completeLayers||this.checkLayers(t),e=i-1;e>=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<i;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()}},Gi.prototype.appendElementInPos=function(t,e){var i=t.getBaseElement();if(i){for(var s,r=0;r<e;)this.elements[r]&&!0!==this.elements[r]&&this.elements[r].getBaseElement()&&(s=this.elements[r].getBaseElement()),r+=1;s?this.layerElement.insertBefore(i,s):this.layerElement.appendChild(i)}},Gi.prototype.hide=function(){this.layerElement.style.display="none"},Gi.prototype.show=function(){this.layerElement.style.display="block"},c([ei,oi,gi,ii,yi],Yi),Yi.prototype.initElement=function(t,e,i){this.initFrame(),this.initBaseData(t,e,i),this.initTransform(t,e,i),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&e.progressiveLoad||this.buildAllItems(),this.hide()},Yi.prototype.prepareFrame=function(t){if(this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=t/this.data.sr;else{var e=this.tm.v;e===this.data.op&&(e=this.data.op-1),this.renderedFrame=e}var i,s=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),i=s-1;i>=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))}},Yi.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},Yi.prototype.setElements=function(t){this.elements=t},Yi.prototype.getElements=function(){return this.elements},Yi.prototype.destroyElements=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy()},Yi.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},c([Gi,Yi,mi],Xi),Xi.prototype.createComp=function(t){return new Xi(t,this.globalData,this)},c([Gi],Ki),Ki.prototype.createComp=function(t){return new Xi(t,this.globalData,this)},tt("svg",Ki),te.registerModifier("tm",ie),te.registerModifier("pb",se),te.registerModifier("rp",ne),te.registerModifier("rd",ae),te.registerModifier("zz",Ae),te.registerModifier("op",ze),Ot}());const o=s(a.exports);
1
+ var RaiWidget=function(t){"use strict";var e=Object.defineProperty,i=(t,i,s)=>((t,i,s)=>i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[i]=s)(t,"symbol"!=typeof i?i+"":i,s);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function s(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var r,n,a={exports:{}};r=a,n=a.exports,"undefined"!=typeof document&&"undefined"!=typeof navigator&&(r.exports=function(){var t="http://www.w3.org/2000/svg",e="",i=!1,s=-999999,r=function(t){i=!!t},a=function(){return i},o=function(t){e=t},h=function(){return e};function l(t){return document.createElement(t)}function c(t,e){var i,s,r=t.length;for(i=0;i<r;i+=1)for(var n in s=t[i].prototype)Object.prototype.hasOwnProperty.call(s,n)&&(e.prototype[n]=s[n])}function p(t){function e(){}return e.prototype=t,e}var d=function(){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(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].pause()},resume:function(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].resume()},setRate:function(t){var e,i=this.audios.length;for(e=0;e<i;e+=1)this.audios[e].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(){var t,e=this.audios.length;for(t=0;t<e;t+=1)this.audios[t].volume(this._volume*(this._isMuted?0:1))}},function(){return new t}}(),u=function(){function t(t,e){var i,s=0,r=[];switch(t){case"int16":case"uint8c":i=1;break;default:i=1.1}for(s=0;s<e;s+=1)r.push(i);return r}function e(e,i){return"float32"===e?new Float32Array(i):"int16"===e?new Int16Array(i):"uint8c"===e?new Uint8ClampedArray(i):t(e,i)}return"function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?e:t}();function f(t){return Array.apply(null,{length:t})}var m=!0,g=null,y="",v=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),b=Math.pow,w=Math.sqrt,k=Math.floor,_=Math.min,T=150,x=Math.PI/180,A=.5519;function S(t,e,i,s){this.type=t,this.currentTime=e,this.totalTime=i,this.direction=s<0?-1:1}function E(t,e){this.type=t,this.direction=e<0?-1:1}function C(t,e,i,s){this.type=t,this.currentLoop=i,this.totalLoops=e,this.direction=s<0?-1:1}function P(t,e,i){this.type=t,this.firstFrame=e,this.totalFrames=i}function D(t,e){this.type=t,this.target=e}function I(t,e){this.type="renderFrameError",this.nativeError=t,this.currentTime=e}function M(t){this.type="configError",this.nativeError=t}var L=function(){var t=0;return function(){return y+"__lottie_element_"+(t+=1)}}();function F(t,e,i){var s,r,n,a,o,h,l,c;switch(h=i*(1-e),l=i*(1-(o=6*t-(a=Math.floor(6*t)))*e),c=i*(1-(1-o)*e),a%6){case 0:s=i,r=c,n=h;break;case 1:s=l,r=i,n=h;break;case 2:s=h,r=i,n=c;break;case 3:s=h,r=l,n=i;break;case 4:s=c,r=h,n=i;break;case 5:s=i,r=h,n=l}return[s,r,n]}function R(t,e,i){var s,r=Math.max(t,e,i),n=Math.min(t,e,i),a=r-n,o=0===r?0:a/r,h=r/255;switch(r){case n:s=0;break;case t:s=e-i+a*(e<i?6:0),s/=6*a;break;case e:s=i-t+2*a,s/=6*a;break;case i:s=t-e+4*a,s/=6*a}return[s,o,h]}function N(t,e){var i=R(255*t[0],255*t[1],255*t[2]);return i[1]+=e,i[1]>1?i[1]=1:i[1]<=0&&(i[1]=0),F(i[0],i[1],i[2])}function O(t,e){var i=R(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),F(i[0],i[1],i[2])}function z(t,e){var i=R(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),F(i[0],i[1],i[2])}!function(){var t,e,i=[];for(t=0;t<256;t+=1)e=t.toString(16),i[t]=1===e.length?"0"+e:e}();var U=function(t){m=!!t},W=function(){return m},j=function(t){g=t},B=function(){return g},V=function(t){T=t},H=function(){return T},$=function(t){y=t};function q(e){return document.createElementNS(t,e)}function G(t){return(G="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 Y=function(){var t,e,i=1,s=[],r={onmessage:function(){},postMessage:function(e){t({data:e})}},n={postMessage:function(t){r.onmessage({data:t})}};function o(e){if(window.Worker&&window.Blob&&a()){var i=new Blob(["var _workerSelf = self; self.onmessage = ",e.toString()],{type:"text/javascript"}),s=URL.createObjectURL(i);return new Worker(s)}return t=e,r}function h(){e||((e=o(function(t){function e(){function t(e,i){var a,o,h,l,c,p,d=e.length;for(o=0;o<d;o+=1)if("ks"in(a=e[o])&&!a.completed){if(a.completed=!0,a.hasMask){var f=a.masksProperties;for(l=f.length,h=0;h<l;h+=1)if(f[h].pt.k.i)n(f[h].pt.k);else for(p=f[h].pt.k.length,c=0;c<p;c+=1)f[h].pt.k[c].s&&n(f[h].pt.k[c].s[0]),f[h].pt.k[c].e&&n(f[h].pt.k[c].e[0])}0===a.ty?(a.layers=s(a.refId,i),t(a.layers,i)):4===a.ty?r(a.shapes):5===a.ty&&u(a)}}function e(e,i){if(e){var r=0,n=e.length;for(r=0;r<n;r+=1)1===e[r].t&&(e[r].data.layers=s(e[r].data.refId,i),t(e[r].data.layers,i))}}function i(t,e){for(var i=0,s=e.length;i<s;){if(e[i].id===t)return e[i];i+=1}return null}function s(t,e){var s=i(t,e);return s?s.layers.__used?JSON.parse(JSON.stringify(s.layers)):(s.layers.__used=!0,s.layers):null}function r(t){var e,i,s;for(e=t.length-1;e>=0;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)n(t[e].ks.k);else for(s=t[e].ks.k.length,i=0;i<s;i+=1)t[e].ks.k[i].s&&n(t[e].ks.k[i].s[0]),t[e].ks.k[i].e&&n(t[e].ks.k[i].e[0]);else"gr"===t[e].ty&&r(t[e].it)}function n(t){var e,i=t.i.length;for(e=0;e<i;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function a(t,e){var i=e?e.split("."):[100,100,100];return t[0]>i[0]||!(i[0]>t[0])&&(t[1]>i[1]||!(i[1]>t[1])&&(t[2]>i[2]||!(i[2]>t[2])&&null))}var o=function(){var t=[4,4,14];function e(t){var e=t.t.d;t.t.d={k:[{s:e,t:0}]}}function i(t){var i,s=t.length;for(i=0;i<s;i+=1)5===t[i].ty&&e(t[i])}return function(e){if(a(t,e.v)&&(i(e.layers),e.assets)){var s,r=e.assets.length;for(s=0;s<r;s+=1)e.assets[s].layers&&i(e.assets[s].layers)}}}(),h=function(){var t=[4,7,99];return function(e){if(e.chars&&!a(t,e.v)){var i,s=e.chars.length;for(i=0;i<s;i+=1){var n=e.chars[i];n.data&&n.data.shapes&&(r(n.data.shapes),n.data.ip=0,n.data.op=99999,n.data.st=0,n.data.sr=1,n.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}},e.chars[i].t||(n.data.shapes.push({ty:"no"}),n.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"})))}}}}(),l=function(){var t=[5,7,15];function e(t){var e=t.t.p;"number"==typeof e.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})}function i(t){var i,s=t.length;for(i=0;i<s;i+=1)5===t[i].ty&&e(t[i])}return function(e){if(a(t,e.v)&&(i(e.layers),e.assets)){var s,r=e.assets.length;for(s=0;s<r;s+=1)e.assets[s].layers&&i(e.assets[s].layers)}}}(),c=function(){var t=[4,1,9];function e(t){var i,s,r,n=t.length;for(i=0;i<n;i+=1)if("gr"===t[i].ty)e(t[i].it);else if("fl"===t[i].ty||"st"===t[i].ty)if(t[i].c.k&&t[i].c.k[0].i)for(r=t[i].c.k.length,s=0;s<r;s+=1)t[i].c.k[s].s&&(t[i].c.k[s].s[0]/=255,t[i].c.k[s].s[1]/=255,t[i].c.k[s].s[2]/=255,t[i].c.k[s].s[3]/=255),t[i].c.k[s].e&&(t[i].c.k[s].e[0]/=255,t[i].c.k[s].e[1]/=255,t[i].c.k[s].e[2]/=255,t[i].c.k[s].e[3]/=255);else t[i].c.k[0]/=255,t[i].c.k[1]/=255,t[i].c.k[2]/=255,t[i].c.k[3]/=255}function i(t){var i,s=t.length;for(i=0;i<s;i+=1)4===t[i].ty&&e(t[i].shapes)}return function(e){if(a(t,e.v)&&(i(e.layers),e.assets)){var s,r=e.assets.length;for(s=0;s<r;s+=1)e.assets[s].layers&&i(e.assets[s].layers)}}}(),p=function(){var t=[4,4,18];function e(t){var i,s,r;for(i=t.length-1;i>=0;i-=1)if("sh"===t[i].ty)if(t[i].ks.k.i)t[i].ks.k.c=t[i].closed;else for(r=t[i].ks.k.length,s=0;s<r;s+=1)t[i].ks.k[s].s&&(t[i].ks.k[s].s[0].c=t[i].closed),t[i].ks.k[s].e&&(t[i].ks.k[s].e[0].c=t[i].closed);else"gr"===t[i].ty&&e(t[i].it)}function i(t){var i,s,r,n,a,o,h=t.length;for(s=0;s<h;s+=1){if((i=t[s]).hasMask){var l=i.masksProperties;for(n=l.length,r=0;r<n;r+=1)if(l[r].pt.k.i)l[r].pt.k.c=l[r].cl;else for(o=l[r].pt.k.length,a=0;a<o;a+=1)l[r].pt.k[a].s&&(l[r].pt.k[a].s[0].c=l[r].cl),l[r].pt.k[a].e&&(l[r].pt.k[a].e[0].c=l[r].cl)}4===i.ty&&e(i.shapes)}}return function(e){if(a(t,e.v)&&(i(e.layers),e.assets)){var s,r=e.assets.length;for(s=0;s<r;s+=1)e.assets[s].layers&&i(e.assets[s].layers)}}}();function d(i){i.__complete||(c(i),o(i),h(i),l(i),p(i),t(i.layers,i.assets),e(i.chars,i.assets),i.__complete=!0)}function u(t){0===t.t.a.length&&t.t.p}var f={};return f.completeData=d,f.checkColors=c,f.checkChars=h,f.checkPathProperties=l,f.checkShapes=p,f.completeLayers=t,f}if(n.dataManager||(n.dataManager=e()),n.assetLoader||(n.assetLoader=function(){function t(t){var e=t.getResponseHeader("content-type");return e&&"json"===t.responseType&&-1!==e.indexOf("json")||t.response&&"object"===G(t.response)?t.response:t.response&&"string"==typeof t.response?JSON.parse(t.response):t.responseText?JSON.parse(t.responseText):null}function e(e,i,s,r){var n,a=new XMLHttpRequest;try{a.responseType="json"}catch(o){}a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status)n=t(a),s(n);else try{n=t(a),s(n)}catch(o){r&&r(o)}};try{a.open(["G","E","T"].join(""),e,!0)}catch(h){a.open(["G","E","T"].join(""),i+"/"+e,!0)}a.send()}return{load:e}}()),"loadAnimation"===t.data.type)n.assetLoader.load(t.data.path,t.data.fullPath,function(e){n.dataManager.completeData(e),n.postMessage({id:t.data.id,payload:e,status:"success"})},function(){n.postMessage({id:t.data.id,status:"error"})});else if("complete"===t.data.type){var i=t.data.animation;n.dataManager.completeData(i),n.postMessage({id:t.data.id,payload:i,status:"success"})}else"loadData"===t.data.type&&n.assetLoader.load(t.data.path,t.data.fullPath,function(e){n.postMessage({id:t.data.id,payload:e,status:"success"})},function(){n.postMessage({id:t.data.id,status:"error"})})})).onmessage=function(t){var e=t.data,i=e.id,r=s[i];s[i]=null,"success"===e.status?r.onComplete(e.payload):r.onError&&r.onError()})}function l(t,e){var r="processId_"+(i+=1);return s[r]={onComplete:t,onError:e},r}function c(t,i,s){h();var r=l(i,s);e.postMessage({type:"loadAnimation",path:t,fullPath:window.location.origin+window.location.pathname,id:r})}function p(t,i,s){h();var r=l(i,s);e.postMessage({type:"loadData",path:t,fullPath:window.location.origin+window.location.pathname,id:r})}function d(t,i,s){h();var r=l(i,s);e.postMessage({type:"complete",animation:t,id:r})}return{loadAnimation:c,loadData:p,completeAnimation:d}}(),X=function(){var t=function(){var t=l("canvas");t.width=1,t.height=1;var e=t.getContext("2d");return e.fillStyle="rgba(0,0,0,0)",e.fillRect(0,0,1,1),t}();function e(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function i(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function s(t,e,i){var s="";if(t.e)s=t.p;else if(e){var r=t.p;-1!==r.indexOf("images/")&&(r=r.split("/")[1]),s=e+r}else s=i,s+=t.u?t.u:"",s+=t.p;return s}function r(t){var e=0,i=setInterval(function(){(t.getBBox().width||e>500)&&(this._imageLoaded(),clearInterval(i)),e+=1}.bind(this),50)}function n(e){var i=s(e,this.assetsPath,this.path),r=q("image");v?this.testImageLoaded(r):r.addEventListener("load",this._imageLoaded,!1),r.addEventListener("error",function(){n.img=t,this._imageLoaded()}.bind(this),!1),r.setAttributeNS("http://www.w3.org/1999/xlink","href",i),this._elementHelper.append?this._elementHelper.append(r):this._elementHelper.appendChild(r);var n={img:r,assetData:e};return n}function a(e){var i=s(e,this.assetsPath,this.path),r=l("img");r.crossOrigin="anonymous",r.addEventListener("load",this._imageLoaded,!1),r.addEventListener("error",function(){n.img=t,this._imageLoaded()}.bind(this),!1),r.src=i;var n={img:r,assetData:e};return n}function o(t){var e={assetData:t},i=s(t,this.assetsPath,this.path);return Y.loadData(i,function(t){e.img=t,this._footageLoaded()}.bind(this),function(){e.img={},this._footageLoaded()}.bind(this)),e}function h(t,e){var i;this.imagesLoadedCb=e;var s=t.length;for(i=0;i<s;i+=1)t[i].layers||(t[i].t&&"seq"!==t[i].t?3===t[i].t&&(this.totalFootages+=1,this.images.push(this.createFootageData(t[i]))):(this.totalImages+=1,this.images.push(this._createImageData(t[i]))))}function c(t){this.path=t||""}function p(t){this.assetsPath=t||""}function d(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}function u(){this.imagesLoadedCb=null,this.images.length=0}function f(){return this.totalImages===this.loadedAssets}function m(){return this.totalFootages===this.loadedFootagesCount}function g(t,e){"svg"===t?(this._elementHelper=e,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}function y(){this._imageLoaded=e.bind(this),this._footageLoaded=i.bind(this),this.testImageLoaded=r.bind(this),this.createFootageData=o.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return y.prototype={loadAssets:h,setAssetsPath:p,setPath:c,loadedImages:f,loadedFootages:m,destroy:u,getAsset:d,createImgData:a,createImageData:n,imageLoaded:e,footageLoaded:i,setCacheType:g},y}();function K(){}K.prototype={triggerEvent:function(t,e){if(this._cbs[t])for(var i=this._cbs[t],s=0;s<i.length;s+=1)i[s](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,s=this._cbs[t].length;i<s;)this._cbs[t][i]===e&&(this._cbs[t].splice(i,1),i-=1,s-=1),i+=1;this._cbs[t].length||(this._cbs[t]=null)}}else this._cbs[t]=null}};var J=function(){function t(t){for(var e,i=t.split("\r\n"),s={},r=0,n=0;n<i.length;n+=1)2===(e=i[n].split(":")).length&&(s[e[0]]=e[1].trim(),r+=1);if(0===r)throw new Error;return s}return function(e){for(var i=[],s=0;s<e.length;s+=1){var r=e[s],n={time:r.tm,duration:r.dr};try{n.payload=JSON.parse(e[s].cm)}catch(a){try{n.payload=t(e[s].cm)}catch(o){n.payload={name:e[s].cm}}}i.push(n)}return i}}(),Z=function(){function t(t){this.compositions.push(t)}return function(){function e(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 e.compositions=[],e.currentFrame=0,e.registerComposition=t,e}}(),Q={},tt=function(t,e){Q[t]=e};function et(t){return Q[t]}function it(){if(Q.canvas)return"canvas";for(var t in Q)if(Q[t])return t;return""}function st(t){return(st="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 rt=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=L(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=W(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=Z(),this.imagePreloader=new X,this.audioController=d(),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new S("drawnFrame",0,0,0),this.expressionsPlugin=B()};c([K],rt),rt.prototype.setParams=function(t){(t.wrapper||t.container)&&(this.wrapper=t.wrapper||t.container);var e="svg";t.animType?e=t.animType:t.renderer&&(e=t.renderer);var i=et(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||void 0===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?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")),Y.loadAnimation(t.path,this.configAnimation,this.onSetupError))},rt.prototype.onSetupError=function(){this.trigger("data_failed")},rt.prototype.setupAnimation=function(t){Y.completeAnimation(t,this.configAnimation)},rt.prototype.setData=function(t,e){e&&"object"!==st(e)&&(e=JSON.parse(e));var i={wrapper:t,animationData:e},s=t.attributes;i.path=s.getNamedItem("data-animation-path")?s.getNamedItem("data-animation-path").value:s.getNamedItem("data-bm-path")?s.getNamedItem("data-bm-path").value:s.getNamedItem("bm-path")?s.getNamedItem("bm-path").value:"",i.animType=s.getNamedItem("data-anim-type")?s.getNamedItem("data-anim-type").value:s.getNamedItem("data-bm-type")?s.getNamedItem("data-bm-type").value:s.getNamedItem("bm-type")?s.getNamedItem("bm-type").value:s.getNamedItem("data-bm-renderer")?s.getNamedItem("data-bm-renderer").value:s.getNamedItem("bm-renderer")?s.getNamedItem("bm-renderer").value:it()||"canvas";var r=s.getNamedItem("data-anim-loop")?s.getNamedItem("data-anim-loop").value:s.getNamedItem("data-bm-loop")?s.getNamedItem("data-bm-loop").value:s.getNamedItem("bm-loop")?s.getNamedItem("bm-loop").value:"";"false"===r?i.loop=!1:"true"===r?i.loop=!0:""!==r&&(i.loop=parseInt(r,10));var n=s.getNamedItem("data-anim-autoplay")?s.getNamedItem("data-anim-autoplay").value:s.getNamedItem("data-bm-autoplay")?s.getNamedItem("data-bm-autoplay").value:!s.getNamedItem("bm-autoplay")||s.getNamedItem("bm-autoplay").value;i.autoplay="false"!==n,i.name=s.getNamedItem("data-name")?s.getNamedItem("data-name").value:s.getNamedItem("data-bm-name")?s.getNamedItem("data-bm-name").value:s.getNamedItem("bm-name")?s.getNamedItem("bm-name").value:"","false"===(s.getNamedItem("data-anim-prerender")?s.getNamedItem("data-anim-prerender").value:s.getNamedItem("data-bm-prerender")?s.getNamedItem("data-bm-prerender").value:s.getNamedItem("bm-prerender")?s.getNamedItem("bm-prerender").value:"")&&(i.prerender=!1),i.path?this.setParams(i):this.trigger("destroy")},rt.prototype.includeLayers=function(t){t.op>this.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,i,s=this.animationData.layers,r=s.length,n=t.layers,a=n.length;for(i=0;i<a;i+=1)for(e=0;e<r;){if(s[e].id===n[i].id){s[e]=n[i];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,Y.completeAnimation(this.animationData,this.onSegmentComplete)},rt.prototype.onSegmentComplete=function(t){this.animationData=t;var e=B();e&&e.initExpressions(this),this.loadNextSegment()},rt.prototype.loadNextSegment=function(){var t=this.animationData.segments;if(!t||0===t.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var e=t.shift();this.timeCompleted=e.time*this.frameRate;var i=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,Y.loadData(i,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},rt.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},rt.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},rt.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},rt.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=J(t.markers||[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(e){this.triggerConfigError(e)}},rt.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},rt.prototype.checkLoaded=function(){if(!this.isLoaded&&this.renderer.globalData.fontManager.isLoaded&&(this.imagePreloader.loadedImages()||"canvas"!==this.renderer.rendererType)&&this.imagePreloader.loadedFootages()){this.isLoaded=!0;var t=B();t&&t.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play()}},rt.prototype.resize=function(t,e){var i="number"==typeof t?t:void 0,s="number"==typeof e?e:void 0;this.renderer.updateContainerSize(i,s)},rt.prototype.setSubframe=function(t){this.isSubframeEnabled=!!t},rt.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")},rt.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)}},rt.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")))},rt.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())},rt.prototype.togglePause=function(t){t&&this.name!==t||(!0===this.isPaused?this.play():this.pause())},rt.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},rt.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},rt.prototype.goToAndStop=function(t,e,i){if(!i||this.name===i){var s=Number(t);if(isNaN(s)){var r=this.getMarkerData(t);r&&this.goToAndStop(r.time,!0)}else e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier);this.pause()}},rt.prototype.goToAndPlay=function(t,e,i){if(!i||this.name===i){var s=Number(t);if(isNaN(s)){var r=this.getMarkerData(t);r&&(r.duration?this.playSegments([r.time,r.time+r.duration],!0):this.goToAndStop(r.time,!0))}else this.goToAndStop(s,e,i);this.play()}},rt.prototype.advanceTime=function(t){if(!0!==this.isPaused&&!1!==this.isLoaded){var e=this.currentRawFrame+t*this.frameModifier,i=!1;e>=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"))}},rt.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]<t[0]?(this.frameModifier>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")},rt.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)},rt.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),"object"===st(t[0])){var i,s=t.length;for(i=0;i<s;i+=1)this.segments.push(t[i])}else this.segments.push(t);this.segments.length&&e&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},rt.prototype.resetSegments=function(t){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),t&&this.checkSegments(0)},rt.prototype.checkSegments=function(t){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),t),!0)},rt.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)},rt.prototype.setCurrentRawFrameValue=function(t){this.currentRawFrame=t,this.gotoFrame()},rt.prototype.setSpeed=function(t){this.playSpeed=t,this.updaFrameModifier()},rt.prototype.setDirection=function(t){this.playDirection=t<0?-1:1,this.updaFrameModifier()},rt.prototype.setLoop=function(t){this.loop=t},rt.prototype.setVolume=function(t,e){e&&this.name!==e||this.audioController.setVolume(t)},rt.prototype.getVolume=function(){return this.audioController.getVolume()},rt.prototype.mute=function(t){t&&this.name!==t||this.audioController.mute()},rt.prototype.unmute=function(t){t&&this.name!==t||this.audioController.unmute()},rt.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},rt.prototype.getPath=function(){return this.path},rt.prototype.getAssetsPath=function(t){var e="";if(t.e)e=t.p;else if(this.assetsPath){var i=t.p;-1!==i.indexOf("images/")&&(i=i.split("/")[1]),e=this.assetsPath+i}else e=this.path,e+=t.u?t.u:"",e+=t.p;return e},rt.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},rt.prototype.hide=function(){this.renderer.hide()},rt.prototype.show=function(){this.renderer.show()},rt.prototype.getDuration=function(t){return t?this.totalFrames:this.totalFrames/this.frameRate},rt.prototype.updateDocumentData=function(t,e,i){try{this.renderer.getElementByPath(t).updateDocumentData(e,i)}catch(s){}},rt.prototype.trigger=function(t){if(this._cbs&&this._cbs[t])switch(t){case"enterFrame":this.triggerEvent(t,new S(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 C(t,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(t,new E(t,this.frameMult));break;case"segmentStart":this.triggerEvent(t,new P(t,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(t,new D(t,this));break;default:this.triggerEvent(t)}"enterFrame"===t&&this.onEnterFrame&&this.onEnterFrame.call(this,new S(t,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===t&&this.onLoopComplete&&this.onLoopComplete.call(this,new C(t,this.loop,this.playCount,this.frameMult)),"complete"===t&&this.onComplete&&this.onComplete.call(this,new E(t,this.frameMult)),"segmentStart"===t&&this.onSegmentStart&&this.onSegmentStart.call(this,new P(t,this.firstFrame,this.totalFrames)),"destroy"===t&&this.onDestroy&&this.onDestroy.call(this,new D(t,this))},rt.prototype.triggerRenderFrameError=function(t){var e=new I(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)},rt.prototype.triggerConfigError=function(t){var e=new M(t,this.currentFrame);this.triggerEvent("error",e),this.onError&&this.onError.call(this,e)};var nt=function(){var t={},e=[],i=0,s=0,r=0,n=!0,a=!1;function o(t){for(var i=0,r=t.target;i<s;)e[i].animation===r&&(e.splice(i,1),i-=1,s-=1,r.isPaused||d()),i+=1}function h(t,i){if(!t)return null;for(var r=0;r<s;){if(e[r].elem===t&&null!==e[r].elem)return e[r].animation;r+=1}var n=new rt;return u(n,t),n.setData(t,i),n}function c(){var t,i=e.length,s=[];for(t=0;t<i;t+=1)s.push(e[t].animation);return s}function p(){r+=1,E()}function d(){r-=1}function u(t,i){t.addEventListener("destroy",o),t.addEventListener("_active",p),t.addEventListener("_idle",d),e.push({elem:i,animation:t}),s+=1}function f(t){var e=new rt;return u(e,null),e.setParams(t),e}function m(t,i){var r;for(r=0;r<s;r+=1)e[r].animation.setSpeed(t,i)}function g(t,i){var r;for(r=0;r<s;r+=1)e[r].animation.setDirection(t,i)}function y(t){var i;for(i=0;i<s;i+=1)e[i].animation.play(t)}function v(t){var o,h=t-i;for(o=0;o<s;o+=1)e[o].animation.advanceTime(h);i=t,r&&!a?window.requestAnimationFrame(v):n=!0}function b(t){i=t,window.requestAnimationFrame(v)}function w(t){var i;for(i=0;i<s;i+=1)e[i].animation.pause(t)}function k(t,i,r){var n;for(n=0;n<s;n+=1)e[n].animation.goToAndStop(t,i,r)}function _(t){var i;for(i=0;i<s;i+=1)e[i].animation.stop(t)}function T(t){var i;for(i=0;i<s;i+=1)e[i].animation.togglePause(t)}function x(t){var i;for(i=s-1;i>=0;i-=1)e[i].animation.destroy(t)}function A(t,e,i){var s,r=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),n=r.length;for(s=0;s<n;s+=1)i&&r[s].setAttribute("data-bm-type",i),h(r[s],t);if(e&&0===n){i||(i="svg");var a=document.getElementsByTagName("body")[0];a.innerText="";var o=l("div");o.style.width="100%",o.style.height="100%",o.setAttribute("data-bm-type",i),a.appendChild(o),h(o,t)}}function S(){var t;for(t=0;t<s;t+=1)e[t].animation.resize()}function E(){!a&&r&&n&&(window.requestAnimationFrame(b),n=!1)}function C(){a=!0}function P(){a=!1,E()}function D(t,i){var r;for(r=0;r<s;r+=1)e[r].animation.setVolume(t,i)}function I(t){var i;for(i=0;i<s;i+=1)e[i].animation.mute(t)}function M(t){var i;for(i=0;i<s;i+=1)e[i].animation.unmute(t)}return t.registerAnimation=h,t.loadAnimation=f,t.setSpeed=m,t.setDirection=g,t.play=y,t.pause=w,t.stop=_,t.togglePause=T,t.searchAnimations=A,t.resize=S,t.goToAndStop=k,t.destroy=x,t.freeze=C,t.unfreeze=P,t.setVolume=D,t.mute=I,t.unmute=M,t.getRegisteredAnimations=c,t}(),at=function(){var t={};t.getBezierEasing=i;var e={};function i(t,i,s,r,n){var a=n||("bez_"+t+"_"+i+"_"+s+"_"+r).replace(/\./g,"p");if(e[a])return e[a];var o=new y([t,i,s,r]);return e[a]=o,o}var s=4,r=.001,n=1e-7,a=10,o=11,h=1/(o-1),l="function"==typeof Float32Array;function c(t,e){return 1-3*e+3*t}function p(t,e){return 3*e-6*t}function d(t){return 3*t}function u(t,e,i){return((c(e,i)*t+p(e,i))*t+d(e))*t}function f(t,e,i){return 3*c(e,i)*t*t+2*p(e,i)*t+d(e)}function m(t,e,i,s,r){var o,h,l=0;do{(o=u(h=e+(i-e)/2,s,r)-t)>0?i=h:e=h}while(Math.abs(o)>n&&++l<a);return h}function g(t,e,i,r){for(var n=0;n<s;++n){var a=f(e,i,r);if(0===a)return e;e-=(u(e,i,r)-t)/a}return e}function y(t){this._p=t,this._mSampleValues=l?new Float32Array(o):new Array(o),this._precomputed=!1,this.get=this.get.bind(this)}return y.prototype={get:function(t){var e=this._p[0],i=this._p[1],s=this._p[2],r=this._p[3];return this._precomputed||this._precompute(),e===i&&s===r?t:0===t?0:1===t?1:u(this._getTForX(t),i,r)},_precompute:function(){var t=this._p[0],e=this._p[1],i=this._p[2],s=this._p[3];this._precomputed=!0,t===e&&i===s||this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],i=0;i<o;++i)this._mSampleValues[i]=u(i*h,t,e)},_getTForX:function(t){for(var e=this._p[0],i=this._p[2],s=this._mSampleValues,n=0,a=1,l=o-1;a!==l&&s[a]<=t;++a)n+=h;var c=n+(t-s[--a])/(s[a+1]-s[a])*h,p=f(c,e,i);return p>=r?g(t,c,e,i):0===p?c:m(t,n,n+h,e,i)}},t}(),ot=function(){function t(t){return t.concat(f(t.length))}return{double:t}}(),ht=function(){return function(t,e,i){var s=0,r=t,n=f(r);function a(){return s?n[s-=1]:e()}function o(t){s===r&&(n=ot.double(n),r*=2),i&&i(t),n[s]=t,s+=1}return{newElement:a,release:o}}}(),lt=function(){function t(){return{addedLength:0,percents:u("float32",H()),lengths:u("float32",H())}}return ht(8,t)}(),ct=function(){function t(){return{lengths:[],totalLength:0}}function e(t){var e,i=t.lengths.length;for(e=0;e<i;e+=1)lt.release(t.lengths[e]);t.lengths.length=0}return ht(8,t,e)}();function pt(){var t=Math;function e(t,e,i,s,r,n){var a=t*s+e*r+i*n-r*s-n*t-i*e;return a>-.001&&a<.001}function i(i,s,r,n,a,o,h,l,c){if(0===r&&0===o&&0===c)return e(i,s,n,a,h,l);var p,d=t.sqrt(t.pow(n-i,2)+t.pow(a-s,2)+t.pow(o-r,2)),u=t.sqrt(t.pow(h-i,2)+t.pow(l-s,2)+t.pow(c-r,2)),f=t.sqrt(t.pow(h-n,2)+t.pow(l-a,2)+t.pow(c-o,2));return(p=d>u?d>f?d-u-f:f-u-d:f>u?f-u-d:u-d-f)>-1e-4&&p<1e-4}var s=function(){return function(t,e,i,s){var r,n,a,o,h,l,c=H(),p=0,d=[],u=[],f=lt.newElement();for(a=i.length,r=0;r<c;r+=1){for(h=r/(c-1),l=0,n=0;n<a;n+=1)o=b(1-h,3)*t[n]+3*b(1-h,2)*h*i[n]+3*(1-h)*b(h,2)*s[n]+b(h,3)*e[n],d[n]=o,null!==u[n]&&(l+=b(d[n]-u[n],2)),u[n]=d[n];l&&(p+=l=w(l)),f.percents[r]=h,f.lengths[r]=p}return f.addedLength=p,f}}();function r(t){var e,i=ct.newElement(),r=t.c,n=t.v,a=t.o,o=t.i,h=t._length,l=i.lengths,c=0;for(e=0;e<h-1;e+=1)l[e]=s(n[e],n[e+1],a[e],o[e+1]),c+=l[e].addedLength;return r&&h&&(l[e]=s(n[e],n[0],a[e],o[0]),c+=l[e].addedLength),i.totalLength=c,i}function n(t){this.segmentLength=0,this.points=new Array(t)}function a(t,e){this.partialLength=t,this.point=e}var o=function(){var t={};return function(i,s,r,o){var h=(i[0]+"_"+i[1]+"_"+s[0]+"_"+s[1]+"_"+r[0]+"_"+r[1]+"_"+o[0]+"_"+o[1]).replace(/\./g,"p");if(!t[h]){var l,c,p,d,u,m,g,y=H(),v=0,k=null;2===i.length&&(i[0]!==s[0]||i[1]!==s[1])&&e(i[0],i[1],s[0],s[1],i[0]+r[0],i[1]+r[1])&&e(i[0],i[1],s[0],s[1],s[0]+o[0],s[1]+o[1])&&(y=2);var _=new n(y);for(p=r.length,l=0;l<y;l+=1){for(g=f(p),u=l/(y-1),m=0,c=0;c<p;c+=1)d=b(1-u,3)*i[c]+3*b(1-u,2)*u*(i[c]+r[c])+3*(1-u)*b(u,2)*(s[c]+o[c])+b(u,3)*s[c],g[c]=d,null!==k&&(m+=b(g[c]-k[c],2));v+=m=w(m),_.points[l]=new a(m,g),k=g}_.segmentLength=v,t[h]=_}return t[h]}}();function h(t,e){var i=e.percents,s=e.lengths,r=i.length,n=k((r-1)*t),a=t*e.addedLength,o=0;if(n===r-1||0===n||a===s[n])return i[n];for(var h=s[n]>a?-1:1,l=!0;l;)if(s[n]<=a&&s[n+1]>a?(o=(a-s[n])/(s[n+1]-s[n]),l=!1):n+=h,n<0||n>=r-1){if(n===r-1)return i[n];l=!1}return i[n]+(i[n+1]-i[n])*o}function l(e,i,s,r,n,a){var o=h(n,a),l=1-o;return[t.round(1e3*(l*l*l*e[0]+(o*l*l+l*o*l+l*l*o)*s[0]+(o*o*l+l*o*o+o*l*o)*r[0]+o*o*o*i[0]))/1e3,t.round(1e3*(l*l*l*e[1]+(o*l*l+l*o*l+l*l*o)*s[1]+(o*o*l+l*o*o+o*l*o)*r[1]+o*o*o*i[1]))/1e3]}var c=u("float32",8);function p(e,i,s,r,n,a,o){n<0?n=0:n>1&&(n=1);var l,p=h(n,o),d=h(a=a>1?1:a,o),u=e.length,f=1-p,m=1-d,g=f*f*f,y=p*f*f*3,v=p*p*f*3,b=p*p*p,w=f*f*m,k=p*f*m+f*p*m+f*f*d,_=p*p*m+f*p*d+p*f*d,T=p*p*d,x=f*m*m,A=p*m*m+f*d*m+f*m*d,S=p*d*m+f*d*d+p*m*d,E=p*d*d,C=m*m*m,P=d*m*m+m*d*m+m*m*d,D=d*d*m+m*d*d+d*m*d,I=d*d*d;for(l=0;l<u;l+=1)c[4*l]=t.round(1e3*(g*e[l]+y*s[l]+v*r[l]+b*i[l]))/1e3,c[4*l+1]=t.round(1e3*(w*e[l]+k*s[l]+_*r[l]+T*i[l]))/1e3,c[4*l+2]=t.round(1e3*(x*e[l]+A*s[l]+S*r[l]+E*i[l]))/1e3,c[4*l+3]=t.round(1e3*(C*e[l]+P*s[l]+D*r[l]+I*i[l]))/1e3;return c}return{getSegmentsLength:r,getNewSegment:p,getPointInSegment:l,buildBezierData:o,pointOnLine2D:e,pointOnLine3D:i}}var dt=pt(),ut=s,ft=Math.abs;function mt(t,e){var i,s=this.offsetTime;"multidimensional"===this.propType&&(i=u("float32",this.pv.length));for(var r,n,a,o,h,l,c,p,d,f=e.lastIndex,m=f,g=this.keyframes.length-1,y=!0;y;){if(r=this.keyframes[m],n=this.keyframes[m+1],m===g-1&&t>=n.t-s){r.h&&(r=n),f=0;break}if(n.t-s>t){f=m;break}m<g-1?m+=1:(f=0,y=!1)}a=this.keyframesMetadata[m]||{};var v,b=n.t-s,w=r.t-s;if(r.to){a.bezierData||(a.bezierData=dt.buildBezierData(r.s,n.s||r.e,r.to,r.ti));var k=a.bezierData;if(t>=b||t<w){var _=t>=b?k.points.length-1:0;for(h=k.points[_].point.length,o=0;o<h;o+=1)i[o]=k.points[_].point[o]}else{a.__fnct?d=a.__fnct:(d=at.getBezierEasing(r.o.x,r.o.y,r.i.x,r.i.y,r.n).get,a.__fnct=d),l=d((t-w)/(b-w));var T,x=k.segmentLength*l,A=e.lastFrame<t&&e._lastKeyframeIndex===m?e._lastAddedLength:0;for(p=e.lastFrame<t&&e._lastKeyframeIndex===m?e._lastPoint:0,y=!0,c=k.points.length;y;){if(A+=k.points[p].partialLength,0===x||0===l||p===k.points.length-1){for(h=k.points[p].point.length,o=0;o<h;o+=1)i[o]=k.points[p].point[o];break}if(x>=A&&x<A+k.points[p+1].partialLength){for(T=(x-A)/k.points[p+1].partialLength,h=k.points[p].point.length,o=0;o<h;o+=1)i[o]=k.points[p].point[o]+(k.points[p+1].point[o]-k.points[p].point[o])*T;break}p<c-1?p+=1:y=!1}e._lastPoint=p,e._lastAddedLength=A-k.points[p].partialLength,e._lastKeyframeIndex=m}}else{var S,E,C,P,D;if(g=r.s.length,v=n.s||r.e,this.sh&&1!==r.h)t>=b?(i[0]=v[0],i[1]=v[1],i[2]=v[2]):t<=w?(i[0]=r.s[0],i[1]=r.s[1],i[2]=r.s[2]):yt(i,gt(vt(r.s),vt(v),(t-w)/(b-w)));else for(m=0;m<g;m+=1)1!==r.h&&(t>=b?l=1:t<w?l=0:(r.o.x.constructor===Array?(a.__fnct||(a.__fnct=[]),a.__fnct[m]?d=a.__fnct[m]:(S=void 0===r.o.x[m]?r.o.x[0]:r.o.x[m],E=void 0===r.o.y[m]?r.o.y[0]:r.o.y[m],C=void 0===r.i.x[m]?r.i.x[0]:r.i.x[m],P=void 0===r.i.y[m]?r.i.y[0]:r.i.y[m],d=at.getBezierEasing(S,E,C,P).get,a.__fnct[m]=d)):a.__fnct?d=a.__fnct:(S=r.o.x,E=r.o.y,C=r.i.x,P=r.i.y,d=at.getBezierEasing(S,E,C,P).get,r.keyframeMetadata=d),l=d((t-w)/(b-w)))),v=n.s||r.e,D=1===r.h?r.s[m]:r.s[m]+(v[m]-r.s[m])*l,"multidimensional"===this.propType?i[m]=D:i=D}return e.lastIndex=f,i}function gt(t,e,i){var s,r,n,a,o,h=[],l=t[0],c=t[1],p=t[2],d=t[3],u=e[0],f=e[1],m=e[2],g=e[3];return(r=l*u+c*f+p*m+d*g)<0&&(r=-r,u=-u,f=-f,m=-m,g=-g),1-r>1e-6?(s=Math.acos(r),n=Math.sin(s),a=Math.sin((1-i)*s)/n,o=Math.sin(i*s)/n):(a=1-i,o=i),h[0]=a*l+o*u,h[1]=a*c+o*f,h[2]=a*p+o*m,h[3]=a*d+o*g,h}function yt(t,e){var i=e[0],s=e[1],r=e[2],n=e[3],a=Math.atan2(2*s*n-2*i*r,1-2*s*s-2*r*r),o=Math.asin(2*i*s+2*r*n),h=Math.atan2(2*i*n-2*s*r,1-2*i*i-2*r*r);t[0]=a/x,t[1]=o/x,t[2]=h/x}function vt(t){var e=t[0]*x,i=t[1]*x,s=t[2]*x,r=Math.cos(e/2),n=Math.cos(i/2),a=Math.cos(s/2),o=Math.sin(e/2),h=Math.sin(i/2),l=Math.sin(s/2);return[o*h*a+r*n*l,o*n*a+r*h*l,r*h*a-o*n*l,r*n*a-o*h*l]}function bt(){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!==ut&&(this._caching.lastFrame>=i&&t>=i||this._caching.lastFrame<e&&t<e))){this._caching.lastFrame>=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var s=this.interpolateValue(t,this._caching);this.pv=s}return this._caching.lastFrame=t,this.pv}function wt(t){var e;if("unidimensional"===this.propType)e=t*this.mult,ft(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);else for(var i=0,s=this.v.length;i<s;)e=t[i]*this.mult,ft(this.v[i]-e)>1e-5&&(this.v[i]=e,this._mdf=!0),i+=1}function kt(){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<e;t+=1)i=this.effectsSequence[t](i);this.setVValue(i),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function _t(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function Tt(t,e,i,s){this.propType="unidimensional",this.mult=i||1,this.data=e,this.v=i?e.k*i:e.k,this.pv=e.k,this._mdf=!1,this.elem=t,this.container=s,this.comp=t.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=kt,this.setVValue=wt,this.addEffect=_t}function xt(t,e,i,s){var r;this.propType="multidimensional",this.mult=i||1,this.data=e,this._mdf=!1,this.elem=t,this.container=s,this.comp=t.comp,this.k=!1,this.kf=!1,this.frameId=-1;var n=e.k.length;for(this.v=u("float32",n),this.pv=u("float32",n),this.vel=u("float32",n),r=0;r<n;r+=1)this.v[r]=e.k[r]*this.mult,this.pv[r]=e.k[r];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=kt,this.setVValue=wt,this.addEffect=_t}function At(t,e,i,s){this.propType="unidimensional",this.keyframes=e.k,this.keyframesMetadata=[],this.offsetTime=t.data.st,this.frameId=-1,this._caching={lastFrame:ut,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=e,this.mult=i||1,this.elem=t,this.container=s,this.comp=t.comp,this.v=ut,this.pv=ut,this._isFirstFrame=!0,this.getValue=kt,this.setVValue=wt,this.interpolateValue=mt,this.effectsSequence=[bt.bind(this)],this.addEffect=_t}function St(t,e,i,s){var r;this.propType="multidimensional";var n,a,o,h,l=e.k.length;for(r=0;r<l-1;r+=1)e.k[r].to&&e.k[r].s&&e.k[r+1]&&e.k[r+1].s&&(n=e.k[r].s,a=e.k[r+1].s,o=e.k[r].to,h=e.k[r].ti,(2===n.length&&(n[0]!==a[0]||n[1]!==a[1])&&dt.pointOnLine2D(n[0],n[1],a[0],a[1],n[0]+o[0],n[1]+o[1])&&dt.pointOnLine2D(n[0],n[1],a[0],a[1],a[0]+h[0],a[1]+h[1])||3===n.length&&(n[0]!==a[0]||n[1]!==a[1]||n[2]!==a[2])&&dt.pointOnLine3D(n[0],n[1],n[2],a[0],a[1],a[2],n[0]+o[0],n[1]+o[1],n[2]+o[2])&&dt.pointOnLine3D(n[0],n[1],n[2],a[0],a[1],a[2],a[0]+h[0],a[1]+h[1],a[2]+h[2]))&&(e.k[r].to=null,e.k[r].ti=null),n[0]===a[0]&&n[1]===a[1]&&0===o[0]&&0===o[1]&&0===h[0]&&0===h[1]&&(2===n.length||n[2]===a[2]&&0===o[2]&&0===h[2])&&(e.k[r].to=null,e.k[r].ti=null));this.effectsSequence=[bt.bind(this)],this.data=e,this.keyframes=e.k,this.keyframesMetadata=[],this.offsetTime=t.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=i||1,this.elem=t,this.container=s,this.comp=t.comp,this.getValue=kt,this.setVValue=wt,this.interpolateValue=mt,this.frameId=-1;var c=e.k[0].s.length;for(this.v=u("float32",c),this.pv=u("float32",c),r=0;r<c;r+=1)this.v[r]=ut,this.pv[r]=ut;this._caching={lastFrame:ut,lastIndex:0,value:u("float32",c)},this.addEffect=_t}var Et=function(){function t(t,e,i,s,r){var n;if(e.sid&&(e=t.globalData.slotManager.getProp(e)),e.k.length)if("number"==typeof e.k[0])n=new xt(t,e,s,r);else switch(i){case 0:n=new At(t,e,s,r);break;case 1:n=new St(t,e,s,r)}else n=new Tt(t,e,s,r);return n.effectsSequence.length&&r.addDynamicProperty(n),n}return{getProp:t}}();function Ct(){}Ct.prototype={addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&(this.dynamicProperties.push(t),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){var t;this._mdf=!1;var e=this.dynamicProperties.length;for(t=0;t<e;t+=1)this.dynamicProperties[t].getValue(),this.dynamicProperties[t]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(t){this.container=t,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var Pt=function(){function t(){return u("float32",2)}return ht(8,t)}();function Dt(){this.c=!1,this._length=0,this._maxLength=8,this.v=f(this._maxLength),this.o=f(this._maxLength),this.i=f(this._maxLength)}Dt.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var i=0;i<e;)this.v[i]=Pt.newElement(),this.o[i]=Pt.newElement(),this.i[i]=Pt.newElement(),i+=1},Dt.prototype.setLength=function(t){for(;this._maxLength<t;)this.doubleArrayLength();this._length=t},Dt.prototype.doubleArrayLength=function(){this.v=this.v.concat(f(this._maxLength)),this.i=this.i.concat(f(this._maxLength)),this.o=this.o.concat(f(this._maxLength)),this._maxLength*=2},Dt.prototype.setXYAt=function(t,e,i,s,r){var n;switch(this._length=Math.max(this._length,s+1),this._length>=this._maxLength&&this.doubleArrayLength(),i){case"v":n=this.v;break;case"i":n=this.i;break;case"o":n=this.o;break;default:n=[]}(!n[s]||n[s]&&!r)&&(n[s]=Pt.newElement()),n[s][0]=t,n[s][1]=e},Dt.prototype.setTripleAt=function(t,e,i,s,r,n,a,o){this.setXYAt(t,e,"v",a,o),this.setXYAt(i,s,"o",a,o),this.setXYAt(r,n,"i",a,o)},Dt.prototype.reverse=function(){var t=new Dt;t.setPathData(this.c,this._length);var e=this.v,i=this.o,s=this.i,r=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],s[0][0],s[0][1],i[0][0],i[0][1],0,!1),r=1);var n,a=this._length-1,o=this._length;for(n=r;n<o;n+=1)t.setTripleAt(e[a][0],e[a][1],s[a][0],s[a][1],i[a][0],i[a][1],n,!1),a-=1;return t},Dt.prototype.length=function(){return this._length};var It=function(){function t(){return new Dt}function e(t){var e,i=t._length;for(e=0;e<i;e+=1)Pt.release(t.v[e]),Pt.release(t.i[e]),Pt.release(t.o[e]),t.v[e]=null,t.i[e]=null,t.o[e]=null;t._length=0,t.c=!1}function i(t){var e,i=s.newElement(),r=void 0===t._length?t.v.length:t._length;for(i.setLength(r),i.c=t.c,e=0;e<r;e+=1)i.setTripleAt(t.v[e][0],t.v[e][1],t.o[e][0],t.o[e][1],t.i[e][0],t.i[e][1],e);return i}var s=ht(4,t,e);return s.clone=i,s}();function Mt(){this._length=0,this._maxLength=4,this.shapes=f(this._maxLength)}Mt.prototype.addShape=function(t){this._length===this._maxLength&&(this.shapes=this.shapes.concat(f(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=t,this._length+=1},Mt.prototype.releaseShapes=function(){var t;for(t=0;t<this._length;t+=1)It.release(this.shapes[t]);this._length=0};var Lt=function(){var t={newShapeCollection:r,release:n},e=0,i=4,s=f(i);function r(){return e?s[e-=1]:new Mt}function n(t){var r,n=t._length;for(r=0;r<n;r+=1)It.release(t.shapes[r]);t._length=0,e===i&&(s=ot.double(s),i*=2),s[e]=t,e+=1}return t}(),Ft=function(){var t=-999999;function e(t,e,i){var s,r,n,a,o,h,l,c,p,d=i.lastIndex,u=this.keyframes;if(t<u[0].t-this.offsetTime)s=u[0].s[0],n=!0,d=0;else if(t>=u[u.length-1].t-this.offsetTime)s=u[u.length-1].s?u[u.length-1].s[0]:u[u.length-2].e[0],n=!0;else{for(var f,m,g,y=d,v=u.length-1,b=!0;b&&(f=u[y],!((m=u[y+1]).t-this.offsetTime>t));)y<v-1?y+=1:b=!1;if(g=this.keyframesMetadata[y]||{},d=y,!(n=1===f.h)){if(t>=m.t-this.offsetTime)c=1;else if(t<f.t-this.offsetTime)c=0;else{var w;g.__fnct?w=g.__fnct:(w=at.getBezierEasing(f.o.x,f.o.y,f.i.x,f.i.y).get,g.__fnct=w),c=w((t-(f.t-this.offsetTime))/(m.t-this.offsetTime-(f.t-this.offsetTime)))}r=m.s?m.s[0]:f.e[0]}s=f.s[0]}for(h=e._length,l=s.i[0].length,i.lastIndex=d,a=0;a<h;a+=1)for(o=0;o<l;o+=1)p=n?s.i[a][o]:s.i[a][o]+(r.i[a][o]-s.i[a][o])*c,e.i[a][o]=p,p=n?s.o[a][o]:s.o[a][o]+(r.o[a][o]-s.o[a][o])*c,e.o[a][o]=p,p=n?s.v[a][o]:s.v[a][o]+(r.v[a][o]-s.v[a][o])*c,e.v[a][o]=p}function i(){var e=this.comp.renderedFrame-this.offsetTime,i=this.keyframes[0].t-this.offsetTime,s=this.keyframes[this.keyframes.length-1].t-this.offsetTime,r=this._caching.lastFrame;return r!==t&&(r<i&&e<i||r>s&&e>s)||(this._caching.lastIndex=r<e?this._caching.lastIndex:0,this.interpolateShape(e,this.pv,this._caching)),this._caching.lastFrame=e,this.pv}function s(){this.paths=this.localShapeCollection}function r(t,e){if(t._length!==e._length||t.c!==e.c)return!1;var i,s=t._length;for(i=0;i<s;i+=1)if(t.v[i][0]!==e.v[i][0]||t.v[i][1]!==e.v[i][1]||t.o[i][0]!==e.o[i][0]||t.o[i][1]!==e.o[i][1]||t.i[i][0]!==e.i[i][0]||t.i[i][1]!==e.i[i][1])return!1;return!0}function n(t){r(this.v,t)||(this.v=It.clone(t),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function a(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var t,e;this.lock=!0,this._mdf=!1,t=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k;var i=this.effectsSequence.length;for(e=0;e<i;e+=1)t=this.effectsSequence[e](t);this.setVValue(t),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function o(t,e,i){this.propType="shape",this.comp=t.comp,this.container=t,this.elem=t,this.data=e,this.k=!1,this.kf=!1,this._mdf=!1;var r=3===i?e.pt.k:e.ks.k;this.v=It.clone(r),this.pv=It.clone(this.v),this.localShapeCollection=Lt.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=s,this.effectsSequence=[]}function h(t){this.effectsSequence.push(t),this.container.addDynamicProperty(this)}function l(e,r,n){this.propType="shape",this.comp=e.comp,this.elem=e,this.container=e,this.offsetTime=e.data.st,this.keyframes=3===n?r.pt.k:r.ks.k,this.keyframesMetadata=[],this.k=!0,this.kf=!0;var a=this.keyframes[0].s[0].i.length;this.v=It.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,a),this.pv=It.clone(this.v),this.localShapeCollection=Lt.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=t,this.reset=s,this._caching={lastFrame:t,lastIndex:0},this.effectsSequence=[i.bind(this)]}o.prototype.interpolateShape=e,o.prototype.getValue=a,o.prototype.setVValue=n,o.prototype.addEffect=h,l.prototype.getValue=a,l.prototype.interpolateShape=e,l.prototype.setVValue=n,l.prototype.addEffect=h;var p=function(){var t=A;function e(t,e){this.v=It.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=Lt.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=e.d,this.elem=t,this.comp=t.comp,this.frameId=-1,this.initDynamicPropertyContainer(t),this.p=Et.getProp(t,e.p,1,0,this),this.s=Et.getProp(t,e.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return e.prototype={reset:s,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var e=this.p.v[0],i=this.p.v[1],s=this.s.v[0]/2,r=this.s.v[1]/2,n=3!==this.d,a=this.v;a.v[0][0]=e,a.v[0][1]=i-r,a.v[1][0]=n?e+s:e-s,a.v[1][1]=i,a.v[2][0]=e,a.v[2][1]=i+r,a.v[3][0]=n?e-s:e+s,a.v[3][1]=i,a.i[0][0]=n?e-s*t:e+s*t,a.i[0][1]=i-r,a.i[1][0]=n?e+s:e-s,a.i[1][1]=i-r*t,a.i[2][0]=n?e+s*t:e-s*t,a.i[2][1]=i+r,a.i[3][0]=n?e-s:e+s,a.i[3][1]=i+r*t,a.o[0][0]=n?e+s*t:e-s*t,a.o[0][1]=i-r,a.o[1][0]=n?e+s:e-s,a.o[1][1]=i+r*t,a.o[2][0]=n?e-s*t:e+s*t,a.o[2][1]=i+r,a.o[3][0]=n?e-s:e+s,a.o[3][1]=i-r*t}},c([Ct],e),e}(),d=function(){function t(t,e){this.v=It.newElement(),this.v.setPathData(!0,0),this.elem=t,this.comp=t.comp,this.data=e,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),1===e.sy?(this.ir=Et.getProp(t,e.ir,0,0,this),this.is=Et.getProp(t,e.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=Et.getProp(t,e.pt,0,0,this),this.p=Et.getProp(t,e.p,1,0,this),this.r=Et.getProp(t,e.r,0,x,this),this.or=Et.getProp(t,e.or,0,0,this),this.os=Et.getProp(t,e.os,0,.01,this),this.localShapeCollection=Lt.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return t.prototype={reset:s,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var t,e,i,s,r=2*Math.floor(this.pt.v),n=2*Math.PI/r,a=!0,o=this.or.v,h=this.ir.v,l=this.os.v,c=this.is.v,p=2*Math.PI*o/(2*r),d=2*Math.PI*h/(2*r),u=-Math.PI/2;u+=this.r.v;var f=3===this.data.d?-1:1;for(this.v._length=0,t=0;t<r;t+=1){i=a?l:c,s=a?p:d;var m=(e=a?o:h)*Math.cos(u),g=e*Math.sin(u),y=0===m&&0===g?0:g/Math.sqrt(m*m+g*g),v=0===m&&0===g?0:-m/Math.sqrt(m*m+g*g);m+=+this.p.v[0],g+=+this.p.v[1],this.v.setTripleAt(m,g,m-y*s*i*f,g-v*s*i*f,m+y*s*i*f,g+v*s*i*f,t,!0),a=!a,u+=n*f}},convertPolygonToPath:function(){var t,e=Math.floor(this.pt.v),i=2*Math.PI/e,s=this.or.v,r=this.os.v,n=2*Math.PI*s/(4*e),a=.5*-Math.PI,o=3===this.data.d?-1:1;for(a+=this.r.v,this.v._length=0,t=0;t<e;t+=1){var h=s*Math.cos(a),l=s*Math.sin(a),c=0===h&&0===l?0:l/Math.sqrt(h*h+l*l),p=0===h&&0===l?0:-h/Math.sqrt(h*h+l*l);h+=+this.p.v[0],l+=+this.p.v[1],this.v.setTripleAt(h,l,h-c*n*r*o,l-p*n*r*o,h+c*n*r*o,l+p*n*r*o,t,!0),a+=i*o}this.paths.length=0,this.paths[0]=this.v}},c([Ct],t),t}(),u=function(){function t(t,e){this.v=It.newElement(),this.v.c=!0,this.localShapeCollection=Lt.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=t,this.comp=t.comp,this.frameId=-1,this.d=e.d,this.initDynamicPropertyContainer(t),this.p=Et.getProp(t,e.p,1,0,this),this.s=Et.getProp(t,e.s,1,0,this),this.r=Et.getProp(t,e.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return t.prototype={convertRectToPath:function(){var t=this.p.v[0],e=this.p.v[1],i=this.s.v[0]/2,s=this.s.v[1]/2,r=_(i,s,this.r.v),n=r*(1-A);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(t+i,e-s+r,t+i,e-s+r,t+i,e-s+n,0,!0),this.v.setTripleAt(t+i,e+s-r,t+i,e+s-n,t+i,e+s-r,1,!0),0!==r?(this.v.setTripleAt(t+i-r,e+s,t+i-r,e+s,t+i-n,e+s,2,!0),this.v.setTripleAt(t-i+r,e+s,t-i+n,e+s,t-i+r,e+s,3,!0),this.v.setTripleAt(t-i,e+s-r,t-i,e+s-r,t-i,e+s-n,4,!0),this.v.setTripleAt(t-i,e-s+r,t-i,e-s+n,t-i,e-s+r,5,!0),this.v.setTripleAt(t-i+r,e-s,t-i+r,e-s,t-i+n,e-s,6,!0),this.v.setTripleAt(t+i-r,e-s,t+i-n,e-s,t+i-r,e-s,7,!0)):(this.v.setTripleAt(t-i,e+s,t-i+n,e+s,t-i,e+s,2),this.v.setTripleAt(t-i,e-s,t-i,e-s+n,t-i,e-s,3))):(this.v.setTripleAt(t+i,e-s+r,t+i,e-s+n,t+i,e-s+r,0,!0),0!==r?(this.v.setTripleAt(t+i-r,e-s,t+i-r,e-s,t+i-n,e-s,1,!0),this.v.setTripleAt(t-i+r,e-s,t-i+n,e-s,t-i+r,e-s,2,!0),this.v.setTripleAt(t-i,e-s+r,t-i,e-s+r,t-i,e-s+n,3,!0),this.v.setTripleAt(t-i,e+s-r,t-i,e+s-n,t-i,e+s-r,4,!0),this.v.setTripleAt(t-i+r,e+s,t-i+r,e+s,t-i+n,e+s,5,!0),this.v.setTripleAt(t+i-r,e+s,t+i-n,e+s,t+i-r,e+s,6,!0),this.v.setTripleAt(t+i,e+s-r,t+i,e+s-r,t+i,e+s-n,7,!0)):(this.v.setTripleAt(t-i,e-s,t-i+n,e-s,t-i,e-s,1,!0),this.v.setTripleAt(t-i,e+s,t-i,e+s-n,t-i,e+s,2,!0),this.v.setTripleAt(t+i,e+s,t+i-n,e+s,t+i,e+s,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:s},c([Ct],t),t}();function f(t,e,i){var s;return 3===i||4===i?s=(3===i?e.pt:e.ks).k.length?new l(t,e,i):new o(t,e,i):5===i?s=new u(t,e):6===i?s=new p(t,e):7===i&&(s=new d(t,e)),s.k&&t.addDynamicProperty(s),s}function m(){return o}function g(){return l}var y={};return y.getShapeProp=f,y.getConstructorFunction=m,y.getKeyframedConstructorFunction=g,y}(),Rt=function(){var t=Math.cos,e=Math.sin,i=Math.tan,s=Math.round;function r(){return this.props[0]=1,this.props[1]=0,this.props[2]=0,this.props[3]=0,this.props[4]=0,this.props[5]=1,this.props[6]=0,this.props[7]=0,this.props[8]=0,this.props[9]=0,this.props[10]=1,this.props[11]=0,this.props[12]=0,this.props[13]=0,this.props[14]=0,this.props[15]=1,this}function n(i){if(0===i)return this;var s=t(i),r=e(i);return this._t(s,-r,0,0,r,s,0,0,0,0,1,0,0,0,0,1)}function a(i){if(0===i)return this;var s=t(i),r=e(i);return this._t(1,0,0,0,0,s,-r,0,0,r,s,0,0,0,0,1)}function o(i){if(0===i)return this;var s=t(i),r=e(i);return this._t(s,0,r,0,0,1,0,0,-r,0,s,0,0,0,0,1)}function h(i){if(0===i)return this;var s=t(i),r=e(i);return this._t(s,-r,0,0,r,s,0,0,0,0,1,0,0,0,0,1)}function l(t,e){return this._t(1,e,t,1,0,0)}function c(t,e){return this.shear(i(t),i(e))}function p(s,r){var n=t(r),a=e(r);return this._t(n,a,0,0,-a,n,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,i(s),1,0,0,0,0,1,0,0,0,0,1)._t(n,-a,0,0,a,n,0,0,0,0,1,0,0,0,0,1)}function d(t,e,i){return i||0===i||(i=1),1===t&&1===e&&1===i?this:this._t(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1)}function f(t,e,i,s,r,n,a,o,h,l,c,p,d,u,f,m){return this.props[0]=t,this.props[1]=e,this.props[2]=i,this.props[3]=s,this.props[4]=r,this.props[5]=n,this.props[6]=a,this.props[7]=o,this.props[8]=h,this.props[9]=l,this.props[10]=c,this.props[11]=p,this.props[12]=d,this.props[13]=u,this.props[14]=f,this.props[15]=m,this}function m(t,e,i){return i=i||0,0!==t||0!==e||0!==i?this._t(1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1):this}function g(t,e,i,s,r,n,a,o,h,l,c,p,d,u,f,m){var g=this.props;if(1===t&&0===e&&0===i&&0===s&&0===r&&1===n&&0===a&&0===o&&0===h&&0===l&&1===c&&0===p)return g[12]=g[12]*t+g[15]*d,g[13]=g[13]*n+g[15]*u,g[14]=g[14]*c+g[15]*f,g[15]*=m,this._identityCalculated=!1,this;var y=g[0],v=g[1],b=g[2],w=g[3],k=g[4],_=g[5],T=g[6],x=g[7],A=g[8],S=g[9],E=g[10],C=g[11],P=g[12],D=g[13],I=g[14],M=g[15];return g[0]=y*t+v*r+b*h+w*d,g[1]=y*e+v*n+b*l+w*u,g[2]=y*i+v*a+b*c+w*f,g[3]=y*s+v*o+b*p+w*m,g[4]=k*t+_*r+T*h+x*d,g[5]=k*e+_*n+T*l+x*u,g[6]=k*i+_*a+T*c+x*f,g[7]=k*s+_*o+T*p+x*m,g[8]=A*t+S*r+E*h+C*d,g[9]=A*e+S*n+E*l+C*u,g[10]=A*i+S*a+E*c+C*f,g[11]=A*s+S*o+E*p+C*m,g[12]=P*t+D*r+I*h+M*d,g[13]=P*e+D*n+I*l+M*u,g[14]=P*i+D*a+I*c+M*f,g[15]=P*s+D*o+I*p+M*m,this._identityCalculated=!1,this}function y(t){var e=t.props;return this.transform(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function v(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function b(t){for(var e=0;e<16;){if(t.props[e]!==this.props[e])return!1;e+=1}return!0}function w(t){var e;for(e=0;e<16;e+=1)t.props[e]=this.props[e];return t}function k(t){var e;for(e=0;e<16;e+=1)this.props[e]=t[e]}function _(t,e,i){return{x:t*this.props[0]+e*this.props[4]+i*this.props[8]+this.props[12],y:t*this.props[1]+e*this.props[5]+i*this.props[9]+this.props[13],z:t*this.props[2]+e*this.props[6]+i*this.props[10]+this.props[14]}}function T(t,e,i){return t*this.props[0]+e*this.props[4]+i*this.props[8]+this.props[12]}function x(t,e,i){return t*this.props[1]+e*this.props[5]+i*this.props[9]+this.props[13]}function A(t,e,i){return t*this.props[2]+e*this.props[6]+i*this.props[10]+this.props[14]}function S(){var t=this.props[0]*this.props[5]-this.props[1]*this.props[4],e=this.props[5]/t,i=-this.props[1]/t,s=-this.props[4]/t,r=this.props[0]/t,n=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/t,a=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/t,o=new Rt;return o.props[0]=e,o.props[1]=i,o.props[4]=s,o.props[5]=r,o.props[12]=n,o.props[13]=a,o}function E(t){return this.getInverseMatrix().applyToPointArray(t[0],t[1],t[2]||0)}function C(t){var e,i=t.length,s=[];for(e=0;e<i;e+=1)s[e]=E(t[e]);return s}function P(t,e,i){var s=u("float32",6);if(this.isIdentity())s[0]=t[0],s[1]=t[1],s[2]=e[0],s[3]=e[1],s[4]=i[0],s[5]=i[1];else{var r=this.props[0],n=this.props[1],a=this.props[4],o=this.props[5],h=this.props[12],l=this.props[13];s[0]=t[0]*r+t[1]*a+h,s[1]=t[0]*n+t[1]*o+l,s[2]=e[0]*r+e[1]*a+h,s[3]=e[0]*n+e[1]*o+l,s[4]=i[0]*r+i[1]*a+h,s[5]=i[0]*n+i[1]*o+l}return s}function D(t,e,i){return this.isIdentity()?[t,e,i]:[t*this.props[0]+e*this.props[4]+i*this.props[8]+this.props[12],t*this.props[1]+e*this.props[5]+i*this.props[9]+this.props[13],t*this.props[2]+e*this.props[6]+i*this.props[10]+this.props[14]]}function I(t,e){if(this.isIdentity())return t+","+e;var i=this.props;return Math.round(100*(t*i[0]+e*i[4]+i[12]))/100+","+Math.round(100*(t*i[1]+e*i[5]+i[13]))/100}function M(){for(var t=0,e=this.props,i="matrix3d(",r=1e4;t<16;)i+=s(e[t]*r)/r,i+=15===t?")":",",t+=1;return i}function L(t){var e=1e4;return t<1e-6&&t>0||t>-1e-6&&t<0?s(t*e)/e:t}function F(){var t=this.props;return"matrix("+L(t[0])+","+L(t[1])+","+L(t[4])+","+L(t[5])+","+L(t[12])+","+L(t[13])+")"}return function(){this.reset=r,this.rotate=n,this.rotateX=a,this.rotateY=o,this.rotateZ=h,this.skew=c,this.skewFromAxis=p,this.shear=l,this.scale=d,this.setTransform=f,this.translate=m,this.transform=g,this.multiply=y,this.applyToPoint=_,this.applyToX=T,this.applyToY=x,this.applyToZ=A,this.applyToPointArray=D,this.applyToTriplePoints=P,this.applyToPointStringified=I,this.toCSS=M,this.to2dCSS=F,this.clone=w,this.cloneFromProps=k,this.equals=b,this.inversePoints=C,this.inversePoint=E,this.getInverseMatrix=S,this._t=this.transform,this.isIdentity=v,this._identity=!0,this._identityCalculated=!1,this.props=u("float32",16),this.reset()}}();function Nt(t){return(Nt="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 Ot={};function zt(t){o(t)}function Ut(){nt.searchAnimations()}function Wt(t){U(t)}function jt(t){$(t)}function Bt(t){return nt.loadAnimation(t)}function Vt(t){if("string"==typeof t)switch(t){case"high":V(200);break;default:case"medium":V(50);break;case"low":V(10)}else!isNaN(t)&&t>1&&V(t)}function Ht(){return"undefined"!=typeof navigator}function $t(t,e){"expressions"===t&&j(e)}function qt(t){switch(t){case"propertyFactory":return Et;case"shapePropertyFactory":return Ft;case"matrix":return Rt;default:return null}}function Gt(){"complete"===document.readyState&&(clearInterval(Qt),Ut())}function Yt(t){for(var e=Xt.split("&"),i=0;i<e.length;i+=1){var s=e[i].split("=");if(decodeURIComponent(s[0])==t)return decodeURIComponent(s[1])}return null}Ot.play=nt.play,Ot.pause=nt.pause,Ot.setLocationHref=zt,Ot.togglePause=nt.togglePause,Ot.setSpeed=nt.setSpeed,Ot.setDirection=nt.setDirection,Ot.stop=nt.stop,Ot.searchAnimations=Ut,Ot.registerAnimation=nt.registerAnimation,Ot.loadAnimation=Bt,Ot.setSubframeRendering=Wt,Ot.resize=nt.resize,Ot.goToAndStop=nt.goToAndStop,Ot.destroy=nt.destroy,Ot.setQuality=Vt,Ot.inBrowser=Ht,Ot.installPlugin=$t,Ot.freeze=nt.freeze,Ot.unfreeze=nt.unfreeze,Ot.setVolume=nt.setVolume,Ot.mute=nt.mute,Ot.unmute=nt.unmute,Ot.getRegisteredAnimations=nt.getRegisteredAnimations,Ot.useWebWorker=r,Ot.setIDPrefix=jt,Ot.__getFactory=qt,Ot.version="5.13.0";var Xt="",Kt=document.getElementsByTagName("script"),Jt=Kt.length-1,Zt=Kt[Jt]||{src:""};Xt=Zt.src?Zt.src.replace(/^[^\?]+\??/,""):"",Yt("renderer");var Qt=setInterval(Gt,100);try{"object"!==Nt(n)&&(window.bodymovin=Ot)}catch(Ji){}var te=function(){var t={},e={};function i(t,i){e[t]||(e[t]=i)}function s(t,i,s){return new e[t](i,s)}return t.registerModifier=i,t.getModifier=s,t}();function ee(){}function ie(){}function se(){}ee.prototype.initModifierProperties=function(){},ee.prototype.addShapeToModifier=function(){},ee.prototype.addShape=function(t){if(!this.closed){t.sh.container.addDynamicProperty(t.sh);var e={shape:t.sh,data:t,localShapeCollection:Lt.newShapeCollection()};this.shapes.push(e),this.addShapeToModifier(e),this._isAnimated&&t.setAsAnimated()}},ee.prototype.init=function(t,e){this.shapes=[],this.elem=t,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e),this.frameId=s,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ee.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},c([Ct],ee),c([ee],ie),ie.prototype.initModifierProperties=function(t,e){this.s=Et.getProp(t,e.s,0,.01,this),this.e=Et.getProp(t,e.e,0,.01,this),this.o=Et.getProp(t,e.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=e.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},ie.prototype.addShapeToModifier=function(t){t.pathsData=[]},ie.prototype.calculateShapeEdges=function(t,e,i,s,r){var n=[];e<=1?n.push({s:t,e:e}):t>=1?n.push({s:t-1,e:e-1}):(n.push({s:t,e:1}),n.push({s:0,e:e-1}));var a,o,h=[],l=n.length;for(a=0;a<l;a+=1){var c,p;(o=n[a]).e*r<s||o.s*r>s+i||(c=o.s*r<=s?0:(o.s*r-s)/i,p=o.e*r>=s+i?1:(o.e*r-s)/i,h.push([c,p]))}return h.length||h.push([0,0]),h},ie.prototype.releasePathsData=function(t){var e,i=t.length;for(e=0;e<i;e+=1)ct.release(t[e]);return t.length=0,t},ie.prototype.processShapes=function(t){var e,i,s,r;if(this._mdf||t){var n=this.o.v%360/360;if(n<0&&(n+=1),(e=this.s.v>1?1+n:this.s.v<0?0+n:this.s.v+n)>(i=this.e.v>1?1+n:this.e.v<0?0+n:this.e.v+n)){var a=e;e=i,i=a}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,c,p,d=this.shapes.length,u=0;if(i===e)for(r=0;r<d;r+=1)this.shapes[r].localShapeCollection.releaseShapes(),this.shapes[r].shape._mdf=!0,this.shapes[r].shape.paths=this.shapes[r].localShapeCollection,this._mdf&&(this.shapes[r].pathsData.length=0);else if(1===i&&0===e||0===i&&1===e){if(this._mdf)for(r=0;r<d;r+=1)this.shapes[r].pathsData.length=0,this.shapes[r].shape._mdf=!0}else{var f,m,g=[];for(r=0;r<d;r+=1)if((f=this.shapes[r]).shape._mdf||this._mdf||t||2===this.m){if(h=(s=f.shape.paths)._length,p=0,!f.shape._mdf&&f.pathsData.length)p=f.totalShapeLength;else{for(l=this.releasePathsData(f.pathsData),o=0;o<h;o+=1)c=dt.getSegmentsLength(s.shapes[o]),l.push(c),p+=c.totalLength;f.totalShapeLength=p,f.pathsData=l}u+=p,f.shape._mdf=!0}else f.shape.paths=f.localShapeCollection;var y,v=e,b=i,w=0;for(r=d-1;r>=0;r-=1)if((f=this.shapes[r]).shape._mdf){for((m=f.localShapeCollection).releaseShapes(),2===this.m&&d>1?(y=this.calculateShapeEdges(e,i,f.totalShapeLength,w,u),w+=f.totalShapeLength):y=[[v,b]],h=y.length,o=0;o<h;o+=1){v=y[o][0],b=y[o][1],g.length=0,b<=1?g.push({s:f.totalShapeLength*v,e:f.totalShapeLength*b}):v>=1?g.push({s:f.totalShapeLength*(v-1),e:f.totalShapeLength*(b-1)}):(g.push({s:f.totalShapeLength*v,e:f.totalShapeLength}),g.push({s:0,e:f.totalShapeLength*(b-1)}));var k=this.addShapes(f,g[0]);if(g[0].s!==g[0].e){if(g.length>1)if(f.shape.paths.shapes[f.shape.paths._length-1].c){var _=k.pop();this.addPaths(k,m),k=this.addShapes(f,g[1],_)}else this.addPaths(k,m),k=this.addShapes(f,g[1]);this.addPaths(k,m)}}f.shape.paths=m}}},ie.prototype.addPaths=function(t,e){var i,s=t.length;for(i=0;i<s;i+=1)e.addShape(t[i])},ie.prototype.addSegment=function(t,e,i,s,r,n,a){r.setXYAt(e[0],e[1],"o",n),r.setXYAt(i[0],i[1],"i",n+1),a&&r.setXYAt(t[0],t[1],"v",n),r.setXYAt(s[0],s[1],"v",n+1)},ie.prototype.addSegmentFromArray=function(t,e,i,s){e.setXYAt(t[1],t[5],"o",i),e.setXYAt(t[2],t[6],"i",i+1),s&&e.setXYAt(t[0],t[4],"v",i),e.setXYAt(t[3],t[7],"v",i+1)},ie.prototype.addShapes=function(t,e,i){var s,r,n,a,o,h,l,c,p=t.pathsData,d=t.shape.paths.shapes,u=t.shape.paths._length,f=0,m=[],g=!0;for(i?(o=i._length,c=i._length):(i=It.newElement(),o=0,c=0),m.push(i),s=0;s<u;s+=1){for(h=p[s].lengths,i.c=d[s].c,n=d[s].c?h.length:h.length+1,r=1;r<n;r+=1)if(f+(a=h[r-1]).addedLength<e.s)f+=a.addedLength,i.c=!1;else{if(f>e.e){i.c=!1;break}e.s<=f&&e.e>=f+a.addedLength?(this.addSegment(d[s].v[r-1],d[s].o[r-1],d[s].i[r],d[s].v[r],i,o,g),g=!1):(l=dt.getNewSegment(d[s].v[r-1],d[s].v[r],d[s].o[r-1],d[s].i[r],(e.s-f)/a.addedLength,(e.e-f)/a.addedLength,h[r-1]),this.addSegmentFromArray(l,i,o,g),g=!1,i.c=!1),f+=a.addedLength,o+=1}if(d[s].c&&h.length){if(a=h[r-1],f<=e.e){var y=h[r-1].addedLength;e.s<=f&&e.e>=f+y?(this.addSegment(d[s].v[r-1],d[s].o[r-1],d[s].i[0],d[s].v[0],i,o,g),g=!1):(l=dt.getNewSegment(d[s].v[r-1],d[s].v[0],d[s].o[r-1],d[s].i[0],(e.s-f)/y,(e.e-f)/y,h[r-1]),this.addSegmentFromArray(l,i,o,g),g=!1,i.c=!1)}else i.c=!1;f+=a.addedLength,o+=1}if(i._length&&(i.setXYAt(i.v[c][0],i.v[c][1],"i",c),i.setXYAt(i.v[i._length-1][0],i.v[i._length-1][1],"o",i._length-1)),f>e.e)break;s<u-1&&(i=It.newElement(),g=!0,m.push(i),o=0)}return m},c([ee],se),se.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=Et.getProp(t,e.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},se.prototype.processPath=function(t,e){var i=e/100,s=[0,0],r=t._length,n=0;for(n=0;n<r;n+=1)s[0]+=t.v[n][0],s[1]+=t.v[n][1];s[0]/=r,s[1]/=r;var a,o,h,l,c,p,d=It.newElement();for(d.c=t.c,n=0;n<r;n+=1)a=t.v[n][0]+(s[0]-t.v[n][0])*i,o=t.v[n][1]+(s[1]-t.v[n][1])*i,h=t.o[n][0]+(s[0]-t.o[n][0])*-i,l=t.o[n][1]+(s[1]-t.o[n][1])*-i,c=t.i[n][0]+(s[0]-t.i[n][0])*-i,p=t.i[n][1]+(s[1]-t.i[n][1])*-i,d.setTripleAt(a,o,h,l,c,p,n);return d},se.prototype.processShapes=function(t){var e,i,s,r,n,a,o=this.shapes.length,h=this.amount.v;if(0!==h)for(i=0;i<o;i+=1){if(a=(n=this.shapes[i]).localShapeCollection,n.shape._mdf||this._mdf||t)for(a.releaseShapes(),n.shape._mdf=!0,e=n.shape.paths.shapes,r=n.shape.paths._length,s=0;s<r;s+=1)a.addShape(this.processPath(e[s],h));n.shape.paths=n.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)};var re=function(){var t=[0,0];function e(t){var e=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||e,this.a&&t.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&t.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&t.skewFromAxis(-this.sk.v,this.sa.v),this.r?t.rotate(-this.r.v):t.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.data.p.s?this.data.p.z?t.translate(this.px.v,this.py.v,-this.pz.v):t.translate(this.px.v,this.py.v,0):t.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}function i(e){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||e){var i;if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&this.v.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.autoOriented){var s,r;if(i=this.elem.globalData.frameRate,this.p&&this.p.keyframes&&this.p.getValueAtTime)this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(s=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/i,0),r=this.p.getValueAtTime(this.p.keyframes[0].t/i,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(s=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/i,0),r=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/i,0)):(s=this.p.pv,r=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){s=[],r=[];var n=this.px,a=this.py;n._caching.lastFrame+n.offsetTime<=n.keyframes[0].t?(s[0]=n.getValueAtTime((n.keyframes[0].t+.01)/i,0),s[1]=a.getValueAtTime((a.keyframes[0].t+.01)/i,0),r[0]=n.getValueAtTime(n.keyframes[0].t/i,0),r[1]=a.getValueAtTime(a.keyframes[0].t/i,0)):n._caching.lastFrame+n.offsetTime>=n.keyframes[n.keyframes.length-1].t?(s[0]=n.getValueAtTime(n.keyframes[n.keyframes.length-1].t/i,0),s[1]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/i,0),r[0]=n.getValueAtTime((n.keyframes[n.keyframes.length-1].t-.01)/i,0),r[1]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/i,0)):(s=[n.pv,a.pv],r[0]=n.getValueAtTime((n._caching.lastFrame+n.offsetTime-.01)/i,n.offsetTime),r[1]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/i,a.offsetTime))}else s=r=t;this.v.rotate(-Math.atan2(s[1]-r[1],s[0]-r[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}}function s(){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)}}function r(){}function n(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0}function a(t,e,i){if(this.elem=t,this.frameId=-1,this.propType="transform",this.data=e,this.v=new Rt,this.pre=new Rt,this.appliedTransformations=0,this.initDynamicPropertyContainer(i||t),e.p&&e.p.s?(this.px=Et.getProp(t,e.p.x,0,0,this),this.py=Et.getProp(t,e.p.y,0,0,this),e.p.z&&(this.pz=Et.getProp(t,e.p.z,0,0,this))):this.p=Et.getProp(t,e.p||{k:[0,0,0]},1,0,this),e.rx){if(this.rx=Et.getProp(t,e.rx,0,x,this),this.ry=Et.getProp(t,e.ry,0,x,this),this.rz=Et.getProp(t,e.rz,0,x,this),e.or.k[0].ti){var s,r=e.or.k.length;for(s=0;s<r;s+=1)e.or.k[s].to=null,e.or.k[s].ti=null}this.or=Et.getProp(t,e.or,1,x,this),this.or.sh=!0}else this.r=Et.getProp(t,e.r||{k:0},0,x,this);e.sk&&(this.sk=Et.getProp(t,e.sk,0,x,this),this.sa=Et.getProp(t,e.sa,0,x,this)),this.a=Et.getProp(t,e.a||{k:[0,0,0]},1,0,this),this.s=Et.getProp(t,e.s||{k:[100,100,100]},1,.01,this),e.o?this.o=Et.getProp(t,e.o,0,.01,t):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}function o(t,e,i){return new a(t,e,i)}return a.prototype={applyToMatrix:e,getValue:i,precalculateMatrix:s,autoOrient:r},c([Ct],a),a.prototype.addDynamicProperty=n,a.prototype._addDynamicProperty=Ct.prototype.addDynamicProperty,{getTransformProperty:o}}();function ne(){}function ae(){}function oe(t,e){return 1e5*Math.abs(t-e)<=Math.min(Math.abs(t),Math.abs(e))}function he(t){return Math.abs(t)<=1e-5}function le(t,e,i){return t*(1-i)+e*i}function ce(t,e,i){return[le(t[0],e[0],i),le(t[1],e[1],i)]}function pe(t,e,i){if(0===t)return[];var s=e*e-4*t*i;if(s<0)return[];var r=-e/(2*t);if(0===s)return[r];var n=Math.sqrt(s)/(2*t);return[r-n,r+n]}function de(t,e,i,s){return[3*e-t-3*i+s,3*t-6*e+3*i,-3*t+3*e,t]}function ue(t){return new fe(t,t,t,t,!1)}function fe(t,e,i,s,r){r&&xe(t,e)&&(e=ce(t,s,1/3)),r&&xe(i,s)&&(i=ce(t,s,2/3));var n=de(t[0],e[0],i[0],s[0]),a=de(t[1],e[1],i[1],s[1]);this.a=[n[0],a[0]],this.b=[n[1],a[1]],this.c=[n[2],a[2]],this.d=[n[3],a[3]],this.points=[t,e,i,s]}function me(t,e){var i=t.points[0][e],s=t.points[t.points.length-1][e];if(i>s){var r=s;s=i,i=r}for(var n=pe(3*t.a[e],2*t.b[e],t.c[e]),a=0;a<n.length;a+=1)if(n[a]>0&&n[a]<1){var o=t.point(n[a])[e];o<i?i=o:o>s&&(s=o)}return{min:i,max:s}}function ge(t,e,i){var s=t.boundingBox();return{cx:s.cx,cy:s.cy,width:s.width,height:s.height,bez:t,t:(e+i)/2,t1:e,t2:i}}function ye(t){var e=t.bez.split(.5);return[ge(e[0],t.t1,t.t),ge(e[1],t.t,t.t2)]}function ve(t,e){return 2*Math.abs(t.cx-e.cx)<t.width+e.width&&2*Math.abs(t.cy-e.cy)<t.height+e.height}function be(t,e,i,s,r,n){if(ve(t,e))if(i>=n||t.width<=s&&t.height<=s&&e.width<=s&&e.height<=s)r.push([t.t,e.t]);else{var a=ye(t),o=ye(e);be(a[0],o[0],i+1,s,r,n),be(a[0],o[1],i+1,s,r,n),be(a[1],o[0],i+1,s,r,n),be(a[1],o[1],i+1,s,r,n)}}function we(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 ke(t,e,i,s){var r=[t[0],t[1],1],n=[e[0],e[1],1],a=[i[0],i[1],1],o=[s[0],s[1],1],h=we(we(r,n),we(a,o));return he(h[2])?null:[h[0]/h[2],h[1]/h[2]]}function _e(t,e,i){return[t[0]+Math.cos(e)*i,t[1]-Math.sin(e)*i]}function Te(t,e){return Math.hypot(t[0]-e[0],t[1]-e[1])}function xe(t,e){return oe(t[0],e[0])&&oe(t[1],e[1])}function Ae(){}function Se(t,e,i,s,r,n,a){var o=i-Math.PI/2,h=i+Math.PI/2,l=e[0]+Math.cos(i)*s*r,c=e[1]-Math.sin(i)*s*r;t.setTripleAt(l,c,l+Math.cos(o)*n,c-Math.sin(o)*n,l+Math.cos(h)*a,c-Math.sin(h)*a,t.length())}function Ee(t,e){var i=[e[0]-t[0],e[1]-t[1]],s=.5*-Math.PI;return[Math.cos(s)*i[0]-Math.sin(s)*i[1],Math.sin(s)*i[0]+Math.cos(s)*i[1]]}function Ce(t,e){var i=0===e?t.length()-1:e-1,s=(e+1)%t.length(),r=Ee(t.v[i],t.v[s]);return Math.atan2(0,1)-Math.atan2(r[1],r[0])}function Pe(t,e,i,s,r,n,a){var o=Ce(e,i),h=e.v[i%e._length],l=e.v[0===i?e._length-1:i-1],c=e.v[(i+1)%e._length],p=2===n?Math.sqrt(Math.pow(h[0]-l[0],2)+Math.pow(h[1]-l[1],2)):0,d=2===n?Math.sqrt(Math.pow(h[0]-c[0],2)+Math.pow(h[1]-c[1],2)):0;Se(t,e.v[i%e._length],o,a,s,d/(2*(r+1)),p/(2*(r+1)))}function De(t,e,i,s,r,n){for(var a=0;a<s;a+=1){var o=(a+1)/(s+1),h=2===r?Math.sqrt(Math.pow(e.points[3][0]-e.points[0][0],2)+Math.pow(e.points[3][1]-e.points[0][1],2)):0,l=e.normalAngle(o);Se(t,e.point(o),l,n,i,h/(2*(s+1)),h/(2*(s+1))),n=-n}return n}function Ie(t,e,i){var s=Math.atan2(e[0]-t[0],e[1]-t[1]);return[_e(t,s,i),_e(e,s,i)]}function Me(t,e){var i,s,r,n,a,o,h;i=(h=Ie(t.points[0],t.points[1],e))[0],s=h[1],r=(h=Ie(t.points[1],t.points[2],e))[0],n=h[1],a=(h=Ie(t.points[2],t.points[3],e))[0],o=h[1];var l=ke(i,s,r,n);null===l&&(l=s);var c=ke(a,o,r,n);return null===c&&(c=a),new fe(i,l,c,o)}function Le(t,e,i,s,r){var n=e.points[3],a=i.points[0];if(3===s)return n;if(xe(n,a))return n;if(2===s){var o=-e.tangentAngle(1),h=-i.tangentAngle(0)+Math.PI,l=ke(n,_e(n,o+Math.PI/2,100),a,_e(a,o+Math.PI/2,100)),c=l?Te(l,n):Te(n,a)/2,p=_e(n,o,2*c*A);return t.setXYAt(p[0],p[1],"o",t.length()-1),p=_e(a,h,2*c*A),t.setTripleAt(a[0],a[1],a[0],a[1],p[0],p[1],t.length()),a}var d=ke(xe(n,e.points[2])?e.points[0]:e.points[2],n,a,xe(a,i.points[1])?i.points[3]:i.points[1]);return d&&Te(d,n)<r?(t.setTripleAt(d[0],d[1],d[0],d[1],d[0],d[1],t.length()),d):n}function Fe(t,e){var i=t.intersections(e);return i.length&&oe(i[0][0],1)&&i.shift(),i.length?i[0]:null}function Re(t,e){var i=t.slice(),s=e.slice(),r=Fe(t[t.length-1],e[0]);return r&&(i[t.length-1]=t[t.length-1].split(r[0])[0],s[0]=e[0].split(r[1])[1]),t.length>1&&e.length>1&&(r=Fe(t[0],e[e.length-1]))?[[t[0].split(r[0])[0]],[e[e.length-1].split(r[1])[1]]]:[i,s]}function Ne(t){for(var e,i=1;i<t.length;i+=1)e=Re(t[i-1],t[i]),t[i-1]=e[0],t[i]=e[1];return t.length>1&&(e=Re(t[t.length-1],t[0]),t[t.length-1]=e[0],t[0]=e[1]),t}function Oe(t,e){var i,s,r,n,a=t.inflectionPoints();if(0===a.length)return[Me(t,e)];if(1===a.length||oe(a[1],1))return i=(r=t.split(a[0]))[0],s=r[1],[Me(i,e),Me(s,e)];i=(r=t.split(a[0]))[0];var o=(a[1]-a[0])/(1-a[0]);return n=(r=r[1].split(o))[0],s=r[1],[Me(i,e),Me(n,e),Me(s,e)]}function ze(){}function Ue(t){for(var e=t.fStyle?t.fStyle.split(" "):[],i="normal",s="normal",r=e.length,n=0;n<r;n+=1)switch(e[n].toLowerCase()){case"italic":s="italic";break;case"bold":i="700";break;case"black":i="900";break;case"medium":i="500";break;case"regular":case"normal":i="400";break;case"light":case"thin":i="200"}return{style:s,weight:t.fWeight||i}}c([ee],ne),ne.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.c=Et.getProp(t,e.c,0,null,this),this.o=Et.getProp(t,e.o,0,null,this),this.tr=re.getTransformProperty(t,e.tr,this),this.so=Et.getProp(t,e.tr.so,0,.01,this),this.eo=Et.getProp(t,e.tr.eo,0,.01,this),this.data=e,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Rt,this.rMatrix=new Rt,this.sMatrix=new Rt,this.tMatrix=new Rt,this.matrix=new Rt},ne.prototype.applyTransforms=function(t,e,i,s,r,n){var a=n?-1:1,o=s.s.v[0]+(1-s.s.v[0])*(1-r),h=s.s.v[1]+(1-s.s.v[1])*(1-r);t.translate(s.p.v[0]*a*r,s.p.v[1]*a*r,s.p.v[2]),e.translate(-s.a.v[0],-s.a.v[1],s.a.v[2]),e.rotate(-s.r.v*a*r),e.translate(s.a.v[0],s.a.v[1],s.a.v[2]),i.translate(-s.a.v[0],-s.a.v[1],s.a.v[2]),i.scale(n?1/o:o,n?1/h:h),i.translate(s.a.v[0],s.a.v[1],s.a.v[2])},ne.prototype.init=function(t,e,i,s){for(this.elem=t,this.arr=e,this.pos=i,this.elemsData=s,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(t),this.initModifierProperties(t,e[i]);i>0;)i-=1,this._elements.unshift(e[i]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ne.prototype.resetElements=function(t){var e,i=t.length;for(e=0;e<i;e+=1)t[e]._processed=!1,"gr"===t[e].ty&&this.resetElements(t[e].it)},ne.prototype.cloneElements=function(t){var e=JSON.parse(JSON.stringify(t));return this.resetElements(e),e},ne.prototype.changeGroupRender=function(t,e){var i,s=t.length;for(i=0;i<s;i+=1)t[i]._render=e,"gr"===t[i].ty&&this.changeGroupRender(t[i].it,e)},ne.prototype.processShapes=function(t){var e,i,s,r,n,a=!1;if(this._mdf||t){var o,h=Math.ceil(this.c.v);if(this._groups.length<h){for(;this._groups.length<h;){var l={it:this.cloneElements(this._elements),ty:"gr"};l.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,l),this._groups.splice(0,0,l),this._currentCopies+=1}this.elem.reloadShapes(),a=!0}for(n=0,s=0;s<=this._groups.length-1;s+=1){if(o=n<h,this._groups[s]._render=o,this.changeGroupRender(this._groups[s].it,o),!o){var c=this.elemsData[s].it,p=c[c.length-1];0!==p.transform.op.v?(p.transform.op._mdf=!0,p.transform.op.v=0):p.transform.op._mdf=!1}n+=1}this._currentCopies=h;var d=this.o.v,u=d%1,f=d>0?Math.floor(d):Math.ceil(d),m=this.pMatrix.props,g=this.rMatrix.props,y=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var v,b,w=0;if(d>0){for(;w<f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),w+=1;u&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,u,!1),w+=u)}else if(d<0){for(;w>f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),w-=1;u&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-u,!0),w-=u)}for(s=1===this.data.m?0:this._currentCopies-1,r=1===this.data.m?1:-1,n=this._currentCopies;n;){if(b=(i=(e=this.elemsData[s].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)*(s/(this._currentCopies-1)),0!==w){for((0!==s&&1===r||s!==this._currentCopies-1&&-1===r)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),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(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(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15]),v=0;v<b;v+=1)i[v]=this.matrix.props[v];this.matrix.reset()}else for(this.matrix.reset(),v=0;v<b;v+=1)i[v]=this.matrix.props[v];w+=1,n-=1,s+=r}}else for(n=this._currentCopies,s=0,r=1;n;)i=(e=this.elemsData[s].it)[e.length-1].transform.mProps.v.props,e[e.length-1].transform.mProps._mdf=!1,e[e.length-1].transform.op._mdf=!1,n-=1,s+=r;return a},ne.prototype.addShape=function(){},c([ee],ae),ae.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.rd=Et.getProp(t,e.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},ae.prototype.processPath=function(t,e){var i,s=It.newElement();s.c=t.c;var r,n,a,o,h,l,c,p,d,u,f,m,g=t._length,y=0;for(i=0;i<g;i+=1)r=t.v[i],a=t.o[i],n=t.i[i],r[0]===a[0]&&r[1]===a[1]&&r[0]===n[0]&&r[1]===n[1]?0!==i&&i!==g-1||t.c?(o=0===i?t.v[g-1]:t.v[i-1],l=(h=Math.sqrt(Math.pow(r[0]-o[0],2)+Math.pow(r[1]-o[1],2)))?Math.min(h/2,e)/h:0,c=f=r[0]+(o[0]-r[0])*l,p=m=r[1]-(r[1]-o[1])*l,d=c-(c-r[0])*A,u=p-(p-r[1])*A,s.setTripleAt(c,p,d,u,f,m,y),y+=1,o=i===g-1?t.v[0]:t.v[i+1],l=(h=Math.sqrt(Math.pow(r[0]-o[0],2)+Math.pow(r[1]-o[1],2)))?Math.min(h/2,e)/h:0,c=d=r[0]+(o[0]-r[0])*l,p=u=r[1]+(o[1]-r[1])*l,f=c-(c-r[0])*A,m=p-(p-r[1])*A,s.setTripleAt(c,p,d,u,f,m,y),y+=1):(s.setTripleAt(r[0],r[1],a[0],a[1],n[0],n[1],y),y+=1):(s.setTripleAt(t.v[i][0],t.v[i][1],t.o[i][0],t.o[i][1],t.i[i][0],t.i[i][1],y),y+=1);return s},ae.prototype.processShapes=function(t){var e,i,s,r,n,a,o=this.shapes.length,h=this.rd.v;if(0!==h)for(i=0;i<o;i+=1){if(a=(n=this.shapes[i]).localShapeCollection,n.shape._mdf||this._mdf||t)for(a.releaseShapes(),n.shape._mdf=!0,e=n.shape.paths.shapes,r=n.shape.paths._length,s=0;s<r;s+=1)a.addShape(this.processPath(e[s],h));n.shape.paths=n.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},fe.prototype.point=function(t){return[((this.a[0]*t+this.b[0])*t+this.c[0])*t+this.d[0],((this.a[1]*t+this.b[1])*t+this.c[1])*t+this.d[1]]},fe.prototype.derivative=function(t){return[(3*t*this.a[0]+2*this.b[0])*t+this.c[0],(3*t*this.a[1]+2*this.b[1])*t+this.c[1]]},fe.prototype.tangentAngle=function(t){var e=this.derivative(t);return Math.atan2(e[1],e[0])},fe.prototype.normalAngle=function(t){var e=this.derivative(t);return Math.atan2(e[0],e[1])},fe.prototype.inflectionPoints=function(){var t=this.a[1]*this.b[0]-this.a[0]*this.b[1];if(he(t))return[];var e=-.5*(this.a[1]*this.c[0]-this.a[0]*this.c[1])/t,i=e*e-1/3*(this.b[1]*this.c[0]-this.b[0]*this.c[1])/t;if(i<0)return[];var s=Math.sqrt(i);return he(s)?s>0&&s<1?[e]:[]:[e-s,e+s].filter(function(t){return t>0&&t<1})},fe.prototype.split=function(t){if(t<=0)return[ue(this.points[0]),this];if(t>=1)return[this,ue(this.points[this.points.length-1])];var e=ce(this.points[0],this.points[1],t),i=ce(this.points[1],this.points[2],t),s=ce(this.points[2],this.points[3],t),r=ce(e,i,t),n=ce(i,s,t),a=ce(r,n,t);return[new fe(this.points[0],e,r,a,!0),new fe(a,n,s,this.points[3],!0)]},fe.prototype.bounds=function(){return{x:me(this,0),y:me(this,1)}},fe.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}},fe.prototype.intersections=function(t,e,i){void 0===e&&(e=2),void 0===i&&(i=7);var s=[];return be(ge(this,0,1),ge(t,0,1),0,e,s,i),s},fe.shapeSegment=function(t,e){var i=(e+1)%t.length();return new fe(t.v[e],t.o[e],t.i[i],t.v[i],!0)},fe.shapeSegmentInverted=function(t,e){var i=(e+1)%t.length();return new fe(t.v[i],t.i[i],t.o[e],t.v[e],!0)},c([ee],Ae),Ae.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amplitude=Et.getProp(t,e.s,0,null,this),this.frequency=Et.getProp(t,e.r,0,null,this),this.pointsType=Et.getProp(t,e.pt,0,null,this),this._isAnimated=0!==this.amplitude.effectsSequence.length||0!==this.frequency.effectsSequence.length||0!==this.pointsType.effectsSequence.length},Ae.prototype.processPath=function(t,e,i,s){var r=t._length,n=It.newElement();if(n.c=t.c,t.c||(r-=1),0===r)return n;var a=-1,o=fe.shapeSegment(t,0);Pe(n,t,0,e,i,s,a);for(var h=0;h<r;h+=1)a=De(n,o,e,i,s,-a),o=h!==r-1||t.c?fe.shapeSegment(t,(h+1)%r):null,Pe(n,t,h+1,e,i,s,a);return n},Ae.prototype.processShapes=function(t){var e,i,s,r,n,a,o=this.shapes.length,h=this.amplitude.v,l=Math.max(0,Math.round(this.frequency.v)),c=this.pointsType.v;if(0!==h)for(i=0;i<o;i+=1){if(a=(n=this.shapes[i]).localShapeCollection,n.shape._mdf||this._mdf||t)for(a.releaseShapes(),n.shape._mdf=!0,e=n.shape.paths.shapes,r=n.shape.paths._length,s=0;s<r;s+=1)a.addShape(this.processPath(e[s],h,l,c));n.shape.paths=n.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},c([ee],ze),ze.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amount=Et.getProp(t,e.a,0,null,this),this.miterLimit=Et.getProp(t,e.ml,0,null,this),this.lineJoin=e.lj,this._isAnimated=0!==this.amount.effectsSequence.length},ze.prototype.processPath=function(t,e,i,s){var r=It.newElement();r.c=t.c;var n,a,o,h=t.length();t.c||(h-=1);var l=[];for(n=0;n<h;n+=1)o=fe.shapeSegment(t,n),l.push(Oe(o,e));if(!t.c)for(n=h-1;n>=0;n-=1)o=fe.shapeSegmentInverted(t,n),l.push(Oe(o,e));l=Ne(l);var c=null,p=null;for(n=0;n<l.length;n+=1){var d=l[n];for(p&&(c=Le(r,p,d[0],i,s)),p=d[d.length-1],a=0;a<d.length;a+=1)o=d[a],c&&xe(o.points[0],c)?r.setXYAt(o.points[1][0],o.points[1][1],"o",r.length()-1):r.setTripleAt(o.points[0][0],o.points[0][1],o.points[1][0],o.points[1][1],o.points[0][0],o.points[0][1],r.length()),r.setTripleAt(o.points[3][0],o.points[3][1],o.points[3][0],o.points[3][1],o.points[2][0],o.points[2][1],r.length()),c=o.points[3]}return l.length&&Le(r,p,l[0][0],i,s),r},ze.prototype.processShapes=function(t){var e,i,s,r,n,a,o=this.shapes.length,h=this.amount.v,l=this.miterLimit.v,c=this.lineJoin;if(0!==h)for(i=0;i<o;i+=1){if(a=(n=this.shapes[i]).localShapeCollection,n.shape._mdf||this._mdf||t)for(a.releaseShapes(),n.shape._mdf=!0,e=n.shape.paths.shapes,r=n.shape.paths._length,s=0;s<r;s+=1)a.addShape(this.processPath(e[s],h,c,l));n.shape.paths=n.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)};var We=function(){var t=5e3,e={w:0,size:0,shapes:[],data:{shapes:[]}},i=[];i=i.concat([2304,2305,2306,2307,2362,2363,2364,2364,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2387,2388,2389,2390,2391,2402,2403]);var s=127988,r=917631,n=917601,a=917626,o=65039,h=8205,c=127462,p=127487,d=["d83cdffb","d83cdffc","d83cdffd","d83cdffe","d83cdfff"];function u(t){var e,i=t.split(","),s=i.length,r=[];for(e=0;e<s;e+=1)"sans-serif"!==i[e]&&"monospace"!==i[e]&&r.push(i[e]);return r.join(",")}function f(t,e){var i=l("span");i.setAttribute("aria-hidden",!0),i.style.fontFamily=e;var s=l("span");s.innerText="giItT1WQy@!-/#",i.style.position="absolute",i.style.left="-10000px",i.style.top="-10000px",i.style.fontSize="300px",i.style.fontVariant="normal",i.style.fontStyle="normal",i.style.fontWeight="normal",i.style.letterSpacing="0",i.appendChild(s),document.body.appendChild(i);var r=s.offsetWidth;return s.style.fontFamily=u(t)+", "+e,{node:s,w:r,parent:i}}function m(){var e,i,s,r=this.fonts.length,n=r;for(e=0;e<r;e+=1)this.fonts[e].loaded?n-=1:"n"===this.fonts[e].fOrigin||0===this.fonts[e].origin?this.fonts[e].loaded=!0:(i=this.fonts[e].monoCase.node,s=this.fonts[e].monoCase.w,i.offsetWidth!==s?(n-=1,this.fonts[e].loaded=!0):(i=this.fonts[e].sansCase.node,s=this.fonts[e].sansCase.w,i.offsetWidth!==s&&(n-=1,this.fonts[e].loaded=!0)),this.fonts[e].loaded&&(this.fonts[e].sansCase.parent.parentNode.removeChild(this.fonts[e].sansCase.parent),this.fonts[e].monoCase.parent.parentNode.removeChild(this.fonts[e].monoCase.parent)));0!==n&&Date.now()-this.initTime<t?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)}function g(t,e){var i,s=document.body&&e?"svg":"canvas",r=Ue(t);if("svg"===s){var n=q("text");n.style.fontSize="100px",n.setAttribute("font-family",t.fFamily),n.setAttribute("font-style",r.style),n.setAttribute("font-weight",r.weight),n.textContent="1",t.fClass?(n.style.fontFamily="inherit",n.setAttribute("class",t.fClass)):n.style.fontFamily=t.fFamily,e.appendChild(n),i=n}else{var a=new OffscreenCanvas(500,500).getContext("2d");a.font=r.style+" "+r.weight+" 100px "+t.fFamily,i=a}function o(t){return"svg"===s?(i.textContent=t,i.getComputedTextLength()):i.measureText(t).width}return{measureText:o}}function y(t,e){if(t){if(this.chars)return this.isLoaded=!0,void(this.fonts=t.list);if(!document.body)return this.isLoaded=!0,t.list.forEach(function(t){t.helper=g(t),t.cache={}}),void(this.fonts=t.list);var i,s=t.list,r=s.length,n=r;for(i=0;i<r;i+=1){var a,o,h=!0;if(s[i].loaded=!1,s[i].monoCase=f(s[i].fFamily,"monospace"),s[i].sansCase=f(s[i].fFamily,"sans-serif"),s[i].fPath){if("p"===s[i].fOrigin||3===s[i].origin){if((a=document.querySelectorAll('style[f-forigin="p"][f-family="'+s[i].fFamily+'"], style[f-origin="3"][f-family="'+s[i].fFamily+'"]')).length>0&&(h=!1),h){var c=l("style");c.setAttribute("f-forigin",s[i].fOrigin),c.setAttribute("f-origin",s[i].origin),c.setAttribute("f-family",s[i].fFamily),c.type="text/css",c.innerText="@font-face {font-family: "+s[i].fFamily+"; font-style: normal; src: url('"+s[i].fPath+"');}",e.appendChild(c)}}else if("g"===s[i].fOrigin||1===s[i].origin){for(a=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),o=0;o<a.length;o+=1)-1!==a[o].href.indexOf(s[i].fPath)&&(h=!1);if(h){var p=l("link");p.setAttribute("f-forigin",s[i].fOrigin),p.setAttribute("f-origin",s[i].origin),p.type="text/css",p.rel="stylesheet",p.href=s[i].fPath,document.body.appendChild(p)}}else if("t"===s[i].fOrigin||2===s[i].origin){for(a=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),o=0;o<a.length;o+=1)s[i].fPath===a[o].src&&(h=!1);if(h){var d=l("link");d.setAttribute("f-forigin",s[i].fOrigin),d.setAttribute("f-origin",s[i].origin),d.setAttribute("rel","stylesheet"),d.setAttribute("href",s[i].fPath),e.appendChild(d)}}}else s[i].loaded=!0,n-=1;s[i].helper=g(s[i],e),s[i].cache={},this.fonts.push(s[i])}0===n?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0}function v(t){if(t){var e;this.chars||(this.chars=[]);var i,s,r=t.length,n=this.chars.length;for(e=0;e<r;e+=1){for(i=0,s=!1;i<n;)this.chars[i].style===t[e].style&&this.chars[i].fFamily===t[e].fFamily&&this.chars[i].ch===t[e].ch&&(s=!0),i+=1;s||(this.chars.push(t[e]),n+=1)}}}function b(t,i,s){for(var r=0,n=this.chars.length;r<n;){if(this.chars[r].ch===t&&this.chars[r].style===i&&this.chars[r].fFamily===s)return this.chars[r];r+=1}return("string"==typeof t&&13!==t.charCodeAt(0)||!t)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",t,i,s)),e}function w(t,e,i){var s=this.getFontByName(e),r=t;if(!s.cache[r]){var n=s.helper;if(" "===t){var a=n.measureText("|"+t+"|"),o=n.measureText("||");s.cache[r]=(a-o)/100}else s.cache[r]=n.measureText(t)/100}return s.cache[r]*i}function k(t){for(var e=0,i=this.fonts.length;e<i;){if(this.fonts[e].fName===t)return this.fonts[e];e+=1}return this.fonts[0]}function _(t){var e=0,i=t.charCodeAt(0);if(i>=55296&&i<=56319){var s=t.charCodeAt(1);s>=56320&&s<=57343&&(e=1024*(i-55296)+s-56320+65536)}return e}function T(t,e){var i=t.toString(16)+e.toString(16);return-1!==d.indexOf(i)}function x(t){return t===h}function A(t){return t===o}function S(t){var e=_(t);return e>=c&&e<=p}function E(t){return S(t.substr(0,2))&&S(t.substr(2,2))}function C(t){return-1!==i.indexOf(t)}function P(t,e){var i=_(t.substr(e,2));if(i!==s)return!1;var o=0;for(e+=2;o<5;){if((i=_(t.substr(e,2)))<n||i>a)return!1;o+=1,e+=2}return _(t.substr(e,2))===r}function D(){this.isLoaded=!0}var I=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)};I.isModifier=T,I.isZeroWidthJoiner=x,I.isFlagEmoji=E,I.isRegionalCode=S,I.isCombinedCharacter=C,I.isRegionalFlag=P,I.isVariationSelector=A,I.BLACK_FLAG_CODE_POINT=s;var M={addChars:v,addFonts:y,getCharData:b,getFontByName:k,measureText:w,checkLoadedFonts:m,setIsLoaded:D};return I.prototype=M,I}();function je(t){this.animationData=t}function Be(t){return new je(t)}function Ve(){}je.prototype.getProp=function(t){return this.animationData.slots&&this.animationData.slots[t.sid]?Object.assign(t,this.animationData.slots[t.sid].p):t},Ve.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(t){-1===this.renderableComponents.indexOf(t)&&this.renderableComponents.push(t)},removeRenderableComponent:function(t){-1!==this.renderableComponents.indexOf(t)&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)},prepareRenderableFrame:function(t){this.checkLayerLimits(t)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?!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<e;t+=1)this.renderableComponents[t].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}};var He=function(){var t={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"};return function(e){return t[e]||""}}();function $e(t,e,i){this.p=Et.getProp(e,t.v,0,0,i)}function qe(t,e,i){this.p=Et.getProp(e,t.v,0,0,i)}function Ge(t,e,i){this.p=Et.getProp(e,t.v,1,0,i)}function Ye(t,e,i){this.p=Et.getProp(e,t.v,1,0,i)}function Xe(t,e,i){this.p=Et.getProp(e,t.v,0,0,i)}function Ke(t,e,i){this.p=Et.getProp(e,t.v,0,0,i)}function Je(t,e,i){this.p=Et.getProp(e,t.v,0,0,i)}function Ze(){this.p={}}function Qe(t,e){var i,s=t.ef||[];this.effectElements=[];var r,n=s.length;for(i=0;i<n;i+=1)r=new ti(s[i],e),this.effectElements.push(r)}function ti(t,e){this.init(t,e)}function ei(){}function ii(){}function si(t,e,i){this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(t.refId),this.footageData=e.imageLoader.getAsset(this.assetData),this.initBaseData(t,e,i)}function ri(t,e,i){this.initFrame(),this.initRenderable(),this.assetData=e.getAssetData(t.refId),this.initBaseData(t,e,i),this._isPlaying=!1,this._canPlay=!1;var s=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(s),this._currentTime=0,this.globalData.audioController.addAudio(this),this._volumeMultiplier=1,this._volume=1,this._previousVolume=null,this.tm=t.tm?Et.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0},this.lv=Et.getProp(this,t.au&&t.au.lv?t.au.lv:{k:[100]},1,.01,this)}function ni(){}c([Ct],ti),ti.prototype.getValue=ti.prototype.iterateDynamicProperties,ti.prototype.init=function(t,e){var i;this.data=t,this.effectElements=[],this.initDynamicPropertyContainer(e);var s,r=this.data.ef.length,n=this.data.ef;for(i=0;i<r;i+=1){switch(s=null,n[i].ty){case 0:s=new $e(n[i],e,this);break;case 1:s=new qe(n[i],e,this);break;case 2:s=new Ge(n[i],e,this);break;case 3:s=new Ye(n[i],e,this);break;case 4:case 7:s=new Je(n[i],e,this);break;case 10:s=new Xe(n[i],e,this);break;case 11:s=new Ke(n[i],e,this);break;case 5:s=new Qe(n[i],e);break;default:s=new Ze(n[i])}s&&this.effectElements.push(s)}},ei.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var t=0,e=this.data.masksProperties.length;t<e;){if("n"!==this.data.masksProperties[t].mode&&!1!==this.data.masksProperties[t].cl)return!0;t+=1}return!1},initExpressions:function(){},setBlendMode:function(){var t=He(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=t},initBaseData:function(t,e,i){this.globalData=e,this.comp=i,this.data=t,this.layerId=L(),this.data.sr||(this.data.sr=1),this.effectsManager=new Qe(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}},ii.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(t,e){var i,s=this.dynamicProperties.length;for(i=0;i<s;i+=1)(e||this._isParent&&"transform"===this.dynamicProperties[i].propType)&&(this.dynamicProperties[i].getValue(),this.dynamicProperties[i]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(t){-1===this.dynamicProperties.indexOf(t)&&this.dynamicProperties.push(t)}},si.prototype.prepareFrame=function(){},c([Ve,ei,ii],si),si.prototype.getBaseElement=function(){return null},si.prototype.renderFrame=function(){},si.prototype.destroy=function(){},si.prototype.initExpressions=function(){},si.prototype.getFootageData=function(){return this.footageData},ri.prototype.prepareFrame=function(t){if(this.prepareRenderableFrame(t,!0),this.prepareProperties(t,!0),this.tm._placeholder)this._currentTime=t/this.data.sr;else{var e=this.tm.v;this._currentTime=e}this._volume=this.lv.v[0];var i=this._volume*this._volumeMultiplier;this._previousVolume!==i&&(this._previousVolume=i,this.audio.volume(i))},c([Ve,ei,ii],ri),ri.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek())>.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},ri.prototype.show=function(){},ri.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},ri.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},ri.prototype.resume=function(){this._canPlay=!0},ri.prototype.setRate=function(t){this.audio.rate(t)},ri.prototype.volume=function(t){this._volumeMultiplier=t,this._previousVolume=t*this._volume,this.audio.volume(this._previousVolume)},ri.prototype.getBaseElement=function(){return null},ri.prototype.destroy=function(){},ri.prototype.sourceRectAtTime=function(){},ri.prototype.initExpressions=function(){},ni.prototype.checkLayers=function(t){var e,i,s=this.layers.length;for(this.completeLayers=!0,e=s-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()},ni.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)}},ni.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},ni.prototype.createAudio=function(t){return new ri(t,this.globalData,this)},ni.prototype.createFootage=function(t){return new si(t,this.globalData,this)},ni.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.buildItem(t);this.checkPendingElements()},ni.prototype.includeLayers=function(t){var e;this.completeLayers=!1;var i,s=t.length,r=this.layers.length;for(e=0;e<s;e+=1)for(i=0;i<r;){if(this.layers[i].id===t[e].id){this.layers[i]=t[e];break}i+=1}},ni.prototype.setProjectInterface=function(t){this.globalData.projectInterface=t},ni.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},ni.prototype.buildElementParenting=function(t,e,i){for(var s=this.elements,r=this.layers,n=0,a=r.length;n<a;)r[n].ind==e&&(s[n]&&!0!==s[n]?(i.push(s[n]),s[n].setAsParent(),void 0!==r[n].parent?this.buildElementParenting(t,r[n].parent,i):t.setHierarchy(i)):(this.buildItem(n),this.addPendingElement(t))),n+=1},ni.prototype.addPendingElement=function(t){this.pendingElements.push(t)},ni.prototype.searchExtraCompositions=function(t){var e,i=t.length;for(e=0;e<i;e+=1)if(t[e].xt){var s=this.createComp(t[e]);s.initExpressions(),this.globalData.projectInterface.registerComposition(s)}},ni.prototype.getElementById=function(t){var e,i=this.elements.length;for(e=0;e<i;e+=1)if(this.elements[e].data.ind===t)return this.elements[e];return null},ni.prototype.getElementByPath=function(t){var e,i=t.shift();if("number"==typeof i)e=this.elements[i];else{var s,r=this.elements.length;for(s=0;s<r;s+=1)if(this.elements[s].data.nm===i){e=this.elements[s];break}}return 0===t.length?e:e.getElementByPath(t)},ni.prototype.setupGlobalData=function(t,e){this.globalData.fontManager=new We,this.globalData.slotManager=Be(t),this.globalData.fontManager.addChars(t.chars),this.globalData.fontManager.addFonts(t.fonts,e),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=t.fr,this.globalData.nm=t.nm,this.globalData.compSize={w:t.w,h:t.h}};var ai={TRANSFORM_EFFECT:"transformEFfect"};function oi(){}function hi(t,e,i){this.data=t,this.element=e,this.globalData=i,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var s,r,n=this.globalData.defs,a=this.masksProperties?this.masksProperties.length:0;this.viewData=f(a),this.solidPath="";var o,l,c,p,d,u,m=this.masksProperties,g=0,y=[],v=L(),b="clipPath",w="clip-path";for(s=0;s<a;s+=1)if(("a"!==m[s].mode&&"n"!==m[s].mode||m[s].inv||100!==m[s].o.k||m[s].o.x)&&(b="mask",w="mask"),"s"!==m[s].mode&&"i"!==m[s].mode||0!==g?c=null:((c=q("rect")).setAttribute("fill","#ffffff"),c.setAttribute("width",this.element.comp.data.w||0),c.setAttribute("height",this.element.comp.data.h||0),y.push(c)),r=q("path"),"n"===m[s].mode)this.viewData[s]={op:Et.getProp(this.element,m[s].o,0,.01,this.element),prop:Ft.getShapeProp(this.element,m[s],3),elem:r,lastPath:""},n.appendChild(r);else{var k;if(g+=1,r.setAttribute("fill","s"===m[s].mode?"#000000":"#ffffff"),r.setAttribute("clip-rule","nonzero"),0!==m[s].x.k?(b="mask",w="mask",u=Et.getProp(this.element,m[s].x,0,null,this.element),k=L(),(p=q("filter")).setAttribute("id",k),(d=q("feMorphology")).setAttribute("operator","erode"),d.setAttribute("in","SourceGraphic"),d.setAttribute("radius","0"),p.appendChild(d),n.appendChild(p),r.setAttribute("stroke","s"===m[s].mode?"#000000":"#ffffff")):(d=null,u=null),this.storedData[s]={elem:r,x:u,expan:d,lastPath:"",lastOperator:"",filterId:k,lastRadius:0},"i"===m[s].mode){l=y.length;var _=q("g");for(o=0;o<l;o+=1)_.appendChild(y[o]);var T=q("mask");T.setAttribute("mask-type","alpha"),T.setAttribute("id",v+"_"+g),T.appendChild(r),n.appendChild(T),_.setAttribute("mask","url("+h()+"#"+v+"_"+g+")"),y.length=0,y.push(_)}else y.push(r);m[s].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[s]={elem:r,lastPath:"",op:Et.getProp(this.element,m[s].o,0,.01,this.element),prop:Ft.getShapeProp(this.element,m[s],3),invRect:c},this.viewData[s].prop.k||this.drawPath(m[s],this.viewData[s].prop.v,this.viewData[s])}for(this.maskElement=q(b),a=y.length,s=0;s<a;s+=1)this.maskElement.appendChild(y[s]);g>0&&(this.maskElement.setAttribute("id",v),this.element.maskedElement.setAttribute(w,"url("+h()+"#"+v+")"),n.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}oi.prototype={initTransform:function(){var t=new Rt;this.finalTransform={mProp:this.data.ks?re.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,s=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;i<s;){if(this.hierarchy[i].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}i+=1}if(this.finalTransform._matMdf)for(t=this.finalTransform.mProp.v.props,e.cloneFromProps(t),i=0;i<s;i+=1)e.multiply(this.hierarchy[i].finalTransform.mProp.v)}this.localTransforms&&!this.finalTransform._matMdf||(this.finalTransform._localMatMdf=this.finalTransform._matMdf),this.finalTransform._opMdf&&(this.finalTransform.localOpacity=this.finalTransform.mProp.o.v)},renderLocalTransform:function(){if(this.localTransforms){var t=0,e=this.localTransforms.length;if(this.finalTransform._localMatMdf=this.finalTransform._matMdf,!this.finalTransform._localMatMdf||!this.finalTransform._opMdf)for(;t<e;)this.localTransforms[t]._mdf&&(this.finalTransform._localMatMdf=!0),this.localTransforms[t]._opMdf&&!this.finalTransform._opMdf&&(this.finalTransform.localOpacity=this.finalTransform.mProp.o.v,this.finalTransform._opMdf=!0),t+=1;if(this.finalTransform._localMatMdf){var i=this.finalTransform.localMat;for(this.localTransforms[0].matrix.clone(i),t=1;t<e;t+=1){var s=this.localTransforms[t].matrix;i.multiply(s)}i.multiply(this.finalTransform.mat)}if(this.finalTransform._opMdf){var r=this.finalTransform.localOpacity;for(t=0;t<e;t+=1)r*=.01*this.localTransforms[t].opacity;this.finalTransform.localOpacity=r}}},searchEffectTransforms:function(){if(this.renderableEffectsManager){var t=this.renderableEffectsManager.getEffects(ai.TRANSFORM_EFFECT);if(t.length){this.localTransforms=[],this.finalTransform.localMat=new Rt;var e=0,i=t.length;for(e=0;e<i;e+=1)this.localTransforms.push(t[e])}}},globalToLocal:function(t){var e=[];e.push(this.finalTransform);for(var i,s=!0,r=this.comp;s;)r.finalTransform?(r.data.hasMask&&e.splice(0,0,r.finalTransform),r=r.comp):s=!1;var n,a=e.length;for(i=0;i<a;i+=1)n=e[i].mat.applyToPointArray(0,0,0),t=[t[0]-n[0],t[1]-n[1],0];return t},mHelper:new Rt},hi.prototype.getMaskProperty=function(t){return this.viewData[t].prop},hi.prototype.renderFrame=function(t){var e,i=this.element.finalTransform.mat,s=this.masksProperties.length;for(e=0;e<s;e+=1)if((this.viewData[e].prop._mdf||t)&&this.drawPath(this.masksProperties[e],this.viewData[e].prop.v,this.viewData[e]),(this.viewData[e].op._mdf||t)&&this.viewData[e].elem.setAttribute("fill-opacity",this.viewData[e].op.v),"n"!==this.masksProperties[e].mode&&(this.viewData[e].invRect&&(this.element.finalTransform.mProp._mdf||t)&&this.viewData[e].invRect.setAttribute("transform",i.getInverseMatrix().to2dCSS()),this.storedData[e].x&&(this.storedData[e].x._mdf||t))){var r=this.storedData[e].expan;this.storedData[e].x.v<0?("erode"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="erode",this.storedData[e].elem.setAttribute("filter","url("+h()+"#"+this.storedData[e].filterId+")")),r.setAttribute("radius",-this.storedData[e].x.v)):("dilate"!==this.storedData[e].lastOperator&&(this.storedData[e].lastOperator="dilate",this.storedData[e].elem.setAttribute("filter",null)),this.storedData[e].elem.setAttribute("stroke-width",2*this.storedData[e].x.v))}},hi.prototype.getMaskelement=function(){return this.maskElement},hi.prototype.createLayerSolidPath=function(){var t="M0,0 ";return t+=" h"+this.globalData.compSize.w,t+=" v"+this.globalData.compSize.h,t+=" h-"+this.globalData.compSize.w,t+=" v-"+this.globalData.compSize.h+" "},hi.prototype.drawPath=function(t,e,i){var s,r,n=" M"+e.v[0][0]+","+e.v[0][1];for(r=e._length,s=1;s<r;s+=1)n+=" C"+e.o[s-1][0]+","+e.o[s-1][1]+" "+e.i[s][0]+","+e.i[s][1]+" "+e.v[s][0]+","+e.v[s][1];if(e.c&&r>1&&(n+=" C"+e.o[s-1][0]+","+e.o[s-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),i.lastPath!==n){var a="";i.elem&&(e.c&&(a=t.inv?this.solidPath+n:n),i.elem.setAttribute("d",a)),i.lastPath=n}},hi.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var li,ci=function(){var t={};function e(t,e){var i=q("filter");return 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%")),i}function i(){var t=q("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}return t.createFilter=e,t.createAlphaToLuminanceFilter=i,t}(),pi=(li={maskType:!0,svgLumaHidden:!0,offscreenCanvas:"undefined"!=typeof OffscreenCanvas},(/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))&&(li.maskType=!1),/firefox/i.test(navigator.userAgent)&&(li.svgLumaHidden=!1),li),di={},ui="filter_result_";function fi(t){var e,i,s="SourceGraphic",r=t.data.ef?t.data.ef.length:0,n=L(),a=ci.createFilter(n,!0),o=0;for(this.filters=[],e=0;e<r;e+=1){i=null;var l=t.data.ef[e].ty;di[l]&&(i=new(0,di[l].effect)(a,t.effectsManager.effectElements[e],t,ui+o,s),s=ui+o,di[l].countsAsEffect&&(o+=1)),i&&this.filters.push(i)}o&&(t.globalData.defs.appendChild(a),t.layerElement.setAttribute("filter","url("+h()+"#"+n+")")),this.filters.length&&t.addRenderableComponent(this)}function mi(){}function gi(){}function yi(){}function vi(t,e,i){this.assetData=e.getAssetData(t.refId),this.assetData&&this.assetData.sid&&(this.assetData=e.slotManager.getProp(this.assetData)),this.initElement(t,e,i),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function bi(t,e){this.elem=t,this.pos=e}function wi(){}fi.prototype.renderFrame=function(t){var e,i=this.filters.length;for(e=0;e<i;e+=1)this.filters[e].renderFrame(t)},fi.prototype.getEffects=function(t){var e,i=this.filters.length,s=[];for(e=0;e<i;e+=1)this.filters[e].type===t&&s.push(this.filters[e]);return s},mi.prototype={initRendererElement:function(){this.layerElement=q("g")},createContainerElements:function(){this.matteElement=q("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var t=null;if(this.data.td){this.matteMasks={};var e=q("g");e.setAttribute("id",this.layerId),e.appendChild(this.layerElement),t=e,this.globalData.defs.appendChild(e)}else this.data.tt?(this.matteElement.appendChild(this.layerElement),t=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var i=q("clipPath"),s=q("path");s.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var r=L();if(i.setAttribute("id",r),i.appendChild(s),this.globalData.defs.appendChild(i),this.checkMasks()){var n=q("g");n.setAttribute("clip-path","url("+h()+"#"+r+")"),n.appendChild(this.layerElement),this.transformedElement=n,t?t.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+h()+"#"+r+")")}0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._localMatMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.localMat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.localOpacity)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new hi(this.data,this,this.globalData),this.renderableEffectsManager=new fi(this),this.searchEffectTransforms()},getMatte:function(t){if(this.matteMasks||(this.matteMasks={}),!this.matteMasks[t]){var e,i,s,r,n=this.layerId+"_"+t;if(1===t||3===t){var a=q("mask");a.setAttribute("id",n),a.setAttribute("mask-type",3===t?"luminance":"alpha"),(s=q("use")).setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),a.appendChild(s),this.globalData.defs.appendChild(a),pi.maskType||1!==t||(a.setAttribute("mask-type","luminance"),e=L(),i=ci.createFilter(e),this.globalData.defs.appendChild(i),i.appendChild(ci.createAlphaToLuminanceFilter()),(r=q("g")).appendChild(s),a.appendChild(r),r.setAttribute("filter","url("+h()+"#"+e+")"))}else if(2===t){var o=q("mask");o.setAttribute("id",n),o.setAttribute("mask-type","alpha");var l=q("g");o.appendChild(l),e=L(),i=ci.createFilter(e);var c=q("feComponentTransfer");c.setAttribute("in","SourceGraphic"),i.appendChild(c);var p=q("feFuncA");p.setAttribute("type","table"),p.setAttribute("tableValues","1.0 0.0"),c.appendChild(p),this.globalData.defs.appendChild(i);var d=q("rect");d.setAttribute("width",this.comp.data.w),d.setAttribute("height",this.comp.data.h),d.setAttribute("x","0"),d.setAttribute("y","0"),d.setAttribute("fill","#ffffff"),d.setAttribute("opacity","0"),l.setAttribute("filter","url("+h()+"#"+e+")"),l.appendChild(d),(s=q("use")).setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),l.appendChild(s),pi.maskType||(o.setAttribute("mask-type","luminance"),i.appendChild(ci.createAlphaToLuminanceFilter()),r=q("g"),l.appendChild(d),r.appendChild(this.layerElement),l.appendChild(r)),this.globalData.defs.appendChild(o)}this.matteMasks[t]=n}return this.matteMasks[t]},setMatte:function(t){this.matteElement&&this.matteElement.setAttribute("mask","url("+h()+"#"+t+")")}},gi.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(t){this.hierarchy=t},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},c([Ve,p({initElement:function(t,e,i){this.initFrame(),this.initBaseData(t,e,i),this.initTransform(t,e,i),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}})],yi),c([ei,oi,mi,gi,ii,yi],vi),vi.prototype.createContent=function(){var t=this.globalData.getAssetsPath(this.assetData);this.innerElem=q("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",t),this.layerElement.appendChild(this.innerElem)},vi.prototype.sourceRectAtTime=function(){return this.sourceRect},wi.prototype={addShapeToModifiers:function(t){var e,i=this.shapeModifiers.length;for(e=0;e<i;e+=1)this.shapeModifiers[e].addShape(t)},isShapeInAnimatedModifiers:function(t){for(var e=0,i=this.shapeModifiers.length;e<i;)if(this.shapeModifiers[e].isAnimatedWithShape(t))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var t,e=this.shapes.length;for(t=0;t<e;t+=1)this.shapes[t].sh.reset();for(t=(e=this.shapeModifiers.length)-1;t>=0&&!this.shapeModifiers[t].processShapes(this._isFirstFrame);t-=1);}},searchProcessedElement:function(t){for(var e=this.processedElements,i=0,s=e.length;i<s;){if(e[i].elem===t)return e[i].pos;i+=1}return 0},addProcessedElement:function(t,e){for(var i=this.processedElements,s=i.length;s;)if(i[s-=1].elem===t)return void(i[s].pos=e);i.push(new bi(t,e))},prepareFrame:function(t){this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)}};var ki={1:"butt",2:"round",3:"square"},_i={1:"miter",2:"round",3:"bevel"};function Ti(t,e,i){this.caches=[],this.styles=[],this.transformers=t,this.lStr="",this.sh=i,this.lvl=e,this._isAnimated=!!i.k;for(var s=0,r=t.length;s<r;){if(t[s].mProps.dynamicProperties.length){this._isAnimated=!0;break}s+=1}}function xi(t,e){this.data=t,this.type=t.ty,this.d="",this.lvl=e,this._mdf=!1,this.closed=!0===t.hd,this.pElem=q("path"),this.msElem=null}function Ai(t,e,i,s){var r;this.elem=t,this.frameId=-1,this.dataProps=f(e.length),this.renderer=i,this.k=!1,this.dashStr="",this.dashArray=u("float32",e.length?e.length-1:0),this.dashoffset=u("float32",1),this.initDynamicPropertyContainer(s);var n,a=e.length||0;for(r=0;r<a;r+=1)n=Et.getProp(t,e[r].v,0,0,this),this.k=n.k||this.k,this.dataProps[r]={n:e[r].n,p:n};this.k||this.getValue(!0),this._isAnimated=this.k}function Si(t,e,i){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=Et.getProp(t,e.o,0,.01,this),this.w=Et.getProp(t,e.w,0,null,this),this.d=new Ai(t,e.d||{},"svg",this),this.c=Et.getProp(t,e.c,1,255,this),this.style=i,this._isAnimated=!!this._isAnimated}function Ei(t,e,i){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.o=Et.getProp(t,e.o,0,.01,this),this.c=Et.getProp(t,e.c,1,255,this),this.style=i}function Ci(t,e,i){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.style=i}function Pi(t,e,i){this.data=e,this.c=u("uint8c",4*e.p);var s=e.k.k[0].s?e.k.k[0].s.length-4*e.p:e.k.k.length-4*e.p;this.o=u("float32",s),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=s,this.initDynamicPropertyContainer(i),this.prop=Et.getProp(t,e.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}function Di(t,e,i){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.initGradientData(t,e,i)}function Ii(t,e,i){this.initDynamicPropertyContainer(t),this.getValue=this.iterateDynamicProperties,this.w=Et.getProp(t,e.w,0,null,this),this.d=new Ai(t,e.d||{},"svg",this),this.initGradientData(t,e,i),this._isAnimated=!!this._isAnimated}function Mi(){this.it=[],this.prevViewData=[],this.gr=q("g")}function Li(t,e,i){this.transform={mProps:t,op:e,container:i},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}Ti.prototype.setAsAnimated=function(){this._isAnimated=!0},xi.prototype.reset=function(){this.d="",this._mdf=!1},Ai.prototype.getValue=function(t){if((this.elem.globalData.frameId!==this.frameId||t)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||t,this._mdf)){var e=0,i=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),e=0;e<i;e+=1)"o"!==this.dataProps[e].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[e].p.v:this.dashArray[e]=this.dataProps[e].p.v:this.dashoffset[0]=this.dataProps[e].p.v}},c([Ct],Ai),c([Ct],Si),c([Ct],Ei),c([Ct],Ci),Pi.prototype.comparePoints=function(t,e){for(var i=0,s=this.o.length/2;i<s;){if(Math.abs(t[4*i]-t[4*e+2*i])>.01)return!1;i+=1}return!0},Pi.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;t<e;){if(!this.comparePoints(this.data.k.k[t].s,this.data.p))return!1;t+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},Pi.prototype.getValue=function(t){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||t){var e,i,s,r=4*this.data.p;for(e=0;e<r;e+=1)i=e%4==0?100:255,s=Math.round(this.prop.v[e]*i),this.c[e]!==s&&(this.c[e]=s,this._cmdf=!t);if(this.o.length)for(r=this.prop.v.length,e=4*this.data.p;e<r;e+=1)i=e%2==0?100:1,s=e%2==0?Math.round(100*this.prop.v[e]):this.prop.v[e],this.o[e-4*this.data.p]!==s&&(this.o[e-4*this.data.p]=s,this._omdf=!t);this._mdf=!t}},c([Ct],Pi),Di.prototype.initGradientData=function(t,e,i){this.o=Et.getProp(t,e.o,0,.01,this),this.s=Et.getProp(t,e.s,1,null,this),this.e=Et.getProp(t,e.e,1,null,this),this.h=Et.getProp(t,e.h||{k:0},0,.01,this),this.a=Et.getProp(t,e.a||{k:0},0,x,this),this.g=new Pi(t,e.g,this),this.style=i,this.stops=[],this.setGradientData(i.pElem,e),this.setGradientOpacity(e,i),this._isAnimated=!!this._isAnimated},Di.prototype.setGradientData=function(t,e){var i=L(),s=q(1===e.t?"linearGradient":"radialGradient");s.setAttribute("id",i),s.setAttribute("spreadMethod","pad"),s.setAttribute("gradientUnits","userSpaceOnUse");var r,n,a,o=[];for(a=4*e.g.p,n=0;n<a;n+=4)r=q("stop"),s.appendChild(r),o.push(r);t.setAttribute("gf"===e.ty?"fill":"stroke","url("+h()+"#"+i+")"),this.gf=s,this.cst=o},Di.prototype.setGradientOpacity=function(t,e){if(this.g._hasOpacity&&!this.g._collapsable){var i,s,r,n=q("mask"),a=q("path");n.appendChild(a);var o=L(),l=L();n.setAttribute("id",l);var c=q(1===t.t?"linearGradient":"radialGradient");c.setAttribute("id",o),c.setAttribute("spreadMethod","pad"),c.setAttribute("gradientUnits","userSpaceOnUse"),r=t.g.k.k[0].s?t.g.k.k[0].s.length:t.g.k.k.length;var p=this.stops;for(s=4*t.g.p;s<r;s+=2)(i=q("stop")).setAttribute("stop-color","rgb(255,255,255)"),c.appendChild(i),p.push(i);a.setAttribute("gf"===t.ty?"fill":"stroke","url("+h()+"#"+o+")"),"gs"===t.ty&&(a.setAttribute("stroke-linecap",ki[t.lc||2]),a.setAttribute("stroke-linejoin",_i[t.lj||2]),1===t.lj&&a.setAttribute("stroke-miterlimit",t.ml)),this.of=c,this.ms=n,this.ost=p,this.maskId=l,e.msElem=a}},c([Ct],Di),c([Di,Ct],Ii);var Fi=function(t,e,i,s){if(0===e)return"";var r,n=t.o,a=t.i,o=t.v,h=" M"+s.applyToPointStringified(o[0][0],o[0][1]);for(r=1;r<e;r+=1)h+=" C"+s.applyToPointStringified(n[r-1][0],n[r-1][1])+" "+s.applyToPointStringified(a[r][0],a[r][1])+" "+s.applyToPointStringified(o[r][0],o[r][1]);return i&&e&&(h+=" C"+s.applyToPointStringified(n[r-1][0],n[r-1][1])+" "+s.applyToPointStringified(a[0][0],a[0][1])+" "+s.applyToPointStringified(o[0][0],o[0][1]),h+="z"),h},Ri=function(){var t=new Rt,e=new Rt;function i(t){switch(t.ty){case"fl":return a;case"gf":return h;case"gs":return o;case"st":return l;case"sh":case"el":case"rc":case"sr":return n;case"tr":return s;case"no":return r;default:return null}}function s(t,e,i){(i||e.transform.op._mdf)&&e.transform.container.setAttribute("opacity",e.transform.op.v),(i||e.transform.mProps._mdf)&&e.transform.container.setAttribute("transform",e.transform.mProps.v.to2dCSS())}function r(){}function n(i,s,r){var n,a,o,h,l,c,p,d,u,f,m=s.styles.length,g=s.lvl;for(c=0;c<m;c+=1){if(h=s.sh._mdf||r,s.styles[c].lvl<g){for(d=e.reset(),u=g-s.styles[c].lvl,f=s.transformers.length-1;!h&&u>0;)h=s.transformers[f].mProps._mdf||h,u-=1,f-=1;if(h)for(u=g-s.styles[c].lvl,f=s.transformers.length-1;u>0;)d.multiply(s.transformers[f].mProps.v),u-=1,f-=1}else d=t;if(a=(p=s.sh.paths)._length,h){for(o="",n=0;n<a;n+=1)(l=p.shapes[n])&&l._length&&(o+=Fi(l,l._length,l.c,d));s.caches[c]=o}else o=s.caches[c];s.styles[c].d+=!0===i.hd?"":o,s.styles[c]._mdf=h||s.styles[c]._mdf}}function a(t,e,i){var s=e.style;(e.c._mdf||i)&&s.pElem.setAttribute("fill","rgb("+k(e.c.v[0])+","+k(e.c.v[1])+","+k(e.c.v[2])+")"),(e.o._mdf||i)&&s.pElem.setAttribute("fill-opacity",e.o.v)}function o(t,e,i){h(t,e,i),l(t,e,i)}function h(t,e,i){var s,r,n,a,o,h=e.gf,l=e.g._hasOpacity,c=e.s.v,p=e.e.v;if(e.o._mdf||i){var d="gf"===t.ty?"fill-opacity":"stroke-opacity";e.style.pElem.setAttribute(d,e.o.v)}if(e.s._mdf||i){var u=1===t.t?"x1":"cx",f="x1"===u?"y1":"cy";h.setAttribute(u,c[0]),h.setAttribute(f,c[1]),l&&!e.g._collapsable&&(e.of.setAttribute(u,c[0]),e.of.setAttribute(f,c[1]))}if(e.g._cmdf||i){s=e.cst;var m=e.g.c;for(n=s.length,r=0;r<n;r+=1)(a=s[r]).setAttribute("offset",m[4*r]+"%"),a.setAttribute("stop-color","rgb("+m[4*r+1]+","+m[4*r+2]+","+m[4*r+3]+")")}if(l&&(e.g._omdf||i)){var g=e.g.o;for(n=(s=e.g._collapsable?e.cst:e.ost).length,r=0;r<n;r+=1)a=s[r],e.g._collapsable||a.setAttribute("offset",g[2*r]+"%"),a.setAttribute("stop-opacity",g[2*r+1])}if(1===t.t)(e.e._mdf||i)&&(h.setAttribute("x2",p[0]),h.setAttribute("y2",p[1]),l&&!e.g._collapsable&&(e.of.setAttribute("x2",p[0]),e.of.setAttribute("y2",p[1])));else if((e.s._mdf||e.e._mdf||i)&&(o=Math.sqrt(Math.pow(c[0]-p[0],2)+Math.pow(c[1]-p[1],2)),h.setAttribute("r",o),l&&!e.g._collapsable&&e.of.setAttribute("r",o)),e.s._mdf||e.e._mdf||e.h._mdf||e.a._mdf||i){o||(o=Math.sqrt(Math.pow(c[0]-p[0],2)+Math.pow(c[1]-p[1],2)));var y=Math.atan2(p[1]-c[1],p[0]-c[0]),v=e.h.v;v>=1?v=.99:v<=-1&&(v=-.99);var b=o*v,w=Math.cos(y+e.a.v)*b+c[0],k=Math.sin(y+e.a.v)*b+c[1];h.setAttribute("fx",w),h.setAttribute("fy",k),l&&!e.g._collapsable&&(e.of.setAttribute("fx",w),e.of.setAttribute("fy",k))}}function l(t,e,i){var s=e.style,r=e.d;r&&(r._mdf||i)&&r.dashStr&&(s.pElem.setAttribute("stroke-dasharray",r.dashStr),s.pElem.setAttribute("stroke-dashoffset",r.dashoffset[0])),e.c&&(e.c._mdf||i)&&s.pElem.setAttribute("stroke","rgb("+k(e.c.v[0])+","+k(e.c.v[1])+","+k(e.c.v[2])+")"),(e.o._mdf||i)&&s.pElem.setAttribute("stroke-opacity",e.o.v),(e.w._mdf||i)&&(s.pElem.setAttribute("stroke-width",e.w.v),s.msElem&&s.msElem.setAttribute("stroke-width",e.w.v))}return{createRenderFunction:i}}();function Ni(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 Oi(t,e,i,s,r,n){this.o=t,this.sw=e,this.sc=i,this.fc=s,this.m=r,this.p=n,this._mdf={o:!0,sw:!!e,sc:!!i,fc:!!s,m:!0,p:!0}}function zi(t,e){this._frameId=s,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)}c([ei,oi,mi,wi,gi,ii,yi],Ni),Ni.prototype.initSecondaryElement=function(){},Ni.prototype.identityMatrix=new Rt,Ni.prototype.buildExpressionInterface=function(){},Ni.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},Ni.prototype.filterUniqueShapes=function(){var t,e,i,s,r=this.shapes.length,n=this.stylesList.length,a=[],o=!1;for(i=0;i<n;i+=1){for(s=this.stylesList[i],o=!1,a.length=0,t=0;t<r;t+=1)-1!==(e=this.shapes[t]).styles.indexOf(s)&&(a.push(e),o=e._isAnimated||o);a.length>1&&o&&this.setShapesAsAnimated(a)}},Ni.prototype.setShapesAsAnimated=function(t){var e,i=t.length;for(e=0;e<i;e+=1)t[e].setAsAnimated()},Ni.prototype.createStyleElement=function(t,e){var i,s=new xi(t,e),r=s.pElem;return"st"===t.ty?i=new Si(this,t,s):"fl"===t.ty?i=new Ei(this,t,s):"gf"===t.ty||"gs"===t.ty?(i=new("gf"===t.ty?Di:Ii)(this,t,s),this.globalData.defs.appendChild(i.gf),i.maskId&&(this.globalData.defs.appendChild(i.ms),this.globalData.defs.appendChild(i.of),r.setAttribute("mask","url("+h()+"#"+i.maskId+")"))):"no"===t.ty&&(i=new Ci(this,t,s)),"st"!==t.ty&&"gs"!==t.ty||(r.setAttribute("stroke-linecap",ki[t.lc||2]),r.setAttribute("stroke-linejoin",_i[t.lj||2]),r.setAttribute("fill-opacity","0"),1===t.lj&&r.setAttribute("stroke-miterlimit",t.ml)),2===t.r&&r.setAttribute("fill-rule","evenodd"),t.ln&&r.setAttribute("id",t.ln),t.cl&&r.setAttribute("class",t.cl),t.bm&&(r.style["mix-blend-mode"]=He(t.bm)),this.stylesList.push(s),this.addToAnimatedContents(t,i),i},Ni.prototype.createGroupElement=function(t){var e=new Mi;return t.ln&&e.gr.setAttribute("id",t.ln),t.cl&&e.gr.setAttribute("class",t.cl),t.bm&&(e.gr.style["mix-blend-mode"]=He(t.bm)),e},Ni.prototype.createTransformElement=function(t,e){var i=re.getTransformProperty(this,t,this),s=new Li(i,i.o,e);return this.addToAnimatedContents(t,s),s},Ni.prototype.createShapeElement=function(t,e,i){var s=4;"rc"===t.ty?s=5:"el"===t.ty?s=6:"sr"===t.ty&&(s=7);var r=new Ti(e,i,Ft.getShapeProp(this,t,s,this));return this.shapes.push(r),this.addShapeToModifiers(r),this.addToAnimatedContents(t,r),r},Ni.prototype.addToAnimatedContents=function(t,e){for(var i=0,s=this.animatedContents.length;i<s;){if(this.animatedContents[i].element===e)return;i+=1}this.animatedContents.push({fn:Ri.createRenderFunction(t),element:e,data:t})},Ni.prototype.setElementStyles=function(t){var e,i=t.styles,s=this.stylesList.length;for(e=0;e<s;e+=1)-1!==i.indexOf(this.stylesList[e])||this.stylesList[e].closed||i.push(this.stylesList[e])},Ni.prototype.reloadShapes=function(){var t;this._isFirstFrame=!0;var e=this.itemsData.length;for(t=0;t<e;t+=1)this.prevViewData[t]=this.itemsData[t];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),e=this.dynamicProperties.length,t=0;t<e;t+=1)this.dynamicProperties[t].getValue();this.renderModifiers()},Ni.prototype.searchShapes=function(t,e,i,s,r,n,a){var o,h,l,c,p,d,u=[].concat(n),f=t.length-1,m=[],g=[];for(o=f;o>=0;o-=1){if((d=this.searchProcessedElement(t[o]))?e[o]=i[d-1]:t[o]._render=a,"fl"===t[o].ty||"st"===t[o].ty||"gf"===t[o].ty||"gs"===t[o].ty||"no"===t[o].ty)d?e[o].style.closed=t[o].hd:e[o]=this.createStyleElement(t[o],r),t[o]._render&&e[o].style.pElem.parentNode!==s&&s.appendChild(e[o].style.pElem),m.push(e[o].style);else if("gr"===t[o].ty){if(d)for(l=e[o].it.length,h=0;h<l;h+=1)e[o].prevViewData[h]=e[o].it[h];else e[o]=this.createGroupElement(t[o]);this.searchShapes(t[o].it,e[o].it,e[o].prevViewData,e[o].gr,r+1,u,a),t[o]._render&&e[o].gr.parentNode!==s&&s.appendChild(e[o].gr)}else"tr"===t[o].ty?(d||(e[o]=this.createTransformElement(t[o],s)),c=e[o].transform,u.push(c)):"sh"===t[o].ty||"rc"===t[o].ty||"el"===t[o].ty||"sr"===t[o].ty?(d||(e[o]=this.createShapeElement(t[o],u,r)),this.setElementStyles(e[o])):"tm"===t[o].ty||"rd"===t[o].ty||"ms"===t[o].ty||"pb"===t[o].ty||"zz"===t[o].ty||"op"===t[o].ty?(d?(p=e[o]).closed=!1:((p=te.getModifier(t[o].ty)).init(this,t[o]),e[o]=p,this.shapeModifiers.push(p)),g.push(p)):"rp"===t[o].ty&&(d?(p=e[o]).closed=!0:(p=te.getModifier(t[o].ty),e[o]=p,p.init(this,t,o,e),this.shapeModifiers.push(p),a=!1),g.push(p));this.addProcessedElement(t[o],o+1)}for(f=m.length,o=0;o<f;o+=1)m[o].closed=!0;for(f=g.length,o=0;o<f;o+=1)g[o].closed=!0},Ni.prototype.renderInnerContent=function(){var t;this.renderModifiers();var e=this.stylesList.length;for(t=0;t<e;t+=1)this.stylesList[t].reset();for(this.renderShape(),t=0;t<e;t+=1)(this.stylesList[t]._mdf||this._isFirstFrame)&&(this.stylesList[t].msElem&&(this.stylesList[t].msElem.setAttribute("d",this.stylesList[t].d),this.stylesList[t].d="M0 0"+this.stylesList[t].d),this.stylesList[t].pElem.setAttribute("d",this.stylesList[t].d||"M0 0"))},Ni.prototype.renderShape=function(){var t,e,i=this.animatedContents.length;for(t=0;t<i;t+=1)e=this.animatedContents[t],(this._isFirstFrame||e.element._isAnimated)&&!0!==e.data&&e.fn(e.data,e.element,this._isFirstFrame)},Ni.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null},Oi.prototype.update=function(t,e,i,s,r,n){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1,this._mdf.p=!1;var a=!1;return this.o!==t&&(this.o=t,this._mdf.o=!0,a=!0),this.sw!==e&&(this.sw=e,this._mdf.sw=!0,a=!0),this.sc!==i&&(this.sc=i,this._mdf.sc=!0,a=!0),this.fc!==s&&(this.fc=s,this._mdf.fc=!0,a=!0),this.m!==r&&(this.m=r,this._mdf.m=!0,a=!0),!n.length||this.p[0]===n[0]&&this.p[1]===n[1]&&this.p[4]===n[4]&&this.p[5]===n[5]&&this.p[12]===n[12]&&this.p[13]===n[13]||(this.p=n,this._mdf.p=!0,a=!0),a},zi.prototype.defaultBoxWidth=[0,0],zi.prototype.copyData=function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},zi.prototype.setCurrentData=function(t){t.__complete||this.completeTextData(t),this.currentData=t,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},zi.prototype.searchProperty=function(){return this.searchKeyframes()},zi.prototype.searchKeyframes=function(){return this.kf=this.data.d.k.length>1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},zi.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},zi.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 s;this.lock=!0,this._mdf=!1;var r=this.effectsSequence.length,n=t||this.data.d.k[this.keysIndex].s;for(s=0;s<r;s+=1)n=i!==this.keysIndex?this.effectsSequence[s](n,n.t):this.effectsSequence[s](this.currentData,n.t);e!==n&&this.setCurrentData(n),this.v=this.currentData,this.pv=this.v,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},zi.prototype.getKeyframeValue=function(){for(var t=this.data.d.k,e=this.elem.comp.renderedFrame,i=0,s=t.length;i<=s-1&&!(i===s-1||t[i+1].t>e);)i+=1;return this.keysIndex!==i&&(this.keysIndex=i),this.data.d.k[this.keysIndex].s},zi.prototype.buildFinalText=function(t){for(var e,i,s=[],r=0,n=t.length,a=!1,o=!1,h="";r<n;)a=o,o=!1,e=t.charCodeAt(r),h=t.charAt(r),We.isCombinedCharacter(e)?a=!0:e>=55296&&e<=56319?We.isRegionalFlag(t,r)?h=t.substr(r,14):(i=t.charCodeAt(r+1))>=56320&&i<=57343&&(We.isModifier(e,i)?(h=t.substr(r,2),a=!0):h=We.isFlagEmoji(t.substr(r,4))?t.substr(r,4):t.substr(r,2)):e>56319?(i=t.charCodeAt(r+1),We.isVariationSelector(e)&&(a=!0)):We.isZeroWidthJoiner(e)&&(a=!0,o=!0),a?(s[s.length-1]+=h,a=!1):s.push(h),r+=h.length;return s},zi.prototype.completeTextData=function(t){t.__complete=!0;var e,i,s,r,n,a,o,h=this.elem.globalData.fontManager,l=this.data,c=[],p=0,d=l.m.g,u=0,f=0,m=0,g=[],y=0,v=0,b=h.getFontByName(t.f),w=0,k=Ue(b);t.fWeight=k.weight,t.fStyle=k.style,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),i=t.finalText.length,t.finalLineHeight=t.lh;var _,T=t.tr/1e3*t.finalSize;if(t.sz)for(var x,A,S=!0,E=t.sz[0],C=t.sz[1];S;){x=0,y=0,i=(A=this.buildFinalText(t.t)).length,T=t.tr/1e3*t.finalSize;var P=-1;for(e=0;e<i;e+=1)_=A[e].charCodeAt(0),s=!1," "===A[e]?P=e:13!==_&&3!==_||(y=0,s=!0,x+=t.finalLineHeight||1.2*t.finalSize),h.chars?(o=h.getCharData(A[e],b.fStyle,b.fFamily),w=s?0:o.w*t.finalSize/100):w=h.measureText(A[e],t.f,t.finalSize),y+w>E&&" "!==A[e]?(-1===P?i+=1:e=P,x+=t.finalLineHeight||1.2*t.finalSize,A.splice(e,P===e?1:0,"\r"),P=-1,y=0):(y+=w,y+=T);x+=b.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&C<x?(t.finalSize-=1,t.finalLineHeight=t.finalSize*t.lh/t.s):(t.finalText=A,i=t.finalText.length,S=!1)}y=-T,w=0;var D,I=0;for(e=0;e<i;e+=1)if(s=!1,13===(_=(D=t.finalText[e]).charCodeAt(0))||3===_?(I=0,g.push(y),v=y>v?y:v,y=-2*T,r="",s=!0,m+=1):r=D,h.chars?(o=h.getCharData(D,b.fStyle,h.getFontByName(t.f).fFamily),w=s?0:o.w*t.finalSize/100):w=h.measureText(r,t.f,t.finalSize)," "===D?I+=w+T:(y+=w+T+I,I=0),c.push({l:w,an:w,add:u,n:s,anIndexes:[],val:r,line:m,animatorJustifyOffset:0}),2==d){if(u+=w,""===r||" "===r||e===i-1){for(""!==r&&" "!==r||(u-=w);f<=e;)c[f].an=u,c[f].ind=p,c[f].extra=w,f+=1;p+=1,u=0}}else if(3==d){if(u+=w,""===r||e===i-1){for(""===r&&(u-=w);f<=e;)c[f].an=u,c[f].ind=p,c[f].extra=w,f+=1;u=0,p+=1}}else c[p].ind=p,c[p].extra=0,p+=1;if(t.l=c,v=y>v?y:v,g.push(y),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=g;var M,L,F,R,N=l.a;a=N.length;var O=[];for(n=0;n<a;n+=1){for((M=N[n]).a.sc&&(t.strokeColorAnim=!0),M.a.sw&&(t.strokeWidthAnim=!0),(M.a.fc||M.a.fh||M.a.fs||M.a.fb)&&(t.fillColorAnim=!0),R=0,F=M.s.b,e=0;e<i;e+=1)(L=c[e]).anIndexes[n]=R,(1==F&&""!==L.val||2==F&&""!==L.val&&" "!==L.val||3==F&&(L.n||" "==L.val||e==i-1)||4==F&&(L.n||e==i-1))&&(1===M.s.rn&&O.push(R),R+=1);l.a[n].s.totalChars=R;var z,U=-1;if(1===M.s.rn)for(e=0;e<i;e+=1)U!=(L=c[e]).anIndexes[n]&&(U=L.anIndexes[n],z=O.splice(Math.floor(Math.random()*O.length),1)[0]),L.anIndexes[n]=z}t.yOffset=t.finalLineHeight||1.2*t.finalSize,t.ls=t.ls||0,t.ascent=b.ascent*t.finalSize/100},zi.prototype.updateDocumentData=function(t,e){e=void 0===e?this.keysIndex:e;var i=this.copyData({},this.data.d.k[e].s);i=this.copyData(i,t),this.data.d.k[e].s=i,this.recalculate(e),this.setCurrentData(i),this.elem.addDynamicProperty(this)},zi.prototype.recalculate=function(t){var e=this.data.d.k[t].s;e.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(e)},zi.prototype.canResizeFont=function(t){this.canResize=t,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},zi.prototype.setMinimumFontSize=function(t){this.minimumFontSize=Math.floor(t)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var Ui=function(){var t=Math.max,e=Math.min,i=Math.floor;function s(t,e){this._currentTextLength=-1,this.k=!1,this.data=e,this.elem=t,this.comp=t.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(t),this.s=Et.getProp(t,e.s||{k:0},0,0,this),this.e="e"in e?Et.getProp(t,e.e,0,0,this):{v:100},this.o=Et.getProp(t,e.o||{k:0},0,0,this),this.xe=Et.getProp(t,e.xe||{k:0},0,0,this),this.ne=Et.getProp(t,e.ne||{k:0},0,0,this),this.sm=Et.getProp(t,e.sm||{k:100},0,0,this),this.a=Et.getProp(t,e.a,0,.01,this),this.dynamicProperties.length||this.getValue()}function r(t,e,i){return new s(t,e)}return s.prototype={getMult:function(s){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var r=0,n=0,a=1,o=1;this.ne.v>0?r=this.ne.v/100:n=-this.ne.v/100,this.xe.v>0?a=1-this.xe.v/100:o=1+this.xe.v/100;var h=at.getBezierEasing(r,n,a,o).get,l=0,c=this.finalS,p=this.finalE,d=this.data.sh;if(2===d)l=h(l=p===c?s>=p?1:0:t(0,e(.5/(p-c)+(s-c)/(p-c),1)));else if(3===d)l=h(l=p===c?s>=p?0:1:1-t(0,e(.5/(p-c)+(s-c)/(p-c),1)));else if(4===d)p===c?l=0:(l=t(0,e(.5/(p-c)+(s-c)/(p-c),1)))<.5?l*=2:l=1-2*(l-.5),l=h(l);else if(5===d){if(p===c)l=0;else{var u=p-c,f=-u/2+(s=e(t(0,s+.5-c),p-c)),m=u/2;l=Math.sqrt(1-f*f/(m*m))}l=h(l)}else 6===d?(p===c?l=0:(s=e(t(0,s+.5-c),p-c),l=(1+Math.cos(Math.PI+2*Math.PI*s/(p-c)))/2),l=h(l)):(s>=i(c)&&(l=t(0,e(s-c<0?e(p,1)-(c-s):p-s,1))),l=h(l));if(100!==this.sm.v){var g=.01*this.sm.v;0===g&&(g=1e-8);var y=.5-.5*g;l<y?l=0:(l=(l-y)/g)>1&&(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,s=this.s.v/e+i,r=this.e.v/e+i;if(s>r){var n=s;s=r,r=n}this.finalS=s,this.finalE=r}},c([Ct],s),{getTextSelectorProp:r}}();function Wi(t,e,i){var s={propType:!1},r=Et.getProp,n=e.a;this.a={r:n.r?r(t,n.r,0,x,i):s,rx:n.rx?r(t,n.rx,0,x,i):s,ry:n.ry?r(t,n.ry,0,x,i):s,sk:n.sk?r(t,n.sk,0,x,i):s,sa:n.sa?r(t,n.sa,0,x,i):s,s:n.s?r(t,n.s,1,.01,i):s,a:n.a?r(t,n.a,1,0,i):s,o:n.o?r(t,n.o,0,.01,i):s,p:n.p?r(t,n.p,1,0,i):s,sw:n.sw?r(t,n.sw,0,0,i):s,sc:n.sc?r(t,n.sc,1,0,i):s,fc:n.fc?r(t,n.fc,1,0,i):s,fh:n.fh?r(t,n.fh,0,0,i):s,fs:n.fs?r(t,n.fs,0,.01,i):s,fb:n.fb?r(t,n.fb,0,.01,i):s,t:n.t?r(t,n.t,0,0,i):s},this.s=Ui.getTextSelectorProp(t,e.s,i),this.s.t=e.s.t}function ji(t,e,i){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=i,this._animatorsData=f(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(i)}function Bi(){}ji.prototype.searchProperties=function(){var t,e,i=this._textData.a.length,s=Et.getProp;for(t=0;t<i;t+=1)e=this._textData.a[t],this._animatorsData[t]=new Wi(this._elem,e,this);this._textData.p&&"m"in this._textData.p?(this._pathData={a:s(this._elem,this._textData.p.a,0,0,this),f:s(this._elem,this._textData.p.f,0,0,this),l:s(this._elem,this._textData.p.l,0,0,this),r:s(this._elem,this._textData.p.r,0,0,this),p:s(this._elem,this._textData.p.p,0,0,this),m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=s(this._elem,this._textData.m.a,1,0,this)},ji.prototype.getMeasures=function(t,e){if(this.lettersChangedFlag=e,this._mdf||this._isFirstFrame||e||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var i,s,r,n,a,o,h,l,c,p,d,u,f,m,g,y,v,b,w,k=this._moreOptions.alignment.v,_=this._animatorsData,T=this._textData,x=this.mHelper,A=this._renderType,S=this.renderedLetters.length,E=t.l;if(this._hasMaskedPath){if(w=this._pathData.m,!this._pathData.n||this._pathData._mdf){var C,P=w.v;for(this._pathData.r.v&&(P=P.reverse()),a={tLength:0,segments:[]},n=P._length-1,y=0,r=0;r<n;r+=1)C=dt.buildBezierData(P.v[r],P.v[r+1],[P.o[r][0]-P.v[r][0],P.o[r][1]-P.v[r][1]],[P.i[r+1][0]-P.v[r+1][0],P.i[r+1][1]-P.v[r+1][1]]),a.tLength+=C.segmentLength,a.segments.push(C),y+=C.segmentLength;r=n,w.v.c&&(C=dt.buildBezierData(P.v[r],P.v[0],[P.o[r][0]-P.v[r][0],P.o[r][1]-P.v[r][1]],[P.i[0][0]-P.v[0][0],P.i[0][1]-P.v[0][1]]),a.tLength+=C.segmentLength,a.segments.push(C),y+=C.segmentLength),this._pathData.pi=a}if(a=this._pathData.pi,o=this._pathData.f.v,d=0,p=1,l=0,c=!0,m=a.segments,o<0&&w.v.c)for(a.tLength<Math.abs(o)&&(o=-Math.abs(o)%a.tLength),p=(f=m[d=m.length-1].points).length-1;o<0;)o+=f[p].partialLength,(p-=1)<0&&(p=(f=m[d-=1].points).length-1);u=(f=m[d].points)[p-1],g=(h=f[p]).partialLength}n=E.length,i=0,s=0;var D,I,M,L,F,R=1.2*t.finalSize*.714,U=!0;M=_.length;var W,j,B,V,H,$,q,G,Y,X,K,J,Z=-1,Q=o,tt=d,et=p,it=-1,st="",rt=this.defaultPropsArray;if(2===t.j||1===t.j){var nt=0,at=0,ot=2===t.j?-.5:-1,ht=0,lt=!0;for(r=0;r<n;r+=1)if(E[r].n){for(nt&&(nt+=at);ht<r;)E[ht].animatorJustifyOffset=nt,ht+=1;nt=0,lt=!0}else{for(I=0;I<M;I+=1)(D=_[I].a).t.propType&&(lt&&2===t.j&&(at+=D.t.v*ot),(F=_[I].s.getMult(E[r].anIndexes[I],T.a[I].s.totalChars)).length?nt+=D.t.v*F[0]*ot:nt+=D.t.v*F*ot);lt=!1}for(nt&&(nt+=at);ht<r;)E[ht].animatorJustifyOffset=nt,ht+=1}for(r=0;r<n;r+=1){if(x.reset(),V=1,E[r].n)i=0,s+=t.yOffset,s+=U?1:0,o=Q,U=!1,this._hasMaskedPath&&(p=et,u=(f=m[d=tt].points)[p-1],g=(h=f[p]).partialLength,l=0),st="",K="",Y="",J="",rt=this.defaultPropsArray;else{if(this._hasMaskedPath){if(it!==E[r].line){switch(t.j){case 1:o+=y-t.lineWidths[E[r].line];break;case 2:o+=(y-t.lineWidths[E[r].line])/2}it=E[r].line}Z!==E[r].ind&&(E[Z]&&(o+=E[Z].extra),o+=E[r].an/2,Z=E[r].ind),o+=k[0]*E[r].an*.005;var ct=0;for(I=0;I<M;I+=1)(D=_[I].a).p.propType&&((F=_[I].s.getMult(E[r].anIndexes[I],T.a[I].s.totalChars)).length?ct+=D.p.v[0]*F[0]:ct+=D.p.v[0]*F),D.a.propType&&((F=_[I].s.getMult(E[r].anIndexes[I],T.a[I].s.totalChars)).length?ct+=D.a.v[0]*F[0]:ct+=D.a.v[0]*F);for(c=!0,this._pathData.a.v&&(o=.5*E[0].an+(y-this._pathData.f.v-.5*E[0].an-.5*E[E.length-1].an)*Z/(n-1),o+=this._pathData.f.v);c;)l+g>=o+ct||!f?(v=(o+ct-l)/h.partialLength,j=u.point[0]+(h.point[0]-u.point[0])*v,B=u.point[1]+(h.point[1]-u.point[1])*v,x.translate(-k[0]*E[r].an*.005,-k[1]*R*.01),c=!1):f&&(l+=h.partialLength,(p+=1)>=f.length&&(p=0,m[d+=1]?f=m[d].points:w.v.c?(p=0,f=m[d=0].points):(l-=h.partialLength,f=null)),f&&(u=h,g=(h=f[p]).partialLength));W=E[r].an/2-E[r].add,x.translate(-W,0,0)}else W=E[r].an/2-E[r].add,x.translate(-W,0,0),x.translate(-k[0]*E[r].an*.005,-k[1]*R*.01,0);for(I=0;I<M;I+=1)(D=_[I].a).t.propType&&(F=_[I].s.getMult(E[r].anIndexes[I],T.a[I].s.totalChars),0===i&&0===t.j||(this._hasMaskedPath?F.length?o+=D.t.v*F[0]:o+=D.t.v*F:F.length?i+=D.t.v*F[0]:i+=D.t.v*F));for(t.strokeWidthAnim&&($=t.sw||0),t.strokeColorAnim&&(H=t.sc?[t.sc[0],t.sc[1],t.sc[2]]:[0,0,0]),t.fillColorAnim&&t.fc&&(q=[t.fc[0],t.fc[1],t.fc[2]]),I=0;I<M;I+=1)(D=_[I].a).a.propType&&((F=_[I].s.getMult(E[r].anIndexes[I],T.a[I].s.totalChars)).length?x.translate(-D.a.v[0]*F[0],-D.a.v[1]*F[1],D.a.v[2]*F[2]):x.translate(-D.a.v[0]*F,-D.a.v[1]*F,D.a.v[2]*F));for(I=0;I<M;I+=1)(D=_[I].a).s.propType&&((F=_[I].s.getMult(E[r].anIndexes[I],T.a[I].s.totalChars)).length?x.scale(1+(D.s.v[0]-1)*F[0],1+(D.s.v[1]-1)*F[1],1):x.scale(1+(D.s.v[0]-1)*F,1+(D.s.v[1]-1)*F,1));for(I=0;I<M;I+=1){if(D=_[I].a,F=_[I].s.getMult(E[r].anIndexes[I],T.a[I].s.totalChars),D.sk.propType&&(F.length?x.skewFromAxis(-D.sk.v*F[0],D.sa.v*F[1]):x.skewFromAxis(-D.sk.v*F,D.sa.v*F)),D.r.propType&&(F.length?x.rotateZ(-D.r.v*F[2]):x.rotateZ(-D.r.v*F)),D.ry.propType&&(F.length?x.rotateY(D.ry.v*F[1]):x.rotateY(D.ry.v*F)),D.rx.propType&&(F.length?x.rotateX(D.rx.v*F[0]):x.rotateX(D.rx.v*F)),D.o.propType&&(F.length?V+=(D.o.v*F[0]-V)*F[0]:V+=(D.o.v*F-V)*F),t.strokeWidthAnim&&D.sw.propType&&(F.length?$+=D.sw.v*F[0]:$+=D.sw.v*F),t.strokeColorAnim&&D.sc.propType)for(G=0;G<3;G+=1)F.length?H[G]+=(D.sc.v[G]-H[G])*F[0]:H[G]+=(D.sc.v[G]-H[G])*F;if(t.fillColorAnim&&t.fc){if(D.fc.propType)for(G=0;G<3;G+=1)F.length?q[G]+=(D.fc.v[G]-q[G])*F[0]:q[G]+=(D.fc.v[G]-q[G])*F;D.fh.propType&&(q=F.length?z(q,D.fh.v*F[0]):z(q,D.fh.v*F)),D.fs.propType&&(q=F.length?N(q,D.fs.v*F[0]):N(q,D.fs.v*F)),D.fb.propType&&(q=F.length?O(q,D.fb.v*F[0]):O(q,D.fb.v*F))}}for(I=0;I<M;I+=1)(D=_[I].a).p.propType&&(F=_[I].s.getMult(E[r].anIndexes[I],T.a[I].s.totalChars),this._hasMaskedPath?F.length?x.translate(0,D.p.v[1]*F[0],-D.p.v[2]*F[1]):x.translate(0,D.p.v[1]*F,-D.p.v[2]*F):F.length?x.translate(D.p.v[0]*F[0],D.p.v[1]*F[1],-D.p.v[2]*F[2]):x.translate(D.p.v[0]*F,D.p.v[1]*F,-D.p.v[2]*F));if(t.strokeWidthAnim&&(Y=$<0?0:$),t.strokeColorAnim&&(X="rgb("+Math.round(255*H[0])+","+Math.round(255*H[1])+","+Math.round(255*H[2])+")"),t.fillColorAnim&&t.fc&&(K="rgb("+Math.round(255*q[0])+","+Math.round(255*q[1])+","+Math.round(255*q[2])+")"),this._hasMaskedPath){if(x.translate(0,-t.ls),x.translate(0,k[1]*R*.01+s,0),this._pathData.p.v){b=(h.point[1]-u.point[1])/(h.point[0]-u.point[0]);var pt=180*Math.atan(b)/Math.PI;h.point[0]<u.point[0]&&(pt+=180),x.rotate(-pt*Math.PI/180)}x.translate(j,B,0),o-=k[0]*E[r].an*.005,E[r+1]&&Z!==E[r+1].ind&&(o+=E[r].an/2,o+=.001*t.tr*t.finalSize)}else{switch(x.translate(i,s,0),t.ps&&x.translate(t.ps[0],t.ps[1]+t.ascent,0),t.j){case 1:x.translate(E[r].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[E[r].line]),0,0);break;case 2:x.translate(E[r].animatorJustifyOffset+t.justifyOffset+(t.boxWidth-t.lineWidths[E[r].line])/2,0,0)}x.translate(0,-t.ls),x.translate(W,0,0),x.translate(k[0]*E[r].an*.005,k[1]*R*.01,0),i+=E[r].l+.001*t.tr*t.finalSize}"html"===A?st=x.toCSS():"svg"===A?st=x.to2dCSS():rt=[x.props[0],x.props[1],x.props[2],x.props[3],x.props[4],x.props[5],x.props[6],x.props[7],x.props[8],x.props[9],x.props[10],x.props[11],x.props[12],x.props[13],x.props[14],x.props[15]],J=V}S<=r?(L=new Oi(J,Y,X,K,st,rt),this.renderedLetters.push(L),S+=1,this.lettersChangedFlag=!0):(L=this.renderedLetters[r],this.lettersChangedFlag=L.update(J,Y,X,K,st,rt)||this.lettersChangedFlag)}}},ji.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},ji.prototype.mHelper=new Rt,ji.prototype.defaultPropsArray=[],c([Ct],ji),Bi.prototype.initElement=function(t,e,i){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(t,e,i),this.textProperty=new zi(this,t.t,this.dynamicProperties),this.textAnimator=new ji(t.t,this.renderType,this),this.initTransform(t,e,i),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},Bi.prototype.prepareFrame=function(t){this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange)},Bi.prototype.createPathShape=function(t,e){var i,s,r=e.length,n="";for(i=0;i<r;i+=1)"sh"===e[i].ty&&(s=e[i].ks.k,n+=Fi(s,s.i.length,!0,t));return n},Bi.prototype.updateDocumentData=function(t,e){this.textProperty.updateDocumentData(t,e)},Bi.prototype.canResizeFont=function(t){this.textProperty.canResizeFont(t)},Bi.prototype.setMinimumFontSize=function(t){this.textProperty.setMinimumFontSize(t)},Bi.prototype.applyTextPropertiesToMatrix=function(t,e,i,s,r){switch(t.ps&&e.translate(t.ps[0],t.ps[1]+t.ascent,0),e.translate(0,-t.ls,0),t.j){case 1:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[i]),0,0);break;case 2:e.translate(t.justifyOffset+(t.boxWidth-t.lineWidths[i])/2,0,0)}e.translate(s,r,0)},Bi.prototype.buildColor=function(t){return"rgb("+Math.round(255*t[0])+","+Math.round(255*t[1])+","+Math.round(255*t[2])+")"},Bi.prototype.emptyProp=new Oi,Bi.prototype.destroy=function(){},Bi.prototype.validateText=function(){(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)};var Vi={shapes:[]};function Hi(t,e,i){this.textSpans=[],this.renderType="svg",this.initElement(t,e,i)}function $i(t,e,i){this.initElement(t,e,i)}function qi(t,e,i){this.initFrame(),this.initBaseData(t,e,i),this.initFrame(),this.initTransform(t,e,i),this.initHierarchy()}function Gi(){}function Yi(){}function Xi(t,e,i){this.layers=t.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?f(this.layers.length):[],this.initElement(t,e,i),this.tm=t.tm?Et.getProp(this,t.tm,0,e.frameRate,this):{_placeholder:!0}}function Ki(t,e){this.animationItem=t,this.layers=null,this.renderedFrame=-1,this.svgElement=q("svg");var i="";if(e&&e.title){var s=q("title"),r=L();s.setAttribute("id",r),s.textContent=e.title,this.svgElement.appendChild(s),i+=r}if(e&&e.description){var n=q("desc"),a=L();n.setAttribute("id",a),n.textContent=e.description,this.svgElement.appendChild(n),i+=" "+a}i&&this.svgElement.setAttribute("aria-labelledby",i);var o=q("defs");this.svgElement.appendChild(o);var h=q("g");this.svgElement.appendChild(h),this.layerElement=h,this.renderConfig={preserveAspectRatio:e&&e.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:e&&e.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:e&&e.contentVisibility||"visible",progressiveLoad:e&&e.progressiveLoad||!1,hideOnTransparent:!(e&&!1===e.hideOnTransparent),viewBoxOnly:e&&e.viewBoxOnly||!1,viewBoxSize:e&&e.viewBoxSize||!1,className:e&&e.className||"",id:e&&e.id||"",focusable:e&&e.focusable,filterSize:{width:e&&e.filterSize&&e.filterSize.width||"100%",height:e&&e.filterSize&&e.filterSize.height||"100%",x:e&&e.filterSize&&e.filterSize.x||"0%",y:e&&e.filterSize&&e.filterSize.y||"0%"},width:e&&e.width,height:e&&e.height,runExpressions:!e||void 0===e.runExpressions||e.runExpressions},this.globalData={_mdf:!1,frameNum:-1,defs:o,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}return c([ei,oi,mi,gi,ii,yi,Bi],Hi),Hi.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=q("text"))},Hi.prototype.buildTextContents=function(t){for(var e=0,i=t.length,s=[],r="";e<i;)t[e]===String.fromCharCode(13)||t[e]===String.fromCharCode(3)?(s.push(r),r=""):r+=t[e],e+=1;return s.push(r),s},Hi.prototype.buildShapeData=function(t,e){if(t.shapes&&t.shapes.length){var i=t.shapes[0];if(i.it){var s=i.it[i.it.length-1];s.s&&(s.s.k[0]=e,s.s.k[1]=e)}}return t},Hi.prototype.buildNewText=function(){var t,e;this.addDynamicProperty(this);var i=this.textProperty.currentData;this.renderedLetters=f(i?i.l.length:0),i.fc?this.layerElement.setAttribute("fill",this.buildColor(i.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),i.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(i.sc)),this.layerElement.setAttribute("stroke-width",i.sw)),this.layerElement.setAttribute("font-size",i.finalSize);var s=this.globalData.fontManager.getFontByName(i.f);if(s.fClass)this.layerElement.setAttribute("class",s.fClass);else{this.layerElement.setAttribute("font-family",s.fFamily);var r=i.fWeight,n=i.fStyle;this.layerElement.setAttribute("font-style",n),this.layerElement.setAttribute("font-weight",r)}this.layerElement.setAttribute("aria-label",i.t);var a,o=i.l||[],h=!!this.globalData.fontManager.chars;e=o.length;var l=this.mHelper,c="",p=this.data.singleShape,d=0,u=0,m=!0,g=.001*i.tr*i.finalSize;if(!p||h||i.sz){var y,v=this.textSpans.length;for(t=0;t<e;t+=1){if(this.textSpans[t]||(this.textSpans[t]={span:null,childSpan:null,glyph:null}),!h||!p||0===t){if(a=v>t?this.textSpans[t].span:q(h?"g":"text"),v<=t){if(a.setAttribute("stroke-linecap","butt"),a.setAttribute("stroke-linejoin","round"),a.setAttribute("stroke-miterlimit","4"),this.textSpans[t].span=a,h){var b=q("g");a.appendChild(b),this.textSpans[t].childSpan=b}this.textSpans[t].span=a,this.layerElement.appendChild(a)}a.style.display="inherit"}if(l.reset(),p&&(o[t].n&&(d=-g,u+=i.yOffset,u+=m?1:0,m=!1),this.applyTextPropertiesToMatrix(i,l,o[t].line,d,u),d+=o[t].l||0,d+=g),h){var w;if(1===(y=this.globalData.fontManager.getCharData(i.finalText[t],s.fStyle,this.globalData.fontManager.getFontByName(i.f).fFamily)).t)w=new Xi(y.data,this.globalData,this);else{var k=Vi;y.data&&y.data.shapes&&(k=this.buildShapeData(y.data,i.finalSize)),w=new Ni(k,this.globalData,this)}if(this.textSpans[t].glyph){var _=this.textSpans[t].glyph;this.textSpans[t].childSpan.removeChild(_.layerElement),_.destroy()}this.textSpans[t].glyph=w,w._debug=!0,w.prepareFrame(0),w.renderFrame(),this.textSpans[t].childSpan.appendChild(w.layerElement),1===y.t&&this.textSpans[t].childSpan.setAttribute("transform","scale("+i.finalSize/100+","+i.finalSize/100+")")}else p&&a.setAttribute("transform","translate("+l.props[12]+","+l.props[13]+")"),a.textContent=o[t].val,a.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve")}p&&a&&a.setAttribute("d",c)}else{var T=this.textContainer,x="start";switch(i.j){case 1:x="end";break;case 2:x="middle";break;default:x="start"}T.setAttribute("text-anchor",x),T.setAttribute("letter-spacing",g);var A=this.buildTextContents(i.finalText);for(e=A.length,u=i.ps?i.ps[1]+i.ascent:0,t=0;t<e;t+=1)(a=this.textSpans[t].span||q("tspan")).textContent=A[t],a.setAttribute("x",0),a.setAttribute("y",u),a.style.display="inherit",T.appendChild(a),this.textSpans[t]||(this.textSpans[t]={span:null,glyph:null}),this.textSpans[t].span=a,u+=i.finalLineHeight;this.layerElement.appendChild(T)}for(;t<this.textSpans.length;)this.textSpans[t].span.style.display="none",t+=1;this._sizeChanged=!0},Hi.prototype.sourceRectAtTime=function(){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var t=this.layerElement.getBBox();this.bbox={top:t.y,left:t.x,width:t.width,height:t.height}}return this.bbox},Hi.prototype.getValue=function(){var t,e,i=this.textSpans.length;for(this.renderedFrame=this.comp.renderedFrame,t=0;t<i;t+=1)(e=this.textSpans[t].glyph)&&(e.prepareFrame(this.comp.renderedFrame-this.data.st),e._mdf&&(this._mdf=!0))},Hi.prototype.renderInnerContent=function(){if(this.validateText(),(!this.data.singleShape||this._mdf)&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){var t,e;this._sizeChanged=!0;var i,s,r,n=this.textAnimator.renderedLetters,a=this.textProperty.currentData.l;for(e=a.length,t=0;t<e;t+=1)a[t].n||(i=n[t],s=this.textSpans[t].span,(r=this.textSpans[t].glyph)&&r.renderFrame(),i._mdf.m&&s.setAttribute("transform",i.m),i._mdf.o&&s.setAttribute("opacity",i.o),i._mdf.sw&&s.setAttribute("stroke-width",i.sw),i._mdf.sc&&s.setAttribute("stroke",i.sc),i._mdf.fc&&s.setAttribute("fill",i.fc))}},c([vi],$i),$i.prototype.createContent=function(){var t=q("rect");t.setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.layerElement.appendChild(t)},qi.prototype.prepareFrame=function(t){this.prepareProperties(t,!0)},qi.prototype.renderFrame=function(){},qi.prototype.getBaseElement=function(){return null},qi.prototype.destroy=function(){},qi.prototype.sourceRectAtTime=function(){},qi.prototype.hide=function(){},c([ei,oi,gi,ii],qi),c([ni],Gi),Gi.prototype.createNull=function(t){return new qi(t,this.globalData,this)},Gi.prototype.createShape=function(t){return new Ni(t,this.globalData,this)},Gi.prototype.createText=function(t){return new Hi(t,this.globalData,this)},Gi.prototype.createImage=function(t){return new vi(t,this.globalData,this)},Gi.prototype.createSolid=function(t){return new $i(t,this.globalData,this)},Gi.prototype.configAnimation=function(t){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.svgElement.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+t.w+" "+t.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",t.w),this.svgElement.setAttribute("height",t.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)",this.svgElement.style.contentVisibility=this.renderConfig.contentVisibility),this.renderConfig.width&&this.svgElement.setAttribute("width",this.renderConfig.width),this.renderConfig.height&&this.svgElement.setAttribute("height",this.renderConfig.height),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var e=this.globalData.defs;this.setupGlobalData(t,e),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=t;var i=q("clipPath"),s=q("rect");s.setAttribute("width",t.w),s.setAttribute("height",t.h),s.setAttribute("x",0),s.setAttribute("y",0);var r=L();i.setAttribute("id",r),i.appendChild(s),this.layerElement.setAttribute("clip-path","url("+h()+"#"+r+")"),e.appendChild(i),this.layers=t.layers,this.elements=f(t.layers.length)},Gi.prototype.destroy=function(){var t;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var e=this.layers?this.layers.length:0;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy&&this.elements[t].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},Gi.prototype.updateContainerSize=function(){},Gi.prototype.findIndexByInd=function(t){var e=0,i=this.layers.length;for(e=0;e<i;e+=1)if(this.layers[e].ind===t)return e;return-1},Gi.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!==this.layers[t].ty){e[t]=!0;var i=this.createItem(this.layers[t]);if(e[t]=i,B()&&(0===this.layers[t].ty&&this.globalData.projectInterface.registerComposition(i),i.initExpressions()),this.appendElementInPos(i,t),this.layers[t].tt){var s="tp"in this.layers[t]?this.findIndexByInd(this.layers[t].tp):t-1;if(-1===s)return;if(this.elements[s]&&!0!==this.elements[s]){var r=e[s].getMatte(this.layers[t].tt);i.setMatte(r)}else this.buildItem(s),this.addPendingElement(i)}}},Gi.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var t=this.pendingElements.pop();if(t.checkParenting(),t.data.tt)for(var e=0,i=this.elements.length;e<i;){if(this.elements[e]===t){var s="tp"in t.data?this.findIndexByInd(t.data.tp):e-1,r=this.elements[s].getMatte(this.layers[e].tt);t.setMatte(r);break}e+=1}}},Gi.prototype.renderFrame=function(t){if(this.renderedFrame!==t&&!this.destroyed){var e;null===t?t=this.renderedFrame:this.renderedFrame=t,this.globalData.frameNum=t,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=t,this.globalData._mdf=!1;var i=this.layers.length;for(this.completeLayers||this.checkLayers(t),e=i-1;e>=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<i;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()}},Gi.prototype.appendElementInPos=function(t,e){var i=t.getBaseElement();if(i){for(var s,r=0;r<e;)this.elements[r]&&!0!==this.elements[r]&&this.elements[r].getBaseElement()&&(s=this.elements[r].getBaseElement()),r+=1;s?this.layerElement.insertBefore(i,s):this.layerElement.appendChild(i)}},Gi.prototype.hide=function(){this.layerElement.style.display="none"},Gi.prototype.show=function(){this.layerElement.style.display="block"},c([ei,oi,gi,ii,yi],Yi),Yi.prototype.initElement=function(t,e,i){this.initFrame(),this.initBaseData(t,e,i),this.initTransform(t,e,i),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&e.progressiveLoad||this.buildAllItems(),this.hide()},Yi.prototype.prepareFrame=function(t){if(this._mdf=!1,this.prepareRenderableFrame(t),this.prepareProperties(t,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=t/this.data.sr;else{var e=this.tm.v;e===this.data.op&&(e=this.data.op-1),this.renderedFrame=e}var i,s=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),i=s-1;i>=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))}},Yi.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},Yi.prototype.setElements=function(t){this.elements=t},Yi.prototype.getElements=function(){return this.elements},Yi.prototype.destroyElements=function(){var t,e=this.layers.length;for(t=0;t<e;t+=1)this.elements[t]&&this.elements[t].destroy()},Yi.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},c([Gi,Yi,mi],Xi),Xi.prototype.createComp=function(t){return new Xi(t,this.globalData,this)},c([Gi],Ki),Ki.prototype.createComp=function(t){return new Xi(t,this.globalData,this)},tt("svg",Ki),te.registerModifier("tm",ie),te.registerModifier("pb",se),te.registerModifier("rp",ne),te.registerModifier("rd",ae),te.registerModifier("zz",Ae),te.registerModifier("op",ze),Ot}());const o=s(a.exports);
2
2
  /*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */
3
- function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,s=Array(e);i<e;i++)s[i]=t[i];return s}function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var s,r,n,a,o=[],h=!0,l=!1;try{if(n=(i=i.call(t)).next,0===e);else for(;!(h=(s=n.call(i)).done)&&(o.push(s.value),o.length!==e);h=!0);}catch(c){l=!0,r=c}finally{try{if(!h&&null!=i.return&&(a=i.return(),Object(a)!==a))return}finally{if(l)throw r}}return o}}(t,e)||function(t,e){if(t){if("string"==typeof t)return h(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?h(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const c=Object.entries,p=Object.setPrototypeOf,d=Object.isFrozen,f=Object.getPrototypeOf,u=Object.getOwnPropertyDescriptor;let m=Object.freeze,g=Object.seal,y=Object.create,v="undefined"!=typeof Reflect&&Reflect,b=v.apply,w=v.construct;m||(m=function(t){return t}),g||(g=function(t){return t}),b||(b=function(t,e){for(var i=arguments.length,s=new Array(i>2?i-2:0),r=2;r<i;r++)s[r-2]=arguments[r];return t.apply(e,s)}),w||(w=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),s=1;s<e;s++)i[s-1]=arguments[s];return new t(...i)});const k=V(Array.prototype.forEach),_=V(Array.prototype.lastIndexOf),T=V(Array.prototype.pop),x=V(Array.prototype.push),A=V(Array.prototype.splice),S=Array.isArray,E=V(String.prototype.toLowerCase),C=V(String.prototype.toString),P=V(String.prototype.match),D=V(String.prototype.replace),I=V(String.prototype.indexOf),M=V(String.prototype.trim),L=V(Number.prototype.toString),F=V(Boolean.prototype.toString),R="undefined"==typeof BigInt?null:V(BigInt.prototype.toString),N="undefined"==typeof Symbol?null:V(Symbol.prototype.toString),O=V(Object.prototype.hasOwnProperty),z=V(Object.prototype.toString),U=V(RegExp.prototype.test),W=(j=TypeError,function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return w(j,e)});var j;function V(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var i=arguments.length,s=new Array(i>1?i-1:0),r=1;r<i;r++)s[r-1]=arguments[r];return b(t,e,s)}}function B(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:E;if(p&&p(t,null),!S(e))return t;let s=e.length;for(;s--;){let r=e[s];if("string"==typeof r){const t=i(r);t!==r&&(d(e)||(e[s]=t),r=t)}t[r]=!0}return t}function q(t){for(let e=0;e<t.length;e++){O(t,e)||(t[e]=null)}return t}function H(t){const e=y(null);for(const s of c(t)){var i=l(s,2);const r=i[0],n=i[1];O(t,r)&&(S(n)?e[r]=q(n):n&&"object"==typeof n&&n.constructor===Object?e[r]=H(n):e[r]=n)}return e}function $(t,e){for(;null!==t;){const i=u(t,e);if(i){if(i.get)return V(i.get);if("function"==typeof i.value)return V(i.value)}t=f(t)}return function(){return null}}const G=m(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Y=m(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),X=m(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),K=m(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),J=m(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Z=m(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Q=m(["#text"]),tt=m(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),et=m(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),it=m(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),st=m(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),rt=g(/{{[\w\W]*|^[\w\W]*}}/g),nt=g(/<%[\w\W]*|^[\w\W]*%>/g),at=g(/\${[\w\W]*/g),ot=g(/^data-[\-\w.\u00B7-\uFFFF]+$/),ht=g(/^aria-[\-\w]+$/),lt=g(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ct=g(/^(?:\w+script|data):/i),pt=g(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),dt=g(/^html$/i),ft=g(/^[a-z][.\w]*(-[.\w]+)+$/i),ut=g(/<[/\w!]/g),mt=g(/<[/\w]/g),gt=g(/<\/no(script|embed|frames)/i),yt=g(/\/>/i),vt=1,bt=3,wt=7,kt=8,_t=9,Tt=11,xt=function(t,e,i,s){return O(t,e)&&S(t[e])?B(s.base?H(s.base):{},t[e],s.transform):i};var At=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof window?null:window;const i=e=>t(e);if(i.version="3.4.12",i.removed=[],!e||!e.document||e.document.nodeType!==_t||!e.Element)return i.isSupported=!1,i;let s=e.document;const r=s,n=r.currentScript;e.DocumentFragment;const a=e.HTMLTemplateElement,o=e.Node,h=e.Element,l=e.NodeFilter,p=e.NamedNodeMap;void 0===p&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const d=e.DOMParser,f=e.trustedTypes,u=h.prototype,v=$(u,"cloneNode"),b=$(u,"remove"),w=$(u,"nextSibling"),j=$(u,"childNodes"),V=$(u,"parentNode"),q=$(u,"shadowRoot"),At=$(u,"attributes"),St=o&&o.prototype?$(o.prototype,"nodeType"):null,Et=o&&o.prototype?$(o.prototype,"nodeName"):null;if("function"==typeof a){const t=s.createElement("template");t.content&&t.content.ownerDocument&&(s=t.content.ownerDocument)}let Ct,Pt,Dt="",It=!1,Mt=0;const Lt=function(){if(Mt>0)throw W('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Ft=function(t){Lt(),Mt++;try{return Ct.createHTML(t)}finally{Mt--}},Rt=function(){return It||(Pt=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let i=null;const s="data-tt-policy-suffix";e&&e.hasAttribute(s)&&(i=e.getAttribute(s));const r="dompurify"+(i?"#"+i:"");try{return t.createPolicy(r,{createHTML:t=>t,createScriptURL:t=>t})}catch(n){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(f,n),It=!0),Pt},Nt=s,Ot=Nt.implementation,zt=Nt.createNodeIterator,Ut=Nt.createDocumentFragment,Wt=Nt.getElementsByTagName,jt=r.importNode;let Vt={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};i.isSupported="function"==typeof c&&"function"==typeof V&&Ot&&void 0!==Ot.createHTMLDocument;const Bt=rt,qt=nt,Ht=at,$t=ot,Gt=ht,Yt=ct,Xt=pt,Kt=ft;let Jt=lt,Zt=null;const Qt=B({},[...G,...Y,...X,...J,...Q]);let te=null;const ee=B({},[...tt,...et,...it,...st]);let ie=Object.seal(y(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),se=null,re=null;const ne=Object.seal(y(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ae=!0,oe=!0,he=!1,le=!0,ce=!1,pe=!0,de=!1,fe=!1,ue=null,me=null,ge=!1,ye=!1,ve=!1,be=!1,we=!0,ke=!1;const _e="user-content-";let Te=!0,xe=!1,Ae={},Se=null;const Ee=B({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Ce=null;const Pe=B({},["audio","video","img","source","image","track"]);let De=null;const Ie=B({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Me="http://www.w3.org/1998/Math/MathML",Le="http://www.w3.org/2000/svg",Fe="http://www.w3.org/1999/xhtml";let Re=Fe,Ne=!1,Oe=null;const ze=B({},[Me,Le,Fe],C),Ue=m(["mi","mo","mn","ms","mtext"]);let We=B({},Ue);const je=m(["annotation-xml"]);let Ve=B({},je);const Be=B({},["title","style","font","a","script"]);let qe=null;const He=["application/xhtml+xml","text/html"];let $e=null,Ge=null;const Ye=s.createElement("form"),Xe=function(t){return t instanceof RegExp||t instanceof Function},Ke=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Ge&&Ge===t)return;t&&"object"==typeof t||(t={}),t=H(t),qe=-1===He.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,$e="application/xhtml+xml"===qe?C:E,Zt=xt(t,"ALLOWED_TAGS",Qt,{transform:$e}),te=xt(t,"ALLOWED_ATTR",ee,{transform:$e}),Oe=xt(t,"ALLOWED_NAMESPACES",ze,{transform:C}),De=xt(t,"ADD_URI_SAFE_ATTR",Ie,{transform:$e,base:Ie}),Ce=xt(t,"ADD_DATA_URI_TAGS",Pe,{transform:$e,base:Pe}),Se=xt(t,"FORBID_CONTENTS",Ee,{transform:$e}),se=xt(t,"FORBID_TAGS",H({}),{transform:$e}),re=xt(t,"FORBID_ATTR",H({}),{transform:$e}),Ae=!!O(t,"USE_PROFILES")&&(t.USE_PROFILES&&"object"==typeof t.USE_PROFILES?H(t.USE_PROFILES):t.USE_PROFILES),ae=!1!==t.ALLOW_ARIA_ATTR,oe=!1!==t.ALLOW_DATA_ATTR,he=t.ALLOW_UNKNOWN_PROTOCOLS||!1,le=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,ce=t.SAFE_FOR_TEMPLATES||!1,pe=!1!==t.SAFE_FOR_XML,de=t.WHOLE_DOCUMENT||!1,ye=t.RETURN_DOM||!1,ve=t.RETURN_DOM_FRAGMENT||!1,be=t.RETURN_TRUSTED_TYPE||!1,ge=t.FORCE_BODY||!1,we=!1!==t.SANITIZE_DOM,ke=t.SANITIZE_NAMED_PROPS||!1,Te=!1!==t.KEEP_CONTENT,xe=t.IN_PLACE||!1,Jt=function(t){try{return U(t,""),!0}catch(e){return!1}}(t.ALLOWED_URI_REGEXP)?t.ALLOWED_URI_REGEXP:lt,Re="string"==typeof t.NAMESPACE?t.NAMESPACE:Fe,We=O(t,"MATHML_TEXT_INTEGRATION_POINTS")&&t.MATHML_TEXT_INTEGRATION_POINTS&&"object"==typeof t.MATHML_TEXT_INTEGRATION_POINTS?H(t.MATHML_TEXT_INTEGRATION_POINTS):B({},Ue),Ve=O(t,"HTML_INTEGRATION_POINTS")&&t.HTML_INTEGRATION_POINTS&&"object"==typeof t.HTML_INTEGRATION_POINTS?H(t.HTML_INTEGRATION_POINTS):B({},je);const e=O(t,"CUSTOM_ELEMENT_HANDLING")&&t.CUSTOM_ELEMENT_HANDLING&&"object"==typeof t.CUSTOM_ELEMENT_HANDLING?H(t.CUSTOM_ELEMENT_HANDLING):y(null);if(ie=y(null),O(e,"tagNameCheck")&&Xe(e.tagNameCheck)&&(ie.tagNameCheck=e.tagNameCheck),O(e,"attributeNameCheck")&&Xe(e.attributeNameCheck)&&(ie.attributeNameCheck=e.attributeNameCheck),O(e,"allowCustomizedBuiltInElements")&&"boolean"==typeof e.allowCustomizedBuiltInElements&&(ie.allowCustomizedBuiltInElements=e.allowCustomizedBuiltInElements),g(ie),ce&&(oe=!1),ve&&(ye=!0),Ae&&(Zt=B({},Q),te=y(null),!0===Ae.html&&(B(Zt,G),B(te,tt)),!0===Ae.svg&&(B(Zt,Y),B(te,et),B(te,st)),!0===Ae.svgFilters&&(B(Zt,X),B(te,et),B(te,st)),!0===Ae.mathMl&&(B(Zt,J),B(te,it),B(te,st))),ne.tagCheck=null,ne.attributeCheck=null,O(t,"ADD_TAGS")&&("function"==typeof t.ADD_TAGS?ne.tagCheck=t.ADD_TAGS:S(t.ADD_TAGS)&&(Zt===Qt&&(Zt=H(Zt)),B(Zt,t.ADD_TAGS,$e))),O(t,"ADD_ATTR")&&("function"==typeof t.ADD_ATTR?ne.attributeCheck=t.ADD_ATTR:S(t.ADD_ATTR)&&(te===ee&&(te=H(te)),B(te,t.ADD_ATTR,$e))),O(t,"ADD_URI_SAFE_ATTR")&&S(t.ADD_URI_SAFE_ATTR)&&B(De,t.ADD_URI_SAFE_ATTR,$e),O(t,"FORBID_CONTENTS")&&S(t.FORBID_CONTENTS)&&(Se===Ee&&(Se=H(Se)),B(Se,t.FORBID_CONTENTS,$e)),O(t,"ADD_FORBID_CONTENTS")&&S(t.ADD_FORBID_CONTENTS)&&(Se===Ee&&(Se=H(Se)),B(Se,t.ADD_FORBID_CONTENTS,$e)),Te&&(Zt["#text"]=!0),de&&B(Zt,["html","head","body"]),Zt.table&&(B(Zt,["tbody"]),delete se.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw W('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw W('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const e=Ct;Ct=t.TRUSTED_TYPES_POLICY;try{Dt=Ft("")}catch(i){throw Ct=e,i}}else null===t.TRUSTED_TYPES_POLICY?(Ct=void 0,Dt=""):(void 0===Ct&&(Ct=Rt()),Ct&&"string"==typeof Dt&&(Dt=Ft("")));m&&m(t),Ge=t},Je=B({},[...Y,...X,...K]),Ze=B({},[...J,...Z]),Qe=function(t){let e=V(t);e&&e.tagName||(e={namespaceURI:Re,tagName:"template"});const i=E(t.tagName),s=E(e.tagName);return!!Oe[t.namespaceURI]&&(t.namespaceURI===Le?function(t,e,i){return e.namespaceURI===Fe?"svg"===t:e.namespaceURI===Me?"svg"===t&&("annotation-xml"===i||We[i]):Boolean(Je[t])}(i,e,s):t.namespaceURI===Me?function(t,e,i){return e.namespaceURI===Fe?"math"===t:e.namespaceURI===Le?"math"===t&&Ve[i]:Boolean(Ze[t])}(i,e,s):t.namespaceURI===Fe?function(t,e,i){return!(e.namespaceURI===Le&&!Ve[i])&&!(e.namespaceURI===Me&&!We[i])&&!Ze[t]&&(Be[t]||!Je[t])}(i,e,s):!("application/xhtml+xml"!==qe||!Oe[t.namespaceURI]))},ti=function(t){x(i.removed,{element:t});try{V(t).removeChild(t)}catch(e){if(b(t),!V(t))throw W("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ei=function(t){ri(t);const e=j(t);if(e){const t=[];k(e,e=>{x(t,e)}),k(t,t=>{try{b(t)}catch(e){}})}const i=At(t);if(i)for(let r=i.length-1;r>=0;--r){const e=i[r],n=e&&e.name;if("string"==typeof n)try{t.removeAttribute(n)}catch(s){}}},ii=function(t,e){try{x(i.removed,{attribute:e.getAttributeNode(t),from:e})}catch(s){x(i.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t)if(ye||ve)try{ti(e)}catch(s){}else try{e.setAttribute(t,"")}catch(s){}},si=function(t){const e=At(t);if(e)for(let s=e.length-1;s>=0;--s){const r=e[s],n=r&&r.name;if("string"==typeof n&&!te[$e(n)])try{t.removeAttribute(n)}catch(i){}}},ri=function(t){const e=[t];for(;e.length>0;){const t=e.pop();(St?St(t):t.nodeType)===vt&&si(t);const i=j(t);if(i)for(let s=i.length-1;s>=0;--s)e.push(i[s])}},ni=function(t){let e=null,i=null;if(ge)t="<remove></remove>"+t;else{const e=P(t,/^[\r\n\t ]+/);i=e&&e[0]}"application/xhtml+xml"===qe&&Re===Fe&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const r=Ct?Ft(t):t;if(Re===Fe)try{e=(new d).parseFromString(r,qe)}catch(a){}if(!e||!e.documentElement){e=Ot.createDocument(Re,"template",null);try{e.documentElement.innerHTML=Ne?Dt:r}catch(a){}}const n=e.body||e.documentElement;return t&&i&&n.insertBefore(s.createTextNode(i),n.childNodes[0]||null),Re===Fe?Wt.call(e,de?"html":"body")[0]:de?e.documentElement:n},ai=function(t){return zt.call(t.ownerDocument||t,t,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},oi=function(t){return t=D(t,Bt," "),t=D(t,qt," "),t=D(t,Ht," ")},hi=function(t){var e;t.normalize();const i=zt.call(t.ownerDocument||t,t,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let s=i.nextNode();for(;s;)s.data=oi(s.data),s=i.nextNode();const r=null===(e=t.querySelectorAll)||void 0===e?void 0:e.call(t,"template");r&&k(r,t=>{ci(t.content)&&hi(t.content)})},li=function(t){const e=Et?Et(t):null;return"string"==typeof e&&("form"===$e(e)&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||t.attributes!==At(t)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes||t.nodeType!==St(t)||t.childNodes!==j(t)))},ci=function(t){if(!St||"object"!=typeof t||null===t)return!1;try{return St(t)===Tt}catch(e){return!1}},pi=function(t){if(!St||"object"!=typeof t||null===t)return!1;try{return"number"==typeof St(t)}catch(e){return!1}};function di(t,e,s){0!==t.length&&k(t,t=>{t.call(i,e,s,Ge)})}const fi=function(t,e){if(di(Vt.beforeSanitizeElements,t,null),t!==e&&null===V(t))return!0;if(li(t))return ti(t),!0;const s=$e(Et?Et(t):t.nodeName);if(di(Vt.uponSanitizeElement,t,{tagName:s,allowedTags:Zt}),t!==e&&null===V(t))return!0;if(function(t,e){return!!(pe&&t.hasChildNodes()&&!pi(t.firstElementChild)&&U(ut,t.textContent)&&U(ut,t.innerHTML))||!(!pe||t.namespaceURI!==Fe||"style"!==e||!pi(t.firstElementChild))||t.nodeType===wt||!(!pe||t.nodeType!==kt||!U(mt,t.data))}(t,s))return ti(t),!0;if(se[s]||!(ne.tagCheck instanceof Function&&ne.tagCheck(s))&&!Zt[s]){const e=function(t,e){if(!se[e]&&gi(e)){if(ie.tagNameCheck instanceof RegExp&&U(ie.tagNameCheck,e))return!1;if(ie.tagNameCheck instanceof Function&&ie.tagNameCheck(e))return!1}if(Te&&!Se[e]){const e=V(t),i=j(t);if(i&&e)for(let s=i.length-1;s>=0;--s){const r=xe?i[s]:v(i[s],!0);e.insertBefore(r,w(t))}}return ti(t),!0}(t,s);return!1===e&&di(Vt.afterSanitizeElements,t,null),e}if((St?St(t):t.nodeType)===vt&&!Qe(t))return ti(t),!0;if(("noscript"===s||"noembed"===s||"noframes"===s)&&U(gt,t.innerHTML))return ti(t),!0;if(ce&&t.nodeType===bt){const e=oi(t.textContent);t.textContent!==e&&(x(i.removed,{element:t.cloneNode()}),t.textContent=e)}return di(Vt.afterSanitizeElements,t,null),!1},ui=function(t,e,i){if(re[e])return!1;if(pe&&"patchsrc"===e)return!1;if(pe&&"for"===e&&"label"!==t&&"output"!==t)return!1;if(we&&("id"===e||"name"===e)&&(i in s||i in Ye))return!1;const r=te[e]||ne.attributeCheck instanceof Function&&ne.attributeCheck(e,t);if(oe&&U($t,e));else if(ae&&U(Gt,e));else if(r)if(De[e]);else if(U(Jt,D(i,Xt,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==I(i,"data:")||!Ce[t]){if(he&&!U(Yt,D(i,Xt,"")));else if(i)return!1}else;else if(!(gi(t)&&(ie.tagNameCheck instanceof RegExp&&U(ie.tagNameCheck,t)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(t))&&(ie.attributeNameCheck instanceof RegExp&&U(ie.attributeNameCheck,e)||ie.attributeNameCheck instanceof Function&&ie.attributeNameCheck(e,t))||"is"===e&&ie.allowCustomizedBuiltInElements&&(ie.tagNameCheck instanceof RegExp&&U(ie.tagNameCheck,i)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(i))))return!1;return!0},mi=B({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),gi=function(t){return!mi[E(t)]&&U(Kt,t)},yi=function(t,e,i,s){if(Ct&&"object"==typeof f&&"function"==typeof f.getAttributeType&&!i)switch(f.getAttributeType(t,e)){case"TrustedHTML":return Ft(s);case"TrustedScriptURL":return function(t){Lt(),Mt++;try{return Ct.createScriptURL(t)}finally{Mt--}}(s)}return s},vi=function(t,e,s,r){try{s?t.setAttributeNS(s,e,r):t.setAttribute(e,r),li(t)?ti(t):T(i.removed)}catch(n){ii(e,t)}},bi=function(t){di(Vt.beforeSanitizeAttributes,t,null);const e=t.attributes;if(!e||li(t))return;const i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:te,forceKeepAttr:void 0};let s=e.length;const r=$e(t.nodeName);for(;s--;){const n=e[s],a=n.name,o=n.namespaceURI,h=n.value,l=$e(a),c=h;let p="value"===a?c:M(c);i.attrName=l,i.attrValue=p,i.keepAttr=!0,i.forceKeepAttr=void 0,di(Vt.uponSanitizeAttribute,t,i),p=i.attrValue,!ke||"id"!==l&&"name"!==l||0===I(p,_e)||(ii(a,t),p=_e+p),pe&&U(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,p)?ii(a,t):"attributename"===l&&P(p,"href")?ii(a,t):i.forceKeepAttr||(i.keepAttr&&(le||!U(yt,p))?(ce&&(p=oi(p)),ui(r,l,p)?(p=yi(r,l,o,p),p!==c&&vi(t,a,o,p)):ii(a,t)):ii(a,t))}di(Vt.afterSanitizeAttributes,t,null)},wi=function(t){let e=null;const i=ai(t);for(di(Vt.beforeSanitizeShadowDOM,t,null);e=i.nextNode();){di(Vt.uponSanitizeShadowNode,e,null),fi(e,t),bi(e),ci(e.content)&&wi(e.content);if((St?St(e):e.nodeType)===vt){const t=q(e);ci(t)&&(ki(t),wi(t))}}di(Vt.afterSanitizeShadowDOM,t,null)},ki=function(t){const e=[{node:t,shadow:null}];for(;e.length>0;){const t=e.pop();if(t.shadow){wi(t.shadow);continue}const i=t.node,s=(St?St(i):i.nodeType)===vt,r=j(i);if(r)for(let n=r.length-1;n>=0;--n)e.push({node:r[n],shadow:null});if(s){const t=Et?Et(i):null;if("string"==typeof t&&"template"===$e(t)){const t=i.content;ci(t)&&e.push({node:t,shadow:null})}}if(s){const t=q(i);ci(t)&&e.push({node:null,shadow:t},{node:t,shadow:null})}}};return i.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=null,n=null,a=null,o=null;if(Ne=!t,Ne&&(t="\x3c!--\x3e"),"string"!=typeof t&&!pi(t)&&"string"!=typeof(t=function(t){switch(typeof t){case"string":return t;case"number":return L(t);case"boolean":return F(t);case"bigint":return R?R(t):"0";case"symbol":return N?N(t):"Symbol()";case"undefined":default:return z(t);case"function":case"object":{if(null===t)return z(t);const e=t,i=$(e,"toString");if("function"==typeof i){const t=i(e);return"string"==typeof t?t:z(t)}return z(t)}}}(t)))throw W("dirty is not a string, aborting");if(!i.isSupported)return t;fe?(Zt=ue,te=me):Ke(e),(Vt.uponSanitizeElement.length>0||Vt.uponSanitizeAttribute.length>0)&&(Zt=H(Zt)),Vt.uponSanitizeAttribute.length>0&&(te=H(te)),i.removed=[];const h=xe&&"string"!=typeof t&&pi(t);if(h){!function(t){if(!pe)return;const e=[t];for(;e.length>0;){const t=e.pop(),s=St?St(t):t.nodeType;if(s===wt||s===kt&&U(mt,t.data)){try{b(t)}catch(i){}continue}if(s===vt){const e=t,s=$e(Et?Et(t):t.nodeName);try{e.hasAttribute&&e.hasAttribute("patchsrc")&&e.removeAttribute("patchsrc"),e.hasAttribute&&e.hasAttribute("for")&&"label"!==s&&"output"!==s&&e.removeAttribute("for")}catch(i){}}const r=j(t);if(r)for(let i=r.length-1;i>=0;--i)e.push(r[i])}}(t);const e=Et?Et(t):t.nodeName;if("string"==typeof e){const i=$e(e);if(!Zt[i]||se[i])throw ei(t),W("root node is forbidden and cannot be sanitized in-place")}if(li(t))throw ei(t),W("root node is clobbered and cannot be sanitized in-place");try{ki(t)}catch(d){throw ei(t),d}}else if(pi(t))s=ni("\x3c!----\x3e"),n=s.ownerDocument.importNode(t,!0),n.nodeType===vt&&"BODY"===n.nodeName||"HTML"===n.nodeName?s=n:s.appendChild(n),ki(n);else{if(!ye&&!ce&&!de&&-1===t.indexOf("<"))return Ct&&be?Ft(t):t;if(s=ni(t),!s)return ye?null:be?Dt:""}s&&ge&&ti(s.firstChild);const l=h?t:s,c=ai(l);try{for(;a=c.nextNode();)fi(a,l),bi(a),ci(a.content)&&wi(a.content)}catch(d){throw h&&(ei(t),k(i.removed,t=>{t.element&&ri(t.element)})),d}if(h)return k(i.removed,t=>{t.element&&ri(t.element)}),ce&&hi(t),t;if(ye){if(ce&&hi(s),ve)for(o=Ut.call(s.ownerDocument);s.firstChild;)o.appendChild(s.firstChild);else o=s;return(te.shadowroot||te.shadowrootmode)&&(o=jt.call(r,o,!0)),o}let p=de?s.outerHTML:s.innerHTML;return de&&Zt["!doctype"]&&s.ownerDocument&&s.ownerDocument.doctype&&s.ownerDocument.doctype.name&&U(dt,s.ownerDocument.doctype.name)&&(p="<!DOCTYPE "+s.ownerDocument.doctype.name+">\n"+p),ce&&(p=oi(p)),Ct&&be?Ft(p):p},i.setConfig=function(){Ke(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),fe=!0,ue=Zt,me=te},i.clearConfig=function(){Ge=null,fe=!1,ue=null,me=null,Ct=Pt,Dt=""},i.isValidAttribute=function(t,e,i){Ge||Ke({});const s=$e(t),r=$e(e);return ui(s,r,i)},i.addHook=function(t,e){"function"==typeof e&&O(Vt,t)&&x(Vt[t],e)},i.removeHook=function(t,e){if(O(Vt,t)){if(void 0!==e){const i=_(Vt[t],e);return-1===i?void 0:A(Vt[t],i,1)[0]}return T(Vt[t])}},i.removeHooks=function(t){O(Vt,t)&&(Vt[t]=[])},i.removeAllHooks=function(){Vt={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},i}();function St(t,e){const i=t.startsWith("--")?t:`--${t}`,s=[e,document.documentElement,document.body,...Array.from(document.querySelectorAll(["rai-widget","rai-custom-widget","rai-channel-widget","rai-store-widget","rai-milestone-widget","rai-social-widget","rai-currency-widget","rai-referral-widget",".rai-widget-root",'[data-rai-widget-root="true"]'].join(",")))].filter(Boolean),r=new Set;for(const n of s){if(r.has(n))continue;r.add(n);const t=getComputedStyle(n).getPropertyValue(i).trim();if(t)return t}for(const n of Array.from(document.querySelectorAll("*"))){if(r.has(n))continue;const t=getComputedStyle(n).getPropertyValue(i).trim();if(t)return t}}function Et(t,e){if(!t)return;const i=t.trim();if(/^(#|rgb|hsl)/i.test(i))return i;if(/^(--)?[a-z0-9-]+$/i.test(i))return St(i,e);const s=i.match(/^var\((--[a-z0-9-]+)\)$/i);return s?St(s[1],e):void 0}function Ct(t,e,i){const s=document.createElement(t);if(Object.assign(s.style,e),i)for(const r of Object.keys(i))s.setAttribute(r,i[r]);return s}function Pt(t){return"left"===t||"top"===t?"flex-start":"right"===t||"bottom"===t?"flex-end":"center"}function Dt(t,e){var i;const s=[null==(i=t.cta)?void 0:i.style,t.cta,t.ctaStyle];for(const r of s)for(const t of e){const e=null==r?void 0:r[t];if(e)return e}}function It(t,e,i){var s,r,n,a,o,h,l,c,p,d,f,u,m,g;const y=t.placement||{},v=y.mode||"overlay",b=y.position||"top",w=String(y.zIndex||2147483e3),k=function(t){var e,i;return"image"===t.type&&Boolean((null==(e=t.image)?void 0:e.desktopUrl)||(null==(i=t.image)?void 0:i.mobileUrl))}(t),_=k?"transparent":Et(null==(s=t.style)?void 0:s.backgroundColor,i)||"#1f2024",T=Et(null==(r=t.style)?void 0:r.color,i)||"#ffffff",x="overlay"===v||"popup"===v,A=Dt(t,["position"])||"center",S=Pt(null==(n=t.image)?void 0:n.horizontalAlignment),E=Pt(null==(a=t.image)?void 0:a.verticalAlignment),C=(null==(o=t.image)?void 0:o.horizontalAlignment)||"center",P=(null==(h=t.image)?void 0:h.verticalAlignment)||"center",D=k?"#ffffff":T,I=Ct("div",{boxSizing:"border-box",fontFamily:"Roboto, sans-serif",fontSize:"14px",lineHeight:"1.35",background:_,color:T,borderRadius:x&&!k?"6px":"0",boxShadow:x&&!k?"0 8px 24px rgba(0,0,0,0.22)":"none",padding:k?"0":x?"12px 42px 12px 24px":"8px 42px 8px 16px",display:"flex",alignItems:k?E:"flex-start",justifyContent:"center",gap:k?"0":"16px"});if(I.setAttribute("role",x?"dialog":"region"),I.setAttribute("aria-label","community banner"),I.setAttribute("data-renderer-version","sdk-banner-preview-layout"),x)if(Object.assign(I.style,{position:"fixed",left:"50%",width:"fit-content",maxWidth:k?"70vw":"min(700px, 80vw)",height:"auto",minHeight:k?"0":"80px",maxHeight:k?"70vh":"calc(100vh - 300px)",overflowY:k?"visible":"auto",zIndex:w}),k){const t=[];"left"===C?I.style.left="24px":"right"===C?(I.style.left="",I.style.right="24px"):(I.style.left="50%",t.push("-50%")),"top"===P?I.style.top="10px":"bottom"===P?I.style.bottom="24px":(I.style.top="50%",t.push("-50%")),2===t.length?I.style.transform=`translate(${t[0]}, ${t[1]})`:1===t.length&&"center"===C?I.style.transform=`translateX(${t[0]})`:1===t.length?I.style.transform=`translateY(${t[0]})`:I.style.transform=""}else"bottom"===b?(I.style.bottom="24px",I.style.transform="translateX(-50%)"):"center"===b?(I.style.top="50%",I.style.transform="translate(-50%, -50%)"):(I.style.top="10px",I.style.transform="translateX(-50%)");else Object.assign(I.style,{position:"relative",width:"100%",zIndex:w});const M=Ct("div",{display:"flex",width:k||x?"auto":"100%",maxWidth:"100%",flexDirection:"column",gap:k?"0":"12px",overflow:"hidden"}),L=Ct("div",{display:"flex",width:k||x?"auto":"100%",justifyContent:k?S:"space-between",alignItems:k?E:"flex-start",gap:"12px"}),F=Ct("div",{width:k||x?"auto":"100%",maxWidth:k?"70vw":x?"calc(min(700px, 80vw) - 66px)":"100%",overflow:"hidden",wordBreak:"normal",overflowWrap:"anywhere",whiteSpace:"normal",color:T}),R=(null==(l=t.image)?void 0:l.desktopUrl)||(null==(c=t.image)?void 0:c.mobileUrl);if(k&&R){const e=null==(p=t.image)?void 0:p.linkUrl,i=null==(d=t.image)?void 0:d.openInNewTab,s=Ct("img",{display:"block",maxWidth:"70vw",maxHeight:"70vh",width:"auto",height:"auto",objectFit:"contain",objectPosition:(U=null==(f=t.image)?void 0:f.horizontalAlignment,W=null==(u=t.image)?void 0:u.verticalAlignment,`${"left"===U?"left":"right"===U?"right":"center"} ${"top"===W?"top":"bottom"===W?"bottom":"center"}`),cursor:e?"pointer":"",borderRadius:"rounded"===(null==(m=t.image)?void 0:m.cornerRadius)?"8px":"0"},{src:R,alt:t.title||"banner"});e&&s.addEventListener("click",()=>{i?window.open(e,"_blank","noopener,noreferrer"):window.location.href=e}),F.appendChild(s)}else{F.innerHTML=(z=t.text)?At.sanitize(z,{ALLOWED_TAGS:["p","strong","em","u","img","span","div","a","br"],ALLOWED_ATTR:["style","src","class","href","target","alt","width","height"],ADD_ATTR:["target"],ALLOW_DATA_ATTR:!1}):"",(O=F).querySelectorAll("p").forEach(t=>{t.style.margin="0",t.style.whiteSpace="normal",t.style.overflowWrap="anywhere"}),O.querySelectorAll("strong").forEach(t=>{t.style.fontWeight="700",t.style.whiteSpace="normal"}),O.querySelectorAll("em").forEach(t=>{t.style.fontStyle="italic",t.style.whiteSpace="normal"}),O.querySelectorAll("u").forEach(t=>{t.style.textDecoration="underline",t.style.whiteSpace="normal"}),O.querySelectorAll("a").forEach(t=>{t.style.color="#3b82f6",t.style.textDecoration="underline",t.style.whiteSpace="normal",t.style.overflowWrap="anywhere","_blank"===t.getAttribute("target")&&t.setAttribute("rel","noopener noreferrer")}),O.querySelectorAll("img").forEach(t=>{t.style.maxWidth="100%",t.style.height="auto"});const e=function(t){const e=t.querySelector('[style*="text-align"]'),i=((null==e?void 0:e.style.textAlign)||t.style.textAlign||"").toLowerCase().trim();return"center"===i||"right"===i||"justify"===i?i:"left"}(F);F.style.textAlign=e,x&&(L.style.justifyContent="center"===(N=e)?"center":"right"===N?"flex-end":"flex-start")}var N,O,z,U,W,j;if(!k&&(null==(g=t.cta)?void 0:g.enabled)){const s=Ct("button",{cursor:"pointer",border:"none",borderRadius:"6px",height:"36px",minHeight:"36px",padding:"0 16px",fontFamily:"Roboto, sans-serif",fontSize:"12px",fontWeight:"600",lineHeight:"20px",backgroundColor:Et(Dt(t,["backgroundColor","buttonColor","aColor"]),i)||"#2f6df6",color:Et(Dt(t,["textColor","color"]),i)||"#ffffff",boxSizing:"border-box",display:"inline-flex",alignItems:"center",justifyContent:"center"});if(s.type="button",s.textContent=t.cta.label||"CTA Button",s.addEventListener("click",e.onCtaClick),"inline"===A){L.appendChild(F);const t=Ct("div",{display:"flex",flexDirection:"column",alignItems:"flex-end",justifyContent:"center",flexShrink:"0"});t.appendChild(s),L.appendChild(t),M.appendChild(L)}else{L.appendChild(F),M.appendChild(L);const t=Ct("div",{display:"flex",width:"100%",justifyContent:(j=A,"left"===j?"flex-start":"right"===j?"flex-end":"center")});t.appendChild(s),M.appendChild(t)}}else L.appendChild(F),M.appendChild(L);I.appendChild(M);const V=Ct("button",{position:x?"absolute":"",top:x?k?"16px":"12px":"",right:x?k?"16px":"12px":"",marginTop:x?"0":"8px",width:"20px",minWidth:"20px",height:"20px",cursor:"pointer",border:"none",borderRadius:"50%",background:"rgba(0,0,0,0.25)",color:D,fontSize:"16px",lineHeight:"1",display:"flex",alignItems:"center",justifyContent:"center",padding:"0",flexShrink:"0"});return V.type="button",V.setAttribute("aria-label","dismiss banner"),V.innerHTML="&times;",V.addEventListener("click",e.onDismiss),I.appendChild(V),I}At.addHook("afterSanitizeAttributes",t=>{"A"===t.tagName&&"_blank"===t.getAttribute("target")&&t.setAttribute("rel","noopener noreferrer")});function Mt(){try{if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID()}catch{}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}function Lt(t){if(t)try{(new Image).src=t}catch{}}function Ft(t){return`${t.storagePrefix}-${t.widgetId}-${t.container}-auth`}function Rt(t){return`${t.storagePrefix}-${t.widgetId}-auth`}function Nt(t){return`${t.storagePrefix}-${t.widgetId}-error-settings`}function Ot(t,e){try{const i={refreshToken:e.refreshToken,tokenFamily:e.tokenFamily,refreshTokenExpiry:e.refreshTokenExpiry};localStorage.setItem(Ft(t),JSON.stringify(i))}catch{}}function zt(t){try{localStorage.removeItem(Ft(t)),localStorage.removeItem(Rt(t))}catch{}}function Ut(t){try{const e=localStorage.getItem(Nt(t));if(!e)return null;const i=JSON.parse(e);return i.cachedAt&&Date.now()-i.cachedAt<36e5?i:(localStorage.removeItem(Nt(t)),null)}catch{return null}}function Wt(t){return!t||Date.now()>=t-6e4}function jt(t,e,i,s){e.accessToken=i.accessToken,e.refreshToken=i.refreshToken,e.tokenFamily=i.tokenFamily??null,i.widgetData&&"object"==typeof i.widgetData&&!Array.isArray(i.widgetData)&&(e.widgetData=i.widgetData);const r=Date.now();e.accessTokenExpiry=r+1e3*i.accessTokenTTL,e.refreshTokenExpiry=r+1e3*i.refreshTokenTTL,Ot(t,e),t.autoRefresh&&s&&s()}function Vt(t){const e={};return t.embedToken&&(e.embedToken=t.embedToken),t.userIdentifiers&&Object.keys(t.userIdentifiers).length>0&&(e.userIdentifiers=t.userIdentifiers),e}async function Bt(t,e,i){const s=crypto.randomUUID(),r=Date.now(),n=t.maxRetries??3,a=t.retryDelay??500;for(let o=0;o<=n;o++){o>0&&await new Promise(t=>setTimeout(t,a*(1<<o-1)));let h=!1;try{const n={nonce:s,timestamp:r,widgetType:t.widgetType,...Vt(t)},a=await fetch(`${t.apiUrl}/${t.widgetId}/auth/serverless`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),credentials:"include"});if(!a.ok){h=a.status>=400&&a.status<500;const t=await a.json().catch(()=>({error:"Authentication failed"}));throw h&&(e.lastAuthError={status:a.status,error:null==t?void 0:t.error,hint:null==t?void 0:t.hint},console.error(`[rai-widget] /auth/serverless ${a.status}:`,(null==t?void 0:t.error)||"Authentication failed",(null==t?void 0:t.hint)?`— ${t.hint}`:"")),new Error((null==t?void 0:t.error)||`HTTP ${a.status}`)}e.lastAuthError=null;const o=await a.json();if(!o.accessToken||!o.refreshToken)throw new Error("Invalid authentication response");return jt(t,e,o,i),e.isAuthenticated=!0,!0}catch{if(h||o===n)return e.isAuthenticated=!1,!1}}return e.isAuthenticated=!1,!1}async function qt(t,e,i){const s=t.maxRetries??3,r=t.retryDelay??500;for(let n=0;n<=s;n++){n>0&&await new Promise(t=>setTimeout(t,r*(1<<n-1)));let a=!1;try{const s=await fetch(t.authUrl,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}});if(!s.ok)throw a=s.status>=400&&s.status<500,new Error(`HTTP ${s.status}`);const r=await s.json();if(!r.token)throw new Error("Invalid proxy auth response");const n=r.expiresIn??300;return e.accessToken=r.token,e.refreshToken=null,e.tokenFamily=null,e.accessTokenExpiry=Date.now()+1e3*n,e.refreshTokenExpiry=null,e.isAuthenticated=!0,t.autoRefresh&&i&&i(),!0}catch{if(a||n===s)return e.isAuthenticated=!1,!1}}return e.isAuthenticated=!1,!1}async function Ht(t,e,i,s){return e.isRefreshing?e.refreshPromise:!!e.refreshToken&&(e.isRefreshing=!0,e.refreshPromise=(async()=>{const r=async()=>{Xt(e),zt(t);const r=await Bt(t,e,i);return r&&s&&s(),r};try{const n=await fetch(`${t.apiUrl}/${t.widgetId}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.refreshToken}`},body:JSON.stringify({widgetType:t.widgetType,...Vt(t)})});if(!n.ok){if(400===n.status||401===n.status||403===n.status)return r();const t=await n.json().catch(()=>({error:"Token refresh failed"}));throw new Error(t.error||`HTTP ${n.status}`)}const a=await n.json();if(!a.accessToken||!a.refreshToken)throw new Error("Invalid refresh response");return jt(t,e,a,i),s&&s(),!0}catch{return r()}finally{e.isRefreshing=!1,e.refreshPromise=null}})(),e.refreshPromise)}const $t=new Map;function Gt(t,e){e.configured&&(t.errorSettings={errorMessage:e.errorMessage,modalColor:e.modalColor,backgroundImage:e.backgroundImage}),e.loadingAnimation&&(t.loadingAnimation=e.loadingAnimation),e.loadingSettings&&(t.loadingSettings=e.loadingSettings),e.themePalette&&(t.themePalette=e.themePalette),"string"==typeof e.font&&e.font&&(t.font=e.font),"light"!==e.defaultColorSchema&&"dark"!==e.defaultColorSchema||(t.defaultColorSchema=e.defaultColorSchema)}async function Yt(t,e,i={}){if(!i.skipCache){const i=Ut(t);if(i)return Gt(e,i),e.errorSettings}const s=`${t.apiUrl}/${t.widgetId}/auth/error-settings?widgetType=${t.widgetType}`;let r=$t.get(s);r||(r=(async()=>{try{const e=await fetch(s,{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok)return null;const i=await e.json();return function(t,e){try{localStorage.setItem(Nt(t),JSON.stringify({...e,cachedAt:Date.now()}))}catch{}}(t,i),i}catch{return null}finally{$t.delete(s)}})(),$t.set(s,r));const n=await r;return n?(Gt(e,n),e.errorSettings):null}function Xt(t){t.accessToken=null,t.refreshToken=null,t.tokenFamily=null,t.accessTokenExpiry=null,t.refreshTokenExpiry=null,t.isAuthenticated=!1,t.isRefreshing=!1,t.refreshPromise=null,t.lastAuthError=null,t.widgetData=null,t.refreshTimer&&(clearTimeout(t.refreshTimer),t.refreshTimer=null),t.syncTimer&&(clearInterval(t.syncTimer),t.syncTimer=null)}const Kt="__RAI_AUTO_THEME_LEASE_STATE__",Jt="__DISABLE_AUTO_THEME__";function Zt(t){return("object"==typeof t||"function"==typeof t)&&null!==t&&"function"==typeof t.then}function Qt(t,e,i){return new Promise((s,r)=>{const n=setTimeout(()=>{r(new Error(i))},e);Promise.resolve(t).then(t=>{clearTimeout(n),s(t)},t=>{clearTimeout(n),r(t)})})}async function te(t,e,i=3e4){const s=Zt(t)?await Qt(t,i,`Widget bundle mount did not resolve within ${i}ms`):t;return"object"==typeof(r=s)&&null!==r&&"ready"in r&&Zt(r.ready)?(await Qt(s.ready,i,`Widget bundle did not report deep readiness within ${i}ms`),"deep-ready"):(await e,"first-paint");var r}function ee(t,e){const i=new URL(t,e);return i.hash="",i.href}const ie=function({loadScript:t,readGlobal:e,baseUrl:i}){const s=new Map,r=new Map;return async function(n,a){const o=ee(a,i()),h=`${n}:${o}`,l=s.get(h);if(l)return l;const c=(r.get(n)||Promise.resolve()).then(async()=>{await t(o);const i=e(n);if("object"!=typeof(s=i)&&"function"!=typeof s||null===s||"function"!=typeof s.mount)throw new Error(`window.${n}.mount not found after loading ${o}`);var s;const r=i.mount;return{mount:(t,e)=>r.call(i,t,e)}});s.set(h,c);const p=c.then(()=>{},()=>{});r.set(n,p),p.then(()=>{r.get(n)===p&&r.delete(n)});try{return await c}catch(d){throw s.get(h)===c&&s.delete(h),d}}}({loadScript:function(t){return new Promise((e,i)=>{const s=document.createElement("script");s.src=t,s.onload=()=>e(),s.onerror=()=>i(new Error(`Failed to load ${t}`)),document.head.appendChild(s)})},readGlobal:t=>window[t],baseUrl:()=>document.baseURI}),se=function({preloadScript:t,baseUrl:e}){const i=new Map;return function(s,r){const n=ee(r,e());if(i.has(n))return;const a=t(n).catch(()=>{i.delete(n)});i.set(n,a)}}({preloadScript:function(t){return new Promise((e,i)=>{const s=document.createElement("link");s.rel="preload",s.as="script",s.href=t,s.onload=()=>e(),s.onerror=()=>i(new Error(`Failed to preload ${t}`)),document.head.appendChild(s)})},baseUrl:()=>document.baseURI});class re{constructor(){i(this,"registeredCallbacks",{}),i(this,"locked",!1)}get isLocked(){return this.locked}registerCallback(t,e){this.locked||(!function(t){if(!t||"string"!=typeof t)throw new TypeError("ReturningAI callback name must be a non-empty string")}(t),function(t){if("function"!=typeof t)throw new TypeError("ReturningAI callback must be a function")}(e),this.registeredCallbacks={...this.registeredCallbacks,[t]:e})}lock(){this.locked||(this.locked=!0)}read(){return{...this.registeredCallbacks}}}const ne="store.callback_field_options",ae="callbackFieldOptions",oe="store.purchase_success",he="storePurchaseSuccess",le="milestone.cta_click",ce="milestoneCtaClick",pe="milestone_cta_clicked";function de(t){return"object"==typeof t&&null!==t}function fe(t){return de(t)&&Object.values(t).every(t=>"string"==typeof t)}function ue(t){return function(t){if(!t)return null;const e=t.split(".")[1];if(!e)return null;try{const t=e.replace(/-/g,"+").replace(/_/g,"/"),i=t.padEnd(4*Math.ceil(t.length/4),"="),s=Uint8Array.from(atob(i),t=>t.charCodeAt(0)),r=JSON.parse((new TextDecoder).decode(s));return de(r)&&fe(r.userIdentifiers)?{...r.userIdentifiers}:null}catch{return null}}(t.embedToken)??{...t.userIdentifiers}}function me(t,e,i){return de(t)&&t.callbackName===e&&t.scope===i}function ge(t,e){if(!e||0===Object.keys(e).length)return t;if(!de(t))return t;const i=t.context;if(!de(i))return t;const s=i.user;return de(s)?{...t,context:{...i,user:{...s,identifiers:{...e}}}}:t}const ye={[ae]:{callbackName:ae,scope:ne,sourceWidgetType:"store",allowedHostWidgetTypes:["store","custom"],completionMode:"result",missingHandler:"reject",legacyActions:["store:host-callback"],validatePayload:t=>me(t,ae,ne)},[he]:{callbackName:he,scope:oe,sourceWidgetType:"store",allowedHostWidgetTypes:["store","custom"],completionMode:"acknowledged",missingHandler:"reject",legacyActions:["store:host-callback"],validatePayload:t=>me(t,he,oe)},[ce]:{callbackName:ce,scope:le,sourceWidgetType:"milestone",allowedHostWidgetTypes:["milestone","custom"],completionMode:"detached",missingHandler:"ignore",legacyActions:[],validatePayload:function(t){if(!me(t,ce,le))return!1;const e=t.context;if(!de(e))return!1;const i=e.community,s=e.milestone,r=e.stage,n=e.button,a=e.user;return e.event===pe&&de(i)&&"string"==typeof i.id&&i.id.length>0&&(void 0===i.name||null===i.name||"string"==typeof i.name)&&de(s)&&"string"==typeof s.id&&s.id.length>0&&"string"==typeof s.name&&s.name.length>0&&de(r)&&"string"==typeof r.id&&r.id.length>0&&"string"==typeof r.name&&r.name.length>0&&de(n)&&"string"==typeof n.name&&n.name.length>0&&de(a)&&fe(a.identifiers)&&"string"==typeof e.clickedAt&&e.clickedAt.length>0&&!Number.isNaN(Date.parse(e.clickedAt))}}};function ve(t,e){if(t)try{t(e)}catch{}}function be(t,e){const i=ye[t];return(null==i?void 0:i.validatePayload(e))?i:void 0}function we(t){const e=be(t.callbackName,t.payload);if(!e||!e.allowedHostWidgetTypes.includes(t.hostWidgetType))throw new Error("Host callback is not supported for this widget");const i={invocationId:t.invocationId||`host_callback_${Date.now()}_${Math.random().toString(36).slice(2)}`,callbackName:e.callbackName,scope:e.scope,sourceWidgetType:e.sourceWidgetType,hostWidgetType:t.hostWidgetType,completionMode:e.completionMode,transport:t.transport};ve(t.observer,{type:"callback.received",...i});const s=t.callbacks[e.callbackName];if(!s){if(ve(t.observer,{type:"callback.handler_missing",...i}),"ignore"===e.missingHandler)return;return Promise.reject(new Error("Host callback is not registered"))}let r;ve(t.observer,{type:"callback.handler_started",...i});try{r=s(t.payload)}catch(n){if(ve(t.observer,{type:"callback.handler_rejected",...i,error:n}),"detached"===e.completionMode)return;return Promise.reject(new Error("Host callback failed"))}if("detached"!==e.completionMode)return Promise.resolve(r).then(s=>(ve(t.observer,{type:"callback.handler_resolved",...i}),"result"===e.completionMode?s:void 0),e=>{throw ve(t.observer,{type:"callback.handler_rejected",...i,error:e}),new Error("Host callback failed")});r&&"function"==typeof r.then?Promise.resolve(r).then(()=>ve(t.observer,{type:"callback.handler_resolved",...i}),e=>ve(t.observer,{type:"callback.handler_rejected",...i,error:e})):ve(t.observer,{type:"callback.handler_resolved",...i})}function ke(t,e,i){var s;if(e.accessToken)try{null==(s=i.contentWindow)||s.postMessage({type:"RETURNINGAI_WIDGET_TOKEN",value:{widgetId:t.widgetId,token:e.accessToken,...void 0!==t.customData&&{customData:t.customData}}},t.widgetDomain)}catch{}}function _e(t,e,i,s,r,n,a,o,h){const l=function(t,e){let i=null;return{call(s){i&&clearTimeout(i),i=setTimeout(()=>{t(s),i=null},e)},cancel(){i&&(clearTimeout(i),i=null)}}}(t=>{s.style.height=`${t}px`,null==o||o("rai-height-change",{height:t})},t.heightDebounce??100),c=async i=>{var c;if(i.origin!==t.widgetDomain)return;if(!i.data||"string"!=typeof i.data.type)return;const{type:p,containerId:d,widgetId:f,payload:u}=i.data;switch(p){case"RETURNINGAI_WIDGET_REQUEST_TOKEN":try{const i=await async function(t,e,i){if(e.accessToken&&!Wt(e.accessTokenExpiry))return e.accessToken;if(t.authUrl){if(await qt(t,e,i)&&e.accessToken)return e.accessToken;throw new Error("Unable to obtain valid token")}if(await Ht(t,e,i)&&e.accessToken)return e.accessToken;if(await Bt(t,e,i)&&e.accessToken)return e.accessToken;throw new Error("Unable to obtain valid token")}(t,e,r);null==(c=s.contentWindow)||c.postMessage({type:"RETURNINGAI_WIDGET_TOKEN",value:{token:i,widgetId:t.widgetId,...void 0!==t.customData&&{customData:t.customData}}},t.widgetDomain)}catch{}break;case"WIDGET_HEIGHT_UPDATE":{const t=Number(null==u?void 0:u.height);Number.isFinite(t)&&t>0&&l.call(t);break}case"WIDGET_READY":if(void 0!==f&&f!==t.widgetId)break;if(void 0!==d&&d!==t.container)break;s.classList.add("loaded"),a&&a(),null==o||o("rai-ready");break;case"WIDGET_ERROR":a&&a();break;case"WIDGET_LOGOUT":n&&await n();break;case"RETURNINGAI_WIDGET_ACTION":{if(i.source!==s.contentWindow)break;const e=i.data;if(void 0!==e.widgetId&&e.widgetId!==t.widgetId)break;if(void 0!==e.containerId&&e.containerId!==t.container)break;const r=ge(e.payload,ue(t)),n=be(e.callbackName,r);if(!n)break;if(!function(t,e,i,s){return("widget:host-callback"===e||t.legacyActions.includes(e))&&i===t.sourceWidgetType&&t.allowedHostWidgetTypes.includes(s)}(n,e.action,e.widgetType,t.widgetType))break;const a=e=>{var i;null==(i=s.contentWindow)||i.postMessage(e,t.widgetDomain)},o=we({callbacks:(null==h?void 0:h())??{},callbackName:e.callbackName,payload:r,hostWidgetType:t.widgetType,invocationId:e.requestId,transport:"iframe"});if(!o)break;try{const t=await o;a({type:"RETURNINGAI_WIDGET_ACTION_RESULT",requestId:e.requestId,action:"widget:host-callback"===e.action?"widget:host-callback":"store:host-callback",ok:!0,status:"success",..."result"===n.completionMode&&void 0!==t?{value:t}:{}})}catch(m){a({type:"RETURNINGAI_WIDGET_ACTION_RESULT",requestId:e.requestId,action:"widget:host-callback"===e.action?"widget:host-callback":"store:host-callback",ok:!1,status:"failed",error:{message:m instanceof Error&&"Host callback is not registered"===m.message?m.message:"Host callback failed"}})}break}}};return window.addEventListener("message",c),()=>{window.removeEventListener("message",c),l.cancel()}}const Te=new Set(["community-id","channel-id","widget-id","widget-type","theme","container","width","height","api-url","widget-url","auto-refresh","debug","storage-prefix","max-retries","retry-delay","height-debounce","locale","custom-data","retry-label","auth-url","bundle-url","embed-token","v2-api-url","domain-key","loading-text","bg","text","accent","font"]);const xe={store:"RaiStoreWidget",channel:"RaiChannelWidget",social:"RaiSocialWidget",milestone:"RaiMilestoneWidget","currency-view":"RaiCurrencyWidget","referral-conditions":"RaiReferralWidget",custom:"RaiCustomWidget"},Ae={"RAI-STORE-WIDGET":"store","RAI-CHANNEL-WIDGET":"channel","RAI-MILESTONE-WIDGET":"milestone","RAI-SOCIAL-WIDGET":"social","RAI-CURRENCY-WIDGET":"currency-view","RAI-REFERRAL-WIDGET":"referral-conditions","RAI-CUSTOM-WIDGET":"custom","RAI-WIDGET":"store"},Se={SGTR:"https://sgtr-eks-widgets.genesiv.org",STG:"https://staging-widgets.genesiv.org",PROD:"https://prod-widgets.returning.ai",GEN:"https://prod-widgets.returning.ai",LOCAL:"http://localhost:1333"},Ee={SGTR:"https://api-v2.genesiv.org",STG:"https://staging-api-v2.genesiv.org",PROD:"https://api-v2.returning.ai",GEN:"https://api-v2.returning.ai",LOCAL:"http://localhost:1335"};function Ce(t){if(t)try{const e=new URL(t).hostname.toLowerCase();if("localhost"===e||"127.0.0.1"===e)return"LOCAL";if(e.includes("sgtr"))return"SGTR";if(e.includes("staging"))return"STG";if("genesiv.org"===e||e.endsWith(".genesiv.org"))return"SGTR";if(e.includes("returning.ai")||e.includes("returningai.com")||e.includes("genesiv.com"))return"PROD"}catch{return}}function Pe(t){return Se[t]||Se.PROD}const De=new Set,Ie=new Set(["aeonik","courier","courier new","monaco","monospace","sans-serif","serif","system-ui"]),Me=new Set(["lora","playfair display","prata"]);function Le(t){return"Noto"===t.trim()?"Noto Sans":t.trim()}function Fe(t){const e=Le(t),i=e.toLowerCase();switch(i){case"monospace":return"monospace";case"courier":case"courier new":return'"Courier New", Courier, monospace';case"monaco":return"Monaco, Menlo, Consolas, monospace";case"system-ui":return"system-ui, -apple-system, sans-serif";case"sans-serif":case"serif":return i;default:return`'${e.replace(/[\\']/g,"\\\\$&")}', ${Me.has(i)?"Georgia, 'Times New Roman', serif":"system-ui, -apple-system, sans-serif"}`}}function Re(t){const e=Le(t),i=e.toLowerCase();if(!e||Ie.has(i))return;if(De.has(i))return;!function(){if(!document.getElementById("rai-fonts-preconnect")){const t=document.createElement("link");t.id="rai-fonts-preconnect",t.rel="preconnect",t.href="https://fonts.googleapis.com",document.head.appendChild(t)}if(!document.getElementById("rai-fonts-static-preconnect")){const t=document.createElement("link");t.id="rai-fonts-static-preconnect",t.rel="preconnect",t.href="https://fonts.gstatic.com",t.crossOrigin="anonymous",document.head.appendChild(t)}}();const s=`rai-font-${e.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`,r=`https://fonts.googleapis.com/css2?family=${encodeURIComponent(e)}:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,700&display=swap`;let n=document.getElementById(s);n&&n.href!==r&&(n.remove(),n=null),n||(n=document.createElement("link"),n.id=s,n.rel="stylesheet",n.href=r,document.head.appendChild(n)),De.add(i),n.onerror=()=>{De.delete(i),null==n||n.remove()}}const Ne=["script","iframe","object","embed"],Oe=["src","href","xlink:href"];function ze(t,e){const i=e=>t.getAttribute(e)??t.getAttribute(`data-${e}`)??"",s=(t,e)=>{const s=parseInt(i(t),10);return Number.isFinite(s)&&s>=0?s:e},r=!!i("community-id"),n=i("community-id")||i("widget-id")||e||"";if(n&&!/^[a-zA-Z0-9_\-=]{8,}$/.test(n))throw new Error(`[rai-widget] Invalid community-id: "${n}"`);const a=i("channel-id")||void 0;if(a&&!/^[a-zA-Z0-9_\-=]{8,}$/.test(a))throw new Error(`[rai-widget] Invalid channel-id: "${a}"`);const o=i("widget-type")||Ae[t.tagName]||"store";let h;h=r?"store"===o?n:"channel"===o?a?btoa(a):n:n?btoa(n):n:n;let l,c=i("widget-url")||"https://widget.returningai.com";c.endsWith("store-widget")&&(c=`${c}/${n}/open-widget`);try{l=new URL(c).origin}catch{l=c}if(c.includes("store-widget")){const t=new URL(c);t.searchParams.set("color",i("theme")||"light"),c=t.toString()}const p=i("api-url")||void 0,d=i("v2-api-url")||void 0,f=function(t){const e=null==t?void 0:t.trim().toUpperCase();if(e)return"GEN"===e||"PRODUCTION"===e?"PROD":"PRE-STAGING"===e||"PRESTAGING"===e?"SGTR":"STAGING"===e?"STG":"LOCALHOST"===e?"LOCAL":e in Se?e:void 0}(i("domain-key"))||Ce(p)||Ce(d)||"PROD",u=i("container")||i("data-container")||`returning-ai-widget-${h}`,m={};Array.from(t.attributes).forEach(t=>{const e=t.name.toLowerCase();if(!e.startsWith("data-"))return;const i=e.slice(5);Te.has(i)||(m[e]=t.value)});const g=(()=>{const t=i("custom-data");if(t)try{return JSON.parse(t)}catch{return}})();return{communityId:n,channelId:a,widgetId:h,widgetType:o,theme:i("theme")||"light",themeExplicit:!!i("theme"),container:u,width:i("width")||"100%",height:i("height")||"600px",apiUrl:p||Pe(f),widgetUrl:c,widgetDomain:l,autoRefresh:"false"!==i("auto-refresh"),debug:"true"===i("debug"),storagePrefix:i("storage-prefix")||"returning-ai-widget",userIdentifiers:m,maxRetries:s("max-retries",3),retryDelay:s("retry-delay",500),heightDebounce:s("height-debounce",100),locale:i("locale")||void 0,customData:g,authUrl:i("auth-url")||void 0,bundleUrl:i("bundle-url")||void 0,embedToken:i("embed-token")||void 0,v2ApiUrl:d,domainKey:f,loadingText:i("loading-text")||"Loading ...",firstPaintColors:(()=>{const t=i("bg")||void 0,e=i("text")||void 0,s=i("accent")||void 0;return t||e||s?{bg:t,text:e,accent:s}:void 0})(),firstPaintFont:i("font")||void 0}}function Ue(t){const e=Object.keys(t.userIdentifiers||{}).sort().map(e=>[e,t.userIdentifiers[e]]);return JSON.stringify({embedToken:t.embedToken||"",userIdentifiers:e})}class We extends HTMLElement{constructor(){super(),i(this,"shadow"),i(this,"config"),i(this,"state",{accessToken:null,refreshToken:null,tokenFamily:null,accessTokenExpiry:null,refreshTokenExpiry:null,refreshTimer:null,syncTimer:null,iframe:null,isAuthenticated:!1,isRefreshing:!1,refreshPromise:null,errorSettings:null,loadingAnimation:null,loadingSettings:null,themePalette:null,font:null,defaultColorSchema:null,lastAuthError:null,widgetData:null}),i(this,"loaderEl",null),i(this,"errorEl",null),i(this,"msgEl",null),i(this,"cleanupListener"),i(this,"intersectionObserver"),i(this,"themeObserver"),i(this,"identityAttributeObserver"),i(this,"identitySignature",""),i(this,"hasAttemptedInit",!1),i(this,"initGeneration",0),i(this,"lottieInstances",[]),i(this,"renderedLoaderAnimationKey",null),i(this,"callbackRegistry",new re),i(this,"bannerNode",null),i(this,"releaseAutoThemeDisableLease"),this.shadow=this.attachShadow({mode:"closed"})}static get observedAttributes(){return["embed-token","data-embed-token"]}registerCallback(t,e){this.callbackRegistry.registerCallback(t,e)}lockCallbacks(){this.callbackRegistry.lock()}connectedCallback(){this.config=ze(this,void 0),this.identitySignature=Ue(this.config),this.setupIdentityAttributeObserver();const t=document.createElement("style");t.textContent=':host{display:block;position:relative;width:100%;height:100%}.rai-loader{position:absolute;top:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;width:100%;height:100%;background:var(--rai-loading-background, var(--background-5, var(--rai-loader-bg, #ffffff)));border-radius:8px;z-index:10;transition:opacity .3s ease-out;font-family:var(--rai-loader-font, "Roboto", system-ui, -apple-system, sans-serif)}.rai-loader.fade-out{opacity:0;pointer-events:none}.rai-loader-pending-settings{visibility:hidden}.rai-loader-text{margin:.5rem 0 0;font-family:var(--rai-loading-text-font, var(--rai-loader-font, "Roboto", system-ui, -apple-system, sans-serif));font-size:var(--rai-loading-text-size, 1.125rem);line-height:1.75rem;font-weight:var(--rai-loading-text-weight, 400);font-style:var(--rai-loading-text-style, normal);text-decoration:var(--rai-loading-text-decoration, none);letter-spacing:normal;color:var(--rai-loading-text-color, var(--accent-1, var(--rai-accent, #000000)));text-align:center}@media (min-width: 768px){.rai-loader-text{font-size:var(--rai-loading-text-size, 1.5rem);line-height:2rem}}.rai-error{display:none;position:absolute;top:0;left:0;width:100%;height:100%;align-items:center;justify-content:center;flex-direction:column;gap:12px;background:var(--rai-error-bg, #1a1a1a);border-radius:8px;padding:24px;box-sizing:border-box;text-align:center;color:var(--rai-error-text, #9ca3af);font-family:system-ui,-apple-system,sans-serif;z-index:10}.rai-error.visible{display:flex}iframe{display:block;border:none;opacity:0;transition:opacity .3s ease-in}iframe.loaded{opacity:1}.rai-lottie-loader{width:100px;height:100px}.rai-lottie-loader svg{width:100%!important;height:100%!important}.rai-lottie-spinner{width:32px;height:32px;margin:34px auto;border:3px solid var(--rai-text4, #6b7280);border-top-color:var(--rai-accent, #000000);border-radius:50%;animation:rai-spin .7s linear infinite}@keyframes rai-spin{to{transform:rotate(360deg)}}.rai-sdk-loader{position:relative;width:75px;height:100px}.rai-sdk-loader__bar{position:absolute;bottom:0;width:10px;height:50%;background:var(--rai-accent, #000000);transform-origin:center bottom;box-shadow:1px 1px #0003}.rai-sdk-loader__bar:nth-child(1){left:0;transform:scaleY(.2);animation:rai-sdk-barUp1 4s infinite}.rai-sdk-loader__bar:nth-child(2){left:15px;transform:scaleY(.4);animation:rai-sdk-barUp2 4s infinite}.rai-sdk-loader__bar:nth-child(3){left:30px;transform:scaleY(.6);animation:rai-sdk-barUp3 4s infinite}.rai-sdk-loader__bar:nth-child(4){left:45px;transform:scaleY(.8);animation:rai-sdk-barUp4 4s infinite}.rai-sdk-loader__bar:nth-child(5){left:60px;transform:scale(1);animation:rai-sdk-barUp5 4s infinite}.rai-sdk-loader__ball{position:absolute;bottom:10px;left:0;width:10px;height:10px;background:var(--rai-accent, #000000);border-radius:50%;animation:rai-sdk-ball 4s infinite}@keyframes rai-sdk-ball{0%{transform:translate(0)}5%{transform:translate(8px,-14px)}10%{transform:translate(15px,-10px)}17%{transform:translate(23px,-24px)}20%{transform:translate(30px,-20px)}27%{transform:translate(38px,-34px)}30%{transform:translate(45px,-30px)}37%{transform:translate(53px,-44px)}40%{transform:translate(60px,-40px)}50%{transform:translate(60px)}57%{transform:translate(53px,-14px)}60%{transform:translate(45px,-10px)}67%{transform:translate(37px,-24px)}70%{transform:translate(30px,-20px)}77%{transform:translate(22px,-34px)}80%{transform:translate(15px,-30px)}87%{transform:translate(7px,-44px)}90%{transform:translateY(-40px)}to{transform:translate(0)}}@keyframes rai-sdk-barUp1{0%{transform:scaleY(.2)}40%{transform:scaleY(.2)}50%{transform:scale(1)}90%{transform:scale(1)}to{transform:scaleY(.2)}}@keyframes rai-sdk-barUp2{0%{transform:scaleY(.4)}40%{transform:scaleY(.4)}50%{transform:scaleY(.8)}90%{transform:scaleY(.8)}to{transform:scaleY(.4)}}@keyframes rai-sdk-barUp3{0%{transform:scaleY(.6)}to{transform:scaleY(.6)}}@keyframes rai-sdk-barUp4{0%{transform:scaleY(.8)}40%{transform:scaleY(.8)}50%{transform:scaleY(.4)}90%{transform:scaleY(.4)}to{transform:scaleY(.8)}}@keyframes rai-sdk-barUp5{0%{transform:scale(1)}40%{transform:scale(1)}50%{transform:scaleY(.2)}90%{transform:scaleY(.2)}to{transform:scale(1)}}#loading-square{width:75px;aspect-ratio:1;display:flex;color:var(--rai-accent, #000000);background:linear-gradient(currentColor 0 0) right / 51% 100%,linear-gradient(currentColor 0 0) bottom / 100% 51%;background-repeat:no-repeat;animation:l16-0 2s infinite linear .25s}#loading-square>div{width:50%;height:50%;background:currentColor;animation:l16-1 .5s infinite linear}@keyframes l16-0{0%,12.49%{transform:rotate(0)}12.5%,37.49%{transform:rotate(90deg)}37.5%,62.49%{transform:rotate(180deg)}62.5%,87.49%{transform:rotate(270deg)}87.5%,to{transform:rotate(360deg)}}@keyframes l16-1{0%{transform:perspective(80px) rotate3d(-1,-1,0,0)}80%,to{transform:perspective(80px) rotate3d(-1,-1,0,-180deg)}}#loading-circle{width:75px;aspect-ratio:1;display:grid;grid:50%/50%;color:var(--rai-accent, #000000);border-radius:50%;--_g: no-repeat linear-gradient(currentColor 0 0);background:var(--_g),var(--_g),var(--_g);background-size:50.1% 50.1%;animation:l9-0 1.5s infinite steps(1) alternate,l9-0-0 3s infinite steps(1) alternate}#loading-circle>div{background:var(--rai-text4, #6b7280);border-top-left-radius:100px;transform:perspective(150px) rotateY(0) rotateX(0);transform-origin:bottom right;animation:l9-1 1.5s infinite linear alternate}@keyframes l9-0{0%{background-position:0 100%,100% 100%,100% 0}33%{background-position:100% 100%,100% 100%,100% 0}66%{background-position:100% 0,100% 0,100% 0}}@keyframes l9-0-0{0%{transform:scaleX(1) rotate(0)}50%{transform:scaleX(-1) rotate(-90deg)}}@keyframes l9-1{16.5%{transform:perspective(150px) rotateX(-90deg) rotateY(0) rotateX(0);filter:grayscale(.8)}33%{transform:perspective(150px) rotateX(-180deg) rotateY(0) rotateX(0)}66%{transform:perspective(150px) rotateX(-180deg) rotateY(-180deg) rotateX(0)}to{transform:perspective(150px) rotateX(-180deg) rotateY(-180deg) rotateX(-180deg);filter:grayscale(.8)}}.rai-custom-error{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10}.tiptap strong.tw-font-bold,.tiptap b.tw-font-bold{font-weight:700}.tiptap em.tw-font-italic,.tiptap i.tw-font-italic{font-style:italic}.tiptap a.tiptap-rich-text-link{color:#3b82f6;text-decoration:underline;position:relative;display:inline-block;width:fit-content}.tiptap a.tiptap-rich-text-link:hover{color:#3b82f6cc;text-decoration:none}.tiptap a.tiptap-rich-text-link:not([title=""]):before{content:attr(title);position:absolute;top:-2rem;left:50%;transform:translate(-50%);white-space:nowrap;border-radius:.25rem;background-color:#000;padding:.25rem .5rem;color:#fff;opacity:0;transition:opacity .2s;pointer-events:none}.tiptap a.tiptap-rich-text-link:not([title=""]):hover:before{opacity:1}.tiptap p[style*="text-align: left"]{text-align:left}.tiptap p[style*="text-align: center"]{text-align:center}.tiptap p[style*="text-align: right"]{text-align:right}.tiptap p[style*="text-align: justify"]{text-align:justify}.tiptap u{text-decoration:underline}.tiptap.ProseMirror{background-color:transparent;height:fit-content!important;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;-webkit-font-variant-ligatures:none;font-variant-ligatures:none;font-feature-settings:"liga" 0;padding:0;width:100%;overflow-y:auto}.tiptap{line-height:1.6;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif}.tiptap p{margin:.5em 0}.tiptap p:first-child{margin-top:0}.tiptap p:last-child{margin-bottom:0}.tiptap img{max-width:100%;height:auto;display:block}.tiptap p[style*="text-align: left"] img{margin-left:0;margin-right:auto}.tiptap p[style*="text-align: center"] img{margin-left:auto;margin-right:auto}.tiptap p[style*="text-align: right"] img{margin-left:auto;margin-right:0}.rai-retry-btn{padding:8px 20px;border:none;border-radius:6px;background:var(--rai-accent, #000000);color:var(--rai-error-bg, #ffffff);font-size:14px;font-family:system-ui,-apple-system,sans-serif;cursor:pointer}.rai-retry-btn:hover{opacity:.85}',this.shadow.appendChild(t);const e=this.config.theme,i="dark"===e?"#ffffff":"#000000",s="dark"===e?"#9ca3af":"#6b7280",r="dark"===e?"#1a1a1a":"#ffffff";this.style.width=this.config.width,this.style.height=this.config.height,this.style.setProperty("--rai-accent",i),this.style.setProperty("--rai-text4",s),this.style.setProperty("--rai-loader-bg",r),this.style.setProperty("--rai-error-bg",r),this.applyFirstPaintColors(),this.renderShell(),this.hasAttribute("eager")?this.init():(this.intersectionObserver=new IntersectionObserver(t=>{t[0].isIntersecting&&(this.intersectionObserver.disconnect(),this.intersectionObserver=void 0,this.init())}),this.intersectionObserver.observe(this))}disconnectedCallback(){var t,e,i;null==(t=this.intersectionObserver)||t.disconnect(),null==(e=this.themeObserver)||e.disconnect(),null==(i=this.identityAttributeObserver)||i.disconnect(),this.teardownMountedWidget(),this.clearLottieInstances(),this.removeBanner(),Xt(this.state)}attributeChangedCallback(t,e,i){e!==i&&("embed-token"!==t&&"data-embed-token"!==t||this.handleIdentityConfigChange())}setupIdentityAttributeObserver(){var t;null==(t=this.identityAttributeObserver)||t.disconnect(),this.identityAttributeObserver=new MutationObserver(t=>{t.some(t=>"attributes"===t.type&&!!t.attributeName&&function(t){const e=t.toLowerCase();return!!e.startsWith("data-")&&!Te.has(e.slice(5))}(t.attributeName))&&this.handleIdentityConfigChange()}),this.identityAttributeObserver.observe(this,{attributes:!0})}handleIdentityConfigChange(){if(!this.isConnected||!this.config)return;const t=ze(this,this.config.communityId),e=Ue(t);if(e===this.identitySignature)return void(this.config=t);const i=this.config;this.config=t,this.identitySignature=e,zt(i),zt(this.config),this.hasAttemptedInit&&this.reload()}emit(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e??{}}))}readRuntimeCallbacks(){return this.callbackRegistry.read()}applyFirstPaintColors(){var t;const e=Ut(this.config);if(e&&Gt(this.state,e),!this.config.themeExplicit){const t=null==e?void 0:e.defaultColorSchema;"light"!==t&&"dark"!==t||(this.config.theme=t)}const i="dark"===this.config.theme?"dark":"light",s=null==(t=null==e?void 0:e.themePalette)?void 0:t[i];s&&this.applyPalette(s);const r=("string"==typeof(null==e?void 0:e.font)?e.font:void 0)||this.config.firstPaintFont;if(r&&this.applyFont(r),this.applyLoadingSettings(),s)return;const n=this.config.firstPaintColors;(null==n?void 0:n.bg)&&this.style.setProperty("--background-5",n.bg),(null==n?void 0:n.text)&&this.style.setProperty("--text-1",n.text),(null==n?void 0:n.accent)&&this.style.setProperty("--accent-1",n.accent)}applyFont(t){const e=Le(t);this.style.setProperty("--rai-loader-font",Fe(e)),this.style.setProperty("--font-family",e),Re(e)}applyPalette(t){Object.entries(t).forEach(([t,e])=>{t.startsWith("--")&&e&&this.style.setProperty(t,e)})}applyLoadingSettings(t=this.state.loadingSettings){var e,i;const s=null==t?void 0:t.loadingText,r="dark"===this.config.theme?"dark":"light",n=(null==(e=null==t?void 0:t.backgroundColors)?void 0:e[r])??(null==t?void 0:t.backgroundColor);n&&"var(--background-5)"!==n?this.style.setProperty("--rai-loading-background",n):this.style.removeProperty("--rai-loading-background");const a=null==(i=this.loaderEl)?void 0:i.querySelector(".rai-loader-text");if(!s)return this.style.removeProperty("--rai-loading-text-color"),this.style.removeProperty("--rai-loading-text-font"),this.style.removeProperty("--rai-loading-text-size"),this.style.removeProperty("--rai-loading-text-weight"),this.style.removeProperty("--rai-loading-text-style"),this.style.removeProperty("--rai-loading-text-decoration"),void(a&&(a.textContent=this.config.loadingText,a.hidden=!1));s.color&&this.style.setProperty("--rai-loading-text-color",s.color),s.fontFamily&&(this.style.setProperty("--rai-loading-text-font",Fe(s.fontFamily)),Re(s.fontFamily)),Number.isFinite(s.fontSizePx)&&s.fontSizePx>0&&this.style.setProperty("--rai-loading-text-size",`${s.fontSizePx}px`),this.style.setProperty("--rai-loading-text-weight",s.bold?"700":"400"),this.style.setProperty("--rai-loading-text-style",s.italic?"italic":"normal"),this.style.setProperty("--rai-loading-text-decoration",s.underline?"underline":"none"),a&&(a.textContent=s.text,a.hidden=!s.enabled)}getLoadingAnimationRenderKey(){var t,e,i;const s=this.state.loadingAnimation,r="dark"===this.config.theme?"dark":"light",n="custom"===(null==s?void 0:s.type)?(null==(t=s.custom)?void 0:t[r])||(null==(e=s.custom)?void 0:e.light)||(null==(i=s.custom)?void 0:i.dark):void 0;return JSON.stringify({theme:r,type:(null==s?void 0:s.type)??null,preset:(null==s?void 0:s.preset)??null,custom:n?{type:n.type??null,html:n.html??null,lottie:n.lottie??null}:null})}renderShell(){this.loaderEl=document.createElement("div"),this.loaderEl.className="rai-loader","custom"!==this.config.widgetType||Ut(this.config)||this.loaderEl.classList.add("rai-loader-pending-settings");const t=document.createElement("h1");t.className="rai-loader-text",t.textContent=this.config.loadingText,this.loaderEl.appendChild(t),this.shadow.appendChild(this.loaderEl),this.applyLoadingSettings(),this.fetchAndRenderLoader(),this.errorEl=document.createElement("div"),this.errorEl.className="rai-error",this.msgEl=document.createElement("span"),this.msgEl.className="rai-error-msg",this.msgEl.textContent="Authentication failed. Please try again later.",this.errorEl.appendChild(this.msgEl);const e=this.getAttribute("retry-label")||this.getAttribute("data-retry-label")||"Retry",i=document.createElement("button");i.className="rai-retry-btn",i.textContent=e,i.addEventListener("click",()=>this.reload()),this.errorEl.appendChild(i),this.shadow.appendChild(this.errorEl)}async fetchAndRenderLoader(){var t;const e=Ut(this.config);if(e)return Gt(this.state,e),this.applyLoadingSettings(),this.renderLoaderAnimation(),void Yt(this.config,this.state,{skipCache:!0}).then(()=>{var t;if(!this.loaderEl)return;const e="dark"===this.config.theme?"dark":"light",i=null==(t=this.state.themePalette)?void 0:t[e];i&&this.applyPalette(i),this.state.font&&this.applyFont(this.state.font),this.applyLoadingSettings(),this.renderedLoaderAnimationKey!==this.getLoadingAnimationRenderKey()&&this.renderLoaderAnimation()}).catch(()=>{});try{await Yt(this.config,this.state)}catch{}if(!this.loaderEl)return;this.config.themeExplicit||"light"!==this.state.defaultColorSchema&&"dark"!==this.state.defaultColorSchema||this.state.defaultColorSchema===this.config.theme||(this.config.theme=this.state.defaultColorSchema);const i="dark"===this.config.theme?"dark":"light",s=null==(t=this.state.themePalette)?void 0:t[i];s&&this.applyPalette(s),this.state.font&&this.applyFont(this.state.font),this.applyLoadingSettings(),this.renderLoaderAnimation(),this.loaderEl.classList.remove("rai-loader-pending-settings")}renderLoaderAnimation(){if(!this.loaderEl)return;this.renderedLoaderAnimationKey=this.getLoadingAnimationRenderKey(),this.clearLottieInstances();const t=this.loaderEl.querySelector(".rai-loader-anim");t&&t.remove();const e=document.createElement("div");e.className="rai-loader-anim";const i=this.state.loadingAnimation,s="dark"===this.config.theme?"dark":"light";if("custom"===(null==i?void 0:i.type)&&i.custom){const t=i.custom[s]||i.custom.light||i.custom.dark;if(t){if("lottie"===t.type&&t.lottieData)return this.renderLottieInto(e,t.lottieData),void this.loaderEl.insertBefore(e,this.loaderEl.firstChild);if("html"===t.type&&t.html)return e.innerHTML=function(t){const e=document.createElement("template");e.innerHTML=t,e.content.querySelectorAll(Ne.join(",")).forEach(t=>t.remove()),e.content.querySelectorAll("*").forEach(t=>{Array.from(t.attributes).forEach(e=>{const i=e.name.toLowerCase();(i.startsWith("on")||Oe.includes(i)&&e.value.trim().toLowerCase().startsWith("javascript:"))&&t.removeAttribute(e.name)})});const i=document.createElement("div");return i.appendChild(e.content.cloneNode(!0)),i.innerHTML}(t.html),void this.loaderEl.insertBefore(e,this.loaderEl.firstChild)}}if("preset"===(null==i?void 0:i.type)&&i.preset)return e.appendChild(this.createPresetLoader(i.preset)),void this.loaderEl.insertBefore(e,this.loaderEl.firstChild);e.appendChild(this.createDefaultLoader()),this.loaderEl.insertBefore(e,this.loaderEl.firstChild)}renderLottieInto(t,e){const i=document.createElement("div");i.className="rai-lottie-loader",t.appendChild(i);const s=o.loadAnimation({container:i,renderer:"svg",loop:!0,autoplay:!0,animationData:e});this.lottieInstances.push(s)}clearLottieInstances(){this.lottieInstances.forEach(t=>t.destroy()),this.lottieInstances=[]}createDefaultLoader(){const t=document.createElement("div");t.className="rai-sdk-loader";for(let i=0;i<5;i++){const e=document.createElement("div");e.className="rai-sdk-loader__bar",t.appendChild(e)}const e=document.createElement("div");return e.className="rai-sdk-loader__ball",t.appendChild(e),t}createPresetLoader(t){if("square"===t){const t=document.createElement("div");t.id="loading-square";const e=document.createElement("div");return t.appendChild(e),t}if("circle"===t){const t=document.createElement("div");t.id="loading-circle";const e=document.createElement("div");return t.appendChild(e),t}return this.createDefaultLoader()}hideLoader(){if(!this.loaderEl)return;const t=this.loaderEl,e=this.lottieInstances;this.lottieInstances=[],t.classList.add("fade-out"),setTimeout(()=>{t.remove(),e.forEach(t=>t.destroy())},300),this.loaderEl=null}waitForFirstBundlePaint(t){return new Promise(e=>{let i,s=!1;const r=new MutationObserver(()=>{t.children.length>0&&n()}),n=()=>{s||(s=!0,r.disconnect(),clearTimeout(i),requestAnimationFrame(()=>e()))};r.observe(t,{childList:!0}),i=setTimeout(n,2e3),t.children.length>0&&n()})}showError(){this.hideLoader();const t=this.state.errorSettings,e=this.state.lastAuthError,i="User not found"===(null==e?void 0:e.error)||"Missing required user identifier fields"===(null==e?void 0:e.error)||"Missing user identifier fields"===(null==e?void 0:e.error),s=!!(null==t?void 0:t.errorMessage)&&(i||!e);s?this.renderCustomError(t):this.errorEl&&((null==e?void 0:e.error)&&this.msgEl&&(this.msgEl.textContent=e.hint?`${e.error}: ${e.hint}`:e.error),this.errorEl.classList.add("visible"));const r=s?t.errorMessage:(null==e?void 0:e.error)||"Authentication failed";this.emit("rai-error",{message:r,hint:null==e?void 0:e.hint,status:null==e?void 0:e.status})}renderCustomError(t){var e,i;null==(e=this.errorEl)||e.remove(),this.errorEl=null;const s=(null==(i=t.backgroundImage)?void 0:i.trim())?`background-image: url('${t.backgroundImage}'); background-size: cover; background-position: center; background-repeat: no-repeat;`:"",r=document.createElement("div");r.className="rai-custom-error",r.style.cssText=`\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: auto;\n width: 100%;\n height: 100%;\n ${s}\n `;const n=document.createElement("div");n.className="rai-rich-text",n.style.cssText=`\n min-width: 50%;\n min-height: 50%;\n margin: 0 auto;\n padding: 20px;\n width: auto;\n height: auto;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 6px;\n background-color: ${t.modalColor||"transparent"};\n `;const a=document.createElement("div");a.className="tiptap ProseMirror",a.innerHTML=t.errorMessage||"",n.appendChild(a),r.appendChild(n),this.shadow.appendChild(r)}resolveBannerApiUrl(){if(this.config.v2ApiUrl)return this.config.v2ApiUrl.replace(/\/+$/,"");switch(this.config.domainKey){case"SGTR":return"https://api-v2.genesiv.org";case"STG":return"https://staging-api-v2.genesiv.org";case"LOCAL":return"http://localhost:1335";default:return"https://api-v2.returning.ai"}}removeBanner(){var t;(null==(t=this.bannerNode)?void 0:t.parentNode)&&this.bannerNode.parentNode.removeChild(this.bannerNode),this.bannerNode=null}async mountBannerForWidget(){var t,e;try{if(this.bannerNode)return;if("off"===this.getAttribute("banner")||this.hasAttribute("no-banner"))return;const i=this.resolveBannerApiUrl();let s,r;if("custom"===this.config.widgetType){const t=t=>/^[a-f0-9]{24}$/i.test(t);let e="";try{e=atob(this.config.communityId)}catch{e=""}if(t(e)?r=e:t(this.config.communityId)&&(r=this.config.communityId),!r)return}else s=this.config.communityId;const n=function(t,e){const i=`${e}-rai-banner-visitor-${t}`;try{let t=localStorage.getItem(i);return t||(t=Mt(),localStorage.setItem(i,t)),t}catch{return Mt()}}(this.config.communityId||r||"rai",this.config.storagePrefix),a=window.innerWidth,o=a<640?"mobile":a<1024?"tablet":"desktop",h=await async function(t,e){try{const i=await fetch(`${t}/v2/api/banner-sdk/eligible`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await i.json();return s&&s.meta&&"success"===s.meta.status?s.data||{banner:null}:{banner:null,reason:s&&s.detail||"request_failed"}}catch{return{banner:null,reason:"network_error"}}}(i,{communityId:s,surface:"sdk",widgetType:this.config.widgetType,widgetId:r,embedToken:this.config.embedToken,page:{url:window.location.href,hostname:window.location.hostname,path:window.location.pathname},viewport:{width:window.innerWidth,height:window.innerHeight,device:o},identifier:{type:"anonymous_session",value:n}});if(!this.isConnected)return;const l=h.banner;if(!l)return;if("hide"===(null==(t=l.placement)?void 0:t.mobileBehavior)&&"mobile"===o)return;const c=It(l,{onCtaClick:()=>{var t,e,i;Lt(null==(t=l.tracking)?void 0:t.clickUrl),this.emit("rai-banner-click",{bannerId:l.id});const s=null==(e=l.cta)?void 0:e.url;s&&((null==(i=l.cta)?void 0:i.openInNewTab)?window.open(s,"_blank","noopener,noreferrer"):window.location.href=s)},onDismiss:()=>{var t;Lt(null==(t=l.tracking)?void 0:t.dismissUrl),this.emit("rai-banner-dismiss",{bannerId:l.id}),this.removeBanner()}},this);this.bannerNode=c,document.body.appendChild(c),Lt(null==(e=l.tracking)?void 0:e.impressionUrl),this.emit("rai-banner-impression",{bannerId:l.id})}catch{}}async init(){const t=++this.initGeneration;if(this.hasAttemptedInit=!0,!this.config.communityId)return void this.showError();var e,i;this.config.bundleUrl&&(this.prepareBundleRuntimeEnvironment(),e=xe[this.config.widgetType],i=this.config.bundleUrl,se(e,i));const s=Yt(this.config,this.state),r=async t=>{const[e]=await Promise.all([t,s]);return e},n=()=>{var e;if(!this.isCurrentInit(t))return;null==(e=this.errorEl)||e.classList.remove("visible"),this.shadow.querySelectorAll(".rai-custom-error").forEach(t=>t.remove());let i=!1,s=0;const r=()=>{i||(i=!0,window.clearTimeout(s),this.removeEventListener("rai-mounted",r),this.removeEventListener("rai-ready",r),this.mountBannerForWidget())};this.addEventListener("rai-mounted",r),this.addEventListener("rai-ready",r),s=window.setTimeout(r,2500),this.config.bundleUrl?this.mountWidget(t):this.createIframe()};if(this.config.authUrl){const e=await r(qt(this.config,this.state,()=>this.scheduleRefresh()));if(!this.isCurrentInit(t))return;return void(e?(this.emit("rai-authenticated"),n()):this.showError())}if(this.config.embedToken){Xt(this.state),zt(this.config);const e=await r(Bt(this.config,this.state,()=>this.scheduleRefresh()));if(!this.isCurrentInit(t))return;return void(e?(this.emit("rai-authenticated"),n()):this.showError())}if(function(t,e){try{let i=localStorage.getItem(Ft(t));const s=!i;if(i||(i=localStorage.getItem(Rt(t))),!i)return!1;const r=JSON.parse(i);return r.refreshToken&&!Wt(r.refreshTokenExpiry)?(e.refreshToken=r.refreshToken,e.tokenFamily=r.tokenFamily,e.refreshTokenExpiry=r.refreshTokenExpiry,s&&(Ot(t,e),localStorage.removeItem(Rt(t))),!0):(zt(t),!1)}catch{return!1}}(this.config,this.state)){const e=await r(Ht(this.config,this.state,()=>this.scheduleRefresh()));if(!this.isCurrentInit(t))return;return e?(this.state.isAuthenticated=!0,this.emit("rai-authenticated"),void n()):void this.showError()}const a=await r(Bt(this.config,this.state,()=>this.scheduleRefresh()));this.isCurrentInit(t)&&(a?(this.emit("rai-authenticated"),n()):this.showError())}isCurrentInit(t){return this.isConnected&&t===this.initGeneration}teardownMountedWidget(){var t;null==(t=this.releaseAutoThemeDisableLease)||t.call(this),this.releaseAutoThemeDisableLease=void 0,this.cleanupListener&&(this.cleanupListener(),this.cleanupListener=void 0),this.state.syncTimer&&(clearInterval(this.state.syncTimer),this.state.syncTimer=null),this.state.iframe=null,this.shadow.querySelectorAll("iframe").forEach(t=>t.remove()),this.querySelectorAll('[data-rai-widget-root="true"]').forEach(t=>t.remove())}createIframe(){this.teardownMountedWidget();const t=document.createElement("iframe");t.src=this.buildWidgetUrl(this.config),t.allow="clipboard-write",t.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox"),t.frameBorder="0",t.scrolling="no",t.style.width=this.config.width,t.style.height=this.config.height,t.style.border="none",t.style.display="block",t.onload=()=>{ke(this.config,this.state,t),this.schedulePeriodicSync(t)},t.onerror=()=>{this.showError()},this.state.iframe=t,this.shadow.appendChild(t),this.cleanupListener=_e(this.config,this.state,this.shadow,t,()=>this.scheduleRefresh(),()=>this.logoutAndClear(),()=>this.hideLoader(),(t,e)=>this.emit(t,e),()=>this.readRuntimeCallbacks())}prepareBundleRuntimeEnvironment(){const t=this.config.v2ApiUrl||(e=this.config.domainKey,Ee[e]||Ee.PROD);var e;const i=window;i.DomainKey||(i.DomainKey=function(t){return"PROD"===t?"GEN":t}(this.config.domainKey)),i.api_url||(i.api_url=t),i.__IS_WIDGET__=!0;const s="dark"===this.config.theme?"dark":"light",r="dark"===s?"dark-knight":"white-smoke";return document.documentElement.setAttribute("data-theme",r),i.currentTheme=s,i.__FORCE_COLOR_MODE__=s,i.__WIDGET_STORAGE_KEY__=`color-schema-${this.config.widgetType}-${this.config.widgetId}`,{bundleApiUrl:t,colorMode:s}}async mountWidget(t){var e;let i=null;try{this.teardownMountedWidget();const e="auto"===this.config.height.trim().toLowerCase();"custom"===this.config.widgetType&&(this.releaseAutoThemeDisableLease=function(t=window){let e=t[Kt];e||(e={count:0,previousValue:t[Jt]},t[Kt]=e),e.count+=1,t[Jt]=!0;let i=!1;return()=>{i||(i=!0,e.count=Math.max(0,e.count-1),e.count>0||(void 0===e.previousValue?delete t[Jt]:t[Jt]=e.previousValue,delete t[Kt]))}}());const{bundleApiUrl:s,colorMode:r}=this.prepareBundleRuntimeEnvironment();window.guest_token=this.state.accessToken;const n=xe[this.config.widgetType],a=await function(t,e){return ie(t,e)}(n,this.config.bundleUrl);if(!this.isCurrentInit(t))return;i=document.createElement("div");const o="custom"===this.config.widgetType;if(i.className="rai-widget-root",i.setAttribute("data-rai-widget-root","true"),i.__raiWidgetRuntime={colorMode:r,loadingAnimation:this.state.loadingAnimation,loadingSettings:this.state.loadingSettings},i.style.cssText=["position: relative","width: 100%","height: "+(e?"auto":"100%"),"color: var(--text-1)","background: transparent","font-family: var(--rai-loader-font, 'Roboto', system-ui, -apple-system, sans-serif)","visibility: "+(o?"hidden":"visible")].join("; "),this.appendChild(i),!this.shadow.querySelector("slot")){const t=document.createElement("slot");this.shadow.appendChild(t)}const h=this.waitForFirstBundlePaint(i),l=a.mount(i,{widgetType:this.config.widgetType,communityId:this.config.communityId,channelId:this.config.channelId,widgetId:this.config.communityId,apiUrl:s,token:this.state.accessToken,basePath:"/",isPreview:!1,isOpenWidget:!this.state.accessToken,defaultColorSchema:"custom"!==this.config.widgetType||this.config.themeExplicit?r:null,colorMode:r,loadingAnimation:this.state.loadingAnimation,loadingSettings:this.state.loadingSettings,widgetData:"custom"===this.config.widgetType&&this.state.widgetData||void 0,autoHeight:e,requestHostCallback:(t,e)=>we({callbacks:this.readRuntimeCallbacks(),callbackName:t,payload:ge(e,ue(this.config)),hostWidgetType:this.config.widgetType,transport:"bundle"})});if(await te(l,h),!this.isCurrentInit(t)||!i.isConnected)return void i.remove();o&&(i.style.visibility="visible"),this.hideLoader(),this.emit("rai-mounted")}catch(s){if(!this.isCurrentInit(t))return void(null==i||i.remove());console.error("[rai-widget] Bundle mount failed:",s),null==(e=this.releaseAutoThemeDisableLease)||e.call(this),this.releaseAutoThemeDisableLease=void 0,this.showError()}}scheduleRefresh(){if(this.state.refreshTimer&&clearTimeout(this.state.refreshTimer),!this.state.accessTokenExpiry)return;const t=this.state.accessTokenExpiry-Date.now()-6e4,e=()=>{this.state.iframe&&ke(this.config,this.state,this.state.iframe),this.config.bundleUrl&&this.state.accessToken&&(window.guest_token=this.state.accessToken)},i=async()=>{if(this.config.authUrl){await qt(this.config,this.state,()=>this.scheduleRefresh())&&e()}else await Ht(this.config,this.state,()=>this.scheduleRefresh(),e)};t>0?this.state.refreshTimer=setTimeout(i,t):i()}schedulePeriodicSync(t){this.state.syncTimer&&clearInterval(this.state.syncTimer),this.state.syncTimer=setInterval(()=>{this.state.accessToken&&ke(this.config,this.state,t)},12e4)}async logoutAndClear(){await async function(t,e){if(e.accessToken)try{await fetch(`${t.apiUrl}/${t.widgetId}/auth/logout`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.accessToken}`},body:JSON.stringify({refreshToken:e.refreshToken})})}catch{}Xt(e),zt(t)}(this.config,this.state),this.teardownMountedWidget(),this.removeBanner(),this.emit("rai-logout")}async reload(){var t;const e=this.config;this.config=ze(this,null==(t=this.config)?void 0:t.communityId),this.identitySignature=Ue(this.config),this.style.width=this.config.width,this.style.height=this.config.height,zt(e),zt(this.config),this.teardownMountedWidget(),this.removeBanner(),Xt(this.state),await this.init()}async logoutPublic(){await this.logoutAndClear()}isAuthenticated(){return this.state.isAuthenticated&&null!==this.state.accessToken}getTokenInfo(){return{hasAccessToken:!!this.state.accessToken,hasRefreshToken:!!this.state.refreshToken,accessTokenExpiry:this.state.accessTokenExpiry?new Date(this.state.accessTokenExpiry):null,refreshTokenExpiry:this.state.refreshTokenExpiry?new Date(this.state.refreshTokenExpiry):null,isAccessTokenValid:!!this.state.accessToken&&!Wt(this.state.accessTokenExpiry),isRefreshTokenValid:!!this.state.refreshToken&&!Wt(this.state.refreshTokenExpiry)}}}class je extends We{buildWidgetUrl(t){const e=new URL(t.widgetUrl);return e.searchParams.set("color",t.theme),e.searchParams.set("containerId",t.container),e.searchParams.set("connectType","simple"),e.searchParams.set("mode","private"),t.locale&&e.searchParams.set("locale",t.locale),e.toString()}}class Ve extends We{buildWidgetUrl(t){const e=t.widgetUrl.endsWith("channel-widget")?`${t.widgetUrl}/${t.widgetId}`:t.widgetUrl;try{const i=new URL(e);return i.searchParams.set("color",t.theme),t.locale&&i.searchParams.set("locale",t.locale),i.toString()}catch{const i=[`color=${t.theme}`];return t.locale&&i.push(`locale=${encodeURIComponent(t.locale)}`),`${e}?${i.join("&")}`}}}class Be extends We{buildWidgetUrl(t){const e=t.widgetUrl.endsWith("milestone-widget")?`${t.widgetUrl}/${t.widgetId}`:t.widgetUrl;try{const i=new URL(e);return i.searchParams.set("color",t.theme),t.locale&&i.searchParams.set("locale",t.locale),i.toString()}catch{const i=[`color=${t.theme}`];return t.locale&&i.push(`locale=${encodeURIComponent(t.locale)}`),`${e}?${i.join("&")}`}}}class qe extends We{buildWidgetUrl(t){const e=t.widgetUrl.endsWith("social-widget")?`${t.widgetUrl}/${t.widgetId}`:t.widgetUrl;try{const i=new URL(e);return i.searchParams.set("color",t.theme),t.locale&&i.searchParams.set("locale",t.locale),i.toString()}catch{const i=[`color=${t.theme}`];return t.locale&&i.push(`locale=${encodeURIComponent(t.locale)}`),`${e}?${i.join("&")}`}}}class He extends We{buildWidgetUrl(t){const e=t.widgetUrl.endsWith("currency-overview-widget")?`${t.widgetUrl}/${t.widgetId}`:t.widgetUrl;try{const i=new URL(e);return i.searchParams.set("color",t.theme),t.locale&&i.searchParams.set("locale",t.locale),i.toString()}catch{const i=[`color=${t.theme}`];return t.locale&&i.push(`locale=${encodeURIComponent(t.locale)}`),`${e}?${i.join("&")}`}}}class $e extends We{buildWidgetUrl(t){const e=t.widgetUrl.endsWith("referral-conditions-widget")?`${t.widgetUrl}/${t.widgetId}`:t.widgetUrl;try{const i=new URL(e);return i.searchParams.set("color",t.theme),t.locale&&i.searchParams.set("locale",t.locale),i.toString()}catch{const i=[`color=${t.theme}`];return t.locale&&i.push(`locale=${encodeURIComponent(t.locale)}`),`${e}?${i.join("&")}`}}}class Ge extends We{buildWidgetUrl(t){const e=t.widgetUrl.endsWith("custom-widget")?`${t.widgetUrl}/${t.widgetId}`:t.widgetUrl;try{const i=new URL(e);return i.searchParams.set("auth","postmessage"),t.themeExplicit&&i.searchParams.set("color",t.theme),t.locale&&i.searchParams.set("locale",t.locale),i.toString()}catch{const i=["auth=postmessage"];return t.themeExplicit&&i.push(`color=${t.theme}`),t.locale&&i.push(`locale=${encodeURIComponent(t.locale)}`),i.length>0?`${e}?${i.join("&")}`:e}}}console.log("[rai-widget] v1.8.0");const Ye=[["rai-store-widget",je],["rai-channel-widget",Ve],["rai-milestone-widget",Be],["rai-social-widget",qe],["rai-currency-widget",He],["rai-referral-widget",$e],["rai-custom-widget",Ge],["rai-widget",class extends je{}]];for(const[Qe,ti]of Ye)customElements.get(Qe)||customElements.define(Qe,ti);const Xe={store:je,channel:Ve,milestone:Be,social:qe,"currency-view":He,"referral-conditions":$e,custom:Ge},Ke=Ye.map(([t])=>t).join(", ");function Je(){var t,e;const i=((null==(t=document.currentScript)?void 0:t.hasAttribute("data-widget-id"))||(null==(e=document.currentScript)?void 0:e.hasAttribute("data-community-id"))?document.currentScript:null)||document.querySelector("script[data-widget-id], script[data-community-id]");if(!i)return;const s=i.getAttribute("data-community-id")||i.getAttribute("data-widget-id");if(!s)return;const r=i.getAttribute("data-container")||`returning-ai-widget-${s}`,n=document.getElementById(r);if(!n)return;"static"===getComputedStyle(n).position&&(n.style.position="relative");const a=i.getAttribute("data-widget-type")??"store",o=new(Xe[a]??je);Array.from(i.attributes).forEach(t=>{o.setAttribute(t.name,t.value)}),n.appendChild(o)}function Ze(){const t=(()=>{var t,e;const i=((null==(t=document.currentScript)?void 0:t.hasAttribute("data-widget-id"))||(null==(e=document.currentScript)?void 0:e.hasAttribute("data-community-id"))?document.currentScript:null)||document.querySelector("script[data-widget-id], script[data-community-id]");if(!i)return null;const s=i.getAttribute("data-container")||`returning-ai-widget-${i.getAttribute("data-community-id")||i.getAttribute("data-widget-id")}`;return document.getElementById(s)})(),e=null==t?void 0:t.querySelector(Ke);window.ReturningAIWidget={version:"1.8.0",reload:()=>(null==e?void 0:e.reload())??Promise.resolve(),logout:()=>(null==e?void 0:e.logoutPublic())??Promise.resolve(),isAuthenticated:()=>(null==e?void 0:e.isAuthenticated())??!1,getTokenInfo:()=>(null==e?void 0:e.getTokenInfo())??{}}}return"loading"===document.readyState?document.addEventListener("DOMContentLoaded",Je):Je(),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",Ze):Ze(),t.ChannelWidget=Ve,t.CurrencyWidget=He,t.CustomWidget=Ge,t.MILESTONE_CTA_CLICK_CALLBACK_NAME=ce,t.MILESTONE_CTA_CLICK_EVENT=pe,t.MILESTONE_CTA_CLICK_SCOPE=le,t.MilestoneWidget=Be,t.ReferralWidget=$e,t.STORE_CALLBACK_FIELD_OPTIONS_CALLBACK_NAME=ae,t.STORE_CALLBACK_FIELD_OPTIONS_SCOPE=ne,t.STORE_CALLBACK_FIELD_OPTIONS_TIMEOUT_MS=15e3,t.STORE_PURCHASE_SUCCESS_CALLBACK_NAME=he,t.STORE_PURCHASE_SUCCESS_SCOPE=oe,t.SocialWidget=qe,t.StoreWidget=je,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t}({});
3
+ function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,s=Array(e);i<e;i++)s[i]=t[i];return s}function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var s,r,n,a,o=[],h=!0,l=!1;try{if(n=(i=i.call(t)).next,0===e);else for(;!(h=(s=n.call(i)).done)&&(o.push(s.value),o.length!==e);h=!0);}catch(c){l=!0,r=c}finally{try{if(!h&&null!=i.return&&(a=i.return(),Object(a)!==a))return}finally{if(l)throw r}}return o}}(t,e)||function(t,e){if(t){if("string"==typeof t)return h(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?h(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const c=Object.entries,p=Object.setPrototypeOf,d=Object.isFrozen,u=Object.getPrototypeOf,f=Object.getOwnPropertyDescriptor;let m=Object.freeze,g=Object.seal,y=Object.create,v="undefined"!=typeof Reflect&&Reflect,b=v.apply,w=v.construct;m||(m=function(t){return t}),g||(g=function(t){return t}),b||(b=function(t,e){for(var i=arguments.length,s=new Array(i>2?i-2:0),r=2;r<i;r++)s[r-2]=arguments[r];return t.apply(e,s)}),w||(w=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),s=1;s<e;s++)i[s-1]=arguments[s];return new t(...i)});const k=B(Array.prototype.forEach),_=B(Array.prototype.lastIndexOf),T=B(Array.prototype.pop),x=B(Array.prototype.push),A=B(Array.prototype.splice),S=Array.isArray,E=B(String.prototype.toLowerCase),C=B(String.prototype.toString),P=B(String.prototype.match),D=B(String.prototype.replace),I=B(String.prototype.indexOf),M=B(String.prototype.trim),L=B(Number.prototype.toString),F=B(Boolean.prototype.toString),R="undefined"==typeof BigInt?null:B(BigInt.prototype.toString),N="undefined"==typeof Symbol?null:B(Symbol.prototype.toString),O=B(Object.prototype.hasOwnProperty),z=B(Object.prototype.toString),U=B(RegExp.prototype.test),W=(j=TypeError,function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return w(j,e)});var j;function B(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var i=arguments.length,s=new Array(i>1?i-1:0),r=1;r<i;r++)s[r-1]=arguments[r];return b(t,e,s)}}function V(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:E;if(p&&p(t,null),!S(e))return t;let s=e.length;for(;s--;){let r=e[s];if("string"==typeof r){const t=i(r);t!==r&&(d(e)||(e[s]=t),r=t)}t[r]=!0}return t}function H(t){for(let e=0;e<t.length;e++){O(t,e)||(t[e]=null)}return t}function $(t){const e=y(null);for(const s of c(t)){var i=l(s,2);const r=i[0],n=i[1];O(t,r)&&(S(n)?e[r]=H(n):n&&"object"==typeof n&&n.constructor===Object?e[r]=$(n):e[r]=n)}return e}function q(t,e){for(;null!==t;){const i=f(t,e);if(i){if(i.get)return B(i.get);if("function"==typeof i.value)return B(i.value)}t=u(t)}return function(){return null}}const G=m(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Y=m(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),X=m(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),K=m(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),J=m(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Z=m(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Q=m(["#text"]),tt=m(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),et=m(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),it=m(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),st=m(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),rt=g(/{{[\w\W]*|^[\w\W]*}}/g),nt=g(/<%[\w\W]*|^[\w\W]*%>/g),at=g(/\${[\w\W]*/g),ot=g(/^data-[\-\w.\u00B7-\uFFFF]+$/),ht=g(/^aria-[\-\w]+$/),lt=g(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ct=g(/^(?:\w+script|data):/i),pt=g(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),dt=g(/^html$/i),ut=g(/^[a-z][.\w]*(-[.\w]+)+$/i),ft=g(/<[/\w!]/g),mt=g(/<[/\w]/g),gt=g(/<\/no(script|embed|frames)/i),yt=g(/\/>/i),vt=1,bt=3,wt=7,kt=8,_t=9,Tt=11,xt=function(t,e,i,s){return O(t,e)&&S(t[e])?V(s.base?$(s.base):{},t[e],s.transform):i};var At=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof window?null:window;const i=e=>t(e);if(i.version="3.4.12",i.removed=[],!e||!e.document||e.document.nodeType!==_t||!e.Element)return i.isSupported=!1,i;let s=e.document;const r=s,n=r.currentScript;e.DocumentFragment;const a=e.HTMLTemplateElement,o=e.Node,h=e.Element,l=e.NodeFilter,p=e.NamedNodeMap;void 0===p&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const d=e.DOMParser,u=e.trustedTypes,f=h.prototype,v=q(f,"cloneNode"),b=q(f,"remove"),w=q(f,"nextSibling"),j=q(f,"childNodes"),B=q(f,"parentNode"),H=q(f,"shadowRoot"),At=q(f,"attributes"),St=o&&o.prototype?q(o.prototype,"nodeType"):null,Et=o&&o.prototype?q(o.prototype,"nodeName"):null;if("function"==typeof a){const t=s.createElement("template");t.content&&t.content.ownerDocument&&(s=t.content.ownerDocument)}let Ct,Pt,Dt="",It=!1,Mt=0;const Lt=function(){if(Mt>0)throw W('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Ft=function(t){Lt(),Mt++;try{return Ct.createHTML(t)}finally{Mt--}},Rt=function(){return It||(Pt=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let i=null;const s="data-tt-policy-suffix";e&&e.hasAttribute(s)&&(i=e.getAttribute(s));const r="dompurify"+(i?"#"+i:"");try{return t.createPolicy(r,{createHTML:t=>t,createScriptURL:t=>t})}catch(n){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(u,n),It=!0),Pt},Nt=s,Ot=Nt.implementation,zt=Nt.createNodeIterator,Ut=Nt.createDocumentFragment,Wt=Nt.getElementsByTagName,jt=r.importNode;let Bt={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};i.isSupported="function"==typeof c&&"function"==typeof B&&Ot&&void 0!==Ot.createHTMLDocument;const Vt=rt,Ht=nt,$t=at,qt=ot,Gt=ht,Yt=ct,Xt=pt,Kt=ut;let Jt=lt,Zt=null;const Qt=V({},[...G,...Y,...X,...J,...Q]);let te=null;const ee=V({},[...tt,...et,...it,...st]);let ie=Object.seal(y(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),se=null,re=null;const ne=Object.seal(y(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ae=!0,oe=!0,he=!1,le=!0,ce=!1,pe=!0,de=!1,ue=!1,fe=null,me=null,ge=!1,ye=!1,ve=!1,be=!1,we=!0,ke=!1;const _e="user-content-";let Te=!0,xe=!1,Ae={},Se=null;const Ee=V({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Ce=null;const Pe=V({},["audio","video","img","source","image","track"]);let De=null;const Ie=V({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Me="http://www.w3.org/1998/Math/MathML",Le="http://www.w3.org/2000/svg",Fe="http://www.w3.org/1999/xhtml";let Re=Fe,Ne=!1,Oe=null;const ze=V({},[Me,Le,Fe],C),Ue=m(["mi","mo","mn","ms","mtext"]);let We=V({},Ue);const je=m(["annotation-xml"]);let Be=V({},je);const Ve=V({},["title","style","font","a","script"]);let He=null;const $e=["application/xhtml+xml","text/html"];let qe=null,Ge=null;const Ye=s.createElement("form"),Xe=function(t){return t instanceof RegExp||t instanceof Function},Ke=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Ge&&Ge===t)return;t&&"object"==typeof t||(t={}),t=$(t),He=-1===$e.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,qe="application/xhtml+xml"===He?C:E,Zt=xt(t,"ALLOWED_TAGS",Qt,{transform:qe}),te=xt(t,"ALLOWED_ATTR",ee,{transform:qe}),Oe=xt(t,"ALLOWED_NAMESPACES",ze,{transform:C}),De=xt(t,"ADD_URI_SAFE_ATTR",Ie,{transform:qe,base:Ie}),Ce=xt(t,"ADD_DATA_URI_TAGS",Pe,{transform:qe,base:Pe}),Se=xt(t,"FORBID_CONTENTS",Ee,{transform:qe}),se=xt(t,"FORBID_TAGS",$({}),{transform:qe}),re=xt(t,"FORBID_ATTR",$({}),{transform:qe}),Ae=!!O(t,"USE_PROFILES")&&(t.USE_PROFILES&&"object"==typeof t.USE_PROFILES?$(t.USE_PROFILES):t.USE_PROFILES),ae=!1!==t.ALLOW_ARIA_ATTR,oe=!1!==t.ALLOW_DATA_ATTR,he=t.ALLOW_UNKNOWN_PROTOCOLS||!1,le=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,ce=t.SAFE_FOR_TEMPLATES||!1,pe=!1!==t.SAFE_FOR_XML,de=t.WHOLE_DOCUMENT||!1,ye=t.RETURN_DOM||!1,ve=t.RETURN_DOM_FRAGMENT||!1,be=t.RETURN_TRUSTED_TYPE||!1,ge=t.FORCE_BODY||!1,we=!1!==t.SANITIZE_DOM,ke=t.SANITIZE_NAMED_PROPS||!1,Te=!1!==t.KEEP_CONTENT,xe=t.IN_PLACE||!1,Jt=function(t){try{return U(t,""),!0}catch(e){return!1}}(t.ALLOWED_URI_REGEXP)?t.ALLOWED_URI_REGEXP:lt,Re="string"==typeof t.NAMESPACE?t.NAMESPACE:Fe,We=O(t,"MATHML_TEXT_INTEGRATION_POINTS")&&t.MATHML_TEXT_INTEGRATION_POINTS&&"object"==typeof t.MATHML_TEXT_INTEGRATION_POINTS?$(t.MATHML_TEXT_INTEGRATION_POINTS):V({},Ue),Be=O(t,"HTML_INTEGRATION_POINTS")&&t.HTML_INTEGRATION_POINTS&&"object"==typeof t.HTML_INTEGRATION_POINTS?$(t.HTML_INTEGRATION_POINTS):V({},je);const e=O(t,"CUSTOM_ELEMENT_HANDLING")&&t.CUSTOM_ELEMENT_HANDLING&&"object"==typeof t.CUSTOM_ELEMENT_HANDLING?$(t.CUSTOM_ELEMENT_HANDLING):y(null);if(ie=y(null),O(e,"tagNameCheck")&&Xe(e.tagNameCheck)&&(ie.tagNameCheck=e.tagNameCheck),O(e,"attributeNameCheck")&&Xe(e.attributeNameCheck)&&(ie.attributeNameCheck=e.attributeNameCheck),O(e,"allowCustomizedBuiltInElements")&&"boolean"==typeof e.allowCustomizedBuiltInElements&&(ie.allowCustomizedBuiltInElements=e.allowCustomizedBuiltInElements),g(ie),ce&&(oe=!1),ve&&(ye=!0),Ae&&(Zt=V({},Q),te=y(null),!0===Ae.html&&(V(Zt,G),V(te,tt)),!0===Ae.svg&&(V(Zt,Y),V(te,et),V(te,st)),!0===Ae.svgFilters&&(V(Zt,X),V(te,et),V(te,st)),!0===Ae.mathMl&&(V(Zt,J),V(te,it),V(te,st))),ne.tagCheck=null,ne.attributeCheck=null,O(t,"ADD_TAGS")&&("function"==typeof t.ADD_TAGS?ne.tagCheck=t.ADD_TAGS:S(t.ADD_TAGS)&&(Zt===Qt&&(Zt=$(Zt)),V(Zt,t.ADD_TAGS,qe))),O(t,"ADD_ATTR")&&("function"==typeof t.ADD_ATTR?ne.attributeCheck=t.ADD_ATTR:S(t.ADD_ATTR)&&(te===ee&&(te=$(te)),V(te,t.ADD_ATTR,qe))),O(t,"ADD_URI_SAFE_ATTR")&&S(t.ADD_URI_SAFE_ATTR)&&V(De,t.ADD_URI_SAFE_ATTR,qe),O(t,"FORBID_CONTENTS")&&S(t.FORBID_CONTENTS)&&(Se===Ee&&(Se=$(Se)),V(Se,t.FORBID_CONTENTS,qe)),O(t,"ADD_FORBID_CONTENTS")&&S(t.ADD_FORBID_CONTENTS)&&(Se===Ee&&(Se=$(Se)),V(Se,t.ADD_FORBID_CONTENTS,qe)),Te&&(Zt["#text"]=!0),de&&V(Zt,["html","head","body"]),Zt.table&&(V(Zt,["tbody"]),delete se.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw W('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw W('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const e=Ct;Ct=t.TRUSTED_TYPES_POLICY;try{Dt=Ft("")}catch(i){throw Ct=e,i}}else null===t.TRUSTED_TYPES_POLICY?(Ct=void 0,Dt=""):(void 0===Ct&&(Ct=Rt()),Ct&&"string"==typeof Dt&&(Dt=Ft("")));m&&m(t),Ge=t},Je=V({},[...Y,...X,...K]),Ze=V({},[...J,...Z]),Qe=function(t){let e=B(t);e&&e.tagName||(e={namespaceURI:Re,tagName:"template"});const i=E(t.tagName),s=E(e.tagName);return!!Oe[t.namespaceURI]&&(t.namespaceURI===Le?function(t,e,i){return e.namespaceURI===Fe?"svg"===t:e.namespaceURI===Me?"svg"===t&&("annotation-xml"===i||We[i]):Boolean(Je[t])}(i,e,s):t.namespaceURI===Me?function(t,e,i){return e.namespaceURI===Fe?"math"===t:e.namespaceURI===Le?"math"===t&&Be[i]:Boolean(Ze[t])}(i,e,s):t.namespaceURI===Fe?function(t,e,i){return!(e.namespaceURI===Le&&!Be[i])&&!(e.namespaceURI===Me&&!We[i])&&!Ze[t]&&(Ve[t]||!Je[t])}(i,e,s):!("application/xhtml+xml"!==He||!Oe[t.namespaceURI]))},ti=function(t){x(i.removed,{element:t});try{B(t).removeChild(t)}catch(e){if(b(t),!B(t))throw W("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ei=function(t){ri(t);const e=j(t);if(e){const t=[];k(e,e=>{x(t,e)}),k(t,t=>{try{b(t)}catch(e){}})}const i=At(t);if(i)for(let r=i.length-1;r>=0;--r){const e=i[r],n=e&&e.name;if("string"==typeof n)try{t.removeAttribute(n)}catch(s){}}},ii=function(t,e){try{x(i.removed,{attribute:e.getAttributeNode(t),from:e})}catch(s){x(i.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t)if(ye||ve)try{ti(e)}catch(s){}else try{e.setAttribute(t,"")}catch(s){}},si=function(t){const e=At(t);if(e)for(let s=e.length-1;s>=0;--s){const r=e[s],n=r&&r.name;if("string"==typeof n&&!te[qe(n)])try{t.removeAttribute(n)}catch(i){}}},ri=function(t){const e=[t];for(;e.length>0;){const t=e.pop();(St?St(t):t.nodeType)===vt&&si(t);const i=j(t);if(i)for(let s=i.length-1;s>=0;--s)e.push(i[s])}},ni=function(t){let e=null,i=null;if(ge)t="<remove></remove>"+t;else{const e=P(t,/^[\r\n\t ]+/);i=e&&e[0]}"application/xhtml+xml"===He&&Re===Fe&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const r=Ct?Ft(t):t;if(Re===Fe)try{e=(new d).parseFromString(r,He)}catch(a){}if(!e||!e.documentElement){e=Ot.createDocument(Re,"template",null);try{e.documentElement.innerHTML=Ne?Dt:r}catch(a){}}const n=e.body||e.documentElement;return t&&i&&n.insertBefore(s.createTextNode(i),n.childNodes[0]||null),Re===Fe?Wt.call(e,de?"html":"body")[0]:de?e.documentElement:n},ai=function(t){return zt.call(t.ownerDocument||t,t,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},oi=function(t){return t=D(t,Vt," "),t=D(t,Ht," "),t=D(t,$t," ")},hi=function(t){var e;t.normalize();const i=zt.call(t.ownerDocument||t,t,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let s=i.nextNode();for(;s;)s.data=oi(s.data),s=i.nextNode();const r=null===(e=t.querySelectorAll)||void 0===e?void 0:e.call(t,"template");r&&k(r,t=>{ci(t.content)&&hi(t.content)})},li=function(t){const e=Et?Et(t):null;return"string"==typeof e&&("form"===qe(e)&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||t.attributes!==At(t)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes||t.nodeType!==St(t)||t.childNodes!==j(t)))},ci=function(t){if(!St||"object"!=typeof t||null===t)return!1;try{return St(t)===Tt}catch(e){return!1}},pi=function(t){if(!St||"object"!=typeof t||null===t)return!1;try{return"number"==typeof St(t)}catch(e){return!1}};function di(t,e,s){0!==t.length&&k(t,t=>{t.call(i,e,s,Ge)})}const ui=function(t,e){if(di(Bt.beforeSanitizeElements,t,null),t!==e&&null===B(t))return!0;if(li(t))return ti(t),!0;const s=qe(Et?Et(t):t.nodeName);if(di(Bt.uponSanitizeElement,t,{tagName:s,allowedTags:Zt}),t!==e&&null===B(t))return!0;if(function(t,e){return!!(pe&&t.hasChildNodes()&&!pi(t.firstElementChild)&&U(ft,t.textContent)&&U(ft,t.innerHTML))||!(!pe||t.namespaceURI!==Fe||"style"!==e||!pi(t.firstElementChild))||t.nodeType===wt||!(!pe||t.nodeType!==kt||!U(mt,t.data))}(t,s))return ti(t),!0;if(se[s]||!(ne.tagCheck instanceof Function&&ne.tagCheck(s))&&!Zt[s]){const e=function(t,e){if(!se[e]&&gi(e)){if(ie.tagNameCheck instanceof RegExp&&U(ie.tagNameCheck,e))return!1;if(ie.tagNameCheck instanceof Function&&ie.tagNameCheck(e))return!1}if(Te&&!Se[e]){const e=B(t),i=j(t);if(i&&e)for(let s=i.length-1;s>=0;--s){const r=xe?i[s]:v(i[s],!0);e.insertBefore(r,w(t))}}return ti(t),!0}(t,s);return!1===e&&di(Bt.afterSanitizeElements,t,null),e}if((St?St(t):t.nodeType)===vt&&!Qe(t))return ti(t),!0;if(("noscript"===s||"noembed"===s||"noframes"===s)&&U(gt,t.innerHTML))return ti(t),!0;if(ce&&t.nodeType===bt){const e=oi(t.textContent);t.textContent!==e&&(x(i.removed,{element:t.cloneNode()}),t.textContent=e)}return di(Bt.afterSanitizeElements,t,null),!1},fi=function(t,e,i){if(re[e])return!1;if(pe&&"patchsrc"===e)return!1;if(pe&&"for"===e&&"label"!==t&&"output"!==t)return!1;if(we&&("id"===e||"name"===e)&&(i in s||i in Ye))return!1;const r=te[e]||ne.attributeCheck instanceof Function&&ne.attributeCheck(e,t);if(oe&&U(qt,e));else if(ae&&U(Gt,e));else if(r)if(De[e]);else if(U(Jt,D(i,Xt,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==I(i,"data:")||!Ce[t]){if(he&&!U(Yt,D(i,Xt,"")));else if(i)return!1}else;else if(!(gi(t)&&(ie.tagNameCheck instanceof RegExp&&U(ie.tagNameCheck,t)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(t))&&(ie.attributeNameCheck instanceof RegExp&&U(ie.attributeNameCheck,e)||ie.attributeNameCheck instanceof Function&&ie.attributeNameCheck(e,t))||"is"===e&&ie.allowCustomizedBuiltInElements&&(ie.tagNameCheck instanceof RegExp&&U(ie.tagNameCheck,i)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(i))))return!1;return!0},mi=V({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),gi=function(t){return!mi[E(t)]&&U(Kt,t)},yi=function(t,e,i,s){if(Ct&&"object"==typeof u&&"function"==typeof u.getAttributeType&&!i)switch(u.getAttributeType(t,e)){case"TrustedHTML":return Ft(s);case"TrustedScriptURL":return function(t){Lt(),Mt++;try{return Ct.createScriptURL(t)}finally{Mt--}}(s)}return s},vi=function(t,e,s,r){try{s?t.setAttributeNS(s,e,r):t.setAttribute(e,r),li(t)?ti(t):T(i.removed)}catch(n){ii(e,t)}},bi=function(t){di(Bt.beforeSanitizeAttributes,t,null);const e=t.attributes;if(!e||li(t))return;const i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:te,forceKeepAttr:void 0};let s=e.length;const r=qe(t.nodeName);for(;s--;){const n=e[s],a=n.name,o=n.namespaceURI,h=n.value,l=qe(a),c=h;let p="value"===a?c:M(c);i.attrName=l,i.attrValue=p,i.keepAttr=!0,i.forceKeepAttr=void 0,di(Bt.uponSanitizeAttribute,t,i),p=i.attrValue,!ke||"id"!==l&&"name"!==l||0===I(p,_e)||(ii(a,t),p=_e+p),pe&&U(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,p)?ii(a,t):"attributename"===l&&P(p,"href")?ii(a,t):i.forceKeepAttr||(i.keepAttr&&(le||!U(yt,p))?(ce&&(p=oi(p)),fi(r,l,p)?(p=yi(r,l,o,p),p!==c&&vi(t,a,o,p)):ii(a,t)):ii(a,t))}di(Bt.afterSanitizeAttributes,t,null)},wi=function(t){let e=null;const i=ai(t);for(di(Bt.beforeSanitizeShadowDOM,t,null);e=i.nextNode();){di(Bt.uponSanitizeShadowNode,e,null),ui(e,t),bi(e),ci(e.content)&&wi(e.content);if((St?St(e):e.nodeType)===vt){const t=H(e);ci(t)&&(ki(t),wi(t))}}di(Bt.afterSanitizeShadowDOM,t,null)},ki=function(t){const e=[{node:t,shadow:null}];for(;e.length>0;){const t=e.pop();if(t.shadow){wi(t.shadow);continue}const i=t.node,s=(St?St(i):i.nodeType)===vt,r=j(i);if(r)for(let n=r.length-1;n>=0;--n)e.push({node:r[n],shadow:null});if(s){const t=Et?Et(i):null;if("string"==typeof t&&"template"===qe(t)){const t=i.content;ci(t)&&e.push({node:t,shadow:null})}}if(s){const t=H(i);ci(t)&&e.push({node:null,shadow:t},{node:t,shadow:null})}}};return i.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=null,n=null,a=null,o=null;if(Ne=!t,Ne&&(t="\x3c!--\x3e"),"string"!=typeof t&&!pi(t)&&"string"!=typeof(t=function(t){switch(typeof t){case"string":return t;case"number":return L(t);case"boolean":return F(t);case"bigint":return R?R(t):"0";case"symbol":return N?N(t):"Symbol()";case"undefined":default:return z(t);case"function":case"object":{if(null===t)return z(t);const e=t,i=q(e,"toString");if("function"==typeof i){const t=i(e);return"string"==typeof t?t:z(t)}return z(t)}}}(t)))throw W("dirty is not a string, aborting");if(!i.isSupported)return t;ue?(Zt=fe,te=me):Ke(e),(Bt.uponSanitizeElement.length>0||Bt.uponSanitizeAttribute.length>0)&&(Zt=$(Zt)),Bt.uponSanitizeAttribute.length>0&&(te=$(te)),i.removed=[];const h=xe&&"string"!=typeof t&&pi(t);if(h){!function(t){if(!pe)return;const e=[t];for(;e.length>0;){const t=e.pop(),s=St?St(t):t.nodeType;if(s===wt||s===kt&&U(mt,t.data)){try{b(t)}catch(i){}continue}if(s===vt){const e=t,s=qe(Et?Et(t):t.nodeName);try{e.hasAttribute&&e.hasAttribute("patchsrc")&&e.removeAttribute("patchsrc"),e.hasAttribute&&e.hasAttribute("for")&&"label"!==s&&"output"!==s&&e.removeAttribute("for")}catch(i){}}const r=j(t);if(r)for(let i=r.length-1;i>=0;--i)e.push(r[i])}}(t);const e=Et?Et(t):t.nodeName;if("string"==typeof e){const i=qe(e);if(!Zt[i]||se[i])throw ei(t),W("root node is forbidden and cannot be sanitized in-place")}if(li(t))throw ei(t),W("root node is clobbered and cannot be sanitized in-place");try{ki(t)}catch(d){throw ei(t),d}}else if(pi(t))s=ni("\x3c!----\x3e"),n=s.ownerDocument.importNode(t,!0),n.nodeType===vt&&"BODY"===n.nodeName||"HTML"===n.nodeName?s=n:s.appendChild(n),ki(n);else{if(!ye&&!ce&&!de&&-1===t.indexOf("<"))return Ct&&be?Ft(t):t;if(s=ni(t),!s)return ye?null:be?Dt:""}s&&ge&&ti(s.firstChild);const l=h?t:s,c=ai(l);try{for(;a=c.nextNode();)ui(a,l),bi(a),ci(a.content)&&wi(a.content)}catch(d){throw h&&(ei(t),k(i.removed,t=>{t.element&&ri(t.element)})),d}if(h)return k(i.removed,t=>{t.element&&ri(t.element)}),ce&&hi(t),t;if(ye){if(ce&&hi(s),ve)for(o=Ut.call(s.ownerDocument);s.firstChild;)o.appendChild(s.firstChild);else o=s;return(te.shadowroot||te.shadowrootmode)&&(o=jt.call(r,o,!0)),o}let p=de?s.outerHTML:s.innerHTML;return de&&Zt["!doctype"]&&s.ownerDocument&&s.ownerDocument.doctype&&s.ownerDocument.doctype.name&&U(dt,s.ownerDocument.doctype.name)&&(p="<!DOCTYPE "+s.ownerDocument.doctype.name+">\n"+p),ce&&(p=oi(p)),Ct&&be?Ft(p):p},i.setConfig=function(){Ke(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),ue=!0,fe=Zt,me=te},i.clearConfig=function(){Ge=null,ue=!1,fe=null,me=null,Ct=Pt,Dt=""},i.isValidAttribute=function(t,e,i){Ge||Ke({});const s=qe(t),r=qe(e);return fi(s,r,i)},i.addHook=function(t,e){"function"==typeof e&&O(Bt,t)&&x(Bt[t],e)},i.removeHook=function(t,e){if(O(Bt,t)){if(void 0!==e){const i=_(Bt[t],e);return-1===i?void 0:A(Bt[t],i,1)[0]}return T(Bt[t])}},i.removeHooks=function(t){O(Bt,t)&&(Bt[t]=[])},i.removeAllHooks=function(){Bt={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},i}();function St(t,e){const i=t.startsWith("--")?t:`--${t}`,s=[e,document.documentElement,document.body,...Array.from(document.querySelectorAll(["rai-widget","rai-custom-widget","rai-channel-widget","rai-store-widget","rai-milestone-widget","rai-social-widget","rai-currency-widget","rai-referral-widget",".rai-widget-root",'[data-rai-widget-root="true"]'].join(",")))].filter(Boolean),r=new Set;for(const n of s){if(r.has(n))continue;r.add(n);const t=getComputedStyle(n).getPropertyValue(i).trim();if(t)return t}for(const n of Array.from(document.querySelectorAll("*"))){if(r.has(n))continue;const t=getComputedStyle(n).getPropertyValue(i).trim();if(t)return t}}function Et(t,e){if(!t)return;const i=t.trim();if(/^(#|rgb|hsl)/i.test(i))return i;if(/^(--)?[a-z0-9-]+$/i.test(i))return St(i,e);const s=i.match(/^var\((--[a-z0-9-]+)\)$/i);return s?St(s[1],e):void 0}function Ct(t,e,i){const s=document.createElement(t);if(Object.assign(s.style,e),i)for(const r of Object.keys(i))s.setAttribute(r,i[r]);return s}function Pt(t){return"left"===t||"top"===t?"flex-start":"right"===t||"bottom"===t?"flex-end":"center"}function Dt(t,e){var i;const s=[null==(i=t.cta)?void 0:i.style,t.cta,t.ctaStyle];for(const r of s)for(const t of e){const e=null==r?void 0:r[t];if(e)return e}}function It(t,e,i){var s,r,n,a,o,h,l,c,p,d,u,f,m,g;const y=t.placement||{},v=y.mode||"overlay",b=y.position||"top",w=String(y.zIndex||2147483e3),k=function(t){var e,i;return"image"===t.type&&Boolean((null==(e=t.image)?void 0:e.desktopUrl)||(null==(i=t.image)?void 0:i.mobileUrl))}(t),_=k?"transparent":Et(null==(s=t.style)?void 0:s.backgroundColor,i)||"#1f2024",T=Et(null==(r=t.style)?void 0:r.color,i)||"#ffffff",x="overlay"===v||"popup"===v,A=Dt(t,["position"])||"center",S=Pt(null==(n=t.image)?void 0:n.horizontalAlignment),E=Pt(null==(a=t.image)?void 0:a.verticalAlignment),C=(null==(o=t.image)?void 0:o.horizontalAlignment)||"center",P=(null==(h=t.image)?void 0:h.verticalAlignment)||"center",D=k?"#ffffff":T,I=Ct("div",{boxSizing:"border-box",fontFamily:"Roboto, sans-serif",fontSize:"14px",lineHeight:"1.35",background:_,color:T,borderRadius:x&&!k?"6px":"0",boxShadow:x&&!k?"0 8px 24px rgba(0,0,0,0.22)":"none",padding:k?"0":x?"12px 42px 12px 24px":"8px 42px 8px 16px",display:"flex",alignItems:k?E:"flex-start",justifyContent:"center",gap:k?"0":"16px"});if(I.setAttribute("role",x?"dialog":"region"),I.setAttribute("aria-label","community banner"),I.setAttribute("data-renderer-version","sdk-banner-preview-layout"),x)if(Object.assign(I.style,{position:"fixed",left:"50%",width:"fit-content",maxWidth:k?"70vw":"min(700px, 80vw)",height:"auto",minHeight:k?"0":"80px",maxHeight:k?"70vh":"calc(100vh - 300px)",overflowY:k?"visible":"auto",zIndex:w}),k){const t=[];"left"===C?I.style.left="24px":"right"===C?(I.style.left="",I.style.right="24px"):(I.style.left="50%",t.push("-50%")),"top"===P?I.style.top="10px":"bottom"===P?I.style.bottom="24px":(I.style.top="50%",t.push("-50%")),2===t.length?I.style.transform=`translate(${t[0]}, ${t[1]})`:1===t.length&&"center"===C?I.style.transform=`translateX(${t[0]})`:1===t.length?I.style.transform=`translateY(${t[0]})`:I.style.transform=""}else"bottom"===b?(I.style.bottom="24px",I.style.transform="translateX(-50%)"):"center"===b?(I.style.top="50%",I.style.transform="translate(-50%, -50%)"):(I.style.top="10px",I.style.transform="translateX(-50%)");else Object.assign(I.style,{position:"relative",width:"100%",zIndex:w});const M=Ct("div",{display:"flex",width:k||x?"auto":"100%",maxWidth:"100%",flexDirection:"column",gap:k?"0":"12px",overflow:"hidden"}),L=Ct("div",{display:"flex",width:k||x?"auto":"100%",justifyContent:k?S:"space-between",alignItems:k?E:"flex-start",gap:"12px"}),F=Ct("div",{width:k||x?"auto":"100%",maxWidth:k?"70vw":x?"calc(min(700px, 80vw) - 66px)":"100%",overflow:"hidden",wordBreak:"normal",overflowWrap:"anywhere",whiteSpace:"normal",color:T}),R=(null==(l=t.image)?void 0:l.desktopUrl)||(null==(c=t.image)?void 0:c.mobileUrl);if(k&&R){const e=null==(p=t.image)?void 0:p.linkUrl,i=null==(d=t.image)?void 0:d.openInNewTab,s=Ct("img",{display:"block",maxWidth:"70vw",maxHeight:"70vh",width:"auto",height:"auto",objectFit:"contain",objectPosition:(U=null==(u=t.image)?void 0:u.horizontalAlignment,W=null==(f=t.image)?void 0:f.verticalAlignment,`${"left"===U?"left":"right"===U?"right":"center"} ${"top"===W?"top":"bottom"===W?"bottom":"center"}`),cursor:e?"pointer":"",borderRadius:"rounded"===(null==(m=t.image)?void 0:m.cornerRadius)?"8px":"0"},{src:R,alt:t.title||"banner"});e&&s.addEventListener("click",()=>{i?window.open(e,"_blank","noopener,noreferrer"):window.location.href=e}),F.appendChild(s)}else{F.innerHTML=(z=t.text)?At.sanitize(z,{ALLOWED_TAGS:["p","strong","em","u","img","span","div","a","br"],ALLOWED_ATTR:["style","src","class","href","target","alt","width","height"],ADD_ATTR:["target"],ALLOW_DATA_ATTR:!1}):"",(O=F).querySelectorAll("p").forEach(t=>{t.style.margin="0",t.style.whiteSpace="normal",t.style.overflowWrap="anywhere"}),O.querySelectorAll("strong").forEach(t=>{t.style.fontWeight="700",t.style.whiteSpace="normal"}),O.querySelectorAll("em").forEach(t=>{t.style.fontStyle="italic",t.style.whiteSpace="normal"}),O.querySelectorAll("u").forEach(t=>{t.style.textDecoration="underline",t.style.whiteSpace="normal"}),O.querySelectorAll("a").forEach(t=>{t.style.color="#3b82f6",t.style.textDecoration="underline",t.style.whiteSpace="normal",t.style.overflowWrap="anywhere","_blank"===t.getAttribute("target")&&t.setAttribute("rel","noopener noreferrer")}),O.querySelectorAll("img").forEach(t=>{t.style.maxWidth="100%",t.style.height="auto"});const e=function(t){const e=t.querySelector('[style*="text-align"]'),i=((null==e?void 0:e.style.textAlign)||t.style.textAlign||"").toLowerCase().trim();return"center"===i||"right"===i||"justify"===i?i:"left"}(F);F.style.textAlign=e,x&&(L.style.justifyContent="center"===(N=e)?"center":"right"===N?"flex-end":"flex-start")}var N,O,z,U,W,j;if(!k&&(null==(g=t.cta)?void 0:g.enabled)){const s=Ct("button",{cursor:"pointer",border:"none",borderRadius:"6px",height:"36px",minHeight:"36px",padding:"0 16px",fontFamily:"Roboto, sans-serif",fontSize:"12px",fontWeight:"600",lineHeight:"20px",backgroundColor:Et(Dt(t,["backgroundColor","buttonColor","aColor"]),i)||"#2f6df6",color:Et(Dt(t,["textColor","color"]),i)||"#ffffff",boxSizing:"border-box",display:"inline-flex",alignItems:"center",justifyContent:"center"});if(s.type="button",s.textContent=t.cta.label||"CTA Button",s.addEventListener("click",e.onCtaClick),"inline"===A){L.appendChild(F);const t=Ct("div",{display:"flex",flexDirection:"column",alignItems:"flex-end",justifyContent:"center",flexShrink:"0"});t.appendChild(s),L.appendChild(t),M.appendChild(L)}else{L.appendChild(F),M.appendChild(L);const t=Ct("div",{display:"flex",width:"100%",justifyContent:(j=A,"left"===j?"flex-start":"right"===j?"flex-end":"center")});t.appendChild(s),M.appendChild(t)}}else L.appendChild(F),M.appendChild(L);I.appendChild(M);const B=Ct("button",{position:x?"absolute":"",top:x?k?"16px":"12px":"",right:x?k?"16px":"12px":"",marginTop:x?"0":"8px",width:"20px",minWidth:"20px",height:"20px",cursor:"pointer",border:"none",borderRadius:"50%",background:"rgba(0,0,0,0.25)",color:D,fontSize:"16px",lineHeight:"1",display:"flex",alignItems:"center",justifyContent:"center",padding:"0",flexShrink:"0"});return B.type="button",B.setAttribute("aria-label","dismiss banner"),B.innerHTML="&times;",B.addEventListener("click",e.onDismiss),I.appendChild(B),I}At.addHook("afterSanitizeAttributes",t=>{"A"===t.tagName&&"_blank"===t.getAttribute("target")&&t.setAttribute("rel","noopener noreferrer")});function Mt(){try{if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID()}catch{}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}function Lt(t){if(t)try{(new Image).src=t}catch{}}function Ft(t){return`${t.storagePrefix}-${t.widgetId}-${t.container}-auth`}function Rt(t){return`${t.storagePrefix}-${t.widgetId}-auth`}function Nt(t){return`${t.storagePrefix}-${t.widgetId}-error-settings`}function Ot(t,e){try{const i={refreshToken:e.refreshToken,tokenFamily:e.tokenFamily,refreshTokenExpiry:e.refreshTokenExpiry};localStorage.setItem(Ft(t),JSON.stringify(i))}catch{}}function zt(t){try{localStorage.removeItem(Ft(t)),localStorage.removeItem(Rt(t))}catch{}}function Ut(t){try{const e=localStorage.getItem(Nt(t));if(!e)return null;const i=JSON.parse(e);return i.cachedAt&&Date.now()-i.cachedAt<36e5?i:(localStorage.removeItem(Nt(t)),null)}catch{return null}}function Wt(t){return!t||Date.now()>=t-6e4}function jt(t,e,i,s){e.accessToken=i.accessToken,e.refreshToken=i.refreshToken,e.tokenFamily=i.tokenFamily??null,i.widgetData&&"object"==typeof i.widgetData&&!Array.isArray(i.widgetData)&&(e.widgetData=i.widgetData);const r=Date.now();e.accessTokenExpiry=r+1e3*i.accessTokenTTL,e.refreshTokenExpiry=r+1e3*i.refreshTokenTTL,Ot(t,e),t.autoRefresh&&s&&s()}function Bt(t){const e={};return t.embedToken&&(e.embedToken=t.embedToken),t.userIdentifiers&&Object.keys(t.userIdentifiers).length>0&&(e.userIdentifiers=t.userIdentifiers),e}async function Vt(t,e,i){const s=crypto.randomUUID(),r=Date.now(),n=t.maxRetries??3,a=t.retryDelay??500;for(let o=0;o<=n;o++){o>0&&await new Promise(t=>setTimeout(t,a*(1<<o-1)));let h=!1;try{const n={nonce:s,timestamp:r,widgetType:t.widgetType,...Bt(t)},a=await fetch(`${t.apiUrl}/${t.widgetId}/auth/serverless`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),credentials:"include"});if(!a.ok){h=a.status>=400&&a.status<500;const t=await a.json().catch(()=>({error:"Authentication failed"}));throw h&&(e.lastAuthError={status:a.status,error:null==t?void 0:t.error,hint:null==t?void 0:t.hint},console.error(`[rai-widget] /auth/serverless ${a.status}:`,(null==t?void 0:t.error)||"Authentication failed",(null==t?void 0:t.hint)?`— ${t.hint}`:"")),new Error((null==t?void 0:t.error)||`HTTP ${a.status}`)}e.lastAuthError=null;const o=await a.json();if(!o.accessToken||!o.refreshToken)throw new Error("Invalid authentication response");return jt(t,e,o,i),e.isAuthenticated=!0,!0}catch{if(h||o===n)return e.isAuthenticated=!1,!1}}return e.isAuthenticated=!1,!1}async function Ht(t,e,i){const s=t.maxRetries??3,r=t.retryDelay??500;for(let n=0;n<=s;n++){n>0&&await new Promise(t=>setTimeout(t,r*(1<<n-1)));let a=!1;try{const s=await fetch(t.authUrl,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}});if(!s.ok)throw a=s.status>=400&&s.status<500,new Error(`HTTP ${s.status}`);const r=await s.json();if(!r.token)throw new Error("Invalid proxy auth response");const n=r.expiresIn??300;return e.accessToken=r.token,e.refreshToken=null,e.tokenFamily=null,e.accessTokenExpiry=Date.now()+1e3*n,e.refreshTokenExpiry=null,e.isAuthenticated=!0,t.autoRefresh&&i&&i(),!0}catch{if(a||n===s)return e.isAuthenticated=!1,!1}}return e.isAuthenticated=!1,!1}async function $t(t,e,i,s){return e.isRefreshing?e.refreshPromise:!!e.refreshToken&&(e.isRefreshing=!0,e.refreshPromise=(async()=>{const r=async()=>{Xt(e),zt(t);const r=await Vt(t,e,i);return r&&s&&s(),r};try{const n=await fetch(`${t.apiUrl}/${t.widgetId}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.refreshToken}`},body:JSON.stringify({widgetType:t.widgetType,...Bt(t)})});if(!n.ok){if(400===n.status||401===n.status||403===n.status)return r();const t=await n.json().catch(()=>({error:"Token refresh failed"}));throw new Error(t.error||`HTTP ${n.status}`)}const a=await n.json();if(!a.accessToken||!a.refreshToken)throw new Error("Invalid refresh response");return jt(t,e,a,i),s&&s(),!0}catch{return r()}finally{e.isRefreshing=!1,e.refreshPromise=null}})(),e.refreshPromise)}const qt=new Map;function Gt(t,e){e.configured&&(t.errorSettings={errorMessage:e.errorMessage,modalColor:e.modalColor,backgroundImage:e.backgroundImage}),e.loadingAnimation&&(t.loadingAnimation=e.loadingAnimation),e.loadingSettings&&(t.loadingSettings=e.loadingSettings),e.themePalette&&(t.themePalette=e.themePalette),"string"==typeof e.font&&e.font&&(t.font=e.font),"light"!==e.defaultColorSchema&&"dark"!==e.defaultColorSchema||(t.defaultColorSchema=e.defaultColorSchema)}async function Yt(t,e,i={}){if(!i.skipCache){const i=Ut(t);if(i)return Gt(e,i),e.errorSettings}const s=`${t.apiUrl}/${t.widgetId}/auth/error-settings?widgetType=${t.widgetType}`;let r=qt.get(s);r||(r=(async()=>{try{const e=await fetch(s,{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok)return null;const i=await e.json();return function(t,e){try{localStorage.setItem(Nt(t),JSON.stringify({...e,cachedAt:Date.now()}))}catch{}}(t,i),i}catch{return null}finally{qt.delete(s)}})(),qt.set(s,r));const n=await r;return n?(Gt(e,n),e.errorSettings):null}function Xt(t){t.accessToken=null,t.refreshToken=null,t.tokenFamily=null,t.accessTokenExpiry=null,t.refreshTokenExpiry=null,t.isAuthenticated=!1,t.isRefreshing=!1,t.refreshPromise=null,t.lastAuthError=null,t.widgetData=null,t.refreshTimer&&(clearTimeout(t.refreshTimer),t.refreshTimer=null),t.syncTimer&&(clearInterval(t.syncTimer),t.syncTimer=null)}const Kt="__RAI_AUTO_THEME_LEASE_STATE__",Jt="__DISABLE_AUTO_THEME__";function Zt(t){return("object"==typeof t||"function"==typeof t)&&null!==t&&"function"==typeof t.then}function Qt(t,e,i){return new Promise((s,r)=>{const n=setTimeout(()=>{r(new Error(i))},e);Promise.resolve(t).then(t=>{clearTimeout(n),s(t)},t=>{clearTimeout(n),r(t)})})}function te(t,e=3e4){return Zt(t)?Qt(t,e,`Widget bundle mount did not resolve within ${e}ms`):Promise.resolve(t)}async function ee(t,e,i=3e4){const s=await te(t,i);return"object"==typeof(r=s)&&null!==r&&"ready"in r&&Zt(r.ready)?(await Qt(s.ready,i,`Widget bundle did not report deep readiness within ${i}ms`),"deep-ready"):(await e,"first-paint");var r}function ie(t,e){const i=new URL(t,e);return i.hash="",i.href}const se=new Set;function re(t){const e=`${t.rel}:${t.url}`;if(se.has(e))return;const i=document.createElement("link");i.rel=t.rel,i.as=t.as,i.href=t.url,i.crossOrigin="anonymous",i.onload=()=>{},i.onerror=()=>{se.delete(e),i.remove()},se.add(e),document.head.appendChild(i)}const ne=function({loadScript:t,readGlobal:e,baseUrl:i}){const s=new Map,r=new Map;return async function(n,a){const o=ie(a,i()),h=`${n}:${o}`,l=s.get(h);if(l)return l;const c=(r.get(n)||Promise.resolve()).then(async()=>{await t(o);const i=e(n);if("object"!=typeof(s=i)&&"function"!=typeof s||null===s||"function"!=typeof s.mount)throw new Error(`window.${n}.mount not found after loading ${o}`);var s;const r=i.mount;return{mount:(t,e)=>r.call(i,t,e)}});s.set(h,c);const p=c.then(()=>{},()=>{});r.set(n,p),p.then(()=>{r.get(n)===p&&r.delete(n)});try{return await c}catch(d){throw s.get(h)===c&&s.delete(h),d}}}({loadScript:function(t){return new Promise((e,i)=>{const s=document.createElement("script");s.src=t,s.onload=()=>e(),s.onerror=()=>i(new Error(`Failed to load ${t}`)),document.head.appendChild(s)})},readGlobal:t=>window[t],baseUrl:()=>document.baseURI}),ae=function({preloadScript:t,preloadBundleAssets:e,baseUrl:i}){const s=new Map,r=new Map;return function(n,a){const o=ie(a,i());if(s.has(o))return;const h=t(o).catch(()=>{s.delete(o)});if(s.set(o,h),e&&!r.has(o)){const t=e(o).catch(()=>{r.delete(o)});r.set(o,t)}}}({preloadScript:function(t){return new Promise((e,i)=>{const s=document.createElement("link");s.rel="preload",s.as="script",s.href=t,s.onload=()=>e(),s.onerror=()=>i(new Error(`Failed to preload ${t}`)),document.head.appendChild(s)})},preloadBundleAssets:async function(t){const e=new URL("./preload-manifest.json",t),i=await fetch(e,{credentials:"omit",headers:{Accept:"application/json"}});if(!i.ok)throw new Error(`Bundle preload manifest returned ${i.status}`);const s=await i.json();for(const r of function(t,e){if(1!==e.version)return[];const i=new URL(t),s=new URL("./",i),r=[...(Array.isArray(e.scripts)?e.scripts:[]).map(t=>({value:t,rel:"modulepreload",as:"script",extension:".js"})),...(Array.isArray(e.styles)?e.styles:[]).map(t=>({value:t,rel:"preload",as:"style",extension:".css"}))],n=new Set,a=[];for(const o of r){if(a.length>=24)break;if("string"!=typeof o.value)continue;let t;try{t=new URL(o.value,s)}catch{continue}t.origin===s.origin&&t.pathname.startsWith(s.pathname)&&t.pathname.endsWith(o.extension)&&!n.has(t.href)&&(n.add(t.href),a.push({url:t.href,rel:o.rel,as:o.as}))}return a}(t,s))re(r)},baseUrl:()=>document.baseURI});function oe(t,e,i=window){return!(!t.bundleUrl||!e.accessToken)&&(i.guest_token=e.accessToken,i.dispatchEvent(new CustomEvent("authtoken-change",{detail:{token:e.accessToken,widgetId:t.widgetId}})),!0)}class he{constructor(){i(this,"registeredCallbacks",{}),i(this,"locked",!1)}get isLocked(){return this.locked}registerCallback(t,e){this.locked||(!function(t){if(!t||"string"!=typeof t)throw new TypeError("ReturningAI callback name must be a non-empty string")}(t),function(t){if("function"!=typeof t)throw new TypeError("ReturningAI callback must be a function")}(e),this.registeredCallbacks={...this.registeredCallbacks,[t]:e})}lock(){this.locked||(this.locked=!0)}read(){return{...this.registeredCallbacks}}}const le="store.callback_field_options",ce="callbackFieldOptions",pe="store.purchase_success",de="storePurchaseSuccess",ue="milestone.cta_click",fe="milestoneCtaClick",me="milestone_cta_clicked";function ge(t){return"object"==typeof t&&null!==t}function ye(t){return ge(t)&&Object.values(t).every(t=>"string"==typeof t)}function ve(t){return function(t){if(!t)return null;const e=t.split(".")[1];if(!e)return null;try{const t=e.replace(/-/g,"+").replace(/_/g,"/"),i=t.padEnd(4*Math.ceil(t.length/4),"="),s=Uint8Array.from(atob(i),t=>t.charCodeAt(0)),r=JSON.parse((new TextDecoder).decode(s));return ge(r)&&ye(r.userIdentifiers)?{...r.userIdentifiers}:null}catch{return null}}(t.embedToken)??{...t.userIdentifiers}}function be(t,e,i){return ge(t)&&t.callbackName===e&&t.scope===i}function we(t,e){if(!e||0===Object.keys(e).length)return t;if(!ge(t))return t;const i=t.context;if(!ge(i))return t;const s=i.user;return ge(s)?{...t,context:{...i,user:{...s,identifiers:{...e}}}}:t}const ke={[ce]:{callbackName:ce,scope:le,sourceWidgetType:"store",allowedHostWidgetTypes:["store","custom"],completionMode:"result",missingHandler:"reject",legacyActions:["store:host-callback"],validatePayload:t=>be(t,ce,le)},[de]:{callbackName:de,scope:pe,sourceWidgetType:"store",allowedHostWidgetTypes:["store","custom"],completionMode:"acknowledged",missingHandler:"reject",legacyActions:["store:host-callback"],validatePayload:t=>be(t,de,pe)},[fe]:{callbackName:fe,scope:ue,sourceWidgetType:"milestone",allowedHostWidgetTypes:["milestone","custom"],completionMode:"detached",missingHandler:"ignore",legacyActions:[],validatePayload:function(t){if(!be(t,fe,ue))return!1;const e=t.context;if(!ge(e))return!1;const i=e.community,s=e.milestone,r=e.stage,n=e.button,a=e.user;return e.event===me&&ge(i)&&"string"==typeof i.id&&i.id.length>0&&(void 0===i.name||null===i.name||"string"==typeof i.name)&&ge(s)&&"string"==typeof s.id&&s.id.length>0&&"string"==typeof s.name&&s.name.length>0&&ge(r)&&"string"==typeof r.id&&r.id.length>0&&"string"==typeof r.name&&r.name.length>0&&ge(n)&&"string"==typeof n.name&&n.name.length>0&&ge(a)&&ye(a.identifiers)&&"string"==typeof e.clickedAt&&e.clickedAt.length>0&&!Number.isNaN(Date.parse(e.clickedAt))}}};function _e(t,e){if(t)try{t(e)}catch{}}function Te(t,e){const i=ke[t];return(null==i?void 0:i.validatePayload(e))?i:void 0}function xe(t){const e=Te(t.callbackName,t.payload);if(!e||!e.allowedHostWidgetTypes.includes(t.hostWidgetType))throw new Error("Host callback is not supported for this widget");const i={invocationId:t.invocationId||`host_callback_${Date.now()}_${Math.random().toString(36).slice(2)}`,callbackName:e.callbackName,scope:e.scope,sourceWidgetType:e.sourceWidgetType,hostWidgetType:t.hostWidgetType,completionMode:e.completionMode,transport:t.transport};_e(t.observer,{type:"callback.received",...i});const s=t.callbacks[e.callbackName];if(!s){if(_e(t.observer,{type:"callback.handler_missing",...i}),"ignore"===e.missingHandler)return;return Promise.reject(new Error("Host callback is not registered"))}let r;_e(t.observer,{type:"callback.handler_started",...i});try{r=s(t.payload)}catch(n){if(_e(t.observer,{type:"callback.handler_rejected",...i,error:n}),"detached"===e.completionMode)return;return Promise.reject(new Error("Host callback failed"))}if("detached"!==e.completionMode)return Promise.resolve(r).then(s=>(_e(t.observer,{type:"callback.handler_resolved",...i}),"result"===e.completionMode?s:void 0),e=>{throw _e(t.observer,{type:"callback.handler_rejected",...i,error:e}),new Error("Host callback failed")});r&&"function"==typeof r.then?Promise.resolve(r).then(()=>_e(t.observer,{type:"callback.handler_resolved",...i}),e=>_e(t.observer,{type:"callback.handler_rejected",...i,error:e})):_e(t.observer,{type:"callback.handler_resolved",...i})}const Ae=["en","de","es","fr","it","pt","pl","da","nl","ru","chs","el","ko","cht","th","ja","id","vt","ms","hi","fil","ta","tr","ar","mn","sw"],Se=new Set(Ae),Ee=new Set,Ce=/^[a-z]{2,8}(?:-[a-z0-9]{1,8})*$/;const Pe=/^(\d+(?:\.\d+)?)%$/;function De(t){const e=t.trim().match(Pe);if(!e)return null;const i=Number(e[1]);return Number.isFinite(i)&&i>0?i:null}function Ie(t,e,i){var s;if(e.accessToken)try{null==(s=i.contentWindow)||s.postMessage({type:"RETURNINGAI_WIDGET_TOKEN",value:{widgetId:t.widgetId,token:e.accessToken,...void 0!==t.customData&&{customData:t.customData}}},t.widgetDomain)}catch{}}function Me(t,e,i,s,r,n,a,o,h){const l=function(t,e){let i=null;return{call(s){i&&clearTimeout(i),i=setTimeout(()=>{t(s),i=null},e)},cancel(){i&&(clearTimeout(i),i=null)}}}(t=>{s.style.height=`${t}px`,null==o||o("rai-height-change",{height:t})},t.heightDebounce??100),c=async i=>{var c;if(i.origin!==t.widgetDomain)return;if(!i.data||"string"!=typeof i.data.type)return;const{type:p,containerId:d,widgetId:u,payload:f}=i.data;switch(p){case"RETURNINGAI_WIDGET_REQUEST_TOKEN":try{const i=await async function(t,e,i){if(e.accessToken&&!Wt(e.accessTokenExpiry))return e.accessToken;if(t.authUrl){if(await Ht(t,e,i)&&e.accessToken)return e.accessToken;throw new Error("Unable to obtain valid token")}if(await $t(t,e,i)&&e.accessToken)return e.accessToken;if(await Vt(t,e,i)&&e.accessToken)return e.accessToken;throw new Error("Unable to obtain valid token")}(t,e,r);null==(c=s.contentWindow)||c.postMessage({type:"RETURNINGAI_WIDGET_TOKEN",value:{token:i,widgetId:t.widgetId,...void 0!==t.customData&&{customData:t.customData}}},t.widgetDomain)}catch{}break;case"WIDGET_HEIGHT_UPDATE":{const t=Number(null==f?void 0:f.height);Number.isFinite(t)&&t>0&&l.call(t);break}case"WIDGET_READY":if(void 0!==u&&u!==t.widgetId)break;if(void 0!==d&&d!==t.container)break;s.classList.add("loaded"),a&&a(),null==o||o("rai-ready");break;case"WIDGET_ERROR":a&&a();break;case"WIDGET_LOGOUT":n&&await n();break;case"RETURNINGAI_WIDGET_ACTION":{if(i.source!==s.contentWindow)break;const e=i.data;if(void 0!==e.widgetId&&e.widgetId!==t.widgetId)break;if(void 0!==e.containerId&&e.containerId!==t.container)break;const r=we(e.payload,ve(t)),n=Te(e.callbackName,r);if(!n)break;if(!function(t,e,i,s){return("widget:host-callback"===e||t.legacyActions.includes(e))&&i===t.sourceWidgetType&&t.allowedHostWidgetTypes.includes(s)}(n,e.action,e.widgetType,t.widgetType))break;const a=e=>{var i;null==(i=s.contentWindow)||i.postMessage(e,t.widgetDomain)},o=xe({callbacks:(null==h?void 0:h())??{},callbackName:e.callbackName,payload:r,hostWidgetType:t.widgetType,invocationId:e.requestId,transport:"iframe"});if(!o)break;try{const t=await o;a({type:"RETURNINGAI_WIDGET_ACTION_RESULT",requestId:e.requestId,action:"widget:host-callback"===e.action?"widget:host-callback":"store:host-callback",ok:!0,status:"success",..."result"===n.completionMode&&void 0!==t?{value:t}:{}})}catch(m){a({type:"RETURNINGAI_WIDGET_ACTION_RESULT",requestId:e.requestId,action:"widget:host-callback"===e.action?"widget:host-callback":"store:host-callback",ok:!1,status:"failed",error:{message:m instanceof Error&&"Host callback is not registered"===m.message?m.message:"Host callback failed"}})}break}}};return window.addEventListener("message",c),()=>{window.removeEventListener("message",c),l.cancel()}}const Le=new Set(["community-id","channel-id","widget-id","widget-type","theme","container","width","height","api-url","widget-url","auto-refresh","debug","storage-prefix","max-retries","retry-delay","height-debounce","language","locale","custom-data","retry-label","auth-url","bundle-url","embed-token","v2-api-url","domain-key","loading-text","bg","text","accent","font"]);const Fe={store:"RaiStoreWidget",channel:"RaiChannelWidget",social:"RaiSocialWidget",milestone:"RaiMilestoneWidget","currency-view":"RaiCurrencyWidget","referral-conditions":"RaiReferralWidget",custom:"RaiCustomWidget"},Re={"RAI-STORE-WIDGET":"store","RAI-CHANNEL-WIDGET":"channel","RAI-MILESTONE-WIDGET":"milestone","RAI-SOCIAL-WIDGET":"social","RAI-CURRENCY-WIDGET":"currency-view","RAI-REFERRAL-WIDGET":"referral-conditions","RAI-CUSTOM-WIDGET":"custom","RAI-WIDGET":"store"},Ne={SGTR:"https://sgtr-eks-widgets.genesiv.org",STG:"https://staging-widgets.genesiv.org",PROD:"https://prod-widgets.returning.ai",GEN:"https://prod-widgets.returning.ai",LOCAL:"http://localhost:1333"},Oe={SGTR:"https://api-v2.genesiv.org",STG:"https://staging-api-v2.genesiv.org",PROD:"https://api-v2.returning.ai",GEN:"https://api-v2.returning.ai",LOCAL:"http://localhost:1335"};function ze(t){if(t)try{const e=new URL(t).hostname.toLowerCase();if("localhost"===e||"127.0.0.1"===e)return"LOCAL";if(e.includes("sgtr"))return"SGTR";if(e.includes("staging"))return"STG";if("genesiv.org"===e||e.endsWith(".genesiv.org"))return"SGTR";if(e.includes("returning.ai")||e.includes("returningai.com")||e.includes("genesiv.com"))return"PROD"}catch{return}}function Ue(t){return Ne[t]||Ne.PROD}const We=new Set,je=new Set(["aeonik","courier","courier new","monaco","monospace","sans-serif","serif","system-ui"]),Be=new Set(["lora","playfair display","prata"]);function Ve(t){return"Noto"===t.trim()?"Noto Sans":t.trim()}function He(t){const e=Ve(t),i=e.toLowerCase();switch(i){case"monospace":return"monospace";case"courier":case"courier new":return'"Courier New", Courier, monospace';case"monaco":return"Monaco, Menlo, Consolas, monospace";case"system-ui":return"system-ui, -apple-system, sans-serif";case"sans-serif":case"serif":return i;default:return`'${e.replace(/[\\']/g,"\\\\$&")}', ${Be.has(i)?"Georgia, 'Times New Roman', serif":"system-ui, -apple-system, sans-serif"}`}}function $e(t){const e=Ve(t),i=e.toLowerCase();if(!e||je.has(i))return;if(We.has(i))return;!function(){if(!document.getElementById("rai-fonts-preconnect")){const t=document.createElement("link");t.id="rai-fonts-preconnect",t.rel="preconnect",t.href="https://fonts.googleapis.com",document.head.appendChild(t)}if(!document.getElementById("rai-fonts-static-preconnect")){const t=document.createElement("link");t.id="rai-fonts-static-preconnect",t.rel="preconnect",t.href="https://fonts.gstatic.com",t.crossOrigin="anonymous",document.head.appendChild(t)}}();const s=`rai-font-${e.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`,r=`https://fonts.googleapis.com/css2?family=${encodeURIComponent(e)}:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,700&display=swap`;let n=document.getElementById(s);n&&n.href!==r&&(n.remove(),n=null),n||(n=document.createElement("link"),n.id=s,n.rel="stylesheet",n.href=r,document.head.appendChild(n)),We.add(i),n.onerror=()=>{We.delete(i),null==n||n.remove()}}const qe=["script","iframe","object","embed"],Ge=["src","href","xlink:href"];function Ye(t,e){const i=e=>t.getAttribute(e)??t.getAttribute(`data-${e}`)??"",s=(t,e)=>{const s=parseInt(i(t),10);return Number.isFinite(s)&&s>=0?s:e},r=!!i("community-id"),n=i("community-id")||i("widget-id")||e||"";if(n&&!/^[a-zA-Z0-9_\-=]{8,}$/.test(n))throw new Error(`[rai-widget] Invalid community-id: "${n}"`);const a=i("channel-id")||void 0;if(a&&!/^[a-zA-Z0-9_\-=]{8,}$/.test(a))throw new Error(`[rai-widget] Invalid channel-id: "${a}"`);const o=i("widget-type")||Re[t.tagName]||"store";let h;h=r?"store"===o?n:"channel"===o?a?btoa(a):n:n?btoa(n):n:n;let l,c=i("widget-url")||"https://widget.returningai.com";c.endsWith("store-widget")&&(c=`${c}/${n}/open-widget`);try{l=new URL(c).origin}catch{l=c}if(c.includes("store-widget")){const t=new URL(c);t.searchParams.set("color",i("theme")||"light"),c=t.toString()}const p=i("api-url")||void 0,d=i("v2-api-url")||void 0,u=function(t){const e=null==t?void 0:t.trim().toUpperCase();if(e)return"GEN"===e||"PRODUCTION"===e?"PROD":"PRE-STAGING"===e||"PRESTAGING"===e?"SGTR":"STAGING"===e?"STG":"LOCALHOST"===e?"LOCAL":e in Ne?e:void 0}(i("domain-key"))||ze(p)||ze(d)||"PROD",f=i("container")||i("data-container")||`returning-ai-widget-${h}`,m={};Array.from(t.attributes).forEach(t=>{const e=t.name.toLowerCase();if(!e.startsWith("data-"))return;const i=e.slice(5);Le.has(i)||(m[e]=t.value)});const g=(()=>{const t=i("custom-data");if(t)try{return JSON.parse(t)}catch{return}})(),y=i("language").trim(),v=i("locale").trim(),b=y||v||void 0,w=function(t){const e=null==t?void 0:t.trim().toLowerCase().replace(/_/g,"-");if(!e||!Ce.test(e))return;const i=e.split("-"),s=i[0];return"zh"===s?i.includes("hant")?"cht":i.includes("hans")?"chs":i.includes("tw")||i.includes("hk")||i.includes("mo")?"cht":i.includes("cn")||i.includes("sg")?"chs":void 0:"vi"===s||"vt"===s?"vt":Se.has(s)?s:void 0}(b);return b&&!w&&function(t){const e=t.trim();if(!e)return;const i=e.toLowerCase();Ee.has(i)||(Ee.add(i),console.warn(`[rai-widget] Unsupported language "${e.slice(0,80)}". Falling back to the browser language. Supported language codes: ${Ae.join(", ")}.`))}(b),{communityId:n,channelId:a,widgetId:h,widgetType:o,theme:i("theme")||"light",themeExplicit:!!i("theme"),container:f,width:i("width")||"100%",height:i("height")||"600px",apiUrl:p||Ue(u),widgetUrl:c,widgetDomain:l,autoRefresh:"false"!==i("auto-refresh"),debug:"true"===i("debug"),storagePrefix:i("storage-prefix")||"returning-ai-widget",userIdentifiers:m,maxRetries:s("max-retries",3),retryDelay:s("retry-delay",500),heightDebounce:s("height-debounce",100),language:w,locale:!y&&v?w:void 0,customData:g,authUrl:i("auth-url")||void 0,bundleUrl:i("bundle-url")||void 0,embedToken:i("embed-token")||void 0,v2ApiUrl:d,domainKey:u,loadingText:i("loading-text")||"Loading ...",firstPaintColors:(()=>{const t=i("bg")||void 0,e=i("text")||void 0,s=i("accent")||void 0;return t||e||s?{bg:t,text:e,accent:s}:void 0})(),firstPaintFont:i("font")||void 0}}function Xe(t){const e=Object.keys(t.userIdentifiers||{}).sort().map(e=>[e,t.userIdentifiers[e]]);return JSON.stringify({embedToken:t.embedToken||"",userIdentifiers:e})}class Ke extends HTMLElement{constructor(){super(),i(this,"shadow"),i(this,"config"),i(this,"state",{accessToken:null,refreshToken:null,tokenFamily:null,accessTokenExpiry:null,refreshTokenExpiry:null,refreshTimer:null,syncTimer:null,iframe:null,isAuthenticated:!1,isRefreshing:!1,refreshPromise:null,errorSettings:null,loadingAnimation:null,loadingSettings:null,themePalette:null,font:null,defaultColorSchema:null,lastAuthError:null,widgetData:null}),i(this,"loaderEl",null),i(this,"loaderHeightRestore",null),i(this,"loaderHeightObserver",null),i(this,"errorEl",null),i(this,"msgEl",null),i(this,"cleanupListener"),i(this,"intersectionObserver"),i(this,"themeObserver"),i(this,"identityAttributeObserver"),i(this,"identitySignature",""),i(this,"hasAttemptedInit",!1),i(this,"initGeneration",0),i(this,"lottieInstances",[]),i(this,"callbackRegistry",new he),i(this,"bannerNode",null),i(this,"releaseAutoThemeDisableLease"),i(this,"bundleUnmount"),this.shadow=this.attachShadow({mode:"closed"})}static get observedAttributes(){return["embed-token","data-embed-token","language","data-language","locale","data-locale"]}registerCallback(t,e){this.callbackRegistry.registerCallback(t,e)}lockCallbacks(){this.callbackRegistry.lock()}connectedCallback(){this.config=Ye(this,void 0),this.identitySignature=Xe(this.config),this.setupIdentityAttributeObserver(),function(t){const e=document;for(const i of t){const t=`rai-widget-preconnect-${i.replace(/[^a-z0-9]+/gi,"-")}`;if(e.getElementById(t))continue;const s=e.createElement("link");s.id=t,s.rel="preconnect",s.href=i,s.crossOrigin="anonymous",e.head.appendChild(s)}}(function(t,e){const i=[t.apiUrl,t.v2ApiUrl,t.authUrl,t.bundleUrl,t.widgetUrl,t.widgetDomain],s=[];for(const r of i)if(r)try{const t=new URL(r,e);"http:"!==t.protocol&&"https:"!==t.protocol||s.includes(t.origin)||s.push(t.origin)}catch{}return s}(this.config,document.baseURI));const t=document.createElement("style");t.textContent=':host{display:block;position:relative;width:100%;height:100%}.rai-loader{position:absolute;top:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;width:100%;height:100%;background:var(--rai-loading-background, var(--background-5, var(--rai-loader-bg, #ffffff)));border-radius:8px;z-index:10;transition:opacity .3s ease-out;font-family:var(--rai-loader-font, "Roboto", system-ui, -apple-system, sans-serif)}.rai-loader.fade-out{opacity:0;pointer-events:none}.rai-loader-pending-settings{visibility:hidden}.rai-loader-text{margin:.5rem 0 0;font-family:var(--rai-loading-text-font, var(--rai-loader-font, "Roboto", system-ui, -apple-system, sans-serif));font-size:var(--rai-loading-text-size, 1.125rem);line-height:1.75rem;font-weight:var(--rai-loading-text-weight, 400);font-style:var(--rai-loading-text-style, normal);text-decoration:var(--rai-loading-text-decoration, none);letter-spacing:normal;color:var(--rai-loading-text-color, var(--accent-1, var(--rai-accent, #000000)));text-align:center}@media (min-width: 768px){.rai-loader-text{font-size:var(--rai-loading-text-size, 1.5rem);line-height:2rem}}.rai-error{display:none;position:absolute;top:0;left:0;width:100%;height:100%;align-items:center;justify-content:center;flex-direction:column;gap:12px;background:var(--rai-error-bg, #1a1a1a);border-radius:8px;padding:24px;box-sizing:border-box;text-align:center;color:var(--rai-error-text, #9ca3af);font-family:system-ui,-apple-system,sans-serif;z-index:10}.rai-error.visible{display:flex}iframe{display:block;border:none;opacity:0;transition:opacity .3s ease-in}iframe.loaded{opacity:1}.rai-lottie-loader{width:100px;height:100px}.rai-lottie-loader svg{width:100%!important;height:100%!important}.rai-lottie-spinner{width:32px;height:32px;margin:34px auto;border:3px solid var(--rai-text4, #6b7280);border-top-color:var(--rai-accent, #000000);border-radius:50%;animation:rai-spin .7s linear infinite}@keyframes rai-spin{to{transform:rotate(360deg)}}.rai-sdk-loader{position:relative;width:75px;height:100px}.rai-sdk-loader__bar{position:absolute;bottom:0;width:10px;height:50%;background:var(--rai-accent, #000000);transform-origin:center bottom;box-shadow:1px 1px #0003}.rai-sdk-loader__bar:nth-child(1){left:0;transform:scaleY(.2);animation:rai-sdk-barUp1 4s infinite}.rai-sdk-loader__bar:nth-child(2){left:15px;transform:scaleY(.4);animation:rai-sdk-barUp2 4s infinite}.rai-sdk-loader__bar:nth-child(3){left:30px;transform:scaleY(.6);animation:rai-sdk-barUp3 4s infinite}.rai-sdk-loader__bar:nth-child(4){left:45px;transform:scaleY(.8);animation:rai-sdk-barUp4 4s infinite}.rai-sdk-loader__bar:nth-child(5){left:60px;transform:scale(1);animation:rai-sdk-barUp5 4s infinite}.rai-sdk-loader__ball{position:absolute;bottom:10px;left:0;width:10px;height:10px;background:var(--rai-accent, #000000);border-radius:50%;animation:rai-sdk-ball 4s infinite}@keyframes rai-sdk-ball{0%{transform:translate(0)}5%{transform:translate(8px,-14px)}10%{transform:translate(15px,-10px)}17%{transform:translate(23px,-24px)}20%{transform:translate(30px,-20px)}27%{transform:translate(38px,-34px)}30%{transform:translate(45px,-30px)}37%{transform:translate(53px,-44px)}40%{transform:translate(60px,-40px)}50%{transform:translate(60px)}57%{transform:translate(53px,-14px)}60%{transform:translate(45px,-10px)}67%{transform:translate(37px,-24px)}70%{transform:translate(30px,-20px)}77%{transform:translate(22px,-34px)}80%{transform:translate(15px,-30px)}87%{transform:translate(7px,-44px)}90%{transform:translateY(-40px)}to{transform:translate(0)}}@keyframes rai-sdk-barUp1{0%{transform:scaleY(.2)}40%{transform:scaleY(.2)}50%{transform:scale(1)}90%{transform:scale(1)}to{transform:scaleY(.2)}}@keyframes rai-sdk-barUp2{0%{transform:scaleY(.4)}40%{transform:scaleY(.4)}50%{transform:scaleY(.8)}90%{transform:scaleY(.8)}to{transform:scaleY(.4)}}@keyframes rai-sdk-barUp3{0%{transform:scaleY(.6)}to{transform:scaleY(.6)}}@keyframes rai-sdk-barUp4{0%{transform:scaleY(.8)}40%{transform:scaleY(.8)}50%{transform:scaleY(.4)}90%{transform:scaleY(.4)}to{transform:scaleY(.8)}}@keyframes rai-sdk-barUp5{0%{transform:scale(1)}40%{transform:scale(1)}50%{transform:scaleY(.2)}90%{transform:scaleY(.2)}to{transform:scale(1)}}#loading-square{width:75px;aspect-ratio:1;display:flex;color:var(--rai-accent, #000000);background:linear-gradient(currentColor 0 0) right / 51% 100%,linear-gradient(currentColor 0 0) bottom / 100% 51%;background-repeat:no-repeat;animation:l16-0 2s infinite linear .25s}#loading-square>div{width:50%;height:50%;background:currentColor;animation:l16-1 .5s infinite linear}@keyframes l16-0{0%,12.49%{transform:rotate(0)}12.5%,37.49%{transform:rotate(90deg)}37.5%,62.49%{transform:rotate(180deg)}62.5%,87.49%{transform:rotate(270deg)}87.5%,to{transform:rotate(360deg)}}@keyframes l16-1{0%{transform:perspective(80px) rotate3d(-1,-1,0,0)}80%,to{transform:perspective(80px) rotate3d(-1,-1,0,-180deg)}}#loading-circle{width:75px;aspect-ratio:1;display:grid;grid:50%/50%;color:var(--rai-accent, #000000);border-radius:50%;--_g: no-repeat linear-gradient(currentColor 0 0);background:var(--_g),var(--_g),var(--_g);background-size:50.1% 50.1%;animation:l9-0 1.5s infinite steps(1) alternate,l9-0-0 3s infinite steps(1) alternate}#loading-circle>div{background:var(--rai-text4, #6b7280);border-top-left-radius:100px;transform:perspective(150px) rotateY(0) rotateX(0);transform-origin:bottom right;animation:l9-1 1.5s infinite linear alternate}@keyframes l9-0{0%{background-position:0 100%,100% 100%,100% 0}33%{background-position:100% 100%,100% 100%,100% 0}66%{background-position:100% 0,100% 0,100% 0}}@keyframes l9-0-0{0%{transform:scaleX(1) rotate(0)}50%{transform:scaleX(-1) rotate(-90deg)}}@keyframes l9-1{16.5%{transform:perspective(150px) rotateX(-90deg) rotateY(0) rotateX(0);filter:grayscale(.8)}33%{transform:perspective(150px) rotateX(-180deg) rotateY(0) rotateX(0)}66%{transform:perspective(150px) rotateX(-180deg) rotateY(-180deg) rotateX(0)}to{transform:perspective(150px) rotateX(-180deg) rotateY(-180deg) rotateX(-180deg);filter:grayscale(.8)}}.rai-custom-error{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10}.tiptap strong.tw-font-bold,.tiptap b.tw-font-bold{font-weight:700}.tiptap em.tw-font-italic,.tiptap i.tw-font-italic{font-style:italic}.tiptap a.tiptap-rich-text-link{color:#3b82f6;text-decoration:underline;position:relative;display:inline-block;width:fit-content}.tiptap a.tiptap-rich-text-link:hover{color:#3b82f6cc;text-decoration:none}.tiptap a.tiptap-rich-text-link:not([title=""]):before{content:attr(title);position:absolute;top:-2rem;left:50%;transform:translate(-50%);white-space:nowrap;border-radius:.25rem;background-color:#000;padding:.25rem .5rem;color:#fff;opacity:0;transition:opacity .2s;pointer-events:none}.tiptap a.tiptap-rich-text-link:not([title=""]):hover:before{opacity:1}.tiptap p[style*="text-align: left"]{text-align:left}.tiptap p[style*="text-align: center"]{text-align:center}.tiptap p[style*="text-align: right"]{text-align:right}.tiptap p[style*="text-align: justify"]{text-align:justify}.tiptap u{text-decoration:underline}.tiptap.ProseMirror{background-color:transparent;height:fit-content!important;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;-webkit-font-variant-ligatures:none;font-variant-ligatures:none;font-feature-settings:"liga" 0;padding:0;width:100%;overflow-y:auto}.tiptap{line-height:1.6;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif}.tiptap p{margin:.5em 0}.tiptap p:first-child{margin-top:0}.tiptap p:last-child{margin-bottom:0}.tiptap img{max-width:100%;height:auto;display:block}.tiptap p[style*="text-align: left"] img{margin-left:0;margin-right:auto}.tiptap p[style*="text-align: center"] img{margin-left:auto;margin-right:auto}.tiptap p[style*="text-align: right"] img{margin-left:auto;margin-right:0}.rai-retry-btn{padding:8px 20px;border:none;border-radius:6px;background:var(--rai-accent, #000000);color:var(--rai-error-bg, #ffffff);font-size:14px;font-family:system-ui,-apple-system,sans-serif;cursor:pointer}.rai-retry-btn:hover{opacity:.85}',this.shadow.appendChild(t);const e=this.config.theme,i="dark"===e?"#ffffff":"#000000",s="dark"===e?"#9ca3af":"#6b7280",r="dark"===e?"#1a1a1a":"#ffffff";this.style.width=this.config.width,this.style.height=this.config.height,this.style.setProperty("--rai-accent",i),this.style.setProperty("--rai-text4",s),this.style.setProperty("--rai-loader-bg",r),this.style.setProperty("--rai-error-bg",r),this.applyFirstPaintColors(),this.renderShell(),this.hasAttribute("eager")?this.init():(this.intersectionObserver=new IntersectionObserver(t=>{t[0].isIntersecting&&(this.intersectionObserver.disconnect(),this.intersectionObserver=void 0,this.init())}),this.intersectionObserver.observe(this))}disconnectedCallback(){var t,e,i;null==(t=this.intersectionObserver)||t.disconnect(),null==(e=this.themeObserver)||e.disconnect(),null==(i=this.identityAttributeObserver)||i.disconnect(),this.teardownMountedWidget(),this.clearLottieInstances(),this.restoreLoaderHeight(),this.removeBanner(),Xt(this.state)}attributeChangedCallback(t,e,i){e!==i&&("embed-token"!==t&&"data-embed-token"!==t?this.isConnected&&this.config&&(this.hasAttemptedInit?this.reload():this.config=Ye(this,this.config.communityId)):this.handleIdentityConfigChange())}setupIdentityAttributeObserver(){var t;null==(t=this.identityAttributeObserver)||t.disconnect(),this.identityAttributeObserver=new MutationObserver(t=>{t.some(t=>"attributes"===t.type&&!!t.attributeName&&function(t){const e=t.toLowerCase();return!!e.startsWith("data-")&&!Le.has(e.slice(5))}(t.attributeName))&&this.handleIdentityConfigChange()}),this.identityAttributeObserver.observe(this,{attributes:!0})}handleIdentityConfigChange(){if(!this.isConnected||!this.config)return;const t=Ye(this,this.config.communityId),e=Xe(t);if(e===this.identitySignature)return void(this.config=t);const i=this.config;this.config=t,this.identitySignature=e,zt(i),zt(this.config),this.hasAttemptedInit&&this.reload()}emit(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e??{}}))}readRuntimeCallbacks(){return this.callbackRegistry.read()}applyFirstPaintColors(){var t;const e=Ut(this.config);if(e&&Gt(this.state,e),!this.config.themeExplicit){const t=null==e?void 0:e.defaultColorSchema;"light"!==t&&"dark"!==t||(this.config.theme=t)}const i="dark"===this.config.theme?"dark":"light",s=null==(t=null==e?void 0:e.themePalette)?void 0:t[i];s&&this.applyPalette(s);const r=("string"==typeof(null==e?void 0:e.font)?e.font:void 0)||this.config.firstPaintFont;if(r&&this.applyFont(r),this.applyLoadingSettings(),s)return;const n=this.config.firstPaintColors;(null==n?void 0:n.bg)&&this.style.setProperty("--background-5",n.bg),(null==n?void 0:n.text)&&this.style.setProperty("--text-1",n.text),(null==n?void 0:n.accent)&&this.style.setProperty("--accent-1",n.accent)}applyFont(t){const e=Ve(t);this.style.setProperty("--rai-loader-font",He(e)),this.style.setProperty("--font-family",e),$e(e)}applyPalette(t){Object.entries(t).forEach(([t,e])=>{t.startsWith("--")&&e&&this.style.setProperty(t,e)})}applyLoadingSettings(t=this.state.loadingSettings){var e,i;const s=null==t?void 0:t.loadingText,r="dark"===this.config.theme?"dark":"light",n=(null==(e=null==t?void 0:t.backgroundColors)?void 0:e[r])??(null==t?void 0:t.backgroundColor);n&&"var(--background-5)"!==n?this.style.setProperty("--rai-loading-background",n):this.style.removeProperty("--rai-loading-background");const a=null==(i=this.loaderEl)?void 0:i.querySelector(".rai-loader-text");if(!s)return this.style.removeProperty("--rai-loading-text-color"),this.style.removeProperty("--rai-loading-text-font"),this.style.removeProperty("--rai-loading-text-size"),this.style.removeProperty("--rai-loading-text-weight"),this.style.removeProperty("--rai-loading-text-style"),this.style.removeProperty("--rai-loading-text-decoration"),void(a&&(a.textContent=this.config.loadingText,a.hidden=!1));s.color&&this.style.setProperty("--rai-loading-text-color",s.color),s.fontFamily&&(this.style.setProperty("--rai-loading-text-font",He(s.fontFamily)),$e(s.fontFamily)),Number.isFinite(s.fontSizePx)&&s.fontSizePx>0&&this.style.setProperty("--rai-loading-text-size",`${s.fontSizePx}px`),this.style.setProperty("--rai-loading-text-weight",s.bold?"700":"400"),this.style.setProperty("--rai-loading-text-style",s.italic?"italic":"normal"),this.style.setProperty("--rai-loading-text-decoration",s.underline?"underline":"none"),a&&(a.textContent=s.text,a.hidden=!s.enabled)}renderShell(){this.loaderEl=document.createElement("div"),this.loaderEl.className="rai-loader","custom"!==this.config.widgetType||Ut(this.config)||this.loaderEl.classList.add("rai-loader-pending-settings");const t=document.createElement("h1");t.className="rai-loader-text",t.textContent=this.config.loadingText,this.loaderEl.appendChild(t),this.shadow.appendChild(this.loaderEl),this.freezeIframeLoaderHeight(),this.applyLoadingSettings(),this.fetchAndRenderLoader(),this.errorEl=document.createElement("div"),this.errorEl.className="rai-error",this.msgEl=document.createElement("span"),this.msgEl.className="rai-error-msg",this.msgEl.textContent="Authentication failed. Please try again later.",this.errorEl.appendChild(this.msgEl);const e=this.getAttribute("retry-label")||this.getAttribute("data-retry-label")||"Retry",i=document.createElement("button");i.className="rai-retry-btn",i.textContent=e,i.addEventListener("click",()=>this.reload()),this.errorEl.appendChild(i),this.shadow.appendChild(this.errorEl)}async fetchAndRenderLoader(){var t;const e=Ut(this.config);if(e)return Gt(this.state,e),this.applyLoadingSettings(),void this.renderLoaderAnimation();try{await Yt(this.config,this.state)}catch{}const i=this.loaderEl;if(!i)return;this.config.themeExplicit||"light"!==this.state.defaultColorSchema&&"dark"!==this.state.defaultColorSchema||this.state.defaultColorSchema===this.config.theme||(this.config.theme=this.state.defaultColorSchema);const s="dark"===this.config.theme?"dark":"light",r=null==(t=this.state.themePalette)?void 0:t[s];r&&this.applyPalette(r),this.state.font&&this.applyFont(this.state.font),this.applyLoadingSettings(),this.renderLoaderAnimation(),i.classList.remove("rai-loader-pending-settings")}renderLoaderAnimation(){if(!this.loaderEl)return;this.clearLottieInstances();const t=this.loaderEl.querySelector(".rai-loader-anim");t&&t.remove();const e=document.createElement("div");e.className="rai-loader-anim";const i=this.state.loadingAnimation,s="dark"===this.config.theme?"dark":"light";if("custom"===(null==i?void 0:i.type)&&i.custom){const t=i.custom[s]||i.custom.light||i.custom.dark;if(t){if("lottie"===t.type&&t.lottieData)return this.renderLottieInto(e,t.lottieData),void this.loaderEl.insertBefore(e,this.loaderEl.firstChild);if("html"===t.type&&t.html)return e.innerHTML=function(t){const e=document.createElement("template");e.innerHTML=t,e.content.querySelectorAll(qe.join(",")).forEach(t=>t.remove()),e.content.querySelectorAll("*").forEach(t=>{Array.from(t.attributes).forEach(e=>{const i=e.name.toLowerCase();(i.startsWith("on")||Ge.includes(i)&&e.value.trim().toLowerCase().startsWith("javascript:"))&&t.removeAttribute(e.name)})});const i=document.createElement("div");return i.appendChild(e.content.cloneNode(!0)),i.innerHTML}(t.html),void this.loaderEl.insertBefore(e,this.loaderEl.firstChild)}}if("preset"===(null==i?void 0:i.type)&&i.preset)return e.appendChild(this.createPresetLoader(i.preset)),void this.loaderEl.insertBefore(e,this.loaderEl.firstChild);e.appendChild(this.createDefaultLoader()),this.loaderEl.insertBefore(e,this.loaderEl.firstChild)}renderLottieInto(t,e){const i=document.createElement("div");i.className="rai-lottie-loader",t.appendChild(i);const s=o.loadAnimation({container:i,renderer:"svg",loop:!0,autoplay:!0,animationData:e});this.lottieInstances.push(s)}clearLottieInstances(){this.lottieInstances.forEach(t=>t.destroy()),this.lottieInstances=[]}createDefaultLoader(){const t=document.createElement("div");t.className="rai-sdk-loader";for(let i=0;i<5;i++){const e=document.createElement("div");e.className="rai-sdk-loader__bar",t.appendChild(e)}const e=document.createElement("div");return e.className="rai-sdk-loader__ball",t.appendChild(e),t}createPresetLoader(t){if("square"===t){const t=document.createElement("div");t.id="loading-square";const e=document.createElement("div");return t.appendChild(e),t}if("circle"===t){const t=document.createElement("div");t.id="loading-circle";const e=document.createElement("div");return t.appendChild(e),t}return this.createDefaultLoader()}hideLoader(){if(!this.loaderEl)return;const t=this.loaderEl,e=this.lottieInstances;this.lottieInstances=[],t.classList.add("fade-out"),setTimeout(()=>{t.remove(),e.forEach(t=>t.destroy()),this.restoreLoaderHeight()},300),this.loaderEl=null}freezeIframeLoaderHeight(){var t;if(this.config.bundleUrl||this.loaderHeightRestore)return;const e=this.getBoundingClientRect().height,i=this.getClientRects().length>0,s=null!==De(this.style.height),r=function(t,e){const i=De(t);return null===i?0:e*i/100}(this.style.height,window.innerHeight);if(e<=0&&s&&!i)return void this.deferIframeLoaderHeightFreeze();const n=e>0?e:r;!Number.isFinite(n)||n<=0||(null==(t=this.loaderHeightObserver)||t.disconnect(),this.loaderHeightObserver=null,this.loaderHeightRestore={value:this.style.getPropertyValue("height"),priority:this.style.getPropertyPriority("height"),resolvedHeight:n},this.style.setProperty("height",`${n}px`))}deferIframeLoaderHeightFreeze(){this.loaderHeightObserver||"undefined"==typeof ResizeObserver||(this.loaderHeightObserver=new ResizeObserver(()=>{var t,e;if(!this.isConnected||!this.loaderEl||this.config.bundleUrl)return null==(t=this.loaderHeightObserver)||t.disconnect(),void(this.loaderHeightObserver=null);0!==this.getClientRects().length&&(null==(e=this.loaderHeightObserver)||e.disconnect(),this.loaderHeightObserver=null,this.freezeIframeLoaderHeight())}),this.loaderHeightObserver.observe(this))}restoreLoaderHeight(){var t;if(null==(t=this.loaderHeightObserver)||t.disconnect(),this.loaderHeightObserver=null,!this.loaderHeightRestore)return;const{value:e,priority:i,resolvedHeight:s}=this.loaderHeightRestore;this.loaderHeightRestore=null,e?this.style.setProperty("height",e,i):this.style.removeProperty("height");const r=function({originalHeight:t,restoredHeight:e,resolvedHeight:i,isRendered:s}){if(!s||Number.isFinite(e)&&e>0)return null;const r=De(t);return null===r?`${i}px`:`${r}vh`}({originalHeight:e,restoredHeight:this.getBoundingClientRect().height,resolvedHeight:s,isRendered:this.isConnected&&this.getClientRects().length>0});r&&this.style.setProperty("height",r,i)}waitForFirstBundlePaint(t){return new Promise(e=>{let i,s=!1;const r=new MutationObserver(()=>{t.children.length>0&&n()}),n=()=>{s||(s=!0,r.disconnect(),clearTimeout(i),requestAnimationFrame(()=>e()))};r.observe(t,{childList:!0}),i=setTimeout(n,2e3),t.children.length>0&&n()})}showError(){this.hideLoader();const t=this.state.errorSettings,e=this.state.lastAuthError,i="User not found"===(null==e?void 0:e.error)||"Missing required user identifier fields"===(null==e?void 0:e.error)||"Missing user identifier fields"===(null==e?void 0:e.error),s=!!(null==t?void 0:t.errorMessage)&&(i||!e);s?this.renderCustomError(t):this.errorEl&&((null==e?void 0:e.error)&&this.msgEl&&(this.msgEl.textContent=e.hint?`${e.error}: ${e.hint}`:e.error),this.errorEl.classList.add("visible"));const r=s?t.errorMessage:(null==e?void 0:e.error)||"Authentication failed";this.emit("rai-error",{message:r,hint:null==e?void 0:e.hint,status:null==e?void 0:e.status})}renderCustomError(t){var e,i;null==(e=this.errorEl)||e.remove(),this.errorEl=null;const s=(null==(i=t.backgroundImage)?void 0:i.trim())?`background-image: url('${t.backgroundImage}'); background-size: cover; background-position: center; background-repeat: no-repeat;`:"",r=document.createElement("div");r.className="rai-custom-error",r.style.cssText=`\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: auto;\n width: 100%;\n height: 100%;\n ${s}\n `;const n=document.createElement("div");n.className="rai-rich-text",n.style.cssText=`\n min-width: 50%;\n min-height: 50%;\n margin: 0 auto;\n padding: 20px;\n width: auto;\n height: auto;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 6px;\n background-color: ${t.modalColor||"transparent"};\n `;const a=document.createElement("div");a.className="tiptap ProseMirror",a.innerHTML=t.errorMessage||"",n.appendChild(a),r.appendChild(n),this.shadow.appendChild(r)}resolveBannerApiUrl(){if(this.config.v2ApiUrl)return this.config.v2ApiUrl.replace(/\/+$/,"");switch(this.config.domainKey){case"SGTR":return"https://api-v2.genesiv.org";case"STG":return"https://staging-api-v2.genesiv.org";case"LOCAL":return"http://localhost:1335";default:return"https://api-v2.returning.ai"}}removeBanner(){var t;(null==(t=this.bannerNode)?void 0:t.parentNode)&&this.bannerNode.parentNode.removeChild(this.bannerNode),this.bannerNode=null}async mountBannerForWidget(){var t,e;try{if(this.bannerNode)return;if("off"===this.getAttribute("banner")||this.hasAttribute("no-banner"))return;const i=this.resolveBannerApiUrl();let s,r;if("custom"===this.config.widgetType){const t=t=>/^[a-f0-9]{24}$/i.test(t);let e="";try{e=atob(this.config.communityId)}catch{e=""}if(t(e)?r=e:t(this.config.communityId)&&(r=this.config.communityId),!r)return}else s=this.config.communityId;const n=function(t,e){const i=`${e}-rai-banner-visitor-${t}`;try{let t=localStorage.getItem(i);return t||(t=Mt(),localStorage.setItem(i,t)),t}catch{return Mt()}}(this.config.communityId||r||"rai",this.config.storagePrefix),a=window.innerWidth,o=a<640?"mobile":a<1024?"tablet":"desktop",h=await async function(t,e){try{const i=await fetch(`${t}/v2/api/banner-sdk/eligible`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await i.json();return s&&s.meta&&"success"===s.meta.status?s.data||{banner:null}:{banner:null,reason:s&&s.detail||"request_failed"}}catch{return{banner:null,reason:"network_error"}}}(i,{communityId:s,surface:"sdk",widgetType:this.config.widgetType,widgetId:r,embedToken:this.config.embedToken,page:{url:window.location.href,hostname:window.location.hostname,path:window.location.pathname},viewport:{width:window.innerWidth,height:window.innerHeight,device:o},identifier:{type:"anonymous_session",value:n}});if(!this.isConnected)return;const l=h.banner;if(!l)return;if("hide"===(null==(t=l.placement)?void 0:t.mobileBehavior)&&"mobile"===o)return;const c=It(l,{onCtaClick:()=>{var t,e,i;Lt(null==(t=l.tracking)?void 0:t.clickUrl),this.emit("rai-banner-click",{bannerId:l.id});const s=null==(e=l.cta)?void 0:e.url;s&&((null==(i=l.cta)?void 0:i.openInNewTab)?window.open(s,"_blank","noopener,noreferrer"):window.location.href=s)},onDismiss:()=>{var t;Lt(null==(t=l.tracking)?void 0:t.dismissUrl),this.emit("rai-banner-dismiss",{bannerId:l.id}),this.removeBanner()}},this);this.bannerNode=c,document.body.appendChild(c),Lt(null==(e=l.tracking)?void 0:e.impressionUrl),this.emit("rai-banner-impression",{bannerId:l.id})}catch{}}async init(){const t=++this.initGeneration;if(this.hasAttemptedInit=!0,!this.config.communityId)return void this.showError();var e,i;this.config.bundleUrl&&(this.prepareBundleRuntimeEnvironment(),e=Fe[this.config.widgetType],i=this.config.bundleUrl,ae(e,i));const s=t=>async function(t,e){if(await t)return e({skipCache:!0}).catch(()=>{}),!0;try{await e()}catch{}return!1}(t,t=>Yt(this.config,this.state,t)),r=()=>{var e;if(!this.isCurrentInit(t))return;null==(e=this.errorEl)||e.classList.remove("visible"),this.shadow.querySelectorAll(".rai-custom-error").forEach(t=>t.remove());let i=!1,s=0;const r=()=>{i||(i=!0,window.clearTimeout(s),this.removeEventListener("rai-mounted",r),this.removeEventListener("rai-ready",r),this.mountBannerForWidget())};this.addEventListener("rai-mounted",r),this.addEventListener("rai-ready",r),s=window.setTimeout(r,2500),this.config.bundleUrl?this.mountWidget(t):this.createIframe()};if(this.config.authUrl){const e=await s(Ht(this.config,this.state,()=>this.scheduleRefresh()));if(!this.isCurrentInit(t))return;return void(e?(this.emit("rai-authenticated"),r()):this.showError())}if(this.config.embedToken){Xt(this.state),zt(this.config);const e=await s(Vt(this.config,this.state,()=>this.scheduleRefresh()));if(!this.isCurrentInit(t))return;return void(e?(this.emit("rai-authenticated"),r()):this.showError())}if(function(t,e){try{let i=localStorage.getItem(Ft(t));const s=!i;if(i||(i=localStorage.getItem(Rt(t))),!i)return!1;const r=JSON.parse(i);return r.refreshToken&&!Wt(r.refreshTokenExpiry)?(e.refreshToken=r.refreshToken,e.tokenFamily=r.tokenFamily,e.refreshTokenExpiry=r.refreshTokenExpiry,s&&(Ot(t,e),localStorage.removeItem(Rt(t))),!0):(zt(t),!1)}catch{return!1}}(this.config,this.state)){const e=await s($t(this.config,this.state,()=>this.scheduleRefresh()));if(!this.isCurrentInit(t))return;return e?(this.state.isAuthenticated=!0,this.emit("rai-authenticated"),void r()):void this.showError()}const n=await s(Vt(this.config,this.state,()=>this.scheduleRefresh()));this.isCurrentInit(t)&&(n?(this.emit("rai-authenticated"),r()):this.showError())}isCurrentInit(t){return this.isConnected&&t===this.initGeneration}teardownMountedWidget(){var t;const e=this.bundleUnmount;this.bundleUnmount=void 0;try{null==e||e()}catch(i){console.error("[rai-widget] Bundle unmount failed:",i)}null==(t=this.releaseAutoThemeDisableLease)||t.call(this),this.releaseAutoThemeDisableLease=void 0,this.cleanupListener&&(this.cleanupListener(),this.cleanupListener=void 0),this.state.syncTimer&&(clearInterval(this.state.syncTimer),this.state.syncTimer=null),this.state.iframe=null,this.shadow.querySelectorAll("iframe").forEach(t=>t.remove()),this.querySelectorAll('[data-rai-widget-root="true"]').forEach(t=>t.remove())}createIframe(){this.teardownMountedWidget();const t=document.createElement("iframe");t.src=this.buildWidgetUrl(this.config),t.allow="clipboard-write",t.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox"),t.frameBorder="0",t.scrolling="no",t.style.width=this.config.width,t.style.height=this.config.height,t.style.border="none",t.style.display="block",t.onload=()=>{Ie(this.config,this.state,t),this.schedulePeriodicSync(t)},t.onerror=()=>{this.showError()},this.state.iframe=t,this.shadow.appendChild(t),this.cleanupListener=Me(this.config,this.state,this.shadow,t,()=>this.scheduleRefresh(),()=>this.logoutAndClear(),()=>this.hideLoader(),(t,e)=>this.emit(t,e),()=>this.readRuntimeCallbacks())}prepareBundleRuntimeEnvironment(){const t=this.config.v2ApiUrl||(e=this.config.domainKey,Oe[e]||Oe.PROD);var e;const i=window;i.DomainKey||(i.DomainKey=function(t){return"PROD"===t?"GEN":t}(this.config.domainKey)),i.api_url||(i.api_url=t),i.__IS_WIDGET__=!0;const s="dark"===this.config.theme?"dark":"light",r="dark"===s?"dark-knight":"white-smoke";return document.documentElement.setAttribute("data-theme",r),i.currentTheme=s,i.__FORCE_COLOR_MODE__=s,i.__WIDGET_STORAGE_KEY__=`color-schema-${this.config.widgetType}-${this.config.widgetId}`,{bundleApiUrl:t,colorMode:s}}async mountWidget(t){var e;let i,s=null;try{this.teardownMountedWidget();const e="auto"===this.config.height.trim().toLowerCase();"custom"===this.config.widgetType&&(this.releaseAutoThemeDisableLease=function(t=window){let e=t[Kt];e||(e={count:0,previousValue:t[Jt]},t[Kt]=e),e.count+=1,t[Jt]=!0;let i=!1;return()=>{i||(i=!0,e.count=Math.max(0,e.count-1),e.count>0||(void 0===e.previousValue?delete t[Jt]:t[Jt]=e.previousValue,delete t[Kt]))}}());const{bundleApiUrl:r,colorMode:n}=this.prepareBundleRuntimeEnvironment();oe(this.config,this.state);const a=Fe[this.config.widgetType],o=await function(t,e){return ne(t,e)}(a,this.config.bundleUrl);if(!this.isCurrentInit(t))return;s=document.createElement("div");const h="custom"===this.config.widgetType;if(s.className="rai-widget-root",s.setAttribute("data-rai-widget-root","true"),s.__raiWidgetRuntime={colorMode:n,loadingAnimation:this.state.loadingAnimation,loadingSettings:this.state.loadingSettings},s.style.cssText=["position: relative","width: 100%","height: "+(e?"auto":"100%"),"color: var(--text-1)","background: transparent","font-family: var(--rai-loader-font, 'Roboto', system-ui, -apple-system, sans-serif)","visibility: "+(h?"hidden":"visible")].join("; "),this.appendChild(s),!this.shadow.querySelector("slot")){const t=document.createElement("slot");this.shadow.appendChild(t)}const l=this.waitForFirstBundlePaint(s),c=o.mount(s,{widgetType:this.config.widgetType,communityId:this.config.communityId,channelId:this.config.channelId,widgetId:this.config.communityId,apiUrl:r,token:this.state.accessToken,basePath:"/",isPreview:!1,isOpenWidget:!this.state.accessToken,defaultColorSchema:"custom"!==this.config.widgetType||this.config.themeExplicit?n:null,language:this.config.language,colorMode:n,loadingAnimation:this.state.loadingAnimation,loadingSettings:this.state.loadingSettings,widgetData:"custom"===this.config.widgetType&&this.state.widgetData||void 0,autoHeight:e,requestHostCallback:(t,e)=>xe({callbacks:this.readRuntimeCallbacks(),callbackName:t,payload:we(e,ve(this.config)),hostWidgetType:this.config.widgetType,transport:"bundle"})}),p=await te(c);if(i=function(t){if("object"!=typeof t||null===t||!("unmount"in t))return;const e=t.unmount;if("function"!=typeof e)return;let i=!1;return()=>{i||(i=!0,e.call(t))}}(p),!this.isCurrentInit(t)||!s.isConnected)return null==i||i(),void s.remove();if(this.bundleUnmount=i,await ee(p,l),!this.isCurrentInit(t)||!s.isConnected)return null==i||i(),this.bundleUnmount===i&&(this.bundleUnmount=void 0),void s.remove();h&&(s.style.visibility="visible"),this.hideLoader(),this.emit("rai-mounted")}catch(r){if(null==i||i(),this.bundleUnmount===i&&(this.bundleUnmount=void 0),!this.isCurrentInit(t))return void(null==s||s.remove());console.error("[rai-widget] Bundle mount failed:",r),null==s||s.remove(),null==(e=this.releaseAutoThemeDisableLease)||e.call(this),this.releaseAutoThemeDisableLease=void 0,this.showError()}}scheduleRefresh(){if(this.state.refreshTimer&&clearTimeout(this.state.refreshTimer),!this.state.accessTokenExpiry)return;const t=this.state.accessTokenExpiry-Date.now()-6e4,e=()=>{this.state.iframe&&Ie(this.config,this.state,this.state.iframe),oe(this.config,this.state)},i=async()=>{if(this.config.authUrl){await Ht(this.config,this.state,()=>this.scheduleRefresh())&&e()}else await $t(this.config,this.state,()=>this.scheduleRefresh(),e)};t>0?this.state.refreshTimer=setTimeout(i,t):i()}schedulePeriodicSync(t){this.state.syncTimer&&clearInterval(this.state.syncTimer),this.state.syncTimer=setInterval(()=>{this.state.accessToken&&Ie(this.config,this.state,t)},12e4)}async logoutAndClear(){await async function(t,e){if(e.accessToken)try{await fetch(`${t.apiUrl}/${t.widgetId}/auth/logout`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.accessToken}`},body:JSON.stringify({refreshToken:e.refreshToken})})}catch{}Xt(e),zt(t)}(this.config,this.state),this.teardownMountedWidget(),this.removeBanner(),this.emit("rai-logout")}async reload(){var t;const e=this.config;this.config=Ye(this,null==(t=this.config)?void 0:t.communityId),this.identitySignature=Xe(this.config),this.style.width=this.config.width,this.style.height=this.config.height,zt(e),zt(this.config),this.teardownMountedWidget(),this.removeBanner(),Xt(this.state),await this.init()}async logoutPublic(){await this.logoutAndClear()}isAuthenticated(){return this.state.isAuthenticated&&null!==this.state.accessToken}getTokenInfo(){return{hasAccessToken:!!this.state.accessToken,hasRefreshToken:!!this.state.refreshToken,accessTokenExpiry:this.state.accessTokenExpiry?new Date(this.state.accessTokenExpiry):null,refreshTokenExpiry:this.state.refreshTokenExpiry?new Date(this.state.refreshTokenExpiry):null,isAccessTokenValid:!!this.state.accessToken&&!Wt(this.state.accessTokenExpiry),isRefreshTokenValid:!!this.state.refreshToken&&!Wt(this.state.refreshTokenExpiry)}}}class Je extends Ke{buildWidgetUrl(t){const e=new URL(t.widgetUrl);return e.searchParams.set("color",t.theme),e.searchParams.set("containerId",t.container),e.searchParams.set("connectType","simple"),e.searchParams.set("mode","private"),t.language&&e.searchParams.set("language",t.language),t.locale&&e.searchParams.set("locale",t.locale),e.toString()}}class Ze extends Ke{buildWidgetUrl(t){const e=t.widgetUrl.endsWith("channel-widget")?`${t.widgetUrl}/${t.widgetId}`:t.widgetUrl;try{const i=new URL(e);return i.searchParams.set("color",t.theme),t.language&&i.searchParams.set("language",t.language),t.locale&&i.searchParams.set("locale",t.locale),i.toString()}catch{const i=[`color=${t.theme}`];return t.language&&i.push(`language=${encodeURIComponent(t.language)}`),t.locale&&i.push(`locale=${encodeURIComponent(t.locale)}`),`${e}?${i.join("&")}`}}}class Qe extends Ke{buildWidgetUrl(t){const e=t.widgetUrl.endsWith("milestone-widget")?`${t.widgetUrl}/${t.widgetId}`:t.widgetUrl;try{const i=new URL(e);return i.searchParams.set("color",t.theme),t.language&&i.searchParams.set("language",t.language),t.locale&&i.searchParams.set("locale",t.locale),i.toString()}catch{const i=[`color=${t.theme}`];return t.language&&i.push(`language=${encodeURIComponent(t.language)}`),t.locale&&i.push(`locale=${encodeURIComponent(t.locale)}`),`${e}?${i.join("&")}`}}}class ti extends Ke{buildWidgetUrl(t){const e=t.widgetUrl.endsWith("social-widget")?`${t.widgetUrl}/${t.widgetId}`:t.widgetUrl;try{const i=new URL(e);return i.searchParams.set("color",t.theme),t.language&&i.searchParams.set("language",t.language),t.locale&&i.searchParams.set("locale",t.locale),i.toString()}catch{const i=[`color=${t.theme}`];return t.language&&i.push(`language=${encodeURIComponent(t.language)}`),t.locale&&i.push(`locale=${encodeURIComponent(t.locale)}`),`${e}?${i.join("&")}`}}}class ei extends Ke{buildWidgetUrl(t){const e=t.widgetUrl.endsWith("currency-overview-widget")?`${t.widgetUrl}/${t.widgetId}`:t.widgetUrl;try{const i=new URL(e);return i.searchParams.set("color",t.theme),t.language&&i.searchParams.set("language",t.language),t.locale&&i.searchParams.set("locale",t.locale),i.toString()}catch{const i=[`color=${t.theme}`];return t.language&&i.push(`language=${encodeURIComponent(t.language)}`),t.locale&&i.push(`locale=${encodeURIComponent(t.locale)}`),`${e}?${i.join("&")}`}}}class ii extends Ke{buildWidgetUrl(t){const e=t.widgetUrl.endsWith("referral-conditions-widget")?`${t.widgetUrl}/${t.widgetId}`:t.widgetUrl;try{const i=new URL(e);return i.searchParams.set("color",t.theme),t.language&&i.searchParams.set("language",t.language),t.locale&&i.searchParams.set("locale",t.locale),i.toString()}catch{const i=[`color=${t.theme}`];return t.language&&i.push(`language=${encodeURIComponent(t.language)}`),t.locale&&i.push(`locale=${encodeURIComponent(t.locale)}`),`${e}?${i.join("&")}`}}}class si extends Ke{buildWidgetUrl(t){const e=t.widgetUrl.endsWith("custom-widget")?`${t.widgetUrl}/${t.widgetId}`:t.widgetUrl;try{const i=new URL(e);return i.searchParams.set("auth","postmessage"),t.themeExplicit&&i.searchParams.set("color",t.theme),t.language&&i.searchParams.set("language",t.language),t.locale&&i.searchParams.set("locale",t.locale),i.toString()}catch{const i=["auth=postmessage"];return t.themeExplicit&&i.push(`color=${t.theme}`),t.language&&i.push(`language=${encodeURIComponent(t.language)}`),t.locale&&i.push(`locale=${encodeURIComponent(t.locale)}`),i.length>0?`${e}?${i.join("&")}`:e}}}console.log("[rai-widget] v1.8.2");const ri=[["rai-store-widget",Je],["rai-channel-widget",Ze],["rai-milestone-widget",Qe],["rai-social-widget",ti],["rai-currency-widget",ei],["rai-referral-widget",ii],["rai-custom-widget",si],["rai-widget",class extends Je{}]];for(const[li,ci]of ri)customElements.get(li)||customElements.define(li,ci);const ni={store:Je,channel:Ze,milestone:Qe,social:ti,"currency-view":ei,"referral-conditions":ii,custom:si},ai=ri.map(([t])=>t).join(", ");function oi(){var t,e;const i=((null==(t=document.currentScript)?void 0:t.hasAttribute("data-widget-id"))||(null==(e=document.currentScript)?void 0:e.hasAttribute("data-community-id"))?document.currentScript:null)||document.querySelector("script[data-widget-id], script[data-community-id]");if(!i)return;const s=i.getAttribute("data-community-id")||i.getAttribute("data-widget-id");if(!s)return;const r=i.getAttribute("data-container")||`returning-ai-widget-${s}`,n=document.getElementById(r);if(!n)return;"static"===getComputedStyle(n).position&&(n.style.position="relative");const a=i.getAttribute("data-widget-type")??"store",o=new(ni[a]??Je);Array.from(i.attributes).forEach(t=>{o.setAttribute(t.name,t.value)}),n.appendChild(o)}function hi(){const t=(()=>{var t,e;const i=((null==(t=document.currentScript)?void 0:t.hasAttribute("data-widget-id"))||(null==(e=document.currentScript)?void 0:e.hasAttribute("data-community-id"))?document.currentScript:null)||document.querySelector("script[data-widget-id], script[data-community-id]");if(!i)return null;const s=i.getAttribute("data-container")||`returning-ai-widget-${i.getAttribute("data-community-id")||i.getAttribute("data-widget-id")}`;return document.getElementById(s)})(),e=null==t?void 0:t.querySelector(ai);window.ReturningAIWidget={version:"1.8.2",reload:()=>(null==e?void 0:e.reload())??Promise.resolve(),logout:()=>(null==e?void 0:e.logoutPublic())??Promise.resolve(),isAuthenticated:()=>(null==e?void 0:e.isAuthenticated())??!1,getTokenInfo:()=>(null==e?void 0:e.getTokenInfo())??{}}}return"loading"===document.readyState?document.addEventListener("DOMContentLoaded",oi):oi(),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",hi):hi(),t.ChannelWidget=Ze,t.CurrencyWidget=ei,t.CustomWidget=si,t.MILESTONE_CTA_CLICK_CALLBACK_NAME=fe,t.MILESTONE_CTA_CLICK_EVENT=me,t.MILESTONE_CTA_CLICK_SCOPE=ue,t.MilestoneWidget=Qe,t.ReferralWidget=ii,t.STORE_CALLBACK_FIELD_OPTIONS_CALLBACK_NAME=ce,t.STORE_CALLBACK_FIELD_OPTIONS_SCOPE=le,t.STORE_CALLBACK_FIELD_OPTIONS_TIMEOUT_MS=15e3,t.STORE_PURCHASE_SUCCESS_CALLBACK_NAME=de,t.STORE_PURCHASE_SUCCESS_SCOPE=pe,t.SocialWidget=ti,t.StoreWidget=Je,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t}({});