lottie.min.js 415 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047
  1. "undefined" != typeof navigator && function(t, e) {
  2. "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).lottie = e()
  3. }(this, (function() {
  4. "use strict";
  5. var svgNS = "http://www.w3.org/2000/svg",
  6. locationHref = "",
  7. _useWebWorker = !1,
  8. initialDefaultFrame = -999999,
  9. setWebWorker = function(t) {
  10. _useWebWorker = !!t
  11. },
  12. getWebWorker = function() {
  13. return _useWebWorker
  14. },
  15. setLocationHref = function(t) {
  16. locationHref = t
  17. },
  18. getLocationHref = function() {
  19. return locationHref
  20. };
  21. function createTag(t) {
  22. return document.createElement(t)
  23. }
  24. function extendPrototype(t, e) {
  25. var r, i, s = t.length;
  26. for (r = 0; r < s; r += 1)
  27. for (var a in i = t[r].prototype) Object.prototype.hasOwnProperty.call(i, a) && (e.prototype[a] = i[a])
  28. }
  29. function getDescriptor(t, e) {
  30. return Object.getOwnPropertyDescriptor(t, e)
  31. }
  32. function createProxyFunction(t) {
  33. function e() {}
  34. return e.prototype = t, e
  35. }
  36. var audioControllerFactory = function() {
  37. function t(t) {
  38. this.audios = [], this.audioFactory = t, this._volume = 1, this._isMuted = !1
  39. }
  40. return t.prototype = {
  41. addAudio: function(t) {
  42. this.audios.push(t)
  43. },
  44. pause: function() {
  45. var t, e = this.audios.length;
  46. for (t = 0; t < e; t += 1) this.audios[t].pause()
  47. },
  48. resume: function() {
  49. var t, e = this.audios.length;
  50. for (t = 0; t < e; t += 1) this.audios[t].resume()
  51. },
  52. setRate: function(t) {
  53. var e, r = this.audios.length;
  54. for (e = 0; e < r; e += 1) this.audios[e].setRate(t)
  55. },
  56. createAudio: function(t) {
  57. return this.audioFactory ? this.audioFactory(t) : window.Howl ? new window.Howl({
  58. src: [t]
  59. }) : {
  60. isPlaying: !1,
  61. play: function() {
  62. this.isPlaying = !0
  63. },
  64. seek: function() {
  65. this.isPlaying = !1
  66. },
  67. playing: function() {},
  68. rate: function() {},
  69. setVolume: function() {}
  70. }
  71. },
  72. setAudioFactory: function(t) {
  73. this.audioFactory = t
  74. },
  75. setVolume: function(t) {
  76. this._volume = t, this._updateVolume()
  77. },
  78. mute: function() {
  79. this._isMuted = !0, this._updateVolume()
  80. },
  81. unmute: function() {
  82. this._isMuted = !1, this._updateVolume()
  83. },
  84. getVolume: function() {
  85. return this._volume
  86. },
  87. _updateVolume: function() {
  88. var t, e = this.audios.length;
  89. for (t = 0; t < e; t += 1) this.audios[t].volume(this._volume * (this._isMuted ? 0 : 1))
  90. }
  91. },
  92. function() {
  93. return new t
  94. }
  95. }(),
  96. createTypedArray = function() {
  97. function t(t, e) {
  98. var r, i = 0,
  99. s = [];
  100. switch (t) {
  101. case "int16":
  102. case "uint8c":
  103. r = 1;
  104. break;
  105. default:
  106. r = 1.1
  107. }
  108. for (i = 0; i < e; i += 1) s.push(r);
  109. return s
  110. }
  111. return "function" == typeof Uint8ClampedArray && "function" == typeof Float32Array ? function(e, r) {
  112. return "float32" === e ? new Float32Array(r) : "int16" === e ? new Int16Array(r) : "uint8c" === e ? new Uint8ClampedArray(r) : t(e, r)
  113. } : t
  114. }();
  115. function createSizedArray(t) {
  116. return Array.apply(null, {
  117. length: t
  118. })
  119. }
  120. function _typeof$6(t) {
  121. return _typeof$6 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
  122. return typeof t
  123. } : function(t) {
  124. return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
  125. }, _typeof$6(t)
  126. }
  127. var subframeEnabled = !0,
  128. expressionsPlugin = null,
  129. idPrefix$1 = "",
  130. isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent),
  131. _shouldRoundValues = !1,
  132. bmPow = Math.pow,
  133. bmSqrt = Math.sqrt,
  134. bmFloor = Math.floor,
  135. bmMax = Math.max,
  136. bmMin = Math.min,
  137. BMMath = {};
  138. function ProjectInterface$1() {
  139. return {}
  140. }! function() {
  141. var t, e = ["abs", "acos", "acosh", "asin", "asinh", "atan", "atanh", "atan2", "ceil", "cbrt", "expm1", "clz32", "cos", "cosh", "exp", "floor", "fround", "hypot", "imul", "log", "log1p", "log2", "log10", "max", "min", "pow", "random", "round", "sign", "sin", "sinh", "sqrt", "tan", "tanh", "trunc", "E", "LN10", "LN2", "LOG10E", "LOG2E", "PI", "SQRT1_2", "SQRT2"],
  142. r = e.length;
  143. for (t = 0; t < r; t += 1) BMMath[e[t]] = Math[e[t]]
  144. }(), BMMath.random = Math.random, BMMath.abs = function(t) {
  145. if ("object" === _typeof$6(t) && t.length) {
  146. var e, r = createSizedArray(t.length),
  147. i = t.length;
  148. for (e = 0; e < i; e += 1) r[e] = Math.abs(t[e]);
  149. return r
  150. }
  151. return Math.abs(t)
  152. };
  153. var defaultCurveSegments = 150,
  154. degToRads = Math.PI / 180,
  155. roundCorner = .5519;
  156. function roundValues(t) {
  157. _shouldRoundValues = !!t
  158. }
  159. function bmRnd(t) {
  160. return _shouldRoundValues ? Math.round(t) : t
  161. }
  162. function styleDiv(t) {
  163. t.style.position = "absolute", t.style.top = 0, t.style.left = 0, t.style.display = "block", t.style.transformOrigin = "0 0", t.style.webkitTransformOrigin = "0 0", t.style.backfaceVisibility = "visible", t.style.webkitBackfaceVisibility = "visible", t.style.transformStyle = "preserve-3d", t.style.webkitTransformStyle = "preserve-3d", t.style.mozTransformStyle = "preserve-3d"
  164. }
  165. function BMEnterFrameEvent(t, e, r, i) {
  166. this.type = t, this.currentTime = e, this.totalTime = r, this.direction = i < 0 ? -1 : 1
  167. }
  168. function BMCompleteEvent(t, e) {
  169. this.type = t, this.direction = e < 0 ? -1 : 1
  170. }
  171. function BMCompleteLoopEvent(t, e, r, i) {
  172. this.type = t, this.currentLoop = r, this.totalLoops = e, this.direction = i < 0 ? -1 : 1
  173. }
  174. function BMSegmentStartEvent(t, e, r) {
  175. this.type = t, this.firstFrame = e, this.totalFrames = r
  176. }
  177. function BMDestroyEvent(t, e) {
  178. this.type = t, this.target = e
  179. }
  180. function BMRenderFrameErrorEvent(t, e) {
  181. this.type = "renderFrameError", this.nativeError = t, this.currentTime = e
  182. }
  183. function BMConfigErrorEvent(t) {
  184. this.type = "configError", this.nativeError = t
  185. }
  186. function BMAnimationConfigErrorEvent(t, e) {
  187. this.type = t, this.nativeError = e
  188. }
  189. var createElementID = (_count = 0, function() {
  190. return idPrefix$1 + "__lottie_element_" + (_count += 1)
  191. }),
  192. _count;
  193. function HSVtoRGB(t, e, r) {
  194. var i, s, a, n, o, h, l, p;
  195. switch (h = r * (1 - e), l = r * (1 - (o = 6 * t - (n = Math.floor(6 * t))) * e), p = r * (1 - (1 - o) * e), n % 6) {
  196. case 0:
  197. i = r, s = p, a = h;
  198. break;
  199. case 1:
  200. i = l, s = r, a = h;
  201. break;
  202. case 2:
  203. i = h, s = r, a = p;
  204. break;
  205. case 3:
  206. i = h, s = l, a = r;
  207. break;
  208. case 4:
  209. i = p, s = h, a = r;
  210. break;
  211. case 5:
  212. i = r, s = h, a = l
  213. }
  214. return [i, s, a]
  215. }
  216. function RGBtoHSV(t, e, r) {
  217. var i, s = Math.max(t, e, r),
  218. a = Math.min(t, e, r),
  219. n = s - a,
  220. o = 0 === s ? 0 : n / s,
  221. h = s / 255;
  222. switch (s) {
  223. case a:
  224. i = 0;
  225. break;
  226. case t:
  227. i = e - r + n * (e < r ? 6 : 0), i /= 6 * n;
  228. break;
  229. case e:
  230. i = r - t + 2 * n, i /= 6 * n;
  231. break;
  232. case r:
  233. i = t - e + 4 * n, i /= 6 * n
  234. }
  235. return [i, o, h]
  236. }
  237. function addSaturationToRGB(t, e) {
  238. var r = RGBtoHSV(255 * t[0], 255 * t[1], 255 * t[2]);
  239. return r[1] += e, r[1] > 1 ? r[1] = 1 : r[1] <= 0 && (r[1] = 0), HSVtoRGB(r[0], r[1], r[2])
  240. }
  241. function addBrightnessToRGB(t, e) {
  242. var r = RGBtoHSV(255 * t[0], 255 * t[1], 255 * t[2]);
  243. return r[2] += e, r[2] > 1 ? r[2] = 1 : r[2] < 0 && (r[2] = 0), HSVtoRGB(r[0], r[1], r[2])
  244. }
  245. function addHueToRGB(t, e) {
  246. var r = RGBtoHSV(255 * t[0], 255 * t[1], 255 * t[2]);
  247. return r[0] += e / 360, r[0] > 1 ? r[0] -= 1 : r[0] < 0 && (r[0] += 1), HSVtoRGB(r[0], r[1], r[2])
  248. }
  249. var rgbToHex = function() {
  250. var t, e, r = [];
  251. for (t = 0; t < 256; t += 1) e = t.toString(16), r[t] = 1 === e.length ? "0" + e : e;
  252. return function(t, e, i) {
  253. return t < 0 && (t = 0), e < 0 && (e = 0), i < 0 && (i = 0), "#" + r[t] + r[e] + r[i]
  254. }
  255. }(),
  256. setSubframeEnabled = function(t) {
  257. subframeEnabled = !!t
  258. },
  259. getSubframeEnabled = function() {
  260. return subframeEnabled
  261. },
  262. setExpressionsPlugin = function(t) {
  263. expressionsPlugin = t
  264. },
  265. getExpressionsPlugin = function() {
  266. return expressionsPlugin
  267. },
  268. setDefaultCurveSegments = function(t) {
  269. defaultCurveSegments = t
  270. },
  271. getDefaultCurveSegments = function() {
  272. return defaultCurveSegments
  273. },
  274. setIdPrefix = function(t) {
  275. idPrefix$1 = t
  276. },
  277. getIdPrefix = function() {
  278. return idPrefix$1
  279. };
  280. function createNS(t) {
  281. return document.createElementNS(svgNS, t)
  282. }
  283. function _typeof$5(t) {
  284. return _typeof$5 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
  285. return typeof t
  286. } : function(t) {
  287. return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
  288. }, _typeof$5(t)
  289. }
  290. var dataManager = function() {
  291. var t, e, r = 1,
  292. i = [],
  293. s = {
  294. onmessage: function() {},
  295. postMessage: function(e) {
  296. t({
  297. data: e
  298. })
  299. }
  300. },
  301. a = {
  302. postMessage: function(t) {
  303. s.onmessage({
  304. data: t
  305. })
  306. }
  307. };
  308. function n() {
  309. e || (e = function(e) {
  310. if (window.Worker && window.Blob && getWebWorker()) {
  311. var r = new Blob(["var _workerSelf = self; self.onmessage = ", e.toString()], {
  312. type: "text/javascript"
  313. }),
  314. i = URL.createObjectURL(r);
  315. return new Worker(i)
  316. }
  317. return t = e, s
  318. }((function(t) {
  319. if (a.dataManager || (a.dataManager = function() {
  320. function t(s, a) {
  321. var n, o, h, l, p, m, c = s.length;
  322. for (o = 0; o < c; o += 1)
  323. if ("ks" in (n = s[o]) && !n.completed) {
  324. if (n.completed = !0, n.tt && (s[o - 1].td = n.tt), n.hasMask) {
  325. var d = n.masksProperties;
  326. for (l = d.length, h = 0; h < l; h += 1)
  327. if (d[h].pt.k.i) i(d[h].pt.k);
  328. else
  329. for (m = d[h].pt.k.length, p = 0; p < m; p += 1) d[h].pt.k[p].s && i(d[h].pt.k[p].s[0]), d[h].pt.k[p].e && i(d[h].pt.k[p].e[0])
  330. }
  331. 0 === n.ty ? (n.layers = e(n.refId, a), t(n.layers, a)) : 4 === n.ty ? r(n.shapes) : 5 === n.ty && f(n)
  332. }
  333. }
  334. function e(t, e) {
  335. var r = function(t, e) {
  336. for (var r = 0, i = e.length; r < i;) {
  337. if (e[r].id === t) return e[r];
  338. r += 1
  339. }
  340. return null
  341. }(t, e);
  342. return r ? r.layers.__used ? JSON.parse(JSON.stringify(r.layers)) : (r.layers.__used = !0, r.layers) : null
  343. }
  344. function r(t) {
  345. var e, s, a;
  346. for (e = t.length - 1; e >= 0; e -= 1)
  347. if ("sh" === t[e].ty)
  348. if (t[e].ks.k.i) i(t[e].ks.k);
  349. else
  350. for (a = t[e].ks.k.length, s = 0; s < a; s += 1) t[e].ks.k[s].s && i(t[e].ks.k[s].s[0]), t[e].ks.k[s].e && i(t[e].ks.k[s].e[0]);
  351. else "gr" === t[e].ty && r(t[e].it)
  352. }
  353. function i(t) {
  354. var e, r = t.i.length;
  355. for (e = 0; e < r; 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]
  356. }
  357. function s(t, e) {
  358. var r = e ? e.split(".") : [100, 100, 100];
  359. return t[0] > r[0] || !(r[0] > t[0]) && (t[1] > r[1] || !(r[1] > t[1]) && (t[2] > r[2] || !(r[2] > t[2]) && null))
  360. }
  361. var a, n = function() {
  362. var t = [4, 4, 14];
  363. function e(t) {
  364. var e, r, i, s = t.length;
  365. for (e = 0; e < s; e += 1) 5 === t[e].ty && (i = void 0, i = (r = t[e]).t.d, r.t.d = {
  366. k: [{
  367. s: i,
  368. t: 0
  369. }]
  370. })
  371. }
  372. return function(r) {
  373. if (s(t, r.v) && (e(r.layers), r.assets)) {
  374. var i, a = r.assets.length;
  375. for (i = 0; i < a; i += 1) r.assets[i].layers && e(r.assets[i].layers)
  376. }
  377. }
  378. }(),
  379. o = (a = [4, 7, 99], function(t) {
  380. if (t.chars && !s(a, t.v)) {
  381. var e, i = t.chars.length;
  382. for (e = 0; e < i; e += 1) {
  383. var n = t.chars[e];
  384. 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 = {
  385. p: {
  386. k: [0, 0],
  387. a: 0
  388. },
  389. s: {
  390. k: [100, 100],
  391. a: 0
  392. },
  393. a: {
  394. k: [0, 0],
  395. a: 0
  396. },
  397. r: {
  398. k: 0,
  399. a: 0
  400. },
  401. o: {
  402. k: 100,
  403. a: 0
  404. }
  405. }, t.chars[e].t || (n.data.shapes.push({
  406. ty: "no"
  407. }), n.data.shapes[0].it.push({
  408. p: {
  409. k: [0, 0],
  410. a: 0
  411. },
  412. s: {
  413. k: [100, 100],
  414. a: 0
  415. },
  416. a: {
  417. k: [0, 0],
  418. a: 0
  419. },
  420. r: {
  421. k: 0,
  422. a: 0
  423. },
  424. o: {
  425. k: 100,
  426. a: 0
  427. },
  428. sk: {
  429. k: 0,
  430. a: 0
  431. },
  432. sa: {
  433. k: 0,
  434. a: 0
  435. },
  436. ty: "tr"
  437. })))
  438. }
  439. }
  440. }),
  441. h = function() {
  442. var t = [5, 7, 15];
  443. function e(t) {
  444. var e, r, i = t.length;
  445. for (e = 0; e < i; e += 1) 5 === t[e].ty && (r = void 0, "number" == typeof(r = t[e].t.p).a && (r.a = {
  446. a: 0,
  447. k: r.a
  448. }), "number" == typeof r.p && (r.p = {
  449. a: 0,
  450. k: r.p
  451. }), "number" == typeof r.r && (r.r = {
  452. a: 0,
  453. k: r.r
  454. }))
  455. }
  456. return function(r) {
  457. if (s(t, r.v) && (e(r.layers), r.assets)) {
  458. var i, a = r.assets.length;
  459. for (i = 0; i < a; i += 1) r.assets[i].layers && e(r.assets[i].layers)
  460. }
  461. }
  462. }(),
  463. l = function() {
  464. var t = [4, 1, 9];
  465. function e(t) {
  466. var r, i, s, a = t.length;
  467. for (r = 0; r < a; r += 1)
  468. if ("gr" === t[r].ty) e(t[r].it);
  469. else if ("fl" === t[r].ty || "st" === t[r].ty)
  470. if (t[r].c.k && t[r].c.k[0].i)
  471. for (s = t[r].c.k.length, i = 0; i < s; i += 1) t[r].c.k[i].s && (t[r].c.k[i].s[0] /= 255, t[r].c.k[i].s[1] /= 255, t[r].c.k[i].s[2] /= 255, t[r].c.k[i].s[3] /= 255), t[r].c.k[i].e && (t[r].c.k[i].e[0] /= 255, t[r].c.k[i].e[1] /= 255, t[r].c.k[i].e[2] /= 255, t[r].c.k[i].e[3] /= 255);
  472. else t[r].c.k[0] /= 255, t[r].c.k[1] /= 255, t[r].c.k[2] /= 255, t[r].c.k[3] /= 255
  473. }
  474. function r(t) {
  475. var r, i = t.length;
  476. for (r = 0; r < i; r += 1) 4 === t[r].ty && e(t[r].shapes)
  477. }
  478. return function(e) {
  479. if (s(t, e.v) && (r(e.layers), e.assets)) {
  480. var i, a = e.assets.length;
  481. for (i = 0; i < a; i += 1) e.assets[i].layers && r(e.assets[i].layers)
  482. }
  483. }
  484. }(),
  485. p = function() {
  486. var t = [4, 4, 18];
  487. function e(t) {
  488. var r, i, s;
  489. for (r = t.length - 1; r >= 0; r -= 1)
  490. if ("sh" === t[r].ty)
  491. if (t[r].ks.k.i) t[r].ks.k.c = t[r].closed;
  492. else
  493. for (s = t[r].ks.k.length, i = 0; i < s; i += 1) t[r].ks.k[i].s && (t[r].ks.k[i].s[0].c = t[r].closed), t[r].ks.k[i].e && (t[r].ks.k[i].e[0].c = t[r].closed);
  494. else "gr" === t[r].ty && e(t[r].it)
  495. }
  496. function r(t) {
  497. var r, i, s, a, n, o, h = t.length;
  498. for (i = 0; i < h; i += 1) {
  499. if ((r = t[i]).hasMask) {
  500. var l = r.masksProperties;
  501. for (a = l.length, s = 0; s < a; s += 1)
  502. if (l[s].pt.k.i) l[s].pt.k.c = l[s].cl;
  503. else
  504. for (o = l[s].pt.k.length, n = 0; n < o; n += 1) l[s].pt.k[n].s && (l[s].pt.k[n].s[0].c = l[s].cl), l[s].pt.k[n].e && (l[s].pt.k[n].e[0].c = l[s].cl)
  505. }
  506. 4 === r.ty && e(r.shapes)
  507. }
  508. }
  509. return function(e) {
  510. if (s(t, e.v) && (r(e.layers), e.assets)) {
  511. var i, a = e.assets.length;
  512. for (i = 0; i < a; i += 1) e.assets[i].layers && r(e.assets[i].layers)
  513. }
  514. }
  515. }();
  516. function f(t) {
  517. 0 === t.t.a.length && t.t.p
  518. }
  519. var m = {
  520. completeData: function(r) {
  521. r.__complete || (l(r), n(r), o(r), h(r), p(r), t(r.layers, r.assets), function(r, i) {
  522. if (r) {
  523. var s = 0,
  524. a = r.length;
  525. for (s = 0; s < a; s += 1) 1 === r[s].t && (r[s].data.layers = e(r[s].data.refId, i), t(r[s].data.layers, i))
  526. }
  527. }(r.chars, r.assets), r.__complete = !0)
  528. }
  529. };
  530. return m.checkColors = l, m.checkChars = o, m.checkPathProperties = h, m.checkShapes = p, m.completeLayers = t, m
  531. }()), a.assetLoader || (a.assetLoader = function() {
  532. function t(t) {
  533. var e = t.getResponseHeader("content-type");
  534. return e && "json" === t.responseType && -1 !== e.indexOf("json") || t.response && "object" === _typeof$5(t.response) ? t.response : t.response && "string" == typeof t.response ? JSON.parse(t.response) : t.responseText ? JSON.parse(t.responseText) : null
  535. }
  536. return {
  537. load: function(e, r, i, s) {
  538. var a, n = new XMLHttpRequest;
  539. try {
  540. n.responseType = "json"
  541. } catch (t) {}
  542. n.onreadystatechange = function() {
  543. if (4 === n.readyState)
  544. if (200 === n.status) a = t(n), i(a);
  545. else try {
  546. a = t(n), i(a)
  547. } catch (t) {
  548. s && s(t)
  549. }
  550. };
  551. try {
  552. n.open("GET", e, !0)
  553. } catch (t) {
  554. n.open("GET", r + "/" + e, !0)
  555. }
  556. n.send()
  557. }
  558. }
  559. }()), "loadAnimation" === t.data.type) a.assetLoader.load(t.data.path, t.data.fullPath, (function(e) {
  560. a.dataManager.completeData(e), a.postMessage({
  561. id: t.data.id,
  562. payload: e,
  563. status: "success"
  564. })
  565. }), (function() {
  566. a.postMessage({
  567. id: t.data.id,
  568. status: "error"
  569. })
  570. }));
  571. else if ("complete" === t.data.type) {
  572. var e = t.data.animation;
  573. a.dataManager.completeData(e), a.postMessage({
  574. id: t.data.id,
  575. payload: e,
  576. status: "success"
  577. })
  578. } else "loadData" === t.data.type && a.assetLoader.load(t.data.path, t.data.fullPath, (function(e) {
  579. a.postMessage({
  580. id: t.data.id,
  581. payload: e,
  582. status: "success"
  583. })
  584. }), (function() {
  585. a.postMessage({
  586. id: t.data.id,
  587. status: "error"
  588. })
  589. }))
  590. })), e.onmessage = function(t) {
  591. var e = t.data,
  592. r = e.id,
  593. s = i[r];
  594. i[r] = null, "success" === e.status ? s.onComplete(e.payload) : s.onError && s.onError()
  595. })
  596. }
  597. function o(t, e) {
  598. var s = "processId_" + (r += 1);
  599. return i[s] = {
  600. onComplete: t,
  601. onError: e
  602. }, s
  603. }
  604. return {
  605. loadAnimation: function(t, r, i) {
  606. n();
  607. var s = o(r, i);
  608. e.postMessage({
  609. type: "loadAnimation",
  610. path: t,
  611. fullPath: window.location.origin + window.location.pathname,
  612. id: s
  613. })
  614. },
  615. loadData: function(t, r, i) {
  616. n();
  617. var s = o(r, i);
  618. e.postMessage({
  619. type: "loadData",
  620. path: t,
  621. fullPath: window.location.origin + window.location.pathname,
  622. id: s
  623. })
  624. },
  625. completeAnimation: function(t, r, i) {
  626. n();
  627. var s = o(r, i);
  628. e.postMessage({
  629. type: "complete",
  630. animation: t,
  631. id: s
  632. })
  633. }
  634. }
  635. }(),
  636. ImagePreloader = function() {
  637. var t = function() {
  638. var t = createTag("canvas");
  639. t.width = 1, t.height = 1;
  640. var e = t.getContext("2d");
  641. return e.fillStyle = "rgba(0,0,0,0)", e.fillRect(0, 0, 1, 1), t
  642. }();
  643. function e() {
  644. this.loadedAssets += 1, this.loadedAssets === this.totalImages && this.loadedFootagesCount === this.totalFootages && this.imagesLoadedCb && this.imagesLoadedCb(null)
  645. }
  646. function r() {
  647. this.loadedFootagesCount += 1, this.loadedAssets === this.totalImages && this.loadedFootagesCount === this.totalFootages && this.imagesLoadedCb && this.imagesLoadedCb(null)
  648. }
  649. function i(t, e, r) {
  650. var i = "";
  651. if (t.e) i = t.p;
  652. else if (e) {
  653. var s = t.p; - 1 !== s.indexOf("images/") && (s = s.split("/")[1]), i = e + s
  654. } else i = r, i += t.u ? t.u : "", i += t.p;
  655. return i
  656. }
  657. function s(t) {
  658. var e = 0,
  659. r = setInterval(function() {
  660. (t.getBBox().width || e > 500) && (this._imageLoaded(), clearInterval(r)), e += 1
  661. }.bind(this), 50)
  662. }
  663. function a(t) {
  664. var e = {
  665. assetData: t
  666. },
  667. r = i(t, this.assetsPath, this.path);
  668. return dataManager.loadData(r, function(t) {
  669. e.img = t, this._footageLoaded()
  670. }.bind(this), function() {
  671. e.img = {}, this._footageLoaded()
  672. }.bind(this)), e
  673. }
  674. function n() {
  675. this._imageLoaded = e.bind(this), this._footageLoaded = r.bind(this), this.testImageLoaded = s.bind(this), this.createFootageData = a.bind(this), this.assetsPath = "", this.path = "", this.totalImages = 0, this.totalFootages = 0, this.loadedAssets = 0, this.loadedFootagesCount = 0, this.imagesLoadedCb = null, this.images = []
  676. }
  677. return n.prototype = {
  678. loadAssets: function(t, e) {
  679. var r;
  680. this.imagesLoadedCb = e;
  681. var i = t.length;
  682. for (r = 0; r < i; r += 1) t[r].layers || (t[r].t && "seq" !== t[r].t ? 3 === t[r].t && (this.totalFootages += 1, this.images.push(this.createFootageData(t[r]))) : (this.totalImages += 1, this.images.push(this._createImageData(t[r]))))
  683. },
  684. setAssetsPath: function(t) {
  685. this.assetsPath = t || ""
  686. },
  687. setPath: function(t) {
  688. this.path = t || ""
  689. },
  690. loadedImages: function() {
  691. return this.totalImages === this.loadedAssets
  692. },
  693. loadedFootages: function() {
  694. return this.totalFootages === this.loadedFootagesCount
  695. },
  696. destroy: function() {
  697. this.imagesLoadedCb = null, this.images.length = 0
  698. },
  699. getAsset: function(t) {
  700. for (var e = 0, r = this.images.length; e < r;) {
  701. if (this.images[e].assetData === t) return this.images[e].img;
  702. e += 1
  703. }
  704. return null
  705. },
  706. createImgData: function(e) {
  707. var r = i(e, this.assetsPath, this.path),
  708. s = createTag("img");
  709. s.crossOrigin = "anonymous", s.addEventListener("load", this._imageLoaded, !1), s.addEventListener("error", function() {
  710. a.img = t, this._imageLoaded()
  711. }.bind(this), !1), s.src = r;
  712. var a = {
  713. img: s,
  714. assetData: e
  715. };
  716. return a
  717. },
  718. createImageData: function(e) {
  719. var r = i(e, this.assetsPath, this.path),
  720. s = createNS("image");
  721. isSafari ? this.testImageLoaded(s) : s.addEventListener("load", this._imageLoaded, !1), s.addEventListener("error", function() {
  722. a.img = t, this._imageLoaded()
  723. }.bind(this), !1), s.setAttributeNS("http://www.w3.org/1999/xlink", "href", r), this._elementHelper.append ? this._elementHelper.append(s) : this._elementHelper.appendChild(s);
  724. var a = {
  725. img: s,
  726. assetData: e
  727. };
  728. return a
  729. },
  730. imageLoaded: e,
  731. footageLoaded: r,
  732. setCacheType: function(t, e) {
  733. "svg" === t ? (this._elementHelper = e, this._createImageData = this.createImageData.bind(this)) : this._createImageData = this.createImgData.bind(this)
  734. }
  735. }, n
  736. }();
  737. function BaseEvent() {}
  738. BaseEvent.prototype = {
  739. triggerEvent: function(t, e) {
  740. if (this._cbs[t])
  741. for (var r = this._cbs[t], i = 0; i < r.length; i += 1) r[i](e)
  742. },
  743. addEventListener: function(t, e) {
  744. return this._cbs[t] || (this._cbs[t] = []), this._cbs[t].push(e),
  745. function() {
  746. this.removeEventListener(t, e)
  747. }.bind(this)
  748. },
  749. removeEventListener: function(t, e) {
  750. if (e) {
  751. if (this._cbs[t]) {
  752. for (var r = 0, i = this._cbs[t].length; r < i;) this._cbs[t][r] === e && (this._cbs[t].splice(r, 1), r -= 1, i -= 1), r += 1;
  753. this._cbs[t].length || (this._cbs[t] = null)
  754. }
  755. } else this._cbs[t] = null
  756. }
  757. };
  758. var markerParser = function() {
  759. function t(t) {
  760. for (var e, r = t.split("\r\n"), i = {}, s = 0, a = 0; a < r.length; a += 1) 2 === (e = r[a].split(":")).length && (i[e[0]] = e[1].trim(), s += 1);
  761. if (0 === s) throw new Error;
  762. return i
  763. }
  764. return function(e) {
  765. for (var r = [], i = 0; i < e.length; i += 1) {
  766. var s = e[i],
  767. a = {
  768. time: s.tm,
  769. duration: s.dr
  770. };
  771. try {
  772. a.payload = JSON.parse(e[i].cm)
  773. } catch (r) {
  774. try {
  775. a.payload = t(e[i].cm)
  776. } catch (t) {
  777. a.payload = {
  778. name: e[i].cm
  779. }
  780. }
  781. }
  782. r.push(a)
  783. }
  784. return r
  785. }
  786. }(),
  787. ProjectInterface = function() {
  788. function t(t) {
  789. this.compositions.push(t)
  790. }
  791. return function() {
  792. function e(t) {
  793. for (var e = 0, r = this.compositions.length; e < r;) {
  794. 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;
  795. e += 1
  796. }
  797. return null
  798. }
  799. return e.compositions = [], e.currentFrame = 0, e.registerComposition = t, e
  800. }
  801. }(),
  802. renderers = {},
  803. registerRenderer = function(t, e) {
  804. renderers[t] = e
  805. };
  806. function getRenderer(t) {
  807. return renderers[t]
  808. }
  809. function _typeof$4(t) {
  810. return _typeof$4 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
  811. return typeof t
  812. } : function(t) {
  813. return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
  814. }, _typeof$4(t)
  815. }
  816. var AnimationItem = function() {
  817. this._cbs = [], this.name = "", this.path = "", this.isLoaded = !1, this.currentFrame = 0, this.currentRawFrame = 0, this.firstFrame = 0, this.totalFrames = 0, this.frameRate = 0, this.frameMult = 0, this.playSpeed = 1, this.playDirection = 1, this.playCount = 0, this.animationData = {}, this.assets = [], this.isPaused = !0, this.autoplay = !1, this.loop = !0, this.renderer = null, this.animationID = createElementID(), this.assetsPath = "", this.timeCompleted = 0, this.segmentPos = 0, this.isSubframeEnabled = getSubframeEnabled(), this.segments = [], this._idle = !0, this._completedLoop = !1, this.projectInterface = ProjectInterface(), this.imagePreloader = new ImagePreloader, this.audioController = audioControllerFactory(), this.markers = [], this.configAnimation = this.configAnimation.bind(this), this.onSetupError = this.onSetupError.bind(this), this.onSegmentComplete = this.onSegmentComplete.bind(this), this.drawnFrameEvent = new BMEnterFrameEvent("drawnFrame", 0, 0, 0)
  818. };
  819. extendPrototype([BaseEvent], AnimationItem), AnimationItem.prototype.setParams = function(t) {
  820. (t.wrapper || t.container) && (this.wrapper = t.wrapper || t.container);
  821. var e = "svg";
  822. t.animType ? e = t.animType : t.renderer && (e = t.renderer);
  823. var r = getRenderer(e);
  824. this.renderer = new r(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")), dataManager.loadAnimation(t.path, this.configAnimation, this.onSetupError))
  825. }, AnimationItem.prototype.onSetupError = function() {
  826. this.trigger("data_failed")
  827. }, AnimationItem.prototype.setupAnimation = function(t) {
  828. dataManager.completeAnimation(t, this.configAnimation)
  829. }, AnimationItem.prototype.setData = function(t, e) {
  830. e && "object" !== _typeof$4(e) && (e = JSON.parse(e));
  831. var r = {
  832. wrapper: t,
  833. animationData: e
  834. },
  835. i = t.attributes;
  836. r.path = i.getNamedItem("data-animation-path") ? i.getNamedItem("data-animation-path").value : i.getNamedItem("data-bm-path") ? i.getNamedItem("data-bm-path").value : i.getNamedItem("bm-path") ? i.getNamedItem("bm-path").value : "", r.animType = i.getNamedItem("data-anim-type") ? i.getNamedItem("data-anim-type").value : i.getNamedItem("data-bm-type") ? i.getNamedItem("data-bm-type").value : i.getNamedItem("bm-type") ? i.getNamedItem("bm-type").value : i.getNamedItem("data-bm-renderer") ? i.getNamedItem("data-bm-renderer").value : i.getNamedItem("bm-renderer") ? i.getNamedItem("bm-renderer").value : "canvas";
  837. var s = i.getNamedItem("data-anim-loop") ? i.getNamedItem("data-anim-loop").value : i.getNamedItem("data-bm-loop") ? i.getNamedItem("data-bm-loop").value : i.getNamedItem("bm-loop") ? i.getNamedItem("bm-loop").value : "";
  838. "false" === s ? r.loop = !1 : "true" === s ? r.loop = !0 : "" !== s && (r.loop = parseInt(s, 10));
  839. var a = i.getNamedItem("data-anim-autoplay") ? i.getNamedItem("data-anim-autoplay").value : i.getNamedItem("data-bm-autoplay") ? i.getNamedItem("data-bm-autoplay").value : !i.getNamedItem("bm-autoplay") || i.getNamedItem("bm-autoplay").value;
  840. r.autoplay = "false" !== a, r.name = i.getNamedItem("data-name") ? i.getNamedItem("data-name").value : i.getNamedItem("data-bm-name") ? i.getNamedItem("data-bm-name").value : i.getNamedItem("bm-name") ? i.getNamedItem("bm-name").value : "", "false" === (i.getNamedItem("data-anim-prerender") ? i.getNamedItem("data-anim-prerender").value : i.getNamedItem("data-bm-prerender") ? i.getNamedItem("data-bm-prerender").value : i.getNamedItem("bm-prerender") ? i.getNamedItem("bm-prerender").value : "") && (r.prerender = !1), this.setParams(r)
  841. }, AnimationItem.prototype.includeLayers = function(t) {
  842. t.op > this.animationData.op && (this.animationData.op = t.op, this.totalFrames = Math.floor(t.op - this.animationData.ip));
  843. var e, r, i = this.animationData.layers,
  844. s = i.length,
  845. a = t.layers,
  846. n = a.length;
  847. for (r = 0; r < n; r += 1)
  848. for (e = 0; e < s;) {
  849. if (i[e].id === a[r].id) {
  850. i[e] = a[r];
  851. break
  852. }
  853. e += 1
  854. }
  855. 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)
  856. for (s = t.assets.length, e = 0; e < s; e += 1) this.animationData.assets.push(t.assets[e]);
  857. this.animationData.__complete = !1, dataManager.completeAnimation(this.animationData, this.onSegmentComplete)
  858. }, AnimationItem.prototype.onSegmentComplete = function(t) {
  859. this.animationData = t;
  860. var e = getExpressionsPlugin();
  861. e && e.initExpressions(this), this.loadNextSegment()
  862. }, AnimationItem.prototype.loadNextSegment = function() {
  863. var t = this.animationData.segments;
  864. if (!t || 0 === t.length || !this.autoloadSegments) return this.trigger("data_ready"), void(this.timeCompleted = this.totalFrames);
  865. var e = t.shift();
  866. this.timeCompleted = e.time * this.frameRate;
  867. var r = this.path + this.fileName + "_" + this.segmentPos + ".json";
  868. this.segmentPos += 1, dataManager.loadData(r, this.includeLayers.bind(this), function() {
  869. this.trigger("data_failed")
  870. }.bind(this))
  871. }, AnimationItem.prototype.loadSegments = function() {
  872. this.animationData.segments || (this.timeCompleted = this.totalFrames), this.loadNextSegment()
  873. }, AnimationItem.prototype.imagesLoaded = function() {
  874. this.trigger("loaded_images"), this.checkLoaded()
  875. }, AnimationItem.prototype.preloadImages = function() {
  876. this.imagePreloader.setAssetsPath(this.assetsPath), this.imagePreloader.setPath(this.path), this.imagePreloader.loadAssets(this.animationData.assets, this.imagesLoaded.bind(this))
  877. }, AnimationItem.prototype.configAnimation = function(t) {
  878. if (this.renderer) try {
  879. this.animationData = t, this.initialSegment ? (this.totalFrames = Math.floor(this.initialSegment[1] - this.initialSegment[0]), this.firstFrame = Math.round(this.initialSegment[0])) : (this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip), this.firstFrame = Math.round(this.animationData.ip)), this.renderer.configAnimation(t), t.assets || (t.assets = []), this.assets = this.animationData.assets, this.frameRate = this.animationData.fr, this.frameMult = this.animationData.fr / 1e3, this.renderer.searchExtraCompositions(t.assets), this.markers = markerParser(t.markers || []), this.trigger("config_ready"), this.preloadImages(), this.loadSegments(), this.updaFrameModifier(), this.waitForFontsLoaded(), this.isPaused && this.audioController.pause()
  880. } catch (t) {
  881. this.triggerConfigError(t)
  882. }
  883. }, AnimationItem.prototype.waitForFontsLoaded = function() {
  884. this.renderer && (this.renderer.globalData.fontManager.isLoaded ? this.checkLoaded() : setTimeout(this.waitForFontsLoaded.bind(this), 20))
  885. }, AnimationItem.prototype.checkLoaded = function() {
  886. if (!this.isLoaded && this.renderer.globalData.fontManager.isLoaded && (this.imagePreloader.loadedImages() || "canvas" !== this.renderer.rendererType) && this.imagePreloader.loadedFootages()) {
  887. this.isLoaded = !0;
  888. var t = getExpressionsPlugin();
  889. t && t.initExpressions(this), this.renderer.initItems(), setTimeout(function() {
  890. this.trigger("DOMLoaded")
  891. }.bind(this), 0), this.gotoFrame(), this.autoplay && this.play()
  892. }
  893. }, AnimationItem.prototype.resize = function() {
  894. this.renderer.updateContainerSize()
  895. }, AnimationItem.prototype.setSubframe = function(t) {
  896. this.isSubframeEnabled = !!t
  897. }, AnimationItem.prototype.gotoFrame = function() {
  898. 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")
  899. }, AnimationItem.prototype.renderFrame = function() {
  900. if (!1 !== this.isLoaded && this.renderer) try {
  901. this.renderer.renderFrame(this.currentFrame + this.firstFrame)
  902. } catch (t) {
  903. this.triggerRenderFrameError(t)
  904. }
  905. }, AnimationItem.prototype.play = function(t) {
  906. t && this.name !== t || !0 === this.isPaused && (this.isPaused = !1, this.trigger("_pause"), this.audioController.resume(), this._idle && (this._idle = !1, this.trigger("_active")))
  907. }, AnimationItem.prototype.pause = function(t) {
  908. t && this.name !== t || !1 === this.isPaused && (this.isPaused = !0, this.trigger("_play"), this._idle = !0, this.trigger("_idle"), this.audioController.pause())
  909. }, AnimationItem.prototype.togglePause = function(t) {
  910. t && this.name !== t || (!0 === this.isPaused ? this.play() : this.pause())
  911. }, AnimationItem.prototype.stop = function(t) {
  912. t && this.name !== t || (this.pause(), this.playCount = 0, this._completedLoop = !1, this.setCurrentRawFrameValue(0))
  913. }, AnimationItem.prototype.getMarkerData = function(t) {
  914. for (var e, r = 0; r < this.markers.length; r += 1)
  915. if ((e = this.markers[r]).payload && e.payload.name === t) return e;
  916. return null
  917. }, AnimationItem.prototype.goToAndStop = function(t, e, r) {
  918. if (!r || this.name === r) {
  919. var i = Number(t);
  920. if (isNaN(i)) {
  921. var s = this.getMarkerData(t);
  922. s && this.goToAndStop(s.time, !0)
  923. } else e ? this.setCurrentRawFrameValue(t) : this.setCurrentRawFrameValue(t * this.frameModifier);
  924. this.pause()
  925. }
  926. }, AnimationItem.prototype.goToAndPlay = function(t, e, r) {
  927. if (!r || this.name === r) {
  928. var i = Number(t);
  929. if (isNaN(i)) {
  930. var s = this.getMarkerData(t);
  931. s && (s.duration ? this.playSegments([s.time, s.time + s.duration], !0) : this.goToAndStop(s.time, !0))
  932. } else this.goToAndStop(i, e, r);
  933. this.play()
  934. }
  935. }, AnimationItem.prototype.advanceTime = function(t) {
  936. if (!0 !== this.isPaused && !1 !== this.isLoaded) {
  937. var e = this.currentRawFrame + t * this.frameModifier,
  938. r = !1;
  939. 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) || (r = !0, e = this.totalFrames - 1) : e < 0 ? this.checkSegments(e % this.totalFrames) || (!this.loop || this.playCount-- <= 0 && !0 !== this.loop ? (r = !0, e = 0) : (this.setCurrentRawFrameValue(this.totalFrames + e % this.totalFrames), this._completedLoop ? this.trigger("loopComplete") : this._completedLoop = !0)) : this.setCurrentRawFrameValue(e), r && (this.setCurrentRawFrameValue(e), this.pause(), this.trigger("complete"))
  940. }
  941. }, AnimationItem.prototype.adjustSegment = function(t, e) {
  942. 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")
  943. }, AnimationItem.prototype.setSegment = function(t, e) {
  944. var r = -1;
  945. this.isPaused && (this.currentRawFrame + this.firstFrame < t ? r = t : this.currentRawFrame + this.firstFrame > e && (r = e - t)), this.firstFrame = t, this.totalFrames = e - t, this.timeCompleted = this.totalFrames, -1 !== r && this.goToAndStop(r, !0)
  946. }, AnimationItem.prototype.playSegments = function(t, e) {
  947. if (e && (this.segments.length = 0), "object" === _typeof$4(t[0])) {
  948. var r, i = t.length;
  949. for (r = 0; r < i; r += 1) this.segments.push(t[r])
  950. } else this.segments.push(t);
  951. this.segments.length && e && this.adjustSegment(this.segments.shift(), 0), this.isPaused && this.play()
  952. }, AnimationItem.prototype.resetSegments = function(t) {
  953. this.segments.length = 0, this.segments.push([this.animationData.ip, this.animationData.op]), t && this.checkSegments(0)
  954. }, AnimationItem.prototype.checkSegments = function(t) {
  955. return !!this.segments.length && (this.adjustSegment(this.segments.shift(), t), !0)
  956. }, AnimationItem.prototype.destroy = function(t) {
  957. 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.renderer = null, this.imagePreloader = null, this.projectInterface = null)
  958. }, AnimationItem.prototype.setCurrentRawFrameValue = function(t) {
  959. this.currentRawFrame = t, this.gotoFrame()
  960. }, AnimationItem.prototype.setSpeed = function(t) {
  961. this.playSpeed = t, this.updaFrameModifier()
  962. }, AnimationItem.prototype.setDirection = function(t) {
  963. this.playDirection = t < 0 ? -1 : 1, this.updaFrameModifier()
  964. }, AnimationItem.prototype.setVolume = function(t, e) {
  965. e && this.name !== e || this.audioController.setVolume(t)
  966. }, AnimationItem.prototype.getVolume = function() {
  967. return this.audioController.getVolume()
  968. }, AnimationItem.prototype.mute = function(t) {
  969. t && this.name !== t || this.audioController.mute()
  970. }, AnimationItem.prototype.unmute = function(t) {
  971. t && this.name !== t || this.audioController.unmute()
  972. }, AnimationItem.prototype.updaFrameModifier = function() {
  973. this.frameModifier = this.frameMult * this.playSpeed * this.playDirection, this.audioController.setRate(this.playSpeed * this.playDirection)
  974. }, AnimationItem.prototype.getPath = function() {
  975. return this.path
  976. }, AnimationItem.prototype.getAssetsPath = function(t) {
  977. var e = "";
  978. if (t.e) e = t.p;
  979. else if (this.assetsPath) {
  980. var r = t.p; - 1 !== r.indexOf("images/") && (r = r.split("/")[1]), e = this.assetsPath + r
  981. } else e = this.path, e += t.u ? t.u : "", e += t.p;
  982. return e
  983. }, AnimationItem.prototype.getAssetData = function(t) {
  984. for (var e = 0, r = this.assets.length; e < r;) {
  985. if (t === this.assets[e].id) return this.assets[e];
  986. e += 1
  987. }
  988. return null
  989. }, AnimationItem.prototype.hide = function() {
  990. this.renderer.hide()
  991. }, AnimationItem.prototype.show = function() {
  992. this.renderer.show()
  993. }, AnimationItem.prototype.getDuration = function(t) {
  994. return t ? this.totalFrames : this.totalFrames / this.frameRate
  995. }, AnimationItem.prototype.updateDocumentData = function(t, e, r) {
  996. try {
  997. this.renderer.getElementByPath(t).updateDocumentData(e, r)
  998. } catch (t) {}
  999. }, AnimationItem.prototype.trigger = function(t) {
  1000. if (this._cbs && this._cbs[t]) switch (t) {
  1001. case "enterFrame":
  1002. this.triggerEvent(t, new BMEnterFrameEvent(t, this.currentFrame, this.totalFrames, this.frameModifier));
  1003. break;
  1004. case "drawnFrame":
  1005. this.drawnFrameEvent.currentTime = this.currentFrame, this.drawnFrameEvent.totalTime = this.totalFrames, this.drawnFrameEvent.direction = this.frameModifier, this.triggerEvent(t, this.drawnFrameEvent);
  1006. break;
  1007. case "loopComplete":
  1008. this.triggerEvent(t, new BMCompleteLoopEvent(t, this.loop, this.playCount, this.frameMult));
  1009. break;
  1010. case "complete":
  1011. this.triggerEvent(t, new BMCompleteEvent(t, this.frameMult));
  1012. break;
  1013. case "segmentStart":
  1014. this.triggerEvent(t, new BMSegmentStartEvent(t, this.firstFrame, this.totalFrames));
  1015. break;
  1016. case "destroy":
  1017. this.triggerEvent(t, new BMDestroyEvent(t, this));
  1018. break;
  1019. default:
  1020. this.triggerEvent(t)
  1021. }
  1022. "enterFrame" === t && this.onEnterFrame && this.onEnterFrame.call(this, new BMEnterFrameEvent(t, this.currentFrame, this.totalFrames, this.frameMult)), "loopComplete" === t && this.onLoopComplete && this.onLoopComplete.call(this, new BMCompleteLoopEvent(t, this.loop, this.playCount, this.frameMult)), "complete" === t && this.onComplete && this.onComplete.call(this, new BMCompleteEvent(t, this.frameMult)), "segmentStart" === t && this.onSegmentStart && this.onSegmentStart.call(this, new BMSegmentStartEvent(t, this.firstFrame, this.totalFrames)), "destroy" === t && this.onDestroy && this.onDestroy.call(this, new BMDestroyEvent(t, this))
  1023. }, AnimationItem.prototype.triggerRenderFrameError = function(t) {
  1024. var e = new BMRenderFrameErrorEvent(t, this.currentFrame);
  1025. this.triggerEvent("error", e), this.onError && this.onError.call(this, e)
  1026. }, AnimationItem.prototype.triggerConfigError = function(t) {
  1027. var e = new BMConfigErrorEvent(t, this.currentFrame);
  1028. this.triggerEvent("error", e), this.onError && this.onError.call(this, e)
  1029. };
  1030. var animationManager = function() {
  1031. var t = {},
  1032. e = [],
  1033. r = 0,
  1034. i = 0,
  1035. s = 0,
  1036. a = !0,
  1037. n = !1;
  1038. function o(t) {
  1039. for (var r = 0, s = t.target; r < i;) e[r].animation === s && (e.splice(r, 1), r -= 1, i -= 1, s.isPaused || p()), r += 1
  1040. }
  1041. function h(t, r) {
  1042. if (!t) return null;
  1043. for (var s = 0; s < i;) {
  1044. if (e[s].elem === t && null !== e[s].elem) return e[s].animation;
  1045. s += 1
  1046. }
  1047. var a = new AnimationItem;
  1048. return f(a, t), a.setData(t, r), a
  1049. }
  1050. function l() {
  1051. s += 1, d()
  1052. }
  1053. function p() {
  1054. s -= 1
  1055. }
  1056. function f(t, r) {
  1057. t.addEventListener("destroy", o), t.addEventListener("_active", l), t.addEventListener("_idle", p), e.push({
  1058. elem: r,
  1059. animation: t
  1060. }), i += 1
  1061. }
  1062. function m(t) {
  1063. var o, h = t - r;
  1064. for (o = 0; o < i; o += 1) e[o].animation.advanceTime(h);
  1065. r = t, s && !n ? window.requestAnimationFrame(m) : a = !0
  1066. }
  1067. function c(t) {
  1068. r = t, window.requestAnimationFrame(m)
  1069. }
  1070. function d() {
  1071. !n && s && a && (window.requestAnimationFrame(c), a = !1)
  1072. }
  1073. return t.registerAnimation = h, t.loadAnimation = function(t) {
  1074. var e = new AnimationItem;
  1075. return f(e, null), e.setParams(t), e
  1076. }, t.setSpeed = function(t, r) {
  1077. var s;
  1078. for (s = 0; s < i; s += 1) e[s].animation.setSpeed(t, r)
  1079. }, t.setDirection = function(t, r) {
  1080. var s;
  1081. for (s = 0; s < i; s += 1) e[s].animation.setDirection(t, r)
  1082. }, t.play = function(t) {
  1083. var r;
  1084. for (r = 0; r < i; r += 1) e[r].animation.play(t)
  1085. }, t.pause = function(t) {
  1086. var r;
  1087. for (r = 0; r < i; r += 1) e[r].animation.pause(t)
  1088. }, t.stop = function(t) {
  1089. var r;
  1090. for (r = 0; r < i; r += 1) e[r].animation.stop(t)
  1091. }, t.togglePause = function(t) {
  1092. var r;
  1093. for (r = 0; r < i; r += 1) e[r].animation.togglePause(t)
  1094. }, t.searchAnimations = function(t, e, r) {
  1095. var i, s = [].concat([].slice.call(document.getElementsByClassName("lottie")), [].slice.call(document.getElementsByClassName("bodymovin"))),
  1096. a = s.length;
  1097. for (i = 0; i < a; i += 1) r && s[i].setAttribute("data-bm-type", r), h(s[i], t);
  1098. if (e && 0 === a) {
  1099. r || (r = "svg");
  1100. var n = document.getElementsByTagName("body")[0];
  1101. n.innerText = "";
  1102. var o = createTag("div");
  1103. o.style.width = "100%", o.style.height = "100%", o.setAttribute("data-bm-type", r), n.appendChild(o), h(o, t)
  1104. }
  1105. }, t.resize = function() {
  1106. var t;
  1107. for (t = 0; t < i; t += 1) e[t].animation.resize()
  1108. }, t.goToAndStop = function(t, r, s) {
  1109. var a;
  1110. for (a = 0; a < i; a += 1) e[a].animation.goToAndStop(t, r, s)
  1111. }, t.destroy = function(t) {
  1112. var r;
  1113. for (r = i - 1; r >= 0; r -= 1) e[r].animation.destroy(t)
  1114. }, t.freeze = function() {
  1115. n = !0
  1116. }, t.unfreeze = function() {
  1117. n = !1, d()
  1118. }, t.setVolume = function(t, r) {
  1119. var s;
  1120. for (s = 0; s < i; s += 1) e[s].animation.setVolume(t, r)
  1121. }, t.mute = function(t) {
  1122. var r;
  1123. for (r = 0; r < i; r += 1) e[r].animation.mute(t)
  1124. }, t.unmute = function(t) {
  1125. var r;
  1126. for (r = 0; r < i; r += 1) e[r].animation.unmute(t)
  1127. }, t.getRegisteredAnimations = function() {
  1128. var t, r = e.length,
  1129. i = [];
  1130. for (t = 0; t < r; t += 1) i.push(e[t].animation);
  1131. return i
  1132. }, t
  1133. }(),
  1134. BezierFactory = function() {
  1135. var t = {
  1136. getBezierEasing: function(t, r, i, s, a) {
  1137. var n = a || ("bez_" + t + "_" + r + "_" + i + "_" + s).replace(/\./g, "p");
  1138. if (e[n]) return e[n];
  1139. var o = new l([t, r, i, s]);
  1140. return e[n] = o, o
  1141. }
  1142. },
  1143. e = {};
  1144. var r = .1,
  1145. i = "function" == typeof Float32Array;
  1146. function s(t, e) {
  1147. return 1 - 3 * e + 3 * t
  1148. }
  1149. function a(t, e) {
  1150. return 3 * e - 6 * t
  1151. }
  1152. function n(t) {
  1153. return 3 * t
  1154. }
  1155. function o(t, e, r) {
  1156. return ((s(e, r) * t + a(e, r)) * t + n(e)) * t
  1157. }
  1158. function h(t, e, r) {
  1159. return 3 * s(e, r) * t * t + 2 * a(e, r) * t + n(e)
  1160. }
  1161. function l(t) {
  1162. this._p = t, this._mSampleValues = i ? new Float32Array(11) : new Array(11), this._precomputed = !1, this.get = this.get.bind(this)
  1163. }
  1164. return l.prototype = {
  1165. get: function(t) {
  1166. var e = this._p[0],
  1167. r = this._p[1],
  1168. i = this._p[2],
  1169. s = this._p[3];
  1170. return this._precomputed || this._precompute(), e === r && i === s ? t : 0 === t ? 0 : 1 === t ? 1 : o(this._getTForX(t), r, s)
  1171. },
  1172. _precompute: function() {
  1173. var t = this._p[0],
  1174. e = this._p[1],
  1175. r = this._p[2],
  1176. i = this._p[3];
  1177. this._precomputed = !0, t === e && r === i || this._calcSampleValues()
  1178. },
  1179. _calcSampleValues: function() {
  1180. for (var t = this._p[0], e = this._p[2], i = 0; i < 11; ++i) this._mSampleValues[i] = o(i * r, t, e)
  1181. },
  1182. _getTForX: function(t) {
  1183. for (var e = this._p[0], i = this._p[2], s = this._mSampleValues, a = 0, n = 1; 10 !== n && s[n] <= t; ++n) a += r;
  1184. var l = a + (t - s[--n]) / (s[n + 1] - s[n]) * r,
  1185. p = h(l, e, i);
  1186. return p >= .001 ? function(t, e, r, i) {
  1187. for (var s = 0; s < 4; ++s) {
  1188. var a = h(e, r, i);
  1189. if (0 === a) return e;
  1190. e -= (o(e, r, i) - t) / a
  1191. }
  1192. return e
  1193. }(t, l, e, i) : 0 === p ? l : function(t, e, r, i, s) {
  1194. var a, n, h = 0;
  1195. do {
  1196. (a = o(n = e + (r - e) / 2, i, s) - t) > 0 ? r = n : e = n
  1197. } while (Math.abs(a) > 1e-7 && ++h < 10);
  1198. return n
  1199. }(t, a, a + r, e, i)
  1200. }
  1201. }, t
  1202. }(),
  1203. pooling = {
  1204. double: function(t) {
  1205. return t.concat(createSizedArray(t.length))
  1206. }
  1207. },
  1208. poolFactory = function(t, e, r) {
  1209. var i = 0,
  1210. s = t,
  1211. a = createSizedArray(s);
  1212. return {
  1213. newElement: function() {
  1214. return i ? a[i -= 1] : e()
  1215. },
  1216. release: function(t) {
  1217. i === s && (a = pooling.double(a), s *= 2), r && r(t), a[i] = t, i += 1
  1218. }
  1219. }
  1220. },
  1221. bezierLengthPool = poolFactory(8, (function() {
  1222. return {
  1223. addedLength: 0,
  1224. percents: createTypedArray("float32", getDefaultCurveSegments()),
  1225. lengths: createTypedArray("float32", getDefaultCurveSegments())
  1226. }
  1227. })),
  1228. segmentsLengthPool = poolFactory(8, (function() {
  1229. return {
  1230. lengths: [],
  1231. totalLength: 0
  1232. }
  1233. }), (function(t) {
  1234. var e, r = t.lengths.length;
  1235. for (e = 0; e < r; e += 1) bezierLengthPool.release(t.lengths[e]);
  1236. t.lengths.length = 0
  1237. }));
  1238. function bezFunction() {
  1239. var t = Math;
  1240. function e(t, e, r, i, s, a) {
  1241. var n = t * i + e * s + r * a - s * i - a * t - r * e;
  1242. return n > -.001 && n < .001
  1243. }
  1244. var r = function(t, e, r, i) {
  1245. var s, a, n, o, h, l, p = getDefaultCurveSegments(),
  1246. f = 0,
  1247. m = [],
  1248. c = [],
  1249. d = bezierLengthPool.newElement();
  1250. for (n = r.length, s = 0; s < p; s += 1) {
  1251. for (h = s / (p - 1), l = 0, a = 0; a < n; a += 1) o = bmPow(1 - h, 3) * t[a] + 3 * bmPow(1 - h, 2) * h * r[a] + 3 * (1 - h) * bmPow(h, 2) * i[a] + bmPow(h, 3) * e[a], m[a] = o, null !== c[a] && (l += bmPow(m[a] - c[a], 2)), c[a] = m[a];
  1252. l && (f += l = bmSqrt(l)), d.percents[s] = h, d.lengths[s] = f
  1253. }
  1254. return d.addedLength = f, d
  1255. };
  1256. function i(t) {
  1257. this.segmentLength = 0, this.points = new Array(t)
  1258. }
  1259. function s(t, e) {
  1260. this.partialLength = t, this.point = e
  1261. }
  1262. var a, n = (a = {}, function(t, r, n, o) {
  1263. var h = (t[0] + "_" + t[1] + "_" + r[0] + "_" + r[1] + "_" + n[0] + "_" + n[1] + "_" + o[0] + "_" + o[1]).replace(/\./g, "p");
  1264. if (!a[h]) {
  1265. var l, p, f, m, c, d, u, y = getDefaultCurveSegments(),
  1266. g = 0,
  1267. v = null;
  1268. 2 === t.length && (t[0] !== r[0] || t[1] !== r[1]) && e(t[0], t[1], r[0], r[1], t[0] + n[0], t[1] + n[1]) && e(t[0], t[1], r[0], r[1], r[0] + o[0], r[1] + o[1]) && (y = 2);
  1269. var b = new i(y);
  1270. for (f = n.length, l = 0; l < y; l += 1) {
  1271. for (u = createSizedArray(f), c = l / (y - 1), d = 0, p = 0; p < f; p += 1) m = bmPow(1 - c, 3) * t[p] + 3 * bmPow(1 - c, 2) * c * (t[p] + n[p]) + 3 * (1 - c) * bmPow(c, 2) * (r[p] + o[p]) + bmPow(c, 3) * r[p], u[p] = m, null !== v && (d += bmPow(u[p] - v[p], 2));
  1272. g += d = bmSqrt(d), b.points[l] = new s(d, u), v = u
  1273. }
  1274. b.segmentLength = g, a[h] = b
  1275. }
  1276. return a[h]
  1277. });
  1278. function o(t, e) {
  1279. var r = e.percents,
  1280. i = e.lengths,
  1281. s = r.length,
  1282. a = bmFloor((s - 1) * t),
  1283. n = t * e.addedLength,
  1284. o = 0;
  1285. if (a === s - 1 || 0 === a || n === i[a]) return r[a];
  1286. for (var h = i[a] > n ? -1 : 1, l = !0; l;)
  1287. if (i[a] <= n && i[a + 1] > n ? (o = (n - i[a]) / (i[a + 1] - i[a]), l = !1) : a += h, a < 0 || a >= s - 1) {
  1288. if (a === s - 1) return r[a];
  1289. l = !1
  1290. }
  1291. return r[a] + (r[a + 1] - r[a]) * o
  1292. }
  1293. var h = createTypedArray("float32", 8);
  1294. return {
  1295. getSegmentsLength: function(t) {
  1296. var e, i = segmentsLengthPool.newElement(),
  1297. s = t.c,
  1298. a = t.v,
  1299. n = t.o,
  1300. o = t.i,
  1301. h = t._length,
  1302. l = i.lengths,
  1303. p = 0;
  1304. for (e = 0; e < h - 1; e += 1) l[e] = r(a[e], a[e + 1], n[e], o[e + 1]), p += l[e].addedLength;
  1305. return s && h && (l[e] = r(a[e], a[0], n[e], o[0]), p += l[e].addedLength), i.totalLength = p, i
  1306. },
  1307. getNewSegment: function(e, r, i, s, a, n, l) {
  1308. a < 0 ? a = 0 : a > 1 && (a = 1);
  1309. var p, f = o(a, l),
  1310. m = o(n = n > 1 ? 1 : n, l),
  1311. c = e.length,
  1312. d = 1 - f,
  1313. u = 1 - m,
  1314. y = d * d * d,
  1315. g = f * d * d * 3,
  1316. v = f * f * d * 3,
  1317. b = f * f * f,
  1318. P = d * d * u,
  1319. E = f * d * u + d * f * u + d * d * m,
  1320. x = f * f * u + d * f * m + f * d * m,
  1321. S = f * f * m,
  1322. _ = d * u * u,
  1323. C = f * u * u + d * m * u + d * u * m,
  1324. A = f * m * u + d * m * m + f * u * m,
  1325. T = f * m * m,
  1326. D = u * u * u,
  1327. k = m * u * u + u * m * u + u * u * m,
  1328. M = m * m * u + u * m * m + m * u * m,
  1329. F = m * m * m;
  1330. for (p = 0; p < c; p += 1) h[4 * p] = t.round(1e3 * (y * e[p] + g * i[p] + v * s[p] + b * r[p])) / 1e3, h[4 * p + 1] = t.round(1e3 * (P * e[p] + E * i[p] + x * s[p] + S * r[p])) / 1e3, h[4 * p + 2] = t.round(1e3 * (_ * e[p] + C * i[p] + A * s[p] + T * r[p])) / 1e3, h[4 * p + 3] = t.round(1e3 * (D * e[p] + k * i[p] + M * s[p] + F * r[p])) / 1e3;
  1331. return h
  1332. },
  1333. getPointInSegment: function(e, r, i, s, a, n) {
  1334. var h = o(a, n),
  1335. l = 1 - h;
  1336. return [t.round(1e3 * (l * l * l * e[0] + (h * l * l + l * h * l + l * l * h) * i[0] + (h * h * l + l * h * h + h * l * h) * s[0] + h * h * h * r[0])) / 1e3, t.round(1e3 * (l * l * l * e[1] + (h * l * l + l * h * l + l * l * h) * i[1] + (h * h * l + l * h * h + h * l * h) * s[1] + h * h * h * r[1])) / 1e3]
  1337. },
  1338. buildBezierData: n,
  1339. pointOnLine2D: e,
  1340. pointOnLine3D: function(r, i, s, a, n, o, h, l, p) {
  1341. if (0 === s && 0 === o && 0 === p) return e(r, i, a, n, h, l);
  1342. var f, m = t.sqrt(t.pow(a - r, 2) + t.pow(n - i, 2) + t.pow(o - s, 2)),
  1343. c = t.sqrt(t.pow(h - r, 2) + t.pow(l - i, 2) + t.pow(p - s, 2)),
  1344. d = t.sqrt(t.pow(h - a, 2) + t.pow(l - n, 2) + t.pow(p - o, 2));
  1345. return (f = m > c ? m > d ? m - c - d : d - c - m : d > c ? d - c - m : c - m - d) > -1e-4 && f < 1e-4
  1346. }
  1347. }
  1348. }
  1349. var bez = bezFunction(),
  1350. PropertyFactory = function() {
  1351. var t = initialDefaultFrame,
  1352. e = Math.abs;
  1353. function r(t, e) {
  1354. var r, s = this.offsetTime;
  1355. "multidimensional" === this.propType && (r = createTypedArray("float32", this.pv.length));
  1356. for (var a, n, o, h, l, p, f, m, c, d = e.lastIndex, u = d, y = this.keyframes.length - 1, g = !0; g;) {
  1357. if (a = this.keyframes[u], n = this.keyframes[u + 1], u === y - 1 && t >= n.t - s) {
  1358. a.h && (a = n), d = 0;
  1359. break
  1360. }
  1361. if (n.t - s > t) {
  1362. d = u;
  1363. break
  1364. }
  1365. u < y - 1 ? u += 1 : (d = 0, g = !1)
  1366. }
  1367. o = this.keyframesMetadata[u] || {};
  1368. var v, b, P, E, x, S, _, C, A, T, D = n.t - s,
  1369. k = a.t - s;
  1370. if (a.to) {
  1371. o.bezierData || (o.bezierData = bez.buildBezierData(a.s, n.s || a.e, a.to, a.ti));
  1372. var M = o.bezierData;
  1373. if (t >= D || t < k) {
  1374. var F = t >= D ? M.points.length - 1 : 0;
  1375. for (l = M.points[F].point.length, h = 0; h < l; h += 1) r[h] = M.points[F].point[h]
  1376. } else {
  1377. o.__fnct ? c = o.__fnct : (c = BezierFactory.getBezierEasing(a.o.x, a.o.y, a.i.x, a.i.y, a.n).get, o.__fnct = c), p = c((t - k) / (D - k));
  1378. var w, I = M.segmentLength * p,
  1379. V = e.lastFrame < t && e._lastKeyframeIndex === u ? e._lastAddedLength : 0;
  1380. for (m = e.lastFrame < t && e._lastKeyframeIndex === u ? e._lastPoint : 0, g = !0, f = M.points.length; g;) {
  1381. if (V += M.points[m].partialLength, 0 === I || 0 === p || m === M.points.length - 1) {
  1382. for (l = M.points[m].point.length, h = 0; h < l; h += 1) r[h] = M.points[m].point[h];
  1383. break
  1384. }
  1385. if (I >= V && I < V + M.points[m + 1].partialLength) {
  1386. for (w = (I - V) / M.points[m + 1].partialLength, l = M.points[m].point.length, h = 0; h < l; h += 1) r[h] = M.points[m].point[h] + (M.points[m + 1].point[h] - M.points[m].point[h]) * w;
  1387. break
  1388. }
  1389. m < f - 1 ? m += 1 : g = !1
  1390. }
  1391. e._lastPoint = m, e._lastAddedLength = V - M.points[m].partialLength, e._lastKeyframeIndex = u
  1392. }
  1393. } else {
  1394. var B, R, L, G, z;
  1395. if (y = a.s.length, v = n.s || a.e, this.sh && 1 !== a.h)
  1396. if (t >= D) r[0] = v[0], r[1] = v[1], r[2] = v[2];
  1397. else if (t <= k) r[0] = a.s[0], r[1] = a.s[1], r[2] = a.s[2];
  1398. else {
  1399. var N = i(a.s),
  1400. O = i(v);
  1401. b = r, P = function(t, e, r) {
  1402. var i, s, a, n, o, h = [],
  1403. l = t[0],
  1404. p = t[1],
  1405. f = t[2],
  1406. m = t[3],
  1407. c = e[0],
  1408. d = e[1],
  1409. u = e[2],
  1410. y = e[3];
  1411. return (s = l * c + p * d + f * u + m * y) < 0 && (s = -s, c = -c, d = -d, u = -u, y = -y), 1 - s > 1e-6 ? (i = Math.acos(s), a = Math.sin(i), n = Math.sin((1 - r) * i) / a, o = Math.sin(r * i) / a) : (n = 1 - r, o = r), h[0] = n * l + o * c, h[1] = n * p + o * d, h[2] = n * f + o * u, h[3] = n * m + o * y, h
  1412. }(N, O, (t - k) / (D - k)), E = P[0], x = P[1], S = P[2], _ = P[3], C = Math.atan2(2 * x * _ - 2 * E * S, 1 - 2 * x * x - 2 * S * S), A = Math.asin(2 * E * x + 2 * S * _), T = Math.atan2(2 * E * _ - 2 * x * S, 1 - 2 * E * E - 2 * S * S), b[0] = C / degToRads, b[1] = A / degToRads, b[2] = T / degToRads
  1413. } else
  1414. for (u = 0; u < y; u += 1) 1 !== a.h && (t >= D ? p = 1 : t < k ? p = 0 : (a.o.x.constructor === Array ? (o.__fnct || (o.__fnct = []), o.__fnct[u] ? c = o.__fnct[u] : (B = void 0 === a.o.x[u] ? a.o.x[0] : a.o.x[u], R = void 0 === a.o.y[u] ? a.o.y[0] : a.o.y[u], L = void 0 === a.i.x[u] ? a.i.x[0] : a.i.x[u], G = void 0 === a.i.y[u] ? a.i.y[0] : a.i.y[u], c = BezierFactory.getBezierEasing(B, R, L, G).get, o.__fnct[u] = c)) : o.__fnct ? c = o.__fnct : (B = a.o.x, R = a.o.y, L = a.i.x, G = a.i.y, c = BezierFactory.getBezierEasing(B, R, L, G).get, a.keyframeMetadata = c), p = c((t - k) / (D - k)))), v = n.s || a.e, z = 1 === a.h ? a.s[u] : a.s[u] + (v[u] - a.s[u]) * p, "multidimensional" === this.propType ? r[u] = z : r = z
  1415. }
  1416. return e.lastIndex = d, r
  1417. }
  1418. function i(t) {
  1419. var e = t[0] * degToRads,
  1420. r = t[1] * degToRads,
  1421. i = t[2] * degToRads,
  1422. s = Math.cos(e / 2),
  1423. a = Math.cos(r / 2),
  1424. n = Math.cos(i / 2),
  1425. o = Math.sin(e / 2),
  1426. h = Math.sin(r / 2),
  1427. l = Math.sin(i / 2);
  1428. return [o * h * n + s * a * l, o * a * n + s * h * l, s * h * n - o * a * l, s * a * n - o * h * l]
  1429. }
  1430. function s() {
  1431. var e = this.comp.renderedFrame - this.offsetTime,
  1432. r = this.keyframes[0].t - this.offsetTime,
  1433. i = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
  1434. if (!(e === this._caching.lastFrame || this._caching.lastFrame !== t && (this._caching.lastFrame >= i && e >= i || this._caching.lastFrame < r && e < r))) {
  1435. this._caching.lastFrame >= e && (this._caching._lastKeyframeIndex = -1, this._caching.lastIndex = 0);
  1436. var s = this.interpolateValue(e, this._caching);
  1437. this.pv = s
  1438. }
  1439. return this._caching.lastFrame = e, this.pv
  1440. }
  1441. function a(t) {
  1442. var r;
  1443. if ("unidimensional" === this.propType) r = t * this.mult, e(this.v - r) > 1e-5 && (this.v = r, this._mdf = !0);
  1444. else
  1445. for (var i = 0, s = this.v.length; i < s;) r = t[i] * this.mult, e(this.v[i] - r) > 1e-5 && (this.v[i] = r, this._mdf = !0), i += 1
  1446. }
  1447. function n() {
  1448. if (this.elem.globalData.frameId !== this.frameId && this.effectsSequence.length)
  1449. if (this.lock) this.setVValue(this.pv);
  1450. else {
  1451. var t;
  1452. this.lock = !0, this._mdf = this._isFirstFrame;
  1453. var e = this.effectsSequence.length,
  1454. r = this.kf ? this.pv : this.data.k;
  1455. for (t = 0; t < e; t += 1) r = this.effectsSequence[t](r);
  1456. this.setVValue(r), this._isFirstFrame = !1, this.lock = !1, this.frameId = this.elem.globalData.frameId
  1457. }
  1458. }
  1459. function o(t) {
  1460. this.effectsSequence.push(t), this.container.addDynamicProperty(this)
  1461. }
  1462. function h(t, e, r, i) {
  1463. this.propType = "unidimensional", this.mult = r || 1, this.data = e, this.v = r ? e.k * r : e.k, this.pv = e.k, this._mdf = !1, this.elem = t, this.container = i, this.comp = t.comp, this.k = !1, this.kf = !1, this.vel = 0, this.effectsSequence = [], this._isFirstFrame = !0, this.getValue = n, this.setVValue = a, this.addEffect = o
  1464. }
  1465. function l(t, e, r, i) {
  1466. var s;
  1467. this.propType = "multidimensional", this.mult = r || 1, this.data = e, this._mdf = !1, this.elem = t, this.container = i, this.comp = t.comp, this.k = !1, this.kf = !1, this.frameId = -1;
  1468. var h = e.k.length;
  1469. for (this.v = createTypedArray("float32", h), this.pv = createTypedArray("float32", h), this.vel = createTypedArray("float32", h), s = 0; s < h; s += 1) this.v[s] = e.k[s] * this.mult, this.pv[s] = e.k[s];
  1470. this._isFirstFrame = !0, this.effectsSequence = [], this.getValue = n, this.setVValue = a, this.addEffect = o
  1471. }
  1472. function p(e, i, h, l) {
  1473. this.propType = "unidimensional", this.keyframes = i.k, this.keyframesMetadata = [], this.offsetTime = e.data.st, this.frameId = -1, this._caching = {
  1474. lastFrame: t,
  1475. lastIndex: 0,
  1476. value: 0,
  1477. _lastKeyframeIndex: -1
  1478. }, this.k = !0, this.kf = !0, this.data = i, this.mult = h || 1, this.elem = e, this.container = l, this.comp = e.comp, this.v = t, this.pv = t, this._isFirstFrame = !0, this.getValue = n, this.setVValue = a, this.interpolateValue = r, this.effectsSequence = [s.bind(this)], this.addEffect = o
  1479. }
  1480. function f(e, i, h, l) {
  1481. var p;
  1482. this.propType = "multidimensional";
  1483. var f, m, c, d, u = i.k.length;
  1484. for (p = 0; p < u - 1; p += 1) i.k[p].to && i.k[p].s && i.k[p + 1] && i.k[p + 1].s && (f = i.k[p].s, m = i.k[p + 1].s, c = i.k[p].to, d = i.k[p].ti, (2 === f.length && (f[0] !== m[0] || f[1] !== m[1]) && bez.pointOnLine2D(f[0], f[1], m[0], m[1], f[0] + c[0], f[1] + c[1]) && bez.pointOnLine2D(f[0], f[1], m[0], m[1], m[0] + d[0], m[1] + d[1]) || 3 === f.length && (f[0] !== m[0] || f[1] !== m[1] || f[2] !== m[2]) && bez.pointOnLine3D(f[0], f[1], f[2], m[0], m[1], m[2], f[0] + c[0], f[1] + c[1], f[2] + c[2]) && bez.pointOnLine3D(f[0], f[1], f[2], m[0], m[1], m[2], m[0] + d[0], m[1] + d[1], m[2] + d[2])) && (i.k[p].to = null, i.k[p].ti = null), f[0] === m[0] && f[1] === m[1] && 0 === c[0] && 0 === c[1] && 0 === d[0] && 0 === d[1] && (2 === f.length || f[2] === m[2] && 0 === c[2] && 0 === d[2]) && (i.k[p].to = null, i.k[p].ti = null));
  1485. this.effectsSequence = [s.bind(this)], this.data = i, this.keyframes = i.k, this.keyframesMetadata = [], this.offsetTime = e.data.st, this.k = !0, this.kf = !0, this._isFirstFrame = !0, this.mult = h || 1, this.elem = e, this.container = l, this.comp = e.comp, this.getValue = n, this.setVValue = a, this.interpolateValue = r, this.frameId = -1;
  1486. var y = i.k[0].s.length;
  1487. for (this.v = createTypedArray("float32", y), this.pv = createTypedArray("float32", y), p = 0; p < y; p += 1) this.v[p] = t, this.pv[p] = t;
  1488. this._caching = {
  1489. lastFrame: t,
  1490. lastIndex: 0,
  1491. value: createTypedArray("float32", y)
  1492. }, this.addEffect = o
  1493. }
  1494. return {
  1495. getProp: function(t, e, r, i, s) {
  1496. var a;
  1497. if (e.k.length)
  1498. if ("number" == typeof e.k[0]) a = new l(t, e, i, s);
  1499. else switch (r) {
  1500. case 0:
  1501. a = new p(t, e, i, s);
  1502. break;
  1503. case 1:
  1504. a = new f(t, e, i, s)
  1505. } else a = new h(t, e, i, s);
  1506. return a.effectsSequence.length && s.addDynamicProperty(a), a
  1507. }
  1508. }
  1509. }();
  1510. function DynamicPropertyContainer() {}
  1511. DynamicPropertyContainer.prototype = {
  1512. addDynamicProperty: function(t) {
  1513. -1 === this.dynamicProperties.indexOf(t) && (this.dynamicProperties.push(t), this.container.addDynamicProperty(this), this._isAnimated = !0)
  1514. },
  1515. iterateDynamicProperties: function() {
  1516. var t;
  1517. this._mdf = !1;
  1518. var e = this.dynamicProperties.length;
  1519. for (t = 0; t < e; t += 1) this.dynamicProperties[t].getValue(), this.dynamicProperties[t]._mdf && (this._mdf = !0)
  1520. },
  1521. initDynamicPropertyContainer: function(t) {
  1522. this.container = t, this.dynamicProperties = [], this._mdf = !1, this._isAnimated = !1
  1523. }
  1524. };
  1525. var pointPool = poolFactory(8, (function() {
  1526. return createTypedArray("float32", 2)
  1527. }));
  1528. function ShapePath() {
  1529. this.c = !1, this._length = 0, this._maxLength = 8, this.v = createSizedArray(this._maxLength), this.o = createSizedArray(this._maxLength), this.i = createSizedArray(this._maxLength)
  1530. }
  1531. ShapePath.prototype.setPathData = function(t, e) {
  1532. this.c = t, this.setLength(e);
  1533. for (var r = 0; r < e;) this.v[r] = pointPool.newElement(), this.o[r] = pointPool.newElement(), this.i[r] = pointPool.newElement(), r += 1
  1534. }, ShapePath.prototype.setLength = function(t) {
  1535. for (; this._maxLength < t;) this.doubleArrayLength();
  1536. this._length = t
  1537. }, ShapePath.prototype.doubleArrayLength = function() {
  1538. this.v = this.v.concat(createSizedArray(this._maxLength)), this.i = this.i.concat(createSizedArray(this._maxLength)), this.o = this.o.concat(createSizedArray(this._maxLength)), this._maxLength *= 2
  1539. }, ShapePath.prototype.setXYAt = function(t, e, r, i, s) {
  1540. var a;
  1541. switch (this._length = Math.max(this._length, i + 1), this._length >= this._maxLength && this.doubleArrayLength(), r) {
  1542. case "v":
  1543. a = this.v;
  1544. break;
  1545. case "i":
  1546. a = this.i;
  1547. break;
  1548. case "o":
  1549. a = this.o;
  1550. break;
  1551. default:
  1552. a = []
  1553. }(!a[i] || a[i] && !s) && (a[i] = pointPool.newElement()), a[i][0] = t, a[i][1] = e
  1554. }, ShapePath.prototype.setTripleAt = function(t, e, r, i, s, a, n, o) {
  1555. this.setXYAt(t, e, "v", n, o), this.setXYAt(r, i, "o", n, o), this.setXYAt(s, a, "i", n, o)
  1556. }, ShapePath.prototype.reverse = function() {
  1557. var t = new ShapePath;
  1558. t.setPathData(this.c, this._length);
  1559. var e = this.v,
  1560. r = this.o,
  1561. i = this.i,
  1562. s = 0;
  1563. this.c && (t.setTripleAt(e[0][0], e[0][1], i[0][0], i[0][1], r[0][0], r[0][1], 0, !1), s = 1);
  1564. var a, n = this._length - 1,
  1565. o = this._length;
  1566. for (a = s; a < o; a += 1) t.setTripleAt(e[n][0], e[n][1], i[n][0], i[n][1], r[n][0], r[n][1], a, !1), n -= 1;
  1567. return t
  1568. };
  1569. var shapePool = (factory = poolFactory(4, (function() {
  1570. return new ShapePath
  1571. }), (function(t) {
  1572. var e, r = t._length;
  1573. for (e = 0; e < r; e += 1) pointPool.release(t.v[e]), pointPool.release(t.i[e]), pointPool.release(t.o[e]), t.v[e] = null, t.i[e] = null, t.o[e] = null;
  1574. t._length = 0, t.c = !1
  1575. })), factory.clone = function(t) {
  1576. var e, r = factory.newElement(),
  1577. i = void 0 === t._length ? t.v.length : t._length;
  1578. for (r.setLength(i), r.c = t.c, e = 0; e < i; e += 1) r.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);
  1579. return r
  1580. }, factory),
  1581. factory;
  1582. function ShapeCollection() {
  1583. this._length = 0, this._maxLength = 4, this.shapes = createSizedArray(this._maxLength)
  1584. }
  1585. ShapeCollection.prototype.addShape = function(t) {
  1586. this._length === this._maxLength && (this.shapes = this.shapes.concat(createSizedArray(this._maxLength)), this._maxLength *= 2), this.shapes[this._length] = t, this._length += 1
  1587. }, ShapeCollection.prototype.releaseShapes = function() {
  1588. var t;
  1589. for (t = 0; t < this._length; t += 1) shapePool.release(this.shapes[t]);
  1590. this._length = 0
  1591. };
  1592. var shapeCollectionPool = (ob = {
  1593. newShapeCollection: function() {
  1594. return _length ? pool[_length -= 1] : new ShapeCollection
  1595. },
  1596. release: function(t) {
  1597. var e, r = t._length;
  1598. for (e = 0; e < r; e += 1) shapePool.release(t.shapes[e]);
  1599. t._length = 0, _length === _maxLength && (pool = pooling.double(pool), _maxLength *= 2), pool[_length] = t, _length += 1
  1600. }
  1601. }, _length = 0, _maxLength = 4, pool = createSizedArray(_maxLength), ob),
  1602. ob, _length, _maxLength, pool, ShapePropertyFactory = function() {
  1603. var t = -999999;
  1604. function e(t, e, r) {
  1605. var i, s, a, n, o, h, l, p, f, m = r.lastIndex,
  1606. c = this.keyframes;
  1607. if (t < c[0].t - this.offsetTime) i = c[0].s[0], a = !0, m = 0;
  1608. else if (t >= c[c.length - 1].t - this.offsetTime) i = c[c.length - 1].s ? c[c.length - 1].s[0] : c[c.length - 2].e[0], a = !0;
  1609. else {
  1610. for (var d, u, y, g = m, v = c.length - 1, b = !0; b && (d = c[g], !((u = c[g + 1]).t - this.offsetTime > t));) g < v - 1 ? g += 1 : b = !1;
  1611. if (y = this.keyframesMetadata[g] || {}, m = g, !(a = 1 === d.h)) {
  1612. if (t >= u.t - this.offsetTime) p = 1;
  1613. else if (t < d.t - this.offsetTime) p = 0;
  1614. else {
  1615. var P;
  1616. y.__fnct ? P = y.__fnct : (P = BezierFactory.getBezierEasing(d.o.x, d.o.y, d.i.x, d.i.y).get, y.__fnct = P), p = P((t - (d.t - this.offsetTime)) / (u.t - this.offsetTime - (d.t - this.offsetTime)))
  1617. }
  1618. s = u.s ? u.s[0] : d.e[0]
  1619. }
  1620. i = d.s[0]
  1621. }
  1622. for (h = e._length, l = i.i[0].length, r.lastIndex = m, n = 0; n < h; n += 1)
  1623. for (o = 0; o < l; o += 1) f = a ? i.i[n][o] : i.i[n][o] + (s.i[n][o] - i.i[n][o]) * p, e.i[n][o] = f, f = a ? i.o[n][o] : i.o[n][o] + (s.o[n][o] - i.o[n][o]) * p, e.o[n][o] = f, f = a ? i.v[n][o] : i.v[n][o] + (s.v[n][o] - i.v[n][o]) * p, e.v[n][o] = f
  1624. }
  1625. function r() {
  1626. var e = this.comp.renderedFrame - this.offsetTime,
  1627. r = this.keyframes[0].t - this.offsetTime,
  1628. i = this.keyframes[this.keyframes.length - 1].t - this.offsetTime,
  1629. s = this._caching.lastFrame;
  1630. return s !== t && (s < r && e < r || s > i && e > i) || (this._caching.lastIndex = s < e ? this._caching.lastIndex : 0, this.interpolateShape(e, this.pv, this._caching)), this._caching.lastFrame = e, this.pv
  1631. }
  1632. function i() {
  1633. this.paths = this.localShapeCollection
  1634. }
  1635. function s(t) {
  1636. (function(t, e) {
  1637. if (t._length !== e._length || t.c !== e.c) return !1;
  1638. var r, i = t._length;
  1639. for (r = 0; r < i; r += 1)
  1640. if (t.v[r][0] !== e.v[r][0] || t.v[r][1] !== e.v[r][1] || t.o[r][0] !== e.o[r][0] || t.o[r][1] !== e.o[r][1] || t.i[r][0] !== e.i[r][0] || t.i[r][1] !== e.i[r][1]) return !1;
  1641. return !0
  1642. })(this.v, t) || (this.v = shapePool.clone(t), this.localShapeCollection.releaseShapes(), this.localShapeCollection.addShape(this.v), this._mdf = !0, this.paths = this.localShapeCollection)
  1643. }
  1644. function a() {
  1645. if (this.elem.globalData.frameId !== this.frameId)
  1646. if (this.effectsSequence.length)
  1647. if (this.lock) this.setVValue(this.pv);
  1648. else {
  1649. var t, e;
  1650. this.lock = !0, this._mdf = !1, t = this.kf ? this.pv : this.data.ks ? this.data.ks.k : this.data.pt.k;
  1651. var r = this.effectsSequence.length;
  1652. for (e = 0; e < r; e += 1) t = this.effectsSequence[e](t);
  1653. this.setVValue(t), this.lock = !1, this.frameId = this.elem.globalData.frameId
  1654. }
  1655. else this._mdf = !1
  1656. }
  1657. function n(t, e, r) {
  1658. 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;
  1659. var s = 3 === r ? e.pt.k : e.ks.k;
  1660. this.v = shapePool.clone(s), this.pv = shapePool.clone(this.v), this.localShapeCollection = shapeCollectionPool.newShapeCollection(), this.paths = this.localShapeCollection, this.paths.addShape(this.v), this.reset = i, this.effectsSequence = []
  1661. }
  1662. function o(t) {
  1663. this.effectsSequence.push(t), this.container.addDynamicProperty(this)
  1664. }
  1665. function h(e, s, a) {
  1666. this.propType = "shape", this.comp = e.comp, this.elem = e, this.container = e, this.offsetTime = e.data.st, this.keyframes = 3 === a ? s.pt.k : s.ks.k, this.keyframesMetadata = [], this.k = !0, this.kf = !0;
  1667. var n = this.keyframes[0].s[0].i.length;
  1668. this.v = shapePool.newElement(), this.v.setPathData(this.keyframes[0].s[0].c, n), this.pv = shapePool.clone(this.v), this.localShapeCollection = shapeCollectionPool.newShapeCollection(), this.paths = this.localShapeCollection, this.paths.addShape(this.v), this.lastFrame = t, this.reset = i, this._caching = {
  1669. lastFrame: t,
  1670. lastIndex: 0
  1671. }, this.effectsSequence = [r.bind(this)]
  1672. }
  1673. n.prototype.interpolateShape = e, n.prototype.getValue = a, n.prototype.setVValue = s, n.prototype.addEffect = o, h.prototype.getValue = a, h.prototype.interpolateShape = e, h.prototype.setVValue = s, h.prototype.addEffect = o;
  1674. var l = function() {
  1675. var t = roundCorner;
  1676. function e(t, e) {
  1677. this.v = shapePool.newElement(), this.v.setPathData(!0, 4), this.localShapeCollection = shapeCollectionPool.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 = PropertyFactory.getProp(t, e.p, 1, 0, this), this.s = PropertyFactory.getProp(t, e.s, 1, 0, this), this.dynamicProperties.length ? this.k = !0 : (this.k = !1, this.convertEllToPath())
  1678. }
  1679. return e.prototype = {
  1680. reset: i,
  1681. getValue: function() {
  1682. this.elem.globalData.frameId !== this.frameId && (this.frameId = this.elem.globalData.frameId, this.iterateDynamicProperties(), this._mdf && this.convertEllToPath())
  1683. },
  1684. convertEllToPath: function() {
  1685. var e = this.p.v[0],
  1686. r = this.p.v[1],
  1687. i = this.s.v[0] / 2,
  1688. s = this.s.v[1] / 2,
  1689. a = 3 !== this.d,
  1690. n = this.v;
  1691. n.v[0][0] = e, n.v[0][1] = r - s, n.v[1][0] = a ? e + i : e - i, n.v[1][1] = r, n.v[2][0] = e, n.v[2][1] = r + s, n.v[3][0] = a ? e - i : e + i, n.v[3][1] = r, n.i[0][0] = a ? e - i * t : e + i * t, n.i[0][1] = r - s, n.i[1][0] = a ? e + i : e - i, n.i[1][1] = r - s * t, n.i[2][0] = a ? e + i * t : e - i * t, n.i[2][1] = r + s, n.i[3][0] = a ? e - i : e + i, n.i[3][1] = r + s * t, n.o[0][0] = a ? e + i * t : e - i * t, n.o[0][1] = r - s, n.o[1][0] = a ? e + i : e - i, n.o[1][1] = r + s * t, n.o[2][0] = a ? e - i * t : e + i * t, n.o[2][1] = r + s, n.o[3][0] = a ? e - i : e + i, n.o[3][1] = r - s * t
  1692. }
  1693. }, extendPrototype([DynamicPropertyContainer], e), e
  1694. }(),
  1695. p = function() {
  1696. function t(t, e) {
  1697. this.v = shapePool.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 = PropertyFactory.getProp(t, e.ir, 0, 0, this), this.is = PropertyFactory.getProp(t, e.is, 0, .01, this), this.convertToPath = this.convertStarToPath) : this.convertToPath = this.convertPolygonToPath, this.pt = PropertyFactory.getProp(t, e.pt, 0, 0, this), this.p = PropertyFactory.getProp(t, e.p, 1, 0, this), this.r = PropertyFactory.getProp(t, e.r, 0, degToRads, this), this.or = PropertyFactory.getProp(t, e.or, 0, 0, this), this.os = PropertyFactory.getProp(t, e.os, 0, .01, this), this.localShapeCollection = shapeCollectionPool.newShapeCollection(), this.localShapeCollection.addShape(this.v), this.paths = this.localShapeCollection, this.dynamicProperties.length ? this.k = !0 : (this.k = !1, this.convertToPath())
  1698. }
  1699. return t.prototype = {
  1700. reset: i,
  1701. getValue: function() {
  1702. this.elem.globalData.frameId !== this.frameId && (this.frameId = this.elem.globalData.frameId, this.iterateDynamicProperties(), this._mdf && this.convertToPath())
  1703. },
  1704. convertStarToPath: function() {
  1705. var t, e, r, i, s = 2 * Math.floor(this.pt.v),
  1706. a = 2 * Math.PI / s,
  1707. n = !0,
  1708. o = this.or.v,
  1709. h = this.ir.v,
  1710. l = this.os.v,
  1711. p = this.is.v,
  1712. f = 2 * Math.PI * o / (2 * s),
  1713. m = 2 * Math.PI * h / (2 * s),
  1714. c = -Math.PI / 2;
  1715. c += this.r.v;
  1716. var d = 3 === this.data.d ? -1 : 1;
  1717. for (this.v._length = 0, t = 0; t < s; t += 1) {
  1718. r = n ? l : p, i = n ? f : m;
  1719. var u = (e = n ? o : h) * Math.cos(c),
  1720. y = e * Math.sin(c),
  1721. g = 0 === u && 0 === y ? 0 : y / Math.sqrt(u * u + y * y),
  1722. v = 0 === u && 0 === y ? 0 : -u / Math.sqrt(u * u + y * y);
  1723. u += +this.p.v[0], y += +this.p.v[1], this.v.setTripleAt(u, y, u - g * i * r * d, y - v * i * r * d, u + g * i * r * d, y + v * i * r * d, t, !0), n = !n, c += a * d
  1724. }
  1725. },
  1726. convertPolygonToPath: function() {
  1727. var t, e = Math.floor(this.pt.v),
  1728. r = 2 * Math.PI / e,
  1729. i = this.or.v,
  1730. s = this.os.v,
  1731. a = 2 * Math.PI * i / (4 * e),
  1732. n = .5 * -Math.PI,
  1733. o = 3 === this.data.d ? -1 : 1;
  1734. for (n += this.r.v, this.v._length = 0, t = 0; t < e; t += 1) {
  1735. var h = i * Math.cos(n),
  1736. l = i * Math.sin(n),
  1737. p = 0 === h && 0 === l ? 0 : l / Math.sqrt(h * h + l * l),
  1738. f = 0 === h && 0 === l ? 0 : -h / Math.sqrt(h * h + l * l);
  1739. h += +this.p.v[0], l += +this.p.v[1], this.v.setTripleAt(h, l, h - p * a * s * o, l - f * a * s * o, h + p * a * s * o, l + f * a * s * o, t, !0), n += r * o
  1740. }
  1741. this.paths.length = 0, this.paths[0] = this.v
  1742. }
  1743. }, extendPrototype([DynamicPropertyContainer], t), t
  1744. }(),
  1745. f = function() {
  1746. function t(t, e) {
  1747. this.v = shapePool.newElement(), this.v.c = !0, this.localShapeCollection = shapeCollectionPool.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 = PropertyFactory.getProp(t, e.p, 1, 0, this), this.s = PropertyFactory.getProp(t, e.s, 1, 0, this), this.r = PropertyFactory.getProp(t, e.r, 0, 0, this), this.dynamicProperties.length ? this.k = !0 : (this.k = !1, this.convertRectToPath())
  1748. }
  1749. return t.prototype = {
  1750. convertRectToPath: function() {
  1751. var t = this.p.v[0],
  1752. e = this.p.v[1],
  1753. r = this.s.v[0] / 2,
  1754. i = this.s.v[1] / 2,
  1755. s = bmMin(r, i, this.r.v),
  1756. a = s * (1 - roundCorner);
  1757. this.v._length = 0, 2 === this.d || 1 === this.d ? (this.v.setTripleAt(t + r, e - i + s, t + r, e - i + s, t + r, e - i + a, 0, !0), this.v.setTripleAt(t + r, e + i - s, t + r, e + i - a, t + r, e + i - s, 1, !0), 0 !== s ? (this.v.setTripleAt(t + r - s, e + i, t + r - s, e + i, t + r - a, e + i, 2, !0), this.v.setTripleAt(t - r + s, e + i, t - r + a, e + i, t - r + s, e + i, 3, !0), this.v.setTripleAt(t - r, e + i - s, t - r, e + i - s, t - r, e + i - a, 4, !0), this.v.setTripleAt(t - r, e - i + s, t - r, e - i + a, t - r, e - i + s, 5, !0), this.v.setTripleAt(t - r + s, e - i, t - r + s, e - i, t - r + a, e - i, 6, !0), this.v.setTripleAt(t + r - s, e - i, t + r - a, e - i, t + r - s, e - i, 7, !0)) : (this.v.setTripleAt(t - r, e + i, t - r + a, e + i, t - r, e + i, 2), this.v.setTripleAt(t - r, e - i, t - r, e - i + a, t - r, e - i, 3))) : (this.v.setTripleAt(t + r, e - i + s, t + r, e - i + a, t + r, e - i + s, 0, !0), 0 !== s ? (this.v.setTripleAt(t + r - s, e - i, t + r - s, e - i, t + r - a, e - i, 1, !0), this.v.setTripleAt(t - r + s, e - i, t - r + a, e - i, t - r + s, e - i, 2, !0), this.v.setTripleAt(t - r, e - i + s, t - r, e - i + s, t - r, e - i + a, 3, !0), this.v.setTripleAt(t - r, e + i - s, t - r, e + i - a, t - r, e + i - s, 4, !0), this.v.setTripleAt(t - r + s, e + i, t - r + s, e + i, t - r + a, e + i, 5, !0), this.v.setTripleAt(t + r - s, e + i, t + r - a, e + i, t + r - s, e + i, 6, !0), this.v.setTripleAt(t + r, e + i - s, t + r, e + i - s, t + r, e + i - a, 7, !0)) : (this.v.setTripleAt(t - r, e - i, t - r + a, e - i, t - r, e - i, 1, !0), this.v.setTripleAt(t - r, e + i, t - r, e + i - a, t - r, e + i, 2, !0), this.v.setTripleAt(t + r, e + i, t + r - a, e + i, t + r, e + i, 3, !0)))
  1758. },
  1759. getValue: function() {
  1760. this.elem.globalData.frameId !== this.frameId && (this.frameId = this.elem.globalData.frameId, this.iterateDynamicProperties(), this._mdf && this.convertRectToPath())
  1761. },
  1762. reset: i
  1763. }, extendPrototype([DynamicPropertyContainer], t), t
  1764. }();
  1765. var m = {
  1766. getShapeProp: function(t, e, r) {
  1767. var i;
  1768. return 3 === r || 4 === r ? i = (3 === r ? e.pt : e.ks).k.length ? new h(t, e, r) : new n(t, e, r) : 5 === r ? i = new f(t, e) : 6 === r ? i = new l(t, e) : 7 === r && (i = new p(t, e)), i.k && t.addDynamicProperty(i), i
  1769. },
  1770. getConstructorFunction: function() {
  1771. return n
  1772. },
  1773. getKeyframedConstructorFunction: function() {
  1774. return h
  1775. }
  1776. };
  1777. return m
  1778. }(),
  1779. Matrix = function() {
  1780. var t = Math.cos,
  1781. e = Math.sin,
  1782. r = Math.tan,
  1783. i = Math.round;
  1784. function s() {
  1785. 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
  1786. }
  1787. function a(r) {
  1788. if (0 === r) return this;
  1789. var i = t(r),
  1790. s = e(r);
  1791. return this._t(i, -s, 0, 0, s, i, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)
  1792. }
  1793. function n(r) {
  1794. if (0 === r) return this;
  1795. var i = t(r),
  1796. s = e(r);
  1797. return this._t(1, 0, 0, 0, 0, i, -s, 0, 0, s, i, 0, 0, 0, 0, 1)
  1798. }
  1799. function o(r) {
  1800. if (0 === r) return this;
  1801. var i = t(r),
  1802. s = e(r);
  1803. return this._t(i, 0, s, 0, 0, 1, 0, 0, -s, 0, i, 0, 0, 0, 0, 1)
  1804. }
  1805. function h(r) {
  1806. if (0 === r) return this;
  1807. var i = t(r),
  1808. s = e(r);
  1809. return this._t(i, -s, 0, 0, s, i, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)
  1810. }
  1811. function l(t, e) {
  1812. return this._t(1, e, t, 1, 0, 0)
  1813. }
  1814. function p(t, e) {
  1815. return this.shear(r(t), r(e))
  1816. }
  1817. function f(i, s) {
  1818. var a = t(s),
  1819. n = e(s);
  1820. return this._t(a, n, 0, 0, -n, a, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)._t(1, 0, 0, 0, r(i), 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)._t(a, -n, 0, 0, n, a, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)
  1821. }
  1822. function m(t, e, r) {
  1823. return r || 0 === r || (r = 1), 1 === t && 1 === e && 1 === r ? this : this._t(t, 0, 0, 0, 0, e, 0, 0, 0, 0, r, 0, 0, 0, 0, 1)
  1824. }
  1825. function c(t, e, r, i, s, a, n, o, h, l, p, f, m, c, d, u) {
  1826. return this.props[0] = t, this.props[1] = e, this.props[2] = r, this.props[3] = i, this.props[4] = s, this.props[5] = a, this.props[6] = n, this.props[7] = o, this.props[8] = h, this.props[9] = l, this.props[10] = p, this.props[11] = f, this.props[12] = m, this.props[13] = c, this.props[14] = d, this.props[15] = u, this
  1827. }
  1828. function d(t, e, r) {
  1829. return r = r || 0, 0 !== t || 0 !== e || 0 !== r ? this._t(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, t, e, r, 1) : this
  1830. }
  1831. function u(t, e, r, i, s, a, n, o, h, l, p, f, m, c, d, u) {
  1832. var y = this.props;
  1833. if (1 === t && 0 === e && 0 === r && 0 === i && 0 === s && 1 === a && 0 === n && 0 === o && 0 === h && 0 === l && 1 === p && 0 === f) return y[12] = y[12] * t + y[15] * m, y[13] = y[13] * a + y[15] * c, y[14] = y[14] * p + y[15] * d, y[15] *= u, this._identityCalculated = !1, this;
  1834. var g = y[0],
  1835. v = y[1],
  1836. b = y[2],
  1837. P = y[3],
  1838. E = y[4],
  1839. x = y[5],
  1840. S = y[6],
  1841. _ = y[7],
  1842. C = y[8],
  1843. A = y[9],
  1844. T = y[10],
  1845. D = y[11],
  1846. k = y[12],
  1847. M = y[13],
  1848. F = y[14],
  1849. w = y[15];
  1850. return y[0] = g * t + v * s + b * h + P * m, y[1] = g * e + v * a + b * l + P * c, y[2] = g * r + v * n + b * p + P * d, y[3] = g * i + v * o + b * f + P * u, y[4] = E * t + x * s + S * h + _ * m, y[5] = E * e + x * a + S * l + _ * c, y[6] = E * r + x * n + S * p + _ * d, y[7] = E * i + x * o + S * f + _ * u, y[8] = C * t + A * s + T * h + D * m, y[9] = C * e + A * a + T * l + D * c, y[10] = C * r + A * n + T * p + D * d, y[11] = C * i + A * o + T * f + D * u, y[12] = k * t + M * s + F * h + w * m, y[13] = k * e + M * a + F * l + w * c, y[14] = k * r + M * n + F * p + w * d, y[15] = k * i + M * o + F * f + w * u, this._identityCalculated = !1, this
  1851. }
  1852. function y() {
  1853. 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
  1854. }
  1855. function g(t) {
  1856. for (var e = 0; e < 16;) {
  1857. if (t.props[e] !== this.props[e]) return !1;
  1858. e += 1
  1859. }
  1860. return !0
  1861. }
  1862. function v(t) {
  1863. var e;
  1864. for (e = 0; e < 16; e += 1) t.props[e] = this.props[e];
  1865. return t
  1866. }
  1867. function b(t) {
  1868. var e;
  1869. for (e = 0; e < 16; e += 1) this.props[e] = t[e]
  1870. }
  1871. function P(t, e, r) {
  1872. return {
  1873. x: t * this.props[0] + e * this.props[4] + r * this.props[8] + this.props[12],
  1874. y: t * this.props[1] + e * this.props[5] + r * this.props[9] + this.props[13],
  1875. z: t * this.props[2] + e * this.props[6] + r * this.props[10] + this.props[14]
  1876. }
  1877. }
  1878. function E(t, e, r) {
  1879. return t * this.props[0] + e * this.props[4] + r * this.props[8] + this.props[12]
  1880. }
  1881. function x(t, e, r) {
  1882. return t * this.props[1] + e * this.props[5] + r * this.props[9] + this.props[13]
  1883. }
  1884. function S(t, e, r) {
  1885. return t * this.props[2] + e * this.props[6] + r * this.props[10] + this.props[14]
  1886. }
  1887. function _() {
  1888. var t = this.props[0] * this.props[5] - this.props[1] * this.props[4],
  1889. e = this.props[5] / t,
  1890. r = -this.props[1] / t,
  1891. i = -this.props[4] / t,
  1892. s = this.props[0] / t,
  1893. a = (this.props[4] * this.props[13] - this.props[5] * this.props[12]) / t,
  1894. n = -(this.props[0] * this.props[13] - this.props[1] * this.props[12]) / t,
  1895. o = new Matrix;
  1896. return o.props[0] = e, o.props[1] = r, o.props[4] = i, o.props[5] = s, o.props[12] = a, o.props[13] = n, o
  1897. }
  1898. function C(t) {
  1899. return this.getInverseMatrix().applyToPointArray(t[0], t[1], t[2] || 0)
  1900. }
  1901. function A(t) {
  1902. var e, r = t.length,
  1903. i = [];
  1904. for (e = 0; e < r; e += 1) i[e] = C(t[e]);
  1905. return i
  1906. }
  1907. function T(t, e, r) {
  1908. var i = createTypedArray("float32", 6);
  1909. if (this.isIdentity()) i[0] = t[0], i[1] = t[1], i[2] = e[0], i[3] = e[1], i[4] = r[0], i[5] = r[1];
  1910. else {
  1911. var s = this.props[0],
  1912. a = this.props[1],
  1913. n = this.props[4],
  1914. o = this.props[5],
  1915. h = this.props[12],
  1916. l = this.props[13];
  1917. i[0] = t[0] * s + t[1] * n + h, i[1] = t[0] * a + t[1] * o + l, i[2] = e[0] * s + e[1] * n + h, i[3] = e[0] * a + e[1] * o + l, i[4] = r[0] * s + r[1] * n + h, i[5] = r[0] * a + r[1] * o + l
  1918. }
  1919. return i
  1920. }
  1921. function D(t, e, r) {
  1922. return this.isIdentity() ? [t, e, r] : [t * this.props[0] + e * this.props[4] + r * this.props[8] + this.props[12], t * this.props[1] + e * this.props[5] + r * this.props[9] + this.props[13], t * this.props[2] + e * this.props[6] + r * this.props[10] + this.props[14]]
  1923. }
  1924. function k(t, e) {
  1925. if (this.isIdentity()) return t + "," + e;
  1926. var r = this.props;
  1927. return Math.round(100 * (t * r[0] + e * r[4] + r[12])) / 100 + "," + Math.round(100 * (t * r[1] + e * r[5] + r[13])) / 100
  1928. }
  1929. function M() {
  1930. for (var t = 0, e = this.props, r = "matrix3d("; t < 16;) r += i(1e4 * e[t]) / 1e4, r += 15 === t ? ")" : ",", t += 1;
  1931. return r
  1932. }
  1933. function F(t) {
  1934. return t < 1e-6 && t > 0 || t > -1e-6 && t < 0 ? i(1e4 * t) / 1e4 : t
  1935. }
  1936. function w() {
  1937. var t = this.props;
  1938. return "matrix(" + F(t[0]) + "," + F(t[1]) + "," + F(t[4]) + "," + F(t[5]) + "," + F(t[12]) + "," + F(t[13]) + ")"
  1939. }
  1940. return function() {
  1941. this.reset = s, this.rotate = a, this.rotateX = n, this.rotateY = o, this.rotateZ = h, this.skew = p, this.skewFromAxis = f, this.shear = l, this.scale = m, this.setTransform = c, this.translate = d, this.transform = u, this.applyToPoint = P, this.applyToX = E, this.applyToY = x, this.applyToZ = S, this.applyToPointArray = D, this.applyToTriplePoints = T, this.applyToPointStringified = k, this.toCSS = M, this.to2dCSS = w, this.clone = v, this.cloneFromProps = b, this.equals = g, this.inversePoints = A, this.inversePoint = C, this.getInverseMatrix = _, this._t = this.transform, this.isIdentity = y, this._identity = !0, this._identityCalculated = !1, this.props = createTypedArray("float32", 16), this.reset()
  1942. }
  1943. }();
  1944. function _typeof$3(t) {
  1945. return _typeof$3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
  1946. return typeof t
  1947. } : function(t) {
  1948. return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
  1949. }, _typeof$3(t)
  1950. }
  1951. var lottie = {},
  1952. standalone = "__[STANDALONE]__",
  1953. animationData = "__[ANIMATIONDATA]__",
  1954. renderer = "";
  1955. function setLocation(t) {
  1956. setLocationHref(t)
  1957. }
  1958. function searchAnimations() {
  1959. !0 === standalone ? animationManager.searchAnimations(animationData, standalone, renderer) : animationManager.searchAnimations()
  1960. }
  1961. function setSubframeRendering(t) {
  1962. setSubframeEnabled(t)
  1963. }
  1964. function setPrefix(t) {
  1965. setIdPrefix(t)
  1966. }
  1967. function loadAnimation(t) {
  1968. return !0 === standalone && (t.animationData = JSON.parse(animationData)), animationManager.loadAnimation(t)
  1969. }
  1970. function setQuality(t) {
  1971. if ("string" == typeof t) switch (t) {
  1972. case "high":
  1973. setDefaultCurveSegments(200);
  1974. break;
  1975. default:
  1976. case "medium":
  1977. setDefaultCurveSegments(50);
  1978. break;
  1979. case "low":
  1980. setDefaultCurveSegments(10)
  1981. } else !isNaN(t) && t > 1 && setDefaultCurveSegments(t);
  1982. getDefaultCurveSegments() >= 50 ? roundValues(!1) : roundValues(!0)
  1983. }
  1984. function inBrowser() {
  1985. return "undefined" != typeof navigator
  1986. }
  1987. function installPlugin(t, e) {
  1988. "expressions" === t && setExpressionsPlugin(e)
  1989. }
  1990. function getFactory(t) {
  1991. switch (t) {
  1992. case "propertyFactory":
  1993. return PropertyFactory;
  1994. case "shapePropertyFactory":
  1995. return ShapePropertyFactory;
  1996. case "matrix":
  1997. return Matrix;
  1998. default:
  1999. return null
  2000. }
  2001. }
  2002. function checkReady() {
  2003. "complete" === document.readyState && (clearInterval(readyStateCheckInterval), searchAnimations())
  2004. }
  2005. function getQueryVariable(t) {
  2006. for (var e = queryString.split("&"), r = 0; r < e.length; r += 1) {
  2007. var i = e[r].split("=");
  2008. if (decodeURIComponent(i[0]) == t) return decodeURIComponent(i[1])
  2009. }
  2010. return null
  2011. }
  2012. lottie.play = animationManager.play, lottie.pause = animationManager.pause, lottie.setLocationHref = setLocation, lottie.togglePause = animationManager.togglePause, lottie.setSpeed = animationManager.setSpeed, lottie.setDirection = animationManager.setDirection, lottie.stop = animationManager.stop, lottie.searchAnimations = searchAnimations, lottie.registerAnimation = animationManager.registerAnimation, lottie.loadAnimation = loadAnimation, lottie.setSubframeRendering = setSubframeRendering, lottie.resize = animationManager.resize, lottie.goToAndStop = animationManager.goToAndStop, lottie.destroy = animationManager.destroy, lottie.setQuality = setQuality, lottie.inBrowser = inBrowser, lottie.installPlugin = installPlugin, lottie.freeze = animationManager.freeze, lottie.unfreeze = animationManager.unfreeze, lottie.setVolume = animationManager.setVolume, lottie.mute = animationManager.mute, lottie.unmute = animationManager.unmute, lottie.getRegisteredAnimations = animationManager.getRegisteredAnimations, lottie.useWebWorker = setWebWorker, lottie.setIDPrefix = setPrefix, lottie.__getFactory = getFactory, lottie.version = "5.9.4";
  2013. var queryString = "";
  2014. if (standalone) {
  2015. var scripts = document.getElementsByTagName("script"),
  2016. index = scripts.length - 1,
  2017. myScript = scripts[index] || {
  2018. src: ""
  2019. };
  2020. queryString = myScript.src ? myScript.src.replace(/^[^\?]+\??/, "") : "", renderer = getQueryVariable("renderer")
  2021. }
  2022. var readyStateCheckInterval = setInterval(checkReady, 100);
  2023. try {
  2024. "object" === ("undefined" == typeof exports ? "undefined" : _typeof$3(exports)) && "undefined" != typeof module || "function" == typeof define && define.amd || (window.bodymovin = lottie)
  2025. } catch (t) {}
  2026. var ShapeModifiers = function() {
  2027. var t = {},
  2028. e = {};
  2029. return t.registerModifier = function(t, r) {
  2030. e[t] || (e[t] = r)
  2031. }, t.getModifier = function(t, r, i) {
  2032. return new e[t](r, i)
  2033. }, t
  2034. }();
  2035. function ShapeModifier() {}
  2036. function TrimModifier() {}
  2037. function PuckerAndBloatModifier() {}
  2038. ShapeModifier.prototype.initModifierProperties = function() {}, ShapeModifier.prototype.addShapeToModifier = function() {}, ShapeModifier.prototype.addShape = function(t) {
  2039. if (!this.closed) {
  2040. t.sh.container.addDynamicProperty(t.sh);
  2041. var e = {
  2042. shape: t.sh,
  2043. data: t,
  2044. localShapeCollection: shapeCollectionPool.newShapeCollection()
  2045. };
  2046. this.shapes.push(e), this.addShapeToModifier(e), this._isAnimated && t.setAsAnimated()
  2047. }
  2048. }, ShapeModifier.prototype.init = function(t, e) {
  2049. this.shapes = [], this.elem = t, this.initDynamicPropertyContainer(t), this.initModifierProperties(t, e), this.frameId = initialDefaultFrame, this.closed = !1, this.k = !1, this.dynamicProperties.length ? this.k = !0 : this.getValue(!0)
  2050. }, ShapeModifier.prototype.processKeys = function() {
  2051. this.elem.globalData.frameId !== this.frameId && (this.frameId = this.elem.globalData.frameId, this.iterateDynamicProperties())
  2052. }, extendPrototype([DynamicPropertyContainer], ShapeModifier), extendPrototype([ShapeModifier], TrimModifier), TrimModifier.prototype.initModifierProperties = function(t, e) {
  2053. this.s = PropertyFactory.getProp(t, e.s, 0, .01, this), this.e = PropertyFactory.getProp(t, e.e, 0, .01, this), this.o = PropertyFactory.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
  2054. }, TrimModifier.prototype.addShapeToModifier = function(t) {
  2055. t.pathsData = []
  2056. }, TrimModifier.prototype.calculateShapeEdges = function(t, e, r, i, s) {
  2057. var a = [];
  2058. e <= 1 ? a.push({
  2059. s: t,
  2060. e: e
  2061. }) : t >= 1 ? a.push({
  2062. s: t - 1,
  2063. e: e - 1
  2064. }) : (a.push({
  2065. s: t,
  2066. e: 1
  2067. }), a.push({
  2068. s: 0,
  2069. e: e - 1
  2070. }));
  2071. var n, o, h = [],
  2072. l = a.length;
  2073. for (n = 0; n < l; n += 1) {
  2074. var p, f;
  2075. if (!((o = a[n]).e * s < i || o.s * s > i + r)) p = o.s * s <= i ? 0 : (o.s * s - i) / r, f = o.e * s >= i + r ? 1 : (o.e * s - i) / r, h.push([p, f])
  2076. }
  2077. return h.length || h.push([0, 0]), h
  2078. }, TrimModifier.prototype.releasePathsData = function(t) {
  2079. var e, r = t.length;
  2080. for (e = 0; e < r; e += 1) segmentsLengthPool.release(t[e]);
  2081. return t.length = 0, t
  2082. }, TrimModifier.prototype.processShapes = function(t) {
  2083. var e, r, i, s;
  2084. if (this._mdf || t) {
  2085. var a = this.o.v % 360 / 360;
  2086. if (a < 0 && (a += 1), (e = this.s.v > 1 ? 1 + a : this.s.v < 0 ? 0 + a : this.s.v + a) > (r = this.e.v > 1 ? 1 + a : this.e.v < 0 ? 0 + a : this.e.v + a)) {
  2087. var n = e;
  2088. e = r, r = n
  2089. }
  2090. e = 1e-4 * Math.round(1e4 * e), r = 1e-4 * Math.round(1e4 * r), this.sValue = e, this.eValue = r
  2091. } else e = this.sValue, r = this.eValue;
  2092. var o, h, l, p, f, m = this.shapes.length,
  2093. c = 0;
  2094. if (r === e)
  2095. for (s = 0; s < m; s += 1) this.shapes[s].localShapeCollection.releaseShapes(), this.shapes[s].shape._mdf = !0, this.shapes[s].shape.paths = this.shapes[s].localShapeCollection, this._mdf && (this.shapes[s].pathsData.length = 0);
  2096. else if (1 === r && 0 === e || 0 === r && 1 === e) {
  2097. if (this._mdf)
  2098. for (s = 0; s < m; s += 1) this.shapes[s].pathsData.length = 0, this.shapes[s].shape._mdf = !0
  2099. } else {
  2100. var d, u, y = [];
  2101. for (s = 0; s < m; s += 1)
  2102. if ((d = this.shapes[s]).shape._mdf || this._mdf || t || 2 === this.m) {
  2103. if (h = (i = d.shape.paths)._length, f = 0, !d.shape._mdf && d.pathsData.length) f = d.totalShapeLength;
  2104. else {
  2105. for (l = this.releasePathsData(d.pathsData), o = 0; o < h; o += 1) p = bez.getSegmentsLength(i.shapes[o]), l.push(p), f += p.totalLength;
  2106. d.totalShapeLength = f, d.pathsData = l
  2107. }
  2108. c += f, d.shape._mdf = !0
  2109. } else d.shape.paths = d.localShapeCollection;
  2110. var g, v = e,
  2111. b = r,
  2112. P = 0;
  2113. for (s = m - 1; s >= 0; s -= 1)
  2114. if ((d = this.shapes[s]).shape._mdf) {
  2115. for ((u = d.localShapeCollection).releaseShapes(), 2 === this.m && m > 1 ? (g = this.calculateShapeEdges(e, r, d.totalShapeLength, P, c), P += d.totalShapeLength) : g = [
  2116. [v, b]
  2117. ], h = g.length, o = 0; o < h; o += 1) {
  2118. v = g[o][0], b = g[o][1], y.length = 0, b <= 1 ? y.push({
  2119. s: d.totalShapeLength * v,
  2120. e: d.totalShapeLength * b
  2121. }) : v >= 1 ? y.push({
  2122. s: d.totalShapeLength * (v - 1),
  2123. e: d.totalShapeLength * (b - 1)
  2124. }) : (y.push({
  2125. s: d.totalShapeLength * v,
  2126. e: d.totalShapeLength
  2127. }), y.push({
  2128. s: 0,
  2129. e: d.totalShapeLength * (b - 1)
  2130. }));
  2131. var E = this.addShapes(d, y[0]);
  2132. if (y[0].s !== y[0].e) {
  2133. if (y.length > 1)
  2134. if (d.shape.paths.shapes[d.shape.paths._length - 1].c) {
  2135. var x = E.pop();
  2136. this.addPaths(E, u), E = this.addShapes(d, y[1], x)
  2137. } else this.addPaths(E, u), E = this.addShapes(d, y[1]);
  2138. this.addPaths(E, u)
  2139. }
  2140. }
  2141. d.shape.paths = u
  2142. }
  2143. }
  2144. }, TrimModifier.prototype.addPaths = function(t, e) {
  2145. var r, i = t.length;
  2146. for (r = 0; r < i; r += 1) e.addShape(t[r])
  2147. }, TrimModifier.prototype.addSegment = function(t, e, r, i, s, a, n) {
  2148. s.setXYAt(e[0], e[1], "o", a), s.setXYAt(r[0], r[1], "i", a + 1), n && s.setXYAt(t[0], t[1], "v", a), s.setXYAt(i[0], i[1], "v", a + 1)
  2149. }, TrimModifier.prototype.addSegmentFromArray = function(t, e, r, i) {
  2150. e.setXYAt(t[1], t[5], "o", r), e.setXYAt(t[2], t[6], "i", r + 1), i && e.setXYAt(t[0], t[4], "v", r), e.setXYAt(t[3], t[7], "v", r + 1)
  2151. }, TrimModifier.prototype.addShapes = function(t, e, r) {
  2152. var i, s, a, n, o, h, l, p, f = t.pathsData,
  2153. m = t.shape.paths.shapes,
  2154. c = t.shape.paths._length,
  2155. d = 0,
  2156. u = [],
  2157. y = !0;
  2158. for (r ? (o = r._length, p = r._length) : (r = shapePool.newElement(), o = 0, p = 0), u.push(r), i = 0; i < c; i += 1) {
  2159. for (h = f[i].lengths, r.c = m[i].c, a = m[i].c ? h.length : h.length + 1, s = 1; s < a; s += 1)
  2160. if (d + (n = h[s - 1]).addedLength < e.s) d += n.addedLength, r.c = !1;
  2161. else {
  2162. if (d > e.e) {
  2163. r.c = !1;
  2164. break
  2165. }
  2166. e.s <= d && e.e >= d + n.addedLength ? (this.addSegment(m[i].v[s - 1], m[i].o[s - 1], m[i].i[s], m[i].v[s], r, o, y), y = !1) : (l = bez.getNewSegment(m[i].v[s - 1], m[i].v[s], m[i].o[s - 1], m[i].i[s], (e.s - d) / n.addedLength, (e.e - d) / n.addedLength, h[s - 1]), this.addSegmentFromArray(l, r, o, y), y = !1, r.c = !1), d += n.addedLength, o += 1
  2167. }
  2168. if (m[i].c && h.length) {
  2169. if (n = h[s - 1], d <= e.e) {
  2170. var g = h[s - 1].addedLength;
  2171. e.s <= d && e.e >= d + g ? (this.addSegment(m[i].v[s - 1], m[i].o[s - 1], m[i].i[0], m[i].v[0], r, o, y), y = !1) : (l = bez.getNewSegment(m[i].v[s - 1], m[i].v[0], m[i].o[s - 1], m[i].i[0], (e.s - d) / g, (e.e - d) / g, h[s - 1]), this.addSegmentFromArray(l, r, o, y), y = !1, r.c = !1)
  2172. } else r.c = !1;
  2173. d += n.addedLength, o += 1
  2174. }
  2175. if (r._length && (r.setXYAt(r.v[p][0], r.v[p][1], "i", p), r.setXYAt(r.v[r._length - 1][0], r.v[r._length - 1][1], "o", r._length - 1)), d > e.e) break;
  2176. i < c - 1 && (r = shapePool.newElement(), y = !0, u.push(r), o = 0)
  2177. }
  2178. return u
  2179. }, extendPrototype([ShapeModifier], PuckerAndBloatModifier), PuckerAndBloatModifier.prototype.initModifierProperties = function(t, e) {
  2180. this.getValue = this.processKeys, this.amount = PropertyFactory.getProp(t, e.a, 0, null, this), this._isAnimated = !!this.amount.effectsSequence.length
  2181. }, PuckerAndBloatModifier.prototype.processPath = function(t, e) {
  2182. var r = e / 100,
  2183. i = [0, 0],
  2184. s = t._length,
  2185. a = 0;
  2186. for (a = 0; a < s; a += 1) i[0] += t.v[a][0], i[1] += t.v[a][1];
  2187. i[0] /= s, i[1] /= s;
  2188. var n, o, h, l, p, f, m = shapePool.newElement();
  2189. for (m.c = t.c, a = 0; a < s; a += 1) n = t.v[a][0] + (i[0] - t.v[a][0]) * r, o = t.v[a][1] + (i[1] - t.v[a][1]) * r, h = t.o[a][0] + (i[0] - t.o[a][0]) * -r, l = t.o[a][1] + (i[1] - t.o[a][1]) * -r, p = t.i[a][0] + (i[0] - t.i[a][0]) * -r, f = t.i[a][1] + (i[1] - t.i[a][1]) * -r, m.setTripleAt(n, o, h, l, p, f, a);
  2190. return m
  2191. }, PuckerAndBloatModifier.prototype.processShapes = function(t) {
  2192. var e, r, i, s, a, n, o = this.shapes.length,
  2193. h = this.amount.v;
  2194. if (0 !== h)
  2195. for (r = 0; r < o; r += 1) {
  2196. if (n = (a = this.shapes[r]).localShapeCollection, a.shape._mdf || this._mdf || t)
  2197. for (n.releaseShapes(), a.shape._mdf = !0, e = a.shape.paths.shapes, s = a.shape.paths._length, i = 0; i < s; i += 1) n.addShape(this.processPath(e[i], h));
  2198. a.shape.paths = a.localShapeCollection
  2199. }
  2200. this.dynamicProperties.length || (this._mdf = !1)
  2201. };
  2202. var TransformPropertyFactory = function() {
  2203. var t = [0, 0];
  2204. function e(t, e, r) {
  2205. if (this.elem = t, this.frameId = -1, this.propType = "transform", this.data = e, this.v = new Matrix, this.pre = new Matrix, this.appliedTransformations = 0, this.initDynamicPropertyContainer(r || t), e.p && e.p.s ? (this.px = PropertyFactory.getProp(t, e.p.x, 0, 0, this), this.py = PropertyFactory.getProp(t, e.p.y, 0, 0, this), e.p.z && (this.pz = PropertyFactory.getProp(t, e.p.z, 0, 0, this))) : this.p = PropertyFactory.getProp(t, e.p || {
  2206. k: [0, 0, 0]
  2207. }, 1, 0, this), e.rx) {
  2208. if (this.rx = PropertyFactory.getProp(t, e.rx, 0, degToRads, this), this.ry = PropertyFactory.getProp(t, e.ry, 0, degToRads, this), this.rz = PropertyFactory.getProp(t, e.rz, 0, degToRads, this), e.or.k[0].ti) {
  2209. var i, s = e.or.k.length;
  2210. for (i = 0; i < s; i += 1) e.or.k[i].to = null, e.or.k[i].ti = null
  2211. }
  2212. this.or = PropertyFactory.getProp(t, e.or, 1, degToRads, this), this.or.sh = !0
  2213. } else this.r = PropertyFactory.getProp(t, e.r || {
  2214. k: 0
  2215. }, 0, degToRads, this);
  2216. e.sk && (this.sk = PropertyFactory.getProp(t, e.sk, 0, degToRads, this), this.sa = PropertyFactory.getProp(t, e.sa, 0, degToRads, this)), this.a = PropertyFactory.getProp(t, e.a || {
  2217. k: [0, 0, 0]
  2218. }, 1, 0, this), this.s = PropertyFactory.getProp(t, e.s || {
  2219. k: [100, 100, 100]
  2220. }, 1, .01, this), e.o ? this.o = PropertyFactory.getProp(t, e.o, 0, .01, t) : this.o = {
  2221. _mdf: !1,
  2222. v: 1
  2223. }, this._isDirty = !0, this.dynamicProperties.length || this.getValue(!0)
  2224. }
  2225. return e.prototype = {
  2226. applyToMatrix: function(t) {
  2227. var e = this._mdf;
  2228. 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])
  2229. },
  2230. getValue: function(e) {
  2231. if (this.elem.globalData.frameId !== this.frameId) {
  2232. if (this._isDirty && (this.precalculateMatrix(), this._isDirty = !1), this.iterateDynamicProperties(), this._mdf || e) {
  2233. var r;
  2234. 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) {
  2235. var i, s;
  2236. if (r = this.elem.globalData.frameRate, this.p && this.p.keyframes && this.p.getValueAtTime) this.p._caching.lastFrame + this.p.offsetTime <= this.p.keyframes[0].t ? (i = this.p.getValueAtTime((this.p.keyframes[0].t + .01) / r, 0), s = this.p.getValueAtTime(this.p.keyframes[0].t / r, 0)) : this.p._caching.lastFrame + this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t ? (i = this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length - 1].t / r, 0), s = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - .05) / r, 0)) : (i = this.p.pv, s = this.p.getValueAtTime((this.p._caching.lastFrame + this.p.offsetTime - .01) / r, this.p.offsetTime));
  2237. else if (this.px && this.px.keyframes && this.py.keyframes && this.px.getValueAtTime && this.py.getValueAtTime) {
  2238. i = [], s = [];
  2239. var a = this.px,
  2240. n = this.py;
  2241. a._caching.lastFrame + a.offsetTime <= a.keyframes[0].t ? (i[0] = a.getValueAtTime((a.keyframes[0].t + .01) / r, 0), i[1] = n.getValueAtTime((n.keyframes[0].t + .01) / r, 0), s[0] = a.getValueAtTime(a.keyframes[0].t / r, 0), s[1] = n.getValueAtTime(n.keyframes[0].t / r, 0)) : a._caching.lastFrame + a.offsetTime >= a.keyframes[a.keyframes.length - 1].t ? (i[0] = a.getValueAtTime(a.keyframes[a.keyframes.length - 1].t / r, 0), i[1] = n.getValueAtTime(n.keyframes[n.keyframes.length - 1].t / r, 0), s[0] = a.getValueAtTime((a.keyframes[a.keyframes.length - 1].t - .01) / r, 0), s[1] = n.getValueAtTime((n.keyframes[n.keyframes.length - 1].t - .01) / r, 0)) : (i = [a.pv, n.pv], s[0] = a.getValueAtTime((a._caching.lastFrame + a.offsetTime - .01) / r, a.offsetTime), s[1] = n.getValueAtTime((n._caching.lastFrame + n.offsetTime - .01) / r, n.offsetTime))
  2242. } else i = s = t;
  2243. this.v.rotate(-Math.atan2(i[1] - s[1], i[0] - s[0]))
  2244. }
  2245. 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])
  2246. }
  2247. this.frameId = this.elem.globalData.frameId
  2248. }
  2249. },
  2250. precalculateMatrix: function() {
  2251. if (!this.a.k && (this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]), this.appliedTransformations = 1, !this.s.effectsSequence.length)) {
  2252. if (this.pre.scale(this.s.v[0], this.s.v[1], this.s.v[2]), this.appliedTransformations = 2, this.sk) {
  2253. if (this.sk.effectsSequence.length || this.sa.effectsSequence.length) return;
  2254. this.pre.skewFromAxis(-this.sk.v, this.sa.v), this.appliedTransformations = 3
  2255. }
  2256. 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)
  2257. }
  2258. },
  2259. autoOrient: function() {}
  2260. }, extendPrototype([DynamicPropertyContainer], e), e.prototype.addDynamicProperty = function(t) {
  2261. this._addDynamicProperty(t), this.elem.addDynamicProperty(t), this._isDirty = !0
  2262. }, e.prototype._addDynamicProperty = DynamicPropertyContainer.prototype.addDynamicProperty, {
  2263. getTransformProperty: function(t, r, i) {
  2264. return new e(t, r, i)
  2265. }
  2266. }
  2267. }();
  2268. function RepeaterModifier() {}
  2269. function RoundCornersModifier() {}
  2270. function getFontProperties(t) {
  2271. for (var e = t.fStyle ? t.fStyle.split(" ") : [], r = "normal", i = "normal", s = e.length, a = 0; a < s; a += 1) switch (e[a].toLowerCase()) {
  2272. case "italic":
  2273. i = "italic";
  2274. break;
  2275. case "bold":
  2276. r = "700";
  2277. break;
  2278. case "black":
  2279. r = "900";
  2280. break;
  2281. case "medium":
  2282. r = "500";
  2283. break;
  2284. case "regular":
  2285. case "normal":
  2286. r = "400";
  2287. break;
  2288. case "light":
  2289. case "thin":
  2290. r = "200"
  2291. }
  2292. return {
  2293. style: i,
  2294. weight: t.fWeight || r
  2295. }
  2296. }
  2297. extendPrototype([ShapeModifier], RepeaterModifier), RepeaterModifier.prototype.initModifierProperties = function(t, e) {
  2298. this.getValue = this.processKeys, this.c = PropertyFactory.getProp(t, e.c, 0, null, this), this.o = PropertyFactory.getProp(t, e.o, 0, null, this), this.tr = TransformPropertyFactory.getTransformProperty(t, e.tr, this), this.so = PropertyFactory.getProp(t, e.tr.so, 0, .01, this), this.eo = PropertyFactory.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 Matrix, this.rMatrix = new Matrix, this.sMatrix = new Matrix, this.tMatrix = new Matrix, this.matrix = new Matrix
  2299. }, RepeaterModifier.prototype.applyTransforms = function(t, e, r, i, s, a) {
  2300. var n = a ? -1 : 1,
  2301. o = i.s.v[0] + (1 - i.s.v[0]) * (1 - s),
  2302. h = i.s.v[1] + (1 - i.s.v[1]) * (1 - s);
  2303. t.translate(i.p.v[0] * n * s, i.p.v[1] * n * s, i.p.v[2]), e.translate(-i.a.v[0], -i.a.v[1], i.a.v[2]), e.rotate(-i.r.v * n * s), e.translate(i.a.v[0], i.a.v[1], i.a.v[2]), r.translate(-i.a.v[0], -i.a.v[1], i.a.v[2]), r.scale(a ? 1 / o : o, a ? 1 / h : h), r.translate(i.a.v[0], i.a.v[1], i.a.v[2])
  2304. }, RepeaterModifier.prototype.init = function(t, e, r, i) {
  2305. for (this.elem = t, this.arr = e, this.pos = r, this.elemsData = i, this._currentCopies = 0, this._elements = [], this._groups = [], this.frameId = -1, this.initDynamicPropertyContainer(t), this.initModifierProperties(t, e[r]); r > 0;) r -= 1, this._elements.unshift(e[r]);
  2306. this.dynamicProperties.length ? this.k = !0 : this.getValue(!0)
  2307. }, RepeaterModifier.prototype.resetElements = function(t) {
  2308. var e, r = t.length;
  2309. for (e = 0; e < r; e += 1) t[e]._processed = !1, "gr" === t[e].ty && this.resetElements(t[e].it)
  2310. }, RepeaterModifier.prototype.cloneElements = function(t) {
  2311. var e = JSON.parse(JSON.stringify(t));
  2312. return this.resetElements(e), e
  2313. }, RepeaterModifier.prototype.changeGroupRender = function(t, e) {
  2314. var r, i = t.length;
  2315. for (r = 0; r < i; r += 1) t[r]._render = e, "gr" === t[r].ty && this.changeGroupRender(t[r].it, e)
  2316. }, RepeaterModifier.prototype.processShapes = function(t) {
  2317. var e, r, i, s, a, n = !1;
  2318. if (this._mdf || t) {
  2319. var o, h = Math.ceil(this.c.v);
  2320. if (this._groups.length < h) {
  2321. for (; this._groups.length < h;) {
  2322. var l = {
  2323. it: this.cloneElements(this._elements),
  2324. ty: "gr"
  2325. };
  2326. l.it.push({
  2327. a: {
  2328. a: 0,
  2329. ix: 1,
  2330. k: [0, 0]
  2331. },
  2332. nm: "Transform",
  2333. o: {
  2334. a: 0,
  2335. ix: 7,
  2336. k: 100
  2337. },
  2338. p: {
  2339. a: 0,
  2340. ix: 2,
  2341. k: [0, 0]
  2342. },
  2343. r: {
  2344. a: 1,
  2345. ix: 6,
  2346. k: [{
  2347. s: 0,
  2348. e: 0,
  2349. t: 0
  2350. }, {
  2351. s: 0,
  2352. e: 0,
  2353. t: 1
  2354. }]
  2355. },
  2356. s: {
  2357. a: 0,
  2358. ix: 3,
  2359. k: [100, 100]
  2360. },
  2361. sa: {
  2362. a: 0,
  2363. ix: 5,
  2364. k: 0
  2365. },
  2366. sk: {
  2367. a: 0,
  2368. ix: 4,
  2369. k: 0
  2370. },
  2371. ty: "tr"
  2372. }), this.arr.splice(0, 0, l), this._groups.splice(0, 0, l), this._currentCopies += 1
  2373. }
  2374. this.elem.reloadShapes(), n = !0
  2375. }
  2376. for (a = 0, i = 0; i <= this._groups.length - 1; i += 1) {
  2377. if (o = a < h, this._groups[i]._render = o, this.changeGroupRender(this._groups[i].it, o), !o) {
  2378. var p = this.elemsData[i].it,
  2379. f = p[p.length - 1];
  2380. 0 !== f.transform.op.v ? (f.transform.op._mdf = !0, f.transform.op.v = 0) : f.transform.op._mdf = !1
  2381. }
  2382. a += 1
  2383. }
  2384. this._currentCopies = h;
  2385. var m = this.o.v,
  2386. c = m % 1,
  2387. d = m > 0 ? Math.floor(m) : Math.ceil(m),
  2388. u = this.pMatrix.props,
  2389. y = this.rMatrix.props,
  2390. g = this.sMatrix.props;
  2391. this.pMatrix.reset(), this.rMatrix.reset(), this.sMatrix.reset(), this.tMatrix.reset(), this.matrix.reset();
  2392. var v, b, P = 0;
  2393. if (m > 0) {
  2394. for (; P < d;) this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, !1), P += 1;
  2395. c && (this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, c, !1), P += c)
  2396. } else if (m < 0) {
  2397. for (; P > d;) this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, !0), P -= 1;
  2398. c && (this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, -c, !0), P -= c)
  2399. }
  2400. for (i = 1 === this.data.m ? 0 : this._currentCopies - 1, s = 1 === this.data.m ? 1 : -1, a = this._currentCopies; a;) {
  2401. if (b = (r = (e = this.elemsData[i].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) * (i / (this._currentCopies - 1)), 0 !== P) {
  2402. for ((0 !== i && 1 === s || i !== this._currentCopies - 1 && -1 === s) && this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, !1), this.matrix.transform(y[0], y[1], y[2], y[3], y[4], y[5], y[6], y[7], y[8], y[9], y[10], y[11], y[12], y[13], y[14], y[15]), this.matrix.transform(g[0], g[1], g[2], g[3], g[4], g[5], g[6], g[7], g[8], g[9], g[10], g[11], g[12], g[13], g[14], g[15]), this.matrix.transform(u[0], u[1], u[2], u[3], u[4], u[5], u[6], u[7], u[8], u[9], u[10], u[11], u[12], u[13], u[14], u[15]), v = 0; v < b; v += 1) r[v] = this.matrix.props[v];
  2403. this.matrix.reset()
  2404. } else
  2405. for (this.matrix.reset(), v = 0; v < b; v += 1) r[v] = this.matrix.props[v];
  2406. P += 1, a -= 1, i += s
  2407. }
  2408. } else
  2409. for (a = this._currentCopies, i = 0, s = 1; a;) r = (e = this.elemsData[i].it)[e.length - 1].transform.mProps.v.props, e[e.length - 1].transform.mProps._mdf = !1, e[e.length - 1].transform.op._mdf = !1, a -= 1, i += s;
  2410. return n
  2411. }, RepeaterModifier.prototype.addShape = function() {}, extendPrototype([ShapeModifier], RoundCornersModifier), RoundCornersModifier.prototype.initModifierProperties = function(t, e) {
  2412. this.getValue = this.processKeys, this.rd = PropertyFactory.getProp(t, e.r, 0, null, this), this._isAnimated = !!this.rd.effectsSequence.length
  2413. }, RoundCornersModifier.prototype.processPath = function(t, e) {
  2414. var r, i = shapePool.newElement();
  2415. i.c = t.c;
  2416. var s, a, n, o, h, l, p, f, m, c, d, u, y = t._length,
  2417. g = 0;
  2418. for (r = 0; r < y; r += 1) s = t.v[r], n = t.o[r], a = t.i[r], s[0] === n[0] && s[1] === n[1] && s[0] === a[0] && s[1] === a[1] ? 0 !== r && r !== y - 1 || t.c ? (o = 0 === r ? t.v[y - 1] : t.v[r - 1], l = (h = Math.sqrt(Math.pow(s[0] - o[0], 2) + Math.pow(s[1] - o[1], 2))) ? Math.min(h / 2, e) / h : 0, p = d = s[0] + (o[0] - s[0]) * l, f = u = s[1] - (s[1] - o[1]) * l, m = p - (p - s[0]) * roundCorner, c = f - (f - s[1]) * roundCorner, i.setTripleAt(p, f, m, c, d, u, g), g += 1, o = r === y - 1 ? t.v[0] : t.v[r + 1], l = (h = Math.sqrt(Math.pow(s[0] - o[0], 2) + Math.pow(s[1] - o[1], 2))) ? Math.min(h / 2, e) / h : 0, p = m = s[0] + (o[0] - s[0]) * l, f = c = s[1] + (o[1] - s[1]) * l, d = p - (p - s[0]) * roundCorner, u = f - (f - s[1]) * roundCorner, i.setTripleAt(p, f, m, c, d, u, g), g += 1) : (i.setTripleAt(s[0], s[1], n[0], n[1], a[0], a[1], g), g += 1) : (i.setTripleAt(t.v[r][0], t.v[r][1], t.o[r][0], t.o[r][1], t.i[r][0], t.i[r][1], g), g += 1);
  2419. return i
  2420. }, RoundCornersModifier.prototype.processShapes = function(t) {
  2421. var e, r, i, s, a, n, o = this.shapes.length,
  2422. h = this.rd.v;
  2423. if (0 !== h)
  2424. for (r = 0; r < o; r += 1) {
  2425. if (n = (a = this.shapes[r]).localShapeCollection, a.shape._mdf || this._mdf || t)
  2426. for (n.releaseShapes(), a.shape._mdf = !0, e = a.shape.paths.shapes, s = a.shape.paths._length, i = 0; i < s; i += 1) n.addShape(this.processPath(e[i], h));
  2427. a.shape.paths = a.localShapeCollection
  2428. }
  2429. this.dynamicProperties.length || (this._mdf = !1)
  2430. };
  2431. var FontManager = function() {
  2432. var t = {
  2433. w: 0,
  2434. size: 0,
  2435. shapes: [],
  2436. data: {
  2437. shapes: []
  2438. }
  2439. },
  2440. e = [];
  2441. e = e.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]);
  2442. var r = ["d83cdffb", "d83cdffc", "d83cdffd", "d83cdffe", "d83cdfff"],
  2443. i = [65039, 8205];
  2444. function s(t, e) {
  2445. var r = createTag("span");
  2446. r.setAttribute("aria-hidden", !0), r.style.fontFamily = e;
  2447. var i = createTag("span");
  2448. i.innerText = "giItT1WQy@!-/#", r.style.position = "absolute", r.style.left = "-10000px", r.style.top = "-10000px", r.style.fontSize = "300px", r.style.fontVariant = "normal", r.style.fontStyle = "normal", r.style.fontWeight = "normal", r.style.letterSpacing = "0", r.appendChild(i), document.body.appendChild(r);
  2449. var s = i.offsetWidth;
  2450. return i.style.fontFamily = function(t) {
  2451. var e, r = t.split(","),
  2452. i = r.length,
  2453. s = [];
  2454. for (e = 0; e < i; e += 1) "sans-serif" !== r[e] && "monospace" !== r[e] && s.push(r[e]);
  2455. return s.join(",")
  2456. }(t) + ", " + e, {
  2457. node: i,
  2458. w: s,
  2459. parent: r
  2460. }
  2461. }
  2462. function a(t, e) {
  2463. var r, i = document.body && e ? "svg" : "canvas",
  2464. s = getFontProperties(t);
  2465. if ("svg" === i) {
  2466. var a = createNS("text");
  2467. a.style.fontSize = "100px", a.setAttribute("font-family", t.fFamily), a.setAttribute("font-style", s.style), a.setAttribute("font-weight", s.weight), a.textContent = "1", t.fClass ? (a.style.fontFamily = "inherit", a.setAttribute("class", t.fClass)) : a.style.fontFamily = t.fFamily, e.appendChild(a), r = a
  2468. } else {
  2469. var n = new OffscreenCanvas(500, 500).getContext("2d");
  2470. n.font = s.style + " " + s.weight + " 100px " + t.fFamily, r = n
  2471. }
  2472. return {
  2473. measureText: function(t) {
  2474. return "svg" === i ? (r.textContent = t, r.getComputedTextLength()) : r.measureText(t).width
  2475. }
  2476. }
  2477. }
  2478. var n = function() {
  2479. 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)
  2480. };
  2481. n.isModifier = function(t, e) {
  2482. var i = t.toString(16) + e.toString(16);
  2483. return -1 !== r.indexOf(i)
  2484. }, n.isZeroWidthJoiner = function(t, e) {
  2485. return e ? t === i[0] && e === i[1] : t === i[1]
  2486. }, n.isCombinedCharacter = function(t) {
  2487. return -1 !== e.indexOf(t)
  2488. };
  2489. var o = {
  2490. addChars: function(t) {
  2491. if (t) {
  2492. var e;
  2493. this.chars || (this.chars = []);
  2494. var r, i, s = t.length,
  2495. a = this.chars.length;
  2496. for (e = 0; e < s; e += 1) {
  2497. for (r = 0, i = !1; r < a;) this.chars[r].style === t[e].style && this.chars[r].fFamily === t[e].fFamily && this.chars[r].ch === t[e].ch && (i = !0), r += 1;
  2498. i || (this.chars.push(t[e]), a += 1)
  2499. }
  2500. }
  2501. },
  2502. addFonts: function(t, e) {
  2503. if (t) {
  2504. if (this.chars) return this.isLoaded = !0, void(this.fonts = t.list);
  2505. if (!document.body) return this.isLoaded = !0, t.list.forEach((function(t) {
  2506. t.helper = a(t), t.cache = {}
  2507. })), void(this.fonts = t.list);
  2508. var r, i = t.list,
  2509. n = i.length,
  2510. o = n;
  2511. for (r = 0; r < n; r += 1) {
  2512. var h, l, p = !0;
  2513. if (i[r].loaded = !1, i[r].monoCase = s(i[r].fFamily, "monospace"), i[r].sansCase = s(i[r].fFamily, "sans-serif"), i[r].fPath) {
  2514. if ("p" === i[r].fOrigin || 3 === i[r].origin) {
  2515. if ((h = document.querySelectorAll('style[f-forigin="p"][f-family="' + i[r].fFamily + '"], style[f-origin="3"][f-family="' + i[r].fFamily + '"]')).length > 0 && (p = !1), p) {
  2516. var f = createTag("style");
  2517. f.setAttribute("f-forigin", i[r].fOrigin), f.setAttribute("f-origin", i[r].origin), f.setAttribute("f-family", i[r].fFamily), f.type = "text/css", f.innerText = "@font-face {font-family: " + i[r].fFamily + "; font-style: normal; src: url('" + i[r].fPath + "');}", e.appendChild(f)
  2518. }
  2519. } else if ("g" === i[r].fOrigin || 1 === i[r].origin) {
  2520. for (h = document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'), l = 0; l < h.length; l += 1) - 1 !== h[l].href.indexOf(i[r].fPath) && (p = !1);
  2521. if (p) {
  2522. var m = createTag("link");
  2523. m.setAttribute("f-forigin", i[r].fOrigin), m.setAttribute("f-origin", i[r].origin), m.type = "text/css", m.rel = "stylesheet", m.href = i[r].fPath, document.body.appendChild(m)
  2524. }
  2525. } else if ("t" === i[r].fOrigin || 2 === i[r].origin) {
  2526. for (h = document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'), l = 0; l < h.length; l += 1) i[r].fPath === h[l].src && (p = !1);
  2527. if (p) {
  2528. var c = createTag("link");
  2529. c.setAttribute("f-forigin", i[r].fOrigin), c.setAttribute("f-origin", i[r].origin), c.setAttribute("rel", "stylesheet"), c.setAttribute("href", i[r].fPath), e.appendChild(c)
  2530. }
  2531. }
  2532. } else i[r].loaded = !0, o -= 1;
  2533. i[r].helper = a(i[r], e), i[r].cache = {}, this.fonts.push(i[r])
  2534. }
  2535. 0 === o ? this.isLoaded = !0 : setTimeout(this.checkLoadedFonts.bind(this), 100)
  2536. } else this.isLoaded = !0
  2537. },
  2538. getCharData: function(e, r, i) {
  2539. for (var s = 0, a = this.chars.length; s < a;) {
  2540. if (this.chars[s].ch === e && this.chars[s].style === r && this.chars[s].fFamily === i) return this.chars[s];
  2541. s += 1
  2542. }
  2543. return ("string" == typeof e && 13 !== e.charCodeAt(0) || !e) && console && console.warn && !this._warned && (this._warned = !0, console.warn("Missing character from exported characters list: ", e, r, i)), t
  2544. },
  2545. getFontByName: function(t) {
  2546. for (var e = 0, r = this.fonts.length; e < r;) {
  2547. if (this.fonts[e].fName === t) return this.fonts[e];
  2548. e += 1
  2549. }
  2550. return this.fonts[0]
  2551. },
  2552. measureText: function(t, e, r) {
  2553. var i = this.getFontByName(e),
  2554. s = t.charCodeAt(0);
  2555. if (!i.cache[s + 1]) {
  2556. var a = i.helper;
  2557. if (" " === t) {
  2558. var n = a.measureText("|" + t + "|"),
  2559. o = a.measureText("||");
  2560. i.cache[s + 1] = (n - o) / 100
  2561. } else i.cache[s + 1] = a.measureText(t) / 100
  2562. }
  2563. return i.cache[s + 1] * r
  2564. },
  2565. checkLoadedFonts: function() {
  2566. var t, e, r, i = this.fonts.length,
  2567. s = i;
  2568. for (t = 0; t < i; t += 1) this.fonts[t].loaded ? s -= 1 : "n" === this.fonts[t].fOrigin || 0 === this.fonts[t].origin ? this.fonts[t].loaded = !0 : (e = this.fonts[t].monoCase.node, r = this.fonts[t].monoCase.w, e.offsetWidth !== r ? (s -= 1, this.fonts[t].loaded = !0) : (e = this.fonts[t].sansCase.node, r = this.fonts[t].sansCase.w, e.offsetWidth !== r && (s -= 1, this.fonts[t].loaded = !0)), this.fonts[t].loaded && (this.fonts[t].sansCase.parent.parentNode.removeChild(this.fonts[t].sansCase.parent), this.fonts[t].monoCase.parent.parentNode.removeChild(this.fonts[t].monoCase.parent)));
  2569. 0 !== s && Date.now() - this.initTime < 5e3 ? setTimeout(this.checkLoadedFontsBinded, 20) : setTimeout(this.setIsLoadedBinded, 10)
  2570. },
  2571. setIsLoaded: function() {
  2572. this.isLoaded = !0
  2573. }
  2574. };
  2575. return n.prototype = o, n
  2576. }();
  2577. function RenderableElement() {}
  2578. RenderableElement.prototype = {
  2579. initRenderable: function() {
  2580. this.isInRange = !1, this.hidden = !1, this.isTransparent = !1, this.renderableComponents = []
  2581. },
  2582. addRenderableComponent: function(t) {
  2583. -1 === this.renderableComponents.indexOf(t) && this.renderableComponents.push(t)
  2584. },
  2585. removeRenderableComponent: function(t) {
  2586. -1 !== this.renderableComponents.indexOf(t) && this.renderableComponents.splice(this.renderableComponents.indexOf(t), 1)
  2587. },
  2588. prepareRenderableFrame: function(t) {
  2589. this.checkLayerLimits(t)
  2590. },
  2591. checkTransparency: function() {
  2592. this.finalTransform.mProp.o.v <= 0 ? !this.isTransparent && this.globalData.renderConfig.hideOnTransparent && (this.isTransparent = !0, this.hide()) : this.isTransparent && (this.isTransparent = !1, this.show())
  2593. },
  2594. checkLayerLimits: function(t) {
  2595. 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())
  2596. },
  2597. renderRenderable: function() {
  2598. var t, e = this.renderableComponents.length;
  2599. for (t = 0; t < e; t += 1) this.renderableComponents[t].renderFrame(this._isFirstFrame)
  2600. },
  2601. sourceRectAtTime: function() {
  2602. return {
  2603. top: 0,
  2604. left: 0,
  2605. width: 100,
  2606. height: 100
  2607. }
  2608. },
  2609. getLayerSize: function() {
  2610. return 5 === this.data.ty ? {
  2611. w: this.data.textData.width,
  2612. h: this.data.textData.height
  2613. } : {
  2614. w: this.data.width,
  2615. h: this.data.height
  2616. }
  2617. }
  2618. };
  2619. var MaskManagerInterface = function() {
  2620. function t(t, e) {
  2621. this._mask = t, this._data = e
  2622. }
  2623. Object.defineProperty(t.prototype, "maskPath", {
  2624. get: function() {
  2625. return this._mask.prop.k && this._mask.prop.getValue(), this._mask.prop
  2626. }
  2627. }), Object.defineProperty(t.prototype, "maskOpacity", {
  2628. get: function() {
  2629. return this._mask.op.k && this._mask.op.getValue(), 100 * this._mask.op.v
  2630. }
  2631. });
  2632. return function(e) {
  2633. var r, i = createSizedArray(e.viewData.length),
  2634. s = e.viewData.length;
  2635. for (r = 0; r < s; r += 1) i[r] = new t(e.viewData[r], e.masksProperties[r]);
  2636. return function(t) {
  2637. for (r = 0; r < s;) {
  2638. if (e.masksProperties[r].nm === t) return i[r];
  2639. r += 1
  2640. }
  2641. return null
  2642. }
  2643. }
  2644. }(),
  2645. ExpressionPropertyInterface = function() {
  2646. var t = {
  2647. pv: 0,
  2648. v: 0,
  2649. mult: 1
  2650. },
  2651. e = {
  2652. pv: [0, 0, 0],
  2653. v: [0, 0, 0],
  2654. mult: 1
  2655. };
  2656. function r(t, e, r) {
  2657. Object.defineProperty(t, "velocity", {
  2658. get: function() {
  2659. return e.getVelocityAtTime(e.comp.currentFrame)
  2660. }
  2661. }), t.numKeys = e.keyframes ? e.keyframes.length : 0, t.key = function(i) {
  2662. if (!t.numKeys) return 0;
  2663. var s = "";
  2664. s = "s" in e.keyframes[i - 1] ? e.keyframes[i - 1].s : "e" in e.keyframes[i - 2] ? e.keyframes[i - 2].e : e.keyframes[i - 2].s;
  2665. var a = "unidimensional" === r ? new Number(s) : Object.assign({}, s);
  2666. return a.time = e.keyframes[i - 1].t / e.elem.comp.globalData.frameRate, a.value = "unidimensional" === r ? s[0] : s, a
  2667. }, t.valueAtTime = e.getValueAtTime, t.speedAtTime = e.getSpeedAtTime, t.velocityAtTime = e.getVelocityAtTime, t.propertyGroup = e.propertyGroup
  2668. }
  2669. function i() {
  2670. return t
  2671. }
  2672. return function(s) {
  2673. return s ? "unidimensional" === s.propType ? function(e) {
  2674. e && "pv" in e || (e = t);
  2675. var i = 1 / e.mult,
  2676. s = e.pv * i,
  2677. a = new Number(s);
  2678. return a.value = s, r(a, e, "unidimensional"),
  2679. function() {
  2680. return e.k && e.getValue(), s = e.v * i, a.value !== s && ((a = new Number(s)).value = s, r(a, e, "unidimensional")), a
  2681. }
  2682. }(s) : function(t) {
  2683. t && "pv" in t || (t = e);
  2684. var i = 1 / t.mult,
  2685. s = t.data && t.data.l || t.pv.length,
  2686. a = createTypedArray("float32", s),
  2687. n = createTypedArray("float32", s);
  2688. return a.value = n, r(a, t, "multidimensional"),
  2689. function() {
  2690. t.k && t.getValue();
  2691. for (var e = 0; e < s; e += 1) n[e] = t.v[e] * i, a[e] = n[e];
  2692. return a
  2693. }
  2694. }(s) : i
  2695. }
  2696. }(),
  2697. TransformExpressionInterface = function(t) {
  2698. function e(t) {
  2699. switch (t) {
  2700. case "scale":
  2701. case "Scale":
  2702. case "ADBE Scale":
  2703. case 6:
  2704. return e.scale;
  2705. case "rotation":
  2706. case "Rotation":
  2707. case "ADBE Rotation":
  2708. case "ADBE Rotate Z":
  2709. case 10:
  2710. return e.rotation;
  2711. case "ADBE Rotate X":
  2712. return e.xRotation;
  2713. case "ADBE Rotate Y":
  2714. return e.yRotation;
  2715. case "position":
  2716. case "Position":
  2717. case "ADBE Position":
  2718. case 2:
  2719. return e.position;
  2720. case "ADBE Position_0":
  2721. return e.xPosition;
  2722. case "ADBE Position_1":
  2723. return e.yPosition;
  2724. case "ADBE Position_2":
  2725. return e.zPosition;
  2726. case "anchorPoint":
  2727. case "AnchorPoint":
  2728. case "Anchor Point":
  2729. case "ADBE AnchorPoint":
  2730. case 1:
  2731. return e.anchorPoint;
  2732. case "opacity":
  2733. case "Opacity":
  2734. case 11:
  2735. return e.opacity;
  2736. default:
  2737. return null
  2738. }
  2739. }
  2740. var r, i, s, a;
  2741. return Object.defineProperty(e, "rotation", {
  2742. get: ExpressionPropertyInterface(t.r || t.rz)
  2743. }), Object.defineProperty(e, "zRotation", {
  2744. get: ExpressionPropertyInterface(t.rz || t.r)
  2745. }), Object.defineProperty(e, "xRotation", {
  2746. get: ExpressionPropertyInterface(t.rx)
  2747. }), Object.defineProperty(e, "yRotation", {
  2748. get: ExpressionPropertyInterface(t.ry)
  2749. }), Object.defineProperty(e, "scale", {
  2750. get: ExpressionPropertyInterface(t.s)
  2751. }), t.p ? a = ExpressionPropertyInterface(t.p) : (r = ExpressionPropertyInterface(t.px), i = ExpressionPropertyInterface(t.py), t.pz && (s = ExpressionPropertyInterface(t.pz))), Object.defineProperty(e, "position", {
  2752. get: function() {
  2753. return t.p ? a() : [r(), i(), s ? s() : 0]
  2754. }
  2755. }), Object.defineProperty(e, "xPosition", {
  2756. get: ExpressionPropertyInterface(t.px)
  2757. }), Object.defineProperty(e, "yPosition", {
  2758. get: ExpressionPropertyInterface(t.py)
  2759. }), Object.defineProperty(e, "zPosition", {
  2760. get: ExpressionPropertyInterface(t.pz)
  2761. }), Object.defineProperty(e, "anchorPoint", {
  2762. get: ExpressionPropertyInterface(t.a)
  2763. }), Object.defineProperty(e, "opacity", {
  2764. get: ExpressionPropertyInterface(t.o)
  2765. }), Object.defineProperty(e, "skew", {
  2766. get: ExpressionPropertyInterface(t.sk)
  2767. }), Object.defineProperty(e, "skewAxis", {
  2768. get: ExpressionPropertyInterface(t.sa)
  2769. }), Object.defineProperty(e, "orientation", {
  2770. get: ExpressionPropertyInterface(t.or)
  2771. }), e
  2772. },
  2773. LayerExpressionInterface = function() {
  2774. function t(t) {
  2775. var e = new Matrix;
  2776. void 0 !== t ? this._elem.finalTransform.mProp.getValueAtTime(t).clone(e) : this._elem.finalTransform.mProp.applyToMatrix(e);
  2777. return e
  2778. }
  2779. function e(t, e) {
  2780. var r = this.getMatrix(e);
  2781. return r.props[12] = 0, r.props[13] = 0, r.props[14] = 0, this.applyPoint(r, t)
  2782. }
  2783. function r(t, e) {
  2784. var r = this.getMatrix(e);
  2785. return this.applyPoint(r, t)
  2786. }
  2787. function i(t, e) {
  2788. var r = this.getMatrix(e);
  2789. return r.props[12] = 0, r.props[13] = 0, r.props[14] = 0, this.invertPoint(r, t)
  2790. }
  2791. function s(t, e) {
  2792. var r = this.getMatrix(e);
  2793. return this.invertPoint(r, t)
  2794. }
  2795. function a(t, e) {
  2796. if (this._elem.hierarchy && this._elem.hierarchy.length) {
  2797. var r, i = this._elem.hierarchy.length;
  2798. for (r = 0; r < i; r += 1) this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(t)
  2799. }
  2800. return t.applyToPointArray(e[0], e[1], e[2] || 0)
  2801. }
  2802. function n(t, e) {
  2803. if (this._elem.hierarchy && this._elem.hierarchy.length) {
  2804. var r, i = this._elem.hierarchy.length;
  2805. for (r = 0; r < i; r += 1) this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(t)
  2806. }
  2807. return t.inversePoint(e)
  2808. }
  2809. function o(t) {
  2810. var e = new Matrix;
  2811. if (e.reset(), this._elem.finalTransform.mProp.applyToMatrix(e), this._elem.hierarchy && this._elem.hierarchy.length) {
  2812. var r, i = this._elem.hierarchy.length;
  2813. for (r = 0; r < i; r += 1) this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(e);
  2814. return e.inversePoint(t)
  2815. }
  2816. return e.inversePoint(t)
  2817. }
  2818. function h() {
  2819. return [1, 1, 1, 1]
  2820. }
  2821. return function(l) {
  2822. var p;
  2823. function f(t) {
  2824. switch (t) {
  2825. case "ADBE Root Vectors Group":
  2826. case "Contents":
  2827. case 2:
  2828. return f.shapeInterface;
  2829. case 1:
  2830. case 6:
  2831. case "Transform":
  2832. case "transform":
  2833. case "ADBE Transform Group":
  2834. return p;
  2835. case 4:
  2836. case "ADBE Effect Parade":
  2837. case "effects":
  2838. case "Effects":
  2839. return f.effect;
  2840. case "ADBE Text Properties":
  2841. return f.textInterface;
  2842. default:
  2843. return null
  2844. }
  2845. }
  2846. f.getMatrix = t, f.invertPoint = n, f.applyPoint = a, f.toWorld = r, f.toWorldVec = e, f.fromWorld = s, f.fromWorldVec = i, f.toComp = r, f.fromComp = o, f.sampleImage = h, f.sourceRectAtTime = l.sourceRectAtTime.bind(l), f._elem = l;
  2847. var m = getDescriptor(p = TransformExpressionInterface(l.finalTransform.mProp), "anchorPoint");
  2848. return Object.defineProperties(f, {
  2849. hasParent: {
  2850. get: function() {
  2851. return l.hierarchy.length
  2852. }
  2853. },
  2854. parent: {
  2855. get: function() {
  2856. return l.hierarchy[0].layerInterface
  2857. }
  2858. },
  2859. rotation: getDescriptor(p, "rotation"),
  2860. scale: getDescriptor(p, "scale"),
  2861. position: getDescriptor(p, "position"),
  2862. opacity: getDescriptor(p, "opacity"),
  2863. anchorPoint: m,
  2864. anchor_point: m,
  2865. transform: {
  2866. get: function() {
  2867. return p
  2868. }
  2869. },
  2870. active: {
  2871. get: function() {
  2872. return l.isInRange
  2873. }
  2874. }
  2875. }), f.startTime = l.data.st, f.index = l.data.ind, f.source = l.data.refId, f.height = 0 === l.data.ty ? l.data.h : 100, f.width = 0 === l.data.ty ? l.data.w : 100, f.inPoint = l.data.ip / l.comp.globalData.frameRate, f.outPoint = l.data.op / l.comp.globalData.frameRate, f._name = l.data.nm, f.registerMaskInterface = function(t) {
  2876. f.mask = new MaskManagerInterface(t, l)
  2877. }, f.registerEffectsInterface = function(t) {
  2878. f.effect = t
  2879. }, f
  2880. }
  2881. }(),
  2882. propertyGroupFactory = function(t, e) {
  2883. return function(r) {
  2884. return (r = void 0 === r ? 1 : r) <= 0 ? t : e(r - 1)
  2885. }
  2886. },
  2887. PropertyInterface = function(t, e) {
  2888. var r = {
  2889. _name: t
  2890. };
  2891. return function(t) {
  2892. return (t = void 0 === t ? 1 : t) <= 0 ? r : e(t - 1)
  2893. }
  2894. },
  2895. EffectsExpressionInterface = function() {
  2896. function t(r, i, s, a) {
  2897. function n(t) {
  2898. for (var e = r.ef, i = 0, s = e.length; i < s;) {
  2899. if (t === e[i].nm || t === e[i].mn || t === e[i].ix) return 5 === e[i].ty ? l[i] : l[i]();
  2900. i += 1
  2901. }
  2902. throw new Error
  2903. }
  2904. var o, h = propertyGroupFactory(n, s),
  2905. l = [],
  2906. p = r.ef.length;
  2907. for (o = 0; o < p; o += 1) 5 === r.ef[o].ty ? l.push(t(r.ef[o], i.effectElements[o], i.effectElements[o].propertyGroup, a)) : l.push(e(i.effectElements[o], r.ef[o].ty, a, h));
  2908. return "ADBE Color Control" === r.mn && Object.defineProperty(n, "color", {
  2909. get: function() {
  2910. return l[0]()
  2911. }
  2912. }), Object.defineProperties(n, {
  2913. numProperties: {
  2914. get: function() {
  2915. return r.np
  2916. }
  2917. },
  2918. _name: {
  2919. value: r.nm
  2920. },
  2921. propertyGroup: {
  2922. value: h
  2923. }
  2924. }), n.enabled = 0 !== r.en, n.active = n.enabled, n
  2925. }
  2926. function e(t, e, r, i) {
  2927. var s = ExpressionPropertyInterface(t.p);
  2928. return t.p.setGroupProperty && t.p.setGroupProperty(PropertyInterface("", i)),
  2929. function() {
  2930. return 10 === e ? r.comp.compInterface(t.p.v) : s()
  2931. }
  2932. }
  2933. return {
  2934. createEffectsInterface: function(e, r) {
  2935. if (e.effectsManager) {
  2936. var i, s = [],
  2937. a = e.data.ef,
  2938. n = e.effectsManager.effectElements.length;
  2939. for (i = 0; i < n; i += 1) s.push(t(a[i], e.effectsManager.effectElements[i], r, e));
  2940. var o = e.data.ef || [],
  2941. h = function(t) {
  2942. for (i = 0, n = o.length; i < n;) {
  2943. if (t === o[i].nm || t === o[i].mn || t === o[i].ix) return s[i];
  2944. i += 1
  2945. }
  2946. return null
  2947. };
  2948. return Object.defineProperty(h, "numProperties", {
  2949. get: function() {
  2950. return o.length
  2951. }
  2952. }), h
  2953. }
  2954. return null
  2955. }
  2956. }
  2957. }(),
  2958. CompExpressionInterface = function(t) {
  2959. function e(e) {
  2960. for (var r = 0, i = t.layers.length; r < i;) {
  2961. if (t.layers[r].nm === e || t.layers[r].ind === e) return t.elements[r].layerInterface;
  2962. r += 1
  2963. }
  2964. return null
  2965. }
  2966. return Object.defineProperty(e, "_name", {
  2967. value: t.data.nm
  2968. }), e.layer = e, e.pixelAspect = 1, e.height = t.data.h || t.globalData.compSize.h, e.width = t.data.w || t.globalData.compSize.w, e.pixelAspect = 1, e.frameDuration = 1 / t.globalData.frameRate, e.displayStartTime = 0, e.numLayers = t.layers.length, e
  2969. },
  2970. ShapePathInterface = function(t, e, r) {
  2971. var i = e.sh;
  2972. function s(t) {
  2973. return "Shape" === t || "shape" === t || "Path" === t || "path" === t || "ADBE Vector Shape" === t || 2 === t ? s.path : null
  2974. }
  2975. var a = propertyGroupFactory(s, r);
  2976. return i.setGroupProperty(PropertyInterface("Path", a)), Object.defineProperties(s, {
  2977. path: {
  2978. get: function() {
  2979. return i.k && i.getValue(), i
  2980. }
  2981. },
  2982. shape: {
  2983. get: function() {
  2984. return i.k && i.getValue(), i
  2985. }
  2986. },
  2987. _name: {
  2988. value: t.nm
  2989. },
  2990. ix: {
  2991. value: t.ix
  2992. },
  2993. propertyIndex: {
  2994. value: t.ix
  2995. },
  2996. mn: {
  2997. value: t.mn
  2998. },
  2999. propertyGroup: {
  3000. value: r
  3001. }
  3002. }), s
  3003. },
  3004. ShapeExpressionInterface = function() {
  3005. function t(t, o, c) {
  3006. var d, u = [],
  3007. y = t ? t.length : 0;
  3008. for (d = 0; d < y; d += 1) "gr" === t[d].ty ? u.push(e(t[d], o[d], c)) : "fl" === t[d].ty ? u.push(r(t[d], o[d], c)) : "st" === t[d].ty ? u.push(a(t[d], o[d], c)) : "tm" === t[d].ty ? u.push(n(t[d], o[d], c)) : "tr" === t[d].ty || ("el" === t[d].ty ? u.push(h(t[d], o[d], c)) : "sr" === t[d].ty ? u.push(l(t[d], o[d], c)) : "sh" === t[d].ty ? u.push(ShapePathInterface(t[d], o[d], c)) : "rc" === t[d].ty ? u.push(p(t[d], o[d], c)) : "rd" === t[d].ty ? u.push(f(t[d], o[d], c)) : "rp" === t[d].ty ? u.push(m(t[d], o[d], c)) : "gf" === t[d].ty ? u.push(i(t[d], o[d], c)) : u.push(s(t[d], o[d])));
  3009. return u
  3010. }
  3011. function e(e, r, i) {
  3012. var s = function(t) {
  3013. switch (t) {
  3014. case "ADBE Vectors Group":
  3015. case "Contents":
  3016. case 2:
  3017. return s.content;
  3018. default:
  3019. return s.transform
  3020. }
  3021. };
  3022. s.propertyGroup = propertyGroupFactory(s, i);
  3023. var a = function(e, r, i) {
  3024. var s, a = function(t) {
  3025. for (var e = 0, r = s.length; e < r;) {
  3026. if (s[e]._name === t || s[e].mn === t || s[e].propertyIndex === t || s[e].ix === t || s[e].ind === t) return s[e];
  3027. e += 1
  3028. }
  3029. return "number" == typeof t ? s[t - 1] : null
  3030. };
  3031. a.propertyGroup = propertyGroupFactory(a, i), s = t(e.it, r.it, a.propertyGroup), a.numProperties = s.length;
  3032. var n = o(e.it[e.it.length - 1], r.it[r.it.length - 1], a.propertyGroup);
  3033. return a.transform = n, a.propertyIndex = e.cix, a._name = e.nm, a
  3034. }(e, r, s.propertyGroup),
  3035. n = o(e.it[e.it.length - 1], r.it[r.it.length - 1], s.propertyGroup);
  3036. return s.content = a, s.transform = n, Object.defineProperty(s, "_name", {
  3037. get: function() {
  3038. return e.nm
  3039. }
  3040. }), s.numProperties = e.np, s.propertyIndex = e.ix, s.nm = e.nm, s.mn = e.mn, s
  3041. }
  3042. function r(t, e, r) {
  3043. function i(t) {
  3044. return "Color" === t || "color" === t ? i.color : "Opacity" === t || "opacity" === t ? i.opacity : null
  3045. }
  3046. return Object.defineProperties(i, {
  3047. color: {
  3048. get: ExpressionPropertyInterface(e.c)
  3049. },
  3050. opacity: {
  3051. get: ExpressionPropertyInterface(e.o)
  3052. },
  3053. _name: {
  3054. value: t.nm
  3055. },
  3056. mn: {
  3057. value: t.mn
  3058. }
  3059. }), e.c.setGroupProperty(PropertyInterface("Color", r)), e.o.setGroupProperty(PropertyInterface("Opacity", r)), i
  3060. }
  3061. function i(t, e, r) {
  3062. function i(t) {
  3063. return "Start Point" === t || "start point" === t ? i.startPoint : "End Point" === t || "end point" === t ? i.endPoint : "Opacity" === t || "opacity" === t ? i.opacity : null
  3064. }
  3065. return Object.defineProperties(i, {
  3066. startPoint: {
  3067. get: ExpressionPropertyInterface(e.s)
  3068. },
  3069. endPoint: {
  3070. get: ExpressionPropertyInterface(e.e)
  3071. },
  3072. opacity: {
  3073. get: ExpressionPropertyInterface(e.o)
  3074. },
  3075. type: {
  3076. get: function() {
  3077. return "a"
  3078. }
  3079. },
  3080. _name: {
  3081. value: t.nm
  3082. },
  3083. mn: {
  3084. value: t.mn
  3085. }
  3086. }), e.s.setGroupProperty(PropertyInterface("Start Point", r)), e.e.setGroupProperty(PropertyInterface("End Point", r)), e.o.setGroupProperty(PropertyInterface("Opacity", r)), i
  3087. }
  3088. function s() {
  3089. return function() {
  3090. return null
  3091. }
  3092. }
  3093. function a(t, e, r) {
  3094. var i, s = propertyGroupFactory(l, r),
  3095. a = propertyGroupFactory(h, s);
  3096. function n(r) {
  3097. Object.defineProperty(h, t.d[r].nm, {
  3098. get: ExpressionPropertyInterface(e.d.dataProps[r].p)
  3099. })
  3100. }
  3101. var o = t.d ? t.d.length : 0,
  3102. h = {};
  3103. for (i = 0; i < o; i += 1) n(i), e.d.dataProps[i].p.setGroupProperty(a);
  3104. function l(t) {
  3105. return "Color" === t || "color" === t ? l.color : "Opacity" === t || "opacity" === t ? l.opacity : "Stroke Width" === t || "stroke width" === t ? l.strokeWidth : null
  3106. }
  3107. return Object.defineProperties(l, {
  3108. color: {
  3109. get: ExpressionPropertyInterface(e.c)
  3110. },
  3111. opacity: {
  3112. get: ExpressionPropertyInterface(e.o)
  3113. },
  3114. strokeWidth: {
  3115. get: ExpressionPropertyInterface(e.w)
  3116. },
  3117. dash: {
  3118. get: function() {
  3119. return h
  3120. }
  3121. },
  3122. _name: {
  3123. value: t.nm
  3124. },
  3125. mn: {
  3126. value: t.mn
  3127. }
  3128. }), e.c.setGroupProperty(PropertyInterface("Color", s)), e.o.setGroupProperty(PropertyInterface("Opacity", s)), e.w.setGroupProperty(PropertyInterface("Stroke Width", s)), l
  3129. }
  3130. function n(t, e, r) {
  3131. function i(e) {
  3132. return e === t.e.ix || "End" === e || "end" === e ? i.end : e === t.s.ix ? i.start : e === t.o.ix ? i.offset : null
  3133. }
  3134. var s = propertyGroupFactory(i, r);
  3135. return i.propertyIndex = t.ix, e.s.setGroupProperty(PropertyInterface("Start", s)), e.e.setGroupProperty(PropertyInterface("End", s)), e.o.setGroupProperty(PropertyInterface("Offset", s)), i.propertyIndex = t.ix, i.propertyGroup = r, Object.defineProperties(i, {
  3136. start: {
  3137. get: ExpressionPropertyInterface(e.s)
  3138. },
  3139. end: {
  3140. get: ExpressionPropertyInterface(e.e)
  3141. },
  3142. offset: {
  3143. get: ExpressionPropertyInterface(e.o)
  3144. },
  3145. _name: {
  3146. value: t.nm
  3147. }
  3148. }), i.mn = t.mn, i
  3149. }
  3150. function o(t, e, r) {
  3151. function i(e) {
  3152. return t.a.ix === e || "Anchor Point" === e ? i.anchorPoint : t.o.ix === e || "Opacity" === e ? i.opacity : t.p.ix === e || "Position" === e ? i.position : t.r.ix === e || "Rotation" === e || "ADBE Vector Rotation" === e ? i.rotation : t.s.ix === e || "Scale" === e ? i.scale : t.sk && t.sk.ix === e || "Skew" === e ? i.skew : t.sa && t.sa.ix === e || "Skew Axis" === e ? i.skewAxis : null
  3153. }
  3154. var s = propertyGroupFactory(i, r);
  3155. return e.transform.mProps.o.setGroupProperty(PropertyInterface("Opacity", s)), e.transform.mProps.p.setGroupProperty(PropertyInterface("Position", s)), e.transform.mProps.a.setGroupProperty(PropertyInterface("Anchor Point", s)), e.transform.mProps.s.setGroupProperty(PropertyInterface("Scale", s)), e.transform.mProps.r.setGroupProperty(PropertyInterface("Rotation", s)), e.transform.mProps.sk && (e.transform.mProps.sk.setGroupProperty(PropertyInterface("Skew", s)), e.transform.mProps.sa.setGroupProperty(PropertyInterface("Skew Angle", s))), e.transform.op.setGroupProperty(PropertyInterface("Opacity", s)), Object.defineProperties(i, {
  3156. opacity: {
  3157. get: ExpressionPropertyInterface(e.transform.mProps.o)
  3158. },
  3159. position: {
  3160. get: ExpressionPropertyInterface(e.transform.mProps.p)
  3161. },
  3162. anchorPoint: {
  3163. get: ExpressionPropertyInterface(e.transform.mProps.a)
  3164. },
  3165. scale: {
  3166. get: ExpressionPropertyInterface(e.transform.mProps.s)
  3167. },
  3168. rotation: {
  3169. get: ExpressionPropertyInterface(e.transform.mProps.r)
  3170. },
  3171. skew: {
  3172. get: ExpressionPropertyInterface(e.transform.mProps.sk)
  3173. },
  3174. skewAxis: {
  3175. get: ExpressionPropertyInterface(e.transform.mProps.sa)
  3176. },
  3177. _name: {
  3178. value: t.nm
  3179. }
  3180. }), i.ty = "tr", i.mn = t.mn, i.propertyGroup = r, i
  3181. }
  3182. function h(t, e, r) {
  3183. function i(e) {
  3184. return t.p.ix === e ? i.position : t.s.ix === e ? i.size : null
  3185. }
  3186. var s = propertyGroupFactory(i, r);
  3187. i.propertyIndex = t.ix;
  3188. var a = "tm" === e.sh.ty ? e.sh.prop : e.sh;
  3189. return a.s.setGroupProperty(PropertyInterface("Size", s)), a.p.setGroupProperty(PropertyInterface("Position", s)), Object.defineProperties(i, {
  3190. size: {
  3191. get: ExpressionPropertyInterface(a.s)
  3192. },
  3193. position: {
  3194. get: ExpressionPropertyInterface(a.p)
  3195. },
  3196. _name: {
  3197. value: t.nm
  3198. }
  3199. }), i.mn = t.mn, i
  3200. }
  3201. function l(t, e, r) {
  3202. function i(e) {
  3203. return t.p.ix === e ? i.position : t.r.ix === e ? i.rotation : t.pt.ix === e ? i.points : t.or.ix === e || "ADBE Vector Star Outer Radius" === e ? i.outerRadius : t.os.ix === e ? i.outerRoundness : !t.ir || t.ir.ix !== e && "ADBE Vector Star Inner Radius" !== e ? t.is && t.is.ix === e ? i.innerRoundness : null : i.innerRadius
  3204. }
  3205. var s = propertyGroupFactory(i, r),
  3206. a = "tm" === e.sh.ty ? e.sh.prop : e.sh;
  3207. return i.propertyIndex = t.ix, a.or.setGroupProperty(PropertyInterface("Outer Radius", s)), a.os.setGroupProperty(PropertyInterface("Outer Roundness", s)), a.pt.setGroupProperty(PropertyInterface("Points", s)), a.p.setGroupProperty(PropertyInterface("Position", s)), a.r.setGroupProperty(PropertyInterface("Rotation", s)), t.ir && (a.ir.setGroupProperty(PropertyInterface("Inner Radius", s)), a.is.setGroupProperty(PropertyInterface("Inner Roundness", s))), Object.defineProperties(i, {
  3208. position: {
  3209. get: ExpressionPropertyInterface(a.p)
  3210. },
  3211. rotation: {
  3212. get: ExpressionPropertyInterface(a.r)
  3213. },
  3214. points: {
  3215. get: ExpressionPropertyInterface(a.pt)
  3216. },
  3217. outerRadius: {
  3218. get: ExpressionPropertyInterface(a.or)
  3219. },
  3220. outerRoundness: {
  3221. get: ExpressionPropertyInterface(a.os)
  3222. },
  3223. innerRadius: {
  3224. get: ExpressionPropertyInterface(a.ir)
  3225. },
  3226. innerRoundness: {
  3227. get: ExpressionPropertyInterface(a.is)
  3228. },
  3229. _name: {
  3230. value: t.nm
  3231. }
  3232. }), i.mn = t.mn, i
  3233. }
  3234. function p(t, e, r) {
  3235. function i(e) {
  3236. return t.p.ix === e ? i.position : t.r.ix === e ? i.roundness : t.s.ix === e || "Size" === e || "ADBE Vector Rect Size" === e ? i.size : null
  3237. }
  3238. var s = propertyGroupFactory(i, r),
  3239. a = "tm" === e.sh.ty ? e.sh.prop : e.sh;
  3240. return i.propertyIndex = t.ix, a.p.setGroupProperty(PropertyInterface("Position", s)), a.s.setGroupProperty(PropertyInterface("Size", s)), a.r.setGroupProperty(PropertyInterface("Rotation", s)), Object.defineProperties(i, {
  3241. position: {
  3242. get: ExpressionPropertyInterface(a.p)
  3243. },
  3244. roundness: {
  3245. get: ExpressionPropertyInterface(a.r)
  3246. },
  3247. size: {
  3248. get: ExpressionPropertyInterface(a.s)
  3249. },
  3250. _name: {
  3251. value: t.nm
  3252. }
  3253. }), i.mn = t.mn, i
  3254. }
  3255. function f(t, e, r) {
  3256. function i(e) {
  3257. return t.r.ix === e || "Round Corners 1" === e ? i.radius : null
  3258. }
  3259. var s = propertyGroupFactory(i, r),
  3260. a = e;
  3261. return i.propertyIndex = t.ix, a.rd.setGroupProperty(PropertyInterface("Radius", s)), Object.defineProperties(i, {
  3262. radius: {
  3263. get: ExpressionPropertyInterface(a.rd)
  3264. },
  3265. _name: {
  3266. value: t.nm
  3267. }
  3268. }), i.mn = t.mn, i
  3269. }
  3270. function m(t, e, r) {
  3271. function i(e) {
  3272. return t.c.ix === e || "Copies" === e ? i.copies : t.o.ix === e || "Offset" === e ? i.offset : null
  3273. }
  3274. var s = propertyGroupFactory(i, r),
  3275. a = e;
  3276. return i.propertyIndex = t.ix, a.c.setGroupProperty(PropertyInterface("Copies", s)), a.o.setGroupProperty(PropertyInterface("Offset", s)), Object.defineProperties(i, {
  3277. copies: {
  3278. get: ExpressionPropertyInterface(a.c)
  3279. },
  3280. offset: {
  3281. get: ExpressionPropertyInterface(a.o)
  3282. },
  3283. _name: {
  3284. value: t.nm
  3285. }
  3286. }), i.mn = t.mn, i
  3287. }
  3288. return function(e, r, i) {
  3289. var s;
  3290. function a(t) {
  3291. if ("number" == typeof t) return 0 === (t = void 0 === t ? 1 : t) ? i : s[t - 1];
  3292. for (var e = 0, r = s.length; e < r;) {
  3293. if (s[e]._name === t) return s[e];
  3294. e += 1
  3295. }
  3296. return null
  3297. }
  3298. return a.propertyGroup = propertyGroupFactory(a, (function() {
  3299. return i
  3300. })), s = t(e, r, a.propertyGroup), a.numProperties = s.length, a._name = "Contents", a
  3301. }
  3302. }(),
  3303. TextExpressionInterface = function(t) {
  3304. var e, r;
  3305. function i(t) {
  3306. return "ADBE Text Document" === t ? i.sourceText : null
  3307. }
  3308. return Object.defineProperty(i, "sourceText", {
  3309. get: function() {
  3310. t.textProperty.getValue();
  3311. var i = t.textProperty.currentData.t;
  3312. return i !== e && (t.textProperty.currentData.t = e, (r = new String(i)).value = i || new String(i)), r
  3313. }
  3314. }), i
  3315. },
  3316. getBlendMode = (blendModeEnums = {
  3317. 0: "source-over",
  3318. 1: "multiply",
  3319. 2: "screen",
  3320. 3: "overlay",
  3321. 4: "darken",
  3322. 5: "lighten",
  3323. 6: "color-dodge",
  3324. 7: "color-burn",
  3325. 8: "hard-light",
  3326. 9: "soft-light",
  3327. 10: "difference",
  3328. 11: "exclusion",
  3329. 12: "hue",
  3330. 13: "saturation",
  3331. 14: "color",
  3332. 15: "luminosity"
  3333. }, function(t) {
  3334. return blendModeEnums[t] || ""
  3335. }),
  3336. blendModeEnums;
  3337. function SliderEffect(t, e, r) {
  3338. this.p = PropertyFactory.getProp(e, t.v, 0, 0, r)
  3339. }
  3340. function AngleEffect(t, e, r) {
  3341. this.p = PropertyFactory.getProp(e, t.v, 0, 0, r)
  3342. }
  3343. function ColorEffect(t, e, r) {
  3344. this.p = PropertyFactory.getProp(e, t.v, 1, 0, r)
  3345. }
  3346. function PointEffect(t, e, r) {
  3347. this.p = PropertyFactory.getProp(e, t.v, 1, 0, r)
  3348. }
  3349. function LayerIndexEffect(t, e, r) {
  3350. this.p = PropertyFactory.getProp(e, t.v, 0, 0, r)
  3351. }
  3352. function MaskIndexEffect(t, e, r) {
  3353. this.p = PropertyFactory.getProp(e, t.v, 0, 0, r)
  3354. }
  3355. function CheckboxEffect(t, e, r) {
  3356. this.p = PropertyFactory.getProp(e, t.v, 0, 0, r)
  3357. }
  3358. function NoValueEffect() {
  3359. this.p = {}
  3360. }
  3361. function EffectsManager(t, e) {
  3362. var r, i = t.ef || [];
  3363. this.effectElements = [];
  3364. var s, a = i.length;
  3365. for (r = 0; r < a; r += 1) s = new GroupEffect(i[r], e), this.effectElements.push(s)
  3366. }
  3367. function GroupEffect(t, e) {
  3368. this.init(t, e)
  3369. }
  3370. function BaseElement() {}
  3371. function FrameElement() {}
  3372. function _typeof$2(t) {
  3373. return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
  3374. return typeof t
  3375. } : function(t) {
  3376. return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
  3377. }, _typeof$2(t)
  3378. }
  3379. extendPrototype([DynamicPropertyContainer], GroupEffect), GroupEffect.prototype.getValue = GroupEffect.prototype.iterateDynamicProperties, GroupEffect.prototype.init = function(t, e) {
  3380. var r;
  3381. this.data = t, this.effectElements = [], this.initDynamicPropertyContainer(e);
  3382. var i, s = this.data.ef.length,
  3383. a = this.data.ef;
  3384. for (r = 0; r < s; r += 1) {
  3385. switch (i = null, a[r].ty) {
  3386. case 0:
  3387. i = new SliderEffect(a[r], e, this);
  3388. break;
  3389. case 1:
  3390. i = new AngleEffect(a[r], e, this);
  3391. break;
  3392. case 2:
  3393. i = new ColorEffect(a[r], e, this);
  3394. break;
  3395. case 3:
  3396. i = new PointEffect(a[r], e, this);
  3397. break;
  3398. case 4:
  3399. case 7:
  3400. i = new CheckboxEffect(a[r], e, this);
  3401. break;
  3402. case 10:
  3403. i = new LayerIndexEffect(a[r], e, this);
  3404. break;
  3405. case 11:
  3406. i = new MaskIndexEffect(a[r], e, this);
  3407. break;
  3408. case 5:
  3409. i = new EffectsManager(a[r], e, this);
  3410. break;
  3411. default:
  3412. i = new NoValueEffect(a[r], e, this)
  3413. }
  3414. i && this.effectElements.push(i)
  3415. }
  3416. }, BaseElement.prototype = {
  3417. checkMasks: function() {
  3418. if (!this.data.hasMask) return !1;
  3419. for (var t = 0, e = this.data.masksProperties.length; t < e;) {
  3420. if ("n" !== this.data.masksProperties[t].mode && !1 !== this.data.masksProperties[t].cl) return !0;
  3421. t += 1
  3422. }
  3423. return !1
  3424. },
  3425. initExpressions: function() {
  3426. this.layerInterface = LayerExpressionInterface(this), this.data.hasMask && this.maskManager && this.layerInterface.registerMaskInterface(this.maskManager);
  3427. var t = EffectsExpressionInterface.createEffectsInterface(this, this.layerInterface);
  3428. this.layerInterface.registerEffectsInterface(t), 0 === this.data.ty || this.data.xt ? this.compInterface = CompExpressionInterface(this) : 4 === this.data.ty ? (this.layerInterface.shapeInterface = ShapeExpressionInterface(this.shapesData, this.itemsData, this.layerInterface), this.layerInterface.content = this.layerInterface.shapeInterface) : 5 === this.data.ty && (this.layerInterface.textInterface = TextExpressionInterface(this), this.layerInterface.text = this.layerInterface.textInterface)
  3429. },
  3430. setBlendMode: function() {
  3431. var t = getBlendMode(this.data.bm);
  3432. (this.baseElement || this.layerElement).style["mix-blend-mode"] = t
  3433. },
  3434. initBaseData: function(t, e, r) {
  3435. this.globalData = e, this.comp = r, this.data = t, this.layerId = createElementID(), this.data.sr || (this.data.sr = 1), this.effectsManager = new EffectsManager(this.data, this, this.dynamicProperties)
  3436. },
  3437. getType: function() {
  3438. return this.type
  3439. },
  3440. sourceRectAtTime: function() {}
  3441. }, FrameElement.prototype = {
  3442. initFrame: function() {
  3443. this._isFirstFrame = !1, this.dynamicProperties = [], this._mdf = !1
  3444. },
  3445. prepareProperties: function(t, e) {
  3446. var r, i = this.dynamicProperties.length;
  3447. for (r = 0; r < i; r += 1)(e || this._isParent && "transform" === this.dynamicProperties[r].propType) && (this.dynamicProperties[r].getValue(), this.dynamicProperties[r]._mdf && (this.globalData._mdf = !0, this._mdf = !0))
  3448. },
  3449. addDynamicProperty: function(t) {
  3450. -1 === this.dynamicProperties.indexOf(t) && this.dynamicProperties.push(t)
  3451. }
  3452. };
  3453. var FootageInterface = (dataInterfaceFactory = function(t) {
  3454. function e(t) {
  3455. return "Outline" === t ? e.outlineInterface() : null
  3456. }
  3457. return e._name = "Outline", e.outlineInterface = function(t) {
  3458. var e = "",
  3459. r = t.getFootageData();
  3460. function i(t) {
  3461. if (r[t]) return e = t, "object" === _typeof$2(r = r[t]) ? i : r;
  3462. var s = t.indexOf(e);
  3463. if (-1 !== s) {
  3464. var a = parseInt(t.substr(s + e.length), 10);
  3465. return "object" === _typeof$2(r = r[a]) ? i : r
  3466. }
  3467. return ""
  3468. }
  3469. return function() {
  3470. return e = "", r = t.getFootageData(), i
  3471. }
  3472. }(t), e
  3473. }, function(t) {
  3474. function e(t) {
  3475. return "Data" === t ? e.dataInterface : null
  3476. }
  3477. return e._name = "Data", e.dataInterface = dataInterfaceFactory(t), e
  3478. }),
  3479. dataInterfaceFactory;
  3480. function FootageElement(t, e, r) {
  3481. this.initFrame(), this.initRenderable(), this.assetData = e.getAssetData(t.refId), this.footageData = e.imageLoader.getAsset(this.assetData), this.initBaseData(t, e, r)
  3482. }
  3483. function AudioElement(t, e, r) {
  3484. this.initFrame(), this.initRenderable(), this.assetData = e.getAssetData(t.refId), this.initBaseData(t, e, r), this._isPlaying = !1, this._canPlay = !1;
  3485. var i = this.globalData.getAssetsPath(this.assetData);
  3486. this.audio = this.globalData.audioController.createAudio(i), this._currentTime = 0, this.globalData.audioController.addAudio(this), this._volumeMultiplier = 1, this._volume = 1, this._previousVolume = null, this.tm = t.tm ? PropertyFactory.getProp(this, t.tm, 0, e.frameRate, this) : {
  3487. _placeholder: !0
  3488. }, this.lv = PropertyFactory.getProp(this, t.au && t.au.lv ? t.au.lv : {
  3489. k: [100]
  3490. }, 1, .01, this)
  3491. }
  3492. function BaseRenderer() {}
  3493. function TransformElement() {}
  3494. function MaskElement(t, e, r) {
  3495. this.data = t, this.element = e, this.globalData = r, this.storedData = [], this.masksProperties = this.data.masksProperties || [], this.maskElement = null;
  3496. var i, s, a = this.globalData.defs,
  3497. n = this.masksProperties ? this.masksProperties.length : 0;
  3498. this.viewData = createSizedArray(n), this.solidPath = "";
  3499. var o, h, l, p, f, m, c = this.masksProperties,
  3500. d = 0,
  3501. u = [],
  3502. y = createElementID(),
  3503. g = "clipPath",
  3504. v = "clip-path";
  3505. for (i = 0; i < n; i += 1)
  3506. if (("a" !== c[i].mode && "n" !== c[i].mode || c[i].inv || 100 !== c[i].o.k || c[i].o.x) && (g = "mask", v = "mask"), "s" !== c[i].mode && "i" !== c[i].mode || 0 !== d ? l = null : ((l = createNS("rect")).setAttribute("fill", "#ffffff"), l.setAttribute("width", this.element.comp.data.w || 0), l.setAttribute("height", this.element.comp.data.h || 0), u.push(l)), s = createNS("path"), "n" === c[i].mode) this.viewData[i] = {
  3507. op: PropertyFactory.getProp(this.element, c[i].o, 0, .01, this.element),
  3508. prop: ShapePropertyFactory.getShapeProp(this.element, c[i], 3),
  3509. elem: s,
  3510. lastPath: ""
  3511. }, a.appendChild(s);
  3512. else {
  3513. var b;
  3514. if (d += 1, s.setAttribute("fill", "s" === c[i].mode ? "#000000" : "#ffffff"), s.setAttribute("clip-rule", "nonzero"), 0 !== c[i].x.k ? (g = "mask", v = "mask", m = PropertyFactory.getProp(this.element, c[i].x, 0, null, this.element), b = createElementID(), (p = createNS("filter")).setAttribute("id", b), (f = createNS("feMorphology")).setAttribute("operator", "erode"), f.setAttribute("in", "SourceGraphic"), f.setAttribute("radius", "0"), p.appendChild(f), a.appendChild(p), s.setAttribute("stroke", "s" === c[i].mode ? "#000000" : "#ffffff")) : (f = null, m = null), this.storedData[i] = {
  3515. elem: s,
  3516. x: m,
  3517. expan: f,
  3518. lastPath: "",
  3519. lastOperator: "",
  3520. filterId: b,
  3521. lastRadius: 0
  3522. }, "i" === c[i].mode) {
  3523. h = u.length;
  3524. var P = createNS("g");
  3525. for (o = 0; o < h; o += 1) P.appendChild(u[o]);
  3526. var E = createNS("mask");
  3527. E.setAttribute("mask-type", "alpha"), E.setAttribute("id", y + "_" + d), E.appendChild(s), a.appendChild(E), P.setAttribute("mask", "url(" + getLocationHref() + "#" + y + "_" + d + ")"), u.length = 0, u.push(P)
  3528. } else u.push(s);
  3529. c[i].inv && !this.solidPath && (this.solidPath = this.createLayerSolidPath()), this.viewData[i] = {
  3530. elem: s,
  3531. lastPath: "",
  3532. op: PropertyFactory.getProp(this.element, c[i].o, 0, .01, this.element),
  3533. prop: ShapePropertyFactory.getShapeProp(this.element, c[i], 3),
  3534. invRect: l
  3535. }, this.viewData[i].prop.k || this.drawPath(c[i], this.viewData[i].prop.v, this.viewData[i])
  3536. }
  3537. for (this.maskElement = createNS(g), n = u.length, i = 0; i < n; i += 1) this.maskElement.appendChild(u[i]);
  3538. d > 0 && (this.maskElement.setAttribute("id", y), this.element.maskedElement.setAttribute(v, "url(" + getLocationHref() + "#" + y + ")"), a.appendChild(this.maskElement)), this.viewData.length && this.element.addRenderableComponent(this)
  3539. }
  3540. FootageElement.prototype.prepareFrame = function() {}, extendPrototype([RenderableElement, BaseElement, FrameElement], FootageElement), FootageElement.prototype.getBaseElement = function() {
  3541. return null
  3542. }, FootageElement.prototype.renderFrame = function() {}, FootageElement.prototype.destroy = function() {}, FootageElement.prototype.initExpressions = function() {
  3543. this.layerInterface = FootageInterface(this)
  3544. }, FootageElement.prototype.getFootageData = function() {
  3545. return this.footageData
  3546. }, AudioElement.prototype.prepareFrame = function(t) {
  3547. if (this.prepareRenderableFrame(t, !0), this.prepareProperties(t, !0), this.tm._placeholder) this._currentTime = t / this.data.sr;
  3548. else {
  3549. var e = this.tm.v;
  3550. this._currentTime = e
  3551. }
  3552. this._volume = this.lv.v[0];
  3553. var r = this._volume * this._volumeMultiplier;
  3554. this._previousVolume !== r && (this._previousVolume = r, this.audio.volume(r))
  3555. }, extendPrototype([RenderableElement, BaseElement, FrameElement], AudioElement), AudioElement.prototype.renderFrame = function() {
  3556. 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))
  3557. }, AudioElement.prototype.show = function() {}, AudioElement.prototype.hide = function() {
  3558. this.audio.pause(), this._isPlaying = !1
  3559. }, AudioElement.prototype.pause = function() {
  3560. this.audio.pause(), this._isPlaying = !1, this._canPlay = !1
  3561. }, AudioElement.prototype.resume = function() {
  3562. this._canPlay = !0
  3563. }, AudioElement.prototype.setRate = function(t) {
  3564. this.audio.rate(t)
  3565. }, AudioElement.prototype.volume = function(t) {
  3566. this._volumeMultiplier = t, this._previousVolume = t * this._volume, this.audio.volume(this._previousVolume)
  3567. }, AudioElement.prototype.getBaseElement = function() {
  3568. return null
  3569. }, AudioElement.prototype.destroy = function() {}, AudioElement.prototype.sourceRectAtTime = function() {}, AudioElement.prototype.initExpressions = function() {}, BaseRenderer.prototype.checkLayers = function(t) {
  3570. var e, r, i = this.layers.length;
  3571. for (this.completeLayers = !0, e = i - 1; e >= 0; e -= 1) this.elements[e] || (r = this.layers[e]).ip - r.st <= t - this.layers[e].st && r.op - r.st > t - this.layers[e].st && this.buildItem(e), this.completeLayers = !!this.elements[e] && this.completeLayers;
  3572. this.checkPendingElements()
  3573. }, BaseRenderer.prototype.createItem = function(t) {
  3574. switch (t.ty) {
  3575. case 2:
  3576. return this.createImage(t);
  3577. case 0:
  3578. return this.createComp(t);
  3579. case 1:
  3580. return this.createSolid(t);
  3581. case 3:
  3582. default:
  3583. return this.createNull(t);
  3584. case 4:
  3585. return this.createShape(t);
  3586. case 5:
  3587. return this.createText(t);
  3588. case 6:
  3589. return this.createAudio(t);
  3590. case 13:
  3591. return this.createCamera(t);
  3592. case 15:
  3593. return this.createFootage(t)
  3594. }
  3595. }, BaseRenderer.prototype.createCamera = function() {
  3596. throw new Error("You're using a 3d camera. Try the html renderer.")
  3597. }, BaseRenderer.prototype.createAudio = function(t) {
  3598. return new AudioElement(t, this.globalData, this)
  3599. }, BaseRenderer.prototype.createFootage = function(t) {
  3600. return new FootageElement(t, this.globalData, this)
  3601. }, BaseRenderer.prototype.buildAllItems = function() {
  3602. var t, e = this.layers.length;
  3603. for (t = 0; t < e; t += 1) this.buildItem(t);
  3604. this.checkPendingElements()
  3605. }, BaseRenderer.prototype.includeLayers = function(t) {
  3606. var e;
  3607. this.completeLayers = !1;
  3608. var r, i = t.length,
  3609. s = this.layers.length;
  3610. for (e = 0; e < i; e += 1)
  3611. for (r = 0; r < s;) {
  3612. if (this.layers[r].id === t[e].id) {
  3613. this.layers[r] = t[e];
  3614. break
  3615. }
  3616. r += 1
  3617. }
  3618. }, BaseRenderer.prototype.setProjectInterface = function(t) {
  3619. this.globalData.projectInterface = t
  3620. }, BaseRenderer.prototype.initItems = function() {
  3621. this.globalData.progressiveLoad || this.buildAllItems()
  3622. }, BaseRenderer.prototype.buildElementParenting = function(t, e, r) {
  3623. for (var i = this.elements, s = this.layers, a = 0, n = s.length; a < n;) s[a].ind == e && (i[a] && !0 !== i[a] ? (r.push(i[a]), i[a].setAsParent(), void 0 !== s[a].parent ? this.buildElementParenting(t, s[a].parent, r) : t.setHierarchy(r)) : (this.buildItem(a), this.addPendingElement(t))), a += 1
  3624. }, BaseRenderer.prototype.addPendingElement = function(t) {
  3625. this.pendingElements.push(t)
  3626. }, BaseRenderer.prototype.searchExtraCompositions = function(t) {
  3627. var e, r = t.length;
  3628. for (e = 0; e < r; e += 1)
  3629. if (t[e].xt) {
  3630. var i = this.createComp(t[e]);
  3631. i.initExpressions(), this.globalData.projectInterface.registerComposition(i)
  3632. }
  3633. }, BaseRenderer.prototype.getElementByPath = function(t) {
  3634. var e, r = t.shift();
  3635. if ("number" == typeof r) e = this.elements[r];
  3636. else {
  3637. var i, s = this.elements.length;
  3638. for (i = 0; i < s; i += 1)
  3639. if (this.elements[i].data.nm === r) {
  3640. e = this.elements[i];
  3641. break
  3642. }
  3643. }
  3644. return 0 === t.length ? e : e.getElementByPath(t)
  3645. }, BaseRenderer.prototype.setupGlobalData = function(t, e) {
  3646. this.globalData.fontManager = new FontManager, 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 = {
  3647. w: t.w,
  3648. h: t.h
  3649. }
  3650. }, TransformElement.prototype = {
  3651. initTransform: function() {
  3652. this.finalTransform = {
  3653. mProp: this.data.ks ? TransformPropertyFactory.getTransformProperty(this, this.data.ks, this) : {
  3654. o: 0
  3655. },
  3656. _matMdf: !1,
  3657. _opMdf: !1,
  3658. mat: new Matrix
  3659. }, this.data.ao && (this.finalTransform.mProp.autoOriented = !0), this.data.ty
  3660. },
  3661. renderTransform: function() {
  3662. if (this.finalTransform._opMdf = this.finalTransform.mProp.o._mdf || this._isFirstFrame, this.finalTransform._matMdf = this.finalTransform.mProp._mdf || this._isFirstFrame, this.hierarchy) {
  3663. var t, e = this.finalTransform.mat,
  3664. r = 0,
  3665. i = this.hierarchy.length;
  3666. if (!this.finalTransform._matMdf)
  3667. for (; r < i;) {
  3668. if (this.hierarchy[r].finalTransform.mProp._mdf) {
  3669. this.finalTransform._matMdf = !0;
  3670. break
  3671. }
  3672. r += 1
  3673. }
  3674. if (this.finalTransform._matMdf)
  3675. for (t = this.finalTransform.mProp.v.props, e.cloneFromProps(t), r = 0; r < i; r += 1) t = this.hierarchy[r].finalTransform.mProp.v.props, e.transform(t[0], t[1], t[2], t[3], t[4], t[5], t[6], t[7], t[8], t[9], t[10], t[11], t[12], t[13], t[14], t[15])
  3676. }
  3677. },
  3678. globalToLocal: function(t) {
  3679. var e = [];
  3680. e.push(this.finalTransform);
  3681. for (var r, i = !0, s = this.comp; i;) s.finalTransform ? (s.data.hasMask && e.splice(0, 0, s.finalTransform), s = s.comp) : i = !1;
  3682. var a, n = e.length;
  3683. for (r = 0; r < n; r += 1) a = e[r].mat.applyToPointArray(0, 0, 0), t = [t[0] - a[0], t[1] - a[1], 0];
  3684. return t
  3685. },
  3686. mHelper: new Matrix
  3687. }, MaskElement.prototype.getMaskProperty = function(t) {
  3688. return this.viewData[t].prop
  3689. }, MaskElement.prototype.renderFrame = function(t) {
  3690. var e, r = this.element.finalTransform.mat,
  3691. i = this.masksProperties.length;
  3692. for (e = 0; e < i; e += 1)
  3693. 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", r.getInverseMatrix().to2dCSS()), this.storedData[e].x && (this.storedData[e].x._mdf || t))) {
  3694. var s = this.storedData[e].expan;
  3695. this.storedData[e].x.v < 0 ? ("erode" !== this.storedData[e].lastOperator && (this.storedData[e].lastOperator = "erode", this.storedData[e].elem.setAttribute("filter", "url(" + getLocationHref() + "#" + this.storedData[e].filterId + ")")), s.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))
  3696. }
  3697. }, MaskElement.prototype.getMaskelement = function() {
  3698. return this.maskElement
  3699. }, MaskElement.prototype.createLayerSolidPath = function() {
  3700. var t = "M0,0 ";
  3701. 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 + " "
  3702. }, MaskElement.prototype.drawPath = function(t, e, r) {
  3703. var i, s, a = " M" + e.v[0][0] + "," + e.v[0][1];
  3704. for (s = e._length, i = 1; i < s; i += 1) a += " C" + e.o[i - 1][0] + "," + e.o[i - 1][1] + " " + e.i[i][0] + "," + e.i[i][1] + " " + e.v[i][0] + "," + e.v[i][1];
  3705. if (e.c && s > 1 && (a += " C" + e.o[i - 1][0] + "," + e.o[i - 1][1] + " " + e.i[0][0] + "," + e.i[0][1] + " " + e.v[0][0] + "," + e.v[0][1]), r.lastPath !== a) {
  3706. var n = "";
  3707. r.elem && (e.c && (n = t.inv ? this.solidPath + a : a), r.elem.setAttribute("d", n)), r.lastPath = a
  3708. }
  3709. }, MaskElement.prototype.destroy = function() {
  3710. this.element = null, this.globalData = null, this.maskElement = null, this.data = null, this.masksProperties = null
  3711. };
  3712. var filtersFactory = function() {
  3713. var t = {};
  3714. return t.createFilter = function(t, e) {
  3715. var r = createNS("filter");
  3716. r.setAttribute("id", t), !0 !== e && (r.setAttribute("filterUnits", "objectBoundingBox"), r.setAttribute("x", "0%"), r.setAttribute("y", "0%"), r.setAttribute("width", "100%"), r.setAttribute("height", "100%"));
  3717. return r
  3718. }, t.createAlphaToLuminanceFilter = function() {
  3719. var t = createNS("feColorMatrix");
  3720. 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
  3721. }, t
  3722. }(),
  3723. featureSupport = function() {
  3724. var t = {
  3725. maskType: !0
  3726. };
  3727. return (/MSIE 10/i.test(navigator.userAgent) || /MSIE 9/i.test(navigator.userAgent) || /rv:11.0/i.test(navigator.userAgent) || /Edge\/\d./i.test(navigator.userAgent)) && (t.maskType = !1), t
  3728. }(),
  3729. registeredEffects = {},
  3730. idPrefix = "filter_result_";
  3731. function SVGEffects(t) {
  3732. var e, r, i = "SourceGraphic",
  3733. s = t.data.ef ? t.data.ef.length : 0,
  3734. a = createElementID(),
  3735. n = filtersFactory.createFilter(a, !0),
  3736. o = 0;
  3737. for (this.filters = [], e = 0; e < s; e += 1) {
  3738. r = null;
  3739. var h = t.data.ef[e].ty;
  3740. if (registeredEffects[h]) r = new(0, registeredEffects[h].effect)(n, t.effectsManager.effectElements[e], t, idPrefix + o, i), i = idPrefix + o, registeredEffects[h].countsAsEffect && (o += 1);
  3741. r && this.filters.push(r)
  3742. }
  3743. o && (t.globalData.defs.appendChild(n), t.layerElement.setAttribute("filter", "url(" + getLocationHref() + "#" + a + ")")), this.filters.length && t.addRenderableComponent(this)
  3744. }
  3745. function registerEffect(t, e, r) {
  3746. registeredEffects[t] = {
  3747. effect: e,
  3748. countsAsEffect: r
  3749. }
  3750. }
  3751. function SVGBaseElement() {}
  3752. function HierarchyElement() {}
  3753. function RenderableDOMElement() {}
  3754. function IImageElement(t, e, r) {
  3755. this.assetData = e.getAssetData(t.refId), this.initElement(t, e, r), this.sourceRect = {
  3756. top: 0,
  3757. left: 0,
  3758. width: this.assetData.w,
  3759. height: this.assetData.h
  3760. }
  3761. }
  3762. function ProcessedElement(t, e) {
  3763. this.elem = t, this.pos = e
  3764. }
  3765. function IShapeElement() {}
  3766. SVGEffects.prototype.renderFrame = function(t) {
  3767. var e, r = this.filters.length;
  3768. for (e = 0; e < r; e += 1) this.filters[e].renderFrame(t)
  3769. }, SVGBaseElement.prototype = {
  3770. initRendererElement: function() {
  3771. this.layerElement = createNS("g")
  3772. },
  3773. createContainerElements: function() {
  3774. this.matteElement = createNS("g"), this.transformedElement = this.layerElement, this.maskedElement = this.layerElement, this._sizeChanged = !1;
  3775. var t, e, r, i = null;
  3776. if (this.data.td) {
  3777. if (3 == this.data.td || 1 == this.data.td) {
  3778. var s = createNS("mask");
  3779. s.setAttribute("id", this.layerId), s.setAttribute("mask-type", 3 == this.data.td ? "luminance" : "alpha"), s.appendChild(this.layerElement), i = s, this.globalData.defs.appendChild(s), featureSupport.maskType || 1 != this.data.td || (s.setAttribute("mask-type", "luminance"), t = createElementID(), e = filtersFactory.createFilter(t), this.globalData.defs.appendChild(e), e.appendChild(filtersFactory.createAlphaToLuminanceFilter()), (r = createNS("g")).appendChild(this.layerElement), i = r, s.appendChild(r), r.setAttribute("filter", "url(" + getLocationHref() + "#" + t + ")"))
  3780. } else if (2 == this.data.td) {
  3781. var a = createNS("mask");
  3782. a.setAttribute("id", this.layerId), a.setAttribute("mask-type", "alpha");
  3783. var n = createNS("g");
  3784. a.appendChild(n), t = createElementID(), e = filtersFactory.createFilter(t);
  3785. var o = createNS("feComponentTransfer");
  3786. o.setAttribute("in", "SourceGraphic"), e.appendChild(o);
  3787. var h = createNS("feFuncA");
  3788. h.setAttribute("type", "table"), h.setAttribute("tableValues", "1.0 0.0"), o.appendChild(h), this.globalData.defs.appendChild(e);
  3789. var l = createNS("rect");
  3790. l.setAttribute("width", this.comp.data.w), l.setAttribute("height", this.comp.data.h), l.setAttribute("x", "0"), l.setAttribute("y", "0"), l.setAttribute("fill", "#ffffff"), l.setAttribute("opacity", "0"), n.setAttribute("filter", "url(" + getLocationHref() + "#" + t + ")"), n.appendChild(l), n.appendChild(this.layerElement), i = n, featureSupport.maskType || (a.setAttribute("mask-type", "luminance"), e.appendChild(filtersFactory.createAlphaToLuminanceFilter()), r = createNS("g"), n.appendChild(l), r.appendChild(this.layerElement), i = r, n.appendChild(r)), this.globalData.defs.appendChild(a)
  3791. }
  3792. } else this.data.tt ? (this.matteElement.appendChild(this.layerElement), i = this.matteElement, this.baseElement = this.matteElement) : this.baseElement = this.layerElement;
  3793. 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) {
  3794. var p = createNS("clipPath"),
  3795. f = createNS("path");
  3796. f.setAttribute("d", "M0,0 L" + this.data.w + ",0 L" + this.data.w + "," + this.data.h + " L0," + this.data.h + "z");
  3797. var m = createElementID();
  3798. if (p.setAttribute("id", m), p.appendChild(f), this.globalData.defs.appendChild(p), this.checkMasks()) {
  3799. var c = createNS("g");
  3800. c.setAttribute("clip-path", "url(" + getLocationHref() + "#" + m + ")"), c.appendChild(this.layerElement), this.transformedElement = c, i ? i.appendChild(this.transformedElement) : this.baseElement = this.transformedElement
  3801. } else this.layerElement.setAttribute("clip-path", "url(" + getLocationHref() + "#" + m + ")")
  3802. }
  3803. 0 !== this.data.bm && this.setBlendMode()
  3804. },
  3805. renderElement: function() {
  3806. this.finalTransform._matMdf && this.transformedElement.setAttribute("transform", this.finalTransform.mat.to2dCSS()), this.finalTransform._opMdf && this.transformedElement.setAttribute("opacity", this.finalTransform.mProp.o.v)
  3807. },
  3808. destroyBaseElement: function() {
  3809. this.layerElement = null, this.matteElement = null, this.maskManager.destroy()
  3810. },
  3811. getBaseElement: function() {
  3812. return this.data.hd ? null : this.baseElement
  3813. },
  3814. createRenderableComponents: function() {
  3815. this.maskManager = new MaskElement(this.data, this, this.globalData), this.renderableEffectsManager = new SVGEffects(this)
  3816. },
  3817. setMatte: function(t) {
  3818. this.matteElement && this.matteElement.setAttribute("mask", "url(" + getLocationHref() + "#" + t + ")")
  3819. }
  3820. }, HierarchyElement.prototype = {
  3821. initHierarchy: function() {
  3822. this.hierarchy = [], this._isParent = !1, this.checkParenting()
  3823. },
  3824. setHierarchy: function(t) {
  3825. this.hierarchy = t
  3826. },
  3827. setAsParent: function() {
  3828. this._isParent = !0
  3829. },
  3830. checkParenting: function() {
  3831. void 0 !== this.data.parent && this.comp.buildElementParenting(this, this.data.parent, [])
  3832. }
  3833. }, extendPrototype([RenderableElement, createProxyFunction({
  3834. initElement: function(t, e, r) {
  3835. this.initFrame(), this.initBaseData(t, e, r), this.initTransform(t, e, r), this.initHierarchy(), this.initRenderable(), this.initRendererElement(), this.createContainerElements(), this.createRenderableComponents(), this.createContent(), this.hide()
  3836. },
  3837. hide: function() {
  3838. this.hidden || this.isInRange && !this.isTransparent || ((this.baseElement || this.layerElement).style.display = "none", this.hidden = !0)
  3839. },
  3840. show: function() {
  3841. this.isInRange && !this.isTransparent && (this.data.hd || ((this.baseElement || this.layerElement).style.display = "block"), this.hidden = !1, this._isFirstFrame = !0)
  3842. },
  3843. renderFrame: function() {
  3844. this.data.hd || this.hidden || (this.renderTransform(), this.renderRenderable(), this.renderElement(), this.renderInnerContent(), this._isFirstFrame && (this._isFirstFrame = !1))
  3845. },
  3846. renderInnerContent: function() {},
  3847. prepareFrame: function(t) {
  3848. this._mdf = !1, this.prepareRenderableFrame(t), this.prepareProperties(t, this.isInRange), this.checkTransparency()
  3849. },
  3850. destroy: function() {
  3851. this.innerElem = null, this.destroyBaseElement()
  3852. }
  3853. })], RenderableDOMElement), extendPrototype([BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement], IImageElement), IImageElement.prototype.createContent = function() {
  3854. var t = this.globalData.getAssetsPath(this.assetData);
  3855. this.innerElem = createNS("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)
  3856. }, IImageElement.prototype.sourceRectAtTime = function() {
  3857. return this.sourceRect
  3858. }, IShapeElement.prototype = {
  3859. addShapeToModifiers: function(t) {
  3860. var e, r = this.shapeModifiers.length;
  3861. for (e = 0; e < r; e += 1) this.shapeModifiers[e].addShape(t)
  3862. },
  3863. isShapeInAnimatedModifiers: function(t) {
  3864. for (var e = this.shapeModifiers.length; 0 < e;)
  3865. if (this.shapeModifiers[0].isAnimatedWithShape(t)) return !0;
  3866. return !1
  3867. },
  3868. renderModifiers: function() {
  3869. if (this.shapeModifiers.length) {
  3870. var t, e = this.shapes.length;
  3871. for (t = 0; t < e; t += 1) this.shapes[t].sh.reset();
  3872. for (t = (e = this.shapeModifiers.length) - 1; t >= 0 && !this.shapeModifiers[t].processShapes(this._isFirstFrame); t -= 1);
  3873. }
  3874. },
  3875. searchProcessedElement: function(t) {
  3876. for (var e = this.processedElements, r = 0, i = e.length; r < i;) {
  3877. if (e[r].elem === t) return e[r].pos;
  3878. r += 1
  3879. }
  3880. return 0
  3881. },
  3882. addProcessedElement: function(t, e) {
  3883. for (var r = this.processedElements, i = r.length; i;)
  3884. if (r[i -= 1].elem === t) return void(r[i].pos = e);
  3885. r.push(new ProcessedElement(t, e))
  3886. },
  3887. prepareFrame: function(t) {
  3888. this.prepareRenderableFrame(t), this.prepareProperties(t, this.isInRange)
  3889. }
  3890. };
  3891. var lineCapEnum = {
  3892. 1: "butt",
  3893. 2: "round",
  3894. 3: "square"
  3895. },
  3896. lineJoinEnum = {
  3897. 1: "miter",
  3898. 2: "round",
  3899. 3: "bevel"
  3900. };
  3901. function SVGShapeData(t, e, r) {
  3902. this.caches = [], this.styles = [], this.transformers = t, this.lStr = "", this.sh = r, this.lvl = e, this._isAnimated = !!r.k;
  3903. for (var i = 0, s = t.length; i < s;) {
  3904. if (t[i].mProps.dynamicProperties.length) {
  3905. this._isAnimated = !0;
  3906. break
  3907. }
  3908. i += 1
  3909. }
  3910. }
  3911. function SVGStyleData(t, e) {
  3912. this.data = t, this.type = t.ty, this.d = "", this.lvl = e, this._mdf = !1, this.closed = !0 === t.hd, this.pElem = createNS("path"), this.msElem = null
  3913. }
  3914. function DashProperty(t, e, r, i) {
  3915. var s;
  3916. this.elem = t, this.frameId = -1, this.dataProps = createSizedArray(e.length), this.renderer = r, this.k = !1, this.dashStr = "", this.dashArray = createTypedArray("float32", e.length ? e.length - 1 : 0), this.dashoffset = createTypedArray("float32", 1), this.initDynamicPropertyContainer(i);
  3917. var a, n = e.length || 0;
  3918. for (s = 0; s < n; s += 1) a = PropertyFactory.getProp(t, e[s].v, 0, 0, this), this.k = a.k || this.k, this.dataProps[s] = {
  3919. n: e[s].n,
  3920. p: a
  3921. };
  3922. this.k || this.getValue(!0), this._isAnimated = this.k
  3923. }
  3924. function SVGStrokeStyleData(t, e, r) {
  3925. this.initDynamicPropertyContainer(t), this.getValue = this.iterateDynamicProperties, this.o = PropertyFactory.getProp(t, e.o, 0, .01, this), this.w = PropertyFactory.getProp(t, e.w, 0, null, this), this.d = new DashProperty(t, e.d || {}, "svg", this), this.c = PropertyFactory.getProp(t, e.c, 1, 255, this), this.style = r, this._isAnimated = !!this._isAnimated
  3926. }
  3927. function SVGFillStyleData(t, e, r) {
  3928. this.initDynamicPropertyContainer(t), this.getValue = this.iterateDynamicProperties, this.o = PropertyFactory.getProp(t, e.o, 0, .01, this), this.c = PropertyFactory.getProp(t, e.c, 1, 255, this), this.style = r
  3929. }
  3930. function SVGNoStyleData(t, e, r) {
  3931. this.initDynamicPropertyContainer(t), this.getValue = this.iterateDynamicProperties, this.style = r
  3932. }
  3933. function GradientProperty(t, e, r) {
  3934. this.data = e, this.c = createTypedArray("uint8c", 4 * e.p);
  3935. var i = e.k.k[0].s ? e.k.k[0].s.length - 4 * e.p : e.k.k.length - 4 * e.p;
  3936. this.o = createTypedArray("float32", i), this._cmdf = !1, this._omdf = !1, this._collapsable = this.checkCollapsable(), this._hasOpacity = i, this.initDynamicPropertyContainer(r), this.prop = PropertyFactory.getProp(t, e.k, 1, null, this), this.k = this.prop.k, this.getValue(!0)
  3937. }
  3938. function SVGGradientFillStyleData(t, e, r) {
  3939. this.initDynamicPropertyContainer(t), this.getValue = this.iterateDynamicProperties, this.initGradientData(t, e, r)
  3940. }
  3941. function SVGGradientStrokeStyleData(t, e, r) {
  3942. this.initDynamicPropertyContainer(t), this.getValue = this.iterateDynamicProperties, this.w = PropertyFactory.getProp(t, e.w, 0, null, this), this.d = new DashProperty(t, e.d || {}, "svg", this), this.initGradientData(t, e, r), this._isAnimated = !!this._isAnimated
  3943. }
  3944. function ShapeGroupData() {
  3945. this.it = [], this.prevViewData = [], this.gr = createNS("g")
  3946. }
  3947. function SVGTransformData(t, e, r) {
  3948. this.transform = {
  3949. mProps: t,
  3950. op: e,
  3951. container: r
  3952. }, this.elements = [], this._isAnimated = this.transform.mProps.dynamicProperties.length || this.transform.op.effectsSequence.length
  3953. }
  3954. SVGShapeData.prototype.setAsAnimated = function() {
  3955. this._isAnimated = !0
  3956. }, SVGStyleData.prototype.reset = function() {
  3957. this.d = "", this._mdf = !1
  3958. }, DashProperty.prototype.getValue = function(t) {
  3959. if ((this.elem.globalData.frameId !== this.frameId || t) && (this.frameId = this.elem.globalData.frameId, this.iterateDynamicProperties(), this._mdf = this._mdf || t, this._mdf)) {
  3960. var e = 0,
  3961. r = this.dataProps.length;
  3962. for ("svg" === this.renderer && (this.dashStr = ""), e = 0; e < r; 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
  3963. }
  3964. }, extendPrototype([DynamicPropertyContainer], DashProperty), extendPrototype([DynamicPropertyContainer], SVGStrokeStyleData), extendPrototype([DynamicPropertyContainer], SVGFillStyleData), extendPrototype([DynamicPropertyContainer], SVGNoStyleData), GradientProperty.prototype.comparePoints = function(t, e) {
  3965. for (var r = 0, i = this.o.length / 2; r < i;) {
  3966. if (Math.abs(t[4 * r] - t[4 * e + 2 * r]) > .01) return !1;
  3967. r += 1
  3968. }
  3969. return !0
  3970. }, GradientProperty.prototype.checkCollapsable = function() {
  3971. if (this.o.length / 2 != this.c.length / 4) return !1;
  3972. if (this.data.k.k[0].s)
  3973. for (var t = 0, e = this.data.k.k.length; t < e;) {
  3974. if (!this.comparePoints(this.data.k.k[t].s, this.data.p)) return !1;
  3975. t += 1
  3976. } else if (!this.comparePoints(this.data.k.k, this.data.p)) return !1;
  3977. return !0
  3978. }, GradientProperty.prototype.getValue = function(t) {
  3979. if (this.prop.getValue(), this._mdf = !1, this._cmdf = !1, this._omdf = !1, this.prop._mdf || t) {
  3980. var e, r, i, s = 4 * this.data.p;
  3981. for (e = 0; e < s; e += 1) r = e % 4 == 0 ? 100 : 255, i = Math.round(this.prop.v[e] * r), this.c[e] !== i && (this.c[e] = i, this._cmdf = !t);
  3982. if (this.o.length)
  3983. for (s = this.prop.v.length, e = 4 * this.data.p; e < s; e += 1) r = e % 2 == 0 ? 100 : 1, i = e % 2 == 0 ? Math.round(100 * this.prop.v[e]) : this.prop.v[e], this.o[e - 4 * this.data.p] !== i && (this.o[e - 4 * this.data.p] = i, this._omdf = !t);
  3984. this._mdf = !t
  3985. }
  3986. }, extendPrototype([DynamicPropertyContainer], GradientProperty), SVGGradientFillStyleData.prototype.initGradientData = function(t, e, r) {
  3987. this.o = PropertyFactory.getProp(t, e.o, 0, .01, this), this.s = PropertyFactory.getProp(t, e.s, 1, null, this), this.e = PropertyFactory.getProp(t, e.e, 1, null, this), this.h = PropertyFactory.getProp(t, e.h || {
  3988. k: 0
  3989. }, 0, .01, this), this.a = PropertyFactory.getProp(t, e.a || {
  3990. k: 0
  3991. }, 0, degToRads, this), this.g = new GradientProperty(t, e.g, this), this.style = r, this.stops = [], this.setGradientData(r.pElem, e), this.setGradientOpacity(e, r), this._isAnimated = !!this._isAnimated
  3992. }, SVGGradientFillStyleData.prototype.setGradientData = function(t, e) {
  3993. var r = createElementID(),
  3994. i = createNS(1 === e.t ? "linearGradient" : "radialGradient");
  3995. i.setAttribute("id", r), i.setAttribute("spreadMethod", "pad"), i.setAttribute("gradientUnits", "userSpaceOnUse");
  3996. var s, a, n, o = [];
  3997. for (n = 4 * e.g.p, a = 0; a < n; a += 4) s = createNS("stop"), i.appendChild(s), o.push(s);
  3998. t.setAttribute("gf" === e.ty ? "fill" : "stroke", "url(" + getLocationHref() + "#" + r + ")"), this.gf = i, this.cst = o
  3999. }, SVGGradientFillStyleData.prototype.setGradientOpacity = function(t, e) {
  4000. if (this.g._hasOpacity && !this.g._collapsable) {
  4001. var r, i, s, a = createNS("mask"),
  4002. n = createNS("path");
  4003. a.appendChild(n);
  4004. var o = createElementID(),
  4005. h = createElementID();
  4006. a.setAttribute("id", h);
  4007. var l = createNS(1 === t.t ? "linearGradient" : "radialGradient");
  4008. l.setAttribute("id", o), l.setAttribute("spreadMethod", "pad"), l.setAttribute("gradientUnits", "userSpaceOnUse"), s = t.g.k.k[0].s ? t.g.k.k[0].s.length : t.g.k.k.length;
  4009. var p = this.stops;
  4010. for (i = 4 * t.g.p; i < s; i += 2)(r = createNS("stop")).setAttribute("stop-color", "rgb(255,255,255)"), l.appendChild(r), p.push(r);
  4011. n.setAttribute("gf" === t.ty ? "fill" : "stroke", "url(" + getLocationHref() + "#" + o + ")"), "gs" === t.ty && (n.setAttribute("stroke-linecap", lineCapEnum[t.lc || 2]), n.setAttribute("stroke-linejoin", lineJoinEnum[t.lj || 2]), 1 === t.lj && n.setAttribute("stroke-miterlimit", t.ml)), this.of = l, this.ms = a, this.ost = p, this.maskId = h, e.msElem = n
  4012. }
  4013. }, extendPrototype([DynamicPropertyContainer], SVGGradientFillStyleData), extendPrototype([SVGGradientFillStyleData, DynamicPropertyContainer], SVGGradientStrokeStyleData);
  4014. var buildShapeString = function(t, e, r, i) {
  4015. if (0 === e) return "";
  4016. var s, a = t.o,
  4017. n = t.i,
  4018. o = t.v,
  4019. h = " M" + i.applyToPointStringified(o[0][0], o[0][1]);
  4020. for (s = 1; s < e; s += 1) h += " C" + i.applyToPointStringified(a[s - 1][0], a[s - 1][1]) + " " + i.applyToPointStringified(n[s][0], n[s][1]) + " " + i.applyToPointStringified(o[s][0], o[s][1]);
  4021. return r && e && (h += " C" + i.applyToPointStringified(a[s - 1][0], a[s - 1][1]) + " " + i.applyToPointStringified(n[0][0], n[0][1]) + " " + i.applyToPointStringified(o[0][0], o[0][1]), h += "z"), h
  4022. },
  4023. SVGElementsRenderer = function() {
  4024. var t = new Matrix,
  4025. e = new Matrix;
  4026. function r(t, e, r) {
  4027. (r || e.transform.op._mdf) && e.transform.container.setAttribute("opacity", e.transform.op.v), (r || e.transform.mProps._mdf) && e.transform.container.setAttribute("transform", e.transform.mProps.v.to2dCSS())
  4028. }
  4029. function i() {}
  4030. function s(r, i, s) {
  4031. var a, n, o, h, l, p, f, m, c, d, u, y = i.styles.length,
  4032. g = i.lvl;
  4033. for (p = 0; p < y; p += 1) {
  4034. if (h = i.sh._mdf || s, i.styles[p].lvl < g) {
  4035. for (m = e.reset(), d = g - i.styles[p].lvl, u = i.transformers.length - 1; !h && d > 0;) h = i.transformers[u].mProps._mdf || h, d -= 1, u -= 1;
  4036. if (h)
  4037. for (d = g - i.styles[p].lvl, u = i.transformers.length - 1; d > 0;) c = i.transformers[u].mProps.v.props, m.transform(c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7], c[8], c[9], c[10], c[11], c[12], c[13], c[14], c[15]), d -= 1, u -= 1
  4038. } else m = t;
  4039. if (n = (f = i.sh.paths)._length, h) {
  4040. for (o = "", a = 0; a < n; a += 1)(l = f.shapes[a]) && l._length && (o += buildShapeString(l, l._length, l.c, m));
  4041. i.caches[p] = o
  4042. } else o = i.caches[p];
  4043. i.styles[p].d += !0 === r.hd ? "" : o, i.styles[p]._mdf = h || i.styles[p]._mdf
  4044. }
  4045. }
  4046. function a(t, e, r) {
  4047. var i = e.style;
  4048. (e.c._mdf || r) && i.pElem.setAttribute("fill", "rgb(" + bmFloor(e.c.v[0]) + "," + bmFloor(e.c.v[1]) + "," + bmFloor(e.c.v[2]) + ")"), (e.o._mdf || r) && i.pElem.setAttribute("fill-opacity", e.o.v)
  4049. }
  4050. function n(t, e, r) {
  4051. o(t, e, r), h(t, e, r)
  4052. }
  4053. function o(t, e, r) {
  4054. var i, s, a, n, o, h = e.gf,
  4055. l = e.g._hasOpacity,
  4056. p = e.s.v,
  4057. f = e.e.v;
  4058. if (e.o._mdf || r) {
  4059. var m = "gf" === t.ty ? "fill-opacity" : "stroke-opacity";
  4060. e.style.pElem.setAttribute(m, e.o.v)
  4061. }
  4062. if (e.s._mdf || r) {
  4063. var c = 1 === t.t ? "x1" : "cx",
  4064. d = "x1" === c ? "y1" : "cy";
  4065. h.setAttribute(c, p[0]), h.setAttribute(d, p[1]), l && !e.g._collapsable && (e.of.setAttribute(c, p[0]), e.of.setAttribute(d, p[1]))
  4066. }
  4067. if (e.g._cmdf || r) {
  4068. i = e.cst;
  4069. var u = e.g.c;
  4070. for (a = i.length, s = 0; s < a; s += 1)(n = i[s]).setAttribute("offset", u[4 * s] + "%"), n.setAttribute("stop-color", "rgb(" + u[4 * s + 1] + "," + u[4 * s + 2] + "," + u[4 * s + 3] + ")")
  4071. }
  4072. if (l && (e.g._omdf || r)) {
  4073. var y = e.g.o;
  4074. for (a = (i = e.g._collapsable ? e.cst : e.ost).length, s = 0; s < a; s += 1) n = i[s], e.g._collapsable || n.setAttribute("offset", y[2 * s] + "%"), n.setAttribute("stop-opacity", y[2 * s + 1])
  4075. }
  4076. if (1 === t.t)(e.e._mdf || r) && (h.setAttribute("x2", f[0]), h.setAttribute("y2", f[1]), l && !e.g._collapsable && (e.of.setAttribute("x2", f[0]), e.of.setAttribute("y2", f[1])));
  4077. else if ((e.s._mdf || e.e._mdf || r) && (o = Math.sqrt(Math.pow(p[0] - f[0], 2) + Math.pow(p[1] - f[1], 2)), h.setAttribute("r", o), l && !e.g._collapsable && e.of.setAttribute("r", o)), e.e._mdf || e.h._mdf || e.a._mdf || r) {
  4078. o || (o = Math.sqrt(Math.pow(p[0] - f[0], 2) + Math.pow(p[1] - f[1], 2)));
  4079. var g = Math.atan2(f[1] - p[1], f[0] - p[0]),
  4080. v = e.h.v;
  4081. v >= 1 ? v = .99 : v <= -1 && (v = -.99);
  4082. var b = o * v,
  4083. P = Math.cos(g + e.a.v) * b + p[0],
  4084. E = Math.sin(g + e.a.v) * b + p[1];
  4085. h.setAttribute("fx", P), h.setAttribute("fy", E), l && !e.g._collapsable && (e.of.setAttribute("fx", P), e.of.setAttribute("fy", E))
  4086. }
  4087. }
  4088. function h(t, e, r) {
  4089. var i = e.style,
  4090. s = e.d;
  4091. s && (s._mdf || r) && s.dashStr && (i.pElem.setAttribute("stroke-dasharray", s.dashStr), i.pElem.setAttribute("stroke-dashoffset", s.dashoffset[0])), e.c && (e.c._mdf || r) && i.pElem.setAttribute("stroke", "rgb(" + bmFloor(e.c.v[0]) + "," + bmFloor(e.c.v[1]) + "," + bmFloor(e.c.v[2]) + ")"), (e.o._mdf || r) && i.pElem.setAttribute("stroke-opacity", e.o.v), (e.w._mdf || r) && (i.pElem.setAttribute("stroke-width", e.w.v), i.msElem && i.msElem.setAttribute("stroke-width", e.w.v))
  4092. }
  4093. return {
  4094. createRenderFunction: function(t) {
  4095. switch (t.ty) {
  4096. case "fl":
  4097. return a;
  4098. case "gf":
  4099. return o;
  4100. case "gs":
  4101. return n;
  4102. case "st":
  4103. return h;
  4104. case "sh":
  4105. case "el":
  4106. case "rc":
  4107. case "sr":
  4108. return s;
  4109. case "tr":
  4110. return r;
  4111. case "no":
  4112. return i;
  4113. default:
  4114. return null
  4115. }
  4116. }
  4117. }
  4118. }();
  4119. function SVGShapeElement(t, e, r) {
  4120. this.shapes = [], this.shapesData = t.shapes, this.stylesList = [], this.shapeModifiers = [], this.itemsData = [], this.processedElements = [], this.animatedContents = [], this.initElement(t, e, r), this.prevViewData = []
  4121. }
  4122. function LetterProps(t, e, r, i, s, a) {
  4123. this.o = t, this.sw = e, this.sc = r, this.fc = i, this.m = s, this.p = a, this._mdf = {
  4124. o: !0,
  4125. sw: !!e,
  4126. sc: !!r,
  4127. fc: !!i,
  4128. m: !0,
  4129. p: !0
  4130. }
  4131. }
  4132. function TextProperty(t, e) {
  4133. this._frameId = initialDefaultFrame, this.pv = "", this.v = "", this.kf = !1, this._isFirstFrame = !0, this._mdf = !1, this.data = e, this.elem = t, this.comp = this.elem.comp, this.keysIndex = 0, this.canResize = !1, this.minimumFontSize = 1, this.effectsSequence = [], this.currentData = {
  4134. ascent: 0,
  4135. boxWidth: this.defaultBoxWidth,
  4136. f: "",
  4137. fStyle: "",
  4138. fWeight: "",
  4139. fc: "",
  4140. j: "",
  4141. justifyOffset: "",
  4142. l: [],
  4143. lh: 0,
  4144. lineWidths: [],
  4145. ls: "",
  4146. of: "",
  4147. s: "",
  4148. sc: "",
  4149. sw: 0,
  4150. t: 0,
  4151. tr: 0,
  4152. sz: 0,
  4153. ps: null,
  4154. fillColorAnim: !1,
  4155. strokeColorAnim: !1,
  4156. strokeWidthAnim: !1,
  4157. yOffset: 0,
  4158. finalSize: 0,
  4159. finalText: [],
  4160. finalLineHeight: 0,
  4161. __complete: !1
  4162. }, this.copyData(this.currentData, this.data.d.k[0].s), this.searchProperty() || this.completeTextData(this.currentData)
  4163. }
  4164. extendPrototype([BaseElement, TransformElement, SVGBaseElement, IShapeElement, HierarchyElement, FrameElement, RenderableDOMElement], SVGShapeElement), SVGShapeElement.prototype.initSecondaryElement = function() {}, SVGShapeElement.prototype.identityMatrix = new Matrix, SVGShapeElement.prototype.buildExpressionInterface = function() {}, SVGShapeElement.prototype.createContent = function() {
  4165. this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], !0), this.filterUniqueShapes()
  4166. }, SVGShapeElement.prototype.filterUniqueShapes = function() {
  4167. var t, e, r, i, s = this.shapes.length,
  4168. a = this.stylesList.length,
  4169. n = [],
  4170. o = !1;
  4171. for (r = 0; r < a; r += 1) {
  4172. for (i = this.stylesList[r], o = !1, n.length = 0, t = 0; t < s; t += 1) - 1 !== (e = this.shapes[t]).styles.indexOf(i) && (n.push(e), o = e._isAnimated || o);
  4173. n.length > 1 && o && this.setShapesAsAnimated(n)
  4174. }
  4175. }, SVGShapeElement.prototype.setShapesAsAnimated = function(t) {
  4176. var e, r = t.length;
  4177. for (e = 0; e < r; e += 1) t[e].setAsAnimated()
  4178. }, SVGShapeElement.prototype.createStyleElement = function(t, e) {
  4179. var r, i = new SVGStyleData(t, e),
  4180. s = i.pElem;
  4181. if ("st" === t.ty) r = new SVGStrokeStyleData(this, t, i);
  4182. else if ("fl" === t.ty) r = new SVGFillStyleData(this, t, i);
  4183. else if ("gf" === t.ty || "gs" === t.ty) {
  4184. r = new("gf" === t.ty ? SVGGradientFillStyleData : SVGGradientStrokeStyleData)(this, t, i), this.globalData.defs.appendChild(r.gf), r.maskId && (this.globalData.defs.appendChild(r.ms), this.globalData.defs.appendChild(r.of), s.setAttribute("mask", "url(" + getLocationHref() + "#" + r.maskId + ")"))
  4185. } else "no" === t.ty && (r = new SVGNoStyleData(this, t, i));
  4186. return "st" !== t.ty && "gs" !== t.ty || (s.setAttribute("stroke-linecap", lineCapEnum[t.lc || 2]), s.setAttribute("stroke-linejoin", lineJoinEnum[t.lj || 2]), s.setAttribute("fill-opacity", "0"), 1 === t.lj && s.setAttribute("stroke-miterlimit", t.ml)), 2 === t.r && s.setAttribute("fill-rule", "evenodd"), t.ln && s.setAttribute("id", t.ln), t.cl && s.setAttribute("class", t.cl), t.bm && (s.style["mix-blend-mode"] = getBlendMode(t.bm)), this.stylesList.push(i), this.addToAnimatedContents(t, r), r
  4187. }, SVGShapeElement.prototype.createGroupElement = function(t) {
  4188. var e = new ShapeGroupData;
  4189. 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"] = getBlendMode(t.bm)), e
  4190. }, SVGShapeElement.prototype.createTransformElement = function(t, e) {
  4191. var r = TransformPropertyFactory.getTransformProperty(this, t, this),
  4192. i = new SVGTransformData(r, r.o, e);
  4193. return this.addToAnimatedContents(t, i), i
  4194. }, SVGShapeElement.prototype.createShapeElement = function(t, e, r) {
  4195. var i = 4;
  4196. "rc" === t.ty ? i = 5 : "el" === t.ty ? i = 6 : "sr" === t.ty && (i = 7);
  4197. var s = new SVGShapeData(e, r, ShapePropertyFactory.getShapeProp(this, t, i, this));
  4198. return this.shapes.push(s), this.addShapeToModifiers(s), this.addToAnimatedContents(t, s), s
  4199. }, SVGShapeElement.prototype.addToAnimatedContents = function(t, e) {
  4200. for (var r = 0, i = this.animatedContents.length; r < i;) {
  4201. if (this.animatedContents[r].element === e) return;
  4202. r += 1
  4203. }
  4204. this.animatedContents.push({
  4205. fn: SVGElementsRenderer.createRenderFunction(t),
  4206. element: e,
  4207. data: t
  4208. })
  4209. }, SVGShapeElement.prototype.setElementStyles = function(t) {
  4210. var e, r = t.styles,
  4211. i = this.stylesList.length;
  4212. for (e = 0; e < i; e += 1) this.stylesList[e].closed || r.push(this.stylesList[e])
  4213. }, SVGShapeElement.prototype.reloadShapes = function() {
  4214. var t;
  4215. this._isFirstFrame = !0;
  4216. var e = this.itemsData.length;
  4217. for (t = 0; t < e; t += 1) this.prevViewData[t] = this.itemsData[t];
  4218. 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();
  4219. this.renderModifiers()
  4220. }, SVGShapeElement.prototype.searchShapes = function(t, e, r, i, s, a, n) {
  4221. var o, h, l, p, f, m, c = [].concat(a),
  4222. d = t.length - 1,
  4223. u = [],
  4224. y = [];
  4225. for (o = d; o >= 0; o -= 1) {
  4226. if ((m = this.searchProcessedElement(t[o])) ? e[o] = r[m - 1] : t[o]._render = n, "fl" === t[o].ty || "st" === t[o].ty || "gf" === t[o].ty || "gs" === t[o].ty || "no" === t[o].ty) m ? e[o].style.closed = !1 : e[o] = this.createStyleElement(t[o], s), t[o]._render && e[o].style.pElem.parentNode !== i && i.appendChild(e[o].style.pElem), u.push(e[o].style);
  4227. else if ("gr" === t[o].ty) {
  4228. if (m)
  4229. for (l = e[o].it.length, h = 0; h < l; h += 1) e[o].prevViewData[h] = e[o].it[h];
  4230. else e[o] = this.createGroupElement(t[o]);
  4231. this.searchShapes(t[o].it, e[o].it, e[o].prevViewData, e[o].gr, s + 1, c, n), t[o]._render && e[o].gr.parentNode !== i && i.appendChild(e[o].gr)
  4232. } else "tr" === t[o].ty ? (m || (e[o] = this.createTransformElement(t[o], i)), p = e[o].transform, c.push(p)) : "sh" === t[o].ty || "rc" === t[o].ty || "el" === t[o].ty || "sr" === t[o].ty ? (m || (e[o] = this.createShapeElement(t[o], c, s)), this.setElementStyles(e[o])) : "tm" === t[o].ty || "rd" === t[o].ty || "ms" === t[o].ty || "pb" === t[o].ty ? (m ? (f = e[o]).closed = !1 : ((f = ShapeModifiers.getModifier(t[o].ty)).init(this, t[o]), e[o] = f, this.shapeModifiers.push(f)), y.push(f)) : "rp" === t[o].ty && (m ? (f = e[o]).closed = !0 : (f = ShapeModifiers.getModifier(t[o].ty), e[o] = f, f.init(this, t, o, e), this.shapeModifiers.push(f), n = !1), y.push(f));
  4233. this.addProcessedElement(t[o], o + 1)
  4234. }
  4235. for (d = u.length, o = 0; o < d; o += 1) u[o].closed = !0;
  4236. for (d = y.length, o = 0; o < d; o += 1) y[o].closed = !0
  4237. }, SVGShapeElement.prototype.renderInnerContent = function() {
  4238. var t;
  4239. this.renderModifiers();
  4240. var e = this.stylesList.length;
  4241. for (t = 0; t < e; t += 1) this.stylesList[t].reset();
  4242. 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"))
  4243. }, SVGShapeElement.prototype.renderShape = function() {
  4244. var t, e, r = this.animatedContents.length;
  4245. for (t = 0; t < r; t += 1) e = this.animatedContents[t], (this._isFirstFrame || e.element._isAnimated) && !0 !== e.data && e.fn(e.data, e.element, this._isFirstFrame)
  4246. }, SVGShapeElement.prototype.destroy = function() {
  4247. this.destroyBaseElement(), this.shapesData = null, this.itemsData = null
  4248. }, LetterProps.prototype.update = function(t, e, r, i, s, a) {
  4249. this._mdf.o = !1, this._mdf.sw = !1, this._mdf.sc = !1, this._mdf.fc = !1, this._mdf.m = !1, this._mdf.p = !1;
  4250. var n = !1;
  4251. return this.o !== t && (this.o = t, this._mdf.o = !0, n = !0), this.sw !== e && (this.sw = e, this._mdf.sw = !0, n = !0), this.sc !== r && (this.sc = r, this._mdf.sc = !0, n = !0), this.fc !== i && (this.fc = i, this._mdf.fc = !0, n = !0), this.m !== s && (this.m = s, this._mdf.m = !0, n = !0), !a.length || this.p[0] === a[0] && this.p[1] === a[1] && this.p[4] === a[4] && this.p[5] === a[5] && this.p[12] === a[12] && this.p[13] === a[13] || (this.p = a, this._mdf.p = !0, n = !0), n
  4252. }, TextProperty.prototype.defaultBoxWidth = [0, 0], TextProperty.prototype.copyData = function(t, e) {
  4253. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
  4254. return t
  4255. }, TextProperty.prototype.setCurrentData = function(t) {
  4256. t.__complete || this.completeTextData(t), this.currentData = t, this.currentData.boxWidth = this.currentData.boxWidth || this.defaultBoxWidth, this._mdf = !0
  4257. }, TextProperty.prototype.searchProperty = function() {
  4258. return this.searchKeyframes()
  4259. }, TextProperty.prototype.searchKeyframes = function() {
  4260. return this.kf = this.data.d.k.length > 1, this.kf && this.addEffect(this.getKeyframeValue.bind(this)), this.kf
  4261. }, TextProperty.prototype.addEffect = function(t) {
  4262. this.effectsSequence.push(t), this.elem.addDynamicProperty(this)
  4263. }, TextProperty.prototype.getValue = function(t) {
  4264. if (this.elem.globalData.frameId !== this.frameId && this.effectsSequence.length || t) {
  4265. this.currentData.t = this.data.d.k[this.keysIndex].s.t;
  4266. var e = this.currentData,
  4267. r = this.keysIndex;
  4268. if (this.lock) this.setCurrentData(this.currentData);
  4269. else {
  4270. var i;
  4271. this.lock = !0, this._mdf = !1;
  4272. var s = this.effectsSequence.length,
  4273. a = t || this.data.d.k[this.keysIndex].s;
  4274. for (i = 0; i < s; i += 1) a = r !== this.keysIndex ? this.effectsSequence[i](a, a.t) : this.effectsSequence[i](this.currentData, a.t);
  4275. e !== a && this.setCurrentData(a), this.v = this.currentData, this.pv = this.v, this.lock = !1, this.frameId = this.elem.globalData.frameId
  4276. }
  4277. }
  4278. }, TextProperty.prototype.getKeyframeValue = function() {
  4279. for (var t = this.data.d.k, e = this.elem.comp.renderedFrame, r = 0, i = t.length; r <= i - 1 && !(r === i - 1 || t[r + 1].t > e);) r += 1;
  4280. return this.keysIndex !== r && (this.keysIndex = r), this.data.d.k[this.keysIndex].s
  4281. }, TextProperty.prototype.buildFinalText = function(t) {
  4282. for (var e, r, i = [], s = 0, a = t.length, n = !1; s < a;) e = t.charCodeAt(s), FontManager.isCombinedCharacter(e) ? i[i.length - 1] += t.charAt(s) : e >= 55296 && e <= 56319 ? (r = t.charCodeAt(s + 1)) >= 56320 && r <= 57343 ? (n || FontManager.isModifier(e, r) ? (i[i.length - 1] += t.substr(s, 2), n = !1) : i.push(t.substr(s, 2)), s += 1) : i.push(t.charAt(s)) : e > 56319 ? (r = t.charCodeAt(s + 1), FontManager.isZeroWidthJoiner(e, r) ? (n = !0, i[i.length - 1] += t.substr(s, 2), s += 1) : i.push(t.charAt(s))) : FontManager.isZeroWidthJoiner(e) ? (i[i.length - 1] += t.charAt(s), n = !0) : i.push(t.charAt(s)), s += 1;
  4283. return i
  4284. }, TextProperty.prototype.completeTextData = function(t) {
  4285. t.__complete = !0;
  4286. var e, r, i, s, a, n, o, h = this.elem.globalData.fontManager,
  4287. l = this.data,
  4288. p = [],
  4289. f = 0,
  4290. m = l.m.g,
  4291. c = 0,
  4292. d = 0,
  4293. u = 0,
  4294. y = [],
  4295. g = 0,
  4296. v = 0,
  4297. b = h.getFontByName(t.f),
  4298. P = 0,
  4299. E = getFontProperties(b);
  4300. t.fWeight = E.weight, t.fStyle = E.style, t.finalSize = t.s, t.finalText = this.buildFinalText(t.t), r = t.finalText.length, t.finalLineHeight = t.lh;
  4301. var x, S = t.tr / 1e3 * t.finalSize;
  4302. if (t.sz)
  4303. for (var _, C, A = !0, T = t.sz[0], D = t.sz[1]; A;) {
  4304. _ = 0, g = 0, r = (C = this.buildFinalText(t.t)).length, S = t.tr / 1e3 * t.finalSize;
  4305. var k = -1;
  4306. for (e = 0; e < r; e += 1) x = C[e].charCodeAt(0), i = !1, " " === C[e] ? k = e : 13 !== x && 3 !== x || (g = 0, i = !0, _ += t.finalLineHeight || 1.2 * t.finalSize), h.chars ? (o = h.getCharData(C[e], b.fStyle, b.fFamily), P = i ? 0 : o.w * t.finalSize / 100) : P = h.measureText(C[e], t.f, t.finalSize), g + P > T && " " !== C[e] ? (-1 === k ? r += 1 : e = k, _ += t.finalLineHeight || 1.2 * t.finalSize, C.splice(e, k === e ? 1 : 0, "\r"), k = -1, g = 0) : (g += P, g += S);
  4307. _ += b.ascent * t.finalSize / 100, this.canResize && t.finalSize > this.minimumFontSize && D < _ ? (t.finalSize -= 1, t.finalLineHeight = t.finalSize * t.lh / t.s) : (t.finalText = C, r = t.finalText.length, A = !1)
  4308. }
  4309. g = -S, P = 0;
  4310. var M, F = 0;
  4311. for (e = 0; e < r; e += 1)
  4312. if (i = !1, 13 === (x = (M = t.finalText[e]).charCodeAt(0)) || 3 === x ? (F = 0, y.push(g), v = g > v ? g : v, g = -2 * S, s = "", i = !0, u += 1) : s = M, h.chars ? (o = h.getCharData(M, b.fStyle, h.getFontByName(t.f).fFamily), P = i ? 0 : o.w * t.finalSize / 100) : P = h.measureText(s, t.f, t.finalSize), " " === M ? F += P + S : (g += P + S + F, F = 0), p.push({
  4313. l: P,
  4314. an: P,
  4315. add: c,
  4316. n: i,
  4317. anIndexes: [],
  4318. val: s,
  4319. line: u,
  4320. animatorJustifyOffset: 0
  4321. }), 2 == m) {
  4322. if (c += P, "" === s || " " === s || e === r - 1) {
  4323. for ("" !== s && " " !== s || (c -= P); d <= e;) p[d].an = c, p[d].ind = f, p[d].extra = P, d += 1;
  4324. f += 1, c = 0
  4325. }
  4326. } else if (3 == m) {
  4327. if (c += P, "" === s || e === r - 1) {
  4328. for ("" === s && (c -= P); d <= e;) p[d].an = c, p[d].ind = f, p[d].extra = P, d += 1;
  4329. c = 0, f += 1
  4330. }
  4331. } else p[f].ind = f, p[f].extra = 0, f += 1;
  4332. if (t.l = p, v = g > v ? g : v, y.push(g), t.sz) t.boxWidth = t.sz[0], t.justifyOffset = 0;
  4333. else switch (t.boxWidth = v, t.j) {
  4334. case 1:
  4335. t.justifyOffset = -t.boxWidth;
  4336. break;
  4337. case 2:
  4338. t.justifyOffset = -t.boxWidth / 2;
  4339. break;
  4340. default:
  4341. t.justifyOffset = 0
  4342. }
  4343. t.lineWidths = y;
  4344. var w, I, V, B, R = l.a;
  4345. n = R.length;
  4346. var L = [];
  4347. for (a = 0; a < n; a += 1) {
  4348. for ((w = R[a]).a.sc && (t.strokeColorAnim = !0), w.a.sw && (t.strokeWidthAnim = !0), (w.a.fc || w.a.fh || w.a.fs || w.a.fb) && (t.fillColorAnim = !0), B = 0, V = w.s.b, e = 0; e < r; e += 1)(I = p[e]).anIndexes[a] = B, (1 == V && "" !== I.val || 2 == V && "" !== I.val && " " !== I.val || 3 == V && (I.n || " " == I.val || e == r - 1) || 4 == V && (I.n || e == r - 1)) && (1 === w.s.rn && L.push(B), B += 1);
  4349. l.a[a].s.totalChars = B;
  4350. var G, z = -1;
  4351. if (1 === w.s.rn)
  4352. for (e = 0; e < r; e += 1) z != (I = p[e]).anIndexes[a] && (z = I.anIndexes[a], G = L.splice(Math.floor(Math.random() * L.length), 1)[0]), I.anIndexes[a] = G
  4353. }
  4354. t.yOffset = t.finalLineHeight || 1.2 * t.finalSize, t.ls = t.ls || 0, t.ascent = b.ascent * t.finalSize / 100
  4355. }, TextProperty.prototype.updateDocumentData = function(t, e) {
  4356. e = void 0 === e ? this.keysIndex : e;
  4357. var r = this.copyData({}, this.data.d.k[e].s);
  4358. r = this.copyData(r, t), this.data.d.k[e].s = r, this.recalculate(e), this.elem.addDynamicProperty(this)
  4359. }, TextProperty.prototype.recalculate = function(t) {
  4360. var e = this.data.d.k[t].s;
  4361. e.__complete = !1, this.keysIndex = 0, this._isFirstFrame = !0, this.getValue(e)
  4362. }, TextProperty.prototype.canResizeFont = function(t) {
  4363. this.canResize = t, this.recalculate(this.keysIndex), this.elem.addDynamicProperty(this)
  4364. }, TextProperty.prototype.setMinimumFontSize = function(t) {
  4365. this.minimumFontSize = Math.floor(t) || 1, this.recalculate(this.keysIndex), this.elem.addDynamicProperty(this)
  4366. };
  4367. var TextSelectorProp = function() {
  4368. var t = Math.max,
  4369. e = Math.min,
  4370. r = Math.floor;
  4371. function i(t, e) {
  4372. 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 = PropertyFactory.getProp(t, e.s || {
  4373. k: 0
  4374. }, 0, 0, this), this.e = "e" in e ? PropertyFactory.getProp(t, e.e, 0, 0, this) : {
  4375. v: 100
  4376. }, this.o = PropertyFactory.getProp(t, e.o || {
  4377. k: 0
  4378. }, 0, 0, this), this.xe = PropertyFactory.getProp(t, e.xe || {
  4379. k: 0
  4380. }, 0, 0, this), this.ne = PropertyFactory.getProp(t, e.ne || {
  4381. k: 0
  4382. }, 0, 0, this), this.sm = PropertyFactory.getProp(t, e.sm || {
  4383. k: 100
  4384. }, 0, 0, this), this.a = PropertyFactory.getProp(t, e.a, 0, .01, this), this.dynamicProperties.length || this.getValue()
  4385. }
  4386. return i.prototype = {
  4387. getMult: function(i) {
  4388. this._currentTextLength !== this.elem.textProperty.currentData.l.length && this.getValue();
  4389. var s = 0,
  4390. a = 0,
  4391. n = 1,
  4392. o = 1;
  4393. this.ne.v > 0 ? s = this.ne.v / 100 : a = -this.ne.v / 100, this.xe.v > 0 ? n = 1 - this.xe.v / 100 : o = 1 + this.xe.v / 100;
  4394. var h = BezierFactory.getBezierEasing(s, a, n, o).get,
  4395. l = 0,
  4396. p = this.finalS,
  4397. f = this.finalE,
  4398. m = this.data.sh;
  4399. if (2 === m) l = h(l = f === p ? i >= f ? 1 : 0 : t(0, e(.5 / (f - p) + (i - p) / (f - p), 1)));
  4400. else if (3 === m) l = h(l = f === p ? i >= f ? 0 : 1 : 1 - t(0, e(.5 / (f - p) + (i - p) / (f - p), 1)));
  4401. else if (4 === m) f === p ? l = 0 : (l = t(0, e(.5 / (f - p) + (i - p) / (f - p), 1))) < .5 ? l *= 2 : l = 1 - 2 * (l - .5), l = h(l);
  4402. else if (5 === m) {
  4403. if (f === p) l = 0;
  4404. else {
  4405. var c = f - p,
  4406. d = -c / 2 + (i = e(t(0, i + .5 - p), f - p)),
  4407. u = c / 2;
  4408. l = Math.sqrt(1 - d * d / (u * u))
  4409. }
  4410. l = h(l)
  4411. } else 6 === m ? (f === p ? l = 0 : (i = e(t(0, i + .5 - p), f - p), l = (1 + Math.cos(Math.PI + 2 * Math.PI * i / (f - p))) / 2), l = h(l)) : (i >= r(p) && (l = t(0, e(i - p < 0 ? e(f, 1) - (p - i) : f - i, 1))), l = h(l));
  4412. if (100 !== this.sm.v) {
  4413. var y = .01 * this.sm.v;
  4414. 0 === y && (y = 1e-8);
  4415. var g = .5 - .5 * y;
  4416. l < g ? l = 0 : (l = (l - g) / y) > 1 && (l = 1)
  4417. }
  4418. return l * this.a.v
  4419. },
  4420. getValue: function(t) {
  4421. 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);
  4422. var e = 2 === this.data.r ? 1 : 100 / this.data.totalChars,
  4423. r = this.o.v / e,
  4424. i = this.s.v / e + r,
  4425. s = this.e.v / e + r;
  4426. if (i > s) {
  4427. var a = i;
  4428. i = s, s = a
  4429. }
  4430. this.finalS = i, this.finalE = s
  4431. }
  4432. }, extendPrototype([DynamicPropertyContainer], i), {
  4433. getTextSelectorProp: function(t, e, r) {
  4434. return new i(t, e, r)
  4435. }
  4436. }
  4437. }();
  4438. function TextAnimatorDataProperty(t, e, r) {
  4439. var i = {
  4440. propType: !1
  4441. },
  4442. s = PropertyFactory.getProp,
  4443. a = e.a;
  4444. this.a = {
  4445. r: a.r ? s(t, a.r, 0, degToRads, r) : i,
  4446. rx: a.rx ? s(t, a.rx, 0, degToRads, r) : i,
  4447. ry: a.ry ? s(t, a.ry, 0, degToRads, r) : i,
  4448. sk: a.sk ? s(t, a.sk, 0, degToRads, r) : i,
  4449. sa: a.sa ? s(t, a.sa, 0, degToRads, r) : i,
  4450. s: a.s ? s(t, a.s, 1, .01, r) : i,
  4451. a: a.a ? s(t, a.a, 1, 0, r) : i,
  4452. o: a.o ? s(t, a.o, 0, .01, r) : i,
  4453. p: a.p ? s(t, a.p, 1, 0, r) : i,
  4454. sw: a.sw ? s(t, a.sw, 0, 0, r) : i,
  4455. sc: a.sc ? s(t, a.sc, 1, 0, r) : i,
  4456. fc: a.fc ? s(t, a.fc, 1, 0, r) : i,
  4457. fh: a.fh ? s(t, a.fh, 0, 0, r) : i,
  4458. fs: a.fs ? s(t, a.fs, 0, .01, r) : i,
  4459. fb: a.fb ? s(t, a.fb, 0, .01, r) : i,
  4460. t: a.t ? s(t, a.t, 0, 0, r) : i
  4461. }, this.s = TextSelectorProp.getTextSelectorProp(t, e.s, r), this.s.t = e.s.t
  4462. }
  4463. function TextAnimatorProperty(t, e, r) {
  4464. this._isFirstFrame = !0, this._hasMaskedPath = !1, this._frameId = -1, this._textData = t, this._renderType = e, this._elem = r, this._animatorsData = createSizedArray(this._textData.a.length), this._pathData = {}, this._moreOptions = {
  4465. alignment: {}
  4466. }, this.renderedLetters = [], this.lettersChangedFlag = !1, this.initDynamicPropertyContainer(r)
  4467. }
  4468. function ITextElement() {}
  4469. TextAnimatorProperty.prototype.searchProperties = function() {
  4470. var t, e, r = this._textData.a.length,
  4471. i = PropertyFactory.getProp;
  4472. for (t = 0; t < r; t += 1) e = this._textData.a[t], this._animatorsData[t] = new TextAnimatorDataProperty(this._elem, e, this);
  4473. this._textData.p && "m" in this._textData.p ? (this._pathData = {
  4474. a: i(this._elem, this._textData.p.a, 0, 0, this),
  4475. f: i(this._elem, this._textData.p.f, 0, 0, this),
  4476. l: i(this._elem, this._textData.p.l, 0, 0, this),
  4477. r: i(this._elem, this._textData.p.r, 0, 0, this),
  4478. p: i(this._elem, this._textData.p.p, 0, 0, this),
  4479. m: this._elem.maskManager.getMaskProperty(this._textData.p.m)
  4480. }, this._hasMaskedPath = !0) : this._hasMaskedPath = !1, this._moreOptions.alignment = i(this._elem, this._textData.m.a, 1, 0, this)
  4481. }, TextAnimatorProperty.prototype.getMeasures = function(t, e) {
  4482. if (this.lettersChangedFlag = e, this._mdf || this._isFirstFrame || e || this._hasMaskedPath && this._pathData.m._mdf) {
  4483. this._isFirstFrame = !1;
  4484. var r, i, s, a, n, o, h, l, p, f, m, c, d, u, y, g, v, b, P, E = this._moreOptions.alignment.v,
  4485. x = this._animatorsData,
  4486. S = this._textData,
  4487. _ = this.mHelper,
  4488. C = this._renderType,
  4489. A = this.renderedLetters.length,
  4490. T = t.l;
  4491. if (this._hasMaskedPath) {
  4492. if (P = this._pathData.m, !this._pathData.n || this._pathData._mdf) {
  4493. var D, k = P.v;
  4494. for (this._pathData.r.v && (k = k.reverse()), n = {
  4495. tLength: 0,
  4496. segments: []
  4497. }, a = k._length - 1, g = 0, s = 0; s < a; s += 1) D = bez.buildBezierData(k.v[s], k.v[s + 1], [k.o[s][0] - k.v[s][0], k.o[s][1] - k.v[s][1]], [k.i[s + 1][0] - k.v[s + 1][0], k.i[s + 1][1] - k.v[s + 1][1]]), n.tLength += D.segmentLength, n.segments.push(D), g += D.segmentLength;
  4498. s = a, P.v.c && (D = bez.buildBezierData(k.v[s], k.v[0], [k.o[s][0] - k.v[s][0], k.o[s][1] - k.v[s][1]], [k.i[0][0] - k.v[0][0], k.i[0][1] - k.v[0][1]]), n.tLength += D.segmentLength, n.segments.push(D), g += D.segmentLength), this._pathData.pi = n
  4499. }
  4500. if (n = this._pathData.pi, o = this._pathData.f.v, m = 0, f = 1, l = 0, p = !0, u = n.segments, o < 0 && P.v.c)
  4501. for (n.tLength < Math.abs(o) && (o = -Math.abs(o) % n.tLength), f = (d = u[m = u.length - 1].points).length - 1; o < 0;) o += d[f].partialLength, (f -= 1) < 0 && (f = (d = u[m -= 1].points).length - 1);
  4502. c = (d = u[m].points)[f - 1], y = (h = d[f]).partialLength
  4503. }
  4504. a = T.length, r = 0, i = 0;
  4505. var M, F, w, I, V, B = 1.2 * t.finalSize * .714,
  4506. R = !0;
  4507. w = x.length;
  4508. var L, G, z, N, O, H, j, q, W, $, Y, X, K = -1,
  4509. J = o,
  4510. Z = m,
  4511. U = f,
  4512. Q = -1,
  4513. tt = "",
  4514. et = this.defaultPropsArray;
  4515. if (2 === t.j || 1 === t.j) {
  4516. var rt = 0,
  4517. it = 0,
  4518. st = 2 === t.j ? -.5 : -1,
  4519. at = 0,
  4520. nt = !0;
  4521. for (s = 0; s < a; s += 1)
  4522. if (T[s].n) {
  4523. for (rt && (rt += it); at < s;) T[at].animatorJustifyOffset = rt, at += 1;
  4524. rt = 0, nt = !0
  4525. } else {
  4526. for (F = 0; F < w; F += 1)(M = x[F].a).t.propType && (nt && 2 === t.j && (it += M.t.v * st), (V = x[F].s.getMult(T[s].anIndexes[F], S.a[F].s.totalChars)).length ? rt += M.t.v * V[0] * st : rt += M.t.v * V * st);
  4527. nt = !1
  4528. }
  4529. for (rt && (rt += it); at < s;) T[at].animatorJustifyOffset = rt, at += 1
  4530. }
  4531. for (s = 0; s < a; s += 1) {
  4532. if (_.reset(), N = 1, T[s].n) r = 0, i += t.yOffset, i += R ? 1 : 0, o = J, R = !1, this._hasMaskedPath && (f = U, c = (d = u[m = Z].points)[f - 1], y = (h = d[f]).partialLength, l = 0), tt = "", Y = "", W = "", X = "", et = this.defaultPropsArray;
  4533. else {
  4534. if (this._hasMaskedPath) {
  4535. if (Q !== T[s].line) {
  4536. switch (t.j) {
  4537. case 1:
  4538. o += g - t.lineWidths[T[s].line];
  4539. break;
  4540. case 2:
  4541. o += (g - t.lineWidths[T[s].line]) / 2
  4542. }
  4543. Q = T[s].line
  4544. }
  4545. K !== T[s].ind && (T[K] && (o += T[K].extra), o += T[s].an / 2, K = T[s].ind), o += E[0] * T[s].an * .005;
  4546. var ot = 0;
  4547. for (F = 0; F < w; F += 1)(M = x[F].a).p.propType && ((V = x[F].s.getMult(T[s].anIndexes[F], S.a[F].s.totalChars)).length ? ot += M.p.v[0] * V[0] : ot += M.p.v[0] * V), M.a.propType && ((V = x[F].s.getMult(T[s].anIndexes[F], S.a[F].s.totalChars)).length ? ot += M.a.v[0] * V[0] : ot += M.a.v[0] * V);
  4548. for (p = !0, this._pathData.a.v && (o = .5 * T[0].an + (g - this._pathData.f.v - .5 * T[0].an - .5 * T[T.length - 1].an) * K / (a - 1), o += this._pathData.f.v); p;) l + y >= o + ot || !d ? (v = (o + ot - l) / h.partialLength, G = c.point[0] + (h.point[0] - c.point[0]) * v, z = c.point[1] + (h.point[1] - c.point[1]) * v, _.translate(-E[0] * T[s].an * .005, -E[1] * B * .01), p = !1) : d && (l += h.partialLength, (f += 1) >= d.length && (f = 0, u[m += 1] ? d = u[m].points : P.v.c ? (f = 0, d = u[m = 0].points) : (l -= h.partialLength, d = null)), d && (c = h, y = (h = d[f]).partialLength));
  4549. L = T[s].an / 2 - T[s].add, _.translate(-L, 0, 0)
  4550. } else L = T[s].an / 2 - T[s].add, _.translate(-L, 0, 0), _.translate(-E[0] * T[s].an * .005, -E[1] * B * .01, 0);
  4551. for (F = 0; F < w; F += 1)(M = x[F].a).t.propType && (V = x[F].s.getMult(T[s].anIndexes[F], S.a[F].s.totalChars), 0 === r && 0 === t.j || (this._hasMaskedPath ? V.length ? o += M.t.v * V[0] : o += M.t.v * V : V.length ? r += M.t.v * V[0] : r += M.t.v * V));
  4552. for (t.strokeWidthAnim && (H = t.sw || 0), t.strokeColorAnim && (O = t.sc ? [t.sc[0], t.sc[1], t.sc[2]] : [0, 0, 0]), t.fillColorAnim && t.fc && (j = [t.fc[0], t.fc[1], t.fc[2]]), F = 0; F < w; F += 1)(M = x[F].a).a.propType && ((V = x[F].s.getMult(T[s].anIndexes[F], S.a[F].s.totalChars)).length ? _.translate(-M.a.v[0] * V[0], -M.a.v[1] * V[1], M.a.v[2] * V[2]) : _.translate(-M.a.v[0] * V, -M.a.v[1] * V, M.a.v[2] * V));
  4553. for (F = 0; F < w; F += 1)(M = x[F].a).s.propType && ((V = x[F].s.getMult(T[s].anIndexes[F], S.a[F].s.totalChars)).length ? _.scale(1 + (M.s.v[0] - 1) * V[0], 1 + (M.s.v[1] - 1) * V[1], 1) : _.scale(1 + (M.s.v[0] - 1) * V, 1 + (M.s.v[1] - 1) * V, 1));
  4554. for (F = 0; F < w; F += 1) {
  4555. if (M = x[F].a, V = x[F].s.getMult(T[s].anIndexes[F], S.a[F].s.totalChars), M.sk.propType && (V.length ? _.skewFromAxis(-M.sk.v * V[0], M.sa.v * V[1]) : _.skewFromAxis(-M.sk.v * V, M.sa.v * V)), M.r.propType && (V.length ? _.rotateZ(-M.r.v * V[2]) : _.rotateZ(-M.r.v * V)), M.ry.propType && (V.length ? _.rotateY(M.ry.v * V[1]) : _.rotateY(M.ry.v * V)), M.rx.propType && (V.length ? _.rotateX(M.rx.v * V[0]) : _.rotateX(M.rx.v * V)), M.o.propType && (V.length ? N += (M.o.v * V[0] - N) * V[0] : N += (M.o.v * V - N) * V), t.strokeWidthAnim && M.sw.propType && (V.length ? H += M.sw.v * V[0] : H += M.sw.v * V), t.strokeColorAnim && M.sc.propType)
  4556. for (q = 0; q < 3; q += 1) V.length ? O[q] += (M.sc.v[q] - O[q]) * V[0] : O[q] += (M.sc.v[q] - O[q]) * V;
  4557. if (t.fillColorAnim && t.fc) {
  4558. if (M.fc.propType)
  4559. for (q = 0; q < 3; q += 1) V.length ? j[q] += (M.fc.v[q] - j[q]) * V[0] : j[q] += (M.fc.v[q] - j[q]) * V;
  4560. M.fh.propType && (j = V.length ? addHueToRGB(j, M.fh.v * V[0]) : addHueToRGB(j, M.fh.v * V)), M.fs.propType && (j = V.length ? addSaturationToRGB(j, M.fs.v * V[0]) : addSaturationToRGB(j, M.fs.v * V)), M.fb.propType && (j = V.length ? addBrightnessToRGB(j, M.fb.v * V[0]) : addBrightnessToRGB(j, M.fb.v * V))
  4561. }
  4562. }
  4563. for (F = 0; F < w; F += 1)(M = x[F].a).p.propType && (V = x[F].s.getMult(T[s].anIndexes[F], S.a[F].s.totalChars), this._hasMaskedPath ? V.length ? _.translate(0, M.p.v[1] * V[0], -M.p.v[2] * V[1]) : _.translate(0, M.p.v[1] * V, -M.p.v[2] * V) : V.length ? _.translate(M.p.v[0] * V[0], M.p.v[1] * V[1], -M.p.v[2] * V[2]) : _.translate(M.p.v[0] * V, M.p.v[1] * V, -M.p.v[2] * V));
  4564. if (t.strokeWidthAnim && (W = H < 0 ? 0 : H), t.strokeColorAnim && ($ = "rgb(" + Math.round(255 * O[0]) + "," + Math.round(255 * O[1]) + "," + Math.round(255 * O[2]) + ")"), t.fillColorAnim && t.fc && (Y = "rgb(" + Math.round(255 * j[0]) + "," + Math.round(255 * j[1]) + "," + Math.round(255 * j[2]) + ")"), this._hasMaskedPath) {
  4565. if (_.translate(0, -t.ls), _.translate(0, E[1] * B * .01 + i, 0), this._pathData.p.v) {
  4566. b = (h.point[1] - c.point[1]) / (h.point[0] - c.point[0]);
  4567. var ht = 180 * Math.atan(b) / Math.PI;
  4568. h.point[0] < c.point[0] && (ht += 180), _.rotate(-ht * Math.PI / 180)
  4569. }
  4570. _.translate(G, z, 0), o -= E[0] * T[s].an * .005, T[s + 1] && K !== T[s + 1].ind && (o += T[s].an / 2, o += .001 * t.tr * t.finalSize)
  4571. } else {
  4572. switch (_.translate(r, i, 0), t.ps && _.translate(t.ps[0], t.ps[1] + t.ascent, 0), t.j) {
  4573. case 1:
  4574. _.translate(T[s].animatorJustifyOffset + t.justifyOffset + (t.boxWidth - t.lineWidths[T[s].line]), 0, 0);
  4575. break;
  4576. case 2:
  4577. _.translate(T[s].animatorJustifyOffset + t.justifyOffset + (t.boxWidth - t.lineWidths[T[s].line]) / 2, 0, 0)
  4578. }
  4579. _.translate(0, -t.ls), _.translate(L, 0, 0), _.translate(E[0] * T[s].an * .005, E[1] * B * .01, 0), r += T[s].l + .001 * t.tr * t.finalSize
  4580. }
  4581. "html" === C ? tt = _.toCSS() : "svg" === C ? tt = _.to2dCSS() : et = [_.props[0], _.props[1], _.props[2], _.props[3], _.props[4], _.props[5], _.props[6], _.props[7], _.props[8], _.props[9], _.props[10], _.props[11], _.props[12], _.props[13], _.props[14], _.props[15]], X = N
  4582. }
  4583. A <= s ? (I = new LetterProps(X, W, $, Y, tt, et), this.renderedLetters.push(I), A += 1, this.lettersChangedFlag = !0) : (I = this.renderedLetters[s], this.lettersChangedFlag = I.update(X, W, $, Y, tt, et) || this.lettersChangedFlag)
  4584. }
  4585. }
  4586. }, TextAnimatorProperty.prototype.getValue = function() {
  4587. this._elem.globalData.frameId !== this._frameId && (this._frameId = this._elem.globalData.frameId, this.iterateDynamicProperties())
  4588. }, TextAnimatorProperty.prototype.mHelper = new Matrix, TextAnimatorProperty.prototype.defaultPropsArray = [], extendPrototype([DynamicPropertyContainer], TextAnimatorProperty), ITextElement.prototype.initElement = function(t, e, r) {
  4589. this.lettersChangedFlag = !0, this.initFrame(), this.initBaseData(t, e, r), this.textProperty = new TextProperty(this, t.t, this.dynamicProperties), this.textAnimator = new TextAnimatorProperty(t.t, this.renderType, this), this.initTransform(t, e, r), this.initHierarchy(), this.initRenderable(), this.initRendererElement(), this.createContainerElements(), this.createRenderableComponents(), this.createContent(), this.hide(), this.textAnimator.searchProperties(this.dynamicProperties)
  4590. }, ITextElement.prototype.prepareFrame = function(t) {
  4591. this._mdf = !1, this.prepareRenderableFrame(t), this.prepareProperties(t, this.isInRange), (this.textProperty._mdf || this.textProperty._isFirstFrame) && (this.buildNewText(), this.textProperty._isFirstFrame = !1, this.textProperty._mdf = !1)
  4592. }, ITextElement.prototype.createPathShape = function(t, e) {
  4593. var r, i, s = e.length,
  4594. a = "";
  4595. for (r = 0; r < s; r += 1) "sh" === e[r].ty && (i = e[r].ks.k, a += buildShapeString(i, i.i.length, !0, t));
  4596. return a
  4597. }, ITextElement.prototype.updateDocumentData = function(t, e) {
  4598. this.textProperty.updateDocumentData(t, e)
  4599. }, ITextElement.prototype.canResizeFont = function(t) {
  4600. this.textProperty.canResizeFont(t)
  4601. }, ITextElement.prototype.setMinimumFontSize = function(t) {
  4602. this.textProperty.setMinimumFontSize(t)
  4603. }, ITextElement.prototype.applyTextPropertiesToMatrix = function(t, e, r, i, s) {
  4604. switch (t.ps && e.translate(t.ps[0], t.ps[1] + t.ascent, 0), e.translate(0, -t.ls, 0), t.j) {
  4605. case 1:
  4606. e.translate(t.justifyOffset + (t.boxWidth - t.lineWidths[r]), 0, 0);
  4607. break;
  4608. case 2:
  4609. e.translate(t.justifyOffset + (t.boxWidth - t.lineWidths[r]) / 2, 0, 0)
  4610. }
  4611. e.translate(i, s, 0)
  4612. }, ITextElement.prototype.buildColor = function(t) {
  4613. return "rgb(" + Math.round(255 * t[0]) + "," + Math.round(255 * t[1]) + "," + Math.round(255 * t[2]) + ")"
  4614. }, ITextElement.prototype.emptyProp = new LetterProps, ITextElement.prototype.destroy = function() {};
  4615. var emptyShapeData = {
  4616. shapes: []
  4617. };
  4618. function SVGTextLottieElement(t, e, r) {
  4619. this.textSpans = [], this.renderType = "svg", this.initElement(t, e, r)
  4620. }
  4621. function ISolidElement(t, e, r) {
  4622. this.initElement(t, e, r)
  4623. }
  4624. function NullElement(t, e, r) {
  4625. this.initFrame(), this.initBaseData(t, e, r), this.initFrame(), this.initTransform(t, e, r), this.initHierarchy()
  4626. }
  4627. function SVGRendererBase() {}
  4628. function ICompElement() {}
  4629. function SVGCompElement(t, e, r) {
  4630. this.layers = t.layers, this.supports3d = !0, this.completeLayers = !1, this.pendingElements = [], this.elements = this.layers ? createSizedArray(this.layers.length) : [], this.initElement(t, e, r), this.tm = t.tm ? PropertyFactory.getProp(this, t.tm, 0, e.frameRate, this) : {
  4631. _placeholder: !0
  4632. }
  4633. }
  4634. function SVGRenderer(t, e) {
  4635. this.animationItem = t, this.layers = null, this.renderedFrame = -1, this.svgElement = createNS("svg");
  4636. var r = "";
  4637. if (e && e.title) {
  4638. var i = createNS("title"),
  4639. s = createElementID();
  4640. i.setAttribute("id", s), i.textContent = e.title, this.svgElement.appendChild(i), r += s
  4641. }
  4642. if (e && e.description) {
  4643. var a = createNS("desc"),
  4644. n = createElementID();
  4645. a.setAttribute("id", n), a.textContent = e.description, this.svgElement.appendChild(a), r += " " + n
  4646. }
  4647. r && this.svgElement.setAttribute("aria-labelledby", r);
  4648. var o = createNS("defs");
  4649. this.svgElement.appendChild(o);
  4650. var h = createNS("g");
  4651. this.svgElement.appendChild(h), this.layerElement = h, this.renderConfig = {
  4652. preserveAspectRatio: e && e.preserveAspectRatio || "xMidYMid meet",
  4653. imagePreserveAspectRatio: e && e.imagePreserveAspectRatio || "xMidYMid slice",
  4654. contentVisibility: e && e.contentVisibility || "visible",
  4655. progressiveLoad: e && e.progressiveLoad || !1,
  4656. hideOnTransparent: !(e && !1 === e.hideOnTransparent),
  4657. viewBoxOnly: e && e.viewBoxOnly || !1,
  4658. viewBoxSize: e && e.viewBoxSize || !1,
  4659. className: e && e.className || "",
  4660. id: e && e.id || "",
  4661. focusable: e && e.focusable,
  4662. filterSize: {
  4663. width: e && e.filterSize && e.filterSize.width || "100%",
  4664. height: e && e.filterSize && e.filterSize.height || "100%",
  4665. x: e && e.filterSize && e.filterSize.x || "0%",
  4666. y: e && e.filterSize && e.filterSize.y || "0%"
  4667. },
  4668. width: e && e.width,
  4669. height: e && e.height
  4670. }, this.globalData = {
  4671. _mdf: !1,
  4672. frameNum: -1,
  4673. defs: o,
  4674. renderConfig: this.renderConfig
  4675. }, this.elements = [], this.pendingElements = [], this.destroyed = !1, this.rendererType = "svg"
  4676. }
  4677. function CVContextData() {
  4678. var t;
  4679. this.saved = [], this.cArrPos = 0, this.cTr = new Matrix, this.cO = 1;
  4680. for (this.savedOp = createTypedArray("float32", 15), t = 0; t < 15; t += 1) this.saved[t] = createTypedArray("float32", 16);
  4681. this._length = 15
  4682. }
  4683. function ShapeTransformManager() {
  4684. this.sequences = {}, this.sequenceList = [], this.transform_key_count = 0
  4685. }
  4686. function CVEffects() {}
  4687. function CVMaskElement(t, e) {
  4688. var r;
  4689. this.data = t, this.element = e, this.masksProperties = this.data.masksProperties || [], this.viewData = createSizedArray(this.masksProperties.length);
  4690. var i = this.masksProperties.length,
  4691. s = !1;
  4692. for (r = 0; r < i; r += 1) "n" !== this.masksProperties[r].mode && (s = !0), this.viewData[r] = ShapePropertyFactory.getShapeProp(this.element, this.masksProperties[r], 3);
  4693. this.hasMasks = s, s && this.element.addRenderableComponent(this)
  4694. }
  4695. function CVBaseElement() {}
  4696. function CVShapeData(t, e, r, i) {
  4697. this.styledShapes = [], this.tr = [0, 0, 0, 0, 0, 0];
  4698. var s, a = 4;
  4699. "rc" === e.ty ? a = 5 : "el" === e.ty ? a = 6 : "sr" === e.ty && (a = 7), this.sh = ShapePropertyFactory.getShapeProp(t, e, a, t);
  4700. var n, o = r.length;
  4701. for (s = 0; s < o; s += 1) r[s].closed || (n = {
  4702. transforms: i.addTransformSequence(r[s].transforms),
  4703. trNodes: []
  4704. }, this.styledShapes.push(n), r[s].elements.push(n))
  4705. }
  4706. function CVShapeElement(t, e, r) {
  4707. this.shapes = [], this.shapesData = t.shapes, this.stylesList = [], this.itemsData = [], this.prevViewData = [], this.shapeModifiers = [], this.processedElements = [], this.transformsManager = new ShapeTransformManager, this.initElement(t, e, r)
  4708. }
  4709. function CVTextElement(t, e, r) {
  4710. this.textSpans = [], this.yOffset = 0, this.fillColorAnim = !1, this.strokeColorAnim = !1, this.strokeWidthAnim = !1, this.stroke = !1, this.fill = !1, this.justifyOffset = 0, this.currentRender = null, this.renderType = "canvas", this.values = {
  4711. fill: "rgba(0,0,0,0)",
  4712. stroke: "rgba(0,0,0,0)",
  4713. sWidth: 0,
  4714. fValue: ""
  4715. }, this.initElement(t, e, r)
  4716. }
  4717. function CVImageElement(t, e, r) {
  4718. this.assetData = e.getAssetData(t.refId), this.img = e.imageLoader.getAsset(this.assetData), this.initElement(t, e, r)
  4719. }
  4720. function CVSolidElement(t, e, r) {
  4721. this.initElement(t, e, r)
  4722. }
  4723. function CanvasRendererBase(t, e) {
  4724. this.animationItem = t, this.renderConfig = {
  4725. clearCanvas: !e || void 0 === e.clearCanvas || e.clearCanvas,
  4726. context: e && e.context || null,
  4727. progressiveLoad: e && e.progressiveLoad || !1,
  4728. preserveAspectRatio: e && e.preserveAspectRatio || "xMidYMid meet",
  4729. imagePreserveAspectRatio: e && e.imagePreserveAspectRatio || "xMidYMid slice",
  4730. contentVisibility: e && e.contentVisibility || "visible",
  4731. className: e && e.className || "",
  4732. id: e && e.id || ""
  4733. }, this.renderConfig.dpr = e && e.dpr || 1, this.animationItem.wrapper && (this.renderConfig.dpr = e && e.dpr || window.devicePixelRatio || 1), this.renderedFrame = -1, this.globalData = {
  4734. frameNum: -1,
  4735. _mdf: !1,
  4736. renderConfig: this.renderConfig,
  4737. currentGlobalAlpha: -1
  4738. }, this.contextData = new CVContextData, this.elements = [], this.pendingElements = [], this.transformMat = new Matrix, this.completeLayers = !1, this.rendererType = "canvas"
  4739. }
  4740. function CVCompElement(t, e, r) {
  4741. this.completeLayers = !1, this.layers = t.layers, this.pendingElements = [], this.elements = createSizedArray(this.layers.length), this.initElement(t, e, r), this.tm = t.tm ? PropertyFactory.getProp(this, t.tm, 0, e.frameRate, this) : {
  4742. _placeholder: !0
  4743. }
  4744. }
  4745. function CanvasRenderer(t, e) {
  4746. this.animationItem = t, this.renderConfig = {
  4747. clearCanvas: !e || void 0 === e.clearCanvas || e.clearCanvas,
  4748. context: e && e.context || null,
  4749. progressiveLoad: e && e.progressiveLoad || !1,
  4750. preserveAspectRatio: e && e.preserveAspectRatio || "xMidYMid meet",
  4751. imagePreserveAspectRatio: e && e.imagePreserveAspectRatio || "xMidYMid slice",
  4752. contentVisibility: e && e.contentVisibility || "visible",
  4753. className: e && e.className || "",
  4754. id: e && e.id || ""
  4755. }, this.renderConfig.dpr = e && e.dpr || 1, this.animationItem.wrapper && (this.renderConfig.dpr = e && e.dpr || window.devicePixelRatio || 1), this.renderedFrame = -1, this.globalData = {
  4756. frameNum: -1,
  4757. _mdf: !1,
  4758. renderConfig: this.renderConfig,
  4759. currentGlobalAlpha: -1
  4760. }, this.contextData = new CVContextData, this.elements = [], this.pendingElements = [], this.transformMat = new Matrix, this.completeLayers = !1, this.rendererType = "canvas"
  4761. }
  4762. function HBaseElement() {}
  4763. function HSolidElement(t, e, r) {
  4764. this.initElement(t, e, r)
  4765. }
  4766. function HShapeElement(t, e, r) {
  4767. this.shapes = [], this.shapesData = t.shapes, this.stylesList = [], this.shapeModifiers = [], this.itemsData = [], this.processedElements = [], this.animatedContents = [], this.shapesContainer = createNS("g"), this.initElement(t, e, r), this.prevViewData = [], this.currentBBox = {
  4768. x: 999999,
  4769. y: -999999,
  4770. h: 0,
  4771. w: 0
  4772. }
  4773. }
  4774. function HTextElement(t, e, r) {
  4775. this.textSpans = [], this.textPaths = [], this.currentBBox = {
  4776. x: 999999,
  4777. y: -999999,
  4778. h: 0,
  4779. w: 0
  4780. }, this.renderType = "svg", this.isMasked = !1, this.initElement(t, e, r)
  4781. }
  4782. function HCameraElement(t, e, r) {
  4783. this.initFrame(), this.initBaseData(t, e, r), this.initHierarchy();
  4784. var i = PropertyFactory.getProp;
  4785. if (this.pe = i(this, t.pe, 0, 0, this), t.ks.p.s ? (this.px = i(this, t.ks.p.x, 1, 0, this), this.py = i(this, t.ks.p.y, 1, 0, this), this.pz = i(this, t.ks.p.z, 1, 0, this)) : this.p = i(this, t.ks.p, 1, 0, this), t.ks.a && (this.a = i(this, t.ks.a, 1, 0, this)), t.ks.or.k.length && t.ks.or.k[0].to) {
  4786. var s, a = t.ks.or.k.length;
  4787. for (s = 0; s < a; s += 1) t.ks.or.k[s].to = null, t.ks.or.k[s].ti = null
  4788. }
  4789. this.or = i(this, t.ks.or, 1, degToRads, this), this.or.sh = !0, this.rx = i(this, t.ks.rx, 0, degToRads, this), this.ry = i(this, t.ks.ry, 0, degToRads, this), this.rz = i(this, t.ks.rz, 0, degToRads, this), this.mat = new Matrix, this._prevMat = new Matrix, this._isFirstFrame = !0, this.finalTransform = {
  4790. mProp: this
  4791. }
  4792. }
  4793. function HImageElement(t, e, r) {
  4794. this.assetData = e.getAssetData(t.refId), this.initElement(t, e, r)
  4795. }
  4796. function HybridRendererBase(t, e) {
  4797. this.animationItem = t, this.layers = null, this.renderedFrame = -1, this.renderConfig = {
  4798. className: e && e.className || "",
  4799. imagePreserveAspectRatio: e && e.imagePreserveAspectRatio || "xMidYMid slice",
  4800. hideOnTransparent: !(e && !1 === e.hideOnTransparent),
  4801. filterSize: {
  4802. width: e && e.filterSize && e.filterSize.width || "400%",
  4803. height: e && e.filterSize && e.filterSize.height || "400%",
  4804. x: e && e.filterSize && e.filterSize.x || "-100%",
  4805. y: e && e.filterSize && e.filterSize.y || "-100%"
  4806. }
  4807. }, this.globalData = {
  4808. _mdf: !1,
  4809. frameNum: -1,
  4810. renderConfig: this.renderConfig
  4811. }, this.pendingElements = [], this.elements = [], this.threeDElements = [], this.destroyed = !1, this.camera = null, this.supports3d = !0, this.rendererType = "html"
  4812. }
  4813. function HCompElement(t, e, r) {
  4814. this.layers = t.layers, this.supports3d = !t.hasMask, this.completeLayers = !1, this.pendingElements = [], this.elements = this.layers ? createSizedArray(this.layers.length) : [], this.initElement(t, e, r), this.tm = t.tm ? PropertyFactory.getProp(this, t.tm, 0, e.frameRate, this) : {
  4815. _placeholder: !0
  4816. }
  4817. }
  4818. function HybridRenderer(t, e) {
  4819. this.animationItem = t, this.layers = null, this.renderedFrame = -1, this.renderConfig = {
  4820. className: e && e.className || "",
  4821. imagePreserveAspectRatio: e && e.imagePreserveAspectRatio || "xMidYMid slice",
  4822. hideOnTransparent: !(e && !1 === e.hideOnTransparent),
  4823. filterSize: {
  4824. width: e && e.filterSize && e.filterSize.width || "400%",
  4825. height: e && e.filterSize && e.filterSize.height || "400%",
  4826. x: e && e.filterSize && e.filterSize.x || "-100%",
  4827. y: e && e.filterSize && e.filterSize.y || "-100%"
  4828. }
  4829. }, this.globalData = {
  4830. _mdf: !1,
  4831. frameNum: -1,
  4832. renderConfig: this.renderConfig
  4833. }, this.pendingElements = [], this.elements = [], this.threeDElements = [], this.destroyed = !1, this.camera = null, this.supports3d = !0, this.rendererType = "html"
  4834. }
  4835. extendPrototype([BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, ITextElement], SVGTextLottieElement), SVGTextLottieElement.prototype.createContent = function() {
  4836. this.data.singleShape && !this.globalData.fontManager.chars && (this.textContainer = createNS("text"))
  4837. }, SVGTextLottieElement.prototype.buildTextContents = function(t) {
  4838. for (var e = 0, r = t.length, i = [], s = ""; e < r;) t[e] === String.fromCharCode(13) || t[e] === String.fromCharCode(3) ? (i.push(s), s = "") : s += t[e], e += 1;
  4839. return i.push(s), i
  4840. }, SVGTextLottieElement.prototype.buildShapeData = function(t, e) {
  4841. if (t.shapes && t.shapes.length) {
  4842. var r = t.shapes[0];
  4843. if (r.it) {
  4844. var i = r.it[r.it.length - 1];
  4845. i.s && (i.s.k[0] = e, i.s.k[1] = e)
  4846. }
  4847. }
  4848. return t
  4849. }, SVGTextLottieElement.prototype.buildNewText = function() {
  4850. var t, e;
  4851. this.addDynamicProperty(this);
  4852. var r = this.textProperty.currentData;
  4853. this.renderedLetters = createSizedArray(r ? r.l.length : 0), r.fc ? this.layerElement.setAttribute("fill", this.buildColor(r.fc)) : this.layerElement.setAttribute("fill", "rgba(0,0,0,0)"), r.sc && (this.layerElement.setAttribute("stroke", this.buildColor(r.sc)), this.layerElement.setAttribute("stroke-width", r.sw)), this.layerElement.setAttribute("font-size", r.finalSize);
  4854. var i = this.globalData.fontManager.getFontByName(r.f);
  4855. if (i.fClass) this.layerElement.setAttribute("class", i.fClass);
  4856. else {
  4857. this.layerElement.setAttribute("font-family", i.fFamily);
  4858. var s = r.fWeight,
  4859. a = r.fStyle;
  4860. this.layerElement.setAttribute("font-style", a), this.layerElement.setAttribute("font-weight", s)
  4861. }
  4862. this.layerElement.setAttribute("aria-label", r.t);
  4863. var n, o = r.l || [],
  4864. h = !!this.globalData.fontManager.chars;
  4865. e = o.length;
  4866. var l = this.mHelper,
  4867. p = this.data.singleShape,
  4868. f = 0,
  4869. m = 0,
  4870. c = !0,
  4871. d = .001 * r.tr * r.finalSize;
  4872. if (!p || h || r.sz) {
  4873. var u, y = this.textSpans.length;
  4874. for (t = 0; t < e; t += 1) {
  4875. if (this.textSpans[t] || (this.textSpans[t] = {
  4876. span: null,
  4877. childSpan: null,
  4878. glyph: null
  4879. }), !h || !p || 0 === t) {
  4880. if (n = y > t ? this.textSpans[t].span : createNS(h ? "g" : "text"), y <= t) {
  4881. if (n.setAttribute("stroke-linecap", "butt"), n.setAttribute("stroke-linejoin", "round"), n.setAttribute("stroke-miterlimit", "4"), this.textSpans[t].span = n, h) {
  4882. var g = createNS("g");
  4883. n.appendChild(g), this.textSpans[t].childSpan = g
  4884. }
  4885. this.textSpans[t].span = n, this.layerElement.appendChild(n)
  4886. }
  4887. n.style.display = "inherit"
  4888. }
  4889. if (l.reset(), p && (o[t].n && (f = -d, m += r.yOffset, m += c ? 1 : 0, c = !1), this.applyTextPropertiesToMatrix(r, l, o[t].line, f, m), f += o[t].l || 0, f += d), h) {
  4890. var v;
  4891. if (1 === (u = this.globalData.fontManager.getCharData(r.finalText[t], i.fStyle, this.globalData.fontManager.getFontByName(r.f).fFamily)).t) v = new SVGCompElement(u.data, this.globalData, this);
  4892. else {
  4893. var b = emptyShapeData;
  4894. u.data && u.data.shapes && (b = this.buildShapeData(u.data, r.finalSize)), v = new SVGShapeElement(b, this.globalData, this)
  4895. }
  4896. if (this.textSpans[t].glyph) {
  4897. var P = this.textSpans[t].glyph;
  4898. this.textSpans[t].childSpan.removeChild(P.layerElement), P.destroy()
  4899. }
  4900. this.textSpans[t].glyph = v, v._debug = !0, v.prepareFrame(0), v.renderFrame(), this.textSpans[t].childSpan.appendChild(v.layerElement), 1 === u.t && this.textSpans[t].childSpan.setAttribute("transform", "scale(" + r.finalSize / 100 + "," + r.finalSize / 100 + ")")
  4901. } else p && n.setAttribute("transform", "translate(" + l.props[12] + "," + l.props[13] + ")"), n.textContent = o[t].val, n.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve")
  4902. }
  4903. p && n && n.setAttribute("d", "")
  4904. } else {
  4905. var E = this.textContainer,
  4906. x = "start";
  4907. switch (r.j) {
  4908. case 1:
  4909. x = "end";
  4910. break;
  4911. case 2:
  4912. x = "middle";
  4913. break;
  4914. default:
  4915. x = "start"
  4916. }
  4917. E.setAttribute("text-anchor", x), E.setAttribute("letter-spacing", d);
  4918. var S = this.buildTextContents(r.finalText);
  4919. for (e = S.length, m = r.ps ? r.ps[1] + r.ascent : 0, t = 0; t < e; t += 1)(n = this.textSpans[t].span || createNS("tspan")).textContent = S[t], n.setAttribute("x", 0), n.setAttribute("y", m), n.style.display = "inherit", E.appendChild(n), this.textSpans[t] || (this.textSpans[t] = {
  4920. span: null,
  4921. glyph: null
  4922. }), this.textSpans[t].span = n, m += r.finalLineHeight;
  4923. this.layerElement.appendChild(E)
  4924. }
  4925. for (; t < this.textSpans.length;) this.textSpans[t].span.style.display = "none", t += 1;
  4926. this._sizeChanged = !0
  4927. }, SVGTextLottieElement.prototype.sourceRectAtTime = function() {
  4928. if (this.prepareFrame(this.comp.renderedFrame - this.data.st), this.renderInnerContent(), this._sizeChanged) {
  4929. this._sizeChanged = !1;
  4930. var t = this.layerElement.getBBox();
  4931. this.bbox = {
  4932. top: t.y,
  4933. left: t.x,
  4934. width: t.width,
  4935. height: t.height
  4936. }
  4937. }
  4938. return this.bbox
  4939. }, SVGTextLottieElement.prototype.getValue = function() {
  4940. var t, e, r = this.textSpans.length;
  4941. for (this.renderedFrame = this.comp.renderedFrame, t = 0; t < r; t += 1)(e = this.textSpans[t].glyph) && (e.prepareFrame(this.comp.renderedFrame - this.data.st), e._mdf && (this._mdf = !0))
  4942. }, SVGTextLottieElement.prototype.renderInnerContent = function() {
  4943. if ((!this.data.singleShape || this._mdf) && (this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag), this.lettersChangedFlag || this.textAnimator.lettersChangedFlag)) {
  4944. var t, e;
  4945. this._sizeChanged = !0;
  4946. var r, i, s, a = this.textAnimator.renderedLetters,
  4947. n = this.textProperty.currentData.l;
  4948. for (e = n.length, t = 0; t < e; t += 1) n[t].n || (r = a[t], i = this.textSpans[t].span, (s = this.textSpans[t].glyph) && s.renderFrame(), r._mdf.m && i.setAttribute("transform", r.m), r._mdf.o && i.setAttribute("opacity", r.o), r._mdf.sw && i.setAttribute("stroke-width", r.sw), r._mdf.sc && i.setAttribute("stroke", r.sc), r._mdf.fc && i.setAttribute("fill", r.fc))
  4949. }
  4950. }, extendPrototype([IImageElement], ISolidElement), ISolidElement.prototype.createContent = function() {
  4951. var t = createNS("rect");
  4952. t.setAttribute("width", this.data.sw), t.setAttribute("height", this.data.sh), t.setAttribute("fill", this.data.sc), this.layerElement.appendChild(t)
  4953. }, NullElement.prototype.prepareFrame = function(t) {
  4954. this.prepareProperties(t, !0)
  4955. }, NullElement.prototype.renderFrame = function() {}, NullElement.prototype.getBaseElement = function() {
  4956. return null
  4957. }, NullElement.prototype.destroy = function() {}, NullElement.prototype.sourceRectAtTime = function() {}, NullElement.prototype.hide = function() {}, extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement], NullElement), extendPrototype([BaseRenderer], SVGRendererBase), SVGRendererBase.prototype.createNull = function(t) {
  4958. return new NullElement(t, this.globalData, this)
  4959. }, SVGRendererBase.prototype.createShape = function(t) {
  4960. return new SVGShapeElement(t, this.globalData, this)
  4961. }, SVGRendererBase.prototype.createText = function(t) {
  4962. return new SVGTextLottieElement(t, this.globalData, this)
  4963. }, SVGRendererBase.prototype.createImage = function(t) {
  4964. return new IImageElement(t, this.globalData, this)
  4965. }, SVGRendererBase.prototype.createSolid = function(t) {
  4966. return new ISolidElement(t, this.globalData, this)
  4967. }, SVGRendererBase.prototype.configAnimation = function(t) {
  4968. this.svgElement.setAttribute("xmlns", "http://www.w3.org/2000/svg"), 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);
  4969. var e = this.globalData.defs;
  4970. this.setupGlobalData(t, e), this.globalData.progressiveLoad = this.renderConfig.progressiveLoad, this.data = t;
  4971. var r = createNS("clipPath"),
  4972. i = createNS("rect");
  4973. i.setAttribute("width", t.w), i.setAttribute("height", t.h), i.setAttribute("x", 0), i.setAttribute("y", 0);
  4974. var s = createElementID();
  4975. r.setAttribute("id", s), r.appendChild(i), this.layerElement.setAttribute("clip-path", "url(" + getLocationHref() + "#" + s + ")"), e.appendChild(r), this.layers = t.layers, this.elements = createSizedArray(t.layers.length)
  4976. }, SVGRendererBase.prototype.destroy = function() {
  4977. var t;
  4978. this.animationItem.wrapper && (this.animationItem.wrapper.innerText = ""), this.layerElement = null, this.globalData.defs = null;
  4979. var e = this.layers ? this.layers.length : 0;
  4980. for (t = 0; t < e; t += 1) this.elements[t] && this.elements[t].destroy();
  4981. this.elements.length = 0, this.destroyed = !0, this.animationItem = null
  4982. }, SVGRendererBase.prototype.updateContainerSize = function() {}, SVGRendererBase.prototype.buildItem = function(t) {
  4983. var e = this.elements;
  4984. if (!e[t] && 99 !== this.layers[t].ty) {
  4985. e[t] = !0;
  4986. var r = this.createItem(this.layers[t]);
  4987. e[t] = r, getExpressionsPlugin() && (0 === this.layers[t].ty && this.globalData.projectInterface.registerComposition(r), r.initExpressions()), this.appendElementInPos(r, t), this.layers[t].tt && (this.elements[t - 1] && !0 !== this.elements[t - 1] ? r.setMatte(e[t - 1].layerId) : (this.buildItem(t - 1), this.addPendingElement(r)))
  4988. }
  4989. }, SVGRendererBase.prototype.checkPendingElements = function() {
  4990. for (; this.pendingElements.length;) {
  4991. var t = this.pendingElements.pop();
  4992. if (t.checkParenting(), t.data.tt)
  4993. for (var e = 0, r = this.elements.length; e < r;) {
  4994. if (this.elements[e] === t) {
  4995. t.setMatte(this.elements[e - 1].layerId);
  4996. break
  4997. }
  4998. e += 1
  4999. }
  5000. }
  5001. }, SVGRendererBase.prototype.renderFrame = function(t) {
  5002. if (this.renderedFrame !== t && !this.destroyed) {
  5003. var e;
  5004. 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;
  5005. var r = this.layers.length;
  5006. for (this.completeLayers || this.checkLayers(t), e = r - 1; e >= 0; e -= 1)(this.completeLayers || this.elements[e]) && this.elements[e].prepareFrame(t - this.layers[e].st);
  5007. if (this.globalData._mdf)
  5008. for (e = 0; e < r; e += 1)(this.completeLayers || this.elements[e]) && this.elements[e].renderFrame()
  5009. }
  5010. }, SVGRendererBase.prototype.appendElementInPos = function(t, e) {
  5011. var r = t.getBaseElement();
  5012. if (r) {
  5013. for (var i, s = 0; s < e;) this.elements[s] && !0 !== this.elements[s] && this.elements[s].getBaseElement() && (i = this.elements[s].getBaseElement()), s += 1;
  5014. i ? this.layerElement.insertBefore(r, i) : this.layerElement.appendChild(r)
  5015. }
  5016. }, SVGRendererBase.prototype.hide = function() {
  5017. this.layerElement.style.display = "none"
  5018. }, SVGRendererBase.prototype.show = function() {
  5019. this.layerElement.style.display = "block"
  5020. }, extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement, RenderableDOMElement], ICompElement), ICompElement.prototype.initElement = function(t, e, r) {
  5021. this.initFrame(), this.initBaseData(t, e, r), this.initTransform(t, e, r), this.initRenderable(), this.initHierarchy(), this.initRendererElement(), this.createContainerElements(), this.createRenderableComponents(), !this.data.xt && e.progressiveLoad || this.buildAllItems(), this.hide()
  5022. }, ICompElement.prototype.prepareFrame = function(t) {
  5023. if (this._mdf = !1, this.prepareRenderableFrame(t), this.prepareProperties(t, this.isInRange), this.isInRange || this.data.xt) {
  5024. if (this.tm._placeholder) this.renderedFrame = t / this.data.sr;
  5025. else {
  5026. var e = this.tm.v;
  5027. e === this.data.op && (e = this.data.op - 1), this.renderedFrame = e
  5028. }
  5029. var r, i = this.elements.length;
  5030. for (this.completeLayers || this.checkLayers(this.renderedFrame), r = i - 1; r >= 0; r -= 1)(this.completeLayers || this.elements[r]) && (this.elements[r].prepareFrame(this.renderedFrame - this.layers[r].st), this.elements[r]._mdf && (this._mdf = !0))
  5031. }
  5032. }, ICompElement.prototype.renderInnerContent = function() {
  5033. var t, e = this.layers.length;
  5034. for (t = 0; t < e; t += 1)(this.completeLayers || this.elements[t]) && this.elements[t].renderFrame()
  5035. }, ICompElement.prototype.setElements = function(t) {
  5036. this.elements = t
  5037. }, ICompElement.prototype.getElements = function() {
  5038. return this.elements
  5039. }, ICompElement.prototype.destroyElements = function() {
  5040. var t, e = this.layers.length;
  5041. for (t = 0; t < e; t += 1) this.elements[t] && this.elements[t].destroy()
  5042. }, ICompElement.prototype.destroy = function() {
  5043. this.destroyElements(), this.destroyBaseElement()
  5044. }, extendPrototype([SVGRendererBase, ICompElement, SVGBaseElement], SVGCompElement), SVGCompElement.prototype.createComp = function(t) {
  5045. return new SVGCompElement(t, this.globalData, this)
  5046. }, extendPrototype([SVGRendererBase], SVGRenderer), SVGRenderer.prototype.createComp = function(t) {
  5047. return new SVGCompElement(t, this.globalData, this)
  5048. }, CVContextData.prototype.duplicate = function() {
  5049. var t = 2 * this._length,
  5050. e = this.savedOp;
  5051. this.savedOp = createTypedArray("float32", t), this.savedOp.set(e);
  5052. var r = 0;
  5053. for (r = this._length; r < t; r += 1) this.saved[r] = createTypedArray("float32", 16);
  5054. this._length = t
  5055. }, CVContextData.prototype.reset = function() {
  5056. this.cArrPos = 0, this.cTr.reset(), this.cO = 1
  5057. }, ShapeTransformManager.prototype = {
  5058. addTransformSequence: function(t) {
  5059. var e, r = t.length,
  5060. i = "_";
  5061. for (e = 0; e < r; e += 1) i += t[e].transform.key + "_";
  5062. var s = this.sequences[i];
  5063. return s || (s = {
  5064. transforms: [].concat(t),
  5065. finalTransform: new Matrix,
  5066. _mdf: !1
  5067. }, this.sequences[i] = s, this.sequenceList.push(s)), s
  5068. },
  5069. processSequence: function(t, e) {
  5070. for (var r, i = 0, s = t.transforms.length, a = e; i < s && !e;) {
  5071. if (t.transforms[i].transform.mProps._mdf) {
  5072. a = !0;
  5073. break
  5074. }
  5075. i += 1
  5076. }
  5077. if (a)
  5078. for (t.finalTransform.reset(), i = s - 1; i >= 0; i -= 1) r = t.transforms[i].transform.mProps.v.props, t.finalTransform.transform(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8], r[9], r[10], r[11], r[12], r[13], r[14], r[15]);
  5079. t._mdf = a
  5080. },
  5081. processSequences: function(t) {
  5082. var e, r = this.sequenceList.length;
  5083. for (e = 0; e < r; e += 1) this.processSequence(this.sequenceList[e], t)
  5084. },
  5085. getNewKey: function() {
  5086. return this.transform_key_count += 1, "_" + this.transform_key_count
  5087. }
  5088. }, CVEffects.prototype.renderFrame = function() {}, CVMaskElement.prototype.renderFrame = function() {
  5089. if (this.hasMasks) {
  5090. var t, e, r, i, s = this.element.finalTransform.mat,
  5091. a = this.element.canvasContext,
  5092. n = this.masksProperties.length;
  5093. for (a.beginPath(), t = 0; t < n; t += 1)
  5094. if ("n" !== this.masksProperties[t].mode) {
  5095. var o;
  5096. this.masksProperties[t].inv && (a.moveTo(0, 0), a.lineTo(this.element.globalData.compSize.w, 0), a.lineTo(this.element.globalData.compSize.w, this.element.globalData.compSize.h), a.lineTo(0, this.element.globalData.compSize.h), a.lineTo(0, 0)), i = this.viewData[t].v, e = s.applyToPointArray(i.v[0][0], i.v[0][1], 0), a.moveTo(e[0], e[1]);
  5097. var h = i._length;
  5098. for (o = 1; o < h; o += 1) r = s.applyToTriplePoints(i.o[o - 1], i.i[o], i.v[o]), a.bezierCurveTo(r[0], r[1], r[2], r[3], r[4], r[5]);
  5099. r = s.applyToTriplePoints(i.o[o - 1], i.i[0], i.v[0]), a.bezierCurveTo(r[0], r[1], r[2], r[3], r[4], r[5])
  5100. }
  5101. this.element.globalData.renderer.save(!0), a.clip()
  5102. }
  5103. }, CVMaskElement.prototype.getMaskProperty = MaskElement.prototype.getMaskProperty, CVMaskElement.prototype.destroy = function() {
  5104. this.element = null
  5105. }, CVBaseElement.prototype = {
  5106. createElements: function() {},
  5107. initRendererElement: function() {},
  5108. createContainerElements: function() {
  5109. this.canvasContext = this.globalData.canvasContext, this.renderableEffectsManager = new CVEffects(this)
  5110. },
  5111. createContent: function() {},
  5112. setBlendMode: function() {
  5113. var t = this.globalData;
  5114. if (t.blendMode !== this.data.bm) {
  5115. t.blendMode = this.data.bm;
  5116. var e = getBlendMode(this.data.bm);
  5117. t.canvasContext.globalCompositeOperation = e
  5118. }
  5119. },
  5120. createRenderableComponents: function() {
  5121. this.maskManager = new CVMaskElement(this.data, this)
  5122. },
  5123. hideElement: function() {
  5124. this.hidden || this.isInRange && !this.isTransparent || (this.hidden = !0)
  5125. },
  5126. showElement: function() {
  5127. this.isInRange && !this.isTransparent && (this.hidden = !1, this._isFirstFrame = !0, this.maskManager._isFirstFrame = !0)
  5128. },
  5129. renderFrame: function() {
  5130. if (!this.hidden && !this.data.hd) {
  5131. this.renderTransform(), this.renderRenderable(), this.setBlendMode();
  5132. var t = 0 === this.data.ty;
  5133. this.globalData.renderer.save(t), this.globalData.renderer.ctxTransform(this.finalTransform.mat.props), this.globalData.renderer.ctxOpacity(this.finalTransform.mProp.o.v), this.renderInnerContent(), this.globalData.renderer.restore(t), this.maskManager.hasMasks && this.globalData.renderer.restore(!0), this._isFirstFrame && (this._isFirstFrame = !1)
  5134. }
  5135. },
  5136. destroy: function() {
  5137. this.canvasContext = null, this.data = null, this.globalData = null, this.maskManager.destroy()
  5138. },
  5139. mHelper: new Matrix
  5140. }, CVBaseElement.prototype.hide = CVBaseElement.prototype.hideElement, CVBaseElement.prototype.show = CVBaseElement.prototype.showElement, CVShapeData.prototype.setAsAnimated = SVGShapeData.prototype.setAsAnimated, extendPrototype([BaseElement, TransformElement, CVBaseElement, IShapeElement, HierarchyElement, FrameElement, RenderableElement], CVShapeElement), CVShapeElement.prototype.initElement = RenderableDOMElement.prototype.initElement, CVShapeElement.prototype.transformHelper = {
  5141. opacity: 1,
  5142. _opMdf: !1
  5143. }, CVShapeElement.prototype.dashResetter = [], CVShapeElement.prototype.createContent = function() {
  5144. this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, !0, [])
  5145. }, CVShapeElement.prototype.createStyleElement = function(t, e) {
  5146. var r = {
  5147. data: t,
  5148. type: t.ty,
  5149. preTransforms: this.transformsManager.addTransformSequence(e),
  5150. transforms: [],
  5151. elements: [],
  5152. closed: !0 === t.hd
  5153. },
  5154. i = {};
  5155. if ("fl" === t.ty || "st" === t.ty ? (i.c = PropertyFactory.getProp(this, t.c, 1, 255, this), i.c.k || (r.co = "rgb(" + bmFloor(i.c.v[0]) + "," + bmFloor(i.c.v[1]) + "," + bmFloor(i.c.v[2]) + ")")) : "gf" !== t.ty && "gs" !== t.ty || (i.s = PropertyFactory.getProp(this, t.s, 1, null, this), i.e = PropertyFactory.getProp(this, t.e, 1, null, this), i.h = PropertyFactory.getProp(this, t.h || {
  5156. k: 0
  5157. }, 0, .01, this), i.a = PropertyFactory.getProp(this, t.a || {
  5158. k: 0
  5159. }, 0, degToRads, this), i.g = new GradientProperty(this, t.g, this)), i.o = PropertyFactory.getProp(this, t.o, 0, .01, this), "st" === t.ty || "gs" === t.ty) {
  5160. if (r.lc = lineCapEnum[t.lc || 2], r.lj = lineJoinEnum[t.lj || 2], 1 == t.lj && (r.ml = t.ml), i.w = PropertyFactory.getProp(this, t.w, 0, null, this), i.w.k || (r.wi = i.w.v), t.d) {
  5161. var s = new DashProperty(this, t.d, "canvas", this);
  5162. i.d = s, i.d.k || (r.da = i.d.dashArray, r.do = i.d.dashoffset[0])
  5163. }
  5164. } else r.r = 2 === t.r ? "evenodd" : "nonzero";
  5165. return this.stylesList.push(r), i.style = r, i
  5166. }, CVShapeElement.prototype.createGroupElement = function() {
  5167. return {
  5168. it: [],
  5169. prevViewData: []
  5170. }
  5171. }, CVShapeElement.prototype.createTransformElement = function(t) {
  5172. return {
  5173. transform: {
  5174. opacity: 1,
  5175. _opMdf: !1,
  5176. key: this.transformsManager.getNewKey(),
  5177. op: PropertyFactory.getProp(this, t.o, 0, .01, this),
  5178. mProps: TransformPropertyFactory.getTransformProperty(this, t, this)
  5179. }
  5180. }
  5181. }, CVShapeElement.prototype.createShapeElement = function(t) {
  5182. var e = new CVShapeData(this, t, this.stylesList, this.transformsManager);
  5183. return this.shapes.push(e), this.addShapeToModifiers(e), e
  5184. }, CVShapeElement.prototype.reloadShapes = function() {
  5185. var t;
  5186. this._isFirstFrame = !0;
  5187. var e = this.itemsData.length;
  5188. for (t = 0; t < e; t += 1) this.prevViewData[t] = this.itemsData[t];
  5189. for (this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, !0, []), e = this.dynamicProperties.length, t = 0; t < e; t += 1) this.dynamicProperties[t].getValue();
  5190. this.renderModifiers(), this.transformsManager.processSequences(this._isFirstFrame)
  5191. }, CVShapeElement.prototype.addTransformToStyleList = function(t) {
  5192. var e, r = this.stylesList.length;
  5193. for (e = 0; e < r; e += 1) this.stylesList[e].closed || this.stylesList[e].transforms.push(t)
  5194. }, CVShapeElement.prototype.removeTransformFromStyleList = function() {
  5195. var t, e = this.stylesList.length;
  5196. for (t = 0; t < e; t += 1) this.stylesList[t].closed || this.stylesList[t].transforms.pop()
  5197. }, CVShapeElement.prototype.closeStyles = function(t) {
  5198. var e, r = t.length;
  5199. for (e = 0; e < r; e += 1) t[e].closed = !0
  5200. }, CVShapeElement.prototype.searchShapes = function(t, e, r, i, s) {
  5201. var a, n, o, h, l, p, f = t.length - 1,
  5202. m = [],
  5203. c = [],
  5204. d = [].concat(s);
  5205. for (a = f; a >= 0; a -= 1) {
  5206. if ((h = this.searchProcessedElement(t[a])) ? e[a] = r[h - 1] : t[a]._shouldRender = i, "fl" === t[a].ty || "st" === t[a].ty || "gf" === t[a].ty || "gs" === t[a].ty) h ? e[a].style.closed = !1 : e[a] = this.createStyleElement(t[a], d), m.push(e[a].style);
  5207. else if ("gr" === t[a].ty) {
  5208. if (h)
  5209. for (o = e[a].it.length, n = 0; n < o; n += 1) e[a].prevViewData[n] = e[a].it[n];
  5210. else e[a] = this.createGroupElement(t[a]);
  5211. this.searchShapes(t[a].it, e[a].it, e[a].prevViewData, i, d)
  5212. } else "tr" === t[a].ty ? (h || (p = this.createTransformElement(t[a]), e[a] = p), d.push(e[a]), this.addTransformToStyleList(e[a])) : "sh" === t[a].ty || "rc" === t[a].ty || "el" === t[a].ty || "sr" === t[a].ty ? h || (e[a] = this.createShapeElement(t[a])) : "tm" === t[a].ty || "rd" === t[a].ty || "pb" === t[a].ty ? (h ? (l = e[a]).closed = !1 : ((l = ShapeModifiers.getModifier(t[a].ty)).init(this, t[a]), e[a] = l, this.shapeModifiers.push(l)), c.push(l)) : "rp" === t[a].ty && (h ? (l = e[a]).closed = !0 : (l = ShapeModifiers.getModifier(t[a].ty), e[a] = l, l.init(this, t, a, e), this.shapeModifiers.push(l), i = !1), c.push(l));
  5213. this.addProcessedElement(t[a], a + 1)
  5214. }
  5215. for (this.removeTransformFromStyleList(), this.closeStyles(m), f = c.length, a = 0; a < f; a += 1) c[a].closed = !0
  5216. }, CVShapeElement.prototype.renderInnerContent = function() {
  5217. this.transformHelper.opacity = 1, this.transformHelper._opMdf = !1, this.renderModifiers(), this.transformsManager.processSequences(this._isFirstFrame), this.renderShape(this.transformHelper, this.shapesData, this.itemsData, !0)
  5218. }, CVShapeElement.prototype.renderShapeTransform = function(t, e) {
  5219. (t._opMdf || e.op._mdf || this._isFirstFrame) && (e.opacity = t.opacity, e.opacity *= e.op.v, e._opMdf = !0)
  5220. }, CVShapeElement.prototype.drawLayer = function() {
  5221. var t, e, r, i, s, a, n, o, h, l = this.stylesList.length,
  5222. p = this.globalData.renderer,
  5223. f = this.globalData.canvasContext;
  5224. for (t = 0; t < l; t += 1)
  5225. if (("st" !== (o = (h = this.stylesList[t]).type) && "gs" !== o || 0 !== h.wi) && h.data._shouldRender && 0 !== h.coOp && 0 !== this.globalData.currentGlobalAlpha) {
  5226. for (p.save(), a = h.elements, "st" === o || "gs" === o ? (f.strokeStyle = "st" === o ? h.co : h.grd, f.lineWidth = h.wi, f.lineCap = h.lc, f.lineJoin = h.lj, f.miterLimit = h.ml || 0) : f.fillStyle = "fl" === o ? h.co : h.grd, p.ctxOpacity(h.coOp), "st" !== o && "gs" !== o && f.beginPath(), p.ctxTransform(h.preTransforms.finalTransform.props), r = a.length, e = 0; e < r; e += 1) {
  5227. for ("st" !== o && "gs" !== o || (f.beginPath(), h.da && (f.setLineDash(h.da), f.lineDashOffset = h.do)), s = (n = a[e].trNodes).length, i = 0; i < s; i += 1) "m" === n[i].t ? f.moveTo(n[i].p[0], n[i].p[1]) : "c" === n[i].t ? f.bezierCurveTo(n[i].pts[0], n[i].pts[1], n[i].pts[2], n[i].pts[3], n[i].pts[4], n[i].pts[5]) : f.closePath();
  5228. "st" !== o && "gs" !== o || (f.stroke(), h.da && f.setLineDash(this.dashResetter))
  5229. }
  5230. "st" !== o && "gs" !== o && f.fill(h.r), p.restore()
  5231. }
  5232. }, CVShapeElement.prototype.renderShape = function(t, e, r, i) {
  5233. var s, a;
  5234. for (a = t, s = e.length - 1; s >= 0; s -= 1) "tr" === e[s].ty ? (a = r[s].transform, this.renderShapeTransform(t, a)) : "sh" === e[s].ty || "el" === e[s].ty || "rc" === e[s].ty || "sr" === e[s].ty ? this.renderPath(e[s], r[s]) : "fl" === e[s].ty ? this.renderFill(e[s], r[s], a) : "st" === e[s].ty ? this.renderStroke(e[s], r[s], a) : "gf" === e[s].ty || "gs" === e[s].ty ? this.renderGradientFill(e[s], r[s], a) : "gr" === e[s].ty ? this.renderShape(a, e[s].it, r[s].it) : e[s].ty;
  5235. i && this.drawLayer()
  5236. }, CVShapeElement.prototype.renderStyledShape = function(t, e) {
  5237. if (this._isFirstFrame || e._mdf || t.transforms._mdf) {
  5238. var r, i, s, a = t.trNodes,
  5239. n = e.paths,
  5240. o = n._length;
  5241. a.length = 0;
  5242. var h = t.transforms.finalTransform;
  5243. for (s = 0; s < o; s += 1) {
  5244. var l = n.shapes[s];
  5245. if (l && l.v) {
  5246. for (i = l._length, r = 1; r < i; r += 1) 1 === r && a.push({
  5247. t: "m",
  5248. p: h.applyToPointArray(l.v[0][0], l.v[0][1], 0)
  5249. }), a.push({
  5250. t: "c",
  5251. pts: h.applyToTriplePoints(l.o[r - 1], l.i[r], l.v[r])
  5252. });
  5253. 1 === i && a.push({
  5254. t: "m",
  5255. p: h.applyToPointArray(l.v[0][0], l.v[0][1], 0)
  5256. }), l.c && i && (a.push({
  5257. t: "c",
  5258. pts: h.applyToTriplePoints(l.o[r - 1], l.i[0], l.v[0])
  5259. }), a.push({
  5260. t: "z"
  5261. }))
  5262. }
  5263. }
  5264. t.trNodes = a
  5265. }
  5266. }, CVShapeElement.prototype.renderPath = function(t, e) {
  5267. if (!0 !== t.hd && t._shouldRender) {
  5268. var r, i = e.styledShapes.length;
  5269. for (r = 0; r < i; r += 1) this.renderStyledShape(e.styledShapes[r], e.sh)
  5270. }
  5271. }, CVShapeElement.prototype.renderFill = function(t, e, r) {
  5272. var i = e.style;
  5273. (e.c._mdf || this._isFirstFrame) && (i.co = "rgb(" + bmFloor(e.c.v[0]) + "," + bmFloor(e.c.v[1]) + "," + bmFloor(e.c.v[2]) + ")"), (e.o._mdf || r._opMdf || this._isFirstFrame) && (i.coOp = e.o.v * r.opacity)
  5274. }, CVShapeElement.prototype.renderGradientFill = function(t, e, r) {
  5275. var i, s = e.style;
  5276. if (!s.grd || e.g._mdf || e.s._mdf || e.e._mdf || 1 !== t.t && (e.h._mdf || e.a._mdf)) {
  5277. var a, n = this.globalData.canvasContext,
  5278. o = e.s.v,
  5279. h = e.e.v;
  5280. if (1 === t.t) i = n.createLinearGradient(o[0], o[1], h[0], h[1]);
  5281. else {
  5282. var l = Math.sqrt(Math.pow(o[0] - h[0], 2) + Math.pow(o[1] - h[1], 2)),
  5283. p = Math.atan2(h[1] - o[1], h[0] - o[0]),
  5284. f = e.h.v;
  5285. f >= 1 ? f = .99 : f <= -1 && (f = -.99);
  5286. var m = l * f,
  5287. c = Math.cos(p + e.a.v) * m + o[0],
  5288. d = Math.sin(p + e.a.v) * m + o[1];
  5289. i = n.createRadialGradient(c, d, 0, o[0], o[1], l)
  5290. }
  5291. var u = t.g.p,
  5292. y = e.g.c,
  5293. g = 1;
  5294. for (a = 0; a < u; a += 1) e.g._hasOpacity && e.g._collapsable && (g = e.g.o[2 * a + 1]), i.addColorStop(y[4 * a] / 100, "rgba(" + y[4 * a + 1] + "," + y[4 * a + 2] + "," + y[4 * a + 3] + "," + g + ")");
  5295. s.grd = i
  5296. }
  5297. s.coOp = e.o.v * r.opacity
  5298. }, CVShapeElement.prototype.renderStroke = function(t, e, r) {
  5299. var i = e.style,
  5300. s = e.d;
  5301. s && (s._mdf || this._isFirstFrame) && (i.da = s.dashArray, i.do = s.dashoffset[0]), (e.c._mdf || this._isFirstFrame) && (i.co = "rgb(" + bmFloor(e.c.v[0]) + "," + bmFloor(e.c.v[1]) + "," + bmFloor(e.c.v[2]) + ")"), (e.o._mdf || r._opMdf || this._isFirstFrame) && (i.coOp = e.o.v * r.opacity), (e.w._mdf || this._isFirstFrame) && (i.wi = e.w.v)
  5302. }, CVShapeElement.prototype.destroy = function() {
  5303. this.shapesData = null, this.globalData = null, this.canvasContext = null, this.stylesList.length = 0, this.itemsData.length = 0
  5304. }, extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement, ITextElement], CVTextElement), CVTextElement.prototype.tHelper = createTag("canvas").getContext("2d"), CVTextElement.prototype.buildNewText = function() {
  5305. var t = this.textProperty.currentData;
  5306. this.renderedLetters = createSizedArray(t.l ? t.l.length : 0);
  5307. var e = !1;
  5308. t.fc ? (e = !0, this.values.fill = this.buildColor(t.fc)) : this.values.fill = "rgba(0,0,0,0)", this.fill = e;
  5309. var r = !1;
  5310. t.sc && (r = !0, this.values.stroke = this.buildColor(t.sc), this.values.sWidth = t.sw);
  5311. var i, s, a, n, o, h, l, p, f, m, c, d, u = this.globalData.fontManager.getFontByName(t.f),
  5312. y = t.l,
  5313. g = this.mHelper;
  5314. this.stroke = r, this.values.fValue = t.finalSize + "px " + this.globalData.fontManager.getFontByName(t.f).fFamily, s = t.finalText.length;
  5315. var v = this.data.singleShape,
  5316. b = .001 * t.tr * t.finalSize,
  5317. P = 0,
  5318. E = 0,
  5319. x = !0,
  5320. S = 0;
  5321. for (i = 0; i < s; i += 1) {
  5322. n = (a = this.globalData.fontManager.getCharData(t.finalText[i], u.fStyle, this.globalData.fontManager.getFontByName(t.f).fFamily)) && a.data || {}, g.reset(), v && y[i].n && (P = -b, E += t.yOffset, E += x ? 1 : 0, x = !1), f = (l = n.shapes ? n.shapes[0].it : []).length, g.scale(t.finalSize / 100, t.finalSize / 100), v && this.applyTextPropertiesToMatrix(t, g, y[i].line, P, E), c = createSizedArray(f - 1);
  5323. var _ = 0;
  5324. for (p = 0; p < f; p += 1)
  5325. if ("sh" === l[p].ty) {
  5326. for (h = l[p].ks.k.i.length, m = l[p].ks.k, d = [], o = 1; o < h; o += 1) 1 === o && d.push(g.applyToX(m.v[0][0], m.v[0][1], 0), g.applyToY(m.v[0][0], m.v[0][1], 0)), d.push(g.applyToX(m.o[o - 1][0], m.o[o - 1][1], 0), g.applyToY(m.o[o - 1][0], m.o[o - 1][1], 0), g.applyToX(m.i[o][0], m.i[o][1], 0), g.applyToY(m.i[o][0], m.i[o][1], 0), g.applyToX(m.v[o][0], m.v[o][1], 0), g.applyToY(m.v[o][0], m.v[o][1], 0));
  5327. d.push(g.applyToX(m.o[o - 1][0], m.o[o - 1][1], 0), g.applyToY(m.o[o - 1][0], m.o[o - 1][1], 0), g.applyToX(m.i[0][0], m.i[0][1], 0), g.applyToY(m.i[0][0], m.i[0][1], 0), g.applyToX(m.v[0][0], m.v[0][1], 0), g.applyToY(m.v[0][0], m.v[0][1], 0)), c[_] = d, _ += 1
  5328. }
  5329. v && (P += y[i].l, P += b), this.textSpans[S] ? this.textSpans[S].elem = c : this.textSpans[S] = {
  5330. elem: c
  5331. }, S += 1
  5332. }
  5333. }, CVTextElement.prototype.renderInnerContent = function() {
  5334. var t, e, r, i, s, a, n = this.canvasContext;
  5335. n.font = this.values.fValue, n.lineCap = "butt", n.lineJoin = "miter", n.miterLimit = 4, this.data.singleShape || this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
  5336. var o, h = this.textAnimator.renderedLetters,
  5337. l = this.textProperty.currentData.l;
  5338. e = l.length;
  5339. var p, f, m = null,
  5340. c = null,
  5341. d = null;
  5342. for (t = 0; t < e; t += 1)
  5343. if (!l[t].n) {
  5344. if ((o = h[t]) && (this.globalData.renderer.save(), this.globalData.renderer.ctxTransform(o.p), this.globalData.renderer.ctxOpacity(o.o)), this.fill) {
  5345. for (o && o.fc ? m !== o.fc && (m = o.fc, n.fillStyle = o.fc) : m !== this.values.fill && (m = this.values.fill, n.fillStyle = this.values.fill), i = (p = this.textSpans[t].elem).length, this.globalData.canvasContext.beginPath(), r = 0; r < i; r += 1)
  5346. for (a = (f = p[r]).length, this.globalData.canvasContext.moveTo(f[0], f[1]), s = 2; s < a; s += 6) this.globalData.canvasContext.bezierCurveTo(f[s], f[s + 1], f[s + 2], f[s + 3], f[s + 4], f[s + 5]);
  5347. this.globalData.canvasContext.closePath(), this.globalData.canvasContext.fill()
  5348. }
  5349. if (this.stroke) {
  5350. for (o && o.sw ? d !== o.sw && (d = o.sw, n.lineWidth = o.sw) : d !== this.values.sWidth && (d = this.values.sWidth, n.lineWidth = this.values.sWidth), o && o.sc ? c !== o.sc && (c = o.sc, n.strokeStyle = o.sc) : c !== this.values.stroke && (c = this.values.stroke, n.strokeStyle = this.values.stroke), i = (p = this.textSpans[t].elem).length, this.globalData.canvasContext.beginPath(), r = 0; r < i; r += 1)
  5351. for (a = (f = p[r]).length, this.globalData.canvasContext.moveTo(f[0], f[1]), s = 2; s < a; s += 6) this.globalData.canvasContext.bezierCurveTo(f[s], f[s + 1], f[s + 2], f[s + 3], f[s + 4], f[s + 5]);
  5352. this.globalData.canvasContext.closePath(), this.globalData.canvasContext.stroke()
  5353. }
  5354. o && this.globalData.renderer.restore()
  5355. }
  5356. }, extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement], CVImageElement), CVImageElement.prototype.initElement = SVGShapeElement.prototype.initElement, CVImageElement.prototype.prepareFrame = IImageElement.prototype.prepareFrame, CVImageElement.prototype.createContent = function() {
  5357. if (this.img.width && (this.assetData.w !== this.img.width || this.assetData.h !== this.img.height)) {
  5358. var t = createTag("canvas");
  5359. t.width = this.assetData.w, t.height = this.assetData.h;
  5360. var e, r, i = t.getContext("2d"),
  5361. s = this.img.width,
  5362. a = this.img.height,
  5363. n = s / a,
  5364. o = this.assetData.w / this.assetData.h,
  5365. h = this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio;
  5366. n > o && "xMidYMid slice" === h || n < o && "xMidYMid slice" !== h ? e = (r = a) * o : r = (e = s) / o, i.drawImage(this.img, (s - e) / 2, (a - r) / 2, e, r, 0, 0, this.assetData.w, this.assetData.h), this.img = t
  5367. }
  5368. }, CVImageElement.prototype.renderInnerContent = function() {
  5369. this.canvasContext.drawImage(this.img, 0, 0)
  5370. }, CVImageElement.prototype.destroy = function() {
  5371. this.img = null
  5372. }, extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement], CVSolidElement), CVSolidElement.prototype.initElement = SVGShapeElement.prototype.initElement, CVSolidElement.prototype.prepareFrame = IImageElement.prototype.prepareFrame, CVSolidElement.prototype.renderInnerContent = function() {
  5373. var t = this.canvasContext;
  5374. t.fillStyle = this.data.sc, t.fillRect(0, 0, this.data.sw, this.data.sh)
  5375. }, extendPrototype([BaseRenderer], CanvasRendererBase), CanvasRendererBase.prototype.createShape = function(t) {
  5376. return new CVShapeElement(t, this.globalData, this)
  5377. }, CanvasRendererBase.prototype.createText = function(t) {
  5378. return new CVTextElement(t, this.globalData, this)
  5379. }, CanvasRendererBase.prototype.createImage = function(t) {
  5380. return new CVImageElement(t, this.globalData, this)
  5381. }, CanvasRendererBase.prototype.createSolid = function(t) {
  5382. return new CVSolidElement(t, this.globalData, this)
  5383. }, CanvasRendererBase.prototype.createNull = SVGRenderer.prototype.createNull, CanvasRendererBase.prototype.ctxTransform = function(t) {
  5384. if (1 !== t[0] || 0 !== t[1] || 0 !== t[4] || 1 !== t[5] || 0 !== t[12] || 0 !== t[13])
  5385. if (this.renderConfig.clearCanvas) {
  5386. this.transformMat.cloneFromProps(t);
  5387. var e = this.contextData.cTr.props;
  5388. this.transformMat.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]), this.contextData.cTr.cloneFromProps(this.transformMat.props);
  5389. var r = this.contextData.cTr.props;
  5390. this.canvasContext.setTransform(r[0], r[1], r[4], r[5], r[12], r[13])
  5391. } else this.canvasContext.transform(t[0], t[1], t[4], t[5], t[12], t[13])
  5392. }, CanvasRendererBase.prototype.ctxOpacity = function(t) {
  5393. if (!this.renderConfig.clearCanvas) return this.canvasContext.globalAlpha *= t < 0 ? 0 : t, void(this.globalData.currentGlobalAlpha = this.contextData.cO);
  5394. this.contextData.cO *= t < 0 ? 0 : t, this.globalData.currentGlobalAlpha !== this.contextData.cO && (this.canvasContext.globalAlpha = this.contextData.cO, this.globalData.currentGlobalAlpha = this.contextData.cO)
  5395. }, CanvasRendererBase.prototype.reset = function() {
  5396. this.renderConfig.clearCanvas ? this.contextData.reset() : this.canvasContext.restore()
  5397. }, CanvasRendererBase.prototype.save = function(t) {
  5398. if (this.renderConfig.clearCanvas) {
  5399. t && this.canvasContext.save();
  5400. var e, r = this.contextData.cTr.props;
  5401. this.contextData._length <= this.contextData.cArrPos && this.contextData.duplicate();
  5402. var i = this.contextData.saved[this.contextData.cArrPos];
  5403. for (e = 0; e < 16; e += 1) i[e] = r[e];
  5404. this.contextData.savedOp[this.contextData.cArrPos] = this.contextData.cO, this.contextData.cArrPos += 1
  5405. } else this.canvasContext.save()
  5406. }, CanvasRendererBase.prototype.restore = function(t) {
  5407. if (this.renderConfig.clearCanvas) {
  5408. t && (this.canvasContext.restore(), this.globalData.blendMode = "source-over"), this.contextData.cArrPos -= 1;
  5409. var e, r = this.contextData.saved[this.contextData.cArrPos],
  5410. i = this.contextData.cTr.props;
  5411. for (e = 0; e < 16; e += 1) i[e] = r[e];
  5412. this.canvasContext.setTransform(r[0], r[1], r[4], r[5], r[12], r[13]), r = this.contextData.savedOp[this.contextData.cArrPos], this.contextData.cO = r, this.globalData.currentGlobalAlpha !== r && (this.canvasContext.globalAlpha = r, this.globalData.currentGlobalAlpha = r)
  5413. } else this.canvasContext.restore()
  5414. }, CanvasRendererBase.prototype.configAnimation = function(t) {
  5415. if (this.animationItem.wrapper) {
  5416. this.animationItem.container = createTag("canvas");
  5417. var e = this.animationItem.container.style;
  5418. e.width = "100%", e.height = "100%";
  5419. var r = "0px 0px 0px";
  5420. e.transformOrigin = r, e.mozTransformOrigin = r, e.webkitTransformOrigin = r, e["-webkit-transform"] = r, e.contentVisibility = this.renderConfig.contentVisibility, this.animationItem.wrapper.appendChild(this.animationItem.container), this.canvasContext = this.animationItem.container.getContext("2d"), this.renderConfig.className && this.animationItem.container.setAttribute("class", this.renderConfig.className), this.renderConfig.id && this.animationItem.container.setAttribute("id", this.renderConfig.id)
  5421. } else this.canvasContext = this.renderConfig.context;
  5422. this.data = t, this.layers = t.layers, this.transformCanvas = {
  5423. w: t.w,
  5424. h: t.h,
  5425. sx: 0,
  5426. sy: 0,
  5427. tx: 0,
  5428. ty: 0
  5429. }, this.setupGlobalData(t, document.body), this.globalData.canvasContext = this.canvasContext, this.globalData.renderer = this, this.globalData.isDashed = !1, this.globalData.progressiveLoad = this.renderConfig.progressiveLoad, this.globalData.transformCanvas = this.transformCanvas, this.elements = createSizedArray(t.layers.length), this.updateContainerSize()
  5430. }, CanvasRendererBase.prototype.updateContainerSize = function() {
  5431. var t, e, r, i;
  5432. if (this.reset(), this.animationItem.wrapper && this.animationItem.container ? (t = this.animationItem.wrapper.offsetWidth, e = this.animationItem.wrapper.offsetHeight, this.animationItem.container.setAttribute("width", t * this.renderConfig.dpr), this.animationItem.container.setAttribute("height", e * this.renderConfig.dpr)) : (t = this.canvasContext.canvas.width * this.renderConfig.dpr, e = this.canvasContext.canvas.height * this.renderConfig.dpr), -1 !== this.renderConfig.preserveAspectRatio.indexOf("meet") || -1 !== this.renderConfig.preserveAspectRatio.indexOf("slice")) {
  5433. var s = this.renderConfig.preserveAspectRatio.split(" "),
  5434. a = s[1] || "meet",
  5435. n = s[0] || "xMidYMid",
  5436. o = n.substr(0, 4),
  5437. h = n.substr(4);
  5438. r = t / e, (i = this.transformCanvas.w / this.transformCanvas.h) > r && "meet" === a || i < r && "slice" === a ? (this.transformCanvas.sx = t / (this.transformCanvas.w / this.renderConfig.dpr), this.transformCanvas.sy = t / (this.transformCanvas.w / this.renderConfig.dpr)) : (this.transformCanvas.sx = e / (this.transformCanvas.h / this.renderConfig.dpr), this.transformCanvas.sy = e / (this.transformCanvas.h / this.renderConfig.dpr)), this.transformCanvas.tx = "xMid" === o && (i < r && "meet" === a || i > r && "slice" === a) ? (t - this.transformCanvas.w * (e / this.transformCanvas.h)) / 2 * this.renderConfig.dpr : "xMax" === o && (i < r && "meet" === a || i > r && "slice" === a) ? (t - this.transformCanvas.w * (e / this.transformCanvas.h)) * this.renderConfig.dpr : 0, this.transformCanvas.ty = "YMid" === h && (i > r && "meet" === a || i < r && "slice" === a) ? (e - this.transformCanvas.h * (t / this.transformCanvas.w)) / 2 * this.renderConfig.dpr : "YMax" === h && (i > r && "meet" === a || i < r && "slice" === a) ? (e - this.transformCanvas.h * (t / this.transformCanvas.w)) * this.renderConfig.dpr : 0
  5439. } else "none" === this.renderConfig.preserveAspectRatio ? (this.transformCanvas.sx = t / (this.transformCanvas.w / this.renderConfig.dpr), this.transformCanvas.sy = e / (this.transformCanvas.h / this.renderConfig.dpr), this.transformCanvas.tx = 0, this.transformCanvas.ty = 0) : (this.transformCanvas.sx = this.renderConfig.dpr, this.transformCanvas.sy = this.renderConfig.dpr, this.transformCanvas.tx = 0, this.transformCanvas.ty = 0);
  5440. this.transformCanvas.props = [this.transformCanvas.sx, 0, 0, 0, 0, this.transformCanvas.sy, 0, 0, 0, 0, 1, 0, this.transformCanvas.tx, this.transformCanvas.ty, 0, 1], this.ctxTransform(this.transformCanvas.props), this.canvasContext.beginPath(), this.canvasContext.rect(0, 0, this.transformCanvas.w, this.transformCanvas.h), this.canvasContext.closePath(), this.canvasContext.clip(), this.renderFrame(this.renderedFrame, !0)
  5441. }, CanvasRendererBase.prototype.destroy = function() {
  5442. var t;
  5443. for (this.renderConfig.clearCanvas && this.animationItem.wrapper && (this.animationItem.wrapper.innerText = ""), t = (this.layers ? this.layers.length : 0) - 1; t >= 0; t -= 1) this.elements[t] && this.elements[t].destroy();
  5444. this.elements.length = 0, this.globalData.canvasContext = null, this.animationItem.container = null, this.destroyed = !0
  5445. }, CanvasRendererBase.prototype.renderFrame = function(t, e) {
  5446. if ((this.renderedFrame !== t || !0 !== this.renderConfig.clearCanvas || e) && !this.destroyed && -1 !== t) {
  5447. var r;
  5448. this.renderedFrame = t, this.globalData.frameNum = t - this.animationItem._isFirstFrame, this.globalData.frameId += 1, this.globalData._mdf = !this.renderConfig.clearCanvas || e, this.globalData.projectInterface.currentFrame = t;
  5449. var i = this.layers.length;
  5450. for (this.completeLayers || this.checkLayers(t), r = 0; r < i; r += 1)(this.completeLayers || this.elements[r]) && this.elements[r].prepareFrame(t - this.layers[r].st);
  5451. if (this.globalData._mdf) {
  5452. for (!0 === this.renderConfig.clearCanvas ? this.canvasContext.clearRect(0, 0, this.transformCanvas.w, this.transformCanvas.h) : this.save(), r = i - 1; r >= 0; r -= 1)(this.completeLayers || this.elements[r]) && this.elements[r].renderFrame();
  5453. !0 !== this.renderConfig.clearCanvas && this.restore()
  5454. }
  5455. }
  5456. }, CanvasRendererBase.prototype.buildItem = function(t) {
  5457. var e = this.elements;
  5458. if (!e[t] && 99 !== this.layers[t].ty) {
  5459. var r = this.createItem(this.layers[t], this, this.globalData);
  5460. e[t] = r, r.initExpressions()
  5461. }
  5462. }, CanvasRendererBase.prototype.checkPendingElements = function() {
  5463. for (; this.pendingElements.length;) {
  5464. this.pendingElements.pop().checkParenting()
  5465. }
  5466. }, CanvasRendererBase.prototype.hide = function() {
  5467. this.animationItem.container.style.display = "none"
  5468. }, CanvasRendererBase.prototype.show = function() {
  5469. this.animationItem.container.style.display = "block"
  5470. }, extendPrototype([CanvasRendererBase, ICompElement, CVBaseElement], CVCompElement), CVCompElement.prototype.renderInnerContent = function() {
  5471. var t, e = this.canvasContext;
  5472. for (e.beginPath(), e.moveTo(0, 0), e.lineTo(this.data.w, 0), e.lineTo(this.data.w, this.data.h), e.lineTo(0, this.data.h), e.lineTo(0, 0), e.clip(), t = this.layers.length - 1; t >= 0; t -= 1)(this.completeLayers || this.elements[t]) && this.elements[t].renderFrame()
  5473. }, CVCompElement.prototype.destroy = function() {
  5474. var t;
  5475. for (t = this.layers.length - 1; t >= 0; t -= 1) this.elements[t] && this.elements[t].destroy();
  5476. this.layers = null, this.elements = null
  5477. }, CVCompElement.prototype.createComp = function(t) {
  5478. return new CVCompElement(t, this.globalData, this)
  5479. }, extendPrototype([CanvasRendererBase], CanvasRenderer), CanvasRenderer.prototype.createComp = function(t) {
  5480. return new CVCompElement(t, this.globalData, this)
  5481. }, HBaseElement.prototype = {
  5482. checkBlendMode: function() {},
  5483. initRendererElement: function() {
  5484. this.baseElement = createTag(this.data.tg || "div"), this.data.hasMask ? (this.svgElement = createNS("svg"), this.layerElement = createNS("g"), this.maskedElement = this.layerElement, this.svgElement.appendChild(this.layerElement), this.baseElement.appendChild(this.svgElement)) : this.layerElement = this.baseElement, styleDiv(this.baseElement)
  5485. },
  5486. createContainerElements: function() {
  5487. this.renderableEffectsManager = new CVEffects(this), this.transformedElement = this.baseElement, this.maskedElement = this.layerElement, this.data.ln && this.layerElement.setAttribute("id", this.data.ln), this.data.cl && this.layerElement.setAttribute("class", this.data.cl), 0 !== this.data.bm && this.setBlendMode()
  5488. },
  5489. renderElement: function() {
  5490. var t = this.transformedElement ? this.transformedElement.style : {};
  5491. if (this.finalTransform._matMdf) {
  5492. var e = this.finalTransform.mat.toCSS();
  5493. t.transform = e, t.webkitTransform = e
  5494. }
  5495. this.finalTransform._opMdf && (t.opacity = this.finalTransform.mProp.o.v)
  5496. },
  5497. renderFrame: function() {
  5498. this.data.hd || this.hidden || (this.renderTransform(), this.renderRenderable(), this.renderElement(), this.renderInnerContent(), this._isFirstFrame && (this._isFirstFrame = !1))
  5499. },
  5500. destroy: function() {
  5501. this.layerElement = null, this.transformedElement = null, this.matteElement && (this.matteElement = null), this.maskManager && (this.maskManager.destroy(), this.maskManager = null)
  5502. },
  5503. createRenderableComponents: function() {
  5504. this.maskManager = new MaskElement(this.data, this, this.globalData)
  5505. },
  5506. addEffects: function() {},
  5507. setMatte: function() {}
  5508. }, HBaseElement.prototype.getBaseElement = SVGBaseElement.prototype.getBaseElement, HBaseElement.prototype.destroyBaseElement = HBaseElement.prototype.destroy, HBaseElement.prototype.buildElementParenting = BaseRenderer.prototype.buildElementParenting, extendPrototype([BaseElement, TransformElement, HBaseElement, HierarchyElement, FrameElement, RenderableDOMElement], HSolidElement), HSolidElement.prototype.createContent = function() {
  5509. var t;
  5510. this.data.hasMask ? ((t = createNS("rect")).setAttribute("width", this.data.sw), t.setAttribute("height", this.data.sh), t.setAttribute("fill", this.data.sc), this.svgElement.setAttribute("width", this.data.sw), this.svgElement.setAttribute("height", this.data.sh)) : ((t = createTag("div")).style.width = this.data.sw + "px", t.style.height = this.data.sh + "px", t.style.backgroundColor = this.data.sc), this.layerElement.appendChild(t)
  5511. }, extendPrototype([BaseElement, TransformElement, HSolidElement, SVGShapeElement, HBaseElement, HierarchyElement, FrameElement, RenderableElement], HShapeElement), HShapeElement.prototype._renderShapeFrame = HShapeElement.prototype.renderInnerContent, HShapeElement.prototype.createContent = function() {
  5512. var t;
  5513. if (this.baseElement.style.fontSize = 0, this.data.hasMask) this.layerElement.appendChild(this.shapesContainer), t = this.svgElement;
  5514. else {
  5515. t = createNS("svg");
  5516. var e = this.comp.data ? this.comp.data : this.globalData.compSize;
  5517. t.setAttribute("width", e.w), t.setAttribute("height", e.h), t.appendChild(this.shapesContainer), this.layerElement.appendChild(t)
  5518. }
  5519. this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.shapesContainer, 0, [], !0), this.filterUniqueShapes(), this.shapeCont = t
  5520. }, HShapeElement.prototype.getTransformedPoint = function(t, e) {
  5521. var r, i = t.length;
  5522. for (r = 0; r < i; r += 1) e = t[r].mProps.v.applyToPointArray(e[0], e[1], 0);
  5523. return e
  5524. }, HShapeElement.prototype.calculateShapeBoundingBox = function(t, e) {
  5525. var r, i, s, a, n, o = t.sh.v,
  5526. h = t.transformers,
  5527. l = o._length;
  5528. if (!(l <= 1)) {
  5529. for (r = 0; r < l - 1; r += 1) i = this.getTransformedPoint(h, o.v[r]), s = this.getTransformedPoint(h, o.o[r]), a = this.getTransformedPoint(h, o.i[r + 1]), n = this.getTransformedPoint(h, o.v[r + 1]), this.checkBounds(i, s, a, n, e);
  5530. o.c && (i = this.getTransformedPoint(h, o.v[r]), s = this.getTransformedPoint(h, o.o[r]), a = this.getTransformedPoint(h, o.i[0]), n = this.getTransformedPoint(h, o.v[0]), this.checkBounds(i, s, a, n, e))
  5531. }
  5532. }, HShapeElement.prototype.checkBounds = function(t, e, r, i, s) {
  5533. this.getBoundsOfCurve(t, e, r, i);
  5534. var a = this.shapeBoundingBox;
  5535. s.x = bmMin(a.left, s.x), s.xMax = bmMax(a.right, s.xMax), s.y = bmMin(a.top, s.y), s.yMax = bmMax(a.bottom, s.yMax)
  5536. }, HShapeElement.prototype.shapeBoundingBox = {
  5537. left: 0,
  5538. right: 0,
  5539. top: 0,
  5540. bottom: 0
  5541. }, HShapeElement.prototype.tempBoundingBox = {
  5542. x: 0,
  5543. xMax: 0,
  5544. y: 0,
  5545. yMax: 0,
  5546. width: 0,
  5547. height: 0
  5548. }, HShapeElement.prototype.getBoundsOfCurve = function(t, e, r, i) {
  5549. for (var s, a, n, o, h, l, p, f = [
  5550. [t[0], i[0]],
  5551. [t[1], i[1]]
  5552. ], m = 0; m < 2; ++m) a = 6 * t[m] - 12 * e[m] + 6 * r[m], s = -3 * t[m] + 9 * e[m] - 9 * r[m] + 3 * i[m], n = 3 * e[m] - 3 * t[m], a |= 0, n |= 0, 0 === (s |= 0) && 0 === a || (0 === s ? (o = -n / a) > 0 && o < 1 && f[m].push(this.calculateF(o, t, e, r, i, m)) : (h = a * a - 4 * n * s) >= 0 && ((l = (-a + bmSqrt(h)) / (2 * s)) > 0 && l < 1 && f[m].push(this.calculateF(l, t, e, r, i, m)), (p = (-a - bmSqrt(h)) / (2 * s)) > 0 && p < 1 && f[m].push(this.calculateF(p, t, e, r, i, m))));
  5553. this.shapeBoundingBox.left = bmMin.apply(null, f[0]), this.shapeBoundingBox.top = bmMin.apply(null, f[1]), this.shapeBoundingBox.right = bmMax.apply(null, f[0]), this.shapeBoundingBox.bottom = bmMax.apply(null, f[1])
  5554. }, HShapeElement.prototype.calculateF = function(t, e, r, i, s, a) {
  5555. return bmPow(1 - t, 3) * e[a] + 3 * bmPow(1 - t, 2) * t * r[a] + 3 * (1 - t) * bmPow(t, 2) * i[a] + bmPow(t, 3) * s[a]
  5556. }, HShapeElement.prototype.calculateBoundingBox = function(t, e) {
  5557. var r, i = t.length;
  5558. for (r = 0; r < i; r += 1) t[r] && t[r].sh ? this.calculateShapeBoundingBox(t[r], e) : t[r] && t[r].it && this.calculateBoundingBox(t[r].it, e)
  5559. }, HShapeElement.prototype.currentBoxContains = function(t) {
  5560. return this.currentBBox.x <= t.x && this.currentBBox.y <= t.y && this.currentBBox.width + this.currentBBox.x >= t.x + t.width && this.currentBBox.height + this.currentBBox.y >= t.y + t.height
  5561. }, HShapeElement.prototype.renderInnerContent = function() {
  5562. if (this._renderShapeFrame(), !this.hidden && (this._isFirstFrame || this._mdf)) {
  5563. var t = this.tempBoundingBox,
  5564. e = 999999;
  5565. if (t.x = e, t.xMax = -e, t.y = e, t.yMax = -e, this.calculateBoundingBox(this.itemsData, t), t.width = t.xMax < t.x ? 0 : t.xMax - t.x, t.height = t.yMax < t.y ? 0 : t.yMax - t.y, this.currentBoxContains(t)) return;
  5566. var r = !1;
  5567. if (this.currentBBox.w !== t.width && (this.currentBBox.w = t.width, this.shapeCont.setAttribute("width", t.width), r = !0), this.currentBBox.h !== t.height && (this.currentBBox.h = t.height, this.shapeCont.setAttribute("height", t.height), r = !0), r || this.currentBBox.x !== t.x || this.currentBBox.y !== t.y) {
  5568. this.currentBBox.w = t.width, this.currentBBox.h = t.height, this.currentBBox.x = t.x, this.currentBBox.y = t.y, this.shapeCont.setAttribute("viewBox", this.currentBBox.x + " " + this.currentBBox.y + " " + this.currentBBox.w + " " + this.currentBBox.h);
  5569. var i = this.shapeCont.style,
  5570. s = "translate(" + this.currentBBox.x + "px," + this.currentBBox.y + "px)";
  5571. i.transform = s, i.webkitTransform = s
  5572. }
  5573. }
  5574. }, extendPrototype([BaseElement, TransformElement, HBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, ITextElement], HTextElement), HTextElement.prototype.createContent = function() {
  5575. if (this.isMasked = this.checkMasks(), this.isMasked) {
  5576. this.renderType = "svg", this.compW = this.comp.data.w, this.compH = this.comp.data.h, this.svgElement.setAttribute("width", this.compW), this.svgElement.setAttribute("height", this.compH);
  5577. var t = createNS("g");
  5578. this.maskedElement.appendChild(t), this.innerElem = t
  5579. } else this.renderType = "html", this.innerElem = this.layerElement;
  5580. this.checkParenting()
  5581. }, HTextElement.prototype.buildNewText = function() {
  5582. var t = this.textProperty.currentData;
  5583. this.renderedLetters = createSizedArray(t.l ? t.l.length : 0);
  5584. var e = this.innerElem.style,
  5585. r = t.fc ? this.buildColor(t.fc) : "rgba(0,0,0,0)";
  5586. e.fill = r, e.color = r, t.sc && (e.stroke = this.buildColor(t.sc), e.strokeWidth = t.sw + "px");
  5587. var i, s, a = this.globalData.fontManager.getFontByName(t.f);
  5588. if (!this.globalData.fontManager.chars)
  5589. if (e.fontSize = t.finalSize + "px", e.lineHeight = t.finalSize + "px", a.fClass) this.innerElem.className = a.fClass;
  5590. else {
  5591. e.fontFamily = a.fFamily;
  5592. var n = t.fWeight,
  5593. o = t.fStyle;
  5594. e.fontStyle = o, e.fontWeight = n
  5595. }
  5596. var h, l, p, f = t.l;
  5597. s = f.length;
  5598. var m, c = this.mHelper,
  5599. d = "",
  5600. u = 0;
  5601. for (i = 0; i < s; i += 1) {
  5602. if (this.globalData.fontManager.chars ? (this.textPaths[u] ? h = this.textPaths[u] : ((h = createNS("path")).setAttribute("stroke-linecap", lineCapEnum[1]), h.setAttribute("stroke-linejoin", lineJoinEnum[2]), h.setAttribute("stroke-miterlimit", "4")), this.isMasked || (this.textSpans[u] ? p = (l = this.textSpans[u]).children[0] : ((l = createTag("div")).style.lineHeight = 0, (p = createNS("svg")).appendChild(h), styleDiv(l)))) : this.isMasked ? h = this.textPaths[u] ? this.textPaths[u] : createNS("text") : this.textSpans[u] ? (l = this.textSpans[u], h = this.textPaths[u]) : (styleDiv(l = createTag("span")), styleDiv(h = createTag("span")), l.appendChild(h)), this.globalData.fontManager.chars) {
  5603. var y, g = this.globalData.fontManager.getCharData(t.finalText[i], a.fStyle, this.globalData.fontManager.getFontByName(t.f).fFamily);
  5604. if (y = g ? g.data : null, c.reset(), y && y.shapes && y.shapes.length && (m = y.shapes[0].it, c.scale(t.finalSize / 100, t.finalSize / 100), d = this.createPathShape(c, m), h.setAttribute("d", d)), this.isMasked) this.innerElem.appendChild(h);
  5605. else {
  5606. if (this.innerElem.appendChild(l), y && y.shapes) {
  5607. document.body.appendChild(p);
  5608. var v = p.getBBox();
  5609. p.setAttribute("width", v.width + 2), p.setAttribute("height", v.height + 2), p.setAttribute("viewBox", v.x - 1 + " " + (v.y - 1) + " " + (v.width + 2) + " " + (v.height + 2));
  5610. var b = p.style,
  5611. P = "translate(" + (v.x - 1) + "px," + (v.y - 1) + "px)";
  5612. b.transform = P, b.webkitTransform = P, f[i].yOffset = v.y - 1
  5613. } else p.setAttribute("width", 1), p.setAttribute("height", 1);
  5614. l.appendChild(p)
  5615. }
  5616. } else if (h.textContent = f[i].val, h.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), this.isMasked) this.innerElem.appendChild(h);
  5617. else {
  5618. this.innerElem.appendChild(l);
  5619. var E = h.style,
  5620. x = "translate3d(0," + -t.finalSize / 1.2 + "px,0)";
  5621. E.transform = x, E.webkitTransform = x
  5622. }
  5623. this.isMasked ? this.textSpans[u] = h : this.textSpans[u] = l, this.textSpans[u].style.display = "block", this.textPaths[u] = h, u += 1
  5624. }
  5625. for (; u < this.textSpans.length;) this.textSpans[u].style.display = "none", u += 1
  5626. }, HTextElement.prototype.renderInnerContent = function() {
  5627. var t;
  5628. if (this.data.singleShape) {
  5629. if (!this._isFirstFrame && !this.lettersChangedFlag) return;
  5630. if (this.isMasked && this.finalTransform._matMdf) {
  5631. this.svgElement.setAttribute("viewBox", -this.finalTransform.mProp.p.v[0] + " " + -this.finalTransform.mProp.p.v[1] + " " + this.compW + " " + this.compH), t = this.svgElement.style;
  5632. var e = "translate(" + -this.finalTransform.mProp.p.v[0] + "px," + -this.finalTransform.mProp.p.v[1] + "px)";
  5633. t.transform = e, t.webkitTransform = e
  5634. }
  5635. }
  5636. if (this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag), this.lettersChangedFlag || this.textAnimator.lettersChangedFlag) {
  5637. var r, i, s, a, n, o = 0,
  5638. h = this.textAnimator.renderedLetters,
  5639. l = this.textProperty.currentData.l;
  5640. for (i = l.length, r = 0; r < i; r += 1) l[r].n ? o += 1 : (a = this.textSpans[r], n = this.textPaths[r], s = h[o], o += 1, s._mdf.m && (this.isMasked ? a.setAttribute("transform", s.m) : (a.style.webkitTransform = s.m, a.style.transform = s.m)), a.style.opacity = s.o, s.sw && s._mdf.sw && n.setAttribute("stroke-width", s.sw), s.sc && s._mdf.sc && n.setAttribute("stroke", s.sc), s.fc && s._mdf.fc && (n.setAttribute("fill", s.fc), n.style.color = s.fc));
  5641. if (this.innerElem.getBBox && !this.hidden && (this._isFirstFrame || this._mdf)) {
  5642. var p = this.innerElem.getBBox();
  5643. this.currentBBox.w !== p.width && (this.currentBBox.w = p.width, this.svgElement.setAttribute("width", p.width)), this.currentBBox.h !== p.height && (this.currentBBox.h = p.height, this.svgElement.setAttribute("height", p.height));
  5644. if (this.currentBBox.w !== p.width + 2 || this.currentBBox.h !== p.height + 2 || this.currentBBox.x !== p.x - 1 || this.currentBBox.y !== p.y - 1) {
  5645. this.currentBBox.w = p.width + 2, this.currentBBox.h = p.height + 2, this.currentBBox.x = p.x - 1, this.currentBBox.y = p.y - 1, this.svgElement.setAttribute("viewBox", this.currentBBox.x + " " + this.currentBBox.y + " " + this.currentBBox.w + " " + this.currentBBox.h), t = this.svgElement.style;
  5646. var f = "translate(" + this.currentBBox.x + "px," + this.currentBBox.y + "px)";
  5647. t.transform = f, t.webkitTransform = f
  5648. }
  5649. }
  5650. }
  5651. }, extendPrototype([BaseElement, FrameElement, HierarchyElement], HCameraElement), HCameraElement.prototype.setup = function() {
  5652. var t, e, r, i, s = this.comp.threeDElements.length;
  5653. for (t = 0; t < s; t += 1)
  5654. if ("3d" === (e = this.comp.threeDElements[t]).type) {
  5655. r = e.perspectiveElem.style, i = e.container.style;
  5656. var a = this.pe.v + "px",
  5657. n = "0px 0px 0px",
  5658. o = "matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";
  5659. r.perspective = a, r.webkitPerspective = a, i.transformOrigin = n, i.mozTransformOrigin = n, i.webkitTransformOrigin = n, r.transform = o, r.webkitTransform = o
  5660. }
  5661. }, HCameraElement.prototype.createElements = function() {}, HCameraElement.prototype.hide = function() {}, HCameraElement.prototype.renderFrame = function() {
  5662. var t, e, r = this._isFirstFrame;
  5663. if (this.hierarchy)
  5664. for (e = this.hierarchy.length, t = 0; t < e; t += 1) r = this.hierarchy[t].finalTransform.mProp._mdf || r;
  5665. if (r || this.pe._mdf || this.p && this.p._mdf || this.px && (this.px._mdf || this.py._mdf || this.pz._mdf) || this.rx._mdf || this.ry._mdf || this.rz._mdf || this.or._mdf || this.a && this.a._mdf) {
  5666. if (this.mat.reset(), this.hierarchy)
  5667. for (t = e = this.hierarchy.length - 1; t >= 0; t -= 1) {
  5668. var i = this.hierarchy[t].finalTransform.mProp;
  5669. this.mat.translate(-i.p.v[0], -i.p.v[1], i.p.v[2]), this.mat.rotateX(-i.or.v[0]).rotateY(-i.or.v[1]).rotateZ(i.or.v[2]), this.mat.rotateX(-i.rx.v).rotateY(-i.ry.v).rotateZ(i.rz.v), this.mat.scale(1 / i.s.v[0], 1 / i.s.v[1], 1 / i.s.v[2]), this.mat.translate(i.a.v[0], i.a.v[1], i.a.v[2])
  5670. }
  5671. if (this.p ? this.mat.translate(-this.p.v[0], -this.p.v[1], this.p.v[2]) : this.mat.translate(-this.px.v, -this.py.v, this.pz.v), this.a) {
  5672. var s;
  5673. s = this.p ? [this.p.v[0] - this.a.v[0], this.p.v[1] - this.a.v[1], this.p.v[2] - this.a.v[2]] : [this.px.v - this.a.v[0], this.py.v - this.a.v[1], this.pz.v - this.a.v[2]];
  5674. var a = Math.sqrt(Math.pow(s[0], 2) + Math.pow(s[1], 2) + Math.pow(s[2], 2)),
  5675. n = [s[0] / a, s[1] / a, s[2] / a],
  5676. o = Math.sqrt(n[2] * n[2] + n[0] * n[0]),
  5677. h = Math.atan2(n[1], o),
  5678. l = Math.atan2(n[0], -n[2]);
  5679. this.mat.rotateY(l).rotateX(-h)
  5680. }
  5681. this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v), this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]), this.mat.translate(this.globalData.compSize.w / 2, this.globalData.compSize.h / 2, 0), this.mat.translate(0, 0, this.pe.v);
  5682. var p = !this._prevMat.equals(this.mat);
  5683. if ((p || this.pe._mdf) && this.comp.threeDElements) {
  5684. var f, m, c;
  5685. for (e = this.comp.threeDElements.length, t = 0; t < e; t += 1)
  5686. if ("3d" === (f = this.comp.threeDElements[t]).type) {
  5687. if (p) {
  5688. var d = this.mat.toCSS();
  5689. (c = f.container.style).transform = d, c.webkitTransform = d
  5690. }
  5691. this.pe._mdf && ((m = f.perspectiveElem.style).perspective = this.pe.v + "px", m.webkitPerspective = this.pe.v + "px")
  5692. }
  5693. this.mat.clone(this._prevMat)
  5694. }
  5695. }
  5696. this._isFirstFrame = !1
  5697. }, HCameraElement.prototype.prepareFrame = function(t) {
  5698. this.prepareProperties(t, !0)
  5699. }, HCameraElement.prototype.destroy = function() {}, HCameraElement.prototype.getBaseElement = function() {
  5700. return null
  5701. }, extendPrototype([BaseElement, TransformElement, HBaseElement, HSolidElement, HierarchyElement, FrameElement, RenderableElement], HImageElement), HImageElement.prototype.createContent = function() {
  5702. var t = this.globalData.getAssetsPath(this.assetData),
  5703. e = new Image;
  5704. this.data.hasMask ? (this.imageElem = createNS("image"), this.imageElem.setAttribute("width", this.assetData.w + "px"), this.imageElem.setAttribute("height", this.assetData.h + "px"), this.imageElem.setAttributeNS("http://www.w3.org/1999/xlink", "href", t), this.layerElement.appendChild(this.imageElem), this.baseElement.setAttribute("width", this.assetData.w), this.baseElement.setAttribute("height", this.assetData.h)) : this.layerElement.appendChild(e), e.crossOrigin = "anonymous", e.src = t, this.data.ln && this.baseElement.setAttribute("id", this.data.ln)
  5705. }, extendPrototype([BaseRenderer], HybridRendererBase), HybridRendererBase.prototype.buildItem = SVGRenderer.prototype.buildItem, HybridRendererBase.prototype.checkPendingElements = function() {
  5706. for (; this.pendingElements.length;) {
  5707. this.pendingElements.pop().checkParenting()
  5708. }
  5709. }, HybridRendererBase.prototype.appendElementInPos = function(t, e) {
  5710. var r = t.getBaseElement();
  5711. if (r) {
  5712. var i = this.layers[e];
  5713. if (i.ddd && this.supports3d) this.addTo3dContainer(r, e);
  5714. else if (this.threeDElements) this.addTo3dContainer(r, e);
  5715. else {
  5716. for (var s, a, n = 0; n < e;) this.elements[n] && !0 !== this.elements[n] && this.elements[n].getBaseElement && (a = this.elements[n], s = (this.layers[n].ddd ? this.getThreeDContainerByPos(n) : a.getBaseElement()) || s), n += 1;
  5717. s ? i.ddd && this.supports3d || this.layerElement.insertBefore(r, s) : i.ddd && this.supports3d || this.layerElement.appendChild(r)
  5718. }
  5719. }
  5720. }, HybridRendererBase.prototype.createShape = function(t) {
  5721. return this.supports3d ? new HShapeElement(t, this.globalData, this) : new SVGShapeElement(t, this.globalData, this)
  5722. }, HybridRendererBase.prototype.createText = function(t) {
  5723. return this.supports3d ? new HTextElement(t, this.globalData, this) : new SVGTextLottieElement(t, this.globalData, this)
  5724. }, HybridRendererBase.prototype.createCamera = function(t) {
  5725. return this.camera = new HCameraElement(t, this.globalData, this), this.camera
  5726. }, HybridRendererBase.prototype.createImage = function(t) {
  5727. return this.supports3d ? new HImageElement(t, this.globalData, this) : new IImageElement(t, this.globalData, this)
  5728. }, HybridRendererBase.prototype.createSolid = function(t) {
  5729. return this.supports3d ? new HSolidElement(t, this.globalData, this) : new ISolidElement(t, this.globalData, this)
  5730. }, HybridRendererBase.prototype.createNull = SVGRenderer.prototype.createNull, HybridRendererBase.prototype.getThreeDContainerByPos = function(t) {
  5731. for (var e = 0, r = this.threeDElements.length; e < r;) {
  5732. if (this.threeDElements[e].startPos <= t && this.threeDElements[e].endPos >= t) return this.threeDElements[e].perspectiveElem;
  5733. e += 1
  5734. }
  5735. return null
  5736. }, HybridRendererBase.prototype.createThreeDContainer = function(t, e) {
  5737. var r, i, s = createTag("div");
  5738. styleDiv(s);
  5739. var a = createTag("div");
  5740. if (styleDiv(a), "3d" === e) {
  5741. (r = s.style).width = this.globalData.compSize.w + "px", r.height = this.globalData.compSize.h + "px";
  5742. var n = "50% 50%";
  5743. r.webkitTransformOrigin = n, r.mozTransformOrigin = n, r.transformOrigin = n;
  5744. var o = "matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";
  5745. (i = a.style).transform = o, i.webkitTransform = o
  5746. }
  5747. s.appendChild(a);
  5748. var h = {
  5749. container: a,
  5750. perspectiveElem: s,
  5751. startPos: t,
  5752. endPos: t,
  5753. type: e
  5754. };
  5755. return this.threeDElements.push(h), h
  5756. }, HybridRendererBase.prototype.build3dContainers = function() {
  5757. var t, e, r = this.layers.length,
  5758. i = "";
  5759. for (t = 0; t < r; t += 1) this.layers[t].ddd && 3 !== this.layers[t].ty ? ("3d" !== i && (i = "3d", e = this.createThreeDContainer(t, "3d")), e.endPos = Math.max(e.endPos, t)) : ("2d" !== i && (i = "2d", e = this.createThreeDContainer(t, "2d")), e.endPos = Math.max(e.endPos, t));
  5760. for (t = (r = this.threeDElements.length) - 1; t >= 0; t -= 1) this.resizerElem.appendChild(this.threeDElements[t].perspectiveElem)
  5761. }, HybridRendererBase.prototype.addTo3dContainer = function(t, e) {
  5762. for (var r = 0, i = this.threeDElements.length; r < i;) {
  5763. if (e <= this.threeDElements[r].endPos) {
  5764. for (var s, a = this.threeDElements[r].startPos; a < e;) this.elements[a] && this.elements[a].getBaseElement && (s = this.elements[a].getBaseElement()), a += 1;
  5765. s ? this.threeDElements[r].container.insertBefore(t, s) : this.threeDElements[r].container.appendChild(t);
  5766. break
  5767. }
  5768. r += 1
  5769. }
  5770. }, HybridRendererBase.prototype.configAnimation = function(t) {
  5771. var e = createTag("div"),
  5772. r = this.animationItem.wrapper,
  5773. i = e.style;
  5774. i.width = t.w + "px", i.height = t.h + "px", this.resizerElem = e, styleDiv(e), i.transformStyle = "flat", i.mozTransformStyle = "flat", i.webkitTransformStyle = "flat", this.renderConfig.className && e.setAttribute("class", this.renderConfig.className), r.appendChild(e), i.overflow = "hidden";
  5775. var s = createNS("svg");
  5776. s.setAttribute("width", "1"), s.setAttribute("height", "1"), styleDiv(s), this.resizerElem.appendChild(s);
  5777. var a = createNS("defs");
  5778. s.appendChild(a), this.data = t, this.setupGlobalData(t, s), this.globalData.defs = a, this.layers = t.layers, this.layerElement = this.resizerElem, this.build3dContainers(), this.updateContainerSize()
  5779. }, HybridRendererBase.prototype.destroy = function() {
  5780. var t;
  5781. this.animationItem.wrapper && (this.animationItem.wrapper.innerText = ""), this.animationItem.container = null, this.globalData.defs = null;
  5782. var e = this.layers ? this.layers.length : 0;
  5783. for (t = 0; t < e; t += 1) this.elements[t].destroy();
  5784. this.elements.length = 0, this.destroyed = !0, this.animationItem = null
  5785. }, HybridRendererBase.prototype.updateContainerSize = function() {
  5786. var t, e, r, i, s = this.animationItem.wrapper.offsetWidth,
  5787. a = this.animationItem.wrapper.offsetHeight,
  5788. n = s / a;
  5789. this.globalData.compSize.w / this.globalData.compSize.h > n ? (t = s / this.globalData.compSize.w, e = s / this.globalData.compSize.w, r = 0, i = (a - this.globalData.compSize.h * (s / this.globalData.compSize.w)) / 2) : (t = a / this.globalData.compSize.h, e = a / this.globalData.compSize.h, r = (s - this.globalData.compSize.w * (a / this.globalData.compSize.h)) / 2, i = 0);
  5790. var o = this.resizerElem.style;
  5791. o.webkitTransform = "matrix3d(" + t + ",0,0,0,0," + e + ",0,0,0,0,1,0," + r + "," + i + ",0,1)", o.transform = o.webkitTransform
  5792. }, HybridRendererBase.prototype.renderFrame = SVGRenderer.prototype.renderFrame, HybridRendererBase.prototype.hide = function() {
  5793. this.resizerElem.style.display = "none"
  5794. }, HybridRendererBase.prototype.show = function() {
  5795. this.resizerElem.style.display = "block"
  5796. }, HybridRendererBase.prototype.initItems = function() {
  5797. if (this.buildAllItems(), this.camera) this.camera.setup();
  5798. else {
  5799. var t, e = this.globalData.compSize.w,
  5800. r = this.globalData.compSize.h,
  5801. i = this.threeDElements.length;
  5802. for (t = 0; t < i; t += 1) {
  5803. var s = this.threeDElements[t].perspectiveElem.style;
  5804. s.webkitPerspective = Math.sqrt(Math.pow(e, 2) + Math.pow(r, 2)) + "px", s.perspective = s.webkitPerspective
  5805. }
  5806. }
  5807. }, HybridRendererBase.prototype.searchExtraCompositions = function(t) {
  5808. var e, r = t.length,
  5809. i = createTag("div");
  5810. for (e = 0; e < r; e += 1)
  5811. if (t[e].xt) {
  5812. var s = this.createComp(t[e], i, this.globalData.comp, null);
  5813. s.initExpressions(), this.globalData.projectInterface.registerComposition(s)
  5814. }
  5815. }, extendPrototype([HybridRendererBase, ICompElement, HBaseElement], HCompElement), HCompElement.prototype._createBaseContainerElements = HCompElement.prototype.createContainerElements, HCompElement.prototype.createContainerElements = function() {
  5816. this._createBaseContainerElements(), this.data.hasMask ? (this.svgElement.setAttribute("width", this.data.w), this.svgElement.setAttribute("height", this.data.h), this.transformedElement = this.baseElement) : this.transformedElement = this.layerElement
  5817. }, HCompElement.prototype.addTo3dContainer = function(t, e) {
  5818. for (var r, i = 0; i < e;) this.elements[i] && this.elements[i].getBaseElement && (r = this.elements[i].getBaseElement()), i += 1;
  5819. r ? this.layerElement.insertBefore(t, r) : this.layerElement.appendChild(t)
  5820. }, HCompElement.prototype.createComp = function(t) {
  5821. return this.supports3d ? new HCompElement(t, this.globalData, this) : new SVGCompElement(t, this.globalData, this)
  5822. }, extendPrototype([HybridRendererBase], HybridRenderer), HybridRenderer.prototype.createComp = function(t) {
  5823. return this.supports3d ? new HCompElement(t, this.globalData, this) : new SVGCompElement(t, this.globalData, this)
  5824. };
  5825. var Expressions = function() {
  5826. var t = {};
  5827. return t.initExpressions = function(t) {
  5828. var e = 0,
  5829. r = [];
  5830. t.renderer.compInterface = CompExpressionInterface(t.renderer), t.renderer.globalData.projectInterface.registerComposition(t.renderer), t.renderer.globalData.pushExpression = function() {
  5831. e += 1
  5832. }, t.renderer.globalData.popExpression = function() {
  5833. 0 == (e -= 1) && function() {
  5834. var t, e = r.length;
  5835. for (t = 0; t < e; t += 1) r[t].release();
  5836. r.length = 0
  5837. }()
  5838. }, t.renderer.globalData.registerExpressionProperty = function(t) {
  5839. -1 === r.indexOf(t) && r.push(t)
  5840. }
  5841. }, t
  5842. }();
  5843. function _typeof$1(t) {
  5844. return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
  5845. return typeof t
  5846. } : function(t) {
  5847. return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
  5848. }, _typeof$1(t)
  5849. }
  5850. function seedRandom(t, e) {
  5851. var r, i = this,
  5852. s = 256,
  5853. a = e.pow(s, 6),
  5854. n = e.pow(2, 52),
  5855. o = 2 * n,
  5856. h = 255;
  5857. function l(t) {
  5858. var e, r = t.length,
  5859. i = this,
  5860. a = 0,
  5861. n = i.i = i.j = 0,
  5862. o = i.S = [];
  5863. for (r || (t = [r++]); a < s;) o[a] = a++;
  5864. for (a = 0; a < s; a++) o[a] = o[n = h & n + t[a % r] + (e = o[a])], o[n] = e;
  5865. i.g = function(t) {
  5866. for (var e, r = 0, a = i.i, n = i.j, o = i.S; t--;) e = o[a = h & a + 1], r = r * s + o[h & (o[a] = o[n = h & n + e]) + (o[n] = e)];
  5867. return i.i = a, i.j = n, r
  5868. }
  5869. }
  5870. function p(t, e) {
  5871. return e.i = t.i, e.j = t.j, e.S = t.S.slice(), e
  5872. }
  5873. function f(t, e) {
  5874. var r, i = [],
  5875. s = _typeof$1(t);
  5876. if (e && "object" == s)
  5877. for (r in t) try {
  5878. i.push(f(t[r], e - 1))
  5879. } catch (t) {}
  5880. return i.length ? i : "string" == s ? t : t + "\0"
  5881. }
  5882. function m(t, e) {
  5883. for (var r, i = t + "", s = 0; s < i.length;) e[h & s] = h & (r ^= 19 * e[h & s]) + i.charCodeAt(s++);
  5884. return c(e)
  5885. }
  5886. function c(t) {
  5887. return String.fromCharCode.apply(0, t)
  5888. }
  5889. e.seedrandom = function(h, d, u) {
  5890. var y = [],
  5891. g = m(f((d = !0 === d ? {
  5892. entropy: !0
  5893. } : d || {}).entropy ? [h, c(t)] : null === h ? function() {
  5894. try {
  5895. r;
  5896. var e = new Uint8Array(s);
  5897. return (i.crypto || i.msCrypto).getRandomValues(e), c(e)
  5898. } catch (e) {
  5899. var a = i.navigator,
  5900. n = a && a.plugins;
  5901. return [+new Date, i, n, i.screen, c(t)]
  5902. }
  5903. }() : h, 3), y),
  5904. v = new l(y),
  5905. b = function() {
  5906. for (var t = v.g(6), e = a, r = 0; t < n;) t = (t + r) * s, e *= s, r = v.g(1);
  5907. for (; t >= o;) t /= 2, e /= 2, r >>>= 1;
  5908. return (t + r) / e
  5909. };
  5910. return b.int32 = function() {
  5911. return 0 | v.g(4)
  5912. }, b.quick = function() {
  5913. return v.g(4) / 4294967296
  5914. }, b.double = b, m(c(v.S), t), (d.pass || u || function(t, r, i, s) {
  5915. return s && (s.S && p(s, v), t.state = function() {
  5916. return p(v, {})
  5917. }), i ? (e.random = t, r) : t
  5918. })(b, g, "global" in d ? d.global : this == e, d.state)
  5919. }, m(e.random(), t)
  5920. }
  5921. function initialize$2(t) {
  5922. seedRandom([], t)
  5923. }
  5924. var propTypes = {
  5925. SHAPE: "shape"
  5926. };
  5927. function _typeof(t) {
  5928. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t) {
  5929. return typeof t
  5930. } : function(t) {
  5931. return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
  5932. }, _typeof(t)
  5933. }
  5934. var ExpressionManager = function() {
  5935. var ob = {},
  5936. Math = BMMath,
  5937. window = null,
  5938. document = null,
  5939. XMLHttpRequest = null,
  5940. fetch = null,
  5941. frames = null;
  5942. function $bm_isInstanceOfArray(t) {
  5943. return t.constructor === Array || t.constructor === Float32Array
  5944. }
  5945. function isNumerable(t, e) {
  5946. return "number" === t || "boolean" === t || "string" === t || e instanceof Number
  5947. }
  5948. function $bm_neg(t) {
  5949. var e = _typeof(t);
  5950. if ("number" === e || "boolean" === e || t instanceof Number) return -t;
  5951. if ($bm_isInstanceOfArray(t)) {
  5952. var r, i = t.length,
  5953. s = [];
  5954. for (r = 0; r < i; r += 1) s[r] = -t[r];
  5955. return s
  5956. }
  5957. return t.propType ? t.v : -t
  5958. }
  5959. initialize$2(BMMath);
  5960. var easeInBez = BezierFactory.getBezierEasing(.333, 0, .833, .833, "easeIn").get,
  5961. easeOutBez = BezierFactory.getBezierEasing(.167, .167, .667, 1, "easeOut").get,
  5962. easeInOutBez = BezierFactory.getBezierEasing(.33, 0, .667, 1, "easeInOut").get;
  5963. function sum(t, e) {
  5964. var r = _typeof(t),
  5965. i = _typeof(e);
  5966. if ("string" === r || "string" === i) return t + e;
  5967. if (isNumerable(r, t) && isNumerable(i, e)) return t + e;
  5968. if ($bm_isInstanceOfArray(t) && isNumerable(i, e)) return (t = t.slice(0))[0] += e, t;
  5969. if (isNumerable(r, t) && $bm_isInstanceOfArray(e)) return (e = e.slice(0))[0] = t + e[0], e;
  5970. if ($bm_isInstanceOfArray(t) && $bm_isInstanceOfArray(e)) {
  5971. for (var s = 0, a = t.length, n = e.length, o = []; s < a || s < n;)("number" == typeof t[s] || t[s] instanceof Number) && ("number" == typeof e[s] || e[s] instanceof Number) ? o[s] = t[s] + e[s] : o[s] = void 0 === e[s] ? t[s] : t[s] || e[s], s += 1;
  5972. return o
  5973. }
  5974. return 0
  5975. }
  5976. var add = sum;
  5977. function sub(t, e) {
  5978. var r = _typeof(t),
  5979. i = _typeof(e);
  5980. if (isNumerable(r, t) && isNumerable(i, e)) return "string" === r && (t = parseInt(t, 10)), "string" === i && (e = parseInt(e, 10)), t - e;
  5981. if ($bm_isInstanceOfArray(t) && isNumerable(i, e)) return (t = t.slice(0))[0] -= e, t;
  5982. if (isNumerable(r, t) && $bm_isInstanceOfArray(e)) return (e = e.slice(0))[0] = t - e[0], e;
  5983. if ($bm_isInstanceOfArray(t) && $bm_isInstanceOfArray(e)) {
  5984. for (var s = 0, a = t.length, n = e.length, o = []; s < a || s < n;)("number" == typeof t[s] || t[s] instanceof Number) && ("number" == typeof e[s] || e[s] instanceof Number) ? o[s] = t[s] - e[s] : o[s] = void 0 === e[s] ? t[s] : t[s] || e[s], s += 1;
  5985. return o
  5986. }
  5987. return 0
  5988. }
  5989. function mul(t, e) {
  5990. var r, i, s, a = _typeof(t),
  5991. n = _typeof(e);
  5992. if (isNumerable(a, t) && isNumerable(n, e)) return t * e;
  5993. if ($bm_isInstanceOfArray(t) && isNumerable(n, e)) {
  5994. for (s = t.length, r = createTypedArray("float32", s), i = 0; i < s; i += 1) r[i] = t[i] * e;
  5995. return r
  5996. }
  5997. if (isNumerable(a, t) && $bm_isInstanceOfArray(e)) {
  5998. for (s = e.length, r = createTypedArray("float32", s), i = 0; i < s; i += 1) r[i] = t * e[i];
  5999. return r
  6000. }
  6001. return 0
  6002. }
  6003. function div(t, e) {
  6004. var r, i, s, a = _typeof(t),
  6005. n = _typeof(e);
  6006. if (isNumerable(a, t) && isNumerable(n, e)) return t / e;
  6007. if ($bm_isInstanceOfArray(t) && isNumerable(n, e)) {
  6008. for (s = t.length, r = createTypedArray("float32", s), i = 0; i < s; i += 1) r[i] = t[i] / e;
  6009. return r
  6010. }
  6011. if (isNumerable(a, t) && $bm_isInstanceOfArray(e)) {
  6012. for (s = e.length, r = createTypedArray("float32", s), i = 0; i < s; i += 1) r[i] = t / e[i];
  6013. return r
  6014. }
  6015. return 0
  6016. }
  6017. function mod(t, e) {
  6018. return "string" == typeof t && (t = parseInt(t, 10)), "string" == typeof e && (e = parseInt(e, 10)), t % e
  6019. }
  6020. var $bm_sum = sum,
  6021. $bm_sub = sub,
  6022. $bm_mul = mul,
  6023. $bm_div = div,
  6024. $bm_mod = mod;
  6025. function clamp(t, e, r) {
  6026. if (e > r) {
  6027. var i = r;
  6028. r = e, e = i
  6029. }
  6030. return Math.min(Math.max(t, e), r)
  6031. }
  6032. function radiansToDegrees(t) {
  6033. return t / degToRads
  6034. }
  6035. var radians_to_degrees = radiansToDegrees;
  6036. function degreesToRadians(t) {
  6037. return t * degToRads
  6038. }
  6039. var degrees_to_radians = radiansToDegrees,
  6040. helperLengthArray = [0, 0, 0, 0, 0, 0];
  6041. function length(t, e) {
  6042. if ("number" == typeof t || t instanceof Number) return e = e || 0, Math.abs(t - e);
  6043. var r;
  6044. e || (e = helperLengthArray);
  6045. var i = Math.min(t.length, e.length),
  6046. s = 0;
  6047. for (r = 0; r < i; r += 1) s += Math.pow(e[r] - t[r], 2);
  6048. return Math.sqrt(s)
  6049. }
  6050. function normalize(t) {
  6051. return div(t, length(t))
  6052. }
  6053. function rgbToHsl(t) {
  6054. var e, r, i = t[0],
  6055. s = t[1],
  6056. a = t[2],
  6057. n = Math.max(i, s, a),
  6058. o = Math.min(i, s, a),
  6059. h = (n + o) / 2;
  6060. if (n === o) e = 0, r = 0;
  6061. else {
  6062. var l = n - o;
  6063. switch (r = h > .5 ? l / (2 - n - o) : l / (n + o), n) {
  6064. case i:
  6065. e = (s - a) / l + (s < a ? 6 : 0);
  6066. break;
  6067. case s:
  6068. e = (a - i) / l + 2;
  6069. break;
  6070. case a:
  6071. e = (i - s) / l + 4
  6072. }
  6073. e /= 6
  6074. }
  6075. return [e, r, h, t[3]]
  6076. }
  6077. function hue2rgb(t, e, r) {
  6078. return r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? t + 6 * (e - t) * r : r < .5 ? e : r < 2 / 3 ? t + (e - t) * (2 / 3 - r) * 6 : t
  6079. }
  6080. function hslToRgb(t) {
  6081. var e, r, i, s = t[0],
  6082. a = t[1],
  6083. n = t[2];
  6084. if (0 === a) e = n, i = n, r = n;
  6085. else {
  6086. var o = n < .5 ? n * (1 + a) : n + a - n * a,
  6087. h = 2 * n - o;
  6088. e = hue2rgb(h, o, s + 1 / 3), r = hue2rgb(h, o, s), i = hue2rgb(h, o, s - 1 / 3)
  6089. }
  6090. return [e, r, i, t[3]]
  6091. }
  6092. function linear(t, e, r, i, s) {
  6093. if (void 0 !== i && void 0 !== s || (i = e, s = r, e = 0, r = 1), r < e) {
  6094. var a = r;
  6095. r = e, e = a
  6096. }
  6097. if (t <= e) return i;
  6098. if (t >= r) return s;
  6099. var n, o = r === e ? 0 : (t - e) / (r - e);
  6100. if (!i.length) return i + (s - i) * o;
  6101. var h = i.length,
  6102. l = createTypedArray("float32", h);
  6103. for (n = 0; n < h; n += 1) l[n] = i[n] + (s[n] - i[n]) * o;
  6104. return l
  6105. }
  6106. function random(t, e) {
  6107. if (void 0 === e && (void 0 === t ? (t = 0, e = 1) : (e = t, t = void 0)), e.length) {
  6108. var r, i = e.length;
  6109. t || (t = createTypedArray("float32", i));
  6110. var s = createTypedArray("float32", i),
  6111. a = BMMath.random();
  6112. for (r = 0; r < i; r += 1) s[r] = t[r] + a * (e[r] - t[r]);
  6113. return s
  6114. }
  6115. return void 0 === t && (t = 0), t + BMMath.random() * (e - t)
  6116. }
  6117. function createPath(t, e, r, i) {
  6118. var s, a = t.length,
  6119. n = shapePool.newElement();
  6120. n.setPathData(!!i, a);
  6121. var o, h, l = [0, 0];
  6122. for (s = 0; s < a; s += 1) o = e && e[s] ? e[s] : l, h = r && r[s] ? r[s] : l, n.setTripleAt(t[s][0], t[s][1], h[0] + t[s][0], h[1] + t[s][1], o[0] + t[s][0], o[1] + t[s][1], s, !0);
  6123. return n
  6124. }
  6125. function initiateExpression(elem, data, property) {
  6126. var val = data.x,
  6127. needsVelocity = /velocity(?![\w\d])/.test(val),
  6128. _needsRandom = -1 !== val.indexOf("random"),
  6129. elemType = elem.data.ty,
  6130. transform, $bm_transform, content, effect, thisProperty = property;
  6131. thisProperty.valueAtTime = thisProperty.getValueAtTime, Object.defineProperty(thisProperty, "value", {
  6132. get: function() {
  6133. return thisProperty.v
  6134. }
  6135. }), elem.comp.frameDuration = 1 / elem.comp.globalData.frameRate, elem.comp.displayStartTime = 0;
  6136. var inPoint = elem.data.ip / elem.comp.globalData.frameRate,
  6137. outPoint = elem.data.op / elem.comp.globalData.frameRate,
  6138. width = elem.data.sw ? elem.data.sw : 0,
  6139. height = elem.data.sh ? elem.data.sh : 0,
  6140. name = elem.data.nm,
  6141. loopIn, loop_in, loopOut, loop_out, smooth, toWorld, fromWorld, fromComp, toComp, fromCompToSurface, position, rotation, anchorPoint, scale, thisLayer, thisComp, mask, valueAtTime, velocityAtTime, scoped_bm_rt, expression_function = eval("[function _expression_function(){" + val + ";scoped_bm_rt=$bm_rt}]")[0],
  6142. numKeys = property.kf ? data.k.length : 0,
  6143. active = !this.data || !0 !== this.data.hd,
  6144. wiggle = function(t, e) {
  6145. var r, i, s = this.pv.length ? this.pv.length : 1,
  6146. a = createTypedArray("float32", s);
  6147. var n = Math.floor(5 * time);
  6148. for (r = 0, i = 0; r < n;) {
  6149. for (i = 0; i < s; i += 1) a[i] += -e + 2 * e * BMMath.random();
  6150. r += 1
  6151. }
  6152. var o = 5 * time,
  6153. h = o - Math.floor(o),
  6154. l = createTypedArray("float32", s);
  6155. if (s > 1) {
  6156. for (i = 0; i < s; i += 1) l[i] = this.pv[i] + a[i] + (-e + 2 * e * BMMath.random()) * h;
  6157. return l
  6158. }
  6159. return this.pv + a[0] + (-e + 2 * e * BMMath.random()) * h
  6160. }.bind(this);
  6161. function loopInDuration(t, e) {
  6162. return loopIn(t, e, !0)
  6163. }
  6164. function loopOutDuration(t, e) {
  6165. return loopOut(t, e, !0)
  6166. }
  6167. thisProperty.loopIn && (loopIn = thisProperty.loopIn.bind(thisProperty), loop_in = loopIn), thisProperty.loopOut && (loopOut = thisProperty.loopOut.bind(thisProperty), loop_out = loopOut), thisProperty.smooth && (smooth = thisProperty.smooth.bind(thisProperty)), this.getValueAtTime && (valueAtTime = this.getValueAtTime.bind(this)), this.getVelocityAtTime && (velocityAtTime = this.getVelocityAtTime.bind(this));
  6168. var comp = elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface),
  6169. time, velocity, value, text, textIndex, textTotal, selectorValue;
  6170. function lookAt(t, e) {
  6171. var r = [e[0] - t[0], e[1] - t[1], e[2] - t[2]],
  6172. i = Math.atan2(r[0], Math.sqrt(r[1] * r[1] + r[2] * r[2])) / degToRads;
  6173. return [-Math.atan2(r[1], r[2]) / degToRads, i, 0]
  6174. }
  6175. function easeOut(t, e, r, i, s) {
  6176. return applyEase(easeOutBez, t, e, r, i, s)
  6177. }
  6178. function easeIn(t, e, r, i, s) {
  6179. return applyEase(easeInBez, t, e, r, i, s)
  6180. }
  6181. function ease(t, e, r, i, s) {
  6182. return applyEase(easeInOutBez, t, e, r, i, s)
  6183. }
  6184. function applyEase(t, e, r, i, s, a) {
  6185. void 0 === s ? (s = r, a = i) : e = (e - r) / (i - r), e > 1 ? e = 1 : e < 0 && (e = 0);
  6186. var n = t(e);
  6187. if ($bm_isInstanceOfArray(s)) {
  6188. var o, h = s.length,
  6189. l = createTypedArray("float32", h);
  6190. for (o = 0; o < h; o += 1) l[o] = (a[o] - s[o]) * n + s[o];
  6191. return l
  6192. }
  6193. return (a - s) * n + s
  6194. }
  6195. function nearestKey(t) {
  6196. var e, r, i, s = data.k.length;
  6197. if (data.k.length && "number" != typeof data.k[0])
  6198. if (r = -1, (t *= elem.comp.globalData.frameRate) < data.k[0].t) r = 1, i = data.k[0].t;
  6199. else {
  6200. for (e = 0; e < s - 1; e += 1) {
  6201. if (t === data.k[e].t) {
  6202. r = e + 1, i = data.k[e].t;
  6203. break
  6204. }
  6205. if (t > data.k[e].t && t < data.k[e + 1].t) {
  6206. t - data.k[e].t > data.k[e + 1].t - t ? (r = e + 2, i = data.k[e + 1].t) : (r = e + 1, i = data.k[e].t);
  6207. break
  6208. }
  6209. } - 1 === r && (r = e + 1, i = data.k[e].t)
  6210. }
  6211. else r = 0, i = 0;
  6212. var a = {};
  6213. return a.index = r, a.time = i / elem.comp.globalData.frameRate, a
  6214. }
  6215. function key(t) {
  6216. var e, r, i;
  6217. if (!data.k.length || "number" == typeof data.k[0]) throw new Error("The property has no keyframe at index " + t);
  6218. t -= 1, e = {
  6219. time: data.k[t].t / elem.comp.globalData.frameRate,
  6220. value: []
  6221. };
  6222. var s = Object.prototype.hasOwnProperty.call(data.k[t], "s") ? data.k[t].s : data.k[t - 1].e;
  6223. for (i = s.length, r = 0; r < i; r += 1) e[r] = s[r], e.value[r] = s[r];
  6224. return e
  6225. }
  6226. function framesToTime(t, e) {
  6227. return e || (e = elem.comp.globalData.frameRate), t / e
  6228. }
  6229. function timeToFrames(t, e) {
  6230. return t || 0 === t || (t = time), e || (e = elem.comp.globalData.frameRate), t * e
  6231. }
  6232. function seedRandom(t) {
  6233. BMMath.seedrandom(randSeed + t)
  6234. }
  6235. function sourceRectAtTime() {
  6236. return elem.sourceRectAtTime()
  6237. }
  6238. function substring(t, e) {
  6239. return "string" == typeof value ? void 0 === e ? value.substring(t) : value.substring(t, e) : ""
  6240. }
  6241. function substr(t, e) {
  6242. return "string" == typeof value ? void 0 === e ? value.substr(t) : value.substr(t, e) : ""
  6243. }
  6244. function posterizeTime(t) {
  6245. time = 0 === t ? 0 : Math.floor(time * t) / t, value = valueAtTime(time)
  6246. }
  6247. var index = elem.data.ind,
  6248. hasParent = !(!elem.hierarchy || !elem.hierarchy.length),
  6249. parent, randSeed = Math.floor(1e6 * Math.random()),
  6250. globalData = elem.globalData;
  6251. function executeExpression(t) {
  6252. return value = t, this.frameExpressionId === elem.globalData.frameId && "textSelector" !== this.propType ? value : ("textSelector" === this.propType && (textIndex = this.textIndex, textTotal = this.textTotal, selectorValue = this.selectorValue), thisLayer || (text = elem.layerInterface.text, thisLayer = elem.layerInterface, thisComp = elem.comp.compInterface, toWorld = thisLayer.toWorld.bind(thisLayer), fromWorld = thisLayer.fromWorld.bind(thisLayer), fromComp = thisLayer.fromComp.bind(thisLayer), toComp = thisLayer.toComp.bind(thisLayer), mask = thisLayer.mask ? thisLayer.mask.bind(thisLayer) : null, fromCompToSurface = fromComp), transform || (transform = elem.layerInterface("ADBE Transform Group"), $bm_transform = transform, transform && (anchorPoint = transform.anchorPoint)), 4 !== elemType || content || (content = thisLayer("ADBE Root Vectors Group")), effect || (effect = thisLayer(4)), (hasParent = !(!elem.hierarchy || !elem.hierarchy.length)) && !parent && (parent = elem.hierarchy[0].layerInterface), time = this.comp.renderedFrame / this.comp.globalData.frameRate, _needsRandom && seedRandom(randSeed + time), needsVelocity && (velocity = velocityAtTime(time)), expression_function(), this.frameExpressionId = elem.globalData.frameId, scoped_bm_rt = scoped_bm_rt.propType === propTypes.SHAPE ? scoped_bm_rt.v : scoped_bm_rt)
  6253. }
  6254. return executeExpression.__preventDeadCodeRemoval = [$bm_transform, anchorPoint, time, velocity, inPoint, outPoint, width, height, name, loop_in, loop_out, smooth, toComp, fromCompToSurface, toWorld, fromWorld, mask, position, rotation, scale, thisComp, numKeys, active, wiggle, loopInDuration, loopOutDuration, comp, lookAt, easeOut, easeIn, ease, nearestKey, key, text, textIndex, textTotal, selectorValue, framesToTime, timeToFrames, sourceRectAtTime, substring, substr, posterizeTime, index, globalData], executeExpression
  6255. }
  6256. return ob.initiateExpression = initiateExpression, ob.__preventDeadCodeRemoval = [window, document, XMLHttpRequest, fetch, frames, $bm_neg, add, $bm_sum, $bm_sub, $bm_mul, $bm_div, $bm_mod, clamp, radians_to_degrees, degreesToRadians, degrees_to_radians, normalize, rgbToHsl, hslToRgb, linear, random, createPath], ob
  6257. }(),
  6258. expressionHelpers = {
  6259. searchExpressions: function(t, e, r) {
  6260. e.x && (r.k = !0, r.x = !0, r.initiateExpression = ExpressionManager.initiateExpression, r.effectsSequence.push(r.initiateExpression(t, e, r).bind(r)))
  6261. },
  6262. getSpeedAtTime: function(t) {
  6263. var e = this.getValueAtTime(t),
  6264. r = this.getValueAtTime(t + -.01),
  6265. i = 0;
  6266. if (e.length) {
  6267. var s;
  6268. for (s = 0; s < e.length; s += 1) i += Math.pow(r[s] - e[s], 2);
  6269. i = 100 * Math.sqrt(i)
  6270. } else i = 0;
  6271. return i
  6272. },
  6273. getVelocityAtTime: function(t) {
  6274. if (void 0 !== this.vel) return this.vel;
  6275. var e, r, i = -.001,
  6276. s = this.getValueAtTime(t),
  6277. a = this.getValueAtTime(t + i);
  6278. if (s.length)
  6279. for (e = createTypedArray("float32", s.length), r = 0; r < s.length; r += 1) e[r] = (a[r] - s[r]) / i;
  6280. else e = (a - s) / i;
  6281. return e
  6282. },
  6283. getValueAtTime: function(t) {
  6284. return t *= this.elem.globalData.frameRate, (t -= this.offsetTime) !== this._cachingAtTime.lastFrame && (this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < t ? this._cachingAtTime.lastIndex : 0, this._cachingAtTime.value = this.interpolateValue(t, this._cachingAtTime), this._cachingAtTime.lastFrame = t), this._cachingAtTime.value
  6285. },
  6286. getStaticValueAtTime: function() {
  6287. return this.pv
  6288. },
  6289. setGroupProperty: function(t) {
  6290. this.propertyGroup = t
  6291. }
  6292. };
  6293. function addPropertyDecorator() {
  6294. function t(t, e, r) {
  6295. if (!this.k || !this.keyframes) return this.pv;
  6296. t = t ? t.toLowerCase() : "";
  6297. var i, s, a, n, o, h = this.comp.renderedFrame,
  6298. l = this.keyframes,
  6299. p = l[l.length - 1].t;
  6300. if (h <= p) return this.pv;
  6301. if (r ? s = p - (i = e ? Math.abs(p - this.elem.comp.globalData.frameRate * e) : Math.max(0, p - this.elem.data.ip)) : ((!e || e > l.length - 1) && (e = l.length - 1), i = p - (s = l[l.length - 1 - e].t)), "pingpong" === t) {
  6302. if (Math.floor((h - s) / i) % 2 != 0) return this.getValueAtTime((i - (h - s) % i + s) / this.comp.globalData.frameRate, 0)
  6303. } else {
  6304. if ("offset" === t) {
  6305. var f = this.getValueAtTime(s / this.comp.globalData.frameRate, 0),
  6306. m = this.getValueAtTime(p / this.comp.globalData.frameRate, 0),
  6307. c = this.getValueAtTime(((h - s) % i + s) / this.comp.globalData.frameRate, 0),
  6308. d = Math.floor((h - s) / i);
  6309. if (this.pv.length) {
  6310. for (n = (o = new Array(f.length)).length, a = 0; a < n; a += 1) o[a] = (m[a] - f[a]) * d + c[a];
  6311. return o
  6312. }
  6313. return (m - f) * d + c
  6314. }
  6315. if ("continue" === t) {
  6316. var u = this.getValueAtTime(p / this.comp.globalData.frameRate, 0),
  6317. y = this.getValueAtTime((p - .001) / this.comp.globalData.frameRate, 0);
  6318. if (this.pv.length) {
  6319. for (n = (o = new Array(u.length)).length, a = 0; a < n; a += 1) o[a] = u[a] + (u[a] - y[a]) * ((h - p) / this.comp.globalData.frameRate) / 5e-4;
  6320. return o
  6321. }
  6322. return u + (h - p) / .001 * (u - y)
  6323. }
  6324. }
  6325. return this.getValueAtTime(((h - s) % i + s) / this.comp.globalData.frameRate, 0)
  6326. }
  6327. function e(t, e, r) {
  6328. if (!this.k) return this.pv;
  6329. t = t ? t.toLowerCase() : "";
  6330. var i, s, a, n, o, h = this.comp.renderedFrame,
  6331. l = this.keyframes,
  6332. p = l[0].t;
  6333. if (h >= p) return this.pv;
  6334. if (r ? s = p + (i = e ? Math.abs(this.elem.comp.globalData.frameRate * e) : Math.max(0, this.elem.data.op - p)) : ((!e || e > l.length - 1) && (e = l.length - 1), i = (s = l[e].t) - p), "pingpong" === t) {
  6335. if (Math.floor((p - h) / i) % 2 == 0) return this.getValueAtTime(((p - h) % i + p) / this.comp.globalData.frameRate, 0)
  6336. } else {
  6337. if ("offset" === t) {
  6338. var f = this.getValueAtTime(p / this.comp.globalData.frameRate, 0),
  6339. m = this.getValueAtTime(s / this.comp.globalData.frameRate, 0),
  6340. c = this.getValueAtTime((i - (p - h) % i + p) / this.comp.globalData.frameRate, 0),
  6341. d = Math.floor((p - h) / i) + 1;
  6342. if (this.pv.length) {
  6343. for (n = (o = new Array(f.length)).length, a = 0; a < n; a += 1) o[a] = c[a] - (m[a] - f[a]) * d;
  6344. return o
  6345. }
  6346. return c - (m - f) * d
  6347. }
  6348. if ("continue" === t) {
  6349. var u = this.getValueAtTime(p / this.comp.globalData.frameRate, 0),
  6350. y = this.getValueAtTime((p + .001) / this.comp.globalData.frameRate, 0);
  6351. if (this.pv.length) {
  6352. for (n = (o = new Array(u.length)).length, a = 0; a < n; a += 1) o[a] = u[a] + (u[a] - y[a]) * (p - h) / .001;
  6353. return o
  6354. }
  6355. return u + (u - y) * (p - h) / .001
  6356. }
  6357. }
  6358. return this.getValueAtTime((i - ((p - h) % i + p)) / this.comp.globalData.frameRate, 0)
  6359. }
  6360. function r(t, e) {
  6361. if (!this.k) return this.pv;
  6362. if (t = .5 * (t || .4), (e = Math.floor(e || 5)) <= 1) return this.pv;
  6363. var r, i, s = this.comp.renderedFrame / this.comp.globalData.frameRate,
  6364. a = s - t,
  6365. n = e > 1 ? (s + t - a) / (e - 1) : 1,
  6366. o = 0,
  6367. h = 0;
  6368. for (r = this.pv.length ? createTypedArray("float32", this.pv.length) : 0; o < e;) {
  6369. if (i = this.getValueAtTime(a + o * n), this.pv.length)
  6370. for (h = 0; h < this.pv.length; h += 1) r[h] += i[h];
  6371. else r += i;
  6372. o += 1
  6373. }
  6374. if (this.pv.length)
  6375. for (h = 0; h < this.pv.length; h += 1) r[h] /= e;
  6376. else r /= e;
  6377. return r
  6378. }
  6379. function i(t) {
  6380. this._transformCachingAtTime || (this._transformCachingAtTime = {
  6381. v: new Matrix
  6382. });
  6383. var e = this._transformCachingAtTime.v;
  6384. if (e.cloneFromProps(this.pre.props), this.appliedTransformations < 1) {
  6385. var r = this.a.getValueAtTime(t);
  6386. e.translate(-r[0] * this.a.mult, -r[1] * this.a.mult, r[2] * this.a.mult)
  6387. }
  6388. if (this.appliedTransformations < 2) {
  6389. var i = this.s.getValueAtTime(t);
  6390. e.scale(i[0] * this.s.mult, i[1] * this.s.mult, i[2] * this.s.mult)
  6391. }
  6392. if (this.sk && this.appliedTransformations < 3) {
  6393. var s = this.sk.getValueAtTime(t),
  6394. a = this.sa.getValueAtTime(t);
  6395. e.skewFromAxis(-s * this.sk.mult, a * this.sa.mult)
  6396. }
  6397. if (this.r && this.appliedTransformations < 4) {
  6398. var n = this.r.getValueAtTime(t);
  6399. e.rotate(-n * this.r.mult)
  6400. } else if (!this.r && this.appliedTransformations < 4) {
  6401. var o = this.rz.getValueAtTime(t),
  6402. h = this.ry.getValueAtTime(t),
  6403. l = this.rx.getValueAtTime(t),
  6404. p = this.or.getValueAtTime(t);
  6405. e.rotateZ(-o * this.rz.mult).rotateY(h * this.ry.mult).rotateX(l * this.rx.mult).rotateZ(-p[2] * this.or.mult).rotateY(p[1] * this.or.mult).rotateX(p[0] * this.or.mult)
  6406. }
  6407. if (this.data.p && this.data.p.s) {
  6408. var f = this.px.getValueAtTime(t),
  6409. m = this.py.getValueAtTime(t);
  6410. if (this.data.p.z) {
  6411. var c = this.pz.getValueAtTime(t);
  6412. e.translate(f * this.px.mult, m * this.py.mult, -c * this.pz.mult)
  6413. } else e.translate(f * this.px.mult, m * this.py.mult, 0)
  6414. } else {
  6415. var d = this.p.getValueAtTime(t);
  6416. e.translate(d[0] * this.p.mult, d[1] * this.p.mult, -d[2] * this.p.mult)
  6417. }
  6418. return e
  6419. }
  6420. function s() {
  6421. return this.v.clone(new Matrix)
  6422. }
  6423. var a = TransformPropertyFactory.getTransformProperty;
  6424. TransformPropertyFactory.getTransformProperty = function(t, e, r) {
  6425. var n = a(t, e, r);
  6426. return n.dynamicProperties.length ? n.getValueAtTime = i.bind(n) : n.getValueAtTime = s.bind(n), n.setGroupProperty = expressionHelpers.setGroupProperty, n
  6427. };
  6428. var n = PropertyFactory.getProp;
  6429. PropertyFactory.getProp = function(i, s, a, o, h) {
  6430. var l = n(i, s, a, o, h);
  6431. l.kf ? l.getValueAtTime = expressionHelpers.getValueAtTime.bind(l) : l.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(l), l.setGroupProperty = expressionHelpers.setGroupProperty, l.loopOut = t, l.loopIn = e, l.smooth = r, l.getVelocityAtTime = expressionHelpers.getVelocityAtTime.bind(l), l.getSpeedAtTime = expressionHelpers.getSpeedAtTime.bind(l), l.numKeys = 1 === s.a ? s.k.length : 0, l.propertyIndex = s.ix;
  6432. var p = 0;
  6433. return 0 !== a && (p = createTypedArray("float32", 1 === s.a ? s.k[0].s.length : s.k.length)), l._cachingAtTime = {
  6434. lastFrame: initialDefaultFrame,
  6435. lastIndex: 0,
  6436. value: p
  6437. }, expressionHelpers.searchExpressions(i, s, l), l.k && h.addDynamicProperty(l), l
  6438. };
  6439. var o = ShapePropertyFactory.getConstructorFunction(),
  6440. h = ShapePropertyFactory.getKeyframedConstructorFunction();
  6441. function l() {}
  6442. l.prototype = {
  6443. vertices: function(t, e) {
  6444. this.k && this.getValue();
  6445. var r, i = this.v;
  6446. void 0 !== e && (i = this.getValueAtTime(e, 0));
  6447. var s = i._length,
  6448. a = i[t],
  6449. n = i.v,
  6450. o = createSizedArray(s);
  6451. for (r = 0; r < s; r += 1) o[r] = "i" === t || "o" === t ? [a[r][0] - n[r][0], a[r][1] - n[r][1]] : [a[r][0], a[r][1]];
  6452. return o
  6453. },
  6454. points: function(t) {
  6455. return this.vertices("v", t)
  6456. },
  6457. inTangents: function(t) {
  6458. return this.vertices("i", t)
  6459. },
  6460. outTangents: function(t) {
  6461. return this.vertices("o", t)
  6462. },
  6463. isClosed: function() {
  6464. return this.v.c
  6465. },
  6466. pointOnPath: function(t, e) {
  6467. var r = this.v;
  6468. void 0 !== e && (r = this.getValueAtTime(e, 0)), this._segmentsLength || (this._segmentsLength = bez.getSegmentsLength(r));
  6469. for (var i, s = this._segmentsLength, a = s.lengths, n = s.totalLength * t, o = 0, h = a.length, l = 0; o < h;) {
  6470. if (l + a[o].addedLength > n) {
  6471. var p = o,
  6472. f = r.c && o === h - 1 ? 0 : o + 1,
  6473. m = (n - l) / a[o].addedLength;
  6474. i = bez.getPointInSegment(r.v[p], r.v[f], r.o[p], r.i[f], m, a[o]);
  6475. break
  6476. }
  6477. l += a[o].addedLength, o += 1
  6478. }
  6479. return i || (i = r.c ? [r.v[0][0], r.v[0][1]] : [r.v[r._length - 1][0], r.v[r._length - 1][1]]), i
  6480. },
  6481. vectorOnPath: function(t, e, r) {
  6482. 1 == t ? t = this.v.c : 0 == t && (t = .999);
  6483. var i = this.pointOnPath(t, e),
  6484. s = this.pointOnPath(t + .001, e),
  6485. a = s[0] - i[0],
  6486. n = s[1] - i[1],
  6487. o = Math.sqrt(Math.pow(a, 2) + Math.pow(n, 2));
  6488. return 0 === o ? [0, 0] : "tangent" === r ? [a / o, n / o] : [-n / o, a / o]
  6489. },
  6490. tangentOnPath: function(t, e) {
  6491. return this.vectorOnPath(t, e, "tangent")
  6492. },
  6493. normalOnPath: function(t, e) {
  6494. return this.vectorOnPath(t, e, "normal")
  6495. },
  6496. setGroupProperty: expressionHelpers.setGroupProperty,
  6497. getValueAtTime: expressionHelpers.getStaticValueAtTime
  6498. }, extendPrototype([l], o), extendPrototype([l], h), h.prototype.getValueAtTime = function(t) {
  6499. return this._cachingAtTime || (this._cachingAtTime = {
  6500. shapeValue: shapePool.clone(this.pv),
  6501. lastIndex: 0,
  6502. lastTime: initialDefaultFrame
  6503. }), t *= this.elem.globalData.frameRate, (t -= this.offsetTime) !== this._cachingAtTime.lastTime && (this._cachingAtTime.lastIndex = this._cachingAtTime.lastTime < t ? this._caching.lastIndex : 0, this._cachingAtTime.lastTime = t, this.interpolateShape(t, this._cachingAtTime.shapeValue, this._cachingAtTime)), this._cachingAtTime.shapeValue
  6504. }, h.prototype.initiateExpression = ExpressionManager.initiateExpression;
  6505. var p = ShapePropertyFactory.getShapeProp;
  6506. ShapePropertyFactory.getShapeProp = function(t, e, r, i, s) {
  6507. var a = p(t, e, r, i, s);
  6508. return a.propertyIndex = e.ix, a.lock = !1, 3 === r ? expressionHelpers.searchExpressions(t, e.pt, a) : 4 === r && expressionHelpers.searchExpressions(t, e.ks, a), a.k && t.addDynamicProperty(a), a
  6509. }
  6510. }
  6511. function initialize$1() {
  6512. addPropertyDecorator()
  6513. }
  6514. function addDecorator() {
  6515. TextProperty.prototype.getExpressionValue = function(t, e) {
  6516. var r = this.calculateExpression(e);
  6517. if (t.t !== r) {
  6518. var i = {};
  6519. return this.copyData(i, t), i.t = r.toString(), i.__complete = !1, i
  6520. }
  6521. return t
  6522. }, TextProperty.prototype.searchProperty = function() {
  6523. var t = this.searchKeyframes(),
  6524. e = this.searchExpressions();
  6525. return this.kf = t || e, this.kf
  6526. }, TextProperty.prototype.searchExpressions = function() {
  6527. return this.data.d.x ? (this.calculateExpression = ExpressionManager.initiateExpression.bind(this)(this.elem, this.data.d, this), this.addEffect(this.getExpressionValue.bind(this)), !0) : null
  6528. }
  6529. }
  6530. function initialize() {
  6531. addDecorator()
  6532. }
  6533. function SVGComposableEffect() {}
  6534. function SVGTintFilter(t, e, r, i, s) {
  6535. this.filterManager = e;
  6536. var a = createNS("feColorMatrix");
  6537. a.setAttribute("type", "matrix"), a.setAttribute("color-interpolation-filters", "linearRGB"), a.setAttribute("values", "0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"), a.setAttribute("result", i + "_tint_1"), t.appendChild(a), (a = createNS("feColorMatrix")).setAttribute("type", "matrix"), a.setAttribute("color-interpolation-filters", "sRGB"), a.setAttribute("values", "1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"), a.setAttribute("result", i + "_tint_2"), t.appendChild(a), this.matrixFilter = a;
  6538. var n = this.createMergeNode(i, [s, i + "_tint_1", i + "_tint_2"]);
  6539. t.appendChild(n)
  6540. }
  6541. function SVGFillFilter(t, e, r, i) {
  6542. this.filterManager = e;
  6543. var s = createNS("feColorMatrix");
  6544. s.setAttribute("type", "matrix"), s.setAttribute("color-interpolation-filters", "sRGB"), s.setAttribute("values", "1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"), s.setAttribute("result", i), t.appendChild(s), this.matrixFilter = s
  6545. }
  6546. function SVGStrokeEffect(t, e, r) {
  6547. this.initialized = !1, this.filterManager = e, this.elem = r, this.paths = []
  6548. }
  6549. function SVGTritoneFilter(t, e, r, i) {
  6550. this.filterManager = e;
  6551. var s = createNS("feColorMatrix");
  6552. s.setAttribute("type", "matrix"), s.setAttribute("color-interpolation-filters", "linearRGB"), s.setAttribute("values", "0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"), t.appendChild(s);
  6553. var a = createNS("feComponentTransfer");
  6554. a.setAttribute("color-interpolation-filters", "sRGB"), a.setAttribute("result", i), this.matrixFilter = a;
  6555. var n = createNS("feFuncR");
  6556. n.setAttribute("type", "table"), a.appendChild(n), this.feFuncR = n;
  6557. var o = createNS("feFuncG");
  6558. o.setAttribute("type", "table"), a.appendChild(o), this.feFuncG = o;
  6559. var h = createNS("feFuncB");
  6560. h.setAttribute("type", "table"), a.appendChild(h), this.feFuncB = h, t.appendChild(a)
  6561. }
  6562. function SVGProLevelsFilter(t, e, r, i) {
  6563. this.filterManager = e;
  6564. var s = this.filterManager.effectElements,
  6565. a = createNS("feComponentTransfer");
  6566. (s[10].p.k || 0 !== s[10].p.v || s[11].p.k || 1 !== s[11].p.v || s[12].p.k || 1 !== s[12].p.v || s[13].p.k || 0 !== s[13].p.v || s[14].p.k || 1 !== s[14].p.v) && (this.feFuncR = this.createFeFunc("feFuncR", a)), (s[17].p.k || 0 !== s[17].p.v || s[18].p.k || 1 !== s[18].p.v || s[19].p.k || 1 !== s[19].p.v || s[20].p.k || 0 !== s[20].p.v || s[21].p.k || 1 !== s[21].p.v) && (this.feFuncG = this.createFeFunc("feFuncG", a)), (s[24].p.k || 0 !== s[24].p.v || s[25].p.k || 1 !== s[25].p.v || s[26].p.k || 1 !== s[26].p.v || s[27].p.k || 0 !== s[27].p.v || s[28].p.k || 1 !== s[28].p.v) && (this.feFuncB = this.createFeFunc("feFuncB", a)), (s[31].p.k || 0 !== s[31].p.v || s[32].p.k || 1 !== s[32].p.v || s[33].p.k || 1 !== s[33].p.v || s[34].p.k || 0 !== s[34].p.v || s[35].p.k || 1 !== s[35].p.v) && (this.feFuncA = this.createFeFunc("feFuncA", a)), (this.feFuncR || this.feFuncG || this.feFuncB || this.feFuncA) && (a.setAttribute("color-interpolation-filters", "sRGB"), t.appendChild(a)), (s[3].p.k || 0 !== s[3].p.v || s[4].p.k || 1 !== s[4].p.v || s[5].p.k || 1 !== s[5].p.v || s[6].p.k || 0 !== s[6].p.v || s[7].p.k || 1 !== s[7].p.v) && ((a = createNS("feComponentTransfer")).setAttribute("color-interpolation-filters", "sRGB"), a.setAttribute("result", i), t.appendChild(a), this.feFuncRComposed = this.createFeFunc("feFuncR", a), this.feFuncGComposed = this.createFeFunc("feFuncG", a), this.feFuncBComposed = this.createFeFunc("feFuncB", a))
  6567. }
  6568. function SVGDropShadowEffect(t, e, r, i, s) {
  6569. var a = e.container.globalData.renderConfig.filterSize;
  6570. t.setAttribute("x", a.x), t.setAttribute("y", a.y), t.setAttribute("width", a.width), t.setAttribute("height", a.height), this.filterManager = e;
  6571. var n = createNS("feGaussianBlur");
  6572. n.setAttribute("in", "SourceAlpha"), n.setAttribute("result", i + "_drop_shadow_1"), n.setAttribute("stdDeviation", "0"), this.feGaussianBlur = n, t.appendChild(n);
  6573. var o = createNS("feOffset");
  6574. o.setAttribute("dx", "25"), o.setAttribute("dy", "0"), o.setAttribute("in", i + "_drop_shadow_1"), o.setAttribute("result", i + "_drop_shadow_2"), this.feOffset = o, t.appendChild(o);
  6575. var h = createNS("feFlood");
  6576. h.setAttribute("flood-color", "#00ff00"), h.setAttribute("flood-opacity", "1"), h.setAttribute("result", i + "_drop_shadow_3"), this.feFlood = h, t.appendChild(h);
  6577. var l = createNS("feComposite");
  6578. l.setAttribute("in", i + "_drop_shadow_3"), l.setAttribute("in2", i + "_drop_shadow_2"), l.setAttribute("operator", "in"), l.setAttribute("result", i + "_drop_shadow_4"), t.appendChild(l);
  6579. var p = this.createMergeNode(i, [i + "_drop_shadow_4", s]);
  6580. t.appendChild(p)
  6581. }
  6582. SVGComposableEffect.prototype = {
  6583. createMergeNode: function(t, e) {
  6584. var r, i, s = createNS("feMerge");
  6585. for (s.setAttribute("result", t), i = 0; i < e.length; i += 1)(r = createNS("feMergeNode")).setAttribute("in", e[i]), s.appendChild(r), s.appendChild(r);
  6586. return s
  6587. }
  6588. }, extendPrototype([SVGComposableEffect], SVGTintFilter), SVGTintFilter.prototype.renderFrame = function(t) {
  6589. if (t || this.filterManager._mdf) {
  6590. var e = this.filterManager.effectElements[0].p.v,
  6591. r = this.filterManager.effectElements[1].p.v,
  6592. i = this.filterManager.effectElements[2].p.v / 100;
  6593. this.matrixFilter.setAttribute("values", r[0] - e[0] + " 0 0 0 " + e[0] + " " + (r[1] - e[1]) + " 0 0 0 " + e[1] + " " + (r[2] - e[2]) + " 0 0 0 " + e[2] + " 0 0 0 " + i + " 0")
  6594. }
  6595. }, SVGFillFilter.prototype.renderFrame = function(t) {
  6596. if (t || this.filterManager._mdf) {
  6597. var e = this.filterManager.effectElements[2].p.v,
  6598. r = this.filterManager.effectElements[6].p.v;
  6599. this.matrixFilter.setAttribute("values", "0 0 0 0 " + e[0] + " 0 0 0 0 " + e[1] + " 0 0 0 0 " + e[2] + " 0 0 0 " + r + " 0")
  6600. }
  6601. }, SVGStrokeEffect.prototype.initialize = function() {
  6602. var t, e, r, i, s = this.elem.layerElement.children || this.elem.layerElement.childNodes;
  6603. for (1 === this.filterManager.effectElements[1].p.v ? (i = this.elem.maskManager.masksProperties.length, r = 0) : i = (r = this.filterManager.effectElements[0].p.v - 1) + 1, (e = createNS("g")).setAttribute("fill", "none"), e.setAttribute("stroke-linecap", "round"), e.setAttribute("stroke-dashoffset", 1); r < i; r += 1) t = createNS("path"), e.appendChild(t), this.paths.push({
  6604. p: t,
  6605. m: r
  6606. });
  6607. if (3 === this.filterManager.effectElements[10].p.v) {
  6608. var a = createNS("mask"),
  6609. n = createElementID();
  6610. a.setAttribute("id", n), a.setAttribute("mask-type", "alpha"), a.appendChild(e), this.elem.globalData.defs.appendChild(a);
  6611. var o = createNS("g");
  6612. for (o.setAttribute("mask", "url(" + getLocationHref() + "#" + n + ")"); s[0];) o.appendChild(s[0]);
  6613. this.elem.layerElement.appendChild(o), this.masker = a, e.setAttribute("stroke", "#fff")
  6614. } else if (1 === this.filterManager.effectElements[10].p.v || 2 === this.filterManager.effectElements[10].p.v) {
  6615. if (2 === this.filterManager.effectElements[10].p.v)
  6616. for (s = this.elem.layerElement.children || this.elem.layerElement.childNodes; s.length;) this.elem.layerElement.removeChild(s[0]);
  6617. this.elem.layerElement.appendChild(e), this.elem.layerElement.removeAttribute("mask"), e.setAttribute("stroke", "#fff")
  6618. }
  6619. this.initialized = !0, this.pathMasker = e
  6620. }, SVGStrokeEffect.prototype.renderFrame = function(t) {
  6621. var e;
  6622. this.initialized || this.initialize();
  6623. var r, i, s = this.paths.length;
  6624. for (e = 0; e < s; e += 1)
  6625. if (-1 !== this.paths[e].m && (r = this.elem.maskManager.viewData[this.paths[e].m], i = this.paths[e].p, (t || this.filterManager._mdf || r.prop._mdf) && i.setAttribute("d", r.lastPath), t || this.filterManager.effectElements[9].p._mdf || this.filterManager.effectElements[4].p._mdf || this.filterManager.effectElements[7].p._mdf || this.filterManager.effectElements[8].p._mdf || r.prop._mdf)) {
  6626. var a;
  6627. if (0 !== this.filterManager.effectElements[7].p.v || 100 !== this.filterManager.effectElements[8].p.v) {
  6628. var n = .01 * Math.min(this.filterManager.effectElements[7].p.v, this.filterManager.effectElements[8].p.v),
  6629. o = .01 * Math.max(this.filterManager.effectElements[7].p.v, this.filterManager.effectElements[8].p.v),
  6630. h = i.getTotalLength();
  6631. a = "0 0 0 " + h * n + " ";
  6632. var l, p = h * (o - n),
  6633. f = 1 + 2 * this.filterManager.effectElements[4].p.v * this.filterManager.effectElements[9].p.v * .01,
  6634. m = Math.floor(p / f);
  6635. for (l = 0; l < m; l += 1) a += "1 " + 2 * this.filterManager.effectElements[4].p.v * this.filterManager.effectElements[9].p.v * .01 + " ";
  6636. a += "0 " + 10 * h + " 0 0"
  6637. } else a = "1 " + 2 * this.filterManager.effectElements[4].p.v * this.filterManager.effectElements[9].p.v * .01;
  6638. i.setAttribute("stroke-dasharray", a)
  6639. }
  6640. if ((t || this.filterManager.effectElements[4].p._mdf) && this.pathMasker.setAttribute("stroke-width", 2 * this.filterManager.effectElements[4].p.v), (t || this.filterManager.effectElements[6].p._mdf) && this.pathMasker.setAttribute("opacity", this.filterManager.effectElements[6].p.v), (1 === this.filterManager.effectElements[10].p.v || 2 === this.filterManager.effectElements[10].p.v) && (t || this.filterManager.effectElements[3].p._mdf)) {
  6641. var c = this.filterManager.effectElements[3].p.v;
  6642. this.pathMasker.setAttribute("stroke", "rgb(" + bmFloor(255 * c[0]) + "," + bmFloor(255 * c[1]) + "," + bmFloor(255 * c[2]) + ")")
  6643. }
  6644. }, SVGTritoneFilter.prototype.renderFrame = function(t) {
  6645. if (t || this.filterManager._mdf) {
  6646. var e = this.filterManager.effectElements[0].p.v,
  6647. r = this.filterManager.effectElements[1].p.v,
  6648. i = this.filterManager.effectElements[2].p.v,
  6649. s = i[0] + " " + r[0] + " " + e[0],
  6650. a = i[1] + " " + r[1] + " " + e[1],
  6651. n = i[2] + " " + r[2] + " " + e[2];
  6652. this.feFuncR.setAttribute("tableValues", s), this.feFuncG.setAttribute("tableValues", a), this.feFuncB.setAttribute("tableValues", n)
  6653. }
  6654. }, SVGProLevelsFilter.prototype.createFeFunc = function(t, e) {
  6655. var r = createNS(t);
  6656. return r.setAttribute("type", "table"), e.appendChild(r), r
  6657. }, SVGProLevelsFilter.prototype.getTableValue = function(t, e, r, i, s) {
  6658. for (var a, n, o = 0, h = Math.min(t, e), l = Math.max(t, e), p = Array.call(null, {
  6659. length: 256
  6660. }), f = 0, m = s - i, c = e - t; o <= 256;) n = (a = o / 256) <= h ? c < 0 ? s : i : a >= l ? c < 0 ? i : s : i + m * Math.pow((a - t) / c, 1 / r), p[f] = n, f += 1, o += 256 / 255;
  6661. return p.join(" ")
  6662. }, SVGProLevelsFilter.prototype.renderFrame = function(t) {
  6663. if (t || this.filterManager._mdf) {
  6664. var e, r = this.filterManager.effectElements;
  6665. this.feFuncRComposed && (t || r[3].p._mdf || r[4].p._mdf || r[5].p._mdf || r[6].p._mdf || r[7].p._mdf) && (e = this.getTableValue(r[3].p.v, r[4].p.v, r[5].p.v, r[6].p.v, r[7].p.v), this.feFuncRComposed.setAttribute("tableValues", e), this.feFuncGComposed.setAttribute("tableValues", e), this.feFuncBComposed.setAttribute("tableValues", e)), this.feFuncR && (t || r[10].p._mdf || r[11].p._mdf || r[12].p._mdf || r[13].p._mdf || r[14].p._mdf) && (e = this.getTableValue(r[10].p.v, r[11].p.v, r[12].p.v, r[13].p.v, r[14].p.v), this.feFuncR.setAttribute("tableValues", e)), this.feFuncG && (t || r[17].p._mdf || r[18].p._mdf || r[19].p._mdf || r[20].p._mdf || r[21].p._mdf) && (e = this.getTableValue(r[17].p.v, r[18].p.v, r[19].p.v, r[20].p.v, r[21].p.v), this.feFuncG.setAttribute("tableValues", e)), this.feFuncB && (t || r[24].p._mdf || r[25].p._mdf || r[26].p._mdf || r[27].p._mdf || r[28].p._mdf) && (e = this.getTableValue(r[24].p.v, r[25].p.v, r[26].p.v, r[27].p.v, r[28].p.v), this.feFuncB.setAttribute("tableValues", e)), this.feFuncA && (t || r[31].p._mdf || r[32].p._mdf || r[33].p._mdf || r[34].p._mdf || r[35].p._mdf) && (e = this.getTableValue(r[31].p.v, r[32].p.v, r[33].p.v, r[34].p.v, r[35].p.v), this.feFuncA.setAttribute("tableValues", e))
  6666. }
  6667. }, extendPrototype([SVGComposableEffect], SVGDropShadowEffect), SVGDropShadowEffect.prototype.renderFrame = function(t) {
  6668. if (t || this.filterManager._mdf) {
  6669. if ((t || this.filterManager.effectElements[4].p._mdf) && this.feGaussianBlur.setAttribute("stdDeviation", this.filterManager.effectElements[4].p.v / 4), t || this.filterManager.effectElements[0].p._mdf) {
  6670. var e = this.filterManager.effectElements[0].p.v;
  6671. this.feFlood.setAttribute("flood-color", rgbToHex(Math.round(255 * e[0]), Math.round(255 * e[1]), Math.round(255 * e[2])))
  6672. }
  6673. if ((t || this.filterManager.effectElements[1].p._mdf) && this.feFlood.setAttribute("flood-opacity", this.filterManager.effectElements[1].p.v / 255), t || this.filterManager.effectElements[2].p._mdf || this.filterManager.effectElements[3].p._mdf) {
  6674. var r = this.filterManager.effectElements[3].p.v,
  6675. i = (this.filterManager.effectElements[2].p.v - 90) * degToRads,
  6676. s = r * Math.cos(i),
  6677. a = r * Math.sin(i);
  6678. this.feOffset.setAttribute("dx", s), this.feOffset.setAttribute("dy", a)
  6679. }
  6680. }
  6681. };
  6682. var _svgMatteSymbols = [];
  6683. function SVGMatte3Effect(t, e, r) {
  6684. this.initialized = !1, this.filterManager = e, this.filterElem = t, this.elem = r, r.matteElement = createNS("g"), r.matteElement.appendChild(r.layerElement), r.matteElement.appendChild(r.transformedElement), r.baseElement = r.matteElement
  6685. }
  6686. function SVGGaussianBlurEffect(t, e, r, i) {
  6687. t.setAttribute("x", "-100%"), t.setAttribute("y", "-100%"), t.setAttribute("width", "300%"), t.setAttribute("height", "300%"), this.filterManager = e;
  6688. var s = createNS("feGaussianBlur");
  6689. s.setAttribute("result", i), t.appendChild(s), this.feGaussianBlur = s
  6690. }
  6691. return SVGMatte3Effect.prototype.findSymbol = function(t) {
  6692. for (var e = 0, r = _svgMatteSymbols.length; e < r;) {
  6693. if (_svgMatteSymbols[e] === t) return _svgMatteSymbols[e];
  6694. e += 1
  6695. }
  6696. return null
  6697. }, SVGMatte3Effect.prototype.replaceInParent = function(t, e) {
  6698. var r = t.layerElement.parentNode;
  6699. if (r) {
  6700. for (var i, s = r.children, a = 0, n = s.length; a < n && s[a] !== t.layerElement;) a += 1;
  6701. a <= n - 2 && (i = s[a + 1]);
  6702. var o = createNS("use");
  6703. o.setAttribute("href", "#" + e), i ? r.insertBefore(o, i) : r.appendChild(o)
  6704. }
  6705. }, SVGMatte3Effect.prototype.setElementAsMask = function(t, e) {
  6706. if (!this.findSymbol(e)) {
  6707. var r = createElementID(),
  6708. i = createNS("mask");
  6709. i.setAttribute("id", e.layerId), i.setAttribute("mask-type", "alpha"), _svgMatteSymbols.push(e);
  6710. var s = t.globalData.defs;
  6711. s.appendChild(i);
  6712. var a = createNS("symbol");
  6713. a.setAttribute("id", r), this.replaceInParent(e, r), a.appendChild(e.layerElement), s.appendChild(a);
  6714. var n = createNS("use");
  6715. n.setAttribute("href", "#" + r), i.appendChild(n), e.data.hd = !1, e.show()
  6716. }
  6717. t.setMatte(e.layerId)
  6718. }, SVGMatte3Effect.prototype.initialize = function() {
  6719. for (var t = this.filterManager.effectElements[0].p.v, e = this.elem.comp.elements, r = 0, i = e.length; r < i;) e[r] && e[r].data.ind === t && this.setElementAsMask(this.elem, e[r]), r += 1;
  6720. this.initialized = !0
  6721. }, SVGMatte3Effect.prototype.renderFrame = function() {
  6722. this.initialized || this.initialize()
  6723. }, SVGGaussianBlurEffect.prototype.renderFrame = function(t) {
  6724. if (t || this.filterManager._mdf) {
  6725. var e = .3 * this.filterManager.effectElements[0].p.v,
  6726. r = this.filterManager.effectElements[1].p.v,
  6727. i = 3 == r ? 0 : e,
  6728. s = 2 == r ? 0 : e;
  6729. this.feGaussianBlur.setAttribute("stdDeviation", i + " " + s);
  6730. var a = 1 == this.filterManager.effectElements[2].p.v ? "wrap" : "duplicate";
  6731. this.feGaussianBlur.setAttribute("edgeMode", a)
  6732. }
  6733. }, registerRenderer("canvas", CanvasRenderer), registerRenderer("html", HybridRenderer), registerRenderer("svg", SVGRenderer), ShapeModifiers.registerModifier("tm", TrimModifier), ShapeModifiers.registerModifier("pb", PuckerAndBloatModifier), ShapeModifiers.registerModifier("rp", RepeaterModifier), ShapeModifiers.registerModifier("rd", RoundCornersModifier), setExpressionsPlugin(Expressions), initialize$1(), initialize(), registerEffect(20, SVGTintFilter, !0), registerEffect(21, SVGFillFilter, !0), registerEffect(22, SVGStrokeEffect, !1), registerEffect(23, SVGTritoneFilter, !0), registerEffect(24, SVGProLevelsFilter, !0), registerEffect(25, SVGDropShadowEffect, !0), registerEffect(28, SVGMatte3Effect, !1), registerEffect(29, SVGGaussianBlurEffect, !0), lottie
  6734. }));