123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680 |
- import {
- a6 as cB,
- a7 as cE,
- d as defineComponent,
- a8 as useConfig,
- a9 as useTheme,
- E as computed,
- aa as createKey,
- ab as useThemeClass,
- ac as h$1,
- ad as inputLight,
- r as ref,
- w as watch,
- f as createVNode,
- ae as NSkeleton,
- af as commonjsGlobal,
- q as onMounted,
- ag as openBlock,
- ah as createElementBlock,
- ai as normalizeStyle,
- aj as toRefs,
- M as nextTick,
- e as reactive,
- k as createTextVNode,
- c as useUserStore,
- ak as useDialog,
- al as NEllipsis,
- j as NButton,
- o as NImage,
- Q as NSpace,
- am as NTag,
- y as resolveComponent,
- V as isVNode,
- N as NForm,
- g as NFormItem,
- F as Fragment,
- an as NInputNumber,
- i as NInputGroup,
- h as NInput,
- m as NTabs,
- n as NTabPane,
- H as NDatePicker,
- z as NModal,
- b as useMessage,
- Z as onUnmounted,
- T as Transition,
- ao as NTooltip,
- ap as NDrawer,
- aq as NDrawerContent
- } from './index-95e721f9.js';
- import { C as CardType } from './index-c8870a16.js';
- import { N as NSlider } from './Slider-6165502a.js';
- import { T as TheSearch } from './index-a585796f.js';
- import { l as listData } from './data-c15517db.js';
- import { N as NScrollbar } from './Scrollbar-27c35a2f.js';
- import './index-73922017.js';
- const style = cB(
- 'input-group-label',
- `
- position: relative;
- user-select: none;
- -webkit-user-select: none;
- box-sizing: border-box;
- padding: 0 12px;
- display: inline-block;
- border-radius: var(--n-border-radius);
- background-color: var(--n-group-label-color);
- color: var(--n-group-label-text-color);
- font-size: var(--n-font-size);
- line-height: var(--n-height);
- height: var(--n-height);
- flex-shrink: 0;
- white-space: nowrap;
- transition:
- color .3s var(--n-bezier),
- background-color .3s var(--n-bezier),
- box-shadow .3s var(--n-bezier);
- `,
- [
- cE(
- 'border',
- `
- position: absolute;
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- border-radius: inherit;
- border: var(--n-group-label-border);
- transition: border-color .3s var(--n-bezier);
- `
- )
- ]
- ),
- inputGroupLabelProps = Object.assign(Object.assign({}, useTheme.props), {
- size: { type: String, default: 'medium' },
- bordered: { type: Boolean, default: void 0 }
- }),
- NInputGroupLabel = defineComponent({
- name: 'InputGroupLabel',
- props: inputGroupLabelProps,
- setup(e) {
- const {
- mergedBorderedRef: t,
- mergedClsPrefixRef: r,
- inlineThemeDisabled: i
- } = useConfig(e),
- s = useTheme('Input', '-input-group-label', style, inputLight, e, r),
- n = computed(() => {
- const { size: o } = e,
- {
- common: { cubicBezierEaseInOut: l },
- self: {
- groupLabelColor: c,
- borderRadius: g,
- groupLabelTextColor: S,
- lineHeight: p,
- groupLabelBorder: P,
- [createKey('fontSize', o)]: b,
- [createKey('height', o)]: y
- }
- } = s.value;
- return {
- '--n-bezier': l,
- '--n-group-label-color': c,
- '--n-group-label-border': P,
- '--n-border-radius': g,
- '--n-group-label-text-color': S,
- '--n-font-size': b,
- '--n-line-height': p,
- '--n-height': y
- };
- }),
- a = i
- ? useThemeClass(
- 'input-group-label',
- computed(() => e.size[0]),
- n,
- e
- )
- : void 0;
- return {
- mergedClsPrefix: r,
- mergedBordered: t,
- cssVars: i ? void 0 : n,
- themeClass: a == null ? void 0 : a.themeClass,
- onRender: a == null ? void 0 : a.onRender
- };
- },
- render() {
- var e, t, r;
- const { mergedClsPrefix: i } = this;
- return (
- (e = this.onRender) === null || e === void 0 || e.call(this),
- h$1(
- 'div',
- {
- class: [`${i}-input-group-label`, this.themeClass],
- style: this.cssVars
- },
- (r = (t = this.$slots).default) === null || r === void 0
- ? void 0
- : r.call(t),
- this.mergedBordered
- ? h$1('div', { class: `${i}-input-group-label__border` })
- : null
- )
- );
- }
- }),
- playContent = '_playContent_10y90_1',
- assignHomework = '_assignHomework_10y90_10',
- sectionAnimateUp = '_sectionAnimateUp_10y90_23',
- coursewarePlay = '_coursewarePlay_10y90_29',
- playModel = '_playModel_10y90_35',
- headerContainer = '_headerContainer_10y90_44',
- backBtn = '_backBtn_10y90_61',
- headRight = '_headRight_10y90_73',
- rightBtn = '_rightBtn_10y90_82',
- menu = '_menu_10y90_94',
- tabsContent = '_tabsContent_10y90_104',
- wraps = '_wraps_10y90_115',
- itemDiv = '_itemDiv_10y90_122',
- itemActive = '_itemActive_10y90_135',
- acitveAnimation = '_acitveAnimation_10y90_138',
- show = '_show_10y90_141',
- hide$1 = '_hide_10y90_144',
- rightFixedBtns = '_rightFixedBtns_10y90_157',
- fullBtn = '_fullBtn_10y90_164',
- point = '_point_10y90_169',
- btnsDisabled = '_btnsDisabled_10y90_179',
- loadWrap = '_loadWrap_10y90_208',
- drawerContainer = '_drawerContainer_10y90_219',
- sectionAnimate$1 = '_sectionAnimate_10y90_23',
- switchDisplaySection = '_switchDisplaySection_10y90_264',
- displayBtn = '_displayBtn_10y90_272',
- attendClassModal = '_attendClassModal_10y90_284',
- modelAttendContent = '_modelAttendContent_10y90_308',
- modelAttendBtnGroup = '_modelAttendBtnGroup_10y90_314',
- trainClassModal = '_trainClassModal_10y90_322',
- styles$8 = {
- playContent,
- assignHomework,
- sectionAnimateUp,
- coursewarePlay,
- playModel,
- headerContainer,
- backBtn,
- headRight,
- rightBtn,
- menu,
- tabsContent,
- wraps,
- itemDiv,
- itemActive,
- acitveAnimation,
- show,
- hide: hide$1,
- rightFixedBtns,
- fullBtn,
- point,
- btnsDisabled,
- loadWrap,
- drawerContainer,
- sectionAnimate: sectionAnimate$1,
- switchDisplaySection,
- displayBtn,
- attendClassModal,
- modelAttendContent,
- modelAttendBtnGroup,
- trainClassModal
- },
- plyr = '',
- musicScore = '_musicScore_piq8y_1',
- container = '_container_piq8y_8',
- musicModel = '_musicModel_piq8y_16',
- errorModel = '_errorModel_piq8y_23',
- startBtn = '_startBtn_piq8y_35',
- loading = '_loading_piq8y_45',
- skeletonWrap = '_skeletonWrap_piq8y_51',
- skeleton = '_skeleton_piq8y_51',
- styles$7 = {
- musicScore,
- container,
- musicModel,
- errorModel,
- startBtn,
- loading,
- skeletonWrap,
- skeleton
- };
- var inBrowser = typeof window < 'u',
- visibility;
- function usePageVisibility() {
- if (!visibility && ((visibility = ref('visible')), inBrowser)) {
- const e = () => {
- visibility.value = document.hidden ? 'hidden' : 'visible';
- };
- e(), window.addEventListener('visibilitychange', e);
- }
- return visibility;
- }
- const MusicScore = defineComponent({
- name: 'musicScore',
- props: {
- music: { type: Object, default: () => ({}) },
- activeModel: { type: Boolean }
- },
- emits: ['setIframe'],
- setup(e, { emit: t }) {
- const r = ref(!1),
- i = usePageVisibility();
- watch(i, g => {
- console.log('🚀 ~ value:', g), g == 'hidden' && (r.value = !1);
- });
- const s = ref(),
- n = ref(!1),
- a = ref(!1),
- o = ref(!1),
- l =
- 'https://dev.kt.colexiu.com/instrument?platform=pc&modelType=practise',
- c = () => {
- fetch(l)
- .then(() => {
- (o.value = !0), (a.value = !1);
- })
- .catch(() => {
- a.value = !0;
- });
- };
- return (
- watch(e.music, () => {
- o.value || ((a.value = !1), e.music.display && c());
- }),
- () =>
- createVNode('div', { class: styles$7.musicScore }, [
- createVNode(
- 'iframe',
- {
- ref: s,
- onLoad: () => {
- t('setIframe', s.value), (n.value = !0);
- },
- class: [styles$7.container, 'musicIframe'],
- frameborder: '0',
- src: l
- },
- null
- ),
- createVNode('div', { class: styles$7.skeletonWrap }, [
- createVNode(NSkeleton, { text: !0, repeat: 8 }, null)
- ])
- ])
- );
- }
- }),
- iconMenu = '' + new URL('icon-menu-74c5e633.svg', import.meta.url).href,
- iconUp = '' + new URL('icon-up-c2aeb981.svg', import.meta.url).href,
- iconDown = '' + new URL('icon-down-c5693186.svg', import.meta.url).href,
- iconNote = '' + new URL('icon-note-e717c676.png', import.meta.url).href,
- iconWhiteboard =
- '' + new URL('icon-whiteboard-c1022e62.png', import.meta.url).href,
- iconAssignHomework =
- '' + new URL('icon-assignHomework-16a80795.svg', import.meta.url).href;
- var lottieExports = {},
- lottie = {
- get exports() {
- return lottieExports;
- },
- set exports(e) {
- lottieExports = e;
- }
- };
- (function (module, exports) {
- typeof navigator < 'u' &&
- (function (e, t) {
- module.exports = t();
- })(commonjsGlobal, function () {
- var svgNS = 'http://www.w3.org/2000/svg',
- locationHref = '',
- _useWebWorker = !1,
- initialDefaultFrame = -999999,
- setWebWorker = function (t) {
- _useWebWorker = !!t;
- },
- getWebWorker = function () {
- return _useWebWorker;
- },
- setLocationHref = function (t) {
- locationHref = t;
- },
- getLocationHref = function () {
- return locationHref;
- };
- function createTag(e) {
- return document.createElement(e);
- }
- function extendPrototype(e, t) {
- var r,
- i = e.length,
- s;
- for (r = 0; r < i; r += 1) {
- s = e[r].prototype;
- for (var n in s)
- Object.prototype.hasOwnProperty.call(s, n) &&
- (t.prototype[n] = s[n]);
- }
- }
- function getDescriptor(e, t) {
- return Object.getOwnPropertyDescriptor(e, t);
- }
- function createProxyFunction(e) {
- function t() {}
- return (t.prototype = e), t;
- }
- var audioControllerFactory = (function () {
- function e(t) {
- (this.audios = []),
- (this.audioFactory = t),
- (this._volume = 1),
- (this._isMuted = !1);
- }
- return (
- (e.prototype = {
- addAudio: function (r) {
- this.audios.push(r);
- },
- pause: function () {
- var r,
- i = this.audios.length;
- for (r = 0; r < i; r += 1) this.audios[r].pause();
- },
- resume: function () {
- var r,
- i = this.audios.length;
- for (r = 0; r < i; r += 1) this.audios[r].resume();
- },
- setRate: function (r) {
- var i,
- s = this.audios.length;
- for (i = 0; i < s; i += 1) this.audios[i].setRate(r);
- },
- createAudio: function (r) {
- return this.audioFactory
- ? this.audioFactory(r)
- : window.Howl
- ? new window.Howl({ src: [r] })
- : {
- isPlaying: !1,
- play: function () {
- this.isPlaying = !0;
- },
- seek: function () {
- this.isPlaying = !1;
- },
- playing: function () {},
- rate: function () {},
- setVolume: function () {}
- };
- },
- setAudioFactory: function (r) {
- this.audioFactory = r;
- },
- setVolume: function (r) {
- (this._volume = r), this._updateVolume();
- },
- mute: function () {
- (this._isMuted = !0), this._updateVolume();
- },
- unmute: function () {
- (this._isMuted = !1), this._updateVolume();
- },
- getVolume: function () {
- return this._volume;
- },
- _updateVolume: function () {
- var r,
- i = this.audios.length;
- for (r = 0; r < i; r += 1)
- this.audios[r].volume(this._volume * (this._isMuted ? 0 : 1));
- }
- }),
- function () {
- return new e();
- }
- );
- })(),
- createTypedArray = (function () {
- function e(r, i) {
- var s = 0,
- n = [],
- a;
- switch (r) {
- case 'int16':
- case 'uint8c':
- a = 1;
- break;
- default:
- a = 1.1;
- break;
- }
- for (s = 0; s < i; s += 1) n.push(a);
- return n;
- }
- function t(r, i) {
- return r === 'float32'
- ? new Float32Array(i)
- : r === 'int16'
- ? new Int16Array(i)
- : r === 'uint8c'
- ? new Uint8ClampedArray(i)
- : e(r, i);
- }
- return typeof Uint8ClampedArray == 'function' &&
- typeof Float32Array == 'function'
- ? t
- : e;
- })();
- function createSizedArray(e) {
- return Array.apply(null, { length: e });
- }
- function _typeof$6(e) {
- return (
- typeof Symbol == 'function' && typeof Symbol.iterator == 'symbol'
- ? (_typeof$6 = function (r) {
- return typeof r;
- })
- : (_typeof$6 = function (r) {
- return r &&
- typeof Symbol == 'function' &&
- r.constructor === Symbol &&
- r !== Symbol.prototype
- ? 'symbol'
- : typeof r;
- }),
- _typeof$6(e)
- );
- }
- var subframeEnabled = !0,
- expressionsPlugin = null,
- expressionsInterfaces = null,
- idPrefix$1 = '',
- isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent),
- bmPow = Math.pow,
- bmSqrt = Math.sqrt,
- bmFloor = Math.floor,
- bmMax = Math.max,
- bmMin = Math.min,
- BMMath = {};
- (function () {
- var 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'
- ],
- t,
- r = e.length;
- for (t = 0; t < r; t += 1) BMMath[e[t]] = Math[e[t]];
- })(),
- (BMMath.random = Math.random),
- (BMMath.abs = function (e) {
- var t = _typeof$6(e);
- if (t === 'object' && e.length) {
- var r = createSizedArray(e.length),
- i,
- s = e.length;
- for (i = 0; i < s; i += 1) r[i] = Math.abs(e[i]);
- return r;
- }
- return Math.abs(e);
- });
- var defaultCurveSegments = 150,
- degToRads = Math.PI / 180,
- roundCorner = 0.5519;
- function styleDiv(e) {
- (e.style.position = 'absolute'),
- (e.style.top = 0),
- (e.style.left = 0),
- (e.style.display = 'block'),
- (e.style.transformOrigin = '0 0'),
- (e.style.webkitTransformOrigin = '0 0'),
- (e.style.backfaceVisibility = 'visible'),
- (e.style.webkitBackfaceVisibility = 'visible'),
- (e.style.transformStyle = 'preserve-3d'),
- (e.style.webkitTransformStyle = 'preserve-3d'),
- (e.style.mozTransformStyle = 'preserve-3d');
- }
- function BMEnterFrameEvent(e, t, r, i) {
- (this.type = e),
- (this.currentTime = t),
- (this.totalTime = r),
- (this.direction = i < 0 ? -1 : 1);
- }
- function BMCompleteEvent(e, t) {
- (this.type = e), (this.direction = t < 0 ? -1 : 1);
- }
- function BMCompleteLoopEvent(e, t, r, i) {
- (this.type = e),
- (this.currentLoop = r),
- (this.totalLoops = t),
- (this.direction = i < 0 ? -1 : 1);
- }
- function BMSegmentStartEvent(e, t, r) {
- (this.type = e), (this.firstFrame = t), (this.totalFrames = r);
- }
- function BMDestroyEvent(e, t) {
- (this.type = e), (this.target = t);
- }
- function BMRenderFrameErrorEvent(e, t) {
- (this.type = 'renderFrameError'),
- (this.nativeError = e),
- (this.currentTime = t);
- }
- function BMConfigErrorEvent(e) {
- (this.type = 'configError'), (this.nativeError = e);
- }
- var createElementID = (function () {
- var e = 0;
- return function () {
- return (e += 1), idPrefix$1 + '__lottie_element_' + e;
- };
- })();
- function HSVtoRGB(e, t, r) {
- var i, s, n, a, o, l, c, g;
- switch (
- ((a = Math.floor(e * 6)),
- (o = e * 6 - a),
- (l = r * (1 - t)),
- (c = r * (1 - o * t)),
- (g = r * (1 - (1 - o) * t)),
- a % 6)
- ) {
- case 0:
- (i = r), (s = g), (n = l);
- break;
- case 1:
- (i = c), (s = r), (n = l);
- break;
- case 2:
- (i = l), (s = r), (n = g);
- break;
- case 3:
- (i = l), (s = c), (n = r);
- break;
- case 4:
- (i = g), (s = l), (n = r);
- break;
- case 5:
- (i = r), (s = l), (n = c);
- break;
- }
- return [i, s, n];
- }
- function RGBtoHSV(e, t, r) {
- var i = Math.max(e, t, r),
- s = Math.min(e, t, r),
- n = i - s,
- a,
- o = i === 0 ? 0 : n / i,
- l = i / 255;
- switch (i) {
- case s:
- a = 0;
- break;
- case e:
- (a = t - r + n * (t < r ? 6 : 0)), (a /= 6 * n);
- break;
- case t:
- (a = r - e + n * 2), (a /= 6 * n);
- break;
- case r:
- (a = e - t + n * 4), (a /= 6 * n);
- break;
- }
- return [a, o, l];
- }
- function addSaturationToRGB(e, t) {
- var r = RGBtoHSV(e[0] * 255, e[1] * 255, e[2] * 255);
- return (
- (r[1] += t),
- r[1] > 1 ? (r[1] = 1) : r[1] <= 0 && (r[1] = 0),
- HSVtoRGB(r[0], r[1], r[2])
- );
- }
- function addBrightnessToRGB(e, t) {
- var r = RGBtoHSV(e[0] * 255, e[1] * 255, e[2] * 255);
- return (
- (r[2] += t),
- r[2] > 1 ? (r[2] = 1) : r[2] < 0 && (r[2] = 0),
- HSVtoRGB(r[0], r[1], r[2])
- );
- }
- function addHueToRGB(e, t) {
- var r = RGBtoHSV(e[0] * 255, e[1] * 255, e[2] * 255);
- return (
- (r[0] += t / 360),
- r[0] > 1 ? (r[0] -= 1) : r[0] < 0 && (r[0] += 1),
- HSVtoRGB(r[0], r[1], r[2])
- );
- }
- var rgbToHex = (function () {
- var e = [],
- t,
- r;
- for (t = 0; t < 256; t += 1)
- (r = t.toString(16)), (e[t] = r.length === 1 ? '0' + r : r);
- return function (i, s, n) {
- return (
- i < 0 && (i = 0),
- s < 0 && (s = 0),
- n < 0 && (n = 0),
- '#' + e[i] + e[s] + e[n]
- );
- };
- })(),
- setSubframeEnabled = function (t) {
- subframeEnabled = !!t;
- },
- getSubframeEnabled = function () {
- return subframeEnabled;
- },
- setExpressionsPlugin = function (t) {
- expressionsPlugin = t;
- },
- getExpressionsPlugin = function () {
- return expressionsPlugin;
- },
- setExpressionInterfaces = function (t) {
- expressionsInterfaces = t;
- },
- getExpressionInterfaces = function () {
- return expressionsInterfaces;
- },
- setDefaultCurveSegments = function (t) {
- defaultCurveSegments = t;
- },
- getDefaultCurveSegments = function () {
- return defaultCurveSegments;
- },
- setIdPrefix = function (t) {
- idPrefix$1 = t;
- };
- function createNS(e) {
- return document.createElementNS(svgNS, e);
- }
- function _typeof$5(e) {
- return (
- typeof Symbol == 'function' && typeof Symbol.iterator == 'symbol'
- ? (_typeof$5 = function (r) {
- return typeof r;
- })
- : (_typeof$5 = function (r) {
- return r &&
- typeof Symbol == 'function' &&
- r.constructor === Symbol &&
- r !== Symbol.prototype
- ? 'symbol'
- : typeof r;
- }),
- _typeof$5(e)
- );
- }
- var dataManager = (function () {
- var e = 1,
- t = [],
- r,
- i,
- s = {
- onmessage: function () {},
- postMessage: function (P) {
- r({ data: P });
- }
- },
- n = {
- postMessage: function (P) {
- s.onmessage({ data: P });
- }
- };
- function a(p) {
- if (window.Worker && window.Blob && getWebWorker()) {
- var P = new Blob(
- ['var _workerSelf = self; self.onmessage = ', p.toString()],
- { type: 'text/javascript' }
- ),
- b = URL.createObjectURL(P);
- return new Worker(b);
- }
- return (r = p), s;
- }
- function o() {
- i ||
- ((i = a(function (P) {
- function b() {
- function A(B, F) {
- var k,
- C,
- M = B.length,
- R,
- L,
- j,
- z;
- for (C = 0; C < M; C += 1)
- if (((k = B[C]), 'ks' in k && !k.completed)) {
- if (((k.completed = !0), k.hasMask)) {
- var H = k.masksProperties;
- for (L = H.length, R = 0; R < L; R += 1)
- if (H[R].pt.k.i) E(H[R].pt.k);
- else
- for (z = H[R].pt.k.length, j = 0; j < z; j += 1)
- H[R].pt.k[j].s && E(H[R].pt.k[j].s[0]),
- H[R].pt.k[j].e && E(H[R].pt.k[j].e[0]);
- }
- k.ty === 0
- ? ((k.layers = m(k.refId, F)), A(k.layers, F))
- : k.ty === 4
- ? d(k.shapes)
- : k.ty === 5 && $(k);
- }
- }
- function u(B, F) {
- if (B) {
- var k = 0,
- C = B.length;
- for (k = 0; k < C; k += 1)
- B[k].t === 1 &&
- ((B[k].data.layers = m(B[k].data.refId, F)),
- A(B[k].data.layers, F));
- }
- }
- function f(B, F) {
- for (var k = 0, C = F.length; k < C; ) {
- if (F[k].id === B) return F[k];
- k += 1;
- }
- return null;
- }
- function m(B, F) {
- var k = f(B, F);
- return k
- ? k.layers.__used
- ? JSON.parse(JSON.stringify(k.layers))
- : ((k.layers.__used = !0), k.layers)
- : null;
- }
- function d(B) {
- var F,
- k = B.length,
- C,
- M;
- for (F = k - 1; F >= 0; F -= 1)
- if (B[F].ty === 'sh')
- if (B[F].ks.k.i) E(B[F].ks.k);
- else
- for (M = B[F].ks.k.length, C = 0; C < M; C += 1)
- B[F].ks.k[C].s && E(B[F].ks.k[C].s[0]),
- B[F].ks.k[C].e && E(B[F].ks.k[C].e[0]);
- else B[F].ty === 'gr' && d(B[F].it);
- }
- function E(B) {
- var F,
- k = B.i.length;
- for (F = 0; F < k; F += 1)
- (B.i[F][0] += B.v[F][0]),
- (B.i[F][1] += B.v[F][1]),
- (B.o[F][0] += B.v[F][0]),
- (B.o[F][1] += B.v[F][1]);
- }
- function T(B, F) {
- var k = F ? F.split('.') : [100, 100, 100];
- return B[0] > k[0]
- ? !0
- : k[0] > B[0]
- ? !1
- : B[1] > k[1]
- ? !0
- : k[1] > B[1]
- ? !1
- : B[2] > k[2]
- ? !0
- : k[2] > B[2]
- ? !1
- : null;
- }
- var x = (function () {
- var B = [4, 4, 14];
- function F(C) {
- var M = C.t.d;
- C.t.d = { k: [{ s: M, t: 0 }] };
- }
- function k(C) {
- var M,
- R = C.length;
- for (M = 0; M < R; M += 1) C[M].ty === 5 && F(C[M]);
- }
- return function (C) {
- if (T(B, C.v) && (k(C.layers), C.assets)) {
- var M,
- R = C.assets.length;
- for (M = 0; M < R; M += 1)
- C.assets[M].layers && k(C.assets[M].layers);
- }
- };
- })(),
- _ = (function () {
- var B = [4, 7, 99];
- return function (F) {
- if (F.chars && !T(B, F.v)) {
- var k,
- C = F.chars.length;
- for (k = 0; k < C; k += 1) {
- var M = F.chars[k];
- M.data &&
- M.data.shapes &&
- (d(M.data.shapes),
- (M.data.ip = 0),
- (M.data.op = 99999),
- (M.data.st = 0),
- (M.data.sr = 1),
- (M.data.ks = {
- p: { k: [0, 0], a: 0 },
- s: { k: [100, 100], a: 0 },
- a: { k: [0, 0], a: 0 },
- r: { k: 0, a: 0 },
- o: { k: 100, a: 0 }
- }),
- F.chars[k].t ||
- (M.data.shapes.push({ ty: 'no' }),
- M.data.shapes[0].it.push({
- p: { k: [0, 0], a: 0 },
- s: { k: [100, 100], a: 0 },
- a: { k: [0, 0], a: 0 },
- r: { k: 0, a: 0 },
- o: { k: 100, a: 0 },
- sk: { k: 0, a: 0 },
- sa: { k: 0, a: 0 },
- ty: 'tr'
- })));
- }
- }
- };
- })(),
- I = (function () {
- var B = [5, 7, 15];
- function F(C) {
- var M = C.t.p;
- typeof M.a == 'number' && (M.a = { a: 0, k: M.a }),
- typeof M.p == 'number' && (M.p = { a: 0, k: M.p }),
- typeof M.r == 'number' && (M.r = { a: 0, k: M.r });
- }
- function k(C) {
- var M,
- R = C.length;
- for (M = 0; M < R; M += 1) C[M].ty === 5 && F(C[M]);
- }
- return function (C) {
- if (T(B, C.v) && (k(C.layers), C.assets)) {
- var M,
- R = C.assets.length;
- for (M = 0; M < R; M += 1)
- C.assets[M].layers && k(C.assets[M].layers);
- }
- };
- })(),
- V = (function () {
- var B = [4, 1, 9];
- function F(C) {
- var M,
- R = C.length,
- L,
- j;
- for (M = 0; M < R; M += 1)
- if (C[M].ty === 'gr') F(C[M].it);
- else if (C[M].ty === 'fl' || C[M].ty === 'st')
- if (C[M].c.k && C[M].c.k[0].i)
- for (j = C[M].c.k.length, L = 0; L < j; L += 1)
- C[M].c.k[L].s &&
- ((C[M].c.k[L].s[0] /= 255),
- (C[M].c.k[L].s[1] /= 255),
- (C[M].c.k[L].s[2] /= 255),
- (C[M].c.k[L].s[3] /= 255)),
- C[M].c.k[L].e &&
- ((C[M].c.k[L].e[0] /= 255),
- (C[M].c.k[L].e[1] /= 255),
- (C[M].c.k[L].e[2] /= 255),
- (C[M].c.k[L].e[3] /= 255));
- else
- (C[M].c.k[0] /= 255),
- (C[M].c.k[1] /= 255),
- (C[M].c.k[2] /= 255),
- (C[M].c.k[3] /= 255);
- }
- function k(C) {
- var M,
- R = C.length;
- for (M = 0; M < R; M += 1)
- C[M].ty === 4 && F(C[M].shapes);
- }
- return function (C) {
- if (T(B, C.v) && (k(C.layers), C.assets)) {
- var M,
- R = C.assets.length;
- for (M = 0; M < R; M += 1)
- C.assets[M].layers && k(C.assets[M].layers);
- }
- };
- })(),
- D = (function () {
- var B = [4, 4, 18];
- function F(C) {
- var M,
- R = C.length,
- L,
- j;
- for (M = R - 1; M >= 0; M -= 1)
- if (C[M].ty === 'sh')
- if (C[M].ks.k.i) C[M].ks.k.c = C[M].closed;
- else
- for (j = C[M].ks.k.length, L = 0; L < j; L += 1)
- C[M].ks.k[L].s &&
- (C[M].ks.k[L].s[0].c = C[M].closed),
- C[M].ks.k[L].e &&
- (C[M].ks.k[L].e[0].c = C[M].closed);
- else C[M].ty === 'gr' && F(C[M].it);
- }
- function k(C) {
- var M,
- R,
- L = C.length,
- j,
- z,
- H,
- U;
- for (R = 0; R < L; R += 1) {
- if (((M = C[R]), M.hasMask)) {
- var q = M.masksProperties;
- for (z = q.length, j = 0; j < z; j += 1)
- if (q[j].pt.k.i) q[j].pt.k.c = q[j].cl;
- else
- for (U = q[j].pt.k.length, H = 0; H < U; H += 1)
- q[j].pt.k[H].s &&
- (q[j].pt.k[H].s[0].c = q[j].cl),
- q[j].pt.k[H].e &&
- (q[j].pt.k[H].e[0].c = q[j].cl);
- }
- M.ty === 4 && F(M.shapes);
- }
- }
- return function (C) {
- if (T(B, C.v) && (k(C.layers), C.assets)) {
- var M,
- R = C.assets.length;
- for (M = 0; M < R; M += 1)
- C.assets[M].layers && k(C.assets[M].layers);
- }
- };
- })();
- function N(B) {
- B.__complete ||
- (V(B),
- x(B),
- _(B),
- I(B),
- D(B),
- A(B.layers, B.assets),
- u(B.chars, B.assets),
- (B.__complete = !0));
- }
- function $(B) {
- B.t.a.length === 0 && 'm' in B.t.p;
- }
- var O = {};
- return (
- (O.completeData = N),
- (O.checkColors = V),
- (O.checkChars = _),
- (O.checkPathProperties = I),
- (O.checkShapes = D),
- (O.completeLayers = A),
- O
- );
- }
- if (
- (n.dataManager || (n.dataManager = b()),
- n.assetLoader ||
- (n.assetLoader = (function () {
- function A(f) {
- var m = f.getResponseHeader('content-type');
- return (m &&
- f.responseType === 'json' &&
- m.indexOf('json') !== -1) ||
- (f.response && _typeof$5(f.response) === 'object')
- ? f.response
- : f.response && typeof f.response == 'string'
- ? JSON.parse(f.response)
- : f.responseText
- ? JSON.parse(f.responseText)
- : null;
- }
- function u(f, m, d, E) {
- var T,
- x = new XMLHttpRequest();
- try {
- x.responseType = 'json';
- } catch {}
- x.onreadystatechange = function () {
- if (x.readyState === 4)
- if (x.status === 200) (T = A(x)), d(T);
- else
- try {
- (T = A(x)), d(T);
- } catch (_) {
- E && E(_);
- }
- };
- try {
- x.open(['G', 'E', 'T'].join(''), f, !0);
- } catch {
- x.open(['G', 'E', 'T'].join(''), m + '/' + f, !0);
- }
- x.send();
- }
- return { load: u };
- })()),
- P.data.type === 'loadAnimation')
- )
- n.assetLoader.load(
- P.data.path,
- P.data.fullPath,
- function (A) {
- n.dataManager.completeData(A),
- n.postMessage({
- id: P.data.id,
- payload: A,
- status: 'success'
- });
- },
- function () {
- n.postMessage({ id: P.data.id, status: 'error' });
- }
- );
- else if (P.data.type === 'complete') {
- var y = P.data.animation;
- n.dataManager.completeData(y),
- n.postMessage({
- id: P.data.id,
- payload: y,
- status: 'success'
- });
- } else
- P.data.type === 'loadData' &&
- n.assetLoader.load(
- P.data.path,
- P.data.fullPath,
- function (A) {
- n.postMessage({
- id: P.data.id,
- payload: A,
- status: 'success'
- });
- },
- function () {
- n.postMessage({ id: P.data.id, status: 'error' });
- }
- );
- })),
- (i.onmessage = function (p) {
- var P = p.data,
- b = P.id,
- y = t[b];
- (t[b] = null),
- P.status === 'success'
- ? y.onComplete(P.payload)
- : y.onError && y.onError();
- }));
- }
- function l(p, P) {
- e += 1;
- var b = 'processId_' + e;
- return (t[b] = { onComplete: p, onError: P }), b;
- }
- function c(p, P, b) {
- o();
- var y = l(P, b);
- i.postMessage({
- type: 'loadAnimation',
- path: p,
- fullPath: window.location.origin + window.location.pathname,
- id: y
- });
- }
- function g(p, P, b) {
- o();
- var y = l(P, b);
- i.postMessage({
- type: 'loadData',
- path: p,
- fullPath: window.location.origin + window.location.pathname,
- id: y
- });
- }
- function S(p, P, b) {
- o();
- var y = l(P, b);
- i.postMessage({ type: 'complete', animation: p, id: y });
- }
- return { loadAnimation: c, loadData: g, completeAnimation: S };
- })(),
- ImagePreloader = (function () {
- var e = (function () {
- var u = createTag('canvas');
- (u.width = 1), (u.height = 1);
- var f = u.getContext('2d');
- return (f.fillStyle = 'rgba(0,0,0,0)'), f.fillRect(0, 0, 1, 1), u;
- })();
- function t() {
- (this.loadedAssets += 1),
- this.loadedAssets === this.totalImages &&
- this.loadedFootagesCount === this.totalFootages &&
- this.imagesLoadedCb &&
- this.imagesLoadedCb(null);
- }
- function r() {
- (this.loadedFootagesCount += 1),
- this.loadedAssets === this.totalImages &&
- this.loadedFootagesCount === this.totalFootages &&
- this.imagesLoadedCb &&
- this.imagesLoadedCb(null);
- }
- function i(u, f, m) {
- var d = '';
- if (u.e) d = u.p;
- else if (f) {
- var E = u.p;
- E.indexOf('images/') !== -1 && (E = E.split('/')[1]), (d = f + E);
- } else (d = m), (d += u.u ? u.u : ''), (d += u.p);
- return d;
- }
- function s(u) {
- var f = 0,
- m = setInterval(
- function () {
- var d = u.getBBox();
- (d.width || f > 500) &&
- (this._imageLoaded(), clearInterval(m)),
- (f += 1);
- }.bind(this),
- 50
- );
- }
- function n(u) {
- var f = i(u, this.assetsPath, this.path),
- m = createNS('image');
- isSafari
- ? this.testImageLoaded(m)
- : m.addEventListener('load', this._imageLoaded, !1),
- m.addEventListener(
- 'error',
- function () {
- (d.img = e), this._imageLoaded();
- }.bind(this),
- !1
- ),
- m.setAttributeNS('http://www.w3.org/1999/xlink', 'href', f),
- this._elementHelper.append
- ? this._elementHelper.append(m)
- : this._elementHelper.appendChild(m);
- var d = { img: m, assetData: u };
- return d;
- }
- function a(u) {
- var f = i(u, this.assetsPath, this.path),
- m = createTag('img');
- (m.crossOrigin = 'anonymous'),
- m.addEventListener('load', this._imageLoaded, !1),
- m.addEventListener(
- 'error',
- function () {
- (d.img = e), this._imageLoaded();
- }.bind(this),
- !1
- ),
- (m.src = f);
- var d = { img: m, assetData: u };
- return d;
- }
- function o(u) {
- var f = { assetData: u },
- m = i(u, this.assetsPath, this.path);
- return (
- dataManager.loadData(
- m,
- function (d) {
- (f.img = d), this._footageLoaded();
- }.bind(this),
- function () {
- (f.img = {}), this._footageLoaded();
- }.bind(this)
- ),
- f
- );
- }
- function l(u, f) {
- this.imagesLoadedCb = f;
- var m,
- d = u.length;
- for (m = 0; m < d; m += 1)
- u[m].layers ||
- (!u[m].t || u[m].t === 'seq'
- ? ((this.totalImages += 1),
- this.images.push(this._createImageData(u[m])))
- : u[m].t === 3 &&
- ((this.totalFootages += 1),
- this.images.push(this.createFootageData(u[m]))));
- }
- function c(u) {
- this.path = u || '';
- }
- function g(u) {
- this.assetsPath = u || '';
- }
- function S(u) {
- for (var f = 0, m = this.images.length; f < m; ) {
- if (this.images[f].assetData === u) return this.images[f].img;
- f += 1;
- }
- return null;
- }
- function p() {
- (this.imagesLoadedCb = null), (this.images.length = 0);
- }
- function P() {
- return this.totalImages === this.loadedAssets;
- }
- function b() {
- return this.totalFootages === this.loadedFootagesCount;
- }
- function y(u, f) {
- u === 'svg'
- ? ((this._elementHelper = f),
- (this._createImageData = this.createImageData.bind(this)))
- : (this._createImageData = this.createImgData.bind(this));
- }
- function A() {
- (this._imageLoaded = t.bind(this)),
- (this._footageLoaded = r.bind(this)),
- (this.testImageLoaded = s.bind(this)),
- (this.createFootageData = o.bind(this)),
- (this.assetsPath = ''),
- (this.path = ''),
- (this.totalImages = 0),
- (this.totalFootages = 0),
- (this.loadedAssets = 0),
- (this.loadedFootagesCount = 0),
- (this.imagesLoadedCb = null),
- (this.images = []);
- }
- return (
- (A.prototype = {
- loadAssets: l,
- setAssetsPath: g,
- setPath: c,
- loadedImages: P,
- loadedFootages: b,
- destroy: p,
- getAsset: S,
- createImgData: a,
- createImageData: n,
- imageLoaded: t,
- footageLoaded: r,
- setCacheType: y
- }),
- A
- );
- })();
- function BaseEvent() {}
- BaseEvent.prototype = {
- triggerEvent: function (t, r) {
- if (this._cbs[t])
- for (var i = this._cbs[t], s = 0; s < i.length; s += 1) i[s](r);
- },
- addEventListener: function (t, r) {
- return (
- this._cbs[t] || (this._cbs[t] = []),
- this._cbs[t].push(r),
- function () {
- this.removeEventListener(t, r);
- }.bind(this)
- );
- },
- removeEventListener: function (t, r) {
- if (!r) this._cbs[t] = null;
- else if (this._cbs[t]) {
- for (var i = 0, s = this._cbs[t].length; i < s; )
- this._cbs[t][i] === r &&
- (this._cbs[t].splice(i, 1), (i -= 1), (s -= 1)),
- (i += 1);
- this._cbs[t].length || (this._cbs[t] = null);
- }
- }
- };
- var markerParser = (function () {
- function e(t) {
- for (
- var r = t.split(`\r
- `),
- i = {},
- s,
- n = 0,
- a = 0;
- a < r.length;
- a += 1
- )
- (s = r[a].split(':')),
- s.length === 2 && ((i[s[0]] = s[1].trim()), (n += 1));
- if (n === 0) throw new Error();
- return i;
- }
- return function (t) {
- for (var r = [], i = 0; i < t.length; i += 1) {
- var s = t[i],
- n = { time: s.tm, duration: s.dr };
- try {
- n.payload = JSON.parse(t[i].cm);
- } catch {
- try {
- n.payload = e(t[i].cm);
- } catch {
- n.payload = { name: t[i].cm };
- }
- }
- r.push(n);
- }
- return r;
- };
- })(),
- ProjectInterface = (function () {
- function e(t) {
- this.compositions.push(t);
- }
- return function () {
- function t(r) {
- for (var i = 0, s = this.compositions.length; i < s; ) {
- if (
- this.compositions[i].data &&
- this.compositions[i].data.nm === r
- )
- return (
- this.compositions[i].prepareFrame &&
- this.compositions[i].data.xt &&
- this.compositions[i].prepareFrame(this.currentFrame),
- this.compositions[i].compInterface
- );
- i += 1;
- }
- return null;
- }
- return (
- (t.compositions = []),
- (t.currentFrame = 0),
- (t.registerComposition = e),
- t
- );
- };
- })(),
- renderers = {},
- registerRenderer = function (t, r) {
- renderers[t] = r;
- };
- function getRenderer(e) {
- return renderers[e];
- }
- function getRegisteredRenderer() {
- if (renderers.canvas) return 'canvas';
- for (var e in renderers) if (renderers[e]) return e;
- return '';
- }
- function _typeof$4(e) {
- return (
- typeof Symbol == 'function' && typeof Symbol.iterator == 'symbol'
- ? (_typeof$4 = function (r) {
- return typeof r;
- })
- : (_typeof$4 = function (r) {
- return r &&
- typeof Symbol == 'function' &&
- r.constructor === Symbol &&
- r !== Symbol.prototype
- ? 'symbol'
- : typeof r;
- }),
- _typeof$4(e)
- );
- }
- var AnimationItem = function () {
- (this._cbs = []),
- (this.name = ''),
- (this.path = ''),
- (this.isLoaded = !1),
- (this.currentFrame = 0),
- (this.currentRawFrame = 0),
- (this.firstFrame = 0),
- (this.totalFrames = 0),
- (this.frameRate = 0),
- (this.frameMult = 0),
- (this.playSpeed = 1),
- (this.playDirection = 1),
- (this.playCount = 0),
- (this.animationData = {}),
- (this.assets = []),
- (this.isPaused = !0),
- (this.autoplay = !1),
- (this.loop = !0),
- (this.renderer = null),
- (this.animationID = createElementID()),
- (this.assetsPath = ''),
- (this.timeCompleted = 0),
- (this.segmentPos = 0),
- (this.isSubframeEnabled = getSubframeEnabled()),
- (this.segments = []),
- (this._idle = !0),
- (this._completedLoop = !1),
- (this.projectInterface = ProjectInterface()),
- (this.imagePreloader = new ImagePreloader()),
- (this.audioController = audioControllerFactory()),
- (this.markers = []),
- (this.configAnimation = this.configAnimation.bind(this)),
- (this.onSetupError = this.onSetupError.bind(this)),
- (this.onSegmentComplete = this.onSegmentComplete.bind(this)),
- (this.drawnFrameEvent = new BMEnterFrameEvent('drawnFrame', 0, 0, 0));
- };
- extendPrototype([BaseEvent], AnimationItem),
- (AnimationItem.prototype.setParams = function (e) {
- (e.wrapper || e.container) &&
- (this.wrapper = e.wrapper || e.container);
- var t = 'svg';
- e.animType ? (t = e.animType) : e.renderer && (t = e.renderer);
- var r = getRenderer(t);
- (this.renderer = new r(this, e.rendererSettings)),
- this.imagePreloader.setCacheType(t, this.renderer.globalData.defs),
- this.renderer.setProjectInterface(this.projectInterface),
- (this.animType = t),
- e.loop === '' ||
- e.loop === null ||
- e.loop === void 0 ||
- e.loop === !0
- ? (this.loop = !0)
- : e.loop === !1
- ? (this.loop = !1)
- : (this.loop = parseInt(e.loop, 10)),
- (this.autoplay = 'autoplay' in e ? e.autoplay : !0),
- (this.name = e.name ? e.name : ''),
- (this.autoloadSegments = Object.prototype.hasOwnProperty.call(
- e,
- 'autoloadSegments'
- )
- ? e.autoloadSegments
- : !0),
- (this.assetsPath = e.assetsPath),
- (this.initialSegment = e.initialSegment),
- e.audioFactory &&
- this.audioController.setAudioFactory(e.audioFactory),
- e.animationData
- ? this.setupAnimation(e.animationData)
- : e.path &&
- (e.path.lastIndexOf('\\') !== -1
- ? (this.path = e.path.substr(0, e.path.lastIndexOf('\\') + 1))
- : (this.path = e.path.substr(0, e.path.lastIndexOf('/') + 1)),
- (this.fileName = e.path.substr(e.path.lastIndexOf('/') + 1)),
- (this.fileName = this.fileName.substr(
- 0,
- this.fileName.lastIndexOf('.json')
- )),
- dataManager.loadAnimation(
- e.path,
- this.configAnimation,
- this.onSetupError
- ));
- }),
- (AnimationItem.prototype.onSetupError = function () {
- this.trigger('data_failed');
- }),
- (AnimationItem.prototype.setupAnimation = function (e) {
- dataManager.completeAnimation(e, this.configAnimation);
- }),
- (AnimationItem.prototype.setData = function (e, t) {
- t && _typeof$4(t) !== 'object' && (t = JSON.parse(t));
- var r = { wrapper: e, animationData: t },
- i = e.attributes;
- (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
- : getRegisteredRenderer() || 'canvas');
- 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
- : '';
- s === 'false'
- ? (r.loop = !1)
- : s === 'true'
- ? (r.loop = !0)
- : s !== '' && (r.loop = parseInt(s, 10));
- var n = 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
- : !0;
- (r.autoplay = n !== 'false'),
- (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
- : '');
- var a = 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
- : '';
- a === 'false' && (r.prerender = !1),
- r.path ? this.setParams(r) : this.trigger('destroy');
- }),
- (AnimationItem.prototype.includeLayers = function (e) {
- e.op > this.animationData.op &&
- ((this.animationData.op = e.op),
- (this.totalFrames = Math.floor(e.op - this.animationData.ip)));
- var t = this.animationData.layers,
- r,
- i = t.length,
- s = e.layers,
- n,
- a = s.length;
- for (n = 0; n < a; n += 1)
- for (r = 0; r < i; ) {
- if (t[r].id === s[n].id) {
- t[r] = s[n];
- break;
- }
- r += 1;
- }
- if (
- ((e.chars || e.fonts) &&
- (this.renderer.globalData.fontManager.addChars(e.chars),
- this.renderer.globalData.fontManager.addFonts(
- e.fonts,
- this.renderer.globalData.defs
- )),
- e.assets)
- )
- for (i = e.assets.length, r = 0; r < i; r += 1)
- this.animationData.assets.push(e.assets[r]);
- (this.animationData.__complete = !1),
- dataManager.completeAnimation(
- this.animationData,
- this.onSegmentComplete
- );
- }),
- (AnimationItem.prototype.onSegmentComplete = function (e) {
- this.animationData = e;
- var t = getExpressionsPlugin();
- t && t.initExpressions(this), this.loadNextSegment();
- }),
- (AnimationItem.prototype.loadNextSegment = function () {
- var e = this.animationData.segments;
- if (!e || e.length === 0 || !this.autoloadSegments) {
- this.trigger('data_ready'), (this.timeCompleted = this.totalFrames);
- return;
- }
- var t = e.shift();
- this.timeCompleted = t.time * this.frameRate;
- var r = this.path + this.fileName + '_' + this.segmentPos + '.json';
- (this.segmentPos += 1),
- dataManager.loadData(
- r,
- this.includeLayers.bind(this),
- function () {
- this.trigger('data_failed');
- }.bind(this)
- );
- }),
- (AnimationItem.prototype.loadSegments = function () {
- var e = this.animationData.segments;
- e || (this.timeCompleted = this.totalFrames), this.loadNextSegment();
- }),
- (AnimationItem.prototype.imagesLoaded = function () {
- this.trigger('loaded_images'), this.checkLoaded();
- }),
- (AnimationItem.prototype.preloadImages = function () {
- this.imagePreloader.setAssetsPath(this.assetsPath),
- this.imagePreloader.setPath(this.path),
- this.imagePreloader.loadAssets(
- this.animationData.assets,
- this.imagesLoaded.bind(this)
- );
- }),
- (AnimationItem.prototype.configAnimation = function (e) {
- if (this.renderer)
- try {
- (this.animationData = e),
- 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(e),
- e.assets || (e.assets = []),
- (this.assets = this.animationData.assets),
- (this.frameRate = this.animationData.fr),
- (this.frameMult = this.animationData.fr / 1e3),
- this.renderer.searchExtraCompositions(e.assets),
- (this.markers = markerParser(e.markers || [])),
- this.trigger('config_ready'),
- this.preloadImages(),
- this.loadSegments(),
- this.updaFrameModifier(),
- this.waitForFontsLoaded(),
- this.isPaused && this.audioController.pause();
- } catch (t) {
- this.triggerConfigError(t);
- }
- }),
- (AnimationItem.prototype.waitForFontsLoaded = function () {
- this.renderer &&
- (this.renderer.globalData.fontManager.isLoaded
- ? this.checkLoaded()
- : setTimeout(this.waitForFontsLoaded.bind(this), 20));
- }),
- (AnimationItem.prototype.checkLoaded = function () {
- if (
- !this.isLoaded &&
- this.renderer.globalData.fontManager.isLoaded &&
- (this.imagePreloader.loadedImages() ||
- this.renderer.rendererType !== 'canvas') &&
- this.imagePreloader.loadedFootages()
- ) {
- this.isLoaded = !0;
- var e = getExpressionsPlugin();
- e && e.initExpressions(this),
- this.renderer.initItems(),
- setTimeout(
- function () {
- this.trigger('DOMLoaded');
- }.bind(this),
- 0
- ),
- this.gotoFrame(),
- this.autoplay && this.play();
- }
- }),
- (AnimationItem.prototype.resize = function (e, t) {
- var r = typeof e == 'number' ? e : void 0,
- i = typeof t == 'number' ? t : void 0;
- this.renderer.updateContainerSize(r, i);
- }),
- (AnimationItem.prototype.setSubframe = function (e) {
- this.isSubframeEnabled = !!e;
- }),
- (AnimationItem.prototype.gotoFrame = function () {
- (this.currentFrame = this.isSubframeEnabled
- ? this.currentRawFrame
- : ~~this.currentRawFrame),
- this.timeCompleted !== this.totalFrames &&
- this.currentFrame > this.timeCompleted &&
- (this.currentFrame = this.timeCompleted),
- this.trigger('enterFrame'),
- this.renderFrame(),
- this.trigger('drawnFrame');
- }),
- (AnimationItem.prototype.renderFrame = function () {
- if (!(this.isLoaded === !1 || !this.renderer))
- try {
- this.renderer.renderFrame(this.currentFrame + this.firstFrame);
- } catch (e) {
- this.triggerRenderFrameError(e);
- }
- }),
- (AnimationItem.prototype.play = function (e) {
- (e && this.name !== e) ||
- (this.isPaused === !0 &&
- ((this.isPaused = !1),
- this.trigger('_pause'),
- this.audioController.resume(),
- this._idle && ((this._idle = !1), this.trigger('_active'))));
- }),
- (AnimationItem.prototype.pause = function (e) {
- (e && this.name !== e) ||
- (this.isPaused === !1 &&
- ((this.isPaused = !0),
- this.trigger('_play'),
- (this._idle = !0),
- this.trigger('_idle'),
- this.audioController.pause()));
- }),
- (AnimationItem.prototype.togglePause = function (e) {
- (e && this.name !== e) ||
- (this.isPaused === !0 ? this.play() : this.pause());
- }),
- (AnimationItem.prototype.stop = function (e) {
- (e && this.name !== e) ||
- (this.pause(),
- (this.playCount = 0),
- (this._completedLoop = !1),
- this.setCurrentRawFrameValue(0));
- }),
- (AnimationItem.prototype.getMarkerData = function (e) {
- for (var t, r = 0; r < this.markers.length; r += 1)
- if (((t = this.markers[r]), t.payload && t.payload.name === e))
- return t;
- return null;
- }),
- (AnimationItem.prototype.goToAndStop = function (e, t, r) {
- if (!(r && this.name !== r)) {
- var i = Number(e);
- if (isNaN(i)) {
- var s = this.getMarkerData(e);
- s && this.goToAndStop(s.time, !0);
- } else
- t
- ? this.setCurrentRawFrameValue(e)
- : this.setCurrentRawFrameValue(e * this.frameModifier);
- this.pause();
- }
- }),
- (AnimationItem.prototype.goToAndPlay = function (e, t, r) {
- if (!(r && this.name !== r)) {
- var i = Number(e);
- if (isNaN(i)) {
- var s = this.getMarkerData(e);
- s &&
- (s.duration
- ? this.playSegments([s.time, s.time + s.duration], !0)
- : this.goToAndStop(s.time, !0));
- } else this.goToAndStop(i, t, r);
- this.play();
- }
- }),
- (AnimationItem.prototype.advanceTime = function (e) {
- if (!(this.isPaused === !0 || this.isLoaded === !1)) {
- var t = this.currentRawFrame + e * this.frameModifier,
- r = !1;
- t >= this.totalFrames - 1 && this.frameModifier > 0
- ? !this.loop || this.playCount === this.loop
- ? this.checkSegments(
- t > this.totalFrames ? t % this.totalFrames : 0
- ) || ((r = !0), (t = this.totalFrames - 1))
- : t >= this.totalFrames
- ? ((this.playCount += 1),
- this.checkSegments(t % this.totalFrames) ||
- (this.setCurrentRawFrameValue(t % this.totalFrames),
- (this._completedLoop = !0),
- this.trigger('loopComplete')))
- : this.setCurrentRawFrameValue(t)
- : t < 0
- ? this.checkSegments(t % this.totalFrames) ||
- (this.loop && !(this.playCount-- <= 0 && this.loop !== !0)
- ? (this.setCurrentRawFrameValue(
- this.totalFrames + (t % this.totalFrames)
- ),
- this._completedLoop
- ? this.trigger('loopComplete')
- : (this._completedLoop = !0))
- : ((r = !0), (t = 0)))
- : this.setCurrentRawFrameValue(t),
- r &&
- (this.setCurrentRawFrameValue(t),
- this.pause(),
- this.trigger('complete'));
- }
- }),
- (AnimationItem.prototype.adjustSegment = function (e, t) {
- (this.playCount = 0),
- e[1] < e[0]
- ? (this.frameModifier > 0 &&
- (this.playSpeed < 0
- ? this.setSpeed(-this.playSpeed)
- : this.setDirection(-1)),
- (this.totalFrames = e[0] - e[1]),
- (this.timeCompleted = this.totalFrames),
- (this.firstFrame = e[1]),
- this.setCurrentRawFrameValue(this.totalFrames - 0.001 - t))
- : e[1] > e[0] &&
- (this.frameModifier < 0 &&
- (this.playSpeed < 0
- ? this.setSpeed(-this.playSpeed)
- : this.setDirection(1)),
- (this.totalFrames = e[1] - e[0]),
- (this.timeCompleted = this.totalFrames),
- (this.firstFrame = e[0]),
- this.setCurrentRawFrameValue(0.001 + t)),
- this.trigger('segmentStart');
- }),
- (AnimationItem.prototype.setSegment = function (e, t) {
- var r = -1;
- this.isPaused &&
- (this.currentRawFrame + this.firstFrame < e
- ? (r = e)
- : this.currentRawFrame + this.firstFrame > t && (r = t - e)),
- (this.firstFrame = e),
- (this.totalFrames = t - e),
- (this.timeCompleted = this.totalFrames),
- r !== -1 && this.goToAndStop(r, !0);
- }),
- (AnimationItem.prototype.playSegments = function (e, t) {
- if ((t && (this.segments.length = 0), _typeof$4(e[0]) === 'object')) {
- var r,
- i = e.length;
- for (r = 0; r < i; r += 1) this.segments.push(e[r]);
- } else this.segments.push(e);
- this.segments.length &&
- t &&
- this.adjustSegment(this.segments.shift(), 0),
- this.isPaused && this.play();
- }),
- (AnimationItem.prototype.resetSegments = function (e) {
- (this.segments.length = 0),
- this.segments.push([this.animationData.ip, this.animationData.op]),
- e && this.checkSegments(0);
- }),
- (AnimationItem.prototype.checkSegments = function (e) {
- return this.segments.length
- ? (this.adjustSegment(this.segments.shift(), e), !0)
- : !1;
- }),
- (AnimationItem.prototype.destroy = function (e) {
- (e && this.name !== e) ||
- !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));
- }),
- (AnimationItem.prototype.setCurrentRawFrameValue = function (e) {
- (this.currentRawFrame = e), this.gotoFrame();
- }),
- (AnimationItem.prototype.setSpeed = function (e) {
- (this.playSpeed = e), this.updaFrameModifier();
- }),
- (AnimationItem.prototype.setDirection = function (e) {
- (this.playDirection = e < 0 ? -1 : 1), this.updaFrameModifier();
- }),
- (AnimationItem.prototype.setLoop = function (e) {
- this.loop = e;
- }),
- (AnimationItem.prototype.setVolume = function (e, t) {
- (t && this.name !== t) || this.audioController.setVolume(e);
- }),
- (AnimationItem.prototype.getVolume = function () {
- return this.audioController.getVolume();
- }),
- (AnimationItem.prototype.mute = function (e) {
- (e && this.name !== e) || this.audioController.mute();
- }),
- (AnimationItem.prototype.unmute = function (e) {
- (e && this.name !== e) || this.audioController.unmute();
- }),
- (AnimationItem.prototype.updaFrameModifier = function () {
- (this.frameModifier =
- this.frameMult * this.playSpeed * this.playDirection),
- this.audioController.setRate(this.playSpeed * this.playDirection);
- }),
- (AnimationItem.prototype.getPath = function () {
- return this.path;
- }),
- (AnimationItem.prototype.getAssetsPath = function (e) {
- var t = '';
- if (e.e) t = e.p;
- else if (this.assetsPath) {
- var r = e.p;
- r.indexOf('images/') !== -1 && (r = r.split('/')[1]),
- (t = this.assetsPath + r);
- } else (t = this.path), (t += e.u ? e.u : ''), (t += e.p);
- return t;
- }),
- (AnimationItem.prototype.getAssetData = function (e) {
- for (var t = 0, r = this.assets.length; t < r; ) {
- if (e === this.assets[t].id) return this.assets[t];
- t += 1;
- }
- return null;
- }),
- (AnimationItem.prototype.hide = function () {
- this.renderer.hide();
- }),
- (AnimationItem.prototype.show = function () {
- this.renderer.show();
- }),
- (AnimationItem.prototype.getDuration = function (e) {
- return e ? this.totalFrames : this.totalFrames / this.frameRate;
- }),
- (AnimationItem.prototype.updateDocumentData = function (e, t, r) {
- try {
- var i = this.renderer.getElementByPath(e);
- i.updateDocumentData(t, r);
- } catch {}
- }),
- (AnimationItem.prototype.trigger = function (e) {
- if (this._cbs && this._cbs[e])
- switch (e) {
- case 'enterFrame':
- this.triggerEvent(
- e,
- new BMEnterFrameEvent(
- e,
- this.currentFrame,
- this.totalFrames,
- this.frameModifier
- )
- );
- break;
- case 'drawnFrame':
- (this.drawnFrameEvent.currentTime = this.currentFrame),
- (this.drawnFrameEvent.totalTime = this.totalFrames),
- (this.drawnFrameEvent.direction = this.frameModifier),
- this.triggerEvent(e, this.drawnFrameEvent);
- break;
- case 'loopComplete':
- this.triggerEvent(
- e,
- new BMCompleteLoopEvent(
- e,
- this.loop,
- this.playCount,
- this.frameMult
- )
- );
- break;
- case 'complete':
- this.triggerEvent(e, new BMCompleteEvent(e, this.frameMult));
- break;
- case 'segmentStart':
- this.triggerEvent(
- e,
- new BMSegmentStartEvent(e, this.firstFrame, this.totalFrames)
- );
- break;
- case 'destroy':
- this.triggerEvent(e, new BMDestroyEvent(e, this));
- break;
- default:
- this.triggerEvent(e);
- }
- e === 'enterFrame' &&
- this.onEnterFrame &&
- this.onEnterFrame.call(
- this,
- new BMEnterFrameEvent(
- e,
- this.currentFrame,
- this.totalFrames,
- this.frameMult
- )
- ),
- e === 'loopComplete' &&
- this.onLoopComplete &&
- this.onLoopComplete.call(
- this,
- new BMCompleteLoopEvent(
- e,
- this.loop,
- this.playCount,
- this.frameMult
- )
- ),
- e === 'complete' &&
- this.onComplete &&
- this.onComplete.call(
- this,
- new BMCompleteEvent(e, this.frameMult)
- ),
- e === 'segmentStart' &&
- this.onSegmentStart &&
- this.onSegmentStart.call(
- this,
- new BMSegmentStartEvent(e, this.firstFrame, this.totalFrames)
- ),
- e === 'destroy' &&
- this.onDestroy &&
- this.onDestroy.call(this, new BMDestroyEvent(e, this));
- }),
- (AnimationItem.prototype.triggerRenderFrameError = function (e) {
- var t = new BMRenderFrameErrorEvent(e, this.currentFrame);
- this.triggerEvent('error', t),
- this.onError && this.onError.call(this, t);
- }),
- (AnimationItem.prototype.triggerConfigError = function (e) {
- var t = new BMConfigErrorEvent(e, this.currentFrame);
- this.triggerEvent('error', t),
- this.onError && this.onError.call(this, t);
- });
- var animationManager = (function () {
- var e = {},
- t = [],
- r = 0,
- i = 0,
- s = 0,
- n = !0,
- a = !1;
- function o(F) {
- for (var k = 0, C = F.target; k < i; )
- t[k].animation === C &&
- (t.splice(k, 1), (k -= 1), (i -= 1), C.isPaused || S()),
- (k += 1);
- }
- function l(F, k) {
- if (!F) return null;
- for (var C = 0; C < i; ) {
- if (t[C].elem === F && t[C].elem !== null) return t[C].animation;
- C += 1;
- }
- var M = new AnimationItem();
- return p(M, F), M.setData(F, k), M;
- }
- function c() {
- var F,
- k = t.length,
- C = [];
- for (F = 0; F < k; F += 1) C.push(t[F].animation);
- return C;
- }
- function g() {
- (s += 1), V();
- }
- function S() {
- s -= 1;
- }
- function p(F, k) {
- F.addEventListener('destroy', o),
- F.addEventListener('_active', g),
- F.addEventListener('_idle', S),
- t.push({ elem: k, animation: F }),
- (i += 1);
- }
- function P(F) {
- var k = new AnimationItem();
- return p(k, null), k.setParams(F), k;
- }
- function b(F, k) {
- var C;
- for (C = 0; C < i; C += 1) t[C].animation.setSpeed(F, k);
- }
- function y(F, k) {
- var C;
- for (C = 0; C < i; C += 1) t[C].animation.setDirection(F, k);
- }
- function A(F) {
- var k;
- for (k = 0; k < i; k += 1) t[k].animation.play(F);
- }
- function u(F) {
- var k = F - r,
- C;
- for (C = 0; C < i; C += 1) t[C].animation.advanceTime(k);
- (r = F), s && !a ? window.requestAnimationFrame(u) : (n = !0);
- }
- function f(F) {
- (r = F), window.requestAnimationFrame(u);
- }
- function m(F) {
- var k;
- for (k = 0; k < i; k += 1) t[k].animation.pause(F);
- }
- function d(F, k, C) {
- var M;
- for (M = 0; M < i; M += 1) t[M].animation.goToAndStop(F, k, C);
- }
- function E(F) {
- var k;
- for (k = 0; k < i; k += 1) t[k].animation.stop(F);
- }
- function T(F) {
- var k;
- for (k = 0; k < i; k += 1) t[k].animation.togglePause(F);
- }
- function x(F) {
- var k;
- for (k = i - 1; k >= 0; k -= 1) t[k].animation.destroy(F);
- }
- function _(F, k, C) {
- var M = [].concat(
- [].slice.call(document.getElementsByClassName('lottie')),
- [].slice.call(document.getElementsByClassName('bodymovin'))
- ),
- R,
- L = M.length;
- for (R = 0; R < L; R += 1)
- C && M[R].setAttribute('data-bm-type', C), l(M[R], F);
- if (k && L === 0) {
- C || (C = 'svg');
- var j = document.getElementsByTagName('body')[0];
- j.innerText = '';
- var z = createTag('div');
- (z.style.width = '100%'),
- (z.style.height = '100%'),
- z.setAttribute('data-bm-type', C),
- j.appendChild(z),
- l(z, F);
- }
- }
- function I() {
- var F;
- for (F = 0; F < i; F += 1) t[F].animation.resize();
- }
- function V() {
- !a && s && n && (window.requestAnimationFrame(f), (n = !1));
- }
- function D() {
- a = !0;
- }
- function N() {
- (a = !1), V();
- }
- function $(F, k) {
- var C;
- for (C = 0; C < i; C += 1) t[C].animation.setVolume(F, k);
- }
- function O(F) {
- var k;
- for (k = 0; k < i; k += 1) t[k].animation.mute(F);
- }
- function B(F) {
- var k;
- for (k = 0; k < i; k += 1) t[k].animation.unmute(F);
- }
- return (
- (e.registerAnimation = l),
- (e.loadAnimation = P),
- (e.setSpeed = b),
- (e.setDirection = y),
- (e.play = A),
- (e.pause = m),
- (e.stop = E),
- (e.togglePause = T),
- (e.searchAnimations = _),
- (e.resize = I),
- (e.goToAndStop = d),
- (e.destroy = x),
- (e.freeze = D),
- (e.unfreeze = N),
- (e.setVolume = $),
- (e.mute = O),
- (e.unmute = B),
- (e.getRegisteredAnimations = c),
- e
- );
- })(),
- BezierFactory = (function () {
- var e = {};
- e.getBezierEasing = r;
- var t = {};
- function r(f, m, d, E, T) {
- var x =
- T ||
- ('bez_' + f + '_' + m + '_' + d + '_' + E).replace(/\./g, 'p');
- if (t[x]) return t[x];
- var _ = new u([f, m, d, E]);
- return (t[x] = _), _;
- }
- var i = 4,
- s = 0.001,
- n = 1e-7,
- a = 10,
- o = 11,
- l = 1 / (o - 1),
- c = typeof Float32Array == 'function';
- function g(f, m) {
- return 1 - 3 * m + 3 * f;
- }
- function S(f, m) {
- return 3 * m - 6 * f;
- }
- function p(f) {
- return 3 * f;
- }
- function P(f, m, d) {
- return ((g(m, d) * f + S(m, d)) * f + p(m)) * f;
- }
- function b(f, m, d) {
- return 3 * g(m, d) * f * f + 2 * S(m, d) * f + p(m);
- }
- function y(f, m, d, E, T) {
- var x,
- _,
- I = 0;
- do
- (_ = m + (d - m) / 2),
- (x = P(_, E, T) - f),
- x > 0 ? (d = _) : (m = _);
- while (Math.abs(x) > n && ++I < a);
- return _;
- }
- function A(f, m, d, E) {
- for (var T = 0; T < i; ++T) {
- var x = b(m, d, E);
- if (x === 0) return m;
- var _ = P(m, d, E) - f;
- m -= _ / x;
- }
- return m;
- }
- function u(f) {
- (this._p = f),
- (this._mSampleValues = c ? new Float32Array(o) : new Array(o)),
- (this._precomputed = !1),
- (this.get = this.get.bind(this));
- }
- return (
- (u.prototype = {
- get: function (m) {
- var d = this._p[0],
- E = this._p[1],
- T = this._p[2],
- x = this._p[3];
- return (
- this._precomputed || this._precompute(),
- d === E && T === x
- ? m
- : m === 0
- ? 0
- : m === 1
- ? 1
- : P(this._getTForX(m), E, x)
- );
- },
- _precompute: function () {
- var m = this._p[0],
- d = this._p[1],
- E = this._p[2],
- T = this._p[3];
- (this._precomputed = !0),
- (m !== d || E !== T) && this._calcSampleValues();
- },
- _calcSampleValues: function () {
- for (var m = this._p[0], d = this._p[2], E = 0; E < o; ++E)
- this._mSampleValues[E] = P(E * l, m, d);
- },
- _getTForX: function (m) {
- for (
- var d = this._p[0],
- E = this._p[2],
- T = this._mSampleValues,
- x = 0,
- _ = 1,
- I = o - 1;
- _ !== I && T[_] <= m;
- ++_
- )
- x += l;
- --_;
- var V = (m - T[_]) / (T[_ + 1] - T[_]),
- D = x + V * l,
- N = b(D, d, E);
- return N >= s
- ? A(m, D, d, E)
- : N === 0
- ? D
- : y(m, x, x + l, d, E);
- }
- }),
- e
- );
- })(),
- pooling = (function () {
- function e(t) {
- return t.concat(createSizedArray(t.length));
- }
- return { double: e };
- })(),
- poolFactory = (function () {
- return function (e, t, r) {
- var i = 0,
- s = e,
- n = createSizedArray(s),
- a = { newElement: o, release: l };
- function o() {
- var c;
- return i ? ((i -= 1), (c = n[i])) : (c = t()), c;
- }
- function l(c) {
- i === s && ((n = pooling.double(n)), (s *= 2)),
- r && r(c),
- (n[i] = c),
- (i += 1);
- }
- return a;
- };
- })(),
- bezierLengthPool = (function () {
- function e() {
- return {
- addedLength: 0,
- percents: createTypedArray('float32', getDefaultCurveSegments()),
- lengths: createTypedArray('float32', getDefaultCurveSegments())
- };
- }
- return poolFactory(8, e);
- })(),
- segmentsLengthPool = (function () {
- function e() {
- return { lengths: [], totalLength: 0 };
- }
- function t(r) {
- var i,
- s = r.lengths.length;
- for (i = 0; i < s; i += 1) bezierLengthPool.release(r.lengths[i]);
- r.lengths.length = 0;
- }
- return poolFactory(8, e, t);
- })();
- function bezFunction() {
- var e = Math;
- function t(p, P, b, y, A, u) {
- var f = p * y + P * A + b * u - A * y - u * p - b * P;
- return f > -0.001 && f < 0.001;
- }
- function r(p, P, b, y, A, u, f, m, d) {
- if (b === 0 && u === 0 && d === 0) return t(p, P, y, A, f, m);
- var E = e.sqrt(e.pow(y - p, 2) + e.pow(A - P, 2) + e.pow(u - b, 2)),
- T = e.sqrt(e.pow(f - p, 2) + e.pow(m - P, 2) + e.pow(d - b, 2)),
- x = e.sqrt(e.pow(f - y, 2) + e.pow(m - A, 2) + e.pow(d - u, 2)),
- _;
- return (
- E > T
- ? E > x
- ? (_ = E - T - x)
- : (_ = x - T - E)
- : x > T
- ? (_ = x - T - E)
- : (_ = T - E - x),
- _ > -1e-4 && _ < 1e-4
- );
- }
- var i = (function () {
- return function (p, P, b, y) {
- var A = getDefaultCurveSegments(),
- u,
- f,
- m,
- d,
- E,
- T = 0,
- x,
- _ = [],
- I = [],
- V = bezierLengthPool.newElement();
- for (m = b.length, u = 0; u < A; u += 1) {
- for (E = u / (A - 1), x = 0, f = 0; f < m; f += 1)
- (d =
- bmPow(1 - E, 3) * p[f] +
- 3 * bmPow(1 - E, 2) * E * b[f] +
- 3 * (1 - E) * bmPow(E, 2) * y[f] +
- bmPow(E, 3) * P[f]),
- (_[f] = d),
- I[f] !== null && (x += bmPow(_[f] - I[f], 2)),
- (I[f] = _[f]);
- x && ((x = bmSqrt(x)), (T += x)),
- (V.percents[u] = E),
- (V.lengths[u] = T);
- }
- return (V.addedLength = T), V;
- };
- })();
- function s(p) {
- var P = segmentsLengthPool.newElement(),
- b = p.c,
- y = p.v,
- A = p.o,
- u = p.i,
- f,
- m = p._length,
- d = P.lengths,
- E = 0;
- for (f = 0; f < m - 1; f += 1)
- (d[f] = i(y[f], y[f + 1], A[f], u[f + 1])), (E += d[f].addedLength);
- return (
- b &&
- m &&
- ((d[f] = i(y[f], y[0], A[f], u[0])), (E += d[f].addedLength)),
- (P.totalLength = E),
- P
- );
- }
- function n(p) {
- (this.segmentLength = 0), (this.points = new Array(p));
- }
- function a(p, P) {
- (this.partialLength = p), (this.point = P);
- }
- var o = (function () {
- var p = {};
- return function (P, b, y, A) {
- var u = (
- P[0] +
- '_' +
- P[1] +
- '_' +
- b[0] +
- '_' +
- b[1] +
- '_' +
- y[0] +
- '_' +
- y[1] +
- '_' +
- A[0] +
- '_' +
- A[1]
- ).replace(/\./g, 'p');
- if (!p[u]) {
- var f = getDefaultCurveSegments(),
- m,
- d,
- E,
- T,
- x,
- _ = 0,
- I,
- V,
- D = null;
- P.length === 2 &&
- (P[0] !== b[0] || P[1] !== b[1]) &&
- t(P[0], P[1], b[0], b[1], P[0] + y[0], P[1] + y[1]) &&
- t(P[0], P[1], b[0], b[1], b[0] + A[0], b[1] + A[1]) &&
- (f = 2);
- var N = new n(f);
- for (E = y.length, m = 0; m < f; m += 1) {
- for (
- V = createSizedArray(E), x = m / (f - 1), I = 0, d = 0;
- d < E;
- d += 1
- )
- (T =
- bmPow(1 - x, 3) * P[d] +
- 3 * bmPow(1 - x, 2) * x * (P[d] + y[d]) +
- 3 * (1 - x) * bmPow(x, 2) * (b[d] + A[d]) +
- bmPow(x, 3) * b[d]),
- (V[d] = T),
- D !== null && (I += bmPow(V[d] - D[d], 2));
- (I = bmSqrt(I)), (_ += I), (N.points[m] = new a(I, V)), (D = V);
- }
- (N.segmentLength = _), (p[u] = N);
- }
- return p[u];
- };
- })();
- function l(p, P) {
- var b = P.percents,
- y = P.lengths,
- A = b.length,
- u = bmFloor((A - 1) * p),
- f = p * P.addedLength,
- m = 0;
- if (u === A - 1 || u === 0 || f === y[u]) return b[u];
- for (var d = y[u] > f ? -1 : 1, E = !0; E; )
- if (
- (y[u] <= f && y[u + 1] > f
- ? ((m = (f - y[u]) / (y[u + 1] - y[u])), (E = !1))
- : (u += d),
- u < 0 || u >= A - 1)
- ) {
- if (u === A - 1) return b[u];
- E = !1;
- }
- return b[u] + (b[u + 1] - b[u]) * m;
- }
- function c(p, P, b, y, A, u) {
- var f = l(A, u),
- m = 1 - f,
- d =
- e.round(
- (m * m * m * p[0] +
- (f * m * m + m * f * m + m * m * f) * b[0] +
- (f * f * m + m * f * f + f * m * f) * y[0] +
- f * f * f * P[0]) *
- 1e3
- ) / 1e3,
- E =
- e.round(
- (m * m * m * p[1] +
- (f * m * m + m * f * m + m * m * f) * b[1] +
- (f * f * m + m * f * f + f * m * f) * y[1] +
- f * f * f * P[1]) *
- 1e3
- ) / 1e3;
- return [d, E];
- }
- var g = createTypedArray('float32', 8);
- function S(p, P, b, y, A, u, f) {
- A < 0 ? (A = 0) : A > 1 && (A = 1);
- var m = l(A, f);
- u = u > 1 ? 1 : u;
- var d = l(u, f),
- E,
- T = p.length,
- x = 1 - m,
- _ = 1 - d,
- I = x * x * x,
- V = m * x * x * 3,
- D = m * m * x * 3,
- N = m * m * m,
- $ = x * x * _,
- O = m * x * _ + x * m * _ + x * x * d,
- B = m * m * _ + x * m * d + m * x * d,
- F = m * m * d,
- k = x * _ * _,
- C = m * _ * _ + x * d * _ + x * _ * d,
- M = m * d * _ + x * d * d + m * _ * d,
- R = m * d * d,
- L = _ * _ * _,
- j = d * _ * _ + _ * d * _ + _ * _ * d,
- z = d * d * _ + _ * d * d + d * _ * d,
- H = d * d * d;
- for (E = 0; E < T; E += 1)
- (g[E * 4] =
- e.round((I * p[E] + V * b[E] + D * y[E] + N * P[E]) * 1e3) / 1e3),
- (g[E * 4 + 1] =
- e.round(($ * p[E] + O * b[E] + B * y[E] + F * P[E]) * 1e3) /
- 1e3),
- (g[E * 4 + 2] =
- e.round((k * p[E] + C * b[E] + M * y[E] + R * P[E]) * 1e3) /
- 1e3),
- (g[E * 4 + 3] =
- e.round((L * p[E] + j * b[E] + z * y[E] + H * P[E]) * 1e3) /
- 1e3);
- return g;
- }
- return {
- getSegmentsLength: s,
- getNewSegment: S,
- getPointInSegment: c,
- buildBezierData: o,
- pointOnLine2D: t,
- pointOnLine3D: r
- };
- }
- var bez = bezFunction(),
- initFrame = initialDefaultFrame,
- mathAbs = Math.abs;
- function interpolateValue(e, t) {
- var r = this.offsetTime,
- i;
- this.propType === 'multidimensional' &&
- (i = createTypedArray('float32', this.pv.length));
- for (
- var s = t.lastIndex,
- n = s,
- a = this.keyframes.length - 1,
- o = !0,
- l,
- c,
- g;
- o;
- ) {
- if (
- ((l = this.keyframes[n]),
- (c = this.keyframes[n + 1]),
- n === a - 1 && e >= c.t - r)
- ) {
- l.h && (l = c), (s = 0);
- break;
- }
- if (c.t - r > e) {
- s = n;
- break;
- }
- n < a - 1 ? (n += 1) : ((s = 0), (o = !1));
- }
- g = this.keyframesMetadata[n] || {};
- var S,
- p,
- P,
- b,
- y,
- A,
- u = c.t - r,
- f = l.t - r,
- m;
- if (l.to) {
- g.bezierData ||
- (g.bezierData = bez.buildBezierData(l.s, c.s || l.e, l.to, l.ti));
- var d = g.bezierData;
- if (e >= u || e < f) {
- var E = e >= u ? d.points.length - 1 : 0;
- for (p = d.points[E].point.length, S = 0; S < p; S += 1)
- i[S] = d.points[E].point[S];
- } else {
- g.__fnct
- ? (A = g.__fnct)
- : ((A = BezierFactory.getBezierEasing(
- l.o.x,
- l.o.y,
- l.i.x,
- l.i.y,
- l.n
- ).get),
- (g.__fnct = A)),
- (P = A((e - f) / (u - f)));
- var T = d.segmentLength * P,
- x,
- _ =
- t.lastFrame < e && t._lastKeyframeIndex === n
- ? t._lastAddedLength
- : 0;
- for (
- y =
- t.lastFrame < e && t._lastKeyframeIndex === n
- ? t._lastPoint
- : 0,
- o = !0,
- b = d.points.length;
- o;
- ) {
- if (
- ((_ += d.points[y].partialLength),
- T === 0 || P === 0 || y === d.points.length - 1)
- ) {
- for (p = d.points[y].point.length, S = 0; S < p; S += 1)
- i[S] = d.points[y].point[S];
- break;
- } else if (T >= _ && T < _ + d.points[y + 1].partialLength) {
- for (
- x = (T - _) / d.points[y + 1].partialLength,
- p = d.points[y].point.length,
- S = 0;
- S < p;
- S += 1
- )
- i[S] =
- d.points[y].point[S] +
- (d.points[y + 1].point[S] - d.points[y].point[S]) * x;
- break;
- }
- y < b - 1 ? (y += 1) : (o = !1);
- }
- (t._lastPoint = y),
- (t._lastAddedLength = _ - d.points[y].partialLength),
- (t._lastKeyframeIndex = n);
- }
- } else {
- var I, V, D, N, $;
- if (((a = l.s.length), (m = c.s || l.e), this.sh && l.h !== 1))
- if (e >= u) (i[0] = m[0]), (i[1] = m[1]), (i[2] = m[2]);
- else if (e <= f) (i[0] = l.s[0]), (i[1] = l.s[1]), (i[2] = l.s[2]);
- else {
- var O = createQuaternion(l.s),
- B = createQuaternion(m),
- F = (e - f) / (u - f);
- quaternionToEuler(i, slerp(O, B, F));
- }
- else
- for (n = 0; n < a; n += 1)
- l.h !== 1 &&
- (e >= u
- ? (P = 1)
- : e < f
- ? (P = 0)
- : (l.o.x.constructor === Array
- ? (g.__fnct || (g.__fnct = []),
- g.__fnct[n]
- ? (A = g.__fnct[n])
- : ((I = l.o.x[n] === void 0 ? l.o.x[0] : l.o.x[n]),
- (V = l.o.y[n] === void 0 ? l.o.y[0] : l.o.y[n]),
- (D = l.i.x[n] === void 0 ? l.i.x[0] : l.i.x[n]),
- (N = l.i.y[n] === void 0 ? l.i.y[0] : l.i.y[n]),
- (A = BezierFactory.getBezierEasing(I, V, D, N).get),
- (g.__fnct[n] = A)))
- : g.__fnct
- ? (A = g.__fnct)
- : ((I = l.o.x),
- (V = l.o.y),
- (D = l.i.x),
- (N = l.i.y),
- (A = BezierFactory.getBezierEasing(I, V, D, N).get),
- (l.keyframeMetadata = A)),
- (P = A((e - f) / (u - f))))),
- (m = c.s || l.e),
- ($ = l.h === 1 ? l.s[n] : l.s[n] + (m[n] - l.s[n]) * P),
- this.propType === 'multidimensional' ? (i[n] = $) : (i = $);
- }
- return (t.lastIndex = s), i;
- }
- function slerp(e, t, r) {
- var i = [],
- s = e[0],
- n = e[1],
- a = e[2],
- o = e[3],
- l = t[0],
- c = t[1],
- g = t[2],
- S = t[3],
- p,
- P,
- b,
- y,
- A;
- return (
- (P = s * l + n * c + a * g + o * S),
- P < 0 && ((P = -P), (l = -l), (c = -c), (g = -g), (S = -S)),
- 1 - P > 1e-6
- ? ((p = Math.acos(P)),
- (b = Math.sin(p)),
- (y = Math.sin((1 - r) * p) / b),
- (A = Math.sin(r * p) / b))
- : ((y = 1 - r), (A = r)),
- (i[0] = y * s + A * l),
- (i[1] = y * n + A * c),
- (i[2] = y * a + A * g),
- (i[3] = y * o + A * S),
- i
- );
- }
- function quaternionToEuler(e, t) {
- var r = t[0],
- i = t[1],
- s = t[2],
- n = t[3],
- a = Math.atan2(2 * i * n - 2 * r * s, 1 - 2 * i * i - 2 * s * s),
- o = Math.asin(2 * r * i + 2 * s * n),
- l = Math.atan2(2 * r * n - 2 * i * s, 1 - 2 * r * r - 2 * s * s);
- (e[0] = a / degToRads), (e[1] = o / degToRads), (e[2] = l / degToRads);
- }
- function createQuaternion(e) {
- var t = e[0] * degToRads,
- r = e[1] * degToRads,
- i = e[2] * degToRads,
- s = Math.cos(t / 2),
- n = Math.cos(r / 2),
- a = Math.cos(i / 2),
- o = Math.sin(t / 2),
- l = Math.sin(r / 2),
- c = Math.sin(i / 2),
- g = s * n * a - o * l * c,
- S = o * l * a + s * n * c,
- p = o * n * a + s * l * c,
- P = s * l * a - o * n * c;
- return [S, p, P, g];
- }
- function getValueAtCurrentTime() {
- var e = this.comp.renderedFrame - this.offsetTime,
- t = this.keyframes[0].t - this.offsetTime,
- r = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
- if (
- !(
- e === this._caching.lastFrame ||
- (this._caching.lastFrame !== initFrame &&
- ((this._caching.lastFrame >= r && e >= r) ||
- (this._caching.lastFrame < t && e < t)))
- )
- ) {
- this._caching.lastFrame >= e &&
- ((this._caching._lastKeyframeIndex = -1),
- (this._caching.lastIndex = 0));
- var i = this.interpolateValue(e, this._caching);
- this.pv = i;
- }
- return (this._caching.lastFrame = e), this.pv;
- }
- function setVValue(e) {
- var t;
- if (this.propType === 'unidimensional')
- (t = e * this.mult),
- mathAbs(this.v - t) > 1e-5 && ((this.v = t), (this._mdf = !0));
- else
- for (var r = 0, i = this.v.length; r < i; )
- (t = e[r] * this.mult),
- mathAbs(this.v[r] - t) > 1e-5 &&
- ((this.v[r] = t), (this._mdf = !0)),
- (r += 1);
- }
- function processEffectsSequence() {
- if (
- !(
- this.elem.globalData.frameId === this.frameId ||
- !this.effectsSequence.length
- )
- ) {
- if (this.lock) {
- this.setVValue(this.pv);
- return;
- }
- (this.lock = !0), (this._mdf = this._isFirstFrame);
- var e,
- t = this.effectsSequence.length,
- r = this.kf ? this.pv : this.data.k;
- for (e = 0; e < t; e += 1) r = this.effectsSequence[e](r);
- this.setVValue(r),
- (this._isFirstFrame = !1),
- (this.lock = !1),
- (this.frameId = this.elem.globalData.frameId);
- }
- }
- function addEffect(e) {
- this.effectsSequence.push(e), this.container.addDynamicProperty(this);
- }
- function ValueProperty(e, t, r, i) {
- (this.propType = 'unidimensional'),
- (this.mult = r || 1),
- (this.data = t),
- (this.v = r ? t.k * r : t.k),
- (this.pv = t.k),
- (this._mdf = !1),
- (this.elem = e),
- (this.container = i),
- (this.comp = e.comp),
- (this.k = !1),
- (this.kf = !1),
- (this.vel = 0),
- (this.effectsSequence = []),
- (this._isFirstFrame = !0),
- (this.getValue = processEffectsSequence),
- (this.setVValue = setVValue),
- (this.addEffect = addEffect);
- }
- function MultiDimensionalProperty(e, t, r, i) {
- (this.propType = 'multidimensional'),
- (this.mult = r || 1),
- (this.data = t),
- (this._mdf = !1),
- (this.elem = e),
- (this.container = i),
- (this.comp = e.comp),
- (this.k = !1),
- (this.kf = !1),
- (this.frameId = -1);
- var s,
- n = t.k.length;
- for (
- this.v = createTypedArray('float32', n),
- this.pv = createTypedArray('float32', n),
- this.vel = createTypedArray('float32', n),
- s = 0;
- s < n;
- s += 1
- )
- (this.v[s] = t.k[s] * this.mult), (this.pv[s] = t.k[s]);
- (this._isFirstFrame = !0),
- (this.effectsSequence = []),
- (this.getValue = processEffectsSequence),
- (this.setVValue = setVValue),
- (this.addEffect = addEffect);
- }
- function KeyframedValueProperty(e, t, r, i) {
- (this.propType = 'unidimensional'),
- (this.keyframes = t.k),
- (this.keyframesMetadata = []),
- (this.offsetTime = e.data.st),
- (this.frameId = -1),
- (this._caching = {
- lastFrame: initFrame,
- lastIndex: 0,
- value: 0,
- _lastKeyframeIndex: -1
- }),
- (this.k = !0),
- (this.kf = !0),
- (this.data = t),
- (this.mult = r || 1),
- (this.elem = e),
- (this.container = i),
- (this.comp = e.comp),
- (this.v = initFrame),
- (this.pv = initFrame),
- (this._isFirstFrame = !0),
- (this.getValue = processEffectsSequence),
- (this.setVValue = setVValue),
- (this.interpolateValue = interpolateValue),
- (this.effectsSequence = [getValueAtCurrentTime.bind(this)]),
- (this.addEffect = addEffect);
- }
- function KeyframedMultidimensionalProperty(e, t, r, i) {
- this.propType = 'multidimensional';
- var s,
- n = t.k.length,
- a,
- o,
- l,
- c;
- for (s = 0; s < n - 1; s += 1)
- t.k[s].to &&
- t.k[s].s &&
- t.k[s + 1] &&
- t.k[s + 1].s &&
- ((a = t.k[s].s),
- (o = t.k[s + 1].s),
- (l = t.k[s].to),
- (c = t.k[s].ti),
- ((a.length === 2 &&
- !(a[0] === o[0] && a[1] === o[1]) &&
- bez.pointOnLine2D(
- a[0],
- a[1],
- o[0],
- o[1],
- a[0] + l[0],
- a[1] + l[1]
- ) &&
- bez.pointOnLine2D(
- a[0],
- a[1],
- o[0],
- o[1],
- o[0] + c[0],
- o[1] + c[1]
- )) ||
- (a.length === 3 &&
- !(a[0] === o[0] && a[1] === o[1] && a[2] === o[2]) &&
- bez.pointOnLine3D(
- a[0],
- a[1],
- a[2],
- o[0],
- o[1],
- o[2],
- a[0] + l[0],
- a[1] + l[1],
- a[2] + l[2]
- ) &&
- bez.pointOnLine3D(
- a[0],
- a[1],
- a[2],
- o[0],
- o[1],
- o[2],
- o[0] + c[0],
- o[1] + c[1],
- o[2] + c[2]
- ))) &&
- ((t.k[s].to = null), (t.k[s].ti = null)),
- a[0] === o[0] &&
- a[1] === o[1] &&
- l[0] === 0 &&
- l[1] === 0 &&
- c[0] === 0 &&
- c[1] === 0 &&
- (a.length === 2 || (a[2] === o[2] && l[2] === 0 && c[2] === 0)) &&
- ((t.k[s].to = null), (t.k[s].ti = null)));
- (this.effectsSequence = [getValueAtCurrentTime.bind(this)]),
- (this.data = t),
- (this.keyframes = t.k),
- (this.keyframesMetadata = []),
- (this.offsetTime = e.data.st),
- (this.k = !0),
- (this.kf = !0),
- (this._isFirstFrame = !0),
- (this.mult = r || 1),
- (this.elem = e),
- (this.container = i),
- (this.comp = e.comp),
- (this.getValue = processEffectsSequence),
- (this.setVValue = setVValue),
- (this.interpolateValue = interpolateValue),
- (this.frameId = -1);
- var g = t.k[0].s.length;
- for (
- this.v = createTypedArray('float32', g),
- this.pv = createTypedArray('float32', g),
- s = 0;
- s < g;
- s += 1
- )
- (this.v[s] = initFrame), (this.pv[s] = initFrame);
- (this._caching = {
- lastFrame: initFrame,
- lastIndex: 0,
- value: createTypedArray('float32', g)
- }),
- (this.addEffect = addEffect);
- }
- var PropertyFactory = (function () {
- function e(r, i, s, n, a) {
- i.sid && (i = r.globalData.slotManager.getProp(i));
- var o;
- if (!i.k.length) o = new ValueProperty(r, i, n, a);
- else if (typeof i.k[0] == 'number')
- o = new MultiDimensionalProperty(r, i, n, a);
- else
- switch (s) {
- case 0:
- o = new KeyframedValueProperty(r, i, n, a);
- break;
- case 1:
- o = new KeyframedMultidimensionalProperty(r, i, n, a);
- break;
- }
- return o.effectsSequence.length && a.addDynamicProperty(o), o;
- }
- var t = { getProp: e };
- return t;
- })();
- function DynamicPropertyContainer() {}
- DynamicPropertyContainer.prototype = {
- addDynamicProperty: function (t) {
- this.dynamicProperties.indexOf(t) === -1 &&
- (this.dynamicProperties.push(t),
- this.container.addDynamicProperty(this),
- (this._isAnimated = !0));
- },
- iterateDynamicProperties: function () {
- this._mdf = !1;
- var t,
- r = this.dynamicProperties.length;
- for (t = 0; t < r; t += 1)
- this.dynamicProperties[t].getValue(),
- this.dynamicProperties[t]._mdf && (this._mdf = !0);
- },
- initDynamicPropertyContainer: function (t) {
- (this.container = t),
- (this.dynamicProperties = []),
- (this._mdf = !1),
- (this._isAnimated = !1);
- }
- };
- var pointPool = (function () {
- function e() {
- return createTypedArray('float32', 2);
- }
- return poolFactory(8, e);
- })();
- function ShapePath() {
- (this.c = !1),
- (this._length = 0),
- (this._maxLength = 8),
- (this.v = createSizedArray(this._maxLength)),
- (this.o = createSizedArray(this._maxLength)),
- (this.i = createSizedArray(this._maxLength));
- }
- (ShapePath.prototype.setPathData = function (e, t) {
- (this.c = e), this.setLength(t);
- for (var r = 0; r < t; )
- (this.v[r] = pointPool.newElement()),
- (this.o[r] = pointPool.newElement()),
- (this.i[r] = pointPool.newElement()),
- (r += 1);
- }),
- (ShapePath.prototype.setLength = function (e) {
- for (; this._maxLength < e; ) this.doubleArrayLength();
- this._length = e;
- }),
- (ShapePath.prototype.doubleArrayLength = function () {
- (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);
- }),
- (ShapePath.prototype.setXYAt = function (e, t, r, i, s) {
- var n;
- switch (
- ((this._length = Math.max(this._length, i + 1)),
- this._length >= this._maxLength && this.doubleArrayLength(),
- r)
- ) {
- case 'v':
- n = this.v;
- break;
- case 'i':
- n = this.i;
- break;
- case 'o':
- n = this.o;
- break;
- default:
- n = [];
- break;
- }
- (!n[i] || (n[i] && !s)) && (n[i] = pointPool.newElement()),
- (n[i][0] = e),
- (n[i][1] = t);
- }),
- (ShapePath.prototype.setTripleAt = function (e, t, r, i, s, n, a, o) {
- this.setXYAt(e, t, 'v', a, o),
- this.setXYAt(r, i, 'o', a, o),
- this.setXYAt(s, n, 'i', a, o);
- }),
- (ShapePath.prototype.reverse = function () {
- var e = new ShapePath();
- e.setPathData(this.c, this._length);
- var t = this.v,
- r = this.o,
- i = this.i,
- s = 0;
- this.c &&
- (e.setTripleAt(
- t[0][0],
- t[0][1],
- i[0][0],
- i[0][1],
- r[0][0],
- r[0][1],
- 0,
- !1
- ),
- (s = 1));
- var n = this._length - 1,
- a = this._length,
- o;
- for (o = s; o < a; o += 1)
- e.setTripleAt(
- t[n][0],
- t[n][1],
- i[n][0],
- i[n][1],
- r[n][0],
- r[n][1],
- o,
- !1
- ),
- (n -= 1);
- return e;
- }),
- (ShapePath.prototype.length = function () {
- return this._length;
- });
- var shapePool = (function () {
- function e() {
- return new ShapePath();
- }
- function t(s) {
- var n = s._length,
- a;
- for (a = 0; a < n; a += 1)
- pointPool.release(s.v[a]),
- pointPool.release(s.i[a]),
- pointPool.release(s.o[a]),
- (s.v[a] = null),
- (s.i[a] = null),
- (s.o[a] = null);
- (s._length = 0), (s.c = !1);
- }
- function r(s) {
- var n = i.newElement(),
- a,
- o = s._length === void 0 ? s.v.length : s._length;
- for (n.setLength(o), n.c = s.c, a = 0; a < o; a += 1)
- n.setTripleAt(
- s.v[a][0],
- s.v[a][1],
- s.o[a][0],
- s.o[a][1],
- s.i[a][0],
- s.i[a][1],
- a
- );
- return n;
- }
- var i = poolFactory(4, e, t);
- return (i.clone = r), i;
- })();
- function ShapeCollection() {
- (this._length = 0),
- (this._maxLength = 4),
- (this.shapes = createSizedArray(this._maxLength));
- }
- (ShapeCollection.prototype.addShape = function (e) {
- this._length === this._maxLength &&
- ((this.shapes = this.shapes.concat(
- createSizedArray(this._maxLength)
- )),
- (this._maxLength *= 2)),
- (this.shapes[this._length] = e),
- (this._length += 1);
- }),
- (ShapeCollection.prototype.releaseShapes = function () {
- var e;
- for (e = 0; e < this._length; e += 1)
- shapePool.release(this.shapes[e]);
- this._length = 0;
- });
- var shapeCollectionPool = (function () {
- var e = { newShapeCollection: s, release: n },
- t = 0,
- r = 4,
- i = createSizedArray(r);
- function s() {
- var a;
- return t ? ((t -= 1), (a = i[t])) : (a = new ShapeCollection()), a;
- }
- function n(a) {
- var o,
- l = a._length;
- for (o = 0; o < l; o += 1) shapePool.release(a.shapes[o]);
- (a._length = 0),
- t === r && ((i = pooling.double(i)), (r *= 2)),
- (i[t] = a),
- (t += 1);
- }
- return e;
- })(),
- ShapePropertyFactory = (function () {
- var e = -999999;
- function t(u, f, m) {
- var d = m.lastIndex,
- E,
- T,
- x,
- _,
- I,
- V,
- D,
- N,
- $,
- O = this.keyframes;
- if (u < O[0].t - this.offsetTime)
- (E = O[0].s[0]), (x = !0), (d = 0);
- else if (u >= O[O.length - 1].t - this.offsetTime)
- (E = O[O.length - 1].s
- ? O[O.length - 1].s[0]
- : O[O.length - 2].e[0]),
- (x = !0);
- else {
- for (
- var B = d, F = O.length - 1, k = !0, C, M, R;
- k && ((C = O[B]), (M = O[B + 1]), !(M.t - this.offsetTime > u));
- )
- B < F - 1 ? (B += 1) : (k = !1);
- if (
- ((R = this.keyframesMetadata[B] || {}),
- (x = C.h === 1),
- (d = B),
- !x)
- ) {
- if (u >= M.t - this.offsetTime) N = 1;
- else if (u < C.t - this.offsetTime) N = 0;
- else {
- var L;
- R.__fnct
- ? (L = R.__fnct)
- : ((L = BezierFactory.getBezierEasing(
- C.o.x,
- C.o.y,
- C.i.x,
- C.i.y
- ).get),
- (R.__fnct = L)),
- (N = L(
- (u - (C.t - this.offsetTime)) /
- (M.t - this.offsetTime - (C.t - this.offsetTime))
- ));
- }
- T = M.s ? M.s[0] : C.e[0];
- }
- E = C.s[0];
- }
- for (
- V = f._length, D = E.i[0].length, m.lastIndex = d, _ = 0;
- _ < V;
- _ += 1
- )
- for (I = 0; I < D; I += 1)
- ($ = x ? E.i[_][I] : E.i[_][I] + (T.i[_][I] - E.i[_][I]) * N),
- (f.i[_][I] = $),
- ($ = x ? E.o[_][I] : E.o[_][I] + (T.o[_][I] - E.o[_][I]) * N),
- (f.o[_][I] = $),
- ($ = x ? E.v[_][I] : E.v[_][I] + (T.v[_][I] - E.v[_][I]) * N),
- (f.v[_][I] = $);
- }
- function r() {
- var u = this.comp.renderedFrame - this.offsetTime,
- f = this.keyframes[0].t - this.offsetTime,
- m = this.keyframes[this.keyframes.length - 1].t - this.offsetTime,
- d = this._caching.lastFrame;
- return (
- (d !== e && ((d < f && u < f) || (d > m && u > m))) ||
- ((this._caching.lastIndex =
- d < u ? this._caching.lastIndex : 0),
- this.interpolateShape(u, this.pv, this._caching)),
- (this._caching.lastFrame = u),
- this.pv
- );
- }
- function i() {
- this.paths = this.localShapeCollection;
- }
- function s(u, f) {
- if (u._length !== f._length || u.c !== f.c) return !1;
- var m,
- d = u._length;
- for (m = 0; m < d; m += 1)
- if (
- u.v[m][0] !== f.v[m][0] ||
- u.v[m][1] !== f.v[m][1] ||
- u.o[m][0] !== f.o[m][0] ||
- u.o[m][1] !== f.o[m][1] ||
- u.i[m][0] !== f.i[m][0] ||
- u.i[m][1] !== f.i[m][1]
- )
- return !1;
- return !0;
- }
- function n(u) {
- s(this.v, u) ||
- ((this.v = shapePool.clone(u)),
- this.localShapeCollection.releaseShapes(),
- this.localShapeCollection.addShape(this.v),
- (this._mdf = !0),
- (this.paths = this.localShapeCollection));
- }
- function a() {
- if (this.elem.globalData.frameId !== this.frameId) {
- if (!this.effectsSequence.length) {
- this._mdf = !1;
- return;
- }
- if (this.lock) {
- this.setVValue(this.pv);
- return;
- }
- (this.lock = !0), (this._mdf = !1);
- var u;
- this.kf
- ? (u = this.pv)
- : this.data.ks
- ? (u = this.data.ks.k)
- : (u = this.data.pt.k);
- var f,
- m = this.effectsSequence.length;
- for (f = 0; f < m; f += 1) u = this.effectsSequence[f](u);
- this.setVValue(u),
- (this.lock = !1),
- (this.frameId = this.elem.globalData.frameId);
- }
- }
- function o(u, f, m) {
- (this.propType = 'shape'),
- (this.comp = u.comp),
- (this.container = u),
- (this.elem = u),
- (this.data = f),
- (this.k = !1),
- (this.kf = !1),
- (this._mdf = !1);
- var d = m === 3 ? f.pt.k : f.ks.k;
- (this.v = shapePool.clone(d)),
- (this.pv = shapePool.clone(this.v)),
- (this.localShapeCollection =
- shapeCollectionPool.newShapeCollection()),
- (this.paths = this.localShapeCollection),
- this.paths.addShape(this.v),
- (this.reset = i),
- (this.effectsSequence = []);
- }
- function l(u) {
- this.effectsSequence.push(u),
- this.container.addDynamicProperty(this);
- }
- (o.prototype.interpolateShape = t),
- (o.prototype.getValue = a),
- (o.prototype.setVValue = n),
- (o.prototype.addEffect = l);
- function c(u, f, m) {
- (this.propType = 'shape'),
- (this.comp = u.comp),
- (this.elem = u),
- (this.container = u),
- (this.offsetTime = u.data.st),
- (this.keyframes = m === 3 ? f.pt.k : f.ks.k),
- (this.keyframesMetadata = []),
- (this.k = !0),
- (this.kf = !0);
- var d = this.keyframes[0].s[0].i.length;
- (this.v = shapePool.newElement()),
- this.v.setPathData(this.keyframes[0].s[0].c, d),
- (this.pv = shapePool.clone(this.v)),
- (this.localShapeCollection =
- shapeCollectionPool.newShapeCollection()),
- (this.paths = this.localShapeCollection),
- this.paths.addShape(this.v),
- (this.lastFrame = e),
- (this.reset = i),
- (this._caching = { lastFrame: e, lastIndex: 0 }),
- (this.effectsSequence = [r.bind(this)]);
- }
- (c.prototype.getValue = a),
- (c.prototype.interpolateShape = t),
- (c.prototype.setVValue = n),
- (c.prototype.addEffect = l);
- var g = (function () {
- var u = roundCorner;
- function f(m, d) {
- (this.v = shapePool.newElement()),
- this.v.setPathData(!0, 4),
- (this.localShapeCollection =
- shapeCollectionPool.newShapeCollection()),
- (this.paths = this.localShapeCollection),
- this.localShapeCollection.addShape(this.v),
- (this.d = d.d),
- (this.elem = m),
- (this.comp = m.comp),
- (this.frameId = -1),
- this.initDynamicPropertyContainer(m),
- (this.p = PropertyFactory.getProp(m, d.p, 1, 0, this)),
- (this.s = PropertyFactory.getProp(m, d.s, 1, 0, this)),
- this.dynamicProperties.length
- ? (this.k = !0)
- : ((this.k = !1), this.convertEllToPath());
- }
- return (
- (f.prototype = {
- reset: i,
- getValue: function () {
- this.elem.globalData.frameId !== this.frameId &&
- ((this.frameId = this.elem.globalData.frameId),
- this.iterateDynamicProperties(),
- this._mdf && this.convertEllToPath());
- },
- convertEllToPath: function () {
- var d = this.p.v[0],
- E = this.p.v[1],
- T = this.s.v[0] / 2,
- x = this.s.v[1] / 2,
- _ = this.d !== 3,
- I = this.v;
- (I.v[0][0] = d),
- (I.v[0][1] = E - x),
- (I.v[1][0] = _ ? d + T : d - T),
- (I.v[1][1] = E),
- (I.v[2][0] = d),
- (I.v[2][1] = E + x),
- (I.v[3][0] = _ ? d - T : d + T),
- (I.v[3][1] = E),
- (I.i[0][0] = _ ? d - T * u : d + T * u),
- (I.i[0][1] = E - x),
- (I.i[1][0] = _ ? d + T : d - T),
- (I.i[1][1] = E - x * u),
- (I.i[2][0] = _ ? d + T * u : d - T * u),
- (I.i[2][1] = E + x),
- (I.i[3][0] = _ ? d - T : d + T),
- (I.i[3][1] = E + x * u),
- (I.o[0][0] = _ ? d + T * u : d - T * u),
- (I.o[0][1] = E - x),
- (I.o[1][0] = _ ? d + T : d - T),
- (I.o[1][1] = E + x * u),
- (I.o[2][0] = _ ? d - T * u : d + T * u),
- (I.o[2][1] = E + x),
- (I.o[3][0] = _ ? d - T : d + T),
- (I.o[3][1] = E - x * u);
- }
- }),
- extendPrototype([DynamicPropertyContainer], f),
- f
- );
- })(),
- S = (function () {
- function u(f, m) {
- (this.v = shapePool.newElement()),
- this.v.setPathData(!0, 0),
- (this.elem = f),
- (this.comp = f.comp),
- (this.data = m),
- (this.frameId = -1),
- (this.d = m.d),
- this.initDynamicPropertyContainer(f),
- m.sy === 1
- ? ((this.ir = PropertyFactory.getProp(f, m.ir, 0, 0, this)),
- (this.is = PropertyFactory.getProp(
- f,
- m.is,
- 0,
- 0.01,
- this
- )),
- (this.convertToPath = this.convertStarToPath))
- : (this.convertToPath = this.convertPolygonToPath),
- (this.pt = PropertyFactory.getProp(f, m.pt, 0, 0, this)),
- (this.p = PropertyFactory.getProp(f, m.p, 1, 0, this)),
- (this.r = PropertyFactory.getProp(
- f,
- m.r,
- 0,
- degToRads,
- this
- )),
- (this.or = PropertyFactory.getProp(f, m.or, 0, 0, this)),
- (this.os = PropertyFactory.getProp(f, m.os, 0, 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());
- }
- return (
- (u.prototype = {
- reset: i,
- getValue: function () {
- this.elem.globalData.frameId !== this.frameId &&
- ((this.frameId = this.elem.globalData.frameId),
- this.iterateDynamicProperties(),
- this._mdf && this.convertToPath());
- },
- convertStarToPath: function () {
- var m = Math.floor(this.pt.v) * 2,
- d = (Math.PI * 2) / m,
- E = !0,
- T = this.or.v,
- x = this.ir.v,
- _ = this.os.v,
- I = this.is.v,
- V = (2 * Math.PI * T) / (m * 2),
- D = (2 * Math.PI * x) / (m * 2),
- N,
- $,
- O,
- B,
- F = -Math.PI / 2;
- F += this.r.v;
- var k = this.data.d === 3 ? -1 : 1;
- for (this.v._length = 0, N = 0; N < m; N += 1) {
- ($ = E ? T : x), (O = E ? _ : I), (B = E ? V : D);
- var C = $ * Math.cos(F),
- M = $ * Math.sin(F),
- R =
- C === 0 && M === 0 ? 0 : M / Math.sqrt(C * C + M * M),
- L =
- C === 0 && M === 0
- ? 0
- : -C / Math.sqrt(C * C + M * M);
- (C += +this.p.v[0]),
- (M += +this.p.v[1]),
- this.v.setTripleAt(
- C,
- M,
- C - R * B * O * k,
- M - L * B * O * k,
- C + R * B * O * k,
- M + L * B * O * k,
- N,
- !0
- ),
- (E = !E),
- (F += d * k);
- }
- },
- convertPolygonToPath: function () {
- var m = Math.floor(this.pt.v),
- d = (Math.PI * 2) / m,
- E = this.or.v,
- T = this.os.v,
- x = (2 * Math.PI * E) / (m * 4),
- _,
- I = -Math.PI * 0.5,
- V = this.data.d === 3 ? -1 : 1;
- for (
- I += this.r.v, this.v._length = 0, _ = 0;
- _ < m;
- _ += 1
- ) {
- var D = E * Math.cos(I),
- N = E * Math.sin(I),
- $ =
- D === 0 && N === 0 ? 0 : N / Math.sqrt(D * D + N * N),
- O =
- D === 0 && N === 0
- ? 0
- : -D / Math.sqrt(D * D + N * N);
- (D += +this.p.v[0]),
- (N += +this.p.v[1]),
- this.v.setTripleAt(
- D,
- N,
- D - $ * x * T * V,
- N - O * x * T * V,
- D + $ * x * T * V,
- N + O * x * T * V,
- _,
- !0
- ),
- (I += d * V);
- }
- (this.paths.length = 0), (this.paths[0] = this.v);
- }
- }),
- extendPrototype([DynamicPropertyContainer], u),
- u
- );
- })(),
- p = (function () {
- function u(f, m) {
- (this.v = shapePool.newElement()),
- (this.v.c = !0),
- (this.localShapeCollection =
- shapeCollectionPool.newShapeCollection()),
- this.localShapeCollection.addShape(this.v),
- (this.paths = this.localShapeCollection),
- (this.elem = f),
- (this.comp = f.comp),
- (this.frameId = -1),
- (this.d = m.d),
- this.initDynamicPropertyContainer(f),
- (this.p = PropertyFactory.getProp(f, m.p, 1, 0, this)),
- (this.s = PropertyFactory.getProp(f, m.s, 1, 0, this)),
- (this.r = PropertyFactory.getProp(f, m.r, 0, 0, this)),
- this.dynamicProperties.length
- ? (this.k = !0)
- : ((this.k = !1), this.convertRectToPath());
- }
- return (
- (u.prototype = {
- convertRectToPath: function () {
- var m = this.p.v[0],
- d = this.p.v[1],
- E = this.s.v[0] / 2,
- T = this.s.v[1] / 2,
- x = bmMin(E, T, this.r.v),
- _ = x * (1 - roundCorner);
- (this.v._length = 0),
- this.d === 2 || this.d === 1
- ? (this.v.setTripleAt(
- m + E,
- d - T + x,
- m + E,
- d - T + x,
- m + E,
- d - T + _,
- 0,
- !0
- ),
- this.v.setTripleAt(
- m + E,
- d + T - x,
- m + E,
- d + T - _,
- m + E,
- d + T - x,
- 1,
- !0
- ),
- x !== 0
- ? (this.v.setTripleAt(
- m + E - x,
- d + T,
- m + E - x,
- d + T,
- m + E - _,
- d + T,
- 2,
- !0
- ),
- this.v.setTripleAt(
- m - E + x,
- d + T,
- m - E + _,
- d + T,
- m - E + x,
- d + T,
- 3,
- !0
- ),
- this.v.setTripleAt(
- m - E,
- d + T - x,
- m - E,
- d + T - x,
- m - E,
- d + T - _,
- 4,
- !0
- ),
- this.v.setTripleAt(
- m - E,
- d - T + x,
- m - E,
- d - T + _,
- m - E,
- d - T + x,
- 5,
- !0
- ),
- this.v.setTripleAt(
- m - E + x,
- d - T,
- m - E + x,
- d - T,
- m - E + _,
- d - T,
- 6,
- !0
- ),
- this.v.setTripleAt(
- m + E - x,
- d - T,
- m + E - _,
- d - T,
- m + E - x,
- d - T,
- 7,
- !0
- ))
- : (this.v.setTripleAt(
- m - E,
- d + T,
- m - E + _,
- d + T,
- m - E,
- d + T,
- 2
- ),
- this.v.setTripleAt(
- m - E,
- d - T,
- m - E,
- d - T + _,
- m - E,
- d - T,
- 3
- )))
- : (this.v.setTripleAt(
- m + E,
- d - T + x,
- m + E,
- d - T + _,
- m + E,
- d - T + x,
- 0,
- !0
- ),
- x !== 0
- ? (this.v.setTripleAt(
- m + E - x,
- d - T,
- m + E - x,
- d - T,
- m + E - _,
- d - T,
- 1,
- !0
- ),
- this.v.setTripleAt(
- m - E + x,
- d - T,
- m - E + _,
- d - T,
- m - E + x,
- d - T,
- 2,
- !0
- ),
- this.v.setTripleAt(
- m - E,
- d - T + x,
- m - E,
- d - T + x,
- m - E,
- d - T + _,
- 3,
- !0
- ),
- this.v.setTripleAt(
- m - E,
- d + T - x,
- m - E,
- d + T - _,
- m - E,
- d + T - x,
- 4,
- !0
- ),
- this.v.setTripleAt(
- m - E + x,
- d + T,
- m - E + x,
- d + T,
- m - E + _,
- d + T,
- 5,
- !0
- ),
- this.v.setTripleAt(
- m + E - x,
- d + T,
- m + E - _,
- d + T,
- m + E - x,
- d + T,
- 6,
- !0
- ),
- this.v.setTripleAt(
- m + E,
- d + T - x,
- m + E,
- d + T - x,
- m + E,
- d + T - _,
- 7,
- !0
- ))
- : (this.v.setTripleAt(
- m - E,
- d - T,
- m - E + _,
- d - T,
- m - E,
- d - T,
- 1,
- !0
- ),
- this.v.setTripleAt(
- m - E,
- d + T,
- m - E,
- d + T - _,
- m - E,
- d + T,
- 2,
- !0
- ),
- this.v.setTripleAt(
- m + E,
- d + T,
- m + E - _,
- d + T,
- m + E,
- d + T,
- 3,
- !0
- )));
- },
- getValue: function () {
- this.elem.globalData.frameId !== this.frameId &&
- ((this.frameId = this.elem.globalData.frameId),
- this.iterateDynamicProperties(),
- this._mdf && this.convertRectToPath());
- },
- reset: i
- }),
- extendPrototype([DynamicPropertyContainer], u),
- u
- );
- })();
- function P(u, f, m) {
- var d;
- if (m === 3 || m === 4) {
- var E = m === 3 ? f.pt : f.ks,
- T = E.k;
- T.length ? (d = new c(u, f, m)) : (d = new o(u, f, m));
- } else
- m === 5
- ? (d = new p(u, f))
- : m === 6
- ? (d = new g(u, f))
- : m === 7 && (d = new S(u, f));
- return d.k && u.addDynamicProperty(d), d;
- }
- function b() {
- return o;
- }
- function y() {
- return c;
- }
- var A = {};
- return (
- (A.getShapeProp = P),
- (A.getConstructorFunction = b),
- (A.getKeyframedConstructorFunction = y),
- A
- );
- })();
- /*!
- Transformation Matrix v2.0
- (c) Epistemex 2014-2015
- www.epistemex.com
- By Ken Fyrstenberg
- Contributions by leeoniya.
- License: MIT, header required.
- */ var Matrix = (function () {
- var e = Math.cos,
- t = Math.sin,
- r = Math.tan,
- i = Math.round;
- function s() {
- return (
- (this.props[0] = 1),
- (this.props[1] = 0),
- (this.props[2] = 0),
- (this.props[3] = 0),
- (this.props[4] = 0),
- (this.props[5] = 1),
- (this.props[6] = 0),
- (this.props[7] = 0),
- (this.props[8] = 0),
- (this.props[9] = 0),
- (this.props[10] = 1),
- (this.props[11] = 0),
- (this.props[12] = 0),
- (this.props[13] = 0),
- (this.props[14] = 0),
- (this.props[15] = 1),
- this
- );
- }
- function n(k) {
- if (k === 0) return this;
- var C = e(k),
- M = t(k);
- return this._t(C, -M, 0, 0, M, C, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- }
- function a(k) {
- if (k === 0) return this;
- var C = e(k),
- M = t(k);
- return this._t(1, 0, 0, 0, 0, C, -M, 0, 0, M, C, 0, 0, 0, 0, 1);
- }
- function o(k) {
- if (k === 0) return this;
- var C = e(k),
- M = t(k);
- return this._t(C, 0, M, 0, 0, 1, 0, 0, -M, 0, C, 0, 0, 0, 0, 1);
- }
- function l(k) {
- if (k === 0) return this;
- var C = e(k),
- M = t(k);
- return this._t(C, -M, 0, 0, M, C, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- }
- function c(k, C) {
- return this._t(1, C, k, 1, 0, 0);
- }
- function g(k, C) {
- return this.shear(r(k), r(C));
- }
- function S(k, C) {
- var M = e(C),
- R = t(C);
- return this._t(M, R, 0, 0, -R, M, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)
- ._t(1, 0, 0, 0, r(k), 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)
- ._t(M, -R, 0, 0, R, M, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
- }
- function p(k, C, M) {
- return (
- !M && M !== 0 && (M = 1),
- k === 1 && C === 1 && M === 1
- ? this
- : this._t(k, 0, 0, 0, 0, C, 0, 0, 0, 0, M, 0, 0, 0, 0, 1)
- );
- }
- function P(k, C, M, R, L, j, z, H, U, q, ee, ie, te, Y, X, J) {
- return (
- (this.props[0] = k),
- (this.props[1] = C),
- (this.props[2] = M),
- (this.props[3] = R),
- (this.props[4] = L),
- (this.props[5] = j),
- (this.props[6] = z),
- (this.props[7] = H),
- (this.props[8] = U),
- (this.props[9] = q),
- (this.props[10] = ee),
- (this.props[11] = ie),
- (this.props[12] = te),
- (this.props[13] = Y),
- (this.props[14] = X),
- (this.props[15] = J),
- this
- );
- }
- function b(k, C, M) {
- return (
- (M = M || 0),
- k !== 0 || C !== 0 || M !== 0
- ? this._t(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, k, C, M, 1)
- : this
- );
- }
- function y(k, C, M, R, L, j, z, H, U, q, ee, ie, te, Y, X, J) {
- var G = this.props;
- if (
- k === 1 &&
- C === 0 &&
- M === 0 &&
- R === 0 &&
- L === 0 &&
- j === 1 &&
- z === 0 &&
- H === 0 &&
- U === 0 &&
- q === 0 &&
- ee === 1 &&
- ie === 0
- )
- return (
- (G[12] = G[12] * k + G[15] * te),
- (G[13] = G[13] * j + G[15] * Y),
- (G[14] = G[14] * ee + G[15] * X),
- (G[15] *= J),
- (this._identityCalculated = !1),
- this
- );
- var W = G[0],
- se = G[1],
- le = G[2],
- ne = G[3],
- re = G[4],
- ae = G[5],
- oe = G[6],
- K = G[7],
- he = G[8],
- ce = G[9],
- Z = G[10],
- pe = G[11],
- Q = G[12],
- ue = G[13],
- fe = G[14],
- de = G[15];
- return (
- (G[0] = W * k + se * L + le * U + ne * te),
- (G[1] = W * C + se * j + le * q + ne * Y),
- (G[2] = W * M + se * z + le * ee + ne * X),
- (G[3] = W * R + se * H + le * ie + ne * J),
- (G[4] = re * k + ae * L + oe * U + K * te),
- (G[5] = re * C + ae * j + oe * q + K * Y),
- (G[6] = re * M + ae * z + oe * ee + K * X),
- (G[7] = re * R + ae * H + oe * ie + K * J),
- (G[8] = he * k + ce * L + Z * U + pe * te),
- (G[9] = he * C + ce * j + Z * q + pe * Y),
- (G[10] = he * M + ce * z + Z * ee + pe * X),
- (G[11] = he * R + ce * H + Z * ie + pe * J),
- (G[12] = Q * k + ue * L + fe * U + de * te),
- (G[13] = Q * C + ue * j + fe * q + de * Y),
- (G[14] = Q * M + ue * z + fe * ee + de * X),
- (G[15] = Q * R + ue * H + fe * ie + de * J),
- (this._identityCalculated = !1),
- this
- );
- }
- function A() {
- return (
- this._identityCalculated ||
- ((this._identity = !(
- 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._identityCalculated = !0)),
- this._identity
- );
- }
- function u(k) {
- for (var C = 0; C < 16; ) {
- if (k.props[C] !== this.props[C]) return !1;
- C += 1;
- }
- return !0;
- }
- function f(k) {
- var C;
- for (C = 0; C < 16; C += 1) k.props[C] = this.props[C];
- return k;
- }
- function m(k) {
- var C;
- for (C = 0; C < 16; C += 1) this.props[C] = k[C];
- }
- function d(k, C, M) {
- return {
- x:
- k * this.props[0] +
- C * this.props[4] +
- M * this.props[8] +
- this.props[12],
- y:
- k * this.props[1] +
- C * this.props[5] +
- M * this.props[9] +
- this.props[13],
- z:
- k * this.props[2] +
- C * this.props[6] +
- M * this.props[10] +
- this.props[14]
- };
- }
- function E(k, C, M) {
- return (
- k * this.props[0] +
- C * this.props[4] +
- M * this.props[8] +
- this.props[12]
- );
- }
- function T(k, C, M) {
- return (
- k * this.props[1] +
- C * this.props[5] +
- M * this.props[9] +
- this.props[13]
- );
- }
- function x(k, C, M) {
- return (
- k * this.props[2] +
- C * this.props[6] +
- M * this.props[10] +
- this.props[14]
- );
- }
- function _() {
- var k = this.props[0] * this.props[5] - this.props[1] * this.props[4],
- C = this.props[5] / k,
- M = -this.props[1] / k,
- R = -this.props[4] / k,
- L = this.props[0] / k,
- j =
- (this.props[4] * this.props[13] -
- this.props[5] * this.props[12]) /
- k,
- z =
- -(
- this.props[0] * this.props[13] -
- this.props[1] * this.props[12]
- ) / k,
- H = new Matrix();
- return (
- (H.props[0] = C),
- (H.props[1] = M),
- (H.props[4] = R),
- (H.props[5] = L),
- (H.props[12] = j),
- (H.props[13] = z),
- H
- );
- }
- function I(k) {
- var C = this.getInverseMatrix();
- return C.applyToPointArray(k[0], k[1], k[2] || 0);
- }
- function V(k) {
- var C,
- M = k.length,
- R = [];
- for (C = 0; C < M; C += 1) R[C] = I(k[C]);
- return R;
- }
- function D(k, C, M) {
- var R = createTypedArray('float32', 6);
- if (this.isIdentity())
- (R[0] = k[0]),
- (R[1] = k[1]),
- (R[2] = C[0]),
- (R[3] = C[1]),
- (R[4] = M[0]),
- (R[5] = M[1]);
- else {
- var L = this.props[0],
- j = this.props[1],
- z = this.props[4],
- H = this.props[5],
- U = this.props[12],
- q = this.props[13];
- (R[0] = k[0] * L + k[1] * z + U),
- (R[1] = k[0] * j + k[1] * H + q),
- (R[2] = C[0] * L + C[1] * z + U),
- (R[3] = C[0] * j + C[1] * H + q),
- (R[4] = M[0] * L + M[1] * z + U),
- (R[5] = M[0] * j + M[1] * H + q);
- }
- return R;
- }
- function N(k, C, M) {
- var R;
- return (
- this.isIdentity()
- ? (R = [k, C, M])
- : (R = [
- k * this.props[0] +
- C * this.props[4] +
- M * this.props[8] +
- this.props[12],
- k * this.props[1] +
- C * this.props[5] +
- M * this.props[9] +
- this.props[13],
- k * this.props[2] +
- C * this.props[6] +
- M * this.props[10] +
- this.props[14]
- ]),
- R
- );
- }
- function $(k, C) {
- if (this.isIdentity()) return k + ',' + C;
- var M = this.props;
- return (
- Math.round((k * M[0] + C * M[4] + M[12]) * 100) / 100 +
- ',' +
- Math.round((k * M[1] + C * M[5] + M[13]) * 100) / 100
- );
- }
- function O() {
- for (var k = 0, C = this.props, M = 'matrix3d(', R = 1e4; k < 16; )
- (M += i(C[k] * R) / R), (M += k === 15 ? ')' : ','), (k += 1);
- return M;
- }
- function B(k) {
- var C = 1e4;
- return (k < 1e-6 && k > 0) || (k > -1e-6 && k < 0) ? i(k * C) / C : k;
- }
- function F() {
- var k = this.props,
- C = B(k[0]),
- M = B(k[1]),
- R = B(k[4]),
- L = B(k[5]),
- j = B(k[12]),
- z = B(k[13]);
- return (
- 'matrix(' +
- C +
- ',' +
- M +
- ',' +
- R +
- ',' +
- L +
- ',' +
- j +
- ',' +
- z +
- ')'
- );
- }
- return function () {
- (this.reset = s),
- (this.rotate = n),
- (this.rotateX = a),
- (this.rotateY = o),
- (this.rotateZ = l),
- (this.skew = g),
- (this.skewFromAxis = S),
- (this.shear = c),
- (this.scale = p),
- (this.setTransform = P),
- (this.translate = b),
- (this.transform = y),
- (this.applyToPoint = d),
- (this.applyToX = E),
- (this.applyToY = T),
- (this.applyToZ = x),
- (this.applyToPointArray = N),
- (this.applyToTriplePoints = D),
- (this.applyToPointStringified = $),
- (this.toCSS = O),
- (this.to2dCSS = F),
- (this.clone = f),
- (this.cloneFromProps = m),
- (this.equals = u),
- (this.inversePoints = V),
- (this.inversePoint = I),
- (this.getInverseMatrix = _),
- (this._t = this.transform),
- (this.isIdentity = A),
- (this._identity = !0),
- (this._identityCalculated = !1),
- (this.props = createTypedArray('float32', 16)),
- this.reset();
- };
- })();
- function _typeof$3(e) {
- return (
- typeof Symbol == 'function' && typeof Symbol.iterator == 'symbol'
- ? (_typeof$3 = function (r) {
- return typeof r;
- })
- : (_typeof$3 = function (r) {
- return r &&
- typeof Symbol == 'function' &&
- r.constructor === Symbol &&
- r !== Symbol.prototype
- ? 'symbol'
- : typeof r;
- }),
- _typeof$3(e)
- );
- }
- var lottie = {};
- function setLocation(e) {
- setLocationHref(e);
- }
- function searchAnimations() {
- animationManager.searchAnimations();
- }
- function setSubframeRendering(e) {
- setSubframeEnabled(e);
- }
- function setPrefix(e) {
- setIdPrefix(e);
- }
- function loadAnimation(e) {
- return animationManager.loadAnimation(e);
- }
- function setQuality(e) {
- if (typeof e == 'string')
- switch (e) {
- case 'high':
- setDefaultCurveSegments(200);
- break;
- default:
- case 'medium':
- setDefaultCurveSegments(50);
- break;
- case 'low':
- setDefaultCurveSegments(10);
- break;
- }
- else !isNaN(e) && e > 1 && setDefaultCurveSegments(e);
- }
- function inBrowser() {
- return typeof navigator < 'u';
- }
- function installPlugin(e, t) {
- e === 'expressions' && setExpressionsPlugin(t);
- }
- function getFactory(e) {
- switch (e) {
- case 'propertyFactory':
- return PropertyFactory;
- case 'shapePropertyFactory':
- return ShapePropertyFactory;
- case 'matrix':
- return Matrix;
- default:
- return null;
- }
- }
- (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.11.0');
- function checkReady() {
- document.readyState === 'complete' &&
- (clearInterval(readyStateCheckInterval), searchAnimations());
- }
- function getQueryVariable(e) {
- for (var t = queryString.split('&'), r = 0; r < t.length; r += 1) {
- var i = t[r].split('=');
- if (decodeURIComponent(i[0]) == e) return decodeURIComponent(i[1]);
- }
- return null;
- }
- var queryString = '';
- {
- var scripts = document.getElementsByTagName('script'),
- index = scripts.length - 1,
- myScript = scripts[index] || { src: '' };
- (queryString = myScript.src
- ? myScript.src.replace(/^[^\?]+\??/, '')
- : ''),
- getQueryVariable('renderer');
- }
- var readyStateCheckInterval = setInterval(checkReady, 100);
- try {
- _typeof$3(exports) !== 'object' && (window.bodymovin = lottie);
- } catch (e) {}
- var ShapeModifiers = (function () {
- var e = {},
- t = {};
- (e.registerModifier = r), (e.getModifier = i);
- function r(s, n) {
- t[s] || (t[s] = n);
- }
- function i(s, n, a) {
- return new t[s](n, a);
- }
- return e;
- })();
- function ShapeModifier() {}
- (ShapeModifier.prototype.initModifierProperties = function () {}),
- (ShapeModifier.prototype.addShapeToModifier = function () {}),
- (ShapeModifier.prototype.addShape = function (e) {
- if (!this.closed) {
- e.sh.container.addDynamicProperty(e.sh);
- var t = {
- shape: e.sh,
- data: e,
- localShapeCollection: shapeCollectionPool.newShapeCollection()
- };
- this.shapes.push(t),
- this.addShapeToModifier(t),
- this._isAnimated && e.setAsAnimated();
- }
- }),
- (ShapeModifier.prototype.init = function (e, t) {
- (this.shapes = []),
- (this.elem = e),
- this.initDynamicPropertyContainer(e),
- this.initModifierProperties(e, t),
- (this.frameId = initialDefaultFrame),
- (this.closed = !1),
- (this.k = !1),
- this.dynamicProperties.length ? (this.k = !0) : this.getValue(!0);
- }),
- (ShapeModifier.prototype.processKeys = function () {
- this.elem.globalData.frameId !== this.frameId &&
- ((this.frameId = this.elem.globalData.frameId),
- this.iterateDynamicProperties());
- }),
- extendPrototype([DynamicPropertyContainer], ShapeModifier);
- function TrimModifier() {}
- extendPrototype([ShapeModifier], TrimModifier),
- (TrimModifier.prototype.initModifierProperties = function (e, t) {
- (this.s = PropertyFactory.getProp(e, t.s, 0, 0.01, this)),
- (this.e = PropertyFactory.getProp(e, t.e, 0, 0.01, this)),
- (this.o = PropertyFactory.getProp(e, t.o, 0, 0, this)),
- (this.sValue = 0),
- (this.eValue = 0),
- (this.getValue = this.processKeys),
- (this.m = t.m),
- (this._isAnimated =
- !!this.s.effectsSequence.length ||
- !!this.e.effectsSequence.length ||
- !!this.o.effectsSequence.length);
- }),
- (TrimModifier.prototype.addShapeToModifier = function (e) {
- e.pathsData = [];
- }),
- (TrimModifier.prototype.calculateShapeEdges = function (e, t, r, i, s) {
- var n = [];
- t <= 1
- ? n.push({ s: e, e: t })
- : e >= 1
- ? n.push({ s: e - 1, e: t - 1 })
- : (n.push({ s: e, e: 1 }), n.push({ s: 0, e: t - 1 }));
- var a = [],
- o,
- l = n.length,
- c;
- for (o = 0; o < l; o += 1)
- if (((c = n[o]), !(c.e * s < i || c.s * s > i + r))) {
- var g, S;
- c.s * s <= i ? (g = 0) : (g = (c.s * s - i) / r),
- c.e * s >= i + r ? (S = 1) : (S = (c.e * s - i) / r),
- a.push([g, S]);
- }
- return a.length || a.push([0, 0]), a;
- }),
- (TrimModifier.prototype.releasePathsData = function (e) {
- var t,
- r = e.length;
- for (t = 0; t < r; t += 1) segmentsLengthPool.release(e[t]);
- return (e.length = 0), e;
- }),
- (TrimModifier.prototype.processShapes = function (e) {
- var t, r;
- if (this._mdf || e) {
- var i = (this.o.v % 360) / 360;
- if (
- (i < 0 && (i += 1),
- this.s.v > 1
- ? (t = 1 + i)
- : this.s.v < 0
- ? (t = 0 + i)
- : (t = this.s.v + i),
- this.e.v > 1
- ? (r = 1 + i)
- : this.e.v < 0
- ? (r = 0 + i)
- : (r = this.e.v + i),
- t > r)
- ) {
- var s = t;
- (t = r), (r = s);
- }
- (t = Math.round(t * 1e4) * 1e-4),
- (r = Math.round(r * 1e4) * 1e-4),
- (this.sValue = t),
- (this.eValue = r);
- } else (t = this.sValue), (r = this.eValue);
- var n,
- a,
- o = this.shapes.length,
- l,
- c,
- g,
- S,
- p,
- P = 0;
- if (r === t)
- for (a = 0; a < o; a += 1)
- this.shapes[a].localShapeCollection.releaseShapes(),
- (this.shapes[a].shape._mdf = !0),
- (this.shapes[a].shape.paths =
- this.shapes[a].localShapeCollection),
- this._mdf && (this.shapes[a].pathsData.length = 0);
- else if ((r === 1 && t === 0) || (r === 0 && t === 1)) {
- if (this._mdf)
- for (a = 0; a < o; a += 1)
- (this.shapes[a].pathsData.length = 0),
- (this.shapes[a].shape._mdf = !0);
- } else {
- var b = [],
- y,
- A;
- for (a = 0; a < o; a += 1)
- if (
- ((y = this.shapes[a]),
- !y.shape._mdf && !this._mdf && !e && this.m !== 2)
- )
- y.shape.paths = y.localShapeCollection;
- else {
- if (
- ((n = y.shape.paths),
- (c = n._length),
- (p = 0),
- !y.shape._mdf && y.pathsData.length)
- )
- p = y.totalShapeLength;
- else {
- for (
- g = this.releasePathsData(y.pathsData), l = 0;
- l < c;
- l += 1
- )
- (S = bez.getSegmentsLength(n.shapes[l])),
- g.push(S),
- (p += S.totalLength);
- (y.totalShapeLength = p), (y.pathsData = g);
- }
- (P += p), (y.shape._mdf = !0);
- }
- var u = t,
- f = r,
- m = 0,
- d;
- for (a = o - 1; a >= 0; a -= 1)
- if (((y = this.shapes[a]), y.shape._mdf)) {
- for (
- A = y.localShapeCollection,
- A.releaseShapes(),
- this.m === 2 && o > 1
- ? ((d = this.calculateShapeEdges(
- t,
- r,
- y.totalShapeLength,
- m,
- P
- )),
- (m += y.totalShapeLength))
- : (d = [[u, f]]),
- c = d.length,
- l = 0;
- l < c;
- l += 1
- ) {
- (u = d[l][0]),
- (f = d[l][1]),
- (b.length = 0),
- f <= 1
- ? b.push({
- s: y.totalShapeLength * u,
- e: y.totalShapeLength * f
- })
- : u >= 1
- ? b.push({
- s: y.totalShapeLength * (u - 1),
- e: y.totalShapeLength * (f - 1)
- })
- : (b.push({
- s: y.totalShapeLength * u,
- e: y.totalShapeLength
- }),
- b.push({ s: 0, e: y.totalShapeLength * (f - 1) }));
- var E = this.addShapes(y, b[0]);
- if (b[0].s !== b[0].e) {
- if (b.length > 1) {
- var T = y.shape.paths.shapes[y.shape.paths._length - 1];
- if (T.c) {
- var x = E.pop();
- this.addPaths(E, A), (E = this.addShapes(y, b[1], x));
- } else this.addPaths(E, A), (E = this.addShapes(y, b[1]));
- }
- this.addPaths(E, A);
- }
- }
- y.shape.paths = A;
- }
- }
- }),
- (TrimModifier.prototype.addPaths = function (e, t) {
- var r,
- i = e.length;
- for (r = 0; r < i; r += 1) t.addShape(e[r]);
- }),
- (TrimModifier.prototype.addSegment = function (e, t, r, i, s, n, a) {
- s.setXYAt(t[0], t[1], 'o', n),
- s.setXYAt(r[0], r[1], 'i', n + 1),
- a && s.setXYAt(e[0], e[1], 'v', n),
- s.setXYAt(i[0], i[1], 'v', n + 1);
- }),
- (TrimModifier.prototype.addSegmentFromArray = function (e, t, r, i) {
- t.setXYAt(e[1], e[5], 'o', r),
- t.setXYAt(e[2], e[6], 'i', r + 1),
- i && t.setXYAt(e[0], e[4], 'v', r),
- t.setXYAt(e[3], e[7], 'v', r + 1);
- }),
- (TrimModifier.prototype.addShapes = function (e, t, r) {
- var i = e.pathsData,
- s = e.shape.paths.shapes,
- n,
- a = e.shape.paths._length,
- o,
- l,
- c = 0,
- g,
- S,
- p,
- P,
- b = [],
- y,
- A = !0;
- for (
- r
- ? ((S = r._length), (y = r._length))
- : ((r = shapePool.newElement()), (S = 0), (y = 0)),
- b.push(r),
- n = 0;
- n < a;
- n += 1
- ) {
- for (
- p = i[n].lengths,
- r.c = s[n].c,
- l = s[n].c ? p.length : p.length + 1,
- o = 1;
- o < l;
- o += 1
- )
- if (((g = p[o - 1]), c + g.addedLength < t.s))
- (c += g.addedLength), (r.c = !1);
- else if (c > t.e) {
- r.c = !1;
- break;
- } else
- t.s <= c && t.e >= c + g.addedLength
- ? (this.addSegment(
- s[n].v[o - 1],
- s[n].o[o - 1],
- s[n].i[o],
- s[n].v[o],
- r,
- S,
- A
- ),
- (A = !1))
- : ((P = bez.getNewSegment(
- s[n].v[o - 1],
- s[n].v[o],
- s[n].o[o - 1],
- s[n].i[o],
- (t.s - c) / g.addedLength,
- (t.e - c) / g.addedLength,
- p[o - 1]
- )),
- this.addSegmentFromArray(P, r, S, A),
- (A = !1),
- (r.c = !1)),
- (c += g.addedLength),
- (S += 1);
- if (s[n].c && p.length) {
- if (((g = p[o - 1]), c <= t.e)) {
- var u = p[o - 1].addedLength;
- t.s <= c && t.e >= c + u
- ? (this.addSegment(
- s[n].v[o - 1],
- s[n].o[o - 1],
- s[n].i[0],
- s[n].v[0],
- r,
- S,
- A
- ),
- (A = !1))
- : ((P = bez.getNewSegment(
- s[n].v[o - 1],
- s[n].v[0],
- s[n].o[o - 1],
- s[n].i[0],
- (t.s - c) / u,
- (t.e - c) / u,
- p[o - 1]
- )),
- this.addSegmentFromArray(P, r, S, A),
- (A = !1),
- (r.c = !1));
- } else r.c = !1;
- (c += g.addedLength), (S += 1);
- }
- if (
- (r._length &&
- (r.setXYAt(r.v[y][0], r.v[y][1], 'i', y),
- r.setXYAt(
- r.v[r._length - 1][0],
- r.v[r._length - 1][1],
- 'o',
- r._length - 1
- )),
- c > t.e)
- )
- break;
- n < a - 1 &&
- ((r = shapePool.newElement()), (A = !0), b.push(r), (S = 0));
- }
- return b;
- });
- function PuckerAndBloatModifier() {}
- extendPrototype([ShapeModifier], PuckerAndBloatModifier),
- (PuckerAndBloatModifier.prototype.initModifierProperties = function (
- e,
- t
- ) {
- (this.getValue = this.processKeys),
- (this.amount = PropertyFactory.getProp(e, t.a, 0, null, this)),
- (this._isAnimated = !!this.amount.effectsSequence.length);
- }),
- (PuckerAndBloatModifier.prototype.processPath = function (e, t) {
- var r = t / 100,
- i = [0, 0],
- s = e._length,
- n = 0;
- for (n = 0; n < s; n += 1) (i[0] += e.v[n][0]), (i[1] += e.v[n][1]);
- (i[0] /= s), (i[1] /= s);
- var a = shapePool.newElement();
- a.c = e.c;
- var o, l, c, g, S, p;
- for (n = 0; n < s; n += 1)
- (o = e.v[n][0] + (i[0] - e.v[n][0]) * r),
- (l = e.v[n][1] + (i[1] - e.v[n][1]) * r),
- (c = e.o[n][0] + (i[0] - e.o[n][0]) * -r),
- (g = e.o[n][1] + (i[1] - e.o[n][1]) * -r),
- (S = e.i[n][0] + (i[0] - e.i[n][0]) * -r),
- (p = e.i[n][1] + (i[1] - e.i[n][1]) * -r),
- a.setTripleAt(o, l, c, g, S, p, n);
- return a;
- }),
- (PuckerAndBloatModifier.prototype.processShapes = function (e) {
- var t,
- r,
- i = this.shapes.length,
- s,
- n,
- a = this.amount.v;
- if (a !== 0) {
- var o, l;
- for (r = 0; r < i; r += 1) {
- if (
- ((o = this.shapes[r]),
- (l = o.localShapeCollection),
- !(!o.shape._mdf && !this._mdf && !e))
- )
- for (
- l.releaseShapes(),
- o.shape._mdf = !0,
- t = o.shape.paths.shapes,
- n = o.shape.paths._length,
- s = 0;
- s < n;
- s += 1
- )
- l.addShape(this.processPath(t[s], a));
- o.shape.paths = o.localShapeCollection;
- }
- }
- this.dynamicProperties.length || (this._mdf = !1);
- });
- var TransformPropertyFactory = (function () {
- var e = [0, 0];
- function t(l) {
- var c = this._mdf;
- this.iterateDynamicProperties(),
- (this._mdf = this._mdf || c),
- this.a && l.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]),
- this.s && l.scale(this.s.v[0], this.s.v[1], this.s.v[2]),
- this.sk && l.skewFromAxis(-this.sk.v, this.sa.v),
- this.r
- ? l.rotate(-this.r.v)
- : l
- .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
- ? l.translate(this.px.v, this.py.v, -this.pz.v)
- : l.translate(this.px.v, this.py.v, 0)
- : l.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
- }
- function r(l) {
- if (this.elem.globalData.frameId !== this.frameId) {
- if (
- (this._isDirty &&
- (this.precalculateMatrix(), (this._isDirty = !1)),
- this.iterateDynamicProperties(),
- this._mdf || l)
- ) {
- var c;
- if (
- (this.v.cloneFromProps(this.pre.props),
- this.appliedTransformations < 1 &&
- this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]),
- this.appliedTransformations < 2 &&
- this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]),
- this.sk &&
- this.appliedTransformations < 3 &&
- this.v.skewFromAxis(-this.sk.v, this.sa.v),
- this.r && this.appliedTransformations < 4
- ? this.v.rotate(-this.r.v)
- : !this.r &&
- this.appliedTransformations < 4 &&
- this.v
- .rotateZ(-this.rz.v)
- .rotateY(this.ry.v)
- .rotateX(this.rx.v)
- .rotateZ(-this.or.v[2])
- .rotateY(this.or.v[1])
- .rotateX(this.or.v[0]),
- this.autoOriented)
- ) {
- var g, S;
- if (
- ((c = this.elem.globalData.frameRate),
- this.p && this.p.keyframes && this.p.getValueAtTime)
- )
- this.p._caching.lastFrame + this.p.offsetTime <=
- this.p.keyframes[0].t
- ? ((g = this.p.getValueAtTime(
- (this.p.keyframes[0].t + 0.01) / c,
- 0
- )),
- (S = this.p.getValueAtTime(this.p.keyframes[0].t / c, 0)))
- : this.p._caching.lastFrame + this.p.offsetTime >=
- this.p.keyframes[this.p.keyframes.length - 1].t
- ? ((g = this.p.getValueAtTime(
- this.p.keyframes[this.p.keyframes.length - 1].t / c,
- 0
- )),
- (S = this.p.getValueAtTime(
- (this.p.keyframes[this.p.keyframes.length - 1].t -
- 0.05) /
- c,
- 0
- )))
- : ((g = this.p.pv),
- (S = this.p.getValueAtTime(
- (this.p._caching.lastFrame + this.p.offsetTime - 0.01) /
- c,
- this.p.offsetTime
- )));
- else if (
- this.px &&
- this.px.keyframes &&
- this.py.keyframes &&
- this.px.getValueAtTime &&
- this.py.getValueAtTime
- ) {
- (g = []), (S = []);
- var p = this.px,
- P = this.py;
- p._caching.lastFrame + p.offsetTime <= p.keyframes[0].t
- ? ((g[0] = p.getValueAtTime(
- (p.keyframes[0].t + 0.01) / c,
- 0
- )),
- (g[1] = P.getValueAtTime(
- (P.keyframes[0].t + 0.01) / c,
- 0
- )),
- (S[0] = p.getValueAtTime(p.keyframes[0].t / c, 0)),
- (S[1] = P.getValueAtTime(P.keyframes[0].t / c, 0)))
- : p._caching.lastFrame + p.offsetTime >=
- p.keyframes[p.keyframes.length - 1].t
- ? ((g[0] = p.getValueAtTime(
- p.keyframes[p.keyframes.length - 1].t / c,
- 0
- )),
- (g[1] = P.getValueAtTime(
- P.keyframes[P.keyframes.length - 1].t / c,
- 0
- )),
- (S[0] = p.getValueAtTime(
- (p.keyframes[p.keyframes.length - 1].t - 0.01) / c,
- 0
- )),
- (S[1] = P.getValueAtTime(
- (P.keyframes[P.keyframes.length - 1].t - 0.01) / c,
- 0
- )))
- : ((g = [p.pv, P.pv]),
- (S[0] = p.getValueAtTime(
- (p._caching.lastFrame + p.offsetTime - 0.01) / c,
- p.offsetTime
- )),
- (S[1] = P.getValueAtTime(
- (P._caching.lastFrame + P.offsetTime - 0.01) / c,
- P.offsetTime
- )));
- } else (S = e), (g = S);
- this.v.rotate(-Math.atan2(g[1] - S[1], g[0] - S[0]));
- }
- this.data.p && this.data.p.s
- ? this.data.p.z
- ? this.v.translate(this.px.v, this.py.v, -this.pz.v)
- : this.v.translate(this.px.v, this.py.v, 0)
- : this.v.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
- }
- this.frameId = this.elem.globalData.frameId;
- }
- }
- function i() {
- if (!this.a.k)
- this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]),
- (this.appliedTransformations = 1);
- else return;
- if (!this.s.effectsSequence.length)
- this.pre.scale(this.s.v[0], this.s.v[1], this.s.v[2]),
- (this.appliedTransformations = 2);
- else return;
- if (this.sk)
- if (
- !this.sk.effectsSequence.length &&
- !this.sa.effectsSequence.length
- )
- this.pre.skewFromAxis(-this.sk.v, this.sa.v),
- (this.appliedTransformations = 3);
- else return;
- this.r
- ? this.r.effectsSequence.length ||
- (this.pre.rotate(-this.r.v), (this.appliedTransformations = 4))
- : !this.rz.effectsSequence.length &&
- !this.ry.effectsSequence.length &&
- !this.rx.effectsSequence.length &&
- !this.or.effectsSequence.length &&
- (this.pre
- .rotateZ(-this.rz.v)
- .rotateY(this.ry.v)
- .rotateX(this.rx.v)
- .rotateZ(-this.or.v[2])
- .rotateY(this.or.v[1])
- .rotateX(this.or.v[0]),
- (this.appliedTransformations = 4));
- }
- function s() {}
- function n(l) {
- this._addDynamicProperty(l),
- this.elem.addDynamicProperty(l),
- (this._isDirty = !0);
- }
- function a(l, c, g) {
- if (
- ((this.elem = l),
- (this.frameId = -1),
- (this.propType = 'transform'),
- (this.data = c),
- (this.v = new Matrix()),
- (this.pre = new Matrix()),
- (this.appliedTransformations = 0),
- this.initDynamicPropertyContainer(g || l),
- c.p && c.p.s
- ? ((this.px = PropertyFactory.getProp(l, c.p.x, 0, 0, this)),
- (this.py = PropertyFactory.getProp(l, c.p.y, 0, 0, this)),
- c.p.z &&
- (this.pz = PropertyFactory.getProp(l, c.p.z, 0, 0, this)))
- : (this.p = PropertyFactory.getProp(
- l,
- c.p || { k: [0, 0, 0] },
- 1,
- 0,
- this
- )),
- c.rx)
- ) {
- if (
- ((this.rx = PropertyFactory.getProp(l, c.rx, 0, degToRads, this)),
- (this.ry = PropertyFactory.getProp(l, c.ry, 0, degToRads, this)),
- (this.rz = PropertyFactory.getProp(l, c.rz, 0, degToRads, this)),
- c.or.k[0].ti)
- ) {
- var S,
- p = c.or.k.length;
- for (S = 0; S < p; S += 1)
- (c.or.k[S].to = null), (c.or.k[S].ti = null);
- }
- (this.or = PropertyFactory.getProp(l, c.or, 1, degToRads, this)),
- (this.or.sh = !0);
- } else
- this.r = PropertyFactory.getProp(
- l,
- c.r || { k: 0 },
- 0,
- degToRads,
- this
- );
- c.sk &&
- ((this.sk = PropertyFactory.getProp(l, c.sk, 0, degToRads, this)),
- (this.sa = PropertyFactory.getProp(l, c.sa, 0, degToRads, this))),
- (this.a = PropertyFactory.getProp(
- l,
- c.a || { k: [0, 0, 0] },
- 1,
- 0,
- this
- )),
- (this.s = PropertyFactory.getProp(
- l,
- c.s || { k: [100, 100, 100] },
- 1,
- 0.01,
- this
- )),
- c.o
- ? (this.o = PropertyFactory.getProp(l, c.o, 0, 0.01, l))
- : (this.o = { _mdf: !1, v: 1 }),
- (this._isDirty = !0),
- this.dynamicProperties.length || this.getValue(!0);
- }
- (a.prototype = {
- applyToMatrix: t,
- getValue: r,
- precalculateMatrix: i,
- autoOrient: s
- }),
- extendPrototype([DynamicPropertyContainer], a),
- (a.prototype.addDynamicProperty = n),
- (a.prototype._addDynamicProperty =
- DynamicPropertyContainer.prototype.addDynamicProperty);
- function o(l, c, g) {
- return new a(l, c, g);
- }
- return { getTransformProperty: o };
- })();
- function RepeaterModifier() {}
- extendPrototype([ShapeModifier], RepeaterModifier),
- (RepeaterModifier.prototype.initModifierProperties = function (e, t) {
- (this.getValue = this.processKeys),
- (this.c = PropertyFactory.getProp(e, t.c, 0, null, this)),
- (this.o = PropertyFactory.getProp(e, t.o, 0, null, this)),
- (this.tr = TransformPropertyFactory.getTransformProperty(
- e,
- t.tr,
- this
- )),
- (this.so = PropertyFactory.getProp(e, t.tr.so, 0, 0.01, this)),
- (this.eo = PropertyFactory.getProp(e, t.tr.eo, 0, 0.01, this)),
- (this.data = t),
- 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());
- }),
- (RepeaterModifier.prototype.applyTransforms = function (
- e,
- t,
- r,
- i,
- s,
- n
- ) {
- var a = n ? -1 : 1,
- o = i.s.v[0] + (1 - i.s.v[0]) * (1 - s),
- l = i.s.v[1] + (1 - i.s.v[1]) * (1 - s);
- e.translate(i.p.v[0] * a * s, i.p.v[1] * a * s, i.p.v[2]),
- t.translate(-i.a.v[0], -i.a.v[1], i.a.v[2]),
- t.rotate(-i.r.v * a * s),
- t.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(n ? 1 / o : o, n ? 1 / l : l),
- r.translate(i.a.v[0], i.a.v[1], i.a.v[2]);
- }),
- (RepeaterModifier.prototype.init = function (e, t, r, i) {
- for (
- this.elem = e,
- this.arr = t,
- this.pos = r,
- this.elemsData = i,
- this._currentCopies = 0,
- this._elements = [],
- this._groups = [],
- this.frameId = -1,
- this.initDynamicPropertyContainer(e),
- this.initModifierProperties(e, t[r]);
- r > 0;
- )
- (r -= 1), this._elements.unshift(t[r]);
- this.dynamicProperties.length ? (this.k = !0) : this.getValue(!0);
- }),
- (RepeaterModifier.prototype.resetElements = function (e) {
- var t,
- r = e.length;
- for (t = 0; t < r; t += 1)
- (e[t]._processed = !1),
- e[t].ty === 'gr' && this.resetElements(e[t].it);
- }),
- (RepeaterModifier.prototype.cloneElements = function (e) {
- var t = JSON.parse(JSON.stringify(e));
- return this.resetElements(t), t;
- }),
- (RepeaterModifier.prototype.changeGroupRender = function (e, t) {
- var r,
- i = e.length;
- for (r = 0; r < i; r += 1)
- (e[r]._render = t),
- e[r].ty === 'gr' && this.changeGroupRender(e[r].it, t);
- }),
- (RepeaterModifier.prototype.processShapes = function (e) {
- var t,
- r,
- i,
- s,
- n,
- a = !1;
- if (this._mdf || e) {
- var o = Math.ceil(this.c.v);
- if (this._groups.length < o) {
- for (; this._groups.length < o; ) {
- var l = { it: this.cloneElements(this._elements), ty: 'gr' };
- l.it.push({
- a: { a: 0, ix: 1, k: [0, 0] },
- nm: 'Transform',
- o: { a: 0, ix: 7, k: 100 },
- p: { a: 0, ix: 2, k: [0, 0] },
- r: {
- a: 1,
- ix: 6,
- k: [
- { s: 0, e: 0, t: 0 },
- { s: 0, e: 0, t: 1 }
- ]
- },
- s: { a: 0, ix: 3, k: [100, 100] },
- sa: { a: 0, ix: 5, k: 0 },
- sk: { a: 0, ix: 4, k: 0 },
- ty: 'tr'
- }),
- this.arr.splice(0, 0, l),
- this._groups.splice(0, 0, l),
- (this._currentCopies += 1);
- }
- this.elem.reloadShapes(), (a = !0);
- }
- n = 0;
- var c;
- for (i = 0; i <= this._groups.length - 1; i += 1) {
- if (
- ((c = n < o),
- (this._groups[i]._render = c),
- this.changeGroupRender(this._groups[i].it, c),
- !c)
- ) {
- var g = this.elemsData[i].it,
- S = g[g.length - 1];
- S.transform.op.v !== 0
- ? ((S.transform.op._mdf = !0), (S.transform.op.v = 0))
- : (S.transform.op._mdf = !1);
- }
- n += 1;
- }
- this._currentCopies = o;
- var p = this.o.v,
- P = p % 1,
- b = p > 0 ? Math.floor(p) : Math.ceil(p),
- y = this.pMatrix.props,
- A = this.rMatrix.props,
- u = this.sMatrix.props;
- this.pMatrix.reset(),
- this.rMatrix.reset(),
- this.sMatrix.reset(),
- this.tMatrix.reset(),
- this.matrix.reset();
- var f = 0;
- if (p > 0) {
- for (; f < b; )
- this.applyTransforms(
- this.pMatrix,
- this.rMatrix,
- this.sMatrix,
- this.tr,
- 1,
- !1
- ),
- (f += 1);
- P &&
- (this.applyTransforms(
- this.pMatrix,
- this.rMatrix,
- this.sMatrix,
- this.tr,
- P,
- !1
- ),
- (f += P));
- } else if (p < 0) {
- for (; f > b; )
- this.applyTransforms(
- this.pMatrix,
- this.rMatrix,
- this.sMatrix,
- this.tr,
- 1,
- !0
- ),
- (f -= 1);
- P &&
- (this.applyTransforms(
- this.pMatrix,
- this.rMatrix,
- this.sMatrix,
- this.tr,
- -P,
- !0
- ),
- (f -= P));
- }
- (i = this.data.m === 1 ? 0 : this._currentCopies - 1),
- (s = this.data.m === 1 ? 1 : -1),
- (n = this._currentCopies);
- for (var m, d; n; ) {
- if (
- ((t = this.elemsData[i].it),
- (r = t[t.length - 1].transform.mProps.v.props),
- (d = r.length),
- (t[t.length - 1].transform.mProps._mdf = !0),
- (t[t.length - 1].transform.op._mdf = !0),
- (t[t.length - 1].transform.op.v =
- this._currentCopies === 1
- ? this.so.v
- : this.so.v +
- (this.eo.v - this.so.v) *
- (i / (this._currentCopies - 1))),
- f !== 0)
- ) {
- for (
- ((i !== 0 && s === 1) ||
- (i !== this._currentCopies - 1 && s === -1)) &&
- this.applyTransforms(
- this.pMatrix,
- this.rMatrix,
- this.sMatrix,
- this.tr,
- 1,
- !1
- ),
- this.matrix.transform(
- A[0],
- A[1],
- A[2],
- A[3],
- A[4],
- A[5],
- A[6],
- A[7],
- A[8],
- A[9],
- A[10],
- A[11],
- A[12],
- A[13],
- A[14],
- A[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]
- ),
- 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]
- ),
- m = 0;
- m < d;
- m += 1
- )
- r[m] = this.matrix.props[m];
- this.matrix.reset();
- } else
- for (this.matrix.reset(), m = 0; m < d; m += 1)
- r[m] = this.matrix.props[m];
- (f += 1), (n -= 1), (i += s);
- }
- } else
- for (n = this._currentCopies, i = 0, s = 1; n; )
- (t = this.elemsData[i].it),
- (r = t[t.length - 1].transform.mProps.v.props),
- (t[t.length - 1].transform.mProps._mdf = !1),
- (t[t.length - 1].transform.op._mdf = !1),
- (n -= 1),
- (i += s);
- return a;
- }),
- (RepeaterModifier.prototype.addShape = function () {});
- function RoundCornersModifier() {}
- extendPrototype([ShapeModifier], RoundCornersModifier),
- (RoundCornersModifier.prototype.initModifierProperties = function (
- e,
- t
- ) {
- (this.getValue = this.processKeys),
- (this.rd = PropertyFactory.getProp(e, t.r, 0, null, this)),
- (this._isAnimated = !!this.rd.effectsSequence.length);
- }),
- (RoundCornersModifier.prototype.processPath = function (e, t) {
- var r = shapePool.newElement();
- r.c = e.c;
- var i,
- s = e._length,
- n,
- a,
- o,
- l,
- c,
- g,
- S = 0,
- p,
- P,
- b,
- y,
- A,
- u;
- for (i = 0; i < s; i += 1)
- (n = e.v[i]),
- (o = e.o[i]),
- (a = e.i[i]),
- n[0] === o[0] && n[1] === o[1] && n[0] === a[0] && n[1] === a[1]
- ? (i === 0 || i === s - 1) && !e.c
- ? (r.setTripleAt(n[0], n[1], o[0], o[1], a[0], a[1], S),
- (S += 1))
- : (i === 0 ? (l = e.v[s - 1]) : (l = e.v[i - 1]),
- (c = Math.sqrt(
- Math.pow(n[0] - l[0], 2) + Math.pow(n[1] - l[1], 2)
- )),
- (g = c ? Math.min(c / 2, t) / c : 0),
- (A = n[0] + (l[0] - n[0]) * g),
- (p = A),
- (u = n[1] - (n[1] - l[1]) * g),
- (P = u),
- (b = p - (p - n[0]) * roundCorner),
- (y = P - (P - n[1]) * roundCorner),
- r.setTripleAt(p, P, b, y, A, u, S),
- (S += 1),
- i === s - 1 ? (l = e.v[0]) : (l = e.v[i + 1]),
- (c = Math.sqrt(
- Math.pow(n[0] - l[0], 2) + Math.pow(n[1] - l[1], 2)
- )),
- (g = c ? Math.min(c / 2, t) / c : 0),
- (b = n[0] + (l[0] - n[0]) * g),
- (p = b),
- (y = n[1] + (l[1] - n[1]) * g),
- (P = y),
- (A = p - (p - n[0]) * roundCorner),
- (u = P - (P - n[1]) * roundCorner),
- r.setTripleAt(p, P, b, y, A, u, S),
- (S += 1))
- : (r.setTripleAt(
- e.v[i][0],
- e.v[i][1],
- e.o[i][0],
- e.o[i][1],
- e.i[i][0],
- e.i[i][1],
- S
- ),
- (S += 1));
- return r;
- }),
- (RoundCornersModifier.prototype.processShapes = function (e) {
- var t,
- r,
- i = this.shapes.length,
- s,
- n,
- a = this.rd.v;
- if (a !== 0) {
- var o, l;
- for (r = 0; r < i; r += 1) {
- if (
- ((o = this.shapes[r]),
- (l = o.localShapeCollection),
- !(!o.shape._mdf && !this._mdf && !e))
- )
- for (
- l.releaseShapes(),
- o.shape._mdf = !0,
- t = o.shape.paths.shapes,
- n = o.shape.paths._length,
- s = 0;
- s < n;
- s += 1
- )
- l.addShape(this.processPath(t[s], a));
- o.shape.paths = o.localShapeCollection;
- }
- }
- this.dynamicProperties.length || (this._mdf = !1);
- });
- function floatEqual(e, t) {
- return Math.abs(e - t) * 1e5 <= Math.min(Math.abs(e), Math.abs(t));
- }
- function floatZero(e) {
- return Math.abs(e) <= 1e-5;
- }
- function lerp(e, t, r) {
- return e * (1 - r) + t * r;
- }
- function lerpPoint(e, t, r) {
- return [lerp(e[0], t[0], r), lerp(e[1], t[1], r)];
- }
- function quadRoots(e, t, r) {
- if (e === 0) return [];
- var i = t * t - 4 * e * r;
- if (i < 0) return [];
- var s = -t / (2 * e);
- if (i === 0) return [s];
- var n = Math.sqrt(i) / (2 * e);
- return [s - n, s + n];
- }
- function polynomialCoefficients(e, t, r, i) {
- return [
- -e + 3 * t - 3 * r + i,
- 3 * e - 6 * t + 3 * r,
- -3 * e + 3 * t,
- e
- ];
- }
- function singlePoint(e) {
- return new PolynomialBezier(e, e, e, e, !1);
- }
- function PolynomialBezier(e, t, r, i, s) {
- s && pointEqual(e, t) && (t = lerpPoint(e, i, 1 / 3)),
- s && pointEqual(r, i) && (r = lerpPoint(e, i, 2 / 3));
- var n = polynomialCoefficients(e[0], t[0], r[0], i[0]),
- a = polynomialCoefficients(e[1], t[1], r[1], i[1]);
- (this.a = [n[0], a[0]]),
- (this.b = [n[1], a[1]]),
- (this.c = [n[2], a[2]]),
- (this.d = [n[3], a[3]]),
- (this.points = [e, t, r, i]);
- }
- (PolynomialBezier.prototype.point = function (e) {
- return [
- ((this.a[0] * e + this.b[0]) * e + this.c[0]) * e + this.d[0],
- ((this.a[1] * e + this.b[1]) * e + this.c[1]) * e + this.d[1]
- ];
- }),
- (PolynomialBezier.prototype.derivative = function (e) {
- return [
- (3 * e * this.a[0] + 2 * this.b[0]) * e + this.c[0],
- (3 * e * this.a[1] + 2 * this.b[1]) * e + this.c[1]
- ];
- }),
- (PolynomialBezier.prototype.tangentAngle = function (e) {
- var t = this.derivative(e);
- return Math.atan2(t[1], t[0]);
- }),
- (PolynomialBezier.prototype.normalAngle = function (e) {
- var t = this.derivative(e);
- return Math.atan2(t[0], t[1]);
- }),
- (PolynomialBezier.prototype.inflectionPoints = function () {
- var e = this.a[1] * this.b[0] - this.a[0] * this.b[1];
- if (floatZero(e)) return [];
- var t = (-0.5 * (this.a[1] * this.c[0] - this.a[0] * this.c[1])) / e,
- r =
- t * t -
- ((1 / 3) * (this.b[1] * this.c[0] - this.b[0] * this.c[1])) / e;
- if (r < 0) return [];
- var i = Math.sqrt(r);
- return floatZero(i)
- ? i > 0 && i < 1
- ? [t]
- : []
- : [t - i, t + i].filter(function (s) {
- return s > 0 && s < 1;
- });
- }),
- (PolynomialBezier.prototype.split = function (e) {
- if (e <= 0) return [singlePoint(this.points[0]), this];
- if (e >= 1)
- return [this, singlePoint(this.points[this.points.length - 1])];
- var t = lerpPoint(this.points[0], this.points[1], e),
- r = lerpPoint(this.points[1], this.points[2], e),
- i = lerpPoint(this.points[2], this.points[3], e),
- s = lerpPoint(t, r, e),
- n = lerpPoint(r, i, e),
- a = lerpPoint(s, n, e);
- return [
- new PolynomialBezier(this.points[0], t, s, a, !0),
- new PolynomialBezier(a, n, i, this.points[3], !0)
- ];
- });
- function extrema(e, t) {
- var r = e.points[0][t],
- i = e.points[e.points.length - 1][t];
- if (r > i) {
- var s = i;
- (i = r), (r = s);
- }
- for (
- var n = quadRoots(3 * e.a[t], 2 * e.b[t], e.c[t]), a = 0;
- a < n.length;
- a += 1
- )
- if (n[a] > 0 && n[a] < 1) {
- var o = e.point(n[a])[t];
- o < r ? (r = o) : o > i && (i = o);
- }
- return { min: r, max: i };
- }
- (PolynomialBezier.prototype.bounds = function () {
- return { x: extrema(this, 0), y: extrema(this, 1) };
- }),
- (PolynomialBezier.prototype.boundingBox = function () {
- var e = this.bounds();
- return {
- left: e.x.min,
- right: e.x.max,
- top: e.y.min,
- bottom: e.y.max,
- width: e.x.max - e.x.min,
- height: e.y.max - e.y.min,
- cx: (e.x.max + e.x.min) / 2,
- cy: (e.y.max + e.y.min) / 2
- };
- });
- function intersectData(e, t, r) {
- var i = e.boundingBox();
- return {
- cx: i.cx,
- cy: i.cy,
- width: i.width,
- height: i.height,
- bez: e,
- t: (t + r) / 2,
- t1: t,
- t2: r
- };
- }
- function splitData(e) {
- var t = e.bez.split(0.5);
- return [intersectData(t[0], e.t1, e.t), intersectData(t[1], e.t, e.t2)];
- }
- function boxIntersect(e, t) {
- return (
- Math.abs(e.cx - t.cx) * 2 < e.width + t.width &&
- Math.abs(e.cy - t.cy) * 2 < e.height + t.height
- );
- }
- function intersectsImpl(e, t, r, i, s, n) {
- if (boxIntersect(e, t)) {
- if (
- r >= n ||
- (e.width <= i && e.height <= i && t.width <= i && t.height <= i)
- ) {
- s.push([e.t, t.t]);
- return;
- }
- var a = splitData(e),
- o = splitData(t);
- intersectsImpl(a[0], o[0], r + 1, i, s, n),
- intersectsImpl(a[0], o[1], r + 1, i, s, n),
- intersectsImpl(a[1], o[0], r + 1, i, s, n),
- intersectsImpl(a[1], o[1], r + 1, i, s, n);
- }
- }
- (PolynomialBezier.prototype.intersections = function (e, t, r) {
- t === void 0 && (t = 2), r === void 0 && (r = 7);
- var i = [];
- return (
- intersectsImpl(
- intersectData(this, 0, 1),
- intersectData(e, 0, 1),
- 0,
- t,
- i,
- r
- ),
- i
- );
- }),
- (PolynomialBezier.shapeSegment = function (e, t) {
- var r = (t + 1) % e.length();
- return new PolynomialBezier(e.v[t], e.o[t], e.i[r], e.v[r], !0);
- }),
- (PolynomialBezier.shapeSegmentInverted = function (e, t) {
- var r = (t + 1) % e.length();
- return new PolynomialBezier(e.v[r], e.i[r], e.o[t], e.v[t], !0);
- });
- function crossProduct(e, t) {
- return [
- e[1] * t[2] - e[2] * t[1],
- e[2] * t[0] - e[0] * t[2],
- e[0] * t[1] - e[1] * t[0]
- ];
- }
- function lineIntersection(e, t, r, i) {
- var s = [e[0], e[1], 1],
- n = [t[0], t[1], 1],
- a = [r[0], r[1], 1],
- o = [i[0], i[1], 1],
- l = crossProduct(crossProduct(s, n), crossProduct(a, o));
- return floatZero(l[2]) ? null : [l[0] / l[2], l[1] / l[2]];
- }
- function polarOffset(e, t, r) {
- return [e[0] + Math.cos(t) * r, e[1] - Math.sin(t) * r];
- }
- function pointDistance(e, t) {
- return Math.hypot(e[0] - t[0], e[1] - t[1]);
- }
- function pointEqual(e, t) {
- return floatEqual(e[0], t[0]) && floatEqual(e[1], t[1]);
- }
- function ZigZagModifier() {}
- extendPrototype([ShapeModifier], ZigZagModifier),
- (ZigZagModifier.prototype.initModifierProperties = function (e, t) {
- (this.getValue = this.processKeys),
- (this.amplitude = PropertyFactory.getProp(e, t.s, 0, null, this)),
- (this.frequency = PropertyFactory.getProp(e, t.r, 0, null, this)),
- (this.pointsType = PropertyFactory.getProp(e, t.pt, 0, null, this)),
- (this._isAnimated =
- this.amplitude.effectsSequence.length !== 0 ||
- this.frequency.effectsSequence.length !== 0 ||
- this.pointsType.effectsSequence.length !== 0);
- });
- function setPoint(e, t, r, i, s, n, a) {
- var o = r - Math.PI / 2,
- l = r + Math.PI / 2,
- c = t[0] + Math.cos(r) * i * s,
- g = t[1] - Math.sin(r) * i * s;
- e.setTripleAt(
- c,
- g,
- c + Math.cos(o) * n,
- g - Math.sin(o) * n,
- c + Math.cos(l) * a,
- g - Math.sin(l) * a,
- e.length()
- );
- }
- function getPerpendicularVector(e, t) {
- var r = [t[0] - e[0], t[1] - e[1]],
- i = -Math.PI * 0.5,
- s = [
- Math.cos(i) * r[0] - Math.sin(i) * r[1],
- Math.sin(i) * r[0] + Math.cos(i) * r[1]
- ];
- return s;
- }
- function getProjectingAngle(e, t) {
- var r = t === 0 ? e.length() - 1 : t - 1,
- i = (t + 1) % e.length(),
- s = e.v[r],
- n = e.v[i],
- a = getPerpendicularVector(s, n);
- return Math.atan2(0, 1) - Math.atan2(a[1], a[0]);
- }
- function zigZagCorner(e, t, r, i, s, n, a) {
- var o = getProjectingAngle(t, r),
- l = t.v[r % t._length],
- c = t.v[r === 0 ? t._length - 1 : r - 1],
- g = t.v[(r + 1) % t._length],
- S =
- n === 2
- ? Math.sqrt(Math.pow(l[0] - c[0], 2) + Math.pow(l[1] - c[1], 2))
- : 0,
- p =
- n === 2
- ? Math.sqrt(Math.pow(l[0] - g[0], 2) + Math.pow(l[1] - g[1], 2))
- : 0;
- setPoint(
- e,
- t.v[r % t._length],
- o,
- a,
- i,
- p / ((s + 1) * 2),
- S / ((s + 1) * 2)
- );
- }
- function zigZagSegment(e, t, r, i, s, n) {
- for (var a = 0; a < i; a += 1) {
- var o = (a + 1) / (i + 1),
- l =
- s === 2
- ? Math.sqrt(
- Math.pow(t.points[3][0] - t.points[0][0], 2) +
- Math.pow(t.points[3][1] - t.points[0][1], 2)
- )
- : 0,
- c = t.normalAngle(o),
- g = t.point(o);
- setPoint(e, g, c, n, r, l / ((i + 1) * 2), l / ((i + 1) * 2)),
- (n = -n);
- }
- return n;
- }
- (ZigZagModifier.prototype.processPath = function (e, t, r, i) {
- var s = e._length,
- n = shapePool.newElement();
- if (((n.c = e.c), e.c || (s -= 1), s === 0)) return n;
- var a = -1,
- o = PolynomialBezier.shapeSegment(e, 0);
- zigZagCorner(n, e, 0, t, r, i, a);
- for (var l = 0; l < s; l += 1)
- (a = zigZagSegment(n, o, t, r, i, -a)),
- l === s - 1 && !e.c
- ? (o = null)
- : (o = PolynomialBezier.shapeSegment(e, (l + 1) % s)),
- zigZagCorner(n, e, l + 1, t, r, i, a);
- return n;
- }),
- (ZigZagModifier.prototype.processShapes = function (e) {
- var t,
- r,
- i = this.shapes.length,
- s,
- n,
- a = this.amplitude.v,
- o = Math.max(0, Math.round(this.frequency.v)),
- l = this.pointsType.v;
- if (a !== 0) {
- var c, g;
- for (r = 0; r < i; r += 1) {
- if (
- ((c = this.shapes[r]),
- (g = c.localShapeCollection),
- !(!c.shape._mdf && !this._mdf && !e))
- )
- for (
- g.releaseShapes(),
- c.shape._mdf = !0,
- t = c.shape.paths.shapes,
- n = c.shape.paths._length,
- s = 0;
- s < n;
- s += 1
- )
- g.addShape(this.processPath(t[s], a, o, l));
- c.shape.paths = c.localShapeCollection;
- }
- }
- this.dynamicProperties.length || (this._mdf = !1);
- });
- function linearOffset(e, t, r) {
- var i = Math.atan2(t[0] - e[0], t[1] - e[1]);
- return [polarOffset(e, i, r), polarOffset(t, i, r)];
- }
- function offsetSegment(e, t) {
- var r, i, s, n, a, o, l;
- (l = linearOffset(e.points[0], e.points[1], t)),
- (r = l[0]),
- (i = l[1]),
- (l = linearOffset(e.points[1], e.points[2], t)),
- (s = l[0]),
- (n = l[1]),
- (l = linearOffset(e.points[2], e.points[3], t)),
- (a = l[0]),
- (o = l[1]);
- var c = lineIntersection(r, i, s, n);
- c === null && (c = i);
- var g = lineIntersection(a, o, s, n);
- return g === null && (g = a), new PolynomialBezier(r, c, g, o);
- }
- function joinLines(e, t, r, i, s) {
- var n = t.points[3],
- a = r.points[0];
- if (i === 3 || pointEqual(n, a)) return n;
- if (i === 2) {
- var o = -t.tangentAngle(1),
- l = -r.tangentAngle(0) + Math.PI,
- c = lineIntersection(
- n,
- polarOffset(n, o + Math.PI / 2, 100),
- a,
- polarOffset(a, o + Math.PI / 2, 100)
- ),
- g = c ? pointDistance(c, n) : pointDistance(n, a) / 2,
- S = polarOffset(n, o, 2 * g * roundCorner);
- return (
- e.setXYAt(S[0], S[1], 'o', e.length() - 1),
- (S = polarOffset(a, l, 2 * g * roundCorner)),
- e.setTripleAt(a[0], a[1], a[0], a[1], S[0], S[1], e.length()),
- a
- );
- }
- var p = pointEqual(n, t.points[2]) ? t.points[0] : t.points[2],
- P = pointEqual(a, r.points[1]) ? r.points[3] : r.points[1],
- b = lineIntersection(p, n, a, P);
- return b && pointDistance(b, n) < s
- ? (e.setTripleAt(b[0], b[1], b[0], b[1], b[0], b[1], e.length()), b)
- : n;
- }
- function getIntersection(e, t) {
- var r = e.intersections(t);
- return (
- r.length && floatEqual(r[0][0], 1) && r.shift(),
- r.length ? r[0] : null
- );
- }
- function pruneSegmentIntersection(e, t) {
- var r = e.slice(),
- i = t.slice(),
- s = getIntersection(e[e.length - 1], t[0]);
- return (
- s &&
- ((r[e.length - 1] = e[e.length - 1].split(s[0])[0]),
- (i[0] = t[0].split(s[1])[1])),
- e.length > 1 &&
- t.length > 1 &&
- ((s = getIntersection(e[0], t[t.length - 1])), s)
- ? [[e[0].split(s[0])[0]], [t[t.length - 1].split(s[1])[1]]]
- : [r, i]
- );
- }
- function pruneIntersections(e) {
- for (var t, r = 1; r < e.length; r += 1)
- (t = pruneSegmentIntersection(e[r - 1], e[r])),
- (e[r - 1] = t[0]),
- (e[r] = t[1]);
- return (
- e.length > 1 &&
- ((t = pruneSegmentIntersection(e[e.length - 1], e[0])),
- (e[e.length - 1] = t[0]),
- (e[0] = t[1])),
- e
- );
- }
- function offsetSegmentSplit(e, t) {
- var r = e.inflectionPoints(),
- i,
- s,
- n,
- a;
- if (r.length === 0) return [offsetSegment(e, t)];
- if (r.length === 1 || floatEqual(r[1], 1))
- return (
- (n = e.split(r[0])),
- (i = n[0]),
- (s = n[1]),
- [offsetSegment(i, t), offsetSegment(s, t)]
- );
- (n = e.split(r[0])), (i = n[0]);
- var o = (r[1] - r[0]) / (1 - r[0]);
- return (
- (n = n[1].split(o)),
- (a = n[0]),
- (s = n[1]),
- [offsetSegment(i, t), offsetSegment(a, t), offsetSegment(s, t)]
- );
- }
- function OffsetPathModifier() {}
- extendPrototype([ShapeModifier], OffsetPathModifier),
- (OffsetPathModifier.prototype.initModifierProperties = function (e, t) {
- (this.getValue = this.processKeys),
- (this.amount = PropertyFactory.getProp(e, t.a, 0, null, this)),
- (this.miterLimit = PropertyFactory.getProp(e, t.ml, 0, null, this)),
- (this.lineJoin = t.lj),
- (this._isAnimated = this.amount.effectsSequence.length !== 0);
- }),
- (OffsetPathModifier.prototype.processPath = function (e, t, r, i) {
- var s = shapePool.newElement();
- s.c = e.c;
- var n = e.length();
- e.c || (n -= 1);
- var a,
- o,
- l,
- c = [];
- for (a = 0; a < n; a += 1)
- (l = PolynomialBezier.shapeSegment(e, a)),
- c.push(offsetSegmentSplit(l, t));
- if (!e.c)
- for (a = n - 1; a >= 0; a -= 1)
- (l = PolynomialBezier.shapeSegmentInverted(e, a)),
- c.push(offsetSegmentSplit(l, t));
- c = pruneIntersections(c);
- var g = null,
- S = null;
- for (a = 0; a < c.length; a += 1) {
- var p = c[a];
- for (
- S && (g = joinLines(s, S, p[0], r, i)),
- S = p[p.length - 1],
- o = 0;
- o < p.length;
- o += 1
- )
- (l = p[o]),
- g && pointEqual(l.points[0], g)
- ? s.setXYAt(
- l.points[1][0],
- l.points[1][1],
- 'o',
- s.length() - 1
- )
- : s.setTripleAt(
- l.points[0][0],
- l.points[0][1],
- l.points[1][0],
- l.points[1][1],
- l.points[0][0],
- l.points[0][1],
- s.length()
- ),
- s.setTripleAt(
- l.points[3][0],
- l.points[3][1],
- l.points[3][0],
- l.points[3][1],
- l.points[2][0],
- l.points[2][1],
- s.length()
- ),
- (g = l.points[3]);
- }
- return c.length && joinLines(s, S, c[0][0], r, i), s;
- }),
- (OffsetPathModifier.prototype.processShapes = function (e) {
- var t,
- r,
- i = this.shapes.length,
- s,
- n,
- a = this.amount.v,
- o = this.miterLimit.v,
- l = this.lineJoin;
- if (a !== 0) {
- var c, g;
- for (r = 0; r < i; r += 1) {
- if (
- ((c = this.shapes[r]),
- (g = c.localShapeCollection),
- !(!c.shape._mdf && !this._mdf && !e))
- )
- for (
- g.releaseShapes(),
- c.shape._mdf = !0,
- t = c.shape.paths.shapes,
- n = c.shape.paths._length,
- s = 0;
- s < n;
- s += 1
- )
- g.addShape(this.processPath(t[s], a, l, o));
- c.shape.paths = c.localShapeCollection;
- }
- }
- this.dynamicProperties.length || (this._mdf = !1);
- });
- function getFontProperties(e) {
- for (
- var t = e.fStyle ? e.fStyle.split(' ') : [],
- r = 'normal',
- i = 'normal',
- s = t.length,
- n,
- a = 0;
- a < s;
- a += 1
- )
- switch (((n = t[a].toLowerCase()), n)) {
- case 'italic':
- i = 'italic';
- break;
- case 'bold':
- r = '700';
- break;
- case 'black':
- r = '900';
- break;
- case 'medium':
- r = '500';
- break;
- case 'regular':
- case 'normal':
- r = '400';
- break;
- case 'light':
- case 'thin':
- r = '200';
- break;
- }
- return { style: i, weight: e.fWeight || r };
- }
- var FontManager = (function () {
- var e = 5e3,
- t = { w: 0, size: 0, shapes: [], data: { shapes: [] } },
- r = [];
- r = r.concat([
- 2304, 2305, 2306, 2307, 2362, 2363, 2364, 2364, 2366, 2367, 2368,
- 2369, 2370, 2371, 2372, 2373, 2374, 2375, 2376, 2377, 2378, 2379,
- 2380, 2381, 2382, 2383, 2387, 2388, 2389, 2390, 2391, 2402, 2403
- ]);
- var i = ['d83cdffb', 'd83cdffc', 'd83cdffd', 'd83cdffe', 'd83cdfff'],
- s = [65039, 8205];
- function n(d) {
- var E = d.split(','),
- T,
- x = E.length,
- _ = [];
- for (T = 0; T < x; T += 1)
- E[T] !== 'sans-serif' && E[T] !== 'monospace' && _.push(E[T]);
- return _.join(',');
- }
- function a(d, E) {
- var T = createTag('span');
- T.setAttribute('aria-hidden', !0), (T.style.fontFamily = E);
- var x = createTag('span');
- (x.innerText = 'giItT1WQy@!-/#'),
- (T.style.position = 'absolute'),
- (T.style.left = '-10000px'),
- (T.style.top = '-10000px'),
- (T.style.fontSize = '300px'),
- (T.style.fontVariant = 'normal'),
- (T.style.fontStyle = 'normal'),
- (T.style.fontWeight = 'normal'),
- (T.style.letterSpacing = '0'),
- T.appendChild(x),
- document.body.appendChild(T);
- var _ = x.offsetWidth;
- return (
- (x.style.fontFamily = n(d) + ', ' + E), { node: x, w: _, parent: T }
- );
- }
- function o() {
- var d,
- E = this.fonts.length,
- T,
- x,
- _ = E;
- for (d = 0; d < E; d += 1)
- this.fonts[d].loaded
- ? (_ -= 1)
- : this.fonts[d].fOrigin === 'n' || this.fonts[d].origin === 0
- ? (this.fonts[d].loaded = !0)
- : ((T = this.fonts[d].monoCase.node),
- (x = this.fonts[d].monoCase.w),
- T.offsetWidth !== x
- ? ((_ -= 1), (this.fonts[d].loaded = !0))
- : ((T = this.fonts[d].sansCase.node),
- (x = this.fonts[d].sansCase.w),
- T.offsetWidth !== x &&
- ((_ -= 1), (this.fonts[d].loaded = !0))),
- this.fonts[d].loaded &&
- (this.fonts[d].sansCase.parent.parentNode.removeChild(
- this.fonts[d].sansCase.parent
- ),
- this.fonts[d].monoCase.parent.parentNode.removeChild(
- this.fonts[d].monoCase.parent
- )));
- _ !== 0 && Date.now() - this.initTime < e
- ? setTimeout(this.checkLoadedFontsBinded, 20)
- : setTimeout(this.setIsLoadedBinded, 10);
- }
- function l(d, E) {
- var T = document.body && E ? 'svg' : 'canvas',
- x,
- _ = getFontProperties(d);
- if (T === 'svg') {
- var I = createNS('text');
- (I.style.fontSize = '100px'),
- I.setAttribute('font-family', d.fFamily),
- I.setAttribute('font-style', _.style),
- I.setAttribute('font-weight', _.weight),
- (I.textContent = '1'),
- d.fClass
- ? ((I.style.fontFamily = 'inherit'),
- I.setAttribute('class', d.fClass))
- : (I.style.fontFamily = d.fFamily),
- E.appendChild(I),
- (x = I);
- } else {
- var V = new OffscreenCanvas(500, 500).getContext('2d');
- (V.font = _.style + ' ' + _.weight + ' 100px ' + d.fFamily),
- (x = V);
- }
- function D(N) {
- return T === 'svg'
- ? ((x.textContent = N), x.getComputedTextLength())
- : x.measureText(N).width;
- }
- return { measureText: D };
- }
- function c(d, E) {
- if (!d) {
- this.isLoaded = !0;
- return;
- }
- if (this.chars) {
- (this.isLoaded = !0), (this.fonts = d.list);
- return;
- }
- if (!document.body) {
- (this.isLoaded = !0),
- d.list.forEach(function (F) {
- (F.helper = l(F)), (F.cache = {});
- }),
- (this.fonts = d.list);
- return;
- }
- var T = d.list,
- x,
- _ = T.length,
- I = _;
- for (x = 0; x < _; x += 1) {
- var V = !0,
- D,
- N;
- if (
- ((T[x].loaded = !1),
- (T[x].monoCase = a(T[x].fFamily, 'monospace')),
- (T[x].sansCase = a(T[x].fFamily, 'sans-serif')),
- !T[x].fPath)
- )
- (T[x].loaded = !0), (I -= 1);
- else if (T[x].fOrigin === 'p' || T[x].origin === 3) {
- if (
- ((D = document.querySelectorAll(
- 'style[f-forigin="p"][f-family="' +
- T[x].fFamily +
- '"], style[f-origin="3"][f-family="' +
- T[x].fFamily +
- '"]'
- )),
- D.length > 0 && (V = !1),
- V)
- ) {
- var $ = createTag('style');
- $.setAttribute('f-forigin', T[x].fOrigin),
- $.setAttribute('f-origin', T[x].origin),
- $.setAttribute('f-family', T[x].fFamily),
- ($.type = 'text/css'),
- ($.innerText =
- '@font-face {font-family: ' +
- T[x].fFamily +
- "; font-style: normal; src: url('" +
- T[x].fPath +
- "');}"),
- E.appendChild($);
- }
- } else if (T[x].fOrigin === 'g' || T[x].origin === 1) {
- for (
- D = document.querySelectorAll(
- 'link[f-forigin="g"], link[f-origin="1"]'
- ),
- N = 0;
- N < D.length;
- N += 1
- )
- D[N].href.indexOf(T[x].fPath) !== -1 && (V = !1);
- if (V) {
- var O = createTag('link');
- O.setAttribute('f-forigin', T[x].fOrigin),
- O.setAttribute('f-origin', T[x].origin),
- (O.type = 'text/css'),
- (O.rel = 'stylesheet'),
- (O.href = T[x].fPath),
- document.body.appendChild(O);
- }
- } else if (T[x].fOrigin === 't' || T[x].origin === 2) {
- for (
- D = document.querySelectorAll(
- 'script[f-forigin="t"], script[f-origin="2"]'
- ),
- N = 0;
- N < D.length;
- N += 1
- )
- T[x].fPath === D[N].src && (V = !1);
- if (V) {
- var B = createTag('link');
- B.setAttribute('f-forigin', T[x].fOrigin),
- B.setAttribute('f-origin', T[x].origin),
- B.setAttribute('rel', 'stylesheet'),
- B.setAttribute('href', T[x].fPath),
- E.appendChild(B);
- }
- }
- (T[x].helper = l(T[x], E)),
- (T[x].cache = {}),
- this.fonts.push(T[x]);
- }
- I === 0
- ? (this.isLoaded = !0)
- : setTimeout(this.checkLoadedFonts.bind(this), 100);
- }
- function g(d) {
- if (d) {
- this.chars || (this.chars = []);
- var E,
- T = d.length,
- x,
- _ = this.chars.length,
- I;
- for (E = 0; E < T; E += 1) {
- for (x = 0, I = !1; x < _; )
- this.chars[x].style === d[E].style &&
- this.chars[x].fFamily === d[E].fFamily &&
- this.chars[x].ch === d[E].ch &&
- (I = !0),
- (x += 1);
- I || (this.chars.push(d[E]), (_ += 1));
- }
- }
- }
- function S(d, E, T) {
- for (var x = 0, _ = this.chars.length; x < _; ) {
- if (
- this.chars[x].ch === d &&
- this.chars[x].style === E &&
- this.chars[x].fFamily === T
- )
- return this.chars[x];
- x += 1;
- }
- return (
- ((typeof d == 'string' && d.charCodeAt(0) !== 13) || !d) &&
- console &&
- console.warn &&
- !this._warned &&
- ((this._warned = !0),
- console.warn(
- 'Missing character from exported characters list: ',
- d,
- E,
- T
- )),
- t
- );
- }
- function p(d, E, T) {
- var x = this.getFontByName(E),
- _ = d.charCodeAt(0);
- if (!x.cache[_ + 1]) {
- var I = x.helper;
- if (d === ' ') {
- var V = I.measureText('|' + d + '|'),
- D = I.measureText('||');
- x.cache[_ + 1] = (V - D) / 100;
- } else x.cache[_ + 1] = I.measureText(d) / 100;
- }
- return x.cache[_ + 1] * T;
- }
- function P(d) {
- for (var E = 0, T = this.fonts.length; E < T; ) {
- if (this.fonts[E].fName === d) return this.fonts[E];
- E += 1;
- }
- return this.fonts[0];
- }
- function b(d, E) {
- var T = d.toString(16) + E.toString(16);
- return i.indexOf(T) !== -1;
- }
- function y(d, E) {
- return E ? d === s[0] && E === s[1] : d === s[1];
- }
- function A(d) {
- return r.indexOf(d) !== -1;
- }
- function u() {
- this.isLoaded = !0;
- }
- var f = function () {
- (this.fonts = []),
- (this.chars = null),
- (this.typekitLoaded = 0),
- (this.isLoaded = !1),
- (this._warned = !1),
- (this.initTime = Date.now()),
- (this.setIsLoadedBinded = this.setIsLoaded.bind(this)),
- (this.checkLoadedFontsBinded = this.checkLoadedFonts.bind(this));
- };
- (f.isModifier = b),
- (f.isZeroWidthJoiner = y),
- (f.isCombinedCharacter = A);
- var m = {
- addChars: g,
- addFonts: c,
- getCharData: S,
- getFontByName: P,
- measureText: p,
- checkLoadedFonts: o,
- setIsLoaded: u
- };
- return (f.prototype = m), f;
- })();
- function SlotManager(e) {
- this.animationData = e;
- }
- SlotManager.prototype.getProp = function (e) {
- return this.animationData.slots && this.animationData.slots[e.sid]
- ? Object.assign(e, this.animationData.slots[e.sid].p)
- : e;
- };
- function slotFactory(e) {
- return new SlotManager(e);
- }
- function RenderableElement() {}
- RenderableElement.prototype = {
- initRenderable: function () {
- (this.isInRange = !1),
- (this.hidden = !1),
- (this.isTransparent = !1),
- (this.renderableComponents = []);
- },
- addRenderableComponent: function (t) {
- this.renderableComponents.indexOf(t) === -1 &&
- this.renderableComponents.push(t);
- },
- removeRenderableComponent: function (t) {
- this.renderableComponents.indexOf(t) !== -1 &&
- this.renderableComponents.splice(
- this.renderableComponents.indexOf(t),
- 1
- );
- },
- prepareRenderableFrame: function (t) {
- this.checkLayerLimits(t);
- },
- checkTransparency: function () {
- this.finalTransform.mProp.o.v <= 0
- ? !this.isTransparent &&
- this.globalData.renderConfig.hideOnTransparent &&
- ((this.isTransparent = !0), this.hide())
- : this.isTransparent && ((this.isTransparent = !1), this.show());
- },
- checkLayerLimits: function (t) {
- this.data.ip - this.data.st <= t && this.data.op - this.data.st > t
- ? this.isInRange !== !0 &&
- ((this.globalData._mdf = !0),
- (this._mdf = !0),
- (this.isInRange = !0),
- this.show())
- : this.isInRange !== !1 &&
- ((this.globalData._mdf = !0), (this.isInRange = !1), this.hide());
- },
- renderRenderable: function () {
- var t,
- r = this.renderableComponents.length;
- for (t = 0; t < r; t += 1)
- this.renderableComponents[t].renderFrame(this._isFirstFrame);
- },
- sourceRectAtTime: function () {
- return { top: 0, left: 0, width: 100, height: 100 };
- },
- getLayerSize: function () {
- return this.data.ty === 5
- ? { w: this.data.textData.width, h: this.data.textData.height }
- : { w: this.data.width, h: this.data.height };
- }
- };
- var getBlendMode = (function () {
- var e = {
- 0: 'source-over',
- 1: 'multiply',
- 2: 'screen',
- 3: 'overlay',
- 4: 'darken',
- 5: 'lighten',
- 6: 'color-dodge',
- 7: 'color-burn',
- 8: 'hard-light',
- 9: 'soft-light',
- 10: 'difference',
- 11: 'exclusion',
- 12: 'hue',
- 13: 'saturation',
- 14: 'color',
- 15: 'luminosity'
- };
- return function (t) {
- return e[t] || '';
- };
- })();
- function SliderEffect(e, t, r) {
- this.p = PropertyFactory.getProp(t, e.v, 0, 0, r);
- }
- function AngleEffect(e, t, r) {
- this.p = PropertyFactory.getProp(t, e.v, 0, 0, r);
- }
- function ColorEffect(e, t, r) {
- this.p = PropertyFactory.getProp(t, e.v, 1, 0, r);
- }
- function PointEffect(e, t, r) {
- this.p = PropertyFactory.getProp(t, e.v, 1, 0, r);
- }
- function LayerIndexEffect(e, t, r) {
- this.p = PropertyFactory.getProp(t, e.v, 0, 0, r);
- }
- function MaskIndexEffect(e, t, r) {
- this.p = PropertyFactory.getProp(t, e.v, 0, 0, r);
- }
- function CheckboxEffect(e, t, r) {
- this.p = PropertyFactory.getProp(t, e.v, 0, 0, r);
- }
- function NoValueEffect() {
- this.p = {};
- }
- function EffectsManager(e, t) {
- var r = e.ef || [];
- this.effectElements = [];
- var i,
- s = r.length,
- n;
- for (i = 0; i < s; i += 1)
- (n = new GroupEffect(r[i], t)), this.effectElements.push(n);
- }
- function GroupEffect(e, t) {
- this.init(e, t);
- }
- extendPrototype([DynamicPropertyContainer], GroupEffect),
- (GroupEffect.prototype.getValue =
- GroupEffect.prototype.iterateDynamicProperties),
- (GroupEffect.prototype.init = function (e, t) {
- (this.data = e),
- (this.effectElements = []),
- this.initDynamicPropertyContainer(t);
- var r,
- i = this.data.ef.length,
- s,
- n = this.data.ef;
- for (r = 0; r < i; r += 1) {
- switch (((s = null), n[r].ty)) {
- case 0:
- s = new SliderEffect(n[r], t, this);
- break;
- case 1:
- s = new AngleEffect(n[r], t, this);
- break;
- case 2:
- s = new ColorEffect(n[r], t, this);
- break;
- case 3:
- s = new PointEffect(n[r], t, this);
- break;
- case 4:
- case 7:
- s = new CheckboxEffect(n[r], t, this);
- break;
- case 10:
- s = new LayerIndexEffect(n[r], t, this);
- break;
- case 11:
- s = new MaskIndexEffect(n[r], t, this);
- break;
- case 5:
- s = new EffectsManager(n[r], t);
- break;
- default:
- s = new NoValueEffect(n[r]);
- break;
- }
- s && this.effectElements.push(s);
- }
- });
- function BaseElement() {}
- BaseElement.prototype = {
- checkMasks: function () {
- if (!this.data.hasMask) return !1;
- for (var t = 0, r = this.data.masksProperties.length; t < r; ) {
- if (
- this.data.masksProperties[t].mode !== 'n' &&
- this.data.masksProperties[t].cl !== !1
- )
- return !0;
- t += 1;
- }
- return !1;
- },
- initExpressions: function () {
- var t = getExpressionInterfaces();
- if (t) {
- var r = t('layer'),
- i = t('effects'),
- s = t('shape'),
- n = t('text'),
- a = t('comp');
- (this.layerInterface = r(this)),
- this.data.hasMask &&
- this.maskManager &&
- this.layerInterface.registerMaskInterface(this.maskManager);
- var o = i.createEffectsInterface(this, this.layerInterface);
- this.layerInterface.registerEffectsInterface(o),
- this.data.ty === 0 || this.data.xt
- ? (this.compInterface = a(this))
- : this.data.ty === 4
- ? ((this.layerInterface.shapeInterface = s(
- this.shapesData,
- this.itemsData,
- this.layerInterface
- )),
- (this.layerInterface.content =
- this.layerInterface.shapeInterface))
- : this.data.ty === 5 &&
- ((this.layerInterface.textInterface = n(this)),
- (this.layerInterface.text =
- this.layerInterface.textInterface));
- }
- },
- setBlendMode: function () {
- var t = getBlendMode(this.data.bm),
- r = this.baseElement || this.layerElement;
- r.style['mix-blend-mode'] = t;
- },
- initBaseData: function (t, r, i) {
- (this.globalData = r),
- (this.comp = i),
- (this.data = t),
- (this.layerId = createElementID()),
- this.data.sr || (this.data.sr = 1),
- (this.effectsManager = new EffectsManager(
- this.data,
- this,
- this.dynamicProperties
- ));
- },
- getType: function () {
- return this.type;
- },
- sourceRectAtTime: function () {}
- };
- function FrameElement() {}
- FrameElement.prototype = {
- initFrame: function () {
- (this._isFirstFrame = !1),
- (this.dynamicProperties = []),
- (this._mdf = !1);
- },
- prepareProperties: function (t, r) {
- var i,
- s = this.dynamicProperties.length;
- for (i = 0; i < s; i += 1)
- (r ||
- (this._isParent &&
- this.dynamicProperties[i].propType === 'transform')) &&
- (this.dynamicProperties[i].getValue(),
- this.dynamicProperties[i]._mdf &&
- ((this.globalData._mdf = !0), (this._mdf = !0)));
- },
- addDynamicProperty: function (t) {
- this.dynamicProperties.indexOf(t) === -1 &&
- this.dynamicProperties.push(t);
- }
- };
- function FootageElement(e, t, r) {
- this.initFrame(),
- this.initRenderable(),
- (this.assetData = t.getAssetData(e.refId)),
- (this.footageData = t.imageLoader.getAsset(this.assetData)),
- this.initBaseData(e, t, r);
- }
- (FootageElement.prototype.prepareFrame = function () {}),
- extendPrototype(
- [RenderableElement, BaseElement, FrameElement],
- FootageElement
- ),
- (FootageElement.prototype.getBaseElement = function () {
- return null;
- }),
- (FootageElement.prototype.renderFrame = function () {}),
- (FootageElement.prototype.destroy = function () {}),
- (FootageElement.prototype.initExpressions = function () {
- var e = getExpressionInterfaces();
- if (e) {
- var t = e('footage');
- this.layerInterface = t(this);
- }
- }),
- (FootageElement.prototype.getFootageData = function () {
- return this.footageData;
- });
- function AudioElement(e, t, r) {
- this.initFrame(),
- this.initRenderable(),
- (this.assetData = t.getAssetData(e.refId)),
- this.initBaseData(e, t, r),
- (this._isPlaying = !1),
- (this._canPlay = !1);
- var i = this.globalData.getAssetsPath(this.assetData);
- (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 = e.tm
- ? PropertyFactory.getProp(this, e.tm, 0, t.frameRate, this)
- : { _placeholder: !0 }),
- (this.lv = PropertyFactory.getProp(
- this,
- e.au && e.au.lv ? e.au.lv : { k: [100] },
- 1,
- 0.01,
- this
- ));
- }
- (AudioElement.prototype.prepareFrame = function (e) {
- if (
- (this.prepareRenderableFrame(e, !0),
- this.prepareProperties(e, !0),
- this.tm._placeholder)
- )
- this._currentTime = e / this.data.sr;
- else {
- var t = this.tm.v;
- this._currentTime = t;
- }
- this._volume = this.lv.v[0];
- var r = this._volume * this._volumeMultiplier;
- this._previousVolume !== r &&
- ((this._previousVolume = r), this.audio.volume(r));
- }),
- extendPrototype(
- [RenderableElement, BaseElement, FrameElement],
- AudioElement
- ),
- (AudioElement.prototype.renderFrame = function () {
- this.isInRange &&
- this._canPlay &&
- (this._isPlaying
- ? (!this.audio.playing() ||
- Math.abs(
- this._currentTime / this.globalData.frameRate -
- this.audio.seek()
- ) > 0.1) &&
- this.audio.seek(this._currentTime / this.globalData.frameRate)
- : (this.audio.play(),
- this.audio.seek(this._currentTime / this.globalData.frameRate),
- (this._isPlaying = !0)));
- }),
- (AudioElement.prototype.show = function () {}),
- (AudioElement.prototype.hide = function () {
- this.audio.pause(), (this._isPlaying = !1);
- }),
- (AudioElement.prototype.pause = function () {
- this.audio.pause(), (this._isPlaying = !1), (this._canPlay = !1);
- }),
- (AudioElement.prototype.resume = function () {
- this._canPlay = !0;
- }),
- (AudioElement.prototype.setRate = function (e) {
- this.audio.rate(e);
- }),
- (AudioElement.prototype.volume = function (e) {
- (this._volumeMultiplier = e),
- (this._previousVolume = e * this._volume),
- this.audio.volume(this._previousVolume);
- }),
- (AudioElement.prototype.getBaseElement = function () {
- return null;
- }),
- (AudioElement.prototype.destroy = function () {}),
- (AudioElement.prototype.sourceRectAtTime = function () {}),
- (AudioElement.prototype.initExpressions = function () {});
- function BaseRenderer() {}
- (BaseRenderer.prototype.checkLayers = function (e) {
- var t,
- r = this.layers.length,
- i;
- for (this.completeLayers = !0, t = r - 1; t >= 0; t -= 1)
- this.elements[t] ||
- ((i = this.layers[t]),
- i.ip - i.st <= e - this.layers[t].st &&
- i.op - i.st > e - this.layers[t].st &&
- this.buildItem(t)),
- (this.completeLayers = this.elements[t] ? this.completeLayers : !1);
- this.checkPendingElements();
- }),
- (BaseRenderer.prototype.createItem = function (e) {
- switch (e.ty) {
- case 2:
- return this.createImage(e);
- case 0:
- return this.createComp(e);
- case 1:
- return this.createSolid(e);
- case 3:
- return this.createNull(e);
- case 4:
- return this.createShape(e);
- case 5:
- return this.createText(e);
- case 6:
- return this.createAudio(e);
- case 13:
- return this.createCamera(e);
- case 15:
- return this.createFootage(e);
- default:
- return this.createNull(e);
- }
- }),
- (BaseRenderer.prototype.createCamera = function () {
- throw new Error("You're using a 3d camera. Try the html renderer.");
- }),
- (BaseRenderer.prototype.createAudio = function (e) {
- return new AudioElement(e, this.globalData, this);
- }),
- (BaseRenderer.prototype.createFootage = function (e) {
- return new FootageElement(e, this.globalData, this);
- }),
- (BaseRenderer.prototype.buildAllItems = function () {
- var e,
- t = this.layers.length;
- for (e = 0; e < t; e += 1) this.buildItem(e);
- this.checkPendingElements();
- }),
- (BaseRenderer.prototype.includeLayers = function (e) {
- this.completeLayers = !1;
- var t,
- r = e.length,
- i,
- s = this.layers.length;
- for (t = 0; t < r; t += 1)
- for (i = 0; i < s; ) {
- if (this.layers[i].id === e[t].id) {
- this.layers[i] = e[t];
- break;
- }
- i += 1;
- }
- }),
- (BaseRenderer.prototype.setProjectInterface = function (e) {
- this.globalData.projectInterface = e;
- }),
- (BaseRenderer.prototype.initItems = function () {
- this.globalData.progressiveLoad || this.buildAllItems();
- }),
- (BaseRenderer.prototype.buildElementParenting = function (e, t, r) {
- for (
- var i = this.elements, s = this.layers, n = 0, a = s.length;
- n < a;
- )
- s[n].ind == t &&
- (!i[n] || i[n] === !0
- ? (this.buildItem(n), this.addPendingElement(e))
- : (r.push(i[n]),
- i[n].setAsParent(),
- s[n].parent !== void 0
- ? this.buildElementParenting(e, s[n].parent, r)
- : e.setHierarchy(r))),
- (n += 1);
- }),
- (BaseRenderer.prototype.addPendingElement = function (e) {
- this.pendingElements.push(e);
- }),
- (BaseRenderer.prototype.searchExtraCompositions = function (e) {
- var t,
- r = e.length;
- for (t = 0; t < r; t += 1)
- if (e[t].xt) {
- var i = this.createComp(e[t]);
- i.initExpressions(),
- this.globalData.projectInterface.registerComposition(i);
- }
- }),
- (BaseRenderer.prototype.getElementById = function (e) {
- var t,
- r = this.elements.length;
- for (t = 0; t < r; t += 1)
- if (this.elements[t].data.ind === e) return this.elements[t];
- return null;
- }),
- (BaseRenderer.prototype.getElementByPath = function (e) {
- var t = e.shift(),
- r;
- if (typeof t == 'number') r = this.elements[t];
- else {
- var i,
- s = this.elements.length;
- for (i = 0; i < s; i += 1)
- if (this.elements[i].data.nm === t) {
- r = this.elements[i];
- break;
- }
- }
- return e.length === 0 ? r : r.getElementByPath(e);
- }),
- (BaseRenderer.prototype.setupGlobalData = function (e, t) {
- (this.globalData.fontManager = new FontManager()),
- (this.globalData.slotManager = slotFactory(e)),
- this.globalData.fontManager.addChars(e.chars),
- this.globalData.fontManager.addFonts(e.fonts, t),
- (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 = e.fr),
- (this.globalData.nm = e.nm),
- (this.globalData.compSize = { w: e.w, h: e.h });
- });
- function TransformElement() {}
- TransformElement.prototype = {
- initTransform: function () {
- (this.finalTransform = {
- mProp: this.data.ks
- ? TransformPropertyFactory.getTransformProperty(
- this,
- this.data.ks,
- this
- )
- : { o: 0 },
- _matMdf: !1,
- _opMdf: !1,
- mat: new Matrix()
- }),
- this.data.ao && (this.finalTransform.mProp.autoOriented = !0),
- this.data.ty;
- },
- renderTransform: function () {
- if (
- ((this.finalTransform._opMdf =
- this.finalTransform.mProp.o._mdf || this._isFirstFrame),
- (this.finalTransform._matMdf =
- this.finalTransform.mProp._mdf || this._isFirstFrame),
- this.hierarchy)
- ) {
- var t,
- r = this.finalTransform.mat,
- i = 0,
- s = this.hierarchy.length;
- if (!this.finalTransform._matMdf)
- for (; i < s; ) {
- if (this.hierarchy[i].finalTransform.mProp._mdf) {
- this.finalTransform._matMdf = !0;
- break;
- }
- i += 1;
- }
- if (this.finalTransform._matMdf)
- for (
- t = this.finalTransform.mProp.v.props,
- r.cloneFromProps(t),
- i = 0;
- i < s;
- i += 1
- )
- (t = this.hierarchy[i].finalTransform.mProp.v.props),
- r.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]
- );
- }
- },
- globalToLocal: function (t) {
- var r = [];
- r.push(this.finalTransform);
- for (var i = !0, s = this.comp; i; )
- s.finalTransform
- ? (s.data.hasMask && r.splice(0, 0, s.finalTransform),
- (s = s.comp))
- : (i = !1);
- var n,
- a = r.length,
- o;
- for (n = 0; n < a; n += 1)
- (o = r[n].mat.applyToPointArray(0, 0, 0)),
- (t = [t[0] - o[0], t[1] - o[1], 0]);
- return t;
- },
- mHelper: new Matrix()
- };
- function MaskElement(e, t, r) {
- (this.data = e),
- (this.element = t),
- (this.globalData = r),
- (this.storedData = []),
- (this.masksProperties = this.data.masksProperties || []),
- (this.maskElement = null);
- var i = this.globalData.defs,
- s,
- n = this.masksProperties ? this.masksProperties.length : 0;
- (this.viewData = createSizedArray(n)), (this.solidPath = '');
- var a,
- o = this.masksProperties,
- l = 0,
- c = [],
- g,
- S,
- p = createElementID(),
- P,
- b,
- y,
- A,
- u = 'clipPath',
- f = 'clip-path';
- for (s = 0; s < n; s += 1)
- if (
- (((o[s].mode !== 'a' && o[s].mode !== 'n') ||
- o[s].inv ||
- o[s].o.k !== 100 ||
- o[s].o.x) &&
- ((u = 'mask'), (f = 'mask')),
- (o[s].mode === 's' || o[s].mode === 'i') && l === 0
- ? ((P = createNS('rect')),
- P.setAttribute('fill', '#ffffff'),
- P.setAttribute('width', this.element.comp.data.w || 0),
- P.setAttribute('height', this.element.comp.data.h || 0),
- c.push(P))
- : (P = null),
- (a = createNS('path')),
- o[s].mode === 'n')
- )
- (this.viewData[s] = {
- op: PropertyFactory.getProp(
- this.element,
- o[s].o,
- 0,
- 0.01,
- this.element
- ),
- prop: ShapePropertyFactory.getShapeProp(this.element, o[s], 3),
- elem: a,
- lastPath: ''
- }),
- i.appendChild(a);
- else {
- (l += 1),
- a.setAttribute('fill', o[s].mode === 's' ? '#000000' : '#ffffff'),
- a.setAttribute('clip-rule', 'nonzero');
- var m;
- if (
- (o[s].x.k !== 0
- ? ((u = 'mask'),
- (f = 'mask'),
- (A = PropertyFactory.getProp(
- this.element,
- o[s].x,
- 0,
- null,
- this.element
- )),
- (m = createElementID()),
- (b = createNS('filter')),
- b.setAttribute('id', m),
- (y = createNS('feMorphology')),
- y.setAttribute('operator', 'erode'),
- y.setAttribute('in', 'SourceGraphic'),
- y.setAttribute('radius', '0'),
- b.appendChild(y),
- i.appendChild(b),
- a.setAttribute(
- 'stroke',
- o[s].mode === 's' ? '#000000' : '#ffffff'
- ))
- : ((y = null), (A = null)),
- (this.storedData[s] = {
- elem: a,
- x: A,
- expan: y,
- lastPath: '',
- lastOperator: '',
- filterId: m,
- lastRadius: 0
- }),
- o[s].mode === 'i')
- ) {
- S = c.length;
- var d = createNS('g');
- for (g = 0; g < S; g += 1) d.appendChild(c[g]);
- var E = createNS('mask');
- E.setAttribute('mask-type', 'alpha'),
- E.setAttribute('id', p + '_' + l),
- E.appendChild(a),
- i.appendChild(E),
- d.setAttribute(
- 'mask',
- 'url(' + getLocationHref() + '#' + p + '_' + l + ')'
- ),
- (c.length = 0),
- c.push(d);
- } else c.push(a);
- o[s].inv &&
- !this.solidPath &&
- (this.solidPath = this.createLayerSolidPath()),
- (this.viewData[s] = {
- elem: a,
- lastPath: '',
- op: PropertyFactory.getProp(
- this.element,
- o[s].o,
- 0,
- 0.01,
- this.element
- ),
- prop: ShapePropertyFactory.getShapeProp(this.element, o[s], 3),
- invRect: P
- }),
- this.viewData[s].prop.k ||
- this.drawPath(o[s], this.viewData[s].prop.v, this.viewData[s]);
- }
- for (this.maskElement = createNS(u), n = c.length, s = 0; s < n; s += 1)
- this.maskElement.appendChild(c[s]);
- l > 0 &&
- (this.maskElement.setAttribute('id', p),
- this.element.maskedElement.setAttribute(
- f,
- 'url(' + getLocationHref() + '#' + p + ')'
- ),
- i.appendChild(this.maskElement)),
- this.viewData.length && this.element.addRenderableComponent(this);
- }
- (MaskElement.prototype.getMaskProperty = function (e) {
- return this.viewData[e].prop;
- }),
- (MaskElement.prototype.renderFrame = function (e) {
- var t = this.element.finalTransform.mat,
- r,
- i = this.masksProperties.length;
- for (r = 0; r < i; r += 1)
- if (
- ((this.viewData[r].prop._mdf || e) &&
- this.drawPath(
- this.masksProperties[r],
- this.viewData[r].prop.v,
- this.viewData[r]
- ),
- (this.viewData[r].op._mdf || e) &&
- this.viewData[r].elem.setAttribute(
- 'fill-opacity',
- this.viewData[r].op.v
- ),
- this.masksProperties[r].mode !== 'n' &&
- (this.viewData[r].invRect &&
- (this.element.finalTransform.mProp._mdf || e) &&
- this.viewData[r].invRect.setAttribute(
- 'transform',
- t.getInverseMatrix().to2dCSS()
- ),
- this.storedData[r].x && (this.storedData[r].x._mdf || e)))
- ) {
- var s = this.storedData[r].expan;
- this.storedData[r].x.v < 0
- ? (this.storedData[r].lastOperator !== 'erode' &&
- ((this.storedData[r].lastOperator = 'erode'),
- this.storedData[r].elem.setAttribute(
- 'filter',
- 'url(' +
- getLocationHref() +
- '#' +
- this.storedData[r].filterId +
- ')'
- )),
- s.setAttribute('radius', -this.storedData[r].x.v))
- : (this.storedData[r].lastOperator !== 'dilate' &&
- ((this.storedData[r].lastOperator = 'dilate'),
- this.storedData[r].elem.setAttribute('filter', null)),
- this.storedData[r].elem.setAttribute(
- 'stroke-width',
- this.storedData[r].x.v * 2
- ));
- }
- }),
- (MaskElement.prototype.getMaskelement = function () {
- return this.maskElement;
- }),
- (MaskElement.prototype.createLayerSolidPath = function () {
- var e = 'M0,0 ';
- return (
- (e += ' h' + this.globalData.compSize.w),
- (e += ' v' + this.globalData.compSize.h),
- (e += ' h-' + this.globalData.compSize.w),
- (e += ' v-' + this.globalData.compSize.h + ' '),
- e
- );
- }),
- (MaskElement.prototype.drawPath = function (e, t, r) {
- var i = ' M' + t.v[0][0] + ',' + t.v[0][1],
- s,
- n;
- for (n = t._length, s = 1; s < n; s += 1)
- i +=
- ' C' +
- t.o[s - 1][0] +
- ',' +
- t.o[s - 1][1] +
- ' ' +
- t.i[s][0] +
- ',' +
- t.i[s][1] +
- ' ' +
- t.v[s][0] +
- ',' +
- t.v[s][1];
- if (
- (t.c &&
- n > 1 &&
- (i +=
- ' C' +
- t.o[s - 1][0] +
- ',' +
- t.o[s - 1][1] +
- ' ' +
- t.i[0][0] +
- ',' +
- t.i[0][1] +
- ' ' +
- t.v[0][0] +
- ',' +
- t.v[0][1]),
- r.lastPath !== i)
- ) {
- var a = '';
- r.elem &&
- (t.c && (a = e.inv ? this.solidPath + i : i),
- r.elem.setAttribute('d', a)),
- (r.lastPath = i);
- }
- }),
- (MaskElement.prototype.destroy = function () {
- (this.element = null),
- (this.globalData = null),
- (this.maskElement = null),
- (this.data = null),
- (this.masksProperties = null);
- });
- var filtersFactory = (function () {
- var e = {};
- (e.createFilter = t), (e.createAlphaToLuminanceFilter = r);
- function t(i, s) {
- var n = createNS('filter');
- return (
- n.setAttribute('id', i),
- s !== !0 &&
- (n.setAttribute('filterUnits', 'objectBoundingBox'),
- n.setAttribute('x', '0%'),
- n.setAttribute('y', '0%'),
- n.setAttribute('width', '100%'),
- n.setAttribute('height', '100%')),
- n
- );
- }
- function r() {
- var i = createNS('feColorMatrix');
- return (
- i.setAttribute('type', 'matrix'),
- i.setAttribute('color-interpolation-filters', 'sRGB'),
- i.setAttribute(
- 'values',
- '0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1'
- ),
- i
- );
- }
- return e;
- })(),
- featureSupport = (function () {
- var e = {
- maskType: !0,
- svgLumaHidden: !0,
- offscreenCanvas: typeof OffscreenCanvas < 'u'
- };
- 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)) &&
- (e.maskType = !1),
- /firefox/i.test(navigator.userAgent) && (e.svgLumaHidden = !1),
- e
- );
- })(),
- registeredEffects = {},
- idPrefix = 'filter_result_';
- function SVGEffects(e) {
- var t,
- r = 'SourceGraphic',
- i = e.data.ef ? e.data.ef.length : 0,
- s = createElementID(),
- n = filtersFactory.createFilter(s, !0),
- a = 0;
- this.filters = [];
- var o;
- for (t = 0; t < i; t += 1) {
- o = null;
- var l = e.data.ef[t].ty;
- if (registeredEffects[l]) {
- var c = registeredEffects[l].effect;
- (o = new c(
- n,
- e.effectsManager.effectElements[t],
- e,
- idPrefix + a,
- r
- )),
- (r = idPrefix + a),
- registeredEffects[l].countsAsEffect && (a += 1);
- }
- o && this.filters.push(o);
- }
- a &&
- (e.globalData.defs.appendChild(n),
- e.layerElement.setAttribute(
- 'filter',
- 'url(' + getLocationHref() + '#' + s + ')'
- )),
- this.filters.length && e.addRenderableComponent(this);
- }
- SVGEffects.prototype.renderFrame = function (e) {
- var t,
- r = this.filters.length;
- for (t = 0; t < r; t += 1) this.filters[t].renderFrame(e);
- };
- function registerEffect(e, t, r) {
- registeredEffects[e] = { effect: t, countsAsEffect: r };
- }
- function SVGBaseElement() {}
- SVGBaseElement.prototype = {
- initRendererElement: function () {
- this.layerElement = createNS('g');
- },
- createContainerElements: function () {
- (this.matteElement = createNS('g')),
- (this.transformedElement = this.layerElement),
- (this.maskedElement = this.layerElement),
- (this._sizeChanged = !1);
- var t = null;
- if (this.data.td) {
- this.matteMasks = {};
- var r = createNS('g');
- r.setAttribute('id', this.layerId),
- r.appendChild(this.layerElement),
- (t = r),
- this.globalData.defs.appendChild(r);
- } else
- this.data.tt
- ? (this.matteElement.appendChild(this.layerElement),
- (t = this.matteElement),
- (this.baseElement = this.matteElement))
- : (this.baseElement = this.layerElement);
- if (
- (this.data.ln && this.layerElement.setAttribute('id', this.data.ln),
- this.data.cl &&
- this.layerElement.setAttribute('class', this.data.cl),
- this.data.ty === 0 && !this.data.hd)
- ) {
- var i = createNS('clipPath'),
- s = createNS('path');
- s.setAttribute(
- 'd',
- 'M0,0 L' +
- this.data.w +
- ',0 L' +
- this.data.w +
- ',' +
- this.data.h +
- ' L0,' +
- this.data.h +
- 'z'
- );
- var n = createElementID();
- if (
- (i.setAttribute('id', n),
- i.appendChild(s),
- this.globalData.defs.appendChild(i),
- this.checkMasks())
- ) {
- var a = createNS('g');
- a.setAttribute(
- 'clip-path',
- 'url(' + getLocationHref() + '#' + n + ')'
- ),
- a.appendChild(this.layerElement),
- (this.transformedElement = a),
- t
- ? t.appendChild(this.transformedElement)
- : (this.baseElement = this.transformedElement);
- } else
- this.layerElement.setAttribute(
- 'clip-path',
- 'url(' + getLocationHref() + '#' + n + ')'
- );
- }
- this.data.bm !== 0 && this.setBlendMode();
- },
- renderElement: function () {
- this.finalTransform._matMdf &&
- this.transformedElement.setAttribute(
- 'transform',
- this.finalTransform.mat.to2dCSS()
- ),
- this.finalTransform._opMdf &&
- this.transformedElement.setAttribute(
- 'opacity',
- this.finalTransform.mProp.o.v
- );
- },
- destroyBaseElement: function () {
- (this.layerElement = null),
- (this.matteElement = null),
- this.maskManager.destroy();
- },
- getBaseElement: function () {
- return this.data.hd ? null : this.baseElement;
- },
- createRenderableComponents: function () {
- (this.maskManager = new MaskElement(
- this.data,
- this,
- this.globalData
- )),
- (this.renderableEffectsManager = new SVGEffects(this));
- },
- getMatte: function (t) {
- if (
- (this.matteMasks || (this.matteMasks = {}), !this.matteMasks[t])
- ) {
- var r = this.layerId + '_' + t,
- i,
- s,
- n,
- a;
- if (t === 1 || t === 3) {
- var o = createNS('mask');
- o.setAttribute('id', r),
- o.setAttribute('mask-type', t === 3 ? 'luminance' : 'alpha'),
- (n = createNS('use')),
- n.setAttributeNS(
- 'http://www.w3.org/1999/xlink',
- 'href',
- '#' + this.layerId
- ),
- o.appendChild(n),
- this.globalData.defs.appendChild(o),
- !featureSupport.maskType &&
- t === 1 &&
- (o.setAttribute('mask-type', 'luminance'),
- (i = createElementID()),
- (s = filtersFactory.createFilter(i)),
- this.globalData.defs.appendChild(s),
- s.appendChild(filtersFactory.createAlphaToLuminanceFilter()),
- (a = createNS('g')),
- a.appendChild(n),
- o.appendChild(a),
- a.setAttribute(
- 'filter',
- 'url(' + getLocationHref() + '#' + i + ')'
- ));
- } else if (t === 2) {
- var l = createNS('mask');
- l.setAttribute('id', r), l.setAttribute('mask-type', 'alpha');
- var c = createNS('g');
- l.appendChild(c),
- (i = createElementID()),
- (s = filtersFactory.createFilter(i));
- var g = createNS('feComponentTransfer');
- g.setAttribute('in', 'SourceGraphic'), s.appendChild(g);
- var S = createNS('feFuncA');
- S.setAttribute('type', 'table'),
- S.setAttribute('tableValues', '1.0 0.0'),
- g.appendChild(S),
- this.globalData.defs.appendChild(s);
- var p = createNS('rect');
- p.setAttribute('width', this.comp.data.w),
- p.setAttribute('height', this.comp.data.h),
- p.setAttribute('x', '0'),
- p.setAttribute('y', '0'),
- p.setAttribute('fill', '#ffffff'),
- p.setAttribute('opacity', '0'),
- c.setAttribute(
- 'filter',
- 'url(' + getLocationHref() + '#' + i + ')'
- ),
- c.appendChild(p),
- (n = createNS('use')),
- n.setAttributeNS(
- 'http://www.w3.org/1999/xlink',
- 'href',
- '#' + this.layerId
- ),
- c.appendChild(n),
- featureSupport.maskType ||
- (l.setAttribute('mask-type', 'luminance'),
- s.appendChild(filtersFactory.createAlphaToLuminanceFilter()),
- (a = createNS('g')),
- c.appendChild(p),
- a.appendChild(this.layerElement),
- c.appendChild(a)),
- this.globalData.defs.appendChild(l);
- }
- this.matteMasks[t] = r;
- }
- return this.matteMasks[t];
- },
- setMatte: function (t) {
- this.matteElement &&
- this.matteElement.setAttribute(
- 'mask',
- 'url(' + getLocationHref() + '#' + t + ')'
- );
- }
- };
- function HierarchyElement() {}
- HierarchyElement.prototype = {
- initHierarchy: function () {
- (this.hierarchy = []), (this._isParent = !1), this.checkParenting();
- },
- setHierarchy: function (t) {
- this.hierarchy = t;
- },
- setAsParent: function () {
- this._isParent = !0;
- },
- checkParenting: function () {
- this.data.parent !== void 0 &&
- this.comp.buildElementParenting(this, this.data.parent, []);
- }
- };
- function RenderableDOMElement() {}
- (function () {
- var e = {
- initElement: function (r, i, s) {
- this.initFrame(),
- this.initBaseData(r, i, s),
- this.initTransform(r, i, s),
- this.initHierarchy(),
- this.initRenderable(),
- this.initRendererElement(),
- this.createContainerElements(),
- this.createRenderableComponents(),
- this.createContent(),
- this.hide();
- },
- hide: function () {
- if (!this.hidden && (!this.isInRange || this.isTransparent)) {
- var r = this.baseElement || this.layerElement;
- (r.style.display = 'none'), (this.hidden = !0);
- }
- },
- show: function () {
- if (this.isInRange && !this.isTransparent) {
- if (!this.data.hd) {
- var r = this.baseElement || this.layerElement;
- r.style.display = 'block';
- }
- (this.hidden = !1), (this._isFirstFrame = !0);
- }
- },
- renderFrame: function () {
- this.data.hd ||
- this.hidden ||
- (this.renderTransform(),
- this.renderRenderable(),
- this.renderElement(),
- this.renderInnerContent(),
- this._isFirstFrame && (this._isFirstFrame = !1));
- },
- renderInnerContent: function () {},
- prepareFrame: function (r) {
- (this._mdf = !1),
- this.prepareRenderableFrame(r),
- this.prepareProperties(r, this.isInRange),
- this.checkTransparency();
- },
- destroy: function () {
- (this.innerElem = null), this.destroyBaseElement();
- }
- };
- extendPrototype(
- [RenderableElement, createProxyFunction(e)],
- RenderableDOMElement
- );
- })();
- function IImageElement(e, t, r) {
- (this.assetData = t.getAssetData(e.refId)),
- this.assetData &&
- this.assetData.sid &&
- (this.assetData = t.slotManager.getProp(this.assetData)),
- this.initElement(e, t, r),
- (this.sourceRect = {
- top: 0,
- left: 0,
- width: this.assetData.w,
- height: this.assetData.h
- });
- }
- extendPrototype(
- [
- BaseElement,
- TransformElement,
- SVGBaseElement,
- HierarchyElement,
- FrameElement,
- RenderableDOMElement
- ],
- IImageElement
- ),
- (IImageElement.prototype.createContent = function () {
- var e = this.globalData.getAssetsPath(this.assetData);
- (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',
- e
- ),
- this.layerElement.appendChild(this.innerElem);
- }),
- (IImageElement.prototype.sourceRectAtTime = function () {
- return this.sourceRect;
- });
- function ProcessedElement(e, t) {
- (this.elem = e), (this.pos = t);
- }
- function IShapeElement() {}
- IShapeElement.prototype = {
- addShapeToModifiers: function (t) {
- var r,
- i = this.shapeModifiers.length;
- for (r = 0; r < i; r += 1) this.shapeModifiers[r].addShape(t);
- },
- isShapeInAnimatedModifiers: function (t) {
- for (var r = 0, i = this.shapeModifiers.length; r < i; )
- if (this.shapeModifiers[r].isAnimatedWithShape(t)) return !0;
- return !1;
- },
- renderModifiers: function () {
- if (this.shapeModifiers.length) {
- var t,
- r = this.shapes.length;
- for (t = 0; t < r; t += 1) this.shapes[t].sh.reset();
- r = this.shapeModifiers.length;
- var i;
- for (
- t = r - 1;
- t >= 0 &&
- ((i = this.shapeModifiers[t].processShapes(this._isFirstFrame)),
- !i);
- t -= 1
- );
- }
- },
- searchProcessedElement: function (t) {
- for (var r = this.processedElements, i = 0, s = r.length; i < s; ) {
- if (r[i].elem === t) return r[i].pos;
- i += 1;
- }
- return 0;
- },
- addProcessedElement: function (t, r) {
- for (var i = this.processedElements, s = i.length; s; )
- if (((s -= 1), i[s].elem === t)) {
- i[s].pos = r;
- return;
- }
- i.push(new ProcessedElement(t, r));
- },
- prepareFrame: function (t) {
- this.prepareRenderableFrame(t),
- this.prepareProperties(t, this.isInRange);
- }
- };
- var lineCapEnum = { 1: 'butt', 2: 'round', 3: 'square' },
- lineJoinEnum = { 1: 'miter', 2: 'round', 3: 'bevel' };
- function SVGShapeData(e, t, r) {
- (this.caches = []),
- (this.styles = []),
- (this.transformers = e),
- (this.lStr = ''),
- (this.sh = r),
- (this.lvl = t),
- (this._isAnimated = !!r.k);
- for (var i = 0, s = e.length; i < s; ) {
- if (e[i].mProps.dynamicProperties.length) {
- this._isAnimated = !0;
- break;
- }
- i += 1;
- }
- }
- SVGShapeData.prototype.setAsAnimated = function () {
- this._isAnimated = !0;
- };
- function SVGStyleData(e, t) {
- (this.data = e),
- (this.type = e.ty),
- (this.d = ''),
- (this.lvl = t),
- (this._mdf = !1),
- (this.closed = e.hd === !0),
- (this.pElem = createNS('path')),
- (this.msElem = null);
- }
- SVGStyleData.prototype.reset = function () {
- (this.d = ''), (this._mdf = !1);
- };
- function DashProperty(e, t, r, i) {
- (this.elem = e),
- (this.frameId = -1),
- (this.dataProps = createSizedArray(t.length)),
- (this.renderer = r),
- (this.k = !1),
- (this.dashStr = ''),
- (this.dashArray = createTypedArray(
- 'float32',
- t.length ? t.length - 1 : 0
- )),
- (this.dashoffset = createTypedArray('float32', 1)),
- this.initDynamicPropertyContainer(i);
- var s,
- n = t.length || 0,
- a;
- for (s = 0; s < n; s += 1)
- (a = PropertyFactory.getProp(e, t[s].v, 0, 0, this)),
- (this.k = a.k || this.k),
- (this.dataProps[s] = { n: t[s].n, p: a });
- this.k || this.getValue(!0), (this._isAnimated = this.k);
- }
- (DashProperty.prototype.getValue = function (e) {
- if (
- !(this.elem.globalData.frameId === this.frameId && !e) &&
- ((this.frameId = this.elem.globalData.frameId),
- this.iterateDynamicProperties(),
- (this._mdf = this._mdf || e),
- this._mdf)
- ) {
- var t = 0,
- r = this.dataProps.length;
- for (
- this.renderer === 'svg' && (this.dashStr = ''), t = 0;
- t < r;
- t += 1
- )
- this.dataProps[t].n !== 'o'
- ? this.renderer === 'svg'
- ? (this.dashStr += ' ' + this.dataProps[t].p.v)
- : (this.dashArray[t] = this.dataProps[t].p.v)
- : (this.dashoffset[0] = this.dataProps[t].p.v);
- }
- }),
- extendPrototype([DynamicPropertyContainer], DashProperty);
- function SVGStrokeStyleData(e, t, r) {
- this.initDynamicPropertyContainer(e),
- (this.getValue = this.iterateDynamicProperties),
- (this.o = PropertyFactory.getProp(e, t.o, 0, 0.01, this)),
- (this.w = PropertyFactory.getProp(e, t.w, 0, null, this)),
- (this.d = new DashProperty(e, t.d || {}, 'svg', this)),
- (this.c = PropertyFactory.getProp(e, t.c, 1, 255, this)),
- (this.style = r),
- (this._isAnimated = !!this._isAnimated);
- }
- extendPrototype([DynamicPropertyContainer], SVGStrokeStyleData);
- function SVGFillStyleData(e, t, r) {
- this.initDynamicPropertyContainer(e),
- (this.getValue = this.iterateDynamicProperties),
- (this.o = PropertyFactory.getProp(e, t.o, 0, 0.01, this)),
- (this.c = PropertyFactory.getProp(e, t.c, 1, 255, this)),
- (this.style = r);
- }
- extendPrototype([DynamicPropertyContainer], SVGFillStyleData);
- function SVGNoStyleData(e, t, r) {
- this.initDynamicPropertyContainer(e),
- (this.getValue = this.iterateDynamicProperties),
- (this.style = r);
- }
- extendPrototype([DynamicPropertyContainer], SVGNoStyleData);
- function GradientProperty(e, t, r) {
- (this.data = t), (this.c = createTypedArray('uint8c', t.p * 4));
- var i = t.k.k[0].s
- ? t.k.k[0].s.length - t.p * 4
- : t.k.k.length - t.p * 4;
- (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(e, t.k, 1, null, this)),
- (this.k = this.prop.k),
- this.getValue(!0);
- }
- (GradientProperty.prototype.comparePoints = function (e, t) {
- for (var r = 0, i = this.o.length / 2, s; r < i; ) {
- if (((s = Math.abs(e[r * 4] - e[t * 4 + r * 2])), s > 0.01))
- return !1;
- r += 1;
- }
- return !0;
- }),
- (GradientProperty.prototype.checkCollapsable = function () {
- if (this.o.length / 2 !== this.c.length / 4) return !1;
- if (this.data.k.k[0].s)
- for (var e = 0, t = this.data.k.k.length; e < t; ) {
- if (!this.comparePoints(this.data.k.k[e].s, this.data.p))
- return !1;
- e += 1;
- }
- else if (!this.comparePoints(this.data.k.k, this.data.p)) return !1;
- return !0;
- }),
- (GradientProperty.prototype.getValue = function (e) {
- if (
- (this.prop.getValue(),
- (this._mdf = !1),
- (this._cmdf = !1),
- (this._omdf = !1),
- this.prop._mdf || e)
- ) {
- var t,
- r = this.data.p * 4,
- i,
- s;
- for (t = 0; t < r; t += 1)
- (i = t % 4 === 0 ? 100 : 255),
- (s = Math.round(this.prop.v[t] * i)),
- this.c[t] !== s && ((this.c[t] = s), (this._cmdf = !e));
- if (this.o.length)
- for (r = this.prop.v.length, t = this.data.p * 4; t < r; t += 1)
- (i = t % 2 === 0 ? 100 : 1),
- (s =
- t % 2 === 0
- ? Math.round(this.prop.v[t] * 100)
- : this.prop.v[t]),
- this.o[t - this.data.p * 4] !== s &&
- ((this.o[t - this.data.p * 4] = s), (this._omdf = !e));
- this._mdf = !e;
- }
- }),
- extendPrototype([DynamicPropertyContainer], GradientProperty);
- function SVGGradientFillStyleData(e, t, r) {
- this.initDynamicPropertyContainer(e),
- (this.getValue = this.iterateDynamicProperties),
- this.initGradientData(e, t, r);
- }
- (SVGGradientFillStyleData.prototype.initGradientData = function (
- e,
- t,
- r
- ) {
- (this.o = PropertyFactory.getProp(e, t.o, 0, 0.01, this)),
- (this.s = PropertyFactory.getProp(e, t.s, 1, null, this)),
- (this.e = PropertyFactory.getProp(e, t.e, 1, null, this)),
- (this.h = PropertyFactory.getProp(e, t.h || { k: 0 }, 0, 0.01, this)),
- (this.a = PropertyFactory.getProp(
- e,
- t.a || { k: 0 },
- 0,
- degToRads,
- this
- )),
- (this.g = new GradientProperty(e, t.g, this)),
- (this.style = r),
- (this.stops = []),
- this.setGradientData(r.pElem, t),
- this.setGradientOpacity(t, r),
- (this._isAnimated = !!this._isAnimated);
- }),
- (SVGGradientFillStyleData.prototype.setGradientData = function (e, t) {
- var r = createElementID(),
- i = createNS(t.t === 1 ? 'linearGradient' : 'radialGradient');
- i.setAttribute('id', r),
- i.setAttribute('spreadMethod', 'pad'),
- i.setAttribute('gradientUnits', 'userSpaceOnUse');
- var s = [],
- n,
- a,
- o;
- for (o = t.g.p * 4, a = 0; a < o; a += 4)
- (n = createNS('stop')), i.appendChild(n), s.push(n);
- e.setAttribute(
- t.ty === 'gf' ? 'fill' : 'stroke',
- 'url(' + getLocationHref() + '#' + r + ')'
- ),
- (this.gf = i),
- (this.cst = s);
- }),
- (SVGGradientFillStyleData.prototype.setGradientOpacity = function (
- e,
- t
- ) {
- if (this.g._hasOpacity && !this.g._collapsable) {
- var r,
- i,
- s,
- n = createNS('mask'),
- a = createNS('path');
- n.appendChild(a);
- var o = createElementID(),
- l = createElementID();
- n.setAttribute('id', l);
- var c = createNS(e.t === 1 ? 'linearGradient' : 'radialGradient');
- c.setAttribute('id', o),
- c.setAttribute('spreadMethod', 'pad'),
- c.setAttribute('gradientUnits', 'userSpaceOnUse'),
- (s = e.g.k.k[0].s ? e.g.k.k[0].s.length : e.g.k.k.length);
- var g = this.stops;
- for (i = e.g.p * 4; i < s; i += 2)
- (r = createNS('stop')),
- r.setAttribute('stop-color', 'rgb(255,255,255)'),
- c.appendChild(r),
- g.push(r);
- a.setAttribute(
- e.ty === 'gf' ? 'fill' : 'stroke',
- 'url(' + getLocationHref() + '#' + o + ')'
- ),
- e.ty === 'gs' &&
- (a.setAttribute('stroke-linecap', lineCapEnum[e.lc || 2]),
- a.setAttribute('stroke-linejoin', lineJoinEnum[e.lj || 2]),
- e.lj === 1 && a.setAttribute('stroke-miterlimit', e.ml)),
- (this.of = c),
- (this.ms = n),
- (this.ost = g),
- (this.maskId = l),
- (t.msElem = a);
- }
- }),
- extendPrototype([DynamicPropertyContainer], SVGGradientFillStyleData);
- function SVGGradientStrokeStyleData(e, t, r) {
- this.initDynamicPropertyContainer(e),
- (this.getValue = this.iterateDynamicProperties),
- (this.w = PropertyFactory.getProp(e, t.w, 0, null, this)),
- (this.d = new DashProperty(e, t.d || {}, 'svg', this)),
- this.initGradientData(e, t, r),
- (this._isAnimated = !!this._isAnimated);
- }
- extendPrototype(
- [SVGGradientFillStyleData, DynamicPropertyContainer],
- SVGGradientStrokeStyleData
- );
- function ShapeGroupData() {
- (this.it = []), (this.prevViewData = []), (this.gr = createNS('g'));
- }
- function SVGTransformData(e, t, r) {
- (this.transform = { mProps: e, op: t, container: r }),
- (this.elements = []),
- (this._isAnimated =
- this.transform.mProps.dynamicProperties.length ||
- this.transform.op.effectsSequence.length);
- }
- var buildShapeString = function (t, r, i, s) {
- if (r === 0) return '';
- var n = t.o,
- a = t.i,
- o = t.v,
- l,
- c = ' M' + s.applyToPointStringified(o[0][0], o[0][1]);
- for (l = 1; l < r; l += 1)
- c +=
- ' C' +
- s.applyToPointStringified(n[l - 1][0], n[l - 1][1]) +
- ' ' +
- s.applyToPointStringified(a[l][0], a[l][1]) +
- ' ' +
- s.applyToPointStringified(o[l][0], o[l][1]);
- return (
- i &&
- r &&
- ((c +=
- ' C' +
- s.applyToPointStringified(n[l - 1][0], n[l - 1][1]) +
- ' ' +
- s.applyToPointStringified(a[0][0], a[0][1]) +
- ' ' +
- s.applyToPointStringified(o[0][0], o[0][1])),
- (c += 'z')),
- c
- );
- },
- SVGElementsRenderer = (function () {
- var e = new Matrix(),
- t = new Matrix(),
- r = { createRenderFunction: i };
- function i(S) {
- switch (S.ty) {
- case 'fl':
- return o;
- case 'gf':
- return c;
- case 'gs':
- return l;
- case 'st':
- return g;
- case 'sh':
- case 'el':
- case 'rc':
- case 'sr':
- return a;
- case 'tr':
- return s;
- case 'no':
- return n;
- default:
- return null;
- }
- }
- function s(S, p, P) {
- (P || p.transform.op._mdf) &&
- p.transform.container.setAttribute('opacity', p.transform.op.v),
- (P || p.transform.mProps._mdf) &&
- p.transform.container.setAttribute(
- 'transform',
- p.transform.mProps.v.to2dCSS()
- );
- }
- function n() {}
- function a(S, p, P) {
- var b,
- y,
- A,
- u,
- f,
- m,
- d = p.styles.length,
- E = p.lvl,
- T,
- x,
- _,
- I,
- V;
- for (m = 0; m < d; m += 1) {
- if (((u = p.sh._mdf || P), p.styles[m].lvl < E)) {
- for (
- x = t.reset(),
- I = E - p.styles[m].lvl,
- V = p.transformers.length - 1;
- !u && I > 0;
- )
- (u = p.transformers[V].mProps._mdf || u), (I -= 1), (V -= 1);
- if (u)
- for (
- I = E - p.styles[m].lvl, V = p.transformers.length - 1;
- I > 0;
- )
- (_ = p.transformers[V].mProps.v.props),
- x.transform(
- _[0],
- _[1],
- _[2],
- _[3],
- _[4],
- _[5],
- _[6],
- _[7],
- _[8],
- _[9],
- _[10],
- _[11],
- _[12],
- _[13],
- _[14],
- _[15]
- ),
- (I -= 1),
- (V -= 1);
- } else x = e;
- if (((T = p.sh.paths), (y = T._length), u)) {
- for (A = '', b = 0; b < y; b += 1)
- (f = T.shapes[b]),
- f &&
- f._length &&
- (A += buildShapeString(f, f._length, f.c, x));
- p.caches[m] = A;
- } else A = p.caches[m];
- (p.styles[m].d += S.hd === !0 ? '' : A),
- (p.styles[m]._mdf = u || p.styles[m]._mdf);
- }
- }
- function o(S, p, P) {
- var b = p.style;
- (p.c._mdf || P) &&
- b.pElem.setAttribute(
- 'fill',
- 'rgb(' +
- bmFloor(p.c.v[0]) +
- ',' +
- bmFloor(p.c.v[1]) +
- ',' +
- bmFloor(p.c.v[2]) +
- ')'
- ),
- (p.o._mdf || P) && b.pElem.setAttribute('fill-opacity', p.o.v);
- }
- function l(S, p, P) {
- c(S, p, P), g(S, p, P);
- }
- function c(S, p, P) {
- var b = p.gf,
- y = p.g._hasOpacity,
- A = p.s.v,
- u = p.e.v;
- if (p.o._mdf || P) {
- var f = S.ty === 'gf' ? 'fill-opacity' : 'stroke-opacity';
- p.style.pElem.setAttribute(f, p.o.v);
- }
- if (p.s._mdf || P) {
- var m = S.t === 1 ? 'x1' : 'cx',
- d = m === 'x1' ? 'y1' : 'cy';
- b.setAttribute(m, A[0]),
- b.setAttribute(d, A[1]),
- y &&
- !p.g._collapsable &&
- (p.of.setAttribute(m, A[0]), p.of.setAttribute(d, A[1]));
- }
- var E, T, x, _;
- if (p.g._cmdf || P) {
- E = p.cst;
- var I = p.g.c;
- for (x = E.length, T = 0; T < x; T += 1)
- (_ = E[T]),
- _.setAttribute('offset', I[T * 4] + '%'),
- _.setAttribute(
- 'stop-color',
- 'rgb(' +
- I[T * 4 + 1] +
- ',' +
- I[T * 4 + 2] +
- ',' +
- I[T * 4 + 3] +
- ')'
- );
- }
- if (y && (p.g._omdf || P)) {
- var V = p.g.o;
- for (
- p.g._collapsable ? (E = p.cst) : (E = p.ost),
- x = E.length,
- T = 0;
- T < x;
- T += 1
- )
- (_ = E[T]),
- p.g._collapsable || _.setAttribute('offset', V[T * 2] + '%'),
- _.setAttribute('stop-opacity', V[T * 2 + 1]);
- }
- if (S.t === 1)
- (p.e._mdf || P) &&
- (b.setAttribute('x2', u[0]),
- b.setAttribute('y2', u[1]),
- y &&
- !p.g._collapsable &&
- (p.of.setAttribute('x2', u[0]),
- p.of.setAttribute('y2', u[1])));
- else {
- var D;
- if (
- ((p.s._mdf || p.e._mdf || P) &&
- ((D = Math.sqrt(
- Math.pow(A[0] - u[0], 2) + Math.pow(A[1] - u[1], 2)
- )),
- b.setAttribute('r', D),
- y && !p.g._collapsable && p.of.setAttribute('r', D)),
- p.e._mdf || p.h._mdf || p.a._mdf || P)
- ) {
- D ||
- (D = Math.sqrt(
- Math.pow(A[0] - u[0], 2) + Math.pow(A[1] - u[1], 2)
- ));
- var N = Math.atan2(u[1] - A[1], u[0] - A[0]),
- $ = p.h.v;
- $ >= 1 ? ($ = 0.99) : $ <= -1 && ($ = -0.99);
- var O = D * $,
- B = Math.cos(N + p.a.v) * O + A[0],
- F = Math.sin(N + p.a.v) * O + A[1];
- b.setAttribute('fx', B),
- b.setAttribute('fy', F),
- y &&
- !p.g._collapsable &&
- (p.of.setAttribute('fx', B), p.of.setAttribute('fy', F));
- }
- }
- }
- function g(S, p, P) {
- var b = p.style,
- y = p.d;
- y &&
- (y._mdf || P) &&
- y.dashStr &&
- (b.pElem.setAttribute('stroke-dasharray', y.dashStr),
- b.pElem.setAttribute('stroke-dashoffset', y.dashoffset[0])),
- p.c &&
- (p.c._mdf || P) &&
- b.pElem.setAttribute(
- 'stroke',
- 'rgb(' +
- bmFloor(p.c.v[0]) +
- ',' +
- bmFloor(p.c.v[1]) +
- ',' +
- bmFloor(p.c.v[2]) +
- ')'
- ),
- (p.o._mdf || P) && b.pElem.setAttribute('stroke-opacity', p.o.v),
- (p.w._mdf || P) &&
- (b.pElem.setAttribute('stroke-width', p.w.v),
- b.msElem && b.msElem.setAttribute('stroke-width', p.w.v));
- }
- return r;
- })();
- function SVGShapeElement(e, t, r) {
- (this.shapes = []),
- (this.shapesData = e.shapes),
- (this.stylesList = []),
- (this.shapeModifiers = []),
- (this.itemsData = []),
- (this.processedElements = []),
- (this.animatedContents = []),
- this.initElement(e, t, r),
- (this.prevViewData = []);
- }
- extendPrototype(
- [
- BaseElement,
- TransformElement,
- SVGBaseElement,
- IShapeElement,
- HierarchyElement,
- FrameElement,
- RenderableDOMElement
- ],
- SVGShapeElement
- ),
- (SVGShapeElement.prototype.initSecondaryElement = function () {}),
- (SVGShapeElement.prototype.identityMatrix = new Matrix()),
- (SVGShapeElement.prototype.buildExpressionInterface = function () {}),
- (SVGShapeElement.prototype.createContent = function () {
- this.searchShapes(
- this.shapesData,
- this.itemsData,
- this.prevViewData,
- this.layerElement,
- 0,
- [],
- !0
- ),
- this.filterUniqueShapes();
- }),
- (SVGShapeElement.prototype.filterUniqueShapes = function () {
- var e,
- t = this.shapes.length,
- r,
- i,
- s = this.stylesList.length,
- n,
- a = [],
- o = !1;
- for (i = 0; i < s; i += 1) {
- for (
- n = this.stylesList[i], o = !1, a.length = 0, e = 0;
- e < t;
- e += 1
- )
- (r = this.shapes[e]),
- r.styles.indexOf(n) !== -1 &&
- (a.push(r), (o = r._isAnimated || o));
- a.length > 1 && o && this.setShapesAsAnimated(a);
- }
- }),
- (SVGShapeElement.prototype.setShapesAsAnimated = function (e) {
- var t,
- r = e.length;
- for (t = 0; t < r; t += 1) e[t].setAsAnimated();
- }),
- (SVGShapeElement.prototype.createStyleElement = function (e, t) {
- var r,
- i = new SVGStyleData(e, t),
- s = i.pElem;
- if (e.ty === 'st') r = new SVGStrokeStyleData(this, e, i);
- else if (e.ty === 'fl') r = new SVGFillStyleData(this, e, i);
- else if (e.ty === 'gf' || e.ty === 'gs') {
- var n =
- e.ty === 'gf'
- ? SVGGradientFillStyleData
- : SVGGradientStrokeStyleData;
- (r = new n(this, e, 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 + ')'
- ));
- } else e.ty === 'no' && (r = new SVGNoStyleData(this, e, i));
- return (
- (e.ty === 'st' || e.ty === 'gs') &&
- (s.setAttribute('stroke-linecap', lineCapEnum[e.lc || 2]),
- s.setAttribute('stroke-linejoin', lineJoinEnum[e.lj || 2]),
- s.setAttribute('fill-opacity', '0'),
- e.lj === 1 && s.setAttribute('stroke-miterlimit', e.ml)),
- e.r === 2 && s.setAttribute('fill-rule', 'evenodd'),
- e.ln && s.setAttribute('id', e.ln),
- e.cl && s.setAttribute('class', e.cl),
- e.bm && (s.style['mix-blend-mode'] = getBlendMode(e.bm)),
- this.stylesList.push(i),
- this.addToAnimatedContents(e, r),
- r
- );
- }),
- (SVGShapeElement.prototype.createGroupElement = function (e) {
- var t = new ShapeGroupData();
- return (
- e.ln && t.gr.setAttribute('id', e.ln),
- e.cl && t.gr.setAttribute('class', e.cl),
- e.bm && (t.gr.style['mix-blend-mode'] = getBlendMode(e.bm)),
- t
- );
- }),
- (SVGShapeElement.prototype.createTransformElement = function (e, t) {
- var r = TransformPropertyFactory.getTransformProperty(this, e, this),
- i = new SVGTransformData(r, r.o, t);
- return this.addToAnimatedContents(e, i), i;
- }),
- (SVGShapeElement.prototype.createShapeElement = function (e, t, r) {
- var i = 4;
- e.ty === 'rc'
- ? (i = 5)
- : e.ty === 'el'
- ? (i = 6)
- : e.ty === 'sr' && (i = 7);
- var s = ShapePropertyFactory.getShapeProp(this, e, i, this),
- n = new SVGShapeData(t, r, s);
- return (
- this.shapes.push(n),
- this.addShapeToModifiers(n),
- this.addToAnimatedContents(e, n),
- n
- );
- }),
- (SVGShapeElement.prototype.addToAnimatedContents = function (e, t) {
- for (var r = 0, i = this.animatedContents.length; r < i; ) {
- if (this.animatedContents[r].element === t) return;
- r += 1;
- }
- this.animatedContents.push({
- fn: SVGElementsRenderer.createRenderFunction(e),
- element: t,
- data: e
- });
- }),
- (SVGShapeElement.prototype.setElementStyles = function (e) {
- var t = e.styles,
- r,
- i = this.stylesList.length;
- for (r = 0; r < i; r += 1)
- this.stylesList[r].closed || t.push(this.stylesList[r]);
- }),
- (SVGShapeElement.prototype.reloadShapes = function () {
- this._isFirstFrame = !0;
- var e,
- t = this.itemsData.length;
- for (e = 0; e < t; e += 1) this.prevViewData[e] = this.itemsData[e];
- for (
- this.searchShapes(
- this.shapesData,
- this.itemsData,
- this.prevViewData,
- this.layerElement,
- 0,
- [],
- !0
- ),
- this.filterUniqueShapes(),
- t = this.dynamicProperties.length,
- e = 0;
- e < t;
- e += 1
- )
- this.dynamicProperties[e].getValue();
- this.renderModifiers();
- }),
- (SVGShapeElement.prototype.searchShapes = function (
- e,
- t,
- r,
- i,
- s,
- n,
- a
- ) {
- var o = [].concat(n),
- l,
- c = e.length - 1,
- g,
- S,
- p = [],
- P = [],
- b,
- y,
- A;
- for (l = c; l >= 0; l -= 1) {
- if (
- ((A = this.searchProcessedElement(e[l])),
- A ? (t[l] = r[A - 1]) : (e[l]._render = a),
- e[l].ty === 'fl' ||
- e[l].ty === 'st' ||
- e[l].ty === 'gf' ||
- e[l].ty === 'gs' ||
- e[l].ty === 'no')
- )
- A
- ? (t[l].style.closed = !1)
- : (t[l] = this.createStyleElement(e[l], s)),
- e[l]._render &&
- t[l].style.pElem.parentNode !== i &&
- i.appendChild(t[l].style.pElem),
- p.push(t[l].style);
- else if (e[l].ty === 'gr') {
- if (!A) t[l] = this.createGroupElement(e[l]);
- else
- for (S = t[l].it.length, g = 0; g < S; g += 1)
- t[l].prevViewData[g] = t[l].it[g];
- this.searchShapes(
- e[l].it,
- t[l].it,
- t[l].prevViewData,
- t[l].gr,
- s + 1,
- o,
- a
- ),
- e[l]._render &&
- t[l].gr.parentNode !== i &&
- i.appendChild(t[l].gr);
- } else
- e[l].ty === 'tr'
- ? (A || (t[l] = this.createTransformElement(e[l], i)),
- (b = t[l].transform),
- o.push(b))
- : e[l].ty === 'sh' ||
- e[l].ty === 'rc' ||
- e[l].ty === 'el' ||
- e[l].ty === 'sr'
- ? (A || (t[l] = this.createShapeElement(e[l], o, s)),
- this.setElementStyles(t[l]))
- : e[l].ty === 'tm' ||
- e[l].ty === 'rd' ||
- e[l].ty === 'ms' ||
- e[l].ty === 'pb' ||
- e[l].ty === 'zz' ||
- e[l].ty === 'op'
- ? (A
- ? ((y = t[l]), (y.closed = !1))
- : ((y = ShapeModifiers.getModifier(e[l].ty)),
- y.init(this, e[l]),
- (t[l] = y),
- this.shapeModifiers.push(y)),
- P.push(y))
- : e[l].ty === 'rp' &&
- (A
- ? ((y = t[l]), (y.closed = !0))
- : ((y = ShapeModifiers.getModifier(e[l].ty)),
- (t[l] = y),
- y.init(this, e, l, t),
- this.shapeModifiers.push(y),
- (a = !1)),
- P.push(y));
- this.addProcessedElement(e[l], l + 1);
- }
- for (c = p.length, l = 0; l < c; l += 1) p[l].closed = !0;
- for (c = P.length, l = 0; l < c; l += 1) P[l].closed = !0;
- }),
- (SVGShapeElement.prototype.renderInnerContent = function () {
- this.renderModifiers();
- var e,
- t = this.stylesList.length;
- for (e = 0; e < t; e += 1) this.stylesList[e].reset();
- for (this.renderShape(), e = 0; e < t; e += 1)
- (this.stylesList[e]._mdf || this._isFirstFrame) &&
- (this.stylesList[e].msElem &&
- (this.stylesList[e].msElem.setAttribute(
- 'd',
- this.stylesList[e].d
- ),
- (this.stylesList[e].d = 'M0 0' + this.stylesList[e].d)),
- this.stylesList[e].pElem.setAttribute(
- 'd',
- this.stylesList[e].d || 'M0 0'
- ));
- }),
- (SVGShapeElement.prototype.renderShape = function () {
- var e,
- t = this.animatedContents.length,
- r;
- for (e = 0; e < t; e += 1)
- (r = this.animatedContents[e]),
- (this._isFirstFrame || r.element._isAnimated) &&
- r.data !== !0 &&
- r.fn(r.data, r.element, this._isFirstFrame);
- }),
- (SVGShapeElement.prototype.destroy = function () {
- this.destroyBaseElement(),
- (this.shapesData = null),
- (this.itemsData = null);
- });
- function LetterProps(e, t, r, i, s, n) {
- (this.o = e),
- (this.sw = t),
- (this.sc = r),
- (this.fc = i),
- (this.m = s),
- (this.p = n),
- (this._mdf = { o: !0, sw: !!t, sc: !!r, fc: !!i, m: !0, p: !0 });
- }
- LetterProps.prototype.update = function (e, t, r, i, s, n) {
- (this._mdf.o = !1),
- (this._mdf.sw = !1),
- (this._mdf.sc = !1),
- (this._mdf.fc = !1),
- (this._mdf.m = !1),
- (this._mdf.p = !1);
- var a = !1;
- return (
- this.o !== e && ((this.o = e), (this._mdf.o = !0), (a = !0)),
- this.sw !== t && ((this.sw = t), (this._mdf.sw = !0), (a = !0)),
- this.sc !== r && ((this.sc = r), (this._mdf.sc = !0), (a = !0)),
- this.fc !== i && ((this.fc = i), (this._mdf.fc = !0), (a = !0)),
- this.m !== s && ((this.m = s), (this._mdf.m = !0), (a = !0)),
- n.length &&
- (this.p[0] !== n[0] ||
- this.p[1] !== n[1] ||
- this.p[4] !== n[4] ||
- this.p[5] !== n[5] ||
- this.p[12] !== n[12] ||
- this.p[13] !== n[13]) &&
- ((this.p = n), (this._mdf.p = !0), (a = !0)),
- a
- );
- };
- function TextProperty(e, t) {
- (this._frameId = initialDefaultFrame),
- (this.pv = ''),
- (this.v = ''),
- (this.kf = !1),
- (this._isFirstFrame = !0),
- (this._mdf = !1),
- t.d && t.d.sid && (t.d = e.globalData.slotManager.getProp(t.d)),
- (this.data = t),
- (this.elem = e),
- (this.comp = this.elem.comp),
- (this.keysIndex = 0),
- (this.canResize = !1),
- (this.minimumFontSize = 1),
- (this.effectsSequence = []),
- (this.currentData = {
- ascent: 0,
- boxWidth: this.defaultBoxWidth,
- f: '',
- fStyle: '',
- fWeight: '',
- fc: '',
- j: '',
- justifyOffset: '',
- l: [],
- lh: 0,
- lineWidths: [],
- ls: '',
- of: '',
- s: '',
- sc: '',
- sw: 0,
- t: 0,
- tr: 0,
- sz: 0,
- ps: null,
- fillColorAnim: !1,
- strokeColorAnim: !1,
- strokeWidthAnim: !1,
- yOffset: 0,
- finalSize: 0,
- finalText: [],
- finalLineHeight: 0,
- __complete: !1
- }),
- this.copyData(this.currentData, this.data.d.k[0].s),
- this.searchProperty() || this.completeTextData(this.currentData);
- }
- (TextProperty.prototype.defaultBoxWidth = [0, 0]),
- (TextProperty.prototype.copyData = function (e, t) {
- for (var r in t)
- Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
- return e;
- }),
- (TextProperty.prototype.setCurrentData = function (e) {
- e.__complete || this.completeTextData(e),
- (this.currentData = e),
- (this.currentData.boxWidth =
- this.currentData.boxWidth || this.defaultBoxWidth),
- (this._mdf = !0);
- }),
- (TextProperty.prototype.searchProperty = function () {
- return this.searchKeyframes();
- }),
- (TextProperty.prototype.searchKeyframes = function () {
- return (
- (this.kf = this.data.d.k.length > 1),
- this.kf && this.addEffect(this.getKeyframeValue.bind(this)),
- this.kf
- );
- }),
- (TextProperty.prototype.addEffect = function (e) {
- this.effectsSequence.push(e), this.elem.addDynamicProperty(this);
- }),
- (TextProperty.prototype.getValue = function (e) {
- if (
- !(
- (this.elem.globalData.frameId === this.frameId ||
- !this.effectsSequence.length) &&
- !e
- )
- ) {
- this.currentData.t = this.data.d.k[this.keysIndex].s.t;
- var t = this.currentData,
- r = this.keysIndex;
- if (this.lock) {
- this.setCurrentData(this.currentData);
- return;
- }
- (this.lock = !0), (this._mdf = !1);
- var i,
- s = this.effectsSequence.length,
- n = e || this.data.d.k[this.keysIndex].s;
- for (i = 0; i < s; i += 1)
- r !== this.keysIndex
- ? (n = this.effectsSequence[i](n, n.t))
- : (n = this.effectsSequence[i](this.currentData, n.t));
- t !== n && this.setCurrentData(n),
- (this.v = this.currentData),
- (this.pv = this.v),
- (this.lock = !1),
- (this.frameId = this.elem.globalData.frameId);
- }
- }),
- (TextProperty.prototype.getKeyframeValue = function () {
- for (
- var e = this.data.d.k,
- t = this.elem.comp.renderedFrame,
- r = 0,
- i = e.length;
- r <= i - 1 && !(r === i - 1 || e[r + 1].t > t);
- )
- r += 1;
- return (
- this.keysIndex !== r && (this.keysIndex = r),
- this.data.d.k[this.keysIndex].s
- );
- }),
- (TextProperty.prototype.buildFinalText = function (e) {
- for (var t = [], r = 0, i = e.length, s, n, a = !1; r < i; )
- (s = e.charCodeAt(r)),
- FontManager.isCombinedCharacter(s)
- ? (t[t.length - 1] += e.charAt(r))
- : s >= 55296 && s <= 56319
- ? ((n = e.charCodeAt(r + 1)),
- n >= 56320 && n <= 57343
- ? (a || FontManager.isModifier(s, n)
- ? ((t[t.length - 1] += e.substr(r, 2)), (a = !1))
- : t.push(e.substr(r, 2)),
- (r += 1))
- : t.push(e.charAt(r)))
- : s > 56319
- ? ((n = e.charCodeAt(r + 1)),
- FontManager.isZeroWidthJoiner(s, n)
- ? ((a = !0), (t[t.length - 1] += e.substr(r, 2)), (r += 1))
- : t.push(e.charAt(r)))
- : FontManager.isZeroWidthJoiner(s)
- ? ((t[t.length - 1] += e.charAt(r)), (a = !0))
- : t.push(e.charAt(r)),
- (r += 1);
- return t;
- }),
- (TextProperty.prototype.completeTextData = function (e) {
- e.__complete = !0;
- var t = this.elem.globalData.fontManager,
- r = this.data,
- i = [],
- s,
- n,
- a,
- o = 0,
- l,
- c = r.m.g,
- g = 0,
- S = 0,
- p = 0,
- P = [],
- b = 0,
- y = 0,
- A,
- u,
- f = t.getFontByName(e.f),
- m,
- d = 0,
- E = getFontProperties(f);
- (e.fWeight = E.weight),
- (e.fStyle = E.style),
- (e.finalSize = e.s),
- (e.finalText = this.buildFinalText(e.t)),
- (n = e.finalText.length),
- (e.finalLineHeight = e.lh);
- var T = (e.tr / 1e3) * e.finalSize,
- x;
- if (e.sz)
- for (var _ = !0, I = e.sz[0], V = e.sz[1], D, N; _; ) {
- (N = this.buildFinalText(e.t)),
- (D = 0),
- (b = 0),
- (n = N.length),
- (T = (e.tr / 1e3) * e.finalSize);
- var $ = -1;
- for (s = 0; s < n; s += 1)
- (x = N[s].charCodeAt(0)),
- (a = !1),
- N[s] === ' '
- ? ($ = s)
- : (x === 13 || x === 3) &&
- ((b = 0),
- (a = !0),
- (D += e.finalLineHeight || e.finalSize * 1.2)),
- t.chars
- ? ((m = t.getCharData(N[s], f.fStyle, f.fFamily)),
- (d = a ? 0 : (m.w * e.finalSize) / 100))
- : (d = t.measureText(N[s], e.f, e.finalSize)),
- b + d > I && N[s] !== ' '
- ? ($ === -1 ? (n += 1) : (s = $),
- (D += e.finalLineHeight || e.finalSize * 1.2),
- N.splice(s, $ === s ? 1 : 0, '\r'),
- ($ = -1),
- (b = 0))
- : ((b += d), (b += T));
- (D += (f.ascent * e.finalSize) / 100),
- this.canResize && e.finalSize > this.minimumFontSize && V < D
- ? ((e.finalSize -= 1),
- (e.finalLineHeight = (e.finalSize * e.lh) / e.s))
- : ((e.finalText = N), (n = e.finalText.length), (_ = !1));
- }
- (b = -T), (d = 0);
- var O = 0,
- B;
- for (s = 0; s < n; s += 1)
- if (
- ((a = !1),
- (B = e.finalText[s]),
- (x = B.charCodeAt(0)),
- x === 13 || x === 3
- ? ((O = 0),
- P.push(b),
- (y = b > y ? b : y),
- (b = -2 * T),
- (l = ''),
- (a = !0),
- (p += 1))
- : (l = B),
- t.chars
- ? ((m = t.getCharData(
- B,
- f.fStyle,
- t.getFontByName(e.f).fFamily
- )),
- (d = a ? 0 : (m.w * e.finalSize) / 100))
- : (d = t.measureText(l, e.f, e.finalSize)),
- B === ' ' ? (O += d + T) : ((b += d + T + O), (O = 0)),
- i.push({
- l: d,
- an: d,
- add: g,
- n: a,
- anIndexes: [],
- val: l,
- line: p,
- animatorJustifyOffset: 0
- }),
- c == 2)
- ) {
- if (((g += d), l === '' || l === ' ' || s === n - 1)) {
- for ((l === '' || l === ' ') && (g -= d); S <= s; )
- (i[S].an = g), (i[S].ind = o), (i[S].extra = d), (S += 1);
- (o += 1), (g = 0);
- }
- } else if (c == 3) {
- if (((g += d), l === '' || s === n - 1)) {
- for (l === '' && (g -= d); S <= s; )
- (i[S].an = g), (i[S].ind = o), (i[S].extra = d), (S += 1);
- (g = 0), (o += 1);
- }
- } else (i[o].ind = o), (i[o].extra = 0), (o += 1);
- if (((e.l = i), (y = b > y ? b : y), P.push(b), e.sz))
- (e.boxWidth = e.sz[0]), (e.justifyOffset = 0);
- else
- switch (((e.boxWidth = y), e.j)) {
- case 1:
- e.justifyOffset = -e.boxWidth;
- break;
- case 2:
- e.justifyOffset = -e.boxWidth / 2;
- break;
- default:
- e.justifyOffset = 0;
- }
- e.lineWidths = P;
- var F = r.a,
- k,
- C;
- u = F.length;
- var M,
- R,
- L = [];
- for (A = 0; A < u; A += 1) {
- for (
- k = F[A],
- k.a.sc && (e.strokeColorAnim = !0),
- k.a.sw && (e.strokeWidthAnim = !0),
- (k.a.fc || k.a.fh || k.a.fs || k.a.fb) &&
- (e.fillColorAnim = !0),
- R = 0,
- M = k.s.b,
- s = 0;
- s < n;
- s += 1
- )
- (C = i[s]),
- (C.anIndexes[A] = R),
- ((M == 1 && C.val !== '') ||
- (M == 2 && C.val !== '' && C.val !== ' ') ||
- (M == 3 && (C.n || C.val == ' ' || s == n - 1)) ||
- (M == 4 && (C.n || s == n - 1))) &&
- (k.s.rn === 1 && L.push(R), (R += 1));
- r.a[A].s.totalChars = R;
- var j = -1,
- z;
- if (k.s.rn === 1)
- for (s = 0; s < n; s += 1)
- (C = i[s]),
- j != C.anIndexes[A] &&
- ((j = C.anIndexes[A]),
- (z = L.splice(Math.floor(Math.random() * L.length), 1)[0])),
- (C.anIndexes[A] = z);
- }
- (e.yOffset = e.finalLineHeight || e.finalSize * 1.2),
- (e.ls = e.ls || 0),
- (e.ascent = (f.ascent * e.finalSize) / 100);
- }),
- (TextProperty.prototype.updateDocumentData = function (e, t) {
- t = t === void 0 ? this.keysIndex : t;
- var r = this.copyData({}, this.data.d.k[t].s);
- (r = this.copyData(r, e)),
- (this.data.d.k[t].s = r),
- this.recalculate(t),
- this.setCurrentData(r),
- this.elem.addDynamicProperty(this);
- }),
- (TextProperty.prototype.recalculate = function (e) {
- var t = this.data.d.k[e].s;
- (t.__complete = !1),
- (this.keysIndex = 0),
- (this._isFirstFrame = !0),
- this.getValue(t);
- }),
- (TextProperty.prototype.canResizeFont = function (e) {
- (this.canResize = e),
- this.recalculate(this.keysIndex),
- this.elem.addDynamicProperty(this);
- }),
- (TextProperty.prototype.setMinimumFontSize = function (e) {
- (this.minimumFontSize = Math.floor(e) || 1),
- this.recalculate(this.keysIndex),
- this.elem.addDynamicProperty(this);
- });
- var TextSelectorProp = (function () {
- var e = Math.max,
- t = Math.min,
- r = Math.floor;
- function i(n, a) {
- (this._currentTextLength = -1),
- (this.k = !1),
- (this.data = a),
- (this.elem = n),
- (this.comp = n.comp),
- (this.finalS = 0),
- (this.finalE = 0),
- this.initDynamicPropertyContainer(n),
- (this.s = PropertyFactory.getProp(n, a.s || { k: 0 }, 0, 0, this)),
- 'e' in a
- ? (this.e = PropertyFactory.getProp(n, a.e, 0, 0, this))
- : (this.e = { v: 100 }),
- (this.o = PropertyFactory.getProp(n, a.o || { k: 0 }, 0, 0, this)),
- (this.xe = PropertyFactory.getProp(
- n,
- a.xe || { k: 0 },
- 0,
- 0,
- this
- )),
- (this.ne = PropertyFactory.getProp(
- n,
- a.ne || { k: 0 },
- 0,
- 0,
- this
- )),
- (this.sm = PropertyFactory.getProp(
- n,
- a.sm || { k: 100 },
- 0,
- 0,
- this
- )),
- (this.a = PropertyFactory.getProp(n, a.a, 0, 0.01, this)),
- this.dynamicProperties.length || this.getValue();
- }
- (i.prototype = {
- getMult: function (a) {
- this._currentTextLength !==
- this.elem.textProperty.currentData.l.length && this.getValue();
- var o = 0,
- l = 0,
- c = 1,
- g = 1;
- this.ne.v > 0 ? (o = this.ne.v / 100) : (l = -this.ne.v / 100),
- this.xe.v > 0
- ? (c = 1 - this.xe.v / 100)
- : (g = 1 + this.xe.v / 100);
- var S = BezierFactory.getBezierEasing(o, l, c, g).get,
- p = 0,
- P = this.finalS,
- b = this.finalE,
- y = this.data.sh;
- if (y === 2)
- b === P
- ? (p = a >= b ? 1 : 0)
- : (p = e(0, t(0.5 / (b - P) + (a - P) / (b - P), 1))),
- (p = S(p));
- else if (y === 3)
- b === P
- ? (p = a >= b ? 0 : 1)
- : (p = 1 - e(0, t(0.5 / (b - P) + (a - P) / (b - P), 1))),
- (p = S(p));
- else if (y === 4)
- b === P
- ? (p = 0)
- : ((p = e(0, t(0.5 / (b - P) + (a - P) / (b - P), 1))),
- p < 0.5 ? (p *= 2) : (p = 1 - 2 * (p - 0.5))),
- (p = S(p));
- else if (y === 5) {
- if (b === P) p = 0;
- else {
- var A = b - P;
- a = t(e(0, a + 0.5 - P), b - P);
- var u = -A / 2 + a,
- f = A / 2;
- p = Math.sqrt(1 - (u * u) / (f * f));
- }
- p = S(p);
- } else
- y === 6
- ? (b === P
- ? (p = 0)
- : ((a = t(e(0, a + 0.5 - P), b - P)),
- (p =
- (1 + Math.cos(Math.PI + (Math.PI * 2 * a) / (b - P))) /
- 2)),
- (p = S(p)))
- : (a >= r(P) &&
- (a - P < 0
- ? (p = e(0, t(t(b, 1) - (P - a), 1)))
- : (p = e(0, t(b - a, 1)))),
- (p = S(p)));
- if (this.sm.v !== 100) {
- var m = this.sm.v * 0.01;
- m === 0 && (m = 1e-8);
- var d = 0.5 - m * 0.5;
- p < d ? (p = 0) : ((p = (p - d) / m), p > 1 && (p = 1));
- }
- return p * this.a.v;
- },
- getValue: function (a) {
- this.iterateDynamicProperties(),
- (this._mdf = a || this._mdf),
- (this._currentTextLength =
- this.elem.textProperty.currentData.l.length || 0),
- a && this.data.r === 2 && (this.e.v = this._currentTextLength);
- var o = this.data.r === 2 ? 1 : 100 / this.data.totalChars,
- l = this.o.v / o,
- c = this.s.v / o + l,
- g = this.e.v / o + l;
- if (c > g) {
- var S = c;
- (c = g), (g = S);
- }
- (this.finalS = c), (this.finalE = g);
- }
- }),
- extendPrototype([DynamicPropertyContainer], i);
- function s(n, a, o) {
- return new i(n, a);
- }
- return { getTextSelectorProp: s };
- })();
- function TextAnimatorDataProperty(e, t, r) {
- var i = { propType: !1 },
- s = PropertyFactory.getProp,
- n = t.a;
- (this.a = {
- r: n.r ? s(e, n.r, 0, degToRads, r) : i,
- rx: n.rx ? s(e, n.rx, 0, degToRads, r) : i,
- ry: n.ry ? s(e, n.ry, 0, degToRads, r) : i,
- sk: n.sk ? s(e, n.sk, 0, degToRads, r) : i,
- sa: n.sa ? s(e, n.sa, 0, degToRads, r) : i,
- s: n.s ? s(e, n.s, 1, 0.01, r) : i,
- a: n.a ? s(e, n.a, 1, 0, r) : i,
- o: n.o ? s(e, n.o, 0, 0.01, r) : i,
- p: n.p ? s(e, n.p, 1, 0, r) : i,
- sw: n.sw ? s(e, n.sw, 0, 0, r) : i,
- sc: n.sc ? s(e, n.sc, 1, 0, r) : i,
- fc: n.fc ? s(e, n.fc, 1, 0, r) : i,
- fh: n.fh ? s(e, n.fh, 0, 0, r) : i,
- fs: n.fs ? s(e, n.fs, 0, 0.01, r) : i,
- fb: n.fb ? s(e, n.fb, 0, 0.01, r) : i,
- t: n.t ? s(e, n.t, 0, 0, r) : i
- }),
- (this.s = TextSelectorProp.getTextSelectorProp(e, t.s, r)),
- (this.s.t = t.s.t);
- }
- function TextAnimatorProperty(e, t, r) {
- (this._isFirstFrame = !0),
- (this._hasMaskedPath = !1),
- (this._frameId = -1),
- (this._textData = e),
- (this._renderType = t),
- (this._elem = r),
- (this._animatorsData = createSizedArray(this._textData.a.length)),
- (this._pathData = {}),
- (this._moreOptions = { alignment: {} }),
- (this.renderedLetters = []),
- (this.lettersChangedFlag = !1),
- this.initDynamicPropertyContainer(r);
- }
- (TextAnimatorProperty.prototype.searchProperties = function () {
- var e,
- t = this._textData.a.length,
- r,
- i = PropertyFactory.getProp;
- for (e = 0; e < t; e += 1)
- (r = this._textData.a[e]),
- (this._animatorsData[e] = new TextAnimatorDataProperty(
- this._elem,
- r,
- this
- ));
- this._textData.p && 'm' in this._textData.p
- ? ((this._pathData = {
- a: i(this._elem, this._textData.p.a, 0, 0, this),
- f: i(this._elem, this._textData.p.f, 0, 0, this),
- l: i(this._elem, this._textData.p.l, 0, 0, this),
- r: i(this._elem, this._textData.p.r, 0, 0, this),
- p: i(this._elem, this._textData.p.p, 0, 0, this),
- m: this._elem.maskManager.getMaskProperty(this._textData.p.m)
- }),
- (this._hasMaskedPath = !0))
- : (this._hasMaskedPath = !1),
- (this._moreOptions.alignment = i(
- this._elem,
- this._textData.m.a,
- 1,
- 0,
- this
- ));
- }),
- (TextAnimatorProperty.prototype.getMeasures = function (e, t) {
- if (
- ((this.lettersChangedFlag = t),
- !(
- !this._mdf &&
- !this._isFirstFrame &&
- !t &&
- (!this._hasMaskedPath || !this._pathData.m._mdf)
- ))
- ) {
- this._isFirstFrame = !1;
- var r = this._moreOptions.alignment.v,
- i = this._animatorsData,
- s = this._textData,
- n = this.mHelper,
- a = this._renderType,
- o = this.renderedLetters.length,
- l,
- c,
- g,
- S,
- p = e.l,
- P,
- b,
- y,
- A,
- u,
- f,
- m,
- d,
- E,
- T,
- x,
- _,
- I,
- V,
- D;
- if (this._hasMaskedPath) {
- if (
- ((D = this._pathData.m),
- !this._pathData.n || this._pathData._mdf)
- ) {
- var N = D.v;
- this._pathData.r.v && (N = N.reverse()),
- (P = { tLength: 0, segments: [] }),
- (S = N._length - 1);
- var $;
- for (_ = 0, g = 0; g < S; g += 1)
- ($ = bez.buildBezierData(
- N.v[g],
- N.v[g + 1],
- [N.o[g][0] - N.v[g][0], N.o[g][1] - N.v[g][1]],
- [
- N.i[g + 1][0] - N.v[g + 1][0],
- N.i[g + 1][1] - N.v[g + 1][1]
- ]
- )),
- (P.tLength += $.segmentLength),
- P.segments.push($),
- (_ += $.segmentLength);
- (g = S),
- D.v.c &&
- (($ = bez.buildBezierData(
- N.v[g],
- N.v[0],
- [N.o[g][0] - N.v[g][0], N.o[g][1] - N.v[g][1]],
- [N.i[0][0] - N.v[0][0], N.i[0][1] - N.v[0][1]]
- )),
- (P.tLength += $.segmentLength),
- P.segments.push($),
- (_ += $.segmentLength)),
- (this._pathData.pi = P);
- }
- if (
- ((P = this._pathData.pi),
- (b = this._pathData.f.v),
- (m = 0),
- (f = 1),
- (A = 0),
- (u = !0),
- (T = P.segments),
- b < 0 && D.v.c)
- )
- for (
- P.tLength < Math.abs(b) && (b = -Math.abs(b) % P.tLength),
- m = T.length - 1,
- E = T[m].points,
- f = E.length - 1;
- b < 0;
- )
- (b += E[f].partialLength),
- (f -= 1),
- f < 0 && ((m -= 1), (E = T[m].points), (f = E.length - 1));
- (E = T[m].points),
- (d = E[f - 1]),
- (y = E[f]),
- (x = y.partialLength);
- }
- (S = p.length), (l = 0), (c = 0);
- var O = e.finalSize * 1.2 * 0.714,
- B = !0,
- F,
- k,
- C,
- M,
- R;
- M = i.length;
- var L,
- j = -1,
- z,
- H,
- U,
- q = b,
- ee = m,
- ie = f,
- te = -1,
- Y,
- X,
- J,
- G,
- W,
- se,
- le,
- ne,
- re = '',
- ae = this.defaultPropsArray,
- oe;
- if (e.j === 2 || e.j === 1) {
- var K = 0,
- he = 0,
- ce = e.j === 2 ? -0.5 : -1,
- Z = 0,
- pe = !0;
- for (g = 0; g < S; g += 1)
- if (p[g].n) {
- for (K && (K += he); Z < g; )
- (p[Z].animatorJustifyOffset = K), (Z += 1);
- (K = 0), (pe = !0);
- } else {
- for (C = 0; C < M; C += 1)
- (F = i[C].a),
- F.t.propType &&
- (pe && e.j === 2 && (he += F.t.v * ce),
- (k = i[C].s),
- (L = k.getMult(p[g].anIndexes[C], s.a[C].s.totalChars)),
- L.length
- ? (K += F.t.v * L[0] * ce)
- : (K += F.t.v * L * ce));
- pe = !1;
- }
- for (K && (K += he); Z < g; )
- (p[Z].animatorJustifyOffset = K), (Z += 1);
- }
- for (g = 0; g < S; g += 1) {
- if ((n.reset(), (Y = 1), p[g].n))
- (l = 0),
- (c += e.yOffset),
- (c += B ? 1 : 0),
- (b = q),
- (B = !1),
- this._hasMaskedPath &&
- ((m = ee),
- (f = ie),
- (E = T[m].points),
- (d = E[f - 1]),
- (y = E[f]),
- (x = y.partialLength),
- (A = 0)),
- (re = ''),
- (ne = ''),
- (se = ''),
- (oe = ''),
- (ae = this.defaultPropsArray);
- else {
- if (this._hasMaskedPath) {
- if (te !== p[g].line) {
- switch (e.j) {
- case 1:
- b += _ - e.lineWidths[p[g].line];
- break;
- case 2:
- b += (_ - e.lineWidths[p[g].line]) / 2;
- break;
- }
- te = p[g].line;
- }
- j !== p[g].ind &&
- (p[j] && (b += p[j].extra),
- (b += p[g].an / 2),
- (j = p[g].ind)),
- (b += r[0] * p[g].an * 0.005);
- var Q = 0;
- for (C = 0; C < M; C += 1)
- (F = i[C].a),
- F.p.propType &&
- ((k = i[C].s),
- (L = k.getMult(p[g].anIndexes[C], s.a[C].s.totalChars)),
- L.length
- ? (Q += F.p.v[0] * L[0])
- : (Q += F.p.v[0] * L)),
- F.a.propType &&
- ((k = i[C].s),
- (L = k.getMult(p[g].anIndexes[C], s.a[C].s.totalChars)),
- L.length
- ? (Q += F.a.v[0] * L[0])
- : (Q += F.a.v[0] * L));
- for (
- u = !0,
- this._pathData.a.v &&
- ((b =
- p[0].an * 0.5 +
- ((_ -
- this._pathData.f.v -
- p[0].an * 0.5 -
- p[p.length - 1].an * 0.5) *
- j) /
- (S - 1)),
- (b += this._pathData.f.v));
- u;
- )
- A + x >= b + Q || !E
- ? ((I = (b + Q - A) / y.partialLength),
- (H = d.point[0] + (y.point[0] - d.point[0]) * I),
- (U = d.point[1] + (y.point[1] - d.point[1]) * I),
- n.translate(
- -r[0] * p[g].an * 0.005,
- -(r[1] * O) * 0.01
- ),
- (u = !1))
- : E &&
- ((A += y.partialLength),
- (f += 1),
- f >= E.length &&
- ((f = 0),
- (m += 1),
- T[m]
- ? (E = T[m].points)
- : D.v.c
- ? ((f = 0), (m = 0), (E = T[m].points))
- : ((A -= y.partialLength), (E = null))),
- E && ((d = y), (y = E[f]), (x = y.partialLength)));
- (z = p[g].an / 2 - p[g].add), n.translate(-z, 0, 0);
- } else
- (z = p[g].an / 2 - p[g].add),
- n.translate(-z, 0, 0),
- n.translate(-r[0] * p[g].an * 0.005, -r[1] * O * 0.01, 0);
- for (C = 0; C < M; C += 1)
- (F = i[C].a),
- F.t.propType &&
- ((k = i[C].s),
- (L = k.getMult(p[g].anIndexes[C], s.a[C].s.totalChars)),
- (l !== 0 || e.j !== 0) &&
- (this._hasMaskedPath
- ? L.length
- ? (b += F.t.v * L[0])
- : (b += F.t.v * L)
- : L.length
- ? (l += F.t.v * L[0])
- : (l += F.t.v * L)));
- for (
- e.strokeWidthAnim && (J = e.sw || 0),
- e.strokeColorAnim &&
- (e.sc
- ? (X = [e.sc[0], e.sc[1], e.sc[2]])
- : (X = [0, 0, 0])),
- e.fillColorAnim &&
- e.fc &&
- (G = [e.fc[0], e.fc[1], e.fc[2]]),
- C = 0;
- C < M;
- C += 1
- )
- (F = i[C].a),
- F.a.propType &&
- ((k = i[C].s),
- (L = k.getMult(p[g].anIndexes[C], s.a[C].s.totalChars)),
- L.length
- ? n.translate(
- -F.a.v[0] * L[0],
- -F.a.v[1] * L[1],
- F.a.v[2] * L[2]
- )
- : n.translate(
- -F.a.v[0] * L,
- -F.a.v[1] * L,
- F.a.v[2] * L
- ));
- for (C = 0; C < M; C += 1)
- (F = i[C].a),
- F.s.propType &&
- ((k = i[C].s),
- (L = k.getMult(p[g].anIndexes[C], s.a[C].s.totalChars)),
- L.length
- ? n.scale(
- 1 + (F.s.v[0] - 1) * L[0],
- 1 + (F.s.v[1] - 1) * L[1],
- 1
- )
- : n.scale(
- 1 + (F.s.v[0] - 1) * L,
- 1 + (F.s.v[1] - 1) * L,
- 1
- ));
- for (C = 0; C < M; C += 1) {
- if (
- ((F = i[C].a),
- (k = i[C].s),
- (L = k.getMult(p[g].anIndexes[C], s.a[C].s.totalChars)),
- F.sk.propType &&
- (L.length
- ? n.skewFromAxis(-F.sk.v * L[0], F.sa.v * L[1])
- : n.skewFromAxis(-F.sk.v * L, F.sa.v * L)),
- F.r.propType &&
- (L.length
- ? n.rotateZ(-F.r.v * L[2])
- : n.rotateZ(-F.r.v * L)),
- F.ry.propType &&
- (L.length
- ? n.rotateY(F.ry.v * L[1])
- : n.rotateY(F.ry.v * L)),
- F.rx.propType &&
- (L.length
- ? n.rotateX(F.rx.v * L[0])
- : n.rotateX(F.rx.v * L)),
- F.o.propType &&
- (L.length
- ? (Y += (F.o.v * L[0] - Y) * L[0])
- : (Y += (F.o.v * L - Y) * L)),
- e.strokeWidthAnim &&
- F.sw.propType &&
- (L.length ? (J += F.sw.v * L[0]) : (J += F.sw.v * L)),
- e.strokeColorAnim && F.sc.propType)
- )
- for (W = 0; W < 3; W += 1)
- L.length
- ? (X[W] += (F.sc.v[W] - X[W]) * L[0])
- : (X[W] += (F.sc.v[W] - X[W]) * L);
- if (e.fillColorAnim && e.fc) {
- if (F.fc.propType)
- for (W = 0; W < 3; W += 1)
- L.length
- ? (G[W] += (F.fc.v[W] - G[W]) * L[0])
- : (G[W] += (F.fc.v[W] - G[W]) * L);
- F.fh.propType &&
- (L.length
- ? (G = addHueToRGB(G, F.fh.v * L[0]))
- : (G = addHueToRGB(G, F.fh.v * L))),
- F.fs.propType &&
- (L.length
- ? (G = addSaturationToRGB(G, F.fs.v * L[0]))
- : (G = addSaturationToRGB(G, F.fs.v * L))),
- F.fb.propType &&
- (L.length
- ? (G = addBrightnessToRGB(G, F.fb.v * L[0]))
- : (G = addBrightnessToRGB(G, F.fb.v * L)));
- }
- }
- for (C = 0; C < M; C += 1)
- (F = i[C].a),
- F.p.propType &&
- ((k = i[C].s),
- (L = k.getMult(p[g].anIndexes[C], s.a[C].s.totalChars)),
- this._hasMaskedPath
- ? L.length
- ? n.translate(0, F.p.v[1] * L[0], -F.p.v[2] * L[1])
- : n.translate(0, F.p.v[1] * L, -F.p.v[2] * L)
- : L.length
- ? n.translate(
- F.p.v[0] * L[0],
- F.p.v[1] * L[1],
- -F.p.v[2] * L[2]
- )
- : n.translate(
- F.p.v[0] * L,
- F.p.v[1] * L,
- -F.p.v[2] * L
- ));
- if (
- (e.strokeWidthAnim && (se = J < 0 ? 0 : J),
- e.strokeColorAnim &&
- (le =
- 'rgb(' +
- Math.round(X[0] * 255) +
- ',' +
- Math.round(X[1] * 255) +
- ',' +
- Math.round(X[2] * 255) +
- ')'),
- e.fillColorAnim &&
- e.fc &&
- (ne =
- 'rgb(' +
- Math.round(G[0] * 255) +
- ',' +
- Math.round(G[1] * 255) +
- ',' +
- Math.round(G[2] * 255) +
- ')'),
- this._hasMaskedPath)
- ) {
- if (
- (n.translate(0, -e.ls),
- n.translate(0, r[1] * O * 0.01 + c, 0),
- this._pathData.p.v)
- ) {
- V = (y.point[1] - d.point[1]) / (y.point[0] - d.point[0]);
- var ue = (Math.atan(V) * 180) / Math.PI;
- y.point[0] < d.point[0] && (ue += 180),
- n.rotate((-ue * Math.PI) / 180);
- }
- n.translate(H, U, 0),
- (b -= r[0] * p[g].an * 0.005),
- p[g + 1] &&
- j !== p[g + 1].ind &&
- ((b += p[g].an / 2), (b += e.tr * 0.001 * e.finalSize));
- } else {
- switch (
- (n.translate(l, c, 0),
- e.ps && n.translate(e.ps[0], e.ps[1] + e.ascent, 0),
- e.j)
- ) {
- case 1:
- n.translate(
- p[g].animatorJustifyOffset +
- e.justifyOffset +
- (e.boxWidth - e.lineWidths[p[g].line]),
- 0,
- 0
- );
- break;
- case 2:
- n.translate(
- p[g].animatorJustifyOffset +
- e.justifyOffset +
- (e.boxWidth - e.lineWidths[p[g].line]) / 2,
- 0,
- 0
- );
- break;
- }
- n.translate(0, -e.ls),
- n.translate(z, 0, 0),
- n.translate(r[0] * p[g].an * 0.005, r[1] * O * 0.01, 0),
- (l += p[g].l + e.tr * 0.001 * e.finalSize);
- }
- a === 'html'
- ? (re = n.toCSS())
- : a === 'svg'
- ? (re = n.to2dCSS())
- : (ae = [
- n.props[0],
- n.props[1],
- n.props[2],
- n.props[3],
- n.props[4],
- n.props[5],
- n.props[6],
- n.props[7],
- n.props[8],
- n.props[9],
- n.props[10],
- n.props[11],
- n.props[12],
- n.props[13],
- n.props[14],
- n.props[15]
- ]),
- (oe = Y);
- }
- o <= g
- ? ((R = new LetterProps(oe, se, le, ne, re, ae)),
- this.renderedLetters.push(R),
- (o += 1),
- (this.lettersChangedFlag = !0))
- : ((R = this.renderedLetters[g]),
- (this.lettersChangedFlag =
- R.update(oe, se, le, ne, re, ae) ||
- this.lettersChangedFlag));
- }
- }
- }),
- (TextAnimatorProperty.prototype.getValue = function () {
- this._elem.globalData.frameId !== this._frameId &&
- ((this._frameId = this._elem.globalData.frameId),
- this.iterateDynamicProperties());
- }),
- (TextAnimatorProperty.prototype.mHelper = new Matrix()),
- (TextAnimatorProperty.prototype.defaultPropsArray = []),
- extendPrototype([DynamicPropertyContainer], TextAnimatorProperty);
- function ITextElement() {}
- (ITextElement.prototype.initElement = function (e, t, r) {
- (this.lettersChangedFlag = !0),
- this.initFrame(),
- this.initBaseData(e, t, r),
- (this.textProperty = new TextProperty(
- this,
- e.t,
- this.dynamicProperties
- )),
- (this.textAnimator = new TextAnimatorProperty(
- e.t,
- this.renderType,
- this
- )),
- this.initTransform(e, t, r),
- this.initHierarchy(),
- this.initRenderable(),
- this.initRendererElement(),
- this.createContainerElements(),
- this.createRenderableComponents(),
- this.createContent(),
- this.hide(),
- this.textAnimator.searchProperties(this.dynamicProperties);
- }),
- (ITextElement.prototype.prepareFrame = function (e) {
- (this._mdf = !1),
- this.prepareRenderableFrame(e),
- this.prepareProperties(e, this.isInRange),
- (this.textProperty._mdf || this.textProperty._isFirstFrame) &&
- (this.buildNewText(),
- (this.textProperty._isFirstFrame = !1),
- (this.textProperty._mdf = !1));
- }),
- (ITextElement.prototype.createPathShape = function (e, t) {
- var r,
- i = t.length,
- s,
- n = '';
- for (r = 0; r < i; r += 1)
- t[r].ty === 'sh' &&
- ((s = t[r].ks.k), (n += buildShapeString(s, s.i.length, !0, e)));
- return n;
- }),
- (ITextElement.prototype.updateDocumentData = function (e, t) {
- this.textProperty.updateDocumentData(e, t);
- }),
- (ITextElement.prototype.canResizeFont = function (e) {
- this.textProperty.canResizeFont(e);
- }),
- (ITextElement.prototype.setMinimumFontSize = function (e) {
- this.textProperty.setMinimumFontSize(e);
- }),
- (ITextElement.prototype.applyTextPropertiesToMatrix = function (
- e,
- t,
- r,
- i,
- s
- ) {
- switch (
- (e.ps && t.translate(e.ps[0], e.ps[1] + e.ascent, 0),
- t.translate(0, -e.ls, 0),
- e.j)
- ) {
- case 1:
- t.translate(
- e.justifyOffset + (e.boxWidth - e.lineWidths[r]),
- 0,
- 0
- );
- break;
- case 2:
- t.translate(
- e.justifyOffset + (e.boxWidth - e.lineWidths[r]) / 2,
- 0,
- 0
- );
- break;
- }
- t.translate(i, s, 0);
- }),
- (ITextElement.prototype.buildColor = function (e) {
- return (
- 'rgb(' +
- Math.round(e[0] * 255) +
- ',' +
- Math.round(e[1] * 255) +
- ',' +
- Math.round(e[2] * 255) +
- ')'
- );
- }),
- (ITextElement.prototype.emptyProp = new LetterProps()),
- (ITextElement.prototype.destroy = function () {});
- var emptyShapeData = { shapes: [] };
- function SVGTextLottieElement(e, t, r) {
- (this.textSpans = []),
- (this.renderType = 'svg'),
- this.initElement(e, t, r);
- }
- extendPrototype(
- [
- BaseElement,
- TransformElement,
- SVGBaseElement,
- HierarchyElement,
- FrameElement,
- RenderableDOMElement,
- ITextElement
- ],
- SVGTextLottieElement
- ),
- (SVGTextLottieElement.prototype.createContent = function () {
- this.data.singleShape &&
- !this.globalData.fontManager.chars &&
- (this.textContainer = createNS('text'));
- }),
- (SVGTextLottieElement.prototype.buildTextContents = function (e) {
- for (var t = 0, r = e.length, i = [], s = ''; t < r; )
- e[t] === String.fromCharCode(13) || e[t] === String.fromCharCode(3)
- ? (i.push(s), (s = ''))
- : (s += e[t]),
- (t += 1);
- return i.push(s), i;
- }),
- (SVGTextLottieElement.prototype.buildShapeData = function (e, t) {
- if (e.shapes && e.shapes.length) {
- var r = e.shapes[0];
- if (r.it) {
- var i = r.it[r.it.length - 1];
- i.s && ((i.s.k[0] = t), (i.s.k[1] = t));
- }
- }
- return e;
- }),
- (SVGTextLottieElement.prototype.buildNewText = function () {
- this.addDynamicProperty(this);
- var e,
- t,
- r = this.textProperty.currentData;
- (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);
- var i = this.globalData.fontManager.getFontByName(r.f);
- if (i.fClass) this.layerElement.setAttribute('class', i.fClass);
- else {
- this.layerElement.setAttribute('font-family', i.fFamily);
- var s = r.fWeight,
- n = r.fStyle;
- this.layerElement.setAttribute('font-style', n),
- this.layerElement.setAttribute('font-weight', s);
- }
- this.layerElement.setAttribute('aria-label', r.t);
- var a = r.l || [],
- o = !!this.globalData.fontManager.chars;
- t = a.length;
- var l,
- c = this.mHelper,
- g = '',
- S = this.data.singleShape,
- p = 0,
- P = 0,
- b = !0,
- y = r.tr * 0.001 * r.finalSize;
- if (S && !o && !r.sz) {
- var A = this.textContainer,
- u = 'start';
- switch (r.j) {
- case 1:
- u = 'end';
- break;
- case 2:
- u = 'middle';
- break;
- default:
- u = 'start';
- break;
- }
- A.setAttribute('text-anchor', u),
- A.setAttribute('letter-spacing', y);
- var f = this.buildTextContents(r.finalText);
- for (
- t = f.length, P = r.ps ? r.ps[1] + r.ascent : 0, e = 0;
- e < t;
- e += 1
- )
- (l = this.textSpans[e].span || createNS('tspan')),
- (l.textContent = f[e]),
- l.setAttribute('x', 0),
- l.setAttribute('y', P),
- (l.style.display = 'inherit'),
- A.appendChild(l),
- this.textSpans[e] ||
- (this.textSpans[e] = { span: null, glyph: null }),
- (this.textSpans[e].span = l),
- (P += r.finalLineHeight);
- this.layerElement.appendChild(A);
- } else {
- var m = this.textSpans.length,
- d;
- for (e = 0; e < t; e += 1) {
- if (
- (this.textSpans[e] ||
- (this.textSpans[e] = {
- span: null,
- childSpan: null,
- glyph: null
- }),
- !o || !S || e === 0)
- ) {
- if (
- ((l =
- m > e
- ? this.textSpans[e].span
- : createNS(o ? 'g' : 'text')),
- m <= e)
- ) {
- if (
- (l.setAttribute('stroke-linecap', 'butt'),
- l.setAttribute('stroke-linejoin', 'round'),
- l.setAttribute('stroke-miterlimit', '4'),
- (this.textSpans[e].span = l),
- o)
- ) {
- var E = createNS('g');
- l.appendChild(E), (this.textSpans[e].childSpan = E);
- }
- (this.textSpans[e].span = l),
- this.layerElement.appendChild(l);
- }
- l.style.display = 'inherit';
- }
- if (
- (c.reset(),
- S &&
- (a[e].n &&
- ((p = -y), (P += r.yOffset), (P += b ? 1 : 0), (b = !1)),
- this.applyTextPropertiesToMatrix(r, c, a[e].line, p, P),
- (p += a[e].l || 0),
- (p += y)),
- o)
- ) {
- d = this.globalData.fontManager.getCharData(
- r.finalText[e],
- i.fStyle,
- this.globalData.fontManager.getFontByName(r.f).fFamily
- );
- var T;
- if (d.t === 1)
- T = new SVGCompElement(d.data, this.globalData, this);
- else {
- var x = emptyShapeData;
- d.data &&
- d.data.shapes &&
- (x = this.buildShapeData(d.data, r.finalSize)),
- (T = new SVGShapeElement(x, this.globalData, this));
- }
- if (this.textSpans[e].glyph) {
- var _ = this.textSpans[e].glyph;
- this.textSpans[e].childSpan.removeChild(_.layerElement),
- _.destroy();
- }
- (this.textSpans[e].glyph = T),
- (T._debug = !0),
- T.prepareFrame(0),
- T.renderFrame(),
- this.textSpans[e].childSpan.appendChild(T.layerElement),
- d.t === 1 &&
- this.textSpans[e].childSpan.setAttribute(
- 'transform',
- 'scale(' +
- r.finalSize / 100 +
- ',' +
- r.finalSize / 100 +
- ')'
- );
- } else
- S &&
- l.setAttribute(
- 'transform',
- 'translate(' + c.props[12] + ',' + c.props[13] + ')'
- ),
- (l.textContent = a[e].val),
- l.setAttributeNS(
- 'http://www.w3.org/XML/1998/namespace',
- 'xml:space',
- 'preserve'
- );
- }
- S && l && l.setAttribute('d', g);
- }
- for (; e < this.textSpans.length; )
- (this.textSpans[e].span.style.display = 'none'), (e += 1);
- this._sizeChanged = !0;
- }),
- (SVGTextLottieElement.prototype.sourceRectAtTime = function () {
- if (
- (this.prepareFrame(this.comp.renderedFrame - this.data.st),
- this.renderInnerContent(),
- this._sizeChanged)
- ) {
- this._sizeChanged = !1;
- var e = this.layerElement.getBBox();
- this.bbox = {
- top: e.y,
- left: e.x,
- width: e.width,
- height: e.height
- };
- }
- return this.bbox;
- }),
- (SVGTextLottieElement.prototype.getValue = function () {
- var e,
- t = this.textSpans.length,
- r;
- for (
- this.renderedFrame = this.comp.renderedFrame, e = 0;
- e < t;
- e += 1
- )
- (r = this.textSpans[e].glyph),
- r &&
- (r.prepareFrame(this.comp.renderedFrame - this.data.st),
- r._mdf && (this._mdf = !0));
- }),
- (SVGTextLottieElement.prototype.renderInnerContent = function () {
- if (
- (!this.data.singleShape || this._mdf) &&
- (this.textAnimator.getMeasures(
- this.textProperty.currentData,
- this.lettersChangedFlag
- ),
- this.lettersChangedFlag || this.textAnimator.lettersChangedFlag)
- ) {
- this._sizeChanged = !0;
- var e,
- t,
- r = this.textAnimator.renderedLetters,
- i = this.textProperty.currentData.l;
- t = i.length;
- var s, n, a;
- for (e = 0; e < t; e += 1)
- i[e].n ||
- ((s = r[e]),
- (n = this.textSpans[e].span),
- (a = this.textSpans[e].glyph),
- a && a.renderFrame(),
- s._mdf.m && n.setAttribute('transform', s.m),
- s._mdf.o && n.setAttribute('opacity', s.o),
- s._mdf.sw && n.setAttribute('stroke-width', s.sw),
- s._mdf.sc && n.setAttribute('stroke', s.sc),
- s._mdf.fc && n.setAttribute('fill', s.fc));
- }
- });
- function ISolidElement(e, t, r) {
- this.initElement(e, t, r);
- }
- extendPrototype([IImageElement], ISolidElement),
- (ISolidElement.prototype.createContent = function () {
- var e = createNS('rect');
- e.setAttribute('width', this.data.sw),
- e.setAttribute('height', this.data.sh),
- e.setAttribute('fill', this.data.sc),
- this.layerElement.appendChild(e);
- });
- function NullElement(e, t, r) {
- this.initFrame(),
- this.initBaseData(e, t, r),
- this.initFrame(),
- this.initTransform(e, t, r),
- this.initHierarchy();
- }
- (NullElement.prototype.prepareFrame = function (e) {
- this.prepareProperties(e, !0);
- }),
- (NullElement.prototype.renderFrame = function () {}),
- (NullElement.prototype.getBaseElement = function () {
- return null;
- }),
- (NullElement.prototype.destroy = function () {}),
- (NullElement.prototype.sourceRectAtTime = function () {}),
- (NullElement.prototype.hide = function () {}),
- extendPrototype(
- [BaseElement, TransformElement, HierarchyElement, FrameElement],
- NullElement
- );
- function SVGRendererBase() {}
- extendPrototype([BaseRenderer], SVGRendererBase),
- (SVGRendererBase.prototype.createNull = function (e) {
- return new NullElement(e, this.globalData, this);
- }),
- (SVGRendererBase.prototype.createShape = function (e) {
- return new SVGShapeElement(e, this.globalData, this);
- }),
- (SVGRendererBase.prototype.createText = function (e) {
- return new SVGTextLottieElement(e, this.globalData, this);
- }),
- (SVGRendererBase.prototype.createImage = function (e) {
- return new IImageElement(e, this.globalData, this);
- }),
- (SVGRendererBase.prototype.createSolid = function (e) {
- return new ISolidElement(e, this.globalData, this);
- }),
- (SVGRendererBase.prototype.configAnimation = function (e) {
- this.svgElement.setAttribute('xmlns', 'http://www.w3.org/2000/svg'),
- this.svgElement.setAttribute(
- 'xmlns:xlink',
- 'http://www.w3.org/1999/xlink'
- ),
- this.renderConfig.viewBoxSize
- ? this.svgElement.setAttribute(
- 'viewBox',
- this.renderConfig.viewBoxSize
- )
- : this.svgElement.setAttribute(
- 'viewBox',
- '0 0 ' + e.w + ' ' + e.h
- ),
- this.renderConfig.viewBoxOnly ||
- (this.svgElement.setAttribute('width', e.w),
- this.svgElement.setAttribute('height', e.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),
- this.renderConfig.focusable !== void 0 &&
- this.svgElement.setAttribute(
- 'focusable',
- this.renderConfig.focusable
- ),
- this.svgElement.setAttribute(
- 'preserveAspectRatio',
- this.renderConfig.preserveAspectRatio
- ),
- this.animationItem.wrapper.appendChild(this.svgElement);
- var t = this.globalData.defs;
- this.setupGlobalData(e, t),
- (this.globalData.progressiveLoad =
- this.renderConfig.progressiveLoad),
- (this.data = e);
- var r = createNS('clipPath'),
- i = createNS('rect');
- i.setAttribute('width', e.w),
- i.setAttribute('height', e.h),
- i.setAttribute('x', 0),
- i.setAttribute('y', 0);
- var s = createElementID();
- r.setAttribute('id', s),
- r.appendChild(i),
- this.layerElement.setAttribute(
- 'clip-path',
- 'url(' + getLocationHref() + '#' + s + ')'
- ),
- t.appendChild(r),
- (this.layers = e.layers),
- (this.elements = createSizedArray(e.layers.length));
- }),
- (SVGRendererBase.prototype.destroy = function () {
- this.animationItem.wrapper &&
- (this.animationItem.wrapper.innerText = ''),
- (this.layerElement = null),
- (this.globalData.defs = null);
- var e,
- t = this.layers ? this.layers.length : 0;
- for (e = 0; e < t; e += 1)
- this.elements[e] &&
- this.elements[e].destroy &&
- this.elements[e].destroy();
- (this.elements.length = 0),
- (this.destroyed = !0),
- (this.animationItem = null);
- }),
- (SVGRendererBase.prototype.updateContainerSize = function () {}),
- (SVGRendererBase.prototype.findIndexByInd = function (e) {
- var t = 0,
- r = this.layers.length;
- for (t = 0; t < r; t += 1) if (this.layers[t].ind === e) return t;
- return -1;
- }),
- (SVGRendererBase.prototype.buildItem = function (e) {
- var t = this.elements;
- if (!(t[e] || this.layers[e].ty === 99)) {
- t[e] = !0;
- var r = this.createItem(this.layers[e]);
- if (
- ((t[e] = r),
- getExpressionsPlugin() &&
- (this.layers[e].ty === 0 &&
- this.globalData.projectInterface.registerComposition(r),
- r.initExpressions()),
- this.appendElementInPos(r, e),
- this.layers[e].tt)
- ) {
- var i =
- 'tp' in this.layers[e]
- ? this.findIndexByInd(this.layers[e].tp)
- : e - 1;
- if (i === -1) return;
- if (!this.elements[i] || this.elements[i] === !0)
- this.buildItem(i), this.addPendingElement(r);
- else {
- var s = t[i],
- n = s.getMatte(this.layers[e].tt);
- r.setMatte(n);
- }
- }
- }
- }),
- (SVGRendererBase.prototype.checkPendingElements = function () {
- for (; this.pendingElements.length; ) {
- var e = this.pendingElements.pop();
- if ((e.checkParenting(), e.data.tt))
- for (var t = 0, r = this.elements.length; t < r; ) {
- if (this.elements[t] === e) {
- var i =
- 'tp' in e.data ? this.findIndexByInd(e.data.tp) : t - 1,
- s = this.elements[i],
- n = s.getMatte(this.layers[t].tt);
- e.setMatte(n);
- break;
- }
- t += 1;
- }
- }
- }),
- (SVGRendererBase.prototype.renderFrame = function (e) {
- if (!(this.renderedFrame === e || this.destroyed)) {
- e === null ? (e = this.renderedFrame) : (this.renderedFrame = e),
- (this.globalData.frameNum = e),
- (this.globalData.frameId += 1),
- (this.globalData.projectInterface.currentFrame = e),
- (this.globalData._mdf = !1);
- var t,
- r = this.layers.length;
- for (
- this.completeLayers || this.checkLayers(e), t = r - 1;
- t >= 0;
- t -= 1
- )
- (this.completeLayers || this.elements[t]) &&
- this.elements[t].prepareFrame(e - this.layers[t].st);
- if (this.globalData._mdf)
- for (t = 0; t < r; t += 1)
- (this.completeLayers || this.elements[t]) &&
- this.elements[t].renderFrame();
- }
- }),
- (SVGRendererBase.prototype.appendElementInPos = function (e, t) {
- var r = e.getBaseElement();
- if (r) {
- for (var i = 0, s; i < t; )
- this.elements[i] &&
- this.elements[i] !== !0 &&
- this.elements[i].getBaseElement() &&
- (s = this.elements[i].getBaseElement()),
- (i += 1);
- s
- ? this.layerElement.insertBefore(r, s)
- : this.layerElement.appendChild(r);
- }
- }),
- (SVGRendererBase.prototype.hide = function () {
- this.layerElement.style.display = 'none';
- }),
- (SVGRendererBase.prototype.show = function () {
- this.layerElement.style.display = 'block';
- });
- function ICompElement() {}
- extendPrototype(
- [
- BaseElement,
- TransformElement,
- HierarchyElement,
- FrameElement,
- RenderableDOMElement
- ],
- ICompElement
- ),
- (ICompElement.prototype.initElement = function (e, t, r) {
- this.initFrame(),
- this.initBaseData(e, t, r),
- this.initTransform(e, t, r),
- this.initRenderable(),
- this.initHierarchy(),
- this.initRendererElement(),
- this.createContainerElements(),
- this.createRenderableComponents(),
- (this.data.xt || !t.progressiveLoad) && this.buildAllItems(),
- this.hide();
- }),
- (ICompElement.prototype.prepareFrame = function (e) {
- if (
- ((this._mdf = !1),
- this.prepareRenderableFrame(e),
- this.prepareProperties(e, this.isInRange),
- !(!this.isInRange && !this.data.xt))
- ) {
- if (this.tm._placeholder) this.renderedFrame = e / this.data.sr;
- else {
- var t = this.tm.v;
- t === this.data.op && (t = this.data.op - 1),
- (this.renderedFrame = t);
- }
- var r,
- i = this.elements.length;
- 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));
- }
- }),
- (ICompElement.prototype.renderInnerContent = function () {
- var e,
- t = this.layers.length;
- for (e = 0; e < t; e += 1)
- (this.completeLayers || this.elements[e]) &&
- this.elements[e].renderFrame();
- }),
- (ICompElement.prototype.setElements = function (e) {
- this.elements = e;
- }),
- (ICompElement.prototype.getElements = function () {
- return this.elements;
- }),
- (ICompElement.prototype.destroyElements = function () {
- var e,
- t = this.layers.length;
- for (e = 0; e < t; e += 1)
- this.elements[e] && this.elements[e].destroy();
- }),
- (ICompElement.prototype.destroy = function () {
- this.destroyElements(), this.destroyBaseElement();
- });
- function SVGCompElement(e, t, r) {
- (this.layers = e.layers),
- (this.supports3d = !0),
- (this.completeLayers = !1),
- (this.pendingElements = []),
- (this.elements = this.layers
- ? createSizedArray(this.layers.length)
- : []),
- this.initElement(e, t, r),
- (this.tm = e.tm
- ? PropertyFactory.getProp(this, e.tm, 0, t.frameRate, this)
- : { _placeholder: !0 });
- }
- extendPrototype(
- [SVGRendererBase, ICompElement, SVGBaseElement],
- SVGCompElement
- ),
- (SVGCompElement.prototype.createComp = function (e) {
- return new SVGCompElement(e, this.globalData, this);
- });
- function SVGRenderer(e, t) {
- (this.animationItem = e),
- (this.layers = null),
- (this.renderedFrame = -1),
- (this.svgElement = createNS('svg'));
- var r = '';
- if (t && t.title) {
- var i = createNS('title'),
- s = createElementID();
- i.setAttribute('id', s),
- (i.textContent = t.title),
- this.svgElement.appendChild(i),
- (r += s);
- }
- if (t && t.description) {
- var n = createNS('desc'),
- a = createElementID();
- n.setAttribute('id', a),
- (n.textContent = t.description),
- this.svgElement.appendChild(n),
- (r += ' ' + a);
- }
- r && this.svgElement.setAttribute('aria-labelledby', r);
- var o = createNS('defs');
- this.svgElement.appendChild(o);
- var l = createNS('g');
- this.svgElement.appendChild(l),
- (this.layerElement = l),
- (this.renderConfig = {
- preserveAspectRatio:
- (t && t.preserveAspectRatio) || 'xMidYMid meet',
- imagePreserveAspectRatio:
- (t && t.imagePreserveAspectRatio) || 'xMidYMid slice',
- contentVisibility: (t && t.contentVisibility) || 'visible',
- progressiveLoad: (t && t.progressiveLoad) || !1,
- hideOnTransparent: !(t && t.hideOnTransparent === !1),
- viewBoxOnly: (t && t.viewBoxOnly) || !1,
- viewBoxSize: (t && t.viewBoxSize) || !1,
- className: (t && t.className) || '',
- id: (t && t.id) || '',
- focusable: t && t.focusable,
- filterSize: {
- width: (t && t.filterSize && t.filterSize.width) || '100%',
- height: (t && t.filterSize && t.filterSize.height) || '100%',
- x: (t && t.filterSize && t.filterSize.x) || '0%',
- y: (t && t.filterSize && t.filterSize.y) || '0%'
- },
- width: t && t.width,
- height: t && t.height,
- runExpressions:
- !t || t.runExpressions === void 0 || t.runExpressions
- }),
- (this.globalData = {
- _mdf: !1,
- frameNum: -1,
- defs: o,
- renderConfig: this.renderConfig
- }),
- (this.elements = []),
- (this.pendingElements = []),
- (this.destroyed = !1),
- (this.rendererType = 'svg');
- }
- extendPrototype([SVGRendererBase], SVGRenderer),
- (SVGRenderer.prototype.createComp = function (e) {
- return new SVGCompElement(e, this.globalData, this);
- });
- function CVContextData() {
- (this.saved = []),
- (this.cArrPos = 0),
- (this.cTr = new Matrix()),
- (this.cO = 1);
- var e,
- t = 15;
- for (
- this.savedOp = createTypedArray('float32', t), e = 0;
- e < t;
- e += 1
- )
- this.saved[e] = createTypedArray('float32', 16);
- this._length = t;
- }
- (CVContextData.prototype.duplicate = function () {
- var e = this._length * 2,
- t = this.savedOp;
- (this.savedOp = createTypedArray('float32', e)), this.savedOp.set(t);
- var r = 0;
- for (r = this._length; r < e; r += 1)
- this.saved[r] = createTypedArray('float32', 16);
- this._length = e;
- }),
- (CVContextData.prototype.reset = function () {
- (this.cArrPos = 0), this.cTr.reset(), (this.cO = 1);
- }),
- (CVContextData.prototype.popTransform = function () {
- var e = this.saved[this.cArrPos],
- t,
- r = this.cTr.props;
- for (t = 0; t < 16; t += 1) r[t] = e[t];
- return e;
- }),
- (CVContextData.prototype.popOpacity = function () {
- var e = this.savedOp[this.cArrPos];
- return (this.cO = e), e;
- }),
- (CVContextData.prototype.pop = function () {
- this.cArrPos -= 1;
- var e = this.popTransform(),
- t = this.popOpacity();
- return { transform: e, opacity: t };
- }),
- (CVContextData.prototype.push = function () {
- var e = this.cTr.props;
- this._length <= this.cArrPos && this.duplicate();
- var t,
- r = this.saved[this.cArrPos];
- for (t = 0; t < 16; t += 1) r[t] = e[t];
- (this.savedOp[this.cArrPos] = this.cO), (this.cArrPos += 1);
- }),
- (CVContextData.prototype.getTransform = function () {
- return this.cTr;
- }),
- (CVContextData.prototype.getOpacity = function () {
- return this.cO;
- }),
- (CVContextData.prototype.setOpacity = function (e) {
- this.cO = e;
- });
- function ShapeTransformManager() {
- (this.sequences = {}),
- (this.sequenceList = []),
- (this.transform_key_count = 0);
- }
- ShapeTransformManager.prototype = {
- addTransformSequence: function (t) {
- var r,
- i = t.length,
- s = '_';
- for (r = 0; r < i; r += 1) s += t[r].transform.key + '_';
- var n = this.sequences[s];
- return (
- n ||
- ((n = {
- transforms: [].concat(t),
- finalTransform: new Matrix(),
- _mdf: !1
- }),
- (this.sequences[s] = n),
- this.sequenceList.push(n)),
- n
- );
- },
- processSequence: function (t, r) {
- for (var i = 0, s = t.transforms.length, n = r; i < s && !r; ) {
- if (t.transforms[i].transform.mProps._mdf) {
- n = !0;
- break;
- }
- i += 1;
- }
- if (n) {
- var a;
- for (t.finalTransform.reset(), i = s - 1; i >= 0; i -= 1)
- (a = t.transforms[i].transform.mProps.v.props),
- t.finalTransform.transform(
- a[0],
- a[1],
- a[2],
- a[3],
- a[4],
- a[5],
- a[6],
- a[7],
- a[8],
- a[9],
- a[10],
- a[11],
- a[12],
- a[13],
- a[14],
- a[15]
- );
- }
- t._mdf = n;
- },
- processSequences: function (t) {
- var r,
- i = this.sequenceList.length;
- for (r = 0; r < i; r += 1)
- this.processSequence(this.sequenceList[r], t);
- },
- getNewKey: function () {
- return (
- (this.transform_key_count += 1), '_' + this.transform_key_count
- );
- }
- };
- var lumaLoader = function () {
- var t = '__lottie_element_luma_buffer',
- r = null,
- i = null,
- s = null;
- function n() {
- var l = createNS('svg'),
- c = createNS('filter'),
- g = createNS('feColorMatrix');
- return (
- c.setAttribute('id', t),
- g.setAttribute('type', 'matrix'),
- g.setAttribute('color-interpolation-filters', 'sRGB'),
- g.setAttribute(
- 'values',
- '0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0'
- ),
- c.appendChild(g),
- l.appendChild(c),
- l.setAttribute('id', t + '_svg'),
- featureSupport.svgLumaHidden && (l.style.display = 'none'),
- l
- );
- }
- function a() {
- r ||
- ((s = n()),
- document.body.appendChild(s),
- (r = createTag('canvas')),
- (i = r.getContext('2d')),
- (i.filter = 'url(#' + t + ')'),
- (i.fillStyle = 'rgba(0,0,0,0)'),
- i.fillRect(0, 0, 1, 1));
- }
- function o(l) {
- return (
- r || a(),
- (r.width = l.width),
- (r.height = l.height),
- (i.filter = 'url(#' + t + ')'),
- r
- );
- }
- return { load: a, get: o };
- };
- function createCanvas(e, t) {
- if (featureSupport.offscreenCanvas) return new OffscreenCanvas(e, t);
- var r = createTag('canvas');
- return (r.width = e), (r.height = t), r;
- }
- var assetLoader = (function () {
- return {
- loadLumaCanvas: lumaLoader.load,
- getLumaCanvas: lumaLoader.get,
- createCanvas
- };
- })();
- function CVEffects() {}
- CVEffects.prototype.renderFrame = function () {};
- function CVMaskElement(e, t) {
- (this.data = e),
- (this.element = t),
- (this.masksProperties = this.data.masksProperties || []),
- (this.viewData = createSizedArray(this.masksProperties.length));
- var r,
- i = this.masksProperties.length,
- s = !1;
- for (r = 0; r < i; r += 1)
- this.masksProperties[r].mode !== 'n' && (s = !0),
- (this.viewData[r] = ShapePropertyFactory.getShapeProp(
- this.element,
- this.masksProperties[r],
- 3
- ));
- (this.hasMasks = s), s && this.element.addRenderableComponent(this);
- }
- (CVMaskElement.prototype.renderFrame = function () {
- if (this.hasMasks) {
- var e = this.element.finalTransform.mat,
- t = this.element.canvasContext,
- r,
- i = this.masksProperties.length,
- s,
- n,
- a;
- for (t.beginPath(), r = 0; r < i; r += 1)
- if (this.masksProperties[r].mode !== 'n') {
- this.masksProperties[r].inv &&
- (t.moveTo(0, 0),
- t.lineTo(this.element.globalData.compSize.w, 0),
- t.lineTo(
- this.element.globalData.compSize.w,
- this.element.globalData.compSize.h
- ),
- t.lineTo(0, this.element.globalData.compSize.h),
- t.lineTo(0, 0)),
- (a = this.viewData[r].v),
- (s = e.applyToPointArray(a.v[0][0], a.v[0][1], 0)),
- t.moveTo(s[0], s[1]);
- var o,
- l = a._length;
- for (o = 1; o < l; o += 1)
- (n = e.applyToTriplePoints(a.o[o - 1], a.i[o], a.v[o])),
- t.bezierCurveTo(n[0], n[1], n[2], n[3], n[4], n[5]);
- (n = e.applyToTriplePoints(a.o[o - 1], a.i[0], a.v[0])),
- t.bezierCurveTo(n[0], n[1], n[2], n[3], n[4], n[5]);
- }
- this.element.globalData.renderer.save(!0), t.clip();
- }
- }),
- (CVMaskElement.prototype.getMaskProperty =
- MaskElement.prototype.getMaskProperty),
- (CVMaskElement.prototype.destroy = function () {
- this.element = null;
- });
- function CVBaseElement() {}
- var operationsMap = {
- 1: 'source-in',
- 2: 'source-out',
- 3: 'source-in',
- 4: 'source-out'
- };
- (CVBaseElement.prototype = {
- createElements: function () {},
- initRendererElement: function () {},
- createContainerElements: function () {
- if (this.data.tt >= 1) {
- this.buffers = [];
- var t = this.globalData.canvasContext,
- r = assetLoader.createCanvas(t.canvas.width, t.canvas.height);
- this.buffers.push(r);
- var i = assetLoader.createCanvas(t.canvas.width, t.canvas.height);
- this.buffers.push(i),
- this.data.tt >= 3 &&
- !document._isProxy &&
- assetLoader.loadLumaCanvas();
- }
- (this.canvasContext = this.globalData.canvasContext),
- (this.transformCanvas = this.globalData.transformCanvas),
- (this.renderableEffectsManager = new CVEffects());
- },
- createContent: function () {},
- setBlendMode: function () {
- var t = this.globalData;
- if (t.blendMode !== this.data.bm) {
- t.blendMode = this.data.bm;
- var r = getBlendMode(this.data.bm);
- t.canvasContext.globalCompositeOperation = r;
- }
- },
- createRenderableComponents: function () {
- this.maskManager = new CVMaskElement(this.data, this);
- },
- hideElement: function () {
- !this.hidden &&
- (!this.isInRange || this.isTransparent) &&
- (this.hidden = !0);
- },
- showElement: function () {
- this.isInRange &&
- !this.isTransparent &&
- ((this.hidden = !1),
- (this._isFirstFrame = !0),
- (this.maskManager._isFirstFrame = !0));
- },
- clearCanvas: function (t) {
- t.clearRect(
- this.transformCanvas.tx,
- this.transformCanvas.ty,
- this.transformCanvas.w * this.transformCanvas.sx,
- this.transformCanvas.h * this.transformCanvas.sy
- );
- },
- prepareLayer: function () {
- if (this.data.tt >= 1) {
- var t = this.buffers[0],
- r = t.getContext('2d');
- this.clearCanvas(r),
- r.drawImage(this.canvasContext.canvas, 0, 0),
- (this.currentTransform = this.canvasContext.getTransform()),
- this.canvasContext.setTransform(1, 0, 0, 1, 0, 0),
- this.clearCanvas(this.canvasContext),
- this.canvasContext.setTransform(this.currentTransform);
- }
- },
- exitLayer: function () {
- if (this.data.tt >= 1) {
- var t = this.buffers[1],
- r = t.getContext('2d');
- this.clearCanvas(r),
- r.drawImage(this.canvasContext.canvas, 0, 0),
- this.canvasContext.setTransform(1, 0, 0, 1, 0, 0),
- this.clearCanvas(this.canvasContext),
- this.canvasContext.setTransform(this.currentTransform);
- var i = this.comp.getElementById(
- 'tp' in this.data ? this.data.tp : this.data.ind - 1
- );
- if (
- (i.renderFrame(!0),
- this.canvasContext.setTransform(1, 0, 0, 1, 0, 0),
- this.data.tt >= 3 && !document._isProxy)
- ) {
- var s = assetLoader.getLumaCanvas(this.canvasContext.canvas),
- n = s.getContext('2d');
- n.drawImage(this.canvasContext.canvas, 0, 0),
- this.clearCanvas(this.canvasContext),
- this.canvasContext.drawImage(s, 0, 0);
- }
- (this.canvasContext.globalCompositeOperation =
- operationsMap[this.data.tt]),
- this.canvasContext.drawImage(t, 0, 0),
- (this.canvasContext.globalCompositeOperation =
- 'destination-over'),
- this.canvasContext.drawImage(this.buffers[0], 0, 0),
- this.canvasContext.setTransform(this.currentTransform),
- (this.canvasContext.globalCompositeOperation = 'source-over');
- }
- },
- renderFrame: function (t) {
- if (!(this.hidden || this.data.hd) && !(this.data.td === 1 && !t)) {
- this.renderTransform(),
- this.renderRenderable(),
- this.setBlendMode();
- var r = this.data.ty === 0;
- this.prepareLayer(),
- this.globalData.renderer.save(r),
- this.globalData.renderer.ctxTransform(
- this.finalTransform.mat.props
- ),
- this.globalData.renderer.ctxOpacity(
- this.finalTransform.mProp.o.v
- ),
- this.renderInnerContent(),
- this.globalData.renderer.restore(r),
- this.exitLayer(),
- this.maskManager.hasMasks && this.globalData.renderer.restore(!0),
- this._isFirstFrame && (this._isFirstFrame = !1);
- }
- },
- destroy: function () {
- (this.canvasContext = null),
- (this.data = null),
- (this.globalData = null),
- this.maskManager.destroy();
- },
- mHelper: new Matrix()
- }),
- (CVBaseElement.prototype.hide = CVBaseElement.prototype.hideElement),
- (CVBaseElement.prototype.show = CVBaseElement.prototype.showElement);
- function CVShapeData(e, t, r, i) {
- (this.styledShapes = []), (this.tr = [0, 0, 0, 0, 0, 0]);
- var s = 4;
- t.ty === 'rc'
- ? (s = 5)
- : t.ty === 'el'
- ? (s = 6)
- : t.ty === 'sr' && (s = 7),
- (this.sh = ShapePropertyFactory.getShapeProp(e, t, s, e));
- var n,
- a = r.length,
- o;
- for (n = 0; n < a; n += 1)
- r[n].closed ||
- ((o = {
- transforms: i.addTransformSequence(r[n].transforms),
- trNodes: []
- }),
- this.styledShapes.push(o),
- r[n].elements.push(o));
- }
- CVShapeData.prototype.setAsAnimated =
- SVGShapeData.prototype.setAsAnimated;
- function CVShapeElement(e, t, r) {
- (this.shapes = []),
- (this.shapesData = e.shapes),
- (this.stylesList = []),
- (this.itemsData = []),
- (this.prevViewData = []),
- (this.shapeModifiers = []),
- (this.processedElements = []),
- (this.transformsManager = new ShapeTransformManager()),
- this.initElement(e, t, r);
- }
- extendPrototype(
- [
- BaseElement,
- TransformElement,
- CVBaseElement,
- IShapeElement,
- HierarchyElement,
- FrameElement,
- RenderableElement
- ],
- CVShapeElement
- ),
- (CVShapeElement.prototype.initElement =
- RenderableDOMElement.prototype.initElement),
- (CVShapeElement.prototype.transformHelper = { opacity: 1, _opMdf: !1 }),
- (CVShapeElement.prototype.dashResetter = []),
- (CVShapeElement.prototype.createContent = function () {
- this.searchShapes(
- this.shapesData,
- this.itemsData,
- this.prevViewData,
- !0,
- []
- );
- }),
- (CVShapeElement.prototype.createStyleElement = function (e, t) {
- var r = {
- data: e,
- type: e.ty,
- preTransforms: this.transformsManager.addTransformSequence(t),
- transforms: [],
- elements: [],
- closed: e.hd === !0
- },
- i = {};
- if (
- (e.ty === 'fl' || e.ty === 'st'
- ? ((i.c = PropertyFactory.getProp(this, e.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]) +
- ')'))
- : (e.ty === 'gf' || e.ty === 'gs') &&
- ((i.s = PropertyFactory.getProp(this, e.s, 1, null, this)),
- (i.e = PropertyFactory.getProp(this, e.e, 1, null, this)),
- (i.h = PropertyFactory.getProp(
- this,
- e.h || { k: 0 },
- 0,
- 0.01,
- this
- )),
- (i.a = PropertyFactory.getProp(
- this,
- e.a || { k: 0 },
- 0,
- degToRads,
- this
- )),
- (i.g = new GradientProperty(this, e.g, this))),
- (i.o = PropertyFactory.getProp(this, e.o, 0, 0.01, this)),
- e.ty === 'st' || e.ty === 'gs')
- ) {
- if (
- ((r.lc = lineCapEnum[e.lc || 2]),
- (r.lj = lineJoinEnum[e.lj || 2]),
- e.lj == 1 && (r.ml = e.ml),
- (i.w = PropertyFactory.getProp(this, e.w, 0, null, this)),
- i.w.k || (r.wi = i.w.v),
- e.d)
- ) {
- var s = new DashProperty(this, e.d, 'canvas', this);
- (i.d = s),
- i.d.k || ((r.da = i.d.dashArray), (r.do = i.d.dashoffset[0]));
- }
- } else r.r = e.r === 2 ? 'evenodd' : 'nonzero';
- return this.stylesList.push(r), (i.style = r), i;
- }),
- (CVShapeElement.prototype.createGroupElement = function () {
- var e = { it: [], prevViewData: [] };
- return e;
- }),
- (CVShapeElement.prototype.createTransformElement = function (e) {
- var t = {
- transform: {
- opacity: 1,
- _opMdf: !1,
- key: this.transformsManager.getNewKey(),
- op: PropertyFactory.getProp(this, e.o, 0, 0.01, this),
- mProps: TransformPropertyFactory.getTransformProperty(
- this,
- e,
- this
- )
- }
- };
- return t;
- }),
- (CVShapeElement.prototype.createShapeElement = function (e) {
- var t = new CVShapeData(
- this,
- e,
- this.stylesList,
- this.transformsManager
- );
- return this.shapes.push(t), this.addShapeToModifiers(t), t;
- }),
- (CVShapeElement.prototype.reloadShapes = function () {
- this._isFirstFrame = !0;
- var e,
- t = this.itemsData.length;
- for (e = 0; e < t; e += 1) this.prevViewData[e] = this.itemsData[e];
- for (
- this.searchShapes(
- this.shapesData,
- this.itemsData,
- this.prevViewData,
- !0,
- []
- ),
- t = this.dynamicProperties.length,
- e = 0;
- e < t;
- e += 1
- )
- this.dynamicProperties[e].getValue();
- this.renderModifiers(),
- this.transformsManager.processSequences(this._isFirstFrame);
- }),
- (CVShapeElement.prototype.addTransformToStyleList = function (e) {
- var t,
- r = this.stylesList.length;
- for (t = 0; t < r; t += 1)
- this.stylesList[t].closed || this.stylesList[t].transforms.push(e);
- }),
- (CVShapeElement.prototype.removeTransformFromStyleList = function () {
- var e,
- t = this.stylesList.length;
- for (e = 0; e < t; e += 1)
- this.stylesList[e].closed || this.stylesList[e].transforms.pop();
- }),
- (CVShapeElement.prototype.closeStyles = function (e) {
- var t,
- r = e.length;
- for (t = 0; t < r; t += 1) e[t].closed = !0;
- }),
- (CVShapeElement.prototype.searchShapes = function (e, t, r, i, s) {
- var n,
- a = e.length - 1,
- o,
- l,
- c = [],
- g = [],
- S,
- p,
- P,
- b = [].concat(s);
- for (n = a; n >= 0; n -= 1) {
- if (
- ((S = this.searchProcessedElement(e[n])),
- S ? (t[n] = r[S - 1]) : (e[n]._shouldRender = i),
- e[n].ty === 'fl' ||
- e[n].ty === 'st' ||
- e[n].ty === 'gf' ||
- e[n].ty === 'gs')
- )
- S
- ? (t[n].style.closed = !1)
- : (t[n] = this.createStyleElement(e[n], b)),
- c.push(t[n].style);
- else if (e[n].ty === 'gr') {
- if (!S) t[n] = this.createGroupElement(e[n]);
- else
- for (l = t[n].it.length, o = 0; o < l; o += 1)
- t[n].prevViewData[o] = t[n].it[o];
- this.searchShapes(e[n].it, t[n].it, t[n].prevViewData, i, b);
- } else
- e[n].ty === 'tr'
- ? (S || ((P = this.createTransformElement(e[n])), (t[n] = P)),
- b.push(t[n]),
- this.addTransformToStyleList(t[n]))
- : e[n].ty === 'sh' ||
- e[n].ty === 'rc' ||
- e[n].ty === 'el' ||
- e[n].ty === 'sr'
- ? S || (t[n] = this.createShapeElement(e[n]))
- : e[n].ty === 'tm' ||
- e[n].ty === 'rd' ||
- e[n].ty === 'pb' ||
- e[n].ty === 'zz' ||
- e[n].ty === 'op'
- ? (S
- ? ((p = t[n]), (p.closed = !1))
- : ((p = ShapeModifiers.getModifier(e[n].ty)),
- p.init(this, e[n]),
- (t[n] = p),
- this.shapeModifiers.push(p)),
- g.push(p))
- : e[n].ty === 'rp' &&
- (S
- ? ((p = t[n]), (p.closed = !0))
- : ((p = ShapeModifiers.getModifier(e[n].ty)),
- (t[n] = p),
- p.init(this, e, n, t),
- this.shapeModifiers.push(p),
- (i = !1)),
- g.push(p));
- this.addProcessedElement(e[n], n + 1);
- }
- for (
- this.removeTransformFromStyleList(),
- this.closeStyles(c),
- a = g.length,
- n = 0;
- n < a;
- n += 1
- )
- g[n].closed = !0;
- }),
- (CVShapeElement.prototype.renderInnerContent = function () {
- (this.transformHelper.opacity = 1),
- (this.transformHelper._opMdf = !1),
- this.renderModifiers(),
- this.transformsManager.processSequences(this._isFirstFrame),
- this.renderShape(
- this.transformHelper,
- this.shapesData,
- this.itemsData,
- !0
- );
- }),
- (CVShapeElement.prototype.renderShapeTransform = function (e, t) {
- (e._opMdf || t.op._mdf || this._isFirstFrame) &&
- ((t.opacity = e.opacity), (t.opacity *= t.op.v), (t._opMdf = !0));
- }),
- (CVShapeElement.prototype.drawLayer = function () {
- var e,
- t = this.stylesList.length,
- r,
- i,
- s,
- n,
- a,
- o,
- l = this.globalData.renderer,
- c = this.globalData.canvasContext,
- g,
- S;
- for (e = 0; e < t; e += 1)
- if (
- ((S = this.stylesList[e]),
- (g = S.type),
- !(
- ((g === 'st' || g === 'gs') && S.wi === 0) ||
- !S.data._shouldRender ||
- S.coOp === 0 ||
- this.globalData.currentGlobalAlpha === 0
- ))
- ) {
- for (
- l.save(),
- a = S.elements,
- g === 'st' || g === 'gs'
- ? ((c.strokeStyle = g === 'st' ? S.co : S.grd),
- (c.lineWidth = S.wi),
- (c.lineCap = S.lc),
- (c.lineJoin = S.lj),
- (c.miterLimit = S.ml || 0))
- : (c.fillStyle = g === 'fl' ? S.co : S.grd),
- l.ctxOpacity(S.coOp),
- g !== 'st' && g !== 'gs' && c.beginPath(),
- l.ctxTransform(S.preTransforms.finalTransform.props),
- i = a.length,
- r = 0;
- r < i;
- r += 1
- ) {
- for (
- (g === 'st' || g === 'gs') &&
- (c.beginPath(),
- S.da && (c.setLineDash(S.da), (c.lineDashOffset = S.do))),
- o = a[r].trNodes,
- n = o.length,
- s = 0;
- s < n;
- s += 1
- )
- o[s].t === 'm'
- ? c.moveTo(o[s].p[0], o[s].p[1])
- : o[s].t === 'c'
- ? c.bezierCurveTo(
- o[s].pts[0],
- o[s].pts[1],
- o[s].pts[2],
- o[s].pts[3],
- o[s].pts[4],
- o[s].pts[5]
- )
- : c.closePath();
- (g === 'st' || g === 'gs') &&
- (c.stroke(), S.da && c.setLineDash(this.dashResetter));
- }
- g !== 'st' && g !== 'gs' && c.fill(S.r), l.restore();
- }
- }),
- (CVShapeElement.prototype.renderShape = function (e, t, r, i) {
- var s,
- n = t.length - 1,
- a;
- for (a = e, s = n; s >= 0; s -= 1)
- t[s].ty === 'tr'
- ? ((a = r[s].transform), this.renderShapeTransform(e, a))
- : t[s].ty === 'sh' ||
- t[s].ty === 'el' ||
- t[s].ty === 'rc' ||
- t[s].ty === 'sr'
- ? this.renderPath(t[s], r[s])
- : t[s].ty === 'fl'
- ? this.renderFill(t[s], r[s], a)
- : t[s].ty === 'st'
- ? this.renderStroke(t[s], r[s], a)
- : t[s].ty === 'gf' || t[s].ty === 'gs'
- ? this.renderGradientFill(t[s], r[s], a)
- : t[s].ty === 'gr'
- ? this.renderShape(a, t[s].it, r[s].it)
- : t[s].ty;
- i && this.drawLayer();
- }),
- (CVShapeElement.prototype.renderStyledShape = function (e, t) {
- if (this._isFirstFrame || t._mdf || e.transforms._mdf) {
- var r = e.trNodes,
- i = t.paths,
- s,
- n,
- a,
- o = i._length;
- r.length = 0;
- var l = e.transforms.finalTransform;
- for (a = 0; a < o; a += 1) {
- var c = i.shapes[a];
- if (c && c.v) {
- for (n = c._length, s = 1; s < n; s += 1)
- s === 1 &&
- r.push({
- t: 'm',
- p: l.applyToPointArray(c.v[0][0], c.v[0][1], 0)
- }),
- r.push({
- t: 'c',
- pts: l.applyToTriplePoints(c.o[s - 1], c.i[s], c.v[s])
- });
- n === 1 &&
- r.push({
- t: 'm',
- p: l.applyToPointArray(c.v[0][0], c.v[0][1], 0)
- }),
- c.c &&
- n &&
- (r.push({
- t: 'c',
- pts: l.applyToTriplePoints(c.o[s - 1], c.i[0], c.v[0])
- }),
- r.push({ t: 'z' }));
- }
- }
- e.trNodes = r;
- }
- }),
- (CVShapeElement.prototype.renderPath = function (e, t) {
- if (e.hd !== !0 && e._shouldRender) {
- var r,
- i = t.styledShapes.length;
- for (r = 0; r < i; r += 1)
- this.renderStyledShape(t.styledShapes[r], t.sh);
- }
- }),
- (CVShapeElement.prototype.renderFill = function (e, t, r) {
- var i = t.style;
- (t.c._mdf || this._isFirstFrame) &&
- (i.co =
- 'rgb(' +
- bmFloor(t.c.v[0]) +
- ',' +
- bmFloor(t.c.v[1]) +
- ',' +
- bmFloor(t.c.v[2]) +
- ')'),
- (t.o._mdf || r._opMdf || this._isFirstFrame) &&
- (i.coOp = t.o.v * r.opacity);
- }),
- (CVShapeElement.prototype.renderGradientFill = function (e, t, r) {
- var i = t.style,
- s;
- if (
- !i.grd ||
- t.g._mdf ||
- t.s._mdf ||
- t.e._mdf ||
- (e.t !== 1 && (t.h._mdf || t.a._mdf))
- ) {
- var n = this.globalData.canvasContext,
- a = t.s.v,
- o = t.e.v;
- if (e.t === 1) s = n.createLinearGradient(a[0], a[1], o[0], o[1]);
- else {
- var l = Math.sqrt(
- Math.pow(a[0] - o[0], 2) + Math.pow(a[1] - o[1], 2)
- ),
- c = Math.atan2(o[1] - a[1], o[0] - a[0]),
- g = t.h.v;
- g >= 1 ? (g = 0.99) : g <= -1 && (g = -0.99);
- var S = l * g,
- p = Math.cos(c + t.a.v) * S + a[0],
- P = Math.sin(c + t.a.v) * S + a[1];
- s = n.createRadialGradient(p, P, 0, a[0], a[1], l);
- }
- var b,
- y = e.g.p,
- A = t.g.c,
- u = 1;
- for (b = 0; b < y; b += 1)
- t.g._hasOpacity && t.g._collapsable && (u = t.g.o[b * 2 + 1]),
- s.addColorStop(
- A[b * 4] / 100,
- 'rgba(' +
- A[b * 4 + 1] +
- ',' +
- A[b * 4 + 2] +
- ',' +
- A[b * 4 + 3] +
- ',' +
- u +
- ')'
- );
- i.grd = s;
- }
- i.coOp = t.o.v * r.opacity;
- }),
- (CVShapeElement.prototype.renderStroke = function (e, t, r) {
- var i = t.style,
- s = t.d;
- s &&
- (s._mdf || this._isFirstFrame) &&
- ((i.da = s.dashArray), (i.do = s.dashoffset[0])),
- (t.c._mdf || this._isFirstFrame) &&
- (i.co =
- 'rgb(' +
- bmFloor(t.c.v[0]) +
- ',' +
- bmFloor(t.c.v[1]) +
- ',' +
- bmFloor(t.c.v[2]) +
- ')'),
- (t.o._mdf || r._opMdf || this._isFirstFrame) &&
- (i.coOp = t.o.v * r.opacity),
- (t.w._mdf || this._isFirstFrame) && (i.wi = t.w.v);
- }),
- (CVShapeElement.prototype.destroy = function () {
- (this.shapesData = null),
- (this.globalData = null),
- (this.canvasContext = null),
- (this.stylesList.length = 0),
- (this.itemsData.length = 0);
- });
- function CVTextElement(e, t, r) {
- (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 = {
- fill: 'rgba(0,0,0,0)',
- stroke: 'rgba(0,0,0,0)',
- sWidth: 0,
- fValue: ''
- }),
- this.initElement(e, t, r);
- }
- extendPrototype(
- [
- BaseElement,
- TransformElement,
- CVBaseElement,
- HierarchyElement,
- FrameElement,
- RenderableElement,
- ITextElement
- ],
- CVTextElement
- ),
- (CVTextElement.prototype.tHelper =
- createTag('canvas').getContext('2d')),
- (CVTextElement.prototype.buildNewText = function () {
- var e = this.textProperty.currentData;
- this.renderedLetters = createSizedArray(e.l ? e.l.length : 0);
- var t = !1;
- e.fc
- ? ((t = !0), (this.values.fill = this.buildColor(e.fc)))
- : (this.values.fill = 'rgba(0,0,0,0)'),
- (this.fill = t);
- var r = !1;
- e.sc &&
- ((r = !0),
- (this.values.stroke = this.buildColor(e.sc)),
- (this.values.sWidth = e.sw));
- var i = this.globalData.fontManager.getFontByName(e.f),
- s,
- n,
- a = e.l,
- o = this.mHelper;
- (this.stroke = r),
- (this.values.fValue =
- e.finalSize +
- 'px ' +
- this.globalData.fontManager.getFontByName(e.f).fFamily),
- (n = e.finalText.length);
- var l,
- c,
- g,
- S,
- p,
- P,
- b,
- y,
- A,
- u,
- f = this.data.singleShape,
- m = e.tr * 0.001 * e.finalSize,
- d = 0,
- E = 0,
- T = !0,
- x = 0;
- for (s = 0; s < n; s += 1) {
- (l = this.globalData.fontManager.getCharData(
- e.finalText[s],
- i.fStyle,
- this.globalData.fontManager.getFontByName(e.f).fFamily
- )),
- (c = (l && l.data) || {}),
- o.reset(),
- f &&
- a[s].n &&
- ((d = -m), (E += e.yOffset), (E += T ? 1 : 0), (T = !1)),
- (p = c.shapes ? c.shapes[0].it : []),
- (b = p.length),
- o.scale(e.finalSize / 100, e.finalSize / 100),
- f && this.applyTextPropertiesToMatrix(e, o, a[s].line, d, E),
- (A = createSizedArray(b - 1));
- var _ = 0;
- for (P = 0; P < b; P += 1)
- if (p[P].ty === 'sh') {
- for (
- S = p[P].ks.k.i.length, y = p[P].ks.k, u = [], g = 1;
- g < S;
- g += 1
- )
- g === 1 &&
- u.push(
- o.applyToX(y.v[0][0], y.v[0][1], 0),
- o.applyToY(y.v[0][0], y.v[0][1], 0)
- ),
- u.push(
- o.applyToX(y.o[g - 1][0], y.o[g - 1][1], 0),
- o.applyToY(y.o[g - 1][0], y.o[g - 1][1], 0),
- o.applyToX(y.i[g][0], y.i[g][1], 0),
- o.applyToY(y.i[g][0], y.i[g][1], 0),
- o.applyToX(y.v[g][0], y.v[g][1], 0),
- o.applyToY(y.v[g][0], y.v[g][1], 0)
- );
- u.push(
- o.applyToX(y.o[g - 1][0], y.o[g - 1][1], 0),
- o.applyToY(y.o[g - 1][0], y.o[g - 1][1], 0),
- o.applyToX(y.i[0][0], y.i[0][1], 0),
- o.applyToY(y.i[0][0], y.i[0][1], 0),
- o.applyToX(y.v[0][0], y.v[0][1], 0),
- o.applyToY(y.v[0][0], y.v[0][1], 0)
- ),
- (A[_] = u),
- (_ += 1);
- }
- f && ((d += a[s].l), (d += m)),
- this.textSpans[x]
- ? (this.textSpans[x].elem = A)
- : (this.textSpans[x] = { elem: A }),
- (x += 1);
- }
- }),
- (CVTextElement.prototype.renderInnerContent = function () {
- var e = this.canvasContext;
- (e.font = this.values.fValue),
- (e.lineCap = 'butt'),
- (e.lineJoin = 'miter'),
- (e.miterLimit = 4),
- this.data.singleShape ||
- this.textAnimator.getMeasures(
- this.textProperty.currentData,
- this.lettersChangedFlag
- );
- var t,
- r,
- i,
- s,
- n,
- a,
- o = this.textAnimator.renderedLetters,
- l = this.textProperty.currentData.l;
- r = l.length;
- var c,
- g = null,
- S = null,
- p = null,
- P,
- b;
- for (t = 0; t < r; t += 1)
- if (!l[t].n) {
- if (
- ((c = o[t]),
- c &&
- (this.globalData.renderer.save(),
- this.globalData.renderer.ctxTransform(c.p),
- this.globalData.renderer.ctxOpacity(c.o)),
- this.fill)
- ) {
- for (
- c && c.fc
- ? g !== c.fc && ((g = c.fc), (e.fillStyle = c.fc))
- : g !== this.values.fill &&
- ((g = this.values.fill),
- (e.fillStyle = this.values.fill)),
- P = this.textSpans[t].elem,
- s = P.length,
- this.globalData.canvasContext.beginPath(),
- i = 0;
- i < s;
- i += 1
- )
- for (
- b = P[i],
- a = b.length,
- this.globalData.canvasContext.moveTo(b[0], b[1]),
- n = 2;
- n < a;
- n += 6
- )
- this.globalData.canvasContext.bezierCurveTo(
- b[n],
- b[n + 1],
- b[n + 2],
- b[n + 3],
- b[n + 4],
- b[n + 5]
- );
- this.globalData.canvasContext.closePath(),
- this.globalData.canvasContext.fill();
- }
- if (this.stroke) {
- for (
- c && c.sw
- ? p !== c.sw && ((p = c.sw), (e.lineWidth = c.sw))
- : p !== this.values.sWidth &&
- ((p = this.values.sWidth),
- (e.lineWidth = this.values.sWidth)),
- c && c.sc
- ? S !== c.sc && ((S = c.sc), (e.strokeStyle = c.sc))
- : S !== this.values.stroke &&
- ((S = this.values.stroke),
- (e.strokeStyle = this.values.stroke)),
- P = this.textSpans[t].elem,
- s = P.length,
- this.globalData.canvasContext.beginPath(),
- i = 0;
- i < s;
- i += 1
- )
- for (
- b = P[i],
- a = b.length,
- this.globalData.canvasContext.moveTo(b[0], b[1]),
- n = 2;
- n < a;
- n += 6
- )
- this.globalData.canvasContext.bezierCurveTo(
- b[n],
- b[n + 1],
- b[n + 2],
- b[n + 3],
- b[n + 4],
- b[n + 5]
- );
- this.globalData.canvasContext.closePath(),
- this.globalData.canvasContext.stroke();
- }
- c && this.globalData.renderer.restore();
- }
- });
- function CVImageElement(e, t, r) {
- (this.assetData = t.getAssetData(e.refId)),
- (this.img = t.imageLoader.getAsset(this.assetData)),
- this.initElement(e, t, r);
- }
- extendPrototype(
- [
- BaseElement,
- TransformElement,
- CVBaseElement,
- HierarchyElement,
- FrameElement,
- RenderableElement
- ],
- CVImageElement
- ),
- (CVImageElement.prototype.initElement =
- SVGShapeElement.prototype.initElement),
- (CVImageElement.prototype.prepareFrame =
- IImageElement.prototype.prepareFrame),
- (CVImageElement.prototype.createContent = function () {
- if (
- this.img.width &&
- (this.assetData.w !== this.img.width ||
- this.assetData.h !== this.img.height)
- ) {
- var e = createTag('canvas');
- (e.width = this.assetData.w), (e.height = this.assetData.h);
- var t = e.getContext('2d'),
- r = this.img.width,
- i = this.img.height,
- s = r / i,
- n = this.assetData.w / this.assetData.h,
- a,
- o,
- l =
- this.assetData.pr ||
- this.globalData.renderConfig.imagePreserveAspectRatio;
- (s > n && l === 'xMidYMid slice') ||
- (s < n && l !== 'xMidYMid slice')
- ? ((o = i), (a = o * n))
- : ((a = r), (o = a / n)),
- t.drawImage(
- this.img,
- (r - a) / 2,
- (i - o) / 2,
- a,
- o,
- 0,
- 0,
- this.assetData.w,
- this.assetData.h
- ),
- (this.img = e);
- }
- }),
- (CVImageElement.prototype.renderInnerContent = function () {
- this.canvasContext.drawImage(this.img, 0, 0);
- }),
- (CVImageElement.prototype.destroy = function () {
- this.img = null;
- });
- function CVSolidElement(e, t, r) {
- this.initElement(e, t, r);
- }
- extendPrototype(
- [
- BaseElement,
- TransformElement,
- CVBaseElement,
- HierarchyElement,
- FrameElement,
- RenderableElement
- ],
- CVSolidElement
- ),
- (CVSolidElement.prototype.initElement =
- SVGShapeElement.prototype.initElement),
- (CVSolidElement.prototype.prepareFrame =
- IImageElement.prototype.prepareFrame),
- (CVSolidElement.prototype.renderInnerContent = function () {
- var e = this.canvasContext;
- (e.fillStyle = this.data.sc),
- e.fillRect(0, 0, this.data.sw, this.data.sh);
- });
- function CanvasRendererBase(e, t) {
- (this.animationItem = e),
- (this.renderConfig = {
- clearCanvas: t && t.clearCanvas !== void 0 ? t.clearCanvas : !0,
- context: (t && t.context) || null,
- progressiveLoad: (t && t.progressiveLoad) || !1,
- preserveAspectRatio:
- (t && t.preserveAspectRatio) || 'xMidYMid meet',
- imagePreserveAspectRatio:
- (t && t.imagePreserveAspectRatio) || 'xMidYMid slice',
- contentVisibility: (t && t.contentVisibility) || 'visible',
- className: (t && t.className) || '',
- id: (t && t.id) || ''
- }),
- (this.renderConfig.dpr = (t && t.dpr) || 1),
- this.animationItem.wrapper &&
- (this.renderConfig.dpr =
- (t && t.dpr) || window.devicePixelRatio || 1),
- (this.renderedFrame = -1),
- (this.globalData = {
- frameNum: -1,
- _mdf: !1,
- renderConfig: this.renderConfig,
- currentGlobalAlpha: -1
- }),
- (this.contextData = new CVContextData()),
- (this.elements = []),
- (this.pendingElements = []),
- (this.transformMat = new Matrix()),
- (this.completeLayers = !1),
- (this.rendererType = 'canvas');
- }
- extendPrototype([BaseRenderer], CanvasRendererBase),
- (CanvasRendererBase.prototype.createShape = function (e) {
- return new CVShapeElement(e, this.globalData, this);
- }),
- (CanvasRendererBase.prototype.createText = function (e) {
- return new CVTextElement(e, this.globalData, this);
- }),
- (CanvasRendererBase.prototype.createImage = function (e) {
- return new CVImageElement(e, this.globalData, this);
- }),
- (CanvasRendererBase.prototype.createSolid = function (e) {
- return new CVSolidElement(e, this.globalData, this);
- }),
- (CanvasRendererBase.prototype.createNull =
- SVGRenderer.prototype.createNull),
- (CanvasRendererBase.prototype.ctxTransform = function (e) {
- if (
- !(
- e[0] === 1 &&
- e[1] === 0 &&
- e[4] === 0 &&
- e[5] === 1 &&
- e[12] === 0 &&
- e[13] === 0
- )
- ) {
- if (!this.renderConfig.clearCanvas) {
- this.canvasContext.transform(
- e[0],
- e[1],
- e[4],
- e[5],
- e[12],
- e[13]
- );
- return;
- }
- this.transformMat.cloneFromProps(e);
- var t = this.contextData.getTransform(),
- r = t.props;
- this.transformMat.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]
- ),
- t.cloneFromProps(this.transformMat.props);
- var i = t.props;
- this.canvasContext.setTransform(
- i[0],
- i[1],
- i[4],
- i[5],
- i[12],
- i[13]
- );
- }
- }),
- (CanvasRendererBase.prototype.ctxOpacity = function (e) {
- var t = this.contextData.getOpacity();
- if (!this.renderConfig.clearCanvas) {
- (this.canvasContext.globalAlpha *= e < 0 ? 0 : e),
- (this.globalData.currentGlobalAlpha = t);
- return;
- }
- (t *= e < 0 ? 0 : e),
- this.contextData.setOpacity(t),
- this.globalData.currentGlobalAlpha !== t &&
- ((this.canvasContext.globalAlpha = t),
- (this.globalData.currentGlobalAlpha = t));
- }),
- (CanvasRendererBase.prototype.reset = function () {
- if (!this.renderConfig.clearCanvas) {
- this.canvasContext.restore();
- return;
- }
- this.contextData.reset();
- }),
- (CanvasRendererBase.prototype.save = function (e) {
- if (!this.renderConfig.clearCanvas) {
- this.canvasContext.save();
- return;
- }
- e && this.canvasContext.save(), this.contextData.push();
- }),
- (CanvasRendererBase.prototype.restore = function (e) {
- if (!this.renderConfig.clearCanvas) {
- this.canvasContext.restore();
- return;
- }
- e &&
- (this.canvasContext.restore(),
- (this.globalData.blendMode = 'source-over'));
- var t = this.contextData.pop(),
- r = t.transform,
- i = t.opacity;
- this.canvasContext.setTransform(r[0], r[1], r[4], r[5], r[12], r[13]),
- this.globalData.currentGlobalAlpha !== i &&
- ((this.canvasContext.globalAlpha = i),
- (this.globalData.currentGlobalAlpha = i));
- }),
- (CanvasRendererBase.prototype.configAnimation = function (e) {
- if (this.animationItem.wrapper) {
- this.animationItem.container = createTag('canvas');
- var t = this.animationItem.container.style;
- (t.width = '100%'), (t.height = '100%');
- var r = '0px 0px 0px';
- (t.transformOrigin = r),
- (t.mozTransformOrigin = r),
- (t.webkitTransformOrigin = r),
- (t['-webkit-transform'] = r),
- (t.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
- );
- } else this.canvasContext = this.renderConfig.context;
- (this.data = e),
- (this.layers = e.layers),
- (this.transformCanvas = {
- w: e.w,
- h: e.h,
- sx: 0,
- sy: 0,
- tx: 0,
- ty: 0
- }),
- this.setupGlobalData(e, 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(e.layers.length)),
- this.updateContainerSize();
- }),
- (CanvasRendererBase.prototype.updateContainerSize = function (e, t) {
- this.reset();
- var r, i;
- e
- ? ((r = e),
- (i = t),
- (this.canvasContext.canvas.width = r),
- (this.canvasContext.canvas.height = i))
- : (this.animationItem.wrapper && this.animationItem.container
- ? ((r = this.animationItem.wrapper.offsetWidth),
- (i = this.animationItem.wrapper.offsetHeight))
- : ((r = this.canvasContext.canvas.width),
- (i = this.canvasContext.canvas.height)),
- (this.canvasContext.canvas.width = r * this.renderConfig.dpr),
- (this.canvasContext.canvas.height = i * this.renderConfig.dpr));
- var s, n;
- if (
- this.renderConfig.preserveAspectRatio.indexOf('meet') !== -1 ||
- this.renderConfig.preserveAspectRatio.indexOf('slice') !== -1
- ) {
- var a = this.renderConfig.preserveAspectRatio.split(' '),
- o = a[1] || 'meet',
- l = a[0] || 'xMidYMid',
- c = l.substr(0, 4),
- g = l.substr(4);
- (s = r / i),
- (n = this.transformCanvas.w / this.transformCanvas.h),
- (n > s && o === 'meet') || (n < s && o === 'slice')
- ? ((this.transformCanvas.sx =
- r / (this.transformCanvas.w / this.renderConfig.dpr)),
- (this.transformCanvas.sy =
- r / (this.transformCanvas.w / this.renderConfig.dpr)))
- : ((this.transformCanvas.sx =
- i / (this.transformCanvas.h / this.renderConfig.dpr)),
- (this.transformCanvas.sy =
- i / (this.transformCanvas.h / this.renderConfig.dpr))),
- c === 'xMid' &&
- ((n < s && o === 'meet') || (n > s && o === 'slice'))
- ? (this.transformCanvas.tx =
- ((r -
- this.transformCanvas.w * (i / this.transformCanvas.h)) /
- 2) *
- this.renderConfig.dpr)
- : c === 'xMax' &&
- ((n < s && o === 'meet') || (n > s && o === 'slice'))
- ? (this.transformCanvas.tx =
- (r -
- this.transformCanvas.w * (i / this.transformCanvas.h)) *
- this.renderConfig.dpr)
- : (this.transformCanvas.tx = 0),
- g === 'YMid' &&
- ((n > s && o === 'meet') || (n < s && o === 'slice'))
- ? (this.transformCanvas.ty =
- ((i -
- this.transformCanvas.h * (r / this.transformCanvas.w)) /
- 2) *
- this.renderConfig.dpr)
- : g === 'YMax' &&
- ((n > s && o === 'meet') || (n < s && o === 'slice'))
- ? (this.transformCanvas.ty =
- (i -
- this.transformCanvas.h * (r / this.transformCanvas.w)) *
- this.renderConfig.dpr)
- : (this.transformCanvas.ty = 0);
- } else
- this.renderConfig.preserveAspectRatio === 'none'
- ? ((this.transformCanvas.sx =
- r / (this.transformCanvas.w / this.renderConfig.dpr)),
- (this.transformCanvas.sy =
- i / (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));
- (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);
- }),
- (CanvasRendererBase.prototype.destroy = function () {
- this.renderConfig.clearCanvas &&
- this.animationItem.wrapper &&
- (this.animationItem.wrapper.innerText = '');
- var e,
- t = this.layers ? this.layers.length : 0;
- for (e = t - 1; e >= 0; e -= 1)
- this.elements[e] &&
- this.elements[e].destroy &&
- this.elements[e].destroy();
- (this.elements.length = 0),
- (this.globalData.canvasContext = null),
- (this.animationItem.container = null),
- (this.destroyed = !0);
- }),
- (CanvasRendererBase.prototype.renderFrame = function (e, t) {
- if (
- !(
- (this.renderedFrame === e &&
- this.renderConfig.clearCanvas === !0 &&
- !t) ||
- this.destroyed ||
- e === -1
- )
- ) {
- (this.renderedFrame = e),
- (this.globalData.frameNum = e - this.animationItem._isFirstFrame),
- (this.globalData.frameId += 1),
- (this.globalData._mdf = !this.renderConfig.clearCanvas || t),
- (this.globalData.projectInterface.currentFrame = e);
- var r,
- i = this.layers.length;
- for (
- this.completeLayers || this.checkLayers(e), r = 0;
- r < i;
- r += 1
- )
- (this.completeLayers || this.elements[r]) &&
- this.elements[r].prepareFrame(e - this.layers[r].st);
- if (this.globalData._mdf) {
- for (
- this.renderConfig.clearCanvas === !0
- ? 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();
- this.renderConfig.clearCanvas !== !0 && this.restore();
- }
- }
- }),
- (CanvasRendererBase.prototype.buildItem = function (e) {
- var t = this.elements;
- if (!(t[e] || this.layers[e].ty === 99)) {
- var r = this.createItem(this.layers[e], this, this.globalData);
- (t[e] = r), r.initExpressions();
- }
- }),
- (CanvasRendererBase.prototype.checkPendingElements = function () {
- for (; this.pendingElements.length; ) {
- var e = this.pendingElements.pop();
- e.checkParenting();
- }
- }),
- (CanvasRendererBase.prototype.hide = function () {
- this.animationItem.container.style.display = 'none';
- }),
- (CanvasRendererBase.prototype.show = function () {
- this.animationItem.container.style.display = 'block';
- });
- function CVCompElement(e, t, r) {
- (this.completeLayers = !1),
- (this.layers = e.layers),
- (this.pendingElements = []),
- (this.elements = createSizedArray(this.layers.length)),
- this.initElement(e, t, r),
- (this.tm = e.tm
- ? PropertyFactory.getProp(this, e.tm, 0, t.frameRate, this)
- : { _placeholder: !0 });
- }
- extendPrototype(
- [CanvasRendererBase, ICompElement, CVBaseElement],
- CVCompElement
- ),
- (CVCompElement.prototype.renderInnerContent = function () {
- var e = this.canvasContext;
- 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();
- var t,
- r = this.layers.length;
- for (t = r - 1; t >= 0; t -= 1)
- (this.completeLayers || this.elements[t]) &&
- this.elements[t].renderFrame();
- }),
- (CVCompElement.prototype.destroy = function () {
- var e,
- t = this.layers.length;
- for (e = t - 1; e >= 0; e -= 1)
- this.elements[e] && this.elements[e].destroy();
- (this.layers = null), (this.elements = null);
- }),
- (CVCompElement.prototype.createComp = function (e) {
- return new CVCompElement(e, this.globalData, this);
- });
- function CanvasRenderer(e, t) {
- (this.animationItem = e),
- (this.renderConfig = {
- clearCanvas: t && t.clearCanvas !== void 0 ? t.clearCanvas : !0,
- context: (t && t.context) || null,
- progressiveLoad: (t && t.progressiveLoad) || !1,
- preserveAspectRatio:
- (t && t.preserveAspectRatio) || 'xMidYMid meet',
- imagePreserveAspectRatio:
- (t && t.imagePreserveAspectRatio) || 'xMidYMid slice',
- contentVisibility: (t && t.contentVisibility) || 'visible',
- className: (t && t.className) || '',
- id: (t && t.id) || '',
- runExpressions:
- !t || t.runExpressions === void 0 || t.runExpressions
- }),
- (this.renderConfig.dpr = (t && t.dpr) || 1),
- this.animationItem.wrapper &&
- (this.renderConfig.dpr =
- (t && t.dpr) || window.devicePixelRatio || 1),
- (this.renderedFrame = -1),
- (this.globalData = {
- frameNum: -1,
- _mdf: !1,
- renderConfig: this.renderConfig,
- currentGlobalAlpha: -1
- }),
- (this.contextData = new CVContextData()),
- (this.elements = []),
- (this.pendingElements = []),
- (this.transformMat = new Matrix()),
- (this.completeLayers = !1),
- (this.rendererType = 'canvas');
- }
- extendPrototype([CanvasRendererBase], CanvasRenderer),
- (CanvasRenderer.prototype.createComp = function (e) {
- return new CVCompElement(e, this.globalData, this);
- });
- function HBaseElement() {}
- (HBaseElement.prototype = {
- checkBlendMode: function () {},
- initRendererElement: function () {
- (this.baseElement = createTag(this.data.tg || 'div')),
- this.data.hasMask
- ? ((this.svgElement = createNS('svg')),
- (this.layerElement = createNS('g')),
- (this.maskedElement = this.layerElement),
- this.svgElement.appendChild(this.layerElement),
- this.baseElement.appendChild(this.svgElement))
- : (this.layerElement = this.baseElement),
- styleDiv(this.baseElement);
- },
- createContainerElements: function () {
- (this.renderableEffectsManager = new CVEffects()),
- (this.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),
- this.data.bm !== 0 && this.setBlendMode();
- },
- renderElement: function () {
- var t = this.transformedElement ? this.transformedElement.style : {};
- if (this.finalTransform._matMdf) {
- var r = this.finalTransform.mat.toCSS();
- (t.transform = r), (t.webkitTransform = r);
- }
- this.finalTransform._opMdf &&
- (t.opacity = this.finalTransform.mProp.o.v);
- },
- renderFrame: function () {
- this.data.hd ||
- this.hidden ||
- (this.renderTransform(),
- this.renderRenderable(),
- this.renderElement(),
- this.renderInnerContent(),
- this._isFirstFrame && (this._isFirstFrame = !1));
- },
- destroy: function () {
- (this.layerElement = null),
- (this.transformedElement = null),
- this.matteElement && (this.matteElement = null),
- this.maskManager &&
- (this.maskManager.destroy(), (this.maskManager = null));
- },
- createRenderableComponents: function () {
- this.maskManager = new MaskElement(this.data, this, this.globalData);
- },
- addEffects: function () {},
- setMatte: function () {}
- }),
- (HBaseElement.prototype.getBaseElement =
- SVGBaseElement.prototype.getBaseElement),
- (HBaseElement.prototype.destroyBaseElement =
- HBaseElement.prototype.destroy),
- (HBaseElement.prototype.buildElementParenting =
- BaseRenderer.prototype.buildElementParenting);
- function HSolidElement(e, t, r) {
- this.initElement(e, t, r);
- }
- extendPrototype(
- [
- BaseElement,
- TransformElement,
- HBaseElement,
- HierarchyElement,
- FrameElement,
- RenderableDOMElement
- ],
- HSolidElement
- ),
- (HSolidElement.prototype.createContent = function () {
- var e;
- this.data.hasMask
- ? ((e = createNS('rect')),
- e.setAttribute('width', this.data.sw),
- e.setAttribute('height', this.data.sh),
- e.setAttribute('fill', this.data.sc),
- this.svgElement.setAttribute('width', this.data.sw),
- this.svgElement.setAttribute('height', this.data.sh))
- : ((e = createTag('div')),
- (e.style.width = this.data.sw + 'px'),
- (e.style.height = this.data.sh + 'px'),
- (e.style.backgroundColor = this.data.sc)),
- this.layerElement.appendChild(e);
- });
- function HShapeElement(e, t, r) {
- (this.shapes = []),
- (this.shapesData = e.shapes),
- (this.stylesList = []),
- (this.shapeModifiers = []),
- (this.itemsData = []),
- (this.processedElements = []),
- (this.animatedContents = []),
- (this.shapesContainer = createNS('g')),
- this.initElement(e, t, r),
- (this.prevViewData = []),
- (this.currentBBox = { x: 999999, y: -999999, h: 0, w: 0 });
- }
- extendPrototype(
- [
- BaseElement,
- TransformElement,
- HSolidElement,
- SVGShapeElement,
- HBaseElement,
- HierarchyElement,
- FrameElement,
- RenderableElement
- ],
- HShapeElement
- ),
- (HShapeElement.prototype._renderShapeFrame =
- HShapeElement.prototype.renderInnerContent),
- (HShapeElement.prototype.createContent = function () {
- var e;
- if (((this.baseElement.style.fontSize = 0), this.data.hasMask))
- this.layerElement.appendChild(this.shapesContainer),
- (e = this.svgElement);
- else {
- e = createNS('svg');
- var t = this.comp.data ? this.comp.data : this.globalData.compSize;
- e.setAttribute('width', t.w),
- e.setAttribute('height', t.h),
- e.appendChild(this.shapesContainer),
- this.layerElement.appendChild(e);
- }
- this.searchShapes(
- this.shapesData,
- this.itemsData,
- this.prevViewData,
- this.shapesContainer,
- 0,
- [],
- !0
- ),
- this.filterUniqueShapes(),
- (this.shapeCont = e);
- }),
- (HShapeElement.prototype.getTransformedPoint = function (e, t) {
- var r,
- i = e.length;
- for (r = 0; r < i; r += 1)
- t = e[r].mProps.v.applyToPointArray(t[0], t[1], 0);
- return t;
- }),
- (HShapeElement.prototype.calculateShapeBoundingBox = function (e, t) {
- var r = e.sh.v,
- i = e.transformers,
- s,
- n = r._length,
- a,
- o,
- l,
- c;
- if (!(n <= 1)) {
- for (s = 0; s < n - 1; s += 1)
- (a = this.getTransformedPoint(i, r.v[s])),
- (o = this.getTransformedPoint(i, r.o[s])),
- (l = this.getTransformedPoint(i, r.i[s + 1])),
- (c = this.getTransformedPoint(i, r.v[s + 1])),
- this.checkBounds(a, o, l, c, t);
- r.c &&
- ((a = this.getTransformedPoint(i, r.v[s])),
- (o = this.getTransformedPoint(i, r.o[s])),
- (l = this.getTransformedPoint(i, r.i[0])),
- (c = this.getTransformedPoint(i, r.v[0])),
- this.checkBounds(a, o, l, c, t));
- }
- }),
- (HShapeElement.prototype.checkBounds = function (e, t, r, i, s) {
- this.getBoundsOfCurve(e, t, r, i);
- var n = this.shapeBoundingBox;
- (s.x = bmMin(n.left, s.x)),
- (s.xMax = bmMax(n.right, s.xMax)),
- (s.y = bmMin(n.top, s.y)),
- (s.yMax = bmMax(n.bottom, s.yMax));
- }),
- (HShapeElement.prototype.shapeBoundingBox = {
- left: 0,
- right: 0,
- top: 0,
- bottom: 0
- }),
- (HShapeElement.prototype.tempBoundingBox = {
- x: 0,
- xMax: 0,
- y: 0,
- yMax: 0,
- width: 0,
- height: 0
- }),
- (HShapeElement.prototype.getBoundsOfCurve = function (e, t, r, i) {
- for (
- var s = [
- [e[0], i[0]],
- [e[1], i[1]]
- ],
- n,
- a,
- o,
- l,
- c,
- g,
- S,
- p = 0;
- p < 2;
- ++p
- )
- (a = 6 * e[p] - 12 * t[p] + 6 * r[p]),
- (n = -3 * e[p] + 9 * t[p] - 9 * r[p] + 3 * i[p]),
- (o = 3 * t[p] - 3 * e[p]),
- (a |= 0),
- (n |= 0),
- (o |= 0),
- (n === 0 && a === 0) ||
- (n === 0
- ? ((l = -o / a),
- l > 0 &&
- l < 1 &&
- s[p].push(this.calculateF(l, e, t, r, i, p)))
- : ((c = a * a - 4 * o * n),
- c >= 0 &&
- ((g = (-a + bmSqrt(c)) / (2 * n)),
- g > 0 &&
- g < 1 &&
- s[p].push(this.calculateF(g, e, t, r, i, p)),
- (S = (-a - bmSqrt(c)) / (2 * n)),
- S > 0 &&
- S < 1 &&
- s[p].push(this.calculateF(S, e, t, r, i, p)))));
- (this.shapeBoundingBox.left = bmMin.apply(null, s[0])),
- (this.shapeBoundingBox.top = bmMin.apply(null, s[1])),
- (this.shapeBoundingBox.right = bmMax.apply(null, s[0])),
- (this.shapeBoundingBox.bottom = bmMax.apply(null, s[1]));
- }),
- (HShapeElement.prototype.calculateF = function (e, t, r, i, s, n) {
- return (
- bmPow(1 - e, 3) * t[n] +
- 3 * bmPow(1 - e, 2) * e * r[n] +
- 3 * (1 - e) * bmPow(e, 2) * i[n] +
- bmPow(e, 3) * s[n]
- );
- }),
- (HShapeElement.prototype.calculateBoundingBox = function (e, t) {
- var r,
- i = e.length;
- for (r = 0; r < i; r += 1)
- e[r] && e[r].sh
- ? this.calculateShapeBoundingBox(e[r], t)
- : e[r] && e[r].it
- ? this.calculateBoundingBox(e[r].it, t)
- : e[r] &&
- e[r].style &&
- e[r].w &&
- this.expandStrokeBoundingBox(e[r].w, t);
- }),
- (HShapeElement.prototype.expandStrokeBoundingBox = function (e, t) {
- var r = 0;
- if (e.keyframes) {
- for (var i = 0; i < e.keyframes.length; i += 1) {
- var s = e.keyframes[i].s;
- s > r && (r = s);
- }
- r *= e.mult;
- } else r = e.v * e.mult;
- (t.x -= r), (t.xMax += r), (t.y -= r), (t.yMax += r);
- }),
- (HShapeElement.prototype.currentBoxContains = function (e) {
- return (
- this.currentBBox.x <= e.x &&
- this.currentBBox.y <= e.y &&
- this.currentBBox.width + this.currentBBox.x >= e.x + e.width &&
- this.currentBBox.height + this.currentBBox.y >= e.y + e.height
- );
- }),
- (HShapeElement.prototype.renderInnerContent = function () {
- if (
- (this._renderShapeFrame(),
- !this.hidden && (this._isFirstFrame || this._mdf))
- ) {
- var e = this.tempBoundingBox,
- t = 999999;
- if (
- ((e.x = t),
- (e.xMax = -t),
- (e.y = t),
- (e.yMax = -t),
- this.calculateBoundingBox(this.itemsData, e),
- (e.width = e.xMax < e.x ? 0 : e.xMax - e.x),
- (e.height = e.yMax < e.y ? 0 : e.yMax - e.y),
- this.currentBoxContains(e))
- )
- return;
- var r = !1;
- if (
- (this.currentBBox.w !== e.width &&
- ((this.currentBBox.w = e.width),
- this.shapeCont.setAttribute('width', e.width),
- (r = !0)),
- this.currentBBox.h !== e.height &&
- ((this.currentBBox.h = e.height),
- this.shapeCont.setAttribute('height', e.height),
- (r = !0)),
- r || this.currentBBox.x !== e.x || this.currentBBox.y !== e.y)
- ) {
- (this.currentBBox.w = e.width),
- (this.currentBBox.h = e.height),
- (this.currentBBox.x = e.x),
- (this.currentBBox.y = e.y),
- this.shapeCont.setAttribute(
- 'viewBox',
- this.currentBBox.x +
- ' ' +
- this.currentBBox.y +
- ' ' +
- this.currentBBox.w +
- ' ' +
- this.currentBBox.h
- );
- var i = this.shapeCont.style,
- s =
- 'translate(' +
- this.currentBBox.x +
- 'px,' +
- this.currentBBox.y +
- 'px)';
- (i.transform = s), (i.webkitTransform = s);
- }
- }
- });
- function HTextElement(e, t, r) {
- (this.textSpans = []),
- (this.textPaths = []),
- (this.currentBBox = { x: 999999, y: -999999, h: 0, w: 0 }),
- (this.renderType = 'svg'),
- (this.isMasked = !1),
- this.initElement(e, t, r);
- }
- extendPrototype(
- [
- BaseElement,
- TransformElement,
- HBaseElement,
- HierarchyElement,
- FrameElement,
- RenderableDOMElement,
- ITextElement
- ],
- HTextElement
- ),
- (HTextElement.prototype.createContent = function () {
- if (((this.isMasked = this.checkMasks()), this.isMasked)) {
- (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);
- var e = createNS('g');
- this.maskedElement.appendChild(e), (this.innerElem = e);
- } else
- (this.renderType = 'html'), (this.innerElem = this.layerElement);
- this.checkParenting();
- }),
- (HTextElement.prototype.buildNewText = function () {
- var e = this.textProperty.currentData;
- this.renderedLetters = createSizedArray(e.l ? e.l.length : 0);
- var t = this.innerElem.style,
- r = e.fc ? this.buildColor(e.fc) : 'rgba(0,0,0,0)';
- (t.fill = r),
- (t.color = r),
- e.sc &&
- ((t.stroke = this.buildColor(e.sc)),
- (t.strokeWidth = e.sw + 'px'));
- var i = this.globalData.fontManager.getFontByName(e.f);
- if (!this.globalData.fontManager.chars)
- if (
- ((t.fontSize = e.finalSize + 'px'),
- (t.lineHeight = e.finalSize + 'px'),
- i.fClass)
- )
- this.innerElem.className = i.fClass;
- else {
- t.fontFamily = i.fFamily;
- var s = e.fWeight,
- n = e.fStyle;
- (t.fontStyle = n), (t.fontWeight = s);
- }
- var a,
- o,
- l = e.l;
- o = l.length;
- var c,
- g,
- S,
- p = this.mHelper,
- P,
- b = '',
- y = 0;
- for (a = 0; a < o; a += 1) {
- if (
- (this.globalData.fontManager.chars
- ? (this.textPaths[y]
- ? (c = this.textPaths[y])
- : ((c = createNS('path')),
- c.setAttribute('stroke-linecap', lineCapEnum[1]),
- c.setAttribute('stroke-linejoin', lineJoinEnum[2]),
- c.setAttribute('stroke-miterlimit', '4')),
- this.isMasked ||
- (this.textSpans[y]
- ? ((g = this.textSpans[y]), (S = g.children[0]))
- : ((g = createTag('div')),
- (g.style.lineHeight = 0),
- (S = createNS('svg')),
- S.appendChild(c),
- styleDiv(g))))
- : this.isMasked
- ? (c = this.textPaths[y] ? this.textPaths[y] : createNS('text'))
- : this.textSpans[y]
- ? ((g = this.textSpans[y]), (c = this.textPaths[y]))
- : ((g = createTag('span')),
- styleDiv(g),
- (c = createTag('span')),
- styleDiv(c),
- g.appendChild(c)),
- this.globalData.fontManager.chars)
- ) {
- var A = this.globalData.fontManager.getCharData(
- e.finalText[a],
- i.fStyle,
- this.globalData.fontManager.getFontByName(e.f).fFamily
- ),
- u;
- if (
- (A ? (u = A.data) : (u = null),
- p.reset(),
- u &&
- u.shapes &&
- u.shapes.length &&
- ((P = u.shapes[0].it),
- p.scale(e.finalSize / 100, e.finalSize / 100),
- (b = this.createPathShape(p, P)),
- c.setAttribute('d', b)),
- this.isMasked)
- )
- this.innerElem.appendChild(c);
- else {
- if ((this.innerElem.appendChild(g), u && u.shapes)) {
- document.body.appendChild(S);
- var f = S.getBBox();
- S.setAttribute('width', f.width + 2),
- S.setAttribute('height', f.height + 2),
- S.setAttribute(
- 'viewBox',
- f.x -
- 1 +
- ' ' +
- (f.y - 1) +
- ' ' +
- (f.width + 2) +
- ' ' +
- (f.height + 2)
- );
- var m = S.style,
- d = 'translate(' + (f.x - 1) + 'px,' + (f.y - 1) + 'px)';
- (m.transform = d),
- (m.webkitTransform = d),
- (l[a].yOffset = f.y - 1);
- } else S.setAttribute('width', 1), S.setAttribute('height', 1);
- g.appendChild(S);
- }
- } else if (
- ((c.textContent = l[a].val),
- c.setAttributeNS(
- 'http://www.w3.org/XML/1998/namespace',
- 'xml:space',
- 'preserve'
- ),
- this.isMasked)
- )
- this.innerElem.appendChild(c);
- else {
- this.innerElem.appendChild(g);
- var E = c.style,
- T = 'translate3d(0,' + -e.finalSize / 1.2 + 'px,0)';
- (E.transform = T), (E.webkitTransform = T);
- }
- this.isMasked ? (this.textSpans[y] = c) : (this.textSpans[y] = g),
- (this.textSpans[y].style.display = 'block'),
- (this.textPaths[y] = c),
- (y += 1);
- }
- for (; y < this.textSpans.length; )
- (this.textSpans[y].style.display = 'none'), (y += 1);
- }),
- (HTextElement.prototype.renderInnerContent = function () {
- var e;
- if (this.data.singleShape) {
- if (!this._isFirstFrame && !this.lettersChangedFlag) return;
- if (this.isMasked && this.finalTransform._matMdf) {
- this.svgElement.setAttribute(
- 'viewBox',
- -this.finalTransform.mProp.p.v[0] +
- ' ' +
- -this.finalTransform.mProp.p.v[1] +
- ' ' +
- this.compW +
- ' ' +
- this.compH
- ),
- (e = this.svgElement.style);
- var t =
- 'translate(' +
- -this.finalTransform.mProp.p.v[0] +
- 'px,' +
- -this.finalTransform.mProp.p.v[1] +
- 'px)';
- (e.transform = t), (e.webkitTransform = t);
- }
- }
- if (
- (this.textAnimator.getMeasures(
- this.textProperty.currentData,
- this.lettersChangedFlag
- ),
- !(
- !this.lettersChangedFlag && !this.textAnimator.lettersChangedFlag
- ))
- ) {
- var r,
- i,
- s = 0,
- n = this.textAnimator.renderedLetters,
- a = this.textProperty.currentData.l;
- i = a.length;
- var o, l, c;
- for (r = 0; r < i; r += 1)
- a[r].n
- ? (s += 1)
- : ((l = this.textSpans[r]),
- (c = this.textPaths[r]),
- (o = n[s]),
- (s += 1),
- o._mdf.m &&
- (this.isMasked
- ? l.setAttribute('transform', o.m)
- : ((l.style.webkitTransform = o.m),
- (l.style.transform = o.m))),
- (l.style.opacity = o.o),
- o.sw && o._mdf.sw && c.setAttribute('stroke-width', o.sw),
- o.sc && o._mdf.sc && c.setAttribute('stroke', o.sc),
- o.fc &&
- o._mdf.fc &&
- (c.setAttribute('fill', o.fc), (c.style.color = o.fc)));
- if (
- this.innerElem.getBBox &&
- !this.hidden &&
- (this._isFirstFrame || this._mdf)
- ) {
- var g = this.innerElem.getBBox();
- this.currentBBox.w !== g.width &&
- ((this.currentBBox.w = g.width),
- this.svgElement.setAttribute('width', g.width)),
- this.currentBBox.h !== g.height &&
- ((this.currentBBox.h = g.height),
- this.svgElement.setAttribute('height', g.height));
- var S = 1;
- if (
- this.currentBBox.w !== g.width + S * 2 ||
- this.currentBBox.h !== g.height + S * 2 ||
- this.currentBBox.x !== g.x - S ||
- this.currentBBox.y !== g.y - S
- ) {
- (this.currentBBox.w = g.width + S * 2),
- (this.currentBBox.h = g.height + S * 2),
- (this.currentBBox.x = g.x - S),
- (this.currentBBox.y = g.y - S),
- this.svgElement.setAttribute(
- 'viewBox',
- this.currentBBox.x +
- ' ' +
- this.currentBBox.y +
- ' ' +
- this.currentBBox.w +
- ' ' +
- this.currentBBox.h
- ),
- (e = this.svgElement.style);
- var p =
- 'translate(' +
- this.currentBBox.x +
- 'px,' +
- this.currentBBox.y +
- 'px)';
- (e.transform = p), (e.webkitTransform = p);
- }
- }
- }
- });
- function HCameraElement(e, t, r) {
- this.initFrame(), this.initBaseData(e, t, r), this.initHierarchy();
- var i = PropertyFactory.getProp;
- if (
- ((this.pe = i(this, e.pe, 0, 0, this)),
- e.ks.p.s
- ? ((this.px = i(this, e.ks.p.x, 1, 0, this)),
- (this.py = i(this, e.ks.p.y, 1, 0, this)),
- (this.pz = i(this, e.ks.p.z, 1, 0, this)))
- : (this.p = i(this, e.ks.p, 1, 0, this)),
- e.ks.a && (this.a = i(this, e.ks.a, 1, 0, this)),
- e.ks.or.k.length && e.ks.or.k[0].to)
- ) {
- var s,
- n = e.ks.or.k.length;
- for (s = 0; s < n; s += 1)
- (e.ks.or.k[s].to = null), (e.ks.or.k[s].ti = null);
- }
- (this.or = i(this, e.ks.or, 1, degToRads, this)),
- (this.or.sh = !0),
- (this.rx = i(this, e.ks.rx, 0, degToRads, this)),
- (this.ry = i(this, e.ks.ry, 0, degToRads, this)),
- (this.rz = i(this, e.ks.rz, 0, degToRads, this)),
- (this.mat = new Matrix()),
- (this._prevMat = new Matrix()),
- (this._isFirstFrame = !0),
- (this.finalTransform = { mProp: this });
- }
- extendPrototype(
- [BaseElement, FrameElement, HierarchyElement],
- HCameraElement
- ),
- (HCameraElement.prototype.setup = function () {
- var e,
- t = this.comp.threeDElements.length,
- r,
- i,
- s;
- for (e = 0; e < t; e += 1)
- if (((r = this.comp.threeDElements[e]), r.type === '3d')) {
- (i = r.perspectiveElem.style), (s = r.container.style);
- var n = this.pe.v + 'px',
- a = '0px 0px 0px',
- o = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)';
- (i.perspective = n),
- (i.webkitPerspective = n),
- (s.transformOrigin = a),
- (s.mozTransformOrigin = a),
- (s.webkitTransformOrigin = a),
- (i.transform = o),
- (i.webkitTransform = o);
- }
- }),
- (HCameraElement.prototype.createElements = function () {}),
- (HCameraElement.prototype.hide = function () {}),
- (HCameraElement.prototype.renderFrame = function () {
- var e = this._isFirstFrame,
- t,
- r;
- if (this.hierarchy)
- for (r = this.hierarchy.length, t = 0; t < r; t += 1)
- e = this.hierarchy[t].finalTransform.mProp._mdf || e;
- if (
- e ||
- 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)
- ) {
- if ((this.mat.reset(), this.hierarchy))
- for (r = this.hierarchy.length - 1, t = r; t >= 0; t -= 1) {
- var i = this.hierarchy[t].finalTransform.mProp;
- 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]);
- }
- if (
- (this.p
- ? this.mat.translate(-this.p.v[0], -this.p.v[1], this.p.v[2])
- : this.mat.translate(-this.px.v, -this.py.v, this.pz.v),
- this.a)
- ) {
- var s;
- this.p
- ? (s = [
- this.p.v[0] - this.a.v[0],
- this.p.v[1] - this.a.v[1],
- this.p.v[2] - this.a.v[2]
- ])
- : (s = [
- this.px.v - this.a.v[0],
- this.py.v - this.a.v[1],
- this.pz.v - this.a.v[2]
- ]);
- var n = Math.sqrt(
- Math.pow(s[0], 2) + Math.pow(s[1], 2) + Math.pow(s[2], 2)
- ),
- a = [s[0] / n, s[1] / n, s[2] / n],
- o = Math.sqrt(a[2] * a[2] + a[0] * a[0]),
- l = Math.atan2(a[1], o),
- c = Math.atan2(a[0], -a[2]);
- this.mat.rotateY(c).rotateX(-l);
- }
- this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),
- this.mat
- .rotateX(-this.or.v[0])
- .rotateY(-this.or.v[1])
- .rotateZ(this.or.v[2]),
- this.mat.translate(
- this.globalData.compSize.w / 2,
- this.globalData.compSize.h / 2,
- 0
- ),
- this.mat.translate(0, 0, this.pe.v);
- var g = !this._prevMat.equals(this.mat);
- if ((g || this.pe._mdf) && this.comp.threeDElements) {
- r = this.comp.threeDElements.length;
- var S, p, P;
- for (t = 0; t < r; t += 1)
- if (((S = this.comp.threeDElements[t]), S.type === '3d')) {
- if (g) {
- var b = this.mat.toCSS();
- (P = S.container.style),
- (P.transform = b),
- (P.webkitTransform = b);
- }
- this.pe._mdf &&
- ((p = S.perspectiveElem.style),
- (p.perspective = this.pe.v + 'px'),
- (p.webkitPerspective = this.pe.v + 'px'));
- }
- this.mat.clone(this._prevMat);
- }
- }
- this._isFirstFrame = !1;
- }),
- (HCameraElement.prototype.prepareFrame = function (e) {
- this.prepareProperties(e, !0);
- }),
- (HCameraElement.prototype.destroy = function () {}),
- (HCameraElement.prototype.getBaseElement = function () {
- return null;
- });
- function HImageElement(e, t, r) {
- (this.assetData = t.getAssetData(e.refId)), this.initElement(e, t, r);
- }
- extendPrototype(
- [
- BaseElement,
- TransformElement,
- HBaseElement,
- HSolidElement,
- HierarchyElement,
- FrameElement,
- RenderableElement
- ],
- HImageElement
- ),
- (HImageElement.prototype.createContent = function () {
- var e = this.globalData.getAssetsPath(this.assetData),
- t = new Image();
- 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',
- e
- ),
- this.layerElement.appendChild(this.imageElem),
- this.baseElement.setAttribute('width', this.assetData.w),
- this.baseElement.setAttribute('height', this.assetData.h))
- : this.layerElement.appendChild(t),
- (t.crossOrigin = 'anonymous'),
- (t.src = e),
- this.data.ln && this.baseElement.setAttribute('id', this.data.ln);
- });
- function HybridRendererBase(e, t) {
- (this.animationItem = e),
- (this.layers = null),
- (this.renderedFrame = -1),
- (this.renderConfig = {
- className: (t && t.className) || '',
- imagePreserveAspectRatio:
- (t && t.imagePreserveAspectRatio) || 'xMidYMid slice',
- hideOnTransparent: !(t && t.hideOnTransparent === !1),
- filterSize: {
- width: (t && t.filterSize && t.filterSize.width) || '400%',
- height: (t && t.filterSize && t.filterSize.height) || '400%',
- x: (t && t.filterSize && t.filterSize.x) || '-100%',
- y: (t && t.filterSize && t.filterSize.y) || '-100%'
- }
- }),
- (this.globalData = {
- _mdf: !1,
- frameNum: -1,
- renderConfig: this.renderConfig
- }),
- (this.pendingElements = []),
- (this.elements = []),
- (this.threeDElements = []),
- (this.destroyed = !1),
- (this.camera = null),
- (this.supports3d = !0),
- (this.rendererType = 'html');
- }
- extendPrototype([BaseRenderer], HybridRendererBase),
- (HybridRendererBase.prototype.buildItem =
- SVGRenderer.prototype.buildItem),
- (HybridRendererBase.prototype.checkPendingElements = function () {
- for (; this.pendingElements.length; ) {
- var e = this.pendingElements.pop();
- e.checkParenting();
- }
- }),
- (HybridRendererBase.prototype.appendElementInPos = function (e, t) {
- var r = e.getBaseElement();
- if (r) {
- var i = this.layers[t];
- if (!i.ddd || !this.supports3d)
- if (this.threeDElements) this.addTo3dContainer(r, t);
- else {
- for (var s = 0, n, a, o; s < t; )
- this.elements[s] &&
- this.elements[s] !== !0 &&
- this.elements[s].getBaseElement &&
- ((a = this.elements[s]),
- (o = this.layers[s].ddd
- ? this.getThreeDContainerByPos(s)
- : a.getBaseElement()),
- (n = o || n)),
- (s += 1);
- n
- ? (!i.ddd || !this.supports3d) &&
- this.layerElement.insertBefore(r, n)
- : (!i.ddd || !this.supports3d) &&
- this.layerElement.appendChild(r);
- }
- else this.addTo3dContainer(r, t);
- }
- }),
- (HybridRendererBase.prototype.createShape = function (e) {
- return this.supports3d
- ? new HShapeElement(e, this.globalData, this)
- : new SVGShapeElement(e, this.globalData, this);
- }),
- (HybridRendererBase.prototype.createText = function (e) {
- return this.supports3d
- ? new HTextElement(e, this.globalData, this)
- : new SVGTextLottieElement(e, this.globalData, this);
- }),
- (HybridRendererBase.prototype.createCamera = function (e) {
- return (
- (this.camera = new HCameraElement(e, this.globalData, this)),
- this.camera
- );
- }),
- (HybridRendererBase.prototype.createImage = function (e) {
- return this.supports3d
- ? new HImageElement(e, this.globalData, this)
- : new IImageElement(e, this.globalData, this);
- }),
- (HybridRendererBase.prototype.createSolid = function (e) {
- return this.supports3d
- ? new HSolidElement(e, this.globalData, this)
- : new ISolidElement(e, this.globalData, this);
- }),
- (HybridRendererBase.prototype.createNull =
- SVGRenderer.prototype.createNull),
- (HybridRendererBase.prototype.getThreeDContainerByPos = function (e) {
- for (var t = 0, r = this.threeDElements.length; t < r; ) {
- if (
- this.threeDElements[t].startPos <= e &&
- this.threeDElements[t].endPos >= e
- )
- return this.threeDElements[t].perspectiveElem;
- t += 1;
- }
- return null;
- }),
- (HybridRendererBase.prototype.createThreeDContainer = function (e, t) {
- var r = createTag('div'),
- i,
- s;
- styleDiv(r);
- var n = createTag('div');
- if ((styleDiv(n), t === '3d')) {
- (i = r.style),
- (i.width = this.globalData.compSize.w + 'px'),
- (i.height = this.globalData.compSize.h + 'px');
- var a = '50% 50%';
- (i.webkitTransformOrigin = a),
- (i.mozTransformOrigin = a),
- (i.transformOrigin = a),
- (s = n.style);
- var o = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)';
- (s.transform = o), (s.webkitTransform = o);
- }
- r.appendChild(n);
- var l = {
- container: n,
- perspectiveElem: r,
- startPos: e,
- endPos: e,
- type: t
- };
- return this.threeDElements.push(l), l;
- }),
- (HybridRendererBase.prototype.build3dContainers = function () {
- var e,
- t = this.layers.length,
- r,
- i = '';
- for (e = 0; e < t; e += 1)
- this.layers[e].ddd && this.layers[e].ty !== 3
- ? (i !== '3d' &&
- ((i = '3d'), (r = this.createThreeDContainer(e, '3d'))),
- (r.endPos = Math.max(r.endPos, e)))
- : (i !== '2d' &&
- ((i = '2d'), (r = this.createThreeDContainer(e, '2d'))),
- (r.endPos = Math.max(r.endPos, e)));
- for (t = this.threeDElements.length, e = t - 1; e >= 0; e -= 1)
- this.resizerElem.appendChild(
- this.threeDElements[e].perspectiveElem
- );
- }),
- (HybridRendererBase.prototype.addTo3dContainer = function (e, t) {
- for (var r = 0, i = this.threeDElements.length; r < i; ) {
- if (t <= this.threeDElements[r].endPos) {
- for (var s = this.threeDElements[r].startPos, n; s < t; )
- this.elements[s] &&
- this.elements[s].getBaseElement &&
- (n = this.elements[s].getBaseElement()),
- (s += 1);
- n
- ? this.threeDElements[r].container.insertBefore(e, n)
- : this.threeDElements[r].container.appendChild(e);
- break;
- }
- r += 1;
- }
- }),
- (HybridRendererBase.prototype.configAnimation = function (e) {
- var t = createTag('div'),
- r = this.animationItem.wrapper,
- i = t.style;
- (i.width = e.w + 'px'),
- (i.height = e.h + 'px'),
- (this.resizerElem = t),
- styleDiv(t),
- (i.transformStyle = 'flat'),
- (i.mozTransformStyle = 'flat'),
- (i.webkitTransformStyle = 'flat'),
- this.renderConfig.className &&
- t.setAttribute('class', this.renderConfig.className),
- r.appendChild(t),
- (i.overflow = 'hidden');
- var s = createNS('svg');
- s.setAttribute('width', '1'),
- s.setAttribute('height', '1'),
- styleDiv(s),
- this.resizerElem.appendChild(s);
- var n = createNS('defs');
- s.appendChild(n),
- (this.data = e),
- this.setupGlobalData(e, s),
- (this.globalData.defs = n),
- (this.layers = e.layers),
- (this.layerElement = this.resizerElem),
- this.build3dContainers(),
- this.updateContainerSize();
- }),
- (HybridRendererBase.prototype.destroy = function () {
- this.animationItem.wrapper &&
- (this.animationItem.wrapper.innerText = ''),
- (this.animationItem.container = null),
- (this.globalData.defs = null);
- var e,
- t = this.layers ? this.layers.length : 0;
- for (e = 0; e < t; e += 1)
- this.elements[e] &&
- this.elements[e].destroy &&
- this.elements[e].destroy();
- (this.elements.length = 0),
- (this.destroyed = !0),
- (this.animationItem = null);
- }),
- (HybridRendererBase.prototype.updateContainerSize = function () {
- var e = this.animationItem.wrapper.offsetWidth,
- t = this.animationItem.wrapper.offsetHeight,
- r = e / t,
- i = this.globalData.compSize.w / this.globalData.compSize.h,
- s,
- n,
- a,
- o;
- i > r
- ? ((s = e / this.globalData.compSize.w),
- (n = e / this.globalData.compSize.w),
- (a = 0),
- (o =
- (t -
- this.globalData.compSize.h *
- (e / this.globalData.compSize.w)) /
- 2))
- : ((s = t / this.globalData.compSize.h),
- (n = t / this.globalData.compSize.h),
- (a =
- (e -
- this.globalData.compSize.w *
- (t / this.globalData.compSize.h)) /
- 2),
- (o = 0));
- var l = this.resizerElem.style;
- (l.webkitTransform =
- 'matrix3d(' +
- s +
- ',0,0,0,0,' +
- n +
- ',0,0,0,0,1,0,' +
- a +
- ',' +
- o +
- ',0,1)'),
- (l.transform = l.webkitTransform);
- }),
- (HybridRendererBase.prototype.renderFrame =
- SVGRenderer.prototype.renderFrame),
- (HybridRendererBase.prototype.hide = function () {
- this.resizerElem.style.display = 'none';
- }),
- (HybridRendererBase.prototype.show = function () {
- this.resizerElem.style.display = 'block';
- }),
- (HybridRendererBase.prototype.initItems = function () {
- if ((this.buildAllItems(), this.camera)) this.camera.setup();
- else {
- var e = this.globalData.compSize.w,
- t = this.globalData.compSize.h,
- r,
- i = this.threeDElements.length;
- for (r = 0; r < i; r += 1) {
- var s = this.threeDElements[r].perspectiveElem.style;
- (s.webkitPerspective =
- Math.sqrt(Math.pow(e, 2) + Math.pow(t, 2)) + 'px'),
- (s.perspective = s.webkitPerspective);
- }
- }
- }),
- (HybridRendererBase.prototype.searchExtraCompositions = function (e) {
- var t,
- r = e.length,
- i = createTag('div');
- for (t = 0; t < r; t += 1)
- if (e[t].xt) {
- var s = this.createComp(e[t], i, this.globalData.comp, null);
- s.initExpressions(),
- this.globalData.projectInterface.registerComposition(s);
- }
- });
- function HCompElement(e, t, r) {
- (this.layers = e.layers),
- (this.supports3d = !e.hasMask),
- (this.completeLayers = !1),
- (this.pendingElements = []),
- (this.elements = this.layers
- ? createSizedArray(this.layers.length)
- : []),
- this.initElement(e, t, r),
- (this.tm = e.tm
- ? PropertyFactory.getProp(this, e.tm, 0, t.frameRate, this)
- : { _placeholder: !0 });
- }
- extendPrototype(
- [HybridRendererBase, ICompElement, HBaseElement],
- HCompElement
- ),
- (HCompElement.prototype._createBaseContainerElements =
- HCompElement.prototype.createContainerElements),
- (HCompElement.prototype.createContainerElements = function () {
- 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);
- }),
- (HCompElement.prototype.addTo3dContainer = function (e, t) {
- for (var r = 0, i; r < t; )
- this.elements[r] &&
- this.elements[r].getBaseElement &&
- (i = this.elements[r].getBaseElement()),
- (r += 1);
- i
- ? this.layerElement.insertBefore(e, i)
- : this.layerElement.appendChild(e);
- }),
- (HCompElement.prototype.createComp = function (e) {
- return this.supports3d
- ? new HCompElement(e, this.globalData, this)
- : new SVGCompElement(e, this.globalData, this);
- });
- function HybridRenderer(e, t) {
- (this.animationItem = e),
- (this.layers = null),
- (this.renderedFrame = -1),
- (this.renderConfig = {
- className: (t && t.className) || '',
- imagePreserveAspectRatio:
- (t && t.imagePreserveAspectRatio) || 'xMidYMid slice',
- hideOnTransparent: !(t && t.hideOnTransparent === !1),
- filterSize: {
- width: (t && t.filterSize && t.filterSize.width) || '400%',
- height: (t && t.filterSize && t.filterSize.height) || '400%',
- x: (t && t.filterSize && t.filterSize.x) || '-100%',
- y: (t && t.filterSize && t.filterSize.y) || '-100%'
- },
- runExpressions:
- !t || t.runExpressions === void 0 || t.runExpressions
- }),
- (this.globalData = {
- _mdf: !1,
- frameNum: -1,
- renderConfig: this.renderConfig
- }),
- (this.pendingElements = []),
- (this.elements = []),
- (this.threeDElements = []),
- (this.destroyed = !1),
- (this.camera = null),
- (this.supports3d = !0),
- (this.rendererType = 'html');
- }
- extendPrototype([HybridRendererBase], HybridRenderer),
- (HybridRenderer.prototype.createComp = function (e) {
- return this.supports3d
- ? new HCompElement(e, this.globalData, this)
- : new SVGCompElement(e, this.globalData, this);
- });
- var CompExpressionInterface = (function () {
- return function (e) {
- function t(r) {
- for (var i = 0, s = e.layers.length; i < s; ) {
- if (e.layers[i].nm === r || e.layers[i].ind === r)
- return e.elements[i].layerInterface;
- i += 1;
- }
- return null;
- }
- return (
- Object.defineProperty(t, '_name', { value: e.data.nm }),
- (t.layer = t),
- (t.pixelAspect = 1),
- (t.height = e.data.h || e.globalData.compSize.h),
- (t.width = e.data.w || e.globalData.compSize.w),
- (t.pixelAspect = 1),
- (t.frameDuration = 1 / e.globalData.frameRate),
- (t.displayStartTime = 0),
- (t.numLayers = e.layers.length),
- t
- );
- };
- })(),
- Expressions = (function () {
- var e = {};
- e.initExpressions = t;
- function t(r) {
- var i = 0,
- s = [];
- function n() {
- i += 1;
- }
- function a() {
- (i -= 1), i === 0 && l();
- }
- function o(c) {
- s.indexOf(c) === -1 && s.push(c);
- }
- function l() {
- var c,
- g = s.length;
- for (c = 0; c < g; c += 1) s[c].release();
- s.length = 0;
- }
- (r.renderer.compInterface = CompExpressionInterface(r.renderer)),
- r.renderer.globalData.projectInterface.registerComposition(
- r.renderer
- ),
- (r.renderer.globalData.pushExpression = n),
- (r.renderer.globalData.popExpression = a),
- (r.renderer.globalData.registerExpressionProperty = o);
- }
- return e;
- })(),
- MaskManagerInterface = (function () {
- function e(r, i) {
- (this._mask = r), (this._data = i);
- }
- Object.defineProperty(e.prototype, 'maskPath', {
- get: function () {
- return (
- this._mask.prop.k && this._mask.prop.getValue(), this._mask.prop
- );
- }
- }),
- Object.defineProperty(e.prototype, 'maskOpacity', {
- get: function () {
- return (
- this._mask.op.k && this._mask.op.getValue(),
- this._mask.op.v * 100
- );
- }
- });
- var t = function (i) {
- var s = createSizedArray(i.viewData.length),
- n,
- a = i.viewData.length;
- for (n = 0; n < a; n += 1)
- s[n] = new e(i.viewData[n], i.masksProperties[n]);
- var o = function (c) {
- for (n = 0; n < a; ) {
- if (i.masksProperties[n].nm === c) return s[n];
- n += 1;
- }
- return null;
- };
- return o;
- };
- return t;
- })(),
- ExpressionPropertyInterface = (function () {
- var e = { pv: 0, v: 0, mult: 1 },
- t = { pv: [0, 0, 0], v: [0, 0, 0], mult: 1 };
- function r(a, o, l) {
- Object.defineProperty(a, 'velocity', {
- get: function () {
- return o.getVelocityAtTime(o.comp.currentFrame);
- }
- }),
- (a.numKeys = o.keyframes ? o.keyframes.length : 0),
- (a.key = function (c) {
- if (!a.numKeys) return 0;
- var g = '';
- 's' in o.keyframes[c - 1]
- ? (g = o.keyframes[c - 1].s)
- : 'e' in o.keyframes[c - 2]
- ? (g = o.keyframes[c - 2].e)
- : (g = o.keyframes[c - 2].s);
- var S =
- l === 'unidimensional' ? new Number(g) : Object.assign({}, g);
- return (
- (S.time =
- o.keyframes[c - 1].t / o.elem.comp.globalData.frameRate),
- (S.value = l === 'unidimensional' ? g[0] : g),
- S
- );
- }),
- (a.valueAtTime = o.getValueAtTime),
- (a.speedAtTime = o.getSpeedAtTime),
- (a.velocityAtTime = o.getVelocityAtTime),
- (a.propertyGroup = o.propertyGroup);
- }
- function i(a) {
- (!a || !('pv' in a)) && (a = e);
- var o = 1 / a.mult,
- l = a.pv * o,
- c = new Number(l);
- return (
- (c.value = l),
- r(c, a, 'unidimensional'),
- function () {
- return (
- a.k && a.getValue(),
- (l = a.v * o),
- c.value !== l &&
- ((c = new Number(l)),
- (c.value = l),
- r(c, a, 'unidimensional')),
- c
- );
- }
- );
- }
- function s(a) {
- (!a || !('pv' in a)) && (a = t);
- var o = 1 / a.mult,
- l = (a.data && a.data.l) || a.pv.length,
- c = createTypedArray('float32', l),
- g = createTypedArray('float32', l);
- return (
- (c.value = g),
- r(c, a, 'multidimensional'),
- function () {
- a.k && a.getValue();
- for (var S = 0; S < l; S += 1)
- (g[S] = a.v[S] * o), (c[S] = g[S]);
- return c;
- }
- );
- }
- function n() {
- return e;
- }
- return function (a) {
- return a ? (a.propType === 'unidimensional' ? i(a) : s(a)) : n;
- };
- })(),
- TransformExpressionInterface = (function () {
- return function (e) {
- function t(a) {
- switch (a) {
- case 'scale':
- case 'Scale':
- case 'ADBE Scale':
- case 6:
- return t.scale;
- case 'rotation':
- case 'Rotation':
- case 'ADBE Rotation':
- case 'ADBE Rotate Z':
- case 10:
- return t.rotation;
- case 'ADBE Rotate X':
- return t.xRotation;
- case 'ADBE Rotate Y':
- return t.yRotation;
- case 'position':
- case 'Position':
- case 'ADBE Position':
- case 2:
- return t.position;
- case 'ADBE Position_0':
- return t.xPosition;
- case 'ADBE Position_1':
- return t.yPosition;
- case 'ADBE Position_2':
- return t.zPosition;
- case 'anchorPoint':
- case 'AnchorPoint':
- case 'Anchor Point':
- case 'ADBE AnchorPoint':
- case 1:
- return t.anchorPoint;
- case 'opacity':
- case 'Opacity':
- case 11:
- return t.opacity;
- default:
- return null;
- }
- }
- Object.defineProperty(t, 'rotation', {
- get: ExpressionPropertyInterface(e.r || e.rz)
- }),
- Object.defineProperty(t, 'zRotation', {
- get: ExpressionPropertyInterface(e.rz || e.r)
- }),
- Object.defineProperty(t, 'xRotation', {
- get: ExpressionPropertyInterface(e.rx)
- }),
- Object.defineProperty(t, 'yRotation', {
- get: ExpressionPropertyInterface(e.ry)
- }),
- Object.defineProperty(t, 'scale', {
- get: ExpressionPropertyInterface(e.s)
- });
- var r, i, s, n;
- return (
- e.p
- ? (n = ExpressionPropertyInterface(e.p))
- : ((r = ExpressionPropertyInterface(e.px)),
- (i = ExpressionPropertyInterface(e.py)),
- e.pz && (s = ExpressionPropertyInterface(e.pz))),
- Object.defineProperty(t, 'position', {
- get: function () {
- return e.p ? n() : [r(), i(), s ? s() : 0];
- }
- }),
- Object.defineProperty(t, 'xPosition', {
- get: ExpressionPropertyInterface(e.px)
- }),
- Object.defineProperty(t, 'yPosition', {
- get: ExpressionPropertyInterface(e.py)
- }),
- Object.defineProperty(t, 'zPosition', {
- get: ExpressionPropertyInterface(e.pz)
- }),
- Object.defineProperty(t, 'anchorPoint', {
- get: ExpressionPropertyInterface(e.a)
- }),
- Object.defineProperty(t, 'opacity', {
- get: ExpressionPropertyInterface(e.o)
- }),
- Object.defineProperty(t, 'skew', {
- get: ExpressionPropertyInterface(e.sk)
- }),
- Object.defineProperty(t, 'skewAxis', {
- get: ExpressionPropertyInterface(e.sa)
- }),
- Object.defineProperty(t, 'orientation', {
- get: ExpressionPropertyInterface(e.or)
- }),
- t
- );
- };
- })(),
- LayerExpressionInterface = (function () {
- function e(c) {
- var g = new Matrix();
- if (c !== void 0) {
- var S = this._elem.finalTransform.mProp.getValueAtTime(c);
- S.clone(g);
- } else {
- var p = this._elem.finalTransform.mProp;
- p.applyToMatrix(g);
- }
- return g;
- }
- function t(c, g) {
- var S = this.getMatrix(g);
- return (
- (S.props[12] = 0),
- (S.props[13] = 0),
- (S.props[14] = 0),
- this.applyPoint(S, c)
- );
- }
- function r(c, g) {
- var S = this.getMatrix(g);
- return this.applyPoint(S, c);
- }
- function i(c, g) {
- var S = this.getMatrix(g);
- return (
- (S.props[12] = 0),
- (S.props[13] = 0),
- (S.props[14] = 0),
- this.invertPoint(S, c)
- );
- }
- function s(c, g) {
- var S = this.getMatrix(g);
- return this.invertPoint(S, c);
- }
- function n(c, g) {
- if (this._elem.hierarchy && this._elem.hierarchy.length) {
- var S,
- p = this._elem.hierarchy.length;
- for (S = 0; S < p; S += 1)
- this._elem.hierarchy[S].finalTransform.mProp.applyToMatrix(c);
- }
- return c.applyToPointArray(g[0], g[1], g[2] || 0);
- }
- function a(c, g) {
- if (this._elem.hierarchy && this._elem.hierarchy.length) {
- var S,
- p = this._elem.hierarchy.length;
- for (S = 0; S < p; S += 1)
- this._elem.hierarchy[S].finalTransform.mProp.applyToMatrix(c);
- }
- return c.inversePoint(g);
- }
- function o(c) {
- var g = new Matrix();
- if (
- (g.reset(),
- this._elem.finalTransform.mProp.applyToMatrix(g),
- this._elem.hierarchy && this._elem.hierarchy.length)
- ) {
- var S,
- p = this._elem.hierarchy.length;
- for (S = 0; S < p; S += 1)
- this._elem.hierarchy[S].finalTransform.mProp.applyToMatrix(g);
- return g.inversePoint(c);
- }
- return g.inversePoint(c);
- }
- function l() {
- return [1, 1, 1, 1];
- }
- return function (c) {
- var g;
- function S(y) {
- P.mask = new MaskManagerInterface(y, c);
- }
- function p(y) {
- P.effect = y;
- }
- function P(y) {
- switch (y) {
- case 'ADBE Root Vectors Group':
- case 'Contents':
- case 2:
- return P.shapeInterface;
- case 1:
- case 6:
- case 'Transform':
- case 'transform':
- case 'ADBE Transform Group':
- return g;
- case 4:
- case 'ADBE Effect Parade':
- case 'effects':
- case 'Effects':
- return P.effect;
- case 'ADBE Text Properties':
- return P.textInterface;
- default:
- return null;
- }
- }
- (P.getMatrix = e),
- (P.invertPoint = a),
- (P.applyPoint = n),
- (P.toWorld = r),
- (P.toWorldVec = t),
- (P.fromWorld = s),
- (P.fromWorldVec = i),
- (P.toComp = r),
- (P.fromComp = o),
- (P.sampleImage = l),
- (P.sourceRectAtTime = c.sourceRectAtTime.bind(c)),
- (P._elem = c),
- (g = TransformExpressionInterface(c.finalTransform.mProp));
- var b = getDescriptor(g, 'anchorPoint');
- return (
- Object.defineProperties(P, {
- hasParent: {
- get: function () {
- return c.hierarchy.length;
- }
- },
- parent: {
- get: function () {
- return c.hierarchy[0].layerInterface;
- }
- },
- rotation: getDescriptor(g, 'rotation'),
- scale: getDescriptor(g, 'scale'),
- position: getDescriptor(g, 'position'),
- opacity: getDescriptor(g, 'opacity'),
- anchorPoint: b,
- anchor_point: b,
- transform: {
- get: function () {
- return g;
- }
- },
- active: {
- get: function () {
- return c.isInRange;
- }
- }
- }),
- (P.startTime = c.data.st),
- (P.index = c.data.ind),
- (P.source = c.data.refId),
- (P.height = c.data.ty === 0 ? c.data.h : 100),
- (P.width = c.data.ty === 0 ? c.data.w : 100),
- (P.inPoint = c.data.ip / c.comp.globalData.frameRate),
- (P.outPoint = c.data.op / c.comp.globalData.frameRate),
- (P._name = c.data.nm),
- (P.registerMaskInterface = S),
- (P.registerEffectsInterface = p),
- P
- );
- };
- })(),
- propertyGroupFactory = (function () {
- return function (e, t) {
- return function (r) {
- return (r = r === void 0 ? 1 : r), r <= 0 ? e : t(r - 1);
- };
- };
- })(),
- PropertyInterface = (function () {
- return function (e, t) {
- var r = { _name: e };
- function i(s) {
- return (s = s === void 0 ? 1 : s), s <= 0 ? r : t(s - 1);
- }
- return i;
- };
- })(),
- EffectsExpressionInterface = (function () {
- var e = { createEffectsInterface: t };
- function t(s, n) {
- if (s.effectsManager) {
- var a = [],
- o = s.data.ef,
- l,
- c = s.effectsManager.effectElements.length;
- for (l = 0; l < c; l += 1)
- a.push(r(o[l], s.effectsManager.effectElements[l], n, s));
- var g = s.data.ef || [],
- S = function (P) {
- for (l = 0, c = g.length; l < c; ) {
- if (P === g[l].nm || P === g[l].mn || P === g[l].ix)
- return a[l];
- l += 1;
- }
- return null;
- };
- return (
- Object.defineProperty(S, 'numProperties', {
- get: function () {
- return g.length;
- }
- }),
- S
- );
- }
- return null;
- }
- function r(s, n, a, o) {
- function l(P) {
- for (var b = s.ef, y = 0, A = b.length; y < A; ) {
- if (P === b[y].nm || P === b[y].mn || P === b[y].ix)
- return b[y].ty === 5 ? g[y] : g[y]();
- y += 1;
- }
- throw new Error();
- }
- var c = propertyGroupFactory(l, a),
- g = [],
- S,
- p = s.ef.length;
- for (S = 0; S < p; S += 1)
- s.ef[S].ty === 5
- ? g.push(
- r(
- s.ef[S],
- n.effectElements[S],
- n.effectElements[S].propertyGroup,
- o
- )
- )
- : g.push(i(n.effectElements[S], s.ef[S].ty, o, c));
- return (
- s.mn === 'ADBE Color Control' &&
- Object.defineProperty(l, 'color', {
- get: function () {
- return g[0]();
- }
- }),
- Object.defineProperties(l, {
- numProperties: {
- get: function () {
- return s.np;
- }
- },
- _name: { value: s.nm },
- propertyGroup: { value: c }
- }),
- (l.enabled = s.en !== 0),
- (l.active = l.enabled),
- l
- );
- }
- function i(s, n, a, o) {
- var l = ExpressionPropertyInterface(s.p);
- function c() {
- return n === 10 ? a.comp.compInterface(s.p.v) : l();
- }
- return (
- s.p.setGroupProperty &&
- s.p.setGroupProperty(PropertyInterface('', o)),
- c
- );
- }
- return e;
- })(),
- ShapePathInterface = (function () {
- return function (t, r, i) {
- var s = r.sh;
- function n(o) {
- return o === 'Shape' ||
- o === 'shape' ||
- o === 'Path' ||
- o === 'path' ||
- o === 'ADBE Vector Shape' ||
- o === 2
- ? n.path
- : null;
- }
- var a = propertyGroupFactory(n, i);
- return (
- s.setGroupProperty(PropertyInterface('Path', a)),
- Object.defineProperties(n, {
- path: {
- get: function () {
- return s.k && s.getValue(), s;
- }
- },
- shape: {
- get: function () {
- return s.k && s.getValue(), s;
- }
- },
- _name: { value: t.nm },
- ix: { value: t.ix },
- propertyIndex: { value: t.ix },
- mn: { value: t.mn },
- propertyGroup: { value: i }
- }),
- n
- );
- };
- })(),
- ShapeExpressionInterface = (function () {
- function e(b, y, A) {
- var u = [],
- f,
- m = b ? b.length : 0;
- for (f = 0; f < m; f += 1)
- b[f].ty === 'gr'
- ? u.push(r(b[f], y[f], A))
- : b[f].ty === 'fl'
- ? u.push(i(b[f], y[f], A))
- : b[f].ty === 'st'
- ? u.push(a(b[f], y[f], A))
- : b[f].ty === 'tm'
- ? u.push(o(b[f], y[f], A))
- : b[f].ty === 'tr' ||
- (b[f].ty === 'el'
- ? u.push(c(b[f], y[f], A))
- : b[f].ty === 'sr'
- ? u.push(g(b[f], y[f], A))
- : b[f].ty === 'sh'
- ? u.push(ShapePathInterface(b[f], y[f], A))
- : b[f].ty === 'rc'
- ? u.push(S(b[f], y[f], A))
- : b[f].ty === 'rd'
- ? u.push(p(b[f], y[f], A))
- : b[f].ty === 'rp'
- ? u.push(P(b[f], y[f], A))
- : b[f].ty === 'gf'
- ? u.push(s(b[f], y[f], A))
- : u.push(n(b[f], y[f])));
- return u;
- }
- function t(b, y, A) {
- var u,
- f = function (E) {
- for (var T = 0, x = u.length; T < x; ) {
- if (
- u[T]._name === E ||
- u[T].mn === E ||
- u[T].propertyIndex === E ||
- u[T].ix === E ||
- u[T].ind === E
- )
- return u[T];
- T += 1;
- }
- return typeof E == 'number' ? u[E - 1] : null;
- };
- (f.propertyGroup = propertyGroupFactory(f, A)),
- (u = e(b.it, y.it, f.propertyGroup)),
- (f.numProperties = u.length);
- var m = l(
- b.it[b.it.length - 1],
- y.it[y.it.length - 1],
- f.propertyGroup
- );
- return (
- (f.transform = m), (f.propertyIndex = b.cix), (f._name = b.nm), f
- );
- }
- function r(b, y, A) {
- var u = function (E) {
- switch (E) {
- case 'ADBE Vectors Group':
- case 'Contents':
- case 2:
- return u.content;
- default:
- return u.transform;
- }
- };
- u.propertyGroup = propertyGroupFactory(u, A);
- var f = t(b, y, u.propertyGroup),
- m = l(
- b.it[b.it.length - 1],
- y.it[y.it.length - 1],
- u.propertyGroup
- );
- return (
- (u.content = f),
- (u.transform = m),
- Object.defineProperty(u, '_name', {
- get: function () {
- return b.nm;
- }
- }),
- (u.numProperties = b.np),
- (u.propertyIndex = b.ix),
- (u.nm = b.nm),
- (u.mn = b.mn),
- u
- );
- }
- function i(b, y, A) {
- function u(f) {
- return f === 'Color' || f === 'color'
- ? u.color
- : f === 'Opacity' || f === 'opacity'
- ? u.opacity
- : null;
- }
- return (
- Object.defineProperties(u, {
- color: { get: ExpressionPropertyInterface(y.c) },
- opacity: { get: ExpressionPropertyInterface(y.o) },
- _name: { value: b.nm },
- mn: { value: b.mn }
- }),
- y.c.setGroupProperty(PropertyInterface('Color', A)),
- y.o.setGroupProperty(PropertyInterface('Opacity', A)),
- u
- );
- }
- function s(b, y, A) {
- function u(f) {
- return f === 'Start Point' || f === 'start point'
- ? u.startPoint
- : f === 'End Point' || f === 'end point'
- ? u.endPoint
- : f === 'Opacity' || f === 'opacity'
- ? u.opacity
- : null;
- }
- return (
- Object.defineProperties(u, {
- startPoint: { get: ExpressionPropertyInterface(y.s) },
- endPoint: { get: ExpressionPropertyInterface(y.e) },
- opacity: { get: ExpressionPropertyInterface(y.o) },
- type: {
- get: function () {
- return 'a';
- }
- },
- _name: { value: b.nm },
- mn: { value: b.mn }
- }),
- y.s.setGroupProperty(PropertyInterface('Start Point', A)),
- y.e.setGroupProperty(PropertyInterface('End Point', A)),
- y.o.setGroupProperty(PropertyInterface('Opacity', A)),
- u
- );
- }
- function n() {
- function b() {
- return null;
- }
- return b;
- }
- function a(b, y, A) {
- var u = propertyGroupFactory(x, A),
- f = propertyGroupFactory(T, u);
- function m(_) {
- Object.defineProperty(T, b.d[_].nm, {
- get: ExpressionPropertyInterface(y.d.dataProps[_].p)
- });
- }
- var d,
- E = b.d ? b.d.length : 0,
- T = {};
- for (d = 0; d < E; d += 1)
- m(d), y.d.dataProps[d].p.setGroupProperty(f);
- function x(_) {
- return _ === 'Color' || _ === 'color'
- ? x.color
- : _ === 'Opacity' || _ === 'opacity'
- ? x.opacity
- : _ === 'Stroke Width' || _ === 'stroke width'
- ? x.strokeWidth
- : null;
- }
- return (
- Object.defineProperties(x, {
- color: { get: ExpressionPropertyInterface(y.c) },
- opacity: { get: ExpressionPropertyInterface(y.o) },
- strokeWidth: { get: ExpressionPropertyInterface(y.w) },
- dash: {
- get: function () {
- return T;
- }
- },
- _name: { value: b.nm },
- mn: { value: b.mn }
- }),
- y.c.setGroupProperty(PropertyInterface('Color', u)),
- y.o.setGroupProperty(PropertyInterface('Opacity', u)),
- y.w.setGroupProperty(PropertyInterface('Stroke Width', u)),
- x
- );
- }
- function o(b, y, A) {
- function u(m) {
- return m === b.e.ix || m === 'End' || m === 'end'
- ? u.end
- : m === b.s.ix
- ? u.start
- : m === b.o.ix
- ? u.offset
- : null;
- }
- var f = propertyGroupFactory(u, A);
- return (
- (u.propertyIndex = b.ix),
- y.s.setGroupProperty(PropertyInterface('Start', f)),
- y.e.setGroupProperty(PropertyInterface('End', f)),
- y.o.setGroupProperty(PropertyInterface('Offset', f)),
- (u.propertyIndex = b.ix),
- (u.propertyGroup = A),
- Object.defineProperties(u, {
- start: { get: ExpressionPropertyInterface(y.s) },
- end: { get: ExpressionPropertyInterface(y.e) },
- offset: { get: ExpressionPropertyInterface(y.o) },
- _name: { value: b.nm }
- }),
- (u.mn = b.mn),
- u
- );
- }
- function l(b, y, A) {
- function u(m) {
- return b.a.ix === m || m === 'Anchor Point'
- ? u.anchorPoint
- : b.o.ix === m || m === 'Opacity'
- ? u.opacity
- : b.p.ix === m || m === 'Position'
- ? u.position
- : b.r.ix === m ||
- m === 'Rotation' ||
- m === 'ADBE Vector Rotation'
- ? u.rotation
- : b.s.ix === m || m === 'Scale'
- ? u.scale
- : (b.sk && b.sk.ix === m) || m === 'Skew'
- ? u.skew
- : (b.sa && b.sa.ix === m) || m === 'Skew Axis'
- ? u.skewAxis
- : null;
- }
- var f = propertyGroupFactory(u, A);
- return (
- y.transform.mProps.o.setGroupProperty(
- PropertyInterface('Opacity', f)
- ),
- y.transform.mProps.p.setGroupProperty(
- PropertyInterface('Position', f)
- ),
- y.transform.mProps.a.setGroupProperty(
- PropertyInterface('Anchor Point', f)
- ),
- y.transform.mProps.s.setGroupProperty(
- PropertyInterface('Scale', f)
- ),
- y.transform.mProps.r.setGroupProperty(
- PropertyInterface('Rotation', f)
- ),
- y.transform.mProps.sk &&
- (y.transform.mProps.sk.setGroupProperty(
- PropertyInterface('Skew', f)
- ),
- y.transform.mProps.sa.setGroupProperty(
- PropertyInterface('Skew Angle', f)
- )),
- y.transform.op.setGroupProperty(PropertyInterface('Opacity', f)),
- Object.defineProperties(u, {
- opacity: {
- get: ExpressionPropertyInterface(y.transform.mProps.o)
- },
- position: {
- get: ExpressionPropertyInterface(y.transform.mProps.p)
- },
- anchorPoint: {
- get: ExpressionPropertyInterface(y.transform.mProps.a)
- },
- scale: {
- get: ExpressionPropertyInterface(y.transform.mProps.s)
- },
- rotation: {
- get: ExpressionPropertyInterface(y.transform.mProps.r)
- },
- skew: {
- get: ExpressionPropertyInterface(y.transform.mProps.sk)
- },
- skewAxis: {
- get: ExpressionPropertyInterface(y.transform.mProps.sa)
- },
- _name: { value: b.nm }
- }),
- (u.ty = 'tr'),
- (u.mn = b.mn),
- (u.propertyGroup = A),
- u
- );
- }
- function c(b, y, A) {
- function u(d) {
- return b.p.ix === d ? u.position : b.s.ix === d ? u.size : null;
- }
- var f = propertyGroupFactory(u, A);
- u.propertyIndex = b.ix;
- var m = y.sh.ty === 'tm' ? y.sh.prop : y.sh;
- return (
- m.s.setGroupProperty(PropertyInterface('Size', f)),
- m.p.setGroupProperty(PropertyInterface('Position', f)),
- Object.defineProperties(u, {
- size: { get: ExpressionPropertyInterface(m.s) },
- position: { get: ExpressionPropertyInterface(m.p) },
- _name: { value: b.nm }
- }),
- (u.mn = b.mn),
- u
- );
- }
- function g(b, y, A) {
- function u(d) {
- return b.p.ix === d
- ? u.position
- : b.r.ix === d
- ? u.rotation
- : b.pt.ix === d
- ? u.points
- : b.or.ix === d || d === 'ADBE Vector Star Outer Radius'
- ? u.outerRadius
- : b.os.ix === d
- ? u.outerRoundness
- : b.ir &&
- (b.ir.ix === d || d === 'ADBE Vector Star Inner Radius')
- ? u.innerRadius
- : b.is && b.is.ix === d
- ? u.innerRoundness
- : null;
- }
- var f = propertyGroupFactory(u, A),
- m = y.sh.ty === 'tm' ? y.sh.prop : y.sh;
- return (
- (u.propertyIndex = b.ix),
- m.or.setGroupProperty(PropertyInterface('Outer Radius', f)),
- m.os.setGroupProperty(PropertyInterface('Outer Roundness', f)),
- m.pt.setGroupProperty(PropertyInterface('Points', f)),
- m.p.setGroupProperty(PropertyInterface('Position', f)),
- m.r.setGroupProperty(PropertyInterface('Rotation', f)),
- b.ir &&
- (m.ir.setGroupProperty(PropertyInterface('Inner Radius', f)),
- m.is.setGroupProperty(PropertyInterface('Inner Roundness', f))),
- Object.defineProperties(u, {
- position: { get: ExpressionPropertyInterface(m.p) },
- rotation: { get: ExpressionPropertyInterface(m.r) },
- points: { get: ExpressionPropertyInterface(m.pt) },
- outerRadius: { get: ExpressionPropertyInterface(m.or) },
- outerRoundness: { get: ExpressionPropertyInterface(m.os) },
- innerRadius: { get: ExpressionPropertyInterface(m.ir) },
- innerRoundness: { get: ExpressionPropertyInterface(m.is) },
- _name: { value: b.nm }
- }),
- (u.mn = b.mn),
- u
- );
- }
- function S(b, y, A) {
- function u(d) {
- return b.p.ix === d
- ? u.position
- : b.r.ix === d
- ? u.roundness
- : b.s.ix === d || d === 'Size' || d === 'ADBE Vector Rect Size'
- ? u.size
- : null;
- }
- var f = propertyGroupFactory(u, A),
- m = y.sh.ty === 'tm' ? y.sh.prop : y.sh;
- return (
- (u.propertyIndex = b.ix),
- m.p.setGroupProperty(PropertyInterface('Position', f)),
- m.s.setGroupProperty(PropertyInterface('Size', f)),
- m.r.setGroupProperty(PropertyInterface('Rotation', f)),
- Object.defineProperties(u, {
- position: { get: ExpressionPropertyInterface(m.p) },
- roundness: { get: ExpressionPropertyInterface(m.r) },
- size: { get: ExpressionPropertyInterface(m.s) },
- _name: { value: b.nm }
- }),
- (u.mn = b.mn),
- u
- );
- }
- function p(b, y, A) {
- function u(d) {
- return b.r.ix === d || d === 'Round Corners 1' ? u.radius : null;
- }
- var f = propertyGroupFactory(u, A),
- m = y;
- return (
- (u.propertyIndex = b.ix),
- m.rd.setGroupProperty(PropertyInterface('Radius', f)),
- Object.defineProperties(u, {
- radius: { get: ExpressionPropertyInterface(m.rd) },
- _name: { value: b.nm }
- }),
- (u.mn = b.mn),
- u
- );
- }
- function P(b, y, A) {
- function u(d) {
- return b.c.ix === d || d === 'Copies'
- ? u.copies
- : b.o.ix === d || d === 'Offset'
- ? u.offset
- : null;
- }
- var f = propertyGroupFactory(u, A),
- m = y;
- return (
- (u.propertyIndex = b.ix),
- m.c.setGroupProperty(PropertyInterface('Copies', f)),
- m.o.setGroupProperty(PropertyInterface('Offset', f)),
- Object.defineProperties(u, {
- copies: { get: ExpressionPropertyInterface(m.c) },
- offset: { get: ExpressionPropertyInterface(m.o) },
- _name: { value: b.nm }
- }),
- (u.mn = b.mn),
- u
- );
- }
- return function (b, y, A) {
- var u;
- function f(d) {
- if (typeof d == 'number')
- return (d = d === void 0 ? 1 : d), d === 0 ? A : u[d - 1];
- for (var E = 0, T = u.length; E < T; ) {
- if (u[E]._name === d) return u[E];
- E += 1;
- }
- return null;
- }
- function m() {
- return A;
- }
- return (
- (f.propertyGroup = propertyGroupFactory(f, m)),
- (u = e(b, y, f.propertyGroup)),
- (f.numProperties = u.length),
- (f._name = 'Contents'),
- f
- );
- };
- })(),
- TextExpressionInterface = (function () {
- return function (e) {
- var t;
- function r(i) {
- switch (i) {
- case 'ADBE Text Document':
- return r.sourceText;
- default:
- return null;
- }
- }
- return (
- Object.defineProperty(r, 'sourceText', {
- get: function () {
- e.textProperty.getValue();
- var s = e.textProperty.currentData.t;
- return (
- (!t || s !== t.value) &&
- ((t = new String(s)),
- (t.value = s || new String(s)),
- Object.defineProperty(t, 'style', {
- get: function () {
- return { fillColor: e.textProperty.currentData.fc };
- }
- })),
- t
- );
- }
- }),
- r
- );
- };
- })();
- function _typeof$2(e) {
- return (
- typeof Symbol == 'function' && typeof Symbol.iterator == 'symbol'
- ? (_typeof$2 = function (r) {
- return typeof r;
- })
- : (_typeof$2 = function (r) {
- return r &&
- typeof Symbol == 'function' &&
- r.constructor === Symbol &&
- r !== Symbol.prototype
- ? 'symbol'
- : typeof r;
- }),
- _typeof$2(e)
- );
- }
- var FootageInterface = (function () {
- var e = function (i) {
- var s = '',
- n = i.getFootageData();
- function a() {
- return (s = ''), (n = i.getFootageData()), o;
- }
- function o(l) {
- if (n[l])
- return (s = l), (n = n[l]), _typeof$2(n) === 'object' ? o : n;
- var c = l.indexOf(s);
- if (c !== -1) {
- var g = parseInt(l.substr(c + s.length), 10);
- return (n = n[g]), _typeof$2(n) === 'object' ? o : n;
- }
- return '';
- }
- return a;
- },
- t = function (i) {
- function s(n) {
- return n === 'Outline' ? s.outlineInterface() : null;
- }
- return (s._name = 'Outline'), (s.outlineInterface = e(i)), s;
- };
- return function (r) {
- function i(s) {
- return s === 'Data' ? i.dataInterface : null;
- }
- return (i._name = 'Data'), (i.dataInterface = t(r)), i;
- };
- })(),
- interfaces = {
- layer: LayerExpressionInterface,
- effects: EffectsExpressionInterface,
- comp: CompExpressionInterface,
- shape: ShapeExpressionInterface,
- text: TextExpressionInterface,
- footage: FootageInterface
- };
- function getInterface(e) {
- return interfaces[e] || null;
- }
- function _typeof$1(e) {
- return (
- typeof Symbol == 'function' && typeof Symbol.iterator == 'symbol'
- ? (_typeof$1 = function (r) {
- return typeof r;
- })
- : (_typeof$1 = function (r) {
- return r &&
- typeof Symbol == 'function' &&
- r.constructor === Symbol &&
- r !== Symbol.prototype
- ? 'symbol'
- : typeof r;
- }),
- _typeof$1(e)
- );
- }
- function seedRandom(e, t) {
- var r = this,
- i = 256,
- s = 6,
- n = 52,
- a = 'random',
- o = t.pow(i, s),
- l = t.pow(2, n),
- c = l * 2,
- g = i - 1,
- S;
- function p(m, d, E) {
- var T = [];
- d = d === !0 ? { entropy: !0 } : d || {};
- var x = A(y(d.entropy ? [m, f(e)] : m === null ? u() : m, 3), T),
- _ = new P(T),
- I = function () {
- for (var D = _.g(s), N = o, $ = 0; D < l; )
- (D = (D + $) * i), (N *= i), ($ = _.g(1));
- for (; D >= c; ) (D /= 2), (N /= 2), ($ >>>= 1);
- return (D + $) / N;
- };
- return (
- (I.int32 = function () {
- return _.g(4) | 0;
- }),
- (I.quick = function () {
- return _.g(4) / 4294967296;
- }),
- (I.double = I),
- A(f(_.S), e),
- (
- d.pass ||
- E ||
- function (V, D, N, $) {
- return (
- $ &&
- ($.S && b($, _),
- (V.state = function () {
- return b(_, {});
- })),
- N ? ((t[a] = V), D) : V
- );
- }
- )(I, x, 'global' in d ? d.global : this == t, d.state)
- );
- }
- t['seed' + a] = p;
- function P(m) {
- var d,
- E = m.length,
- T = this,
- x = 0,
- _ = (T.i = T.j = 0),
- I = (T.S = []);
- for (E || (m = [E++]); x < i; ) I[x] = x++;
- for (x = 0; x < i; x++)
- (I[x] = I[(_ = g & (_ + m[x % E] + (d = I[x])))]), (I[_] = d);
- T.g = function (V) {
- for (var D, N = 0, $ = T.i, O = T.j, B = T.S; V--; )
- (D = B[($ = g & ($ + 1))]),
- (N =
- N * i + B[g & ((B[$] = B[(O = g & (O + D))]) + (B[O] = D))]);
- return (T.i = $), (T.j = O), N;
- };
- }
- function b(m, d) {
- return (d.i = m.i), (d.j = m.j), (d.S = m.S.slice()), d;
- }
- function y(m, d) {
- var E = [],
- T = _typeof$1(m),
- x;
- if (d && T == 'object')
- for (x in m)
- try {
- E.push(y(m[x], d - 1));
- } catch {}
- return E.length ? E : T == 'string' ? m : m + '\0';
- }
- function A(m, d) {
- for (var E = m + '', T, x = 0; x < E.length; )
- d[g & x] = g & ((T ^= d[g & x] * 19) + E.charCodeAt(x++));
- return f(d);
- }
- function u() {
- try {
- var m = new Uint8Array(i);
- return (r.crypto || r.msCrypto).getRandomValues(m), f(m);
- } catch {
- var d = r.navigator,
- E = d && d.plugins;
- return [+new Date(), r, E, r.screen, f(e)];
- }
- }
- function f(m) {
- return String.fromCharCode.apply(0, m);
- }
- A(t.random(), e);
- }
- function initialize$2(e) {
- seedRandom([], e);
- }
- var propTypes = { SHAPE: 'shape' };
- function _typeof(e) {
- return (
- typeof Symbol == 'function' && typeof Symbol.iterator == 'symbol'
- ? (_typeof = function (r) {
- return typeof r;
- })
- : (_typeof = function (r) {
- return r &&
- typeof Symbol == 'function' &&
- r.constructor === Symbol &&
- r !== Symbol.prototype
- ? 'symbol'
- : typeof r;
- }),
- _typeof(e)
- );
- }
- var ExpressionManager = (function () {
- var ob = {},
- Math = BMMath,
- window = null,
- document = null,
- XMLHttpRequest = null,
- fetch = null,
- frames = null;
- initialize$2(BMMath);
- function $bm_isInstanceOfArray(e) {
- return e.constructor === Array || e.constructor === Float32Array;
- }
- function isNumerable(e, t) {
- return (
- e === 'number' ||
- e === 'boolean' ||
- e === 'string' ||
- t instanceof Number
- );
- }
- function $bm_neg(e) {
- var t = _typeof(e);
- if (t === 'number' || t === 'boolean' || e instanceof Number)
- return -e;
- if ($bm_isInstanceOfArray(e)) {
- var r,
- i = e.length,
- s = [];
- for (r = 0; r < i; r += 1) s[r] = -e[r];
- return s;
- }
- return e.propType ? e.v : -e;
- }
- var easeInBez = BezierFactory.getBezierEasing(
- 0.333,
- 0,
- 0.833,
- 0.833,
- 'easeIn'
- ).get,
- easeOutBez = BezierFactory.getBezierEasing(
- 0.167,
- 0.167,
- 0.667,
- 1,
- 'easeOut'
- ).get,
- easeInOutBez = BezierFactory.getBezierEasing(
- 0.33,
- 0,
- 0.667,
- 1,
- 'easeInOut'
- ).get;
- function sum(e, t) {
- var r = _typeof(e),
- i = _typeof(t);
- if (
- r === 'string' ||
- i === 'string' ||
- (isNumerable(r, e) && isNumerable(i, t))
- )
- return e + t;
- if ($bm_isInstanceOfArray(e) && isNumerable(i, t))
- return (e = e.slice(0)), (e[0] += t), e;
- if (isNumerable(r, e) && $bm_isInstanceOfArray(t))
- return (t = t.slice(0)), (t[0] = e + t[0]), t;
- if ($bm_isInstanceOfArray(e) && $bm_isInstanceOfArray(t)) {
- for (
- var s = 0, n = e.length, a = t.length, o = [];
- s < n || s < a;
- )
- (typeof e[s] == 'number' || e[s] instanceof Number) &&
- (typeof t[s] == 'number' || t[s] instanceof Number)
- ? (o[s] = e[s] + t[s])
- : (o[s] = t[s] === void 0 ? e[s] : e[s] || t[s]),
- (s += 1);
- return o;
- }
- return 0;
- }
- var add = sum;
- function sub(e, t) {
- var r = _typeof(e),
- i = _typeof(t);
- if (isNumerable(r, e) && isNumerable(i, t))
- return (
- r === 'string' && (e = parseInt(e, 10)),
- i === 'string' && (t = parseInt(t, 10)),
- e - t
- );
- if ($bm_isInstanceOfArray(e) && isNumerable(i, t))
- return (e = e.slice(0)), (e[0] -= t), e;
- if (isNumerable(r, e) && $bm_isInstanceOfArray(t))
- return (t = t.slice(0)), (t[0] = e - t[0]), t;
- if ($bm_isInstanceOfArray(e) && $bm_isInstanceOfArray(t)) {
- for (
- var s = 0, n = e.length, a = t.length, o = [];
- s < n || s < a;
- )
- (typeof e[s] == 'number' || e[s] instanceof Number) &&
- (typeof t[s] == 'number' || t[s] instanceof Number)
- ? (o[s] = e[s] - t[s])
- : (o[s] = t[s] === void 0 ? e[s] : e[s] || t[s]),
- (s += 1);
- return o;
- }
- return 0;
- }
- function mul(e, t) {
- var r = _typeof(e),
- i = _typeof(t),
- s;
- if (isNumerable(r, e) && isNumerable(i, t)) return e * t;
- var n, a;
- if ($bm_isInstanceOfArray(e) && isNumerable(i, t)) {
- for (
- a = e.length, s = createTypedArray('float32', a), n = 0;
- n < a;
- n += 1
- )
- s[n] = e[n] * t;
- return s;
- }
- if (isNumerable(r, e) && $bm_isInstanceOfArray(t)) {
- for (
- a = t.length, s = createTypedArray('float32', a), n = 0;
- n < a;
- n += 1
- )
- s[n] = e * t[n];
- return s;
- }
- return 0;
- }
- function div(e, t) {
- var r = _typeof(e),
- i = _typeof(t),
- s;
- if (isNumerable(r, e) && isNumerable(i, t)) return e / t;
- var n, a;
- if ($bm_isInstanceOfArray(e) && isNumerable(i, t)) {
- for (
- a = e.length, s = createTypedArray('float32', a), n = 0;
- n < a;
- n += 1
- )
- s[n] = e[n] / t;
- return s;
- }
- if (isNumerable(r, e) && $bm_isInstanceOfArray(t)) {
- for (
- a = t.length, s = createTypedArray('float32', a), n = 0;
- n < a;
- n += 1
- )
- s[n] = e / t[n];
- return s;
- }
- return 0;
- }
- function mod(e, t) {
- return (
- typeof e == 'string' && (e = parseInt(e, 10)),
- typeof t == 'string' && (t = parseInt(t, 10)),
- e % t
- );
- }
- var $bm_sum = sum,
- $bm_sub = sub,
- $bm_mul = mul,
- $bm_div = div,
- $bm_mod = mod;
- function clamp(e, t, r) {
- if (t > r) {
- var i = r;
- (r = t), (t = i);
- }
- return Math.min(Math.max(e, t), r);
- }
- function radiansToDegrees(e) {
- return e / degToRads;
- }
- var radians_to_degrees = radiansToDegrees;
- function degreesToRadians(e) {
- return e * degToRads;
- }
- var degrees_to_radians = radiansToDegrees,
- helperLengthArray = [0, 0, 0, 0, 0, 0];
- function length(e, t) {
- if (typeof e == 'number' || e instanceof Number)
- return (t = t || 0), Math.abs(e - t);
- t || (t = helperLengthArray);
- var r,
- i = Math.min(e.length, t.length),
- s = 0;
- for (r = 0; r < i; r += 1) s += Math.pow(t[r] - e[r], 2);
- return Math.sqrt(s);
- }
- function normalize(e) {
- return div(e, length(e));
- }
- function rgbToHsl(e) {
- var t = e[0],
- r = e[1],
- i = e[2],
- s = Math.max(t, r, i),
- n = Math.min(t, r, i),
- a,
- o,
- l = (s + n) / 2;
- if (s === n) (a = 0), (o = 0);
- else {
- var c = s - n;
- switch (((o = l > 0.5 ? c / (2 - s - n) : c / (s + n)), s)) {
- case t:
- a = (r - i) / c + (r < i ? 6 : 0);
- break;
- case r:
- a = (i - t) / c + 2;
- break;
- case i:
- a = (t - r) / c + 4;
- break;
- }
- a /= 6;
- }
- return [a, o, l, e[3]];
- }
- function hue2rgb(e, t, r) {
- return (
- r < 0 && (r += 1),
- r > 1 && (r -= 1),
- r < 1 / 6
- ? e + (t - e) * 6 * r
- : r < 1 / 2
- ? t
- : r < 2 / 3
- ? e + (t - e) * (2 / 3 - r) * 6
- : e
- );
- }
- function hslToRgb(e) {
- var t = e[0],
- r = e[1],
- i = e[2],
- s,
- n,
- a;
- if (r === 0) (s = i), (a = i), (n = i);
- else {
- var o = i < 0.5 ? i * (1 + r) : i + r - i * r,
- l = 2 * i - o;
- (s = hue2rgb(l, o, t + 1 / 3)),
- (n = hue2rgb(l, o, t)),
- (a = hue2rgb(l, o, t - 1 / 3));
- }
- return [s, n, a, e[3]];
- }
- function linear(e, t, r, i, s) {
- if (
- ((i === void 0 || s === void 0) &&
- ((i = t), (s = r), (t = 0), (r = 1)),
- r < t)
- ) {
- var n = r;
- (r = t), (t = n);
- }
- if (e <= t) return i;
- if (e >= r) return s;
- var a = r === t ? 0 : (e - t) / (r - t);
- if (!i.length) return i + (s - i) * a;
- var o,
- l = i.length,
- c = createTypedArray('float32', l);
- for (o = 0; o < l; o += 1) c[o] = i[o] + (s[o] - i[o]) * a;
- return c;
- }
- function random(e, t) {
- if (
- (t === void 0 &&
- (e === void 0 ? ((e = 0), (t = 1)) : ((t = e), (e = void 0))),
- t.length)
- ) {
- var r,
- i = t.length;
- e || (e = createTypedArray('float32', i));
- var s = createTypedArray('float32', i),
- n = BMMath.random();
- for (r = 0; r < i; r += 1) s[r] = e[r] + n * (t[r] - e[r]);
- return s;
- }
- e === void 0 && (e = 0);
- var a = BMMath.random();
- return e + a * (t - e);
- }
- function createPath(e, t, r, i) {
- var s,
- n = e.length,
- a = shapePool.newElement();
- a.setPathData(!!i, n);
- var o = [0, 0],
- l,
- c;
- for (s = 0; s < n; s += 1)
- (l = t && t[s] ? t[s] : o),
- (c = r && r[s] ? r[s] : o),
- a.setTripleAt(
- e[s][0],
- e[s][1],
- c[0] + e[s][0],
- c[1] + e[s][1],
- l[0] + e[s][0],
- l[1] + e[s][1],
- s,
- !0
- );
- return a;
- }
- function initiateExpression(elem, data, property) {
- function noOp(e) {
- return e;
- }
- if (!elem.globalData.renderConfig.runExpressions) return noOp;
- var val = data.x,
- needsVelocity = /velocity(?![\w\d])/.test(val),
- _needsRandom = val.indexOf('random') !== -1,
- elemType = elem.data.ty,
- transform,
- $bm_transform,
- content,
- effect,
- thisProperty = property;
- (thisProperty.valueAtTime = thisProperty.getValueAtTime),
- Object.defineProperty(thisProperty, 'value', {
- get: function () {
- return thisProperty.v;
- }
- }),
- (elem.comp.frameDuration = 1 / elem.comp.globalData.frameRate),
- (elem.comp.displayStartTime = 0);
- var inPoint = elem.data.ip / elem.comp.globalData.frameRate,
- outPoint = elem.data.op / elem.comp.globalData.frameRate,
- width = elem.data.sw ? elem.data.sw : 0,
- height = elem.data.sh ? elem.data.sh : 0,
- name = elem.data.nm,
- 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],
- numKeys = property.kf ? data.k.length : 0,
- active = !this.data || this.data.hd !== !0,
- wiggle = function e(t, r) {
- var i,
- s,
- n = this.pv.length ? this.pv.length : 1,
- a = createTypedArray('float32', n);
- t = 5;
- var o = Math.floor(time * t);
- for (i = 0, s = 0; i < o; ) {
- for (s = 0; s < n; s += 1)
- a[s] += -r + r * 2 * BMMath.random();
- i += 1;
- }
- var l = time * t,
- c = l - Math.floor(l),
- g = createTypedArray('float32', n);
- if (n > 1) {
- for (s = 0; s < n; s += 1)
- g[s] =
- this.pv[s] + a[s] + (-r + r * 2 * BMMath.random()) * c;
- return g;
- }
- return this.pv + a[0] + (-r + r * 2 * BMMath.random()) * c;
- }.bind(this);
- 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));
- function loopInDuration(e, t) {
- return loopIn(e, t, !0);
- }
- function loopOutDuration(e, t) {
- return loopOut(e, t, !0);
- }
- this.getValueAtTime &&
- (valueAtTime = this.getValueAtTime.bind(this)),
- this.getVelocityAtTime &&
- (velocityAtTime = this.getVelocityAtTime.bind(this));
- var comp = elem.comp.globalData.projectInterface.bind(
- elem.comp.globalData.projectInterface
- );
- function lookAt(e, t) {
- var r = [t[0] - e[0], t[1] - e[1], t[2] - e[2]],
- i =
- Math.atan2(r[0], Math.sqrt(r[1] * r[1] + r[2] * r[2])) /
- degToRads,
- s = -Math.atan2(r[1], r[2]) / degToRads;
- return [s, i, 0];
- }
- function easeOut(e, t, r, i, s) {
- return applyEase(easeOutBez, e, t, r, i, s);
- }
- function easeIn(e, t, r, i, s) {
- return applyEase(easeInBez, e, t, r, i, s);
- }
- function ease(e, t, r, i, s) {
- return applyEase(easeInOutBez, e, t, r, i, s);
- }
- function applyEase(e, t, r, i, s, n) {
- s === void 0 ? ((s = r), (n = i)) : (t = (t - r) / (i - r)),
- t > 1 ? (t = 1) : t < 0 && (t = 0);
- var a = e(t);
- if ($bm_isInstanceOfArray(s)) {
- var o,
- l = s.length,
- c = createTypedArray('float32', l);
- for (o = 0; o < l; o += 1) c[o] = (n[o] - s[o]) * a + s[o];
- return c;
- }
- return (n - s) * a + s;
- }
- function nearestKey(e) {
- var t,
- r = data.k.length,
- i,
- s;
- if (!data.k.length || typeof data.k[0] == 'number')
- (i = 0), (s = 0);
- else if (
- ((i = -1),
- (e *= elem.comp.globalData.frameRate),
- e < data.k[0].t)
- )
- (i = 1), (s = data.k[0].t);
- else {
- for (t = 0; t < r - 1; t += 1)
- if (e === data.k[t].t) {
- (i = t + 1), (s = data.k[t].t);
- break;
- } else if (e > data.k[t].t && e < data.k[t + 1].t) {
- e - data.k[t].t > data.k[t + 1].t - e
- ? ((i = t + 2), (s = data.k[t + 1].t))
- : ((i = t + 1), (s = data.k[t].t));
- break;
- }
- i === -1 && ((i = t + 1), (s = data.k[t].t));
- }
- var n = {};
- return (
- (n.index = i), (n.time = s / elem.comp.globalData.frameRate), n
- );
- }
- function key(e) {
- var t, r, i;
- if (!data.k.length || typeof data.k[0] == 'number')
- throw new Error('The property has no keyframe at index ' + e);
- (e -= 1),
- (t = {
- time: data.k[e].t / elem.comp.globalData.frameRate,
- value: []
- });
- var s = Object.prototype.hasOwnProperty.call(data.k[e], 's')
- ? data.k[e].s
- : data.k[e - 1].e;
- for (i = s.length, r = 0; r < i; r += 1)
- (t[r] = s[r]), (t.value[r] = s[r]);
- return t;
- }
- function framesToTime(e, t) {
- return t || (t = elem.comp.globalData.frameRate), e / t;
- }
- function timeToFrames(e, t) {
- return (
- !e && e !== 0 && (e = time),
- t || (t = elem.comp.globalData.frameRate),
- e * t
- );
- }
- function seedRandom(e) {
- BMMath.seedrandom(randSeed + e);
- }
- function sourceRectAtTime() {
- return elem.sourceRectAtTime();
- }
- function substring(e, t) {
- return typeof value == 'string'
- ? t === void 0
- ? value.substring(e)
- : value.substring(e, t)
- : '';
- }
- function substr(e, t) {
- return typeof value == 'string'
- ? t === void 0
- ? value.substr(e)
- : value.substr(e, t)
- : '';
- }
- function posterizeTime(e) {
- (time = e === 0 ? 0 : Math.floor(time * e) / e),
- (value = valueAtTime(time));
- }
- var time,
- velocity,
- value,
- text,
- textIndex,
- textTotal,
- selectorValue,
- index = elem.data.ind,
- hasParent = !!(elem.hierarchy && elem.hierarchy.length),
- parent,
- randSeed = Math.floor(Math.random() * 1e6),
- globalData = elem.globalData;
- function executeExpression(e) {
- return (
- (value = e),
- this.frameExpressionId === elem.globalData.frameId &&
- this.propType !== 'textSelector'
- ? value
- : (this.propType === 'textSelector' &&
- ((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)),
- elemType === 4 &&
- !content &&
- (content = thisLayer('ADBE Root Vectors Group')),
- effect || (effect = thisLayer(4)),
- (hasParent = !!(elem.hierarchy && elem.hierarchy.length)),
- hasParent &&
- !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),
- scoped_bm_rt)
- );
- }
- 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
- );
- }
- 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
- );
- })(),
- expressionHelpers = (function () {
- function e(a, o, l) {
- o.x &&
- ((l.k = !0),
- (l.x = !0),
- (l.initiateExpression = ExpressionManager.initiateExpression),
- l.effectsSequence.push(l.initiateExpression(a, o, l).bind(l)));
- }
- function t(a) {
- return (
- (a *= this.elem.globalData.frameRate),
- (a -= this.offsetTime),
- a !== this._cachingAtTime.lastFrame &&
- ((this._cachingAtTime.lastIndex =
- this._cachingAtTime.lastFrame < a
- ? this._cachingAtTime.lastIndex
- : 0),
- (this._cachingAtTime.value = this.interpolateValue(
- a,
- this._cachingAtTime
- )),
- (this._cachingAtTime.lastFrame = a)),
- this._cachingAtTime.value
- );
- }
- function r(a) {
- var o = -0.01,
- l = this.getValueAtTime(a),
- c = this.getValueAtTime(a + o),
- g = 0;
- if (l.length) {
- var S;
- for (S = 0; S < l.length; S += 1) g += Math.pow(c[S] - l[S], 2);
- g = Math.sqrt(g) * 100;
- } else g = 0;
- return g;
- }
- function i(a) {
- if (this.vel !== void 0) return this.vel;
- var o = -0.001,
- l = this.getValueAtTime(a),
- c = this.getValueAtTime(a + o),
- g;
- if (l.length) {
- g = createTypedArray('float32', l.length);
- var S;
- for (S = 0; S < l.length; S += 1) g[S] = (c[S] - l[S]) / o;
- } else g = (c - l) / o;
- return g;
- }
- function s() {
- return this.pv;
- }
- function n(a) {
- this.propertyGroup = a;
- }
- return {
- searchExpressions: e,
- getSpeedAtTime: r,
- getVelocityAtTime: i,
- getValueAtTime: t,
- getStaticValueAtTime: s,
- setGroupProperty: n
- };
- })();
- function addPropertyDecorator() {
- function e(p, P, b) {
- if (!this.k || !this.keyframes) return this.pv;
- p = p ? p.toLowerCase() : '';
- var y = this.comp.renderedFrame,
- A = this.keyframes,
- u = A[A.length - 1].t;
- if (y <= u) return this.pv;
- var f, m;
- b
- ? (P
- ? (f = Math.abs(u - this.elem.comp.globalData.frameRate * P))
- : (f = Math.max(0, u - this.elem.data.ip)),
- (m = u - f))
- : ((!P || P > A.length - 1) && (P = A.length - 1),
- (m = A[A.length - 1 - P].t),
- (f = u - m));
- var d, E, T;
- if (p === 'pingpong') {
- var x = Math.floor((y - m) / f);
- if (x % 2 !== 0)
- return this.getValueAtTime(
- (f - ((y - m) % f) + m) / this.comp.globalData.frameRate,
- 0
- );
- } else if (p === 'offset') {
- var _ = this.getValueAtTime(m / this.comp.globalData.frameRate, 0),
- I = this.getValueAtTime(u / this.comp.globalData.frameRate, 0),
- V = this.getValueAtTime(
- (((y - m) % f) + m) / this.comp.globalData.frameRate,
- 0
- ),
- D = Math.floor((y - m) / f);
- if (this.pv.length) {
- for (T = new Array(_.length), E = T.length, d = 0; d < E; d += 1)
- T[d] = (I[d] - _[d]) * D + V[d];
- return T;
- }
- return (I - _) * D + V;
- } else if (p === 'continue') {
- var N = this.getValueAtTime(u / this.comp.globalData.frameRate, 0),
- $ = this.getValueAtTime(
- (u - 0.001) / this.comp.globalData.frameRate,
- 0
- );
- if (this.pv.length) {
- for (T = new Array(N.length), E = T.length, d = 0; d < E; d += 1)
- T[d] =
- N[d] +
- ((N[d] - $[d]) * ((y - u) / this.comp.globalData.frameRate)) /
- 5e-4;
- return T;
- }
- return N + (N - $) * ((y - u) / 0.001);
- }
- return this.getValueAtTime(
- (((y - m) % f) + m) / this.comp.globalData.frameRate,
- 0
- );
- }
- function t(p, P, b) {
- if (!this.k) return this.pv;
- p = p ? p.toLowerCase() : '';
- var y = this.comp.renderedFrame,
- A = this.keyframes,
- u = A[0].t;
- if (y >= u) return this.pv;
- var f, m;
- b
- ? (P
- ? (f = Math.abs(this.elem.comp.globalData.frameRate * P))
- : (f = Math.max(0, this.elem.data.op - u)),
- (m = u + f))
- : ((!P || P > A.length - 1) && (P = A.length - 1),
- (m = A[P].t),
- (f = m - u));
- var d, E, T;
- if (p === 'pingpong') {
- var x = Math.floor((u - y) / f);
- if (x % 2 === 0)
- return this.getValueAtTime(
- (((u - y) % f) + u) / this.comp.globalData.frameRate,
- 0
- );
- } else if (p === 'offset') {
- var _ = this.getValueAtTime(u / this.comp.globalData.frameRate, 0),
- I = this.getValueAtTime(m / this.comp.globalData.frameRate, 0),
- V = this.getValueAtTime(
- (f - ((u - y) % f) + u) / this.comp.globalData.frameRate,
- 0
- ),
- D = Math.floor((u - y) / f) + 1;
- if (this.pv.length) {
- for (T = new Array(_.length), E = T.length, d = 0; d < E; d += 1)
- T[d] = V[d] - (I[d] - _[d]) * D;
- return T;
- }
- return V - (I - _) * D;
- } else if (p === 'continue') {
- var N = this.getValueAtTime(u / this.comp.globalData.frameRate, 0),
- $ = this.getValueAtTime(
- (u + 0.001) / this.comp.globalData.frameRate,
- 0
- );
- if (this.pv.length) {
- for (T = new Array(N.length), E = T.length, d = 0; d < E; d += 1)
- T[d] = N[d] + ((N[d] - $[d]) * (u - y)) / 0.001;
- return T;
- }
- return N + ((N - $) * (u - y)) / 0.001;
- }
- return this.getValueAtTime(
- (f - (((u - y) % f) + u)) / this.comp.globalData.frameRate,
- 0
- );
- }
- function r(p, P) {
- if (!this.k) return this.pv;
- if (((p = (p || 0.4) * 0.5), (P = Math.floor(P || 5)), P <= 1))
- return this.pv;
- var b = this.comp.renderedFrame / this.comp.globalData.frameRate,
- y = b - p,
- A = b + p,
- u = P > 1 ? (A - y) / (P - 1) : 1,
- f = 0,
- m = 0,
- d;
- this.pv.length
- ? (d = createTypedArray('float32', this.pv.length))
- : (d = 0);
- for (var E; f < P; ) {
- if (((E = this.getValueAtTime(y + f * u)), this.pv.length))
- for (m = 0; m < this.pv.length; m += 1) d[m] += E[m];
- else d += E;
- f += 1;
- }
- if (this.pv.length) for (m = 0; m < this.pv.length; m += 1) d[m] /= P;
- else d /= P;
- return d;
- }
- function i(p) {
- this._transformCachingAtTime ||
- (this._transformCachingAtTime = { v: new Matrix() });
- var P = this._transformCachingAtTime.v;
- if (
- (P.cloneFromProps(this.pre.props), this.appliedTransformations < 1)
- ) {
- var b = this.a.getValueAtTime(p);
- P.translate(
- -b[0] * this.a.mult,
- -b[1] * this.a.mult,
- b[2] * this.a.mult
- );
- }
- if (this.appliedTransformations < 2) {
- var y = this.s.getValueAtTime(p);
- P.scale(y[0] * this.s.mult, y[1] * this.s.mult, y[2] * this.s.mult);
- }
- if (this.sk && this.appliedTransformations < 3) {
- var A = this.sk.getValueAtTime(p),
- u = this.sa.getValueAtTime(p);
- P.skewFromAxis(-A * this.sk.mult, u * this.sa.mult);
- }
- if (this.r && this.appliedTransformations < 4) {
- var f = this.r.getValueAtTime(p);
- P.rotate(-f * this.r.mult);
- } else if (!this.r && this.appliedTransformations < 4) {
- var m = this.rz.getValueAtTime(p),
- d = this.ry.getValueAtTime(p),
- E = this.rx.getValueAtTime(p),
- T = this.or.getValueAtTime(p);
- P.rotateZ(-m * this.rz.mult)
- .rotateY(d * this.ry.mult)
- .rotateX(E * this.rx.mult)
- .rotateZ(-T[2] * this.or.mult)
- .rotateY(T[1] * this.or.mult)
- .rotateX(T[0] * this.or.mult);
- }
- if (this.data.p && this.data.p.s) {
- var x = this.px.getValueAtTime(p),
- _ = this.py.getValueAtTime(p);
- if (this.data.p.z) {
- var I = this.pz.getValueAtTime(p);
- P.translate(
- x * this.px.mult,
- _ * this.py.mult,
- -I * this.pz.mult
- );
- } else P.translate(x * this.px.mult, _ * this.py.mult, 0);
- } else {
- var V = this.p.getValueAtTime(p);
- P.translate(
- V[0] * this.p.mult,
- V[1] * this.p.mult,
- -V[2] * this.p.mult
- );
- }
- return P;
- }
- function s() {
- return this.v.clone(new Matrix());
- }
- var n = TransformPropertyFactory.getTransformProperty;
- TransformPropertyFactory.getTransformProperty = function (p, P, b) {
- var y = n(p, P, b);
- return (
- y.dynamicProperties.length
- ? (y.getValueAtTime = i.bind(y))
- : (y.getValueAtTime = s.bind(y)),
- (y.setGroupProperty = expressionHelpers.setGroupProperty),
- y
- );
- };
- var a = PropertyFactory.getProp;
- PropertyFactory.getProp = function (p, P, b, y, A) {
- var u = a(p, P, b, y, A);
- u.kf
- ? (u.getValueAtTime = expressionHelpers.getValueAtTime.bind(u))
- : (u.getValueAtTime =
- expressionHelpers.getStaticValueAtTime.bind(u)),
- (u.setGroupProperty = expressionHelpers.setGroupProperty),
- (u.loopOut = e),
- (u.loopIn = t),
- (u.smooth = r),
- (u.getVelocityAtTime = expressionHelpers.getVelocityAtTime.bind(u)),
- (u.getSpeedAtTime = expressionHelpers.getSpeedAtTime.bind(u)),
- (u.numKeys = P.a === 1 ? P.k.length : 0),
- (u.propertyIndex = P.ix);
- var f = 0;
- return (
- b !== 0 &&
- (f = createTypedArray(
- 'float32',
- P.a === 1 ? P.k[0].s.length : P.k.length
- )),
- (u._cachingAtTime = {
- lastFrame: initialDefaultFrame,
- lastIndex: 0,
- value: f
- }),
- expressionHelpers.searchExpressions(p, P, u),
- u.k && A.addDynamicProperty(u),
- u
- );
- };
- function o(p) {
- return (
- this._cachingAtTime ||
- (this._cachingAtTime = {
- shapeValue: shapePool.clone(this.pv),
- lastIndex: 0,
- lastTime: initialDefaultFrame
- }),
- (p *= this.elem.globalData.frameRate),
- (p -= this.offsetTime),
- p !== this._cachingAtTime.lastTime &&
- ((this._cachingAtTime.lastIndex =
- this._cachingAtTime.lastTime < p ? this._caching.lastIndex : 0),
- (this._cachingAtTime.lastTime = p),
- this.interpolateShape(
- p,
- this._cachingAtTime.shapeValue,
- this._cachingAtTime
- )),
- this._cachingAtTime.shapeValue
- );
- }
- var l = ShapePropertyFactory.getConstructorFunction(),
- c = ShapePropertyFactory.getKeyframedConstructorFunction();
- function g() {}
- (g.prototype = {
- vertices: function (P, b) {
- this.k && this.getValue();
- var y = this.v;
- b !== void 0 && (y = this.getValueAtTime(b, 0));
- var A,
- u = y._length,
- f = y[P],
- m = y.v,
- d = createSizedArray(u);
- for (A = 0; A < u; A += 1)
- P === 'i' || P === 'o'
- ? (d[A] = [f[A][0] - m[A][0], f[A][1] - m[A][1]])
- : (d[A] = [f[A][0], f[A][1]]);
- return d;
- },
- points: function (P) {
- return this.vertices('v', P);
- },
- inTangents: function (P) {
- return this.vertices('i', P);
- },
- outTangents: function (P) {
- return this.vertices('o', P);
- },
- isClosed: function () {
- return this.v.c;
- },
- pointOnPath: function (P, b) {
- var y = this.v;
- b !== void 0 && (y = this.getValueAtTime(b, 0)),
- this._segmentsLength ||
- (this._segmentsLength = bez.getSegmentsLength(y));
- for (
- var A = this._segmentsLength,
- u = A.lengths,
- f = A.totalLength * P,
- m = 0,
- d = u.length,
- E = 0,
- T;
- m < d;
- ) {
- if (E + u[m].addedLength > f) {
- var x = m,
- _ = y.c && m === d - 1 ? 0 : m + 1,
- I = (f - E) / u[m].addedLength;
- T = bez.getPointInSegment(
- y.v[x],
- y.v[_],
- y.o[x],
- y.i[_],
- I,
- u[m]
- );
- break;
- } else E += u[m].addedLength;
- m += 1;
- }
- return (
- T ||
- (T = y.c
- ? [y.v[0][0], y.v[0][1]]
- : [y.v[y._length - 1][0], y.v[y._length - 1][1]]),
- T
- );
- },
- vectorOnPath: function (P, b, y) {
- P == 1 ? (P = this.v.c) : P == 0 && (P = 0.999);
- var A = this.pointOnPath(P, b),
- u = this.pointOnPath(P + 0.001, b),
- f = u[0] - A[0],
- m = u[1] - A[1],
- d = Math.sqrt(Math.pow(f, 2) + Math.pow(m, 2));
- if (d === 0) return [0, 0];
- var E = y === 'tangent' ? [f / d, m / d] : [-m / d, f / d];
- return E;
- },
- tangentOnPath: function (P, b) {
- return this.vectorOnPath(P, b, 'tangent');
- },
- normalOnPath: function (P, b) {
- return this.vectorOnPath(P, b, 'normal');
- },
- setGroupProperty: expressionHelpers.setGroupProperty,
- getValueAtTime: expressionHelpers.getStaticValueAtTime
- }),
- extendPrototype([g], l),
- extendPrototype([g], c),
- (c.prototype.getValueAtTime = o),
- (c.prototype.initiateExpression =
- ExpressionManager.initiateExpression);
- var S = ShapePropertyFactory.getShapeProp;
- ShapePropertyFactory.getShapeProp = function (p, P, b, y, A) {
- var u = S(p, P, b, y, A);
- return (
- (u.propertyIndex = P.ix),
- (u.lock = !1),
- b === 3
- ? expressionHelpers.searchExpressions(p, P.pt, u)
- : b === 4 && expressionHelpers.searchExpressions(p, P.ks, u),
- u.k && p.addDynamicProperty(u),
- u
- );
- };
- }
- function initialize$1() {
- addPropertyDecorator();
- }
- function addDecorator() {
- function e() {
- 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;
- }
- (TextProperty.prototype.getExpressionValue = function (t, r) {
- var i = this.calculateExpression(r);
- if (t.t !== i) {
- var s = {};
- return (
- this.copyData(s, t), (s.t = i.toString()), (s.__complete = !1), s
- );
- }
- return t;
- }),
- (TextProperty.prototype.searchProperty = function () {
- var t = this.searchKeyframes(),
- r = this.searchExpressions();
- return (this.kf = t || r), this.kf;
- }),
- (TextProperty.prototype.searchExpressions = e);
- }
- function initialize() {
- addDecorator();
- }
- function SVGComposableEffect() {}
- SVGComposableEffect.prototype = {
- createMergeNode: function e(t, r) {
- var i = createNS('feMerge');
- i.setAttribute('result', t);
- var s, n;
- for (n = 0; n < r.length; n += 1)
- (s = createNS('feMergeNode')),
- s.setAttribute('in', r[n]),
- i.appendChild(s),
- i.appendChild(s);
- return i;
- }
- };
- var linearFilterValue =
- '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';
- function SVGTintFilter(e, t, r, i, s) {
- this.filterManager = t;
- var n = createNS('feColorMatrix');
- n.setAttribute('type', 'matrix'),
- n.setAttribute('color-interpolation-filters', 'linearRGB'),
- n.setAttribute('values', linearFilterValue + ' 1 0'),
- (this.linearFilter = n),
- n.setAttribute('result', i + '_tint_1'),
- e.appendChild(n),
- (n = createNS('feColorMatrix')),
- n.setAttribute('type', 'matrix'),
- n.setAttribute('color-interpolation-filters', 'sRGB'),
- n.setAttribute('values', '1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0'),
- n.setAttribute('result', i + '_tint_2'),
- e.appendChild(n),
- (this.matrixFilter = n);
- var a = this.createMergeNode(i, [s, i + '_tint_1', i + '_tint_2']);
- e.appendChild(a);
- }
- extendPrototype([SVGComposableEffect], SVGTintFilter),
- (SVGTintFilter.prototype.renderFrame = function (e) {
- if (e || this.filterManager._mdf) {
- var t = this.filterManager.effectElements[0].p.v,
- r = this.filterManager.effectElements[1].p.v,
- i = this.filterManager.effectElements[2].p.v / 100;
- this.linearFilter.setAttribute(
- 'values',
- linearFilterValue + ' ' + i + ' 0'
- ),
- this.matrixFilter.setAttribute(
- 'values',
- r[0] -
- t[0] +
- ' 0 0 0 ' +
- t[0] +
- ' ' +
- (r[1] - t[1]) +
- ' 0 0 0 ' +
- t[1] +
- ' ' +
- (r[2] - t[2]) +
- ' 0 0 0 ' +
- t[2] +
- ' 0 0 0 1 0'
- );
- }
- });
- function SVGFillFilter(e, t, r, i) {
- this.filterManager = t;
- var s = createNS('feColorMatrix');
- 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),
- e.appendChild(s),
- (this.matrixFilter = s);
- }
- SVGFillFilter.prototype.renderFrame = function (e) {
- if (e || this.filterManager._mdf) {
- var t = this.filterManager.effectElements[2].p.v,
- r = this.filterManager.effectElements[6].p.v;
- this.matrixFilter.setAttribute(
- 'values',
- '0 0 0 0 ' +
- t[0] +
- ' 0 0 0 0 ' +
- t[1] +
- ' 0 0 0 0 ' +
- t[2] +
- ' 0 0 0 ' +
- r +
- ' 0'
- );
- }
- };
- function SVGStrokeEffect(e, t, r) {
- (this.initialized = !1),
- (this.filterManager = t),
- (this.elem = r),
- (this.paths = []);
- }
- (SVGStrokeEffect.prototype.initialize = function () {
- var e =
- this.elem.layerElement.children ||
- this.elem.layerElement.childNodes,
- t,
- r,
- i,
- s;
- for (
- this.filterManager.effectElements[1].p.v === 1
- ? ((s = this.elem.maskManager.masksProperties.length), (i = 0))
- : ((i = this.filterManager.effectElements[0].p.v - 1), (s = i + 1)),
- r = createNS('g'),
- r.setAttribute('fill', 'none'),
- r.setAttribute('stroke-linecap', 'round'),
- r.setAttribute('stroke-dashoffset', 1),
- i;
- i < s;
- i += 1
- )
- (t = createNS('path')),
- r.appendChild(t),
- this.paths.push({ p: t, m: i });
- if (this.filterManager.effectElements[10].p.v === 3) {
- var n = createNS('mask'),
- a = createElementID();
- n.setAttribute('id', a),
- n.setAttribute('mask-type', 'alpha'),
- n.appendChild(r),
- this.elem.globalData.defs.appendChild(n);
- var o = createNS('g');
- for (
- o.setAttribute('mask', 'url(' + getLocationHref() + '#' + a + ')');
- e[0];
- )
- o.appendChild(e[0]);
- this.elem.layerElement.appendChild(o),
- (this.masker = n),
- r.setAttribute('stroke', '#fff');
- } else if (
- this.filterManager.effectElements[10].p.v === 1 ||
- this.filterManager.effectElements[10].p.v === 2
- ) {
- if (this.filterManager.effectElements[10].p.v === 2)
- for (
- e =
- this.elem.layerElement.children ||
- this.elem.layerElement.childNodes;
- e.length;
- )
- this.elem.layerElement.removeChild(e[0]);
- this.elem.layerElement.appendChild(r),
- this.elem.layerElement.removeAttribute('mask'),
- r.setAttribute('stroke', '#fff');
- }
- (this.initialized = !0), (this.pathMasker = r);
- }),
- (SVGStrokeEffect.prototype.renderFrame = function (e) {
- this.initialized || this.initialize();
- var t,
- r = this.paths.length,
- i,
- s;
- for (t = 0; t < r; t += 1)
- if (
- this.paths[t].m !== -1 &&
- ((i = this.elem.maskManager.viewData[this.paths[t].m]),
- (s = this.paths[t].p),
- (e || this.filterManager._mdf || i.prop._mdf) &&
- s.setAttribute('d', i.lastPath),
- e ||
- this.filterManager.effectElements[9].p._mdf ||
- this.filterManager.effectElements[4].p._mdf ||
- this.filterManager.effectElements[7].p._mdf ||
- this.filterManager.effectElements[8].p._mdf ||
- i.prop._mdf)
- ) {
- var n;
- if (
- this.filterManager.effectElements[7].p.v !== 0 ||
- this.filterManager.effectElements[8].p.v !== 100
- ) {
- var a =
- Math.min(
- this.filterManager.effectElements[7].p.v,
- this.filterManager.effectElements[8].p.v
- ) * 0.01,
- o =
- Math.max(
- this.filterManager.effectElements[7].p.v,
- this.filterManager.effectElements[8].p.v
- ) * 0.01,
- l = s.getTotalLength();
- n = '0 0 0 ' + l * a + ' ';
- var c = l * (o - a),
- g =
- 1 +
- this.filterManager.effectElements[4].p.v *
- 2 *
- this.filterManager.effectElements[9].p.v *
- 0.01,
- S = Math.floor(c / g),
- p;
- for (p = 0; p < S; p += 1)
- n +=
- '1 ' +
- this.filterManager.effectElements[4].p.v *
- 2 *
- this.filterManager.effectElements[9].p.v *
- 0.01 +
- ' ';
- n += '0 ' + l * 10 + ' 0 0';
- } else
- n =
- '1 ' +
- this.filterManager.effectElements[4].p.v *
- 2 *
- this.filterManager.effectElements[9].p.v *
- 0.01;
- s.setAttribute('stroke-dasharray', n);
- }
- if (
- ((e || this.filterManager.effectElements[4].p._mdf) &&
- this.pathMasker.setAttribute(
- 'stroke-width',
- this.filterManager.effectElements[4].p.v * 2
- ),
- (e || this.filterManager.effectElements[6].p._mdf) &&
- this.pathMasker.setAttribute(
- 'opacity',
- this.filterManager.effectElements[6].p.v
- ),
- (this.filterManager.effectElements[10].p.v === 1 ||
- this.filterManager.effectElements[10].p.v === 2) &&
- (e || this.filterManager.effectElements[3].p._mdf))
- ) {
- var P = this.filterManager.effectElements[3].p.v;
- this.pathMasker.setAttribute(
- 'stroke',
- 'rgb(' +
- bmFloor(P[0] * 255) +
- ',' +
- bmFloor(P[1] * 255) +
- ',' +
- bmFloor(P[2] * 255) +
- ')'
- );
- }
- });
- function SVGTritoneFilter(e, t, r, i) {
- this.filterManager = t;
- var s = createNS('feColorMatrix');
- 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'
- ),
- e.appendChild(s);
- var n = createNS('feComponentTransfer');
- n.setAttribute('color-interpolation-filters', 'sRGB'),
- n.setAttribute('result', i),
- (this.matrixFilter = n);
- var a = createNS('feFuncR');
- a.setAttribute('type', 'table'), n.appendChild(a), (this.feFuncR = a);
- var o = createNS('feFuncG');
- o.setAttribute('type', 'table'), n.appendChild(o), (this.feFuncG = o);
- var l = createNS('feFuncB');
- l.setAttribute('type', 'table'),
- n.appendChild(l),
- (this.feFuncB = l),
- e.appendChild(n);
- }
- SVGTritoneFilter.prototype.renderFrame = function (e) {
- if (e || this.filterManager._mdf) {
- var t = this.filterManager.effectElements[0].p.v,
- r = this.filterManager.effectElements[1].p.v,
- i = this.filterManager.effectElements[2].p.v,
- s = i[0] + ' ' + r[0] + ' ' + t[0],
- n = i[1] + ' ' + r[1] + ' ' + t[1],
- a = i[2] + ' ' + r[2] + ' ' + t[2];
- this.feFuncR.setAttribute('tableValues', s),
- this.feFuncG.setAttribute('tableValues', n),
- this.feFuncB.setAttribute('tableValues', a);
- }
- };
- function SVGProLevelsFilter(e, t, r, i) {
- this.filterManager = t;
- var s = this.filterManager.effectElements,
- n = createNS('feComponentTransfer');
- (s[10].p.k ||
- s[10].p.v !== 0 ||
- s[11].p.k ||
- s[11].p.v !== 1 ||
- s[12].p.k ||
- s[12].p.v !== 1 ||
- s[13].p.k ||
- s[13].p.v !== 0 ||
- s[14].p.k ||
- s[14].p.v !== 1) &&
- (this.feFuncR = this.createFeFunc('feFuncR', n)),
- (s[17].p.k ||
- s[17].p.v !== 0 ||
- s[18].p.k ||
- s[18].p.v !== 1 ||
- s[19].p.k ||
- s[19].p.v !== 1 ||
- s[20].p.k ||
- s[20].p.v !== 0 ||
- s[21].p.k ||
- s[21].p.v !== 1) &&
- (this.feFuncG = this.createFeFunc('feFuncG', n)),
- (s[24].p.k ||
- s[24].p.v !== 0 ||
- s[25].p.k ||
- s[25].p.v !== 1 ||
- s[26].p.k ||
- s[26].p.v !== 1 ||
- s[27].p.k ||
- s[27].p.v !== 0 ||
- s[28].p.k ||
- s[28].p.v !== 1) &&
- (this.feFuncB = this.createFeFunc('feFuncB', n)),
- (s[31].p.k ||
- s[31].p.v !== 0 ||
- s[32].p.k ||
- s[32].p.v !== 1 ||
- s[33].p.k ||
- s[33].p.v !== 1 ||
- s[34].p.k ||
- s[34].p.v !== 0 ||
- s[35].p.k ||
- s[35].p.v !== 1) &&
- (this.feFuncA = this.createFeFunc('feFuncA', n)),
- (this.feFuncR || this.feFuncG || this.feFuncB || this.feFuncA) &&
- (n.setAttribute('color-interpolation-filters', 'sRGB'),
- e.appendChild(n)),
- (s[3].p.k ||
- s[3].p.v !== 0 ||
- s[4].p.k ||
- s[4].p.v !== 1 ||
- s[5].p.k ||
- s[5].p.v !== 1 ||
- s[6].p.k ||
- s[6].p.v !== 0 ||
- s[7].p.k ||
- s[7].p.v !== 1) &&
- ((n = createNS('feComponentTransfer')),
- n.setAttribute('color-interpolation-filters', 'sRGB'),
- n.setAttribute('result', i),
- e.appendChild(n),
- (this.feFuncRComposed = this.createFeFunc('feFuncR', n)),
- (this.feFuncGComposed = this.createFeFunc('feFuncG', n)),
- (this.feFuncBComposed = this.createFeFunc('feFuncB', n)));
- }
- (SVGProLevelsFilter.prototype.createFeFunc = function (e, t) {
- var r = createNS(e);
- return r.setAttribute('type', 'table'), t.appendChild(r), r;
- }),
- (SVGProLevelsFilter.prototype.getTableValue = function (e, t, r, i, s) {
- for (
- var n = 0,
- a = 256,
- o,
- l = Math.min(e, t),
- c = Math.max(e, t),
- g = Array.call(null, { length: a }),
- S,
- p = 0,
- P = s - i,
- b = t - e;
- n <= 256;
- )
- (o = n / 256),
- o <= l
- ? (S = b < 0 ? s : i)
- : o >= c
- ? (S = b < 0 ? i : s)
- : (S = i + P * Math.pow((o - e) / b, 1 / r)),
- (g[p] = S),
- (p += 1),
- (n += 256 / (a - 1));
- return g.join(' ');
- }),
- (SVGProLevelsFilter.prototype.renderFrame = function (e) {
- if (e || this.filterManager._mdf) {
- var t,
- r = this.filterManager.effectElements;
- this.feFuncRComposed &&
- (e ||
- r[3].p._mdf ||
- r[4].p._mdf ||
- r[5].p._mdf ||
- r[6].p._mdf ||
- r[7].p._mdf) &&
- ((t = 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', t),
- this.feFuncGComposed.setAttribute('tableValues', t),
- this.feFuncBComposed.setAttribute('tableValues', t)),
- this.feFuncR &&
- (e ||
- r[10].p._mdf ||
- r[11].p._mdf ||
- r[12].p._mdf ||
- r[13].p._mdf ||
- r[14].p._mdf) &&
- ((t = 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', t)),
- this.feFuncG &&
- (e ||
- r[17].p._mdf ||
- r[18].p._mdf ||
- r[19].p._mdf ||
- r[20].p._mdf ||
- r[21].p._mdf) &&
- ((t = 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', t)),
- this.feFuncB &&
- (e ||
- r[24].p._mdf ||
- r[25].p._mdf ||
- r[26].p._mdf ||
- r[27].p._mdf ||
- r[28].p._mdf) &&
- ((t = 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', t)),
- this.feFuncA &&
- (e ||
- r[31].p._mdf ||
- r[32].p._mdf ||
- r[33].p._mdf ||
- r[34].p._mdf ||
- r[35].p._mdf) &&
- ((t = 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', t));
- }
- });
- function SVGDropShadowEffect(e, t, r, i, s) {
- var n = t.container.globalData.renderConfig.filterSize,
- a = t.data.fs || n;
- e.setAttribute('x', a.x || n.x),
- e.setAttribute('y', a.y || n.y),
- e.setAttribute('width', a.width || n.width),
- e.setAttribute('height', a.height || n.height),
- (this.filterManager = t);
- var o = createNS('feGaussianBlur');
- o.setAttribute('in', 'SourceAlpha'),
- o.setAttribute('result', i + '_drop_shadow_1'),
- o.setAttribute('stdDeviation', '0'),
- (this.feGaussianBlur = o),
- e.appendChild(o);
- var l = createNS('feOffset');
- l.setAttribute('dx', '25'),
- l.setAttribute('dy', '0'),
- l.setAttribute('in', i + '_drop_shadow_1'),
- l.setAttribute('result', i + '_drop_shadow_2'),
- (this.feOffset = l),
- e.appendChild(l);
- var c = createNS('feFlood');
- c.setAttribute('flood-color', '#00ff00'),
- c.setAttribute('flood-opacity', '1'),
- c.setAttribute('result', i + '_drop_shadow_3'),
- (this.feFlood = c),
- e.appendChild(c);
- var g = createNS('feComposite');
- g.setAttribute('in', i + '_drop_shadow_3'),
- g.setAttribute('in2', i + '_drop_shadow_2'),
- g.setAttribute('operator', 'in'),
- g.setAttribute('result', i + '_drop_shadow_4'),
- e.appendChild(g);
- var S = this.createMergeNode(i, [i + '_drop_shadow_4', s]);
- e.appendChild(S);
- }
- extendPrototype([SVGComposableEffect], SVGDropShadowEffect),
- (SVGDropShadowEffect.prototype.renderFrame = function (e) {
- if (e || this.filterManager._mdf) {
- if (
- ((e || this.filterManager.effectElements[4].p._mdf) &&
- this.feGaussianBlur.setAttribute(
- 'stdDeviation',
- this.filterManager.effectElements[4].p.v / 4
- ),
- e || this.filterManager.effectElements[0].p._mdf)
- ) {
- var t = this.filterManager.effectElements[0].p.v;
- this.feFlood.setAttribute(
- 'flood-color',
- rgbToHex(
- Math.round(t[0] * 255),
- Math.round(t[1] * 255),
- Math.round(t[2] * 255)
- )
- );
- }
- if (
- ((e || this.filterManager.effectElements[1].p._mdf) &&
- this.feFlood.setAttribute(
- 'flood-opacity',
- this.filterManager.effectElements[1].p.v / 255
- ),
- e ||
- this.filterManager.effectElements[2].p._mdf ||
- this.filterManager.effectElements[3].p._mdf)
- ) {
- var r = this.filterManager.effectElements[3].p.v,
- i = (this.filterManager.effectElements[2].p.v - 90) * degToRads,
- s = r * Math.cos(i),
- n = r * Math.sin(i);
- this.feOffset.setAttribute('dx', s),
- this.feOffset.setAttribute('dy', n);
- }
- }
- });
- var _svgMatteSymbols = [];
- function SVGMatte3Effect(e, t, r) {
- (this.initialized = !1),
- (this.filterManager = t),
- (this.filterElem = e),
- (this.elem = r),
- (r.matteElement = createNS('g')),
- r.matteElement.appendChild(r.layerElement),
- r.matteElement.appendChild(r.transformedElement),
- (r.baseElement = r.matteElement);
- }
- (SVGMatte3Effect.prototype.findSymbol = function (e) {
- for (var t = 0, r = _svgMatteSymbols.length; t < r; ) {
- if (_svgMatteSymbols[t] === e) return _svgMatteSymbols[t];
- t += 1;
- }
- return null;
- }),
- (SVGMatte3Effect.prototype.replaceInParent = function (e, t) {
- var r = e.layerElement.parentNode;
- if (r) {
- for (
- var i = r.children, s = 0, n = i.length;
- s < n && i[s] !== e.layerElement;
- )
- s += 1;
- var a;
- s <= n - 2 && (a = i[s + 1]);
- var o = createNS('use');
- o.setAttribute('href', '#' + t),
- a ? r.insertBefore(o, a) : r.appendChild(o);
- }
- }),
- (SVGMatte3Effect.prototype.setElementAsMask = function (e, t) {
- if (!this.findSymbol(t)) {
- var r = createElementID(),
- i = createNS('mask');
- i.setAttribute('id', t.layerId),
- i.setAttribute('mask-type', 'alpha'),
- _svgMatteSymbols.push(t);
- var s = e.globalData.defs;
- s.appendChild(i);
- var n = createNS('symbol');
- n.setAttribute('id', r),
- this.replaceInParent(t, r),
- n.appendChild(t.layerElement),
- s.appendChild(n);
- var a = createNS('use');
- a.setAttribute('href', '#' + r),
- i.appendChild(a),
- (t.data.hd = !1),
- t.show();
- }
- e.setMatte(t.layerId);
- }),
- (SVGMatte3Effect.prototype.initialize = function () {
- for (
- var e = this.filterManager.effectElements[0].p.v,
- t = this.elem.comp.elements,
- r = 0,
- i = t.length;
- r < i;
- )
- t[r] &&
- t[r].data.ind === e &&
- this.setElementAsMask(this.elem, t[r]),
- (r += 1);
- this.initialized = !0;
- }),
- (SVGMatte3Effect.prototype.renderFrame = function () {
- this.initialized || this.initialize();
- });
- function SVGGaussianBlurEffect(e, t, r, i) {
- e.setAttribute('x', '-100%'),
- e.setAttribute('y', '-100%'),
- e.setAttribute('width', '300%'),
- e.setAttribute('height', '300%'),
- (this.filterManager = t);
- var s = createNS('feGaussianBlur');
- s.setAttribute('result', i),
- e.appendChild(s),
- (this.feGaussianBlur = s);
- }
- return (
- (SVGGaussianBlurEffect.prototype.renderFrame = function (e) {
- if (e || this.filterManager._mdf) {
- var t = 0.3,
- r = this.filterManager.effectElements[0].p.v * t,
- i = this.filterManager.effectElements[1].p.v,
- s = i == 3 ? 0 : r,
- n = i == 2 ? 0 : r;
- this.feGaussianBlur.setAttribute('stdDeviation', s + ' ' + n);
- var a =
- this.filterManager.effectElements[2].p.v == 1
- ? 'wrap'
- : 'duplicate';
- this.feGaussianBlur.setAttribute('edgeMode', a);
- }
- }),
- 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),
- ShapeModifiers.registerModifier('zz', ZigZagModifier),
- ShapeModifiers.registerModifier('op', OffsetPathModifier),
- setExpressionsPlugin(Expressions),
- setExpressionInterfaces(getInterface),
- 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
- );
- });
- })(lottie, lottieExports);
- const Lottie = lottieExports;
- var freeGlobal =
- typeof global == 'object' && global && global.Object === Object && global,
- freeGlobal$1 = freeGlobal,
- freeSelf = typeof self == 'object' && self && self.Object === Object && self,
- root = freeGlobal$1 || freeSelf || Function('return this')(),
- root$1 = root,
- Symbol$1 = root$1.Symbol,
- Symbol$2 = Symbol$1,
- objectProto$e = Object.prototype,
- hasOwnProperty$b = objectProto$e.hasOwnProperty,
- nativeObjectToString$1 = objectProto$e.toString,
- symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0;
- function getRawTag(e) {
- var t = hasOwnProperty$b.call(e, symToStringTag$1),
- r = e[symToStringTag$1];
- try {
- e[symToStringTag$1] = void 0;
- var i = !0;
- } catch {}
- var s = nativeObjectToString$1.call(e);
- return i && (t ? (e[symToStringTag$1] = r) : delete e[symToStringTag$1]), s;
- }
- var objectProto$d = Object.prototype,
- nativeObjectToString = objectProto$d.toString;
- function objectToString(e) {
- return nativeObjectToString.call(e);
- }
- var nullTag = '[object Null]',
- undefinedTag = '[object Undefined]',
- symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0;
- function baseGetTag(e) {
- return e == null
- ? e === void 0
- ? undefinedTag
- : nullTag
- : symToStringTag && symToStringTag in Object(e)
- ? getRawTag(e)
- : objectToString(e);
- }
- function isObjectLike(e) {
- return e != null && typeof e == 'object';
- }
- var isArray$2 = Array.isArray,
- isArray$1$1 = isArray$2;
- function isObject$2(e) {
- var t = typeof e;
- return e != null && (t == 'object' || t == 'function');
- }
- var asyncTag = '[object AsyncFunction]',
- funcTag$2 = '[object Function]',
- genTag$1 = '[object GeneratorFunction]',
- proxyTag = '[object Proxy]';
- function isFunction$2(e) {
- if (!isObject$2(e)) return !1;
- var t = baseGetTag(e);
- return t == funcTag$2 || t == genTag$1 || t == asyncTag || t == proxyTag;
- }
- var coreJsData = root$1['__core-js_shared__'],
- coreJsData$1 = coreJsData,
- maskSrcKey = (function () {
- var e = /[^.]+$/.exec(
- (coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO) || ''
- );
- return e ? 'Symbol(src)_1.' + e : '';
- })();
- function isMasked(e) {
- return !!maskSrcKey && maskSrcKey in e;
- }
- var funcProto$1 = Function.prototype,
- funcToString$1 = funcProto$1.toString;
- function toSource(e) {
- if (e != null) {
- try {
- return funcToString$1.call(e);
- } catch {}
- try {
- return e + '';
- } catch {}
- }
- return '';
- }
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
- reIsHostCtor = /^\[object .+?Constructor\]$/,
- funcProto = Function.prototype,
- objectProto$c = Object.prototype,
- funcToString = funcProto.toString,
- hasOwnProperty$a = objectProto$c.hasOwnProperty,
- reIsNative = RegExp(
- '^' +
- funcToString
- .call(hasOwnProperty$a)
- .replace(reRegExpChar, '\\$&')
- .replace(
- /hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,
- '$1.*?'
- ) +
- '$'
- );
- function baseIsNative(e) {
- if (!isObject$2(e) || isMasked(e)) return !1;
- var t = isFunction$2(e) ? reIsNative : reIsHostCtor;
- return t.test(toSource(e));
- }
- function getValue(e, t) {
- return e == null ? void 0 : e[t];
- }
- function getNative(e, t) {
- var r = getValue(e, t);
- return baseIsNative(r) ? r : void 0;
- }
- var WeakMap$1 = getNative(root$1, 'WeakMap'),
- WeakMap$1$1 = WeakMap$1,
- objectCreate = Object.create,
- baseCreate = (function () {
- function e() {}
- return function (t) {
- if (!isObject$2(t)) return {};
- if (objectCreate) return objectCreate(t);
- e.prototype = t;
- var r = new e();
- return (e.prototype = void 0), r;
- };
- })(),
- baseCreate$1 = baseCreate;
- function copyArray(e, t) {
- var r = -1,
- i = e.length;
- for (t || (t = Array(i)); ++r < i; ) t[r] = e[r];
- return t;
- }
- var defineProperty = (function () {
- try {
- var e = getNative(Object, 'defineProperty');
- return e({}, '', {}), e;
- } catch {}
- })(),
- defineProperty$1 = defineProperty;
- function arrayEach(e, t) {
- for (
- var r = -1, i = e == null ? 0 : e.length;
- ++r < i && t(e[r], r, e) !== !1;
- );
- return e;
- }
- var MAX_SAFE_INTEGER$1 = 9007199254740991,
- reIsUint = /^(?:0|[1-9]\d*)$/;
- function isIndex(e, t) {
- var r = typeof e;
- return (
- (t = t ?? MAX_SAFE_INTEGER$1),
- !!t &&
- (r == 'number' || (r != 'symbol' && reIsUint.test(e))) &&
- e > -1 &&
- e % 1 == 0 &&
- e < t
- );
- }
- function baseAssignValue(e, t, r) {
- t == '__proto__' && defineProperty$1
- ? defineProperty$1(e, t, {
- configurable: !0,
- enumerable: !0,
- value: r,
- writable: !0
- })
- : (e[t] = r);
- }
- function eq(e, t) {
- return e === t || (e !== e && t !== t);
- }
- var objectProto$b = Object.prototype,
- hasOwnProperty$9 = objectProto$b.hasOwnProperty;
- function assignValue(e, t, r) {
- var i = e[t];
- (!(hasOwnProperty$9.call(e, t) && eq(i, r)) || (r === void 0 && !(t in e))) &&
- baseAssignValue(e, t, r);
- }
- function copyObject(e, t, r, i) {
- var s = !r;
- r || (r = {});
- for (var n = -1, a = t.length; ++n < a; ) {
- var o = t[n],
- l = i ? i(r[o], e[o], o, r, e) : void 0;
- l === void 0 && (l = e[o]),
- s ? baseAssignValue(r, o, l) : assignValue(r, o, l);
- }
- return r;
- }
- var MAX_SAFE_INTEGER = 9007199254740991;
- function isLength(e) {
- return typeof e == 'number' && e > -1 && e % 1 == 0 && e <= MAX_SAFE_INTEGER;
- }
- function isArrayLike(e) {
- return e != null && isLength(e.length) && !isFunction$2(e);
- }
- var objectProto$a = Object.prototype;
- function isPrototype(e) {
- var t = e && e.constructor,
- r = (typeof t == 'function' && t.prototype) || objectProto$a;
- return e === r;
- }
- function baseTimes(e, t) {
- for (var r = -1, i = Array(e); ++r < e; ) i[r] = t(r);
- return i;
- }
- var argsTag$3 = '[object Arguments]';
- function baseIsArguments(e) {
- return isObjectLike(e) && baseGetTag(e) == argsTag$3;
- }
- var objectProto$9 = Object.prototype,
- hasOwnProperty$8 = objectProto$9.hasOwnProperty,
- propertyIsEnumerable$1 = objectProto$9.propertyIsEnumerable,
- isArguments = baseIsArguments(
- (function () {
- return arguments;
- })()
- )
- ? baseIsArguments
- : function (e) {
- return (
- isObjectLike(e) &&
- hasOwnProperty$8.call(e, 'callee') &&
- !propertyIsEnumerable$1.call(e, 'callee')
- );
- },
- isArguments$1 = isArguments;
- function stubFalse() {
- return !1;
- }
- var freeExports$2 =
- typeof exports == 'object' && exports && !exports.nodeType && exports,
- freeModule$2 =
- freeExports$2 &&
- typeof module == 'object' &&
- module &&
- !module.nodeType &&
- module,
- moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2,
- Buffer$1 = moduleExports$2 ? root$1.Buffer : void 0,
- nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : void 0,
- isBuffer = nativeIsBuffer || stubFalse,
- isBuffer$1 = isBuffer,
- argsTag$2 = '[object Arguments]',
- arrayTag$2 = '[object Array]',
- boolTag$3 = '[object Boolean]',
- dateTag$3 = '[object Date]',
- errorTag$2 = '[object Error]',
- funcTag$1 = '[object Function]',
- mapTag$5 = '[object Map]',
- numberTag$3 = '[object Number]',
- objectTag$3 = '[object Object]',
- regexpTag$3 = '[object RegExp]',
- setTag$5 = '[object Set]',
- stringTag$3 = '[object String]',
- weakMapTag$2 = '[object WeakMap]',
- arrayBufferTag$3 = '[object ArrayBuffer]',
- dataViewTag$4 = '[object DataView]',
- float32Tag$2 = '[object Float32Array]',
- float64Tag$2 = '[object Float64Array]',
- int8Tag$2 = '[object Int8Array]',
- int16Tag$2 = '[object Int16Array]',
- int32Tag$2 = '[object Int32Array]',
- uint8Tag$2 = '[object Uint8Array]',
- uint8ClampedTag$2 = '[object Uint8ClampedArray]',
- uint16Tag$2 = '[object Uint16Array]',
- uint32Tag$2 = '[object Uint32Array]',
- typedArrayTags = {};
- typedArrayTags[float32Tag$2] =
- typedArrayTags[float64Tag$2] =
- typedArrayTags[int8Tag$2] =
- typedArrayTags[int16Tag$2] =
- typedArrayTags[int32Tag$2] =
- typedArrayTags[uint8Tag$2] =
- typedArrayTags[uint8ClampedTag$2] =
- typedArrayTags[uint16Tag$2] =
- typedArrayTags[uint32Tag$2] =
- !0;
- typedArrayTags[argsTag$2] =
- typedArrayTags[arrayTag$2] =
- typedArrayTags[arrayBufferTag$3] =
- typedArrayTags[boolTag$3] =
- typedArrayTags[dataViewTag$4] =
- typedArrayTags[dateTag$3] =
- typedArrayTags[errorTag$2] =
- typedArrayTags[funcTag$1] =
- typedArrayTags[mapTag$5] =
- typedArrayTags[numberTag$3] =
- typedArrayTags[objectTag$3] =
- typedArrayTags[regexpTag$3] =
- typedArrayTags[setTag$5] =
- typedArrayTags[stringTag$3] =
- typedArrayTags[weakMapTag$2] =
- !1;
- function baseIsTypedArray(e) {
- return (
- isObjectLike(e) && isLength(e.length) && !!typedArrayTags[baseGetTag(e)]
- );
- }
- function baseUnary(e) {
- return function (t) {
- return e(t);
- };
- }
- var freeExports$1 =
- typeof exports == 'object' && exports && !exports.nodeType && exports,
- freeModule$1 =
- freeExports$1 &&
- typeof module == 'object' &&
- module &&
- !module.nodeType &&
- module,
- moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1,
- freeProcess = moduleExports$1 && freeGlobal$1.process,
- nodeUtil = (function () {
- try {
- var e =
- freeModule$1 &&
- freeModule$1.require &&
- freeModule$1.require('util').types;
- return (
- e || (freeProcess && freeProcess.binding && freeProcess.binding('util'))
- );
- } catch {}
- })(),
- nodeUtil$1 = nodeUtil,
- nodeIsTypedArray = nodeUtil$1 && nodeUtil$1.isTypedArray,
- isTypedArray = nodeIsTypedArray
- ? baseUnary(nodeIsTypedArray)
- : baseIsTypedArray,
- isTypedArray$1 = isTypedArray,
- objectProto$8 = Object.prototype,
- hasOwnProperty$7 = objectProto$8.hasOwnProperty;
- function arrayLikeKeys(e, t) {
- var r = isArray$1$1(e),
- i = !r && isArguments$1(e),
- s = !r && !i && isBuffer$1(e),
- n = !r && !i && !s && isTypedArray$1(e),
- a = r || i || s || n,
- o = a ? baseTimes(e.length, String) : [],
- l = o.length;
- for (var c in e)
- (t || hasOwnProperty$7.call(e, c)) &&
- !(
- a &&
- (c == 'length' ||
- (s && (c == 'offset' || c == 'parent')) ||
- (n && (c == 'buffer' || c == 'byteLength' || c == 'byteOffset')) ||
- isIndex(c, l))
- ) &&
- o.push(c);
- return o;
- }
- function overArg(e, t) {
- return function (r) {
- return e(t(r));
- };
- }
- var nativeKeys = overArg(Object.keys, Object),
- nativeKeys$1 = nativeKeys,
- objectProto$7 = Object.prototype,
- hasOwnProperty$6 = objectProto$7.hasOwnProperty;
- function baseKeys(e) {
- if (!isPrototype(e)) return nativeKeys$1(e);
- var t = [];
- for (var r in Object(e))
- hasOwnProperty$6.call(e, r) && r != 'constructor' && t.push(r);
- return t;
- }
- function keys(e) {
- return isArrayLike(e) ? arrayLikeKeys(e) : baseKeys(e);
- }
- function nativeKeysIn(e) {
- var t = [];
- if (e != null) for (var r in Object(e)) t.push(r);
- return t;
- }
- var objectProto$6 = Object.prototype,
- hasOwnProperty$5 = objectProto$6.hasOwnProperty;
- function baseKeysIn(e) {
- if (!isObject$2(e)) return nativeKeysIn(e);
- var t = isPrototype(e),
- r = [];
- for (var i in e)
- (i == 'constructor' && (t || !hasOwnProperty$5.call(e, i))) || r.push(i);
- return r;
- }
- function keysIn(e) {
- return isArrayLike(e) ? arrayLikeKeys(e, !0) : baseKeysIn(e);
- }
- var nativeCreate = getNative(Object, 'create'),
- nativeCreate$1 = nativeCreate;
- function hashClear() {
- (this.__data__ = nativeCreate$1 ? nativeCreate$1(null) : {}), (this.size = 0);
- }
- function hashDelete(e) {
- var t = this.has(e) && delete this.__data__[e];
- return (this.size -= t ? 1 : 0), t;
- }
- var HASH_UNDEFINED$2 = '__lodash_hash_undefined__',
- objectProto$5 = Object.prototype,
- hasOwnProperty$4 = objectProto$5.hasOwnProperty;
- function hashGet(e) {
- var t = this.__data__;
- if (nativeCreate$1) {
- var r = t[e];
- return r === HASH_UNDEFINED$2 ? void 0 : r;
- }
- return hasOwnProperty$4.call(t, e) ? t[e] : void 0;
- }
- var objectProto$4 = Object.prototype,
- hasOwnProperty$3 = objectProto$4.hasOwnProperty;
- function hashHas(e) {
- var t = this.__data__;
- return nativeCreate$1 ? t[e] !== void 0 : hasOwnProperty$3.call(t, e);
- }
- var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
- function hashSet(e, t) {
- var r = this.__data__;
- return (
- (this.size += this.has(e) ? 0 : 1),
- (r[e] = nativeCreate$1 && t === void 0 ? HASH_UNDEFINED$1 : t),
- this
- );
- }
- function Hash(e) {
- var t = -1,
- r = e == null ? 0 : e.length;
- for (this.clear(); ++t < r; ) {
- var i = e[t];
- this.set(i[0], i[1]);
- }
- }
- Hash.prototype.clear = hashClear;
- Hash.prototype.delete = hashDelete;
- Hash.prototype.get = hashGet;
- Hash.prototype.has = hashHas;
- Hash.prototype.set = hashSet;
- function listCacheClear() {
- (this.__data__ = []), (this.size = 0);
- }
- function assocIndexOf(e, t) {
- for (var r = e.length; r--; ) if (eq(e[r][0], t)) return r;
- return -1;
- }
- var arrayProto = Array.prototype,
- splice = arrayProto.splice;
- function listCacheDelete(e) {
- var t = this.__data__,
- r = assocIndexOf(t, e);
- if (r < 0) return !1;
- var i = t.length - 1;
- return r == i ? t.pop() : splice.call(t, r, 1), --this.size, !0;
- }
- function listCacheGet(e) {
- var t = this.__data__,
- r = assocIndexOf(t, e);
- return r < 0 ? void 0 : t[r][1];
- }
- function listCacheHas(e) {
- return assocIndexOf(this.__data__, e) > -1;
- }
- function listCacheSet(e, t) {
- var r = this.__data__,
- i = assocIndexOf(r, e);
- return i < 0 ? (++this.size, r.push([e, t])) : (r[i][1] = t), this;
- }
- function ListCache(e) {
- var t = -1,
- r = e == null ? 0 : e.length;
- for (this.clear(); ++t < r; ) {
- var i = e[t];
- this.set(i[0], i[1]);
- }
- }
- ListCache.prototype.clear = listCacheClear;
- ListCache.prototype.delete = listCacheDelete;
- ListCache.prototype.get = listCacheGet;
- ListCache.prototype.has = listCacheHas;
- ListCache.prototype.set = listCacheSet;
- var Map = getNative(root$1, 'Map'),
- Map$1 = Map;
- function mapCacheClear() {
- (this.size = 0),
- (this.__data__ = {
- hash: new Hash(),
- map: new (Map$1 || ListCache)(),
- string: new Hash()
- });
- }
- function isKeyable(e) {
- var t = typeof e;
- return t == 'string' || t == 'number' || t == 'symbol' || t == 'boolean'
- ? e !== '__proto__'
- : e === null;
- }
- function getMapData(e, t) {
- var r = e.__data__;
- return isKeyable(t) ? r[typeof t == 'string' ? 'string' : 'hash'] : r.map;
- }
- function mapCacheDelete(e) {
- var t = getMapData(this, e).delete(e);
- return (this.size -= t ? 1 : 0), t;
- }
- function mapCacheGet(e) {
- return getMapData(this, e).get(e);
- }
- function mapCacheHas(e) {
- return getMapData(this, e).has(e);
- }
- function mapCacheSet(e, t) {
- var r = getMapData(this, e),
- i = r.size;
- return r.set(e, t), (this.size += r.size == i ? 0 : 1), this;
- }
- function MapCache(e) {
- var t = -1,
- r = e == null ? 0 : e.length;
- for (this.clear(); ++t < r; ) {
- var i = e[t];
- this.set(i[0], i[1]);
- }
- }
- MapCache.prototype.clear = mapCacheClear;
- MapCache.prototype.delete = mapCacheDelete;
- MapCache.prototype.get = mapCacheGet;
- MapCache.prototype.has = mapCacheHas;
- MapCache.prototype.set = mapCacheSet;
- function arrayPush(e, t) {
- for (var r = -1, i = t.length, s = e.length; ++r < i; ) e[s + r] = t[r];
- return e;
- }
- var getPrototype = overArg(Object.getPrototypeOf, Object),
- getPrototype$1 = getPrototype;
- function stackClear() {
- (this.__data__ = new ListCache()), (this.size = 0);
- }
- function stackDelete(e) {
- var t = this.__data__,
- r = t.delete(e);
- return (this.size = t.size), r;
- }
- function stackGet(e) {
- return this.__data__.get(e);
- }
- function stackHas(e) {
- return this.__data__.has(e);
- }
- var LARGE_ARRAY_SIZE = 200;
- function stackSet(e, t) {
- var r = this.__data__;
- if (r instanceof ListCache) {
- var i = r.__data__;
- if (!Map$1 || i.length < LARGE_ARRAY_SIZE - 1)
- return i.push([e, t]), (this.size = ++r.size), this;
- r = this.__data__ = new MapCache(i);
- }
- return r.set(e, t), (this.size = r.size), this;
- }
- function Stack(e) {
- var t = (this.__data__ = new ListCache(e));
- this.size = t.size;
- }
- Stack.prototype.clear = stackClear;
- Stack.prototype.delete = stackDelete;
- Stack.prototype.get = stackGet;
- Stack.prototype.has = stackHas;
- Stack.prototype.set = stackSet;
- function baseAssign(e, t) {
- return e && copyObject(t, keys(t), e);
- }
- function baseAssignIn(e, t) {
- return e && copyObject(t, keysIn(t), e);
- }
- var freeExports =
- typeof exports == 'object' && exports && !exports.nodeType && exports,
- freeModule =
- freeExports &&
- typeof module == 'object' &&
- module &&
- !module.nodeType &&
- module,
- moduleExports = freeModule && freeModule.exports === freeExports,
- Buffer = moduleExports ? root$1.Buffer : void 0,
- allocUnsafe = Buffer ? Buffer.allocUnsafe : void 0;
- function cloneBuffer(e, t) {
- if (t) return e.slice();
- var r = e.length,
- i = allocUnsafe ? allocUnsafe(r) : new e.constructor(r);
- return e.copy(i), i;
- }
- function arrayFilter(e, t) {
- for (var r = -1, i = e == null ? 0 : e.length, s = 0, n = []; ++r < i; ) {
- var a = e[r];
- t(a, r, e) && (n[s++] = a);
- }
- return n;
- }
- function stubArray() {
- return [];
- }
- var objectProto$3 = Object.prototype,
- propertyIsEnumerable = objectProto$3.propertyIsEnumerable,
- nativeGetSymbols$1 = Object.getOwnPropertySymbols,
- getSymbols = nativeGetSymbols$1
- ? function (e) {
- return e == null
- ? []
- : ((e = Object(e)),
- arrayFilter(nativeGetSymbols$1(e), function (t) {
- return propertyIsEnumerable.call(e, t);
- }));
- }
- : stubArray,
- getSymbols$1 = getSymbols;
- function copySymbols(e, t) {
- return copyObject(e, getSymbols$1(e), t);
- }
- var nativeGetSymbols = Object.getOwnPropertySymbols,
- getSymbolsIn = nativeGetSymbols
- ? function (e) {
- for (var t = []; e; )
- arrayPush(t, getSymbols$1(e)), (e = getPrototype$1(e));
- return t;
- }
- : stubArray,
- getSymbolsIn$1 = getSymbolsIn;
- function copySymbolsIn(e, t) {
- return copyObject(e, getSymbolsIn$1(e), t);
- }
- function baseGetAllKeys(e, t, r) {
- var i = t(e);
- return isArray$1$1(e) ? i : arrayPush(i, r(e));
- }
- function getAllKeys(e) {
- return baseGetAllKeys(e, keys, getSymbols$1);
- }
- function getAllKeysIn(e) {
- return baseGetAllKeys(e, keysIn, getSymbolsIn$1);
- }
- var DataView = getNative(root$1, 'DataView'),
- DataView$1 = DataView,
- Promise$1 = getNative(root$1, 'Promise'),
- Promise$2 = Promise$1,
- Set = getNative(root$1, 'Set'),
- Set$1 = Set,
- mapTag$4 = '[object Map]',
- objectTag$2 = '[object Object]',
- promiseTag = '[object Promise]',
- setTag$4 = '[object Set]',
- weakMapTag$1 = '[object WeakMap]',
- dataViewTag$3 = '[object DataView]',
- dataViewCtorString = toSource(DataView$1),
- mapCtorString = toSource(Map$1),
- promiseCtorString = toSource(Promise$2),
- setCtorString = toSource(Set$1),
- weakMapCtorString = toSource(WeakMap$1$1),
- getTag = baseGetTag;
- ((DataView$1 && getTag(new DataView$1(new ArrayBuffer(1))) != dataViewTag$3) ||
- (Map$1 && getTag(new Map$1()) != mapTag$4) ||
- (Promise$2 && getTag(Promise$2.resolve()) != promiseTag) ||
- (Set$1 && getTag(new Set$1()) != setTag$4) ||
- (WeakMap$1$1 && getTag(new WeakMap$1$1()) != weakMapTag$1)) &&
- (getTag = function (e) {
- var t = baseGetTag(e),
- r = t == objectTag$2 ? e.constructor : void 0,
- i = r ? toSource(r) : '';
- if (i)
- switch (i) {
- case dataViewCtorString:
- return dataViewTag$3;
- case mapCtorString:
- return mapTag$4;
- case promiseCtorString:
- return promiseTag;
- case setCtorString:
- return setTag$4;
- case weakMapCtorString:
- return weakMapTag$1;
- }
- return t;
- });
- var getTag$1 = getTag,
- objectProto$2 = Object.prototype,
- hasOwnProperty$2 = objectProto$2.hasOwnProperty;
- function initCloneArray(e) {
- var t = e.length,
- r = new e.constructor(t);
- return (
- t &&
- typeof e[0] == 'string' &&
- hasOwnProperty$2.call(e, 'index') &&
- ((r.index = e.index), (r.input = e.input)),
- r
- );
- }
- var Uint8Array$1 = root$1.Uint8Array,
- Uint8Array$1$1 = Uint8Array$1;
- function cloneArrayBuffer(e) {
- var t = new e.constructor(e.byteLength);
- return new Uint8Array$1$1(t).set(new Uint8Array$1$1(e)), t;
- }
- function cloneDataView(e, t) {
- var r = t ? cloneArrayBuffer(e.buffer) : e.buffer;
- return new e.constructor(r, e.byteOffset, e.byteLength);
- }
- var reFlags = /\w*$/;
- function cloneRegExp(e) {
- var t = new e.constructor(e.source, reFlags.exec(e));
- return (t.lastIndex = e.lastIndex), t;
- }
- var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : void 0,
- symbolValueOf$1 = symbolProto$1 ? symbolProto$1.valueOf : void 0;
- function cloneSymbol(e) {
- return symbolValueOf$1 ? Object(symbolValueOf$1.call(e)) : {};
- }
- function cloneTypedArray(e, t) {
- var r = t ? cloneArrayBuffer(e.buffer) : e.buffer;
- return new e.constructor(r, e.byteOffset, e.length);
- }
- var boolTag$2 = '[object Boolean]',
- dateTag$2 = '[object Date]',
- mapTag$3 = '[object Map]',
- numberTag$2 = '[object Number]',
- regexpTag$2 = '[object RegExp]',
- setTag$3 = '[object Set]',
- stringTag$2 = '[object String]',
- symbolTag$2 = '[object Symbol]',
- arrayBufferTag$2 = '[object ArrayBuffer]',
- dataViewTag$2 = '[object DataView]',
- float32Tag$1 = '[object Float32Array]',
- float64Tag$1 = '[object Float64Array]',
- int8Tag$1 = '[object Int8Array]',
- int16Tag$1 = '[object Int16Array]',
- int32Tag$1 = '[object Int32Array]',
- uint8Tag$1 = '[object Uint8Array]',
- uint8ClampedTag$1 = '[object Uint8ClampedArray]',
- uint16Tag$1 = '[object Uint16Array]',
- uint32Tag$1 = '[object Uint32Array]';
- function initCloneByTag(e, t, r) {
- var i = e.constructor;
- switch (t) {
- case arrayBufferTag$2:
- return cloneArrayBuffer(e);
- case boolTag$2:
- case dateTag$2:
- return new i(+e);
- case dataViewTag$2:
- return cloneDataView(e, r);
- case float32Tag$1:
- case float64Tag$1:
- case int8Tag$1:
- case int16Tag$1:
- case int32Tag$1:
- case uint8Tag$1:
- case uint8ClampedTag$1:
- case uint16Tag$1:
- case uint32Tag$1:
- return cloneTypedArray(e, r);
- case mapTag$3:
- return new i();
- case numberTag$2:
- case stringTag$2:
- return new i(e);
- case regexpTag$2:
- return cloneRegExp(e);
- case setTag$3:
- return new i();
- case symbolTag$2:
- return cloneSymbol(e);
- }
- }
- function initCloneObject(e) {
- return typeof e.constructor == 'function' && !isPrototype(e)
- ? baseCreate$1(getPrototype$1(e))
- : {};
- }
- var mapTag$2 = '[object Map]';
- function baseIsMap(e) {
- return isObjectLike(e) && getTag$1(e) == mapTag$2;
- }
- var nodeIsMap = nodeUtil$1 && nodeUtil$1.isMap,
- isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap,
- isMap$1 = isMap,
- setTag$2 = '[object Set]';
- function baseIsSet(e) {
- return isObjectLike(e) && getTag$1(e) == setTag$2;
- }
- var nodeIsSet = nodeUtil$1 && nodeUtil$1.isSet,
- isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet,
- isSet$1 = isSet,
- CLONE_DEEP_FLAG$1 = 1,
- CLONE_FLAT_FLAG = 2,
- CLONE_SYMBOLS_FLAG$1 = 4,
- argsTag$1 = '[object Arguments]',
- arrayTag$1 = '[object Array]',
- boolTag$1 = '[object Boolean]',
- dateTag$1 = '[object Date]',
- errorTag$1 = '[object Error]',
- funcTag = '[object Function]',
- genTag = '[object GeneratorFunction]',
- mapTag$1 = '[object Map]',
- numberTag$1 = '[object Number]',
- objectTag$1 = '[object Object]',
- regexpTag$1 = '[object RegExp]',
- setTag$1 = '[object Set]',
- stringTag$1 = '[object String]',
- symbolTag$1 = '[object Symbol]',
- weakMapTag = '[object WeakMap]',
- arrayBufferTag$1 = '[object ArrayBuffer]',
- dataViewTag$1 = '[object DataView]',
- float32Tag = '[object Float32Array]',
- float64Tag = '[object Float64Array]',
- int8Tag = '[object Int8Array]',
- int16Tag = '[object Int16Array]',
- int32Tag = '[object Int32Array]',
- uint8Tag = '[object Uint8Array]',
- uint8ClampedTag = '[object Uint8ClampedArray]',
- uint16Tag = '[object Uint16Array]',
- uint32Tag = '[object Uint32Array]',
- cloneableTags = {};
- cloneableTags[argsTag$1] =
- cloneableTags[arrayTag$1] =
- cloneableTags[arrayBufferTag$1] =
- cloneableTags[dataViewTag$1] =
- cloneableTags[boolTag$1] =
- cloneableTags[dateTag$1] =
- cloneableTags[float32Tag] =
- cloneableTags[float64Tag] =
- cloneableTags[int8Tag] =
- cloneableTags[int16Tag] =
- cloneableTags[int32Tag] =
- cloneableTags[mapTag$1] =
- cloneableTags[numberTag$1] =
- cloneableTags[objectTag$1] =
- cloneableTags[regexpTag$1] =
- cloneableTags[setTag$1] =
- cloneableTags[stringTag$1] =
- cloneableTags[symbolTag$1] =
- cloneableTags[uint8Tag] =
- cloneableTags[uint8ClampedTag] =
- cloneableTags[uint16Tag] =
- cloneableTags[uint32Tag] =
- !0;
- cloneableTags[errorTag$1] =
- cloneableTags[funcTag] =
- cloneableTags[weakMapTag] =
- !1;
- function baseClone(e, t, r, i, s, n) {
- var a,
- o = t & CLONE_DEEP_FLAG$1,
- l = t & CLONE_FLAT_FLAG,
- c = t & CLONE_SYMBOLS_FLAG$1;
- if ((r && (a = s ? r(e, i, s, n) : r(e)), a !== void 0)) return a;
- if (!isObject$2(e)) return e;
- var g = isArray$1$1(e);
- if (g) {
- if (((a = initCloneArray(e)), !o)) return copyArray(e, a);
- } else {
- var S = getTag$1(e),
- p = S == funcTag || S == genTag;
- if (isBuffer$1(e)) return cloneBuffer(e, o);
- if (S == objectTag$1 || S == argsTag$1 || (p && !s)) {
- if (((a = l || p ? {} : initCloneObject(e)), !o))
- return l
- ? copySymbolsIn(e, baseAssignIn(a, e))
- : copySymbols(e, baseAssign(a, e));
- } else {
- if (!cloneableTags[S]) return s ? e : {};
- a = initCloneByTag(e, S, o);
- }
- }
- n || (n = new Stack());
- var P = n.get(e);
- if (P) return P;
- n.set(e, a),
- isSet$1(e)
- ? e.forEach(function (A) {
- a.add(baseClone(A, t, r, A, e, n));
- })
- : isMap$1(e) &&
- e.forEach(function (A, u) {
- a.set(u, baseClone(A, t, r, u, e, n));
- });
- var b = c ? (l ? getAllKeysIn : getAllKeys) : l ? keysIn : keys,
- y = g ? void 0 : b(e);
- return (
- arrayEach(y || e, function (A, u) {
- y && ((u = A), (A = e[u])),
- assignValue(a, u, baseClone(A, t, r, u, e, n));
- }),
- a
- );
- }
- var CLONE_DEEP_FLAG = 1,
- CLONE_SYMBOLS_FLAG = 4;
- function cloneDeep$1(e) {
- return baseClone(e, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
- }
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
- function setCacheAdd(e) {
- return this.__data__.set(e, HASH_UNDEFINED), this;
- }
- function setCacheHas(e) {
- return this.__data__.has(e);
- }
- function SetCache(e) {
- var t = -1,
- r = e == null ? 0 : e.length;
- for (this.__data__ = new MapCache(); ++t < r; ) this.add(e[t]);
- }
- SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
- SetCache.prototype.has = setCacheHas;
- function arraySome(e, t) {
- for (var r = -1, i = e == null ? 0 : e.length; ++r < i; )
- if (t(e[r], r, e)) return !0;
- return !1;
- }
- function cacheHas(e, t) {
- return e.has(t);
- }
- var COMPARE_PARTIAL_FLAG$3 = 1,
- COMPARE_UNORDERED_FLAG$1 = 2;
- function equalArrays(e, t, r, i, s, n) {
- var a = r & COMPARE_PARTIAL_FLAG$3,
- o = e.length,
- l = t.length;
- if (o != l && !(a && l > o)) return !1;
- var c = n.get(e),
- g = n.get(t);
- if (c && g) return c == t && g == e;
- var S = -1,
- p = !0,
- P = r & COMPARE_UNORDERED_FLAG$1 ? new SetCache() : void 0;
- for (n.set(e, t), n.set(t, e); ++S < o; ) {
- var b = e[S],
- y = t[S];
- if (i) var A = a ? i(y, b, S, t, e, n) : i(b, y, S, e, t, n);
- if (A !== void 0) {
- if (A) continue;
- p = !1;
- break;
- }
- if (P) {
- if (
- !arraySome(t, function (u, f) {
- if (!cacheHas(P, f) && (b === u || s(b, u, r, i, n)))
- return P.push(f);
- })
- ) {
- p = !1;
- break;
- }
- } else if (!(b === y || s(b, y, r, i, n))) {
- p = !1;
- break;
- }
- }
- return n.delete(e), n.delete(t), p;
- }
- function mapToArray(e) {
- var t = -1,
- r = Array(e.size);
- return (
- e.forEach(function (i, s) {
- r[++t] = [s, i];
- }),
- r
- );
- }
- function setToArray(e) {
- var t = -1,
- r = Array(e.size);
- return (
- e.forEach(function (i) {
- r[++t] = i;
- }),
- r
- );
- }
- var COMPARE_PARTIAL_FLAG$2 = 1,
- COMPARE_UNORDERED_FLAG = 2,
- boolTag = '[object Boolean]',
- dateTag = '[object Date]',
- errorTag = '[object Error]',
- mapTag = '[object Map]',
- numberTag = '[object Number]',
- regexpTag = '[object RegExp]',
- setTag = '[object Set]',
- stringTag = '[object String]',
- symbolTag = '[object Symbol]',
- arrayBufferTag = '[object ArrayBuffer]',
- dataViewTag = '[object DataView]',
- symbolProto = Symbol$2 ? Symbol$2.prototype : void 0,
- symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
- function equalByTag(e, t, r, i, s, n, a) {
- switch (r) {
- case dataViewTag:
- if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset)
- return !1;
- (e = e.buffer), (t = t.buffer);
- case arrayBufferTag:
- return !(
- e.byteLength != t.byteLength ||
- !n(new Uint8Array$1$1(e), new Uint8Array$1$1(t))
- );
- case boolTag:
- case dateTag:
- case numberTag:
- return eq(+e, +t);
- case errorTag:
- return e.name == t.name && e.message == t.message;
- case regexpTag:
- case stringTag:
- return e == t + '';
- case mapTag:
- var o = mapToArray;
- case setTag:
- var l = i & COMPARE_PARTIAL_FLAG$2;
- if ((o || (o = setToArray), e.size != t.size && !l)) return !1;
- var c = a.get(e);
- if (c) return c == t;
- (i |= COMPARE_UNORDERED_FLAG), a.set(e, t);
- var g = equalArrays(o(e), o(t), i, s, n, a);
- return a.delete(e), g;
- case symbolTag:
- if (symbolValueOf) return symbolValueOf.call(e) == symbolValueOf.call(t);
- }
- return !1;
- }
- var COMPARE_PARTIAL_FLAG$1 = 1,
- objectProto$1 = Object.prototype,
- hasOwnProperty$1 = objectProto$1.hasOwnProperty;
- function equalObjects(e, t, r, i, s, n) {
- var a = r & COMPARE_PARTIAL_FLAG$1,
- o = getAllKeys(e),
- l = o.length,
- c = getAllKeys(t),
- g = c.length;
- if (l != g && !a) return !1;
- for (var S = l; S--; ) {
- var p = o[S];
- if (!(a ? p in t : hasOwnProperty$1.call(t, p))) return !1;
- }
- var P = n.get(e),
- b = n.get(t);
- if (P && b) return P == t && b == e;
- var y = !0;
- n.set(e, t), n.set(t, e);
- for (var A = a; ++S < l; ) {
- p = o[S];
- var u = e[p],
- f = t[p];
- if (i) var m = a ? i(f, u, p, t, e, n) : i(u, f, p, e, t, n);
- if (!(m === void 0 ? u === f || s(u, f, r, i, n) : m)) {
- y = !1;
- break;
- }
- A || (A = p == 'constructor');
- }
- if (y && !A) {
- var d = e.constructor,
- E = t.constructor;
- d != E &&
- 'constructor' in e &&
- 'constructor' in t &&
- !(
- typeof d == 'function' &&
- d instanceof d &&
- typeof E == 'function' &&
- E instanceof E
- ) &&
- (y = !1);
- }
- return n.delete(e), n.delete(t), y;
- }
- var COMPARE_PARTIAL_FLAG = 1,
- argsTag = '[object Arguments]',
- arrayTag = '[object Array]',
- objectTag = '[object Object]',
- objectProto = Object.prototype,
- hasOwnProperty = objectProto.hasOwnProperty;
- function baseIsEqualDeep(e, t, r, i, s, n) {
- var a = isArray$1$1(e),
- o = isArray$1$1(t),
- l = a ? arrayTag : getTag$1(e),
- c = o ? arrayTag : getTag$1(t);
- (l = l == argsTag ? objectTag : l), (c = c == argsTag ? objectTag : c);
- var g = l == objectTag,
- S = c == objectTag,
- p = l == c;
- if (p && isBuffer$1(e)) {
- if (!isBuffer$1(t)) return !1;
- (a = !0), (g = !1);
- }
- if (p && !g)
- return (
- n || (n = new Stack()),
- a || isTypedArray$1(e)
- ? equalArrays(e, t, r, i, s, n)
- : equalByTag(e, t, l, r, i, s, n)
- );
- if (!(r & COMPARE_PARTIAL_FLAG)) {
- var P = g && hasOwnProperty.call(e, '__wrapped__'),
- b = S && hasOwnProperty.call(t, '__wrapped__');
- if (P || b) {
- var y = P ? e.value() : e,
- A = b ? t.value() : t;
- return n || (n = new Stack()), s(y, A, r, i, n);
- }
- }
- return p ? (n || (n = new Stack()), equalObjects(e, t, r, i, s, n)) : !1;
- }
- function baseIsEqual(e, t, r, i, s) {
- return e === t
- ? !0
- : e == null || t == null || (!isObjectLike(e) && !isObjectLike(t))
- ? e !== e && t !== t
- : baseIsEqualDeep(e, t, r, i, baseIsEqual, s);
- }
- function isEqual(e, t) {
- return baseIsEqual(e, t);
- }
- var _export_sfc = (e, t) => {
- const r = e.__vccOpts || e;
- for (const [i, s] of t) r[i] = s;
- return r;
- };
- const _sfc_main = defineComponent({
- props: {
- animationData: { type: Object, default: () => ({}) },
- animationLink: { type: String, default: '' },
- loop: { type: [Boolean, Number], default: !0 },
- autoPlay: { type: Boolean, default: !0 },
- width: { type: [Number, String], default: '100%' },
- height: { type: [Number, String], default: '100%' },
- speed: { type: Number, default: 1 },
- delay: { type: Number, default: 0 },
- direction: { type: String, default: 'forward' },
- pauseOnHover: { type: Boolean, default: !1 },
- playOnHover: { type: Boolean, default: !1 },
- backgroundColor: { type: String, default: 'transparent' },
- pauseAnimation: { type: Boolean, default: !1 },
- renderer: { type: String, default: 'svg' },
- rendererSettings: { type: Object, default: () => ({}) },
- assetsPath: { type: String, default: '' }
- },
- emits: {
- onComplete: null,
- onLoopComplete: null,
- onEnterFrame: null,
- onSegmentStart: null,
- onAnimationLoaded: null
- },
- setup(e, { emit: t }) {
- let r = ref(null);
- const i = ref('');
- let s = 1;
- const n = _ => document.querySelector(`[data-id="${_}"]`) !== null,
- a = async _ => {
- let I = e.autoPlay;
- e.playOnHover && (I = !1);
- let V = {};
- if (
- (isEqual(e.animationData, {}) === !1 &&
- (V = cloneDeep$1(e.animationData)),
- e.animationLink != '')
- )
- try {
- V = await (await fetch(e.animationLink)).json();
- } catch ($) {
- console.error($);
- return;
- }
- let D = e.loop;
- typeof D == 'number' && D > 0 && (D = D - 1), e.delay > 0 && (I = !1);
- const N = {
- container: _,
- renderer: e.renderer,
- loop: D,
- autoplay: I,
- animationData: V,
- assetsPath: e.assetsPath
- };
- isEqual(e.rendererSettings, {}) === !1 &&
- (N.rendererSettings = e.rendererSettings),
- (r = Lottie.loadAnimation(N)),
- setTimeout(() => {
- (I = e.autoPlay),
- e.playOnHover ? r.pause() : I ? r.play() : r.pause(),
- t('onAnimationLoaded');
- }, e.delay),
- r.setSpeed(e.speed),
- e.direction === 'reverse' && r.setDirection(-1),
- e.direction === 'normal' && r.setDirection(1),
- (e.pauseAnimation || e.playOnHover) && r.pause(),
- r.addEventListener('loopComplete', () => {
- e.direction === 'alternate' &&
- (r.stop(), (s = s * -1), r.setDirection(s), r.play()),
- t('onLoopComplete');
- }),
- r.addEventListener('complete', () => {
- t('onComplete');
- }),
- r.addEventListener('enterFrame', () => {
- t('onEnterFrame');
- }),
- r.addEventListener('segmentStart', () => {
- t('onSegmentStart');
- });
- },
- o = computed(() => {
- let _ = e.width,
- I = e.height;
- return (
- typeof e.width == 'number' && (_ = `${e.width}px`),
- typeof e.height == 'number' && (I = `${e.height}px`),
- {
- '--lottie-animation-container-width': _,
- '--lottie-animation-container-height': I,
- '--lottie-animation-container-background-color': e.backgroundColor
- }
- );
- }),
- l = () => {
- r && e.pauseOnHover && r.pause(), r && e.playOnHover && r.play();
- },
- c = () => {
- r && e.pauseOnHover && r.play(), r && e.playOnHover && r.pause();
- };
- watch(
- () => e.pauseAnimation,
- () => {
- if ((e.pauseOnHover || e.playOnHover) && e.pauseAnimation) {
- console.error(
- 'If you are using pauseAnimation prop for Vue3-Lottie, please remove the props pauseOnHover and playOnHover'
- );
- return;
- }
- r && (e.pauseAnimation ? r.pause() : r.play());
- }
- );
- const g = () => {
- r && r.play();
- },
- S = () => {
- r && r.pause();
- },
- p = () => {
- r && r.stop();
- },
- P = () => {
- r && r.destroy();
- },
- b = (_ = 1) => {
- if (_ <= 0) throw new Error('Speed must be greater than 0');
- r && r.setSpeed(_);
- },
- y = _ => {
- r &&
- (_ === 'forward'
- ? r.setDirection(1)
- : _ === 'reverse' && r.setDirection(-1));
- },
- A = (_, I = !0) => {
- r && r.goToAndStop(_, I);
- },
- u = (_, I = !0) => {
- r && r.goToAndPlay(_, I);
- },
- f = (_, I = !1) => {
- r && r.playSegments(_, I);
- },
- m = (_ = !0) => {
- r && r.setSubframe(_);
- },
- d = (_ = !0) => {
- if (r) return r.getDuration(_);
- },
- E = (_, I = 0) => {
- r && r.renderer.elements[I].updateDocumentData(_);
- },
- T = _ => {
- for (
- var I = '',
- V =
- 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',
- D = V.length,
- N = 0;
- N < _;
- N++
- )
- I += V.charAt(Math.floor(Math.random() * D));
- return I;
- },
- x = _ => {
- if (e.pauseOnHover && e.playOnHover)
- throw new Error(
- 'You cannot set pauseOnHover and playOnHover for Vue3-Lottie at the same time.'
- );
- if (e.animationLink === '' && isEqual(e.animationData, {}))
- throw new Error(
- 'You must provide either animationLink or animationData'
- );
- const I = setInterval(() => {
- if (n(_)) {
- clearInterval(I);
- const V = document.querySelector(`[data-id="${_}" ]`);
- V && a(V);
- }
- }, 0);
- };
- return (
- onMounted(async () => {
- (i.value = T(20)), x(i.value);
- }),
- {
- elementid: i,
- hoverEnded: c,
- hoverStarted: l,
- getCurrentStyle: o,
- play: g,
- pause: S,
- stop: p,
- destroy: P,
- setSpeed: b,
- setDirection: y,
- goToAndStop: A,
- goToAndPlay: u,
- playSegments: f,
- setSubFrame: m,
- getDuration: d,
- updateDocumentData: E
- }
- );
- }
- }),
- _hoisted_1 = ['data-id'];
- function _sfc_render(e, t, r, i, s, n) {
- return (
- openBlock(),
- createElementBlock(
- 'div',
- {
- 'data-id': e.elementid,
- class: 'lottie-animation-container',
- style: normalizeStyle(e.getCurrentStyle),
- onMouseenter:
- t[0] || (t[0] = (...a) => e.hoverStarted && e.hoverStarted(...a)),
- onMouseleave:
- t[1] || (t[1] = (...a) => e.hoverEnded && e.hoverEnded(...a))
- },
- null,
- 44,
- _hoisted_1
- )
- );
- }
- var Vue3Lottie = _export_sfc(_sfc_main, [['render', _sfc_render]]);
- const v = '5.7.1',
- fr = 60,
- ip = 0,
- op = 120,
- w = 2436,
- h = 1125,
- nm = '合成 1',
- ddd = 0,
- assets = [
- {
- id: 'image_0',
- w: 195,
- h: 264,
- u: '',
- p: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMMAAAEICAYAAADiJ0BpAAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAgAElEQVR4nO19ebxlRXXut85tGhBoZGjAhEkRISjJQ5QYYwjghBFiVMQ5xhiHRJOoz0jEiahIElEjUcOLmJ8xosGg4hRFoy2IedHggMg8NUQF6WZqmga6++4vf1StqlW19xnu1Hc3d31w+5yzd1WtqtprrqpzBFsh7r9p1aOmNzdHgTyK4AFosFKEKwksBxj+JwEBQMZa8TV+ZvwcitC0Hu+T4R6YmpFUj6bdXDYWCKVqurlwqgMBpCiby5CESEm37Kul30Ay8dwJ4C6Qt1HkFwJ+F4PBBZze8Vu7PubEu0bP8NKELHYHJgV5zbb3rb7p+U3D14H8VeWUNpMAaDE6K2Yu7xkilQABqJlV38dylmlrgUvXbT9HCeEQASI5om/luFQZJBqxXSPU9wrwiW22HZyx06/90U/qeV7K2CqE4d4bv/lETvOjIPcLPGe0YnzIlmktoymzgsgMXDGk3lbhyEyE+FlKZq6tQmwg1RcphbBi4lxO6Yf22/03n5H72U2/qq8W0sxPukNCRAjyzF1WLDtJDn7Z3TN+KA9A9FoYSA7uvXHV36Hha0jGZ0qjlZEYCqg1JFQtF0xh3Z7KrTB1Ev18v9DMlqnQwcTI9WKbNPdzHRbFIFkA2/S72syC1KZPU6+ir1cIyEBukin+7i6PftUlrQewxNBbYSA5dd/qVR9vmuYFACptnUppWWAEQ6s/39K2hnFSOXO9m9HbblVyY6p+FfSL/pdCVGvwFk3pErQ8ztpaJcEFYjxhi7cVh5B3NAMcu/tj//h7WMIYLHYHhuG+67/5wabhC0SykU9KGQTZGOZkDCBhGMG4IsosypjJpVDtGVyb2HJ8bwQkauGsXwNjMpMJdZJqkSQPIllzQ10aAGxKbW8Z1o5ZwgCUTCpENmDR/9xWsmDqglk6af7ynBDcZUA5f8MlH9l74gf0AEQvheG+6y94CgWvslpSH3jW2qVRSwyfHGuJz9q4R1Yb1zBuB1AKh7YZGCtbjczxtdXKFsPGBDmWSA1UXcj+fym0+Vq2GtX4C7cv98mOu7AuguKVbB684b6NH0vu6BJE74SB5KDB9JmdPJutf+vhZsVoNL7RuLF665MVDm1P/9quDyGmXijfJA2c6CczZoJXy9haTobQb/U19yG5fKjGb01L6gOGj19drMbQJ5545/f+4RmdpJcAeicM969e9WSCDy0UZx3UqpUoilRPHkhlWgKjnyrhqu7aBjKd2B9RsYjuEdnkivGvyBKJmKxSdmUK+qaDkv6xoiHJAtbJgi6Lp6ndYvwqLJLL2PoN+MethpYIeicMDfkiMDM9gOyGWLfEal4biCavIufgRdckigxOTrGqK5EagaEfGmhpasuU1j3SekE5s6JvGzArA7TjYNEOTJn258pdM+9UCEVymTLTlgXABvkgnnzXZWftiiWI3gkDIY/KcaiqNiRNHPzueBslk9qHqgo6+832ThV3GAHSEkVEa1yyIgtj1hMQ4wmtK8aNyf2yMQ3ytfgh6//abc+JAFPdLPYNGX/sH+P8xQk0bdZxB0FSNq/ffBCWIHonDALsnzS2ai7VakU8AHMtfJIoAS2NV/nrNigtV5CrBTvTj9Lft+1Y+mLoR+GwgXgqafR3R2BMNrGd1M12vKF1qgC7mLfW+I3VsePXPkUrMuDmh2MJonfCQDYPjm9aWn50Nig1ED+2Y4iy3bbjY7VuQT/6+9kqFKq9oFtbmYwcYHfkkQx9w9ySa4rmuYp2peyDukz1POkEVu3W0bW231C2a3VxCWDZYnegBdKY8rb2VyeiuB59eyFvIHDOsoF8FVNYvd203HE/sHIzmodLw+Ma4rkAVsLEEEXa0bTVzdRd7hGyBbBtitHySU6sIFRpV5Rt5uko4xzlf40ZYPqf6YveKuYpp45jWePKjVQ0SwT9E4aIFHzqBQFAzc6g1GoDWSeQkx904O7/KPKYTVVT6wBcB+B83rrqTetvX/9GkG9CNXaaf/WdqOtVeUidmaeakVKALIBkF8gyYR5X6UYBmcELK6IxQGWZugxgu0WjRlTf5CClIwRfeuinMDBrypRC1X+SylMG4/XLttnmuG33f/IV45qVPY5eD+Btd1/5pVVsNp8LYNfWYlSin42UdV0i0coqGQtQaNh0IX1K7lDy6xvkVeLch2SxxNyjbbMpLZi1AMx0bQq6a5tJaRW05PS4qXxAoncxQ7bipQtjbiEH0rhtsHzqSZMIgsVOBx+3ClNTzxBgY2LMFJgY+lDPJFyss0/xInT/j8YVRUxi3L6WpgdgV7XtXVqFkEnp3fJFrYiJbdSlKhb17D2NU4oyXT1cOuifMESXIQWPkrVe6coIZEpesv3+T71hNmRWHHT8RSJ4sy6IRf8n+92BROF324xM6Ir1+7U6UbB2lCgNvMtUqxFEmyVj9u1tfFAo72IvFVK7VJdLDH2TQco7rCTTT3PfjlmWEnonDDaoY8WYthSE39zhgGO/PBdaOxx84BkYyOrEmDCuielD4d9bB9v0qbAG2h4zE2btnkvWFi/RE2Xa/LkgRJtUsO22BbVFP1K3cUs9/vkCL3nPDrdd8N59eM0Z285bowuI3sUMlmlSvr4jozRo8ME505JHblx3xXkfIZtT1ZdXTZrWHqwboerfaPvk5kg7y5THk4NWm9fPYYf68pGokoDSByyTJ/qmzVDU7JCNbRVBu1pdlIF4XkQsuj4r3Hbh6Yc0wpcBPGHNXc2+kAZrfr4Jv7jgb34iIp9aubN8QH7tL+6ZG5WFQe8sA1BpZMsoESK4f/udB1+bD1qybPB5JMbMbkqbfr4fLuTsTKyUBYG5nmW07KpkN8WO2dZJlsMwei4cr1TWsgj0bTCtgmpK1ptm6+0eMwH56am1337fM9dc+J5vTKO5jGxeT3Lf1C4AAR9FTp966x2bL7v1gtMOmxWhBUbvhCGv2jI/NGaXARCwwQ2y11PnRbvs+PDjr4RgWqJZCNpWEk/nsw3Gv1cXxLCX2eVQuU9S8Fi2FA3UrUljluwmpnjEzIWNL2iFD9WuWeMyJSGMf7oto1yRL923SXH3D85Yufai009ee9FNNxDTn6XgmDTKZKDseQ5ABPsRPP+2C967zwxIbRH0Thjyfv7qoSWXoAHQ3Dx/9GRaiDVAdmFAI4TqK6E8j9B5niAJi3a5Y2GPiUtaYy4zRyqEWduX5znKcSRX0vh3KsDapTx/1uXMFqiS46FY+5/vO2Ltd07/+L33bPofEqcS3IdpEmK7JqjP5zlUMLFyMza+ZQJSWxS9ixkK/7jQU8YPH8j280oT3D47PcbVKAsVfahXbQUAparHkmmLFo0bkzJXlcbu6GhJHxX91K6xWHaUHY3ZY6HaXr2BDwB4zRnb3rZm03NJvIYNHxvkPlun5IaxQ9DiR5YDOHb4QBcHvRMGRWAuqR5uAIlfni86vOX8He6+bf3ORdYIVTCcVKYAbIyWLYWjVqt1mSRsLMtofZu1snJV3GMQuuLUnKVftC3ZRZL6tgmw1SXtsAu3X/yBfZv7mlet/cWmlwPYvRQ+pnnJFi+3L+pKUsckYNNoDNM7N6mHwmACvwQpNBjIfe67+ksP2+4Rx10/V2obbr/3t4sVY6qJz31Rk68xdGsfj2HE5FSpxlS2IVEeqGxng+wUFEwkdvwd+5iMK9llsVrbOGKdlFkqLDHRkLL2Pz/wRDTTr27ub36Xwikr61morVumY7IbHrPVs+svAMCmmcQj26LooTDUGkx9ZDETTWyGPBvAe+ZKa5rTJySatcuRyGe6dntD6zwBCN0iJ+ZaWTZLjU1lFvSz258ItM9RV4wsAJtyp2s3/TSonMrV9uNpPSHfSzQ7hqJN0b8ybrGC1Hb5kLpfbhOfUZS+BdG7ABrIJt/un2lpYvL/8tZVO86Fzn3XfO4AsHmRugm6X8HS1cRIrVXTfRvgAkgugxjvijZ1a7JCxo+umap4hXE3oO0Y7RwvWZdLX21mqm7fBu05UQCQQRA0pG7Pv2knWaj6PEcWntb4eioNvRQGAABLLad/ZqL33HDHPe+effMcbNrYfIjANimDBBQMZ7dEDD1PEF9qS1aUExhV3T7PYN0v6/okLatNSMWUdjyt8Nj4NeXAh2SMquupOuOep47x2+SAEcr8uYjCxtBffPRPGKqHrb4mkTW1ZjuapvnTe67+0itmQ+buKz5zesPmqTaDUq8eJ1+Xdp0jM4m6EFa7FulR7XP8SxbBWIWW+9E1/vSn7WbGCj0ZQ9+0FW7kOCanfc1Kf8Xkdg5y9dzXEDpISV9QjakW5P5Zh/4JQ0SYv7ynP2hGQINEIFxsmub/3X3FF/6K5ERj4Q2rtlt32Wc+jgavSxcr3zfQZ6av2tlsjst1TWCZI/yS+dN9dUMqoUNLBqAqQOmmHactpioDW9NAu1zlRrXptT+rRSiNWwd9IwQ6oDrD1Dl/PUJPhcEEqoKklbszKATAt62/6vPfv+eqLzxtmFDwmn/f9q7LP/PidRtuvxLgi5OvXrhHpYuSy2AMfXtf+912BlS721Xp7FcbrayammU9m2HK0mPopyuVi2Qsk7UixfiL+KMqo//R9NHOg8ZVVayTy6CiX6aF+4LeuW/rr/4KkwmHPnsaHqiY0Zh7AIDIGpBfB5rVgsEdIFcSPJDAk0DuZF0L1G2iahMo6FoBsarcugZQpuxo09ZLLl9BPzVYujBi5ESdxlSldI3S2GqXpBKi7PK1LVhJP9PtnqtKoPRfNkqwmq9Mf69j3tYr/utharXL743Xgfx0DOOVC2RcCeAFoYaePzYPtxIC80gTw6j2DuWyRcjGgylXWfr72pRxD1QromCN7GNbl8HGAMm1yG23VrjTXKm6aAtqHhqLFe50BiJ/SPXJbNiSAKa5KvvLoowhWAYeRpjC/a5V7sVG79ykFMwC2TQXSQm1yalGulw2hPQQAOtXZx2mDyS5uYVFsK6ZljIBQqffXrkRJm4o/HojRK0uG6bJ9FsNoGBKMa6e5eQu+iluMdmi2K6tXtK3tCWTtvurzAjSaEx9jTxGxS2Ljd4JQxGM6QU7cYbZyiyOlZn8ITFfvKzMZh9UHSymera95J603TPVsDnLk1tIQb+yuhGCwuWL1zPTFhOQykCFgyjHb6yJtUx512+mmcJY6zKpwY1zK3YiUj/N/LOaf6BT2+cumfHnSeoVeicMQNTKhmkBlBNoTH1ZK5ZhZtqcji1KtB4cqzpZwRr6xfOrdvIUWrR0ObS09aKG7jpN9Ief51DOrYZfCpfxzbX/efxV5seUU4Zt08909UKtsErhNuNCjj90drr2QS02eicMaaLU45D8GK3LZPPuydSnBjLjpW+XiH/ZKtTnCbR6zu6oP67ucJGvUReM+rClkBjSMIGxKolOYxnGuG+kGbPZSg51+bJVMMMvhcuMudiyUVsl7RbsdeNKoXSrsryE+esal1qOJASQjudUuV89Qe+EIfmxhiE1qi3OE9SaHShMeHafqn1FRQxg3lkXClkTpjSlaSfft/Qtt2QhLLJSiT6N4JQMovuFOs9zwJ6nqOgXvJWF0KYyi5SmiZCtK1O4qZW1KzcA1pbVzn+2REVWDGY8/TMM/csmtV0Nye9ZlrOTm0rZeAPlnJe6qO1GFA9Li7S4DlE2K/rSRd9aLJb0VYPSCmC9Cm4Yx85LFLRwuTF1bXuqsROrt+kDrc19Valy3EX1WjgAVuOpLVYX/T6hd5YBQPTxE3tm6wAkl8HGAOFy249O2rEVdxi3Ad1MkHxqq50TrSx82oAVCr2Wv0KGJpgtOle4R5a6pMa66FsrFYi1LYakXaWMOf8UAyR3syOYt+OP85XcU2MtSyuLDvpqCTvusS7ZD/TOMqgFsG6P3b4NdGnwzNx2sShp5vjgas2U7U5bS2V3Jm9QSy4cyv6hYIqyTWVqxkNBxrQkt2xU4BvaGDZ+wgwWiVFN/4JwSjl+0blCi6mt5dO+WDdn6PxLUT3HTEbYmVzDfqKXliFpcGW0lt9flYsf9OGqFswOlvXRDZ3sQbRcLiNFSYNTX2Ml/eIARWIYKd2uwrKZAVi/u14QNK1CNXhmdGVSbSsL0CjNXJq0HBcpzczANfmafjV/9fih44+WKQ/QjK5/QtFLYVCdrUyUGJq5BOprqgWNy9AKP1JRpuvqAnSZfBomy5qSqeHav1cXqcjfJ4Yz7Zs6rb6aem36xfBh08FgqYWHWs9i/DkjlxSGVPMnSR5abVFviNLv7n9yzTqsXp/QS2EAkCdXspZpmfRQEIGpcj11F+oYItxuPwgpXi1zxevR32+5VKbxQvAMneH0rRsUPtffjZT7ZX4fojSLxj0pKrTpF7nT8prKa4opjDXS+9bSdYHVu5aVTeSbzvp9QP9iBvuwVMtXDJSYMlkOG9DlvTqFb43Sjal95qJN4/60sztS0Ert6jWtbpmX0NaR2a9K+3bSKq1YiqFSu9mq2cP/2v3ijIKho0xfpF2LMUlJv4qNir1YHfOnma32/CNnt3poHXprGYpV6KSZsxtgkTVrro3atUB+EF3arW1vzKIXsnWyrk1BX2XYuMSFFhezL6fDurToGx40TZT9N32zlsyOoOynGX8RXFR9QrUKrdZ5yPxVRioJbqYTVYDktvuI/lkGID1YZtVtwoVSS9XZo/RvKqNaPnngsIffuzSY+t+WaYhMs5u+akq7Mm76bHpg3Y1O/95aOrVilr7pOJktYRnLaBmr5au2h8xfsm7GSNk4JxAePn/sasD0a5S7tZjon2Uw2k/Mwza3CjVq3RyBVGUiI0guK3UDMEyXC1T0c/14M7ZRlrHWq3B3kgbv3pHTaamSkOQ2Wxvh4r3i9yFsH61CsMOz5MTSF3Mtu6PWOpZjy4ytliPPP8vX4j5RP4M+oH+WIWrBlCLVQ/Cs89Rtv9u20dlmVp6Fj201fSjesSrLwu5AOabO66Mo01HOasciRrG+tXFPkrtlrIM6/mmu7MmxNMD4ml3GMn3b9e3mZvx2lmlGnoYvZbs04y8sqOknDP1asHuA3lmGNGkEyKblHxeLA4qk8aqHa+KGsnrpD+uNei9Ne41Am46Ma55nqTWTeUnuWCajurH28XP369+HKP17MYpVisvFnJCAmb8s3KPol8qlldJNJO082/Eb5WLnXy2CeU5Dt30sInonDDqppeJgYgDr61p/WzVk3VhSTvpv0nrmQUcu1BQmbFtWa2dujW8tfdtn60aYH2VEqXUL+rG+QPtiJqQrVgCTexTmwrpoKORX76vvnxiysgrDz3NoGbMuUisOmNSwEdTiRF+yJNJHL6mHblJiHBtEIzFFoWErJqF5b59LfCyFuRcIKDTV2/t0rIuQhCJqvXKfUQf9PJqkFS0j2eo6ZjF1WvRTz5GNUtGJmr5xuapxtV2rbiEtp1jK+VcfztC042m1Wyzm1cquH+idZVAXGsgPzfBAKtTeT2/cJ2U8o7lVsxXpPY1FkOsnzQWr7a3LJclC5f4YSxI6XclJZtiWVbBjliyoagyttcseW+3ClLtjkacs5fx1qrJV6Ph9iDjqliuZYhYjeDRzqPOXXDXzFZgap+jzGJHeXmz0ThhKBVy6MpaxOn/5xronkrdxFAtrrRgku2YpTRlfrVuW2ixikFIDJjNU+N25XnmeoByz0tJ6otbGMryxLqPPc1j3qN7XZcXUvEuuTimEzI1VAXBBPjN8LNV9nqOfXxGj6J2bVGQuhsG6HJVJt+YelTku2tT6DY1A6MPOaxJ1eet+hH5ogBzcLhuTZE1o2yw7kzVoKXytAJNlf1rjVyp2/Ch9/7LFdv2iXR3zEHemc/4T/W6LZZw0M5/9Qe8sg0LSP3Xmga0HDrQfKlAKiGkuuTJaRrVom4mMSZf0sXLftEyZNQJM8Fhbk0rbF1vUI53iUI7V5smt056Y8UvH+FtzYyyoGVadXUp9qayjdj8nGLRbxmLoGDDsPIf6hf1Cb4Uh+6PmC2/rwNYEtKleelUXBbAxgFHJLe2m1/O17JJYL0yq+8k9MjSsi2JjAEMoyUSR1dE4xo5X/W5U46/6bOWsoN9yuZCESntdQ9dWVDAzfbaeh9Xy6i7mDBOM1bME3DJMhNKbLc2w/ZaJIpmCDu0umSlydJrdluIXRNFtXXLgl7VnuXCUTE2ndaEKSGTI2Kjpf5vBC60bVGvl99fzhKSdrcItzxPYXun8dI9/IFhnLkb6+ccfhy2cFdbNtFkIezEP/UIvhSH741lLM/nMWcWQyBNrGLEVLFsthrrd7MnWJj/1A22tmu4X9LNblZkm+Sp19aQ9A/1kXkDz7d551Na0mDqWvuR22+M3LXWNv2TQNw4GchSAc0WwuWRoHUBpvYDsIhX0C99Ue+/CMCHaD9e4ofVDK/z4NPHWh7UNwD4gFO0nYTIMNxH9WKB+wJl+pNeRUpT0ymK8afwxCFBXq8wG2RZKVgv/shVDDKdvX8P9lUeefMGeR735OYPl2F8GeKeI/KI1ftN4Frx6/N30Tfa5N+hlNsmmTUvfPD9gtQoyELJprhkAl5DcAAQJp+Sf7pP4ABpR6RegARp1bwAMRNCgKSNHxBfGik3s20CAJh5SEUEDYiCD0F7DSB+7gzic5F7F2LL5ylZB3Q/182smq90rlJYiuW9Un15/TKucv8KNYWmBk0uXDRQAYPfHv+VnAN7Gyz79rltvvfo5Ar4akN9otSvmmQja5zkMnUjg550MsIjonTCodqpThuEhVl/WK/J9kcFLVvzqiZctRl8nwR3fO/NZDfkPAPawv+1stXHgoVKTFqvQquGZ909Zhq3bCg20nRFdtbfVbdQTPlfSoNcfeeJGAGcDOHvNhac+enrz5tcAeD6I7bJBZv4RRxpraS1xvD4gzhsxbYuCHrpJAUUQiZJhwrTLj1cM8PidHnlCbwUBAHY54lWf3QZTvwXw3mIRjKVWjR+S2bMui83ORDOSNH62LlX8US+wpDbQpp+JTDSmlUe++Qd7HfP2P3zQDsv3JnESBrI6WRXY52TGFccekwCXL1ux/OTJZnDLobfCYJlGH1bOrRPbYPCyqK16jxW//oqrReQdaceChV2Vlayv1V20wpIzNe0t1imu0HbrDI5Y+aD5Q0l/Bvn/Fb9+8m0PedIpf7vn0ThABoNnDAbytYGgDr5SmyHukR8OZPnxuz3ulHUTE9pC6J2bBFgBqLQYwjMeiKzZ4dATLl6s/s0Kg8GXsXnzaXY7Q86QxVcbA5hFwZS7l2w8UuRg/P2EDs2cnB99b6xL9q80tprZoX2RUxoAXwDwhTXffOdB4KaXNoJnCvFwggMBbqHwsoFMfWyPJ77jbBGZzARtYfROGHIwVgbNsMqTzZWL1b/ZYped97n69ttuSNo+Zb8sD9s4oQqaS7+7nVGzP0SSMgxUwULaYJrXXtBqQwPgqTmMc+Uxb70KwF8C+Evy01Nrv3PDg1Y+4aS7c4l3zqH1hUXvhCEHY5LSg1ZrRWF5xOL1cHa4484bDwQqYU/8rtZCzPuK55N1rDcsmveq7VXSxG4OrNYetE0jXNkNmx+InDgN4O6xBXuCXsYMumpbup7GOSD2vOeycw9bnN7NDpxujq1TqcV9k0FTza1uDQDjd+vH4b8P0ZVOtSv3qZ0ixs4BeNPfrzZaUPROGAjdPm1z7jFzYnKCmzZv+ih58TaL2NWJced/f/hhEJySkzwE2ahfksacgmEto7FDlTmymRnNAtmNfe3vUGqXSxYkLQNk+oPeccWWQe+GrcFg6xAITTAZ/ODD1l16zYXrrvjXXrtMt3/3w0+fnua3Se4AMeMxatmurXSe5zDp1tEruznOsOeobZiRDvVkf9TQD0KxVC1D72KGYq9QYdhZfIzlHoeNvPzOH599+YD4UUPcG+52PU0WL1omPPgGAwzCCrQt3yCrixaHNGV7kePYxHPJkN0AHt6Q+9eZxjgAWOFQt6Uc/xDYclWMYTNxxepa3aLWbxojEMYyL0H0ThhEhARj0qRMHwKAphjzQXNMgTi0IQ/NUWdO06TtDFJnaZC0LRC2YrQCUyHQ0DBIvTJu2mpyJiexs7o3sUshEcaU94cZV7IKQG5ftJlyN6xqcEs/9yuPPf8+gw2200Qbt0nnuIcbhrYgeucmAbxZGcBmWbr385v0a3xNK7PMQjRsP325YxRITrQykAqRlIyXBKHKBqW3sf8pFlCrwZJ5ad4n8vZanTFKWaGyf7aiHVMxfhtzVP0p0riBxj1YguihMMjqasUtatC4a6ZwLewCBIoAW5GyJAXTZCFT5m9ZDTFFjb9eaO+aEVUSbJamzulLLmK7mgNdtAsDKQYY9/sQdXUmpo9lbSrVHAgpxr8Ml2IJon/CIPwOKo2VGDo961L76aXWEU5jMVraG5ZRkBnGFLCp0EJ7VylQvdE6wpmaLIUwa2+grZ2RNH6x76jrPqvxY8j4K7PY1S4RKw/k3j12PfgKLEH0TxiWDf4JQPanJT/kcj9/1mjhk2Fm5IcrRamS6aR4rc5VMweSyuStOMHk+nO3jJtVUB5HP/ejGL8Zu6ASCqTlB2P90A7MzRs7f+3zHAIh/mVr2fM13+idMKw46IQrIfJV/aza12qx/M1tWdOmbQ6tYDPHFtmHNlYlMU739mhtM+f1kbdEmBNp9oipHspJbRsBSdobVisPsQB6LcVASDFMbaFK+qa+WtQUw0RXy1i7MGYByGbZsmUfmMnzeiChd8IAAMsFr6TI3WkV2mhmoO0bD9Ps2fbHckY71lq5y9Kw0p4jfx/CWLLklmg5bUPXTkxf602idoy5n5KE2FodmL5VoUoxJi1l2x6yE/a03Y48+fJWM0sEvRSG7R954k1TkJeLJvOtZi60eaVVrU+efPXMmDTasStWyP537XMbTd7hz2tsmtusBqSamerMmfMIhqbNapXnOZjbN/FO8Yocv7SzU5mWtSK2rIAXrRwcecqQR7Ik0EthAICdDj3xnCnI74OYznwhLfVnGaxBs5gAABImSURBVLvI0FiOTNuh27ozcHKTi1nrIZUVyWajuJYXvsRoWrQK55igkpbC/cuCWQTDRf9LobULb10HhVDXLw0GQKwaLN/+d+Toozd3TNCSQRd39ArrL/3Xp2xm81E03BsVcwLMz9wyGYHiiXdYhNbhehNYqgtt65bxCRDNU263I9uV3ieL0EE/DyDVS2OMzFyvT9R9yzxfJheK8VcWIbZPkGftIfv+mRz90vuwxNF7YQAAXvfpndet3/TXEHkpyW0Ds9jgUUqmSQFuZMJKQ5Y+vxWCwNB2D5Th4sS0liGzcNbBL+P/VSxTl6vaBczh+uQWiul/GSTb9nOyQMvbHFtWFFFxXD4lg1evPPqt3xo190sJW4UwKNZf+sk9N7H5kwHlhU3THICklQMk+c2lhrTasLXa2j44kF6tP5/udmhYjRvK9lEwJKp6Zbtd11LN1E6m331GQWwd05Zx4+4F+XVM4UN7HPmWr/f1xNliYasSBosNl3xi703EURAe0FBWCqdXArIcaMAGkBgNsbFatEl8Z4UoMH7TzdC652iAGM7nDXtNukzA/r5xsafP8lu12S/RaVL1FkMPrRPoDgA0rU2EQfwEuIvk2oHg5kbwX3vs/oiLl+oagsPhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOBwOh8PhcDgcDofD4XA4HA6Hw+FwOB4okHEFSK4EsFZEuAX64+g5SA4A7Bg/bhSR+xapH8v0vYhsXmhizyP5XZINyScuKLE5gOSxJK+Nf89b7P4oSP4ZyVXx71GL3Z9hILmc5Mb4d94E5Q9hxt9V7Zy4sL0t+nFX7MNd89XmshH31gE4Ir7/YwDfGNGxnQAcNce+XCIiN82i3g4ADojvV3QVILkzgCNn27EK/yEi905Q7kDkOdl5nmgvFLaJr1MTlJ0276cAgORhAM4G8CskHyoifzPP/dsiGCUMXwHwEwCPAvAMkg8RkZuHlN0fwBfm2JdXAPjIHNsYhodj7v1TPBTA6nlqa2tESxgA3AJgp/j+NJJXi8jntmy35o6hwiAiJPkeAP8cy70cwDu2VMdqRB9RzfhFIvLXi9WXrQ0kXwdgmKs7MO+PIPmlIeUuE5GT0CEMInIzyeMBfBshnvgEyceLyCVz7PoWxSjLAACfAvAuAPsAeDnJU0VkekydCwD8y4T0nwJgUj9TADw9vh/mphxM8pjq2m0AbgDwghFtvwyZWd4D4Icjyq4Z088+4v8gz90o7DGinLp6XZYBIvIjki9AUFgPAvCvJA8XkQ2z6O+iIAkDyUcCeHRHmUsQhGEdgD8iqYPbKCLndJS/QkQ+Ognx6MvPZ9D1uvhn8WUROQ5BsIf1wwbe54jI9+exTzMCySkEZpoJNorI/SPur0FQCF0QBDcXCErmliHlfh5fbfZo26IhkS9Gb+IkAAcD+ACCR7FVwFqG4wCMcj0OAXCm+XwngC5h2Bqxn3n/00XrRcARAP5zhnX+GsCbht0UkTcAeEPXPZLLAaggfUNEjh9Dy1rlLqF9K4AnIyhWkhyISDOmzV5gnJs0Z5A8DsH1AICTFziw+hcAF1bXJslQ7RtfNwG4dV579MCDdXtawiAim0i+EMBBIvL5cY2RvBnAXnPozwqSs1kDWyciRZbPCsPnAFw7poEdAZwV6/3XhERXIJhMYOFTjBeJyFnDbpJ8GoDdqsvbANglvl8P4IVD5vbnIvLNjja/DOBXOspbOv9GctTi1NNF5IqO6z8EcNmQOrsBeNqINhcEIjJNciOA5RjizonIlQCu3KIdmwfYVbyrAVw9qjDJk0yd94wq21O8E8DhI+7vguHB/9cAtIQBwC8jpFtH4SFj7i8fcv2cYTl7kodjjDBEDf1rY2jbtYVDSP7tmPIWB05Y/mIR+fSYMhvRtuqjcDRC36cBrJpBvd8EsH3XjYndpLiw9hfx4w+7tOQSxU+RtydYrEReBPwZysCzvr9QW12OB/DcGZR/GPIzngQPmbD8xwCME4bbReTJkxKOK88rANwzw3rXIYyzhZnEDG9ANv1bzCrEAG9n5FVSANg27pkCStdrJ3Pd4vYqJbwWwHMmIC/otga5QMhUtUDynwC8NH58ep1zJ/lhhJX9hQSxMIJm97RN0v4DJ4COJlmzFZcC+LcF61EbxyCshlscj+5A9/T4V+NQhNV0xf0i8q1xhEmO3cg4AruY97d33LfuyYJYBhF5PoDnd92LG+5WisgvZtouya8DeBKCi7J8a8kWjcNgXAGSDwLwCQTNPA3gDxd8l+AWBskjSL4q/u0xT83uat53CYOd+8VgpicCuIXkzST/ZIZ1dc1hCuU4AcxZiSwaJrEMpyNng04XkYtnSMM+9NlowJ8D+OQs6lncOeb+7wJ4c3z/A8xPelUtw0YRuafj/oJbhjH4/fi6F0avuHfB7lHbE8HtBACQfDiAz5N8L4CzxywG9gojhYHkq5H92isBnDILGtaHXzfTyiLyYwAvnAXdxYYKQ5dVAEphWDDLQHJvhB0EFssAPDO+vzWW+40xTU2LyPfi+5+b63ugTP8+DWGB9qMInsQ/z6Lbi4KhwkDyWQDOMJc+O8uDHDateMcs6o9E3EP/9vjxlSJy0XzTmCXGCcOWcpNeitEbLPfAZCveGxC2ywOlMOxZlfud+DoNYNimv16iUxhIPgFhf7p9YCeT3BXAn4vIxhnQWFBhQGC6Q+L7IsVJcmqCjYXzjpgBU8a5bUgxaxm2thjMLs6mNCXJ7ZHPcFwoIsPG3ku0hIHkbwL4IoDtOsq/CsCjSZ4gIv8zIQ0rDMO05EQgeSiA0xDOPXx5VCBPci8A15H8EYBTReTf50J7hphkzHbuF1Jgz0a5W+DpAP48vj8TwGcnbMf28Yr4eQrAI8z1o5D5Zus+z0DyWACfQV5m32De/whhK/ARAH5A8vki8h8T0Pil+Ho/SvM6GzwT4WE+HSEbMmoN4NkIfX88ZhGrzBF2lXvYtgS7brJgwiAi1wO4HgBIbgPgQ/HWzwC8YUhwP67N+0leC+AglMJgdyBvvcJA8rkIWxH0IZ2FsFfntfHzqwG8BOFE2u4Azif5VhF59xgaqiWvmgeX5ffi61qEcxOjoA/mFxjvE1vG3DSLftU4wrz/7pAyVhHNB81J8AqE46gA8JcqCDGdrJb+cyIyyVnynyAIw8Gxjd0AaL3/FpGZ7v5dSfKaGZRXl3jHGdarkwkJy4CQZ0dIX2qM8H4ReX1MjymmReSVJO8E8MZY9gmjqJLcE8CD48eujWgTg+S+AA6LH88bJVgkH2L6dt4Ei0J7m/eTun+j8FjzfpgwzLcAjgTJ/QCcGj/+F4L7pBDk/VG2X6PwPQTruwvJAxEUlbpIk7peFlMIx3NnisEs67Wg2ula5Fz3X4nIKcMqiMhJUSBOQtA0o/BM8/7S2XYy4sXm/WfGlH02smBPYq51o916EVk7suQYxAWnx8SPPxWRYa6hZbqZJCRm06cphIXTnRGe85/Pw1f/2C+IeDxyCn4DglcxU0xjZopoPwQhJoAbZ1BvbwxJHC0DABG5neT/RzCR7xvXmoicRvJTxhTegLA8DwRfVPFs837bGMwCwFtE5EsAzkU4SQeMsBxxv9Eb48c7MPqbOrZDcOkA4C6M2VsUocKweoKy43AQ8ga8YVYBKIVhoRemHobSin+12qZuV4yPJ9kV9H9cRF5rPv8QITmwK8JWHZ3Df5ylQlkjIuN2/yaYjXp3z7DeRBv1niciP+sq1AURWW3er0fFoDENe1T8uBbAdcjbiXeJ9W7CZIdvTkFmsPeLyCi34lTkFfNPjimrwqO58mFHI2eCx5n3o4RBtxE34/o4V4jINSTXICyACsp9UzW2GXJ/B/tBRBqS3wLwLAQFAASh3hq39gMozzNMLAgT4hmm/fMxy4wJyd2Rz9H+FN0b8RRHIQf8tyBvsRiFY5A143wIg10tH3UASv3rLfWNdK9BGRtZ7IS8u+BShC3XNbrc3G8gCIPiYyPcwmF4OcJcbMl52AEdazsLeezTMsVHMCKKHwURWRsPqXwcwJs7vsDrPxB2Zu4E4O+RY4U/FZFJFvnsNupxGaqRiIGkfsvGjQC+M6K4Wob1c6E5KUYdromJjlPix2smcZUjbJZuM4DiIBLJhwE4JLrEw/q1RVepRaTeAZ2wIMIQmVeZ4ocicgHJF42psw2Ah4nIVfU9Efk3klcD+HHHvetI/g9CWli/reE8ETm3g8xzELTQ5khzP+TtAzcC+Hy8/iwA3xeRG0nq6vYk+fhXIluZM8dksdTt2CLCMFfUq/kxKD/NFLlWRGrL+miEI68XAThhNtvFtyTmXRgig/29uTTpVw3uDeBKklei44sDhn0hVUyjnouQ0QBC0Ny5JbnjYb0e2ZJ8MJ7vfRmAf0TY3vy0uFFwLEhuC+AP4sf7MT6jon75uB21WwI2HtiP5OsRviRhH/N6FYDfNuXeC+BY8/lgko8TEesaaqD6BCxwxmw+MK/CENcCvon8oD875LuVuqDnCA7GhHljko9DSLPqKvcGAC8a8TWYtu7bAfxZ/HgPgLNiWvRYBAH5JQAXkvy9SQ4CIVgdPQn46VEZFZIrkK3Ygu7fIflQBDdy1/i3W8d7m9k6HN3nxNPCFslXIG/pAIK/vx1CvGYX7B4ZX6+d0GXtL0i+lxm/PqbsISRvMOV/Flcl9f6LzL0Xd9R/lrk/css2yQHDQZz7TZ2bST52VL1YV0i+jyXeYe5Pkfxnc+++6DaNanMnktfNYK6eZsr+U3XvN8y9huT0iD/FaSNoHcHZ4R6Sl5P8CskzSb4ktvdUhm/sVrye5NtMf3/b0L4sXj97WP9mCy7At3CPIzhWGBiY609J3mvK3sLsa2s5Kwz1t96B5PvN/cfU92OZFSRfy5LxSPJSBqs0bjyHkvx8VbeVCoxj+rAps5Hha2aGtfsxU/bbE/TjfFP+ZdU9KwyTYpQw7GbKbWJQGj8m+Q2SnyJ5Bsm/MWW+xpDBq9uZIvl2kptN2XfFezsyPHOSvIrk9iT3ZRAOMgrSfIJ9EwaSjyf5rerB3Eyy9T1CDBpFcTXJPyB5XPw7lUETkUHbP6iqewDJD5Bc18EIX2VwO0aN4zEkzzMPR/HOGYx/A8nf6ijzHFPmLoYMit7bPzLFrgzW4zCS55jy0wyHb2x7VhiuIPnFIX8XmnJDhSG2eVDsQ+dxTJJ7mrZaq/skf5nt5/yhqszx5t6VzAJ/77jnMxuwL8LAoG2+wja+wrB1uqutvVhaj2FobbVm0GI1LmZgxJHnuFlqPcVdJF87ql6sKyQ/WdU7zNzfm+Tt5v4Lq/pnjRnrX3XQtMJw0oi+HW7KjRSGCcY5VBhI/hLJteb+NMl3d807ydM6xrggJ93YI2EQlprpDpKvmaC9l3O0QFzKyr2K9Q5i8N1J8uskn9TV/hCahzL7uLczmPoHj6+Z6m9L8jux/mqS+5t7R5JcH+99vKPuiUPGuYHDGapXwhDvnxvv3cBw8GtUW+9kdqVuYYfLNR/gAgjDyG8xIPk2hAM9AHCciPzA3DsEYZHqQwhbJCbqVGTEX0H+cQsgrE7fCOD6Ybl5hi3m187mG7JJvhEhc/ZBEZnx2QaGvVHnIHwzyOrq3mMQvm36WBG5u7q3M8LB+50RthzfgbAt5SIR6fy2a4ZtLPorQ5eJSOf25DiPR8WPV4vI5TMdV0VTLfIqEXlTdX8lwhcKv7ke45D2DkZYY/h3EVmQ1DHz3qTWd6bOFnP6Sg+Sy2d4BNThmBcwxKVTCEcL5nQ8wOFwOBwOh8PhcDgcDofD4XA4HLPG/wL++QhYbLqZPgAAAABJRU5ErkJggg==',
- e: 1
- },
- {
- id: 'image_1',
- w: 1080,
- h: 3,
- u: '',
- p: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABDgAAAAECAYAAABr549KAAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAQPklEQVR4nO2bW44cx5WGvz8yq9gtkbQ1tmDIkAFiYMwDX7UBbcLrEbgebYIb0CsfBoJBwMIIguwZXXjprs44vx/ikpFZ1RQHMPykAJuVGXHucT0n44hfy7+12FZ/efZMfAE8gy+fPtVfAOp/z58/1+fAc+BzgEePxGfw4sVf9bSif318qD/X55fztXj5kidPnvDNt9/r0z/Bt99dF15/hPT9UQBp/lGaHnQZfj8dBPB/P74SH33ER8APP70SgKaD+A3o1Rs95jE/pzcFLxUcpbfl/c1c36faPgteI63vb4APlfT25iSA6wp7k05qcFdccaPSLk3idCeugNtU6Sehu9qedAROWsSptJ+U9IATpKTTXdLxAHdKOgBaFqGkOy2CIwctEgXvThJL1uFw4G7JkhbBAZRFhWFZxOGAliwkwQJKWiouwEFJzMAicSi/C0sxtKoOWWJemBeJQ1JrXlRokFPvG5HXsSIV2jlq3QytPQOEYEZacRYNtHIWU5UjF6ZT001SLkQKrUkrXsQqA6U+k5k0D7KFyBmYakXDmQjFKuM0jP1oPHLRbYe35QvQcBNZ1jQ2KdTEH+VkggivfACYReQzOHKls6GSBLn9Y6p2yVE1TcCG/gQRWgnWMklEVAQIvNONitfgmzxWkzGAFBWU0tZl6DLtbcZg51irCJImFdxo/1Z7jODyyn/TFNq8d/064k6W2DxO07Y9iI6dBrk71frQnyev/OPcnnH2UMvk0hcp3YPQGGZt9OmCJPZEpQv9+c4yzpX6HgHMWtvG310ZO6NVRWyrJG37fOy/Up/OaralaRqBOsC5+gOH9ywRVZhhBL0P+jjgEqSE3w34S/TSSs/2vn4cj+W3zd8YbLcRqeI3Wr8gx2iDcUxWW9ipyxQ7cc8oJ/kyv60GWPfY7HxKkOQiS9raZ6dCdP4rnR1XcrYvdeBa8k7+xGasJbvPmZxhqtCevdJs/M91DNutV7d9Je8tmil2nxLkyExMZMvjbElddnu1zSB/an23zuPETtZLfTHqCUCByVWeor49AUxTlSC8GZONd186qnxpqs/r+tNtlTNUvRvdsz7vsNHlal3ktI7VKdkZIKdhTo02Ks/TiLfh38Qe8G33+rzayGmVcaLwnRpgssvenVZchwHM1PHmFG62siczr3CVsqGcuDyF89JsM8MM3tgpDDPz1OgvcBde5vJuT4YFnDx3AWzugHmVyZ1/5VPEKHV3VUZgJlzFMY12k9dh5tk4fFd1Pxxm+1Rp2z558rHy9xzGs0+cOB5nc4LbQ/joMLfA8eCjZ5+4xT642/IYvnL4BiAOhfYt+Jh95aNvBn2uIpuro4nsjZ7xwPAaX1+ZN0AspT2uDK/hg8X8/BB/mE3cGeDRww/MT8DDxT/+CH5U6vkB/PihAT6qsH/P5df5seF7YvmNAeLjk/kf+OQPbw2f8s3fvmH55GMDPFneGuBr4M+nVwZ4ATx9+p/mK+Dnn/2c4p89Bz7//PvC/0vgxQvzRXXu+KL3q3T/+vtr+dcXbRzu9ynNKecLePYMvgC+fKp3OubAi+tzx/zlXBzwJwDzA3373T/0yR8/Ab6FdNR330Gaj9L0k2B1xouD/RE//PQ36T9+r98AP6XX0qtZpLeChyi91cOH8Or1JL2dxMNJenvbHPf0Nt3qmmvQSVLSjZK4PenqCm5vk0iTkHSlOxXnNOl0V54fqDjap1MSWsTxgFIk7iSUJak4xpJYFqGsRVM6QD14Zi06Fsf4kMUyI0UiSwtZM3N3rtWcP0UihzLSBGRJSJpz1jKHlGdR9+AJCYUySCFBVKc8isMkJ5iIcJpEqYtQdcQUFb/UF7xpmhThCudETGIKRRSchBQVHyRJStR2ORW+CCzZqTqHKSQlrAgEk1DlkSRZCSxkhZVSCkVYiUkoJCRcaRsVx1FClkIJWSSKDnIiJMsSStgiWW48HCJNRTaKnFiVJpJJCGEnqejiQIiKj0SFwbTASLgGHGpYBoNAzXEs9i3nyCRqnbGKh+jqKAqwcnE0Gq0yg1fnowcKAIdAuDrTogbXJGTjDlzajSksXbwGq/IPcBGZ5k80OdsbBg+Onlu9CHuArw1e8aNpg6Uib33tQrcgTDsXrbR6AKcdGJv9ql3UzmhlkHslusrZeseuJt3Yo/x6o+8eflV/ALBdTe069HfBTRqXLe1qaMImla4aAdTYVrm6bbfiuFkMrzoOtryg+14ul5Wnnd2q+dexdO5bNvac02tcPfLd8KvmbgRKN6jbcdV95a0N/oao+1joLdUYG3NUoLO+azpshnzlawmZrfoNSBdtuQ7ZLc0R5lyDOv629t/y25Bwnf8b2XQOWzgNdj3rlta3q601ot7Tv71xJ9Zm0Jzp1/n1cc34X1ejtY1khoW1tI0KDW3b50GfJpjHFa4Pm27zcbk9L7r4uFZcGvDrktbKao21B8UawelzW7buo3suY+8+1SV1lKrb1aA0LkV7+2mltVZXGQe6g/1dN7jNMrNyhbqc6EyVXuFB0DK1Rr0Y4UvdufrawfZ6b0EqPhsedTpXew/bzzjLBQSUg1eR0WO8ZJ2AG+HWBawu5tZ+W60TtEEONh8E3Om2Bg86n23/d75thRx4DjZJW7p9saj9MoowMBydtygzmjQ4/5Y2u1lqpyFc5U5NkK0OUgukbGypYROycNdl7MZy1Km7R5vPVQ411LbjVEQNNnSB3Q6/QQ65bUdmDblXvYbFUrJXeQ01vteDXB7w3bYaY4OTazSP1Ow/9r1to0Bysh3C2FHnUBQr2KQpJEdkSHJgmSRbDhY7TSmiHD6dqJE7K0hF9hK3VAlsJBkrqrBGKnFOO0pg1A4li4hwMtgp4TCRUnJyRJAM2SWQK5NwsYejjJvkEqSycxlPTlKAC2wZAU6O6LAk55xNarjJCZd3R2TsKSXnjFOFn5KCbJPsnGFKKRbK+0RypgSPphbMnMGOKAG4yfjOCzAzFZPZxor5avKyLODJnm3uCixzePZkKt0727Pr56spooRja8BqzuEWxLXNYQo7Sh+c4OiDbw9LlObwlY92ZN84fPUg/NZHXzmMj+bqle0HNYAU9vUD8yrb19kPP8x+9Qoc1z349Ojh4h/jQzsW88MP/PbxQ/PbO/O/8Pff3pl//A7XwFEsp/LbA0a/M8utX9Yh+mR56zFQRAsSwSZQxOefG74sQSKAv7xwiRF9wT5Y9D7lPT91/Fr+lWXRfiuuTvC8NIgRGoav8gAcpBYoAUm5BiEAhq+426/gLbhRv4xG6OLXwQtlmiYufmL7BfQS3NjIMLQWOdpXlXJAsAhKcEP1C63rF8ROZQZFCdyMDqMqsVTf2m9ADF+he0mWAkHlkyZB5V/4KlLZpVTCGGo7Yz2zq3ogdSeT1i/uSeGscFanULZ/9W21C9T3yvGktnNMAjZfibWeuO4JbmxWgdDKwZdcgaZDYd6OinYJ3Aw21iBn1d3IBWmQTUG9qTDoJaMWLAjQGty46Imcl0ZLTfbCpb6cnyAvELiv5QzSlKDVemwWa99X83f77OQf9E4l+Gb1MVnItpNTUUttcg5E+mmNzcPofN4v/vbV53VtLFwgYu/H34Z/HeOsf97pr2F+NHusWg14rn/a2Q+VwJylfhrtvoA4Wz9pzVt5KqV7dBn/9gZoqu7gLtrlMs02LqxhjKhMlTpHmo4Xcdv4O5PVbZyk9c/teQPX1bmgWnNsL8ei9vYYNOyRtPfD2TmmA6kSZPF+4p5JvI70zr4tvbyjN96ll3Yw2veBi01NUjnFFtu6fxBqI+vd/df6f9fe+tSuNHyx/R69Gr0N3Xv07/v9Fu7SyBjGnM9CBT2WcWGeXphLdVtounijV9dusJ13MqoQ8a6trBcbDQYdtjK/e1xfXD/Oagb3e0d4Azv2l0BK6z7hqGeG8dZeQiTVerZrYueyrhsedRz3m7b/nE2hy+v6RtOu2KUNIHT5SpVgF6Tf2Wa1Q3PXJUVdr2VJXs+DYRQezw11nd/OgX7OS/Q1sY0Q9aiGh/HZbTIouhnTQ4yw/mzm3AjbDqEtKjfA9n7RVndIIs7tWmejUhUs2tlUVgn3WDg6ZF08tufKQNFh+8cfqaxZVYaoUhWYcNszo35IXD8sdQUShK31xme9QTXsteVmlol2G3n0HquvEf3cszqXqWnP4HAOH1zVfIR6XfDecuat1ruk0/tsSCPPpnSn0z/uThOUU3vWFFLOIXJoUvG1yo1tyk1soEBLMJdLNXP9k7Qsud/Q1tJ8uJlfy7+vvN/A+LX8S0r/gltvwTx7VgJTX365pqc8f/7x5gbMV4/+W5/xGXwGvPhrwX8KX399np4yP/hQn/6p1H373bX4Y3ke01PgY9qNGLg/RUW1XlNJT+HxT/z8qqYltBSV12/FI85SVN6kWR98AHp7ozc39fnmVlxf8/bmpDE9BUCadAXcKIkb0PWd4Iqr0125WQMo3QkegO6k9uX+tIgH0NM/Tqm83y2CpLsl6XAALYtODUZJl9JTOMBhSVq0aObAUusgq6ScHJBygV2SOMwlrWTJXZ6ZrBKA+YXUlFaUtNTGXldTVC6mp0BNUanpKT3A1OqgpagsGupaegr0jailp2SVwFiu2J1lSGsES1tZOtt9SsSF1BRgs/lfTE3Z4hb+F1JUpjSkbtClRtrZYuqktukLVacYYSlXctsGTZT0m1wJTlKO4XpwwLRPMRl1amXcdINdWkr9HhUD/8ovZKVdqsc+PWWq+jduU8nbuLyWlxtY27qpBzmHS+NV3iGVprAvn2nq5XyV7IIyYlpay/hW6NNvQU8b/tv8hijRx67vHqoFPc/rU8VdbRpwzmbyZZtskBq8z+WMy1f+pQs2hWEc3MdoKBrn1yV5GG707xOEUhkQ7TCYUn++lL5wAbs+t1SVcUqsAK0+lvXQusk9+OW8lXeXLv97onf+PdnAlz/RvEdqyMiv5VTs0EebEambuaeKtK7oqSvv4O72hTou8xvfZ3mdZxBkEhOWPeof0VIldsZLieY7v5f+Z6kSiZRGbarsiXMDeJ8aU2TqYMneZt+kjV2d7a08aWfANQSXWnpJSoZM5Pa86alKYrhN0Pj7PB2lfvVlX59J7hkRdTFLljtUKvYnjakrlBsLbZ/qPNJZX6Se/lOFy2OocUix2CBpczskB0zthsQ0DWkNsEnv2KSoDO9AsrzNhGv09jQq/55xs5XNQ0rOxET5Ul745RG223vl1VNVSl4L/GKqSktVWnw5VSXt7JDXNJVmo3nGy4rT0lRKCgn0NJWZ+r1x8gwsU5RxsZS7B8xzE6vSCjPNkKlpKiVFpcEtlPSiZZrM8v9MVZnnloFS6oZUFTjZntY0lXkyS0lTubPNPBmHD7bhgKn1wGFuNw9mw4mTZx8BjuWWABH2MYxr+olnw225PdDSVKLcGOAGbo4Fzi43AUqayg320VcPcrlNAGzSVGqKymtnf8CHXExR4SGuOC1NxbEYHuO8+H1SVIDLaSpAS1X55m+wfPLaT3jCy5cvefLpH0r7n1+ZF9s0la/4is9+/q/LNxDuuX3wa5rKv6/8EycY65bo+YM2AAAAAElFTkSuQmCC',
- e: 1
- }
- ],
- layers = [
- {
- ddd: 0,
- ind: 1,
- ty: 2,
- nm: '加载视频@3x.png',
- cl: 'png',
- refId: 'image_0',
- sr: 1,
- ks: {
- o: { a: 0, k: 100, ix: 11 },
- r: { a: 0, k: 0, ix: 10 },
- p: { a: 0, k: [1218, 562, 0], ix: 2 },
- a: { a: 0, k: [97.5, 132, 0], ix: 1 },
- s: { a: 0, k: [100, 100, 100], ix: 6 }
- },
- ao: 0,
- ip: 0,
- op: 300,
- st: 0,
- bm: 0
- },
- {
- ddd: 0,
- ind: 2,
- ty: 2,
- nm: '进度条@3x.png',
- cl: 'png',
- refId: 'image_1',
- sr: 1,
- ks: {
- o: {
- a: 1,
- k: [
- {
- i: { x: [0.667], y: [1] },
- o: { x: [0.333], y: [0] },
- t: 60,
- s: [100],
- e: [0]
- },
- {
- i: { x: [0.667], y: [1] },
- o: { x: [0.333], y: [0] },
- t: 61,
- s: [0],
- e: [0]
- },
- { t: 120 }
- ],
- ix: 11
- },
- r: { a: 0, k: 0, ix: 10 },
- p: { a: 0, k: [678, 587.5, 0], ix: 2 },
- a: { a: 0, k: [0, 1.5, 0], ix: 1 },
- s: {
- a: 1,
- k: [
- {
- i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] },
- o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] },
- t: 0,
- s: [0, 100, 100],
- e: [100, 100, 100]
- },
- { t: 60 }
- ],
- ix: 6
- }
- },
- ao: 0,
- ip: 0,
- op: 300,
- st: 0,
- bm: 0
- },
- {
- ddd: 0,
- ind: 3,
- ty: 2,
- nm: '进度条@3x.png',
- cl: 'png',
- refId: 'image_1',
- sr: 1,
- ks: {
- o: {
- a: 1,
- k: [
- {
- i: { x: [0.667], y: [1] },
- o: { x: [0.333], y: [0] },
- t: 0,
- s: [0],
- e: [0]
- },
- {
- i: { x: [0.667], y: [1] },
- o: { x: [0.333], y: [0] },
- t: 60,
- s: [0],
- e: [100]
- },
- { t: 61 }
- ],
- ix: 11
- },
- r: { a: 0, k: 0, ix: 10 },
- p: { a: 0, k: [1758, 589, 0], ix: 2 },
- a: { a: 0, k: [1080, 3, 0], ix: 1 },
- s: {
- a: 1,
- k: [
- {
- i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] },
- o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] },
- t: 60,
- s: [100, 100, 100],
- e: [100, 100, 100]
- },
- {
- i: { x: [0.667, 0.667, 0.667], y: [1, 1, 1] },
- o: { x: [0.333, 0.333, 0.333], y: [0, 0, 0] },
- t: 61,
- s: [100, 100, 100],
- e: [0, 100, 100]
- },
- { t: 120 }
- ],
- ix: 6
- }
- },
- ao: 0,
- ip: 0,
- op: 300,
- st: 0,
- bm: 0
- }
- ],
- markers = [],
- playLoadData = { v, fr, ip, op, w, h, nm, ddd, assets, layers, markers };
- function _defineProperty$1(e, t, r) {
- return (
- (t = _toPropertyKey(t)) in e
- ? Object.defineProperty(e, t, {
- value: r,
- enumerable: !0,
- configurable: !0,
- writable: !0
- })
- : (e[t] = r),
- e
- );
- }
- function _toPrimitive(e, t) {
- if (typeof e != 'object' || e === null) return e;
- var r = e[Symbol.toPrimitive];
- if (r !== void 0) {
- var i = r.call(e, t || 'default');
- if (typeof i != 'object') return i;
- throw new TypeError('@@toPrimitive must return a primitive value.');
- }
- return (t === 'string' ? String : Number)(e);
- }
- function _toPropertyKey(e) {
- var t = _toPrimitive(e, 'string');
- return typeof t == 'symbol' ? t : String(t);
- }
- function _classCallCheck(e, t) {
- if (!(e instanceof t))
- throw new TypeError('Cannot call a class as a function');
- }
- function _defineProperties(e, t) {
- for (var r = 0; r < t.length; r++) {
- var i = t[r];
- (i.enumerable = i.enumerable || !1),
- (i.configurable = !0),
- 'value' in i && (i.writable = !0),
- Object.defineProperty(e, i.key, i);
- }
- }
- function _createClass(e, t, r) {
- return (
- t && _defineProperties(e.prototype, t), r && _defineProperties(e, r), e
- );
- }
- function _defineProperty(e, t, r) {
- return (
- t in e
- ? Object.defineProperty(e, t, {
- value: r,
- enumerable: !0,
- configurable: !0,
- writable: !0
- })
- : (e[t] = r),
- e
- );
- }
- function ownKeys(e, t) {
- var r = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var i = Object.getOwnPropertySymbols(e);
- t &&
- (i = i.filter(function (s) {
- return Object.getOwnPropertyDescriptor(e, s).enumerable;
- })),
- r.push.apply(r, i);
- }
- return r;
- }
- function _objectSpread2(e) {
- for (var t = 1; t < arguments.length; t++) {
- var r = arguments[t] != null ? arguments[t] : {};
- t % 2
- ? ownKeys(Object(r), !0).forEach(function (i) {
- _defineProperty(e, i, r[i]);
- })
- : Object.getOwnPropertyDescriptors
- ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r))
- : ownKeys(Object(r)).forEach(function (i) {
- Object.defineProperty(e, i, Object.getOwnPropertyDescriptor(r, i));
- });
- }
- return e;
- }
- var defaults$1 = { addCSS: !0, thumbWidth: 15, watch: !0 };
- function matches$1(e, t) {
- return function () {
- return Array.from(document.querySelectorAll(t)).includes(this);
- }.call(e, t);
- }
- function trigger(e, t) {
- if (e && t) {
- var r = new Event(t, { bubbles: !0 });
- e.dispatchEvent(r);
- }
- }
- var getConstructor$1 = function (e) {
- return e != null ? e.constructor : null;
- },
- instanceOf$1 = function (e, t) {
- return !!(e && t && e instanceof t);
- },
- isNullOrUndefined$1 = function (e) {
- return e == null;
- },
- isObject$1 = function (e) {
- return getConstructor$1(e) === Object;
- },
- isNumber$1 = function (e) {
- return getConstructor$1(e) === Number && !Number.isNaN(e);
- },
- isString$1 = function (e) {
- return getConstructor$1(e) === String;
- },
- isBoolean$1 = function (e) {
- return getConstructor$1(e) === Boolean;
- },
- isFunction$1 = function (e) {
- return getConstructor$1(e) === Function;
- },
- isArray$1 = function (e) {
- return Array.isArray(e);
- },
- isNodeList$1 = function (e) {
- return instanceOf$1(e, NodeList);
- },
- isElement$1 = function (e) {
- return instanceOf$1(e, Element);
- },
- isEvent$1 = function (e) {
- return instanceOf$1(e, Event);
- },
- isEmpty$1 = function (e) {
- return (
- isNullOrUndefined$1(e) ||
- ((isString$1(e) || isArray$1(e) || isNodeList$1(e)) && !e.length) ||
- (isObject$1(e) && !Object.keys(e).length)
- );
- },
- is$1 = {
- nullOrUndefined: isNullOrUndefined$1,
- object: isObject$1,
- number: isNumber$1,
- string: isString$1,
- boolean: isBoolean$1,
- function: isFunction$1,
- array: isArray$1,
- nodeList: isNodeList$1,
- element: isElement$1,
- event: isEvent$1,
- empty: isEmpty$1
- };
- function getDecimalPlaces(e) {
- var t = ''.concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);
- return t ? Math.max(0, (t[1] ? t[1].length : 0) - (t[2] ? +t[2] : 0)) : 0;
- }
- function round(e, t) {
- if (1 > t) {
- var r = getDecimalPlaces(t);
- return parseFloat(e.toFixed(r));
- }
- return Math.round(e / t) * t;
- }
- var RangeTouch = (function () {
- function e(t, r) {
- _classCallCheck(this, e),
- is$1.element(t)
- ? (this.element = t)
- : is$1.string(t) && (this.element = document.querySelector(t)),
- is$1.element(this.element) &&
- is$1.empty(this.element.rangeTouch) &&
- ((this.config = _objectSpread2({}, defaults$1, {}, r)), this.init());
- }
- return (
- _createClass(
- e,
- [
- {
- key: 'init',
- value: function () {
- e.enabled &&
- (this.config.addCSS &&
- ((this.element.style.userSelect = 'none'),
- (this.element.style.webKitUserSelect = 'none'),
- (this.element.style.touchAction = 'manipulation')),
- this.listeners(!0),
- (this.element.rangeTouch = this));
- }
- },
- {
- key: 'destroy',
- value: function () {
- e.enabled &&
- (this.config.addCSS &&
- ((this.element.style.userSelect = ''),
- (this.element.style.webKitUserSelect = ''),
- (this.element.style.touchAction = '')),
- this.listeners(!1),
- (this.element.rangeTouch = null));
- }
- },
- {
- key: 'listeners',
- value: function (t) {
- var r = this,
- i = t ? 'addEventListener' : 'removeEventListener';
- ['touchstart', 'touchmove', 'touchend'].forEach(function (s) {
- r.element[i](
- s,
- function (n) {
- return r.set(n);
- },
- !1
- );
- });
- }
- },
- {
- key: 'get',
- value: function (t) {
- if (!e.enabled || !is$1.event(t)) return null;
- var r,
- i = t.target,
- s = t.changedTouches[0],
- n = parseFloat(i.getAttribute('min')) || 0,
- a = parseFloat(i.getAttribute('max')) || 100,
- o = parseFloat(i.getAttribute('step')) || 1,
- l = i.getBoundingClientRect(),
- c = ((100 / l.width) * (this.config.thumbWidth / 2)) / 100;
- return (
- 0 > (r = (100 / l.width) * (s.clientX - l.left))
- ? (r = 0)
- : 100 < r && (r = 100),
- 50 > r
- ? (r -= (100 - 2 * r) * c)
- : 50 < r && (r += 2 * (r - 50) * c),
- n + round((r / 100) * (a - n), o)
- );
- }
- },
- {
- key: 'set',
- value: function (t) {
- e.enabled &&
- is$1.event(t) &&
- !t.target.disabled &&
- (t.preventDefault(),
- (t.target.value = this.get(t)),
- trigger(t.target, t.type === 'touchend' ? 'change' : 'input'));
- }
- }
- ],
- [
- {
- key: 'setup',
- value: function (t) {
- var r =
- 1 < arguments.length && arguments[1] !== void 0
- ? arguments[1]
- : {},
- i = null;
- if (
- (is$1.empty(t) || is$1.string(t)
- ? (i = Array.from(
- document.querySelectorAll(
- is$1.string(t) ? t : 'input[type="range"]'
- )
- ))
- : is$1.element(t)
- ? (i = [t])
- : is$1.nodeList(t)
- ? (i = Array.from(t))
- : is$1.array(t) && (i = t.filter(is$1.element)),
- is$1.empty(i))
- )
- return null;
- var s = _objectSpread2({}, defaults$1, {}, r);
- if (is$1.string(t) && s.watch) {
- var n = new MutationObserver(function (a) {
- Array.from(a).forEach(function (o) {
- Array.from(o.addedNodes).forEach(function (l) {
- is$1.element(l) && matches$1(l, t) && new e(l, s);
- });
- });
- });
- n.observe(document.body, { childList: !0, subtree: !0 });
- }
- return i.map(function (a) {
- return new e(a, r);
- });
- }
- },
- {
- key: 'enabled',
- get: function () {
- return 'ontouchstart' in document.documentElement;
- }
- }
- ]
- ),
- e
- );
- })();
- const getConstructor = e => (e != null ? e.constructor : null),
- instanceOf = (e, t) => !!(e && t && e instanceof t),
- isNullOrUndefined = e => e == null,
- isObject = e => getConstructor(e) === Object,
- isNumber = e => getConstructor(e) === Number && !Number.isNaN(e),
- isString = e => getConstructor(e) === String,
- isBoolean = e => getConstructor(e) === Boolean,
- isFunction = e => typeof e == 'function',
- isArray = e => Array.isArray(e),
- isWeakMap = e => instanceOf(e, WeakMap),
- isNodeList = e => instanceOf(e, NodeList),
- isTextNode = e => getConstructor(e) === Text,
- isEvent = e => instanceOf(e, Event),
- isKeyboardEvent = e => instanceOf(e, KeyboardEvent),
- isCue = e =>
- instanceOf(e, window.TextTrackCue) || instanceOf(e, window.VTTCue),
- isTrack = e =>
- instanceOf(e, TextTrack) || (!isNullOrUndefined(e) && isString(e.kind)),
- isPromise = e => instanceOf(e, Promise) && isFunction(e.then),
- isElement = e =>
- e !== null &&
- typeof e == 'object' &&
- e.nodeType === 1 &&
- typeof e.style == 'object' &&
- typeof e.ownerDocument == 'object',
- isEmpty = e =>
- isNullOrUndefined(e) ||
- ((isString(e) || isArray(e) || isNodeList(e)) && !e.length) ||
- (isObject(e) && !Object.keys(e).length),
- isUrl = e => {
- if (instanceOf(e, window.URL)) return !0;
- if (!isString(e)) return !1;
- let t = e;
- (e.startsWith('http://') && e.startsWith('https://')) ||
- (t = `http://${e}`);
- try {
- return !isEmpty(new URL(t).hostname);
- } catch {
- return !1;
- }
- };
- var is = {
- nullOrUndefined: isNullOrUndefined,
- object: isObject,
- number: isNumber,
- string: isString,
- boolean: isBoolean,
- function: isFunction,
- array: isArray,
- weakMap: isWeakMap,
- nodeList: isNodeList,
- element: isElement,
- textNode: isTextNode,
- event: isEvent,
- keyboardEvent: isKeyboardEvent,
- cue: isCue,
- track: isTrack,
- promise: isPromise,
- url: isUrl,
- empty: isEmpty
- };
- const transitionEndEvent = (() => {
- const e = document.createElement('span'),
- t = {
- WebkitTransition: 'webkitTransitionEnd',
- MozTransition: 'transitionend',
- OTransition: 'oTransitionEnd otransitionend',
- transition: 'transitionend'
- },
- r = Object.keys(t).find(i => e.style[i] !== void 0);
- return !!is.string(r) && t[r];
- })();
- function repaint(e, t) {
- setTimeout(() => {
- try {
- (e.hidden = !0), e.offsetHeight, (e.hidden = !1);
- } catch {}
- }, t);
- }
- const isIE = !!window.document.documentMode,
- isEdge = /Edge/g.test(navigator.userAgent),
- isWebKit =
- 'WebkitAppearance' in document.documentElement.style &&
- !/Edge/g.test(navigator.userAgent),
- isIPhone =
- /iPhone|iPod/gi.test(navigator.userAgent) && navigator.maxTouchPoints > 1,
- isIPadOS = navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1,
- isIos =
- /iPad|iPhone|iPod/gi.test(navigator.userAgent) &&
- navigator.maxTouchPoints > 1;
- var browser = { isIE, isEdge, isWebKit, isIPhone, isIPadOS, isIos };
- function cloneDeep(e) {
- return JSON.parse(JSON.stringify(e));
- }
- function getDeep(e, t) {
- return t.split('.').reduce((r, i) => r && r[i], e);
- }
- function extend(e = {}, ...t) {
- if (!t.length) return e;
- const r = t.shift();
- return is.object(r)
- ? (Object.keys(r).forEach(i => {
- is.object(r[i])
- ? (Object.keys(e).includes(i) || Object.assign(e, { [i]: {} }),
- extend(e[i], r[i]))
- : Object.assign(e, { [i]: r[i] });
- }),
- extend(e, ...t))
- : e;
- }
- function wrap(e, t) {
- const r = e.length ? e : [e];
- Array.from(r)
- .reverse()
- .forEach((i, s) => {
- const n = s > 0 ? t.cloneNode(!0) : t,
- a = i.parentNode,
- o = i.nextSibling;
- n.appendChild(i), o ? a.insertBefore(n, o) : a.appendChild(n);
- });
- }
- function setAttributes(e, t) {
- is.element(e) &&
- !is.empty(t) &&
- Object.entries(t)
- .filter(([, r]) => !is.nullOrUndefined(r))
- .forEach(([r, i]) => e.setAttribute(r, i));
- }
- function createElement(e, t, r) {
- const i = document.createElement(e);
- return (
- is.object(t) && setAttributes(i, t), is.string(r) && (i.innerText = r), i
- );
- }
- function insertAfter(e, t) {
- is.element(e) && is.element(t) && t.parentNode.insertBefore(e, t.nextSibling);
- }
- function insertElement(e, t, r, i) {
- is.element(t) && t.appendChild(createElement(e, r, i));
- }
- function removeElement(e) {
- is.nodeList(e) || is.array(e)
- ? Array.from(e).forEach(removeElement)
- : is.element(e) && is.element(e.parentNode) && e.parentNode.removeChild(e);
- }
- function emptyElement(e) {
- if (!is.element(e)) return;
- let { length: t } = e.childNodes;
- for (; t > 0; ) e.removeChild(e.lastChild), (t -= 1);
- }
- function replaceElement(e, t) {
- return is.element(t) && is.element(t.parentNode) && is.element(e)
- ? (t.parentNode.replaceChild(e, t), e)
- : null;
- }
- function getAttributesFromSelector(e, t) {
- if (!is.string(e) || is.empty(e)) return {};
- const r = {},
- i = extend({}, t);
- return (
- e.split(',').forEach(s => {
- const n = s.trim(),
- a = n.replace('.', ''),
- o = n.replace(/[[\]]/g, '').split('='),
- [l] = o,
- c = o.length > 1 ? o[1].replace(/["']/g, '') : '';
- switch (n.charAt(0)) {
- case '.':
- is.string(i.class) ? (r.class = `${i.class} ${a}`) : (r.class = a);
- break;
- case '#':
- r.id = n.replace('#', '');
- break;
- case '[':
- r[l] = c;
- }
- }),
- extend(i, r)
- );
- }
- function toggleHidden(e, t) {
- if (!is.element(e)) return;
- let r = t;
- is.boolean(r) || (r = !e.hidden), (e.hidden = r);
- }
- function toggleClass(e, t, r) {
- if (is.nodeList(e)) return Array.from(e).map(i => toggleClass(i, t, r));
- if (is.element(e)) {
- let i = 'toggle';
- return (
- r !== void 0 && (i = r ? 'add' : 'remove'),
- e.classList[i](t),
- e.classList.contains(t)
- );
- }
- return !1;
- }
- function hasClass(e, t) {
- return is.element(e) && e.classList.contains(t);
- }
- function matches(e, t) {
- const { prototype: r } = Element;
- return (
- r.matches ||
- r.webkitMatchesSelector ||
- r.mozMatchesSelector ||
- r.msMatchesSelector ||
- function () {
- return Array.from(document.querySelectorAll(t)).includes(this);
- }
- ).call(e, t);
- }
- function closest$1(e, t) {
- const { prototype: r } = Element;
- return (
- r.closest ||
- function () {
- let i = this;
- do {
- if (matches.matches(i, t)) return i;
- i = i.parentElement || i.parentNode;
- } while (i !== null && i.nodeType === 1);
- return null;
- }
- ).call(e, t);
- }
- function getElements(e) {
- return this.elements.container.querySelectorAll(e);
- }
- function getElement(e) {
- return this.elements.container.querySelector(e);
- }
- function setFocus(e = null, t = !1) {
- is.element(e) && e.focus({ preventScroll: !0, focusVisible: t });
- }
- const defaultCodecs = {
- 'audio/ogg': 'vorbis',
- 'audio/wav': '1',
- 'video/webm': 'vp8, vorbis',
- 'video/mp4': 'avc1.42E01E, mp4a.40.2',
- 'video/ogg': 'theora'
- },
- support = {
- audio: 'canPlayType' in document.createElement('audio'),
- video: 'canPlayType' in document.createElement('video'),
- check(e, t) {
- const r = support[e] || t !== 'html5';
- return { api: r, ui: r && support.rangeInput };
- },
- pip: !(
- browser.isIPhone ||
- (!is.function(createElement('video').webkitSetPresentationMode) &&
- (!document.pictureInPictureEnabled ||
- createElement('video').disablePictureInPicture))
- ),
- airplay: is.function(window.WebKitPlaybackTargetAvailabilityEvent),
- playsinline: 'playsInline' in document.createElement('video'),
- mime(e) {
- if (is.empty(e)) return !1;
- const [t] = e.split('/');
- let r = e;
- if (!this.isHTML5 || t !== this.type) return !1;
- Object.keys(defaultCodecs).includes(r) &&
- (r += `; codecs="${defaultCodecs[e]}"`);
- try {
- return !!(r && this.media.canPlayType(r).replace(/no/, ''));
- } catch {
- return !1;
- }
- },
- textTracks: 'textTracks' in document.createElement('video'),
- rangeInput: (() => {
- const e = document.createElement('input');
- return (e.type = 'range'), e.type === 'range';
- })(),
- touch: 'ontouchstart' in document.documentElement,
- transitions: transitionEndEvent !== !1,
- reducedMotion:
- 'matchMedia' in window &&
- window.matchMedia('(prefers-reduced-motion)').matches
- },
- supportsPassiveListeners = (() => {
- let e = !1;
- try {
- const t = Object.defineProperty({}, 'passive', {
- get: () => ((e = !0), null)
- });
- window.addEventListener('test', null, t),
- window.removeEventListener('test', null, t);
- } catch {}
- return e;
- })();
- function toggleListener(e, t, r, i = !1, s = !0, n = !1) {
- if (!e || !('addEventListener' in e) || is.empty(t) || !is.function(r))
- return;
- const a = t.split(' ');
- let o = n;
- supportsPassiveListeners && (o = { passive: s, capture: n }),
- a.forEach(l => {
- this &&
- this.eventListeners &&
- i &&
- this.eventListeners.push({
- element: e,
- type: l,
- callback: r,
- options: o
- }),
- e[i ? 'addEventListener' : 'removeEventListener'](l, r, o);
- });
- }
- function on(e, t = '', r, i = !0, s = !1) {
- toggleListener.call(this, e, t, r, !0, i, s);
- }
- function off(e, t = '', r, i = !0, s = !1) {
- toggleListener.call(this, e, t, r, !1, i, s);
- }
- function once(e, t = '', r, i = !0, s = !1) {
- const n = (...a) => {
- off(e, t, n, i, s), r.apply(this, a);
- };
- toggleListener.call(this, e, t, n, !0, i, s);
- }
- function triggerEvent(e, t = '', r = !1, i = {}) {
- if (!is.element(e) || is.empty(t)) return;
- const s = new CustomEvent(t, { bubbles: r, detail: { ...i, plyr: this } });
- e.dispatchEvent(s);
- }
- function unbindListeners() {
- this &&
- this.eventListeners &&
- (this.eventListeners.forEach(e => {
- const { element: t, type: r, callback: i, options: s } = e;
- t.removeEventListener(r, i, s);
- }),
- (this.eventListeners = []));
- }
- function ready() {
- return new Promise(e =>
- this.ready
- ? setTimeout(e, 0)
- : on.call(this, this.elements.container, 'ready', e)
- ).then(() => {});
- }
- function silencePromise(e) {
- is.promise(e) && e.then(null, () => {});
- }
- function dedupe(e) {
- return is.array(e) ? e.filter((t, r) => e.indexOf(t) === r) : e;
- }
- function closest(e, t) {
- return is.array(e) && e.length
- ? e.reduce((r, i) => (Math.abs(i - t) < Math.abs(r - t) ? i : r))
- : null;
- }
- function supportsCSS(e) {
- return !(!window || !window.CSS) && window.CSS.supports(e);
- }
- const standardRatios = [
- [1, 1],
- [4, 3],
- [3, 4],
- [5, 4],
- [4, 5],
- [3, 2],
- [2, 3],
- [16, 10],
- [10, 16],
- [16, 9],
- [9, 16],
- [21, 9],
- [9, 21],
- [32, 9],
- [9, 32]
- ].reduce((e, [t, r]) => ({ ...e, [t / r]: [t, r] }), {});
- function validateAspectRatio(e) {
- return is.array(e) || (is.string(e) && e.includes(':'))
- ? (is.array(e) ? e : e.split(':')).map(Number).every(is.number)
- : !1;
- }
- function reduceAspectRatio(e) {
- if (!is.array(e) || !e.every(is.number)) return null;
- const [t, r] = e,
- i = (n, a) => (a === 0 ? n : i(a, n % a)),
- s = i(t, r);
- return [t / s, r / s];
- }
- function getAspectRatio(e) {
- const t = i => (validateAspectRatio(i) ? i.split(':').map(Number) : null);
- let r = t(e);
- if (
- (r === null && (r = t(this.config.ratio)),
- r === null &&
- !is.empty(this.embed) &&
- is.array(this.embed.ratio) &&
- ({ ratio: r } = this.embed),
- r === null && this.isHTML5)
- ) {
- const { videoWidth: i, videoHeight: s } = this.media;
- r = [i, s];
- }
- return reduceAspectRatio(r);
- }
- function setAspectRatio(e) {
- if (!this.isVideo) return {};
- const { wrapper: t } = this.elements,
- r = getAspectRatio.call(this, e);
- if (!is.array(r)) return {};
- const [i, s] = reduceAspectRatio(r),
- n = (100 / i) * s;
- if (
- (supportsCSS(`aspect-ratio: ${i}/${s}`)
- ? (t.style.aspectRatio = `${i}/${s}`)
- : (t.style.paddingBottom = `${n}%`),
- this.isVimeo && !this.config.vimeo.premium && this.supported.ui)
- ) {
- const a =
- (100 / this.media.offsetWidth) *
- parseInt(window.getComputedStyle(this.media).paddingBottom, 10),
- o = (a - n) / (a / 50);
- this.fullscreen.active
- ? (t.style.paddingBottom = null)
- : (this.media.style.transform = `translateY(-${o}%)`);
- } else
- this.isHTML5 && t.classList.add(this.config.classNames.videoFixedRatio);
- return { padding: n, ratio: r };
- }
- function roundAspectRatio(e, t, r = 0.05) {
- const i = e / t,
- s = closest(Object.keys(standardRatios), i);
- return Math.abs(s - i) <= r ? standardRatios[s] : [e, t];
- }
- function getViewportSize() {
- return [
- Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0),
- Math.max(
- document.documentElement.clientHeight || 0,
- window.innerHeight || 0
- )
- ];
- }
- const html5 = {
- getSources() {
- return this.isHTML5
- ? Array.from(this.media.querySelectorAll('source')).filter(e => {
- const t = e.getAttribute('type');
- return !!is.empty(t) || support.mime.call(this, t);
- })
- : [];
- },
- getQualityOptions() {
- return this.config.quality.forced
- ? this.config.quality.options
- : html5.getSources
- .call(this)
- .map(e => Number(e.getAttribute('size')))
- .filter(Boolean);
- },
- setup() {
- if (!this.isHTML5) return;
- const e = this;
- (e.options.speed = e.config.speed.options),
- is.empty(this.config.ratio) || setAspectRatio.call(e),
- Object.defineProperty(e.media, 'quality', {
- get() {
- const t = html5.getSources
- .call(e)
- .find(r => r.getAttribute('src') === e.source);
- return t && Number(t.getAttribute('size'));
- },
- set(t) {
- if (e.quality !== t) {
- if (
- e.config.quality.forced &&
- is.function(e.config.quality.onChange)
- )
- e.config.quality.onChange(t);
- else {
- const r = html5.getSources
- .call(e)
- .find(l => Number(l.getAttribute('size')) === t);
- if (!r) return;
- const {
- currentTime: i,
- paused: s,
- preload: n,
- readyState: a,
- playbackRate: o
- } = e.media;
- (e.media.src = r.getAttribute('src')),
- (n !== 'none' || a) &&
- (e.once('loadedmetadata', () => {
- (e.speed = o),
- (e.currentTime = i),
- s || silencePromise(e.play());
- }),
- e.media.load());
- }
- triggerEvent.call(e, e.media, 'qualitychange', !1, { quality: t });
- }
- }
- });
- },
- cancelRequests() {
- this.isHTML5 &&
- (removeElement(html5.getSources.call(this)),
- this.media.setAttribute('src', this.config.blankVideo),
- this.media.load(),
- this.debug.log('Cancelled network requests'));
- }
- };
- function generateId(e) {
- return `${e}-${Math.floor(1e4 * Math.random())}`;
- }
- function format(e, ...t) {
- return is.empty(e)
- ? e
- : e.toString().replace(/{(\d+)}/g, (r, i) => t[i].toString());
- }
- function getPercentage(e, t) {
- return e === 0 || t === 0 || Number.isNaN(e) || Number.isNaN(t)
- ? 0
- : ((e / t) * 100).toFixed(2);
- }
- const replaceAll = (e = '', t = '', r = '') =>
- e.replace(
- new RegExp(
- t.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g, '\\$1'),
- 'g'
- ),
- r.toString()
- ),
- toTitleCase = (e = '') =>
- e
- .toString()
- .replace(
- /\w\S*/g,
- t => t.charAt(0).toUpperCase() + t.slice(1).toLowerCase()
- );
- function toPascalCase(e = '') {
- let t = e.toString();
- return (
- (t = replaceAll(t, '-', ' ')),
- (t = replaceAll(t, '_', ' ')),
- (t = toTitleCase(t)),
- replaceAll(t, ' ', '')
- );
- }
- function toCamelCase(e = '') {
- let t = e.toString();
- return (t = toPascalCase(t)), t.charAt(0).toLowerCase() + t.slice(1);
- }
- function stripHTML(e) {
- const t = document.createDocumentFragment(),
- r = document.createElement('div');
- return t.appendChild(r), (r.innerHTML = e), t.firstChild.innerText;
- }
- function getHTML(e) {
- const t = document.createElement('div');
- return t.appendChild(e), t.innerHTML;
- }
- const resources = {
- pip: 'PIP',
- airplay: 'AirPlay',
- html5: 'HTML5',
- vimeo: 'Vimeo',
- youtube: 'YouTube'
- },
- i18n = {
- get(e = '', t = {}) {
- if (is.empty(e) || is.empty(t)) return '';
- let r = getDeep(t.i18n, e);
- if (is.empty(r))
- return Object.keys(resources).includes(e) ? resources[e] : '';
- const i = { '{seektime}': t.seekTime, '{title}': t.title };
- return (
- Object.entries(i).forEach(([s, n]) => {
- r = replaceAll(r, s, n);
- }),
- r
- );
- }
- };
- class Storage {
- constructor(t) {
- _defineProperty$1(this, 'get', r => {
- if (!Storage.supported || !this.enabled) return null;
- const i = window.localStorage.getItem(this.key);
- if (is.empty(i)) return null;
- const s = JSON.parse(i);
- return is.string(r) && r.length ? s[r] : s;
- }),
- _defineProperty$1(this, 'set', r => {
- if (!Storage.supported || !this.enabled || !is.object(r)) return;
- let i = this.get();
- is.empty(i) && (i = {}), extend(i, r);
- try {
- window.localStorage.setItem(this.key, JSON.stringify(i));
- } catch {}
- }),
- (this.enabled = t.config.storage.enabled),
- (this.key = t.config.storage.key);
- }
- static get supported() {
- try {
- if (!('localStorage' in window)) return !1;
- const t = '___test';
- return (
- window.localStorage.setItem(t, t), window.localStorage.removeItem(t), !0
- );
- } catch {
- return !1;
- }
- }
- }
- function fetch$1(e, t = 'text') {
- return new Promise((r, i) => {
- try {
- const s = new XMLHttpRequest();
- if (!('withCredentials' in s)) return;
- s.addEventListener('load', () => {
- if (t === 'text')
- try {
- r(JSON.parse(s.responseText));
- } catch {
- r(s.responseText);
- }
- else r(s.response);
- }),
- s.addEventListener('error', () => {
- throw new Error(s.status);
- }),
- s.open('GET', e, !0),
- (s.responseType = t),
- s.send();
- } catch (s) {
- i(s);
- }
- });
- }
- function loadSprite(e, t) {
- if (!is.string(e)) return;
- const r = 'cache',
- i = is.string(t);
- let s = !1;
- const n = () => document.getElementById(t) !== null,
- a = (o, l) => {
- (o.innerHTML = l),
- (i && n()) || document.body.insertAdjacentElement('afterbegin', o);
- };
- if (!i || !n()) {
- const o = Storage.supported,
- l = document.createElement('div');
- if ((l.setAttribute('hidden', ''), i && l.setAttribute('id', t), o)) {
- const c = window.localStorage.getItem(`${r}-${t}`);
- if (((s = c !== null), s)) {
- const g = JSON.parse(c);
- a(l, g.content);
- }
- }
- fetch$1(e)
- .then(c => {
- if (!is.empty(c)) {
- if (o)
- try {
- window.localStorage.setItem(
- `${r}-${t}`,
- JSON.stringify({ content: c })
- );
- } catch {}
- a(l, c);
- }
- })
- .catch(() => {});
- }
- }
- const getHours = e => Math.trunc((e / 60 / 60) % 60, 10),
- getMinutes = e => Math.trunc((e / 60) % 60, 10),
- getSeconds = e => Math.trunc(e % 60, 10);
- function formatTime(e = 0, t = !1, r = !1) {
- if (!is.number(e)) return formatTime(void 0, t, r);
- const i = o => `0${o}`.slice(-2);
- let s = getHours(e);
- const n = getMinutes(e),
- a = getSeconds(e);
- return (
- (s = t || s > 0 ? `${s}:` : ''),
- `${r && e > 0 ? '-' : ''}${s}${i(n)}:${i(a)}`
- );
- }
- const controls$2 = {
- getIconUrl() {
- const e = new URL(this.config.iconUrl, window.location),
- t = window.location.host
- ? window.location.host
- : window.top.location.host,
- r = e.host !== t || (browser.isIE && !window.svg4everybody);
- return { url: this.config.iconUrl, cors: r };
- },
- findElements() {
- try {
- return (
- (this.elements.controls = getElement.call(
- this,
- this.config.selectors.controls.wrapper
- )),
- (this.elements.buttons = {
- play: getElements.call(this, this.config.selectors.buttons.play),
- pause: getElement.call(this, this.config.selectors.buttons.pause),
- restart: getElement.call(this, this.config.selectors.buttons.restart),
- rewind: getElement.call(this, this.config.selectors.buttons.rewind),
- fastForward: getElement.call(
- this,
- this.config.selectors.buttons.fastForward
- ),
- mute: getElement.call(this, this.config.selectors.buttons.mute),
- pip: getElement.call(this, this.config.selectors.buttons.pip),
- airplay: getElement.call(this, this.config.selectors.buttons.airplay),
- settings: getElement.call(
- this,
- this.config.selectors.buttons.settings
- ),
- captions: getElement.call(
- this,
- this.config.selectors.buttons.captions
- ),
- fullscreen: getElement.call(
- this,
- this.config.selectors.buttons.fullscreen
- )
- }),
- (this.elements.progress = getElement.call(
- this,
- this.config.selectors.progress
- )),
- (this.elements.inputs = {
- seek: getElement.call(this, this.config.selectors.inputs.seek),
- volume: getElement.call(this, this.config.selectors.inputs.volume)
- }),
- (this.elements.display = {
- buffer: getElement.call(this, this.config.selectors.display.buffer),
- currentTime: getElement.call(
- this,
- this.config.selectors.display.currentTime
- ),
- duration: getElement.call(
- this,
- this.config.selectors.display.duration
- )
- }),
- is.element(this.elements.progress) &&
- (this.elements.display.seekTooltip =
- this.elements.progress.querySelector(
- `.${this.config.classNames.tooltip}`
- )),
- !0
- );
- } catch (e) {
- return (
- this.debug.warn(
- 'It looks like there is a problem with your custom controls HTML',
- e
- ),
- this.toggleNativeControls(!0),
- !1
- );
- }
- },
- createIcon(e, t) {
- const r = 'http://www.w3.org/2000/svg',
- i = controls$2.getIconUrl.call(this),
- s = `${i.cors ? '' : i.url}#${this.config.iconPrefix}`,
- n = document.createElementNS(r, 'svg');
- setAttributes(n, extend(t, { 'aria-hidden': 'true', focusable: 'false' }));
- const a = document.createElementNS(r, 'use'),
- o = `${s}-${e}`;
- return (
- 'href' in a &&
- a.setAttributeNS('http://www.w3.org/1999/xlink', 'href', o),
- a.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', o),
- n.appendChild(a),
- n
- );
- },
- createLabel(e, t = {}) {
- const r = i18n.get(e, this.config);
- return createElement(
- 'span',
- {
- ...t,
- class: [t.class, this.config.classNames.hidden]
- .filter(Boolean)
- .join(' ')
- },
- r
- );
- },
- createBadge(e) {
- if (is.empty(e)) return null;
- const t = createElement('span', {
- class: this.config.classNames.menu.value
- });
- return (
- t.appendChild(
- createElement('span', { class: this.config.classNames.menu.badge }, e)
- ),
- t
- );
- },
- createButton(e, t) {
- const r = extend({}, t);
- let i = toCamelCase(e);
- const s = {
- element: 'button',
- toggle: !1,
- label: null,
- icon: null,
- labelPressed: null,
- iconPressed: null
- };
- switch (
- (['element', 'icon', 'label'].forEach(a => {
- Object.keys(r).includes(a) && ((s[a] = r[a]), delete r[a]);
- }),
- s.element !== 'button' ||
- Object.keys(r).includes('type') ||
- (r.type = 'button'),
- Object.keys(r).includes('class')
- ? r.class.split(' ').some(a => a === this.config.classNames.control) ||
- extend(r, { class: `${r.class} ${this.config.classNames.control}` })
- : (r.class = this.config.classNames.control),
- e)
- ) {
- case 'play':
- (s.toggle = !0),
- (s.label = 'play'),
- (s.labelPressed = 'pause'),
- (s.icon = 'play'),
- (s.iconPressed = 'pause');
- break;
- case 'mute':
- (s.toggle = !0),
- (s.label = 'mute'),
- (s.labelPressed = 'unmute'),
- (s.icon = 'volume'),
- (s.iconPressed = 'muted');
- break;
- case 'captions':
- (s.toggle = !0),
- (s.label = 'enableCaptions'),
- (s.labelPressed = 'disableCaptions'),
- (s.icon = 'captions-off'),
- (s.iconPressed = 'captions-on');
- break;
- case 'fullscreen':
- (s.toggle = !0),
- (s.label = 'enterFullscreen'),
- (s.labelPressed = 'exitFullscreen'),
- (s.icon = 'enter-fullscreen'),
- (s.iconPressed = 'exit-fullscreen');
- break;
- case 'play-large':
- (r.class += ` ${this.config.classNames.control}--overlaid`),
- (i = 'play'),
- (s.label = 'play'),
- (s.icon = 'play');
- break;
- default:
- is.empty(s.label) && (s.label = i), is.empty(s.icon) && (s.icon = e);
- }
- const n = createElement(s.element);
- return (
- s.toggle
- ? (n.appendChild(
- controls$2.createIcon.call(this, s.iconPressed, {
- class: 'icon--pressed'
- })
- ),
- n.appendChild(
- controls$2.createIcon.call(this, s.icon, {
- class: 'icon--not-pressed'
- })
- ),
- n.appendChild(
- controls$2.createLabel.call(this, s.labelPressed, {
- class: 'label--pressed'
- })
- ),
- n.appendChild(
- controls$2.createLabel.call(this, s.label, {
- class: 'label--not-pressed'
- })
- ))
- : (n.appendChild(controls$2.createIcon.call(this, s.icon)),
- n.appendChild(controls$2.createLabel.call(this, s.label))),
- extend(r, getAttributesFromSelector(this.config.selectors.buttons[i], r)),
- setAttributes(n, r),
- i === 'play'
- ? (is.array(this.elements.buttons[i]) ||
- (this.elements.buttons[i] = []),
- this.elements.buttons[i].push(n))
- : (this.elements.buttons[i] = n),
- n
- );
- },
- createRange(e, t) {
- const r = createElement(
- 'input',
- extend(
- getAttributesFromSelector(this.config.selectors.inputs[e]),
- {
- type: 'range',
- min: 0,
- max: 100,
- step: 0.01,
- value: 0,
- autocomplete: 'off',
- role: 'slider',
- 'aria-label': i18n.get(e, this.config),
- 'aria-valuemin': 0,
- 'aria-valuemax': 100,
- 'aria-valuenow': 0
- },
- t
- )
- );
- return (
- (this.elements.inputs[e] = r),
- controls$2.updateRangeFill.call(this, r),
- RangeTouch.setup(r),
- r
- );
- },
- createProgress(e, t) {
- const r = createElement(
- 'progress',
- extend(
- getAttributesFromSelector(this.config.selectors.display[e]),
- { min: 0, max: 100, value: 0, role: 'progressbar', 'aria-hidden': !0 },
- t
- )
- );
- if (e !== 'volume') {
- r.appendChild(createElement('span', null, '0'));
- const i = { played: 'played', buffer: 'buffered' }[e],
- s = i ? i18n.get(i, this.config) : '';
- r.innerText = `% ${s.toLowerCase()}`;
- }
- return (this.elements.display[e] = r), r;
- },
- createTime(e, t) {
- const r = getAttributesFromSelector(this.config.selectors.display[e], t),
- i = createElement(
- 'div',
- extend(r, {
- class: `${r.class ? r.class : ''} ${
- this.config.classNames.display.time
- } `.trim(),
- 'aria-label': i18n.get(e, this.config),
- role: 'timer'
- }),
- '00:00'
- );
- return (this.elements.display[e] = i), i;
- },
- bindMenuItemShortcuts(e, t) {
- on.call(
- this,
- e,
- 'keydown keyup',
- r => {
- if (
- ![' ', 'ArrowUp', 'ArrowDown', 'ArrowRight'].includes(r.key) ||
- (r.preventDefault(), r.stopPropagation(), r.type === 'keydown')
- )
- return;
- const i = matches(e, '[role="menuitemradio"]');
- if (!i && [' ', 'ArrowRight'].includes(r.key))
- controls$2.showMenuPanel.call(this, t, !0);
- else {
- let s;
- r.key !== ' ' &&
- (r.key === 'ArrowDown' || (i && r.key === 'ArrowRight')
- ? ((s = e.nextElementSibling),
- is.element(s) || (s = e.parentNode.firstElementChild))
- : ((s = e.previousElementSibling),
- is.element(s) || (s = e.parentNode.lastElementChild)),
- setFocus.call(this, s, !0));
- }
- },
- !1
- ),
- on.call(this, e, 'keyup', r => {
- r.key === 'Return' &&
- controls$2.focusFirstMenuItem.call(this, null, !0);
- });
- },
- createMenuItem({
- value: e,
- list: t,
- type: r,
- title: i,
- badge: s = null,
- checked: n = !1
- }) {
- const a = getAttributesFromSelector(this.config.selectors.inputs[r]),
- o = createElement(
- 'button',
- extend(a, {
- type: 'button',
- role: 'menuitemradio',
- class: `${this.config.classNames.control} ${
- a.class ? a.class : ''
- }`.trim(),
- 'aria-checked': n,
- value: e
- })
- ),
- l = createElement('span');
- (l.innerHTML = i),
- is.element(s) && l.appendChild(s),
- o.appendChild(l),
- Object.defineProperty(o, 'checked', {
- enumerable: !0,
- get: () => o.getAttribute('aria-checked') === 'true',
- set(c) {
- c &&
- Array.from(o.parentNode.children)
- .filter(g => matches(g, '[role="menuitemradio"]'))
- .forEach(g => g.setAttribute('aria-checked', 'false')),
- o.setAttribute('aria-checked', c ? 'true' : 'false');
- }
- }),
- this.listeners.bind(
- o,
- 'click keyup',
- c => {
- if (!is.keyboardEvent(c) || c.key === ' ') {
- switch (
- (c.preventDefault(), c.stopPropagation(), (o.checked = !0), r)
- ) {
- case 'language':
- this.currentTrack = Number(e);
- break;
- case 'quality':
- this.quality = e;
- break;
- case 'speed':
- this.speed = parseFloat(e);
- }
- controls$2.showMenuPanel.call(this, 'home', is.keyboardEvent(c));
- }
- },
- r,
- !1
- ),
- controls$2.bindMenuItemShortcuts.call(this, o, r),
- t.appendChild(o);
- },
- formatTime(e = 0, t = !1) {
- return is.number(e) ? formatTime(e, getHours(this.duration) > 0, t) : e;
- },
- updateTimeDisplay(e = null, t = 0, r = !1) {
- is.element(e) &&
- is.number(t) &&
- (e.innerText = controls$2.formatTime(t, r));
- },
- updateVolume() {
- this.supported.ui &&
- (is.element(this.elements.inputs.volume) &&
- controls$2.setRange.call(
- this,
- this.elements.inputs.volume,
- this.muted ? 0 : this.volume
- ),
- is.element(this.elements.buttons.mute) &&
- (this.elements.buttons.mute.pressed = this.muted || this.volume === 0));
- },
- setRange(e, t = 0) {
- is.element(e) && ((e.value = t), controls$2.updateRangeFill.call(this, e));
- },
- updateProgress(e) {
- if (!this.supported.ui || !is.event(e)) return;
- let t = 0;
- const r = (i, s) => {
- const n = is.number(s) ? s : 0,
- a = is.element(i) ? i : this.elements.display.buffer;
- if (is.element(a)) {
- a.value = n;
- const o = a.getElementsByTagName('span')[0];
- is.element(o) && (o.childNodes[0].nodeValue = n);
- }
- };
- if (e)
- switch (e.type) {
- case 'timeupdate':
- case 'seeking':
- case 'seeked':
- (t = getPercentage(this.currentTime, this.duration)),
- e.type === 'timeupdate' &&
- controls$2.setRange.call(this, this.elements.inputs.seek, t);
- break;
- case 'playing':
- case 'progress':
- r(this.elements.display.buffer, 100 * this.buffered);
- }
- },
- updateRangeFill(e) {
- const t = is.event(e) ? e.target : e;
- if (is.element(t) && t.getAttribute('type') === 'range') {
- if (matches(t, this.config.selectors.inputs.seek)) {
- t.setAttribute('aria-valuenow', this.currentTime);
- const r = controls$2.formatTime(this.currentTime),
- i = controls$2.formatTime(this.duration),
- s = i18n.get('seekLabel', this.config);
- t.setAttribute(
- 'aria-valuetext',
- s.replace('{currentTime}', r).replace('{duration}', i)
- );
- } else if (matches(t, this.config.selectors.inputs.volume)) {
- const r = 100 * t.value;
- t.setAttribute('aria-valuenow', r),
- t.setAttribute('aria-valuetext', `${r.toFixed(1)}%`);
- } else t.setAttribute('aria-valuenow', t.value);
- (browser.isWebKit || browser.isIPadOS) &&
- t.style.setProperty('--value', (t.value / t.max) * 100 + '%');
- }
- },
- updateSeekTooltip(e) {
- var t, r;
- if (
- !this.config.tooltips.seek ||
- !is.element(this.elements.inputs.seek) ||
- !is.element(this.elements.display.seekTooltip) ||
- this.duration === 0
- )
- return;
- const i = this.elements.display.seekTooltip,
- s = `${this.config.classNames.tooltip}--visible`,
- n = g => toggleClass(i, s, g);
- if (this.touch) return void n(!1);
- let a = 0;
- const o = this.elements.progress.getBoundingClientRect();
- if (is.event(e)) a = (100 / o.width) * (e.pageX - o.left);
- else {
- if (!hasClass(i, s)) return;
- a = parseFloat(i.style.left, 10);
- }
- a < 0 ? (a = 0) : a > 100 && (a = 100);
- const l = (this.duration / 100) * a;
- i.innerText = controls$2.formatTime(l);
- const c =
- (t = this.config.markers) === null ||
- t === void 0 ||
- (r = t.points) === null ||
- r === void 0
- ? void 0
- : r.find(({ time: g }) => g === Math.round(l));
- c && i.insertAdjacentHTML('afterbegin', `${c.label}<br>`),
- (i.style.left = `${a}%`),
- is.event(e) &&
- ['mouseenter', 'mouseleave'].includes(e.type) &&
- n(e.type === 'mouseenter');
- },
- timeUpdate(e) {
- const t =
- !is.element(this.elements.display.duration) && this.config.invertTime;
- controls$2.updateTimeDisplay.call(
- this,
- this.elements.display.currentTime,
- t ? this.duration - this.currentTime : this.currentTime,
- t
- ),
- (e && e.type === 'timeupdate' && this.media.seeking) ||
- controls$2.updateProgress.call(this, e);
- },
- durationUpdate() {
- if (!this.supported.ui || (!this.config.invertTime && this.currentTime))
- return;
- if (this.duration >= 2 ** 32)
- return (
- toggleHidden(this.elements.display.currentTime, !0),
- void toggleHidden(this.elements.progress, !0)
- );
- is.element(this.elements.inputs.seek) &&
- this.elements.inputs.seek.setAttribute('aria-valuemax', this.duration);
- const e = is.element(this.elements.display.duration);
- !e &&
- this.config.displayDuration &&
- this.paused &&
- controls$2.updateTimeDisplay.call(
- this,
- this.elements.display.currentTime,
- this.duration
- ),
- e &&
- controls$2.updateTimeDisplay.call(
- this,
- this.elements.display.duration,
- this.duration
- ),
- this.config.markers.enabled && controls$2.setMarkers.call(this),
- controls$2.updateSeekTooltip.call(this);
- },
- toggleMenuButton(e, t) {
- toggleHidden(this.elements.settings.buttons[e], !t);
- },
- updateSetting(e, t, r) {
- const i = this.elements.settings.panels[e];
- let s = null,
- n = t;
- if (e === 'captions') s = this.currentTrack;
- else {
- if (
- ((s = is.empty(r) ? this[e] : r),
- is.empty(s) && (s = this.config[e].default),
- !is.empty(this.options[e]) && !this.options[e].includes(s))
- )
- return void this.debug.warn(`Unsupported value of '${s}' for ${e}`);
- if (!this.config[e].options.includes(s))
- return void this.debug.warn(`Disabled value of '${s}' for ${e}`);
- }
- if (
- (is.element(n) || (n = i && i.querySelector('[role="menu"]')),
- !is.element(n))
- )
- return;
- this.elements.settings.buttons[e].querySelector(
- `.${this.config.classNames.menu.value}`
- ).innerHTML = controls$2.getLabel.call(this, e, s);
- const a = n && n.querySelector(`[value="${s}"]`);
- is.element(a) && (a.checked = !0);
- },
- getLabel(e, t) {
- switch (e) {
- case 'speed':
- return t === 1 ? i18n.get('normal', this.config) : `${t}×`;
- case 'quality':
- if (is.number(t)) {
- const r = i18n.get(`qualityLabel.${t}`, this.config);
- return r.length ? r : `${t}p`;
- }
- return toTitleCase(t);
- case 'captions':
- return captions.getLabel.call(this);
- default:
- return null;
- }
- },
- setQualityMenu(e) {
- if (!is.element(this.elements.settings.panels.quality)) return;
- const t = 'quality',
- r = this.elements.settings.panels.quality.querySelector('[role="menu"]');
- is.array(e) &&
- (this.options.quality = dedupe(e).filter(n =>
- this.config.quality.options.includes(n)
- ));
- const i =
- !is.empty(this.options.quality) && this.options.quality.length > 1;
- if (
- (controls$2.toggleMenuButton.call(this, t, i),
- emptyElement(r),
- controls$2.checkMenu.call(this),
- !i)
- )
- return;
- const s = n => {
- const a = i18n.get(`qualityBadge.${n}`, this.config);
- return a.length ? controls$2.createBadge.call(this, a) : null;
- };
- this.options.quality
- .sort((n, a) => {
- const o = this.config.quality.options;
- return o.indexOf(n) > o.indexOf(a) ? 1 : -1;
- })
- .forEach(n => {
- controls$2.createMenuItem.call(this, {
- value: n,
- list: r,
- type: t,
- title: controls$2.getLabel.call(this, 'quality', n),
- badge: s(n)
- });
- }),
- controls$2.updateSetting.call(this, t, r);
- },
- setCaptionsMenu() {
- if (!is.element(this.elements.settings.panels.captions)) return;
- const e = 'captions',
- t = this.elements.settings.panels.captions.querySelector('[role="menu"]'),
- r = captions.getTracks.call(this),
- i = !!r.length;
- if (
- (controls$2.toggleMenuButton.call(this, e, i),
- emptyElement(t),
- controls$2.checkMenu.call(this),
- !i)
- )
- return;
- const s = r.map((n, a) => ({
- value: a,
- checked: this.captions.toggled && this.currentTrack === a,
- title: captions.getLabel.call(this, n),
- badge:
- n.language &&
- controls$2.createBadge.call(this, n.language.toUpperCase()),
- list: t,
- type: 'language'
- }));
- s.unshift({
- value: -1,
- checked: !this.captions.toggled,
- title: i18n.get('disabled', this.config),
- list: t,
- type: 'language'
- }),
- s.forEach(controls$2.createMenuItem.bind(this)),
- controls$2.updateSetting.call(this, e, t);
- },
- setSpeedMenu() {
- if (!is.element(this.elements.settings.panels.speed)) return;
- const e = 'speed',
- t = this.elements.settings.panels.speed.querySelector('[role="menu"]');
- this.options.speed = this.options.speed.filter(
- i => i >= this.minimumSpeed && i <= this.maximumSpeed
- );
- const r = !is.empty(this.options.speed) && this.options.speed.length > 1;
- controls$2.toggleMenuButton.call(this, e, r),
- emptyElement(t),
- controls$2.checkMenu.call(this),
- r &&
- (this.options.speed.forEach(i => {
- controls$2.createMenuItem.call(this, {
- value: i,
- list: t,
- type: e,
- title: controls$2.getLabel.call(this, 'speed', i)
- });
- }),
- controls$2.updateSetting.call(this, e, t));
- },
- checkMenu() {
- const { buttons: e } = this.elements.settings,
- t = !is.empty(e) && Object.values(e).some(r => !r.hidden);
- toggleHidden(this.elements.settings.menu, !t);
- },
- focusFirstMenuItem(e, t = !1) {
- if (this.elements.settings.popup.hidden) return;
- let r = e;
- is.element(r) ||
- (r = Object.values(this.elements.settings.panels).find(s => !s.hidden));
- const i = r.querySelector('[role^="menuitem"]');
- setFocus.call(this, i, t);
- },
- toggleMenu(e) {
- const { popup: t } = this.elements.settings,
- r = this.elements.buttons.settings;
- if (!is.element(t) || !is.element(r)) return;
- const { hidden: i } = t;
- let s = i;
- if (is.boolean(e)) s = e;
- else if (is.keyboardEvent(e) && e.key === 'Escape') s = !1;
- else if (is.event(e)) {
- const n = is.function(e.composedPath) ? e.composedPath()[0] : e.target,
- a = t.contains(n);
- if (a || (!a && e.target !== r && s)) return;
- }
- r.setAttribute('aria-expanded', s),
- toggleHidden(t, !s),
- toggleClass(this.elements.container, this.config.classNames.menu.open, s),
- s && is.keyboardEvent(e)
- ? controls$2.focusFirstMenuItem.call(this, null, !0)
- : s || i || setFocus.call(this, r, is.keyboardEvent(e));
- },
- getMenuSize(e) {
- const t = e.cloneNode(!0);
- (t.style.position = 'absolute'),
- (t.style.opacity = 0),
- t.removeAttribute('hidden'),
- e.parentNode.appendChild(t);
- const r = t.scrollWidth,
- i = t.scrollHeight;
- return removeElement(t), { width: r, height: i };
- },
- showMenuPanel(e = '', t = !1) {
- const r = this.elements.container.querySelector(
- `#plyr-settings-${this.id}-${e}`
- );
- if (!is.element(r)) return;
- const i = r.parentNode,
- s = Array.from(i.children).find(n => !n.hidden);
- if (support.transitions && !support.reducedMotion) {
- (i.style.width = `${s.scrollWidth}px`),
- (i.style.height = `${s.scrollHeight}px`);
- const n = controls$2.getMenuSize.call(this, r),
- a = o => {
- o.target === i &&
- ['width', 'height'].includes(o.propertyName) &&
- ((i.style.width = ''),
- (i.style.height = ''),
- off.call(this, i, transitionEndEvent, a));
- };
- on.call(this, i, transitionEndEvent, a),
- (i.style.width = `${n.width}px`),
- (i.style.height = `${n.height}px`);
- }
- toggleHidden(s, !0),
- toggleHidden(r, !1),
- controls$2.focusFirstMenuItem.call(this, r, t);
- },
- setDownloadUrl() {
- const e = this.elements.buttons.download;
- is.element(e) && e.setAttribute('href', this.download);
- },
- create(e) {
- const {
- bindMenuItemShortcuts: t,
- createButton: r,
- createProgress: i,
- createRange: s,
- createTime: n,
- setQualityMenu: a,
- setSpeedMenu: o,
- showMenuPanel: l
- } = controls$2;
- (this.elements.controls = null),
- is.array(this.config.controls) &&
- this.config.controls.includes('play-large') &&
- this.elements.container.appendChild(r.call(this, 'play-large'));
- const c = createElement(
- 'div',
- getAttributesFromSelector(this.config.selectors.controls.wrapper)
- );
- this.elements.controls = c;
- const g = { class: 'plyr__controls__item' };
- return (
- dedupe(
- is.array(this.config.controls) ? this.config.controls : []
- ).forEach(S => {
- if (
- (S === 'restart' && c.appendChild(r.call(this, 'restart', g)),
- S === 'rewind' && c.appendChild(r.call(this, 'rewind', g)),
- S === 'play' && c.appendChild(r.call(this, 'play', g)),
- S === 'fast-forward' &&
- c.appendChild(r.call(this, 'fast-forward', g)),
- S === 'progress')
- ) {
- const p = createElement('div', {
- class: `${g.class} plyr__progress__container`
- }),
- P = createElement(
- 'div',
- getAttributesFromSelector(this.config.selectors.progress)
- );
- if (
- (P.appendChild(s.call(this, 'seek', { id: `plyr-seek-${e.id}` })),
- P.appendChild(i.call(this, 'buffer')),
- this.config.tooltips.seek)
- ) {
- const b = createElement(
- 'span',
- { class: this.config.classNames.tooltip },
- '00:00'
- );
- P.appendChild(b), (this.elements.display.seekTooltip = b);
- }
- (this.elements.progress = P),
- p.appendChild(this.elements.progress),
- c.appendChild(p);
- }
- if (
- (S === 'current-time' &&
- c.appendChild(n.call(this, 'currentTime', g)),
- S === 'duration' && c.appendChild(n.call(this, 'duration', g)),
- S === 'mute' || S === 'volume')
- ) {
- let { volume: p } = this.elements;
- if (
- ((is.element(p) && c.contains(p)) ||
- ((p = createElement(
- 'div',
- extend({}, g, { class: `${g.class} plyr__volume`.trim() })
- )),
- (this.elements.volume = p),
- c.appendChild(p)),
- S === 'mute' && p.appendChild(r.call(this, 'mute')),
- S === 'volume' && !browser.isIos && !browser.isIPadOS)
- ) {
- const P = { max: 1, step: 0.05, value: this.config.volume };
- p.appendChild(
- s.call(this, 'volume', extend(P, { id: `plyr-volume-${e.id}` }))
- );
- }
- }
- if (
- (S === 'captions' && c.appendChild(r.call(this, 'captions', g)),
- S === 'settings' && !is.empty(this.config.settings))
- ) {
- const p = createElement(
- 'div',
- extend({}, g, { class: `${g.class} plyr__menu`.trim(), hidden: '' })
- );
- p.appendChild(
- r.call(this, 'settings', {
- 'aria-haspopup': !0,
- 'aria-controls': `plyr-settings-${e.id}`,
- 'aria-expanded': !1
- })
- );
- const P = createElement('div', {
- class: 'plyr__menu__container',
- id: `plyr-settings-${e.id}`,
- hidden: ''
- }),
- b = createElement('div'),
- y = createElement('div', { id: `plyr-settings-${e.id}-home` }),
- A = createElement('div', { role: 'menu' });
- y.appendChild(A),
- b.appendChild(y),
- (this.elements.settings.panels.home = y),
- this.config.settings.forEach(u => {
- const f = createElement(
- 'button',
- extend(
- getAttributesFromSelector(
- this.config.selectors.buttons.settings
- ),
- {
- type: 'button',
- class: `${this.config.classNames.control} ${this.config.classNames.control}--forward`,
- role: 'menuitem',
- 'aria-haspopup': !0,
- hidden: ''
- }
- )
- );
- t.call(this, f, u),
- on.call(this, f, 'click', () => {
- l.call(this, u, !1);
- });
- const m = createElement('span', null, i18n.get(u, this.config)),
- d = createElement('span', {
- class: this.config.classNames.menu.value
- });
- (d.innerHTML = e[u]),
- m.appendChild(d),
- f.appendChild(m),
- A.appendChild(f);
- const E = createElement('div', {
- id: `plyr-settings-${e.id}-${u}`,
- hidden: ''
- }),
- T = createElement('button', {
- type: 'button',
- class: `${this.config.classNames.control} ${this.config.classNames.control}--back`
- });
- T.appendChild(
- createElement(
- 'span',
- { 'aria-hidden': !0 },
- i18n.get(u, this.config)
- )
- ),
- T.appendChild(
- createElement(
- 'span',
- { class: this.config.classNames.hidden },
- i18n.get('menuBack', this.config)
- )
- ),
- on.call(
- this,
- E,
- 'keydown',
- x => {
- x.key === 'ArrowLeft' &&
- (x.preventDefault(),
- x.stopPropagation(),
- l.call(this, 'home', !0));
- },
- !1
- ),
- on.call(this, T, 'click', () => {
- l.call(this, 'home', !1);
- }),
- E.appendChild(T),
- E.appendChild(createElement('div', { role: 'menu' })),
- b.appendChild(E),
- (this.elements.settings.buttons[u] = f),
- (this.elements.settings.panels[u] = E);
- }),
- P.appendChild(b),
- p.appendChild(P),
- c.appendChild(p),
- (this.elements.settings.popup = P),
- (this.elements.settings.menu = p);
- }
- if (
- (S === 'pip' && support.pip && c.appendChild(r.call(this, 'pip', g)),
- S === 'airplay' &&
- support.airplay &&
- c.appendChild(r.call(this, 'airplay', g)),
- S === 'download')
- ) {
- const p = extend({}, g, {
- element: 'a',
- href: this.download,
- target: '_blank'
- });
- this.isHTML5 && (p.download = '');
- const { download: P } = this.config.urls;
- !is.url(P) &&
- this.isEmbed &&
- extend(p, { icon: `logo-${this.provider}`, label: this.provider }),
- c.appendChild(r.call(this, 'download', p));
- }
- S === 'fullscreen' && c.appendChild(r.call(this, 'fullscreen', g));
- }),
- this.isHTML5 && a.call(this, html5.getQualityOptions.call(this)),
- o.call(this),
- c
- );
- },
- inject() {
- if (this.config.loadSprite) {
- const s = controls$2.getIconUrl.call(this);
- s.cors && loadSprite(s.url, 'sprite-plyr');
- }
- this.id = Math.floor(1e4 * Math.random());
- let e = null;
- this.elements.controls = null;
- const t = {
- id: this.id,
- seektime: this.config.seekTime,
- title: this.config.title
- };
- let r = !0;
- is.function(this.config.controls) &&
- (this.config.controls = this.config.controls.call(this, t)),
- this.config.controls || (this.config.controls = []),
- is.element(this.config.controls) || is.string(this.config.controls)
- ? (e = this.config.controls)
- : ((e = controls$2.create.call(this, {
- id: this.id,
- seektime: this.config.seekTime,
- speed: this.speed,
- quality: this.quality,
- captions: captions.getLabel.call(this)
- })),
- (r = !1));
- let i;
- if (
- (r &&
- is.string(this.config.controls) &&
- (e = (s => {
- let n = s;
- return (
- Object.entries(t).forEach(([a, o]) => {
- n = replaceAll(n, `{${a}}`, o);
- }),
- n
- );
- })(e)),
- is.string(this.config.selectors.controls.container) &&
- (i = document.querySelector(this.config.selectors.controls.container)),
- is.element(i) || (i = this.elements.container),
- i[is.element(e) ? 'insertAdjacentElement' : 'insertAdjacentHTML'](
- 'afterbegin',
- e
- ),
- is.element(this.elements.controls) || controls$2.findElements.call(this),
- !is.empty(this.elements.buttons))
- ) {
- const s = n => {
- const a = this.config.classNames.controlPressed;
- n.setAttribute('aria-pressed', 'false'),
- Object.defineProperty(n, 'pressed', {
- configurable: !0,
- enumerable: !0,
- get: () => hasClass(n, a),
- set(o = !1) {
- toggleClass(n, a, o),
- n.setAttribute('aria-pressed', o ? 'true' : 'false');
- }
- });
- };
- Object.values(this.elements.buttons)
- .filter(Boolean)
- .forEach(n => {
- is.array(n) || is.nodeList(n)
- ? Array.from(n).filter(Boolean).forEach(s)
- : s(n);
- });
- }
- if ((browser.isEdge && repaint(i), this.config.tooltips.controls)) {
- const { classNames: s, selectors: n } = this.config,
- a = `${n.controls.wrapper} ${n.labels} .${s.hidden}`,
- o = getElements.call(this, a);
- Array.from(o).forEach(l => {
- toggleClass(l, this.config.classNames.hidden, !1),
- toggleClass(l, this.config.classNames.tooltip, !0);
- });
- }
- },
- setMediaMetadata() {
- try {
- 'mediaSession' in navigator &&
- (navigator.mediaSession.metadata = new window.MediaMetadata({
- title: this.config.mediaMetadata.title,
- artist: this.config.mediaMetadata.artist,
- album: this.config.mediaMetadata.album,
- artwork: this.config.mediaMetadata.artwork
- }));
- } catch {}
- },
- setMarkers() {
- var e, t;
- if (!this.duration || this.elements.markers) return;
- const r =
- (e = this.config.markers) === null ||
- e === void 0 ||
- (t = e.points) === null ||
- t === void 0
- ? void 0
- : t.filter(({ time: l }) => l > 0 && l < this.duration);
- if (r == null || !r.length) return;
- const i = document.createDocumentFragment(),
- s = document.createDocumentFragment();
- let n = null;
- const a = `${this.config.classNames.tooltip}--visible`,
- o = l => toggleClass(n, a, l);
- r.forEach(l => {
- const c = createElement(
- 'span',
- { class: this.config.classNames.marker },
- ''
- ),
- g = (l.time / this.duration) * 100 + '%';
- n &&
- (c.addEventListener('mouseenter', () => {
- l.label || ((n.style.left = g), (n.innerHTML = l.label), o(!0));
- }),
- c.addEventListener('mouseleave', () => {
- o(!1);
- })),
- c.addEventListener('click', () => {
- this.currentTime = l.time;
- }),
- (c.style.left = g),
- s.appendChild(c);
- }),
- i.appendChild(s),
- this.config.tooltips.seek ||
- ((n = createElement(
- 'span',
- { class: this.config.classNames.tooltip },
- ''
- )),
- i.appendChild(n)),
- (this.elements.markers = { points: s, tip: n }),
- this.elements.progress.appendChild(i);
- }
- };
- function parseUrl(e, t = !0) {
- let r = e;
- if (t) {
- const i = document.createElement('a');
- (i.href = r), (r = i.href);
- }
- try {
- return new URL(r);
- } catch {
- return null;
- }
- }
- function buildUrlParams(e) {
- const t = new URLSearchParams();
- return (
- is.object(e) &&
- Object.entries(e).forEach(([r, i]) => {
- t.set(r, i);
- }),
- t
- );
- }
- const captions = {
- setup() {
- if (!this.supported.ui) return;
- if (
- !this.isVideo ||
- this.isYouTube ||
- (this.isHTML5 && !support.textTracks)
- )
- return void (
- is.array(this.config.controls) &&
- this.config.controls.includes('settings') &&
- this.config.settings.includes('captions') &&
- controls$2.setCaptionsMenu.call(this)
- );
- if (
- (is.element(this.elements.captions) ||
- ((this.elements.captions = createElement(
- 'div',
- getAttributesFromSelector(this.config.selectors.captions)
- )),
- this.elements.captions.setAttribute('dir', 'auto'),
- insertAfter(this.elements.captions, this.elements.wrapper)),
- browser.isIE && window.URL)
- ) {
- const i = this.media.querySelectorAll('track');
- Array.from(i).forEach(s => {
- const n = s.getAttribute('src'),
- a = parseUrl(n);
- a !== null &&
- a.hostname !== window.location.href.hostname &&
- ['http:', 'https:'].includes(a.protocol) &&
- fetch$1(n, 'blob')
- .then(o => {
- s.setAttribute('src', window.URL.createObjectURL(o));
- })
- .catch(() => {
- removeElement(s);
- });
- });
- }
- const e = dedupe(
- (
- navigator.languages || [
- navigator.language || navigator.userLanguage || 'en'
- ]
- ).map(i => i.split('-')[0])
- );
- let t = (
- this.storage.get('language') ||
- this.config.captions.language ||
- 'auto'
- ).toLowerCase();
- t === 'auto' && ([t] = e);
- let r = this.storage.get('captions');
- if (
- (is.boolean(r) || ({ active: r } = this.config.captions),
- Object.assign(this.captions, {
- toggled: !1,
- active: r,
- language: t,
- languages: e
- }),
- this.isHTML5)
- ) {
- const i = this.config.captions.update
- ? 'addtrack removetrack'
- : 'removetrack';
- on.call(this, this.media.textTracks, i, captions.update.bind(this));
- }
- setTimeout(captions.update.bind(this), 0);
- },
- update() {
- const e = captions.getTracks.call(this, !0),
- {
- active: t,
- language: r,
- meta: i,
- currentTrackNode: s
- } = this.captions,
- n = !!e.find(a => a.language === r);
- this.isHTML5 &&
- this.isVideo &&
- e
- .filter(a => !i.get(a))
- .forEach(a => {
- this.debug.log('Track added', a),
- i.set(a, { default: a.mode === 'showing' }),
- a.mode === 'showing' && (a.mode = 'hidden'),
- on.call(this, a, 'cuechange', () =>
- captions.updateCues.call(this)
- );
- }),
- ((n && this.language !== r) || !e.includes(s)) &&
- (captions.setLanguage.call(this, r),
- captions.toggle.call(this, t && n)),
- this.elements &&
- toggleClass(
- this.elements.container,
- this.config.classNames.captions.enabled,
- !is.empty(e)
- ),
- is.array(this.config.controls) &&
- this.config.controls.includes('settings') &&
- this.config.settings.includes('captions') &&
- controls$2.setCaptionsMenu.call(this);
- },
- toggle(e, t = !0) {
- if (!this.supported.ui) return;
- const { toggled: r } = this.captions,
- i = this.config.classNames.captions.active,
- s = is.nullOrUndefined(e) ? !r : e;
- if (s !== r) {
- if (
- (t || ((this.captions.active = s), this.storage.set({ captions: s })),
- !this.language && s && !t)
- ) {
- const n = captions.getTracks.call(this),
- a = captions.findTrack.call(
- this,
- [this.captions.language, ...this.captions.languages],
- !0
- );
- return (
- (this.captions.language = a.language),
- void captions.set.call(this, n.indexOf(a))
- );
- }
- this.elements.buttons.captions &&
- (this.elements.buttons.captions.pressed = s),
- toggleClass(this.elements.container, i, s),
- (this.captions.toggled = s),
- controls$2.updateSetting.call(this, 'captions'),
- triggerEvent.call(
- this,
- this.media,
- s ? 'captionsenabled' : 'captionsdisabled'
- );
- }
- setTimeout(() => {
- s &&
- this.captions.toggled &&
- (this.captions.currentTrackNode.mode = 'hidden');
- });
- },
- set(e, t = !0) {
- const r = captions.getTracks.call(this);
- if (e !== -1)
- if (is.number(e))
- if (e in r) {
- if (this.captions.currentTrack !== e) {
- this.captions.currentTrack = e;
- const i = r[e],
- { language: s } = i || {};
- (this.captions.currentTrackNode = i),
- controls$2.updateSetting.call(this, 'captions'),
- t ||
- ((this.captions.language = s),
- this.storage.set({ language: s })),
- this.isVimeo && this.embed.enableTextTrack(s),
- triggerEvent.call(this, this.media, 'languagechange');
- }
- captions.toggle.call(this, !0, t),
- this.isHTML5 && this.isVideo && captions.updateCues.call(this);
- } else this.debug.warn('Track not found', e);
- else this.debug.warn('Invalid caption argument', e);
- else captions.toggle.call(this, !1, t);
- },
- setLanguage(e, t = !0) {
- if (!is.string(e))
- return void this.debug.warn('Invalid language argument', e);
- const r = e.toLowerCase();
- this.captions.language = r;
- const i = captions.getTracks.call(this),
- s = captions.findTrack.call(this, [r]);
- captions.set.call(this, i.indexOf(s), t);
- },
- getTracks(e = !1) {
- return Array.from((this.media || {}).textTracks || [])
- .filter(t => !this.isHTML5 || e || this.captions.meta.has(t))
- .filter(t => ['captions', 'subtitles'].includes(t.kind));
- },
- findTrack(e, t = !1) {
- const r = captions.getTracks.call(this),
- i = a => Number((this.captions.meta.get(a) || {}).default),
- s = Array.from(r).sort((a, o) => i(o) - i(a));
- let n;
- return (
- e.every(a => ((n = s.find(o => o.language === a)), !n)),
- n || (t ? s[0] : void 0)
- );
- },
- getCurrentTrack() {
- return captions.getTracks.call(this)[this.currentTrack];
- },
- getLabel(e) {
- let t = e;
- return (
- !is.track(t) &&
- support.textTracks &&
- this.captions.toggled &&
- (t = captions.getCurrentTrack.call(this)),
- is.track(t)
- ? is.empty(t.label)
- ? is.empty(t.language)
- ? i18n.get('enabled', this.config)
- : e.language.toUpperCase()
- : t.label
- : i18n.get('disabled', this.config)
- );
- },
- updateCues(e) {
- if (!this.supported.ui) return;
- if (!is.element(this.elements.captions))
- return void this.debug.warn('No captions element to render to');
- if (!is.nullOrUndefined(e) && !Array.isArray(e))
- return void this.debug.warn('updateCues: Invalid input', e);
- let t = e;
- if (!t) {
- const i = captions.getCurrentTrack.call(this);
- t = Array.from((i || {}).activeCues || [])
- .map(s => s.getCueAsHTML())
- .map(getHTML);
- }
- const r = t.map(i => i.trim()).join(`
- `);
- if (r !== this.elements.captions.innerHTML) {
- emptyElement(this.elements.captions);
- const i = createElement(
- 'span',
- getAttributesFromSelector(this.config.selectors.caption)
- );
- (i.innerHTML = r),
- this.elements.captions.appendChild(i),
- triggerEvent.call(this, this.media, 'cuechange');
- }
- }
- },
- defaults = {
- enabled: !0,
- title: '',
- debug: !1,
- autoplay: !1,
- autopause: !0,
- playsinline: !0,
- seekTime: 10,
- volume: 1,
- muted: !1,
- duration: null,
- displayDuration: !0,
- invertTime: !0,
- toggleInvert: !0,
- ratio: null,
- clickToPlay: !0,
- hideControls: !0,
- resetOnEnd: !1,
- disableContextMenu: !0,
- loadSprite: !0,
- iconPrefix: 'plyr',
- iconUrl: 'https://cdn.plyr.io/3.7.8/plyr.svg',
- blankVideo: 'https://cdn.plyr.io/static/blank.mp4',
- quality: {
- default: 576,
- options: [4320, 2880, 2160, 1440, 1080, 720, 576, 480, 360, 240],
- forced: !1,
- onChange: null
- },
- loop: { active: !1 },
- speed: { selected: 1, options: [0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 4] },
- keyboard: { focused: !0, global: !1 },
- tooltips: { controls: !1, seek: !0 },
- captions: { active: !1, language: 'auto', update: !1 },
- fullscreen: { enabled: !0, fallback: !0, iosNative: !1 },
- storage: { enabled: !0, key: 'plyr' },
- controls: [
- 'play-large',
- 'play',
- 'progress',
- 'current-time',
- 'mute',
- 'volume',
- 'captions',
- 'settings',
- 'pip',
- 'airplay',
- 'fullscreen'
- ],
- settings: ['captions', 'quality', 'speed'],
- i18n: {
- restart: 'Restart',
- rewind: 'Rewind {seektime}s',
- play: 'Play',
- pause: 'Pause',
- fastForward: 'Forward {seektime}s',
- seek: 'Seek',
- seekLabel: '{currentTime} of {duration}',
- played: 'Played',
- buffered: 'Buffered',
- currentTime: 'Current time',
- duration: 'Duration',
- volume: 'Volume',
- mute: 'Mute',
- unmute: 'Unmute',
- enableCaptions: 'Enable captions',
- disableCaptions: 'Disable captions',
- download: 'Download',
- enterFullscreen: 'Enter fullscreen',
- exitFullscreen: 'Exit fullscreen',
- frameTitle: 'Player for {title}',
- captions: 'Captions',
- settings: 'Settings',
- pip: 'PIP',
- menuBack: 'Go back to previous menu',
- speed: 'Speed',
- normal: 'Normal',
- quality: 'Quality',
- loop: 'Loop',
- start: 'Start',
- end: 'End',
- all: 'All',
- reset: 'Reset',
- disabled: 'Disabled',
- enabled: 'Enabled',
- advertisement: 'Ad',
- qualityBadge: {
- 2160: '4K',
- 1440: 'HD',
- 1080: 'HD',
- 720: 'HD',
- 576: 'SD',
- 480: 'SD'
- }
- },
- urls: {
- download: null,
- vimeo: {
- sdk: 'https://player.vimeo.com/api/player.js',
- iframe: 'https://player.vimeo.com/video/{0}?{1}',
- api: 'https://vimeo.com/api/oembed.json?url={0}'
- },
- youtube: {
- sdk: 'https://www.youtube.com/iframe_api',
- api: 'https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}'
- },
- googleIMA: { sdk: 'https://imasdk.googleapis.com/js/sdkloader/ima3.js' }
- },
- listeners: {
- seek: null,
- play: null,
- pause: null,
- restart: null,
- rewind: null,
- fastForward: null,
- mute: null,
- volume: null,
- captions: null,
- download: null,
- fullscreen: null,
- pip: null,
- airplay: null,
- speed: null,
- quality: null,
- loop: null,
- language: null
- },
- events: [
- 'ended',
- 'progress',
- 'stalled',
- 'playing',
- 'waiting',
- 'canplay',
- 'canplaythrough',
- 'loadstart',
- 'loadeddata',
- 'loadedmetadata',
- 'timeupdate',
- 'volumechange',
- 'play',
- 'pause',
- 'error',
- 'seeking',
- 'seeked',
- 'emptied',
- 'ratechange',
- 'cuechange',
- 'download',
- 'enterfullscreen',
- 'exitfullscreen',
- 'captionsenabled',
- 'captionsdisabled',
- 'languagechange',
- 'controlshidden',
- 'controlsshown',
- 'ready',
- 'statechange',
- 'qualitychange',
- 'adsloaded',
- 'adscontentpause',
- 'adscontentresume',
- 'adstarted',
- 'adsmidpoint',
- 'adscomplete',
- 'adsallcomplete',
- 'adsimpression',
- 'adsclick'
- ],
- selectors: {
- editable: 'input, textarea, select, [contenteditable]',
- container: '.plyr',
- controls: { container: null, wrapper: '.plyr__controls' },
- labels: '[data-plyr]',
- buttons: {
- play: '[data-plyr="play"]',
- pause: '[data-plyr="pause"]',
- restart: '[data-plyr="restart"]',
- rewind: '[data-plyr="rewind"]',
- fastForward: '[data-plyr="fast-forward"]',
- mute: '[data-plyr="mute"]',
- captions: '[data-plyr="captions"]',
- download: '[data-plyr="download"]',
- fullscreen: '[data-plyr="fullscreen"]',
- pip: '[data-plyr="pip"]',
- airplay: '[data-plyr="airplay"]',
- settings: '[data-plyr="settings"]',
- loop: '[data-plyr="loop"]'
- },
- inputs: {
- seek: '[data-plyr="seek"]',
- volume: '[data-plyr="volume"]',
- speed: '[data-plyr="speed"]',
- language: '[data-plyr="language"]',
- quality: '[data-plyr="quality"]'
- },
- display: {
- currentTime: '.plyr__time--current',
- duration: '.plyr__time--duration',
- buffer: '.plyr__progress__buffer',
- loop: '.plyr__progress__loop',
- volume: '.plyr__volume--display'
- },
- progress: '.plyr__progress',
- captions: '.plyr__captions',
- caption: '.plyr__caption'
- },
- classNames: {
- type: 'plyr--{0}',
- provider: 'plyr--{0}',
- video: 'plyr__video-wrapper',
- embed: 'plyr__video-embed',
- videoFixedRatio: 'plyr__video-wrapper--fixed-ratio',
- embedContainer: 'plyr__video-embed__container',
- poster: 'plyr__poster',
- posterEnabled: 'plyr__poster-enabled',
- ads: 'plyr__ads',
- control: 'plyr__control',
- controlPressed: 'plyr__control--pressed',
- playing: 'plyr--playing',
- paused: 'plyr--paused',
- stopped: 'plyr--stopped',
- loading: 'plyr--loading',
- hover: 'plyr--hover',
- tooltip: 'plyr__tooltip',
- cues: 'plyr__cues',
- marker: 'plyr__progress__marker',
- hidden: 'plyr__sr-only',
- hideControls: 'plyr--hide-controls',
- isTouch: 'plyr--is-touch',
- uiSupported: 'plyr--full-ui',
- noTransition: 'plyr--no-transition',
- display: { time: 'plyr__time' },
- menu: {
- value: 'plyr__menu__value',
- badge: 'plyr__badge',
- open: 'plyr--menu-open'
- },
- captions: {
- enabled: 'plyr--captions-enabled',
- active: 'plyr--captions-active'
- },
- fullscreen: {
- enabled: 'plyr--fullscreen-enabled',
- fallback: 'plyr--fullscreen-fallback'
- },
- pip: { supported: 'plyr--pip-supported', active: 'plyr--pip-active' },
- airplay: {
- supported: 'plyr--airplay-supported',
- active: 'plyr--airplay-active'
- },
- previewThumbnails: {
- thumbContainer: 'plyr__preview-thumb',
- thumbContainerShown: 'plyr__preview-thumb--is-shown',
- imageContainer: 'plyr__preview-thumb__image-container',
- timeContainer: 'plyr__preview-thumb__time-container',
- scrubbingContainer: 'plyr__preview-scrubbing',
- scrubbingContainerShown: 'plyr__preview-scrubbing--is-shown'
- }
- },
- attributes: {
- embed: {
- provider: 'data-plyr-provider',
- id: 'data-plyr-embed-id',
- hash: 'data-plyr-embed-hash'
- }
- },
- ads: { enabled: !1, publisherId: '', tagUrl: '' },
- previewThumbnails: { enabled: !1, src: '' },
- vimeo: {
- byline: !1,
- portrait: !1,
- title: !1,
- speed: !0,
- transparent: !1,
- customControls: !0,
- referrerPolicy: null,
- premium: !1
- },
- youtube: {
- rel: 0,
- showinfo: 0,
- iv_load_policy: 3,
- modestbranding: 1,
- customControls: !0,
- noCookie: !1
- },
- mediaMetadata: { title: '', artist: '', album: '', artwork: [] },
- markers: { enabled: !1, points: [] }
- },
- pip = { active: 'picture-in-picture', inactive: 'inline' },
- providers = { html5: 'html5', youtube: 'youtube', vimeo: 'vimeo' },
- types = { audio: 'audio', video: 'video' };
- function getProviderByUrl(e) {
- return /^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(
- e
- )
- ? providers.youtube
- : /^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)
- ? providers.vimeo
- : null;
- }
- const noop = () => {};
- class Console {
- constructor(t = !1) {
- (this.enabled = window.console && t),
- this.enabled && this.log('Debugging enabled');
- }
- get log() {
- return this.enabled
- ? Function.prototype.bind.call(console.log, console)
- : noop;
- }
- get warn() {
- return this.enabled
- ? Function.prototype.bind.call(console.warn, console)
- : noop;
- }
- get error() {
- return this.enabled
- ? Function.prototype.bind.call(console.error, console)
- : noop;
- }
- }
- class Fullscreen {
- constructor(t) {
- _defineProperty$1(this, 'onChange', () => {
- if (!this.supported) return;
- const r = this.player.elements.buttons.fullscreen;
- is.element(r) && (r.pressed = this.active);
- const i =
- this.target === this.player.media
- ? this.target
- : this.player.elements.container;
- triggerEvent.call(
- this.player,
- i,
- this.active ? 'enterfullscreen' : 'exitfullscreen',
- !0
- );
- }),
- _defineProperty$1(this, 'toggleFallback', (r = !1) => {
- if (
- (r
- ? (this.scrollPosition = {
- x: window.scrollX ?? 0,
- y: window.scrollY ?? 0
- })
- : window.scrollTo(this.scrollPosition.x, this.scrollPosition.y),
- (document.body.style.overflow = r ? 'hidden' : ''),
- toggleClass(
- this.target,
- this.player.config.classNames.fullscreen.fallback,
- r
- ),
- browser.isIos)
- ) {
- let i = document.head.querySelector('meta[name="viewport"]');
- const s = 'viewport-fit=cover';
- i ||
- ((i = document.createElement('meta')),
- i.setAttribute('name', 'viewport'));
- const n = is.string(i.content) && i.content.includes(s);
- r
- ? ((this.cleanupViewport = !n), n || (i.content += `,${s}`))
- : this.cleanupViewport &&
- (i.content = i.content
- .split(',')
- .filter(a => a.trim() !== s)
- .join(','));
- }
- this.onChange();
- }),
- _defineProperty$1(this, 'trapFocus', r => {
- if (
- browser.isIos ||
- browser.isIPadOS ||
- !this.active ||
- r.key !== 'Tab'
- )
- return;
- const i = document.activeElement,
- s = getElements.call(
- this.player,
- 'a[href], button:not(:disabled), input:not(:disabled), [tabindex]'
- ),
- [n] = s,
- a = s[s.length - 1];
- i !== a || r.shiftKey
- ? i === n && r.shiftKey && (a.focus(), r.preventDefault())
- : (n.focus(), r.preventDefault());
- }),
- _defineProperty$1(this, 'update', () => {
- if (this.supported) {
- let r;
- (r = this.forceFallback
- ? 'Fallback (forced)'
- : Fullscreen.nativeSupported
- ? 'Native'
- : 'Fallback'),
- this.player.debug.log(`${r} fullscreen enabled`);
- } else
- this.player.debug.log(
- 'Fullscreen not supported and fallback disabled'
- );
- toggleClass(
- this.player.elements.container,
- this.player.config.classNames.fullscreen.enabled,
- this.supported
- );
- }),
- _defineProperty$1(this, 'enter', () => {
- this.supported &&
- (browser.isIos && this.player.config.fullscreen.iosNative
- ? this.player.isVimeo
- ? this.player.embed.requestFullscreen()
- : this.target.webkitEnterFullscreen()
- : !Fullscreen.nativeSupported || this.forceFallback
- ? this.toggleFallback(!0)
- : this.prefix
- ? is.empty(this.prefix) ||
- this.target[`${this.prefix}Request${this.property}`]()
- : this.target.requestFullscreen({ navigationUI: 'hide' }));
- }),
- _defineProperty$1(this, 'exit', () => {
- if (this.supported)
- if (browser.isIos && this.player.config.fullscreen.iosNative)
- this.player.isVimeo
- ? this.player.embed.exitFullscreen()
- : this.target.webkitEnterFullscreen(),
- silencePromise(this.player.play());
- else if (!Fullscreen.nativeSupported || this.forceFallback)
- this.toggleFallback(!1);
- else if (this.prefix) {
- if (!is.empty(this.prefix)) {
- const r = this.prefix === 'moz' ? 'Cancel' : 'Exit';
- document[`${this.prefix}${r}${this.property}`]();
- }
- } else
- (document.cancelFullScreen || document.exitFullscreen).call(
- document
- );
- }),
- _defineProperty$1(this, 'toggle', () => {
- this.active ? this.exit() : this.enter();
- }),
- (this.player = t),
- (this.prefix = Fullscreen.prefix),
- (this.property = Fullscreen.property),
- (this.scrollPosition = { x: 0, y: 0 }),
- (this.forceFallback = t.config.fullscreen.fallback === 'force'),
- (this.player.elements.fullscreen =
- t.config.fullscreen.container &&
- closest$1(
- this.player.elements.container,
- t.config.fullscreen.container
- )),
- on.call(
- this.player,
- document,
- this.prefix === 'ms'
- ? 'MSFullscreenChange'
- : `${this.prefix}fullscreenchange`,
- () => {
- this.onChange();
- }
- ),
- on.call(this.player, this.player.elements.container, 'dblclick', r => {
- (is.element(this.player.elements.controls) &&
- this.player.elements.controls.contains(r.target)) ||
- this.player.listeners.proxy(r, this.toggle, 'fullscreen');
- }),
- on.call(this, this.player.elements.container, 'keydown', r =>
- this.trapFocus(r)
- ),
- this.update();
- }
- static get nativeSupported() {
- return !!(
- document.fullscreenEnabled ||
- document.webkitFullscreenEnabled ||
- document.mozFullScreenEnabled ||
- document.msFullscreenEnabled
- );
- }
- get useNative() {
- return Fullscreen.nativeSupported && !this.forceFallback;
- }
- static get prefix() {
- if (is.function(document.exitFullscreen)) return '';
- let t = '';
- return (
- ['webkit', 'moz', 'ms'].some(
- r =>
- !(
- !is.function(document[`${r}ExitFullscreen`]) &&
- !is.function(document[`${r}CancelFullScreen`])
- ) && ((t = r), !0)
- ),
- t
- );
- }
- static get property() {
- return this.prefix === 'moz' ? 'FullScreen' : 'Fullscreen';
- }
- get supported() {
- return [
- this.player.config.fullscreen.enabled,
- this.player.isVideo,
- Fullscreen.nativeSupported || this.player.config.fullscreen.fallback,
- !this.player.isYouTube ||
- Fullscreen.nativeSupported ||
- !browser.isIos ||
- (this.player.config.playsinline &&
- !this.player.config.fullscreen.iosNative)
- ].every(Boolean);
- }
- get active() {
- if (!this.supported) return !1;
- if (!Fullscreen.nativeSupported || this.forceFallback)
- return hasClass(
- this.target,
- this.player.config.classNames.fullscreen.fallback
- );
- const t = this.prefix
- ? this.target.getRootNode()[`${this.prefix}${this.property}Element`]
- : this.target.getRootNode().fullscreenElement;
- return t && t.shadowRoot
- ? t === this.target.getRootNode().host
- : t === this.target;
- }
- get target() {
- return browser.isIos && this.player.config.fullscreen.iosNative
- ? this.player.media
- : this.player.elements.fullscreen ?? this.player.elements.container;
- }
- }
- function loadImage(e, t = 1) {
- return new Promise((r, i) => {
- const s = new Image(),
- n = () => {
- delete s.onload, delete s.onerror, (s.naturalWidth >= t ? r : i)(s);
- };
- Object.assign(s, { onload: n, onerror: n, src: e });
- });
- }
- const ui = {
- addStyleHook() {
- toggleClass(
- this.elements.container,
- this.config.selectors.container.replace('.', ''),
- !0
- ),
- toggleClass(
- this.elements.container,
- this.config.classNames.uiSupported,
- this.supported.ui
- );
- },
- toggleNativeControls(e = !1) {
- e && this.isHTML5
- ? this.media.setAttribute('controls', '')
- : this.media.removeAttribute('controls');
- },
- build() {
- if ((this.listeners.media(), !this.supported.ui))
- return (
- this.debug.warn(`Basic support only for ${this.provider} ${this.type}`),
- void ui.toggleNativeControls.call(this, !0)
- );
- is.element(this.elements.controls) ||
- (controls$2.inject.call(this), this.listeners.controls()),
- ui.toggleNativeControls.call(this),
- this.isHTML5 && captions.setup.call(this),
- (this.volume = null),
- (this.muted = null),
- (this.loop = null),
- (this.quality = null),
- (this.speed = null),
- controls$2.updateVolume.call(this),
- controls$2.timeUpdate.call(this),
- controls$2.durationUpdate.call(this),
- ui.checkPlaying.call(this),
- toggleClass(
- this.elements.container,
- this.config.classNames.pip.supported,
- support.pip && this.isHTML5 && this.isVideo
- ),
- toggleClass(
- this.elements.container,
- this.config.classNames.airplay.supported,
- support.airplay && this.isHTML5
- ),
- toggleClass(
- this.elements.container,
- this.config.classNames.isTouch,
- this.touch
- ),
- (this.ready = !0),
- setTimeout(() => {
- triggerEvent.call(this, this.media, 'ready');
- }, 0),
- ui.setTitle.call(this),
- this.poster && ui.setPoster.call(this, this.poster, !1).catch(() => {}),
- this.config.duration && controls$2.durationUpdate.call(this),
- this.config.mediaMetadata && controls$2.setMediaMetadata.call(this);
- },
- setTitle() {
- let e = i18n.get('play', this.config);
- if (
- (is.string(this.config.title) &&
- !is.empty(this.config.title) &&
- (e += `, ${this.config.title}`),
- Array.from(this.elements.buttons.play || []).forEach(t => {
- t.setAttribute('aria-label', e);
- }),
- this.isEmbed)
- ) {
- const t = getElement.call(this, 'iframe');
- if (!is.element(t)) return;
- const r = is.empty(this.config.title) ? 'video' : this.config.title,
- i = i18n.get('frameTitle', this.config);
- t.setAttribute('title', i.replace('{title}', r));
- }
- },
- togglePoster(e) {
- toggleClass(
- this.elements.container,
- this.config.classNames.posterEnabled,
- e
- );
- },
- setPoster(e, t = !0) {
- return t && this.poster
- ? Promise.reject(new Error('Poster already set'))
- : (this.media.setAttribute('data-poster', e),
- this.elements.poster.removeAttribute('hidden'),
- ready
- .call(this)
- .then(() => loadImage(e))
- .catch(r => {
- throw (e === this.poster && ui.togglePoster.call(this, !1), r);
- })
- .then(() => {
- if (e !== this.poster)
- throw new Error('setPoster cancelled by later call to setPoster');
- })
- .then(
- () => (
- Object.assign(this.elements.poster.style, {
- backgroundImage: `url('${e}')`,
- backgroundSize: ''
- }),
- ui.togglePoster.call(this, !0),
- e
- )
- ));
- },
- checkPlaying(e) {
- toggleClass(
- this.elements.container,
- this.config.classNames.playing,
- this.playing
- ),
- toggleClass(
- this.elements.container,
- this.config.classNames.paused,
- this.paused
- ),
- toggleClass(
- this.elements.container,
- this.config.classNames.stopped,
- this.stopped
- ),
- Array.from(this.elements.buttons.play || []).forEach(t => {
- Object.assign(t, { pressed: this.playing }),
- t.setAttribute(
- 'aria-label',
- i18n.get(this.playing ? 'pause' : 'play', this.config)
- );
- }),
- (is.event(e) && e.type === 'timeupdate') || ui.toggleControls.call(this);
- },
- checkLoading(e) {
- (this.loading = ['stalled', 'waiting'].includes(e.type)),
- clearTimeout(this.timers.loading),
- (this.timers.loading = setTimeout(
- () => {
- toggleClass(
- this.elements.container,
- this.config.classNames.loading,
- this.loading
- ),
- ui.toggleControls.call(this);
- },
- this.loading ? 250 : 0
- ));
- },
- toggleControls(e) {
- const { controls: t } = this.elements;
- if (t && this.config.hideControls) {
- const r = this.touch && this.lastSeekTime + 2e3 > Date.now();
- this.toggleControls(
- !!(e || this.loading || this.paused || t.pressed || t.hover || r)
- );
- }
- },
- migrateStyles() {
- Object.values({ ...this.media.style })
- .filter(e => !is.empty(e) && is.string(e) && e.startsWith('--plyr'))
- .forEach(e => {
- this.elements.container.style.setProperty(
- e,
- this.media.style.getPropertyValue(e)
- ),
- this.media.style.removeProperty(e);
- }),
- is.empty(this.media.style) && this.media.removeAttribute('style');
- }
- };
- class Listeners {
- constructor(t) {
- _defineProperty$1(this, 'firstTouch', () => {
- const { player: r } = this,
- { elements: i } = r;
- (r.touch = !0), toggleClass(i.container, r.config.classNames.isTouch, !0);
- }),
- _defineProperty$1(this, 'global', (r = !0) => {
- const { player: i } = this;
- i.config.keyboard.global &&
- toggleListener.call(
- i,
- window,
- 'keydown keyup',
- this.handleKey,
- r,
- !1
- ),
- toggleListener.call(i, document.body, 'click', this.toggleMenu, r),
- once.call(i, document.body, 'touchstart', this.firstTouch);
- }),
- _defineProperty$1(this, 'container', () => {
- const { player: r } = this,
- { config: i, elements: s, timers: n } = r;
- !i.keyboard.global &&
- i.keyboard.focused &&
- on.call(r, s.container, 'keydown keyup', this.handleKey, !1),
- on.call(
- r,
- s.container,
- 'mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen',
- l => {
- const { controls: c } = s;
- c &&
- l.type === 'enterfullscreen' &&
- ((c.pressed = !1), (c.hover = !1));
- let g = 0;
- ['touchstart', 'touchmove', 'mousemove'].includes(l.type) &&
- (ui.toggleControls.call(r, !0), (g = r.touch ? 3e3 : 2e3)),
- clearTimeout(n.controls),
- (n.controls = setTimeout(
- () => ui.toggleControls.call(r, !1),
- g
- ));
- }
- );
- const a = () => {
- if (!r.isVimeo || r.config.vimeo.premium) return;
- const l = s.wrapper,
- { active: c } = r.fullscreen,
- [g, S] = getAspectRatio.call(r),
- p = supportsCSS(`aspect-ratio: ${g} / ${S}`);
- if (!c)
- return void (p
- ? ((l.style.width = null), (l.style.height = null))
- : ((l.style.maxWidth = null), (l.style.margin = null)));
- const [P, b] = getViewportSize(),
- y = P / b > g / S;
- p
- ? ((l.style.width = y ? 'auto' : '100%'),
- (l.style.height = y ? '100%' : 'auto'))
- : ((l.style.maxWidth = y ? (b / S) * g + 'px' : null),
- (l.style.margin = y ? '0 auto' : null));
- },
- o = () => {
- clearTimeout(n.resized), (n.resized = setTimeout(a, 50));
- };
- on.call(r, s.container, 'enterfullscreen exitfullscreen', l => {
- const { target: c } = r.fullscreen;
- c === s.container &&
- ((!r.isEmbed && is.empty(r.config.ratio)) ||
- (a(),
- (l.type === 'enterfullscreen' ? on : off).call(
- r,
- window,
- 'resize',
- o
- )));
- });
- }),
- _defineProperty$1(this, 'media', () => {
- const { player: r } = this,
- { elements: i } = r;
- if (
- (on.call(r, r.media, 'timeupdate seeking seeked', n =>
- controls$2.timeUpdate.call(r, n)
- ),
- on.call(r, r.media, 'durationchange loadeddata loadedmetadata', n =>
- controls$2.durationUpdate.call(r, n)
- ),
- on.call(r, r.media, 'ended', () => {
- r.isHTML5 &&
- r.isVideo &&
- r.config.resetOnEnd &&
- (r.restart(), r.pause());
- }),
- on.call(r, r.media, 'progress playing seeking seeked', n =>
- controls$2.updateProgress.call(r, n)
- ),
- on.call(r, r.media, 'volumechange', n =>
- controls$2.updateVolume.call(r, n)
- ),
- on.call(
- r,
- r.media,
- 'playing play pause ended emptied timeupdate',
- n => ui.checkPlaying.call(r, n)
- ),
- on.call(r, r.media, 'waiting canplay seeked playing', n =>
- ui.checkLoading.call(r, n)
- ),
- r.supported.ui && r.config.clickToPlay && !r.isAudio)
- ) {
- const n = getElement.call(r, `.${r.config.classNames.video}`);
- if (!is.element(n)) return;
- on.call(r, i.container, 'click', a => {
- ([i.container, n].includes(a.target) || n.contains(a.target)) &&
- ((r.touch && r.config.hideControls) ||
- (r.ended
- ? (this.proxy(a, r.restart, 'restart'),
- this.proxy(
- a,
- () => {
- silencePromise(r.play());
- },
- 'play'
- ))
- : this.proxy(
- a,
- () => {
- silencePromise(r.togglePlay());
- },
- 'play'
- )));
- });
- }
- r.supported.ui &&
- r.config.disableContextMenu &&
- on.call(
- r,
- i.wrapper,
- 'contextmenu',
- n => {
- n.preventDefault();
- },
- !1
- ),
- on.call(r, r.media, 'volumechange', () => {
- r.storage.set({ volume: r.volume, muted: r.muted });
- }),
- on.call(r, r.media, 'ratechange', () => {
- controls$2.updateSetting.call(r, 'speed'),
- r.storage.set({ speed: r.speed });
- }),
- on.call(r, r.media, 'qualitychange', n => {
- controls$2.updateSetting.call(r, 'quality', null, n.detail.quality);
- }),
- on.call(r, r.media, 'ready qualitychange', () => {
- controls$2.setDownloadUrl.call(r);
- });
- const s = r.config.events.concat(['keyup', 'keydown']).join(' ');
- on.call(r, r.media, s, n => {
- let { detail: a = {} } = n;
- n.type === 'error' && (a = r.media.error),
- triggerEvent.call(r, i.container, n.type, !0, a);
- });
- }),
- _defineProperty$1(this, 'proxy', (r, i, s) => {
- const { player: n } = this,
- a = n.config.listeners[s];
- let o = !0;
- is.function(a) && (o = a.call(n, r)),
- o !== !1 && is.function(i) && i.call(n, r);
- }),
- _defineProperty$1(this, 'bind', (r, i, s, n, a = !0) => {
- const { player: o } = this,
- l = o.config.listeners[n],
- c = is.function(l);
- on.call(o, r, i, g => this.proxy(g, s, n), a && !c);
- }),
- _defineProperty$1(this, 'controls', () => {
- const { player: r } = this,
- { elements: i } = r,
- s = browser.isIE ? 'change' : 'input';
- if (
- (i.buttons.play &&
- Array.from(i.buttons.play).forEach(n => {
- this.bind(
- n,
- 'click',
- () => {
- silencePromise(r.togglePlay());
- },
- 'play'
- );
- }),
- this.bind(i.buttons.restart, 'click', r.restart, 'restart'),
- this.bind(
- i.buttons.rewind,
- 'click',
- () => {
- (r.lastSeekTime = Date.now()), r.rewind();
- },
- 'rewind'
- ),
- this.bind(
- i.buttons.fastForward,
- 'click',
- () => {
- (r.lastSeekTime = Date.now()), r.forward();
- },
- 'fastForward'
- ),
- this.bind(
- i.buttons.mute,
- 'click',
- () => {
- r.muted = !r.muted;
- },
- 'mute'
- ),
- this.bind(i.buttons.captions, 'click', () => r.toggleCaptions()),
- this.bind(
- i.buttons.download,
- 'click',
- () => {
- triggerEvent.call(r, r.media, 'download');
- },
- 'download'
- ),
- this.bind(
- i.buttons.fullscreen,
- 'click',
- () => {
- r.fullscreen.toggle();
- },
- 'fullscreen'
- ),
- this.bind(
- i.buttons.pip,
- 'click',
- () => {
- r.pip = 'toggle';
- },
- 'pip'
- ),
- this.bind(i.buttons.airplay, 'click', r.airplay, 'airplay'),
- this.bind(
- i.buttons.settings,
- 'click',
- n => {
- n.stopPropagation(),
- n.preventDefault(),
- controls$2.toggleMenu.call(r, n);
- },
- null,
- !1
- ),
- this.bind(
- i.buttons.settings,
- 'keyup',
- n => {
- [' ', 'Enter'].includes(n.key) &&
- (n.key !== 'Enter'
- ? (n.preventDefault(),
- n.stopPropagation(),
- controls$2.toggleMenu.call(r, n))
- : controls$2.focusFirstMenuItem.call(r, null, !0));
- },
- null,
- !1
- ),
- this.bind(i.settings.menu, 'keydown', n => {
- n.key === 'Escape' && controls$2.toggleMenu.call(r, n);
- }),
- this.bind(i.inputs.seek, 'mousedown mousemove', n => {
- const a = i.progress.getBoundingClientRect(),
- o = (100 / a.width) * (n.pageX - a.left);
- n.currentTarget.setAttribute('seek-value', o);
- }),
- this.bind(
- i.inputs.seek,
- 'mousedown mouseup keydown keyup touchstart touchend',
- n => {
- const a = n.currentTarget,
- o = 'play-on-seeked';
- if (
- is.keyboardEvent(n) &&
- !['ArrowLeft', 'ArrowRight'].includes(n.key)
- )
- return;
- r.lastSeekTime = Date.now();
- const l = a.hasAttribute(o),
- c = ['mouseup', 'touchend', 'keyup'].includes(n.type);
- l && c
- ? (a.removeAttribute(o), silencePromise(r.play()))
- : !c && r.playing && (a.setAttribute(o, ''), r.pause());
- }
- ),
- browser.isIos)
- ) {
- const n = getElements.call(r, 'input[type="range"]');
- Array.from(n).forEach(a => this.bind(a, s, o => repaint(o.target)));
- }
- this.bind(
- i.inputs.seek,
- s,
- n => {
- const a = n.currentTarget;
- let o = a.getAttribute('seek-value');
- is.empty(o) && (o = a.value),
- a.removeAttribute('seek-value'),
- (r.currentTime = (o / a.max) * r.duration);
- },
- 'seek'
- ),
- this.bind(i.progress, 'mouseenter mouseleave mousemove', n =>
- controls$2.updateSeekTooltip.call(r, n)
- ),
- this.bind(i.progress, 'mousemove touchmove', n => {
- const { previewThumbnails: a } = r;
- a && a.loaded && a.startMove(n);
- }),
- this.bind(i.progress, 'mouseleave touchend click', () => {
- const { previewThumbnails: n } = r;
- n && n.loaded && n.endMove(!1, !0);
- }),
- this.bind(i.progress, 'mousedown touchstart', n => {
- const { previewThumbnails: a } = r;
- a && a.loaded && a.startScrubbing(n);
- }),
- this.bind(i.progress, 'mouseup touchend', n => {
- const { previewThumbnails: a } = r;
- a && a.loaded && a.endScrubbing(n);
- }),
- browser.isWebKit &&
- Array.from(getElements.call(r, 'input[type="range"]')).forEach(
- n => {
- this.bind(n, 'input', a =>
- controls$2.updateRangeFill.call(r, a.target)
- );
- }
- ),
- r.config.toggleInvert &&
- !is.element(i.display.duration) &&
- this.bind(i.display.currentTime, 'click', () => {
- r.currentTime !== 0 &&
- ((r.config.invertTime = !r.config.invertTime),
- controls$2.timeUpdate.call(r));
- }),
- this.bind(
- i.inputs.volume,
- s,
- n => {
- r.volume = n.target.value;
- },
- 'volume'
- ),
- this.bind(i.controls, 'mouseenter mouseleave', n => {
- i.controls.hover = !r.touch && n.type === 'mouseenter';
- }),
- i.fullscreen &&
- Array.from(i.fullscreen.children)
- .filter(n => !n.contains(i.container))
- .forEach(n => {
- this.bind(n, 'mouseenter mouseleave', a => {
- i.controls &&
- (i.controls.hover = !r.touch && a.type === 'mouseenter');
- });
- }),
- this.bind(
- i.controls,
- 'mousedown mouseup touchstart touchend touchcancel',
- n => {
- i.controls.pressed = ['mousedown', 'touchstart'].includes(n.type);
- }
- ),
- this.bind(i.controls, 'focusin', () => {
- const { config: n, timers: a } = r;
- toggleClass(i.controls, n.classNames.noTransition, !0),
- ui.toggleControls.call(r, !0),
- setTimeout(() => {
- toggleClass(i.controls, n.classNames.noTransition, !1);
- }, 0);
- const o = this.touch ? 3e3 : 4e3;
- clearTimeout(a.controls),
- (a.controls = setTimeout(() => ui.toggleControls.call(r, !1), o));
- }),
- this.bind(
- i.inputs.volume,
- 'wheel',
- n => {
- const a = n.webkitDirectionInvertedFromDevice,
- [o, l] = [n.deltaX, -n.deltaY].map(S => (a ? -S : S)),
- c = Math.sign(Math.abs(o) > Math.abs(l) ? o : l);
- r.increaseVolume(c / 50);
- const { volume: g } = r.media;
- ((c === 1 && g < 1) || (c === -1 && g > 0)) && n.preventDefault();
- },
- 'volume',
- !1
- );
- }),
- (this.player = t),
- (this.lastKey = null),
- (this.focusTimer = null),
- (this.lastKeyDown = null),
- (this.handleKey = this.handleKey.bind(this)),
- (this.toggleMenu = this.toggleMenu.bind(this)),
- (this.firstTouch = this.firstTouch.bind(this));
- }
- handleKey(t) {
- const { player: r } = this,
- { elements: i } = r,
- { key: s, type: n, altKey: a, ctrlKey: o, metaKey: l, shiftKey: c } = t,
- g = n === 'keydown',
- S = g && s === this.lastKey;
- if (!(a || o || l || c) && s) {
- if (g) {
- const P = document.activeElement;
- if (is.element(P)) {
- const { editable: b } = r.config.selectors,
- { seek: y } = i.inputs;
- if (
- (P !== y && matches(P, b)) ||
- (t.key === ' ' && matches(P, 'button, [role^="menuitem"]'))
- )
- return;
- }
- switch (
- ([
- ' ',
- 'ArrowLeft',
- 'ArrowUp',
- 'ArrowRight',
- 'ArrowDown',
- '0',
- '1',
- '2',
- '3',
- '4',
- '5',
- '6',
- '7',
- '8',
- '9',
- 'c',
- 'f',
- 'k',
- 'l',
- 'm'
- ].includes(s) && (t.preventDefault(), t.stopPropagation()),
- s)
- ) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- S ||
- ((p = parseInt(s, 10)), (r.currentTime = (r.duration / 10) * p));
- break;
- case ' ':
- case 'k':
- S || silencePromise(r.togglePlay());
- break;
- case 'ArrowUp':
- r.increaseVolume(0.1);
- break;
- case 'ArrowDown':
- r.decreaseVolume(0.1);
- break;
- case 'm':
- S || (r.muted = !r.muted);
- break;
- case 'ArrowRight':
- r.forward();
- break;
- case 'ArrowLeft':
- r.rewind();
- break;
- case 'f':
- r.fullscreen.toggle();
- break;
- case 'c':
- S || r.toggleCaptions();
- break;
- case 'l':
- r.loop = !r.loop;
- }
- s === 'Escape' &&
- !r.fullscreen.usingNative &&
- r.fullscreen.active &&
- r.fullscreen.toggle(),
- (this.lastKey = s);
- } else this.lastKey = null;
- var p;
- }
- }
- toggleMenu(t) {
- controls$2.toggleMenu.call(this.player, t);
- }
- }
- function createCommonjsModule(e, t) {
- return e((t = { exports: {} }), t.exports), t.exports;
- }
- var loadjs_umd = createCommonjsModule(function (e, t) {
- e.exports = (function () {
- var r = function () {},
- i = {},
- s = {},
- n = {};
- function a(p, P) {
- p = p.push ? p : [p];
- var b,
- y,
- A,
- u = [],
- f = p.length,
- m = f;
- for (
- b = function (d, E) {
- E.length && u.push(d), --m || P(u);
- };
- f--;
- )
- (y = p[f]), (A = s[y]) ? b(y, A) : (n[y] = n[y] || []).push(b);
- }
- function o(p, P) {
- if (p) {
- var b = n[p];
- if (((s[p] = P), b)) for (; b.length; ) b[0](p, P), b.splice(0, 1);
- }
- }
- function l(p, P) {
- p.call && (p = { success: p }),
- P.length ? (p.error || r)(P) : (p.success || r)(p);
- }
- function c(p, P, b, y) {
- var A,
- u,
- f = document,
- m = b.async,
- d = (b.numRetries || 0) + 1,
- E = b.before || r,
- T = p.replace(/[\?|#].*$/, ''),
- x = p.replace(/^(css|img)!/, '');
- (y = y || 0),
- /(^css!|\.css$)/.test(T)
- ? (((u = f.createElement('link')).rel = 'stylesheet'),
- (u.href = x),
- (A = 'hideFocus' in u) &&
- u.relList &&
- ((A = 0), (u.rel = 'preload'), (u.as = 'style')))
- : /(^img!|\.(png|gif|jpg|svg|webp)$)/.test(T)
- ? ((u = f.createElement('img')).src = x)
- : (((u = f.createElement('script')).src = p),
- (u.async = m === void 0 || m)),
- (u.onload =
- u.onerror =
- u.onbeforeload =
- function (_) {
- var I = _.type[0];
- if (A)
- try {
- u.sheet.cssText.length || (I = 'e');
- } catch (V) {
- V.code != 18 && (I = 'e');
- }
- if (I == 'e') {
- if ((y += 1) < d) return c(p, P, b, y);
- } else if (u.rel == 'preload' && u.as == 'style')
- return (u.rel = 'stylesheet');
- P(p, I, _.defaultPrevented);
- }),
- E(p, u) !== !1 && f.head.appendChild(u);
- }
- function g(p, P, b) {
- var y,
- A,
- u = (p = p.push ? p : [p]).length,
- f = u,
- m = [];
- for (
- y = function (d, E, T) {
- if ((E == 'e' && m.push(d), E == 'b')) {
- if (!T) return;
- m.push(d);
- }
- --u || P(m);
- },
- A = 0;
- A < f;
- A++
- )
- c(p[A], y, b);
- }
- function S(p, P, b) {
- var y, A;
- if ((P && P.trim && (y = P), (A = (y ? b : P) || {}), y)) {
- if (y in i) throw 'LoadJS';
- i[y] = !0;
- }
- function u(f, m) {
- g(
- p,
- function (d) {
- l(A, d), f && l({ success: f, error: m }, d), o(y, d);
- },
- A
- );
- }
- if (A.returnPromise) return new Promise(u);
- u();
- }
- return (
- (S.ready = function (p, P) {
- return (
- a(p, function (b) {
- l(P, b);
- }),
- S
- );
- }),
- (S.done = function (p) {
- o(p, []);
- }),
- (S.reset = function () {
- (i = {}), (s = {}), (n = {});
- }),
- (S.isDefined = function (p) {
- return p in i;
- }),
- S
- );
- })();
- });
- function loadScript(e) {
- return new Promise((t, r) => {
- loadjs_umd(e, { success: t, error: r });
- });
- }
- function parseId$1(e) {
- return is.empty(e)
- ? null
- : is.number(Number(e))
- ? e
- : e.match(/^.*(vimeo.com\/|video\/)(\d+).*/)
- ? RegExp.$2
- : e;
- }
- function parseHash(e) {
- const t = e.match(/^.*(vimeo.com\/|video\/)(\d+)(\?.*&*h=|\/)+([\d,a-f]+)/);
- return t && t.length === 5 ? t[4] : null;
- }
- function assurePlaybackState$1(e) {
- e && !this.embed.hasPlayed && (this.embed.hasPlayed = !0),
- this.media.paused === e &&
- ((this.media.paused = !e),
- triggerEvent.call(this, this.media, e ? 'play' : 'pause'));
- }
- const vimeo = {
- setup() {
- const e = this;
- toggleClass(e.elements.wrapper, e.config.classNames.embed, !0),
- (e.options.speed = e.config.speed.options),
- setAspectRatio.call(e),
- is.object(window.Vimeo)
- ? vimeo.ready.call(e)
- : loadScript(e.config.urls.vimeo.sdk)
- .then(() => {
- vimeo.ready.call(e);
- })
- .catch(t => {
- e.debug.warn('Vimeo SDK (player.js) failed to load', t);
- });
- },
- ready() {
- const e = this,
- t = e.config.vimeo,
- { premium: r, referrerPolicy: i, ...s } = t;
- let n = e.media.getAttribute('src'),
- a = '';
- is.empty(n)
- ? ((n = e.media.getAttribute(e.config.attributes.embed.id)),
- (a = e.media.getAttribute(e.config.attributes.embed.hash)))
- : (a = parseHash(n));
- const o = a ? { h: a } : {};
- r && Object.assign(s, { controls: !1, sidedock: !1 });
- const l = buildUrlParams({
- loop: e.config.loop.active,
- autoplay: e.autoplay,
- muted: e.muted,
- gesture: 'media',
- playsinline: e.config.playsinline,
- ...o,
- ...s
- }),
- c = parseId$1(n),
- g = createElement('iframe'),
- S = format(e.config.urls.vimeo.iframe, c, l);
- if (
- (g.setAttribute('src', S),
- g.setAttribute('allowfullscreen', ''),
- g.setAttribute(
- 'allow',
- [
- 'autoplay',
- 'fullscreen',
- 'picture-in-picture',
- 'encrypted-media',
- 'accelerometer',
- 'gyroscope'
- ].join('; ')
- ),
- is.empty(i) || g.setAttribute('referrerPolicy', i),
- r || !t.customControls)
- )
- g.setAttribute('data-poster', e.poster),
- (e.media = replaceElement(g, e.media));
- else {
- const f = createElement('div', {
- class: e.config.classNames.embedContainer,
- 'data-poster': e.poster
- });
- f.appendChild(g), (e.media = replaceElement(f, e.media));
- }
- t.customControls ||
- fetch$1(format(e.config.urls.vimeo.api, S)).then(f => {
- !is.empty(f) &&
- f.thumbnail_url &&
- ui.setPoster.call(e, f.thumbnail_url).catch(() => {});
- }),
- (e.embed = new window.Vimeo.Player(g, {
- autopause: e.config.autopause,
- muted: e.muted
- })),
- (e.media.paused = !0),
- (e.media.currentTime = 0),
- e.supported.ui && e.embed.disableTextTrack(),
- (e.media.play = () => (
- assurePlaybackState$1.call(e, !0), e.embed.play()
- )),
- (e.media.pause = () => (
- assurePlaybackState$1.call(e, !1), e.embed.pause()
- )),
- (e.media.stop = () => {
- e.pause(), (e.currentTime = 0);
- });
- let { currentTime: p } = e.media;
- Object.defineProperty(e.media, 'currentTime', {
- get: () => p,
- set(f) {
- const { embed: m, media: d, paused: E, volume: T } = e,
- x = E && !m.hasPlayed;
- (d.seeking = !0),
- triggerEvent.call(e, d, 'seeking'),
- Promise.resolve(x && m.setVolume(0))
- .then(() => m.setCurrentTime(f))
- .then(() => x && m.pause())
- .then(() => x && m.setVolume(T))
- .catch(() => {});
- }
- });
- let P = e.config.speed.selected;
- Object.defineProperty(e.media, 'playbackRate', {
- get: () => P,
- set(f) {
- e.embed
- .setPlaybackRate(f)
- .then(() => {
- (P = f), triggerEvent.call(e, e.media, 'ratechange');
- })
- .catch(() => {
- e.options.speed = [1];
- });
- }
- });
- let { volume: b } = e.config;
- Object.defineProperty(e.media, 'volume', {
- get: () => b,
- set(f) {
- e.embed.setVolume(f).then(() => {
- (b = f), triggerEvent.call(e, e.media, 'volumechange');
- });
- }
- });
- let { muted: y } = e.config;
- Object.defineProperty(e.media, 'muted', {
- get: () => y,
- set(f) {
- const m = !!is.boolean(f) && f;
- e.embed.setMuted(!!m || e.config.muted).then(() => {
- (y = m), triggerEvent.call(e, e.media, 'volumechange');
- });
- }
- });
- let A,
- { loop: u } = e.config;
- Object.defineProperty(e.media, 'loop', {
- get: () => u,
- set(f) {
- const m = is.boolean(f) ? f : e.config.loop.active;
- e.embed.setLoop(m).then(() => {
- u = m;
- });
- }
- }),
- e.embed
- .getVideoUrl()
- .then(f => {
- (A = f), controls$2.setDownloadUrl.call(e);
- })
- .catch(f => {
- this.debug.warn(f);
- }),
- Object.defineProperty(e.media, 'currentSrc', { get: () => A }),
- Object.defineProperty(e.media, 'ended', {
- get: () => e.currentTime === e.duration
- }),
- Promise.all([e.embed.getVideoWidth(), e.embed.getVideoHeight()]).then(
- f => {
- const [m, d] = f;
- (e.embed.ratio = roundAspectRatio(m, d)), setAspectRatio.call(this);
- }
- ),
- e.embed.setAutopause(e.config.autopause).then(f => {
- e.config.autopause = f;
- }),
- e.embed.getVideoTitle().then(f => {
- (e.config.title = f), ui.setTitle.call(this);
- }),
- e.embed.getCurrentTime().then(f => {
- (p = f), triggerEvent.call(e, e.media, 'timeupdate');
- }),
- e.embed.getDuration().then(f => {
- (e.media.duration = f), triggerEvent.call(e, e.media, 'durationchange');
- }),
- e.embed.getTextTracks().then(f => {
- (e.media.textTracks = f), captions.setup.call(e);
- }),
- e.embed.on('cuechange', ({ cues: f = [] }) => {
- const m = f.map(d => stripHTML(d.text));
- captions.updateCues.call(e, m);
- }),
- e.embed.on('loaded', () => {
- e.embed.getPaused().then(f => {
- assurePlaybackState$1.call(e, !f),
- f || triggerEvent.call(e, e.media, 'playing');
- }),
- is.element(e.embed.element) &&
- e.supported.ui &&
- e.embed.element.setAttribute('tabindex', -1);
- }),
- e.embed.on('bufferstart', () => {
- triggerEvent.call(e, e.media, 'waiting');
- }),
- e.embed.on('bufferend', () => {
- triggerEvent.call(e, e.media, 'playing');
- }),
- e.embed.on('play', () => {
- assurePlaybackState$1.call(e, !0),
- triggerEvent.call(e, e.media, 'playing');
- }),
- e.embed.on('pause', () => {
- assurePlaybackState$1.call(e, !1);
- }),
- e.embed.on('timeupdate', f => {
- (e.media.seeking = !1),
- (p = f.seconds),
- triggerEvent.call(e, e.media, 'timeupdate');
- }),
- e.embed.on('progress', f => {
- (e.media.buffered = f.percent),
- triggerEvent.call(e, e.media, 'progress'),
- parseInt(f.percent, 10) === 1 &&
- triggerEvent.call(e, e.media, 'canplaythrough'),
- e.embed.getDuration().then(m => {
- m !== e.media.duration &&
- ((e.media.duration = m),
- triggerEvent.call(e, e.media, 'durationchange'));
- });
- }),
- e.embed.on('seeked', () => {
- (e.media.seeking = !1), triggerEvent.call(e, e.media, 'seeked');
- }),
- e.embed.on('ended', () => {
- (e.media.paused = !0), triggerEvent.call(e, e.media, 'ended');
- }),
- e.embed.on('error', f => {
- (e.media.error = f), triggerEvent.call(e, e.media, 'error');
- }),
- t.customControls && setTimeout(() => ui.build.call(e), 0);
- }
- };
- function parseId(e) {
- return is.empty(e)
- ? null
- : e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)
- ? RegExp.$2
- : e;
- }
- function assurePlaybackState(e) {
- e && !this.embed.hasPlayed && (this.embed.hasPlayed = !0),
- this.media.paused === e &&
- ((this.media.paused = !e),
- triggerEvent.call(this, this.media, e ? 'play' : 'pause'));
- }
- function getHost(e) {
- return e.noCookie
- ? 'https://www.youtube-nocookie.com'
- : window.location.protocol === 'http:'
- ? 'http://www.youtube.com'
- : void 0;
- }
- const youtube = {
- setup() {
- if (
- (toggleClass(this.elements.wrapper, this.config.classNames.embed, !0),
- is.object(window.YT) && is.function(window.YT.Player))
- )
- youtube.ready.call(this);
- else {
- const e = window.onYouTubeIframeAPIReady;
- (window.onYouTubeIframeAPIReady = () => {
- is.function(e) && e(), youtube.ready.call(this);
- }),
- loadScript(this.config.urls.youtube.sdk).catch(t => {
- this.debug.warn('YouTube API failed to load', t);
- });
- }
- },
- getTitle(e) {
- fetch$1(format(this.config.urls.youtube.api, e))
- .then(t => {
- if (is.object(t)) {
- const { title: r, height: i, width: s } = t;
- (this.config.title = r),
- ui.setTitle.call(this),
- (this.embed.ratio = roundAspectRatio(s, i));
- }
- setAspectRatio.call(this);
- })
- .catch(() => {
- setAspectRatio.call(this);
- });
- },
- ready() {
- const e = this,
- t = e.config.youtube,
- r = e.media && e.media.getAttribute('id');
- if (!is.empty(r) && r.startsWith('youtube-')) return;
- let i = e.media.getAttribute('src');
- is.empty(i) &&
- (i = e.media.getAttribute(this.config.attributes.embed.id));
- const s = parseId(i),
- n = createElement('div', {
- id: generateId(e.provider),
- 'data-poster': t.customControls ? e.poster : void 0
- });
- if (((e.media = replaceElement(n, e.media)), t.customControls)) {
- const a = o => `https://i.ytimg.com/vi/${s}/${o}default.jpg`;
- loadImage(a('maxres'), 121)
- .catch(() => loadImage(a('sd'), 121))
- .catch(() => loadImage(a('hq')))
- .then(o => ui.setPoster.call(e, o.src))
- .then(o => {
- o.includes('maxres') ||
- (e.elements.poster.style.backgroundSize = 'cover');
- })
- .catch(() => {});
- }
- e.embed = new window.YT.Player(e.media, {
- videoId: s,
- host: getHost(t),
- playerVars: extend(
- {},
- {
- autoplay: e.config.autoplay ? 1 : 0,
- hl: e.config.hl,
- controls: e.supported.ui && t.customControls ? 0 : 1,
- disablekb: 1,
- playsinline:
- e.config.playsinline && !e.config.fullscreen.iosNative ? 1 : 0,
- cc_load_policy: e.captions.active ? 1 : 0,
- cc_lang_pref: e.config.captions.language,
- widget_referrer: window ? window.location.href : null
- },
- t
- ),
- events: {
- onError(a) {
- if (!e.media.error) {
- const o = a.data,
- l =
- {
- 2: 'The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.',
- 5: 'The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.',
- 100: 'The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.',
- 101: 'The owner of the requested video does not allow it to be played in embedded players.',
- 150: 'The owner of the requested video does not allow it to be played in embedded players.'
- }[o] || 'An unknown error occurred';
- (e.media.error = { code: o, message: l }),
- triggerEvent.call(e, e.media, 'error');
- }
- },
- onPlaybackRateChange(a) {
- const o = a.target;
- (e.media.playbackRate = o.getPlaybackRate()),
- triggerEvent.call(e, e.media, 'ratechange');
- },
- onReady(a) {
- if (is.function(e.media.play)) return;
- const o = a.target;
- youtube.getTitle.call(e, s),
- (e.media.play = () => {
- assurePlaybackState.call(e, !0), o.playVideo();
- }),
- (e.media.pause = () => {
- assurePlaybackState.call(e, !1), o.pauseVideo();
- }),
- (e.media.stop = () => {
- o.stopVideo();
- }),
- (e.media.duration = o.getDuration()),
- (e.media.paused = !0),
- (e.media.currentTime = 0),
- Object.defineProperty(e.media, 'currentTime', {
- get: () => Number(o.getCurrentTime()),
- set(S) {
- e.paused && !e.embed.hasPlayed && e.embed.mute(),
- (e.media.seeking = !0),
- triggerEvent.call(e, e.media, 'seeking'),
- o.seekTo(S);
- }
- }),
- Object.defineProperty(e.media, 'playbackRate', {
- get: () => o.getPlaybackRate(),
- set(S) {
- o.setPlaybackRate(S);
- }
- });
- let { volume: l } = e.config;
- Object.defineProperty(e.media, 'volume', {
- get: () => l,
- set(S) {
- (l = S),
- o.setVolume(100 * l),
- triggerEvent.call(e, e.media, 'volumechange');
- }
- });
- let { muted: c } = e.config;
- Object.defineProperty(e.media, 'muted', {
- get: () => c,
- set(S) {
- const p = is.boolean(S) ? S : c;
- (c = p),
- o[p ? 'mute' : 'unMute'](),
- o.setVolume(100 * l),
- triggerEvent.call(e, e.media, 'volumechange');
- }
- }),
- Object.defineProperty(e.media, 'currentSrc', {
- get: () => o.getVideoUrl()
- }),
- Object.defineProperty(e.media, 'ended', {
- get: () => e.currentTime === e.duration
- });
- const g = o.getAvailablePlaybackRates();
- (e.options.speed = g.filter(S =>
- e.config.speed.options.includes(S)
- )),
- e.supported.ui &&
- t.customControls &&
- e.media.setAttribute('tabindex', -1),
- triggerEvent.call(e, e.media, 'timeupdate'),
- triggerEvent.call(e, e.media, 'durationchange'),
- clearInterval(e.timers.buffering),
- (e.timers.buffering = setInterval(() => {
- (e.media.buffered = o.getVideoLoadedFraction()),
- (e.media.lastBuffered === null ||
- e.media.lastBuffered < e.media.buffered) &&
- triggerEvent.call(e, e.media, 'progress'),
- (e.media.lastBuffered = e.media.buffered),
- e.media.buffered === 1 &&
- (clearInterval(e.timers.buffering),
- triggerEvent.call(e, e.media, 'canplaythrough'));
- }, 200)),
- t.customControls && setTimeout(() => ui.build.call(e), 50);
- },
- onStateChange(a) {
- const o = a.target;
- switch (
- (clearInterval(e.timers.playing),
- e.media.seeking &&
- [1, 2].includes(a.data) &&
- ((e.media.seeking = !1),
- triggerEvent.call(e, e.media, 'seeked')),
- a.data)
- ) {
- case -1:
- triggerEvent.call(e, e.media, 'timeupdate'),
- (e.media.buffered = o.getVideoLoadedFraction()),
- triggerEvent.call(e, e.media, 'progress');
- break;
- case 0:
- assurePlaybackState.call(e, !1),
- e.media.loop
- ? (o.stopVideo(), o.playVideo())
- : triggerEvent.call(e, e.media, 'ended');
- break;
- case 1:
- t.customControls &&
- !e.config.autoplay &&
- e.media.paused &&
- !e.embed.hasPlayed
- ? e.media.pause()
- : (assurePlaybackState.call(e, !0),
- triggerEvent.call(e, e.media, 'playing'),
- (e.timers.playing = setInterval(() => {
- triggerEvent.call(e, e.media, 'timeupdate');
- }, 50)),
- e.media.duration !== o.getDuration() &&
- ((e.media.duration = o.getDuration()),
- triggerEvent.call(e, e.media, 'durationchange')));
- break;
- case 2:
- e.muted || e.embed.unMute(), assurePlaybackState.call(e, !1);
- break;
- case 3:
- triggerEvent.call(e, e.media, 'waiting');
- }
- triggerEvent.call(e, e.elements.container, 'statechange', !1, {
- code: a.data
- });
- }
- }
- });
- }
- },
- media = {
- setup() {
- this.media
- ? (toggleClass(
- this.elements.container,
- this.config.classNames.type.replace('{0}', this.type),
- !0
- ),
- toggleClass(
- this.elements.container,
- this.config.classNames.provider.replace('{0}', this.provider),
- !0
- ),
- this.isEmbed &&
- toggleClass(
- this.elements.container,
- this.config.classNames.type.replace('{0}', 'video'),
- !0
- ),
- this.isVideo &&
- ((this.elements.wrapper = createElement('div', {
- class: this.config.classNames.video
- })),
- wrap(this.media, this.elements.wrapper),
- (this.elements.poster = createElement('div', {
- class: this.config.classNames.poster
- })),
- this.elements.wrapper.appendChild(this.elements.poster)),
- this.isHTML5
- ? html5.setup.call(this)
- : this.isYouTube
- ? youtube.setup.call(this)
- : this.isVimeo && vimeo.setup.call(this))
- : this.debug.warn('No media element found!');
- }
- };
- class Ads {
- constructor(t) {
- _defineProperty$1(this, 'load', () => {
- this.enabled &&
- (is.object(window.google) && is.object(window.google.ima)
- ? this.ready()
- : loadScript(this.player.config.urls.googleIMA.sdk)
- .then(() => {
- this.ready();
- })
- .catch(() => {
- this.trigger(
- 'error',
- new Error('Google IMA SDK failed to load')
- );
- }));
- }),
- _defineProperty$1(this, 'ready', () => {
- var r;
- this.enabled ||
- ((r = this).manager && r.manager.destroy(),
- r.elements.displayContainer && r.elements.displayContainer.destroy(),
- r.elements.container.remove()),
- this.startSafetyTimer(12e3, 'ready()'),
- this.managerPromise.then(() => {
- this.clearSafetyTimer('onAdsManagerLoaded()');
- }),
- this.listeners(),
- this.setupIMA();
- }),
- _defineProperty$1(this, 'setupIMA', () => {
- (this.elements.container = createElement('div', {
- class: this.player.config.classNames.ads
- })),
- this.player.elements.container.appendChild(this.elements.container),
- google.ima.settings.setVpaidMode(
- google.ima.ImaSdkSettings.VpaidMode.ENABLED
- ),
- google.ima.settings.setLocale(this.player.config.ads.language),
- google.ima.settings.setDisableCustomPlaybackForIOS10Plus(
- this.player.config.playsinline
- ),
- (this.elements.displayContainer = new google.ima.AdDisplayContainer(
- this.elements.container,
- this.player.media
- )),
- (this.loader = new google.ima.AdsLoader(
- this.elements.displayContainer
- )),
- this.loader.addEventListener(
- google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
- r => this.onAdsManagerLoaded(r),
- !1
- ),
- this.loader.addEventListener(
- google.ima.AdErrorEvent.Type.AD_ERROR,
- r => this.onAdError(r),
- !1
- ),
- this.requestAds();
- }),
- _defineProperty$1(this, 'requestAds', () => {
- const { container: r } = this.player.elements;
- try {
- const i = new google.ima.AdsRequest();
- (i.adTagUrl = this.tagUrl),
- (i.linearAdSlotWidth = r.offsetWidth),
- (i.linearAdSlotHeight = r.offsetHeight),
- (i.nonLinearAdSlotWidth = r.offsetWidth),
- (i.nonLinearAdSlotHeight = r.offsetHeight),
- (i.forceNonLinearFullSlot = !1),
- i.setAdWillPlayMuted(!this.player.muted),
- this.loader.requestAds(i);
- } catch (i) {
- this.onAdError(i);
- }
- }),
- _defineProperty$1(this, 'pollCountdown', (r = !1) => {
- if (!r)
- return (
- clearInterval(this.countdownTimer),
- void this.elements.container.removeAttribute('data-badge-text')
- );
- this.countdownTimer = setInterval(() => {
- const i = formatTime(Math.max(this.manager.getRemainingTime(), 0)),
- s = `${i18n.get('advertisement', this.player.config)} - ${i}`;
- this.elements.container.setAttribute('data-badge-text', s);
- }, 100);
- }),
- _defineProperty$1(this, 'onAdsManagerLoaded', r => {
- if (!this.enabled) return;
- const i = new google.ima.AdsRenderingSettings();
- (i.restoreCustomPlaybackStateOnAdBreakComplete = !0),
- (i.enablePreloading = !0),
- (this.manager = r.getAdsManager(this.player, i)),
- (this.cuePoints = this.manager.getCuePoints()),
- this.manager.addEventListener(
- google.ima.AdErrorEvent.Type.AD_ERROR,
- s => this.onAdError(s)
- ),
- Object.keys(google.ima.AdEvent.Type).forEach(s => {
- this.manager.addEventListener(google.ima.AdEvent.Type[s], n =>
- this.onAdEvent(n)
- );
- }),
- this.trigger('loaded');
- }),
- _defineProperty$1(this, 'addCuePoints', () => {
- is.empty(this.cuePoints) ||
- this.cuePoints.forEach(r => {
- if (r !== 0 && r !== -1 && r < this.player.duration) {
- const i = this.player.elements.progress;
- if (is.element(i)) {
- const s = (100 / this.player.duration) * r,
- n = createElement('span', {
- class: this.player.config.classNames.cues
- });
- (n.style.left = `${s.toString()}%`), i.appendChild(n);
- }
- }
- });
- }),
- _defineProperty$1(this, 'onAdEvent', r => {
- const { container: i } = this.player.elements,
- s = r.getAd(),
- n = r.getAdData();
- switch (
- ((a => {
- triggerEvent.call(
- this.player,
- this.player.media,
- `ads${a.replace(/_/g, '').toLowerCase()}`
- );
- })(r.type),
- r.type)
- ) {
- case google.ima.AdEvent.Type.LOADED:
- this.trigger('loaded'),
- this.pollCountdown(!0),
- s.isLinear() ||
- ((s.width = i.offsetWidth), (s.height = i.offsetHeight));
- break;
- case google.ima.AdEvent.Type.STARTED:
- this.manager.setVolume(this.player.volume);
- break;
- case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:
- this.player.ended ? this.loadAds() : this.loader.contentComplete();
- break;
- case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:
- this.pauseContent();
- break;
- case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:
- this.pollCountdown(), this.resumeContent();
- break;
- case google.ima.AdEvent.Type.LOG:
- n.adError &&
- this.player.debug.warn(
- `Non-fatal ad error: ${n.adError.getMessage()}`
- );
- }
- }),
- _defineProperty$1(this, 'onAdError', r => {
- this.cancel(), this.player.debug.warn('Ads error', r);
- }),
- _defineProperty$1(this, 'listeners', () => {
- const { container: r } = this.player.elements;
- let i;
- this.player.on('canplay', () => {
- this.addCuePoints();
- }),
- this.player.on('ended', () => {
- this.loader.contentComplete();
- }),
- this.player.on('timeupdate', () => {
- i = this.player.currentTime;
- }),
- this.player.on('seeked', () => {
- const s = this.player.currentTime;
- is.empty(this.cuePoints) ||
- this.cuePoints.forEach((n, a) => {
- i < n &&
- n < s &&
- (this.manager.discardAdBreak(), this.cuePoints.splice(a, 1));
- });
- }),
- window.addEventListener('resize', () => {
- this.manager &&
- this.manager.resize(
- r.offsetWidth,
- r.offsetHeight,
- google.ima.ViewMode.NORMAL
- );
- });
- }),
- _defineProperty$1(this, 'play', () => {
- const { container: r } = this.player.elements;
- this.managerPromise || this.resumeContent(),
- this.managerPromise
- .then(() => {
- this.manager.setVolume(this.player.volume),
- this.elements.displayContainer.initialize();
- try {
- this.initialized ||
- (this.manager.init(
- r.offsetWidth,
- r.offsetHeight,
- google.ima.ViewMode.NORMAL
- ),
- this.manager.start()),
- (this.initialized = !0);
- } catch (i) {
- this.onAdError(i);
- }
- })
- .catch(() => {});
- }),
- _defineProperty$1(this, 'resumeContent', () => {
- (this.elements.container.style.zIndex = ''),
- (this.playing = !1),
- silencePromise(this.player.media.play());
- }),
- _defineProperty$1(this, 'pauseContent', () => {
- (this.elements.container.style.zIndex = 3),
- (this.playing = !0),
- this.player.media.pause();
- }),
- _defineProperty$1(this, 'cancel', () => {
- this.initialized && this.resumeContent(),
- this.trigger('error'),
- this.loadAds();
- }),
- _defineProperty$1(this, 'loadAds', () => {
- this.managerPromise
- .then(() => {
- this.manager && this.manager.destroy(),
- (this.managerPromise = new Promise(r => {
- this.on('loaded', r), this.player.debug.log(this.manager);
- })),
- (this.initialized = !1),
- this.requestAds();
- })
- .catch(() => {});
- }),
- _defineProperty$1(this, 'trigger', (r, ...i) => {
- const s = this.events[r];
- is.array(s) &&
- s.forEach(n => {
- is.function(n) && n.apply(this, i);
- });
- }),
- _defineProperty$1(
- this,
- 'on',
- (r, i) => (
- is.array(this.events[r]) || (this.events[r] = []),
- this.events[r].push(i),
- this
- )
- ),
- _defineProperty$1(this, 'startSafetyTimer', (r, i) => {
- this.player.debug.log(`Safety timer invoked from: ${i}`),
- (this.safetyTimer = setTimeout(() => {
- this.cancel(), this.clearSafetyTimer('startSafetyTimer()');
- }, r));
- }),
- _defineProperty$1(this, 'clearSafetyTimer', r => {
- is.nullOrUndefined(this.safetyTimer) ||
- (this.player.debug.log(`Safety timer cleared from: ${r}`),
- clearTimeout(this.safetyTimer),
- (this.safetyTimer = null));
- }),
- (this.player = t),
- (this.config = t.config.ads),
- (this.playing = !1),
- (this.initialized = !1),
- (this.elements = { container: null, displayContainer: null }),
- (this.manager = null),
- (this.loader = null),
- (this.cuePoints = null),
- (this.events = {}),
- (this.safetyTimer = null),
- (this.countdownTimer = null),
- (this.managerPromise = new Promise((r, i) => {
- this.on('loaded', r), this.on('error', i);
- })),
- this.load();
- }
- get enabled() {
- const { config: t } = this;
- return (
- this.player.isHTML5 &&
- this.player.isVideo &&
- t.enabled &&
- (!is.empty(t.publisherId) || is.url(t.tagUrl))
- );
- }
- get tagUrl() {
- const { config: t } = this;
- return is.url(t.tagUrl)
- ? t.tagUrl
- : `https://go.aniview.com/api/adserver6/vast/?${buildUrlParams({
- AV_PUBLISHERID: '58c25bb0073ef448b1087ad6',
- AV_CHANNELID: '5a0458dc28a06145e4519d21',
- AV_URL: window.location.hostname,
- cb: Date.now(),
- AV_WIDTH: 640,
- AV_HEIGHT: 480,
- AV_CDIM2: t.publisherId
- })}`;
- }
- }
- function clamp(e = 0, t = 0, r = 255) {
- return Math.min(Math.max(e, t), r);
- }
- const parseVtt = e => {
- const t = [];
- return (
- e.split(/\r\n\r\n|\n\n|\r\r/).forEach(r => {
- const i = {};
- r.split(/\r\n|\n|\r/).forEach(s => {
- if (is.number(i.startTime)) {
- if (!is.empty(s.trim()) && is.empty(i.text)) {
- const n = s.trim().split('#xywh=');
- ([i.text] = n), n[1] && ([i.x, i.y, i.w, i.h] = n[1].split(','));
- }
- } else {
- const n = s.match(
- /([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/
- );
- n &&
- ((i.startTime =
- 60 * Number(n[1] || 0) * 60 +
- 60 * Number(n[2]) +
- Number(n[3]) +
- +`0.${n[4]}`),
- (i.endTime =
- 60 * Number(n[6] || 0) * 60 +
- 60 * Number(n[7]) +
- Number(n[8]) +
- +`0.${n[9]}`));
- }
- }),
- i.text && t.push(i);
- }),
- t
- );
- },
- fitRatio = (e, t) => {
- const r = {};
- return (
- e > t.width / t.height
- ? ((r.width = t.width), (r.height = (1 / e) * t.width))
- : ((r.height = t.height), (r.width = e * t.height)),
- r
- );
- };
- class PreviewThumbnails {
- constructor(t) {
- _defineProperty$1(this, 'load', () => {
- this.player.elements.display.seekTooltip &&
- (this.player.elements.display.seekTooltip.hidden = this.enabled),
- this.enabled &&
- this.getThumbnails().then(() => {
- this.enabled &&
- (this.render(),
- this.determineContainerAutoSizing(),
- this.listeners(),
- (this.loaded = !0));
- });
- }),
- _defineProperty$1(
- this,
- 'getThumbnails',
- () =>
- new Promise(r => {
- const { src: i } = this.player.config.previewThumbnails;
- if (is.empty(i))
- throw new Error('Missing previewThumbnails.src config attribute');
- const s = () => {
- this.thumbnails.sort((n, a) => n.height - a.height),
- this.player.debug.log('Preview thumbnails', this.thumbnails),
- r();
- };
- if (is.function(i))
- i(n => {
- (this.thumbnails = n), s();
- });
- else {
- const n = (is.string(i) ? [i] : i).map(a => this.getThumbnail(a));
- Promise.all(n).then(s);
- }
- })
- ),
- _defineProperty$1(
- this,
- 'getThumbnail',
- r =>
- new Promise(i => {
- fetch$1(r).then(s => {
- const n = { frames: parseVtt(s), height: null, urlPrefix: '' };
- n.frames[0].text.startsWith('/') ||
- n.frames[0].text.startsWith('http://') ||
- n.frames[0].text.startsWith('https://') ||
- (n.urlPrefix = r.substring(0, r.lastIndexOf('/') + 1));
- const a = new Image();
- (a.onload = () => {
- (n.height = a.naturalHeight),
- (n.width = a.naturalWidth),
- this.thumbnails.push(n),
- i();
- }),
- (a.src = n.urlPrefix + n.frames[0].text);
- });
- })
- ),
- _defineProperty$1(this, 'startMove', r => {
- if (
- this.loaded &&
- is.event(r) &&
- ['touchmove', 'mousemove'].includes(r.type) &&
- this.player.media.duration
- ) {
- if (r.type === 'touchmove')
- this.seekTime =
- this.player.media.duration *
- (this.player.elements.inputs.seek.value / 100);
- else {
- var i, s;
- const n = this.player.elements.progress.getBoundingClientRect(),
- a = (100 / n.width) * (r.pageX - n.left);
- (this.seekTime = this.player.media.duration * (a / 100)),
- this.seekTime < 0 && (this.seekTime = 0),
- this.seekTime > this.player.media.duration - 1 &&
- (this.seekTime = this.player.media.duration - 1),
- (this.mousePosX = r.pageX),
- (this.elements.thumb.time.innerText = formatTime(this.seekTime));
- const o =
- (i = this.player.config.markers) === null ||
- i === void 0 ||
- (s = i.points) === null ||
- s === void 0
- ? void 0
- : s.find(({ time: l }) => l === Math.round(this.seekTime));
- o &&
- this.elements.thumb.time.insertAdjacentHTML(
- 'afterbegin',
- `${o.label}<br>`
- );
- }
- this.showImageAtCurrentTime();
- }
- }),
- _defineProperty$1(this, 'endMove', () => {
- this.toggleThumbContainer(!1, !0);
- }),
- _defineProperty$1(this, 'startScrubbing', r => {
- (is.nullOrUndefined(r.button) || r.button === !1 || r.button === 0) &&
- ((this.mouseDown = !0),
- this.player.media.duration &&
- (this.toggleScrubbingContainer(!0),
- this.toggleThumbContainer(!1, !0),
- this.showImageAtCurrentTime()));
- }),
- _defineProperty$1(this, 'endScrubbing', () => {
- (this.mouseDown = !1),
- Math.ceil(this.lastTime) === Math.ceil(this.player.media.currentTime)
- ? this.toggleScrubbingContainer(!1)
- : once.call(this.player, this.player.media, 'timeupdate', () => {
- this.mouseDown || this.toggleScrubbingContainer(!1);
- });
- }),
- _defineProperty$1(this, 'listeners', () => {
- this.player.on('play', () => {
- this.toggleThumbContainer(!1, !0);
- }),
- this.player.on('seeked', () => {
- this.toggleThumbContainer(!1);
- }),
- this.player.on('timeupdate', () => {
- this.lastTime = this.player.media.currentTime;
- });
- }),
- _defineProperty$1(this, 'render', () => {
- (this.elements.thumb.container = createElement('div', {
- class: this.player.config.classNames.previewThumbnails.thumbContainer
- })),
- (this.elements.thumb.imageContainer = createElement('div', {
- class:
- this.player.config.classNames.previewThumbnails.imageContainer
- })),
- this.elements.thumb.container.appendChild(
- this.elements.thumb.imageContainer
- );
- const r = createElement('div', {
- class: this.player.config.classNames.previewThumbnails.timeContainer
- });
- (this.elements.thumb.time = createElement('span', {}, '00:00')),
- r.appendChild(this.elements.thumb.time),
- this.elements.thumb.imageContainer.appendChild(r),
- is.element(this.player.elements.progress) &&
- this.player.elements.progress.appendChild(
- this.elements.thumb.container
- ),
- (this.elements.scrubbing.container = createElement('div', {
- class:
- this.player.config.classNames.previewThumbnails.scrubbingContainer
- })),
- this.player.elements.wrapper.appendChild(
- this.elements.scrubbing.container
- );
- }),
- _defineProperty$1(this, 'destroy', () => {
- this.elements.thumb.container && this.elements.thumb.container.remove(),
- this.elements.scrubbing.container &&
- this.elements.scrubbing.container.remove();
- }),
- _defineProperty$1(this, 'showImageAtCurrentTime', () => {
- this.mouseDown
- ? this.setScrubbingContainerSize()
- : this.setThumbContainerSizeAndPos();
- const r = this.thumbnails[0].frames.findIndex(
- n => this.seekTime >= n.startTime && this.seekTime <= n.endTime
- ),
- i = r >= 0;
- let s = 0;
- this.mouseDown || this.toggleThumbContainer(i),
- i &&
- (this.thumbnails.forEach((n, a) => {
- this.loadedImages.includes(n.frames[r].text) && (s = a);
- }),
- r !== this.showingThumb &&
- ((this.showingThumb = r), this.loadImage(s)));
- }),
- _defineProperty$1(this, 'loadImage', (r = 0) => {
- const i = this.showingThumb,
- s = this.thumbnails[r],
- { urlPrefix: n } = s,
- a = s.frames[i],
- o = s.frames[i].text,
- l = n + o;
- if (
- this.currentImageElement &&
- this.currentImageElement.dataset.filename === o
- )
- this.showImage(this.currentImageElement, a, r, i, o, !1),
- (this.currentImageElement.dataset.index = i),
- this.removeOldImages(this.currentImageElement);
- else {
- this.loadingImage &&
- this.usingSprites &&
- (this.loadingImage.onload = null);
- const c = new Image();
- (c.src = l),
- (c.dataset.index = i),
- (c.dataset.filename = o),
- (this.showingThumbFilename = o),
- this.player.debug.log(`Loading image: ${l}`),
- (c.onload = () => this.showImage(c, a, r, i, o, !0)),
- (this.loadingImage = c),
- this.removeOldImages(c);
- }
- }),
- _defineProperty$1(this, 'showImage', (r, i, s, n, a, o = !0) => {
- this.player.debug.log(
- `Showing thumb: ${a}. num: ${n}. qual: ${s}. newimg: ${o}`
- ),
- this.setImageSizeAndOffset(r, i),
- o &&
- (this.currentImageContainer.appendChild(r),
- (this.currentImageElement = r),
- this.loadedImages.includes(a) || this.loadedImages.push(a)),
- this.preloadNearby(n, !0)
- .then(this.preloadNearby(n, !1))
- .then(this.getHigherQuality(s, r, i, a));
- }),
- _defineProperty$1(this, 'removeOldImages', r => {
- Array.from(this.currentImageContainer.children).forEach(i => {
- if (i.tagName.toLowerCase() !== 'img') return;
- const s = this.usingSprites ? 500 : 1e3;
- if (i.dataset.index !== r.dataset.index && !i.dataset.deleting) {
- i.dataset.deleting = !0;
- const { currentImageContainer: n } = this;
- setTimeout(() => {
- n.removeChild(i),
- this.player.debug.log(`Removing thumb: ${i.dataset.filename}`);
- }, s);
- }
- });
- }),
- _defineProperty$1(
- this,
- 'preloadNearby',
- (r, i = !0) =>
- new Promise(s => {
- setTimeout(() => {
- const n = this.thumbnails[0].frames[r].text;
- if (this.showingThumbFilename === n) {
- let a;
- a = i
- ? this.thumbnails[0].frames.slice(r)
- : this.thumbnails[0].frames.slice(0, r).reverse();
- let o = !1;
- a.forEach(l => {
- const c = l.text;
- if (c !== n && !this.loadedImages.includes(c)) {
- (o = !0),
- this.player.debug.log(`Preloading thumb filename: ${c}`);
- const { urlPrefix: g } = this.thumbnails[0],
- S = g + c,
- p = new Image();
- (p.src = S),
- (p.onload = () => {
- this.player.debug.log(`Preloaded thumb filename: ${c}`),
- this.loadedImages.includes(c) ||
- this.loadedImages.push(c),
- s();
- });
- }
- }),
- o || s();
- }
- }, 300);
- })
- ),
- _defineProperty$1(this, 'getHigherQuality', (r, i, s, n) => {
- if (r < this.thumbnails.length - 1) {
- let a = i.naturalHeight;
- this.usingSprites && (a = s.h),
- a < this.thumbContainerHeight &&
- setTimeout(() => {
- this.showingThumbFilename === n &&
- (this.player.debug.log(
- `Showing higher quality thumb for: ${n}`
- ),
- this.loadImage(r + 1));
- }, 300);
- }
- }),
- _defineProperty$1(this, 'toggleThumbContainer', (r = !1, i = !1) => {
- const s =
- this.player.config.classNames.previewThumbnails.thumbContainerShown;
- this.elements.thumb.container.classList.toggle(s, r),
- !r &&
- i &&
- ((this.showingThumb = null), (this.showingThumbFilename = null));
- }),
- _defineProperty$1(this, 'toggleScrubbingContainer', (r = !1) => {
- const i =
- this.player.config.classNames.previewThumbnails
- .scrubbingContainerShown;
- this.elements.scrubbing.container.classList.toggle(i, r),
- r || ((this.showingThumb = null), (this.showingThumbFilename = null));
- }),
- _defineProperty$1(this, 'determineContainerAutoSizing', () => {
- (this.elements.thumb.imageContainer.clientHeight > 20 ||
- this.elements.thumb.imageContainer.clientWidth > 20) &&
- (this.sizeSpecifiedInCSS = !0);
- }),
- _defineProperty$1(this, 'setThumbContainerSizeAndPos', () => {
- const { imageContainer: r } = this.elements.thumb;
- if (this.sizeSpecifiedInCSS) {
- if (r.clientHeight > 20 && r.clientWidth < 20) {
- const i = Math.floor(r.clientHeight * this.thumbAspectRatio);
- r.style.width = `${i}px`;
- } else if (r.clientHeight < 20 && r.clientWidth > 20) {
- const i = Math.floor(r.clientWidth / this.thumbAspectRatio);
- r.style.height = `${i}px`;
- }
- } else {
- const i = Math.floor(
- this.thumbContainerHeight * this.thumbAspectRatio
- );
- (r.style.height = `${this.thumbContainerHeight}px`),
- (r.style.width = `${i}px`);
- }
- this.setThumbContainerPos();
- }),
- _defineProperty$1(this, 'setThumbContainerPos', () => {
- const r = this.player.elements.progress.getBoundingClientRect(),
- i = this.player.elements.container.getBoundingClientRect(),
- { container: s } = this.elements.thumb,
- n = i.left - r.left + 10,
- a = i.right - r.left - s.clientWidth - 10,
- o = this.mousePosX - r.left - s.clientWidth / 2,
- l = clamp(o, n, a);
- (s.style.left = `${l}px`),
- s.style.setProperty('--preview-arrow-offset', o - l + 'px');
- }),
- _defineProperty$1(this, 'setScrubbingContainerSize', () => {
- const { width: r, height: i } = fitRatio(this.thumbAspectRatio, {
- width: this.player.media.clientWidth,
- height: this.player.media.clientHeight
- });
- (this.elements.scrubbing.container.style.width = `${r}px`),
- (this.elements.scrubbing.container.style.height = `${i}px`);
- }),
- _defineProperty$1(this, 'setImageSizeAndOffset', (r, i) => {
- if (!this.usingSprites) return;
- const s = this.thumbContainerHeight / i.h;
- (r.style.height = r.naturalHeight * s + 'px'),
- (r.style.width = r.naturalWidth * s + 'px'),
- (r.style.left = `-${i.x * s}px`),
- (r.style.top = `-${i.y * s}px`);
- }),
- (this.player = t),
- (this.thumbnails = []),
- (this.loaded = !1),
- (this.lastMouseMoveTime = Date.now()),
- (this.mouseDown = !1),
- (this.loadedImages = []),
- (this.elements = { thumb: {}, scrubbing: {} }),
- this.load();
- }
- get enabled() {
- return (
- this.player.isHTML5 &&
- this.player.isVideo &&
- this.player.config.previewThumbnails.enabled
- );
- }
- get currentImageContainer() {
- return this.mouseDown
- ? this.elements.scrubbing.container
- : this.elements.thumb.imageContainer;
- }
- get usingSprites() {
- return Object.keys(this.thumbnails[0].frames[0]).includes('w');
- }
- get thumbAspectRatio() {
- return this.usingSprites
- ? this.thumbnails[0].frames[0].w / this.thumbnails[0].frames[0].h
- : this.thumbnails[0].width / this.thumbnails[0].height;
- }
- get thumbContainerHeight() {
- if (this.mouseDown) {
- const { height: t } = fitRatio(this.thumbAspectRatio, {
- width: this.player.media.clientWidth,
- height: this.player.media.clientHeight
- });
- return t;
- }
- return this.sizeSpecifiedInCSS
- ? this.elements.thumb.imageContainer.clientHeight
- : Math.floor(this.player.media.clientWidth / this.thumbAspectRatio / 4);
- }
- get currentImageElement() {
- return this.mouseDown
- ? this.currentScrubbingImageElement
- : this.currentThumbnailImageElement;
- }
- set currentImageElement(t) {
- this.mouseDown
- ? (this.currentScrubbingImageElement = t)
- : (this.currentThumbnailImageElement = t);
- }
- }
- const source = {
- insertElements(e, t) {
- is.string(t)
- ? insertElement(e, this.media, { src: t })
- : is.array(t) &&
- t.forEach(r => {
- insertElement(e, this.media, r);
- });
- },
- change(e) {
- getDeep(e, 'sources.length')
- ? (html5.cancelRequests.call(this),
- this.destroy.call(
- this,
- () => {
- (this.options.quality = []),
- removeElement(this.media),
- (this.media = null),
- is.element(this.elements.container) &&
- this.elements.container.removeAttribute('class');
- const { sources: t, type: r } = e,
- [{ provider: i = providers.html5, src: s }] = t,
- n = i === 'html5' ? r : 'div',
- a = i === 'html5' ? {} : { src: s };
- Object.assign(this, {
- provider: i,
- type: r,
- supported: support.check(r, i, this.config.playsinline),
- media: createElement(n, a)
- }),
- this.elements.container.appendChild(this.media),
- is.boolean(e.autoplay) && (this.config.autoplay = e.autoplay),
- this.isHTML5 &&
- (this.config.crossorigin &&
- this.media.setAttribute('crossorigin', ''),
- this.config.autoplay && this.media.setAttribute('autoplay', ''),
- is.empty(e.poster) || (this.poster = e.poster),
- this.config.loop.active && this.media.setAttribute('loop', ''),
- this.config.muted && this.media.setAttribute('muted', ''),
- this.config.playsinline &&
- this.media.setAttribute('playsinline', '')),
- ui.addStyleHook.call(this),
- this.isHTML5 && source.insertElements.call(this, 'source', t),
- (this.config.title = e.title),
- media.setup.call(this),
- this.isHTML5 &&
- Object.keys(e).includes('tracks') &&
- source.insertElements.call(this, 'track', e.tracks),
- (this.isHTML5 || (this.isEmbed && !this.supported.ui)) &&
- ui.build.call(this),
- this.isHTML5 && this.media.load(),
- is.empty(e.previewThumbnails) ||
- (Object.assign(
- this.config.previewThumbnails,
- e.previewThumbnails
- ),
- this.previewThumbnails &&
- this.previewThumbnails.loaded &&
- (this.previewThumbnails.destroy(),
- (this.previewThumbnails = null)),
- this.config.previewThumbnails.enabled &&
- (this.previewThumbnails = new PreviewThumbnails(this))),
- this.fullscreen.update();
- },
- !0
- ))
- : this.debug.warn('Invalid source format');
- }
- };
- class Plyr {
- constructor(t, r) {
- if (
- (_defineProperty$1(this, 'play', () =>
- is.function(this.media.play)
- ? (this.ads &&
- this.ads.enabled &&
- this.ads.managerPromise
- .then(() => this.ads.play())
- .catch(() => silencePromise(this.media.play())),
- this.media.play())
- : null
- ),
- _defineProperty$1(this, 'pause', () =>
- this.playing && is.function(this.media.pause)
- ? this.media.pause()
- : null
- ),
- _defineProperty$1(this, 'togglePlay', o =>
- (is.boolean(o) ? o : !this.playing) ? this.play() : this.pause()
- ),
- _defineProperty$1(this, 'stop', () => {
- this.isHTML5
- ? (this.pause(), this.restart())
- : is.function(this.media.stop) && this.media.stop();
- }),
- _defineProperty$1(this, 'restart', () => {
- this.currentTime = 0;
- }),
- _defineProperty$1(this, 'rewind', o => {
- this.currentTime -= is.number(o) ? o : this.config.seekTime;
- }),
- _defineProperty$1(this, 'forward', o => {
- this.currentTime += is.number(o) ? o : this.config.seekTime;
- }),
- _defineProperty$1(this, 'increaseVolume', o => {
- const l = this.media.muted ? 0 : this.volume;
- this.volume = l + (is.number(o) ? o : 0);
- }),
- _defineProperty$1(this, 'decreaseVolume', o => {
- this.increaseVolume(-o);
- }),
- _defineProperty$1(this, 'airplay', () => {
- support.airplay && this.media.webkitShowPlaybackTargetPicker();
- }),
- _defineProperty$1(this, 'toggleControls', o => {
- if (this.supported.ui && !this.isAudio) {
- const l = hasClass(
- this.elements.container,
- this.config.classNames.hideControls
- ),
- c = o === void 0 ? void 0 : !o,
- g = toggleClass(
- this.elements.container,
- this.config.classNames.hideControls,
- c
- );
- if (
- (g &&
- is.array(this.config.controls) &&
- this.config.controls.includes('settings') &&
- !is.empty(this.config.settings) &&
- controls$2.toggleMenu.call(this, !1),
- g !== l)
- ) {
- const S = g ? 'controlshidden' : 'controlsshown';
- triggerEvent.call(this, this.media, S);
- }
- return !g;
- }
- return !1;
- }),
- _defineProperty$1(this, 'on', (o, l) => {
- on.call(this, this.elements.container, o, l);
- }),
- _defineProperty$1(this, 'once', (o, l) => {
- once.call(this, this.elements.container, o, l);
- }),
- _defineProperty$1(this, 'off', (o, l) => {
- off(this.elements.container, o, l);
- }),
- _defineProperty$1(this, 'destroy', (o, l = !1) => {
- if (!this.ready) return;
- const c = () => {
- (document.body.style.overflow = ''),
- (this.embed = null),
- l
- ? (Object.keys(this.elements).length &&
- (removeElement(this.elements.buttons.play),
- removeElement(this.elements.captions),
- removeElement(this.elements.controls),
- removeElement(this.elements.wrapper),
- (this.elements.buttons.play = null),
- (this.elements.captions = null),
- (this.elements.controls = null),
- (this.elements.wrapper = null)),
- is.function(o) && o())
- : (unbindListeners.call(this),
- html5.cancelRequests.call(this),
- replaceElement(this.elements.original, this.elements.container),
- triggerEvent.call(
- this,
- this.elements.original,
- 'destroyed',
- !0
- ),
- is.function(o) && o.call(this.elements.original),
- (this.ready = !1),
- setTimeout(() => {
- (this.elements = null), (this.media = null);
- }, 200));
- };
- this.stop(),
- clearTimeout(this.timers.loading),
- clearTimeout(this.timers.controls),
- clearTimeout(this.timers.resized),
- this.isHTML5
- ? (ui.toggleNativeControls.call(this, !0), c())
- : this.isYouTube
- ? (clearInterval(this.timers.buffering),
- clearInterval(this.timers.playing),
- this.embed !== null &&
- is.function(this.embed.destroy) &&
- this.embed.destroy(),
- c())
- : this.isVimeo &&
- (this.embed !== null && this.embed.unload().then(c),
- setTimeout(c, 200));
- }),
- _defineProperty$1(this, 'supports', o => support.mime.call(this, o)),
- (this.timers = {}),
- (this.ready = !1),
- (this.loading = !1),
- (this.failed = !1),
- (this.touch = support.touch),
- (this.media = t),
- is.string(this.media) &&
- (this.media = document.querySelectorAll(this.media)),
- ((window.jQuery && this.media instanceof jQuery) ||
- is.nodeList(this.media) ||
- is.array(this.media)) &&
- (this.media = this.media[0]),
- (this.config = extend(
- {},
- defaults,
- Plyr.defaults,
- r || {},
- (() => {
- try {
- return JSON.parse(this.media.getAttribute('data-plyr-config'));
- } catch {
- return {};
- }
- })()
- )),
- (this.elements = {
- container: null,
- fullscreen: null,
- captions: null,
- buttons: {},
- display: {},
- progress: {},
- inputs: {},
- settings: { popup: null, menu: null, panels: {}, buttons: {} }
- }),
- (this.captions = { active: null, currentTrack: -1, meta: new WeakMap() }),
- (this.fullscreen = { active: !1 }),
- (this.options = { speed: [], quality: [] }),
- (this.debug = new Console(this.config.debug)),
- this.debug.log('Config', this.config),
- this.debug.log('Support', support),
- is.nullOrUndefined(this.media) || !is.element(this.media))
- )
- return void this.debug.error('Setup failed: no suitable element passed');
- if (this.media.plyr) return void this.debug.warn('Target already setup');
- if (!this.config.enabled)
- return void this.debug.error('Setup failed: disabled by config');
- if (!support.check().api)
- return void this.debug.error('Setup failed: no support');
- const i = this.media.cloneNode(!0);
- (i.autoplay = !1), (this.elements.original = i);
- const s = this.media.tagName.toLowerCase();
- let n = null,
- a = null;
- switch (s) {
- case 'div':
- if (((n = this.media.querySelector('iframe')), is.element(n))) {
- if (
- ((a = parseUrl(n.getAttribute('src'))),
- (this.provider = getProviderByUrl(a.toString())),
- (this.elements.container = this.media),
- (this.media = n),
- (this.elements.container.className = ''),
- a.search.length)
- ) {
- const o = ['1', 'true'];
- o.includes(a.searchParams.get('autoplay')) &&
- (this.config.autoplay = !0),
- o.includes(a.searchParams.get('loop')) &&
- (this.config.loop.active = !0),
- this.isYouTube
- ? ((this.config.playsinline = o.includes(
- a.searchParams.get('playsinline')
- )),
- (this.config.youtube.hl = a.searchParams.get('hl')))
- : (this.config.playsinline = !0);
- }
- } else
- (this.provider = this.media.getAttribute(
- this.config.attributes.embed.provider
- )),
- this.media.removeAttribute(this.config.attributes.embed.provider);
- if (
- is.empty(this.provider) ||
- !Object.values(providers).includes(this.provider)
- )
- return void this.debug.error('Setup failed: Invalid provider');
- this.type = types.video;
- break;
- case 'video':
- case 'audio':
- (this.type = s),
- (this.provider = providers.html5),
- this.media.hasAttribute('crossorigin') &&
- (this.config.crossorigin = !0),
- this.media.hasAttribute('autoplay') && (this.config.autoplay = !0),
- (this.media.hasAttribute('playsinline') ||
- this.media.hasAttribute('webkit-playsinline')) &&
- (this.config.playsinline = !0),
- this.media.hasAttribute('muted') && (this.config.muted = !0),
- this.media.hasAttribute('loop') && (this.config.loop.active = !0);
- break;
- default:
- return void this.debug.error('Setup failed: unsupported type');
- }
- (this.supported = support.check(this.type, this.provider)),
- this.supported.api
- ? ((this.eventListeners = []),
- (this.listeners = new Listeners(this)),
- (this.storage = new Storage(this)),
- (this.media.plyr = this),
- is.element(this.elements.container) ||
- ((this.elements.container = createElement('div')),
- wrap(this.media, this.elements.container)),
- ui.migrateStyles.call(this),
- ui.addStyleHook.call(this),
- media.setup.call(this),
- this.config.debug &&
- on.call(
- this,
- this.elements.container,
- this.config.events.join(' '),
- o => {
- this.debug.log(`event: ${o.type}`);
- }
- ),
- (this.fullscreen = new Fullscreen(this)),
- (this.isHTML5 || (this.isEmbed && !this.supported.ui)) &&
- ui.build.call(this),
- this.listeners.container(),
- this.listeners.global(),
- this.config.ads.enabled && (this.ads = new Ads(this)),
- this.isHTML5 &&
- this.config.autoplay &&
- this.once('canplay', () => silencePromise(this.play())),
- (this.lastSeekTime = 0),
- this.config.previewThumbnails.enabled &&
- (this.previewThumbnails = new PreviewThumbnails(this)))
- : this.debug.error('Setup failed: no support');
- }
- get isHTML5() {
- return this.provider === providers.html5;
- }
- get isEmbed() {
- return this.isYouTube || this.isVimeo;
- }
- get isYouTube() {
- return this.provider === providers.youtube;
- }
- get isVimeo() {
- return this.provider === providers.vimeo;
- }
- get isVideo() {
- return this.type === types.video;
- }
- get isAudio() {
- return this.type === types.audio;
- }
- get playing() {
- return !!(this.ready && !this.paused && !this.ended);
- }
- get paused() {
- return !!this.media.paused;
- }
- get stopped() {
- return !!(this.paused && this.currentTime === 0);
- }
- get ended() {
- return !!this.media.ended;
- }
- set currentTime(t) {
- if (!this.duration) return;
- const r = is.number(t) && t > 0;
- (this.media.currentTime = r ? Math.min(t, this.duration) : 0),
- this.debug.log(`Seeking to ${this.currentTime} seconds`);
- }
- get currentTime() {
- return Number(this.media.currentTime);
- }
- get buffered() {
- const { buffered: t } = this.media;
- return is.number(t)
- ? t
- : t && t.length && this.duration > 0
- ? t.end(0) / this.duration
- : 0;
- }
- get seeking() {
- return !!this.media.seeking;
- }
- get duration() {
- const t = parseFloat(this.config.duration),
- r = (this.media || {}).duration,
- i = is.number(r) && r !== 1 / 0 ? r : 0;
- return t || i;
- }
- set volume(t) {
- let r = t;
- is.string(r) && (r = Number(r)),
- is.number(r) || (r = this.storage.get('volume')),
- is.number(r) || ({ volume: r } = this.config),
- r > 1 && (r = 1),
- r < 0 && (r = 0),
- (this.config.volume = r),
- (this.media.volume = r),
- !is.empty(t) && this.muted && r > 0 && (this.muted = !1);
- }
- get volume() {
- return Number(this.media.volume);
- }
- set muted(t) {
- let r = t;
- is.boolean(r) || (r = this.storage.get('muted')),
- is.boolean(r) || (r = this.config.muted),
- (this.config.muted = r),
- (this.media.muted = r);
- }
- get muted() {
- return !!this.media.muted;
- }
- get hasAudio() {
- return (
- !this.isHTML5 ||
- !!this.isAudio ||
- !!this.media.mozHasAudio ||
- !!this.media.webkitAudioDecodedByteCount ||
- !!(this.media.audioTracks && this.media.audioTracks.length)
- );
- }
- set speed(t) {
- let r = null;
- is.number(t) && (r = t),
- is.number(r) || (r = this.storage.get('speed')),
- is.number(r) || (r = this.config.speed.selected);
- const { minimumSpeed: i, maximumSpeed: s } = this;
- (r = clamp(r, i, s)),
- (this.config.speed.selected = r),
- setTimeout(() => {
- this.media && (this.media.playbackRate = r);
- }, 0);
- }
- get speed() {
- return Number(this.media.playbackRate);
- }
- get minimumSpeed() {
- return this.isYouTube
- ? Math.min(...this.options.speed)
- : this.isVimeo
- ? 0.5
- : 0.0625;
- }
- get maximumSpeed() {
- return this.isYouTube
- ? Math.max(...this.options.speed)
- : this.isVimeo
- ? 2
- : 16;
- }
- set quality(t) {
- const r = this.config.quality,
- i = this.options.quality;
- if (!i.length) return;
- let s = [
- !is.empty(t) && Number(t),
- this.storage.get('quality'),
- r.selected,
- r.default
- ].find(is.number),
- n = !0;
- if (!i.includes(s)) {
- const a = closest(i, s);
- this.debug.warn(`Unsupported quality option: ${s}, using ${a} instead`),
- (s = a),
- (n = !1);
- }
- (r.selected = s),
- (this.media.quality = s),
- n && this.storage.set({ quality: s });
- }
- get quality() {
- return this.media.quality;
- }
- set loop(t) {
- const r = is.boolean(t) ? t : this.config.loop.active;
- (this.config.loop.active = r), (this.media.loop = r);
- }
- get loop() {
- return !!this.media.loop;
- }
- set source(t) {
- source.change.call(this, t);
- }
- get source() {
- return this.media.currentSrc;
- }
- get download() {
- const { download: t } = this.config.urls;
- return is.url(t) ? t : this.source;
- }
- set download(t) {
- is.url(t) &&
- ((this.config.urls.download = t), controls$2.setDownloadUrl.call(this));
- }
- set poster(t) {
- this.isVideo
- ? ui.setPoster.call(this, t, !1).catch(() => {})
- : this.debug.warn('Poster can only be set for video');
- }
- get poster() {
- return this.isVideo
- ? this.media.getAttribute('poster') ||
- this.media.getAttribute('data-poster')
- : null;
- }
- get ratio() {
- if (!this.isVideo) return null;
- const t = reduceAspectRatio(getAspectRatio.call(this));
- return is.array(t) ? t.join(':') : t;
- }
- set ratio(t) {
- this.isVideo
- ? is.string(t) && validateAspectRatio(t)
- ? ((this.config.ratio = reduceAspectRatio(t)),
- setAspectRatio.call(this))
- : this.debug.error(`Invalid aspect ratio specified (${t})`)
- : this.debug.warn('Aspect ratio can only be set for video');
- }
- set autoplay(t) {
- this.config.autoplay = is.boolean(t) ? t : this.config.autoplay;
- }
- get autoplay() {
- return !!this.config.autoplay;
- }
- toggleCaptions(t) {
- captions.toggle.call(this, t, !1);
- }
- set currentTrack(t) {
- captions.set.call(this, t, !1), captions.setup.call(this);
- }
- get currentTrack() {
- const { toggled: t, currentTrack: r } = this.captions;
- return t ? r : -1;
- }
- set language(t) {
- captions.setLanguage.call(this, t, !1);
- }
- get language() {
- return (captions.getCurrentTrack.call(this) || {}).language;
- }
- set pip(t) {
- if (!support.pip) return;
- const r = is.boolean(t) ? t : !this.pip;
- is.function(this.media.webkitSetPresentationMode) &&
- this.media.webkitSetPresentationMode(r ? pip.active : pip.inactive),
- is.function(this.media.requestPictureInPicture) &&
- (!this.pip && r
- ? this.media.requestPictureInPicture()
- : this.pip && !r && document.exitPictureInPicture());
- }
- get pip() {
- return support.pip
- ? is.empty(this.media.webkitPresentationMode)
- ? this.media === document.pictureInPictureElement
- : this.media.webkitPresentationMode === pip.active
- : null;
- }
- setPreviewThumbnails(t) {
- this.previewThumbnails &&
- this.previewThumbnails.loaded &&
- (this.previewThumbnails.destroy(), (this.previewThumbnails = null)),
- Object.assign(this.config.previewThumbnails, t),
- this.config.previewThumbnails.enabled &&
- (this.previewThumbnails = new PreviewThumbnails(this));
- }
- static supported(t, r) {
- return support.check(t, r);
- }
- static loadSprite(t, r) {
- return loadSprite(t, r);
- }
- static setup(t, r = {}) {
- let i = null;
- return (
- is.string(t)
- ? (i = Array.from(document.querySelectorAll(t)))
- : is.nodeList(t)
- ? (i = Array.from(t))
- : is.array(t) && (i = t.filter(is.element)),
- is.empty(i) ? null : i.map(s => new Plyr(s, r))
- );
- }
- }
- Plyr.defaults = cloneDeep(defaults);
- const videoWrap = '_videoWrap_xntkj_1',
- controls$1 = '_controls_xntkj_19',
- time$1 = '_time_xntkj_27',
- line$1 = '_line_xntkj_36',
- slider$1 = '_slider_xntkj_43',
- actions$1 = '_actions_xntkj_54',
- actionWrap$1 = '_actionWrap_xntkj_62',
- actionBtn$1 = '_actionBtn_xntkj_65',
- playIcon = '_playIcon_xntkj_80',
- btnPlay = '_btnPlay_xntkj_83',
- btnPause = '_btnPause_xntkj_86',
- loopBtn = '_loopBtn_xntkj_93',
- styles$6 = {
- videoWrap,
- controls: controls$1,
- time: time$1,
- line: line$1,
- slider: slider$1,
- actions: actions$1,
- actionWrap: actionWrap$1,
- actionBtn: actionBtn$1,
- playIcon,
- btnPlay,
- btnPause,
- loopBtn
- },
- iconplay = '' + new URL('icon-pause-5efb540a.svg', import.meta.url).href,
- iconpause = '' + new URL('icon-play-f01e3616.svg', import.meta.url).href,
- iconReplay$1 = '' + new URL('icon-replay-06435dc9.svg', import.meta.url).href,
- VideoPlay = defineComponent({
- name: 'video-play',
- props: {
- item: { type: Object, default: () => ({}) },
- isEmtry: { type: Boolean, default: !1 }
- },
- emits: ['loadedmetadata', 'togglePlay', 'ended', 'reset'],
- setup(e, { emit: t, expose: r }) {
- const { item: i, isEmtry: s } = toRefs(e),
- n = ref(),
- a = ref(),
- o = 'v' + Date.now() + Math.floor(Math.random() * 100),
- l = 'play' + Date.now() + Math.floor(Math.random() * 100),
- c = 'replay' + Date.now() + Math.floor(Math.random() * 100),
- g = A => {
- var u;
- (u = a.value) == null || u.toggleControls(A);
- },
- S = A => {
- var u;
- A.stopPropagation(), (u = a.value) == null || u.togglePlay();
- },
- p = () => {
- !document.getElementById(c) || !a.value || a.value.restart();
- },
- P = () => {
- var A, u, f;
- (A = document.getElementById(o)) == null ||
- A.addEventListener('click', m => {
- m.stopPropagation(), t('reset');
- }),
- (u = document.getElementById(l)) == null ||
- u.addEventListener('click', S),
- (f = document.getElementById(c)) == null ||
- f.addEventListener('click', p);
- },
- b = A => {
- const u = document.getElementById(l);
- u &&
- (A == 'play'
- ? (u.classList.remove(styles$6.btnPause),
- u.classList.add(styles$6.btnPlay))
- : (u.classList.remove(styles$6.btnPlay),
- u.classList.add(styles$6.btnPause)));
- },
- y = `
- <div id="${o}" class="plyr__controls bottomFixed ${styles$6.controls}">
- <div class="${styles$6.actions}">
- <div class="${styles$6.actionWrap}">
- <button id="${l}" class="${styles$6.actionBtn}">
- <div class="van-loading van-loading--circular" aria-live="polite" aria-busy="true"><span class="van-loading__spinner van-loading__spinner--circular" style="color: rgb(255, 255, 255);"><svg class="van-loading__circular" viewBox="25 25 50 50"><circle cx="50" cy="50" r="20" fill="none"></circle></svg></span></div>
- <img class="${styles$6.playIcon}" src="${iconplay}" />
- <img class="${styles$6.playIcon}" src="${iconpause}" />
- </button>
- </div>
- <div class="${styles$6.time}">
- <div class="plyr__time plyr__time--current" aria-label="Current time">00:00</div><span class="${styles$6.line}">/</span>
- <div class="plyr__time plyr__time--duration" aria-label="Duration">00:00</div>
- </div>
- </div>
- <div class="${styles$6.slider}">
- <div class="plyr__progress">
- <input data-plyr="seek" type="range" min="0" max="100" step="0.01" value="0" aria-label="Seek">
- <progress class="plyr__progress__buffer" min="0" max="100" value="0">% buffered</progress>
- <span role="tooltip" class="plyr__tooltip">00:00</span>
- </div>
- </div>
- <div class="${styles$6.actions}" style="padding-right: 0;">
- <button id="${c}" class="${styles$6.actionBtn} ${styles$6.loopBtn}">
- <img class="loop" src="${iconReplay$1}" />
- </button>
- </div>
- </div>`;
- return (
- onMounted(() => {
- (a.value = new Plyr(n.value, {
- autoplay: !0,
- controls: y,
- autopause: !0,
- ratio: '16:9',
- hideControls: !1,
- clickToPlay: !1,
- fullscreen: { enabled: !1, fallback: !1, iosNative: !1 }
- })),
- a.value &&
- (a.value.on('play', () => {
- var A;
- a.value && ((a.value.muted = !1), (a.value.volume = 1)),
- !i.value.autoPlay &&
- !i.value.isprepare &&
- a.value &&
- (console.log(a.value), a.value.pause()),
- b(''),
- t('togglePlay', (A = a.value) == null ? void 0 : A.paused);
- }),
- a.value.on('pause', () => {
- var A;
- b('play'),
- t('togglePlay', (A = a.value) == null ? void 0 : A.paused);
- }),
- a.value.on('ended', () => {
- t('ended'), b('play');
- }),
- a.value.once('loadedmetadata', () => {
- b('play'),
- i.value.autoPlay && a.value && a.value.play(),
- t('loadedmetadata', a.value);
- }),
- nextTick(() => {
- P();
- }));
- }),
- r({ changePlayBtn: b, toggleHideControl: g }),
- () =>
- createVNode('div', { class: styles$6.videoWrap }, [
- createVNode(
- 'video',
- {
- style: { width: '100%', height: '100%' },
- src: s.value ? '' : i.value.content,
- ref: n,
- playsinline: 'false'
- },
- null
- )
- ])
- );
- }
- }),
- pen = '_pen_frc2u_1',
- open = '_open_frc2u_9',
- whiteboard = '_whiteboard_frc2u_12',
- hide = '_hide_frc2u_15',
- iframe = '_iframe_frc2u_18',
- dely = '_dely_frc2u_24',
- rightItem = '_rightItem_frc2u_27',
- img = '_img_frc2u_39',
- styles$5 = { pen, open, whiteboard, hide, iframe, dely, rightItem, img },
- Pen = defineComponent({
- name: 'pen-page',
- props: {
- show: { type: Boolean, default: !1 },
- type: { type: String, default: 'pen' },
- close: { type: Function, default: () => ({}) }
- },
- setup(e) {
- const { show: t, type: r } = toRefs(e),
- i = ref(!0),
- s =
- (/(localhost|192)/.test(location.host),
- 'https://test.lexiaoya.cn/whiteboard-noCollab');
- return () =>
- createVNode(
- 'div',
- {
- class: [
- styles$5.pen,
- r.value === 'whiteboard' ? styles$5.whiteboard : '',
- i.value ? styles$5.dely : '',
- t.value ? styles$5.open : styles$5.hide
- ]
- },
- [
- createVNode(
- 'iframe',
- {
- class: styles$5.iframe,
- frameborder: '0',
- width: '100vw',
- height: '100vh',
- src: s,
- onLoad: () => {
- i.value = !1;
- }
- },
- null
- ),
- createVNode(
- 'div',
- { class: styles$5.rightItem, onClick: () => e.close() },
- [
- createVNode(
- 'svg',
- { width: '22px', height: '20px', viewBox: '0 0 22 20' },
- [
- createVNode(
- 'path',
- {
- transform: 'translate(-1.000000, -2.000000)',
- fill: '#FFFFFF',
- d: 'M13,2 C13.5522847,2 14,2.44771525 14,3 C14,3.51283584 13.6139598,3.93550716 13.1166211,3.99327227 L13,4 L3,4 L3,20 L13,20 C13.5128358,20 13.9355072,20.3860402 13.9932723,20.8833789 L14,21 C14,21.5128358 13.6139598,21.9355072 13.1166211,21.9932723 L13,22 L2,22 C1.48716416,22 1.06449284,21.6139598 1.00672773,21.1166211 L1,21 L1,3 C1,2.48716416 1.38604019,2.06449284 1.88337887,2.00672773 L2,2 L13,2 Z M17.7071068,7.05025253 L21.9497475,11.2928932 L21.9497475,11.2928932 C22.3402718,11.6834175 22.3402718,12.3165825 21.9497475,12.7071068 L17.7071068,16.9497475 C17.3165825,17.3402718 16.6834175,17.3402718 16.2928932,16.9497475 C15.9023689,16.5592232 15.9023689,15.9260582 16.2928932,15.5355339 L18.828,12.999 L9.29368112,13 C8.74139637,13 8.29368112,12.5522847 8.29368112,12 C8.29368112,11.4871642 8.67972131,11.0644928 9.17706,11.0067277 L9.29368112,11 L18.827,10.999 L16.2928932,8.46446609 C15.9023689,8.0739418 15.9023689,7.44077682 16.2928932,7.05025253 C16.6834175,6.65972824 17.3165825,6.65972824 17.7071068,7.05025253 Z'
- },
- null
- )
- ]
- )
- ]
- )
- ]
- );
- }
- }),
- audioWrap = '_audioWrap_1fqhr_1',
- audioContainer = '_audioContainer_1fqhr_6',
- audio = '_audio_1fqhr_1',
- tempVudio = '_tempVudio_1fqhr_22',
- controls = '_controls_1fqhr_34',
- time = '_time_1fqhr_48',
- line = '_line_1fqhr_57',
- actions = '_actions_1fqhr_64',
- actionWrap = '_actionWrap_1fqhr_72',
- actionBtn = '_actionBtn_1fqhr_75',
- iconReplay = '_iconReplay_1fqhr_86',
- slider = '_slider_1fqhr_95',
- sectionAnimate = '_sectionAnimate_1fqhr_103',
- styles$4 = {
- audioWrap,
- audioContainer,
- audio,
- tempVudio,
- controls,
- time,
- line,
- actions,
- actionWrap,
- actionBtn,
- iconReplay,
- slider,
- sectionAnimate
- };
- var vudioExports = {},
- vudio = {
- get exports() {
- return vudioExports;
- },
- set exports(e) {
- vudioExports = e;
- }
- };
- (function (e, t) {
- (function (r) {
- e.exports = r();
- })(function () {
- var r = {
- effect: 'waveform',
- accuracy: 128,
- width: 256,
- height: 100,
- waveform: {
- maxHeight: 80,
- minHeight: 1,
- spacing: 1,
- color: '#f00',
- shadowBlur: 0,
- shadowColor: '#f00',
- fadeSide: !0,
- horizontalAlign: 'center',
- verticalAlign: 'middle',
- prettify: !0
- },
- lighting: {
- maxHeight: 80,
- lineWidth: 0,
- color: '#f00',
- shadowBlur: 0,
- shadowColor: '#f00',
- fadeSide: !0,
- horizontalAlign: 'center',
- verticalAlign: 'middle'
- }
- };
- function i(n, a, o) {
- if (
- [
- '[object HTMLAudioSource]',
- '[object HTMLAudioElement]',
- '[object MediaStream]'
- ].indexOf(Object.prototype.toString.call(n)) === -1
- )
- throw new TypeError('Invaild Audio Source');
- if (Object.prototype.toString.call(a) !== '[object HTMLCanvasElement]')
- throw new TypeError('Invaild Canvas Element');
- (this.audioSrc = n),
- (this.canvasEle = a),
- (this.option = s(r, o)),
- (this.meta = {}),
- (this.stat = 0),
- (this.freqByteData = null),
- this.__init();
- }
- function s() {
- var n = {};
- return (
- Array.prototype.forEach.call(arguments, function (a) {
- var o;
- for (o in a)
- Object.prototype.hasOwnProperty.call(a, o) &&
- (Object.prototype.toString.call(a[o]) === '[object Object]'
- ? (n[o] = s(n[o], a[o]))
- : (n[o] = a[o]));
- }),
- n
- );
- }
- return (
- (i.prototype = {
- __init: function () {
- var n = new (window.AudioContext ||
- window.webkitAudioContext ||
- window.mozAudioContext)(),
- a =
- Object.prototype.toString.call(this.audioSrc) !==
- '[object MediaStream]'
- ? n.createMediaElementSource(this.audioSrc)
- : n.createMediaStreamSource(this.audioSrc),
- o = window.devicePixelRatio || 1;
- (this.analyser = n.createAnalyser()),
- (this.meta.spr = n.sampleRate),
- a.connect(this.analyser),
- (this.analyser.fftSize = this.option.accuracy * 2),
- this.analyser.connect(n.destination),
- (this.freqByteData = new Uint8Array(
- this.analyser.frequencyBinCount
- )),
- (this.context2d = this.canvasEle.getContext('2d')),
- (this.width = this.option.width),
- (this.height = this.option.height),
- (this.context2d.canvas.width = this.width * o),
- (this.context2d.canvas.height = this.height * o),
- this.context2d.scale(o, o);
- },
- __rebuildData: function (n, a) {
- var o;
- return (
- a === 'center'
- ? (o = [].concat(
- Array.from(n)
- .reverse()
- .splice(this.option.accuracy / 2, this.option.accuracy / 2),
- Array.from(n).splice(0, this.option.accuracy / 2)
- ))
- : a === 'left'
- ? (o = n)
- : a === 'right'
- ? (o = Array.from(n).reverse())
- : (o = [].concat(
- Array.from(n)
- .reverse()
- .splice(this.option.accuracy / 2, this.option.accuracy / 2),
- Array.from(n).splice(0, this.option.accuracy / 2)
- )),
- o
- );
- },
- __animate: function () {
- this.stat === 1 &&
- (this.analyser.getByteFrequencyData(this.freqByteData),
- typeof this.__effects()[this.option.effect] == 'function' &&
- this.__effects()[this.option.effect](this.freqByteData),
- requestAnimationFrame(this.__animate.bind(this)));
- },
- __testFrame: function () {
- this.analyser.getByteFrequencyData(this.freqByteData),
- typeof this.__effects()[this.option.effect] == 'function' &&
- this.__effects()[this.option.effect](this.freqByteData);
- },
- __effects: function () {
- var n = this;
- return {
- lighting: function (a) {
- var o = n.option.lighting,
- l = n.__rebuildData(a, o.horizontalAlign),
- c = o.maxHeight / 2,
- g = !0,
- S,
- p;
- o.horizontalAlign,
- n.context2d.clearRect(0, 0, n.width, n.height),
- (n.context2d.lineWidth = o.lineWidth),
- (n.context2d.strokeStyle = o.color),
- n.context2d.beginPath(),
- l.forEach(function (P, b) {
- (S = (n.width / n.option.accuracy) * b),
- (p = (P / 256) * c),
- o.verticalAlign === 'middle'
- ? (p = (n.height - P) / 2 - c / 2)
- : o.verticalAlign === 'bottom'
- ? (p = n.height - P)
- : o.verticalAlign === 'top'
- ? (p = P)
- : (p = (n.height - P) / 2 - c / 2),
- g
- ? (n.context2d.moveTo(S, p), (g = !1))
- : n.context2d.lineTo(S, p);
- }),
- n.context2d.stroke();
- },
- waveform: function (a) {
- var o = n.option.waveform,
- l = o.fadeSide,
- c = o.prettify,
- g = n.__rebuildData(a, o.horizontalAlign),
- S,
- p,
- P,
- b,
- y,
- A,
- u,
- f;
- o.horizontalAlign !== 'center' && ((l = !1), (c = !1)),
- n.context2d.clearRect(0, 0, n.width, n.height),
- g.forEach(function (m, d) {
- (p =
- (n.width - n.option.accuracy * o.spacing) /
- n.option.accuracy),
- (b = d * (p + o.spacing)),
- o.spacing !== 1 && (b += o.spacing / 2),
- c
- ? d <= n.option.accuracy / 2
- ? (S =
- (1 -
- (n.option.accuracy / 2 - 1 - d) /
- (n.option.accuracy / 2)) *
- o.maxHeight)
- : (S =
- (1 -
- (d - n.option.accuracy / 2) /
- (n.option.accuracy / 2)) *
- o.maxHeight)
- : (S = o.maxHeight),
- (P = (m / 256) * S),
- (P = P < o.minHeight ? o.minHeight : P),
- o.verticalAlign === 'middle'
- ? (y = (n.height - P) / 2)
- : o.verticalAlign === 'top'
- ? (y = 0)
- : o.verticalAlign === 'bottom'
- ? (y = n.height - P)
- : (y = (n.height - P) / 2),
- (A = o.color),
- A instanceof Array
- ? ((u = n.context2d.createLinearGradient(b, y, b, y + P)),
- A.forEach(function (E, T) {
- E instanceof Array
- ? ((f = E[0]), (E = E[1]))
- : T === 0 || T === A.length - 1
- ? (f = T / (A.length - 1))
- : (f = T / A.length + 0.5 / A.length),
- u.addColorStop(f, E);
- }),
- (n.context2d.fillStyle = u))
- : (n.context2d.fillStyle = A),
- o.shadowBlur > 0 &&
- ((n.context2d.shadowBlur = o.shadowBlur),
- (n.context2d.shadowColor = o.shadowColor)),
- l
- ? d <= n.option.accuracy / 2
- ? (n.context2d.globalAlpha =
- 1 -
- (n.option.accuracy / 2 - 1 - d) /
- (n.option.accuracy / 2))
- : (n.context2d.globalAlpha =
- 1 -
- (d - n.option.accuracy / 2) /
- (n.option.accuracy / 2))
- : (n.context2d.globalAlpha = 1),
- n.context2d.fillRect(b, y, p, P);
- });
- }
- };
- },
- dance: function () {
- return this.stat === 0 && ((this.stat = 1), this.__animate()), this;
- },
- pause: function () {
- return (this.stat = 0), this;
- },
- setOption: function (n) {
- this.option = s(this.option, n);
- }
- }),
- i
- );
- });
- })(vudio);
- const Vudio = vudioExports,
- tickMp3 = '' + new URL('tick-b5f22461.mp3', import.meta.url).href,
- AudioPay = defineComponent({
- name: 'audio-play',
- props: {
- item: { type: Object, default: () => ({}) },
- isEmtry: { type: Boolean, default: !1 }
- },
- emits: ['loadedmetadata', 'togglePlay', 'ended', 'reset'],
- setup(e, { emit: t, expose: r }) {
- const i = reactive({
- paused: !0,
- currentTimeNum: 0,
- currentTime: '00:00',
- durationNum: 0,
- duration: '00:00',
- showBar: !0,
- afterMa3: !0
- }),
- s = ref(),
- n = ref();
- let a = null;
- const o = y => {
- y == null || y.stopPropagation(),
- n.value.paused
- ? (l(n.value, s.value), n.value.play(), (i.afterMa3 = !1))
- : n.value.pause(),
- (i.paused = n.value.paused),
- t('togglePlay', i.paused);
- },
- l = (y, A) => {
- a ||
- ((a = new Vudio(y, A, {
- effect: 'waveform',
- accuracy: 256,
- width: 1024,
- height: 600,
- waveform: {
- maxHeight: 200,
- color: [
- [0, '#44D1FF'],
- [0.5, '#44D1FF'],
- [0.5, '#198CFE'],
- [1, '#198CFE']
- ],
- prettify: !1
- }
- })),
- a.dance());
- },
- c = y => {
- if (y > 0) {
- const A = Math.floor(y / 60),
- u = y % 60;
- return (A < 10 ? '0' + A : A) + ':' + (u < 10 ? '0' + u : u);
- } else return '00:00';
- },
- g = y => {
- i.showBar = y;
- },
- S = () => {
- n.value && (n.value.currentTime = 0);
- };
- let p = null;
- const P = ref(),
- b = ref();
- return (
- nextTick(() => {
- (p = new Vudio(b.value, P.value, {
- effect: 'waveform',
- accuracy: 256,
- width: 1024,
- height: 600,
- waveform: {
- maxHeight: 200,
- color: [
- [0, '#44D1FF'],
- [0.5, '#44D1FF'],
- [0.5, '#198CFE'],
- [1, '#198CFE']
- ],
- prettify: !1
- }
- })),
- p.dance();
- }),
- r({ toggleHideControl: g }),
- () =>
- createVNode('div', { class: styles$4.audioWrap }, [
- createVNode('div', { class: styles$4.audioContainer }, [
- createVNode(
- 'audio',
- {
- ref: n,
- crossorigin: 'anonymous',
- src: e.item.content + '?time=1',
- onEnded: () => {
- (i.paused = !0), t('ended');
- },
- onTimeupdate: () => {
- var y;
- (i.currentTime = c(
- Math.round(
- ((y = n.value) == null ? void 0 : y.currentTime) || 0
- )
- )),
- (i.currentTimeNum = n.value.currentTime);
- },
- onLoadedmetadata: () => {
- (i.duration = c(Math.round(n.value.duration))),
- (i.durationNum = n.value.duration),
- e.item.autoPlay && n.value && n.value.play(),
- (n.value.stop = () => {
- n.value.pause(),
- (i.paused = !0),
- t('togglePlay', i.paused);
- }),
- (n.value.onPlay = () => {
- n.value.play(),
- (i.paused = !1),
- l(n.value, s.value),
- t('togglePlay', i.paused);
- }),
- t('loadedmetadata', n.value);
- }
- },
- null
- ),
- createVNode('canvas', { ref: s }, null),
- i.afterMa3 &&
- createVNode('div', { class: styles$4.tempVudio }, [
- createVNode('audio', { ref: b, src: tickMp3 }, null),
- createVNode('canvas', { ref: P }, null)
- ])
- ]),
- createVNode(
- 'div',
- {
- class: [
- styles$4.controls,
- i.showBar ? '' : styles$4.sectionAnimate
- ],
- onClick: y => {
- y.stopPropagation(), t('reset');
- }
- },
- [
- createVNode('div', { class: styles$4.actions }, [
- createVNode('div', { class: styles$4.actionWrap }, [
- createVNode(
- 'button',
- { class: styles$4.actionBtn, onClick: o },
- [
- i.paused
- ? createVNode(
- 'img',
- { class: styles$4.playIcon, src: iconplay },
- null
- )
- : createVNode(
- 'img',
- { class: styles$4.playIcon, src: iconpause },
- null
- )
- ]
- )
- ]),
- createVNode('div', { class: styles$4.time }, [
- createVNode(
- 'div',
- {
- class: 'plyr__time plyr__time--current',
- 'aria-label': 'Current time'
- },
- [i.currentTime]
- ),
- createVNode('span', { class: styles$4.line }, [
- createTextVNode('/')
- ]),
- createVNode(
- 'div',
- {
- class: 'plyr__time plyr__time--duration',
- 'aria-label': 'Duration'
- },
- [i.duration]
- )
- ])
- ]),
- createVNode('div', { class: styles$4.slider }, [
- createVNode(
- NSlider,
- {
- value: i.currentTimeNum,
- step: 0.01,
- max: i.durationNum,
- tooltip: !1,
- 'onUpdate:value': y => {
- (n.value.currentTime = y),
- (i.currentTimeNum = y),
- (i.currentTime = c(Math.round(y || 0)));
- }
- },
- null
- )
- ]),
- createVNode('div', { class: styles$4.actions }, [
- createVNode('div', { class: styles$4.actionWrap }, [
- createVNode(
- 'button',
- { class: styles$4.iconReplay, onClick: S },
- [createVNode('img', { src: iconReplay$1 }, null)]
- )
- ])
- ])
- ]
- )
- ])
- );
- }
- }),
- trainSettings = '_trainSettings_1ohlb_1',
- trainBtnGroup = '_trainBtnGroup_1ohlb_1',
- searchGroup$1 = '_searchGroup_1ohlb_9',
- datetime = '_datetime_1ohlb_13',
- trainList = '_trainList_1ohlb_43',
- trainEditModal = '_trainEditModal_1ohlb_53',
- selectMusicModal = '_selectMusicModal_1ohlb_56',
- styles$3 = {
- trainSettings,
- trainBtnGroup,
- searchGroup: searchGroup$1,
- datetime,
- trainList,
- trainEditModal,
- selectMusicModal
- },
- trainType = '_trainType_45ce3_1',
- title = '_title_45ce3_13',
- btn = '_btn_45ce3_28',
- preview = '_preview_45ce3_70',
- previewBtn = '_previewBtn_45ce3_84',
- type = '_type_45ce3_100',
- operation = '_operation_45ce3_113',
- evaluationType = '_evaluationType_45ce3_122',
- styles$2 = {
- trainType,
- 'train-header': '_train-header_45ce3_8',
- title,
- 'title-tag': '_title-tag_45ce3_20',
- 'title-text': '_title-text_45ce3_25',
- btn,
- 'train-content': '_train-content_45ce3_53',
- preview,
- previewBtn,
- 'train-footer': '_train-footer_45ce3_95',
- type,
- operation,
- evaluationType
- },
- pTag = '' + new URL('p-tag-c1dd923a.svg', import.meta.url).href,
- eTag = '' + new URL('e-tag-41ad6d7f.svg', import.meta.url).href,
- pEdit = '' + new URL('p-edit-4f706e0f.svg', import.meta.url).href,
- eEdit = '' + new URL('e-edit-27c28498.svg', import.meta.url).href,
- iconPause = '' + new URL('icon-pause-70c10a79.svg', import.meta.url).href,
- pDelete = '' + new URL('p-delete-f451a434.svg', import.meta.url).href,
- eDelete = '' + new URL('e-delete-50e50a8c.svg', import.meta.url).href;
- function _isSlot$2(e) {
- return (
- typeof e == 'function' ||
- (Object.prototype.toString.call(e) === '[object Object]' && !isVNode(e))
- );
- }
- const TrainType = defineComponent({
- name: 'train-type',
- props: { item: { type: Object, default: () => ({}) } },
- emits: ['click', 'delete', 'edit'],
- setup(e, { emit: t }) {
- useUserStore();
- const r = useDialog(),
- i = () => {
- const n = r.warning({
- title: '提示',
- content: '您确定是否删除?',
- positiveText: '确定',
- negativeText: '取消',
- onPositiveClick: () => {
- (n.loading = !0), t('delete', e.item);
- }
- });
- },
- s = () => {
- const n =
- 'https://dev.kt.colexiu.com/instrument?platform=pc&modelType=practise';
- window.open(n, '_blank');
- };
- return () => {
- let n;
- return createVNode(
- 'div',
- {
- class: [
- styles$2.trainType,
- e.item.type === 'evaluation' ? styles$2.evaluationType : ''
- ],
- onClick: () => t('click', e.item)
- },
- [
- createVNode('div', { class: styles$2['train-header'] }, [
- createVNode('div', { class: styles$2.title }, [
- createVNode(
- 'img',
- {
- src: e.item.type === 'evaluation' ? eTag : pTag,
- class: styles$2['title-tag']
- },
- null
- ),
- createVNode(
- NEllipsis,
- { class: styles$2['title-text'] },
- { default: () => [e.item.name] }
- )
- ]),
- createVNode(
- NButton,
- { class: styles$2.btn, round: !0, onClick: s },
- {
- default: () => [
- e.item.type === 'evaluation' ? '评测模式' : '练习模式',
- createVNode('img', { src: iconPause }, null)
- ]
- }
- )
- ]),
- createVNode('div', { class: styles$2['train-content'] }, [
- createVNode(
- NImage,
- { src: e.item.src, previewDisabled: !0, objectFit: 'cover' },
- null
- ),
- createVNode('div', { class: styles$2.preview }, [
- createVNode(
- NButton,
- {
- strong: !0,
- secondary: !0,
- class: styles$2.previewBtn,
- onClick: s
- },
- { default: () => [createTextVNode('预览')] }
- )
- ])
- ]),
- createVNode('div', { class: styles$2['train-footer'] }, [
- createVNode(
- NSpace,
- { class: styles$2.type },
- _isSlot$2(
- (n = e.item.typeList.map(a =>
- createVNode(
- NTag,
- null,
- _isSlot$2(a) ? a : { default: () => [a] }
- )
- ))
- )
- ? n
- : { default: () => [n] }
- ),
- createVNode(
- NSpace,
- { size: 6 },
- {
- default: () => [
- createVNode(
- resolveComponent('n-button'),
- {
- quaternary: !0,
- class: styles$2.operation,
- onClick: a => {
- a.stopPropagation(), t('edit', e.item);
- }
- },
- {
- default: () => [
- createVNode(
- 'img',
- {
- src: e.item.type === 'evaluation' ? eEdit : pEdit
- },
- null
- )
- ]
- }
- ),
- createVNode(
- resolveComponent('n-button'),
- {
- quaternary: !0,
- class: styles$2.operation,
- onClick: a => {
- a.stopPropagation(), i();
- }
- },
- {
- default: () => [
- createVNode(
- 'img',
- {
- src:
- e.item.type === 'evaluation' ? eDelete : pDelete
- },
- null
- )
- ]
- }
- )
- ]
- }
- )
- ])
- ]
- );
- };
- }
- }),
- trainUpdate = '_trainUpdate_gry8i_1',
- updateBtnGroup = '_updateBtnGroup_gry8i_4',
- active = '_active_gry8i_16',
- styles$1 = {
- trainUpdate,
- updateBtnGroup,
- switch: '_switch_gry8i_12',
- active
- },
- TrainUpdate = defineComponent({
- name: 'train-update',
- emits: ['close'],
- setup(e, { emit: t }) {
- const r = reactive({
- type: 'practice',
- minScore: null,
- maxScore: null,
- difficulty: '1'
- });
- return () =>
- createVNode('div', { class: styles$1.trainUpdate }, [
- createVNode(
- NForm,
- { labelAlign: 'left', labelPlacement: 'left' },
- {
- default: () => [
- createVNode(
- NFormItem,
- { label: '训练方式', path: 'type' },
- {
- default: () => [
- createVNode(NSpace, null, {
- default: () => [
- createVNode(
- NButton,
- {
- secondary: !0,
- class: [
- styles$1.switch,
- r.type === 'practice' ? styles$1.active : ''
- ],
- onClick: () => (r.type = 'practice')
- },
- { default: () => [createTextVNode('练习')] }
- ),
- createVNode(
- NButton,
- {
- secondary: !0,
- class: [
- styles$1.switch,
- r.type === 'evaluation' ? styles$1.active : ''
- ],
- onClick: () => (r.type = 'evaluation')
- },
- { default: () => [createTextVNode('评测')] }
- )
- ]
- })
- ]
- }
- ),
- r.type === 'practice' &&
- createVNode(Fragment, null, [
- createVNode(
- NFormItem,
- { label: '练习小节', path: 'minScore' },
- {
- default: () => [
- createVNode(
- NInputNumber,
- {
- value: r.minScore,
- 'onUpdate:value': [
- i => (r.minScore = i),
- () => {
- r.maxScore = null;
- }
- ],
- showButton: !1,
- min: 0,
- max: 99,
- placeholder: '最小练习小节',
- style: { width: '46%' }
- },
- null
- ),
- createVNode(
- 'div',
- {
- style: {
- display: 'flex',
- alignItems: 'center',
- lineHeight: '1',
- marginTop: '-2px',
- margin: '-2px 4% 0 4%'
- }
- },
- [createTextVNode('-')]
- ),
- createVNode(
- NInputNumber,
- {
- value: r.maxScore,
- 'onUpdate:value': i => (r.maxScore = i),
- showButton: !1,
- min: r.minScore || 0,
- max: 99,
- placeholder: '最大练习小节',
- style: { width: '46%' }
- },
- null
- )
- ]
- }
- ),
- createVNode(
- NFormItem,
- { label: '练习速度' },
- {
- default: () => [
- createVNode(
- NInputNumber,
- {
- min: 0,
- showButton: !1,
- style: { width: '100%' }
- },
- null
- )
- ]
- }
- ),
- createVNode(
- NFormItem,
- { label: '练习时长' },
- {
- default: () => [
- createVNode(NInputGroup, null, {
- default: () => [
- createVNode(NInput, null, null),
- createVNode(NInputGroupLabel, null, {
- default: () => [createTextVNode('分钟')]
- })
- ]
- })
- ]
- }
- )
- ]),
- r.type === 'evaluation' &&
- createVNode(Fragment, null, [
- createVNode(
- NFormItem,
- { label: '评测难度', path: 'type' },
- {
- default: () => [
- createVNode(NSpace, null, {
- default: () => [
- createVNode(
- NButton,
- {
- secondary: !0,
- class: [
- styles$1.switch,
- r.difficulty === '1' ? styles$1.active : ''
- ],
- onClick: () => (r.difficulty = '1')
- },
- { default: () => [createTextVNode('入门级')] }
- ),
- createVNode(
- NButton,
- {
- secondary: !0,
- class: [
- styles$1.switch,
- r.difficulty === '2' ? styles$1.active : ''
- ],
- onClick: () => (r.difficulty = '2')
- },
- { default: () => [createTextVNode('进阶级')] }
- ),
- createVNode(
- NButton,
- {
- secondary: !0,
- class: [
- styles$1.switch,
- r.difficulty === '3' ? styles$1.active : ''
- ],
- onClick: () => (r.difficulty = '3')
- },
- { default: () => [createTextVNode('大师级')] }
- )
- ]
- })
- ]
- }
- ),
- createVNode(
- NFormItem,
- { label: '评测速度' },
- {
- default: () => [
- createVNode(NInputGroup, null, {
- default: () => [
- createVNode(NInput, null, null),
- createVNode(NInputGroupLabel, null, {
- default: () => [createTextVNode('分钟')]
- })
- ]
- })
- ]
- }
- ),
- createVNode(
- NFormItem,
- { label: '合格分数' },
- {
- default: () => [
- createVNode(NInputGroup, null, {
- default: () => [
- createVNode(NInput, null, null),
- createVNode(NInputGroupLabel, null, {
- default: () => [createTextVNode('分')]
- })
- ]
- })
- ]
- }
- )
- ]),
- createVNode(
- NSpace,
- { class: styles$1.updateBtnGroup },
- {
- default: () => [
- createVNode(
- NButton,
- {
- strong: !0,
- type: 'default',
- round: !0,
- onClick: () => t('close')
- },
- { default: () => [createTextVNode('取消')] }
- ),
- createVNode(
- NButton,
- {
- strong: !0,
- type: 'primary',
- round: !0,
- onClick: () => t('close')
- },
- { default: () => [createTextVNode('确认')] }
- )
- ]
- }
- )
- ]
- }
- )
- ]);
- }
- }),
- selectMusic = '_selectMusic_1akyv_1',
- close = '_close_1akyv_30',
- listContainer = '_listContainer_1akyv_37',
- list = '_list_1akyv_37',
- searchGroup = '_searchGroup_1akyv_50',
- inputSearch = '_inputSearch_1akyv_72',
- styles = {
- selectMusic,
- close,
- listContainer,
- list,
- searchGroup,
- inputSearch
- },
- SearchGroup = defineComponent({
- name: 'search-group',
- setup() {
- return (
- ref(!1),
- reactive({ search: '' }),
- () =>
- createVNode('div', { class: styles.searchGroup }, [
- createVNode(
- NForm,
- { labelAlign: 'left', labelPlacement: 'left' },
- {
- default: () => [
- createVNode(
- NFormItem,
- { label: '教材:' },
- {
- default: () => [
- createVNode(NSpace, null, {
- default: () => [
- createVNode(
- NButton,
- {
- secondary: !0,
- strong: !0,
- type: 'primary',
- focusable: !1
- },
- { default: () => [createTextVNode('全部')] }
- ),
- createVNode(
- NButton,
- { quaternary: !0, focusable: !1 },
- { default: () => [createTextVNode('人教版')] }
- ),
- createVNode(
- NButton,
- { quaternary: !0, focusable: !1 },
- { default: () => [createTextVNode('声部训练')] }
- ),
- createVNode(
- NButton,
- { quaternary: !0, focusable: !1 },
- { default: () => [createTextVNode('小曲目')] }
- ),
- createVNode(
- NButton,
- { quaternary: !0, focusable: !1 },
- { default: () => [createTextVNode('考级曲目')] }
- )
- ]
- })
- ]
- }
- ),
- createVNode(
- NFormItem,
- { label: '乐器:' },
- {
- default: () => [
- createVNode(NSpace, null, {
- default: () => [
- createVNode(
- NButton,
- { secondary: !0, strong: !0, type: 'primary' },
- { default: () => [createTextVNode('全部')] }
- ),
- createVNode(
- NButton,
- {
- quaternary: !0,
- focusable: !1,
- type: 'default'
- },
- { default: () => [createTextVNode('竖笛')] }
- ),
- createVNode(
- NButton,
- {
- quaternary: !0,
- focusable: !1,
- type: 'default'
- },
- { default: () => [createTextVNode('排萧')] }
- ),
- createVNode(
- NButton,
- {
- quaternary: !0,
- focusable: !1,
- type: 'default'
- },
- { default: () => [createTextVNode('口风琴')] }
- ),
- createVNode(
- NButton,
- {
- quaternary: !0,
- focusable: !1,
- type: 'default'
- },
- { default: () => [createTextVNode('陶笛')] }
- ),
- createVNode(
- NButton,
- {
- quaternary: !0,
- focusable: !1,
- type: 'default'
- },
- { default: () => [createTextVNode('葫芦丝')] }
- )
- ]
- })
- ]
- }
- )
- ]
- }
- ),
- createVNode(
- TheSearch,
- { class: styles.inputSearch, round: !0 },
- null
- )
- ])
- );
- }
- }),
- SelectMusic = defineComponent({
- name: 'select-music',
- emits: ['select'],
- setup(e, { emit: t }) {
- const r = reactive({ list: [], height: '100%' });
- return (
- (() => {
- const s = listData.rows || [];
- console.log(s);
- const n = [];
- s.forEach((a, o) => {
- o <= 10 &&
- n.push({
- id: a.id,
- type: 'MUSIC',
- title: a.musicSheetName,
- url: a.fixedTone ? a.fixedTone.split(',')[0] : '',
- isCollect: !(o % 3),
- isSelected: !(o % 4)
- });
- }),
- (r.list = n || []);
- })(),
- () =>
- createVNode('div', { class: styles.selectMusic }, [
- createVNode(
- NTabs,
- {
- animated: !0,
- defaultValue: 'shareResources',
- paneClass: styles.paneTitle,
- justifyContent: 'center',
- paneWrapperClass: styles.paneWrapperContainer
- },
- {
- default: () => [
- createVNode(
- NTabPane,
- { name: 'shareResources', tab: '选择曲目' },
- {
- default: () => [
- createVNode(SearchGroup, null, null),
- createVNode(
- NScrollbar,
- { class: styles.listContainer },
- {
- default: () => [
- createVNode('div', { class: styles.list }, [
- r.list.map(s =>
- createVNode(
- CardType,
- {
- isShowAdd: !0,
- item: s,
- onAdd: n => t('select', n)
- },
- null
- )
- )
- ])
- ]
- }
- )
- ]
- }
- )
- ]
- }
- )
- ])
- );
- }
- });
- function _isSlot$1(e) {
- return (
- typeof e == 'function' ||
- (Object.prototype.toString.call(e) === '[object Object]' && !isVNode(e))
- );
- }
- const TrainSettings = defineComponent({
- name: 'train-settings',
- emits: ['close'],
- setup(e, { emit: t }) {
- const r = reactive({ editStatus: !1, selectMusicStatus: !1 }),
- i = [
- {
- id: 22078,
- src: 'https://cloud-coach.ks3-cn-beijing.ksyuncs.com/music-sheet-fixed/1675770786664-1.png',
- type: 'practice',
- name: '彩虹岛',
- typeList: ['1-12小节', '速度90', '20分钟']
- },
- {
- id: 22048,
- src: 'https://cloud-coach.ks3-cn-beijing.ksyuncs.com/music-sheet-fixed/1675839970286-1.png',
- type: 'evaluation',
- name: '彩云追月',
- typeList: ['入门级', '全部小节', '速度90', '20分钟']
- }
- ];
- return () => {
- let s;
- return createVNode('div', { class: styles$3.trainSettings }, [
- createVNode('div', { class: styles$3.searchGroup }, [
- createVNode(
- NButton,
- { onClick: () => (r.selectMusicStatus = !0) },
- { default: () => [createTextVNode('添加训练')] }
- ),
- createVNode('div', { class: styles$3.datetime }, [
- createVNode('label', null, [createTextVNode('截止时间:')]),
- createVNode(
- NDatePicker,
- {
- style: { width: '200px' },
- 'value-format': 'yyyy-MM-dd',
- type: 'date',
- clearable: !0,
- placeholder: '请选择截止日期'
- },
- null
- )
- ])
- ]),
- createVNode(
- NScrollbar,
- { class: styles$3.trainList },
- _isSlot$1(
- (s = i.map(n =>
- createVNode(
- TrainType,
- {
- item: n,
- onEdit: () => {
- console.log('edit'), (r.editStatus = !0);
- }
- },
- null
- )
- ))
- )
- ? s
- : { default: () => [s] }
- ),
- createVNode(
- NSpace,
- { class: styles$3.trainBtnGroup },
- {
- default: () => [
- createVNode(
- NButton,
- {
- strong: !0,
- type: 'default',
- round: !0,
- onClick: () => t('close')
- },
- { default: () => [createTextVNode('取消布置')] }
- ),
- createVNode(
- NButton,
- { strong: !0, type: 'primary', round: !0 },
- { default: () => [createTextVNode('立即布置')] }
- )
- ]
- }
- ),
- createVNode(
- NModal,
- {
- show: r.editStatus,
- 'onUpdate:show': n => (r.editStatus = n),
- class: ['modalTitle background', styles$3.trainEditModal],
- preset: 'card',
- title: '训练设置'
- },
- {
- default: () => [
- createVNode(
- TrainUpdate,
- { onClose: () => (r.editStatus = !1) },
- null
- )
- ]
- }
- ),
- createVNode(
- NModal,
- {
- show: r.selectMusicStatus,
- 'onUpdate:show': n => (r.selectMusicStatus = n),
- class: ['modalTitle', styles$3.selectMusicModal],
- preset: 'card',
- title: '选择曲目'
- },
- {
- default: () => [
- createVNode(
- SelectMusic,
- {
- onSelect: () => {
- (r.selectMusicStatus = !1), (r.editStatus = !0);
- }
- },
- null
- )
- ]
- }
- )
- ]);
- };
- }
- });
- function _isSlot(e) {
- return (
- typeof e == 'function' ||
- (Object.prototype.toString.call(e) === '[object Object]' && !isVNode(e))
- );
- }
- const index = defineComponent({
- name: 'CoursewarePlay',
- setup() {
- const e = useMessage(),
- t = reactive({ width: '100vw' }),
- r = () => {
- const I = Math.min(screen.width, screen.height),
- V = Math.max(screen.width, screen.height),
- D = I * (16 / 9);
- if (D > V) {
- t.width = '100vw';
- return;
- } else t.width = D + 'px';
- },
- i = (I = 0) => {
- r();
- };
- i(),
- onUnmounted(() => {
- i(1);
- });
- const s = reactive({
- detail: null,
- knowledgePointList: [],
- itemList: [],
- showHead: !0,
- isCourse: !1,
- isRecordPlay: !1,
- videoRefs: {},
- audioRefs: {},
- modelAttendStatus: !1,
- modelTrainStatus: !1
- }),
- n = reactive({
- isAutoPlay: !0,
- nowTime: 0,
- model: !0,
- isAnimation: !0,
- videoBtns: !0,
- currentTime: 0,
- duration: 0,
- timer: null,
- item: null
- }),
- a = async () => {
- (s.knowledgePointList = [
- {
- id: '1',
- name: '其多列',
- title: '其多列',
- type: 'VIDEO',
- content:
- 'https://gyt.ks3-cn-beijing.ksyuncs.com/courseware/1687844560120.mp4',
- url: 'https://gyt.ks3-cn-beijing.ksyuncs.com/courseware/1687844640957.png'
- },
- {
- id: '5',
- name: '歌曲表演 大鹿',
- title: '歌曲表演 大鹿',
- type: 'SONG',
- content:
- 'https://cloud-coach.ks3-cn-beijing.ksyuncs.com/1686819360752.mp3',
- url: 'https://gyt.ks3-cn-beijing.ksyuncs.com/courseware/1687916228530.png'
- },
- {
- id: '2',
- name: '其多列',
- title: '其多列',
- type: 'IMG',
- content:
- 'https://gyt.ks3-cn-beijing.ksyuncs.com/courseware/1688007481564.jpg',
- url: 'https://gyt.ks3-cn-beijing.ksyuncs.com/courseware/1688007481564.jpg'
- },
- {
- id: '4',
- name: '歌曲 其多列',
- title: '其多列',
- type: 'MUSIC',
- content: '43541',
- url: 'https://cloud-coach.ks3-cn-beijing.ksyuncs.com/music-sheet-first/1687847690372-1.png'
- }
- ]),
- (s.itemList = s.knowledgePointList.map(I => ({
- ...I,
- iframeRef: null,
- videoEle: null,
- audioEle: null,
- autoPlay: !1,
- isprepare: !1,
- isRender: !1
- })));
- },
- o = I => {
- var V;
- ((V = I.data) == null ? void 0 : V.api) === 'headerTogge' &&
- (n.model = I.data.show || I.data.playState != 'play');
- };
- onMounted(() => {
- a();
- });
- const l = reactive({ open: !1, activeIndex: 0, toolOpen: !1 }),
- c = () => {
- var I, V;
- for (let D = 0; D < s.itemList.length; D++) {
- const N = s.itemList[D];
- N.type === 'VIDEO' && N.videoEle && N.videoEle.stop(),
- N.type === 'SONG' && N.audioEle && N.audioEle.stop(),
- N.type === 'MUSIC' &&
- ((V = (I = N.iframeRef) == null ? void 0 : I.contentWindow) ==
- null ||
- V.postMessage({ api: 'setPlayState' }, '*'));
- }
- },
- g = I => {
- const V = s.itemList.findIndex(D => D.id == I);
- V > -1 && f(V);
- },
- S = () => {
- clearTimeout(n.timer),
- e.destroyAll(),
- (n.timer = setTimeout(() => {
- (n.model = !1),
- Object.values(s.videoRefs).map(I => I.toggleHideControl(!1)),
- Object.values(s.audioRefs).map(I => I.toggleHideControl(!1));
- }, 4e3));
- },
- p = () => {
- clearTimeout(n.timer),
- e.destroyAll(),
- (n.model = !1),
- Object.values(s.videoRefs).map(I => I.toggleHideControl(!1)),
- Object.values(s.audioRefs).map(I => I.toggleHideControl(!1));
- },
- P = (I = !0) => {
- (n.model = I),
- Object.values(s.videoRefs).map(V => V.toggleHideControl(I)),
- Object.values(s.audioRefs).map(V => V.toggleHideControl(I));
- },
- b = I => {
- if (I && I.type === 'VIDEO') {
- const V = I.videoEle;
- V &&
- (V.paused
- ? (e.destroyAll(), V.play())
- : (e.warning('已暂停'), V.pause()));
- }
- };
- ref(-4);
- const y = ref(3),
- A = [
- {
- prev: { transform: 'translate3d(0, 0, -800px) rotateX(180deg)' },
- next: { transform: 'translate3d(0, 0, -800px) rotateX(-180deg)' }
- },
- {
- prev: { transform: 'translate3d(-100%, 0, -800px)' },
- next: { transform: 'translate3d(100%, 0, -800px)' }
- },
- {
- prev: { transform: 'translate3d(-50%, 0, -800px) rotateY(80deg)' },
- next: { transform: 'translate3d(50%, 0, -800px) rotateY(-80deg)' }
- },
- {
- prev: { transform: 'translate3d(-100%, 0, -800px) rotateY(-120deg)' },
- next: { transform: 'translate3d(100%, 0, -800px) rotateY(120deg)' }
- },
- {
- prev: {
- transform: 'translate3d(-50%, 50%, -800px) rotateZ(-14deg)',
- opacity: 0
- },
- next: {
- transform: 'translate3d(50%, 50%, -800px) rotateZ(14deg)',
- opacity: 0
- }
- },
- {
- prev: {
- transform: 'translateZ(-800px) rotate3d(0, -1, 0, 90deg)',
- opacity: 0
- },
- next: {
- transform: 'translateZ(-800px) rotate3d(0, 1, 0, 90deg)',
- opacity: 0
- },
- current: { transitionDelay: '700ms' }
- }
- ],
- u = ref(),
- f = I => {
- l.activeIndex != I &&
- (c(),
- clearTimeout(u.value),
- m(l.activeIndex, I),
- (l.activeIndex = I),
- (u.value = setTimeout(
- () => {
- const V = s.itemList[I];
- V &&
- (V.type == 'MUSIC' && (n.model = !0),
- V.type === 'SONG' && (clearTimeout(n.timer), e.destroyAll()),
- V.type === 'VIDEO' && (clearTimeout(n.timer), e.destroyAll()));
- },
- n.isAnimation ? 800 : 0
- )));
- },
- m = (I, V) => {
- const D = s.itemList[I],
- N = s.itemList[V];
- if (N) {
- if (N.knowledgePointId != D.knowledgePointId) {
- n.isAnimation = !0;
- return;
- }
- const $ = D.videoEle,
- O = N.videoEle;
- ($ && $.duration < 8 && I < V) || (O && O.duration < 8 && I > V)
- ? (n.isAnimation = !1)
- : (n.isAnimation = !0);
- } else
- n.isAnimation = !((D == null ? void 0 : D.adviseStudyTimeSecond) < 8);
- },
- d = I => {
- f(I === 'up' ? l.activeIndex - 1 : l.activeIndex + 1);
- },
- E = () => {
- var V, D;
- const I = s.itemList[l.activeIndex];
- (I == null ? void 0 : I.type) == 'VIDEO' &&
- !((V = I.videoEle) != null && V.paused) &&
- S(),
- (I == null ? void 0 : I.type) == 'SONG' &&
- !((D = I.audioEle) != null && D.paused) &&
- S();
- };
- document.body.addEventListener('keyup', I => {
- if (I.code === 'ArrowUp') {
- if (l.activeIndex === 0) return;
- d('up');
- } else if (I.code === 'ArrowDown') {
- if (l.activeIndex === s.itemList.length - 1) return;
- d('down');
- }
- });
- const T = reactive({ type: '', penShow: !1 }),
- x = I => {
- var D, N;
- const V = s.itemList[l.activeIndex];
- switch (
- (V.type === 'VIDEO' && V.videoEle && V.videoEle.pause(),
- V.type === 'SONG' && V.audioEle && V.audioEle.stop(),
- V.type === 'MUSIC' &&
- ((N = (D = V.iframeRef) == null ? void 0 : D.contentWindow) ==
- null ||
- N.postMessage({ api: 'setPlayState' }, '*')),
- p(),
- (l.toolOpen = !1),
- (T.type = I.type),
- I.type)
- ) {
- case 'pen':
- T.penShow = !0;
- break;
- case 'whiteboard':
- T.penShow = !0;
- }
- },
- _ = () => {
- (T.type = 'init'), P();
- };
- return (
- onMounted(() => {
- window.addEventListener('message', o);
- }),
- () => {
- let I;
- return createVNode(
- 'div',
- { id: 'playContent', class: styles$8.playContent },
- [
- createVNode(
- 'div',
- {
- onClick: () => {
- clearTimeout(n.timer),
- (n.model = !n.model),
- Object.values(s.videoRefs).map(V =>
- V.toggleHideControl(n.model)
- ),
- Object.values(s.audioRefs).map(V =>
- V.toggleHideControl(n.model)
- );
- }
- },
- [
- createVNode(
- 'div',
- {
- class: styles$8.coursewarePlay,
- style: { width: t.width },
- onClick: V => {
- V.stopPropagation(), S();
- }
- },
- [
- createVNode('div', { class: styles$8.wraps }, [
- s.itemList.map((V, D) => {
- const N = V.isRender || Math.abs(l.activeIndex - D) < 2,
- $ = Math.abs(l.activeIndex - D) > 4;
- return (
- N && (V.isRender = !0),
- N
- ? createVNode(
- 'div',
- {
- key: 'index' + D,
- class: [
- styles$8.itemDiv,
- l.activeIndex === D && styles$8.itemActive,
- n.isAnimation && styles$8.acitveAnimation,
- Math.abs(l.activeIndex - D) < 2
- ? styles$8.show
- : styles$8.hide
- ],
- style:
- D < l.activeIndex
- ? A[y.value].prev
- : D > l.activeIndex
- ? A[y.value].next
- : {},
- onClick: O => {
- if (
- (O.stopPropagation(),
- clearTimeout(n.timer),
- Date.now() - n.nowTime < 300)
- ) {
- b(V);
- return;
- }
- (n.nowTime = Date.now()),
- (n.timer = setTimeout(() => {
- (n.model = !n.model),
- Object.values(s.videoRefs).map(B =>
- B.toggleHideControl(n.model)
- ),
- Object.values(s.audioRefs).map(B =>
- B.toggleHideControl(n.model)
- ),
- n.model && S();
- }, 300));
- }
- },
- [
- V.type === 'VIDEO'
- ? createVNode(Fragment, null, [
- createVNode(
- VideoPlay,
- {
- ref: O => (s.videoRefs[D] = O),
- item: V,
- isEmtry: $,
- onLoadedmetadata: O => {
- (V.videoEle = O),
- (V.isprepare = !0);
- },
- onTogglePlay: O => {
- (V.autoPlay = !1),
- O || l.open
- ? clearTimeout(n.timer)
- : S();
- },
- onEnded: () => {
- const O = l.activeIndex + 1;
- O < s.itemList.length && f(O);
- },
- onReset: () => {
- var O;
- ((O = V.videoEle) != null &&
- O.paused) ||
- S();
- }
- },
- null
- ),
- createVNode(
- Transition,
- { name: 'van-fade' },
- {
- default: () => [
- !V.isprepare &&
- createVNode(
- 'div',
- { class: styles$8.loadWrap },
- [
- createVNode(
- Vue3Lottie,
- {
- animationData:
- playLoadData
- },
- null
- )
- ]
- )
- ]
- }
- )
- ])
- : V.type === 'IMG'
- ? createVNode(
- 'img',
- { src: V.content },
- null
- )
- : V.type === 'SONG'
- ? createVNode(
- AudioPay,
- {
- item: V,
- ref: O => (s.audioRefs[D] = O),
- onLoadedmetadata: O => {
- (V.audioEle = O),
- (V.isprepare = !0);
- },
- onTogglePlay: O => {
- (V.autoPlay = !1),
- O || l.open
- ? clearTimeout(n.timer)
- : S();
- },
- onEnded: () => {
- const O = l.activeIndex + 1;
- O < s.itemList.length && f(O);
- },
- onReset: () => {
- var O;
- ((O = V.audioEle) != null &&
- O.paused) ||
- S();
- }
- },
- null
- )
- : createVNode(
- MusicScore,
- {
- activeModel: n.model,
- 'data-vid': V.id,
- music: V,
- onSetIframe: O => {
- V.iframeRef = O;
- }
- },
- null
- )
- ]
- )
- : null
- );
- })
- ]),
- createVNode(
- Transition,
- { name: 'right' },
- {
- default: () => [
- n.model &&
- createVNode(
- 'div',
- {
- class: styles$8.rightFixedBtns,
- onClick: V => {
- V.stopPropagation(), clearTimeout(n.timer);
- }
- },
- [
- createVNode(
- 'div',
- {
- class: [
- styles$8.fullBtn,
- l.activeIndex === 0
- ? styles$8.btnsDisabled
- : ''
- ],
- onClick: () => {
- l.activeIndex !== 0 && d('up');
- }
- },
- [createVNode('img', { src: iconUp }, null)]
- ),
- createVNode(
- 'div',
- {
- class: [styles$8.fullBtn, styles$8.point],
- onClick: () => (l.open = !0)
- },
- [createVNode('img', { src: iconMenu }, null)]
- ),
- createVNode(
- 'div',
- {
- class: [
- styles$8.fullBtn,
- l.activeIndex === s.itemList.length - 1
- ? styles$8.btnsDisabled
- : ''
- ],
- onClick: () => {
- l.activeIndex !== s.itemList.length - 1 &&
- d('down');
- }
- },
- [createVNode('img', { src: iconDown }, null)]
- )
- ]
- )
- ]
- }
- )
- ]
- )
- ]
- ),
- createVNode(
- 'div',
- {
- class: [
- styles$8.assignHomework,
- n.model ? '' : styles$8.sectionAnimateUp
- ],
- onClick: () => (s.modelAttendStatus = !0)
- },
- [createVNode('img', { src: iconAssignHomework }, null)]
- ),
- createVNode(
- 'div',
- {
- class: [
- styles$8.switchDisplaySection,
- n.model ? '' : styles$8.sectionAnimate
- ]
- },
- [
- createVNode(
- NTooltip,
- { trigger: 'hover' },
- {
- trigger: () =>
- createVNode(
- 'div',
- {
- class: styles$8.displayBtn,
- onClick: () =>
- x({ type: 'pen', icon: iconNote, name: '批注' })
- },
- [createVNode('img', { src: iconNote }, null)]
- ),
- default: () => '批注'
- }
- ),
- createVNode(
- NTooltip,
- { trigger: 'hover' },
- {
- trigger: () =>
- createVNode(
- 'div',
- {
- class: styles$8.displayBtn,
- onClick: () =>
- x({
- type: 'whiteboard',
- icon: iconWhiteboard,
- name: '白板'
- })
- },
- [createVNode('img', { src: iconWhiteboard }, null)]
- ),
- default: () => '白板'
- }
- )
- ]
- ),
- createVNode(
- NDrawer,
- {
- show: l.open,
- 'onUpdate:show': V => (l.open = V),
- class: styles$8.drawerContainer,
- onAfterLeave: E,
- showMask: !1
- },
- {
- default: () => [
- createVNode(
- NDrawerContent,
- { title: '资源列表', closable: !0 },
- _isSlot(
- (I = s.knowledgePointList.map((V, D) =>
- createVNode(
- CardType,
- {
- item: V,
- isActive: l.activeIndex === D,
- isCollect: !1,
- onClick: N => {
- (l.open = !1), g(N.id);
- }
- },
- null
- )
- ))
- )
- ? I
- : { default: () => [I] }
- )
- ]
- }
- ),
- T.penShow &&
- createVNode(
- Pen,
- {
- show: T.type === 'pen' || T.type === 'whiteboard',
- type: T.type,
- close: () => _()
- },
- null
- ),
- createVNode(
- NModal,
- {
- show: s.modelAttendStatus,
- 'onUpdate:show': V => (s.modelAttendStatus = V),
- preset: 'card',
- class: styles$8.attendClassModal,
- title: '课后训练'
- },
- {
- default: () => [
- createVNode('div', { class: styles$8.modelAttendContent }, [
- createTextVNode('本节课已设置课后训练,是否布置?')
- ]),
- createVNode(
- NSpace,
- { class: styles$8.modelAttendBtnGroup },
- {
- default: () => [
- createVNode(
- NButton,
- {
- type: 'default',
- round: !0,
- onClick: () => {
- (s.modelAttendStatus = !1), window.close();
- }
- },
- { default: () => [createTextVNode('暂不布置')] }
- ),
- createVNode(
- NButton,
- {
- type: 'primary',
- round: !0,
- onClick: () => {
- (s.modelTrainStatus = !0),
- (s.modelAttendStatus = !1);
- }
- },
- { default: () => [createTextVNode('布置')] }
- )
- ]
- }
- )
- ]
- }
- ),
- createVNode(
- NModal,
- {
- show: s.modelTrainStatus,
- 'onUpdate:show': V => (s.modelTrainStatus = V),
- preset: 'card',
- class: [styles$8.attendClassModal, styles$8.trainClassModal],
- title: '训练设置'
- },
- {
- default: () => [
- createVNode(
- TrainSettings,
- { onClose: () => (s.modelTrainStatus = !1) },
- null
- )
- ]
- }
- )
- ]
- );
- }
- );
- }
- });
- export { index as default };
|