26.js 965 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359
  1. (window["webpackJsonp"] = window["webpackJsonp"] || []).push([[26],{
  2. /***/ "../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!../../node_modules/vue-lottie/src/lottie.vue?vue&type=script&lang=js":
  3. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  4. !*** D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--13-0!D:/web_src/4dkankan_v4/node_modules/babel-loader/lib!D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--1-0!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist??ref--1-1!D:/web_src/4dkankan_v4/node_modules/vue-lottie/src/lottie.vue?vue&type=script&lang=js ***!
  5. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  6. /*! exports provided: default */
  7. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8. "use strict";
  9. __webpack_require__.r(__webpack_exports__);
  10. /* harmony import */ var lottie_web__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lottie-web */ "../../node_modules/lottie-web/build/player/lottie.js");
  11. /* harmony import */ var lottie_web__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lottie_web__WEBPACK_IMPORTED_MODULE_0__);
  12. /* harmony default export */ __webpack_exports__["default"] = ({
  13. props: {
  14. options: {
  15. type: Object,
  16. required: true
  17. },
  18. height: Number,
  19. width: Number
  20. },
  21. data() {
  22. return {
  23. style: {
  24. width: this.width ? `${this.width}px` : '100%',
  25. height: this.height ? `${this.height}px` : '100%',
  26. overflow: 'hidden',
  27. margin: '0 auto'
  28. }
  29. };
  30. },
  31. mounted() {
  32. this.anim = lottie_web__WEBPACK_IMPORTED_MODULE_0___default.a.loadAnimation({
  33. container: this.$refs.lavContainer,
  34. renderer: 'svg',
  35. loop: this.options.loop !== false,
  36. autoplay: this.options.autoplay !== false,
  37. animationData: this.options.animationData,
  38. rendererSettings: this.options.rendererSettings
  39. });
  40. this.$emit('animCreated', this.anim);
  41. }
  42. });
  43. /***/ }),
  44. /***/ "../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/scene/detail.vue?vue&type=script&lang=ts&setup=true":
  45. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  46. !*** D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--14-0!D:/web_src/4dkankan_v4/node_modules/babel-loader/lib!D:/web_src/4dkankan_v4/node_modules/ts-loader??ref--14-2!D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--1-0!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist??ref--1-1!./src/app/program/views/scene/detail.vue?vue&type=script&lang=ts&setup=true ***!
  47. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  48. /*! exports provided: default */
  49. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50. "use strict";
  51. __webpack_require__.r(__webpack_exports__);
  52. /* harmony import */ var core_js_modules_es_error_cause_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.error.cause.js */ "../../node_modules/core-js/modules/es.error.cause.js");
  53. /* harmony import */ var core_js_modules_es_error_cause_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_error_cause_js__WEBPACK_IMPORTED_MODULE_0__);
  54. /* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ "../../node_modules/core-js/modules/es.array.push.js");
  55. /* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__);
  56. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vue */ "../../node_modules/vue/dist/vue.runtime.esm-bundler.js");
  57. /* harmony import */ var _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/app/program/store/scene */ "./src/app/program/store/scene.ts");
  58. /* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ant-design-vue */ "../../node_modules/ant-design-vue/es/index.js");
  59. /* harmony import */ var _lang__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/lang */ "./src/lang/index.ts");
  60. /* harmony import */ var _app_program_hook__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/app/program/hook */ "./src/app/program/hook/index.ts");
  61. /* harmony import */ var _store_type__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../store/type */ "./src/app/program/store/type.ts");
  62. /* harmony import */ var _app_program_hook_serve__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/app/program/hook/serve */ "./src/app/program/hook/serve.ts");
  63. /* harmony import */ var _store_sys__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../store/sys */ "./src/app/program/store/sys.ts");
  64. /* harmony import */ var _store_auth__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../store/auth */ "./src/app/program/store/auth.ts");
  65. var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
  66. function adopt(value) {
  67. return value instanceof P ? value : new P(function (resolve) {
  68. resolve(value);
  69. });
  70. }
  71. return new (P || (P = Promise))(function (resolve, reject) {
  72. function fulfilled(value) {
  73. try {
  74. step(generator.next(value));
  75. } catch (e) {
  76. reject(e);
  77. }
  78. }
  79. function rejected(value) {
  80. try {
  81. step(generator["throw"](value));
  82. } catch (e) {
  83. reject(e);
  84. }
  85. }
  86. function step(result) {
  87. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  88. }
  89. step((generator = generator.apply(thisArg, _arguments || [])).next());
  90. });
  91. };
  92. var __generator = undefined && undefined.__generator || function (thisArg, body) {
  93. var _ = {
  94. label: 0,
  95. sent: function () {
  96. if (t[0] & 1) throw t[1];
  97. return t[1];
  98. },
  99. trys: [],
  100. ops: []
  101. },
  102. f,
  103. y,
  104. t,
  105. g;
  106. return g = {
  107. next: verb(0),
  108. "throw": verb(1),
  109. "return": verb(2)
  110. }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
  111. return this;
  112. }), g;
  113. function verb(n) {
  114. return function (v) {
  115. return step([n, v]);
  116. };
  117. }
  118. function step(op) {
  119. if (f) throw new TypeError("Generator is already executing.");
  120. while (g && (g = 0, op[0] && (_ = 0)), _) try {
  121. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  122. if (y = 0, t) op = [op[0] & 2, t.value];
  123. switch (op[0]) {
  124. case 0:
  125. case 1:
  126. t = op;
  127. break;
  128. case 4:
  129. _.label++;
  130. return {
  131. value: op[1],
  132. done: false
  133. };
  134. case 5:
  135. _.label++;
  136. y = op[1];
  137. op = [0];
  138. continue;
  139. case 7:
  140. op = _.ops.pop();
  141. _.trys.pop();
  142. continue;
  143. default:
  144. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  145. _ = 0;
  146. continue;
  147. }
  148. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  149. _.label = op[1];
  150. break;
  151. }
  152. if (op[0] === 6 && _.label < t[1]) {
  153. _.label = t[1];
  154. t = op;
  155. break;
  156. }
  157. if (t && _.label < t[2]) {
  158. _.label = t[2];
  159. _.ops.push(op);
  160. break;
  161. }
  162. if (t[2]) _.ops.pop();
  163. _.trys.pop();
  164. continue;
  165. }
  166. op = body.call(thisArg, _);
  167. } catch (e) {
  168. op = [6, e];
  169. y = 0;
  170. } finally {
  171. f = t = 0;
  172. }
  173. if (op[0] & 5) throw op[1];
  174. return {
  175. value: op[0] ? op[1] : void 0,
  176. done: true
  177. };
  178. }
  179. };
  180. /* harmony default export */ __webpack_exports__["default"] = (/*#__PURE__*/Object(vue__WEBPACK_IMPORTED_MODULE_2__["defineComponent"])({
  181. __name: 'detail',
  182. props: {
  183. tab: String
  184. },
  185. emits: ["close"],
  186. setup: function (__props, _a) {
  187. var _this = this;
  188. var expose = _a.expose,
  189. emit = _a.emit;
  190. expose();
  191. var props = __props;
  192. var isCloud = Object(vue__WEBPACK_IMPORTED_MODULE_2__["computed"])(function () {
  193. return props.tab === _store_sys__WEBPACK_IMPORTED_MODULE_9__["SceneType"].cloud;
  194. });
  195. var currentStatus = Object(vue__WEBPACK_IMPORTED_MODULE_2__["ref"])({
  196. showBuildObjStatus: false,
  197. objProgress: 0,
  198. e57Progress: 0,
  199. offlineProgress: 0,
  200. buildE57Time: ''
  201. // showProgress: false,
  202. });
  203. var mirgrateStatus = Object(vue__WEBPACK_IMPORTED_MODULE_2__["ref"])({
  204. isStart: false,
  205. progress: -1,
  206. type: 0,
  207. sceneCode: ''
  208. });
  209. var handleClose = function () {
  210. _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["localSceneDetail"].value = null;
  211. emit('close');
  212. };
  213. var handleObjGenerate = function (scene, isShowStop) {
  214. if (isShowStop === void 0) {
  215. isShowStop = false;
  216. }
  217. return __awaiter(_this, void 0, void 0, function () {
  218. var _id, _a, data, err, _id, res;
  219. return __generator(this, function (_b) {
  220. switch (_b.label) {
  221. case 0:
  222. console.log('handleObjGenerate', scene, isShowStop);
  223. if (!isShowStop) return [3 /*break*/, 2];
  224. _id = scene._id;
  225. return [4 /*yield*/, Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["buildSceneObj"])(_id, false, '')];
  226. case 1:
  227. _b.sent();
  228. return [2 /*return*/];
  229. case 2:
  230. return [4 /*yield*/, Object(_app_program_hook_serve__WEBPACK_IMPORTED_MODULE_8__["useInteractive"])('selectDir', {
  231. title: _lang__WEBPACK_IMPORTED_MODULE_5__["ui18n"].t('program.menu.selectTitle'),
  232. append: '',
  233. free: 10
  234. })];
  235. case 3:
  236. _a = _b.sent(), data = _a.data, err = _a.err;
  237. if (!data) return [3 /*break*/, 5];
  238. _id = scene._id;
  239. return [4 /*yield*/, Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["buildSceneObj"])(_id, true, data)];
  240. case 4:
  241. res = _b.sent();
  242. console.log('data', data, res);
  243. return [3 /*break*/, 6];
  244. case 5:
  245. if (err === 401) {
  246. ant_design_vue__WEBPACK_IMPORTED_MODULE_4__["message"].error(_lang__WEBPACK_IMPORTED_MODULE_5__["ui18n"].t('program.menu.langTip'));
  247. }
  248. _b.label = 6;
  249. case 6:
  250. return [2 /*return*/];
  251. }
  252. });
  253. });
  254. };
  255. var handleE57Generate = function (scene, isShowStop) {
  256. if (isShowStop === void 0) {
  257. isShowStop = false;
  258. }
  259. return __awaiter(_this, void 0, void 0, function () {
  260. var _id, _a, data, err, _id, res;
  261. return __generator(this, function (_b) {
  262. switch (_b.label) {
  263. case 0:
  264. console.log('handleE57Generate', scene, isShowStop);
  265. if (!isShowStop) return [3 /*break*/, 2];
  266. _id = scene._id;
  267. return [4 /*yield*/, Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["buildSceneE57"])(_id, false, '')];
  268. case 1:
  269. _b.sent();
  270. return [2 /*return*/];
  271. case 2:
  272. return [4 /*yield*/, Object(_app_program_hook_serve__WEBPACK_IMPORTED_MODULE_8__["useInteractive"])('selectDir', {
  273. title: _lang__WEBPACK_IMPORTED_MODULE_5__["ui18n"].t('program.menu.selectTitle'),
  274. append: '',
  275. free: 10
  276. })];
  277. case 3:
  278. _a = _b.sent(), data = _a.data, err = _a.err;
  279. if (!data) return [3 /*break*/, 5];
  280. _id = scene._id;
  281. return [4 /*yield*/, Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["buildSceneE57"])(_id, true, data)];
  282. case 4:
  283. res = _b.sent();
  284. console.log('data', data, res);
  285. return [3 /*break*/, 6];
  286. case 5:
  287. if (err === 401) {
  288. ant_design_vue__WEBPACK_IMPORTED_MODULE_4__["message"].error(_lang__WEBPACK_IMPORTED_MODULE_5__["ui18n"].t('program.menu.langTip'));
  289. }
  290. _b.label = 6;
  291. case 6:
  292. return [2 /*return*/];
  293. }
  294. });
  295. });
  296. };
  297. var handleDownOfflineScene = function (scene) {
  298. return __awaiter(_this, void 0, void 0, function () {
  299. var _a, data, err, _id, res;
  300. return __generator(this, function (_b) {
  301. switch (_b.label) {
  302. case 0:
  303. console.log('handleDownOfflineScene', scene);
  304. return [4 /*yield*/, Object(_app_program_hook_serve__WEBPACK_IMPORTED_MODULE_8__["useInteractive"])('selectDir', {
  305. title: _lang__WEBPACK_IMPORTED_MODULE_5__["ui18n"].t('program.menu.selectTitle'),
  306. append: '',
  307. free: 10
  308. })];
  309. case 1:
  310. _a = _b.sent(), data = _a.data, err = _a.err;
  311. if (!data) return [3 /*break*/, 3];
  312. _id = scene._id;
  313. return [4 /*yield*/, Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["downOfflineScene"])(_id, _lang__WEBPACK_IMPORTED_MODULE_5__["lang"], data, _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["globalSceneType"].value)];
  314. case 2:
  315. res = _b.sent();
  316. console.log('data handleDownOfflineScene', data, res);
  317. return [3 /*break*/, 4];
  318. case 3:
  319. if (err === 401) {
  320. ant_design_vue__WEBPACK_IMPORTED_MODULE_4__["message"].error(_lang__WEBPACK_IMPORTED_MODULE_5__["ui18n"].t('program.menu.langTip'));
  321. }
  322. _b.label = 4;
  323. case 4:
  324. return [2 /*return*/];
  325. }
  326. });
  327. });
  328. };
  329. var handleMirgrateOut = function (scene) {
  330. return __awaiter(_this, void 0, void 0, function () {
  331. var _a, data, err, _id, sceneCode, unicode;
  332. return __generator(this, function (_b) {
  333. switch (_b.label) {
  334. case 0:
  335. return [4 /*yield*/, Object(_app_program_hook_serve__WEBPACK_IMPORTED_MODULE_8__["useInteractive"])('selectDir', {
  336. title: _lang__WEBPACK_IMPORTED_MODULE_5__["ui18n"].t('program.menu.selectTitle'),
  337. append: ''
  338. })];
  339. case 1:
  340. _a = _b.sent(), data = _a.data, err = _a.err;
  341. if (!data) return [3 /*break*/, 3];
  342. _id = scene._id, sceneCode = scene.sceneCode, unicode = scene.unicode;
  343. mirgrateStatus.value.isStart = true;
  344. mirgrateStatus.value.sceneCode = sceneCode;
  345. mirgrateStatus.value.progress = -1;
  346. return [4 /*yield*/, Object(_app_program_hook_serve__WEBPACK_IMPORTED_MODULE_8__["useInteractive"])('exportOutScene', {
  347. sceneCode: sceneCode,
  348. unicode: unicode,
  349. zipPath: data
  350. })];
  351. case 2:
  352. _b.sent();
  353. return [3 /*break*/, 4];
  354. case 3:
  355. if (err === 401) {
  356. ant_design_vue__WEBPACK_IMPORTED_MODULE_4__["message"].error(_lang__WEBPACK_IMPORTED_MODULE_5__["ui18n"].t('program.menu.langTip'));
  357. }
  358. _b.label = 4;
  359. case 4:
  360. return [2 /*return*/];
  361. }
  362. });
  363. });
  364. };
  365. var openDir = function (path) {
  366. console.log('openNewDir', path);
  367. Object(_app_program_hook_serve__WEBPACK_IMPORTED_MODULE_8__["useSend"])('openNewDir', path);
  368. };
  369. var loopRequestDetail = null;
  370. // const resetProgressBar = () => {
  371. // currentStatus.value.showProgress = false
  372. // currentStatus.value.progress = 0
  373. // }
  374. var handlefloorplanFolder = function (scene) {
  375. // sceneSource: 5/6 and buildObjStatus: !=0
  376. if (_app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["globalSceneType"].value === 1) {
  377. Object(_app_program_hook_serve__WEBPACK_IMPORTED_MODULE_8__["useSend"])('openNewDir', scene.floorPlanFolder);
  378. console.log('openNewDir', scene.floorPlanFolder);
  379. } else {
  380. Object(_app_program_hook_serve__WEBPACK_IMPORTED_MODULE_8__["useSend"])('openNewDir', scene.meshFloorPlanFolder);
  381. console.log('openNewDir', scene.meshFloorPlanFolder);
  382. }
  383. };
  384. // isStart: true,
  385. // process: 0,
  386. // type: 'import'
  387. // packingStatus 打包状态 -1 失败 0没打包,1已经打过包
  388. // packingFolder ""
  389. Object(_app_program_hook_serve__WEBPACK_IMPORTED_MODULE_8__["useSubscribe"])('migrateSceneStatusOut', function (_a) {
  390. var type = _a.type,
  391. progress = _a.progress,
  392. isStart = _a.isStart,
  393. sceneCode = _a.sceneCode;
  394. return __awaiter(_this, void 0, void 0, function () {
  395. return __generator(this, function (_b) {
  396. console.log('migrateSceneStatusOut', type, progress, isStart, sceneCode);
  397. mirgrateStatus.value.isStart = isStart;
  398. mirgrateStatus.value.progress = progress;
  399. mirgrateStatus.value.type = type;
  400. mirgrateStatus.value.sceneCode = sceneCode;
  401. return [2 /*return*/];
  402. });
  403. });
  404. });
  405. Object(vue__WEBPACK_IMPORTED_MODULE_2__["watchEffect"])(function () {
  406. return __awaiter(_this, void 0, void 0, function () {
  407. var res, res, res, res;
  408. return __generator(this, function (_a) {
  409. switch (_a.label) {
  410. case 0:
  411. if (!_app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["showDetailPanel"].value) return [3 /*break*/, 9];
  412. clearInterval(loopRequestDetail);
  413. loopRequestDetail = setInterval(function () {
  414. Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["getSceneDetail"])(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["localSceneDetail"].value.sceneCode);
  415. }, 1000);
  416. if (!(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["localSceneDetail"].value.buildObjStatus === 2)) return [3 /*break*/, 2];
  417. return [4 /*yield*/, Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["getSceneDetailBuildStatus"])(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["localSceneDetail"].value._id, "buildObj", _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["globalSceneType"].value)];
  418. case 1:
  419. res = _a.sent();
  420. if (res) {
  421. currentStatus.value.objProgress = res.progress;
  422. }
  423. _a.label = 2;
  424. case 2:
  425. if (!(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["localSceneDetail"].value.buildE57Status === 2)) return [3 /*break*/, 4];
  426. return [4 /*yield*/, Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["getSceneDetailBuildStatus"])(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["localSceneDetail"].value._id, "buildE57", _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["globalSceneType"].value)];
  427. case 3:
  428. res = _a.sent();
  429. if (res) {
  430. currentStatus.value.e57Progress = res.progress;
  431. }
  432. _a.label = 4;
  433. case 4:
  434. if (!(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["localSceneDetail"].value.buildOfflineStatus === 0)) return [3 /*break*/, 6];
  435. return [4 /*yield*/, Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["getSceneDetailBuildStatus"])(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["localSceneDetail"].value._id, "buildOffline", _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["globalSceneType"].value)];
  436. case 5:
  437. res = _a.sent();
  438. if (res) {
  439. currentStatus.value.offlineProgress = res.progress;
  440. }
  441. _a.label = 6;
  442. case 6:
  443. if (!(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["localSceneDetail"].value.meshBuildOfflineStatus === 0)) return [3 /*break*/, 8];
  444. return [4 /*yield*/, Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["getSceneDetailBuildStatus"])(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["localSceneDetail"].value._id, "buildOffline", _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["globalSceneType"].value)];
  445. case 7:
  446. res = _a.sent();
  447. if (res) {
  448. currentStatus.value.offlineProgress = res.progress;
  449. }
  450. _a.label = 8;
  451. case 8:
  452. return [3 /*break*/, 10];
  453. case 9:
  454. console.log('hideDetailPanel');
  455. loopRequestDetail && clearInterval(loopRequestDetail);
  456. _a.label = 10;
  457. case 10:
  458. return [2 /*return*/];
  459. }
  460. });
  461. });
  462. });
  463. var reCalcScenes = function (records) {
  464. return __awaiter(_this, void 0, void 0, function () {
  465. return __generator(this, function (_a) {
  466. switch (_a.label) {
  467. case 0:
  468. return [4 /*yield*/, Object(_app_program_hook__WEBPACK_IMPORTED_MODULE_6__["useConfirm"])(_lang__WEBPACK_IMPORTED_MODULE_5__["ui18n"].t('program.sceneDown.recalcMsg'))];
  469. case 1:
  470. if (_a.sent()) {
  471. records.length && Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["calcScenes"])(records, true);
  472. }
  473. return [2 /*return*/];
  474. }
  475. });
  476. });
  477. };
  478. var handleSceneRCal = function (scene) {
  479. if (scene.status == _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["CalcEnum"].ING) {
  480. return Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["pauseCalcScene"])([scene], _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["globalSceneType"].value === 2);
  481. }
  482. var isUnCal = scene.status === _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["CalcEnum"].UN;
  483. if (_app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["globalSceneType"].value === 2) {
  484. if (scene.sceneSource === 3) {
  485. //kk
  486. reCalcScenes([scene]);
  487. } else {
  488. Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["calcObj"])(scene);
  489. }
  490. } else {
  491. if (isUnCal) {
  492. //未计算
  493. Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["calcScenes"])([scene], false);
  494. } else {
  495. reCalcScenes([scene]);
  496. }
  497. }
  498. };
  499. var __returned__ = {
  500. props: props,
  501. emit: emit,
  502. isCloud: isCloud,
  503. currentStatus: currentStatus,
  504. mirgrateStatus: mirgrateStatus,
  505. handleClose: handleClose,
  506. handleObjGenerate: handleObjGenerate,
  507. handleE57Generate: handleE57Generate,
  508. handleDownOfflineScene: handleDownOfflineScene,
  509. handleMirgrateOut: handleMirgrateOut,
  510. openDir: openDir,
  511. loopRequestDetail: loopRequestDetail,
  512. handlefloorplanFolder: handlefloorplanFolder,
  513. reCalcScenes: reCalcScenes,
  514. handleSceneRCal: handleSceneRCal,
  515. localSceneDetail: _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["localSceneDetail"],
  516. globalSceneType: _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["globalSceneType"],
  517. CalcEnum: _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["CalcEnum"],
  518. TypeEnum: _store_type__WEBPACK_IMPORTED_MODULE_7__["TypeEnum"],
  519. info: _store_auth__WEBPACK_IMPORTED_MODULE_10__["info"]
  520. };
  521. Object.defineProperty(__returned__, '__isScriptSetup', {
  522. enumerable: false,
  523. value: true
  524. });
  525. return __returned__;
  526. }
  527. }));
  528. /***/ }),
  529. /***/ "../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/scene/index.vue?vue&type=script&lang=ts&setup=true":
  530. /*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  531. !*** D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--14-0!D:/web_src/4dkankan_v4/node_modules/babel-loader/lib!D:/web_src/4dkankan_v4/node_modules/ts-loader??ref--14-2!D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--1-0!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist??ref--1-1!./src/app/program/views/scene/index.vue?vue&type=script&lang=ts&setup=true ***!
  532. \*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  533. /*! exports provided: default */
  534. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  535. "use strict";
  536. __webpack_require__.r(__webpack_exports__);
  537. /* harmony import */ var core_js_modules_es_error_cause_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.error.cause.js */ "../../node_modules/core-js/modules/es.error.cause.js");
  538. /* harmony import */ var core_js_modules_es_error_cause_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_error_cause_js__WEBPACK_IMPORTED_MODULE_0__);
  539. /* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ "../../node_modules/core-js/modules/es.array.push.js");
  540. /* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__);
  541. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vue */ "../../node_modules/vue/dist/vue.runtime.esm-bundler.js");
  542. /* harmony import */ var _app_program_router__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/app/program/router */ "./src/app/program/router.ts");
  543. /* harmony import */ var _ant_design_icons_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ant-design/icons-vue */ "../../node_modules/@ant-design/icons-vue/es/index.js");
  544. /* harmony import */ var _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/app/program/store/scene */ "./src/app/program/store/scene.ts");
  545. /* harmony import */ var _components_un_data_index_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../components/un-data/index.vue */ "./src/app/program/components/un-data/index.vue");
  546. /* harmony import */ var _app_program_store_status__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/app/program/store/status */ "./src/app/program/store/status.ts");
  547. /* harmony import */ var _views_sys_main_layout_hook__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../views/sys/main-layout/hook */ "./src/app/program/views/sys/main-layout/hook.ts");
  548. /* harmony import */ var _store_auth__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../store/auth */ "./src/app/program/store/auth.ts");
  549. /* harmony import */ var _app_program_hook__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/app/program/hook */ "./src/app/program/hook/index.ts");
  550. /* harmony import */ var _app_program_store_sys__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/app/program/store/sys */ "./src/app/program/store/sys.ts");
  551. /* harmony import */ var _store_type__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../store/type */ "./src/app/program/store/type.ts");
  552. /* harmony import */ var _lang__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/lang */ "./src/lang/index.ts");
  553. /* harmony import */ var _detail_vue__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./detail.vue */ "./src/app/program/views/scene/detail.vue");
  554. /* harmony import */ var _sys_device_index_vue__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../sys/device/index.vue */ "./src/app/program/views/sys/device/index.vue");
  555. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/utils */ "./src/utils/index.ts");
  556. /* harmony import */ var ant_design_vue_es_locale_zh_CN__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ant-design-vue/es/locale/zh_CN */ "../../node_modules/ant-design-vue/es/locale/zh_CN.js");
  557. /* harmony import */ var ant_design_vue_es_locale_en_US__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ant-design-vue/es/locale/en_US */ "../../node_modules/ant-design-vue/es/locale/en_US.js");
  558. /* harmony import */ var ant_design_vue_es_locale_ja_JP__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ant-design-vue/es/locale/ja_JP */ "../../node_modules/ant-design-vue/es/locale/ja_JP.js");
  559. /* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ant-design-vue */ "../../node_modules/ant-design-vue/es/index.js");
  560. /* harmony import */ var _app_program_hook_serve__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @/app/program/hook/serve */ "./src/app/program/hook/serve.ts");
  561. /* harmony import */ var _store_camrea__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../store/camrea */ "./src/app/program/store/camrea.ts");
  562. var __assign = undefined && undefined.__assign || function () {
  563. __assign = Object.assign || function (t) {
  564. for (var s, i = 1, n = arguments.length; i < n; i++) {
  565. s = arguments[i];
  566. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  567. }
  568. return t;
  569. };
  570. return __assign.apply(this, arguments);
  571. };
  572. var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
  573. function adopt(value) {
  574. return value instanceof P ? value : new P(function (resolve) {
  575. resolve(value);
  576. });
  577. }
  578. return new (P || (P = Promise))(function (resolve, reject) {
  579. function fulfilled(value) {
  580. try {
  581. step(generator.next(value));
  582. } catch (e) {
  583. reject(e);
  584. }
  585. }
  586. function rejected(value) {
  587. try {
  588. step(generator["throw"](value));
  589. } catch (e) {
  590. reject(e);
  591. }
  592. }
  593. function step(result) {
  594. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  595. }
  596. step((generator = generator.apply(thisArg, _arguments || [])).next());
  597. });
  598. };
  599. var __generator = undefined && undefined.__generator || function (thisArg, body) {
  600. var _ = {
  601. label: 0,
  602. sent: function () {
  603. if (t[0] & 1) throw t[1];
  604. return t[1];
  605. },
  606. trys: [],
  607. ops: []
  608. },
  609. f,
  610. y,
  611. t,
  612. g;
  613. return g = {
  614. next: verb(0),
  615. "throw": verb(1),
  616. "return": verb(2)
  617. }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
  618. return this;
  619. }), g;
  620. function verb(n) {
  621. return function (v) {
  622. return step([n, v]);
  623. };
  624. }
  625. function step(op) {
  626. if (f) throw new TypeError("Generator is already executing.");
  627. while (g && (g = 0, op[0] && (_ = 0)), _) try {
  628. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  629. if (y = 0, t) op = [op[0] & 2, t.value];
  630. switch (op[0]) {
  631. case 0:
  632. case 1:
  633. t = op;
  634. break;
  635. case 4:
  636. _.label++;
  637. return {
  638. value: op[1],
  639. done: false
  640. };
  641. case 5:
  642. _.label++;
  643. y = op[1];
  644. op = [0];
  645. continue;
  646. case 7:
  647. op = _.ops.pop();
  648. _.trys.pop();
  649. continue;
  650. default:
  651. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  652. _ = 0;
  653. continue;
  654. }
  655. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  656. _.label = op[1];
  657. break;
  658. }
  659. if (op[0] === 6 && _.label < t[1]) {
  660. _.label = t[1];
  661. t = op;
  662. break;
  663. }
  664. if (t && _.label < t[2]) {
  665. _.label = t[2];
  666. _.ops.push(op);
  667. break;
  668. }
  669. if (t[2]) _.ops.pop();
  670. _.trys.pop();
  671. continue;
  672. }
  673. op = body.call(thisArg, _);
  674. } catch (e) {
  675. op = [6, e];
  676. y = 0;
  677. } finally {
  678. f = t = 0;
  679. }
  680. if (op[0] & 5) throw op[1];
  681. return {
  682. value: op[0] ? op[1] : void 0,
  683. done: true
  684. };
  685. }
  686. };
  687. /* harmony default export */ __webpack_exports__["default"] = (/*#__PURE__*/Object(vue__WEBPACK_IMPORTED_MODULE_2__["defineComponent"])({
  688. __name: 'index',
  689. setup: function (__props, _a) {
  690. var _b;
  691. var _this = this;
  692. var expose = _a.expose;
  693. expose();
  694. var antLang = Object(vue__WEBPACK_IMPORTED_MODULE_2__["computed"])(function () {
  695. if (_lang__WEBPACK_IMPORTED_MODULE_13__["lang"] === 'zh') {
  696. return ant_design_vue_es_locale_zh_CN__WEBPACK_IMPORTED_MODULE_17__["default"];
  697. } else if (_lang__WEBPACK_IMPORTED_MODULE_13__["lang"] === "en") {
  698. return ant_design_vue_es_locale_en_US__WEBPACK_IMPORTED_MODULE_18__["default"];
  699. } else if (_lang__WEBPACK_IMPORTED_MODULE_13__["lang"] === "ja") {
  700. return ant_design_vue_es_locale_ja_JP__WEBPACK_IMPORTED_MODULE_19__["default"];
  701. }
  702. });
  703. var mirgrateStatus = Object(vue__WEBPACK_IMPORTED_MODULE_2__["ref"])({
  704. isStart: false,
  705. progress: 0,
  706. type: 0
  707. });
  708. // import record from '@/lang/en/record'
  709. var scenes = Object(vue__WEBPACK_IMPORTED_MODULE_2__["ref"])([]);
  710. var refreshes = Object(vue__WEBPACK_IMPORTED_MODULE_2__["reactive"])((_b = {}, _b[_app_program_store_sys__WEBPACK_IMPORTED_MODULE_11__["SceneType"].cloud] = _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["setLocalScenes"], _b[_app_program_store_sys__WEBPACK_IMPORTED_MODULE_11__["SceneType"].obj] = _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["setLocalScenes"], _b));
  711. var current = Object(vue__WEBPACK_IMPORTED_MODULE_2__["ref"])(_app_program_store_sys__WEBPACK_IMPORTED_MODULE_11__["SceneType"].cloud);
  712. var isCloud = Object(vue__WEBPACK_IMPORTED_MODULE_2__["computed"])(function () {
  713. return current.value === _app_program_store_sys__WEBPACK_IMPORTED_MODULE_11__["SceneType"].cloud;
  714. });
  715. var columns = Object(vue__WEBPACK_IMPORTED_MODULE_2__["computed"])(function () {
  716. var base = [{
  717. title: _lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"].t('program.sceneDown.all'),
  718. slots: {
  719. customRender: 'cover'
  720. },
  721. width: '10%'
  722. }, {
  723. title: '',
  724. slots: {
  725. customRender: 'infos'
  726. },
  727. width: '70%'
  728. }, {
  729. title: '',
  730. key: 'customPanel',
  731. slots: {
  732. customRender: 'action'
  733. },
  734. width: '20%'
  735. }];
  736. if (!isCloud.value && type.value !== _store_type__WEBPACK_IMPORTED_MODULE_12__["TypeEnum"].kankan) {
  737. base[0].title = '';
  738. }
  739. return base;
  740. });
  741. var type = Object(vue__WEBPACK_IMPORTED_MODULE_2__["ref"])(_store_type__WEBPACK_IMPORTED_MODULE_12__["TypeEnum"].kankan);
  742. var pagination = {
  743. pageSize: 5,
  744. showSizeChanger: false
  745. };
  746. var selectScenesType = function (type) {
  747. _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["showDetailPanel"].value = false;
  748. // selectType.value = type
  749. if (Object(_utils__WEBPACK_IMPORTED_MODULE_16__["isNumber"])(type)) {
  750. console.log('type', type);
  751. if (type === _store_type__WEBPACK_IMPORTED_MODULE_12__["TypeEnum"].kankan) {
  752. _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["globalSceneType"].value = 2;
  753. } else {
  754. _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["globalSceneType"].value = 1;
  755. }
  756. }
  757. };
  758. var selectMeshType = function (type) {
  759. // meshOption.value = type
  760. _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["showDetailPanel"].value = false;
  761. if (type === 1) {
  762. if (allOption.value === _store_type__WEBPACK_IMPORTED_MODULE_12__["TypeEnum"].kankan) {
  763. allOption.value = null;
  764. }
  765. }
  766. refresh.value();
  767. };
  768. var refresh = Object(vue__WEBPACK_IMPORTED_MODULE_2__["computed"])(function () {
  769. return refreshes[current.value];
  770. });
  771. var selectIds = Object(vue__WEBPACK_IMPORTED_MODULE_2__["ref"])([]);
  772. var selectScenes = Object(vue__WEBPACK_IMPORTED_MODULE_2__["computed"])(function () {
  773. return selectIds.value.filter(function (qid) {
  774. return _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["localScenes"].value.some(function (_a) {
  775. var _id = _a._id;
  776. return _id === qid;
  777. });
  778. }).map(function (qid) {
  779. return _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["localScenes"].value.find(function (_a) {
  780. var _id = _a._id;
  781. return _id === qid;
  782. });
  783. });
  784. });
  785. var option = Object(vue__WEBPACK_IMPORTED_MODULE_2__["ref"])('title');
  786. var allOption = Object(vue__WEBPACK_IMPORTED_MODULE_2__["ref"])(null);
  787. var meshOption = Object(vue__WEBPACK_IMPORTED_MODULE_2__["ref"])(_app_program_store_sys__WEBPACK_IMPORTED_MODULE_11__["SceneType"].cloud);
  788. var keyword = Object(vue__WEBPACK_IMPORTED_MODULE_2__["ref"])('');
  789. // const scenes = computed(() =>
  790. // keyword.value
  791. // ? typeScenes.value.filter(scene =>
  792. // scene[option.value].toUpperCase().includes(keyword.value.toUpperCase())
  793. // )
  794. // : typeScenes.value
  795. // )
  796. var changeHandler = function (ids) {
  797. selectIds.value = ids;
  798. console.log(ids);
  799. };
  800. var getCoverMsg = function (status) {
  801. var _a;
  802. return (_a = {}, _a[_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].UN] = _lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"].t('program.sceneDown.coverStatus.un'), _a[_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].ING] = _lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"].t('program.sceneDown.coverStatus.ing'), _a[_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].ERR] = _lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"].t('program.sceneDown.coverStatus.err'), _a[_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].PAUSE] = _lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"].t('program.sceneDown.coverStatus.pause'), _a[_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].COPY] = _lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"].t('program.sceneDown.coverStatus.copy'), _a[_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].LINEUP] = _lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"].t('program.sceneDown.coverStatus.lineup'), _a)[status];
  803. };
  804. var getStatusMsg = function (status) {
  805. var _a;
  806. return (_a = {}, _a[_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].UN] = _lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"].t('program.sceneDown.msgStatus.un'), _a[_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].ING] = _lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"].t('program.sceneDown.msgStatus.ing'), _a[_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].ERR] = _lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"].t('program.sceneDown.msgStatus.err'), _a[_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].PAUSE] = _lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"].t('program.sceneDown.msgStatus.pause'), _a[_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].LINEUP] = _lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"].t('program.sceneDown.msgStatus.ing'), _a)[status];
  807. };
  808. var sceneOpen = function (records, status) {
  809. return __awaiter(_this, void 0, void 0, function () {
  810. var isKK, unScenes, ingScenes;
  811. return __generator(this, function (_a) {
  812. isKK = type.value == _store_type__WEBPACK_IMPORTED_MODULE_12__["TypeEnum"].kankan;
  813. unScenes = records.filter(function (item) {
  814. return [_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].UN, _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].ERR, _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].PAUSE].includes(item.status);
  815. });
  816. ingScenes = records.filter(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["isCalsIng"]);
  817. switch (status) {
  818. case _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].COM:
  819. Object(_app_program_router__WEBPACK_IMPORTED_MODULE_3__["jump"])({
  820. name: _app_program_router__WEBPACK_IMPORTED_MODULE_3__["metas"].edit.name,
  821. params: {
  822. m: records[0].m,
  823. type: current.value
  824. }
  825. });
  826. break;
  827. case _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].ERR:
  828. case _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].UN:
  829. case _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].PAUSE:
  830. Object(_store_auth__WEBPACK_IMPORTED_MODULE_9__["getAuth"])(true);
  831. if (!isCloud.value && !isKK) {
  832. unScenes.length && Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["calcObj"])(unScenes[0]);
  833. } else {
  834. unScenes.length && Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["calcScenes"])(unScenes);
  835. }
  836. break;
  837. case _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].ING:
  838. case _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].LINEUP:
  839. ingScenes.length && Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["pauseCalcScene"])(ingScenes, !isCloud.value && !isKK);
  840. }
  841. return [2 /*return*/];
  842. });
  843. });
  844. };
  845. var gotoFuse = function (record) {
  846. return __awaiter(_this, void 0, void 0, function () {
  847. return __generator(this, function (_a) {
  848. _app_program_router__WEBPACK_IMPORTED_MODULE_3__["router"].push({
  849. name: _app_program_router__WEBPACK_IMPORTED_MODULE_3__["metas"].fuse.name,
  850. params: {
  851. sceneId: record._id,
  852. sceneCode: record.m,
  853. fuseId: record.fuseId,
  854. mapping: record.mapping
  855. }
  856. });
  857. return [2 /*return*/];
  858. });
  859. });
  860. };
  861. var handleUnCalcScene = function (record) {
  862. Object(_store_auth__WEBPACK_IMPORTED_MODULE_9__["getAuth"])(true);
  863. // if (!isCloud.value && !isKK) {
  864. // unScenes.length && calcObj(unScenes[0])
  865. // } else {
  866. // unScenes.length && calcScenes(unScenes)
  867. // }
  868. if (_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["globalSceneType"].value === 1) {
  869. Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["calcScenes"])([record]);
  870. } else {
  871. if (record.sceneSource === 3) {
  872. Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["calcScenes"])([record]);
  873. } else {
  874. Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["calcObj"])(record);
  875. }
  876. }
  877. };
  878. var delScene = function (records) {
  879. return __awaiter(_this, void 0, void 0, function () {
  880. var isKK;
  881. return __generator(this, function (_a) {
  882. switch (_a.label) {
  883. case 0:
  884. isKK = type.value == _store_type__WEBPACK_IMPORTED_MODULE_12__["TypeEnum"].kankan;
  885. return [4 /*yield*/, Object(_app_program_hook__WEBPACK_IMPORTED_MODULE_10__["useConfirm"])(_lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"].t('program.sceneDown.delMsg'))];
  886. case 1:
  887. if (_a.sent()) {
  888. records.length && Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["deleteScenes"])(records, _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["Device"].LOCAL, !isCloud.value && !isKK, isKK);
  889. _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["showDetailPanel"].value = false;
  890. _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["localSceneDetail"].value = undefined;
  891. }
  892. return [2 /*return*/];
  893. }
  894. });
  895. });
  896. };
  897. var reCalcScenes = function (records) {
  898. return __awaiter(_this, void 0, void 0, function () {
  899. return __generator(this, function (_a) {
  900. switch (_a.label) {
  901. case 0:
  902. return [4 /*yield*/, Object(_app_program_hook__WEBPACK_IMPORTED_MODULE_10__["useConfirm"])(_lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"].t('program.calcFailureTip'))];
  903. case 1:
  904. if (_a.sent()) {
  905. records.length && Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["calcScenes"])(records, true);
  906. }
  907. return [2 /*return*/];
  908. }
  909. });
  910. });
  911. };
  912. var jumpScene = function (record, edit) {
  913. if (edit === void 0) {
  914. edit = '';
  915. }
  916. var sceneType = _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["globalSceneType"].value == 1 ? _app_program_store_sys__WEBPACK_IMPORTED_MODULE_11__["SceneType"].cloud : _app_program_store_sys__WEBPACK_IMPORTED_MODULE_11__["SceneType"].obj;
  917. console.log('jumpScene', sceneType);
  918. Object(_app_program_router__WEBPACK_IMPORTED_MODULE_3__["jump"])({
  919. name: _app_program_router__WEBPACK_IMPORTED_MODULE_3__["metas"].edit.name,
  920. params: {
  921. m: record.m,
  922. type: sceneType,
  923. edit: edit
  924. }
  925. });
  926. };
  927. var getSceneInfo = function (scene) {
  928. var infos = [];
  929. var isKK = type.value == _store_type__WEBPACK_IMPORTED_MODULE_12__["TypeEnum"].kankan;
  930. if (isCloud.value || isKK) {
  931. if (!isKK) {
  932. if (scene.buildObjStatus !== 1 && scene.status === _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].COM && !scene.isV4 && scene.buildObjStatus === 2) {
  933. infos.push(_lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"].t('program.sceneDown.objGenIng'));
  934. }
  935. }
  936. if (getStatusMsg(scene.status) && scene.syncStatus === _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["SyncEnum"].ING) {
  937. infos.push(getStatusMsg(scene.status));
  938. }
  939. }
  940. if (scene.status === _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].COM) {
  941. if (!(!isCloud.value || isKK) ? scene.downIng : scene.downIngV4) {
  942. infos.push(_lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"].t('program.sceneDown.ing'));
  943. }
  944. }
  945. return infos;
  946. };
  947. var checkSceneOpen = function (scene, label) {
  948. return getSceneMenus(scene).some(function (item) {
  949. return item.text === label;
  950. });
  951. };
  952. var checkScenesOpen = function (scenes, label) {
  953. return scenes.length && scenes.every(function (scene) {
  954. return checkSceneOpen(scene, label);
  955. });
  956. };
  957. var getSceneMenus = function (scene) {
  958. var menus = [];
  959. // || current.value === SceneType.obj
  960. var isKK = type.value == _store_type__WEBPACK_IMPORTED_MODULE_12__["TypeEnum"].kankan;
  961. var isObj = current.value === _app_program_store_sys__WEBPACK_IMPORTED_MODULE_11__["SceneType"].obj || type.value == _store_type__WEBPACK_IMPORTED_MODULE_12__["TypeEnum"].kankan;
  962. var isSingle = isKK || current.value !== _app_program_store_sys__WEBPACK_IMPORTED_MODULE_11__["SceneType"].obj || !scene.buildType || scene.buildType === 'buildObj';
  963. if (!getCoverMsg(scene.status)) {
  964. if (isKK || !isCloud.value) {
  965. menus.push({
  966. text: _lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"].t('program.sceneDown.query'),
  967. action: function () {
  968. return jumpScene(scene);
  969. }
  970. });
  971. }
  972. //TODO 先hide编辑
  973. menus.push({
  974. text: _lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"].t('program.sceneDown.edit'),
  975. action: function () {
  976. return jumpScene(scene, '1');
  977. }
  978. });
  979. }
  980. if (isCloud.value || isObj) {
  981. if (!isObj) {
  982. if (scene.status === _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].COM && scene.buildObjStatus !== 2 && ![5, 6].includes(scene.location)) {
  983. menus.push({
  984. text: _lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"].t('program.sceneDown.obgGen'),
  985. action: function () {
  986. return Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["calcObj"])(scene);
  987. }
  988. });
  989. }
  990. if (scene.status === _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].COM && scene.fuseId && _app_program_hook__WEBPACK_IMPORTED_MODULE_10__["fuse"] && scene.buildObjStatus !== 2) {
  991. menus.push({
  992. text: _lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"].t('program.sceneDown.fush'),
  993. action: function () {
  994. return gotoFuse(scene);
  995. }
  996. });
  997. }
  998. }
  999. if (getStatusMsg(scene.status) && scene.syncStatus !== _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["SyncEnum"].ING) {
  1000. if (isSingle) {
  1001. menus.push({
  1002. text: getStatusMsg(scene.status),
  1003. action: function () {
  1004. return sceneOpen([scene], scene.status);
  1005. }
  1006. });
  1007. }
  1008. }
  1009. // if (isKK && scene.status === CalcEnum.COM) {
  1010. // menus.push({ text: ui18n.t("program.sceneDown.copy"), action: () => copyScene(scene) })
  1011. // }
  1012. if (scene.status === _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].COM && scene.buildObjStatus !== 2 && isSingle) {
  1013. if (isCloud.value || isKK) {
  1014. menus.push({
  1015. text: _lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"].t('program.sceneDown.recalc'),
  1016. action: function () {
  1017. if (!isKK && !isCloud.value) {
  1018. Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["calcObj"])(scene);
  1019. } else {
  1020. reCalcScenes([scene]);
  1021. }
  1022. }
  1023. });
  1024. }
  1025. }
  1026. }
  1027. if (scene.status === _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].COM) {
  1028. if (!(!(!isCloud.value || isKK) ? scene.downIng : scene.downIngV4)) {
  1029. menus.push({
  1030. text: _lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"].t('program.sceneDown.down'),
  1031. action: function () {
  1032. return Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["downScene"])(scene, !isCloud.value || isKK);
  1033. }
  1034. });
  1035. }
  1036. }
  1037. // if (isCloud.value || isKK) {
  1038. if (
  1039. // isSingle &&
  1040. (isCloud.value || isKK) && !Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["isCalsIng"])(scene) && scene.status !== _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].COPY && scene.buildObjStatus !== 2 && !scene.downIng && !scene.downIngV4) {
  1041. menus.push({
  1042. text: _lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"].t('program.delete'),
  1043. action: function () {
  1044. return delScene([scene]);
  1045. }
  1046. });
  1047. }
  1048. // }
  1049. return menus;
  1050. };
  1051. var getList = function () {
  1052. if (keyword.value.length > 0 || Object(_utils__WEBPACK_IMPORTED_MODULE_16__["isNumber"])(allOption.value)) {
  1053. // showDetailPanel.value = false
  1054. switch (true) {
  1055. case Object(vue__WEBPACK_IMPORTED_MODULE_2__["unref"])(keyword) && Object(_utils__WEBPACK_IMPORTED_MODULE_16__["isNumber"])(allOption.value):
  1056. scenes.value = _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["localScenes"].value.filter(function (scene) {
  1057. return scene[option.value].toUpperCase().replace(/\s+/g, ' ').includes(keyword.value.toUpperCase()) && scene.type === allOption.value;
  1058. });
  1059. break;
  1060. case Object(vue__WEBPACK_IMPORTED_MODULE_2__["unref"])(keyword) && !Object(_utils__WEBPACK_IMPORTED_MODULE_16__["isNumber"])(allOption.value):
  1061. scenes.value = _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["localScenes"].value.filter(function (scene) {
  1062. return scene[option.value].toUpperCase().replace(/\s+/g, ' ').includes(keyword.value.toUpperCase());
  1063. });
  1064. break;
  1065. case !Object(vue__WEBPACK_IMPORTED_MODULE_2__["unref"])(keyword) && Object(_utils__WEBPACK_IMPORTED_MODULE_16__["isNumber"])(allOption.value):
  1066. console.log('单选');
  1067. scenes.value = _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["localScenes"].value.filter(function (scene) {
  1068. return scene.type === allOption.value;
  1069. });
  1070. break;
  1071. }
  1072. } else {
  1073. // scenes.value = localScenes.value.filter(scene => {
  1074. // console.log('scene', scene.isCloud)
  1075. // return scene
  1076. // })
  1077. scenes.value = _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["localScenes"].value;
  1078. }
  1079. // mesh要转类型
  1080. if (_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["globalSceneType"].value === 2) {
  1081. var map_1 = {
  1082. '-1': _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].ERR,
  1083. '0': _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].UN,
  1084. '1': _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].COM,
  1085. '2': _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].ING,
  1086. '3': _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].LINEUP,
  1087. '4': _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].PAUSE
  1088. };
  1089. scenes.value = scenes.value.map(function (item) {
  1090. if (item.sceneSource != 3 && item.buildObjStatus !== 0 && ![5, 6].includes(item.location)) {
  1091. // debugger
  1092. return __assign(__assign({}, item), {
  1093. id: item.id + 100000,
  1094. status: map_1[item.buildObjStatus],
  1095. // 点云只要不是计算完成,就禁用一切mesh操作
  1096. buildType: item.status !== _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"].COM ? 'buildScene' : item.buildType
  1097. });
  1098. } else {
  1099. return item;
  1100. }
  1101. });
  1102. }
  1103. };
  1104. Object(vue__WEBPACK_IMPORTED_MODULE_2__["onMounted"])(function () {
  1105. console.warn('fuck xst million times!-2025-3-13-03');
  1106. Object(vue__WEBPACK_IMPORTED_MODULE_2__["watchEffect"])(function () {
  1107. getList();
  1108. if (_app_program_router__WEBPACK_IMPORTED_MODULE_3__["router"].currentRoute.value.name !== _app_program_router__WEBPACK_IMPORTED_MODULE_3__["metas"].scene.name) {
  1109. _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["showDetailPanel"].value = false;
  1110. }
  1111. });
  1112. });
  1113. Object(_app_program_hook_serve__WEBPACK_IMPORTED_MODULE_21__["useSubscribe"])('showMigrateSceneCopyDialog', function () {
  1114. return __awaiter(_this, void 0, void 0, function () {
  1115. return __generator(this, function (_a) {
  1116. switch (_a.label) {
  1117. case 0:
  1118. return [4 /*yield*/, Object(_app_program_hook__WEBPACK_IMPORTED_MODULE_10__["useConfirm"])(_lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"].t('program.sceneDetail.isCopyExist'))];
  1119. case 1:
  1120. if (_a.sent()) {
  1121. Object(_app_program_hook_serve__WEBPACK_IMPORTED_MODULE_21__["useInteractive"])('confirmMigrateSceneCopyDialog', {});
  1122. }
  1123. return [2 /*return*/];
  1124. }
  1125. });
  1126. });
  1127. });
  1128. Object(_app_program_hook_serve__WEBPACK_IMPORTED_MODULE_21__["useSubscribe"])('migrateSceneStatus', function (_a) {
  1129. var type = _a.type,
  1130. progress = _a.progress,
  1131. isStart = _a.isStart,
  1132. error = _a.error;
  1133. return __awaiter(_this, void 0, void 0, function () {
  1134. return __generator(this, function (_b) {
  1135. console.log('migrateSceneStatus', type, progress, isStart);
  1136. mirgrateStatus.value.isStart = isStart;
  1137. mirgrateStatus.value.progress = progress;
  1138. mirgrateStatus.value.type = type;
  1139. if (error) {
  1140. ant_design_vue__WEBPACK_IMPORTED_MODULE_20__["message"].error(_lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"].t('program.migrateScene.fail_import'));
  1141. }
  1142. return [2 /*return*/];
  1143. });
  1144. });
  1145. });
  1146. var onMigrateSceneCancel = function () {
  1147. Object(_app_program_hook_serve__WEBPACK_IMPORTED_MODULE_21__["useInteractive"])('migrateSceneCancel', {});
  1148. setTimeout(function () {
  1149. mirgrateStatus.value.isStart = false;
  1150. }, 500);
  1151. };
  1152. var onPageChange = function () {
  1153. _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["showDetailPanel"].value = false;
  1154. };
  1155. var customRow = function (record) {
  1156. return {
  1157. onClick: function (event) {
  1158. return handlePanelClick(event, record);
  1159. }
  1160. };
  1161. };
  1162. var rowClassName = function (record) {
  1163. var active = record.id === _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["detailPanelId"].value;
  1164. return active ? 'active' : "";
  1165. };
  1166. var handlePanelClick = function (event, record) {
  1167. return __awaiter(_this, void 0, void 0, function () {
  1168. return __generator(this, function (_a) {
  1169. switch (_a.label) {
  1170. case 0:
  1171. console.log('event-className', event.target.className);
  1172. if (!(!String(event.target.className).includes('menu-btn') && !String(event.target.className).includes('cover'))) return [3 /*break*/, 2];
  1173. return [4 /*yield*/, Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["getSceneDetail"])(record.sceneCode)];
  1174. case 1:
  1175. _a.sent();
  1176. _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["showDetailPanel"].value = !_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["showDetailPanel"].value;
  1177. if (_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["showDetailPanel"].value) {
  1178. _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["detailPanelId"].value = record.id;
  1179. } else {
  1180. _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["detailPanelId"].value = '';
  1181. }
  1182. _a.label = 2;
  1183. case 2:
  1184. return [2 /*return*/];
  1185. }
  1186. });
  1187. });
  1188. };
  1189. var handleMirgrateIn = function () {
  1190. return __awaiter(_this, void 0, void 0, function () {
  1191. var _a, filePath, err, error_1;
  1192. return __generator(this, function (_b) {
  1193. switch (_b.label) {
  1194. case 0:
  1195. _b.trys.push([0, 5,, 6]);
  1196. return [4 /*yield*/, Object(_app_program_hook_serve__WEBPACK_IMPORTED_MODULE_21__["useInteractive"])('selectFile', {
  1197. title: _lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"].t('program.menu.selectTitle'),
  1198. extensions: ['zip']
  1199. })];
  1200. case 1:
  1201. _a = _b.sent(), filePath = _a.filePath, err = _a.err;
  1202. console.log('filePath', filePath);
  1203. if (!filePath) return [3 /*break*/, 3];
  1204. // const { _id, sceneCode, unicode } = scene
  1205. return [4 /*yield*/, Object(_app_program_hook_serve__WEBPACK_IMPORTED_MODULE_21__["useInteractive"])('exportInScene', {
  1206. // sceneCode: sceneCode,
  1207. // unicode: unicode,
  1208. zipPath: filePath
  1209. })];
  1210. case 2:
  1211. // const { _id, sceneCode, unicode } = scene
  1212. _b.sent();
  1213. return [3 /*break*/, 4];
  1214. case 3:
  1215. if (err === 401) {
  1216. ant_design_vue__WEBPACK_IMPORTED_MODULE_20__["message"].error(_lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"].t('program.menu.langTip'));
  1217. }
  1218. _b.label = 4;
  1219. case 4:
  1220. return [3 /*break*/, 6];
  1221. case 5:
  1222. error_1 = _b.sent();
  1223. return [3 /*break*/, 6];
  1224. case 6:
  1225. return [2 /*return*/];
  1226. }
  1227. });
  1228. });
  1229. };
  1230. var handleGoByCover = function (record) {
  1231. if (_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["globalSceneType"].value === 1) {
  1232. console.log('handleGoByCover-status', record.status, record.buildObjStatus);
  1233. if (!getCoverMsg(record.status) && record.buildObjStatus !== -1) {
  1234. jumpScene(record, '1');
  1235. }
  1236. } else {
  1237. if (!getCoverMsg(record.status)) {
  1238. console.log('handleGoByCover-mesh', record.status);
  1239. jumpScene(record, '');
  1240. }
  1241. }
  1242. };
  1243. var handlePauseCalcScene = function (record) {
  1244. //pauseCalcScene([record], globalSceneType.value === 2)
  1245. Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["pauseCalcScene"])([record], false);
  1246. };
  1247. Object(vue__WEBPACK_IMPORTED_MODULE_2__["watch"])(function () {
  1248. return keyword.value;
  1249. }, function () {
  1250. return _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["showDetailPanel"].value = false;
  1251. });
  1252. Object(vue__WEBPACK_IMPORTED_MODULE_2__["watch"])(function () {
  1253. return _store_camrea__WEBPACK_IMPORTED_MODULE_22__["cameraNames"].value;
  1254. }, function () {
  1255. if (_store_camrea__WEBPACK_IMPORTED_MODULE_22__["cameraNames"].value.length == 1) {
  1256. allOption.value = _store_camrea__WEBPACK_IMPORTED_MODULE_22__["cameraNames"].value[0];
  1257. }
  1258. });
  1259. var __returned__ = {
  1260. antLang: antLang,
  1261. mirgrateStatus: mirgrateStatus,
  1262. scenes: scenes,
  1263. refreshes: refreshes,
  1264. current: current,
  1265. isCloud: isCloud,
  1266. columns: columns,
  1267. type: type,
  1268. pagination: pagination,
  1269. selectScenesType: selectScenesType,
  1270. selectMeshType: selectMeshType,
  1271. refresh: refresh,
  1272. selectIds: selectIds,
  1273. selectScenes: selectScenes,
  1274. option: option,
  1275. allOption: allOption,
  1276. meshOption: meshOption,
  1277. keyword: keyword,
  1278. changeHandler: changeHandler,
  1279. getCoverMsg: getCoverMsg,
  1280. getStatusMsg: getStatusMsg,
  1281. sceneOpen: sceneOpen,
  1282. gotoFuse: gotoFuse,
  1283. handleUnCalcScene: handleUnCalcScene,
  1284. delScene: delScene,
  1285. reCalcScenes: reCalcScenes,
  1286. jumpScene: jumpScene,
  1287. getSceneInfo: getSceneInfo,
  1288. checkSceneOpen: checkSceneOpen,
  1289. checkScenesOpen: checkScenesOpen,
  1290. getSceneMenus: getSceneMenus,
  1291. getList: getList,
  1292. onMigrateSceneCancel: onMigrateSceneCancel,
  1293. onPageChange: onPageChange,
  1294. customRow: customRow,
  1295. rowClassName: rowClassName,
  1296. handlePanelClick: handlePanelClick,
  1297. handleMirgrateIn: handleMirgrateIn,
  1298. handleGoByCover: handleGoByCover,
  1299. handlePauseCalcScene: handlePauseCalcScene,
  1300. CloseCircleOutlined: _ant_design_icons_vue__WEBPACK_IMPORTED_MODULE_4__["CloseCircleOutlined"],
  1301. CalcEnum: _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["CalcEnum"],
  1302. showDetailPanel: _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["showDetailPanel"],
  1303. globalSceneType: _app_program_store_scene__WEBPACK_IMPORTED_MODULE_5__["globalSceneType"],
  1304. UnData: _components_un_data_index_vue__WEBPACK_IMPORTED_MODULE_6__["default"],
  1305. calcStatus: _app_program_store_status__WEBPACK_IMPORTED_MODULE_7__["calcStatus"],
  1306. useSceneSync: _views_sys_main_layout_hook__WEBPACK_IMPORTED_MODULE_8__["useSceneSync"],
  1307. syncDevice: _views_sys_main_layout_hook__WEBPACK_IMPORTED_MODULE_8__["syncDevice"],
  1308. info: _store_auth__WEBPACK_IMPORTED_MODULE_9__["info"],
  1309. TypeEnum: _store_type__WEBPACK_IMPORTED_MODULE_12__["TypeEnum"],
  1310. ui18n: _lang__WEBPACK_IMPORTED_MODULE_13__["ui18n"],
  1311. Detail: _detail_vue__WEBPACK_IMPORTED_MODULE_14__["default"],
  1312. DeviceCom: _sys_device_index_vue__WEBPACK_IMPORTED_MODULE_15__["default"],
  1313. cameraNames: _store_camrea__WEBPACK_IMPORTED_MODULE_22__["cameraNames"]
  1314. };
  1315. Object.defineProperty(__returned__, '__isScriptSetup', {
  1316. enumerable: false,
  1317. value: true
  1318. });
  1319. return __returned__;
  1320. }
  1321. }));
  1322. /***/ }),
  1323. /***/ "../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/index.vue?vue&type=script&setup=true&lang=ts":
  1324. /*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1325. !*** D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--14-0!D:/web_src/4dkankan_v4/node_modules/babel-loader/lib!D:/web_src/4dkankan_v4/node_modules/ts-loader??ref--14-2!D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--1-0!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist??ref--1-1!./src/app/program/views/sys/device/index.vue?vue&type=script&setup=true&lang=ts ***!
  1326. \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1327. /*! exports provided: default */
  1328. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1329. "use strict";
  1330. __webpack_require__.r(__webpack_exports__);
  1331. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "../../node_modules/vue/dist/vue.runtime.esm-bundler.js");
  1332. /* harmony import */ var _help_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./help.vue */ "./src/app/program/views/sys/device/help.vue");
  1333. /* harmony import */ var _sync_index_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./sync/index.vue */ "./src/app/program/views/sys/device/sync/index.vue");
  1334. /* harmony import */ var _app_program_hook_serve__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/app/program/hook/serve */ "./src/app/program/hook/serve.ts");
  1335. /* harmony import */ var _app_program_store_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/app/program/store/auth */ "./src/app/program/store/auth.ts");
  1336. /* harmony import */ var _lang__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/lang */ "./src/lang/index.ts");
  1337. /* harmony default export */ __webpack_exports__["default"] = (/*#__PURE__*/Object(vue__WEBPACK_IMPORTED_MODULE_0__["defineComponent"])({
  1338. __name: 'index',
  1339. props: {
  1340. syncDevice: {
  1341. type: Boolean,
  1342. required: true
  1343. }
  1344. },
  1345. emits: ["update:syncDevice"],
  1346. setup: function (__props, _a) {
  1347. var expose = _a.expose,
  1348. emit = _a.emit;
  1349. expose();
  1350. var props = __props;
  1351. var actived = Object(vue__WEBPACK_IMPORTED_MODULE_0__["ref"])(true);
  1352. Object(vue__WEBPACK_IMPORTED_MODULE_0__["onDeactivated"])(function () {
  1353. return actived.value = false;
  1354. });
  1355. Object(vue__WEBPACK_IMPORTED_MODULE_0__["onActivated"])(function () {
  1356. return actived.value = true;
  1357. });
  1358. var steps = {
  1359. help: {
  1360. title: _lang__WEBPACK_IMPORTED_MODULE_5__["ui18n"].t('program.linkUP'),
  1361. component: _help_vue__WEBPACK_IMPORTED_MODULE_1__["default"]
  1362. },
  1363. sync: {
  1364. title: _lang__WEBPACK_IMPORTED_MODULE_5__["ui18n"].t('program.scene.sync'),
  1365. component: _sync_index_vue__WEBPACK_IMPORTED_MODULE_2__["default"]
  1366. }
  1367. };
  1368. var stepName = Object(vue__WEBPACK_IMPORTED_MODULE_0__["ref"])(null);
  1369. var visible = Object(vue__WEBPACK_IMPORTED_MODULE_0__["ref"])(false);
  1370. var changeVisible = function (data) {
  1371. visible.value = data;
  1372. if (!visible.value) {
  1373. setTimeout(function () {
  1374. return emit('update:syncDevice', false);
  1375. }, 300);
  1376. }
  1377. };
  1378. var current = Object(vue__WEBPACK_IMPORTED_MODULE_0__["computed"])(function () {
  1379. return _app_program_store_auth__WEBPACK_IMPORTED_MODULE_4__["info"].value && stepName.value && steps[stepName.value];
  1380. });
  1381. var stopSub;
  1382. Object(vue__WEBPACK_IMPORTED_MODULE_0__["watchEffect"])(function () {
  1383. var _a;
  1384. console.error((_a = current.value) === null || _a === void 0 ? void 0 : _a.title);
  1385. });
  1386. Object(vue__WEBPACK_IMPORTED_MODULE_0__["watch"])(current, function () {
  1387. return Object(_app_program_store_auth__WEBPACK_IMPORTED_MODULE_4__["getAuth"])();
  1388. }, {
  1389. immediate: true
  1390. });
  1391. Object(vue__WEBPACK_IMPORTED_MODULE_0__["watchEffect"])(function () {
  1392. if (props.syncDevice) {
  1393. // stepName.value='sync'
  1394. stopSub = Object(_app_program_hook_serve__WEBPACK_IMPORTED_MODULE_3__["useImmedSubscribe"])('findUSB', function (data) {
  1395. stepName.value = data ? 'sync' : 'help';
  1396. });
  1397. } else {
  1398. stepName.value = null;
  1399. stopSub && stopSub();
  1400. }
  1401. });
  1402. Object(vue__WEBPACK_IMPORTED_MODULE_0__["watch"])(current, function () {
  1403. current.value && changeVisible(!!current.value);
  1404. }, {
  1405. immediate: true
  1406. });
  1407. var __returned__ = {
  1408. actived: actived,
  1409. steps: steps,
  1410. stepName: stepName,
  1411. props: props,
  1412. emit: emit,
  1413. visible: visible,
  1414. changeVisible: changeVisible,
  1415. current: current,
  1416. stopSub: stopSub
  1417. };
  1418. Object.defineProperty(__returned__, '__isScriptSetup', {
  1419. enumerable: false,
  1420. value: true
  1421. });
  1422. return __returned__;
  1423. }
  1424. }));
  1425. /***/ }),
  1426. /***/ "../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/sync/index.vue?vue&type=script&setup=true&lang=ts":
  1427. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1428. !*** D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--14-0!D:/web_src/4dkankan_v4/node_modules/babel-loader/lib!D:/web_src/4dkankan_v4/node_modules/ts-loader??ref--14-2!D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--1-0!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist??ref--1-1!./src/app/program/views/sys/device/sync/index.vue?vue&type=script&setup=true&lang=ts ***!
  1429. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1430. /*! exports provided: default */
  1431. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1432. "use strict";
  1433. __webpack_require__.r(__webpack_exports__);
  1434. /* harmony import */ var core_js_modules_es_error_cause_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.error.cause.js */ "../../node_modules/core-js/modules/es.error.cause.js");
  1435. /* harmony import */ var core_js_modules_es_error_cause_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_error_cause_js__WEBPACK_IMPORTED_MODULE_0__);
  1436. /* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ "../../node_modules/core-js/modules/es.array.push.js");
  1437. /* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__);
  1438. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vue */ "../../node_modules/vue/dist/vue.runtime.esm-bundler.js");
  1439. /* harmony import */ var _select_scene_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./select-scene.vue */ "./src/app/program/views/sys/device/sync/select-scene.vue");
  1440. /* harmony import */ var _app_program_components_un_data_index_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/app/program/components/un-data/index.vue */ "./src/app/program/components/un-data/index.vue");
  1441. /* harmony import */ var _ant_design_icons_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ant-design/icons-vue */ "../../node_modules/@ant-design/icons-vue/es/index.js");
  1442. /* harmony import */ var _app_program_store_scene__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/app/program/store/scene */ "./src/app/program/store/scene.ts");
  1443. /* harmony import */ var _app_program_store_status__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/app/program/store/status */ "./src/app/program/store/status.ts");
  1444. /* harmony import */ var _app_program_hook_model__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/app/program/hook/model */ "./src/app/program/hook/model.ts");
  1445. /* harmony import */ var _lang__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/lang */ "./src/lang/index.ts");
  1446. /* harmony import */ var _app_program_store_camrea__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/app/program/store/camrea */ "./src/app/program/store/camrea.ts");
  1447. var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
  1448. function adopt(value) {
  1449. return value instanceof P ? value : new P(function (resolve) {
  1450. resolve(value);
  1451. });
  1452. }
  1453. return new (P || (P = Promise))(function (resolve, reject) {
  1454. function fulfilled(value) {
  1455. try {
  1456. step(generator.next(value));
  1457. } catch (e) {
  1458. reject(e);
  1459. }
  1460. }
  1461. function rejected(value) {
  1462. try {
  1463. step(generator["throw"](value));
  1464. } catch (e) {
  1465. reject(e);
  1466. }
  1467. }
  1468. function step(result) {
  1469. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  1470. }
  1471. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1472. });
  1473. };
  1474. var __generator = undefined && undefined.__generator || function (thisArg, body) {
  1475. var _ = {
  1476. label: 0,
  1477. sent: function () {
  1478. if (t[0] & 1) throw t[1];
  1479. return t[1];
  1480. },
  1481. trys: [],
  1482. ops: []
  1483. },
  1484. f,
  1485. y,
  1486. t,
  1487. g;
  1488. return g = {
  1489. next: verb(0),
  1490. "throw": verb(1),
  1491. "return": verb(2)
  1492. }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
  1493. return this;
  1494. }), g;
  1495. function verb(n) {
  1496. return function (v) {
  1497. return step([n, v]);
  1498. };
  1499. }
  1500. function step(op) {
  1501. if (f) throw new TypeError("Generator is already executing.");
  1502. while (g && (g = 0, op[0] && (_ = 0)), _) try {
  1503. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  1504. if (y = 0, t) op = [op[0] & 2, t.value];
  1505. switch (op[0]) {
  1506. case 0:
  1507. case 1:
  1508. t = op;
  1509. break;
  1510. case 4:
  1511. _.label++;
  1512. return {
  1513. value: op[1],
  1514. done: false
  1515. };
  1516. case 5:
  1517. _.label++;
  1518. y = op[1];
  1519. op = [0];
  1520. continue;
  1521. case 7:
  1522. op = _.ops.pop();
  1523. _.trys.pop();
  1524. continue;
  1525. default:
  1526. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  1527. _ = 0;
  1528. continue;
  1529. }
  1530. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  1531. _.label = op[1];
  1532. break;
  1533. }
  1534. if (op[0] === 6 && _.label < t[1]) {
  1535. _.label = t[1];
  1536. t = op;
  1537. break;
  1538. }
  1539. if (t && _.label < t[2]) {
  1540. _.label = t[2];
  1541. _.ops.push(op);
  1542. break;
  1543. }
  1544. if (t[2]) _.ops.pop();
  1545. _.trys.pop();
  1546. continue;
  1547. }
  1548. op = body.call(thisArg, _);
  1549. } catch (e) {
  1550. op = [6, e];
  1551. y = 0;
  1552. } finally {
  1553. f = t = 0;
  1554. }
  1555. if (op[0] & 5) throw op[1];
  1556. return {
  1557. value: op[0] ? op[1] : void 0,
  1558. done: true
  1559. };
  1560. }
  1561. };
  1562. /* harmony default export */ __webpack_exports__["default"] = (/*#__PURE__*/Object(vue__WEBPACK_IMPORTED_MODULE_2__["defineComponent"])({
  1563. __name: 'index',
  1564. setup: function (__props, _a) {
  1565. var _this = this;
  1566. var expose = _a.expose;
  1567. expose();
  1568. var snCodes = Object(vue__WEBPACK_IMPORTED_MODULE_2__["computed"])(function () {
  1569. return _app_program_store_status__WEBPACK_IMPORTED_MODULE_7__["syncStatus"].snCodes.map(function (code) {
  1570. return code.toUpperCase().trim();
  1571. }).filter(function (code) {
  1572. return _app_program_store_camrea__WEBPACK_IMPORTED_MODULE_10__["cameraList"].value.some(function (item) {
  1573. return item.sn.trim().toUpperCase() === code;
  1574. });
  1575. });
  1576. });
  1577. var keyword = Object(vue__WEBPACK_IMPORTED_MODULE_2__["ref"])('');
  1578. Object(vue__WEBPACK_IMPORTED_MODULE_2__["watchEffect"])(function () {
  1579. console.error(keyword.value);
  1580. }, {
  1581. flush: 'sync'
  1582. });
  1583. var updateKeyowrd = function (val) {
  1584. console.error("updateKeyowrd", val);
  1585. keyword.value = val;
  1586. };
  1587. var types = Object(vue__WEBPACK_IMPORTED_MODULE_2__["reactive"])([{
  1588. key: _app_program_store_scene__WEBPACK_IMPORTED_MODULE_6__["Device"].USB,
  1589. title: _lang__WEBPACK_IMPORTED_MODULE_9__["ui18n"].t('program.other.usbScene'),
  1590. scenes: _app_program_store_scene__WEBPACK_IMPORTED_MODULE_6__["usbScenes"],
  1591. selects: [],
  1592. showScenes: Object(vue__WEBPACK_IMPORTED_MODULE_2__["computed"])(function () {
  1593. return _app_program_store_scene__WEBPACK_IMPORTED_MODULE_6__["usbScenes"].value;
  1594. })
  1595. }, {
  1596. key: _app_program_store_scene__WEBPACK_IMPORTED_MODULE_6__["Device"].LOCAL,
  1597. title: _lang__WEBPACK_IMPORTED_MODULE_9__["ui18n"].t('program.other.winScene'),
  1598. scenes: _app_program_store_scene__WEBPACK_IMPORTED_MODULE_6__["localScenes"],
  1599. selects: [],
  1600. showScenes: Object(vue__WEBPACK_IMPORTED_MODULE_2__["computed"])(function () {
  1601. return _app_program_store_scene__WEBPACK_IMPORTED_MODULE_6__["localScenes"].value.filter(function (scene) {
  1602. return scene.title.includes(keyword.value);
  1603. }).filter(function (scene) {
  1604. return !Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_6__["isCalsIng"])(scene);
  1605. });
  1606. })
  1607. }]);
  1608. var getType = function (qkey) {
  1609. return types.find(function (_a) {
  1610. var key = _a.key;
  1611. return key === qkey;
  1612. });
  1613. };
  1614. var activeKey = Object(vue__WEBPACK_IMPORTED_MODULE_2__["ref"])(types[0].key);
  1615. var current = Object(vue__WEBPACK_IMPORTED_MODULE_2__["computed"])(function () {
  1616. return getType(activeKey.value);
  1617. });
  1618. Object(vue__WEBPACK_IMPORTED_MODULE_2__["watch"])(function () {
  1619. return current.value.showScenes;
  1620. }, function () {
  1621. console.log(current.value.selects);
  1622. current.value.selects = current.value.showScenes.filter(function (item) {
  1623. return current.value.selects.some(function (_a) {
  1624. var id = _a.id;
  1625. return id === item.id;
  1626. });
  1627. });
  1628. // current.value.selects.filter(item => current.value.showScenes.includes(item))
  1629. });
  1630. var copyScenes = function (scenes) {
  1631. return __awaiter(_this, void 0, void 0, function () {
  1632. return __generator(this, function (_a) {
  1633. Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_6__["syncScenes"])(scenes, current.value.key === _app_program_store_scene__WEBPACK_IMPORTED_MODULE_6__["Device"].USB ? _app_program_store_scene__WEBPACK_IMPORTED_MODULE_6__["Device"].LOCAL : _app_program_store_scene__WEBPACK_IMPORTED_MODULE_6__["Device"].USB);
  1634. return [2 /*return*/];
  1635. });
  1636. });
  1637. };
  1638. var delScenes = function (scenes) {
  1639. return __awaiter(_this, void 0, void 0, function () {
  1640. var isUSB;
  1641. return __generator(this, function (_a) {
  1642. switch (_a.label) {
  1643. case 0:
  1644. isUSB = current.value.key === _app_program_store_scene__WEBPACK_IMPORTED_MODULE_6__["Device"].USB;
  1645. return [4 /*yield*/, Object(_app_program_hook_model__WEBPACK_IMPORTED_MODULE_8__["useConfirm"])("".concat(_lang__WEBPACK_IMPORTED_MODULE_9__["ui18n"].t('program.other.delTipPrev')).concat(isUSB ? _lang__WEBPACK_IMPORTED_MODULE_9__["ui18n"].t('program.other.usb') : _lang__WEBPACK_IMPORTED_MODULE_9__["ui18n"].t('program.other.win')).concat(_lang__WEBPACK_IMPORTED_MODULE_9__["ui18n"].t('program.other.delTipPost')))];
  1646. case 1:
  1647. if (_a.sent()) {
  1648. Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_6__["deleteScenes"])(scenes, current.value.key);
  1649. }
  1650. return [2 /*return*/];
  1651. }
  1652. });
  1653. });
  1654. };
  1655. var quitCopyScenes = function (scenes) {
  1656. return __awaiter(_this, void 0, void 0, function () {
  1657. return __generator(this, function (_a) {
  1658. Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_6__["cancelSyncScenes"])(scenes, current.value.key === _app_program_store_scene__WEBPACK_IMPORTED_MODULE_6__["Device"].USB ? _app_program_store_scene__WEBPACK_IMPORTED_MODULE_6__["Device"].LOCAL : _app_program_store_scene__WEBPACK_IMPORTED_MODULE_6__["Device"].USB);
  1659. return [2 /*return*/];
  1660. });
  1661. });
  1662. };
  1663. var __returned__ = {
  1664. snCodes: snCodes,
  1665. keyword: keyword,
  1666. updateKeyowrd: updateKeyowrd,
  1667. types: types,
  1668. getType: getType,
  1669. activeKey: activeKey,
  1670. current: current,
  1671. copyScenes: copyScenes,
  1672. delScenes: delScenes,
  1673. quitCopyScenes: quitCopyScenes,
  1674. SelectScene: _select_scene_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  1675. UnData: _app_program_components_un_data_index_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  1676. SearchOutlined: _ant_design_icons_vue__WEBPACK_IMPORTED_MODULE_5__["SearchOutlined"],
  1677. CloseCircleOutlined: _ant_design_icons_vue__WEBPACK_IMPORTED_MODULE_5__["CloseCircleOutlined"],
  1678. SyncEnum: _app_program_store_scene__WEBPACK_IMPORTED_MODULE_6__["SyncEnum"],
  1679. Device: _app_program_store_scene__WEBPACK_IMPORTED_MODULE_6__["Device"],
  1680. syncStatus: _app_program_store_status__WEBPACK_IMPORTED_MODULE_7__["syncStatus"],
  1681. framtTime: _app_program_store_status__WEBPACK_IMPORTED_MODULE_7__["framtTime"],
  1682. syncDesc: _app_program_store_status__WEBPACK_IMPORTED_MODULE_7__["syncDesc"]
  1683. };
  1684. Object.defineProperty(__returned__, '__isScriptSetup', {
  1685. enumerable: false,
  1686. value: true
  1687. });
  1688. return __returned__;
  1689. }
  1690. }));
  1691. /***/ }),
  1692. /***/ "../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=script&setup=true&lang=ts":
  1693. /*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1694. !*** D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--14-0!D:/web_src/4dkankan_v4/node_modules/babel-loader/lib!D:/web_src/4dkankan_v4/node_modules/ts-loader??ref--14-2!D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--1-0!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist??ref--1-1!./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=script&setup=true&lang=ts ***!
  1695. \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1696. /*! exports provided: default */
  1697. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1698. "use strict";
  1699. __webpack_require__.r(__webpack_exports__);
  1700. /* harmony import */ var core_js_modules_es_error_cause_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.error.cause.js */ "../../node_modules/core-js/modules/es.error.cause.js");
  1701. /* harmony import */ var core_js_modules_es_error_cause_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_error_cause_js__WEBPACK_IMPORTED_MODULE_0__);
  1702. /* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ "../../node_modules/core-js/modules/es.array.push.js");
  1703. /* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__);
  1704. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vue */ "../../node_modules/vue/dist/vue.runtime.esm-bundler.js");
  1705. /* harmony import */ var _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/app/program/store/scene */ "./src/app/program/store/scene.ts");
  1706. /* harmony import */ var _app_program_store_status__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/app/program/store/status */ "./src/app/program/store/status.ts");
  1707. /* harmony import */ var _ant_design_icons_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ant-design/icons-vue */ "../../node_modules/@ant-design/icons-vue/es/index.js");
  1708. /* harmony import */ var vue_lottie__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vue-lottie */ "../../node_modules/vue-lottie/src/lottie.vue");
  1709. /* harmony import */ var _output_fit_c_json__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./output/fit-c.json */ "./src/app/program/views/sys/device/sync/output/fit-c.json");
  1710. var _output_fit_c_json__WEBPACK_IMPORTED_MODULE_7___namespace = /*#__PURE__*/__webpack_require__.t(/*! ./output/fit-c.json */ "./src/app/program/views/sys/device/sync/output/fit-c.json", 1);
  1711. /* harmony import */ var _output_fit_u_json__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./output/fit-u.json */ "./src/app/program/views/sys/device/sync/output/fit-u.json");
  1712. var _output_fit_u_json__WEBPACK_IMPORTED_MODULE_8___namespace = /*#__PURE__*/__webpack_require__.t(/*! ./output/fit-u.json */ "./src/app/program/views/sys/device/sync/output/fit-u.json", 1);
  1713. /* harmony import */ var _lang__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/lang */ "./src/lang/index.ts");
  1714. /* harmony import */ var _app_program_store_camrea__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/app/program/store/camrea */ "./src/app/program/store/camrea.ts");
  1715. /* harmony import */ var ant_design_vue__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ant-design-vue */ "../../node_modules/ant-design-vue/es/index.js");
  1716. var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
  1717. function adopt(value) {
  1718. return value instanceof P ? value : new P(function (resolve) {
  1719. resolve(value);
  1720. });
  1721. }
  1722. return new (P || (P = Promise))(function (resolve, reject) {
  1723. function fulfilled(value) {
  1724. try {
  1725. step(generator.next(value));
  1726. } catch (e) {
  1727. reject(e);
  1728. }
  1729. }
  1730. function rejected(value) {
  1731. try {
  1732. step(generator["throw"](value));
  1733. } catch (e) {
  1734. reject(e);
  1735. }
  1736. }
  1737. function step(result) {
  1738. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  1739. }
  1740. step((generator = generator.apply(thisArg, _arguments || [])).next());
  1741. });
  1742. };
  1743. var __generator = undefined && undefined.__generator || function (thisArg, body) {
  1744. var _ = {
  1745. label: 0,
  1746. sent: function () {
  1747. if (t[0] & 1) throw t[1];
  1748. return t[1];
  1749. },
  1750. trys: [],
  1751. ops: []
  1752. },
  1753. f,
  1754. y,
  1755. t,
  1756. g;
  1757. return g = {
  1758. next: verb(0),
  1759. "throw": verb(1),
  1760. "return": verb(2)
  1761. }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
  1762. return this;
  1763. }), g;
  1764. function verb(n) {
  1765. return function (v) {
  1766. return step([n, v]);
  1767. };
  1768. }
  1769. function step(op) {
  1770. if (f) throw new TypeError("Generator is already executing.");
  1771. while (g && (g = 0, op[0] && (_ = 0)), _) try {
  1772. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  1773. if (y = 0, t) op = [op[0] & 2, t.value];
  1774. switch (op[0]) {
  1775. case 0:
  1776. case 1:
  1777. t = op;
  1778. break;
  1779. case 4:
  1780. _.label++;
  1781. return {
  1782. value: op[1],
  1783. done: false
  1784. };
  1785. case 5:
  1786. _.label++;
  1787. y = op[1];
  1788. op = [0];
  1789. continue;
  1790. case 7:
  1791. op = _.ops.pop();
  1792. _.trys.pop();
  1793. continue;
  1794. default:
  1795. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  1796. _ = 0;
  1797. continue;
  1798. }
  1799. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  1800. _.label = op[1];
  1801. break;
  1802. }
  1803. if (op[0] === 6 && _.label < t[1]) {
  1804. _.label = t[1];
  1805. t = op;
  1806. break;
  1807. }
  1808. if (t && _.label < t[2]) {
  1809. _.label = t[2];
  1810. _.ops.push(op);
  1811. break;
  1812. }
  1813. if (t[2]) _.ops.pop();
  1814. _.trys.pop();
  1815. continue;
  1816. }
  1817. op = body.call(thisArg, _);
  1818. } catch (e) {
  1819. op = [6, e];
  1820. y = 0;
  1821. } finally {
  1822. f = t = 0;
  1823. }
  1824. if (op[0] & 5) throw op[1];
  1825. return {
  1826. value: op[0] ? op[1] : void 0,
  1827. done: true
  1828. };
  1829. }
  1830. };
  1831. var __spreadArray = undefined && undefined.__spreadArray || function (to, from, pack) {
  1832. if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
  1833. if (ar || !(i in from)) {
  1834. if (!ar) ar = Array.prototype.slice.call(from, 0, i);
  1835. ar[i] = from[i];
  1836. }
  1837. }
  1838. return to.concat(ar || Array.prototype.slice.call(from));
  1839. };
  1840. /* harmony default export */ __webpack_exports__["default"] = (/*#__PURE__*/Object(vue__WEBPACK_IMPORTED_MODULE_2__["defineComponent"])({
  1841. __name: 'select-scene',
  1842. props: {
  1843. scenes: {
  1844. type: Array,
  1845. required: true
  1846. },
  1847. selects: {
  1848. type: Array,
  1849. required: true
  1850. },
  1851. device: {
  1852. type: null,
  1853. required: true
  1854. }
  1855. },
  1856. emits: ["update:selects", "deleteScene", "syncScene", "quitSyncScene"],
  1857. setup: function (__props, _a) {
  1858. var _this = this;
  1859. var expose = _a.expose,
  1860. emit = _a.emit;
  1861. expose();
  1862. var props = __props;
  1863. var isNotCalc = function (scene) {
  1864. var lscene = _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["localScenes"].value.find(function (lscene) {
  1865. return lscene.id === scene.id;
  1866. });
  1867. return !("status" in scene && scene.status === _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["CalcEnum"].ING) && (lscene === null || lscene === void 0 ? void 0 : lscene.buildObjStatus) !== 2 && !(props.device === _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["Device"].LOCAL && (lscene === null || lscene === void 0 ? void 0 : lscene.location) === 6) && !_app_program_store_status__WEBPACK_IMPORTED_MODULE_4__["calcStatus"].scene.locals.some(function (csid) {
  1868. return scene.id === csid;
  1869. });
  1870. };
  1871. var checkScene = function (check, scene) {
  1872. var sceneRaw = Object(vue__WEBPACK_IMPORTED_MODULE_2__["toRaw"])(scene);
  1873. var selects = Object(vue__WEBPACK_IMPORTED_MODULE_2__["toRaw"])(props.selects);
  1874. var index = selects.indexOf(sceneRaw);
  1875. if (check && !~index) {
  1876. if (isNotCalc(sceneRaw)) {
  1877. emit("update:selects", __spreadArray(__spreadArray([], selects, true), [sceneRaw], false));
  1878. }
  1879. } else if (!check && ~index) {
  1880. var data = __spreadArray([], selects, true);
  1881. data.splice(index, 1);
  1882. emit("update:selects", data);
  1883. }
  1884. };
  1885. var selectAll = Object(vue__WEBPACK_IMPORTED_MODULE_2__["computed"])({
  1886. get: function () {
  1887. return props.scenes.every(function (scene) {
  1888. return props.selects.includes(scene);
  1889. });
  1890. },
  1891. set: function (check) {
  1892. if (check) {
  1893. emit("update:selects", props.scenes.filter(function (scene) {
  1894. return !(scene.syncStatus === _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["SyncEnum"].ING || "status" in scene && Object(_app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["isCalsIng"])(scene)) && isNotCalc(scene);
  1895. }));
  1896. } else {
  1897. emit("update:selects", []);
  1898. }
  1899. }
  1900. });
  1901. var getIcon = function (scene) {
  1902. switch (scene.syncStatus) {
  1903. case _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["SyncEnum"].UN:
  1904. return props.device === _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["Device"].USB ? "icon-s-upan" : "icon-s-computer";
  1905. case _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["SyncEnum"].ING:
  1906. return props.device === _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["Device"].USB ? "icon-s-upload" : "icon-s-download";
  1907. case _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["SyncEnum"].COM:
  1908. return "icon-s-complete";
  1909. }
  1910. };
  1911. var getIconMsg = function (scene) {
  1912. switch (scene.syncStatus) {
  1913. case _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["SyncEnum"].UN:
  1914. return props.device === _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["Device"].USB ? _lang__WEBPACK_IMPORTED_MODULE_9__["ui18n"].t("program.other.usbScene") : _lang__WEBPACK_IMPORTED_MODULE_9__["ui18n"].t("program.other.winScene");
  1915. case _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["SyncEnum"].ING:
  1916. return props.device === _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["Device"].USB ? _lang__WEBPACK_IMPORTED_MODULE_9__["ui18n"].t("program.other.toWinIng") : _lang__WEBPACK_IMPORTED_MODULE_9__["ui18n"].t("program.other.toUsbIng");
  1917. case _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["SyncEnum"].COM:
  1918. return _lang__WEBPACK_IMPORTED_MODULE_9__["ui18n"].t("program.other.syncSuccess");
  1919. }
  1920. };
  1921. var getAnimationData = function (scene) {
  1922. if (scene.syncStatus === _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["SyncEnum"].ING) {
  1923. return props.device === _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["Device"].USB ? _output_fit_c_json__WEBPACK_IMPORTED_MODULE_7__ : _output_fit_u_json__WEBPACK_IMPORTED_MODULE_8__;
  1924. }
  1925. };
  1926. var sceneOper = function (scene) {
  1927. return __awaiter(_this, void 0, void 0, function () {
  1928. return __generator(this, function (_a) {
  1929. if (_app_program_store_camrea__WEBPACK_IMPORTED_MODULE_10__["cameraList"].value.some(function (item) {
  1930. return item.sn.trim().toUpperCase() === scene.sn.trim().toUpperCase();
  1931. })) {
  1932. if (scene.syncStatus === _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["SyncEnum"].ING) {
  1933. emit("quitSyncScene", scene);
  1934. } else {
  1935. emit("syncScene", scene);
  1936. }
  1937. } else {
  1938. ant_design_vue__WEBPACK_IMPORTED_MODULE_11__["message"].error(_lang__WEBPACK_IMPORTED_MODULE_9__["ui18n"].t("program.rejectSceneSync"));
  1939. }
  1940. return [2 /*return*/];
  1941. });
  1942. });
  1943. };
  1944. var __returned__ = {
  1945. props: props,
  1946. emit: emit,
  1947. isNotCalc: isNotCalc,
  1948. checkScene: checkScene,
  1949. selectAll: selectAll,
  1950. getIcon: getIcon,
  1951. getIconMsg: getIconMsg,
  1952. getAnimationData: getAnimationData,
  1953. sceneOper: sceneOper,
  1954. SyncEnum: _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["SyncEnum"],
  1955. Device: _app_program_store_scene__WEBPACK_IMPORTED_MODULE_3__["Device"],
  1956. SmallDashOutlined: _ant_design_icons_vue__WEBPACK_IMPORTED_MODULE_5__["SmallDashOutlined"],
  1957. Lottie: vue_lottie__WEBPACK_IMPORTED_MODULE_6__["default"]
  1958. };
  1959. Object.defineProperty(__returned__, '__isScriptSetup', {
  1960. enumerable: false,
  1961. value: true
  1962. });
  1963. return __returned__;
  1964. }
  1965. }));
  1966. /***/ }),
  1967. /***/ "../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js?!../../node_modules/vue-loader-v16/dist/templateLoader.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/scene/detail.vue?vue&type=template&id=f90fcb32&scoped=true&ts=true":
  1968. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1969. !*** D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--14-0!D:/web_src/4dkankan_v4/node_modules/babel-loader/lib!D:/web_src/4dkankan_v4/node_modules/ts-loader??ref--14-2!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/templateLoader.js??ref--7!D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--1-0!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist??ref--1-1!./src/app/program/views/scene/detail.vue?vue&type=template&id=f90fcb32&scoped=true&ts=true ***!
  1970. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1971. /*! exports provided: render */
  1972. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1973. "use strict";
  1974. __webpack_require__.r(__webpack_exports__);
  1975. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  1976. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "../../node_modules/vue/dist/vue.runtime.esm-bundler.js");
  1977. var _withScopeId = function (n) {
  1978. return Object(vue__WEBPACK_IMPORTED_MODULE_0__["pushScopeId"])("data-v-f90fcb32"), n = n(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["popScopeId"])(), n;
  1979. };
  1980. var _hoisted_1 = {
  1981. class: "title",
  1982. style: {
  1983. "margin-top": "40px"
  1984. }
  1985. };
  1986. var _hoisted_2 = {
  1987. key: 0,
  1988. class: "top"
  1989. };
  1990. var _hoisted_3 = {
  1991. class: "sub_title"
  1992. };
  1993. var _hoisted_4 = {
  1994. key: 0,
  1995. class: "col"
  1996. };
  1997. var _hoisted_5 = {
  1998. class: "info"
  1999. };
  2000. var _hoisted_6 = {
  2001. class: "col-title"
  2002. };
  2003. var _hoisted_7 = {
  2004. key: 0,
  2005. class: "col-desc"
  2006. };
  2007. var _hoisted_8 = {
  2008. key: 1,
  2009. class: "col-desc"
  2010. };
  2011. var _hoisted_9 = {
  2012. class: "action"
  2013. };
  2014. var _hoisted_10 = {
  2015. key: 1,
  2016. class: "col"
  2017. };
  2018. var _hoisted_11 = {
  2019. class: "info"
  2020. };
  2021. var _hoisted_12 = {
  2022. class: "col-title"
  2023. };
  2024. var _hoisted_13 = {
  2025. class: "col-desc"
  2026. };
  2027. var _hoisted_14 = {
  2028. class: "action"
  2029. };
  2030. var _hoisted_15 = {
  2031. class: "col"
  2032. };
  2033. var _hoisted_16 = {
  2034. class: "info"
  2035. };
  2036. var _hoisted_17 = {
  2037. class: "col-title"
  2038. };
  2039. var _hoisted_18 = {
  2040. class: "col-desc"
  2041. };
  2042. var _hoisted_19 = {
  2043. class: "action"
  2044. };
  2045. var _hoisted_20 = {
  2046. class: "col"
  2047. };
  2048. var _hoisted_21 = {
  2049. class: "info"
  2050. };
  2051. var _hoisted_22 = {
  2052. class: "col-title"
  2053. };
  2054. var _hoisted_23 = /*#__PURE__*/_withScopeId(function () {
  2055. /*#__PURE__*/return Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", {
  2056. class: "col-desc"
  2057. }, null, -1 /* HOISTED */);
  2058. });
  2059. var _hoisted_24 = {
  2060. class: "action"
  2061. };
  2062. var _hoisted_25 = {
  2063. class: "bottom"
  2064. };
  2065. var _hoisted_26 = {
  2066. class: "sub_title b_sub_title"
  2067. };
  2068. var _hoisted_27 = {
  2069. class: "info-col"
  2070. };
  2071. var _hoisted_28 = {
  2072. class: "info-label"
  2073. };
  2074. var _hoisted_29 = {
  2075. class: "info-desc"
  2076. };
  2077. var _hoisted_30 = {
  2078. key: 0
  2079. };
  2080. var _hoisted_31 = {
  2081. key: 1
  2082. };
  2083. var _hoisted_32 = {
  2084. key: 2
  2085. };
  2086. var _hoisted_33 = {
  2087. class: "info-col"
  2088. };
  2089. var _hoisted_34 = {
  2090. class: "info-label"
  2091. };
  2092. var _hoisted_35 = {
  2093. class: "info-desc"
  2094. };
  2095. var _hoisted_36 = {
  2096. class: "info-col"
  2097. };
  2098. var _hoisted_37 = {
  2099. class: "info-label"
  2100. };
  2101. var _hoisted_38 = {
  2102. class: "info-desc"
  2103. };
  2104. var _hoisted_39 = {
  2105. class: "info-col"
  2106. };
  2107. var _hoisted_40 = {
  2108. class: "info-label"
  2109. };
  2110. var _hoisted_41 = {
  2111. class: "info-desc"
  2112. };
  2113. var _hoisted_42 = {
  2114. class: "info-col"
  2115. };
  2116. var _hoisted_43 = {
  2117. class: "info-label"
  2118. };
  2119. var _hoisted_44 = {
  2120. class: "info-desc"
  2121. };
  2122. var _hoisted_45 = {
  2123. key: 0,
  2124. class: "info-col"
  2125. };
  2126. var _hoisted_46 = {
  2127. class: "info-label"
  2128. };
  2129. var _hoisted_47 = {
  2130. class: "info-desc"
  2131. };
  2132. var _hoisted_48 = {
  2133. key: 1,
  2134. class: "info-col"
  2135. };
  2136. var _hoisted_49 = {
  2137. class: "info-label"
  2138. };
  2139. var _hoisted_50 = {
  2140. class: "info-desc"
  2141. };
  2142. var _hoisted_51 = {
  2143. key: 2,
  2144. class: "info-col"
  2145. };
  2146. var _hoisted_52 = {
  2147. class: "info-label"
  2148. };
  2149. var _hoisted_53 = {
  2150. class: "info-desc"
  2151. };
  2152. var _hoisted_54 = {
  2153. class: "action"
  2154. };
  2155. function render(_ctx, _cache, $props, $setup, $data, $options) {
  2156. var _component_a_button = Object(vue__WEBPACK_IMPORTED_MODULE_0__["resolveComponent"])("a-button");
  2157. return $setup.localSceneDetail ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("div", {
  2158. key: 0,
  2159. class: Object(vue__WEBPACK_IMPORTED_MODULE_0__["normalizeClass"])(["right", {
  2160. isUnCal: [$setup.CalcEnum.UN, $setup.CalcEnum.ERR].includes($setup.localSceneDetail.status)
  2161. }])
  2162. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("i", {
  2163. class: "close iconfont icon-close",
  2164. onClick: $setup.handleClose
  2165. }), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_1, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])($setup.localSceneDetail.title), 1 /* TEXT */), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" buildOfflineStatus :{{ localSceneDetail.buildOfflineStatus }} "), ![$setup.CalcEnum.UN, $setup.CalcEnum.ERR, $setup.CalcEnum.ING, $setup.CalcEnum.LINEUP, $setup.CalcEnum.PAUSE].includes($setup.localSceneDetail.status) && !($setup.globalSceneType == 2 && [-1, 2, 3, 4].includes($setup.localSceneDetail.buildObjStatus)) ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("div", _hoisted_2, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_3, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.title')), 1 /* TEXT */), $setup.localSceneDetail.location != 6 ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("div", _hoisted_4, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_5, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_6, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.obj_title')), 1 /* TEXT */), $setup.localSceneDetail.buildObjStatus === 2 ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("div", _hoisted_7, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.calcing')) + " " + Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])($setup.currentStatus.objProgress) + " % ", 1 /* TEXT */)) : (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("div", _hoisted_8, [$setup.globalSceneType === 1 ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2166. key: 0
  2167. }, [$setup.localSceneDetail.buildObjStatus === 1 ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2168. key: 0
  2169. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])($setup.localSceneDetail.buildObjTime), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), $setup.localSceneDetail.buildObjStatus === 0 ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2170. key: 1
  2171. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.unGenerate')), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), $setup.localSceneDetail.buildObjStatus === -1 ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2172. key: 2
  2173. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" {{ $t('program.sceneDetail.packingFailure') }} "), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.case.status_-1')), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), $setup.localSceneDetail.buildObjStatus === 3 ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2174. key: 3
  2175. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDown.coverStatus.lineup')), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), $setup.localSceneDetail.buildObjStatus === 4 ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2176. key: 4
  2177. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.stoping')), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true)], 64 /* STABLE_FRAGMENT */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true)]))]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_9, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" 生成或重新生成 "), $setup.globalSceneType === 1 ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2178. key: 0
  2179. }, [[-1, 0, 1, 4].includes($setup.localSceneDetail.buildObjStatus) ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])(_component_a_button, {
  2180. key: 0,
  2181. class: "btn",
  2182. type: "link",
  2183. onClick: _cache[0] || (_cache[0] = function ($event) {
  2184. return $setup.handleObjGenerate($setup.localSceneDetail);
  2185. }),
  2186. disabled: $setup.localSceneDetail.status === $setup.CalcEnum.ING
  2187. }, {
  2188. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2189. return [$setup.localSceneDetail.buildObjStatus === 1 ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2190. key: 0
  2191. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.re_generate')), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */)) : (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2192. key: 1
  2193. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.generate')), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */))];
  2194. }),
  2195. _: 1 /* STABLE */
  2196. }, 8 /* PROPS */, ["disabled"])) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" 进行中或排队 "), [2, 3].includes($setup.localSceneDetail.buildObjStatus) ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])(_component_a_button, {
  2197. key: 1,
  2198. class: "btn",
  2199. type: "link",
  2200. onClick: _cache[1] || (_cache[1] = function ($event) {
  2201. return $setup.handleObjGenerate($setup.localSceneDetail, true);
  2202. })
  2203. }, {
  2204. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2205. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.stoping')), 1 /* TEXT */)];
  2206. }),
  2207. _: 1 /* STABLE */
  2208. })) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true)], 64 /* STABLE_FRAGMENT */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), $setup.localSceneDetail.objFolder && $setup.localSceneDetail.buildObjStatus === 1 || $setup.globalSceneType === 2 && $setup.localSceneDetail.objFolder ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("i", {
  2209. key: 1,
  2210. class: "icon iconfont icon-folder",
  2211. onClick: _cache[2] || (_cache[2] = function ($event) {
  2212. return $setup.openDir($setup.localSceneDetail.objFolder);
  2213. })
  2214. })) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true)])])) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), $setup.globalSceneType === 1 && ($setup.localSceneDetail.mixture || $setup.localSceneDetail.location != 6) && $setup.localSceneDetail.location == 4 ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("div", _hoisted_10, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_11, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_12, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.e57_title')), 1 /* TEXT */), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_13, [$setup.localSceneDetail.buildE57Status === -1 ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2215. key: 0
  2216. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.case.status_-1')), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */)) : $setup.localSceneDetail.buildE57Status === 2 ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2217. key: 1
  2218. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.calcing')) + " " + Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])($setup.currentStatus.e57Progress) + " % ", 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */)) : $setup.localSceneDetail.buildE57Status === 3 ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2219. key: 2
  2220. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" <template v-if=\"localSceneDetail.buildE57Status === 1 || localSceneDetail.e57Folder\">\r\n {{ localSceneDetail.buildE57Time }}\r\n </template> "), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDown.coverStatus.lineup')), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */)) : $setup.localSceneDetail.e57Folder ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2221. key: 3
  2222. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])($setup.localSceneDetail.buildE57Time), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */)) : $setup.localSceneDetail.buildE57Status === 0 || !$setup.localSceneDetail.buildE57Status ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2223. key: 4
  2224. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.unGenerate')), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), $setup.localSceneDetail.buildE57Status === 4 ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2225. key: 5
  2226. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.stoping')), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true)])]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_14, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" 生成或重新生成 "), [-1, 0, 1].includes($setup.localSceneDetail.buildE57Status) ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])(_component_a_button, {
  2227. key: 0,
  2228. class: "btn",
  2229. type: "link",
  2230. onClick: _cache[3] || (_cache[3] = function ($event) {
  2231. return $setup.handleE57Generate($setup.localSceneDetail);
  2232. }),
  2233. disabled: $setup.localSceneDetail.status === $setup.CalcEnum.ING
  2234. }, {
  2235. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2236. return [$setup.localSceneDetail.buildE57Status === 1 ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2237. key: 0
  2238. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.re_generate')), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */)) : (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2239. key: 1
  2240. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.generate')), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */))];
  2241. }),
  2242. _: 1 /* STABLE */
  2243. }, 8 /* PROPS */, ["disabled"])) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" 进行中或排队 "), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" <a-button v-if=\"[2, 3].includes(localSceneDetail.buildE57Status)\" class=\"btn\" type=\"link\"\r\n @click=\"handleE57Generate(localSceneDetail, true)\">\r\n {{ $t('program.sceneDetail.stoping') }}\r\n </a-button> "), $setup.localSceneDetail.e57Folder && ![2, 3].includes($setup.localSceneDetail.buildE57Status) ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("i", {
  2244. key: 1,
  2245. class: "icon iconfont icon-folder",
  2246. onClick: _cache[4] || (_cache[4] = function ($event) {
  2247. return $setup.openDir($setup.localSceneDetail.e57Folder);
  2248. })
  2249. })) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true)])])) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_15, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_16, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_17, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.offline_title')), 1 /* TEXT */), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_18, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" -1 未生成 ,0:正在生成 1,完成 2,下载失败 3,重新生成 "), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" -1 未生成 "), ($setup.globalSceneType === 1 ? $setup.localSceneDetail.buildOfflineStatus === -1 : $setup.localSceneDetail.meshBuildOfflineStatus === -1) ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2250. key: 0
  2251. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.unGenerate')), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" 0:正在生成 "), ($setup.globalSceneType === 1 ? $setup.localSceneDetail.buildOfflineStatus === 0 : $setup.localSceneDetail.meshBuildOfflineStatus === 0) ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2252. key: 1
  2253. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.packing')) + " " + Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])($setup.currentStatus.offlineProgress) + " % ", 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" 1,完成 "), ($setup.globalSceneType === 1 ? $setup.localSceneDetail.buildOfflineStatus === 1 : $setup.localSceneDetail.meshBuildOfflineStatus === 1) ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2254. key: 2
  2255. }, [$setup.localSceneDetail.buildOfflineEndTime || $setup.localSceneDetail.buildOfflineMeshEndTime ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2256. key: 0
  2257. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])($setup.globalSceneType === 1 ? $setup.localSceneDetail.buildOfflineEndTime : $setup.localSceneDetail.buildOfflineMeshEndTime), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true)], 64 /* STABLE_FRAGMENT */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" 2,下载失败 "), ($setup.globalSceneType === 1 ? $setup.localSceneDetail.buildOfflineStatus === 2 : $setup.localSceneDetail.meshBuildOfflineStatus === 2) ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2258. key: 3
  2259. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.packingFailure')), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" 3,重新生成 "), ($setup.globalSceneType === 1 ? $setup.localSceneDetail.buildOfflineStatus === 3 : $setup.localSceneDetail.meshBuildOfflineStatus === 3) ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2260. key: 4
  2261. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.reGenerate')), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true)])]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_19, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" 1 生成成功 ,0:正在生成 1,初次生成 2,下载失败 "), $setup.localSceneDetail.status !== $setup.CalcEnum.ING && ($setup.globalSceneType === 1 ? $setup.localSceneDetail.buildOfflineStatus !== 0 : $setup.localSceneDetail.meshBuildOfflineStatus !== 0) ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])(_component_a_button, {
  2262. key: 0,
  2263. class: "btn",
  2264. type: "link",
  2265. onClick: _cache[5] || (_cache[5] = function ($event) {
  2266. return $setup.handleDownOfflineScene($setup.localSceneDetail);
  2267. })
  2268. }, {
  2269. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2270. return [$setup.globalSceneType === 1 ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2271. key: 0
  2272. }, [[-1, 2].includes($setup.localSceneDetail.buildOfflineStatus) ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2273. key: 0
  2274. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.generate')), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */)) : (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2275. key: 1
  2276. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.re_generate')), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */))], 64 /* STABLE_FRAGMENT */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), $setup.globalSceneType === 2 ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2277. key: 1
  2278. }, [[-1, 2].includes($setup.localSceneDetail.meshBuildOfflineStatus) ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2279. key: 0
  2280. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.generate')), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */)) : (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2281. key: 1
  2282. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.re_generate')), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */))], 64 /* STABLE_FRAGMENT */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true)];
  2283. }),
  2284. _: 1 /* STABLE */
  2285. })) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), $setup.globalSceneType === 1 ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2286. key: 1
  2287. }, [$setup.localSceneDetail.offlineFolder ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("i", {
  2288. key: 0,
  2289. class: "icon iconfont icon-folder",
  2290. onClick: _cache[6] || (_cache[6] = function ($event) {
  2291. return $setup.openDir($setup.localSceneDetail.offlineFolder);
  2292. })
  2293. })) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true)], 64 /* STABLE_FRAGMENT */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), $setup.globalSceneType === 2 ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2294. key: 2
  2295. }, [$setup.localSceneDetail.meshOfflineFolder ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("i", {
  2296. key: 0,
  2297. class: "icon iconfont icon-folder",
  2298. onClick: _cache[7] || (_cache[7] = function ($event) {
  2299. return $setup.openDir($setup.localSceneDetail.meshOfflineFolder);
  2300. })
  2301. })) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true)], 64 /* STABLE_FRAGMENT */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true)])]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_20, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_21, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_22, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.floorplan_title')), 1 /* TEXT */), _hoisted_23]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_24, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("i", {
  2302. class: "icon iconfont icon-folder",
  2303. onClick: _cache[8] || (_cache[8] = function ($event) {
  2304. return $setup.handlefloorplanFolder($setup.localSceneDetail);
  2305. })
  2306. })])]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" <div class=\"col\">\r\n <div class=\"info\">\r\n <div class=\"col-title\">{{ $t('program.sceneDetail.migrageS_title') }}</div>\r\n <div class=\"col-desc\">\r\n <template v-if=\"mirgrateStatus.isStart && (mirgrateStatus.sceneCode === localSceneDetail.sceneCode)\">\r\n <template v-if=\"mirgrateStatus.progress>-1\">\r\n {{ $t('program.sceneDetail.packing') }}:{{ mirgrateStatus.progress }} %\r\n </template>\r\n <template v-else>\r\n {{ $t('program.sceneDetail.packing') }}\r\n </template>\r\n </template>\r\n <template v-else>\r\n <template v-if=\"localSceneDetail.packingStatus === -1\">\r\n {{ $t('program.sceneDetail.packingFailure') }}\r\n </template>\r\n <template v-if=\"localSceneDetail.packingStatus === 0\">\r\n {{ $t('program.sceneDetail.unPacking') }}\r\n </template>\r\n <template v-if=\"localSceneDetail.packingStatus === 1\">\r\n {{ $t('program.sceneDetail.packed',{time:localSceneDetail.packingTime}) }}\r\n </template>\r\n </template>\r\n\r\n </div>\r\n </div>\r\n <div class=\"action\" v-if=\"!mirgrateStatus.isStart\">\r\n <a-button class=\"btn\" type=\"link\"\r\n v-if=\"localSceneDetail.packingStatus === 1 || localSceneDetail.packingStatus === -1\"\r\n @click=\"handleMirgrateOut(localSceneDetail)\">\r\n {{ $t('program.sceneDetail.reFirstPacking') }}\r\n </a-button>\r\n <a-button class=\"btn\" type=\"link\" v-if=\"localSceneDetail.packingStatus === 0\"\r\n @click=\"handleMirgrateOut(localSceneDetail)\">\r\n {{ $t('program.sceneDetail.firstPacking') }}\r\n </a-button>\r\n\r\n <i class=\"icon iconfont icon-folder\"\r\n v-if=\"(localSceneDetail.packingStatus === 1 || localSceneDetail.packingStatus === -1) && !mirgrateStatus.isStart\"\r\n @click=\"openDir(localSceneDetail.packingFolder)\"></i>\r\n </div>\r\n </div> ")])) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_25, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_26, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.s_info')), 1 /* TEXT */), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_27, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_28, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.shoot_device')) + ":", 1 /* TEXT */), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_29, [$setup.localSceneDetail.type === $setup.TypeEnum.kankan ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("span", _hoisted_30, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.kankan')), 1 /* TEXT */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), $setup.localSceneDetail.type === $setup.TypeEnum.laser ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("span", _hoisted_31, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.laser')), 1 /* TEXT */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), $setup.localSceneDetail.type === $setup.TypeEnum.shenguang ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("span", _hoisted_32, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.shenguang')), 1 /* TEXT */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(" | SN:" + Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])($setup.localSceneDetail.sn), 1 /* TEXT */)])]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_33, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_34, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.shoot_way')) + ":", 1 /* TEXT */), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_35, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])($setup.localSceneDetail.location != 6 ? _ctx.$t('program.sceneDetail.shoot_way_type_1') : _ctx.$t('program.sceneDetail.shoot_way_type_2')), 1 /* TEXT */)]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_36, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_37, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.shoot_count')) + ":", 1 /* TEXT */), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_38, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])($setup.localSceneDetail.shootCount || '-'), 1 /* TEXT */)]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_39, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_40, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.shootStartTime')) + ":", 1 /* TEXT */), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_41, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])($setup.localSceneDetail.shootStartTime || '-'), 1 /* TEXT */)]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_42, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_43, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.upload_done_time')) + ":", 1 /* TEXT */), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_44, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])($setup.localSceneDetail.uploadTime || '-'), 1 /* TEXT */)]), ![$setup.CalcEnum.UN, $setup.CalcEnum.ERR, $setup.CalcEnum.ING, $setup.CalcEnum.LINEUP, $setup.CalcEnum.PAUSE].includes($setup.localSceneDetail.status) ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("div", _hoisted_45, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_46, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.calc_done_time')) + ":", 1 /* TEXT */), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_47, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(($setup.globalSceneType === 1 ? $setup.localSceneDetail.firstEndTime : $setup.localSceneDetail.meshFirstEndTime) || '-'), 1 /* TEXT */)])) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), ![$setup.CalcEnum.UN, $setup.CalcEnum.ERR, $setup.CalcEnum.ING, $setup.CalcEnum.LINEUP, $setup.CalcEnum.PAUSE].includes($setup.localSceneDetail.status) && !($setup.globalSceneType == 2 && [-1, 2, 3, 4].includes($setup.localSceneDetail.buildObjStatus)) ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("div", _hoisted_48, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_49, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.buildTime')) + ":", 1 /* TEXT */), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" <div class=\"info-desc\">{{ localSceneDetail.buildTime || '-' }}</div> "), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_50, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(($setup.globalSceneType === 1 ? $setup.localSceneDetail.buildTime : $setup.localSceneDetail.buildMeshTime) || '-'), 1 /* TEXT */)])) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), ![$setup.CalcEnum.UN, $setup.CalcEnum.ERR, $setup.CalcEnum.ING, $setup.CalcEnum.LINEUP, $setup.CalcEnum.PAUSE].includes($setup.localSceneDetail.status) && !($setup.globalSceneType == 2 && [-1, 2, 3, 4].includes($setup.localSceneDetail.buildObjStatus)) ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("div", _hoisted_51, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_52, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.re_calc_done_time')) + ":", 1 /* TEXT */), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_53, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" {{ localSceneDetail.buildEndTime }} "), $setup.localSceneDetail.status === $setup.CalcEnum.UN ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2307. key: 0
  2308. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" 未重算过 "), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(($setup.globalSceneType === 1 ? $setup.localSceneDetail.firstEndTime : $setup.localSceneDetail.meshFirstEndTime) || '-'), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */)) : (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2309. key: 1
  2310. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" 重算过 "), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(($setup.globalSceneType === 1 ? $setup.localSceneDetail.buildEndTime : $setup.localSceneDetail.meshBuildEndTime) || '-'), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */))]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_54, [$setup.localSceneDetail.buildObjStatus !== 2 && !($setup.globalSceneType == 2 && $setup.localSceneDetail.sceneSource > 3) ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])(_component_a_button, {
  2311. key: 0,
  2312. class: Object(vue__WEBPACK_IMPORTED_MODULE_0__["normalizeClass"])(["btn", {
  2313. disabled: !$setup.info
  2314. }]),
  2315. type: "link",
  2316. onClick: _cache[9] || (_cache[9] = function ($event) {
  2317. return $setup.handleSceneRCal($setup.localSceneDetail);
  2318. })
  2319. }, {
  2320. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2321. return [$setup.localSceneDetail.status === $setup.CalcEnum.UN ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2322. key: 0
  2323. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDown.msgStatus.un')), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */)) : $setup.localSceneDetail.status === $setup.CalcEnum.ING ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2324. key: 1
  2325. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDown.msgStatus.ing')), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */)) : (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2326. key: 2
  2327. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDown.recalc')), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */))];
  2328. }),
  2329. _: 1 /* STABLE */
  2330. }, 8 /* PROPS */, ["class"])) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true)])])) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true)]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" <a-modal v-if=\"mirgrateStatus.isStart\" :closable=\"false\" :centered=\"true\" :visible=\"mirgrateStatus.isStart\"\r\n :title=\"$t('sys.dialogTitle')\" :footer=\"null\" width=\"340px\" class=\"dialog\">\r\n <div class=\"process-content\" style=\"color:white\">\r\n <span> {{ mirgrateStatus.type === 0 ? $t('program.sceneDetail.exporting') : $t('program.sceneDetail.exportingOut')\r\n }}\r\n {{ mirgrateStatus.progress }} %</span>\r\n <a-button class=\"btn\" type=\"primary\" @click=\"mirgrateStatus.isStart = false\">{{ $t('sys.cancel') }}</a-button>\r\n </div>\r\n </a-modal> ")], 2 /* CLASS */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true);
  2331. }
  2332. /***/ }),
  2333. /***/ "../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js?!../../node_modules/vue-loader-v16/dist/templateLoader.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/scene/index.vue?vue&type=template&id=41644aac&scoped=true&ts=true":
  2334. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  2335. !*** D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--14-0!D:/web_src/4dkankan_v4/node_modules/babel-loader/lib!D:/web_src/4dkankan_v4/node_modules/ts-loader??ref--14-2!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/templateLoader.js??ref--7!D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--1-0!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist??ref--1-1!./src/app/program/views/scene/index.vue?vue&type=template&id=41644aac&scoped=true&ts=true ***!
  2336. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  2337. /*! exports provided: render */
  2338. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2339. "use strict";
  2340. __webpack_require__.r(__webpack_exports__);
  2341. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  2342. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "../../node_modules/vue/dist/vue.runtime.esm-bundler.js");
  2343. var _withScopeId = function (n) {
  2344. return Object(vue__WEBPACK_IMPORTED_MODULE_0__["pushScopeId"])("data-v-41644aac"), n = n(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["popScopeId"])(), n;
  2345. };
  2346. var _hoisted_1 = {
  2347. class: "content-layer scene-layer"
  2348. };
  2349. var _hoisted_2 = {
  2350. class: "action-ctrl top"
  2351. };
  2352. var _hoisted_3 = {
  2353. class: "action"
  2354. };
  2355. var _hoisted_4 = {
  2356. class: "icons"
  2357. };
  2358. var _hoisted_5 = {
  2359. class: "main"
  2360. };
  2361. var _hoisted_6 = {
  2362. class: "left"
  2363. };
  2364. var _hoisted_7 = {
  2365. key: 0,
  2366. class: "customPanel"
  2367. };
  2368. var _hoisted_8 = ["onClick"];
  2369. var _hoisted_9 = ["src"];
  2370. var _hoisted_10 = {
  2371. key: 0,
  2372. class: "cover-child"
  2373. };
  2374. var _hoisted_11 = {
  2375. key: 1,
  2376. class: "copy"
  2377. };
  2378. var _hoisted_12 = {
  2379. class: "infos_detail"
  2380. };
  2381. var _hoisted_13 = {
  2382. key: 0
  2383. };
  2384. var _hoisted_14 = {
  2385. key: 1
  2386. };
  2387. var _hoisted_15 = {
  2388. key: 2
  2389. };
  2390. var _hoisted_16 = /*#__PURE__*/_withScopeId(function () {
  2391. /*#__PURE__*/return Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("span", {
  2392. class: "slash"
  2393. }, "|", -1 /* HOISTED */);
  2394. });
  2395. var _hoisted_17 = /*#__PURE__*/_withScopeId(function () {
  2396. /*#__PURE__*/return Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("span", {
  2397. class: "slash"
  2398. }, "|", -1 /* HOISTED */);
  2399. });
  2400. var _hoisted_18 = {
  2401. class: "scene-actions"
  2402. };
  2403. var _hoisted_19 = {
  2404. class: "menu-btn"
  2405. };
  2406. var _hoisted_20 = {
  2407. class: "menu-btn"
  2408. };
  2409. var _hoisted_21 = {
  2410. class: "menu-btn"
  2411. };
  2412. var _hoisted_22 = {
  2413. class: "menu-btn"
  2414. };
  2415. var _hoisted_23 = {
  2416. class: "scene-action-info"
  2417. };
  2418. var _hoisted_24 = {
  2419. class: "info"
  2420. };
  2421. var _hoisted_25 = {
  2422. class: "process-content",
  2423. style: {
  2424. "color": "white"
  2425. }
  2426. };
  2427. function render(_ctx, _cache, $props, $setup, $data, $options) {
  2428. var _component_a_select_option = Object(vue__WEBPACK_IMPORTED_MODULE_0__["resolveComponent"])("a-select-option");
  2429. var _component_a_select = Object(vue__WEBPACK_IMPORTED_MODULE_0__["resolveComponent"])("a-select");
  2430. var _component_a_input = Object(vue__WEBPACK_IMPORTED_MODULE_0__["resolveComponent"])("a-input");
  2431. var _component_a_input_group = Object(vue__WEBPACK_IMPORTED_MODULE_0__["resolveComponent"])("a-input-group");
  2432. var _component_a_button = Object(vue__WEBPACK_IMPORTED_MODULE_0__["resolveComponent"])("a-button");
  2433. var _component_a_tooltip = Object(vue__WEBPACK_IMPORTED_MODULE_0__["resolveComponent"])("a-tooltip");
  2434. var _component_a_table = Object(vue__WEBPACK_IMPORTED_MODULE_0__["resolveComponent"])("a-table");
  2435. var _component_a_config_provider = Object(vue__WEBPACK_IMPORTED_MODULE_0__["resolveComponent"])("a-config-provider");
  2436. var _component_a_modal = Object(vue__WEBPACK_IMPORTED_MODULE_0__["resolveComponent"])("a-modal");
  2437. return Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_1, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createVNode"])(_component_a_config_provider, {
  2438. locale: $setup.antLang
  2439. }, {
  2440. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2441. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", {
  2442. class: Object(vue__WEBPACK_IMPORTED_MODULE_0__["normalizeClass"])(["list-container", {
  2443. active: $setup.showDetailPanel
  2444. }])
  2445. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_2, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" 工具 "), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_3, [true ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])(_component_a_input_group, {
  2446. key: 0,
  2447. compact: "",
  2448. class: "input"
  2449. }, {
  2450. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2451. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createVNode"])(_component_a_select, {
  2452. class: "select-cat",
  2453. value: $setup.option,
  2454. "onUpdate:value": _cache[0] || (_cache[0] = function ($event) {
  2455. return $setup.option = $event;
  2456. }),
  2457. style: {
  2458. "width": "100px"
  2459. }
  2460. }, {
  2461. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2462. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createVNode"])(_component_a_select_option, {
  2463. value: "title"
  2464. }, {
  2465. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2466. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.scene.name')), 1 /* TEXT */)];
  2467. }),
  2468. _: 1 /* STABLE */
  2469. }), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createVNode"])(_component_a_select_option, {
  2470. value: "sn"
  2471. }, {
  2472. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2473. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.camera.sn')), 1 /* TEXT */)];
  2474. }),
  2475. _: 1 /* STABLE */
  2476. })];
  2477. }),
  2478. _: 1 /* STABLE */
  2479. }, 8 /* PROPS */, ["value"]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createVNode"])(_component_a_input, {
  2480. style: {
  2481. "margin-right": "20px"
  2482. },
  2483. class: "search-input",
  2484. value: $setup.keyword,
  2485. "onUpdate:value": _cache[2] || (_cache[2] = function ($event) {
  2486. return $setup.keyword = $event;
  2487. }),
  2488. placeholder: _ctx.$t('sys.searchAll')
  2489. }, {
  2490. suffix: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2491. return [$setup.keyword ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])($setup["CloseCircleOutlined"], {
  2492. key: 0,
  2493. style: {
  2494. "margin-right": "10px"
  2495. },
  2496. onClick: _cache[1] || (_cache[1] = function ($event) {
  2497. return $setup.keyword = '';
  2498. })
  2499. })) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" <SearchOutlined /> ")];
  2500. }),
  2501. _: 1 /* STABLE */
  2502. }, 8 /* PROPS */, ["value", "placeholder"]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createVNode"])(_component_a_select, {
  2503. style: {
  2504. "margin-right": "20px"
  2505. },
  2506. class: "all select-all",
  2507. value: $setup.allOption,
  2508. "onUpdate:value": _cache[3] || (_cache[3] = function ($event) {
  2509. return $setup.allOption = $event;
  2510. }),
  2511. onSelect: $setup.selectScenesType,
  2512. disabled: $setup.cameraNames.length < 2
  2513. }, {
  2514. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2515. return [$setup.cameraNames.length > 1 ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])(_component_a_select_option, {
  2516. key: 0,
  2517. value: null
  2518. }, {
  2519. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2520. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.selectAll')), 1 /* TEXT */)];
  2521. }),
  2522. _: 1 /* STABLE */
  2523. })) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), $setup.cameraNames.includes($setup.TypeEnum.kankan) ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])(_component_a_select_option, {
  2524. key: 1,
  2525. value: $setup.TypeEnum.kankan
  2526. }, {
  2527. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2528. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.kankan')), 1 /* TEXT */)];
  2529. }),
  2530. _: 1 /* STABLE */
  2531. }, 8 /* PROPS */, ["value"])) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), $setup.cameraNames.includes($setup.TypeEnum.laser) ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])(_component_a_select_option, {
  2532. key: 2,
  2533. value: $setup.TypeEnum.laser
  2534. }, {
  2535. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2536. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.laser')), 1 /* TEXT */)];
  2537. }),
  2538. _: 1 /* STABLE */
  2539. }, 8 /* PROPS */, ["value"])) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), $setup.cameraNames.includes($setup.TypeEnum.shenguang) ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])(_component_a_select_option, {
  2540. key: 3,
  2541. value: $setup.TypeEnum.shenguang
  2542. }, {
  2543. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2544. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.shenguang')), 1 /* TEXT */)];
  2545. }),
  2546. _: 1 /* STABLE */
  2547. }, 8 /* PROPS */, ["value"])) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true)];
  2548. }),
  2549. _: 1 /* STABLE */
  2550. }, 8 /* PROPS */, ["value", "disabled"]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createVNode"])(_component_a_select, {
  2551. class: "all select-mesh",
  2552. value: $setup.globalSceneType,
  2553. "onUpdate:value": _cache[4] || (_cache[4] = function ($event) {
  2554. return $setup.globalSceneType = $event;
  2555. }),
  2556. onSelect: $setup.selectMeshType
  2557. }, {
  2558. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2559. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" <a-select-option :value=\"null\"> {{ $t('program.selectAll') }}</a-select-option> "), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createVNode"])(_component_a_select_option, {
  2560. value: 1
  2561. }, {
  2562. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2563. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.scene.laserClo')), 1 /* TEXT */)];
  2564. }),
  2565. _: 1 /* STABLE */
  2566. }), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createVNode"])(_component_a_select_option, {
  2567. value: 2
  2568. }, {
  2569. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2570. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.scene.laserObj')), 1 /* TEXT */)];
  2571. }),
  2572. _: 1 /* STABLE */
  2573. })];
  2574. }),
  2575. _: 1 /* STABLE */
  2576. }, 8 /* PROPS */, ["value"])];
  2577. }),
  2578. _: 1 /* STABLE */
  2579. })) : undefined]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" 工具 "), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_4, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createVNode"])(_component_a_button, {
  2580. class: Object(vue__WEBPACK_IMPORTED_MODULE_0__["normalizeClass"])(["sync-btn", {
  2581. disabled: !$setup.info
  2582. }]),
  2583. type: "primary",
  2584. size: "middle",
  2585. onClick: $setup.useSceneSync
  2586. }, {
  2587. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2588. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.scene.sync')), 1 /* TEXT */)];
  2589. }),
  2590. _: 1 /* STABLE */
  2591. }, 8 /* PROPS */, ["onClick", "class"])])]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_5, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_6, [$setup.scenes.length ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])(_component_a_table, {
  2592. key: 0,
  2593. customRow: $setup.customRow,
  2594. rowClassName: $setup.rowClassName,
  2595. onChange: $setup.onPageChange,
  2596. class: "content-table",
  2597. rowKey: '_id',
  2598. "row-selection": $setup.type === $setup.TypeEnum.kankan || $setup.isCloud ? {
  2599. selectedRowKeys: $setup.selectIds,
  2600. onChange: $setup.changeHandler
  2601. } : null,
  2602. columns: $setup.columns,
  2603. "data-source": $setup.scenes,
  2604. pagination: $setup.pagination
  2605. }, {
  2606. headerCell: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function (_a) {
  2607. var column = _a.column;
  2608. return [column.key === 'customPanel' ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("div", _hoisted_7, [$setup.isCloud || $setup.type === $setup.TypeEnum.kankan ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])(_component_a_tooltip, {
  2609. key: 0,
  2610. placement: "bottom"
  2611. }, {
  2612. title: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2613. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("span", null, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.scene.delete')), 1 /* TEXT */)];
  2614. }),
  2615. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2616. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("span", {
  2617. class: Object(vue__WEBPACK_IMPORTED_MODULE_0__["normalizeClass"])(["iconfont icon-del fun-ctrl", {
  2618. disabled: !$setup.checkScenesOpen($setup.selectScenes, _ctx.$t('program.delete'))
  2619. }]),
  2620. onClick: _cache[5] || (_cache[5] = function ($event) {
  2621. return $setup.delScene($setup.selectScenes);
  2622. })
  2623. }, null, 2 /* CLASS */)];
  2624. }),
  2625. _: 1 /* STABLE */
  2626. })) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createVNode"])(_component_a_tooltip, {
  2627. placement: "bottom"
  2628. }, {
  2629. title: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2630. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("span", null, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('sys.refer')), 1 /* TEXT */)];
  2631. }),
  2632. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2633. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("span", {
  2634. class: "iconfont icon-refresh fun-ctrl",
  2635. onClick: _cache[6] || (_cache[6] =
  2636. //@ts-ignore
  2637. function () {
  2638. var args = [];
  2639. for (var _i = 0; _i < arguments.length; _i++) {
  2640. args[_i] = arguments[_i];
  2641. }
  2642. return $setup.refresh && $setup.refresh.apply($setup, args);
  2643. })
  2644. })];
  2645. }),
  2646. _: 1 /* STABLE */
  2647. }), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" <a-tooltip placement=\"bottom\">\r\n <template #title>\r\n <span>{{ $t('program.sceneDetail.import') }}</span>\r\n </template>\r\n <span class=\"iconfont icon-import fun-ctrl\" @click=\"handleMirgrateIn\"></span>\r\n </a-tooltip> ")])) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true)];
  2648. }),
  2649. cover: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function (_a) {
  2650. var record = _a.record;
  2651. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", {
  2652. class: Object(vue__WEBPACK_IMPORTED_MODULE_0__["normalizeClass"])(["cover", {
  2653. onC: !$setup.getCoverMsg(record.status)
  2654. }]),
  2655. onClick: function ($event) {
  2656. return $setup.handleGoByCover(record);
  2657. }
  2658. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" <img src=\"http://192.168.0.62:9008/profile/static/img_default/pc.jpg?time=1740638570394\" /> "), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("img", {
  2659. class: "cover-child",
  2660. src: record.cover
  2661. }, null, 8 /* PROPS */, _hoisted_9), $setup.getCoverMsg(record.status) ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("span", _hoisted_10, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])($setup.getCoverMsg(record.status)), 1 /* TEXT */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), record.isCopy ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("div", _hoisted_11, " Copy ")) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true)], 10 /* CLASS, PROPS */, _hoisted_8)];
  2662. }),
  2663. infos: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function (_a) {
  2664. var record = _a.record;
  2665. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", {
  2666. class: Object(vue__WEBPACK_IMPORTED_MODULE_0__["normalizeClass"])(["infos", {
  2667. onC: !$setup.getCoverMsg(record.status)
  2668. }])
  2669. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("h3", null, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(record.title), 1 /* TEXT */), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_12, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("p", null, [record.type === $setup.TypeEnum.kankan ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("span", _hoisted_13, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.kankan')), 1 /* TEXT */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), record.type === $setup.TypeEnum.laser ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("span", _hoisted_14, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.laser')), 1 /* TEXT */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), record.type === $setup.TypeEnum.shenguang ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("span", _hoisted_15, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.shenguang')), 1 /* TEXT */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true)]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" <span class=\"slash\">|</span>\r\n <p>\r\n <span>{{ $t('program.scene.photoTime') }}:</span>{{ record.time }}\r\n </p>\r\n <span class=\"slash\">|</span> "), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("p", null, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("span", null, "(" + Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.camera.sn')) + ":", 1 /* TEXT */), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(record.sn) + ") ", 1 /* TEXT */)]), _hoisted_16, Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("p", null, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("span", null, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.case.num')) + ":", 1 /* TEXT */), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(record.sceneCode), 1 /* TEXT */)]), _hoisted_17, Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("p", null, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" <template v-if=\"record.status === CalcEnum.ERR\">\r\n {{ $t('program.sceneDown.coverStatus.err') }}\r\n </template>\r\n <template v-if=\"record.status === CalcEnum.UN\">\r\n {{ $t('program.sceneDown.coverStatus.un') }}\r\n </template>\r\n <template v-if=\"record.status === CalcEnum.COM\">\r\n {{ $t('program.sceneDetail.updateAt') }} {{ record.updateTime }}\r\n </template>\r\n\r\n <template v-if=\"record.status === CalcEnum.ING\">\r\n {{ $t('program.sceneDetail.calcing') }} : {{ calcStatus.progress }} %\r\n </template> "), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" {{ getCoverMsg(record.status) }} "), record.status === $setup.CalcEnum.COM ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2670. key: 0
  2671. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.updateAt')) + " " + Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(($setup.globalSceneType === 1 ? record.lastEditTime : record.lastMeshEditTime) || '-'), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */)) : record.status === $setup.CalcEnum.ING ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2672. key: 1
  2673. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.sceneDetail.calcing')) + " : " + Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])($setup.calcStatus.progress) + " % ", 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */)) : (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  2674. key: 2
  2675. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])($setup.getCoverMsg(record.status)), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */))])])], 2 /* CLASS */)];
  2676. }),
  2677. action: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function (_a) {
  2678. var record = _a.record;
  2679. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" {{ record }} "), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_18, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" {{ record.status }} "), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" 菜单 "), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" 暂停 "), [$setup.CalcEnum.LINEUP, $setup.CalcEnum.ING].includes(record.status) && !($setup.globalSceneType == 2 && record.sceneSource > 3 && [$setup.CalcEnum.LINEUP, $setup.CalcEnum.ING].includes(record.status)) ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])(_component_a_button, {
  2680. key: 0,
  2681. type: "link",
  2682. onClick: function ($event) {
  2683. return $setup.handlePauseCalcScene(record);
  2684. }
  2685. }, {
  2686. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2687. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("span", _hoisted_19, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])($setup.ui18n.t('program.sceneDown.msgStatus.ing')), 1 /* TEXT */)];
  2688. }),
  2689. _: 2 /* DYNAMIC */
  2690. }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick"])) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), record.status === $setup.CalcEnum.COM ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])(_component_a_button, {
  2691. key: 1,
  2692. type: "link",
  2693. onClick: function ($event) {
  2694. return !$setup.getCoverMsg(record.status) && $setup.jumpScene(record, '1');
  2695. }
  2696. }, {
  2697. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2698. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("span", _hoisted_20, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])($setup.ui18n.t('program.sceneDown.edit')), 1 /* TEXT */)];
  2699. }),
  2700. _: 2 /* DYNAMIC */
  2701. }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick"])) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" 重算 "), [$setup.CalcEnum.ERR, $setup.CalcEnum.PAUSE].includes(record.status) && !($setup.globalSceneType == 2 && record.sceneSource > 3) ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])(_component_a_button, {
  2702. key: 2,
  2703. type: "link",
  2704. onClick: function ($event) {
  2705. return $setup.reCalcScenes([record]);
  2706. },
  2707. class: Object(vue__WEBPACK_IMPORTED_MODULE_0__["normalizeClass"])({
  2708. disabled: !$setup.info
  2709. })
  2710. }, {
  2711. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2712. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("span", _hoisted_21, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])($setup.ui18n.t('program.sceneDown.recalc')), 1 /* TEXT */)];
  2713. }),
  2714. _: 2 /* DYNAMIC */
  2715. }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick", "class"])) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" 未计算 "), record.status === $setup.CalcEnum.UN && !($setup.globalSceneType == 2 && record.sceneSource > 3) ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])(_component_a_button, {
  2716. key: 3,
  2717. type: "link",
  2718. onClick: function ($event) {
  2719. return $setup.handleUnCalcScene(record);
  2720. },
  2721. class: Object(vue__WEBPACK_IMPORTED_MODULE_0__["normalizeClass"])({
  2722. disabled: !$setup.info
  2723. })
  2724. }, {
  2725. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2726. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("span", _hoisted_22, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])($setup.ui18n.t('program.sceneDown.msgStatus.un')), 1 /* TEXT */)];
  2727. }),
  2728. _: 2 /* DYNAMIC */
  2729. }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick", "class"])) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" <template v-for=\"item in getSceneMenus(record)\">\r\n <a-button type=\"link\" @click=\"item.action\">\r\n <span class=\"menu-btn\"> {{ item.text }}</span>\r\n </a-button>\r\n </template> ")]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_23, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("span", _hoisted_24, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])($setup.getSceneInfo(record).join('、')), 1 /* TEXT */), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" <a-dropdown\r\n placement=\"bottomRight\"\r\n v-if=\"getSceneMenus(record).length\"\r\n >\r\n <span class=\"ant-dropdown-link\" @click.prevent>\r\n <span class=\"iconfont icon-more fun-ctrl\"></span>\r\n </span>\r\n <template #overlay>\r\n <a-menu>\r\n <a-menu-item v-for=\"item in getSceneMenus(record)\">\r\n <a @click=\"item.action\">{{ item.text }}</a>\r\n </a-menu-item>\r\n </a-menu>\r\n </template>\r\n </a-dropdown> ")])];
  2730. }),
  2731. _: 1 /* STABLE */
  2732. }, 8 /* PROPS */, ["row-selection", "columns", "data-source"])) : (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])($setup["UnData"], {
  2733. key: 1,
  2734. desc: $setup.keyword ? _ctx.$t('program.scene.unKeySearch') : _ctx.$t('program.scene.unSearch')
  2735. }, {
  2736. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2737. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" <div class=\"line\" v-if=\"!keyword\">\r\n <span>\r\n <i class=\"iconfont icon-import\" @click=\"handleMirgrateIn\"></i>\r\n </span>\r\n </div> "), !$setup.keyword ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("div", {
  2738. key: 0,
  2739. class: Object(vue__WEBPACK_IMPORTED_MODULE_0__["normalizeClass"])({
  2740. disabled: !$setup.info
  2741. })
  2742. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" <a-button type=\"primary\" shape=\"round\" size=\"middle\" @click=\"useSceneSync\">\r\n {{ $t('program.scene.sync') }}\r\n </a-button> ")], 2 /* CLASS */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true)];
  2743. }),
  2744. _: 1 /* STABLE */
  2745. }, 8 /* PROPS */, ["desc"]))]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createVNode"])($setup["Detail"], {
  2746. onClose: _cache[7] || (_cache[7] = function ($event) {
  2747. return $setup.showDetailPanel = false;
  2748. }),
  2749. tab: $setup.current
  2750. }, null, 8 /* PROPS */, ["tab"])])], 2 /* CLASS */)];
  2751. }),
  2752. _: 1 /* STABLE */
  2753. }, 8 /* PROPS */, ["locale"])]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createVNode"])($setup["DeviceCom"], {
  2754. syncDevice: $setup.syncDevice,
  2755. "onUpdate:syncDevice": _cache[8] || (_cache[8] = function ($event) {
  2756. return $setup.syncDevice = $event;
  2757. })
  2758. }, null, 8 /* PROPS */, ["syncDevice"]), $setup.mirgrateStatus.isStart ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])(_component_a_modal, {
  2759. key: 0,
  2760. closable: false,
  2761. centered: true,
  2762. visible: $setup.mirgrateStatus.isStart,
  2763. title: _ctx.$t('sys.dialogTitle'),
  2764. footer: null,
  2765. width: "340px",
  2766. class: "dialog"
  2767. }, {
  2768. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2769. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_25, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("span", null, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])($setup.mirgrateStatus.type === 0 ? _ctx.$t('program.sceneDetail.exporting') : _ctx.$t('program.sceneDetail.exportOut')) + " " + Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])($setup.mirgrateStatus.progress) + " %", 1 /* TEXT */), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createVNode"])(_component_a_button, {
  2770. class: "btn",
  2771. type: "primary",
  2772. onClick: $setup.onMigrateSceneCancel,
  2773. disabled: $setup.mirgrateStatus.progress < 1
  2774. }, {
  2775. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2776. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('sys.cancel')), 1 /* TEXT */)];
  2777. }),
  2778. _: 1 /* STABLE */
  2779. }, 8 /* PROPS */, ["disabled"])])];
  2780. }),
  2781. _: 1 /* STABLE */
  2782. }, 8 /* PROPS */, ["visible", "title"])) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true)], 64 /* STABLE_FRAGMENT */);
  2783. }
  2784. /***/ }),
  2785. /***/ "../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js?!../../node_modules/vue-loader-v16/dist/templateLoader.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/index.vue?vue&type=template&id=c40f4be4&ts=true":
  2786. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  2787. !*** D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--14-0!D:/web_src/4dkankan_v4/node_modules/babel-loader/lib!D:/web_src/4dkankan_v4/node_modules/ts-loader??ref--14-2!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/templateLoader.js??ref--7!D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--1-0!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist??ref--1-1!./src/app/program/views/sys/device/index.vue?vue&type=template&id=c40f4be4&ts=true ***!
  2788. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  2789. /*! exports provided: render */
  2790. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2791. "use strict";
  2792. __webpack_require__.r(__webpack_exports__);
  2793. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  2794. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "../../node_modules/vue/dist/vue.runtime.esm-bundler.js");
  2795. function render(_ctx, _cache, $props, $setup, $data, $options) {
  2796. var _component_a_modal = Object(vue__WEBPACK_IMPORTED_MODULE_0__["resolveComponent"])("a-modal");
  2797. return $setup.current ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])(_component_a_modal, {
  2798. key: 0,
  2799. visible: $setup.visible && $setup.actived,
  2800. title: $setup.current.title,
  2801. onCancel: _cache[0] || (_cache[0] = function ($event) {
  2802. return $setup.changeVisible(false);
  2803. }),
  2804. footer: null,
  2805. width: "1020px",
  2806. class: "dialog"
  2807. }, {
  2808. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2809. return [(Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["resolveDynamicComponent"])($setup.current.component)))];
  2810. }),
  2811. _: 1 /* STABLE */
  2812. }, 8 /* PROPS */, ["visible", "title"])) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true);
  2813. }
  2814. /***/ }),
  2815. /***/ "../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js?!../../node_modules/vue-loader-v16/dist/templateLoader.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/sync/index.vue?vue&type=template&id=05b8aad2&scoped=true&ts=true":
  2816. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  2817. !*** D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--14-0!D:/web_src/4dkankan_v4/node_modules/babel-loader/lib!D:/web_src/4dkankan_v4/node_modules/ts-loader??ref--14-2!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/templateLoader.js??ref--7!D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--1-0!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist??ref--1-1!./src/app/program/views/sys/device/sync/index.vue?vue&type=template&id=05b8aad2&scoped=true&ts=true ***!
  2818. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  2819. /*! exports provided: render */
  2820. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2821. "use strict";
  2822. __webpack_require__.r(__webpack_exports__);
  2823. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  2824. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "../../node_modules/vue/dist/vue.runtime.esm-bundler.js");
  2825. var _withScopeId = function (n) {
  2826. return Object(vue__WEBPACK_IMPORTED_MODULE_0__["pushScopeId"])("data-v-05b8aad2"), n = n(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["popScopeId"])(), n;
  2827. };
  2828. var _hoisted_1 = {
  2829. class: "sn-info"
  2830. };
  2831. var _hoisted_2 = {
  2832. key: 0
  2833. };
  2834. var _hoisted_3 = {
  2835. key: 1,
  2836. style: {
  2837. "color": "#fa993f"
  2838. }
  2839. };
  2840. var _hoisted_4 = {
  2841. class: "extra"
  2842. };
  2843. var _hoisted_5 = {
  2844. class: "action-ctrl icon"
  2845. };
  2846. var _hoisted_6 = {
  2847. class: "action"
  2848. };
  2849. function render(_ctx, _cache, $props, $setup, $data, $options) {
  2850. var _component_a_alert = Object(vue__WEBPACK_IMPORTED_MODULE_0__["resolveComponent"])("a-alert");
  2851. var _component_a_input = Object(vue__WEBPACK_IMPORTED_MODULE_0__["resolveComponent"])("a-input");
  2852. var _component_a_button = Object(vue__WEBPACK_IMPORTED_MODULE_0__["resolveComponent"])("a-button");
  2853. var _component_a_tab_pane = Object(vue__WEBPACK_IMPORTED_MODULE_0__["resolveComponent"])("a-tab-pane");
  2854. var _component_a_tabs = Object(vue__WEBPACK_IMPORTED_MODULE_0__["resolveComponent"])("a-tabs");
  2855. return Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("div", null, [$setup.syncStatus.count ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])(_component_a_alert, {
  2856. key: 0,
  2857. message: "".concat(_ctx.$t('program.other.currentSync', {
  2858. count: $setup.syncStatus.count
  2859. })).concat($setup.syncDesc, "\uFF0C").concat(_ctx.$t('program.other.sy'), ": ").concat($setup.framtTime($setup.syncStatus.time), "\uFF0C").concat(_ctx.$t('program.other.linkTip')),
  2860. type: "warning",
  2861. class: "sync-info"
  2862. }, null, 8 /* PROPS */, ["message"])) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" v-if=\"snCodes.length || syncStatus.snCodes.length !== snCodes.length\" "), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_1, [$setup.snCodes.length ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("p", _hoisted_2, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.other.currentSN')), 1 /* TEXT */), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("span", null, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])($setup.snCodes.join(',')), 1 /* TEXT */)])) : (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("p", _hoisted_3, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.other.existsNot')), 1 /* TEXT */))]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_4, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_5, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_6, [$setup.current.key === $setup.Device.LOCAL ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])(_component_a_input, {
  2863. key: 0,
  2864. style: {
  2865. "width": "200px"
  2866. },
  2867. class: "action-ctrl",
  2868. value: $setup.keyword,
  2869. "onUpdate:value": $setup.updateKeyowrd,
  2870. placeholder: _ctx.$t('sys.searchAll')
  2871. }, {
  2872. suffix: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2873. return [$setup.keyword ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])($setup["CloseCircleOutlined"], {
  2874. key: 0,
  2875. style: {
  2876. "margin-right": "10px"
  2877. },
  2878. onClick: _cache[0] || (_cache[0] = function ($event) {
  2879. return $setup.keyword = '';
  2880. })
  2881. })) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createVNode"])($setup["SearchOutlined"])];
  2882. }),
  2883. _: 1 /* STABLE */
  2884. }, 8 /* PROPS */, ["value", "placeholder"])) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true)])]), $setup.current.key !== $setup.Device.LOCAL ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("span", {
  2885. key: 0,
  2886. class: Object(vue__WEBPACK_IMPORTED_MODULE_0__["normalizeClass"])([{
  2887. disabled: !$setup.current.selects.length
  2888. }, "iconfont icon-del icon fun-ctrl"]),
  2889. onClick: _cache[1] || (_cache[1] = function ($event) {
  2890. return $setup.delScenes($setup.current.selects);
  2891. })
  2892. }, null, 2 /* CLASS */)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" <span :class=\"{ disabled: !current.selects.length }\" class=\"iconfont icon-refresh icon fun-ctrl\"\r\n @click=\"setLocalScenes\"></span> "), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createVNode"])(_component_a_button, {
  2893. class: Object(vue__WEBPACK_IMPORTED_MODULE_0__["normalizeClass"])([{
  2894. disabled: !$setup.current.selects.length || $setup.current.selects.every(function (scene) {
  2895. return scene.syncStatus === $setup.SyncEnum.ING;
  2896. })
  2897. }, "sync-btn"]),
  2898. onClick: _cache[2] || (_cache[2] = function ($event) {
  2899. return $setup.copyScenes($setup.current.selects);
  2900. })
  2901. }, {
  2902. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2903. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.other.syncTo')) + Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])($setup.current.key === $setup.Device.USB ? _ctx.$t('program.other.win') : _ctx.$t('program.other.usb')), 1 /* TEXT */)];
  2904. }),
  2905. _: 1 /* STABLE */
  2906. }, 8 /* PROPS */, ["class"])]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createVNode"])(_component_a_tabs, {
  2907. activeKey: $setup.activeKey,
  2908. "onUpdate:activeKey": _cache[6] || (_cache[6] = function ($event) {
  2909. return $setup.activeKey = $event;
  2910. }),
  2911. class: "scene-sync-select"
  2912. }, {
  2913. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2914. return [(Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(true), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, Object(vue__WEBPACK_IMPORTED_MODULE_0__["renderList"])($setup.types, function (atom) {
  2915. return Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])(_component_a_tab_pane, {
  2916. key: atom.key,
  2917. tab: "".concat(atom.title, "\uFF08").concat(atom.showScenes.length, "\uFF09")
  2918. }, {
  2919. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  2920. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createVNode"])($setup["SelectScene"], {
  2921. device: $setup.current.key,
  2922. selects: atom.selects,
  2923. "onUpdate:selects": function (selects) {
  2924. return atom.selects = selects;
  2925. },
  2926. onDeleteScene: _cache[3] || (_cache[3] = function (scene) {
  2927. return $setup.delScenes([scene]);
  2928. }),
  2929. onSyncScene: _cache[4] || (_cache[4] = function (scene) {
  2930. return $setup.copyScenes([scene]);
  2931. }),
  2932. onQuitSyncScene: _cache[5] || (_cache[5] = function (scene) {
  2933. return $setup.quitCopyScenes([scene]);
  2934. }),
  2935. scenes: atom.showScenes
  2936. }, null, 8 /* PROPS */, ["device", "selects", "onUpdate:selects", "scenes"]), !$setup.current.showScenes.length ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])($setup["UnData"], {
  2937. key: 0,
  2938. desc: $setup.current.key === $setup.Device.USB ? _ctx.$t('program.other.unUSB') : _ctx.$t('program.other.unWin'),
  2939. style: {
  2940. "height": "400px"
  2941. }
  2942. }, null, 8 /* PROPS */, ["desc"])) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true)];
  2943. }),
  2944. _: 2 /* DYNAMIC */
  2945. }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["tab"]);
  2946. }), 128 /* KEYED_FRAGMENT */))];
  2947. }),
  2948. _: 1 /* STABLE */
  2949. }, 8 /* PROPS */, ["activeKey"])]);
  2950. }
  2951. /***/ }),
  2952. /***/ "../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js?!../../node_modules/vue-loader-v16/dist/templateLoader.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=template&id=239f642b&scoped=true&ts=true":
  2953. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  2954. !*** D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--14-0!D:/web_src/4dkankan_v4/node_modules/babel-loader/lib!D:/web_src/4dkankan_v4/node_modules/ts-loader??ref--14-2!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/templateLoader.js??ref--7!D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--1-0!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist??ref--1-1!./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=template&id=239f642b&scoped=true&ts=true ***!
  2955. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  2956. /*! exports provided: render */
  2957. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2958. "use strict";
  2959. __webpack_require__.r(__webpack_exports__);
  2960. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  2961. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "../../node_modules/vue/dist/vue.runtime.esm-bundler.js");
  2962. var _withScopeId = function (n) {
  2963. return Object(vue__WEBPACK_IMPORTED_MODULE_0__["pushScopeId"])("data-v-239f642b"), n = n(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["popScopeId"])(), n;
  2964. };
  2965. var _hoisted_1 = {
  2966. class: "select-all"
  2967. };
  2968. var _hoisted_2 = {
  2969. class: "layout"
  2970. };
  2971. var _hoisted_3 = {
  2972. class: "scene-layout"
  2973. };
  2974. var _hoisted_4 = {
  2975. class: "cover"
  2976. };
  2977. var _hoisted_5 = ["src"];
  2978. var _hoisted_6 = {
  2979. class: "pano"
  2980. };
  2981. var _hoisted_7 = {
  2982. class: "pano-left"
  2983. };
  2984. var _hoisted_8 = {
  2985. class: "info"
  2986. };
  2987. var _hoisted_9 = {
  2988. class: "fun-info"
  2989. };
  2990. var _hoisted_10 = {
  2991. key: 0,
  2992. class: "action"
  2993. };
  2994. var _hoisted_11 = ["onClick"];
  2995. var _hoisted_12 = ["onClick"];
  2996. var _hoisted_13 = {
  2997. class: "time-bs"
  2998. };
  2999. var _hoisted_14 = {
  3000. class: "select-count"
  3001. };
  3002. var _hoisted_15 = ["innerHTML"];
  3003. function render(_ctx, _cache, $props, $setup, $data, $options) {
  3004. var _component_a_tooltip = Object(vue__WEBPACK_IMPORTED_MODULE_0__["resolveComponent"])("a-tooltip");
  3005. var _component_a_checkbox = Object(vue__WEBPACK_IMPORTED_MODULE_0__["resolveComponent"])("a-checkbox");
  3006. var _component_a_menu_item = Object(vue__WEBPACK_IMPORTED_MODULE_0__["resolveComponent"])("a-menu-item");
  3007. var _component_a_menu = Object(vue__WEBPACK_IMPORTED_MODULE_0__["resolveComponent"])("a-menu");
  3008. var _component_a_dropdown = Object(vue__WEBPACK_IMPORTED_MODULE_0__["resolveComponent"])("a-dropdown");
  3009. return Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_1, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" <a-checkbox v-model:checked=\"selectAll\" v-if=\"scenes.length\">{{\r\n $t(\"program.sceneDown.all\")\r\n }}</a-checkbox> "), Object(vue__WEBPACK_IMPORTED_MODULE_0__["renderSlot"])(_ctx.$slots, "default", {}, undefined, true)]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_2, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_3, [(Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(true), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, Object(vue__WEBPACK_IMPORTED_MODULE_0__["renderList"])($props.scenes, function (scene) {
  3010. return Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("div", {
  3011. key: scene.id,
  3012. style: {
  3013. width: '310px'
  3014. }
  3015. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_4, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("img", {
  3016. src: 'cover' in scene ? scene.cover : __webpack_require__(/*! @/app/program/assets/usb-scene.png */ "./src/app/program/assets/usb-scene.png")
  3017. }, null, 8 /* PROPS */, _hoisted_5), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("span", null, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createVNode"])(_component_a_tooltip, {
  3018. placement: "bottomRight"
  3019. }, {
  3020. title: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  3021. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("span", null, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])($setup.getIconMsg(scene)), 1 /* TEXT */)];
  3022. }),
  3023. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  3024. return [$setup.getAnimationData(scene) ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])($setup["Lottie"], {
  3025. key: 0,
  3026. options: {
  3027. animationData: $setup.getAnimationData(scene)
  3028. },
  3029. height: 40,
  3030. width: 40
  3031. }, null, 8 /* PROPS */, ["options"])) : (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("i", {
  3032. key: 1,
  3033. class: Object(vue__WEBPACK_IMPORTED_MODULE_0__["normalizeClass"])(["iconfont more-icon", $setup.getIcon(scene)])
  3034. }, null, 2 /* CLASS */))];
  3035. }),
  3036. _: 2 /* DYNAMIC */
  3037. }, 1024 /* DYNAMIC_SLOTS */)])]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_6, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_7, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createVNode"])(_component_a_checkbox, {
  3038. checked: $setup.props.selects.includes(scene),
  3039. "onUpdate:checked": function (check) {
  3040. return $setup.checkScene(check, scene);
  3041. }
  3042. }, null, 8 /* PROPS */, ["checked", "onUpdate:checked"]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_8, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_9, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("h4", null, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(scene.title), 1 /* TEXT */), $setup.isNotCalc(scene) ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("div", _hoisted_10, [scene.syncStatus !== $setup.SyncEnum.COM ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])(vue__WEBPACK_IMPORTED_MODULE_0__["Fragment"], {
  3043. key: 0
  3044. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createVNode"])(_component_a_tooltip, {
  3045. placement: "bottomRight"
  3046. }, {
  3047. title: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  3048. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("span", null, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(scene.syncStatus === $setup.SyncEnum.ING ? _ctx.$t("program.other.cancelSync") : "".concat(_ctx.$t("program.other.syncTo")).concat($props.device === $setup.Device.USB ? _ctx.$t("program.other.win") : _ctx.$t("program.other.usb"))), 1 /* TEXT */)];
  3049. }),
  3050. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  3051. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("a", {
  3052. onClick: function ($event) {
  3053. return $setup.sceneOper(scene);
  3054. },
  3055. class: Object(vue__WEBPACK_IMPORTED_MODULE_0__["normalizeClass"])({
  3056. disabled: $props.device === $setup.Device.LOCAL && scene.location === 6
  3057. })
  3058. }, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(scene.syncStatus === $setup.SyncEnum.ING ? _ctx.$t("sys.cancel") : _ctx.$t("program.other.sync")), 11 /* TEXT, CLASS, PROPS */, _hoisted_11)];
  3059. }),
  3060. _: 2 /* DYNAMIC */
  3061. }, 1024 /* DYNAMIC_SLOTS */), scene.syncStatus !== $setup.SyncEnum.ING && $props.device === $setup.Device.USB ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("a", {
  3062. key: 0,
  3063. onClick: function ($event) {
  3064. return $setup.emit('deleteScene', scene);
  3065. }
  3066. }, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t("sys.delete")), 9 /* TEXT, PROPS */, _hoisted_12)) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true)], 64 /* STABLE_FRAGMENT */)) : (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])(_component_a_dropdown, {
  3067. key: 1,
  3068. trigger: ['hover'],
  3069. placement: "bottomRight"
  3070. }, {
  3071. overlay: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  3072. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createVNode"])(_component_a_menu, null, {
  3073. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  3074. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createVNode"])(_component_a_menu_item, {
  3075. key: "0",
  3076. onClick: function ($event) {
  3077. return $setup.emit('syncScene', scene);
  3078. },
  3079. disabled: $props.device === $setup.Device.LOCAL && scene.location === 6
  3080. }, {
  3081. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  3082. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createVNode"])(_component_a_tooltip, {
  3083. placement: "topLeft"
  3084. }, {
  3085. title: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  3086. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("span", null, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t("program.other.repeatTipPrev")) + Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])($props.device === $setup.Device.USB ? _ctx.$t("program.other.win") : _ctx.$t("program.other.usb")) + Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t("program.other.repeatTipPost")), 1 /* TEXT */)];
  3087. }),
  3088. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  3089. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(" " + Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t("program.other.reSync")) + Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])($props.device === $setup.Device.USB ? _ctx.$t("program.other.win") : _ctx.$t("program.other.usb")), 1 /* TEXT */)];
  3090. }),
  3091. _: 1 /* STABLE */
  3092. })];
  3093. }),
  3094. _: 2 /* DYNAMIC */
  3095. }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick", "disabled"]), $props.device === $setup.Device.USB ? (Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createBlock"])(_component_a_menu_item, {
  3096. key: "1",
  3097. onClick: function ($event) {
  3098. return $setup.emit('deleteScene', scene);
  3099. }
  3100. }, {
  3101. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  3102. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createTextVNode"])(Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t("sys.delete")), 1 /* TEXT */)];
  3103. }),
  3104. _: 2 /* DYNAMIC */
  3105. }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick"])) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true)];
  3106. }),
  3107. _: 2 /* DYNAMIC */
  3108. }, 1024 /* DYNAMIC_SLOTS */)];
  3109. }),
  3110. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  3111. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("a", {
  3112. class: "ant-dropdown-link",
  3113. onClick: _cache[0] || (_cache[0] = Object(vue__WEBPACK_IMPORTED_MODULE_0__["withModifiers"])(function () {}, ["prevent"]))
  3114. }, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createVNode"])($setup["SmallDashOutlined"], {
  3115. class: "fun-ctrl more-icon"
  3116. })])];
  3117. }),
  3118. _: 2 /* DYNAMIC */
  3119. }, 1024 /* DYNAMIC_SLOTS */))])) : Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])("v-if", true)]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_13, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("span", null, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(scene.time), 1 /* TEXT */), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createCommentVNode"])(" <span>{{scene.id}}</span> "), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createVNode"])(_component_a_tooltip, {
  3120. placement: "bottomRight"
  3121. }, {
  3122. title: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  3123. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("span", null, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(scene.id), 1 /* TEXT */)];
  3124. }),
  3125. default: Object(vue__WEBPACK_IMPORTED_MODULE_0__["withCtx"])(function () {
  3126. return [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("span", null, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(scene.id), 1 /* TEXT */)];
  3127. }),
  3128. _: 2 /* DYNAMIC */
  3129. }, 1024 /* DYNAMIC_SLOTS */)])])])])]);
  3130. }), 128 /* KEYED_FRAGMENT */))])]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_14, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("p", {
  3131. innerHTML: _ctx.$t('program.other.selected', {
  3132. length: $props.selects.length
  3133. })
  3134. }, null, 8 /* PROPS */, _hoisted_15)])], 64 /* STABLE_FRAGMENT */);
  3135. }
  3136. /***/ }),
  3137. /***/ "../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/babel-loader/lib/index.js!../../node_modules/vue-loader-v16/dist/templateLoader.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!../../node_modules/vue-lottie/src/lottie.vue?vue&type=template&id=547741c8":
  3138. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  3139. !*** D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--13-0!D:/web_src/4dkankan_v4/node_modules/babel-loader/lib!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/templateLoader.js??ref--7!D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--1-0!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist??ref--1-1!D:/web_src/4dkankan_v4/node_modules/vue-lottie/src/lottie.vue?vue&type=template&id=547741c8 ***!
  3140. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  3141. /*! exports provided: render */
  3142. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3143. "use strict";
  3144. __webpack_require__.r(__webpack_exports__);
  3145. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  3146. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "../../node_modules/vue/dist/vue.runtime.esm-bundler.js");
  3147. function render(_ctx, _cache, $props, $setup, $data, $options) {
  3148. return Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("div", {
  3149. style: Object(vue__WEBPACK_IMPORTED_MODULE_0__["normalizeStyle"])($data.style),
  3150. ref: "lavContainer"
  3151. }, null, 4 /* STYLE */);
  3152. }
  3153. /***/ }),
  3154. /***/ "../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/babel-loader/lib/index.js!../../node_modules/vue-loader-v16/dist/templateLoader.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/help.vue?vue&type=template&id=32593d35&scoped=true":
  3155. /*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  3156. !*** D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--13-0!D:/web_src/4dkankan_v4/node_modules/babel-loader/lib!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/templateLoader.js??ref--7!D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--1-0!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist??ref--1-1!./src/app/program/views/sys/device/help.vue?vue&type=template&id=32593d35&scoped=true ***!
  3157. \*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  3158. /*! exports provided: render */
  3159. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3160. "use strict";
  3161. __webpack_require__.r(__webpack_exports__);
  3162. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  3163. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "../../node_modules/vue/dist/vue.runtime.esm-bundler.js");
  3164. /* harmony import */ var _app_program_assets_router_png__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/app/program/assets/router.png */ "./src/app/program/assets/router.png");
  3165. /* harmony import */ var _app_program_assets_router_png__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_app_program_assets_router_png__WEBPACK_IMPORTED_MODULE_1__);
  3166. const _withScopeId = n => (Object(vue__WEBPACK_IMPORTED_MODULE_0__["pushScopeId"])("data-v-32593d35"), n = n(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["popScopeId"])(), n);
  3167. const _hoisted_1 = {
  3168. class: "help"
  3169. };
  3170. const _hoisted_2 = {
  3171. class: "continue"
  3172. };
  3173. const _hoisted_3 = /*#__PURE__*/_withScopeId(() => /*#__PURE__*/Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("img", {
  3174. src: _app_program_assets_router_png__WEBPACK_IMPORTED_MODULE_1___default.a,
  3175. alt: ""
  3176. }, null, -1 /* HOISTED */));
  3177. const _hoisted_4 = {
  3178. class: "step"
  3179. };
  3180. function render(_ctx, _cache) {
  3181. return Object(vue__WEBPACK_IMPORTED_MODULE_0__["openBlock"])(), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementBlock"])("div", _hoisted_1, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("h3", null, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.syncHelp.title')), 1 /* TEXT */), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_2, [_hoisted_3, Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", _hoisted_4, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", null, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("h4", null, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.syncHelp.step1.title')), 1 /* TEXT */), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("p", null, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.syncHelp.step1.desc1')), 1 /* TEXT */), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("p", null, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.syncHelp.step1.desc2')), 1 /* TEXT */)]), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("div", null, [Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("h4", null, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.syncHelp.step2.title')), 1 /* TEXT */), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("p", null, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.syncHelp.step2.desc1')), 1 /* TEXT */), Object(vue__WEBPACK_IMPORTED_MODULE_0__["createElementVNode"])("p", null, Object(vue__WEBPACK_IMPORTED_MODULE_0__["toDisplayString"])(_ctx.$t('program.syncHelp.step2.desc2')), 1 /* TEXT */)])])])]);
  3182. }
  3183. /***/ }),
  3184. /***/ "../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=style&index=1&id=239f642b&lang=css":
  3185. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  3186. !*** D:/web_src/4dkankan_v4/node_modules/css-loader/dist/cjs.js??ref--7-oneOf-1-1!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/stylePostLoader.js!D:/web_src/4dkankan_v4/node_modules/postcss-loader/src??ref--7-oneOf-1-2!D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--1-0!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist??ref--1-1!./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=style&index=1&id=239f642b&lang=css ***!
  3187. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  3188. /*! no static exports found */
  3189. /***/ (function(module, exports, __webpack_require__) {
  3190. // Imports
  3191. var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../../../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../node_modules/css-loader/dist/runtime/api.js");
  3192. exports = ___CSS_LOADER_API_IMPORT___(false);
  3193. // Module
  3194. exports.push([module.i, "\n.select-all span {\r\n color: #fff;\n}\r\n", ""]);
  3195. // Exports
  3196. module.exports = exports;
  3197. /***/ }),
  3198. /***/ "../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/sass-loader/dist/cjs.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/scene/detail.vue?vue&type=style&index=0&id=f90fcb32&lang=scss&scoped=true":
  3199. /*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  3200. !*** D:/web_src/4dkankan_v4/node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/stylePostLoader.js!D:/web_src/4dkankan_v4/node_modules/postcss-loader/src??ref--9-oneOf-1-2!D:/web_src/4dkankan_v4/node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--1-0!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist??ref--1-1!./src/app/program/views/scene/detail.vue?vue&type=style&index=0&id=f90fcb32&lang=scss&scoped=true ***!
  3201. \*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  3202. /*! no static exports found */
  3203. /***/ (function(module, exports, __webpack_require__) {
  3204. // Imports
  3205. var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../node_modules/css-loader/dist/runtime/api.js");
  3206. exports = ___CSS_LOADER_API_IMPORT___(false);
  3207. // Module
  3208. exports.push([module.i, ".right[data-v-f90fcb32] {\n position: relative;\n display: flex;\n flex-direction: column;\n}\n.right .top[data-v-f90fcb32] {\n overflow: hidden;\n margin-bottom: 20px;\n}\n.right .top[data-v-f90fcb32]::-webkit-scrollbar {\n display: none;\n}\n.right.isUnCal .bottom[data-v-f90fcb32] {\n border-top: none;\n}\n.right .bottom[data-v-f90fcb32] {\n overflow-x: hidden;\n overflow-y: auto;\n flex: 1;\n border-top: 1px rgba(255, 255, 255, 0.1) solid;\n}\n.right .bottom[data-v-f90fcb32]::-webkit-scrollbar {\n display: none;\n}\n.right .bottom .b_sub_title[data-v-f90fcb32] {\n margin: 15px 0;\n}\n.right .close[data-v-f90fcb32] {\n font-size: 18px;\n color: rgba(255, 255, 255, 0.8);\n position: absolute;\n top: 30px;\n right: 30px;\n cursor: pointer;\n}\n.right .close[data-v-f90fcb32]:hover {\n color: rgb(255, 255, 255);\n}\n.right .title[data-v-f90fcb32] {\n font-size: 20px;\n font-weight: bold;\n text-align: left;\n padding-bottom: 20px;\n}\n.right .sub_title[data-v-f90fcb32] {\n font-weight: bold;\n display: inline-flex;\n font-size: 16px;\n padding: 10px 0;\n color: #ffffff;\n line-height: 19px;\n}\n.right .col[data-v-f90fcb32] {\n min-height: 64px;\n padding: 10px 0;\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n}\n.right .col .info .col-desc[data-v-f90fcb32] {\n margin-top: 10px;\n font-size: 12px;\n color: rgba(255, 255, 255, 0.7);\n line-height: 14px;\n}\n.right .col .action[data-v-f90fcb32] {\n display: flex;\n flex-direction: row;\n}\n.right .col .action .icon[data-v-f90fcb32] {\n padding: 0 5px;\n height: 16px;\n color: white;\n line-height: 20px;\n}\n.right .col .action .icon[data-v-f90fcb32]:hover {\n cursor: pointer;\n}\n.right .col .action .btn[data-v-f90fcb32] {\n padding: 0 20px;\n color: #00c8af;\n height: 16px;\n line-height: 0;\n}\n.right .col .action .btn[data-v-f90fcb32]:hover {\n color: #73f0e1;\n}\n.right .info-col[data-v-f90fcb32] {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n margin-bottom: 10px;\n}\n.right .info-col .info-label[data-v-f90fcb32] {\n font-size: 14px;\n color: rgba(255, 255, 255, 0.7);\n line-height: 16px;\n flex: 0 1 110px;\n}\n.right .info-col .info-desc[data-v-f90fcb32] {\n flex: 1;\n}\n.process-content[data-v-f90fcb32] {\n display: flex;\n flex-direction: column;\n min-height: 100px;\n justify-content: center;\n align-items: center;\n}\n.process-content span[data-v-f90fcb32] {\n font-size: 16px;\n text-align: center;\n padding-bottom: 20px;\n}\n.process-content .btn[data-v-f90fcb32] {\n max-width: 80px;\n}\n[data-v-f90fcb32] .ant-btn-link {\n color: #00c8af;\n}\n[data-v-f90fcb32] .ant-btn-link:hover {\n color: rgba(255, 255, 255, 0.9);\n}\n.action[data-v-f90fcb32] .ant-btn-link:nth-child(1):last-child {\n padding-right: 0;\n}", ""]);
  3209. // Exports
  3210. module.exports = exports;
  3211. /***/ }),
  3212. /***/ "../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/sass-loader/dist/cjs.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/scene/index.vue?vue&type=style&index=0&id=41644aac&lang=scss&scoped=true":
  3213. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  3214. !*** D:/web_src/4dkankan_v4/node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/stylePostLoader.js!D:/web_src/4dkankan_v4/node_modules/postcss-loader/src??ref--9-oneOf-1-2!D:/web_src/4dkankan_v4/node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--1-0!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist??ref--1-1!./src/app/program/views/scene/index.vue?vue&type=style&index=0&id=41644aac&lang=scss&scoped=true ***!
  3215. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  3216. /*! no static exports found */
  3217. /***/ (function(module, exports, __webpack_require__) {
  3218. // Imports
  3219. var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../node_modules/css-loader/dist/runtime/api.js");
  3220. exports = ___CSS_LOADER_API_IMPORT___(false);
  3221. // Module
  3222. exports.push([module.i, ".cover[data-v-41644aac] {\n width: 120px;\n height: 80px;\n position: relative;\n}\n.cover.onC[data-v-41644aac] {\n cursor: pointer;\n}\n.cover img[data-v-41644aac] {\n width: 100%;\n height: 100%;\n display: block;\n}\n.cover span[data-v-41644aac] {\n background: rgba(0, 0, 0, 0.6);\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 12px;\n color: #ffffff;\n}\n.cover .copy[data-v-41644aac] {\n display: block;\n position: absolute;\n right: 0;\n bottom: 0;\n color: #ffffff;\n width: 40px;\n height: 18px;\n display: flex;\n align-items: center;\n justify-content: center;\n line-height: 18px;\n font-size: 12px;\n background: rgba(0, 0, 0, 0.3);\n border-top-left-radius: 15px;\n}\n.infos[data-v-41644aac] {\n display: flex;\n justify-content: space-between;\n flex-direction: column;\n}\n.infos .infos_detail[data-v-41644aac] {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 0 5px;\n}\n.infos.onC[data-v-41644aac] {\n cursor: pointer;\n}\n.infos *[data-v-41644aac] {\n margin: 0;\n}\n.infos h3[data-v-41644aac] {\n font-size: 14px;\n color: #ffffff;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n}\n.infos p[data-v-41644aac] {\n font-size: 12px;\n color: rgba(255, 255, 255, 0.7);\n}\n.action[data-v-41644aac] {\n color: #00c8af;\n display: flex;\n justify-content: space-around;\n}\n.action span[data-v-41644aac] {\n color: rgba(255, 255, 255, 0.3);\n}\n.action span[data-v-41644aac],\n.action a[data-v-41644aac] {\n overflow: hidden;\n flex: 1 1 0;\n flex-basis: 0;\n text-align: center;\n}\n.input[data-v-41644aac] {\n width: 500px;\n}\n.action-ctrl[data-v-41644aac] {\n display: flex;\n justify-content: space-between;\n width: 100%;\n min-height: 32px;\n overflow: hidden;\n white-space: nowrap;\n}\n.action-ctrl .action .select-all[data-v-41644aac],\n.action-ctrl .action .select-mesh[data-v-41644aac] {\n width: 120px;\n}\n.action-ctrl .action .select-cat[data-v-41644aac] {\n width: 100px;\n}\n.action-ctrl .action .search-input[data-v-41644aac] {\n width: 180px;\n}\n.action-ctrl .tab[data-v-41644aac] {\n display: flex;\n justify-content: flex-start;\n}\n.action-ctrl .tab h2[data-v-41644aac] {\n margin-right: 50px;\n font-size: 20px;\n font-weight: normal;\n padding-bottom: 8px;\n cursor: pointer;\n color: rgba(255, 255, 255, 0.7);\n transition: color 0.3s ease;\n}\n.action-ctrl .tab h2[data-v-41644aac]:hover {\n color: #fff;\n}\n.action-ctrl .tab h2.active[data-v-41644aac] {\n color: #fff;\n font-weight: bold;\n padding-bottom: 7px;\n}\n.action-ctrl .action[data-v-41644aac] {\n justify-content: flex-end;\n}\n.action-ctrl .icons[data-v-41644aac] {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.action-ctrl .icons .sync-btn[data-v-41644aac] {\n border-radius: 4px 4px 4px 4px;\n}\n.action-ctrl .icons .iconfont[data-v-41644aac] {\n margin-right: 24px;\n}\n.un-data[data-v-41644aac] {\n height: calc(100% - 80px);\n}\n.scene-action-info[data-v-41644aac] {\n text-align: right;\n}\n.scene-action-info > .info[data-v-41644aac] {\n margin-right: 80px;\n color: rgb(205, 127, 55);\n}\n.scene-action-info .ant-dropdown-link[data-v-41644aac] {\n margin-right: 80px;\n}\n.list-container[data-v-41644aac] {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n.list-container .main[data-v-41644aac] {\n flex: 1;\n display: flex;\n padding: 30px;\n background-color: #1b1b1c;\n}\n.list-container .left[data-v-41644aac] {\n flex: 1;\n overflow: hidden;\n}\n@media screen and (min-width: 600px) and (max-width: 1690px) {\n.list-container .left .scene-actions .ant-btn[data-v-41644aac] {\n padding-left: 8px;\n padding-right: 8px;\n}\n}\n.list-container .right[data-v-41644aac] {\n flex: 0;\n max-width: 540px;\n margin-left: 60px;\n background-color: rgba(255, 255, 255, 0.06);\n color: #fff;\n padding: 30px;\n border-radius: 4px 4px 4px 4px;\n display: none;\n}\n@media screen and (min-width: 600px) and (max-width: 1440px) {\n.list-container.active[data-v-41644aac] .infos .infos_detail {\n flex-direction: column;\n justify-content: flex-start;\n align-items: flex-start;\n}\n.list-container.active[data-v-41644aac] .infos .infos_detail .slash {\n display: none;\n}\n}\n.list-container.active .right[data-v-41644aac] {\n display: flex;\n animation: slideInRight-41644aac 0.3s ease-in-out forwards;\n flex: 0 0 540px;\n}\n@media screen and (min-width: 600px) and (max-width: 1690px) {\n.list-container.active .right[data-v-41644aac] {\n flex: 0 0 420px;\n padding: 25px;\n}\n}\n@media screen and (min-width: 600px) and (max-width: 1280px) {\n.list-container.active .right[data-v-41644aac] {\n flex: 0 0 340px;\n padding: 15px;\n}\n}\n.scene-layer[data-v-41644aac] {\n display: flex;\n flex-direction: column;\n padding: 0;\n height: 100%;\n}\n.scene-layer .list-container[data-v-41644aac] {\n padding: 20px;\n height: 100%;\n}\n.scene-actions[data-v-41644aac] {\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n}\n.scene-actions[data-v-41644aac] .ant-btn-link {\n color: #00c8af;\n}\n.scene-actions[data-v-41644aac] .ant-btn-link:hover {\n color: rgba(255, 255, 255, 0.9);\n}\n.customPanel[data-v-41644aac] {\n display: flex;\n justify-content: flex-end;\n}\n.customPanel .iconfont[data-v-41644aac] {\n padding: 0 15px;\n}\n@keyframes slideInRight-41644aac {\nfrom {\n transform: translate3d(100%, 0, 0);\n visibility: visible;\n}\nto {\n transform: translate3d(0, 0, 0);\n}\n}\n.process-content[data-v-41644aac] {\n display: flex;\n flex-direction: column;\n min-height: 100px;\n justify-content: center;\n align-items: center;\n}\n.process-content span[data-v-41644aac] {\n font-size: 16px;\n text-align: center;\n padding-bottom: 20px;\n}\n.process-content .btn[data-v-41644aac] {\n max-width: 80px;\n}\n.line[data-v-41644aac] {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n border-bottom: solid 1px #292929;\n display: flex;\n justify-content: flex-end;\n}\n.line span[data-v-41644aac] {\n color: rgba(255, 255, 255, 0.7);\n margin-bottom: 10px;\n cursor: pointer;\n}\n.scene-layer .action[data-v-41644aac] {\n width: 600px;\n}\n.scene-layer .action[data-v-41644aac] .ant-input,\n.scene-layer .action[data-v-41644aac] .ant-input-group {\n text-align: left !important;\n}\n[data-v-41644aac] .ant-table-row.active {\n background: rgba(255, 255, 255, 0.06);\n border-radius: 0px 0px 0px 0px;\n border: 1px solid rgba(255, 255, 255, 0.16);\n}", ""]);
  3223. // Exports
  3224. module.exports = exports;
  3225. /***/ }),
  3226. /***/ "../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/sass-loader/dist/cjs.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/help.vue?vue&type=style&index=0&id=32593d35&scoped=true&lang=scss":
  3227. /*!********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  3228. !*** D:/web_src/4dkankan_v4/node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/stylePostLoader.js!D:/web_src/4dkankan_v4/node_modules/postcss-loader/src??ref--9-oneOf-1-2!D:/web_src/4dkankan_v4/node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--1-0!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist??ref--1-1!./src/app/program/views/sys/device/help.vue?vue&type=style&index=0&id=32593d35&scoped=true&lang=scss ***!
  3229. \********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  3230. /*! no static exports found */
  3231. /***/ (function(module, exports, __webpack_require__) {
  3232. // Imports
  3233. var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../node_modules/css-loader/dist/runtime/api.js");
  3234. exports = ___CSS_LOADER_API_IMPORT___(false);
  3235. // Module
  3236. exports.push([module.i, ".help[data-v-32593d35] {\n margin: 80px 0;\n}\nh3[data-v-32593d35] {\n font-size: 24px;\n font-weight: bold;\n color: #ffffff;\n text-align: center;\n}\n.continue[data-v-32593d35] {\n display: flex;\n margin-top: 60px;\n}\n.continue img[data-v-32593d35] {\n flex: none;\n}\n.continue .step[data-v-32593d35] {\n flex: 1;\n margin: 0 60px;\n}\n.continue .step div[data-v-32593d35]:not(:last-child) {\n margin-bottom: 60px;\n}\n.continue .step h4[data-v-32593d35] {\n font-size: 20px;\n font-weight: bold;\n margin-bottom: 10px;\n color: #fff;\n}\n.continue .step p[data-v-32593d35] {\n font-size: 14px;\n color: rgba(255, 255, 255, 0.7);\n line-height: 28px;\n margin: 0;\n}", ""]);
  3237. // Exports
  3238. module.exports = exports;
  3239. /***/ }),
  3240. /***/ "../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/sass-loader/dist/cjs.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/sync/index.vue?vue&type=style&index=0&id=05b8aad2&lang=scss&scoped=true":
  3241. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  3242. !*** D:/web_src/4dkankan_v4/node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/stylePostLoader.js!D:/web_src/4dkankan_v4/node_modules/postcss-loader/src??ref--9-oneOf-1-2!D:/web_src/4dkankan_v4/node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--1-0!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist??ref--1-1!./src/app/program/views/sys/device/sync/index.vue?vue&type=style&index=0&id=05b8aad2&lang=scss&scoped=true ***!
  3243. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  3244. /*! no static exports found */
  3245. /***/ (function(module, exports, __webpack_require__) {
  3246. // Imports
  3247. var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../../../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../node_modules/css-loader/dist/runtime/api.js");
  3248. exports = ___CSS_LOADER_API_IMPORT___(false);
  3249. // Module
  3250. exports.push([module.i, ".sn-info[data-v-05b8aad2] {\n margin: 20px 0 40px;\n background: rgba(255, 255, 255, 0.1);\n border-radius: 4px;\n border: 1px solid rgba(255, 255, 255, 0.2);\n padding: 32px 30px;\n}\n.sn-info p[data-v-05b8aad2] {\n font-size: 20px;\n color: rgba(255, 255, 255, 0.7);\n margin: 0;\n}\n.sn-info p span[data-v-05b8aad2] {\n color: #00c8af;\n}\n.extra[data-v-05b8aad2] {\n position: absolute;\n right: 24px;\n display: flex;\n align-items: center;\n z-index: 666;\n font-size: 16px;\n color: rgba(255, 255, 255, 0.7);\n}\n.extra .icon[data-v-05b8aad2] {\n cursor: pointer;\n margin-right: 12px;\n}\n.extra .action-ctrl[data-v-05b8aad2] {\n margin-bottom: 0;\n}\n.extra .del-btn[data-v-05b8aad2],\n.extra .sync-btn[data-v-05b8aad2] {\n color: #fff;\n font-size: 14px;\n margin-left: 10px;\n}\n.extra .del-btn[data-v-05b8aad2] {\n background-color: #d3111a;\n border-color: #d3111a;\n}\n.extra .sync-btn[data-v-05b8aad2] {\n background-color: #00c8af;\n border-color: #00c8af;\n}\n.extra .sync-btn[data-v-05b8aad2]:hover {\n background-color: #008b7a;\n border-color: #008b7a;\n}", ""]);
  3251. // Exports
  3252. module.exports = exports;
  3253. /***/ }),
  3254. /***/ "../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/sass-loader/dist/cjs.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/sync/index.vue?vue&type=style&index=1&id=05b8aad2&lang=scss":
  3255. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  3256. !*** D:/web_src/4dkankan_v4/node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/stylePostLoader.js!D:/web_src/4dkankan_v4/node_modules/postcss-loader/src??ref--9-oneOf-1-2!D:/web_src/4dkankan_v4/node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--1-0!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist??ref--1-1!./src/app/program/views/sys/device/sync/index.vue?vue&type=style&index=1&id=05b8aad2&lang=scss ***!
  3257. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  3258. /*! no static exports found */
  3259. /***/ (function(module, exports, __webpack_require__) {
  3260. // Imports
  3261. var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../../../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../node_modules/css-loader/dist/runtime/api.js");
  3262. exports = ___CSS_LOADER_API_IMPORT___(false);
  3263. // Module
  3264. exports.push([module.i, ".sync-info {\n margin: -24px -24px 0;\n background: rgba(250, 153, 63, 0.8);\n border-color: rgba(250, 153, 63, 0.8);\n text-align: center;\n}\n.sync-info .ant-alert-message {\n font-size: 14px;\n color: rgba(255, 255, 255, 0.7);\n line-height: 19px;\n}\n.scene-sync-select .ant-tabs-bar {\n border-color: rgba(255, 255, 255, 0.16);\n}\n.scene-sync-select .ant-tabs-nav .ant-tabs-tab {\n color: rgba(255, 255, 255, 0.7);\n}\n.scene-sync-select .ant-tabs-nav .ant-tabs-tab:hover,\n.scene-sync-select .ant-tabs-nav .ant-tabs-tab .ant-tabs-tab-btn:hover,\n.scene-sync-select .ant-tabs-nav .ant-tabs-tab-active .ant-tabs-tab-btn,\n.scene-sync-select .ant-tabs-nav .ant-tabs-tab-active {\n color: #00c8af !important;\n}\n.scene-sync-select .ant-tabs-ink-bar {\n background-color: #00c8af;\n}", ""]);
  3265. // Exports
  3266. module.exports = exports;
  3267. /***/ }),
  3268. /***/ "../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/sass-loader/dist/cjs.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=style&index=0&id=239f642b&lang=scss&scoped=true":
  3269. /*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  3270. !*** D:/web_src/4dkankan_v4/node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/stylePostLoader.js!D:/web_src/4dkankan_v4/node_modules/postcss-loader/src??ref--9-oneOf-1-2!D:/web_src/4dkankan_v4/node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--1-0!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist??ref--1-1!./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=style&index=0&id=239f642b&lang=scss&scoped=true ***!
  3271. \*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  3272. /*! no static exports found */
  3273. /***/ (function(module, exports, __webpack_require__) {
  3274. // Imports
  3275. var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../../../../../../../node_modules/css-loader/dist/runtime/api.js */ "../../node_modules/css-loader/dist/runtime/api.js");
  3276. exports = ___CSS_LOADER_API_IMPORT___(false);
  3277. // Module
  3278. exports.push([module.i, ".layout[data-v-239f642b] {\n max-height: 280px;\n overflow-y: auto;\n}\n.scene-layout[data-v-239f642b] {\n display: grid;\n grid-template: auto/1fr 1fr 1fr;\n gap: 20px;\n}\n.cover[data-v-239f642b] {\n height: 200px;\n width: 310px;\n position: relative;\n}\n.cover img[data-v-239f642b] {\n width: 100%;\n height: 100%;\n -o-object-fit: cover;\n object-fit: cover;\n display: block;\n}\n.cover > span[data-v-239f642b] {\n position: absolute;\n right: 10px;\n top: 10px;\n width: 32px;\n font-size: 18px;\n height: 32px;\n border-radius: 50%;\n background: rgba(0, 0, 0, 0.3);\n display: flex;\n align-items: center;\n justify-content: center;\n color: rgb(255, 255, 255);\n}\n.pano[data-v-239f642b] {\n display: flex;\n margin-top: 10px;\n}\n.pano .pano-left[data-v-239f642b] {\n flex: 1;\n display: flex;\n}\n.info[data-v-239f642b] {\n flex: 1;\n margin-left: 10px;\n}\n.info .fun-info[data-v-239f642b] {\n display: flex;\n}\n.info .fun-info h4[data-v-239f642b] {\n color: #ffffff;\n font-size: 14px;\n margin-bottom: 6px;\n flex: 1;\n max-height: 44px;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n /*! autoprefixer: off */\n -webkit-box-orient: vertical;\n}\n.info .fun-info .action[data-v-239f642b] {\n flex: none;\n color: #00c8af;\n}\n.info .fun-info .action a[data-v-239f642b] {\n margin: 0 5px;\n}\n.info .time-bs[data-v-239f642b] {\n font-size: 12px;\n color: rgba(255, 255, 255, 0.7);\n display: flex;\n justify-content: space-between;\n}\n.info .time-bs > span[data-v-239f642b]:last-child {\n width: 160px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.select-all[data-v-239f642b] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin: 27px 0;\n}\n.select-count[data-v-239f642b] {\n margin-top: 10px;\n color: #fff;\n}\n.select-count span[data-v-239f642b] {\n color: #00c8af;\n}\n.more-icon[data-v-239f642b] {\n font-size: 18px;\n}", ""]);
  3279. // Exports
  3280. module.exports = exports;
  3281. /***/ }),
  3282. /***/ "../../node_modules/lottie-web/build/player/lottie.js":
  3283. /*!*****************************************************************************!*\
  3284. !*** D:/web_src/4dkankan_v4/node_modules/lottie-web/build/player/lottie.js ***!
  3285. \*****************************************************************************/
  3286. /*! no static exports found */
  3287. /***/ (function(module, exports, __webpack_require__) {
  3288. (typeof navigator !== "undefined") && (function (global, factory) {
  3289. true ? module.exports = factory() :
  3290. undefined;
  3291. })(this, (function () { 'use strict';
  3292. var svgNS = 'http://www.w3.org/2000/svg';
  3293. var locationHref = '';
  3294. var _useWebWorker = false;
  3295. var initialDefaultFrame = -999999;
  3296. var setWebWorker = function setWebWorker(flag) {
  3297. _useWebWorker = !!flag;
  3298. };
  3299. var getWebWorker = function getWebWorker() {
  3300. return _useWebWorker;
  3301. };
  3302. var setLocationHref = function setLocationHref(value) {
  3303. locationHref = value;
  3304. };
  3305. var getLocationHref = function getLocationHref() {
  3306. return locationHref;
  3307. };
  3308. function createTag(type) {
  3309. // return {appendChild:function(){},setAttribute:function(){},style:{}}
  3310. return document.createElement(type);
  3311. }
  3312. function extendPrototype(sources, destination) {
  3313. var i;
  3314. var len = sources.length;
  3315. var sourcePrototype;
  3316. for (i = 0; i < len; i += 1) {
  3317. sourcePrototype = sources[i].prototype;
  3318. for (var attr in sourcePrototype) {
  3319. if (Object.prototype.hasOwnProperty.call(sourcePrototype, attr)) destination.prototype[attr] = sourcePrototype[attr];
  3320. }
  3321. }
  3322. }
  3323. function getDescriptor(object, prop) {
  3324. return Object.getOwnPropertyDescriptor(object, prop);
  3325. }
  3326. function createProxyFunction(prototype) {
  3327. function ProxyFunction() {}
  3328. ProxyFunction.prototype = prototype;
  3329. return ProxyFunction;
  3330. }
  3331. // import Howl from '../../3rd_party/howler';
  3332. var audioControllerFactory = function () {
  3333. function AudioController(audioFactory) {
  3334. this.audios = [];
  3335. this.audioFactory = audioFactory;
  3336. this._volume = 1;
  3337. this._isMuted = false;
  3338. }
  3339. AudioController.prototype = {
  3340. addAudio: function addAudio(audio) {
  3341. this.audios.push(audio);
  3342. },
  3343. pause: function pause() {
  3344. var i;
  3345. var len = this.audios.length;
  3346. for (i = 0; i < len; i += 1) {
  3347. this.audios[i].pause();
  3348. }
  3349. },
  3350. resume: function resume() {
  3351. var i;
  3352. var len = this.audios.length;
  3353. for (i = 0; i < len; i += 1) {
  3354. this.audios[i].resume();
  3355. }
  3356. },
  3357. setRate: function setRate(rateValue) {
  3358. var i;
  3359. var len = this.audios.length;
  3360. for (i = 0; i < len; i += 1) {
  3361. this.audios[i].setRate(rateValue);
  3362. }
  3363. },
  3364. createAudio: function createAudio(assetPath) {
  3365. if (this.audioFactory) {
  3366. return this.audioFactory(assetPath);
  3367. }
  3368. if (window.Howl) {
  3369. return new window.Howl({
  3370. src: [assetPath]
  3371. });
  3372. }
  3373. return {
  3374. isPlaying: false,
  3375. play: function play() {
  3376. this.isPlaying = true;
  3377. },
  3378. seek: function seek() {
  3379. this.isPlaying = false;
  3380. },
  3381. playing: function playing() {},
  3382. rate: function rate() {},
  3383. setVolume: function setVolume() {}
  3384. };
  3385. },
  3386. setAudioFactory: function setAudioFactory(audioFactory) {
  3387. this.audioFactory = audioFactory;
  3388. },
  3389. setVolume: function setVolume(value) {
  3390. this._volume = value;
  3391. this._updateVolume();
  3392. },
  3393. mute: function mute() {
  3394. this._isMuted = true;
  3395. this._updateVolume();
  3396. },
  3397. unmute: function unmute() {
  3398. this._isMuted = false;
  3399. this._updateVolume();
  3400. },
  3401. getVolume: function getVolume() {
  3402. return this._volume;
  3403. },
  3404. _updateVolume: function _updateVolume() {
  3405. var i;
  3406. var len = this.audios.length;
  3407. for (i = 0; i < len; i += 1) {
  3408. this.audios[i].volume(this._volume * (this._isMuted ? 0 : 1));
  3409. }
  3410. }
  3411. };
  3412. return function () {
  3413. return new AudioController();
  3414. };
  3415. }();
  3416. var createTypedArray = function () {
  3417. function createRegularArray(type, len) {
  3418. var i = 0;
  3419. var arr = [];
  3420. var value;
  3421. switch (type) {
  3422. case 'int16':
  3423. case 'uint8c':
  3424. value = 1;
  3425. break;
  3426. default:
  3427. value = 1.1;
  3428. break;
  3429. }
  3430. for (i = 0; i < len; i += 1) {
  3431. arr.push(value);
  3432. }
  3433. return arr;
  3434. }
  3435. function createTypedArrayFactory(type, len) {
  3436. if (type === 'float32') {
  3437. return new Float32Array(len);
  3438. }
  3439. if (type === 'int16') {
  3440. return new Int16Array(len);
  3441. }
  3442. if (type === 'uint8c') {
  3443. return new Uint8ClampedArray(len);
  3444. }
  3445. return createRegularArray(type, len);
  3446. }
  3447. if (typeof Uint8ClampedArray === 'function' && typeof Float32Array === 'function') {
  3448. return createTypedArrayFactory;
  3449. }
  3450. return createRegularArray;
  3451. }();
  3452. function createSizedArray(len) {
  3453. return Array.apply(null, {
  3454. length: len
  3455. });
  3456. }
  3457. function _typeof$6(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$6 = function _typeof(obj) { return typeof obj; }; } else { _typeof$6 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$6(obj); }
  3458. var subframeEnabled = true;
  3459. var expressionsPlugin = null;
  3460. var expressionsInterfaces = null;
  3461. var idPrefix$1 = '';
  3462. var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
  3463. var _shouldRoundValues = false;
  3464. var bmPow = Math.pow;
  3465. var bmSqrt = Math.sqrt;
  3466. var bmFloor = Math.floor;
  3467. var bmMax = Math.max;
  3468. var bmMin = Math.min;
  3469. var BMMath = {};
  3470. (function () {
  3471. var propertyNames = ['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'];
  3472. var i;
  3473. var len = propertyNames.length;
  3474. for (i = 0; i < len; i += 1) {
  3475. BMMath[propertyNames[i]] = Math[propertyNames[i]];
  3476. }
  3477. })();
  3478. function ProjectInterface$1() {
  3479. return {};
  3480. }
  3481. BMMath.random = Math.random;
  3482. BMMath.abs = function (val) {
  3483. var tOfVal = _typeof$6(val);
  3484. if (tOfVal === 'object' && val.length) {
  3485. var absArr = createSizedArray(val.length);
  3486. var i;
  3487. var len = val.length;
  3488. for (i = 0; i < len; i += 1) {
  3489. absArr[i] = Math.abs(val[i]);
  3490. }
  3491. return absArr;
  3492. }
  3493. return Math.abs(val);
  3494. };
  3495. var defaultCurveSegments = 150;
  3496. var degToRads = Math.PI / 180;
  3497. var roundCorner = 0.5519;
  3498. function roundValues(flag) {
  3499. _shouldRoundValues = !!flag;
  3500. }
  3501. function bmRnd(value) {
  3502. if (_shouldRoundValues) {
  3503. return Math.round(value);
  3504. }
  3505. return value;
  3506. }
  3507. function styleDiv(element) {
  3508. element.style.position = 'absolute';
  3509. element.style.top = 0;
  3510. element.style.left = 0;
  3511. element.style.display = 'block';
  3512. element.style.transformOrigin = '0 0';
  3513. element.style.webkitTransformOrigin = '0 0';
  3514. element.style.backfaceVisibility = 'visible';
  3515. element.style.webkitBackfaceVisibility = 'visible';
  3516. element.style.transformStyle = 'preserve-3d';
  3517. element.style.webkitTransformStyle = 'preserve-3d';
  3518. element.style.mozTransformStyle = 'preserve-3d';
  3519. }
  3520. function BMEnterFrameEvent(type, currentTime, totalTime, frameMultiplier) {
  3521. this.type = type;
  3522. this.currentTime = currentTime;
  3523. this.totalTime = totalTime;
  3524. this.direction = frameMultiplier < 0 ? -1 : 1;
  3525. }
  3526. function BMCompleteEvent(type, frameMultiplier) {
  3527. this.type = type;
  3528. this.direction = frameMultiplier < 0 ? -1 : 1;
  3529. }
  3530. function BMCompleteLoopEvent(type, totalLoops, currentLoop, frameMultiplier) {
  3531. this.type = type;
  3532. this.currentLoop = currentLoop;
  3533. this.totalLoops = totalLoops;
  3534. this.direction = frameMultiplier < 0 ? -1 : 1;
  3535. }
  3536. function BMSegmentStartEvent(type, firstFrame, totalFrames) {
  3537. this.type = type;
  3538. this.firstFrame = firstFrame;
  3539. this.totalFrames = totalFrames;
  3540. }
  3541. function BMDestroyEvent(type, target) {
  3542. this.type = type;
  3543. this.target = target;
  3544. }
  3545. function BMRenderFrameErrorEvent(nativeError, currentTime) {
  3546. this.type = 'renderFrameError';
  3547. this.nativeError = nativeError;
  3548. this.currentTime = currentTime;
  3549. }
  3550. function BMConfigErrorEvent(nativeError) {
  3551. this.type = 'configError';
  3552. this.nativeError = nativeError;
  3553. }
  3554. function BMAnimationConfigErrorEvent(type, nativeError) {
  3555. this.type = type;
  3556. this.nativeError = nativeError;
  3557. }
  3558. var createElementID = function () {
  3559. var _count = 0;
  3560. return function createID() {
  3561. _count += 1;
  3562. return idPrefix$1 + '__lottie_element_' + _count;
  3563. };
  3564. }();
  3565. function HSVtoRGB(h, s, v) {
  3566. var r;
  3567. var g;
  3568. var b;
  3569. var i;
  3570. var f;
  3571. var p;
  3572. var q;
  3573. var t;
  3574. i = Math.floor(h * 6);
  3575. f = h * 6 - i;
  3576. p = v * (1 - s);
  3577. q = v * (1 - f * s);
  3578. t = v * (1 - (1 - f) * s);
  3579. switch (i % 6) {
  3580. case 0:
  3581. r = v;
  3582. g = t;
  3583. b = p;
  3584. break;
  3585. case 1:
  3586. r = q;
  3587. g = v;
  3588. b = p;
  3589. break;
  3590. case 2:
  3591. r = p;
  3592. g = v;
  3593. b = t;
  3594. break;
  3595. case 3:
  3596. r = p;
  3597. g = q;
  3598. b = v;
  3599. break;
  3600. case 4:
  3601. r = t;
  3602. g = p;
  3603. b = v;
  3604. break;
  3605. case 5:
  3606. r = v;
  3607. g = p;
  3608. b = q;
  3609. break;
  3610. default:
  3611. break;
  3612. }
  3613. return [r, g, b];
  3614. }
  3615. function RGBtoHSV(r, g, b) {
  3616. var max = Math.max(r, g, b);
  3617. var min = Math.min(r, g, b);
  3618. var d = max - min;
  3619. var h;
  3620. var s = max === 0 ? 0 : d / max;
  3621. var v = max / 255;
  3622. switch (max) {
  3623. case min:
  3624. h = 0;
  3625. break;
  3626. case r:
  3627. h = g - b + d * (g < b ? 6 : 0);
  3628. h /= 6 * d;
  3629. break;
  3630. case g:
  3631. h = b - r + d * 2;
  3632. h /= 6 * d;
  3633. break;
  3634. case b:
  3635. h = r - g + d * 4;
  3636. h /= 6 * d;
  3637. break;
  3638. default:
  3639. break;
  3640. }
  3641. return [h, s, v];
  3642. }
  3643. function addSaturationToRGB(color, offset) {
  3644. var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
  3645. hsv[1] += offset;
  3646. if (hsv[1] > 1) {
  3647. hsv[1] = 1;
  3648. } else if (hsv[1] <= 0) {
  3649. hsv[1] = 0;
  3650. }
  3651. return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
  3652. }
  3653. function addBrightnessToRGB(color, offset) {
  3654. var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
  3655. hsv[2] += offset;
  3656. if (hsv[2] > 1) {
  3657. hsv[2] = 1;
  3658. } else if (hsv[2] < 0) {
  3659. hsv[2] = 0;
  3660. }
  3661. return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
  3662. }
  3663. function addHueToRGB(color, offset) {
  3664. var hsv = RGBtoHSV(color[0] * 255, color[1] * 255, color[2] * 255);
  3665. hsv[0] += offset / 360;
  3666. if (hsv[0] > 1) {
  3667. hsv[0] -= 1;
  3668. } else if (hsv[0] < 0) {
  3669. hsv[0] += 1;
  3670. }
  3671. return HSVtoRGB(hsv[0], hsv[1], hsv[2]);
  3672. }
  3673. var rgbToHex = function () {
  3674. var colorMap = [];
  3675. var i;
  3676. var hex;
  3677. for (i = 0; i < 256; i += 1) {
  3678. hex = i.toString(16);
  3679. colorMap[i] = hex.length === 1 ? '0' + hex : hex;
  3680. }
  3681. return function (r, g, b) {
  3682. if (r < 0) {
  3683. r = 0;
  3684. }
  3685. if (g < 0) {
  3686. g = 0;
  3687. }
  3688. if (b < 0) {
  3689. b = 0;
  3690. }
  3691. return '#' + colorMap[r] + colorMap[g] + colorMap[b];
  3692. };
  3693. }();
  3694. var setSubframeEnabled = function setSubframeEnabled(flag) {
  3695. subframeEnabled = !!flag;
  3696. };
  3697. var getSubframeEnabled = function getSubframeEnabled() {
  3698. return subframeEnabled;
  3699. };
  3700. var setExpressionsPlugin = function setExpressionsPlugin(value) {
  3701. expressionsPlugin = value;
  3702. };
  3703. var getExpressionsPlugin = function getExpressionsPlugin() {
  3704. return expressionsPlugin;
  3705. };
  3706. var setExpressionInterfaces = function setExpressionInterfaces(value) {
  3707. expressionsInterfaces = value;
  3708. };
  3709. var getExpressionInterfaces = function getExpressionInterfaces() {
  3710. return expressionsInterfaces;
  3711. };
  3712. var setDefaultCurveSegments = function setDefaultCurveSegments(value) {
  3713. defaultCurveSegments = value;
  3714. };
  3715. var getDefaultCurveSegments = function getDefaultCurveSegments() {
  3716. return defaultCurveSegments;
  3717. };
  3718. var setIdPrefix = function setIdPrefix(value) {
  3719. idPrefix$1 = value;
  3720. };
  3721. var getIdPrefix = function getIdPrefix() {
  3722. return idPrefix$1;
  3723. };
  3724. function createNS(type) {
  3725. // return {appendChild:function(){},setAttribute:function(){},style:{}}
  3726. return document.createElementNS(svgNS, type);
  3727. }
  3728. function _typeof$5(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$5 = function _typeof(obj) { return typeof obj; }; } else { _typeof$5 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$5(obj); }
  3729. var dataManager = function () {
  3730. var _counterId = 1;
  3731. var processes = [];
  3732. var workerFn;
  3733. var workerInstance;
  3734. var workerProxy = {
  3735. onmessage: function onmessage() {},
  3736. postMessage: function postMessage(path) {
  3737. workerFn({
  3738. data: path
  3739. });
  3740. }
  3741. };
  3742. var _workerSelf = {
  3743. postMessage: function postMessage(data) {
  3744. workerProxy.onmessage({
  3745. data: data
  3746. });
  3747. }
  3748. };
  3749. function createWorker(fn) {
  3750. if (window.Worker && window.Blob && getWebWorker()) {
  3751. var blob = new Blob(['var _workerSelf = self; self.onmessage = ', fn.toString()], {
  3752. type: 'text/javascript'
  3753. }); // var blob = new Blob(['self.onmessage = ', fn.toString()], { type: 'text/javascript' });
  3754. var url = URL.createObjectURL(blob);
  3755. return new Worker(url);
  3756. }
  3757. workerFn = fn;
  3758. return workerProxy;
  3759. }
  3760. function setupWorker() {
  3761. if (!workerInstance) {
  3762. workerInstance = createWorker(function workerStart(e) {
  3763. function dataFunctionManager() {
  3764. function completeLayers(layers, comps) {
  3765. var layerData;
  3766. var i;
  3767. var len = layers.length;
  3768. var j;
  3769. var jLen;
  3770. var k;
  3771. var kLen;
  3772. for (i = 0; i < len; i += 1) {
  3773. layerData = layers[i];
  3774. if ('ks' in layerData && !layerData.completed) {
  3775. layerData.completed = true;
  3776. if (layerData.hasMask) {
  3777. var maskProps = layerData.masksProperties;
  3778. jLen = maskProps.length;
  3779. for (j = 0; j < jLen; j += 1) {
  3780. if (maskProps[j].pt.k.i) {
  3781. convertPathsToAbsoluteValues(maskProps[j].pt.k);
  3782. } else {
  3783. kLen = maskProps[j].pt.k.length;
  3784. for (k = 0; k < kLen; k += 1) {
  3785. if (maskProps[j].pt.k[k].s) {
  3786. convertPathsToAbsoluteValues(maskProps[j].pt.k[k].s[0]);
  3787. }
  3788. if (maskProps[j].pt.k[k].e) {
  3789. convertPathsToAbsoluteValues(maskProps[j].pt.k[k].e[0]);
  3790. }
  3791. }
  3792. }
  3793. }
  3794. }
  3795. if (layerData.ty === 0) {
  3796. layerData.layers = findCompLayers(layerData.refId, comps);
  3797. completeLayers(layerData.layers, comps);
  3798. } else if (layerData.ty === 4) {
  3799. completeShapes(layerData.shapes);
  3800. } else if (layerData.ty === 5) {
  3801. completeText(layerData);
  3802. }
  3803. }
  3804. }
  3805. }
  3806. function completeChars(chars, assets) {
  3807. if (chars) {
  3808. var i = 0;
  3809. var len = chars.length;
  3810. for (i = 0; i < len; i += 1) {
  3811. if (chars[i].t === 1) {
  3812. // var compData = findComp(chars[i].data.refId, assets);
  3813. chars[i].data.layers = findCompLayers(chars[i].data.refId, assets); // chars[i].data.ip = 0;
  3814. // chars[i].data.op = 99999;
  3815. // chars[i].data.st = 0;
  3816. // chars[i].data.sr = 1;
  3817. // chars[i].w = compData.w;
  3818. // chars[i].data.ks = {
  3819. // a: { k: [0, 0, 0], a: 0 },
  3820. // p: { k: [0, -compData.h, 0], a: 0 },
  3821. // r: { k: 0, a: 0 },
  3822. // s: { k: [100, 100], a: 0 },
  3823. // o: { k: 100, a: 0 },
  3824. // };
  3825. completeLayers(chars[i].data.layers, assets);
  3826. }
  3827. }
  3828. }
  3829. }
  3830. function findComp(id, comps) {
  3831. var i = 0;
  3832. var len = comps.length;
  3833. while (i < len) {
  3834. if (comps[i].id === id) {
  3835. return comps[i];
  3836. }
  3837. i += 1;
  3838. }
  3839. return null;
  3840. }
  3841. function findCompLayers(id, comps) {
  3842. var comp = findComp(id, comps);
  3843. if (comp) {
  3844. if (!comp.layers.__used) {
  3845. comp.layers.__used = true;
  3846. return comp.layers;
  3847. }
  3848. return JSON.parse(JSON.stringify(comp.layers));
  3849. }
  3850. return null;
  3851. }
  3852. function completeShapes(arr) {
  3853. var i;
  3854. var len = arr.length;
  3855. var j;
  3856. var jLen;
  3857. for (i = len - 1; i >= 0; i -= 1) {
  3858. if (arr[i].ty === 'sh') {
  3859. if (arr[i].ks.k.i) {
  3860. convertPathsToAbsoluteValues(arr[i].ks.k);
  3861. } else {
  3862. jLen = arr[i].ks.k.length;
  3863. for (j = 0; j < jLen; j += 1) {
  3864. if (arr[i].ks.k[j].s) {
  3865. convertPathsToAbsoluteValues(arr[i].ks.k[j].s[0]);
  3866. }
  3867. if (arr[i].ks.k[j].e) {
  3868. convertPathsToAbsoluteValues(arr[i].ks.k[j].e[0]);
  3869. }
  3870. }
  3871. }
  3872. } else if (arr[i].ty === 'gr') {
  3873. completeShapes(arr[i].it);
  3874. }
  3875. }
  3876. }
  3877. function convertPathsToAbsoluteValues(path) {
  3878. var i;
  3879. var len = path.i.length;
  3880. for (i = 0; i < len; i += 1) {
  3881. path.i[i][0] += path.v[i][0];
  3882. path.i[i][1] += path.v[i][1];
  3883. path.o[i][0] += path.v[i][0];
  3884. path.o[i][1] += path.v[i][1];
  3885. }
  3886. }
  3887. function checkVersion(minimum, animVersionString) {
  3888. var animVersion = animVersionString ? animVersionString.split('.') : [100, 100, 100];
  3889. if (minimum[0] > animVersion[0]) {
  3890. return true;
  3891. }
  3892. if (animVersion[0] > minimum[0]) {
  3893. return false;
  3894. }
  3895. if (minimum[1] > animVersion[1]) {
  3896. return true;
  3897. }
  3898. if (animVersion[1] > minimum[1]) {
  3899. return false;
  3900. }
  3901. if (minimum[2] > animVersion[2]) {
  3902. return true;
  3903. }
  3904. if (animVersion[2] > minimum[2]) {
  3905. return false;
  3906. }
  3907. return null;
  3908. }
  3909. var checkText = function () {
  3910. var minimumVersion = [4, 4, 14];
  3911. function updateTextLayer(textLayer) {
  3912. var documentData = textLayer.t.d;
  3913. textLayer.t.d = {
  3914. k: [{
  3915. s: documentData,
  3916. t: 0
  3917. }]
  3918. };
  3919. }
  3920. function iterateLayers(layers) {
  3921. var i;
  3922. var len = layers.length;
  3923. for (i = 0; i < len; i += 1) {
  3924. if (layers[i].ty === 5) {
  3925. updateTextLayer(layers[i]);
  3926. }
  3927. }
  3928. }
  3929. return function (animationData) {
  3930. if (checkVersion(minimumVersion, animationData.v)) {
  3931. iterateLayers(animationData.layers);
  3932. if (animationData.assets) {
  3933. var i;
  3934. var len = animationData.assets.length;
  3935. for (i = 0; i < len; i += 1) {
  3936. if (animationData.assets[i].layers) {
  3937. iterateLayers(animationData.assets[i].layers);
  3938. }
  3939. }
  3940. }
  3941. }
  3942. };
  3943. }();
  3944. var checkChars = function () {
  3945. var minimumVersion = [4, 7, 99];
  3946. return function (animationData) {
  3947. if (animationData.chars && !checkVersion(minimumVersion, animationData.v)) {
  3948. var i;
  3949. var len = animationData.chars.length;
  3950. for (i = 0; i < len; i += 1) {
  3951. var charData = animationData.chars[i];
  3952. if (charData.data && charData.data.shapes) {
  3953. completeShapes(charData.data.shapes);
  3954. charData.data.ip = 0;
  3955. charData.data.op = 99999;
  3956. charData.data.st = 0;
  3957. charData.data.sr = 1;
  3958. charData.data.ks = {
  3959. p: {
  3960. k: [0, 0],
  3961. a: 0
  3962. },
  3963. s: {
  3964. k: [100, 100],
  3965. a: 0
  3966. },
  3967. a: {
  3968. k: [0, 0],
  3969. a: 0
  3970. },
  3971. r: {
  3972. k: 0,
  3973. a: 0
  3974. },
  3975. o: {
  3976. k: 100,
  3977. a: 0
  3978. }
  3979. };
  3980. if (!animationData.chars[i].t) {
  3981. charData.data.shapes.push({
  3982. ty: 'no'
  3983. });
  3984. charData.data.shapes[0].it.push({
  3985. p: {
  3986. k: [0, 0],
  3987. a: 0
  3988. },
  3989. s: {
  3990. k: [100, 100],
  3991. a: 0
  3992. },
  3993. a: {
  3994. k: [0, 0],
  3995. a: 0
  3996. },
  3997. r: {
  3998. k: 0,
  3999. a: 0
  4000. },
  4001. o: {
  4002. k: 100,
  4003. a: 0
  4004. },
  4005. sk: {
  4006. k: 0,
  4007. a: 0
  4008. },
  4009. sa: {
  4010. k: 0,
  4011. a: 0
  4012. },
  4013. ty: 'tr'
  4014. });
  4015. }
  4016. }
  4017. }
  4018. }
  4019. };
  4020. }();
  4021. var checkPathProperties = function () {
  4022. var minimumVersion = [5, 7, 15];
  4023. function updateTextLayer(textLayer) {
  4024. var pathData = textLayer.t.p;
  4025. if (typeof pathData.a === 'number') {
  4026. pathData.a = {
  4027. a: 0,
  4028. k: pathData.a
  4029. };
  4030. }
  4031. if (typeof pathData.p === 'number') {
  4032. pathData.p = {
  4033. a: 0,
  4034. k: pathData.p
  4035. };
  4036. }
  4037. if (typeof pathData.r === 'number') {
  4038. pathData.r = {
  4039. a: 0,
  4040. k: pathData.r
  4041. };
  4042. }
  4043. }
  4044. function iterateLayers(layers) {
  4045. var i;
  4046. var len = layers.length;
  4047. for (i = 0; i < len; i += 1) {
  4048. if (layers[i].ty === 5) {
  4049. updateTextLayer(layers[i]);
  4050. }
  4051. }
  4052. }
  4053. return function (animationData) {
  4054. if (checkVersion(minimumVersion, animationData.v)) {
  4055. iterateLayers(animationData.layers);
  4056. if (animationData.assets) {
  4057. var i;
  4058. var len = animationData.assets.length;
  4059. for (i = 0; i < len; i += 1) {
  4060. if (animationData.assets[i].layers) {
  4061. iterateLayers(animationData.assets[i].layers);
  4062. }
  4063. }
  4064. }
  4065. }
  4066. };
  4067. }();
  4068. var checkColors = function () {
  4069. var minimumVersion = [4, 1, 9];
  4070. function iterateShapes(shapes) {
  4071. var i;
  4072. var len = shapes.length;
  4073. var j;
  4074. var jLen;
  4075. for (i = 0; i < len; i += 1) {
  4076. if (shapes[i].ty === 'gr') {
  4077. iterateShapes(shapes[i].it);
  4078. } else if (shapes[i].ty === 'fl' || shapes[i].ty === 'st') {
  4079. if (shapes[i].c.k && shapes[i].c.k[0].i) {
  4080. jLen = shapes[i].c.k.length;
  4081. for (j = 0; j < jLen; j += 1) {
  4082. if (shapes[i].c.k[j].s) {
  4083. shapes[i].c.k[j].s[0] /= 255;
  4084. shapes[i].c.k[j].s[1] /= 255;
  4085. shapes[i].c.k[j].s[2] /= 255;
  4086. shapes[i].c.k[j].s[3] /= 255;
  4087. }
  4088. if (shapes[i].c.k[j].e) {
  4089. shapes[i].c.k[j].e[0] /= 255;
  4090. shapes[i].c.k[j].e[1] /= 255;
  4091. shapes[i].c.k[j].e[2] /= 255;
  4092. shapes[i].c.k[j].e[3] /= 255;
  4093. }
  4094. }
  4095. } else {
  4096. shapes[i].c.k[0] /= 255;
  4097. shapes[i].c.k[1] /= 255;
  4098. shapes[i].c.k[2] /= 255;
  4099. shapes[i].c.k[3] /= 255;
  4100. }
  4101. }
  4102. }
  4103. }
  4104. function iterateLayers(layers) {
  4105. var i;
  4106. var len = layers.length;
  4107. for (i = 0; i < len; i += 1) {
  4108. if (layers[i].ty === 4) {
  4109. iterateShapes(layers[i].shapes);
  4110. }
  4111. }
  4112. }
  4113. return function (animationData) {
  4114. if (checkVersion(minimumVersion, animationData.v)) {
  4115. iterateLayers(animationData.layers);
  4116. if (animationData.assets) {
  4117. var i;
  4118. var len = animationData.assets.length;
  4119. for (i = 0; i < len; i += 1) {
  4120. if (animationData.assets[i].layers) {
  4121. iterateLayers(animationData.assets[i].layers);
  4122. }
  4123. }
  4124. }
  4125. }
  4126. };
  4127. }();
  4128. var checkShapes = function () {
  4129. var minimumVersion = [4, 4, 18];
  4130. function completeClosingShapes(arr) {
  4131. var i;
  4132. var len = arr.length;
  4133. var j;
  4134. var jLen;
  4135. for (i = len - 1; i >= 0; i -= 1) {
  4136. if (arr[i].ty === 'sh') {
  4137. if (arr[i].ks.k.i) {
  4138. arr[i].ks.k.c = arr[i].closed;
  4139. } else {
  4140. jLen = arr[i].ks.k.length;
  4141. for (j = 0; j < jLen; j += 1) {
  4142. if (arr[i].ks.k[j].s) {
  4143. arr[i].ks.k[j].s[0].c = arr[i].closed;
  4144. }
  4145. if (arr[i].ks.k[j].e) {
  4146. arr[i].ks.k[j].e[0].c = arr[i].closed;
  4147. }
  4148. }
  4149. }
  4150. } else if (arr[i].ty === 'gr') {
  4151. completeClosingShapes(arr[i].it);
  4152. }
  4153. }
  4154. }
  4155. function iterateLayers(layers) {
  4156. var layerData;
  4157. var i;
  4158. var len = layers.length;
  4159. var j;
  4160. var jLen;
  4161. var k;
  4162. var kLen;
  4163. for (i = 0; i < len; i += 1) {
  4164. layerData = layers[i];
  4165. if (layerData.hasMask) {
  4166. var maskProps = layerData.masksProperties;
  4167. jLen = maskProps.length;
  4168. for (j = 0; j < jLen; j += 1) {
  4169. if (maskProps[j].pt.k.i) {
  4170. maskProps[j].pt.k.c = maskProps[j].cl;
  4171. } else {
  4172. kLen = maskProps[j].pt.k.length;
  4173. for (k = 0; k < kLen; k += 1) {
  4174. if (maskProps[j].pt.k[k].s) {
  4175. maskProps[j].pt.k[k].s[0].c = maskProps[j].cl;
  4176. }
  4177. if (maskProps[j].pt.k[k].e) {
  4178. maskProps[j].pt.k[k].e[0].c = maskProps[j].cl;
  4179. }
  4180. }
  4181. }
  4182. }
  4183. }
  4184. if (layerData.ty === 4) {
  4185. completeClosingShapes(layerData.shapes);
  4186. }
  4187. }
  4188. }
  4189. return function (animationData) {
  4190. if (checkVersion(minimumVersion, animationData.v)) {
  4191. iterateLayers(animationData.layers);
  4192. if (animationData.assets) {
  4193. var i;
  4194. var len = animationData.assets.length;
  4195. for (i = 0; i < len; i += 1) {
  4196. if (animationData.assets[i].layers) {
  4197. iterateLayers(animationData.assets[i].layers);
  4198. }
  4199. }
  4200. }
  4201. }
  4202. };
  4203. }();
  4204. function completeData(animationData) {
  4205. if (animationData.__complete) {
  4206. return;
  4207. }
  4208. checkColors(animationData);
  4209. checkText(animationData);
  4210. checkChars(animationData);
  4211. checkPathProperties(animationData);
  4212. checkShapes(animationData);
  4213. completeLayers(animationData.layers, animationData.assets);
  4214. completeChars(animationData.chars, animationData.assets);
  4215. animationData.__complete = true;
  4216. }
  4217. function completeText(data) {
  4218. if (data.t.a.length === 0 && !('m' in data.t.p)) {// data.singleShape = true;
  4219. }
  4220. }
  4221. var moduleOb = {};
  4222. moduleOb.completeData = completeData;
  4223. moduleOb.checkColors = checkColors;
  4224. moduleOb.checkChars = checkChars;
  4225. moduleOb.checkPathProperties = checkPathProperties;
  4226. moduleOb.checkShapes = checkShapes;
  4227. moduleOb.completeLayers = completeLayers;
  4228. return moduleOb;
  4229. }
  4230. if (!_workerSelf.dataManager) {
  4231. _workerSelf.dataManager = dataFunctionManager();
  4232. }
  4233. if (!_workerSelf.assetLoader) {
  4234. _workerSelf.assetLoader = function () {
  4235. function formatResponse(xhr) {
  4236. // using typeof doubles the time of execution of this method,
  4237. // so if available, it's better to use the header to validate the type
  4238. var contentTypeHeader = xhr.getResponseHeader('content-type');
  4239. if (contentTypeHeader && xhr.responseType === 'json' && contentTypeHeader.indexOf('json') !== -1) {
  4240. return xhr.response;
  4241. }
  4242. if (xhr.response && _typeof$5(xhr.response) === 'object') {
  4243. return xhr.response;
  4244. }
  4245. if (xhr.response && typeof xhr.response === 'string') {
  4246. return JSON.parse(xhr.response);
  4247. }
  4248. if (xhr.responseText) {
  4249. return JSON.parse(xhr.responseText);
  4250. }
  4251. return null;
  4252. }
  4253. function loadAsset(path, fullPath, callback, errorCallback) {
  4254. var response;
  4255. var xhr = new XMLHttpRequest(); // set responseType after calling open or IE will break.
  4256. try {
  4257. // This crashes on Android WebView prior to KitKat
  4258. xhr.responseType = 'json';
  4259. } catch (err) {} // eslint-disable-line no-empty
  4260. xhr.onreadystatechange = function () {
  4261. if (xhr.readyState === 4) {
  4262. if (xhr.status === 200) {
  4263. response = formatResponse(xhr);
  4264. callback(response);
  4265. } else {
  4266. try {
  4267. response = formatResponse(xhr);
  4268. callback(response);
  4269. } catch (err) {
  4270. if (errorCallback) {
  4271. errorCallback(err);
  4272. }
  4273. }
  4274. }
  4275. }
  4276. };
  4277. try {
  4278. // Hack to workaround banner validation
  4279. xhr.open(['G', 'E', 'T'].join(''), path, true);
  4280. } catch (error) {
  4281. // Hack to workaround banner validation
  4282. xhr.open(['G', 'E', 'T'].join(''), fullPath + '/' + path, true);
  4283. }
  4284. xhr.send();
  4285. }
  4286. return {
  4287. load: loadAsset
  4288. };
  4289. }();
  4290. }
  4291. if (e.data.type === 'loadAnimation') {
  4292. _workerSelf.assetLoader.load(e.data.path, e.data.fullPath, function (data) {
  4293. _workerSelf.dataManager.completeData(data);
  4294. _workerSelf.postMessage({
  4295. id: e.data.id,
  4296. payload: data,
  4297. status: 'success'
  4298. });
  4299. }, function () {
  4300. _workerSelf.postMessage({
  4301. id: e.data.id,
  4302. status: 'error'
  4303. });
  4304. });
  4305. } else if (e.data.type === 'complete') {
  4306. var animation = e.data.animation;
  4307. _workerSelf.dataManager.completeData(animation);
  4308. _workerSelf.postMessage({
  4309. id: e.data.id,
  4310. payload: animation,
  4311. status: 'success'
  4312. });
  4313. } else if (e.data.type === 'loadData') {
  4314. _workerSelf.assetLoader.load(e.data.path, e.data.fullPath, function (data) {
  4315. _workerSelf.postMessage({
  4316. id: e.data.id,
  4317. payload: data,
  4318. status: 'success'
  4319. });
  4320. }, function () {
  4321. _workerSelf.postMessage({
  4322. id: e.data.id,
  4323. status: 'error'
  4324. });
  4325. });
  4326. }
  4327. });
  4328. workerInstance.onmessage = function (event) {
  4329. var data = event.data;
  4330. var id = data.id;
  4331. var process = processes[id];
  4332. processes[id] = null;
  4333. if (data.status === 'success') {
  4334. process.onComplete(data.payload);
  4335. } else if (process.onError) {
  4336. process.onError();
  4337. }
  4338. };
  4339. }
  4340. }
  4341. function createProcess(onComplete, onError) {
  4342. _counterId += 1;
  4343. var id = 'processId_' + _counterId;
  4344. processes[id] = {
  4345. onComplete: onComplete,
  4346. onError: onError
  4347. };
  4348. return id;
  4349. }
  4350. function loadAnimation(path, onComplete, onError) {
  4351. setupWorker();
  4352. var processId = createProcess(onComplete, onError);
  4353. workerInstance.postMessage({
  4354. type: 'loadAnimation',
  4355. path: path,
  4356. fullPath: window.location.origin + window.location.pathname,
  4357. id: processId
  4358. });
  4359. }
  4360. function loadData(path, onComplete, onError) {
  4361. setupWorker();
  4362. var processId = createProcess(onComplete, onError);
  4363. workerInstance.postMessage({
  4364. type: 'loadData',
  4365. path: path,
  4366. fullPath: window.location.origin + window.location.pathname,
  4367. id: processId
  4368. });
  4369. }
  4370. function completeAnimation(anim, onComplete, onError) {
  4371. setupWorker();
  4372. var processId = createProcess(onComplete, onError);
  4373. workerInstance.postMessage({
  4374. type: 'complete',
  4375. animation: anim,
  4376. id: processId
  4377. });
  4378. }
  4379. return {
  4380. loadAnimation: loadAnimation,
  4381. loadData: loadData,
  4382. completeAnimation: completeAnimation
  4383. };
  4384. }();
  4385. var ImagePreloader = function () {
  4386. var proxyImage = function () {
  4387. var canvas = createTag('canvas');
  4388. canvas.width = 1;
  4389. canvas.height = 1;
  4390. var ctx = canvas.getContext('2d');
  4391. ctx.fillStyle = 'rgba(0,0,0,0)';
  4392. ctx.fillRect(0, 0, 1, 1);
  4393. return canvas;
  4394. }();
  4395. function imageLoaded() {
  4396. this.loadedAssets += 1;
  4397. if (this.loadedAssets === this.totalImages && this.loadedFootagesCount === this.totalFootages) {
  4398. if (this.imagesLoadedCb) {
  4399. this.imagesLoadedCb(null);
  4400. }
  4401. }
  4402. }
  4403. function footageLoaded() {
  4404. this.loadedFootagesCount += 1;
  4405. if (this.loadedAssets === this.totalImages && this.loadedFootagesCount === this.totalFootages) {
  4406. if (this.imagesLoadedCb) {
  4407. this.imagesLoadedCb(null);
  4408. }
  4409. }
  4410. }
  4411. function getAssetsPath(assetData, assetsPath, originalPath) {
  4412. var path = '';
  4413. if (assetData.e) {
  4414. path = assetData.p;
  4415. } else if (assetsPath) {
  4416. var imagePath = assetData.p;
  4417. if (imagePath.indexOf('images/') !== -1) {
  4418. imagePath = imagePath.split('/')[1];
  4419. }
  4420. path = assetsPath + imagePath;
  4421. } else {
  4422. path = originalPath;
  4423. path += assetData.u ? assetData.u : '';
  4424. path += assetData.p;
  4425. }
  4426. return path;
  4427. }
  4428. function testImageLoaded(img) {
  4429. var _count = 0;
  4430. var intervalId = setInterval(function () {
  4431. var box = img.getBBox();
  4432. if (box.width || _count > 500) {
  4433. this._imageLoaded();
  4434. clearInterval(intervalId);
  4435. }
  4436. _count += 1;
  4437. }.bind(this), 50);
  4438. }
  4439. function createImageData(assetData) {
  4440. var path = getAssetsPath(assetData, this.assetsPath, this.path);
  4441. var img = createNS('image');
  4442. if (isSafari) {
  4443. this.testImageLoaded(img);
  4444. } else {
  4445. img.addEventListener('load', this._imageLoaded, false);
  4446. }
  4447. img.addEventListener('error', function () {
  4448. ob.img = proxyImage;
  4449. this._imageLoaded();
  4450. }.bind(this), false);
  4451. img.setAttributeNS('http://www.w3.org/1999/xlink', 'href', path);
  4452. if (this._elementHelper.append) {
  4453. this._elementHelper.append(img);
  4454. } else {
  4455. this._elementHelper.appendChild(img);
  4456. }
  4457. var ob = {
  4458. img: img,
  4459. assetData: assetData
  4460. };
  4461. return ob;
  4462. }
  4463. function createImgData(assetData) {
  4464. var path = getAssetsPath(assetData, this.assetsPath, this.path);
  4465. var img = createTag('img');
  4466. img.crossOrigin = 'anonymous';
  4467. img.addEventListener('load', this._imageLoaded, false);
  4468. img.addEventListener('error', function () {
  4469. ob.img = proxyImage;
  4470. this._imageLoaded();
  4471. }.bind(this), false);
  4472. img.src = path;
  4473. var ob = {
  4474. img: img,
  4475. assetData: assetData
  4476. };
  4477. return ob;
  4478. }
  4479. function createFootageData(data) {
  4480. var ob = {
  4481. assetData: data
  4482. };
  4483. var path = getAssetsPath(data, this.assetsPath, this.path);
  4484. dataManager.loadData(path, function (footageData) {
  4485. ob.img = footageData;
  4486. this._footageLoaded();
  4487. }.bind(this), function () {
  4488. ob.img = {};
  4489. this._footageLoaded();
  4490. }.bind(this));
  4491. return ob;
  4492. }
  4493. function loadAssets(assets, cb) {
  4494. this.imagesLoadedCb = cb;
  4495. var i;
  4496. var len = assets.length;
  4497. for (i = 0; i < len; i += 1) {
  4498. if (!assets[i].layers) {
  4499. if (!assets[i].t || assets[i].t === 'seq') {
  4500. this.totalImages += 1;
  4501. this.images.push(this._createImageData(assets[i]));
  4502. } else if (assets[i].t === 3) {
  4503. this.totalFootages += 1;
  4504. this.images.push(this.createFootageData(assets[i]));
  4505. }
  4506. }
  4507. }
  4508. }
  4509. function setPath(path) {
  4510. this.path = path || '';
  4511. }
  4512. function setAssetsPath(path) {
  4513. this.assetsPath = path || '';
  4514. }
  4515. function getAsset(assetData) {
  4516. var i = 0;
  4517. var len = this.images.length;
  4518. while (i < len) {
  4519. if (this.images[i].assetData === assetData) {
  4520. return this.images[i].img;
  4521. }
  4522. i += 1;
  4523. }
  4524. return null;
  4525. }
  4526. function destroy() {
  4527. this.imagesLoadedCb = null;
  4528. this.images.length = 0;
  4529. }
  4530. function loadedImages() {
  4531. return this.totalImages === this.loadedAssets;
  4532. }
  4533. function loadedFootages() {
  4534. return this.totalFootages === this.loadedFootagesCount;
  4535. }
  4536. function setCacheType(type, elementHelper) {
  4537. if (type === 'svg') {
  4538. this._elementHelper = elementHelper;
  4539. this._createImageData = this.createImageData.bind(this);
  4540. } else {
  4541. this._createImageData = this.createImgData.bind(this);
  4542. }
  4543. }
  4544. function ImagePreloaderFactory() {
  4545. this._imageLoaded = imageLoaded.bind(this);
  4546. this._footageLoaded = footageLoaded.bind(this);
  4547. this.testImageLoaded = testImageLoaded.bind(this);
  4548. this.createFootageData = createFootageData.bind(this);
  4549. this.assetsPath = '';
  4550. this.path = '';
  4551. this.totalImages = 0;
  4552. this.totalFootages = 0;
  4553. this.loadedAssets = 0;
  4554. this.loadedFootagesCount = 0;
  4555. this.imagesLoadedCb = null;
  4556. this.images = [];
  4557. }
  4558. ImagePreloaderFactory.prototype = {
  4559. loadAssets: loadAssets,
  4560. setAssetsPath: setAssetsPath,
  4561. setPath: setPath,
  4562. loadedImages: loadedImages,
  4563. loadedFootages: loadedFootages,
  4564. destroy: destroy,
  4565. getAsset: getAsset,
  4566. createImgData: createImgData,
  4567. createImageData: createImageData,
  4568. imageLoaded: imageLoaded,
  4569. footageLoaded: footageLoaded,
  4570. setCacheType: setCacheType
  4571. };
  4572. return ImagePreloaderFactory;
  4573. }();
  4574. function BaseEvent() {}
  4575. BaseEvent.prototype = {
  4576. triggerEvent: function triggerEvent(eventName, args) {
  4577. if (this._cbs[eventName]) {
  4578. var callbacks = this._cbs[eventName];
  4579. for (var i = 0; i < callbacks.length; i += 1) {
  4580. callbacks[i](args);
  4581. }
  4582. }
  4583. },
  4584. addEventListener: function addEventListener(eventName, callback) {
  4585. if (!this._cbs[eventName]) {
  4586. this._cbs[eventName] = [];
  4587. }
  4588. this._cbs[eventName].push(callback);
  4589. return function () {
  4590. this.removeEventListener(eventName, callback);
  4591. }.bind(this);
  4592. },
  4593. removeEventListener: function removeEventListener(eventName, callback) {
  4594. if (!callback) {
  4595. this._cbs[eventName] = null;
  4596. } else if (this._cbs[eventName]) {
  4597. var i = 0;
  4598. var len = this._cbs[eventName].length;
  4599. while (i < len) {
  4600. if (this._cbs[eventName][i] === callback) {
  4601. this._cbs[eventName].splice(i, 1);
  4602. i -= 1;
  4603. len -= 1;
  4604. }
  4605. i += 1;
  4606. }
  4607. if (!this._cbs[eventName].length) {
  4608. this._cbs[eventName] = null;
  4609. }
  4610. }
  4611. }
  4612. };
  4613. var markerParser = function () {
  4614. function parsePayloadLines(payload) {
  4615. var lines = payload.split('\r\n');
  4616. var keys = {};
  4617. var line;
  4618. var keysCount = 0;
  4619. for (var i = 0; i < lines.length; i += 1) {
  4620. line = lines[i].split(':');
  4621. if (line.length === 2) {
  4622. keys[line[0]] = line[1].trim();
  4623. keysCount += 1;
  4624. }
  4625. }
  4626. if (keysCount === 0) {
  4627. throw new Error();
  4628. }
  4629. return keys;
  4630. }
  4631. return function (_markers) {
  4632. var markers = [];
  4633. for (var i = 0; i < _markers.length; i += 1) {
  4634. var _marker = _markers[i];
  4635. var markerData = {
  4636. time: _marker.tm,
  4637. duration: _marker.dr
  4638. };
  4639. try {
  4640. markerData.payload = JSON.parse(_markers[i].cm);
  4641. } catch (_) {
  4642. try {
  4643. markerData.payload = parsePayloadLines(_markers[i].cm);
  4644. } catch (__) {
  4645. markerData.payload = {
  4646. name: _markers[i].cm
  4647. };
  4648. }
  4649. }
  4650. markers.push(markerData);
  4651. }
  4652. return markers;
  4653. };
  4654. }();
  4655. var ProjectInterface = function () {
  4656. function registerComposition(comp) {
  4657. this.compositions.push(comp);
  4658. }
  4659. return function () {
  4660. function _thisProjectFunction(name) {
  4661. var i = 0;
  4662. var len = this.compositions.length;
  4663. while (i < len) {
  4664. if (this.compositions[i].data && this.compositions[i].data.nm === name) {
  4665. if (this.compositions[i].prepareFrame && this.compositions[i].data.xt) {
  4666. this.compositions[i].prepareFrame(this.currentFrame);
  4667. }
  4668. return this.compositions[i].compInterface;
  4669. }
  4670. i += 1;
  4671. }
  4672. return null;
  4673. }
  4674. _thisProjectFunction.compositions = [];
  4675. _thisProjectFunction.currentFrame = 0;
  4676. _thisProjectFunction.registerComposition = registerComposition;
  4677. return _thisProjectFunction;
  4678. };
  4679. }();
  4680. var renderers = {};
  4681. var registerRenderer = function registerRenderer(key, value) {
  4682. renderers[key] = value;
  4683. };
  4684. function getRenderer(key) {
  4685. return renderers[key];
  4686. }
  4687. function getRegisteredRenderer() {
  4688. // Returns canvas by default for compatibility
  4689. if (renderers.canvas) {
  4690. return 'canvas';
  4691. } // Returns any renderer that is registered
  4692. for (var key in renderers) {
  4693. if (renderers[key]) {
  4694. return key;
  4695. }
  4696. }
  4697. return '';
  4698. }
  4699. function _typeof$4(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$4 = function _typeof(obj) { return typeof obj; }; } else { _typeof$4 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$4(obj); }
  4700. var AnimationItem = function AnimationItem() {
  4701. this._cbs = [];
  4702. this.name = '';
  4703. this.path = '';
  4704. this.isLoaded = false;
  4705. this.currentFrame = 0;
  4706. this.currentRawFrame = 0;
  4707. this.firstFrame = 0;
  4708. this.totalFrames = 0;
  4709. this.frameRate = 0;
  4710. this.frameMult = 0;
  4711. this.playSpeed = 1;
  4712. this.playDirection = 1;
  4713. this.playCount = 0;
  4714. this.animationData = {};
  4715. this.assets = [];
  4716. this.isPaused = true;
  4717. this.autoplay = false;
  4718. this.loop = true;
  4719. this.renderer = null;
  4720. this.animationID = createElementID();
  4721. this.assetsPath = '';
  4722. this.timeCompleted = 0;
  4723. this.segmentPos = 0;
  4724. this.isSubframeEnabled = getSubframeEnabled();
  4725. this.segments = [];
  4726. this._idle = true;
  4727. this._completedLoop = false;
  4728. this.projectInterface = ProjectInterface();
  4729. this.imagePreloader = new ImagePreloader();
  4730. this.audioController = audioControllerFactory();
  4731. this.markers = [];
  4732. this.configAnimation = this.configAnimation.bind(this);
  4733. this.onSetupError = this.onSetupError.bind(this);
  4734. this.onSegmentComplete = this.onSegmentComplete.bind(this);
  4735. this.drawnFrameEvent = new BMEnterFrameEvent('drawnFrame', 0, 0, 0);
  4736. this.expressionsPlugin = getExpressionsPlugin();
  4737. };
  4738. extendPrototype([BaseEvent], AnimationItem);
  4739. AnimationItem.prototype.setParams = function (params) {
  4740. if (params.wrapper || params.container) {
  4741. this.wrapper = params.wrapper || params.container;
  4742. }
  4743. var animType = 'svg';
  4744. if (params.animType) {
  4745. animType = params.animType;
  4746. } else if (params.renderer) {
  4747. animType = params.renderer;
  4748. }
  4749. var RendererClass = getRenderer(animType);
  4750. this.renderer = new RendererClass(this, params.rendererSettings);
  4751. this.imagePreloader.setCacheType(animType, this.renderer.globalData.defs);
  4752. this.renderer.setProjectInterface(this.projectInterface);
  4753. this.animType = animType;
  4754. if (params.loop === '' || params.loop === null || params.loop === undefined || params.loop === true) {
  4755. this.loop = true;
  4756. } else if (params.loop === false) {
  4757. this.loop = false;
  4758. } else {
  4759. this.loop = parseInt(params.loop, 10);
  4760. }
  4761. this.autoplay = 'autoplay' in params ? params.autoplay : true;
  4762. this.name = params.name ? params.name : '';
  4763. this.autoloadSegments = Object.prototype.hasOwnProperty.call(params, 'autoloadSegments') ? params.autoloadSegments : true;
  4764. this.assetsPath = params.assetsPath;
  4765. this.initialSegment = params.initialSegment;
  4766. if (params.audioFactory) {
  4767. this.audioController.setAudioFactory(params.audioFactory);
  4768. }
  4769. if (params.animationData) {
  4770. this.setupAnimation(params.animationData);
  4771. } else if (params.path) {
  4772. if (params.path.lastIndexOf('\\') !== -1) {
  4773. this.path = params.path.substr(0, params.path.lastIndexOf('\\') + 1);
  4774. } else {
  4775. this.path = params.path.substr(0, params.path.lastIndexOf('/') + 1);
  4776. }
  4777. this.fileName = params.path.substr(params.path.lastIndexOf('/') + 1);
  4778. this.fileName = this.fileName.substr(0, this.fileName.lastIndexOf('.json'));
  4779. dataManager.loadAnimation(params.path, this.configAnimation, this.onSetupError);
  4780. }
  4781. };
  4782. AnimationItem.prototype.onSetupError = function () {
  4783. this.trigger('data_failed');
  4784. };
  4785. AnimationItem.prototype.setupAnimation = function (data) {
  4786. dataManager.completeAnimation(data, this.configAnimation);
  4787. };
  4788. AnimationItem.prototype.setData = function (wrapper, animationData) {
  4789. if (animationData) {
  4790. if (_typeof$4(animationData) !== 'object') {
  4791. animationData = JSON.parse(animationData);
  4792. }
  4793. }
  4794. var params = {
  4795. wrapper: wrapper,
  4796. animationData: animationData
  4797. };
  4798. var wrapperAttributes = wrapper.attributes;
  4799. params.path = wrapperAttributes.getNamedItem('data-animation-path') // eslint-disable-line no-nested-ternary
  4800. ? wrapperAttributes.getNamedItem('data-animation-path').value : wrapperAttributes.getNamedItem('data-bm-path') // eslint-disable-line no-nested-ternary
  4801. ? wrapperAttributes.getNamedItem('data-bm-path').value : wrapperAttributes.getNamedItem('bm-path') ? wrapperAttributes.getNamedItem('bm-path').value : '';
  4802. params.animType = wrapperAttributes.getNamedItem('data-anim-type') // eslint-disable-line no-nested-ternary
  4803. ? wrapperAttributes.getNamedItem('data-anim-type').value : wrapperAttributes.getNamedItem('data-bm-type') // eslint-disable-line no-nested-ternary
  4804. ? wrapperAttributes.getNamedItem('data-bm-type').value : wrapperAttributes.getNamedItem('bm-type') // eslint-disable-line no-nested-ternary
  4805. ? wrapperAttributes.getNamedItem('bm-type').value : wrapperAttributes.getNamedItem('data-bm-renderer') // eslint-disable-line no-nested-ternary
  4806. ? wrapperAttributes.getNamedItem('data-bm-renderer').value : wrapperAttributes.getNamedItem('bm-renderer') ? wrapperAttributes.getNamedItem('bm-renderer').value : getRegisteredRenderer() || 'canvas';
  4807. var loop = wrapperAttributes.getNamedItem('data-anim-loop') // eslint-disable-line no-nested-ternary
  4808. ? wrapperAttributes.getNamedItem('data-anim-loop').value : wrapperAttributes.getNamedItem('data-bm-loop') // eslint-disable-line no-nested-ternary
  4809. ? wrapperAttributes.getNamedItem('data-bm-loop').value : wrapperAttributes.getNamedItem('bm-loop') ? wrapperAttributes.getNamedItem('bm-loop').value : '';
  4810. if (loop === 'false') {
  4811. params.loop = false;
  4812. } else if (loop === 'true') {
  4813. params.loop = true;
  4814. } else if (loop !== '') {
  4815. params.loop = parseInt(loop, 10);
  4816. }
  4817. var autoplay = wrapperAttributes.getNamedItem('data-anim-autoplay') // eslint-disable-line no-nested-ternary
  4818. ? wrapperAttributes.getNamedItem('data-anim-autoplay').value : wrapperAttributes.getNamedItem('data-bm-autoplay') // eslint-disable-line no-nested-ternary
  4819. ? wrapperAttributes.getNamedItem('data-bm-autoplay').value : wrapperAttributes.getNamedItem('bm-autoplay') ? wrapperAttributes.getNamedItem('bm-autoplay').value : true;
  4820. params.autoplay = autoplay !== 'false';
  4821. params.name = wrapperAttributes.getNamedItem('data-name') // eslint-disable-line no-nested-ternary
  4822. ? wrapperAttributes.getNamedItem('data-name').value : wrapperAttributes.getNamedItem('data-bm-name') // eslint-disable-line no-nested-ternary
  4823. ? wrapperAttributes.getNamedItem('data-bm-name').value : wrapperAttributes.getNamedItem('bm-name') ? wrapperAttributes.getNamedItem('bm-name').value : '';
  4824. var prerender = wrapperAttributes.getNamedItem('data-anim-prerender') // eslint-disable-line no-nested-ternary
  4825. ? wrapperAttributes.getNamedItem('data-anim-prerender').value : wrapperAttributes.getNamedItem('data-bm-prerender') // eslint-disable-line no-nested-ternary
  4826. ? wrapperAttributes.getNamedItem('data-bm-prerender').value : wrapperAttributes.getNamedItem('bm-prerender') ? wrapperAttributes.getNamedItem('bm-prerender').value : '';
  4827. if (prerender === 'false') {
  4828. params.prerender = false;
  4829. }
  4830. if (!params.path) {
  4831. this.trigger('destroy');
  4832. } else {
  4833. this.setParams(params);
  4834. }
  4835. };
  4836. AnimationItem.prototype.includeLayers = function (data) {
  4837. if (data.op > this.animationData.op) {
  4838. this.animationData.op = data.op;
  4839. this.totalFrames = Math.floor(data.op - this.animationData.ip);
  4840. }
  4841. var layers = this.animationData.layers;
  4842. var i;
  4843. var len = layers.length;
  4844. var newLayers = data.layers;
  4845. var j;
  4846. var jLen = newLayers.length;
  4847. for (j = 0; j < jLen; j += 1) {
  4848. i = 0;
  4849. while (i < len) {
  4850. if (layers[i].id === newLayers[j].id) {
  4851. layers[i] = newLayers[j];
  4852. break;
  4853. }
  4854. i += 1;
  4855. }
  4856. }
  4857. if (data.chars || data.fonts) {
  4858. this.renderer.globalData.fontManager.addChars(data.chars);
  4859. this.renderer.globalData.fontManager.addFonts(data.fonts, this.renderer.globalData.defs);
  4860. }
  4861. if (data.assets) {
  4862. len = data.assets.length;
  4863. for (i = 0; i < len; i += 1) {
  4864. this.animationData.assets.push(data.assets[i]);
  4865. }
  4866. }
  4867. this.animationData.__complete = false;
  4868. dataManager.completeAnimation(this.animationData, this.onSegmentComplete);
  4869. };
  4870. AnimationItem.prototype.onSegmentComplete = function (data) {
  4871. this.animationData = data;
  4872. var expressionsPlugin = getExpressionsPlugin();
  4873. if (expressionsPlugin) {
  4874. expressionsPlugin.initExpressions(this);
  4875. }
  4876. this.loadNextSegment();
  4877. };
  4878. AnimationItem.prototype.loadNextSegment = function () {
  4879. var segments = this.animationData.segments;
  4880. if (!segments || segments.length === 0 || !this.autoloadSegments) {
  4881. this.trigger('data_ready');
  4882. this.timeCompleted = this.totalFrames;
  4883. return;
  4884. }
  4885. var segment = segments.shift();
  4886. this.timeCompleted = segment.time * this.frameRate;
  4887. var segmentPath = this.path + this.fileName + '_' + this.segmentPos + '.json';
  4888. this.segmentPos += 1;
  4889. dataManager.loadData(segmentPath, this.includeLayers.bind(this), function () {
  4890. this.trigger('data_failed');
  4891. }.bind(this));
  4892. };
  4893. AnimationItem.prototype.loadSegments = function () {
  4894. var segments = this.animationData.segments;
  4895. if (!segments) {
  4896. this.timeCompleted = this.totalFrames;
  4897. }
  4898. this.loadNextSegment();
  4899. };
  4900. AnimationItem.prototype.imagesLoaded = function () {
  4901. this.trigger('loaded_images');
  4902. this.checkLoaded();
  4903. };
  4904. AnimationItem.prototype.preloadImages = function () {
  4905. this.imagePreloader.setAssetsPath(this.assetsPath);
  4906. this.imagePreloader.setPath(this.path);
  4907. this.imagePreloader.loadAssets(this.animationData.assets, this.imagesLoaded.bind(this));
  4908. };
  4909. AnimationItem.prototype.configAnimation = function (animData) {
  4910. if (!this.renderer) {
  4911. return;
  4912. }
  4913. try {
  4914. this.animationData = animData;
  4915. if (this.initialSegment) {
  4916. this.totalFrames = Math.floor(this.initialSegment[1] - this.initialSegment[0]);
  4917. this.firstFrame = Math.round(this.initialSegment[0]);
  4918. } else {
  4919. this.totalFrames = Math.floor(this.animationData.op - this.animationData.ip);
  4920. this.firstFrame = Math.round(this.animationData.ip);
  4921. }
  4922. this.renderer.configAnimation(animData);
  4923. if (!animData.assets) {
  4924. animData.assets = [];
  4925. }
  4926. this.assets = this.animationData.assets;
  4927. this.frameRate = this.animationData.fr;
  4928. this.frameMult = this.animationData.fr / 1000;
  4929. this.renderer.searchExtraCompositions(animData.assets);
  4930. this.markers = markerParser(animData.markers || []);
  4931. this.trigger('config_ready');
  4932. this.preloadImages();
  4933. this.loadSegments();
  4934. this.updaFrameModifier();
  4935. this.waitForFontsLoaded();
  4936. if (this.isPaused) {
  4937. this.audioController.pause();
  4938. }
  4939. } catch (error) {
  4940. this.triggerConfigError(error);
  4941. }
  4942. };
  4943. AnimationItem.prototype.waitForFontsLoaded = function () {
  4944. if (!this.renderer) {
  4945. return;
  4946. }
  4947. if (this.renderer.globalData.fontManager.isLoaded) {
  4948. this.checkLoaded();
  4949. } else {
  4950. setTimeout(this.waitForFontsLoaded.bind(this), 20);
  4951. }
  4952. };
  4953. AnimationItem.prototype.checkLoaded = function () {
  4954. if (!this.isLoaded && this.renderer.globalData.fontManager.isLoaded && (this.imagePreloader.loadedImages() || this.renderer.rendererType !== 'canvas') && this.imagePreloader.loadedFootages()) {
  4955. this.isLoaded = true;
  4956. var expressionsPlugin = getExpressionsPlugin();
  4957. if (expressionsPlugin) {
  4958. expressionsPlugin.initExpressions(this);
  4959. }
  4960. this.renderer.initItems();
  4961. setTimeout(function () {
  4962. this.trigger('DOMLoaded');
  4963. }.bind(this), 0);
  4964. this.gotoFrame();
  4965. if (this.autoplay) {
  4966. this.play();
  4967. }
  4968. }
  4969. };
  4970. AnimationItem.prototype.resize = function (width, height) {
  4971. // Adding this validation for backwards compatibility in case an event object was being passed down
  4972. var _width = typeof width === 'number' ? width : undefined;
  4973. var _height = typeof height === 'number' ? height : undefined;
  4974. this.renderer.updateContainerSize(_width, _height);
  4975. };
  4976. AnimationItem.prototype.setSubframe = function (flag) {
  4977. this.isSubframeEnabled = !!flag;
  4978. };
  4979. AnimationItem.prototype.gotoFrame = function () {
  4980. this.currentFrame = this.isSubframeEnabled ? this.currentRawFrame : ~~this.currentRawFrame; // eslint-disable-line no-bitwise
  4981. if (this.timeCompleted !== this.totalFrames && this.currentFrame > this.timeCompleted) {
  4982. this.currentFrame = this.timeCompleted;
  4983. }
  4984. this.trigger('enterFrame');
  4985. this.renderFrame();
  4986. this.trigger('drawnFrame');
  4987. };
  4988. AnimationItem.prototype.renderFrame = function () {
  4989. if (this.isLoaded === false || !this.renderer) {
  4990. return;
  4991. }
  4992. try {
  4993. if (this.expressionsPlugin) {
  4994. this.expressionsPlugin.resetFrame();
  4995. }
  4996. this.renderer.renderFrame(this.currentFrame + this.firstFrame);
  4997. } catch (error) {
  4998. this.triggerRenderFrameError(error);
  4999. }
  5000. };
  5001. AnimationItem.prototype.play = function (name) {
  5002. if (name && this.name !== name) {
  5003. return;
  5004. }
  5005. if (this.isPaused === true) {
  5006. this.isPaused = false;
  5007. this.trigger('_play');
  5008. this.audioController.resume();
  5009. if (this._idle) {
  5010. this._idle = false;
  5011. this.trigger('_active');
  5012. }
  5013. }
  5014. };
  5015. AnimationItem.prototype.pause = function (name) {
  5016. if (name && this.name !== name) {
  5017. return;
  5018. }
  5019. if (this.isPaused === false) {
  5020. this.isPaused = true;
  5021. this.trigger('_pause');
  5022. this._idle = true;
  5023. this.trigger('_idle');
  5024. this.audioController.pause();
  5025. }
  5026. };
  5027. AnimationItem.prototype.togglePause = function (name) {
  5028. if (name && this.name !== name) {
  5029. return;
  5030. }
  5031. if (this.isPaused === true) {
  5032. this.play();
  5033. } else {
  5034. this.pause();
  5035. }
  5036. };
  5037. AnimationItem.prototype.stop = function (name) {
  5038. if (name && this.name !== name) {
  5039. return;
  5040. }
  5041. this.pause();
  5042. this.playCount = 0;
  5043. this._completedLoop = false;
  5044. this.setCurrentRawFrameValue(0);
  5045. };
  5046. AnimationItem.prototype.getMarkerData = function (markerName) {
  5047. var marker;
  5048. for (var i = 0; i < this.markers.length; i += 1) {
  5049. marker = this.markers[i];
  5050. if (marker.payload && marker.payload.name === markerName) {
  5051. return marker;
  5052. }
  5053. }
  5054. return null;
  5055. };
  5056. AnimationItem.prototype.goToAndStop = function (value, isFrame, name) {
  5057. if (name && this.name !== name) {
  5058. return;
  5059. }
  5060. var numValue = Number(value);
  5061. if (isNaN(numValue)) {
  5062. var marker = this.getMarkerData(value);
  5063. if (marker) {
  5064. this.goToAndStop(marker.time, true);
  5065. }
  5066. } else if (isFrame) {
  5067. this.setCurrentRawFrameValue(value);
  5068. } else {
  5069. this.setCurrentRawFrameValue(value * this.frameModifier);
  5070. }
  5071. this.pause();
  5072. };
  5073. AnimationItem.prototype.goToAndPlay = function (value, isFrame, name) {
  5074. if (name && this.name !== name) {
  5075. return;
  5076. }
  5077. var numValue = Number(value);
  5078. if (isNaN(numValue)) {
  5079. var marker = this.getMarkerData(value);
  5080. if (marker) {
  5081. if (!marker.duration) {
  5082. this.goToAndStop(marker.time, true);
  5083. } else {
  5084. this.playSegments([marker.time, marker.time + marker.duration], true);
  5085. }
  5086. }
  5087. } else {
  5088. this.goToAndStop(numValue, isFrame, name);
  5089. }
  5090. this.play();
  5091. };
  5092. AnimationItem.prototype.advanceTime = function (value) {
  5093. if (this.isPaused === true || this.isLoaded === false) {
  5094. return;
  5095. }
  5096. var nextValue = this.currentRawFrame + value * this.frameModifier;
  5097. var _isComplete = false; // Checking if nextValue > totalFrames - 1 for addressing non looping and looping animations.
  5098. // If animation won't loop, it should stop at totalFrames - 1. If it will loop it should complete the last frame and then loop.
  5099. if (nextValue >= this.totalFrames - 1 && this.frameModifier > 0) {
  5100. if (!this.loop || this.playCount === this.loop) {
  5101. if (!this.checkSegments(nextValue > this.totalFrames ? nextValue % this.totalFrames : 0)) {
  5102. _isComplete = true;
  5103. nextValue = this.totalFrames - 1;
  5104. }
  5105. } else if (nextValue >= this.totalFrames) {
  5106. this.playCount += 1;
  5107. if (!this.checkSegments(nextValue % this.totalFrames)) {
  5108. this.setCurrentRawFrameValue(nextValue % this.totalFrames);
  5109. this._completedLoop = true;
  5110. this.trigger('loopComplete');
  5111. }
  5112. } else {
  5113. this.setCurrentRawFrameValue(nextValue);
  5114. }
  5115. } else if (nextValue < 0) {
  5116. if (!this.checkSegments(nextValue % this.totalFrames)) {
  5117. if (this.loop && !(this.playCount-- <= 0 && this.loop !== true)) {
  5118. // eslint-disable-line no-plusplus
  5119. this.setCurrentRawFrameValue(this.totalFrames + nextValue % this.totalFrames);
  5120. if (!this._completedLoop) {
  5121. this._completedLoop = true;
  5122. } else {
  5123. this.trigger('loopComplete');
  5124. }
  5125. } else {
  5126. _isComplete = true;
  5127. nextValue = 0;
  5128. }
  5129. }
  5130. } else {
  5131. this.setCurrentRawFrameValue(nextValue);
  5132. }
  5133. if (_isComplete) {
  5134. this.setCurrentRawFrameValue(nextValue);
  5135. this.pause();
  5136. this.trigger('complete');
  5137. }
  5138. };
  5139. AnimationItem.prototype.adjustSegment = function (arr, offset) {
  5140. this.playCount = 0;
  5141. if (arr[1] < arr[0]) {
  5142. if (this.frameModifier > 0) {
  5143. if (this.playSpeed < 0) {
  5144. this.setSpeed(-this.playSpeed);
  5145. } else {
  5146. this.setDirection(-1);
  5147. }
  5148. }
  5149. this.totalFrames = arr[0] - arr[1];
  5150. this.timeCompleted = this.totalFrames;
  5151. this.firstFrame = arr[1];
  5152. this.setCurrentRawFrameValue(this.totalFrames - 0.001 - offset);
  5153. } else if (arr[1] > arr[0]) {
  5154. if (this.frameModifier < 0) {
  5155. if (this.playSpeed < 0) {
  5156. this.setSpeed(-this.playSpeed);
  5157. } else {
  5158. this.setDirection(1);
  5159. }
  5160. }
  5161. this.totalFrames = arr[1] - arr[0];
  5162. this.timeCompleted = this.totalFrames;
  5163. this.firstFrame = arr[0];
  5164. this.setCurrentRawFrameValue(0.001 + offset);
  5165. }
  5166. this.trigger('segmentStart');
  5167. };
  5168. AnimationItem.prototype.setSegment = function (init, end) {
  5169. var pendingFrame = -1;
  5170. if (this.isPaused) {
  5171. if (this.currentRawFrame + this.firstFrame < init) {
  5172. pendingFrame = init;
  5173. } else if (this.currentRawFrame + this.firstFrame > end) {
  5174. pendingFrame = end - init;
  5175. }
  5176. }
  5177. this.firstFrame = init;
  5178. this.totalFrames = end - init;
  5179. this.timeCompleted = this.totalFrames;
  5180. if (pendingFrame !== -1) {
  5181. this.goToAndStop(pendingFrame, true);
  5182. }
  5183. };
  5184. AnimationItem.prototype.playSegments = function (arr, forceFlag) {
  5185. if (forceFlag) {
  5186. this.segments.length = 0;
  5187. }
  5188. if (_typeof$4(arr[0]) === 'object') {
  5189. var i;
  5190. var len = arr.length;
  5191. for (i = 0; i < len; i += 1) {
  5192. this.segments.push(arr[i]);
  5193. }
  5194. } else {
  5195. this.segments.push(arr);
  5196. }
  5197. if (this.segments.length && forceFlag) {
  5198. this.adjustSegment(this.segments.shift(), 0);
  5199. }
  5200. if (this.isPaused) {
  5201. this.play();
  5202. }
  5203. };
  5204. AnimationItem.prototype.resetSegments = function (forceFlag) {
  5205. this.segments.length = 0;
  5206. this.segments.push([this.animationData.ip, this.animationData.op]);
  5207. if (forceFlag) {
  5208. this.checkSegments(0);
  5209. }
  5210. };
  5211. AnimationItem.prototype.checkSegments = function (offset) {
  5212. if (this.segments.length) {
  5213. this.adjustSegment(this.segments.shift(), offset);
  5214. return true;
  5215. }
  5216. return false;
  5217. };
  5218. AnimationItem.prototype.destroy = function (name) {
  5219. if (name && this.name !== name || !this.renderer) {
  5220. return;
  5221. }
  5222. this.renderer.destroy();
  5223. this.imagePreloader.destroy();
  5224. this.trigger('destroy');
  5225. this._cbs = null;
  5226. this.onEnterFrame = null;
  5227. this.onLoopComplete = null;
  5228. this.onComplete = null;
  5229. this.onSegmentStart = null;
  5230. this.onDestroy = null;
  5231. this.renderer = null;
  5232. this.expressionsPlugin = null;
  5233. this.imagePreloader = null;
  5234. this.projectInterface = null;
  5235. };
  5236. AnimationItem.prototype.setCurrentRawFrameValue = function (value) {
  5237. this.currentRawFrame = value;
  5238. this.gotoFrame();
  5239. };
  5240. AnimationItem.prototype.setSpeed = function (val) {
  5241. this.playSpeed = val;
  5242. this.updaFrameModifier();
  5243. };
  5244. AnimationItem.prototype.setDirection = function (val) {
  5245. this.playDirection = val < 0 ? -1 : 1;
  5246. this.updaFrameModifier();
  5247. };
  5248. AnimationItem.prototype.setLoop = function (isLooping) {
  5249. this.loop = isLooping;
  5250. };
  5251. AnimationItem.prototype.setVolume = function (val, name) {
  5252. if (name && this.name !== name) {
  5253. return;
  5254. }
  5255. this.audioController.setVolume(val);
  5256. };
  5257. AnimationItem.prototype.getVolume = function () {
  5258. return this.audioController.getVolume();
  5259. };
  5260. AnimationItem.prototype.mute = function (name) {
  5261. if (name && this.name !== name) {
  5262. return;
  5263. }
  5264. this.audioController.mute();
  5265. };
  5266. AnimationItem.prototype.unmute = function (name) {
  5267. if (name && this.name !== name) {
  5268. return;
  5269. }
  5270. this.audioController.unmute();
  5271. };
  5272. AnimationItem.prototype.updaFrameModifier = function () {
  5273. this.frameModifier = this.frameMult * this.playSpeed * this.playDirection;
  5274. this.audioController.setRate(this.playSpeed * this.playDirection);
  5275. };
  5276. AnimationItem.prototype.getPath = function () {
  5277. return this.path;
  5278. };
  5279. AnimationItem.prototype.getAssetsPath = function (assetData) {
  5280. var path = '';
  5281. if (assetData.e) {
  5282. path = assetData.p;
  5283. } else if (this.assetsPath) {
  5284. var imagePath = assetData.p;
  5285. if (imagePath.indexOf('images/') !== -1) {
  5286. imagePath = imagePath.split('/')[1];
  5287. }
  5288. path = this.assetsPath + imagePath;
  5289. } else {
  5290. path = this.path;
  5291. path += assetData.u ? assetData.u : '';
  5292. path += assetData.p;
  5293. }
  5294. return path;
  5295. };
  5296. AnimationItem.prototype.getAssetData = function (id) {
  5297. var i = 0;
  5298. var len = this.assets.length;
  5299. while (i < len) {
  5300. if (id === this.assets[i].id) {
  5301. return this.assets[i];
  5302. }
  5303. i += 1;
  5304. }
  5305. return null;
  5306. };
  5307. AnimationItem.prototype.hide = function () {
  5308. this.renderer.hide();
  5309. };
  5310. AnimationItem.prototype.show = function () {
  5311. this.renderer.show();
  5312. };
  5313. AnimationItem.prototype.getDuration = function (isFrame) {
  5314. return isFrame ? this.totalFrames : this.totalFrames / this.frameRate;
  5315. };
  5316. AnimationItem.prototype.updateDocumentData = function (path, documentData, index) {
  5317. try {
  5318. var element = this.renderer.getElementByPath(path);
  5319. element.updateDocumentData(documentData, index);
  5320. } catch (error) {// TODO: decide how to handle catch case
  5321. }
  5322. };
  5323. AnimationItem.prototype.trigger = function (name) {
  5324. if (this._cbs && this._cbs[name]) {
  5325. switch (name) {
  5326. case 'enterFrame':
  5327. this.triggerEvent(name, new BMEnterFrameEvent(name, this.currentFrame, this.totalFrames, this.frameModifier));
  5328. break;
  5329. case 'drawnFrame':
  5330. this.drawnFrameEvent.currentTime = this.currentFrame;
  5331. this.drawnFrameEvent.totalTime = this.totalFrames;
  5332. this.drawnFrameEvent.direction = this.frameModifier;
  5333. this.triggerEvent(name, this.drawnFrameEvent);
  5334. break;
  5335. case 'loopComplete':
  5336. this.triggerEvent(name, new BMCompleteLoopEvent(name, this.loop, this.playCount, this.frameMult));
  5337. break;
  5338. case 'complete':
  5339. this.triggerEvent(name, new BMCompleteEvent(name, this.frameMult));
  5340. break;
  5341. case 'segmentStart':
  5342. this.triggerEvent(name, new BMSegmentStartEvent(name, this.firstFrame, this.totalFrames));
  5343. break;
  5344. case 'destroy':
  5345. this.triggerEvent(name, new BMDestroyEvent(name, this));
  5346. break;
  5347. default:
  5348. this.triggerEvent(name);
  5349. }
  5350. }
  5351. if (name === 'enterFrame' && this.onEnterFrame) {
  5352. this.onEnterFrame.call(this, new BMEnterFrameEvent(name, this.currentFrame, this.totalFrames, this.frameMult));
  5353. }
  5354. if (name === 'loopComplete' && this.onLoopComplete) {
  5355. this.onLoopComplete.call(this, new BMCompleteLoopEvent(name, this.loop, this.playCount, this.frameMult));
  5356. }
  5357. if (name === 'complete' && this.onComplete) {
  5358. this.onComplete.call(this, new BMCompleteEvent(name, this.frameMult));
  5359. }
  5360. if (name === 'segmentStart' && this.onSegmentStart) {
  5361. this.onSegmentStart.call(this, new BMSegmentStartEvent(name, this.firstFrame, this.totalFrames));
  5362. }
  5363. if (name === 'destroy' && this.onDestroy) {
  5364. this.onDestroy.call(this, new BMDestroyEvent(name, this));
  5365. }
  5366. };
  5367. AnimationItem.prototype.triggerRenderFrameError = function (nativeError) {
  5368. var error = new BMRenderFrameErrorEvent(nativeError, this.currentFrame);
  5369. this.triggerEvent('error', error);
  5370. if (this.onError) {
  5371. this.onError.call(this, error);
  5372. }
  5373. };
  5374. AnimationItem.prototype.triggerConfigError = function (nativeError) {
  5375. var error = new BMConfigErrorEvent(nativeError, this.currentFrame);
  5376. this.triggerEvent('error', error);
  5377. if (this.onError) {
  5378. this.onError.call(this, error);
  5379. }
  5380. };
  5381. var animationManager = function () {
  5382. var moduleOb = {};
  5383. var registeredAnimations = [];
  5384. var initTime = 0;
  5385. var len = 0;
  5386. var playingAnimationsNum = 0;
  5387. var _stopped = true;
  5388. var _isFrozen = false;
  5389. function removeElement(ev) {
  5390. var i = 0;
  5391. var animItem = ev.target;
  5392. while (i < len) {
  5393. if (registeredAnimations[i].animation === animItem) {
  5394. registeredAnimations.splice(i, 1);
  5395. i -= 1;
  5396. len -= 1;
  5397. if (!animItem.isPaused) {
  5398. subtractPlayingCount();
  5399. }
  5400. }
  5401. i += 1;
  5402. }
  5403. }
  5404. function registerAnimation(element, animationData) {
  5405. if (!element) {
  5406. return null;
  5407. }
  5408. var i = 0;
  5409. while (i < len) {
  5410. if (registeredAnimations[i].elem === element && registeredAnimations[i].elem !== null) {
  5411. return registeredAnimations[i].animation;
  5412. }
  5413. i += 1;
  5414. }
  5415. var animItem = new AnimationItem();
  5416. setupAnimation(animItem, element);
  5417. animItem.setData(element, animationData);
  5418. return animItem;
  5419. }
  5420. function getRegisteredAnimations() {
  5421. var i;
  5422. var lenAnims = registeredAnimations.length;
  5423. var animations = [];
  5424. for (i = 0; i < lenAnims; i += 1) {
  5425. animations.push(registeredAnimations[i].animation);
  5426. }
  5427. return animations;
  5428. }
  5429. function addPlayingCount() {
  5430. playingAnimationsNum += 1;
  5431. activate();
  5432. }
  5433. function subtractPlayingCount() {
  5434. playingAnimationsNum -= 1;
  5435. }
  5436. function setupAnimation(animItem, element) {
  5437. animItem.addEventListener('destroy', removeElement);
  5438. animItem.addEventListener('_active', addPlayingCount);
  5439. animItem.addEventListener('_idle', subtractPlayingCount);
  5440. registeredAnimations.push({
  5441. elem: element,
  5442. animation: animItem
  5443. });
  5444. len += 1;
  5445. }
  5446. function loadAnimation(params) {
  5447. var animItem = new AnimationItem();
  5448. setupAnimation(animItem, null);
  5449. animItem.setParams(params);
  5450. return animItem;
  5451. }
  5452. function setSpeed(val, animation) {
  5453. var i;
  5454. for (i = 0; i < len; i += 1) {
  5455. registeredAnimations[i].animation.setSpeed(val, animation);
  5456. }
  5457. }
  5458. function setDirection(val, animation) {
  5459. var i;
  5460. for (i = 0; i < len; i += 1) {
  5461. registeredAnimations[i].animation.setDirection(val, animation);
  5462. }
  5463. }
  5464. function play(animation) {
  5465. var i;
  5466. for (i = 0; i < len; i += 1) {
  5467. registeredAnimations[i].animation.play(animation);
  5468. }
  5469. }
  5470. function resume(nowTime) {
  5471. var elapsedTime = nowTime - initTime;
  5472. var i;
  5473. for (i = 0; i < len; i += 1) {
  5474. registeredAnimations[i].animation.advanceTime(elapsedTime);
  5475. }
  5476. initTime = nowTime;
  5477. if (playingAnimationsNum && !_isFrozen) {
  5478. window.requestAnimationFrame(resume);
  5479. } else {
  5480. _stopped = true;
  5481. }
  5482. }
  5483. function first(nowTime) {
  5484. initTime = nowTime;
  5485. window.requestAnimationFrame(resume);
  5486. }
  5487. function pause(animation) {
  5488. var i;
  5489. for (i = 0; i < len; i += 1) {
  5490. registeredAnimations[i].animation.pause(animation);
  5491. }
  5492. }
  5493. function goToAndStop(value, isFrame, animation) {
  5494. var i;
  5495. for (i = 0; i < len; i += 1) {
  5496. registeredAnimations[i].animation.goToAndStop(value, isFrame, animation);
  5497. }
  5498. }
  5499. function stop(animation) {
  5500. var i;
  5501. for (i = 0; i < len; i += 1) {
  5502. registeredAnimations[i].animation.stop(animation);
  5503. }
  5504. }
  5505. function togglePause(animation) {
  5506. var i;
  5507. for (i = 0; i < len; i += 1) {
  5508. registeredAnimations[i].animation.togglePause(animation);
  5509. }
  5510. }
  5511. function destroy(animation) {
  5512. var i;
  5513. for (i = len - 1; i >= 0; i -= 1) {
  5514. registeredAnimations[i].animation.destroy(animation);
  5515. }
  5516. }
  5517. function searchAnimations(animationData, standalone, renderer) {
  5518. var animElements = [].concat([].slice.call(document.getElementsByClassName('lottie')), [].slice.call(document.getElementsByClassName('bodymovin')));
  5519. var i;
  5520. var lenAnims = animElements.length;
  5521. for (i = 0; i < lenAnims; i += 1) {
  5522. if (renderer) {
  5523. animElements[i].setAttribute('data-bm-type', renderer);
  5524. }
  5525. registerAnimation(animElements[i], animationData);
  5526. }
  5527. if (standalone && lenAnims === 0) {
  5528. if (!renderer) {
  5529. renderer = 'svg';
  5530. }
  5531. var body = document.getElementsByTagName('body')[0];
  5532. body.innerText = '';
  5533. var div = createTag('div');
  5534. div.style.width = '100%';
  5535. div.style.height = '100%';
  5536. div.setAttribute('data-bm-type', renderer);
  5537. body.appendChild(div);
  5538. registerAnimation(div, animationData);
  5539. }
  5540. }
  5541. function resize() {
  5542. var i;
  5543. for (i = 0; i < len; i += 1) {
  5544. registeredAnimations[i].animation.resize();
  5545. }
  5546. }
  5547. function activate() {
  5548. if (!_isFrozen && playingAnimationsNum) {
  5549. if (_stopped) {
  5550. window.requestAnimationFrame(first);
  5551. _stopped = false;
  5552. }
  5553. }
  5554. }
  5555. function freeze() {
  5556. _isFrozen = true;
  5557. }
  5558. function unfreeze() {
  5559. _isFrozen = false;
  5560. activate();
  5561. }
  5562. function setVolume(val, animation) {
  5563. var i;
  5564. for (i = 0; i < len; i += 1) {
  5565. registeredAnimations[i].animation.setVolume(val, animation);
  5566. }
  5567. }
  5568. function mute(animation) {
  5569. var i;
  5570. for (i = 0; i < len; i += 1) {
  5571. registeredAnimations[i].animation.mute(animation);
  5572. }
  5573. }
  5574. function unmute(animation) {
  5575. var i;
  5576. for (i = 0; i < len; i += 1) {
  5577. registeredAnimations[i].animation.unmute(animation);
  5578. }
  5579. }
  5580. moduleOb.registerAnimation = registerAnimation;
  5581. moduleOb.loadAnimation = loadAnimation;
  5582. moduleOb.setSpeed = setSpeed;
  5583. moduleOb.setDirection = setDirection;
  5584. moduleOb.play = play;
  5585. moduleOb.pause = pause;
  5586. moduleOb.stop = stop;
  5587. moduleOb.togglePause = togglePause;
  5588. moduleOb.searchAnimations = searchAnimations;
  5589. moduleOb.resize = resize; // moduleOb.start = start;
  5590. moduleOb.goToAndStop = goToAndStop;
  5591. moduleOb.destroy = destroy;
  5592. moduleOb.freeze = freeze;
  5593. moduleOb.unfreeze = unfreeze;
  5594. moduleOb.setVolume = setVolume;
  5595. moduleOb.mute = mute;
  5596. moduleOb.unmute = unmute;
  5597. moduleOb.getRegisteredAnimations = getRegisteredAnimations;
  5598. return moduleOb;
  5599. }();
  5600. /* eslint-disable */
  5601. var BezierFactory = function () {
  5602. /**
  5603. * BezierEasing - use bezier curve for transition easing function
  5604. * by Gaëtan Renaudeau 2014 - 2015 – MIT License
  5605. *
  5606. * Credits: is based on Firefox's nsSMILKeySpline.cpp
  5607. * Usage:
  5608. * var spline = BezierEasing([ 0.25, 0.1, 0.25, 1.0 ])
  5609. * spline.get(x) => returns the easing value | x must be in [0, 1] range
  5610. *
  5611. */
  5612. var ob = {};
  5613. ob.getBezierEasing = getBezierEasing;
  5614. var beziers = {};
  5615. function getBezierEasing(a, b, c, d, nm) {
  5616. var str = nm || ('bez_' + a + '_' + b + '_' + c + '_' + d).replace(/\./g, 'p');
  5617. if (beziers[str]) {
  5618. return beziers[str];
  5619. }
  5620. var bezEasing = new BezierEasing([a, b, c, d]);
  5621. beziers[str] = bezEasing;
  5622. return bezEasing;
  5623. } // These values are established by empiricism with tests (tradeoff: performance VS precision)
  5624. var NEWTON_ITERATIONS = 4;
  5625. var NEWTON_MIN_SLOPE = 0.001;
  5626. var SUBDIVISION_PRECISION = 0.0000001;
  5627. var SUBDIVISION_MAX_ITERATIONS = 10;
  5628. var kSplineTableSize = 11;
  5629. var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
  5630. var float32ArraySupported = typeof Float32Array === 'function';
  5631. function A(aA1, aA2) {
  5632. return 1.0 - 3.0 * aA2 + 3.0 * aA1;
  5633. }
  5634. function B(aA1, aA2) {
  5635. return 3.0 * aA2 - 6.0 * aA1;
  5636. }
  5637. function C(aA1) {
  5638. return 3.0 * aA1;
  5639. } // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
  5640. function calcBezier(aT, aA1, aA2) {
  5641. return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;
  5642. } // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
  5643. function getSlope(aT, aA1, aA2) {
  5644. return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);
  5645. }
  5646. function binarySubdivide(aX, aA, aB, mX1, mX2) {
  5647. var currentX,
  5648. currentT,
  5649. i = 0;
  5650. do {
  5651. currentT = aA + (aB - aA) / 2.0;
  5652. currentX = calcBezier(currentT, mX1, mX2) - aX;
  5653. if (currentX > 0.0) {
  5654. aB = currentT;
  5655. } else {
  5656. aA = currentT;
  5657. }
  5658. } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
  5659. return currentT;
  5660. }
  5661. function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {
  5662. for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
  5663. var currentSlope = getSlope(aGuessT, mX1, mX2);
  5664. if (currentSlope === 0.0) return aGuessT;
  5665. var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
  5666. aGuessT -= currentX / currentSlope;
  5667. }
  5668. return aGuessT;
  5669. }
  5670. /**
  5671. * points is an array of [ mX1, mY1, mX2, mY2 ]
  5672. */
  5673. function BezierEasing(points) {
  5674. this._p = points;
  5675. this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
  5676. this._precomputed = false;
  5677. this.get = this.get.bind(this);
  5678. }
  5679. BezierEasing.prototype = {
  5680. get: function get(x) {
  5681. var mX1 = this._p[0],
  5682. mY1 = this._p[1],
  5683. mX2 = this._p[2],
  5684. mY2 = this._p[3];
  5685. if (!this._precomputed) this._precompute();
  5686. if (mX1 === mY1 && mX2 === mY2) return x; // linear
  5687. // Because JavaScript number are imprecise, we should guarantee the extremes are right.
  5688. if (x === 0) return 0;
  5689. if (x === 1) return 1;
  5690. return calcBezier(this._getTForX(x), mY1, mY2);
  5691. },
  5692. // Private part
  5693. _precompute: function _precompute() {
  5694. var mX1 = this._p[0],
  5695. mY1 = this._p[1],
  5696. mX2 = this._p[2],
  5697. mY2 = this._p[3];
  5698. this._precomputed = true;
  5699. if (mX1 !== mY1 || mX2 !== mY2) {
  5700. this._calcSampleValues();
  5701. }
  5702. },
  5703. _calcSampleValues: function _calcSampleValues() {
  5704. var mX1 = this._p[0],
  5705. mX2 = this._p[2];
  5706. for (var i = 0; i < kSplineTableSize; ++i) {
  5707. this._mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
  5708. }
  5709. },
  5710. /**
  5711. * getTForX chose the fastest heuristic to determine the percentage value precisely from a given X projection.
  5712. */
  5713. _getTForX: function _getTForX(aX) {
  5714. var mX1 = this._p[0],
  5715. mX2 = this._p[2],
  5716. mSampleValues = this._mSampleValues;
  5717. var intervalStart = 0.0;
  5718. var currentSample = 1;
  5719. var lastSample = kSplineTableSize - 1;
  5720. for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {
  5721. intervalStart += kSampleStepSize;
  5722. }
  5723. --currentSample; // Interpolate to provide an initial guess for t
  5724. var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]);
  5725. var guessForT = intervalStart + dist * kSampleStepSize;
  5726. var initialSlope = getSlope(guessForT, mX1, mX2);
  5727. if (initialSlope >= NEWTON_MIN_SLOPE) {
  5728. return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
  5729. }
  5730. if (initialSlope === 0.0) {
  5731. return guessForT;
  5732. }
  5733. return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
  5734. }
  5735. };
  5736. return ob;
  5737. }();
  5738. var pooling = function () {
  5739. function _double(arr) {
  5740. return arr.concat(createSizedArray(arr.length));
  5741. }
  5742. return {
  5743. "double": _double
  5744. };
  5745. }();
  5746. var poolFactory = function () {
  5747. return function (initialLength, _create, _release) {
  5748. var _length = 0;
  5749. var _maxLength = initialLength;
  5750. var pool = createSizedArray(_maxLength);
  5751. var ob = {
  5752. newElement: newElement,
  5753. release: release
  5754. };
  5755. function newElement() {
  5756. var element;
  5757. if (_length) {
  5758. _length -= 1;
  5759. element = pool[_length];
  5760. } else {
  5761. element = _create();
  5762. }
  5763. return element;
  5764. }
  5765. function release(element) {
  5766. if (_length === _maxLength) {
  5767. pool = pooling["double"](pool);
  5768. _maxLength *= 2;
  5769. }
  5770. if (_release) {
  5771. _release(element);
  5772. }
  5773. pool[_length] = element;
  5774. _length += 1;
  5775. }
  5776. return ob;
  5777. };
  5778. }();
  5779. var bezierLengthPool = function () {
  5780. function create() {
  5781. return {
  5782. addedLength: 0,
  5783. percents: createTypedArray('float32', getDefaultCurveSegments()),
  5784. lengths: createTypedArray('float32', getDefaultCurveSegments())
  5785. };
  5786. }
  5787. return poolFactory(8, create);
  5788. }();
  5789. var segmentsLengthPool = function () {
  5790. function create() {
  5791. return {
  5792. lengths: [],
  5793. totalLength: 0
  5794. };
  5795. }
  5796. function release(element) {
  5797. var i;
  5798. var len = element.lengths.length;
  5799. for (i = 0; i < len; i += 1) {
  5800. bezierLengthPool.release(element.lengths[i]);
  5801. }
  5802. element.lengths.length = 0;
  5803. }
  5804. return poolFactory(8, create, release);
  5805. }();
  5806. function bezFunction() {
  5807. var math = Math;
  5808. function pointOnLine2D(x1, y1, x2, y2, x3, y3) {
  5809. var det1 = x1 * y2 + y1 * x3 + x2 * y3 - x3 * y2 - y3 * x1 - x2 * y1;
  5810. return det1 > -0.001 && det1 < 0.001;
  5811. }
  5812. function pointOnLine3D(x1, y1, z1, x2, y2, z2, x3, y3, z3) {
  5813. if (z1 === 0 && z2 === 0 && z3 === 0) {
  5814. return pointOnLine2D(x1, y1, x2, y2, x3, y3);
  5815. }
  5816. var dist1 = math.sqrt(math.pow(x2 - x1, 2) + math.pow(y2 - y1, 2) + math.pow(z2 - z1, 2));
  5817. var dist2 = math.sqrt(math.pow(x3 - x1, 2) + math.pow(y3 - y1, 2) + math.pow(z3 - z1, 2));
  5818. var dist3 = math.sqrt(math.pow(x3 - x2, 2) + math.pow(y3 - y2, 2) + math.pow(z3 - z2, 2));
  5819. var diffDist;
  5820. if (dist1 > dist2) {
  5821. if (dist1 > dist3) {
  5822. diffDist = dist1 - dist2 - dist3;
  5823. } else {
  5824. diffDist = dist3 - dist2 - dist1;
  5825. }
  5826. } else if (dist3 > dist2) {
  5827. diffDist = dist3 - dist2 - dist1;
  5828. } else {
  5829. diffDist = dist2 - dist1 - dist3;
  5830. }
  5831. return diffDist > -0.0001 && diffDist < 0.0001;
  5832. }
  5833. var getBezierLength = function () {
  5834. return function (pt1, pt2, pt3, pt4) {
  5835. var curveSegments = getDefaultCurveSegments();
  5836. var k;
  5837. var i;
  5838. var len;
  5839. var ptCoord;
  5840. var perc;
  5841. var addedLength = 0;
  5842. var ptDistance;
  5843. var point = [];
  5844. var lastPoint = [];
  5845. var lengthData = bezierLengthPool.newElement();
  5846. len = pt3.length;
  5847. for (k = 0; k < curveSegments; k += 1) {
  5848. perc = k / (curveSegments - 1);
  5849. ptDistance = 0;
  5850. for (i = 0; i < len; i += 1) {
  5851. ptCoord = bmPow(1 - perc, 3) * pt1[i] + 3 * bmPow(1 - perc, 2) * perc * pt3[i] + 3 * (1 - perc) * bmPow(perc, 2) * pt4[i] + bmPow(perc, 3) * pt2[i];
  5852. point[i] = ptCoord;
  5853. if (lastPoint[i] !== null) {
  5854. ptDistance += bmPow(point[i] - lastPoint[i], 2);
  5855. }
  5856. lastPoint[i] = point[i];
  5857. }
  5858. if (ptDistance) {
  5859. ptDistance = bmSqrt(ptDistance);
  5860. addedLength += ptDistance;
  5861. }
  5862. lengthData.percents[k] = perc;
  5863. lengthData.lengths[k] = addedLength;
  5864. }
  5865. lengthData.addedLength = addedLength;
  5866. return lengthData;
  5867. };
  5868. }();
  5869. function getSegmentsLength(shapeData) {
  5870. var segmentsLength = segmentsLengthPool.newElement();
  5871. var closed = shapeData.c;
  5872. var pathV = shapeData.v;
  5873. var pathO = shapeData.o;
  5874. var pathI = shapeData.i;
  5875. var i;
  5876. var len = shapeData._length;
  5877. var lengths = segmentsLength.lengths;
  5878. var totalLength = 0;
  5879. for (i = 0; i < len - 1; i += 1) {
  5880. lengths[i] = getBezierLength(pathV[i], pathV[i + 1], pathO[i], pathI[i + 1]);
  5881. totalLength += lengths[i].addedLength;
  5882. }
  5883. if (closed && len) {
  5884. lengths[i] = getBezierLength(pathV[i], pathV[0], pathO[i], pathI[0]);
  5885. totalLength += lengths[i].addedLength;
  5886. }
  5887. segmentsLength.totalLength = totalLength;
  5888. return segmentsLength;
  5889. }
  5890. function BezierData(length) {
  5891. this.segmentLength = 0;
  5892. this.points = new Array(length);
  5893. }
  5894. function PointData(partial, point) {
  5895. this.partialLength = partial;
  5896. this.point = point;
  5897. }
  5898. var buildBezierData = function () {
  5899. var storedData = {};
  5900. return function (pt1, pt2, pt3, pt4) {
  5901. var bezierName = (pt1[0] + '_' + pt1[1] + '_' + pt2[0] + '_' + pt2[1] + '_' + pt3[0] + '_' + pt3[1] + '_' + pt4[0] + '_' + pt4[1]).replace(/\./g, 'p');
  5902. if (!storedData[bezierName]) {
  5903. var curveSegments = getDefaultCurveSegments();
  5904. var k;
  5905. var i;
  5906. var len;
  5907. var ptCoord;
  5908. var perc;
  5909. var addedLength = 0;
  5910. var ptDistance;
  5911. var point;
  5912. var lastPoint = null;
  5913. if (pt1.length === 2 && (pt1[0] !== pt2[0] || pt1[1] !== pt2[1]) && pointOnLine2D(pt1[0], pt1[1], pt2[0], pt2[1], pt1[0] + pt3[0], pt1[1] + pt3[1]) && pointOnLine2D(pt1[0], pt1[1], pt2[0], pt2[1], pt2[0] + pt4[0], pt2[1] + pt4[1])) {
  5914. curveSegments = 2;
  5915. }
  5916. var bezierData = new BezierData(curveSegments);
  5917. len = pt3.length;
  5918. for (k = 0; k < curveSegments; k += 1) {
  5919. point = createSizedArray(len);
  5920. perc = k / (curveSegments - 1);
  5921. ptDistance = 0;
  5922. for (i = 0; i < len; i += 1) {
  5923. ptCoord = bmPow(1 - perc, 3) * pt1[i] + 3 * bmPow(1 - perc, 2) * perc * (pt1[i] + pt3[i]) + 3 * (1 - perc) * bmPow(perc, 2) * (pt2[i] + pt4[i]) + bmPow(perc, 3) * pt2[i];
  5924. point[i] = ptCoord;
  5925. if (lastPoint !== null) {
  5926. ptDistance += bmPow(point[i] - lastPoint[i], 2);
  5927. }
  5928. }
  5929. ptDistance = bmSqrt(ptDistance);
  5930. addedLength += ptDistance;
  5931. bezierData.points[k] = new PointData(ptDistance, point);
  5932. lastPoint = point;
  5933. }
  5934. bezierData.segmentLength = addedLength;
  5935. storedData[bezierName] = bezierData;
  5936. }
  5937. return storedData[bezierName];
  5938. };
  5939. }();
  5940. function getDistancePerc(perc, bezierData) {
  5941. var percents = bezierData.percents;
  5942. var lengths = bezierData.lengths;
  5943. var len = percents.length;
  5944. var initPos = bmFloor((len - 1) * perc);
  5945. var lengthPos = perc * bezierData.addedLength;
  5946. var lPerc = 0;
  5947. if (initPos === len - 1 || initPos === 0 || lengthPos === lengths[initPos]) {
  5948. return percents[initPos];
  5949. }
  5950. var dir = lengths[initPos] > lengthPos ? -1 : 1;
  5951. var flag = true;
  5952. while (flag) {
  5953. if (lengths[initPos] <= lengthPos && lengths[initPos + 1] > lengthPos) {
  5954. lPerc = (lengthPos - lengths[initPos]) / (lengths[initPos + 1] - lengths[initPos]);
  5955. flag = false;
  5956. } else {
  5957. initPos += dir;
  5958. }
  5959. if (initPos < 0 || initPos >= len - 1) {
  5960. // FIX for TypedArrays that don't store floating point values with enough accuracy
  5961. if (initPos === len - 1) {
  5962. return percents[initPos];
  5963. }
  5964. flag = false;
  5965. }
  5966. }
  5967. return percents[initPos] + (percents[initPos + 1] - percents[initPos]) * lPerc;
  5968. }
  5969. function getPointInSegment(pt1, pt2, pt3, pt4, percent, bezierData) {
  5970. var t1 = getDistancePerc(percent, bezierData);
  5971. var u1 = 1 - t1;
  5972. var ptX = math.round((u1 * u1 * u1 * pt1[0] + (t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1) * pt3[0] + (t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1) * pt4[0] + t1 * t1 * t1 * pt2[0]) * 1000) / 1000;
  5973. var ptY = math.round((u1 * u1 * u1 * pt1[1] + (t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1) * pt3[1] + (t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1) * pt4[1] + t1 * t1 * t1 * pt2[1]) * 1000) / 1000;
  5974. return [ptX, ptY];
  5975. }
  5976. var bezierSegmentPoints = createTypedArray('float32', 8);
  5977. function getNewSegment(pt1, pt2, pt3, pt4, startPerc, endPerc, bezierData) {
  5978. if (startPerc < 0) {
  5979. startPerc = 0;
  5980. } else if (startPerc > 1) {
  5981. startPerc = 1;
  5982. }
  5983. var t0 = getDistancePerc(startPerc, bezierData);
  5984. endPerc = endPerc > 1 ? 1 : endPerc;
  5985. var t1 = getDistancePerc(endPerc, bezierData);
  5986. var i;
  5987. var len = pt1.length;
  5988. var u0 = 1 - t0;
  5989. var u1 = 1 - t1;
  5990. var u0u0u0 = u0 * u0 * u0;
  5991. var t0u0u0_3 = t0 * u0 * u0 * 3; // eslint-disable-line camelcase
  5992. var t0t0u0_3 = t0 * t0 * u0 * 3; // eslint-disable-line camelcase
  5993. var t0t0t0 = t0 * t0 * t0; //
  5994. var u0u0u1 = u0 * u0 * u1;
  5995. var t0u0u1_3 = t0 * u0 * u1 + u0 * t0 * u1 + u0 * u0 * t1; // eslint-disable-line camelcase
  5996. var t0t0u1_3 = t0 * t0 * u1 + u0 * t0 * t1 + t0 * u0 * t1; // eslint-disable-line camelcase
  5997. var t0t0t1 = t0 * t0 * t1; //
  5998. var u0u1u1 = u0 * u1 * u1;
  5999. var t0u1u1_3 = t0 * u1 * u1 + u0 * t1 * u1 + u0 * u1 * t1; // eslint-disable-line camelcase
  6000. var t0t1u1_3 = t0 * t1 * u1 + u0 * t1 * t1 + t0 * u1 * t1; // eslint-disable-line camelcase
  6001. var t0t1t1 = t0 * t1 * t1; //
  6002. var u1u1u1 = u1 * u1 * u1;
  6003. var t1u1u1_3 = t1 * u1 * u1 + u1 * t1 * u1 + u1 * u1 * t1; // eslint-disable-line camelcase
  6004. var t1t1u1_3 = t1 * t1 * u1 + u1 * t1 * t1 + t1 * u1 * t1; // eslint-disable-line camelcase
  6005. var t1t1t1 = t1 * t1 * t1;
  6006. for (i = 0; i < len; i += 1) {
  6007. bezierSegmentPoints[i * 4] = math.round((u0u0u0 * pt1[i] + t0u0u0_3 * pt3[i] + t0t0u0_3 * pt4[i] + t0t0t0 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase
  6008. bezierSegmentPoints[i * 4 + 1] = math.round((u0u0u1 * pt1[i] + t0u0u1_3 * pt3[i] + t0t0u1_3 * pt4[i] + t0t0t1 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase
  6009. bezierSegmentPoints[i * 4 + 2] = math.round((u0u1u1 * pt1[i] + t0u1u1_3 * pt3[i] + t0t1u1_3 * pt4[i] + t0t1t1 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase
  6010. bezierSegmentPoints[i * 4 + 3] = math.round((u1u1u1 * pt1[i] + t1u1u1_3 * pt3[i] + t1t1u1_3 * pt4[i] + t1t1t1 * pt2[i]) * 1000) / 1000; // eslint-disable-line camelcase
  6011. }
  6012. return bezierSegmentPoints;
  6013. }
  6014. return {
  6015. getSegmentsLength: getSegmentsLength,
  6016. getNewSegment: getNewSegment,
  6017. getPointInSegment: getPointInSegment,
  6018. buildBezierData: buildBezierData,
  6019. pointOnLine2D: pointOnLine2D,
  6020. pointOnLine3D: pointOnLine3D
  6021. };
  6022. }
  6023. var bez = bezFunction();
  6024. var initFrame = initialDefaultFrame;
  6025. var mathAbs = Math.abs;
  6026. function interpolateValue(frameNum, caching) {
  6027. var offsetTime = this.offsetTime;
  6028. var newValue;
  6029. if (this.propType === 'multidimensional') {
  6030. newValue = createTypedArray('float32', this.pv.length);
  6031. }
  6032. var iterationIndex = caching.lastIndex;
  6033. var i = iterationIndex;
  6034. var len = this.keyframes.length - 1;
  6035. var flag = true;
  6036. var keyData;
  6037. var nextKeyData;
  6038. var keyframeMetadata;
  6039. while (flag) {
  6040. keyData = this.keyframes[i];
  6041. nextKeyData = this.keyframes[i + 1];
  6042. if (i === len - 1 && frameNum >= nextKeyData.t - offsetTime) {
  6043. if (keyData.h) {
  6044. keyData = nextKeyData;
  6045. }
  6046. iterationIndex = 0;
  6047. break;
  6048. }
  6049. if (nextKeyData.t - offsetTime > frameNum) {
  6050. iterationIndex = i;
  6051. break;
  6052. }
  6053. if (i < len - 1) {
  6054. i += 1;
  6055. } else {
  6056. iterationIndex = 0;
  6057. flag = false;
  6058. }
  6059. }
  6060. keyframeMetadata = this.keyframesMetadata[i] || {};
  6061. var k;
  6062. var kLen;
  6063. var perc;
  6064. var jLen;
  6065. var j;
  6066. var fnc;
  6067. var nextKeyTime = nextKeyData.t - offsetTime;
  6068. var keyTime = keyData.t - offsetTime;
  6069. var endValue;
  6070. if (keyData.to) {
  6071. if (!keyframeMetadata.bezierData) {
  6072. keyframeMetadata.bezierData = bez.buildBezierData(keyData.s, nextKeyData.s || keyData.e, keyData.to, keyData.ti);
  6073. }
  6074. var bezierData = keyframeMetadata.bezierData;
  6075. if (frameNum >= nextKeyTime || frameNum < keyTime) {
  6076. var ind = frameNum >= nextKeyTime ? bezierData.points.length - 1 : 0;
  6077. kLen = bezierData.points[ind].point.length;
  6078. for (k = 0; k < kLen; k += 1) {
  6079. newValue[k] = bezierData.points[ind].point[k];
  6080. } // caching._lastKeyframeIndex = -1;
  6081. } else {
  6082. if (keyframeMetadata.__fnct) {
  6083. fnc = keyframeMetadata.__fnct;
  6084. } else {
  6085. fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y, keyData.n).get;
  6086. keyframeMetadata.__fnct = fnc;
  6087. }
  6088. perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
  6089. var distanceInLine = bezierData.segmentLength * perc;
  6090. var segmentPerc;
  6091. var addedLength = caching.lastFrame < frameNum && caching._lastKeyframeIndex === i ? caching._lastAddedLength : 0;
  6092. j = caching.lastFrame < frameNum && caching._lastKeyframeIndex === i ? caching._lastPoint : 0;
  6093. flag = true;
  6094. jLen = bezierData.points.length;
  6095. while (flag) {
  6096. addedLength += bezierData.points[j].partialLength;
  6097. if (distanceInLine === 0 || perc === 0 || j === bezierData.points.length - 1) {
  6098. kLen = bezierData.points[j].point.length;
  6099. for (k = 0; k < kLen; k += 1) {
  6100. newValue[k] = bezierData.points[j].point[k];
  6101. }
  6102. break;
  6103. } else if (distanceInLine >= addedLength && distanceInLine < addedLength + bezierData.points[j + 1].partialLength) {
  6104. segmentPerc = (distanceInLine - addedLength) / bezierData.points[j + 1].partialLength;
  6105. kLen = bezierData.points[j].point.length;
  6106. for (k = 0; k < kLen; k += 1) {
  6107. newValue[k] = bezierData.points[j].point[k] + (bezierData.points[j + 1].point[k] - bezierData.points[j].point[k]) * segmentPerc;
  6108. }
  6109. break;
  6110. }
  6111. if (j < jLen - 1) {
  6112. j += 1;
  6113. } else {
  6114. flag = false;
  6115. }
  6116. }
  6117. caching._lastPoint = j;
  6118. caching._lastAddedLength = addedLength - bezierData.points[j].partialLength;
  6119. caching._lastKeyframeIndex = i;
  6120. }
  6121. } else {
  6122. var outX;
  6123. var outY;
  6124. var inX;
  6125. var inY;
  6126. var keyValue;
  6127. len = keyData.s.length;
  6128. endValue = nextKeyData.s || keyData.e;
  6129. if (this.sh && keyData.h !== 1) {
  6130. if (frameNum >= nextKeyTime) {
  6131. newValue[0] = endValue[0];
  6132. newValue[1] = endValue[1];
  6133. newValue[2] = endValue[2];
  6134. } else if (frameNum <= keyTime) {
  6135. newValue[0] = keyData.s[0];
  6136. newValue[1] = keyData.s[1];
  6137. newValue[2] = keyData.s[2];
  6138. } else {
  6139. var quatStart = createQuaternion(keyData.s);
  6140. var quatEnd = createQuaternion(endValue);
  6141. var time = (frameNum - keyTime) / (nextKeyTime - keyTime);
  6142. quaternionToEuler(newValue, slerp(quatStart, quatEnd, time));
  6143. }
  6144. } else {
  6145. for (i = 0; i < len; i += 1) {
  6146. if (keyData.h !== 1) {
  6147. if (frameNum >= nextKeyTime) {
  6148. perc = 1;
  6149. } else if (frameNum < keyTime) {
  6150. perc = 0;
  6151. } else {
  6152. if (keyData.o.x.constructor === Array) {
  6153. if (!keyframeMetadata.__fnct) {
  6154. keyframeMetadata.__fnct = [];
  6155. }
  6156. if (!keyframeMetadata.__fnct[i]) {
  6157. outX = keyData.o.x[i] === undefined ? keyData.o.x[0] : keyData.o.x[i];
  6158. outY = keyData.o.y[i] === undefined ? keyData.o.y[0] : keyData.o.y[i];
  6159. inX = keyData.i.x[i] === undefined ? keyData.i.x[0] : keyData.i.x[i];
  6160. inY = keyData.i.y[i] === undefined ? keyData.i.y[0] : keyData.i.y[i];
  6161. fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
  6162. keyframeMetadata.__fnct[i] = fnc;
  6163. } else {
  6164. fnc = keyframeMetadata.__fnct[i];
  6165. }
  6166. } else if (!keyframeMetadata.__fnct) {
  6167. outX = keyData.o.x;
  6168. outY = keyData.o.y;
  6169. inX = keyData.i.x;
  6170. inY = keyData.i.y;
  6171. fnc = BezierFactory.getBezierEasing(outX, outY, inX, inY).get;
  6172. keyData.keyframeMetadata = fnc;
  6173. } else {
  6174. fnc = keyframeMetadata.__fnct;
  6175. }
  6176. perc = fnc((frameNum - keyTime) / (nextKeyTime - keyTime));
  6177. }
  6178. }
  6179. endValue = nextKeyData.s || keyData.e;
  6180. keyValue = keyData.h === 1 ? keyData.s[i] : keyData.s[i] + (endValue[i] - keyData.s[i]) * perc;
  6181. if (this.propType === 'multidimensional') {
  6182. newValue[i] = keyValue;
  6183. } else {
  6184. newValue = keyValue;
  6185. }
  6186. }
  6187. }
  6188. }
  6189. caching.lastIndex = iterationIndex;
  6190. return newValue;
  6191. } // based on @Toji's https://github.com/toji/gl-matrix/
  6192. function slerp(a, b, t) {
  6193. var out = [];
  6194. var ax = a[0];
  6195. var ay = a[1];
  6196. var az = a[2];
  6197. var aw = a[3];
  6198. var bx = b[0];
  6199. var by = b[1];
  6200. var bz = b[2];
  6201. var bw = b[3];
  6202. var omega;
  6203. var cosom;
  6204. var sinom;
  6205. var scale0;
  6206. var scale1;
  6207. cosom = ax * bx + ay * by + az * bz + aw * bw;
  6208. if (cosom < 0.0) {
  6209. cosom = -cosom;
  6210. bx = -bx;
  6211. by = -by;
  6212. bz = -bz;
  6213. bw = -bw;
  6214. }
  6215. if (1.0 - cosom > 0.000001) {
  6216. omega = Math.acos(cosom);
  6217. sinom = Math.sin(omega);
  6218. scale0 = Math.sin((1.0 - t) * omega) / sinom;
  6219. scale1 = Math.sin(t * omega) / sinom;
  6220. } else {
  6221. scale0 = 1.0 - t;
  6222. scale1 = t;
  6223. }
  6224. out[0] = scale0 * ax + scale1 * bx;
  6225. out[1] = scale0 * ay + scale1 * by;
  6226. out[2] = scale0 * az + scale1 * bz;
  6227. out[3] = scale0 * aw + scale1 * bw;
  6228. return out;
  6229. }
  6230. function quaternionToEuler(out, quat) {
  6231. var qx = quat[0];
  6232. var qy = quat[1];
  6233. var qz = quat[2];
  6234. var qw = quat[3];
  6235. var heading = Math.atan2(2 * qy * qw - 2 * qx * qz, 1 - 2 * qy * qy - 2 * qz * qz);
  6236. var attitude = Math.asin(2 * qx * qy + 2 * qz * qw);
  6237. var bank = Math.atan2(2 * qx * qw - 2 * qy * qz, 1 - 2 * qx * qx - 2 * qz * qz);
  6238. out[0] = heading / degToRads;
  6239. out[1] = attitude / degToRads;
  6240. out[2] = bank / degToRads;
  6241. }
  6242. function createQuaternion(values) {
  6243. var heading = values[0] * degToRads;
  6244. var attitude = values[1] * degToRads;
  6245. var bank = values[2] * degToRads;
  6246. var c1 = Math.cos(heading / 2);
  6247. var c2 = Math.cos(attitude / 2);
  6248. var c3 = Math.cos(bank / 2);
  6249. var s1 = Math.sin(heading / 2);
  6250. var s2 = Math.sin(attitude / 2);
  6251. var s3 = Math.sin(bank / 2);
  6252. var w = c1 * c2 * c3 - s1 * s2 * s3;
  6253. var x = s1 * s2 * c3 + c1 * c2 * s3;
  6254. var y = s1 * c2 * c3 + c1 * s2 * s3;
  6255. var z = c1 * s2 * c3 - s1 * c2 * s3;
  6256. return [x, y, z, w];
  6257. }
  6258. function getValueAtCurrentTime() {
  6259. var frameNum = this.comp.renderedFrame - this.offsetTime;
  6260. var initTime = this.keyframes[0].t - this.offsetTime;
  6261. var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
  6262. if (!(frameNum === this._caching.lastFrame || this._caching.lastFrame !== initFrame && (this._caching.lastFrame >= endTime && frameNum >= endTime || this._caching.lastFrame < initTime && frameNum < initTime))) {
  6263. if (this._caching.lastFrame >= frameNum) {
  6264. this._caching._lastKeyframeIndex = -1;
  6265. this._caching.lastIndex = 0;
  6266. }
  6267. var renderResult = this.interpolateValue(frameNum, this._caching);
  6268. this.pv = renderResult;
  6269. }
  6270. this._caching.lastFrame = frameNum;
  6271. return this.pv;
  6272. }
  6273. function setVValue(val) {
  6274. var multipliedValue;
  6275. if (this.propType === 'unidimensional') {
  6276. multipliedValue = val * this.mult;
  6277. if (mathAbs(this.v - multipliedValue) > 0.00001) {
  6278. this.v = multipliedValue;
  6279. this._mdf = true;
  6280. }
  6281. } else {
  6282. var i = 0;
  6283. var len = this.v.length;
  6284. while (i < len) {
  6285. multipliedValue = val[i] * this.mult;
  6286. if (mathAbs(this.v[i] - multipliedValue) > 0.00001) {
  6287. this.v[i] = multipliedValue;
  6288. this._mdf = true;
  6289. }
  6290. i += 1;
  6291. }
  6292. }
  6293. }
  6294. function processEffectsSequence() {
  6295. if (this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) {
  6296. return;
  6297. }
  6298. if (this.lock) {
  6299. this.setVValue(this.pv);
  6300. return;
  6301. }
  6302. this.lock = true;
  6303. this._mdf = this._isFirstFrame;
  6304. var i;
  6305. var len = this.effectsSequence.length;
  6306. var finalValue = this.kf ? this.pv : this.data.k;
  6307. for (i = 0; i < len; i += 1) {
  6308. finalValue = this.effectsSequence[i](finalValue);
  6309. }
  6310. this.setVValue(finalValue);
  6311. this._isFirstFrame = false;
  6312. this.lock = false;
  6313. this.frameId = this.elem.globalData.frameId;
  6314. }
  6315. function addEffect(effectFunction) {
  6316. this.effectsSequence.push(effectFunction);
  6317. this.container.addDynamicProperty(this);
  6318. }
  6319. function ValueProperty(elem, data, mult, container) {
  6320. this.propType = 'unidimensional';
  6321. this.mult = mult || 1;
  6322. this.data = data;
  6323. this.v = mult ? data.k * mult : data.k;
  6324. this.pv = data.k;
  6325. this._mdf = false;
  6326. this.elem = elem;
  6327. this.container = container;
  6328. this.comp = elem.comp;
  6329. this.k = false;
  6330. this.kf = false;
  6331. this.vel = 0;
  6332. this.effectsSequence = [];
  6333. this._isFirstFrame = true;
  6334. this.getValue = processEffectsSequence;
  6335. this.setVValue = setVValue;
  6336. this.addEffect = addEffect;
  6337. }
  6338. function MultiDimensionalProperty(elem, data, mult, container) {
  6339. this.propType = 'multidimensional';
  6340. this.mult = mult || 1;
  6341. this.data = data;
  6342. this._mdf = false;
  6343. this.elem = elem;
  6344. this.container = container;
  6345. this.comp = elem.comp;
  6346. this.k = false;
  6347. this.kf = false;
  6348. this.frameId = -1;
  6349. var i;
  6350. var len = data.k.length;
  6351. this.v = createTypedArray('float32', len);
  6352. this.pv = createTypedArray('float32', len);
  6353. this.vel = createTypedArray('float32', len);
  6354. for (i = 0; i < len; i += 1) {
  6355. this.v[i] = data.k[i] * this.mult;
  6356. this.pv[i] = data.k[i];
  6357. }
  6358. this._isFirstFrame = true;
  6359. this.effectsSequence = [];
  6360. this.getValue = processEffectsSequence;
  6361. this.setVValue = setVValue;
  6362. this.addEffect = addEffect;
  6363. }
  6364. function KeyframedValueProperty(elem, data, mult, container) {
  6365. this.propType = 'unidimensional';
  6366. this.keyframes = data.k;
  6367. this.keyframesMetadata = [];
  6368. this.offsetTime = elem.data.st;
  6369. this.frameId = -1;
  6370. this._caching = {
  6371. lastFrame: initFrame,
  6372. lastIndex: 0,
  6373. value: 0,
  6374. _lastKeyframeIndex: -1
  6375. };
  6376. this.k = true;
  6377. this.kf = true;
  6378. this.data = data;
  6379. this.mult = mult || 1;
  6380. this.elem = elem;
  6381. this.container = container;
  6382. this.comp = elem.comp;
  6383. this.v = initFrame;
  6384. this.pv = initFrame;
  6385. this._isFirstFrame = true;
  6386. this.getValue = processEffectsSequence;
  6387. this.setVValue = setVValue;
  6388. this.interpolateValue = interpolateValue;
  6389. this.effectsSequence = [getValueAtCurrentTime.bind(this)];
  6390. this.addEffect = addEffect;
  6391. }
  6392. function KeyframedMultidimensionalProperty(elem, data, mult, container) {
  6393. this.propType = 'multidimensional';
  6394. var i;
  6395. var len = data.k.length;
  6396. var s;
  6397. var e;
  6398. var to;
  6399. var ti;
  6400. for (i = 0; i < len - 1; i += 1) {
  6401. if (data.k[i].to && data.k[i].s && data.k[i + 1] && data.k[i + 1].s) {
  6402. s = data.k[i].s;
  6403. e = data.k[i + 1].s;
  6404. to = data.k[i].to;
  6405. ti = data.k[i].ti;
  6406. if (s.length === 2 && !(s[0] === e[0] && s[1] === e[1]) && bez.pointOnLine2D(s[0], s[1], e[0], e[1], s[0] + to[0], s[1] + to[1]) && bez.pointOnLine2D(s[0], s[1], e[0], e[1], e[0] + ti[0], e[1] + ti[1]) || s.length === 3 && !(s[0] === e[0] && s[1] === e[1] && s[2] === e[2]) && bez.pointOnLine3D(s[0], s[1], s[2], e[0], e[1], e[2], s[0] + to[0], s[1] + to[1], s[2] + to[2]) && bez.pointOnLine3D(s[0], s[1], s[2], e[0], e[1], e[2], e[0] + ti[0], e[1] + ti[1], e[2] + ti[2])) {
  6407. data.k[i].to = null;
  6408. data.k[i].ti = null;
  6409. }
  6410. if (s[0] === e[0] && s[1] === e[1] && to[0] === 0 && to[1] === 0 && ti[0] === 0 && ti[1] === 0) {
  6411. if (s.length === 2 || s[2] === e[2] && to[2] === 0 && ti[2] === 0) {
  6412. data.k[i].to = null;
  6413. data.k[i].ti = null;
  6414. }
  6415. }
  6416. }
  6417. }
  6418. this.effectsSequence = [getValueAtCurrentTime.bind(this)];
  6419. this.data = data;
  6420. this.keyframes = data.k;
  6421. this.keyframesMetadata = [];
  6422. this.offsetTime = elem.data.st;
  6423. this.k = true;
  6424. this.kf = true;
  6425. this._isFirstFrame = true;
  6426. this.mult = mult || 1;
  6427. this.elem = elem;
  6428. this.container = container;
  6429. this.comp = elem.comp;
  6430. this.getValue = processEffectsSequence;
  6431. this.setVValue = setVValue;
  6432. this.interpolateValue = interpolateValue;
  6433. this.frameId = -1;
  6434. var arrLen = data.k[0].s.length;
  6435. this.v = createTypedArray('float32', arrLen);
  6436. this.pv = createTypedArray('float32', arrLen);
  6437. for (i = 0; i < arrLen; i += 1) {
  6438. this.v[i] = initFrame;
  6439. this.pv[i] = initFrame;
  6440. }
  6441. this._caching = {
  6442. lastFrame: initFrame,
  6443. lastIndex: 0,
  6444. value: createTypedArray('float32', arrLen)
  6445. };
  6446. this.addEffect = addEffect;
  6447. }
  6448. var PropertyFactory = function () {
  6449. function getProp(elem, data, type, mult, container) {
  6450. if (data.sid) {
  6451. data = elem.globalData.slotManager.getProp(data);
  6452. }
  6453. var p;
  6454. if (!data.k.length) {
  6455. p = new ValueProperty(elem, data, mult, container);
  6456. } else if (typeof data.k[0] === 'number') {
  6457. p = new MultiDimensionalProperty(elem, data, mult, container);
  6458. } else {
  6459. switch (type) {
  6460. case 0:
  6461. p = new KeyframedValueProperty(elem, data, mult, container);
  6462. break;
  6463. case 1:
  6464. p = new KeyframedMultidimensionalProperty(elem, data, mult, container);
  6465. break;
  6466. default:
  6467. break;
  6468. }
  6469. }
  6470. if (p.effectsSequence.length) {
  6471. container.addDynamicProperty(p);
  6472. }
  6473. return p;
  6474. }
  6475. var ob = {
  6476. getProp: getProp
  6477. };
  6478. return ob;
  6479. }();
  6480. function DynamicPropertyContainer() {}
  6481. DynamicPropertyContainer.prototype = {
  6482. addDynamicProperty: function addDynamicProperty(prop) {
  6483. if (this.dynamicProperties.indexOf(prop) === -1) {
  6484. this.dynamicProperties.push(prop);
  6485. this.container.addDynamicProperty(this);
  6486. this._isAnimated = true;
  6487. }
  6488. },
  6489. iterateDynamicProperties: function iterateDynamicProperties() {
  6490. this._mdf = false;
  6491. var i;
  6492. var len = this.dynamicProperties.length;
  6493. for (i = 0; i < len; i += 1) {
  6494. this.dynamicProperties[i].getValue();
  6495. if (this.dynamicProperties[i]._mdf) {
  6496. this._mdf = true;
  6497. }
  6498. }
  6499. },
  6500. initDynamicPropertyContainer: function initDynamicPropertyContainer(container) {
  6501. this.container = container;
  6502. this.dynamicProperties = [];
  6503. this._mdf = false;
  6504. this._isAnimated = false;
  6505. }
  6506. };
  6507. var pointPool = function () {
  6508. function create() {
  6509. return createTypedArray('float32', 2);
  6510. }
  6511. return poolFactory(8, create);
  6512. }();
  6513. function ShapePath() {
  6514. this.c = false;
  6515. this._length = 0;
  6516. this._maxLength = 8;
  6517. this.v = createSizedArray(this._maxLength);
  6518. this.o = createSizedArray(this._maxLength);
  6519. this.i = createSizedArray(this._maxLength);
  6520. }
  6521. ShapePath.prototype.setPathData = function (closed, len) {
  6522. this.c = closed;
  6523. this.setLength(len);
  6524. var i = 0;
  6525. while (i < len) {
  6526. this.v[i] = pointPool.newElement();
  6527. this.o[i] = pointPool.newElement();
  6528. this.i[i] = pointPool.newElement();
  6529. i += 1;
  6530. }
  6531. };
  6532. ShapePath.prototype.setLength = function (len) {
  6533. while (this._maxLength < len) {
  6534. this.doubleArrayLength();
  6535. }
  6536. this._length = len;
  6537. };
  6538. ShapePath.prototype.doubleArrayLength = function () {
  6539. this.v = this.v.concat(createSizedArray(this._maxLength));
  6540. this.i = this.i.concat(createSizedArray(this._maxLength));
  6541. this.o = this.o.concat(createSizedArray(this._maxLength));
  6542. this._maxLength *= 2;
  6543. };
  6544. ShapePath.prototype.setXYAt = function (x, y, type, pos, replace) {
  6545. var arr;
  6546. this._length = Math.max(this._length, pos + 1);
  6547. if (this._length >= this._maxLength) {
  6548. this.doubleArrayLength();
  6549. }
  6550. switch (type) {
  6551. case 'v':
  6552. arr = this.v;
  6553. break;
  6554. case 'i':
  6555. arr = this.i;
  6556. break;
  6557. case 'o':
  6558. arr = this.o;
  6559. break;
  6560. default:
  6561. arr = [];
  6562. break;
  6563. }
  6564. if (!arr[pos] || arr[pos] && !replace) {
  6565. arr[pos] = pointPool.newElement();
  6566. }
  6567. arr[pos][0] = x;
  6568. arr[pos][1] = y;
  6569. };
  6570. ShapePath.prototype.setTripleAt = function (vX, vY, oX, oY, iX, iY, pos, replace) {
  6571. this.setXYAt(vX, vY, 'v', pos, replace);
  6572. this.setXYAt(oX, oY, 'o', pos, replace);
  6573. this.setXYAt(iX, iY, 'i', pos, replace);
  6574. };
  6575. ShapePath.prototype.reverse = function () {
  6576. var newPath = new ShapePath();
  6577. newPath.setPathData(this.c, this._length);
  6578. var vertices = this.v;
  6579. var outPoints = this.o;
  6580. var inPoints = this.i;
  6581. var init = 0;
  6582. if (this.c) {
  6583. newPath.setTripleAt(vertices[0][0], vertices[0][1], inPoints[0][0], inPoints[0][1], outPoints[0][0], outPoints[0][1], 0, false);
  6584. init = 1;
  6585. }
  6586. var cnt = this._length - 1;
  6587. var len = this._length;
  6588. var i;
  6589. for (i = init; i < len; i += 1) {
  6590. newPath.setTripleAt(vertices[cnt][0], vertices[cnt][1], inPoints[cnt][0], inPoints[cnt][1], outPoints[cnt][0], outPoints[cnt][1], i, false);
  6591. cnt -= 1;
  6592. }
  6593. return newPath;
  6594. };
  6595. ShapePath.prototype.length = function () {
  6596. return this._length;
  6597. };
  6598. var shapePool = function () {
  6599. function create() {
  6600. return new ShapePath();
  6601. }
  6602. function release(shapePath) {
  6603. var len = shapePath._length;
  6604. var i;
  6605. for (i = 0; i < len; i += 1) {
  6606. pointPool.release(shapePath.v[i]);
  6607. pointPool.release(shapePath.i[i]);
  6608. pointPool.release(shapePath.o[i]);
  6609. shapePath.v[i] = null;
  6610. shapePath.i[i] = null;
  6611. shapePath.o[i] = null;
  6612. }
  6613. shapePath._length = 0;
  6614. shapePath.c = false;
  6615. }
  6616. function clone(shape) {
  6617. var cloned = factory.newElement();
  6618. var i;
  6619. var len = shape._length === undefined ? shape.v.length : shape._length;
  6620. cloned.setLength(len);
  6621. cloned.c = shape.c;
  6622. for (i = 0; i < len; i += 1) {
  6623. cloned.setTripleAt(shape.v[i][0], shape.v[i][1], shape.o[i][0], shape.o[i][1], shape.i[i][0], shape.i[i][1], i);
  6624. }
  6625. return cloned;
  6626. }
  6627. var factory = poolFactory(4, create, release);
  6628. factory.clone = clone;
  6629. return factory;
  6630. }();
  6631. function ShapeCollection() {
  6632. this._length = 0;
  6633. this._maxLength = 4;
  6634. this.shapes = createSizedArray(this._maxLength);
  6635. }
  6636. ShapeCollection.prototype.addShape = function (shapeData) {
  6637. if (this._length === this._maxLength) {
  6638. this.shapes = this.shapes.concat(createSizedArray(this._maxLength));
  6639. this._maxLength *= 2;
  6640. }
  6641. this.shapes[this._length] = shapeData;
  6642. this._length += 1;
  6643. };
  6644. ShapeCollection.prototype.releaseShapes = function () {
  6645. var i;
  6646. for (i = 0; i < this._length; i += 1) {
  6647. shapePool.release(this.shapes[i]);
  6648. }
  6649. this._length = 0;
  6650. };
  6651. var shapeCollectionPool = function () {
  6652. var ob = {
  6653. newShapeCollection: newShapeCollection,
  6654. release: release
  6655. };
  6656. var _length = 0;
  6657. var _maxLength = 4;
  6658. var pool = createSizedArray(_maxLength);
  6659. function newShapeCollection() {
  6660. var shapeCollection;
  6661. if (_length) {
  6662. _length -= 1;
  6663. shapeCollection = pool[_length];
  6664. } else {
  6665. shapeCollection = new ShapeCollection();
  6666. }
  6667. return shapeCollection;
  6668. }
  6669. function release(shapeCollection) {
  6670. var i;
  6671. var len = shapeCollection._length;
  6672. for (i = 0; i < len; i += 1) {
  6673. shapePool.release(shapeCollection.shapes[i]);
  6674. }
  6675. shapeCollection._length = 0;
  6676. if (_length === _maxLength) {
  6677. pool = pooling["double"](pool);
  6678. _maxLength *= 2;
  6679. }
  6680. pool[_length] = shapeCollection;
  6681. _length += 1;
  6682. }
  6683. return ob;
  6684. }();
  6685. var ShapePropertyFactory = function () {
  6686. var initFrame = -999999;
  6687. function interpolateShape(frameNum, previousValue, caching) {
  6688. var iterationIndex = caching.lastIndex;
  6689. var keyPropS;
  6690. var keyPropE;
  6691. var isHold;
  6692. var j;
  6693. var k;
  6694. var jLen;
  6695. var kLen;
  6696. var perc;
  6697. var vertexValue;
  6698. var kf = this.keyframes;
  6699. if (frameNum < kf[0].t - this.offsetTime) {
  6700. keyPropS = kf[0].s[0];
  6701. isHold = true;
  6702. iterationIndex = 0;
  6703. } else if (frameNum >= kf[kf.length - 1].t - this.offsetTime) {
  6704. keyPropS = kf[kf.length - 1].s ? kf[kf.length - 1].s[0] : kf[kf.length - 2].e[0];
  6705. /* if(kf[kf.length - 1].s){
  6706. keyPropS = kf[kf.length - 1].s[0];
  6707. }else{
  6708. keyPropS = kf[kf.length - 2].e[0];
  6709. } */
  6710. isHold = true;
  6711. } else {
  6712. var i = iterationIndex;
  6713. var len = kf.length - 1;
  6714. var flag = true;
  6715. var keyData;
  6716. var nextKeyData;
  6717. var keyframeMetadata;
  6718. while (flag) {
  6719. keyData = kf[i];
  6720. nextKeyData = kf[i + 1];
  6721. if (nextKeyData.t - this.offsetTime > frameNum) {
  6722. break;
  6723. }
  6724. if (i < len - 1) {
  6725. i += 1;
  6726. } else {
  6727. flag = false;
  6728. }
  6729. }
  6730. keyframeMetadata = this.keyframesMetadata[i] || {};
  6731. isHold = keyData.h === 1;
  6732. iterationIndex = i;
  6733. if (!isHold) {
  6734. if (frameNum >= nextKeyData.t - this.offsetTime) {
  6735. perc = 1;
  6736. } else if (frameNum < keyData.t - this.offsetTime) {
  6737. perc = 0;
  6738. } else {
  6739. var fnc;
  6740. if (keyframeMetadata.__fnct) {
  6741. fnc = keyframeMetadata.__fnct;
  6742. } else {
  6743. fnc = BezierFactory.getBezierEasing(keyData.o.x, keyData.o.y, keyData.i.x, keyData.i.y).get;
  6744. keyframeMetadata.__fnct = fnc;
  6745. }
  6746. perc = fnc((frameNum - (keyData.t - this.offsetTime)) / (nextKeyData.t - this.offsetTime - (keyData.t - this.offsetTime)));
  6747. }
  6748. keyPropE = nextKeyData.s ? nextKeyData.s[0] : keyData.e[0];
  6749. }
  6750. keyPropS = keyData.s[0];
  6751. }
  6752. jLen = previousValue._length;
  6753. kLen = keyPropS.i[0].length;
  6754. caching.lastIndex = iterationIndex;
  6755. for (j = 0; j < jLen; j += 1) {
  6756. for (k = 0; k < kLen; k += 1) {
  6757. vertexValue = isHold ? keyPropS.i[j][k] : keyPropS.i[j][k] + (keyPropE.i[j][k] - keyPropS.i[j][k]) * perc;
  6758. previousValue.i[j][k] = vertexValue;
  6759. vertexValue = isHold ? keyPropS.o[j][k] : keyPropS.o[j][k] + (keyPropE.o[j][k] - keyPropS.o[j][k]) * perc;
  6760. previousValue.o[j][k] = vertexValue;
  6761. vertexValue = isHold ? keyPropS.v[j][k] : keyPropS.v[j][k] + (keyPropE.v[j][k] - keyPropS.v[j][k]) * perc;
  6762. previousValue.v[j][k] = vertexValue;
  6763. }
  6764. }
  6765. }
  6766. function interpolateShapeCurrentTime() {
  6767. var frameNum = this.comp.renderedFrame - this.offsetTime;
  6768. var initTime = this.keyframes[0].t - this.offsetTime;
  6769. var endTime = this.keyframes[this.keyframes.length - 1].t - this.offsetTime;
  6770. var lastFrame = this._caching.lastFrame;
  6771. if (!(lastFrame !== initFrame && (lastFrame < initTime && frameNum < initTime || lastFrame > endTime && frameNum > endTime))) {
  6772. /// /
  6773. this._caching.lastIndex = lastFrame < frameNum ? this._caching.lastIndex : 0;
  6774. this.interpolateShape(frameNum, this.pv, this._caching); /// /
  6775. }
  6776. this._caching.lastFrame = frameNum;
  6777. return this.pv;
  6778. }
  6779. function resetShape() {
  6780. this.paths = this.localShapeCollection;
  6781. }
  6782. function shapesEqual(shape1, shape2) {
  6783. if (shape1._length !== shape2._length || shape1.c !== shape2.c) {
  6784. return false;
  6785. }
  6786. var i;
  6787. var len = shape1._length;
  6788. for (i = 0; i < len; i += 1) {
  6789. if (shape1.v[i][0] !== shape2.v[i][0] || shape1.v[i][1] !== shape2.v[i][1] || shape1.o[i][0] !== shape2.o[i][0] || shape1.o[i][1] !== shape2.o[i][1] || shape1.i[i][0] !== shape2.i[i][0] || shape1.i[i][1] !== shape2.i[i][1]) {
  6790. return false;
  6791. }
  6792. }
  6793. return true;
  6794. }
  6795. function setVValue(newPath) {
  6796. if (!shapesEqual(this.v, newPath)) {
  6797. this.v = shapePool.clone(newPath);
  6798. this.localShapeCollection.releaseShapes();
  6799. this.localShapeCollection.addShape(this.v);
  6800. this._mdf = true;
  6801. this.paths = this.localShapeCollection;
  6802. }
  6803. }
  6804. function processEffectsSequence() {
  6805. if (this.elem.globalData.frameId === this.frameId) {
  6806. return;
  6807. }
  6808. if (!this.effectsSequence.length) {
  6809. this._mdf = false;
  6810. return;
  6811. }
  6812. if (this.lock) {
  6813. this.setVValue(this.pv);
  6814. return;
  6815. }
  6816. this.lock = true;
  6817. this._mdf = false;
  6818. var finalValue;
  6819. if (this.kf) {
  6820. finalValue = this.pv;
  6821. } else if (this.data.ks) {
  6822. finalValue = this.data.ks.k;
  6823. } else {
  6824. finalValue = this.data.pt.k;
  6825. }
  6826. var i;
  6827. var len = this.effectsSequence.length;
  6828. for (i = 0; i < len; i += 1) {
  6829. finalValue = this.effectsSequence[i](finalValue);
  6830. }
  6831. this.setVValue(finalValue);
  6832. this.lock = false;
  6833. this.frameId = this.elem.globalData.frameId;
  6834. }
  6835. function ShapeProperty(elem, data, type) {
  6836. this.propType = 'shape';
  6837. this.comp = elem.comp;
  6838. this.container = elem;
  6839. this.elem = elem;
  6840. this.data = data;
  6841. this.k = false;
  6842. this.kf = false;
  6843. this._mdf = false;
  6844. var pathData = type === 3 ? data.pt.k : data.ks.k;
  6845. this.v = shapePool.clone(pathData);
  6846. this.pv = shapePool.clone(this.v);
  6847. this.localShapeCollection = shapeCollectionPool.newShapeCollection();
  6848. this.paths = this.localShapeCollection;
  6849. this.paths.addShape(this.v);
  6850. this.reset = resetShape;
  6851. this.effectsSequence = [];
  6852. }
  6853. function addEffect(effectFunction) {
  6854. this.effectsSequence.push(effectFunction);
  6855. this.container.addDynamicProperty(this);
  6856. }
  6857. ShapeProperty.prototype.interpolateShape = interpolateShape;
  6858. ShapeProperty.prototype.getValue = processEffectsSequence;
  6859. ShapeProperty.prototype.setVValue = setVValue;
  6860. ShapeProperty.prototype.addEffect = addEffect;
  6861. function KeyframedShapeProperty(elem, data, type) {
  6862. this.propType = 'shape';
  6863. this.comp = elem.comp;
  6864. this.elem = elem;
  6865. this.container = elem;
  6866. this.offsetTime = elem.data.st;
  6867. this.keyframes = type === 3 ? data.pt.k : data.ks.k;
  6868. this.keyframesMetadata = [];
  6869. this.k = true;
  6870. this.kf = true;
  6871. var len = this.keyframes[0].s[0].i.length;
  6872. this.v = shapePool.newElement();
  6873. this.v.setPathData(this.keyframes[0].s[0].c, len);
  6874. this.pv = shapePool.clone(this.v);
  6875. this.localShapeCollection = shapeCollectionPool.newShapeCollection();
  6876. this.paths = this.localShapeCollection;
  6877. this.paths.addShape(this.v);
  6878. this.lastFrame = initFrame;
  6879. this.reset = resetShape;
  6880. this._caching = {
  6881. lastFrame: initFrame,
  6882. lastIndex: 0
  6883. };
  6884. this.effectsSequence = [interpolateShapeCurrentTime.bind(this)];
  6885. }
  6886. KeyframedShapeProperty.prototype.getValue = processEffectsSequence;
  6887. KeyframedShapeProperty.prototype.interpolateShape = interpolateShape;
  6888. KeyframedShapeProperty.prototype.setVValue = setVValue;
  6889. KeyframedShapeProperty.prototype.addEffect = addEffect;
  6890. var EllShapeProperty = function () {
  6891. var cPoint = roundCorner;
  6892. function EllShapePropertyFactory(elem, data) {
  6893. this.v = shapePool.newElement();
  6894. this.v.setPathData(true, 4);
  6895. this.localShapeCollection = shapeCollectionPool.newShapeCollection();
  6896. this.paths = this.localShapeCollection;
  6897. this.localShapeCollection.addShape(this.v);
  6898. this.d = data.d;
  6899. this.elem = elem;
  6900. this.comp = elem.comp;
  6901. this.frameId = -1;
  6902. this.initDynamicPropertyContainer(elem);
  6903. this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
  6904. this.s = PropertyFactory.getProp(elem, data.s, 1, 0, this);
  6905. if (this.dynamicProperties.length) {
  6906. this.k = true;
  6907. } else {
  6908. this.k = false;
  6909. this.convertEllToPath();
  6910. }
  6911. }
  6912. EllShapePropertyFactory.prototype = {
  6913. reset: resetShape,
  6914. getValue: function getValue() {
  6915. if (this.elem.globalData.frameId === this.frameId) {
  6916. return;
  6917. }
  6918. this.frameId = this.elem.globalData.frameId;
  6919. this.iterateDynamicProperties();
  6920. if (this._mdf) {
  6921. this.convertEllToPath();
  6922. }
  6923. },
  6924. convertEllToPath: function convertEllToPath() {
  6925. var p0 = this.p.v[0];
  6926. var p1 = this.p.v[1];
  6927. var s0 = this.s.v[0] / 2;
  6928. var s1 = this.s.v[1] / 2;
  6929. var _cw = this.d !== 3;
  6930. var _v = this.v;
  6931. _v.v[0][0] = p0;
  6932. _v.v[0][1] = p1 - s1;
  6933. _v.v[1][0] = _cw ? p0 + s0 : p0 - s0;
  6934. _v.v[1][1] = p1;
  6935. _v.v[2][0] = p0;
  6936. _v.v[2][1] = p1 + s1;
  6937. _v.v[3][0] = _cw ? p0 - s0 : p0 + s0;
  6938. _v.v[3][1] = p1;
  6939. _v.i[0][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
  6940. _v.i[0][1] = p1 - s1;
  6941. _v.i[1][0] = _cw ? p0 + s0 : p0 - s0;
  6942. _v.i[1][1] = p1 - s1 * cPoint;
  6943. _v.i[2][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
  6944. _v.i[2][1] = p1 + s1;
  6945. _v.i[3][0] = _cw ? p0 - s0 : p0 + s0;
  6946. _v.i[3][1] = p1 + s1 * cPoint;
  6947. _v.o[0][0] = _cw ? p0 + s0 * cPoint : p0 - s0 * cPoint;
  6948. _v.o[0][1] = p1 - s1;
  6949. _v.o[1][0] = _cw ? p0 + s0 : p0 - s0;
  6950. _v.o[1][1] = p1 + s1 * cPoint;
  6951. _v.o[2][0] = _cw ? p0 - s0 * cPoint : p0 + s0 * cPoint;
  6952. _v.o[2][1] = p1 + s1;
  6953. _v.o[3][0] = _cw ? p0 - s0 : p0 + s0;
  6954. _v.o[3][1] = p1 - s1 * cPoint;
  6955. }
  6956. };
  6957. extendPrototype([DynamicPropertyContainer], EllShapePropertyFactory);
  6958. return EllShapePropertyFactory;
  6959. }();
  6960. var StarShapeProperty = function () {
  6961. function StarShapePropertyFactory(elem, data) {
  6962. this.v = shapePool.newElement();
  6963. this.v.setPathData(true, 0);
  6964. this.elem = elem;
  6965. this.comp = elem.comp;
  6966. this.data = data;
  6967. this.frameId = -1;
  6968. this.d = data.d;
  6969. this.initDynamicPropertyContainer(elem);
  6970. if (data.sy === 1) {
  6971. this.ir = PropertyFactory.getProp(elem, data.ir, 0, 0, this);
  6972. this.is = PropertyFactory.getProp(elem, data.is, 0, 0.01, this);
  6973. this.convertToPath = this.convertStarToPath;
  6974. } else {
  6975. this.convertToPath = this.convertPolygonToPath;
  6976. }
  6977. this.pt = PropertyFactory.getProp(elem, data.pt, 0, 0, this);
  6978. this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
  6979. this.r = PropertyFactory.getProp(elem, data.r, 0, degToRads, this);
  6980. this.or = PropertyFactory.getProp(elem, data.or, 0, 0, this);
  6981. this.os = PropertyFactory.getProp(elem, data.os, 0, 0.01, this);
  6982. this.localShapeCollection = shapeCollectionPool.newShapeCollection();
  6983. this.localShapeCollection.addShape(this.v);
  6984. this.paths = this.localShapeCollection;
  6985. if (this.dynamicProperties.length) {
  6986. this.k = true;
  6987. } else {
  6988. this.k = false;
  6989. this.convertToPath();
  6990. }
  6991. }
  6992. StarShapePropertyFactory.prototype = {
  6993. reset: resetShape,
  6994. getValue: function getValue() {
  6995. if (this.elem.globalData.frameId === this.frameId) {
  6996. return;
  6997. }
  6998. this.frameId = this.elem.globalData.frameId;
  6999. this.iterateDynamicProperties();
  7000. if (this._mdf) {
  7001. this.convertToPath();
  7002. }
  7003. },
  7004. convertStarToPath: function convertStarToPath() {
  7005. var numPts = Math.floor(this.pt.v) * 2;
  7006. var angle = Math.PI * 2 / numPts;
  7007. /* this.v.v.length = numPts;
  7008. this.v.i.length = numPts;
  7009. this.v.o.length = numPts; */
  7010. var longFlag = true;
  7011. var longRad = this.or.v;
  7012. var shortRad = this.ir.v;
  7013. var longRound = this.os.v;
  7014. var shortRound = this.is.v;
  7015. var longPerimSegment = 2 * Math.PI * longRad / (numPts * 2);
  7016. var shortPerimSegment = 2 * Math.PI * shortRad / (numPts * 2);
  7017. var i;
  7018. var rad;
  7019. var roundness;
  7020. var perimSegment;
  7021. var currentAng = -Math.PI / 2;
  7022. currentAng += this.r.v;
  7023. var dir = this.data.d === 3 ? -1 : 1;
  7024. this.v._length = 0;
  7025. for (i = 0; i < numPts; i += 1) {
  7026. rad = longFlag ? longRad : shortRad;
  7027. roundness = longFlag ? longRound : shortRound;
  7028. perimSegment = longFlag ? longPerimSegment : shortPerimSegment;
  7029. var x = rad * Math.cos(currentAng);
  7030. var y = rad * Math.sin(currentAng);
  7031. var ox = x === 0 && y === 0 ? 0 : y / Math.sqrt(x * x + y * y);
  7032. var oy = x === 0 && y === 0 ? 0 : -x / Math.sqrt(x * x + y * y);
  7033. x += +this.p.v[0];
  7034. y += +this.p.v[1];
  7035. this.v.setTripleAt(x, y, x - ox * perimSegment * roundness * dir, y - oy * perimSegment * roundness * dir, x + ox * perimSegment * roundness * dir, y + oy * perimSegment * roundness * dir, i, true);
  7036. /* this.v.v[i] = [x,y];
  7037. this.v.i[i] = [x+ox*perimSegment*roundness*dir,y+oy*perimSegment*roundness*dir];
  7038. this.v.o[i] = [x-ox*perimSegment*roundness*dir,y-oy*perimSegment*roundness*dir];
  7039. this.v._length = numPts; */
  7040. longFlag = !longFlag;
  7041. currentAng += angle * dir;
  7042. }
  7043. },
  7044. convertPolygonToPath: function convertPolygonToPath() {
  7045. var numPts = Math.floor(this.pt.v);
  7046. var angle = Math.PI * 2 / numPts;
  7047. var rad = this.or.v;
  7048. var roundness = this.os.v;
  7049. var perimSegment = 2 * Math.PI * rad / (numPts * 4);
  7050. var i;
  7051. var currentAng = -Math.PI * 0.5;
  7052. var dir = this.data.d === 3 ? -1 : 1;
  7053. currentAng += this.r.v;
  7054. this.v._length = 0;
  7055. for (i = 0; i < numPts; i += 1) {
  7056. var x = rad * Math.cos(currentAng);
  7057. var y = rad * Math.sin(currentAng);
  7058. var ox = x === 0 && y === 0 ? 0 : y / Math.sqrt(x * x + y * y);
  7059. var oy = x === 0 && y === 0 ? 0 : -x / Math.sqrt(x * x + y * y);
  7060. x += +this.p.v[0];
  7061. y += +this.p.v[1];
  7062. this.v.setTripleAt(x, y, x - ox * perimSegment * roundness * dir, y - oy * perimSegment * roundness * dir, x + ox * perimSegment * roundness * dir, y + oy * perimSegment * roundness * dir, i, true);
  7063. currentAng += angle * dir;
  7064. }
  7065. this.paths.length = 0;
  7066. this.paths[0] = this.v;
  7067. }
  7068. };
  7069. extendPrototype([DynamicPropertyContainer], StarShapePropertyFactory);
  7070. return StarShapePropertyFactory;
  7071. }();
  7072. var RectShapeProperty = function () {
  7073. function RectShapePropertyFactory(elem, data) {
  7074. this.v = shapePool.newElement();
  7075. this.v.c = true;
  7076. this.localShapeCollection = shapeCollectionPool.newShapeCollection();
  7077. this.localShapeCollection.addShape(this.v);
  7078. this.paths = this.localShapeCollection;
  7079. this.elem = elem;
  7080. this.comp = elem.comp;
  7081. this.frameId = -1;
  7082. this.d = data.d;
  7083. this.initDynamicPropertyContainer(elem);
  7084. this.p = PropertyFactory.getProp(elem, data.p, 1, 0, this);
  7085. this.s = PropertyFactory.getProp(elem, data.s, 1, 0, this);
  7086. this.r = PropertyFactory.getProp(elem, data.r, 0, 0, this);
  7087. if (this.dynamicProperties.length) {
  7088. this.k = true;
  7089. } else {
  7090. this.k = false;
  7091. this.convertRectToPath();
  7092. }
  7093. }
  7094. RectShapePropertyFactory.prototype = {
  7095. convertRectToPath: function convertRectToPath() {
  7096. var p0 = this.p.v[0];
  7097. var p1 = this.p.v[1];
  7098. var v0 = this.s.v[0] / 2;
  7099. var v1 = this.s.v[1] / 2;
  7100. var round = bmMin(v0, v1, this.r.v);
  7101. var cPoint = round * (1 - roundCorner);
  7102. this.v._length = 0;
  7103. if (this.d === 2 || this.d === 1) {
  7104. this.v.setTripleAt(p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + cPoint, 0, true);
  7105. this.v.setTripleAt(p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - cPoint, p0 + v0, p1 + v1 - round, 1, true);
  7106. if (round !== 0) {
  7107. this.v.setTripleAt(p0 + v0 - round, p1 + v1, p0 + v0 - round, p1 + v1, p0 + v0 - cPoint, p1 + v1, 2, true);
  7108. this.v.setTripleAt(p0 - v0 + round, p1 + v1, p0 - v0 + cPoint, p1 + v1, p0 - v0 + round, p1 + v1, 3, true);
  7109. this.v.setTripleAt(p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - cPoint, 4, true);
  7110. this.v.setTripleAt(p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + cPoint, p0 - v0, p1 - v1 + round, 5, true);
  7111. this.v.setTripleAt(p0 - v0 + round, p1 - v1, p0 - v0 + round, p1 - v1, p0 - v0 + cPoint, p1 - v1, 6, true);
  7112. this.v.setTripleAt(p0 + v0 - round, p1 - v1, p0 + v0 - cPoint, p1 - v1, p0 + v0 - round, p1 - v1, 7, true);
  7113. } else {
  7114. this.v.setTripleAt(p0 - v0, p1 + v1, p0 - v0 + cPoint, p1 + v1, p0 - v0, p1 + v1, 2);
  7115. this.v.setTripleAt(p0 - v0, p1 - v1, p0 - v0, p1 - v1 + cPoint, p0 - v0, p1 - v1, 3);
  7116. }
  7117. } else {
  7118. this.v.setTripleAt(p0 + v0, p1 - v1 + round, p0 + v0, p1 - v1 + cPoint, p0 + v0, p1 - v1 + round, 0, true);
  7119. if (round !== 0) {
  7120. this.v.setTripleAt(p0 + v0 - round, p1 - v1, p0 + v0 - round, p1 - v1, p0 + v0 - cPoint, p1 - v1, 1, true);
  7121. this.v.setTripleAt(p0 - v0 + round, p1 - v1, p0 - v0 + cPoint, p1 - v1, p0 - v0 + round, p1 - v1, 2, true);
  7122. this.v.setTripleAt(p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + round, p0 - v0, p1 - v1 + cPoint, 3, true);
  7123. this.v.setTripleAt(p0 - v0, p1 + v1 - round, p0 - v0, p1 + v1 - cPoint, p0 - v0, p1 + v1 - round, 4, true);
  7124. this.v.setTripleAt(p0 - v0 + round, p1 + v1, p0 - v0 + round, p1 + v1, p0 - v0 + cPoint, p1 + v1, 5, true);
  7125. this.v.setTripleAt(p0 + v0 - round, p1 + v1, p0 + v0 - cPoint, p1 + v1, p0 + v0 - round, p1 + v1, 6, true);
  7126. this.v.setTripleAt(p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - round, p0 + v0, p1 + v1 - cPoint, 7, true);
  7127. } else {
  7128. this.v.setTripleAt(p0 - v0, p1 - v1, p0 - v0 + cPoint, p1 - v1, p0 - v0, p1 - v1, 1, true);
  7129. this.v.setTripleAt(p0 - v0, p1 + v1, p0 - v0, p1 + v1 - cPoint, p0 - v0, p1 + v1, 2, true);
  7130. this.v.setTripleAt(p0 + v0, p1 + v1, p0 + v0 - cPoint, p1 + v1, p0 + v0, p1 + v1, 3, true);
  7131. }
  7132. }
  7133. },
  7134. getValue: function getValue() {
  7135. if (this.elem.globalData.frameId === this.frameId) {
  7136. return;
  7137. }
  7138. this.frameId = this.elem.globalData.frameId;
  7139. this.iterateDynamicProperties();
  7140. if (this._mdf) {
  7141. this.convertRectToPath();
  7142. }
  7143. },
  7144. reset: resetShape
  7145. };
  7146. extendPrototype([DynamicPropertyContainer], RectShapePropertyFactory);
  7147. return RectShapePropertyFactory;
  7148. }();
  7149. function getShapeProp(elem, data, type) {
  7150. var prop;
  7151. if (type === 3 || type === 4) {
  7152. var dataProp = type === 3 ? data.pt : data.ks;
  7153. var keys = dataProp.k;
  7154. if (keys.length) {
  7155. prop = new KeyframedShapeProperty(elem, data, type);
  7156. } else {
  7157. prop = new ShapeProperty(elem, data, type);
  7158. }
  7159. } else if (type === 5) {
  7160. prop = new RectShapeProperty(elem, data);
  7161. } else if (type === 6) {
  7162. prop = new EllShapeProperty(elem, data);
  7163. } else if (type === 7) {
  7164. prop = new StarShapeProperty(elem, data);
  7165. }
  7166. if (prop.k) {
  7167. elem.addDynamicProperty(prop);
  7168. }
  7169. return prop;
  7170. }
  7171. function getConstructorFunction() {
  7172. return ShapeProperty;
  7173. }
  7174. function getKeyframedConstructorFunction() {
  7175. return KeyframedShapeProperty;
  7176. }
  7177. var ob = {};
  7178. ob.getShapeProp = getShapeProp;
  7179. ob.getConstructorFunction = getConstructorFunction;
  7180. ob.getKeyframedConstructorFunction = getKeyframedConstructorFunction;
  7181. return ob;
  7182. }();
  7183. /*!
  7184. Transformation Matrix v2.0
  7185. (c) Epistemex 2014-2015
  7186. www.epistemex.com
  7187. By Ken Fyrstenberg
  7188. Contributions by leeoniya.
  7189. License: MIT, header required.
  7190. */
  7191. /**
  7192. * 2D transformation matrix object initialized with identity matrix.
  7193. *
  7194. * The matrix can synchronize a canvas context by supplying the context
  7195. * as an argument, or later apply current absolute transform to an
  7196. * existing context.
  7197. *
  7198. * All values are handled as floating point values.
  7199. *
  7200. * @param {CanvasRenderingContext2D} [context] - Optional context to sync with Matrix
  7201. * @prop {number} a - scale x
  7202. * @prop {number} b - shear y
  7203. * @prop {number} c - shear x
  7204. * @prop {number} d - scale y
  7205. * @prop {number} e - translate x
  7206. * @prop {number} f - translate y
  7207. * @prop {CanvasRenderingContext2D|null} [context=null] - set or get current canvas context
  7208. * @constructor
  7209. */
  7210. var Matrix = function () {
  7211. var _cos = Math.cos;
  7212. var _sin = Math.sin;
  7213. var _tan = Math.tan;
  7214. var _rnd = Math.round;
  7215. function reset() {
  7216. this.props[0] = 1;
  7217. this.props[1] = 0;
  7218. this.props[2] = 0;
  7219. this.props[3] = 0;
  7220. this.props[4] = 0;
  7221. this.props[5] = 1;
  7222. this.props[6] = 0;
  7223. this.props[7] = 0;
  7224. this.props[8] = 0;
  7225. this.props[9] = 0;
  7226. this.props[10] = 1;
  7227. this.props[11] = 0;
  7228. this.props[12] = 0;
  7229. this.props[13] = 0;
  7230. this.props[14] = 0;
  7231. this.props[15] = 1;
  7232. return this;
  7233. }
  7234. function rotate(angle) {
  7235. if (angle === 0) {
  7236. return this;
  7237. }
  7238. var mCos = _cos(angle);
  7239. var mSin = _sin(angle);
  7240. return this._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
  7241. }
  7242. function rotateX(angle) {
  7243. if (angle === 0) {
  7244. return this;
  7245. }
  7246. var mCos = _cos(angle);
  7247. var mSin = _sin(angle);
  7248. return this._t(1, 0, 0, 0, 0, mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1);
  7249. }
  7250. function rotateY(angle) {
  7251. if (angle === 0) {
  7252. return this;
  7253. }
  7254. var mCos = _cos(angle);
  7255. var mSin = _sin(angle);
  7256. return this._t(mCos, 0, mSin, 0, 0, 1, 0, 0, -mSin, 0, mCos, 0, 0, 0, 0, 1);
  7257. }
  7258. function rotateZ(angle) {
  7259. if (angle === 0) {
  7260. return this;
  7261. }
  7262. var mCos = _cos(angle);
  7263. var mSin = _sin(angle);
  7264. return this._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
  7265. }
  7266. function shear(sx, sy) {
  7267. return this._t(1, sy, sx, 1, 0, 0);
  7268. }
  7269. function skew(ax, ay) {
  7270. return this.shear(_tan(ax), _tan(ay));
  7271. }
  7272. function skewFromAxis(ax, angle) {
  7273. var mCos = _cos(angle);
  7274. var mSin = _sin(angle);
  7275. return this._t(mCos, mSin, 0, 0, -mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)._t(1, 0, 0, 0, _tan(ax), 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)._t(mCos, -mSin, 0, 0, mSin, mCos, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); // return this._t(mCos, mSin, -mSin, mCos, 0, 0)._t(1, 0, _tan(ax), 1, 0, 0)._t(mCos, -mSin, mSin, mCos, 0, 0);
  7276. }
  7277. function scale(sx, sy, sz) {
  7278. if (!sz && sz !== 0) {
  7279. sz = 1;
  7280. }
  7281. if (sx === 1 && sy === 1 && sz === 1) {
  7282. return this;
  7283. }
  7284. return this._t(sx, 0, 0, 0, 0, sy, 0, 0, 0, 0, sz, 0, 0, 0, 0, 1);
  7285. }
  7286. function setTransform(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {
  7287. this.props[0] = a;
  7288. this.props[1] = b;
  7289. this.props[2] = c;
  7290. this.props[3] = d;
  7291. this.props[4] = e;
  7292. this.props[5] = f;
  7293. this.props[6] = g;
  7294. this.props[7] = h;
  7295. this.props[8] = i;
  7296. this.props[9] = j;
  7297. this.props[10] = k;
  7298. this.props[11] = l;
  7299. this.props[12] = m;
  7300. this.props[13] = n;
  7301. this.props[14] = o;
  7302. this.props[15] = p;
  7303. return this;
  7304. }
  7305. function translate(tx, ty, tz) {
  7306. tz = tz || 0;
  7307. if (tx !== 0 || ty !== 0 || tz !== 0) {
  7308. return this._t(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, tx, ty, tz, 1);
  7309. }
  7310. return this;
  7311. }
  7312. function transform(a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) {
  7313. var _p = this.props;
  7314. if (a2 === 1 && b2 === 0 && c2 === 0 && d2 === 0 && e2 === 0 && f2 === 1 && g2 === 0 && h2 === 0 && i2 === 0 && j2 === 0 && k2 === 1 && l2 === 0) {
  7315. // NOTE: commenting this condition because TurboFan deoptimizes code when present
  7316. // if(m2 !== 0 || n2 !== 0 || o2 !== 0){
  7317. _p[12] = _p[12] * a2 + _p[15] * m2;
  7318. _p[13] = _p[13] * f2 + _p[15] * n2;
  7319. _p[14] = _p[14] * k2 + _p[15] * o2;
  7320. _p[15] *= p2; // }
  7321. this._identityCalculated = false;
  7322. return this;
  7323. }
  7324. var a1 = _p[0];
  7325. var b1 = _p[1];
  7326. var c1 = _p[2];
  7327. var d1 = _p[3];
  7328. var e1 = _p[4];
  7329. var f1 = _p[5];
  7330. var g1 = _p[6];
  7331. var h1 = _p[7];
  7332. var i1 = _p[8];
  7333. var j1 = _p[9];
  7334. var k1 = _p[10];
  7335. var l1 = _p[11];
  7336. var m1 = _p[12];
  7337. var n1 = _p[13];
  7338. var o1 = _p[14];
  7339. var p1 = _p[15];
  7340. /* matrix order (canvas compatible):
  7341. * ace
  7342. * bdf
  7343. * 001
  7344. */
  7345. _p[0] = a1 * a2 + b1 * e2 + c1 * i2 + d1 * m2;
  7346. _p[1] = a1 * b2 + b1 * f2 + c1 * j2 + d1 * n2;
  7347. _p[2] = a1 * c2 + b1 * g2 + c1 * k2 + d1 * o2;
  7348. _p[3] = a1 * d2 + b1 * h2 + c1 * l2 + d1 * p2;
  7349. _p[4] = e1 * a2 + f1 * e2 + g1 * i2 + h1 * m2;
  7350. _p[5] = e1 * b2 + f1 * f2 + g1 * j2 + h1 * n2;
  7351. _p[6] = e1 * c2 + f1 * g2 + g1 * k2 + h1 * o2;
  7352. _p[7] = e1 * d2 + f1 * h2 + g1 * l2 + h1 * p2;
  7353. _p[8] = i1 * a2 + j1 * e2 + k1 * i2 + l1 * m2;
  7354. _p[9] = i1 * b2 + j1 * f2 + k1 * j2 + l1 * n2;
  7355. _p[10] = i1 * c2 + j1 * g2 + k1 * k2 + l1 * o2;
  7356. _p[11] = i1 * d2 + j1 * h2 + k1 * l2 + l1 * p2;
  7357. _p[12] = m1 * a2 + n1 * e2 + o1 * i2 + p1 * m2;
  7358. _p[13] = m1 * b2 + n1 * f2 + o1 * j2 + p1 * n2;
  7359. _p[14] = m1 * c2 + n1 * g2 + o1 * k2 + p1 * o2;
  7360. _p[15] = m1 * d2 + n1 * h2 + o1 * l2 + p1 * p2;
  7361. this._identityCalculated = false;
  7362. return this;
  7363. }
  7364. function multiply(matrix) {
  7365. var matrixProps = matrix.props;
  7366. return this.transform(matrixProps[0], matrixProps[1], matrixProps[2], matrixProps[3], matrixProps[4], matrixProps[5], matrixProps[6], matrixProps[7], matrixProps[8], matrixProps[9], matrixProps[10], matrixProps[11], matrixProps[12], matrixProps[13], matrixProps[14], matrixProps[15]);
  7367. }
  7368. function isIdentity() {
  7369. if (!this._identityCalculated) {
  7370. 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);
  7371. this._identityCalculated = true;
  7372. }
  7373. return this._identity;
  7374. }
  7375. function equals(matr) {
  7376. var i = 0;
  7377. while (i < 16) {
  7378. if (matr.props[i] !== this.props[i]) {
  7379. return false;
  7380. }
  7381. i += 1;
  7382. }
  7383. return true;
  7384. }
  7385. function clone(matr) {
  7386. var i;
  7387. for (i = 0; i < 16; i += 1) {
  7388. matr.props[i] = this.props[i];
  7389. }
  7390. return matr;
  7391. }
  7392. function cloneFromProps(props) {
  7393. var i;
  7394. for (i = 0; i < 16; i += 1) {
  7395. this.props[i] = props[i];
  7396. }
  7397. }
  7398. function applyToPoint(x, y, z) {
  7399. return {
  7400. x: x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12],
  7401. y: x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13],
  7402. z: x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14]
  7403. };
  7404. /* return {
  7405. x: x * me.a + y * me.c + me.e,
  7406. y: x * me.b + y * me.d + me.f
  7407. }; */
  7408. }
  7409. function applyToX(x, y, z) {
  7410. return x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12];
  7411. }
  7412. function applyToY(x, y, z) {
  7413. return x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13];
  7414. }
  7415. function applyToZ(x, y, z) {
  7416. return x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14];
  7417. }
  7418. function getInverseMatrix() {
  7419. var determinant = this.props[0] * this.props[5] - this.props[1] * this.props[4];
  7420. var a = this.props[5] / determinant;
  7421. var b = -this.props[1] / determinant;
  7422. var c = -this.props[4] / determinant;
  7423. var d = this.props[0] / determinant;
  7424. var e = (this.props[4] * this.props[13] - this.props[5] * this.props[12]) / determinant;
  7425. var f = -(this.props[0] * this.props[13] - this.props[1] * this.props[12]) / determinant;
  7426. var inverseMatrix = new Matrix();
  7427. inverseMatrix.props[0] = a;
  7428. inverseMatrix.props[1] = b;
  7429. inverseMatrix.props[4] = c;
  7430. inverseMatrix.props[5] = d;
  7431. inverseMatrix.props[12] = e;
  7432. inverseMatrix.props[13] = f;
  7433. return inverseMatrix;
  7434. }
  7435. function inversePoint(pt) {
  7436. var inverseMatrix = this.getInverseMatrix();
  7437. return inverseMatrix.applyToPointArray(pt[0], pt[1], pt[2] || 0);
  7438. }
  7439. function inversePoints(pts) {
  7440. var i;
  7441. var len = pts.length;
  7442. var retPts = [];
  7443. for (i = 0; i < len; i += 1) {
  7444. retPts[i] = inversePoint(pts[i]);
  7445. }
  7446. return retPts;
  7447. }
  7448. function applyToTriplePoints(pt1, pt2, pt3) {
  7449. var arr = createTypedArray('float32', 6);
  7450. if (this.isIdentity()) {
  7451. arr[0] = pt1[0];
  7452. arr[1] = pt1[1];
  7453. arr[2] = pt2[0];
  7454. arr[3] = pt2[1];
  7455. arr[4] = pt3[0];
  7456. arr[5] = pt3[1];
  7457. } else {
  7458. var p0 = this.props[0];
  7459. var p1 = this.props[1];
  7460. var p4 = this.props[4];
  7461. var p5 = this.props[5];
  7462. var p12 = this.props[12];
  7463. var p13 = this.props[13];
  7464. arr[0] = pt1[0] * p0 + pt1[1] * p4 + p12;
  7465. arr[1] = pt1[0] * p1 + pt1[1] * p5 + p13;
  7466. arr[2] = pt2[0] * p0 + pt2[1] * p4 + p12;
  7467. arr[3] = pt2[0] * p1 + pt2[1] * p5 + p13;
  7468. arr[4] = pt3[0] * p0 + pt3[1] * p4 + p12;
  7469. arr[5] = pt3[0] * p1 + pt3[1] * p5 + p13;
  7470. }
  7471. return arr;
  7472. }
  7473. function applyToPointArray(x, y, z) {
  7474. var arr;
  7475. if (this.isIdentity()) {
  7476. arr = [x, y, z];
  7477. } else {
  7478. arr = [x * this.props[0] + y * this.props[4] + z * this.props[8] + this.props[12], x * this.props[1] + y * this.props[5] + z * this.props[9] + this.props[13], x * this.props[2] + y * this.props[6] + z * this.props[10] + this.props[14]];
  7479. }
  7480. return arr;
  7481. }
  7482. function applyToPointStringified(x, y) {
  7483. if (this.isIdentity()) {
  7484. return x + ',' + y;
  7485. }
  7486. var _p = this.props;
  7487. return Math.round((x * _p[0] + y * _p[4] + _p[12]) * 100) / 100 + ',' + Math.round((x * _p[1] + y * _p[5] + _p[13]) * 100) / 100;
  7488. }
  7489. function toCSS() {
  7490. // Doesn't make much sense to add this optimization. If it is an identity matrix, it's very likely this will get called only once since it won't be keyframed.
  7491. /* if(this.isIdentity()) {
  7492. return '';
  7493. } */
  7494. var i = 0;
  7495. var props = this.props;
  7496. var cssValue = 'matrix3d(';
  7497. var v = 10000;
  7498. while (i < 16) {
  7499. cssValue += _rnd(props[i] * v) / v;
  7500. cssValue += i === 15 ? ')' : ',';
  7501. i += 1;
  7502. }
  7503. return cssValue;
  7504. }
  7505. function roundMatrixProperty(val) {
  7506. var v = 10000;
  7507. if (val < 0.000001 && val > 0 || val > -0.000001 && val < 0) {
  7508. return _rnd(val * v) / v;
  7509. }
  7510. return val;
  7511. }
  7512. function to2dCSS() {
  7513. // Doesn't make much sense to add this optimization. If it is an identity matrix, it's very likely this will get called only once since it won't be keyframed.
  7514. /* if(this.isIdentity()) {
  7515. return '';
  7516. } */
  7517. var props = this.props;
  7518. var _a = roundMatrixProperty(props[0]);
  7519. var _b = roundMatrixProperty(props[1]);
  7520. var _c = roundMatrixProperty(props[4]);
  7521. var _d = roundMatrixProperty(props[5]);
  7522. var _e = roundMatrixProperty(props[12]);
  7523. var _f = roundMatrixProperty(props[13]);
  7524. return 'matrix(' + _a + ',' + _b + ',' + _c + ',' + _d + ',' + _e + ',' + _f + ')';
  7525. }
  7526. return function () {
  7527. this.reset = reset;
  7528. this.rotate = rotate;
  7529. this.rotateX = rotateX;
  7530. this.rotateY = rotateY;
  7531. this.rotateZ = rotateZ;
  7532. this.skew = skew;
  7533. this.skewFromAxis = skewFromAxis;
  7534. this.shear = shear;
  7535. this.scale = scale;
  7536. this.setTransform = setTransform;
  7537. this.translate = translate;
  7538. this.transform = transform;
  7539. this.multiply = multiply;
  7540. this.applyToPoint = applyToPoint;
  7541. this.applyToX = applyToX;
  7542. this.applyToY = applyToY;
  7543. this.applyToZ = applyToZ;
  7544. this.applyToPointArray = applyToPointArray;
  7545. this.applyToTriplePoints = applyToTriplePoints;
  7546. this.applyToPointStringified = applyToPointStringified;
  7547. this.toCSS = toCSS;
  7548. this.to2dCSS = to2dCSS;
  7549. this.clone = clone;
  7550. this.cloneFromProps = cloneFromProps;
  7551. this.equals = equals;
  7552. this.inversePoints = inversePoints;
  7553. this.inversePoint = inversePoint;
  7554. this.getInverseMatrix = getInverseMatrix;
  7555. this._t = this.transform;
  7556. this.isIdentity = isIdentity;
  7557. this._identity = true;
  7558. this._identityCalculated = false;
  7559. this.props = createTypedArray('float32', 16);
  7560. this.reset();
  7561. };
  7562. }();
  7563. function _typeof$3(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$3 = function _typeof(obj) { return typeof obj; }; } else { _typeof$3 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$3(obj); }
  7564. var lottie = {};
  7565. var standalone = '__[STANDALONE]__';
  7566. var animationData = '__[ANIMATIONDATA]__';
  7567. var renderer = '';
  7568. function setLocation(href) {
  7569. setLocationHref(href);
  7570. }
  7571. function searchAnimations() {
  7572. if (standalone === true) {
  7573. animationManager.searchAnimations(animationData, standalone, renderer);
  7574. } else {
  7575. animationManager.searchAnimations();
  7576. }
  7577. }
  7578. function setSubframeRendering(flag) {
  7579. setSubframeEnabled(flag);
  7580. }
  7581. function setPrefix(prefix) {
  7582. setIdPrefix(prefix);
  7583. }
  7584. function loadAnimation(params) {
  7585. if (standalone === true) {
  7586. params.animationData = JSON.parse(animationData);
  7587. }
  7588. return animationManager.loadAnimation(params);
  7589. }
  7590. function setQuality(value) {
  7591. if (typeof value === 'string') {
  7592. switch (value) {
  7593. case 'high':
  7594. setDefaultCurveSegments(200);
  7595. break;
  7596. default:
  7597. case 'medium':
  7598. setDefaultCurveSegments(50);
  7599. break;
  7600. case 'low':
  7601. setDefaultCurveSegments(10);
  7602. break;
  7603. }
  7604. } else if (!isNaN(value) && value > 1) {
  7605. setDefaultCurveSegments(value);
  7606. }
  7607. if (getDefaultCurveSegments() >= 50) {
  7608. roundValues(false);
  7609. } else {
  7610. roundValues(true);
  7611. }
  7612. }
  7613. function inBrowser() {
  7614. return typeof navigator !== 'undefined';
  7615. }
  7616. function installPlugin(type, plugin) {
  7617. if (type === 'expressions') {
  7618. setExpressionsPlugin(plugin);
  7619. }
  7620. }
  7621. function getFactory(name) {
  7622. switch (name) {
  7623. case 'propertyFactory':
  7624. return PropertyFactory;
  7625. case 'shapePropertyFactory':
  7626. return ShapePropertyFactory;
  7627. case 'matrix':
  7628. return Matrix;
  7629. default:
  7630. return null;
  7631. }
  7632. }
  7633. lottie.play = animationManager.play;
  7634. lottie.pause = animationManager.pause;
  7635. lottie.setLocationHref = setLocation;
  7636. lottie.togglePause = animationManager.togglePause;
  7637. lottie.setSpeed = animationManager.setSpeed;
  7638. lottie.setDirection = animationManager.setDirection;
  7639. lottie.stop = animationManager.stop;
  7640. lottie.searchAnimations = searchAnimations;
  7641. lottie.registerAnimation = animationManager.registerAnimation;
  7642. lottie.loadAnimation = loadAnimation;
  7643. lottie.setSubframeRendering = setSubframeRendering;
  7644. lottie.resize = animationManager.resize; // lottie.start = start;
  7645. lottie.goToAndStop = animationManager.goToAndStop;
  7646. lottie.destroy = animationManager.destroy;
  7647. lottie.setQuality = setQuality;
  7648. lottie.inBrowser = inBrowser;
  7649. lottie.installPlugin = installPlugin;
  7650. lottie.freeze = animationManager.freeze;
  7651. lottie.unfreeze = animationManager.unfreeze;
  7652. lottie.setVolume = animationManager.setVolume;
  7653. lottie.mute = animationManager.mute;
  7654. lottie.unmute = animationManager.unmute;
  7655. lottie.getRegisteredAnimations = animationManager.getRegisteredAnimations;
  7656. lottie.useWebWorker = setWebWorker;
  7657. lottie.setIDPrefix = setPrefix;
  7658. lottie.__getFactory = getFactory;
  7659. lottie.version = '5.12.2';
  7660. function checkReady() {
  7661. if (document.readyState === 'complete') {
  7662. clearInterval(readyStateCheckInterval);
  7663. searchAnimations();
  7664. }
  7665. }
  7666. function getQueryVariable(variable) {
  7667. var vars = queryString.split('&');
  7668. for (var i = 0; i < vars.length; i += 1) {
  7669. var pair = vars[i].split('=');
  7670. if (decodeURIComponent(pair[0]) == variable) {
  7671. // eslint-disable-line eqeqeq
  7672. return decodeURIComponent(pair[1]);
  7673. }
  7674. }
  7675. return null;
  7676. }
  7677. var queryString = '';
  7678. if (standalone) {
  7679. var scripts = document.getElementsByTagName('script');
  7680. var index = scripts.length - 1;
  7681. var myScript = scripts[index] || {
  7682. src: ''
  7683. };
  7684. queryString = myScript.src ? myScript.src.replace(/^[^\?]+\??/, '') : ''; // eslint-disable-line no-useless-escape
  7685. renderer = getQueryVariable('renderer');
  7686. }
  7687. var readyStateCheckInterval = setInterval(checkReady, 100); // this adds bodymovin to the window object for backwards compatibility
  7688. try {
  7689. if (!(( false ? undefined : _typeof$3(exports)) === 'object' && typeof module !== 'undefined') && !( true && __webpack_require__(/*! !webpack amd options */ "../../node_modules/webpack/buildin/amd-options.js")) // eslint-disable-line no-undef
  7690. ) {
  7691. window.bodymovin = lottie;
  7692. }
  7693. } catch (err) {//
  7694. }
  7695. var ShapeModifiers = function () {
  7696. var ob = {};
  7697. var modifiers = {};
  7698. ob.registerModifier = registerModifier;
  7699. ob.getModifier = getModifier;
  7700. function registerModifier(nm, factory) {
  7701. if (!modifiers[nm]) {
  7702. modifiers[nm] = factory;
  7703. }
  7704. }
  7705. function getModifier(nm, elem, data) {
  7706. return new modifiers[nm](elem, data);
  7707. }
  7708. return ob;
  7709. }();
  7710. function ShapeModifier() {}
  7711. ShapeModifier.prototype.initModifierProperties = function () {};
  7712. ShapeModifier.prototype.addShapeToModifier = function () {};
  7713. ShapeModifier.prototype.addShape = function (data) {
  7714. if (!this.closed) {
  7715. // Adding shape to dynamic properties. It covers the case where a shape has no effects applied, to reset it's _mdf state on every tick.
  7716. data.sh.container.addDynamicProperty(data.sh);
  7717. var shapeData = {
  7718. shape: data.sh,
  7719. data: data,
  7720. localShapeCollection: shapeCollectionPool.newShapeCollection()
  7721. };
  7722. this.shapes.push(shapeData);
  7723. this.addShapeToModifier(shapeData);
  7724. if (this._isAnimated) {
  7725. data.setAsAnimated();
  7726. }
  7727. }
  7728. };
  7729. ShapeModifier.prototype.init = function (elem, data) {
  7730. this.shapes = [];
  7731. this.elem = elem;
  7732. this.initDynamicPropertyContainer(elem);
  7733. this.initModifierProperties(elem, data);
  7734. this.frameId = initialDefaultFrame;
  7735. this.closed = false;
  7736. this.k = false;
  7737. if (this.dynamicProperties.length) {
  7738. this.k = true;
  7739. } else {
  7740. this.getValue(true);
  7741. }
  7742. };
  7743. ShapeModifier.prototype.processKeys = function () {
  7744. if (this.elem.globalData.frameId === this.frameId) {
  7745. return;
  7746. }
  7747. this.frameId = this.elem.globalData.frameId;
  7748. this.iterateDynamicProperties();
  7749. };
  7750. extendPrototype([DynamicPropertyContainer], ShapeModifier);
  7751. function TrimModifier() {}
  7752. extendPrototype([ShapeModifier], TrimModifier);
  7753. TrimModifier.prototype.initModifierProperties = function (elem, data) {
  7754. this.s = PropertyFactory.getProp(elem, data.s, 0, 0.01, this);
  7755. this.e = PropertyFactory.getProp(elem, data.e, 0, 0.01, this);
  7756. this.o = PropertyFactory.getProp(elem, data.o, 0, 0, this);
  7757. this.sValue = 0;
  7758. this.eValue = 0;
  7759. this.getValue = this.processKeys;
  7760. this.m = data.m;
  7761. this._isAnimated = !!this.s.effectsSequence.length || !!this.e.effectsSequence.length || !!this.o.effectsSequence.length;
  7762. };
  7763. TrimModifier.prototype.addShapeToModifier = function (shapeData) {
  7764. shapeData.pathsData = [];
  7765. };
  7766. TrimModifier.prototype.calculateShapeEdges = function (s, e, shapeLength, addedLength, totalModifierLength) {
  7767. var segments = [];
  7768. if (e <= 1) {
  7769. segments.push({
  7770. s: s,
  7771. e: e
  7772. });
  7773. } else if (s >= 1) {
  7774. segments.push({
  7775. s: s - 1,
  7776. e: e - 1
  7777. });
  7778. } else {
  7779. segments.push({
  7780. s: s,
  7781. e: 1
  7782. });
  7783. segments.push({
  7784. s: 0,
  7785. e: e - 1
  7786. });
  7787. }
  7788. var shapeSegments = [];
  7789. var i;
  7790. var len = segments.length;
  7791. var segmentOb;
  7792. for (i = 0; i < len; i += 1) {
  7793. segmentOb = segments[i];
  7794. if (!(segmentOb.e * totalModifierLength < addedLength || segmentOb.s * totalModifierLength > addedLength + shapeLength)) {
  7795. var shapeS;
  7796. var shapeE;
  7797. if (segmentOb.s * totalModifierLength <= addedLength) {
  7798. shapeS = 0;
  7799. } else {
  7800. shapeS = (segmentOb.s * totalModifierLength - addedLength) / shapeLength;
  7801. }
  7802. if (segmentOb.e * totalModifierLength >= addedLength + shapeLength) {
  7803. shapeE = 1;
  7804. } else {
  7805. shapeE = (segmentOb.e * totalModifierLength - addedLength) / shapeLength;
  7806. }
  7807. shapeSegments.push([shapeS, shapeE]);
  7808. }
  7809. }
  7810. if (!shapeSegments.length) {
  7811. shapeSegments.push([0, 0]);
  7812. }
  7813. return shapeSegments;
  7814. };
  7815. TrimModifier.prototype.releasePathsData = function (pathsData) {
  7816. var i;
  7817. var len = pathsData.length;
  7818. for (i = 0; i < len; i += 1) {
  7819. segmentsLengthPool.release(pathsData[i]);
  7820. }
  7821. pathsData.length = 0;
  7822. return pathsData;
  7823. };
  7824. TrimModifier.prototype.processShapes = function (_isFirstFrame) {
  7825. var s;
  7826. var e;
  7827. if (this._mdf || _isFirstFrame) {
  7828. var o = this.o.v % 360 / 360;
  7829. if (o < 0) {
  7830. o += 1;
  7831. }
  7832. if (this.s.v > 1) {
  7833. s = 1 + o;
  7834. } else if (this.s.v < 0) {
  7835. s = 0 + o;
  7836. } else {
  7837. s = this.s.v + o;
  7838. }
  7839. if (this.e.v > 1) {
  7840. e = 1 + o;
  7841. } else if (this.e.v < 0) {
  7842. e = 0 + o;
  7843. } else {
  7844. e = this.e.v + o;
  7845. }
  7846. if (s > e) {
  7847. var _s = s;
  7848. s = e;
  7849. e = _s;
  7850. }
  7851. s = Math.round(s * 10000) * 0.0001;
  7852. e = Math.round(e * 10000) * 0.0001;
  7853. this.sValue = s;
  7854. this.eValue = e;
  7855. } else {
  7856. s = this.sValue;
  7857. e = this.eValue;
  7858. }
  7859. var shapePaths;
  7860. var i;
  7861. var len = this.shapes.length;
  7862. var j;
  7863. var jLen;
  7864. var pathsData;
  7865. var pathData;
  7866. var totalShapeLength;
  7867. var totalModifierLength = 0;
  7868. if (e === s) {
  7869. for (i = 0; i < len; i += 1) {
  7870. this.shapes[i].localShapeCollection.releaseShapes();
  7871. this.shapes[i].shape._mdf = true;
  7872. this.shapes[i].shape.paths = this.shapes[i].localShapeCollection;
  7873. if (this._mdf) {
  7874. this.shapes[i].pathsData.length = 0;
  7875. }
  7876. }
  7877. } else if (!(e === 1 && s === 0 || e === 0 && s === 1)) {
  7878. var segments = [];
  7879. var shapeData;
  7880. var localShapeCollection;
  7881. for (i = 0; i < len; i += 1) {
  7882. shapeData = this.shapes[i]; // if shape hasn't changed and trim properties haven't changed, cached previous path can be used
  7883. if (!shapeData.shape._mdf && !this._mdf && !_isFirstFrame && this.m !== 2) {
  7884. shapeData.shape.paths = shapeData.localShapeCollection;
  7885. } else {
  7886. shapePaths = shapeData.shape.paths;
  7887. jLen = shapePaths._length;
  7888. totalShapeLength = 0;
  7889. if (!shapeData.shape._mdf && shapeData.pathsData.length) {
  7890. totalShapeLength = shapeData.totalShapeLength;
  7891. } else {
  7892. pathsData = this.releasePathsData(shapeData.pathsData);
  7893. for (j = 0; j < jLen; j += 1) {
  7894. pathData = bez.getSegmentsLength(shapePaths.shapes[j]);
  7895. pathsData.push(pathData);
  7896. totalShapeLength += pathData.totalLength;
  7897. }
  7898. shapeData.totalShapeLength = totalShapeLength;
  7899. shapeData.pathsData = pathsData;
  7900. }
  7901. totalModifierLength += totalShapeLength;
  7902. shapeData.shape._mdf = true;
  7903. }
  7904. }
  7905. var shapeS = s;
  7906. var shapeE = e;
  7907. var addedLength = 0;
  7908. var edges;
  7909. for (i = len - 1; i >= 0; i -= 1) {
  7910. shapeData = this.shapes[i];
  7911. if (shapeData.shape._mdf) {
  7912. localShapeCollection = shapeData.localShapeCollection;
  7913. localShapeCollection.releaseShapes(); // if m === 2 means paths are trimmed individually so edges need to be found for this specific shape relative to whoel group
  7914. if (this.m === 2 && len > 1) {
  7915. edges = this.calculateShapeEdges(s, e, shapeData.totalShapeLength, addedLength, totalModifierLength);
  7916. addedLength += shapeData.totalShapeLength;
  7917. } else {
  7918. edges = [[shapeS, shapeE]];
  7919. }
  7920. jLen = edges.length;
  7921. for (j = 0; j < jLen; j += 1) {
  7922. shapeS = edges[j][0];
  7923. shapeE = edges[j][1];
  7924. segments.length = 0;
  7925. if (shapeE <= 1) {
  7926. segments.push({
  7927. s: shapeData.totalShapeLength * shapeS,
  7928. e: shapeData.totalShapeLength * shapeE
  7929. });
  7930. } else if (shapeS >= 1) {
  7931. segments.push({
  7932. s: shapeData.totalShapeLength * (shapeS - 1),
  7933. e: shapeData.totalShapeLength * (shapeE - 1)
  7934. });
  7935. } else {
  7936. segments.push({
  7937. s: shapeData.totalShapeLength * shapeS,
  7938. e: shapeData.totalShapeLength
  7939. });
  7940. segments.push({
  7941. s: 0,
  7942. e: shapeData.totalShapeLength * (shapeE - 1)
  7943. });
  7944. }
  7945. var newShapesData = this.addShapes(shapeData, segments[0]);
  7946. if (segments[0].s !== segments[0].e) {
  7947. if (segments.length > 1) {
  7948. var lastShapeInCollection = shapeData.shape.paths.shapes[shapeData.shape.paths._length - 1];
  7949. if (lastShapeInCollection.c) {
  7950. var lastShape = newShapesData.pop();
  7951. this.addPaths(newShapesData, localShapeCollection);
  7952. newShapesData = this.addShapes(shapeData, segments[1], lastShape);
  7953. } else {
  7954. this.addPaths(newShapesData, localShapeCollection);
  7955. newShapesData = this.addShapes(shapeData, segments[1]);
  7956. }
  7957. }
  7958. this.addPaths(newShapesData, localShapeCollection);
  7959. }
  7960. }
  7961. shapeData.shape.paths = localShapeCollection;
  7962. }
  7963. }
  7964. } else if (this._mdf) {
  7965. for (i = 0; i < len; i += 1) {
  7966. // Releasign Trim Cached paths data when no trim applied in case shapes are modified inbetween.
  7967. // Don't remove this even if it's losing cached info.
  7968. this.shapes[i].pathsData.length = 0;
  7969. this.shapes[i].shape._mdf = true;
  7970. }
  7971. }
  7972. };
  7973. TrimModifier.prototype.addPaths = function (newPaths, localShapeCollection) {
  7974. var i;
  7975. var len = newPaths.length;
  7976. for (i = 0; i < len; i += 1) {
  7977. localShapeCollection.addShape(newPaths[i]);
  7978. }
  7979. };
  7980. TrimModifier.prototype.addSegment = function (pt1, pt2, pt3, pt4, shapePath, pos, newShape) {
  7981. shapePath.setXYAt(pt2[0], pt2[1], 'o', pos);
  7982. shapePath.setXYAt(pt3[0], pt3[1], 'i', pos + 1);
  7983. if (newShape) {
  7984. shapePath.setXYAt(pt1[0], pt1[1], 'v', pos);
  7985. }
  7986. shapePath.setXYAt(pt4[0], pt4[1], 'v', pos + 1);
  7987. };
  7988. TrimModifier.prototype.addSegmentFromArray = function (points, shapePath, pos, newShape) {
  7989. shapePath.setXYAt(points[1], points[5], 'o', pos);
  7990. shapePath.setXYAt(points[2], points[6], 'i', pos + 1);
  7991. if (newShape) {
  7992. shapePath.setXYAt(points[0], points[4], 'v', pos);
  7993. }
  7994. shapePath.setXYAt(points[3], points[7], 'v', pos + 1);
  7995. };
  7996. TrimModifier.prototype.addShapes = function (shapeData, shapeSegment, shapePath) {
  7997. var pathsData = shapeData.pathsData;
  7998. var shapePaths = shapeData.shape.paths.shapes;
  7999. var i;
  8000. var len = shapeData.shape.paths._length;
  8001. var j;
  8002. var jLen;
  8003. var addedLength = 0;
  8004. var currentLengthData;
  8005. var segmentCount;
  8006. var lengths;
  8007. var segment;
  8008. var shapes = [];
  8009. var initPos;
  8010. var newShape = true;
  8011. if (!shapePath) {
  8012. shapePath = shapePool.newElement();
  8013. segmentCount = 0;
  8014. initPos = 0;
  8015. } else {
  8016. segmentCount = shapePath._length;
  8017. initPos = shapePath._length;
  8018. }
  8019. shapes.push(shapePath);
  8020. for (i = 0; i < len; i += 1) {
  8021. lengths = pathsData[i].lengths;
  8022. shapePath.c = shapePaths[i].c;
  8023. jLen = shapePaths[i].c ? lengths.length : lengths.length + 1;
  8024. for (j = 1; j < jLen; j += 1) {
  8025. currentLengthData = lengths[j - 1];
  8026. if (addedLength + currentLengthData.addedLength < shapeSegment.s) {
  8027. addedLength += currentLengthData.addedLength;
  8028. shapePath.c = false;
  8029. } else if (addedLength > shapeSegment.e) {
  8030. shapePath.c = false;
  8031. break;
  8032. } else {
  8033. if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + currentLengthData.addedLength) {
  8034. this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[j], shapePaths[i].v[j], shapePath, segmentCount, newShape);
  8035. newShape = false;
  8036. } else {
  8037. segment = bez.getNewSegment(shapePaths[i].v[j - 1], shapePaths[i].v[j], shapePaths[i].o[j - 1], shapePaths[i].i[j], (shapeSegment.s - addedLength) / currentLengthData.addedLength, (shapeSegment.e - addedLength) / currentLengthData.addedLength, lengths[j - 1]);
  8038. this.addSegmentFromArray(segment, shapePath, segmentCount, newShape); // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
  8039. newShape = false;
  8040. shapePath.c = false;
  8041. }
  8042. addedLength += currentLengthData.addedLength;
  8043. segmentCount += 1;
  8044. }
  8045. }
  8046. if (shapePaths[i].c && lengths.length) {
  8047. currentLengthData = lengths[j - 1];
  8048. if (addedLength <= shapeSegment.e) {
  8049. var segmentLength = lengths[j - 1].addedLength;
  8050. if (shapeSegment.s <= addedLength && shapeSegment.e >= addedLength + segmentLength) {
  8051. this.addSegment(shapePaths[i].v[j - 1], shapePaths[i].o[j - 1], shapePaths[i].i[0], shapePaths[i].v[0], shapePath, segmentCount, newShape);
  8052. newShape = false;
  8053. } else {
  8054. segment = bez.getNewSegment(shapePaths[i].v[j - 1], shapePaths[i].v[0], shapePaths[i].o[j - 1], shapePaths[i].i[0], (shapeSegment.s - addedLength) / segmentLength, (shapeSegment.e - addedLength) / segmentLength, lengths[j - 1]);
  8055. this.addSegmentFromArray(segment, shapePath, segmentCount, newShape); // this.addSegment(segment.pt1, segment.pt3, segment.pt4, segment.pt2, shapePath, segmentCount, newShape);
  8056. newShape = false;
  8057. shapePath.c = false;
  8058. }
  8059. } else {
  8060. shapePath.c = false;
  8061. }
  8062. addedLength += currentLengthData.addedLength;
  8063. segmentCount += 1;
  8064. }
  8065. if (shapePath._length) {
  8066. shapePath.setXYAt(shapePath.v[initPos][0], shapePath.v[initPos][1], 'i', initPos);
  8067. shapePath.setXYAt(shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1], 'o', shapePath._length - 1);
  8068. }
  8069. if (addedLength > shapeSegment.e) {
  8070. break;
  8071. }
  8072. if (i < len - 1) {
  8073. shapePath = shapePool.newElement();
  8074. newShape = true;
  8075. shapes.push(shapePath);
  8076. segmentCount = 0;
  8077. }
  8078. }
  8079. return shapes;
  8080. };
  8081. function PuckerAndBloatModifier() {}
  8082. extendPrototype([ShapeModifier], PuckerAndBloatModifier);
  8083. PuckerAndBloatModifier.prototype.initModifierProperties = function (elem, data) {
  8084. this.getValue = this.processKeys;
  8085. this.amount = PropertyFactory.getProp(elem, data.a, 0, null, this);
  8086. this._isAnimated = !!this.amount.effectsSequence.length;
  8087. };
  8088. PuckerAndBloatModifier.prototype.processPath = function (path, amount) {
  8089. var percent = amount / 100;
  8090. var centerPoint = [0, 0];
  8091. var pathLength = path._length;
  8092. var i = 0;
  8093. for (i = 0; i < pathLength; i += 1) {
  8094. centerPoint[0] += path.v[i][0];
  8095. centerPoint[1] += path.v[i][1];
  8096. }
  8097. centerPoint[0] /= pathLength;
  8098. centerPoint[1] /= pathLength;
  8099. var clonedPath = shapePool.newElement();
  8100. clonedPath.c = path.c;
  8101. var vX;
  8102. var vY;
  8103. var oX;
  8104. var oY;
  8105. var iX;
  8106. var iY;
  8107. for (i = 0; i < pathLength; i += 1) {
  8108. vX = path.v[i][0] + (centerPoint[0] - path.v[i][0]) * percent;
  8109. vY = path.v[i][1] + (centerPoint[1] - path.v[i][1]) * percent;
  8110. oX = path.o[i][0] + (centerPoint[0] - path.o[i][0]) * -percent;
  8111. oY = path.o[i][1] + (centerPoint[1] - path.o[i][1]) * -percent;
  8112. iX = path.i[i][0] + (centerPoint[0] - path.i[i][0]) * -percent;
  8113. iY = path.i[i][1] + (centerPoint[1] - path.i[i][1]) * -percent;
  8114. clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, i);
  8115. }
  8116. return clonedPath;
  8117. };
  8118. PuckerAndBloatModifier.prototype.processShapes = function (_isFirstFrame) {
  8119. var shapePaths;
  8120. var i;
  8121. var len = this.shapes.length;
  8122. var j;
  8123. var jLen;
  8124. var amount = this.amount.v;
  8125. if (amount !== 0) {
  8126. var shapeData;
  8127. var localShapeCollection;
  8128. for (i = 0; i < len; i += 1) {
  8129. shapeData = this.shapes[i];
  8130. localShapeCollection = shapeData.localShapeCollection;
  8131. if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) {
  8132. localShapeCollection.releaseShapes();
  8133. shapeData.shape._mdf = true;
  8134. shapePaths = shapeData.shape.paths.shapes;
  8135. jLen = shapeData.shape.paths._length;
  8136. for (j = 0; j < jLen; j += 1) {
  8137. localShapeCollection.addShape(this.processPath(shapePaths[j], amount));
  8138. }
  8139. }
  8140. shapeData.shape.paths = shapeData.localShapeCollection;
  8141. }
  8142. }
  8143. if (!this.dynamicProperties.length) {
  8144. this._mdf = false;
  8145. }
  8146. };
  8147. var TransformPropertyFactory = function () {
  8148. var defaultVector = [0, 0];
  8149. function applyToMatrix(mat) {
  8150. var _mdf = this._mdf;
  8151. this.iterateDynamicProperties();
  8152. this._mdf = this._mdf || _mdf;
  8153. if (this.a) {
  8154. mat.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
  8155. }
  8156. if (this.s) {
  8157. mat.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
  8158. }
  8159. if (this.sk) {
  8160. mat.skewFromAxis(-this.sk.v, this.sa.v);
  8161. }
  8162. if (this.r) {
  8163. mat.rotate(-this.r.v);
  8164. } else {
  8165. mat.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]);
  8166. }
  8167. if (this.data.p.s) {
  8168. if (this.data.p.z) {
  8169. mat.translate(this.px.v, this.py.v, -this.pz.v);
  8170. } else {
  8171. mat.translate(this.px.v, this.py.v, 0);
  8172. }
  8173. } else {
  8174. mat.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
  8175. }
  8176. }
  8177. function processKeys(forceRender) {
  8178. if (this.elem.globalData.frameId === this.frameId) {
  8179. return;
  8180. }
  8181. if (this._isDirty) {
  8182. this.precalculateMatrix();
  8183. this._isDirty = false;
  8184. }
  8185. this.iterateDynamicProperties();
  8186. if (this._mdf || forceRender) {
  8187. var frameRate;
  8188. this.v.cloneFromProps(this.pre.props);
  8189. if (this.appliedTransformations < 1) {
  8190. this.v.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
  8191. }
  8192. if (this.appliedTransformations < 2) {
  8193. this.v.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
  8194. }
  8195. if (this.sk && this.appliedTransformations < 3) {
  8196. this.v.skewFromAxis(-this.sk.v, this.sa.v);
  8197. }
  8198. if (this.r && this.appliedTransformations < 4) {
  8199. this.v.rotate(-this.r.v);
  8200. } else if (!this.r && this.appliedTransformations < 4) {
  8201. 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]);
  8202. }
  8203. if (this.autoOriented) {
  8204. var v1;
  8205. var v2;
  8206. frameRate = this.elem.globalData.frameRate;
  8207. if (this.p && this.p.keyframes && this.p.getValueAtTime) {
  8208. if (this.p._caching.lastFrame + this.p.offsetTime <= this.p.keyframes[0].t) {
  8209. v1 = this.p.getValueAtTime((this.p.keyframes[0].t + 0.01) / frameRate, 0);
  8210. v2 = this.p.getValueAtTime(this.p.keyframes[0].t / frameRate, 0);
  8211. } else if (this.p._caching.lastFrame + this.p.offsetTime >= this.p.keyframes[this.p.keyframes.length - 1].t) {
  8212. v1 = this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length - 1].t / frameRate, 0);
  8213. v2 = this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length - 1].t - 0.05) / frameRate, 0);
  8214. } else {
  8215. v1 = this.p.pv;
  8216. v2 = this.p.getValueAtTime((this.p._caching.lastFrame + this.p.offsetTime - 0.01) / frameRate, this.p.offsetTime);
  8217. }
  8218. } else if (this.px && this.px.keyframes && this.py.keyframes && this.px.getValueAtTime && this.py.getValueAtTime) {
  8219. v1 = [];
  8220. v2 = [];
  8221. var px = this.px;
  8222. var py = this.py;
  8223. if (px._caching.lastFrame + px.offsetTime <= px.keyframes[0].t) {
  8224. v1[0] = px.getValueAtTime((px.keyframes[0].t + 0.01) / frameRate, 0);
  8225. v1[1] = py.getValueAtTime((py.keyframes[0].t + 0.01) / frameRate, 0);
  8226. v2[0] = px.getValueAtTime(px.keyframes[0].t / frameRate, 0);
  8227. v2[1] = py.getValueAtTime(py.keyframes[0].t / frameRate, 0);
  8228. } else if (px._caching.lastFrame + px.offsetTime >= px.keyframes[px.keyframes.length - 1].t) {
  8229. v1[0] = px.getValueAtTime(px.keyframes[px.keyframes.length - 1].t / frameRate, 0);
  8230. v1[1] = py.getValueAtTime(py.keyframes[py.keyframes.length - 1].t / frameRate, 0);
  8231. v2[0] = px.getValueAtTime((px.keyframes[px.keyframes.length - 1].t - 0.01) / frameRate, 0);
  8232. v2[1] = py.getValueAtTime((py.keyframes[py.keyframes.length - 1].t - 0.01) / frameRate, 0);
  8233. } else {
  8234. v1 = [px.pv, py.pv];
  8235. v2[0] = px.getValueAtTime((px._caching.lastFrame + px.offsetTime - 0.01) / frameRate, px.offsetTime);
  8236. v2[1] = py.getValueAtTime((py._caching.lastFrame + py.offsetTime - 0.01) / frameRate, py.offsetTime);
  8237. }
  8238. } else {
  8239. v2 = defaultVector;
  8240. v1 = v2;
  8241. }
  8242. this.v.rotate(-Math.atan2(v1[1] - v2[1], v1[0] - v2[0]));
  8243. }
  8244. if (this.data.p && this.data.p.s) {
  8245. if (this.data.p.z) {
  8246. this.v.translate(this.px.v, this.py.v, -this.pz.v);
  8247. } else {
  8248. this.v.translate(this.px.v, this.py.v, 0);
  8249. }
  8250. } else {
  8251. this.v.translate(this.p.v[0], this.p.v[1], -this.p.v[2]);
  8252. }
  8253. }
  8254. this.frameId = this.elem.globalData.frameId;
  8255. }
  8256. function precalculateMatrix() {
  8257. this.appliedTransformations = 0;
  8258. this.pre.reset();
  8259. if (!this.a.effectsSequence.length) {
  8260. this.pre.translate(-this.a.v[0], -this.a.v[1], this.a.v[2]);
  8261. this.appliedTransformations = 1;
  8262. } else {
  8263. return;
  8264. }
  8265. if (!this.s.effectsSequence.length) {
  8266. this.pre.scale(this.s.v[0], this.s.v[1], this.s.v[2]);
  8267. this.appliedTransformations = 2;
  8268. } else {
  8269. return;
  8270. }
  8271. if (this.sk) {
  8272. if (!this.sk.effectsSequence.length && !this.sa.effectsSequence.length) {
  8273. this.pre.skewFromAxis(-this.sk.v, this.sa.v);
  8274. this.appliedTransformations = 3;
  8275. } else {
  8276. return;
  8277. }
  8278. }
  8279. if (this.r) {
  8280. if (!this.r.effectsSequence.length) {
  8281. this.pre.rotate(-this.r.v);
  8282. this.appliedTransformations = 4;
  8283. }
  8284. } else if (!this.rz.effectsSequence.length && !this.ry.effectsSequence.length && !this.rx.effectsSequence.length && !this.or.effectsSequence.length) {
  8285. 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]);
  8286. this.appliedTransformations = 4;
  8287. }
  8288. }
  8289. function autoOrient() {//
  8290. // var prevP = this.getValueAtTime();
  8291. }
  8292. function addDynamicProperty(prop) {
  8293. this._addDynamicProperty(prop);
  8294. this.elem.addDynamicProperty(prop);
  8295. this._isDirty = true;
  8296. }
  8297. function TransformProperty(elem, data, container) {
  8298. this.elem = elem;
  8299. this.frameId = -1;
  8300. this.propType = 'transform';
  8301. this.data = data;
  8302. this.v = new Matrix(); // Precalculated matrix with non animated properties
  8303. this.pre = new Matrix();
  8304. this.appliedTransformations = 0;
  8305. this.initDynamicPropertyContainer(container || elem);
  8306. if (data.p && data.p.s) {
  8307. this.px = PropertyFactory.getProp(elem, data.p.x, 0, 0, this);
  8308. this.py = PropertyFactory.getProp(elem, data.p.y, 0, 0, this);
  8309. if (data.p.z) {
  8310. this.pz = PropertyFactory.getProp(elem, data.p.z, 0, 0, this);
  8311. }
  8312. } else {
  8313. this.p = PropertyFactory.getProp(elem, data.p || {
  8314. k: [0, 0, 0]
  8315. }, 1, 0, this);
  8316. }
  8317. if (data.rx) {
  8318. this.rx = PropertyFactory.getProp(elem, data.rx, 0, degToRads, this);
  8319. this.ry = PropertyFactory.getProp(elem, data.ry, 0, degToRads, this);
  8320. this.rz = PropertyFactory.getProp(elem, data.rz, 0, degToRads, this);
  8321. if (data.or.k[0].ti) {
  8322. var i;
  8323. var len = data.or.k.length;
  8324. for (i = 0; i < len; i += 1) {
  8325. data.or.k[i].to = null;
  8326. data.or.k[i].ti = null;
  8327. }
  8328. }
  8329. this.or = PropertyFactory.getProp(elem, data.or, 1, degToRads, this); // sh Indicates it needs to be capped between -180 and 180
  8330. this.or.sh = true;
  8331. } else {
  8332. this.r = PropertyFactory.getProp(elem, data.r || {
  8333. k: 0
  8334. }, 0, degToRads, this);
  8335. }
  8336. if (data.sk) {
  8337. this.sk = PropertyFactory.getProp(elem, data.sk, 0, degToRads, this);
  8338. this.sa = PropertyFactory.getProp(elem, data.sa, 0, degToRads, this);
  8339. }
  8340. this.a = PropertyFactory.getProp(elem, data.a || {
  8341. k: [0, 0, 0]
  8342. }, 1, 0, this);
  8343. this.s = PropertyFactory.getProp(elem, data.s || {
  8344. k: [100, 100, 100]
  8345. }, 1, 0.01, this); // Opacity is not part of the transform properties, that's why it won't use this.dynamicProperties. That way transforms won't get updated if opacity changes.
  8346. if (data.o) {
  8347. this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, elem);
  8348. } else {
  8349. this.o = {
  8350. _mdf: false,
  8351. v: 1
  8352. };
  8353. }
  8354. this._isDirty = true;
  8355. if (!this.dynamicProperties.length) {
  8356. this.getValue(true);
  8357. }
  8358. }
  8359. TransformProperty.prototype = {
  8360. applyToMatrix: applyToMatrix,
  8361. getValue: processKeys,
  8362. precalculateMatrix: precalculateMatrix,
  8363. autoOrient: autoOrient
  8364. };
  8365. extendPrototype([DynamicPropertyContainer], TransformProperty);
  8366. TransformProperty.prototype.addDynamicProperty = addDynamicProperty;
  8367. TransformProperty.prototype._addDynamicProperty = DynamicPropertyContainer.prototype.addDynamicProperty;
  8368. function getTransformProperty(elem, data, container) {
  8369. return new TransformProperty(elem, data, container);
  8370. }
  8371. return {
  8372. getTransformProperty: getTransformProperty
  8373. };
  8374. }();
  8375. function RepeaterModifier() {}
  8376. extendPrototype([ShapeModifier], RepeaterModifier);
  8377. RepeaterModifier.prototype.initModifierProperties = function (elem, data) {
  8378. this.getValue = this.processKeys;
  8379. this.c = PropertyFactory.getProp(elem, data.c, 0, null, this);
  8380. this.o = PropertyFactory.getProp(elem, data.o, 0, null, this);
  8381. this.tr = TransformPropertyFactory.getTransformProperty(elem, data.tr, this);
  8382. this.so = PropertyFactory.getProp(elem, data.tr.so, 0, 0.01, this);
  8383. this.eo = PropertyFactory.getProp(elem, data.tr.eo, 0, 0.01, this);
  8384. this.data = data;
  8385. if (!this.dynamicProperties.length) {
  8386. this.getValue(true);
  8387. }
  8388. this._isAnimated = !!this.dynamicProperties.length;
  8389. this.pMatrix = new Matrix();
  8390. this.rMatrix = new Matrix();
  8391. this.sMatrix = new Matrix();
  8392. this.tMatrix = new Matrix();
  8393. this.matrix = new Matrix();
  8394. };
  8395. RepeaterModifier.prototype.applyTransforms = function (pMatrix, rMatrix, sMatrix, transform, perc, inv) {
  8396. var dir = inv ? -1 : 1;
  8397. var scaleX = transform.s.v[0] + (1 - transform.s.v[0]) * (1 - perc);
  8398. var scaleY = transform.s.v[1] + (1 - transform.s.v[1]) * (1 - perc);
  8399. pMatrix.translate(transform.p.v[0] * dir * perc, transform.p.v[1] * dir * perc, transform.p.v[2]);
  8400. rMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
  8401. rMatrix.rotate(-transform.r.v * dir * perc);
  8402. rMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
  8403. sMatrix.translate(-transform.a.v[0], -transform.a.v[1], transform.a.v[2]);
  8404. sMatrix.scale(inv ? 1 / scaleX : scaleX, inv ? 1 / scaleY : scaleY);
  8405. sMatrix.translate(transform.a.v[0], transform.a.v[1], transform.a.v[2]);
  8406. };
  8407. RepeaterModifier.prototype.init = function (elem, arr, pos, elemsData) {
  8408. this.elem = elem;
  8409. this.arr = arr;
  8410. this.pos = pos;
  8411. this.elemsData = elemsData;
  8412. this._currentCopies = 0;
  8413. this._elements = [];
  8414. this._groups = [];
  8415. this.frameId = -1;
  8416. this.initDynamicPropertyContainer(elem);
  8417. this.initModifierProperties(elem, arr[pos]);
  8418. while (pos > 0) {
  8419. pos -= 1; // this._elements.unshift(arr.splice(pos,1)[0]);
  8420. this._elements.unshift(arr[pos]);
  8421. }
  8422. if (this.dynamicProperties.length) {
  8423. this.k = true;
  8424. } else {
  8425. this.getValue(true);
  8426. }
  8427. };
  8428. RepeaterModifier.prototype.resetElements = function (elements) {
  8429. var i;
  8430. var len = elements.length;
  8431. for (i = 0; i < len; i += 1) {
  8432. elements[i]._processed = false;
  8433. if (elements[i].ty === 'gr') {
  8434. this.resetElements(elements[i].it);
  8435. }
  8436. }
  8437. };
  8438. RepeaterModifier.prototype.cloneElements = function (elements) {
  8439. var newElements = JSON.parse(JSON.stringify(elements));
  8440. this.resetElements(newElements);
  8441. return newElements;
  8442. };
  8443. RepeaterModifier.prototype.changeGroupRender = function (elements, renderFlag) {
  8444. var i;
  8445. var len = elements.length;
  8446. for (i = 0; i < len; i += 1) {
  8447. elements[i]._render = renderFlag;
  8448. if (elements[i].ty === 'gr') {
  8449. this.changeGroupRender(elements[i].it, renderFlag);
  8450. }
  8451. }
  8452. };
  8453. RepeaterModifier.prototype.processShapes = function (_isFirstFrame) {
  8454. var items;
  8455. var itemsTransform;
  8456. var i;
  8457. var dir;
  8458. var cont;
  8459. var hasReloaded = false;
  8460. if (this._mdf || _isFirstFrame) {
  8461. var copies = Math.ceil(this.c.v);
  8462. if (this._groups.length < copies) {
  8463. while (this._groups.length < copies) {
  8464. var group = {
  8465. it: this.cloneElements(this._elements),
  8466. ty: 'gr'
  8467. };
  8468. group.it.push({
  8469. a: {
  8470. a: 0,
  8471. ix: 1,
  8472. k: [0, 0]
  8473. },
  8474. nm: 'Transform',
  8475. o: {
  8476. a: 0,
  8477. ix: 7,
  8478. k: 100
  8479. },
  8480. p: {
  8481. a: 0,
  8482. ix: 2,
  8483. k: [0, 0]
  8484. },
  8485. r: {
  8486. a: 1,
  8487. ix: 6,
  8488. k: [{
  8489. s: 0,
  8490. e: 0,
  8491. t: 0
  8492. }, {
  8493. s: 0,
  8494. e: 0,
  8495. t: 1
  8496. }]
  8497. },
  8498. s: {
  8499. a: 0,
  8500. ix: 3,
  8501. k: [100, 100]
  8502. },
  8503. sa: {
  8504. a: 0,
  8505. ix: 5,
  8506. k: 0
  8507. },
  8508. sk: {
  8509. a: 0,
  8510. ix: 4,
  8511. k: 0
  8512. },
  8513. ty: 'tr'
  8514. });
  8515. this.arr.splice(0, 0, group);
  8516. this._groups.splice(0, 0, group);
  8517. this._currentCopies += 1;
  8518. }
  8519. this.elem.reloadShapes();
  8520. hasReloaded = true;
  8521. }
  8522. cont = 0;
  8523. var renderFlag;
  8524. for (i = 0; i <= this._groups.length - 1; i += 1) {
  8525. renderFlag = cont < copies;
  8526. this._groups[i]._render = renderFlag;
  8527. this.changeGroupRender(this._groups[i].it, renderFlag);
  8528. if (!renderFlag) {
  8529. var elems = this.elemsData[i].it;
  8530. var transformData = elems[elems.length - 1];
  8531. if (transformData.transform.op.v !== 0) {
  8532. transformData.transform.op._mdf = true;
  8533. transformData.transform.op.v = 0;
  8534. } else {
  8535. transformData.transform.op._mdf = false;
  8536. }
  8537. }
  8538. cont += 1;
  8539. }
  8540. this._currentCopies = copies; /// /
  8541. var offset = this.o.v;
  8542. var offsetModulo = offset % 1;
  8543. var roundOffset = offset > 0 ? Math.floor(offset) : Math.ceil(offset);
  8544. var pProps = this.pMatrix.props;
  8545. var rProps = this.rMatrix.props;
  8546. var sProps = this.sMatrix.props;
  8547. this.pMatrix.reset();
  8548. this.rMatrix.reset();
  8549. this.sMatrix.reset();
  8550. this.tMatrix.reset();
  8551. this.matrix.reset();
  8552. var iteration = 0;
  8553. if (offset > 0) {
  8554. while (iteration < roundOffset) {
  8555. this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
  8556. iteration += 1;
  8557. }
  8558. if (offsetModulo) {
  8559. this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, offsetModulo, false);
  8560. iteration += offsetModulo;
  8561. }
  8562. } else if (offset < 0) {
  8563. while (iteration > roundOffset) {
  8564. this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, true);
  8565. iteration -= 1;
  8566. }
  8567. if (offsetModulo) {
  8568. this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, -offsetModulo, true);
  8569. iteration -= offsetModulo;
  8570. }
  8571. }
  8572. i = this.data.m === 1 ? 0 : this._currentCopies - 1;
  8573. dir = this.data.m === 1 ? 1 : -1;
  8574. cont = this._currentCopies;
  8575. var j;
  8576. var jLen;
  8577. while (cont) {
  8578. items = this.elemsData[i].it;
  8579. itemsTransform = items[items.length - 1].transform.mProps.v.props;
  8580. jLen = itemsTransform.length;
  8581. items[items.length - 1].transform.mProps._mdf = true;
  8582. items[items.length - 1].transform.op._mdf = true;
  8583. items[items.length - 1].transform.op.v = this._currentCopies === 1 ? this.so.v : this.so.v + (this.eo.v - this.so.v) * (i / (this._currentCopies - 1));
  8584. if (iteration !== 0) {
  8585. if (i !== 0 && dir === 1 || i !== this._currentCopies - 1 && dir === -1) {
  8586. this.applyTransforms(this.pMatrix, this.rMatrix, this.sMatrix, this.tr, 1, false);
  8587. }
  8588. this.matrix.transform(rProps[0], rProps[1], rProps[2], rProps[3], rProps[4], rProps[5], rProps[6], rProps[7], rProps[8], rProps[9], rProps[10], rProps[11], rProps[12], rProps[13], rProps[14], rProps[15]);
  8589. this.matrix.transform(sProps[0], sProps[1], sProps[2], sProps[3], sProps[4], sProps[5], sProps[6], sProps[7], sProps[8], sProps[9], sProps[10], sProps[11], sProps[12], sProps[13], sProps[14], sProps[15]);
  8590. this.matrix.transform(pProps[0], pProps[1], pProps[2], pProps[3], pProps[4], pProps[5], pProps[6], pProps[7], pProps[8], pProps[9], pProps[10], pProps[11], pProps[12], pProps[13], pProps[14], pProps[15]);
  8591. for (j = 0; j < jLen; j += 1) {
  8592. itemsTransform[j] = this.matrix.props[j];
  8593. }
  8594. this.matrix.reset();
  8595. } else {
  8596. this.matrix.reset();
  8597. for (j = 0; j < jLen; j += 1) {
  8598. itemsTransform[j] = this.matrix.props[j];
  8599. }
  8600. }
  8601. iteration += 1;
  8602. cont -= 1;
  8603. i += dir;
  8604. }
  8605. } else {
  8606. cont = this._currentCopies;
  8607. i = 0;
  8608. dir = 1;
  8609. while (cont) {
  8610. items = this.elemsData[i].it;
  8611. itemsTransform = items[items.length - 1].transform.mProps.v.props;
  8612. items[items.length - 1].transform.mProps._mdf = false;
  8613. items[items.length - 1].transform.op._mdf = false;
  8614. cont -= 1;
  8615. i += dir;
  8616. }
  8617. }
  8618. return hasReloaded;
  8619. };
  8620. RepeaterModifier.prototype.addShape = function () {};
  8621. function RoundCornersModifier() {}
  8622. extendPrototype([ShapeModifier], RoundCornersModifier);
  8623. RoundCornersModifier.prototype.initModifierProperties = function (elem, data) {
  8624. this.getValue = this.processKeys;
  8625. this.rd = PropertyFactory.getProp(elem, data.r, 0, null, this);
  8626. this._isAnimated = !!this.rd.effectsSequence.length;
  8627. };
  8628. RoundCornersModifier.prototype.processPath = function (path, round) {
  8629. var clonedPath = shapePool.newElement();
  8630. clonedPath.c = path.c;
  8631. var i;
  8632. var len = path._length;
  8633. var currentV;
  8634. var currentI;
  8635. var currentO;
  8636. var closerV;
  8637. var distance;
  8638. var newPosPerc;
  8639. var index = 0;
  8640. var vX;
  8641. var vY;
  8642. var oX;
  8643. var oY;
  8644. var iX;
  8645. var iY;
  8646. for (i = 0; i < len; i += 1) {
  8647. currentV = path.v[i];
  8648. currentO = path.o[i];
  8649. currentI = path.i[i];
  8650. if (currentV[0] === currentO[0] && currentV[1] === currentO[1] && currentV[0] === currentI[0] && currentV[1] === currentI[1]) {
  8651. if ((i === 0 || i === len - 1) && !path.c) {
  8652. clonedPath.setTripleAt(currentV[0], currentV[1], currentO[0], currentO[1], currentI[0], currentI[1], index);
  8653. /* clonedPath.v[index] = currentV;
  8654. clonedPath.o[index] = currentO;
  8655. clonedPath.i[index] = currentI; */
  8656. index += 1;
  8657. } else {
  8658. if (i === 0) {
  8659. closerV = path.v[len - 1];
  8660. } else {
  8661. closerV = path.v[i - 1];
  8662. }
  8663. distance = Math.sqrt(Math.pow(currentV[0] - closerV[0], 2) + Math.pow(currentV[1] - closerV[1], 2));
  8664. newPosPerc = distance ? Math.min(distance / 2, round) / distance : 0;
  8665. iX = currentV[0] + (closerV[0] - currentV[0]) * newPosPerc;
  8666. vX = iX;
  8667. iY = currentV[1] - (currentV[1] - closerV[1]) * newPosPerc;
  8668. vY = iY;
  8669. oX = vX - (vX - currentV[0]) * roundCorner;
  8670. oY = vY - (vY - currentV[1]) * roundCorner;
  8671. clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, index);
  8672. index += 1;
  8673. if (i === len - 1) {
  8674. closerV = path.v[0];
  8675. } else {
  8676. closerV = path.v[i + 1];
  8677. }
  8678. distance = Math.sqrt(Math.pow(currentV[0] - closerV[0], 2) + Math.pow(currentV[1] - closerV[1], 2));
  8679. newPosPerc = distance ? Math.min(distance / 2, round) / distance : 0;
  8680. oX = currentV[0] + (closerV[0] - currentV[0]) * newPosPerc;
  8681. vX = oX;
  8682. oY = currentV[1] + (closerV[1] - currentV[1]) * newPosPerc;
  8683. vY = oY;
  8684. iX = vX - (vX - currentV[0]) * roundCorner;
  8685. iY = vY - (vY - currentV[1]) * roundCorner;
  8686. clonedPath.setTripleAt(vX, vY, oX, oY, iX, iY, index);
  8687. index += 1;
  8688. }
  8689. } else {
  8690. clonedPath.setTripleAt(path.v[i][0], path.v[i][1], path.o[i][0], path.o[i][1], path.i[i][0], path.i[i][1], index);
  8691. index += 1;
  8692. }
  8693. }
  8694. return clonedPath;
  8695. };
  8696. RoundCornersModifier.prototype.processShapes = function (_isFirstFrame) {
  8697. var shapePaths;
  8698. var i;
  8699. var len = this.shapes.length;
  8700. var j;
  8701. var jLen;
  8702. var rd = this.rd.v;
  8703. if (rd !== 0) {
  8704. var shapeData;
  8705. var localShapeCollection;
  8706. for (i = 0; i < len; i += 1) {
  8707. shapeData = this.shapes[i];
  8708. localShapeCollection = shapeData.localShapeCollection;
  8709. if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) {
  8710. localShapeCollection.releaseShapes();
  8711. shapeData.shape._mdf = true;
  8712. shapePaths = shapeData.shape.paths.shapes;
  8713. jLen = shapeData.shape.paths._length;
  8714. for (j = 0; j < jLen; j += 1) {
  8715. localShapeCollection.addShape(this.processPath(shapePaths[j], rd));
  8716. }
  8717. }
  8718. shapeData.shape.paths = shapeData.localShapeCollection;
  8719. }
  8720. }
  8721. if (!this.dynamicProperties.length) {
  8722. this._mdf = false;
  8723. }
  8724. };
  8725. function floatEqual(a, b) {
  8726. return Math.abs(a - b) * 100000 <= Math.min(Math.abs(a), Math.abs(b));
  8727. }
  8728. function floatZero(f) {
  8729. return Math.abs(f) <= 0.00001;
  8730. }
  8731. function lerp(p0, p1, amount) {
  8732. return p0 * (1 - amount) + p1 * amount;
  8733. }
  8734. function lerpPoint(p0, p1, amount) {
  8735. return [lerp(p0[0], p1[0], amount), lerp(p0[1], p1[1], amount)];
  8736. }
  8737. function quadRoots(a, b, c) {
  8738. // no root
  8739. if (a === 0) return [];
  8740. var s = b * b - 4 * a * c; // Complex roots
  8741. if (s < 0) return [];
  8742. var singleRoot = -b / (2 * a); // 1 root
  8743. if (s === 0) return [singleRoot];
  8744. var delta = Math.sqrt(s) / (2 * a); // 2 roots
  8745. return [singleRoot - delta, singleRoot + delta];
  8746. }
  8747. function polynomialCoefficients(p0, p1, p2, p3) {
  8748. return [-p0 + 3 * p1 - 3 * p2 + p3, 3 * p0 - 6 * p1 + 3 * p2, -3 * p0 + 3 * p1, p0];
  8749. }
  8750. function singlePoint(p) {
  8751. return new PolynomialBezier(p, p, p, p, false);
  8752. }
  8753. function PolynomialBezier(p0, p1, p2, p3, linearize) {
  8754. if (linearize && pointEqual(p0, p1)) {
  8755. p1 = lerpPoint(p0, p3, 1 / 3);
  8756. }
  8757. if (linearize && pointEqual(p2, p3)) {
  8758. p2 = lerpPoint(p0, p3, 2 / 3);
  8759. }
  8760. var coeffx = polynomialCoefficients(p0[0], p1[0], p2[0], p3[0]);
  8761. var coeffy = polynomialCoefficients(p0[1], p1[1], p2[1], p3[1]);
  8762. this.a = [coeffx[0], coeffy[0]];
  8763. this.b = [coeffx[1], coeffy[1]];
  8764. this.c = [coeffx[2], coeffy[2]];
  8765. this.d = [coeffx[3], coeffy[3]];
  8766. this.points = [p0, p1, p2, p3];
  8767. }
  8768. PolynomialBezier.prototype.point = function (t) {
  8769. return [((this.a[0] * t + this.b[0]) * t + this.c[0]) * t + this.d[0], ((this.a[1] * t + this.b[1]) * t + this.c[1]) * t + this.d[1]];
  8770. };
  8771. PolynomialBezier.prototype.derivative = function (t) {
  8772. return [(3 * t * this.a[0] + 2 * this.b[0]) * t + this.c[0], (3 * t * this.a[1] + 2 * this.b[1]) * t + this.c[1]];
  8773. };
  8774. PolynomialBezier.prototype.tangentAngle = function (t) {
  8775. var p = this.derivative(t);
  8776. return Math.atan2(p[1], p[0]);
  8777. };
  8778. PolynomialBezier.prototype.normalAngle = function (t) {
  8779. var p = this.derivative(t);
  8780. return Math.atan2(p[0], p[1]);
  8781. };
  8782. PolynomialBezier.prototype.inflectionPoints = function () {
  8783. var denom = this.a[1] * this.b[0] - this.a[0] * this.b[1];
  8784. if (floatZero(denom)) return [];
  8785. var tcusp = -0.5 * (this.a[1] * this.c[0] - this.a[0] * this.c[1]) / denom;
  8786. var square = tcusp * tcusp - 1 / 3 * (this.b[1] * this.c[0] - this.b[0] * this.c[1]) / denom;
  8787. if (square < 0) return [];
  8788. var root = Math.sqrt(square);
  8789. if (floatZero(root)) {
  8790. if (root > 0 && root < 1) return [tcusp];
  8791. return [];
  8792. }
  8793. return [tcusp - root, tcusp + root].filter(function (r) {
  8794. return r > 0 && r < 1;
  8795. });
  8796. };
  8797. PolynomialBezier.prototype.split = function (t) {
  8798. if (t <= 0) return [singlePoint(this.points[0]), this];
  8799. if (t >= 1) return [this, singlePoint(this.points[this.points.length - 1])];
  8800. var p10 = lerpPoint(this.points[0], this.points[1], t);
  8801. var p11 = lerpPoint(this.points[1], this.points[2], t);
  8802. var p12 = lerpPoint(this.points[2], this.points[3], t);
  8803. var p20 = lerpPoint(p10, p11, t);
  8804. var p21 = lerpPoint(p11, p12, t);
  8805. var p3 = lerpPoint(p20, p21, t);
  8806. return [new PolynomialBezier(this.points[0], p10, p20, p3, true), new PolynomialBezier(p3, p21, p12, this.points[3], true)];
  8807. };
  8808. function extrema(bez, comp) {
  8809. var min = bez.points[0][comp];
  8810. var max = bez.points[bez.points.length - 1][comp];
  8811. if (min > max) {
  8812. var e = max;
  8813. max = min;
  8814. min = e;
  8815. } // Derivative roots to find min/max
  8816. var f = quadRoots(3 * bez.a[comp], 2 * bez.b[comp], bez.c[comp]);
  8817. for (var i = 0; i < f.length; i += 1) {
  8818. if (f[i] > 0 && f[i] < 1) {
  8819. var val = bez.point(f[i])[comp];
  8820. if (val < min) min = val;else if (val > max) max = val;
  8821. }
  8822. }
  8823. return {
  8824. min: min,
  8825. max: max
  8826. };
  8827. }
  8828. PolynomialBezier.prototype.bounds = function () {
  8829. return {
  8830. x: extrema(this, 0),
  8831. y: extrema(this, 1)
  8832. };
  8833. };
  8834. PolynomialBezier.prototype.boundingBox = function () {
  8835. var bounds = this.bounds();
  8836. return {
  8837. left: bounds.x.min,
  8838. right: bounds.x.max,
  8839. top: bounds.y.min,
  8840. bottom: bounds.y.max,
  8841. width: bounds.x.max - bounds.x.min,
  8842. height: bounds.y.max - bounds.y.min,
  8843. cx: (bounds.x.max + bounds.x.min) / 2,
  8844. cy: (bounds.y.max + bounds.y.min) / 2
  8845. };
  8846. };
  8847. function intersectData(bez, t1, t2) {
  8848. var box = bez.boundingBox();
  8849. return {
  8850. cx: box.cx,
  8851. cy: box.cy,
  8852. width: box.width,
  8853. height: box.height,
  8854. bez: bez,
  8855. t: (t1 + t2) / 2,
  8856. t1: t1,
  8857. t2: t2
  8858. };
  8859. }
  8860. function splitData(data) {
  8861. var split = data.bez.split(0.5);
  8862. return [intersectData(split[0], data.t1, data.t), intersectData(split[1], data.t, data.t2)];
  8863. }
  8864. function boxIntersect(b1, b2) {
  8865. return Math.abs(b1.cx - b2.cx) * 2 < b1.width + b2.width && Math.abs(b1.cy - b2.cy) * 2 < b1.height + b2.height;
  8866. }
  8867. function intersectsImpl(d1, d2, depth, tolerance, intersections, maxRecursion) {
  8868. if (!boxIntersect(d1, d2)) return;
  8869. if (depth >= maxRecursion || d1.width <= tolerance && d1.height <= tolerance && d2.width <= tolerance && d2.height <= tolerance) {
  8870. intersections.push([d1.t, d2.t]);
  8871. return;
  8872. }
  8873. var d1s = splitData(d1);
  8874. var d2s = splitData(d2);
  8875. intersectsImpl(d1s[0], d2s[0], depth + 1, tolerance, intersections, maxRecursion);
  8876. intersectsImpl(d1s[0], d2s[1], depth + 1, tolerance, intersections, maxRecursion);
  8877. intersectsImpl(d1s[1], d2s[0], depth + 1, tolerance, intersections, maxRecursion);
  8878. intersectsImpl(d1s[1], d2s[1], depth + 1, tolerance, intersections, maxRecursion);
  8879. }
  8880. PolynomialBezier.prototype.intersections = function (other, tolerance, maxRecursion) {
  8881. if (tolerance === undefined) tolerance = 2;
  8882. if (maxRecursion === undefined) maxRecursion = 7;
  8883. var intersections = [];
  8884. intersectsImpl(intersectData(this, 0, 1), intersectData(other, 0, 1), 0, tolerance, intersections, maxRecursion);
  8885. return intersections;
  8886. };
  8887. PolynomialBezier.shapeSegment = function (shapePath, index) {
  8888. var nextIndex = (index + 1) % shapePath.length();
  8889. return new PolynomialBezier(shapePath.v[index], shapePath.o[index], shapePath.i[nextIndex], shapePath.v[nextIndex], true);
  8890. };
  8891. PolynomialBezier.shapeSegmentInverted = function (shapePath, index) {
  8892. var nextIndex = (index + 1) % shapePath.length();
  8893. return new PolynomialBezier(shapePath.v[nextIndex], shapePath.i[nextIndex], shapePath.o[index], shapePath.v[index], true);
  8894. };
  8895. function crossProduct(a, b) {
  8896. return [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]];
  8897. }
  8898. function lineIntersection(start1, end1, start2, end2) {
  8899. var v1 = [start1[0], start1[1], 1];
  8900. var v2 = [end1[0], end1[1], 1];
  8901. var v3 = [start2[0], start2[1], 1];
  8902. var v4 = [end2[0], end2[1], 1];
  8903. var r = crossProduct(crossProduct(v1, v2), crossProduct(v3, v4));
  8904. if (floatZero(r[2])) return null;
  8905. return [r[0] / r[2], r[1] / r[2]];
  8906. }
  8907. function polarOffset(p, angle, length) {
  8908. return [p[0] + Math.cos(angle) * length, p[1] - Math.sin(angle) * length];
  8909. }
  8910. function pointDistance(p1, p2) {
  8911. return Math.hypot(p1[0] - p2[0], p1[1] - p2[1]);
  8912. }
  8913. function pointEqual(p1, p2) {
  8914. return floatEqual(p1[0], p2[0]) && floatEqual(p1[1], p2[1]);
  8915. }
  8916. function ZigZagModifier() {}
  8917. extendPrototype([ShapeModifier], ZigZagModifier);
  8918. ZigZagModifier.prototype.initModifierProperties = function (elem, data) {
  8919. this.getValue = this.processKeys;
  8920. this.amplitude = PropertyFactory.getProp(elem, data.s, 0, null, this);
  8921. this.frequency = PropertyFactory.getProp(elem, data.r, 0, null, this);
  8922. this.pointsType = PropertyFactory.getProp(elem, data.pt, 0, null, this);
  8923. this._isAnimated = this.amplitude.effectsSequence.length !== 0 || this.frequency.effectsSequence.length !== 0 || this.pointsType.effectsSequence.length !== 0;
  8924. };
  8925. function setPoint(outputBezier, point, angle, direction, amplitude, outAmplitude, inAmplitude) {
  8926. var angO = angle - Math.PI / 2;
  8927. var angI = angle + Math.PI / 2;
  8928. var px = point[0] + Math.cos(angle) * direction * amplitude;
  8929. var py = point[1] - Math.sin(angle) * direction * amplitude;
  8930. outputBezier.setTripleAt(px, py, px + Math.cos(angO) * outAmplitude, py - Math.sin(angO) * outAmplitude, px + Math.cos(angI) * inAmplitude, py - Math.sin(angI) * inAmplitude, outputBezier.length());
  8931. }
  8932. function getPerpendicularVector(pt1, pt2) {
  8933. var vector = [pt2[0] - pt1[0], pt2[1] - pt1[1]];
  8934. var rot = -Math.PI * 0.5;
  8935. var rotatedVector = [Math.cos(rot) * vector[0] - Math.sin(rot) * vector[1], Math.sin(rot) * vector[0] + Math.cos(rot) * vector[1]];
  8936. return rotatedVector;
  8937. }
  8938. function getProjectingAngle(path, cur) {
  8939. var prevIndex = cur === 0 ? path.length() - 1 : cur - 1;
  8940. var nextIndex = (cur + 1) % path.length();
  8941. var prevPoint = path.v[prevIndex];
  8942. var nextPoint = path.v[nextIndex];
  8943. var pVector = getPerpendicularVector(prevPoint, nextPoint);
  8944. return Math.atan2(0, 1) - Math.atan2(pVector[1], pVector[0]);
  8945. }
  8946. function zigZagCorner(outputBezier, path, cur, amplitude, frequency, pointType, direction) {
  8947. var angle = getProjectingAngle(path, cur);
  8948. var point = path.v[cur % path._length];
  8949. var prevPoint = path.v[cur === 0 ? path._length - 1 : cur - 1];
  8950. var nextPoint = path.v[(cur + 1) % path._length];
  8951. var prevDist = pointType === 2 ? Math.sqrt(Math.pow(point[0] - prevPoint[0], 2) + Math.pow(point[1] - prevPoint[1], 2)) : 0;
  8952. var nextDist = pointType === 2 ? Math.sqrt(Math.pow(point[0] - nextPoint[0], 2) + Math.pow(point[1] - nextPoint[1], 2)) : 0;
  8953. setPoint(outputBezier, path.v[cur % path._length], angle, direction, amplitude, nextDist / ((frequency + 1) * 2), prevDist / ((frequency + 1) * 2), pointType);
  8954. }
  8955. function zigZagSegment(outputBezier, segment, amplitude, frequency, pointType, direction) {
  8956. for (var i = 0; i < frequency; i += 1) {
  8957. var t = (i + 1) / (frequency + 1);
  8958. var dist = pointType === 2 ? Math.sqrt(Math.pow(segment.points[3][0] - segment.points[0][0], 2) + Math.pow(segment.points[3][1] - segment.points[0][1], 2)) : 0;
  8959. var angle = segment.normalAngle(t);
  8960. var point = segment.point(t);
  8961. setPoint(outputBezier, point, angle, direction, amplitude, dist / ((frequency + 1) * 2), dist / ((frequency + 1) * 2), pointType);
  8962. direction = -direction;
  8963. }
  8964. return direction;
  8965. }
  8966. ZigZagModifier.prototype.processPath = function (path, amplitude, frequency, pointType) {
  8967. var count = path._length;
  8968. var clonedPath = shapePool.newElement();
  8969. clonedPath.c = path.c;
  8970. if (!path.c) {
  8971. count -= 1;
  8972. }
  8973. if (count === 0) return clonedPath;
  8974. var direction = -1;
  8975. var segment = PolynomialBezier.shapeSegment(path, 0);
  8976. zigZagCorner(clonedPath, path, 0, amplitude, frequency, pointType, direction);
  8977. for (var i = 0; i < count; i += 1) {
  8978. direction = zigZagSegment(clonedPath, segment, amplitude, frequency, pointType, -direction);
  8979. if (i === count - 1 && !path.c) {
  8980. segment = null;
  8981. } else {
  8982. segment = PolynomialBezier.shapeSegment(path, (i + 1) % count);
  8983. }
  8984. zigZagCorner(clonedPath, path, i + 1, amplitude, frequency, pointType, direction);
  8985. }
  8986. return clonedPath;
  8987. };
  8988. ZigZagModifier.prototype.processShapes = function (_isFirstFrame) {
  8989. var shapePaths;
  8990. var i;
  8991. var len = this.shapes.length;
  8992. var j;
  8993. var jLen;
  8994. var amplitude = this.amplitude.v;
  8995. var frequency = Math.max(0, Math.round(this.frequency.v));
  8996. var pointType = this.pointsType.v;
  8997. if (amplitude !== 0) {
  8998. var shapeData;
  8999. var localShapeCollection;
  9000. for (i = 0; i < len; i += 1) {
  9001. shapeData = this.shapes[i];
  9002. localShapeCollection = shapeData.localShapeCollection;
  9003. if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) {
  9004. localShapeCollection.releaseShapes();
  9005. shapeData.shape._mdf = true;
  9006. shapePaths = shapeData.shape.paths.shapes;
  9007. jLen = shapeData.shape.paths._length;
  9008. for (j = 0; j < jLen; j += 1) {
  9009. localShapeCollection.addShape(this.processPath(shapePaths[j], amplitude, frequency, pointType));
  9010. }
  9011. }
  9012. shapeData.shape.paths = shapeData.localShapeCollection;
  9013. }
  9014. }
  9015. if (!this.dynamicProperties.length) {
  9016. this._mdf = false;
  9017. }
  9018. };
  9019. function linearOffset(p1, p2, amount) {
  9020. var angle = Math.atan2(p2[0] - p1[0], p2[1] - p1[1]);
  9021. return [polarOffset(p1, angle, amount), polarOffset(p2, angle, amount)];
  9022. }
  9023. function offsetSegment(segment, amount) {
  9024. var p0;
  9025. var p1a;
  9026. var p1b;
  9027. var p2b;
  9028. var p2a;
  9029. var p3;
  9030. var e;
  9031. e = linearOffset(segment.points[0], segment.points[1], amount);
  9032. p0 = e[0];
  9033. p1a = e[1];
  9034. e = linearOffset(segment.points[1], segment.points[2], amount);
  9035. p1b = e[0];
  9036. p2b = e[1];
  9037. e = linearOffset(segment.points[2], segment.points[3], amount);
  9038. p2a = e[0];
  9039. p3 = e[1];
  9040. var p1 = lineIntersection(p0, p1a, p1b, p2b);
  9041. if (p1 === null) p1 = p1a;
  9042. var p2 = lineIntersection(p2a, p3, p1b, p2b);
  9043. if (p2 === null) p2 = p2a;
  9044. return new PolynomialBezier(p0, p1, p2, p3);
  9045. }
  9046. function joinLines(outputBezier, seg1, seg2, lineJoin, miterLimit) {
  9047. var p0 = seg1.points[3];
  9048. var p1 = seg2.points[0]; // Bevel
  9049. if (lineJoin === 3) return p0; // Connected, they don't need a joint
  9050. if (pointEqual(p0, p1)) return p0; // Round
  9051. if (lineJoin === 2) {
  9052. var angleOut = -seg1.tangentAngle(1);
  9053. var angleIn = -seg2.tangentAngle(0) + Math.PI;
  9054. var center = lineIntersection(p0, polarOffset(p0, angleOut + Math.PI / 2, 100), p1, polarOffset(p1, angleOut + Math.PI / 2, 100));
  9055. var radius = center ? pointDistance(center, p0) : pointDistance(p0, p1) / 2;
  9056. var tan = polarOffset(p0, angleOut, 2 * radius * roundCorner);
  9057. outputBezier.setXYAt(tan[0], tan[1], 'o', outputBezier.length() - 1);
  9058. tan = polarOffset(p1, angleIn, 2 * radius * roundCorner);
  9059. outputBezier.setTripleAt(p1[0], p1[1], p1[0], p1[1], tan[0], tan[1], outputBezier.length());
  9060. return p1;
  9061. } // Miter
  9062. var t0 = pointEqual(p0, seg1.points[2]) ? seg1.points[0] : seg1.points[2];
  9063. var t1 = pointEqual(p1, seg2.points[1]) ? seg2.points[3] : seg2.points[1];
  9064. var intersection = lineIntersection(t0, p0, p1, t1);
  9065. if (intersection && pointDistance(intersection, p0) < miterLimit) {
  9066. outputBezier.setTripleAt(intersection[0], intersection[1], intersection[0], intersection[1], intersection[0], intersection[1], outputBezier.length());
  9067. return intersection;
  9068. }
  9069. return p0;
  9070. }
  9071. function getIntersection(a, b) {
  9072. var intersect = a.intersections(b);
  9073. if (intersect.length && floatEqual(intersect[0][0], 1)) intersect.shift();
  9074. if (intersect.length) return intersect[0];
  9075. return null;
  9076. }
  9077. function pruneSegmentIntersection(a, b) {
  9078. var outa = a.slice();
  9079. var outb = b.slice();
  9080. var intersect = getIntersection(a[a.length - 1], b[0]);
  9081. if (intersect) {
  9082. outa[a.length - 1] = a[a.length - 1].split(intersect[0])[0];
  9083. outb[0] = b[0].split(intersect[1])[1];
  9084. }
  9085. if (a.length > 1 && b.length > 1) {
  9086. intersect = getIntersection(a[0], b[b.length - 1]);
  9087. if (intersect) {
  9088. return [[a[0].split(intersect[0])[0]], [b[b.length - 1].split(intersect[1])[1]]];
  9089. }
  9090. }
  9091. return [outa, outb];
  9092. }
  9093. function pruneIntersections(segments) {
  9094. var e;
  9095. for (var i = 1; i < segments.length; i += 1) {
  9096. e = pruneSegmentIntersection(segments[i - 1], segments[i]);
  9097. segments[i - 1] = e[0];
  9098. segments[i] = e[1];
  9099. }
  9100. if (segments.length > 1) {
  9101. e = pruneSegmentIntersection(segments[segments.length - 1], segments[0]);
  9102. segments[segments.length - 1] = e[0];
  9103. segments[0] = e[1];
  9104. }
  9105. return segments;
  9106. }
  9107. function offsetSegmentSplit(segment, amount) {
  9108. /*
  9109. We split each bezier segment into smaller pieces based
  9110. on inflection points, this ensures the control point
  9111. polygon is convex.
  9112. (A cubic bezier can have none, one, or two inflection points)
  9113. */
  9114. var flex = segment.inflectionPoints();
  9115. var left;
  9116. var right;
  9117. var split;
  9118. var mid;
  9119. if (flex.length === 0) {
  9120. return [offsetSegment(segment, amount)];
  9121. }
  9122. if (flex.length === 1 || floatEqual(flex[1], 1)) {
  9123. split = segment.split(flex[0]);
  9124. left = split[0];
  9125. right = split[1];
  9126. return [offsetSegment(left, amount), offsetSegment(right, amount)];
  9127. }
  9128. split = segment.split(flex[0]);
  9129. left = split[0];
  9130. var t = (flex[1] - flex[0]) / (1 - flex[0]);
  9131. split = split[1].split(t);
  9132. mid = split[0];
  9133. right = split[1];
  9134. return [offsetSegment(left, amount), offsetSegment(mid, amount), offsetSegment(right, amount)];
  9135. }
  9136. function OffsetPathModifier() {}
  9137. extendPrototype([ShapeModifier], OffsetPathModifier);
  9138. OffsetPathModifier.prototype.initModifierProperties = function (elem, data) {
  9139. this.getValue = this.processKeys;
  9140. this.amount = PropertyFactory.getProp(elem, data.a, 0, null, this);
  9141. this.miterLimit = PropertyFactory.getProp(elem, data.ml, 0, null, this);
  9142. this.lineJoin = data.lj;
  9143. this._isAnimated = this.amount.effectsSequence.length !== 0;
  9144. };
  9145. OffsetPathModifier.prototype.processPath = function (inputBezier, amount, lineJoin, miterLimit) {
  9146. var outputBezier = shapePool.newElement();
  9147. outputBezier.c = inputBezier.c;
  9148. var count = inputBezier.length();
  9149. if (!inputBezier.c) {
  9150. count -= 1;
  9151. }
  9152. var i;
  9153. var j;
  9154. var segment;
  9155. var multiSegments = [];
  9156. for (i = 0; i < count; i += 1) {
  9157. segment = PolynomialBezier.shapeSegment(inputBezier, i);
  9158. multiSegments.push(offsetSegmentSplit(segment, amount));
  9159. }
  9160. if (!inputBezier.c) {
  9161. for (i = count - 1; i >= 0; i -= 1) {
  9162. segment = PolynomialBezier.shapeSegmentInverted(inputBezier, i);
  9163. multiSegments.push(offsetSegmentSplit(segment, amount));
  9164. }
  9165. }
  9166. multiSegments = pruneIntersections(multiSegments); // Add bezier segments to the output and apply line joints
  9167. var lastPoint = null;
  9168. var lastSeg = null;
  9169. for (i = 0; i < multiSegments.length; i += 1) {
  9170. var multiSegment = multiSegments[i];
  9171. if (lastSeg) lastPoint = joinLines(outputBezier, lastSeg, multiSegment[0], lineJoin, miterLimit);
  9172. lastSeg = multiSegment[multiSegment.length - 1];
  9173. for (j = 0; j < multiSegment.length; j += 1) {
  9174. segment = multiSegment[j];
  9175. if (lastPoint && pointEqual(segment.points[0], lastPoint)) {
  9176. outputBezier.setXYAt(segment.points[1][0], segment.points[1][1], 'o', outputBezier.length() - 1);
  9177. } else {
  9178. outputBezier.setTripleAt(segment.points[0][0], segment.points[0][1], segment.points[1][0], segment.points[1][1], segment.points[0][0], segment.points[0][1], outputBezier.length());
  9179. }
  9180. outputBezier.setTripleAt(segment.points[3][0], segment.points[3][1], segment.points[3][0], segment.points[3][1], segment.points[2][0], segment.points[2][1], outputBezier.length());
  9181. lastPoint = segment.points[3];
  9182. }
  9183. }
  9184. if (multiSegments.length) joinLines(outputBezier, lastSeg, multiSegments[0][0], lineJoin, miterLimit);
  9185. return outputBezier;
  9186. };
  9187. OffsetPathModifier.prototype.processShapes = function (_isFirstFrame) {
  9188. var shapePaths;
  9189. var i;
  9190. var len = this.shapes.length;
  9191. var j;
  9192. var jLen;
  9193. var amount = this.amount.v;
  9194. var miterLimit = this.miterLimit.v;
  9195. var lineJoin = this.lineJoin;
  9196. if (amount !== 0) {
  9197. var shapeData;
  9198. var localShapeCollection;
  9199. for (i = 0; i < len; i += 1) {
  9200. shapeData = this.shapes[i];
  9201. localShapeCollection = shapeData.localShapeCollection;
  9202. if (!(!shapeData.shape._mdf && !this._mdf && !_isFirstFrame)) {
  9203. localShapeCollection.releaseShapes();
  9204. shapeData.shape._mdf = true;
  9205. shapePaths = shapeData.shape.paths.shapes;
  9206. jLen = shapeData.shape.paths._length;
  9207. for (j = 0; j < jLen; j += 1) {
  9208. localShapeCollection.addShape(this.processPath(shapePaths[j], amount, lineJoin, miterLimit));
  9209. }
  9210. }
  9211. shapeData.shape.paths = shapeData.localShapeCollection;
  9212. }
  9213. }
  9214. if (!this.dynamicProperties.length) {
  9215. this._mdf = false;
  9216. }
  9217. };
  9218. function getFontProperties(fontData) {
  9219. var styles = fontData.fStyle ? fontData.fStyle.split(' ') : [];
  9220. var fWeight = 'normal';
  9221. var fStyle = 'normal';
  9222. var len = styles.length;
  9223. var styleName;
  9224. for (var i = 0; i < len; i += 1) {
  9225. styleName = styles[i].toLowerCase();
  9226. switch (styleName) {
  9227. case 'italic':
  9228. fStyle = 'italic';
  9229. break;
  9230. case 'bold':
  9231. fWeight = '700';
  9232. break;
  9233. case 'black':
  9234. fWeight = '900';
  9235. break;
  9236. case 'medium':
  9237. fWeight = '500';
  9238. break;
  9239. case 'regular':
  9240. case 'normal':
  9241. fWeight = '400';
  9242. break;
  9243. case 'light':
  9244. case 'thin':
  9245. fWeight = '200';
  9246. break;
  9247. default:
  9248. break;
  9249. }
  9250. }
  9251. return {
  9252. style: fStyle,
  9253. weight: fontData.fWeight || fWeight
  9254. };
  9255. }
  9256. var FontManager = function () {
  9257. var maxWaitingTime = 5000;
  9258. var emptyChar = {
  9259. w: 0,
  9260. size: 0,
  9261. shapes: [],
  9262. data: {
  9263. shapes: []
  9264. }
  9265. };
  9266. var combinedCharacters = []; // Hindi characters
  9267. combinedCharacters = combinedCharacters.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]);
  9268. var BLACK_FLAG_CODE_POINT = 127988;
  9269. var CANCEL_TAG_CODE_POINT = 917631;
  9270. var A_TAG_CODE_POINT = 917601;
  9271. var Z_TAG_CODE_POINT = 917626;
  9272. var VARIATION_SELECTOR_16_CODE_POINT = 65039;
  9273. var ZERO_WIDTH_JOINER_CODE_POINT = 8205;
  9274. var REGIONAL_CHARACTER_A_CODE_POINT = 127462;
  9275. var REGIONAL_CHARACTER_Z_CODE_POINT = 127487;
  9276. var surrogateModifiers = ['d83cdffb', 'd83cdffc', 'd83cdffd', 'd83cdffe', 'd83cdfff'];
  9277. function trimFontOptions(font) {
  9278. var familyArray = font.split(',');
  9279. var i;
  9280. var len = familyArray.length;
  9281. var enabledFamilies = [];
  9282. for (i = 0; i < len; i += 1) {
  9283. if (familyArray[i] !== 'sans-serif' && familyArray[i] !== 'monospace') {
  9284. enabledFamilies.push(familyArray[i]);
  9285. }
  9286. }
  9287. return enabledFamilies.join(',');
  9288. }
  9289. function setUpNode(font, family) {
  9290. var parentNode = createTag('span'); // Node is invisible to screen readers.
  9291. parentNode.setAttribute('aria-hidden', true);
  9292. parentNode.style.fontFamily = family;
  9293. var node = createTag('span'); // Characters that vary significantly among different fonts
  9294. node.innerText = 'giItT1WQy@!-/#'; // Visible - so we can measure it - but not on the screen
  9295. parentNode.style.position = 'absolute';
  9296. parentNode.style.left = '-10000px';
  9297. parentNode.style.top = '-10000px'; // Large font size makes even subtle changes obvious
  9298. parentNode.style.fontSize = '300px'; // Reset any font properties
  9299. parentNode.style.fontVariant = 'normal';
  9300. parentNode.style.fontStyle = 'normal';
  9301. parentNode.style.fontWeight = 'normal';
  9302. parentNode.style.letterSpacing = '0';
  9303. parentNode.appendChild(node);
  9304. document.body.appendChild(parentNode); // Remember width with no applied web font
  9305. var width = node.offsetWidth;
  9306. node.style.fontFamily = trimFontOptions(font) + ', ' + family;
  9307. return {
  9308. node: node,
  9309. w: width,
  9310. parent: parentNode
  9311. };
  9312. }
  9313. function checkLoadedFonts() {
  9314. var i;
  9315. var len = this.fonts.length;
  9316. var node;
  9317. var w;
  9318. var loadedCount = len;
  9319. for (i = 0; i < len; i += 1) {
  9320. if (this.fonts[i].loaded) {
  9321. loadedCount -= 1;
  9322. } else if (this.fonts[i].fOrigin === 'n' || this.fonts[i].origin === 0) {
  9323. this.fonts[i].loaded = true;
  9324. } else {
  9325. node = this.fonts[i].monoCase.node;
  9326. w = this.fonts[i].monoCase.w;
  9327. if (node.offsetWidth !== w) {
  9328. loadedCount -= 1;
  9329. this.fonts[i].loaded = true;
  9330. } else {
  9331. node = this.fonts[i].sansCase.node;
  9332. w = this.fonts[i].sansCase.w;
  9333. if (node.offsetWidth !== w) {
  9334. loadedCount -= 1;
  9335. this.fonts[i].loaded = true;
  9336. }
  9337. }
  9338. if (this.fonts[i].loaded) {
  9339. this.fonts[i].sansCase.parent.parentNode.removeChild(this.fonts[i].sansCase.parent);
  9340. this.fonts[i].monoCase.parent.parentNode.removeChild(this.fonts[i].monoCase.parent);
  9341. }
  9342. }
  9343. }
  9344. if (loadedCount !== 0 && Date.now() - this.initTime < maxWaitingTime) {
  9345. setTimeout(this.checkLoadedFontsBinded, 20);
  9346. } else {
  9347. setTimeout(this.setIsLoadedBinded, 10);
  9348. }
  9349. }
  9350. function createHelper(fontData, def) {
  9351. var engine = document.body && def ? 'svg' : 'canvas';
  9352. var helper;
  9353. var fontProps = getFontProperties(fontData);
  9354. if (engine === 'svg') {
  9355. var tHelper = createNS('text');
  9356. tHelper.style.fontSize = '100px'; // tHelper.style.fontFamily = fontData.fFamily;
  9357. tHelper.setAttribute('font-family', fontData.fFamily);
  9358. tHelper.setAttribute('font-style', fontProps.style);
  9359. tHelper.setAttribute('font-weight', fontProps.weight);
  9360. tHelper.textContent = '1';
  9361. if (fontData.fClass) {
  9362. tHelper.style.fontFamily = 'inherit';
  9363. tHelper.setAttribute('class', fontData.fClass);
  9364. } else {
  9365. tHelper.style.fontFamily = fontData.fFamily;
  9366. }
  9367. def.appendChild(tHelper);
  9368. helper = tHelper;
  9369. } else {
  9370. var tCanvasHelper = new OffscreenCanvas(500, 500).getContext('2d');
  9371. tCanvasHelper.font = fontProps.style + ' ' + fontProps.weight + ' 100px ' + fontData.fFamily;
  9372. helper = tCanvasHelper;
  9373. }
  9374. function measure(text) {
  9375. if (engine === 'svg') {
  9376. helper.textContent = text;
  9377. return helper.getComputedTextLength();
  9378. }
  9379. return helper.measureText(text).width;
  9380. }
  9381. return {
  9382. measureText: measure
  9383. };
  9384. }
  9385. function addFonts(fontData, defs) {
  9386. if (!fontData) {
  9387. this.isLoaded = true;
  9388. return;
  9389. }
  9390. if (this.chars) {
  9391. this.isLoaded = true;
  9392. this.fonts = fontData.list;
  9393. return;
  9394. }
  9395. if (!document.body) {
  9396. this.isLoaded = true;
  9397. fontData.list.forEach(function (data) {
  9398. data.helper = createHelper(data);
  9399. data.cache = {};
  9400. });
  9401. this.fonts = fontData.list;
  9402. return;
  9403. }
  9404. var fontArr = fontData.list;
  9405. var i;
  9406. var len = fontArr.length;
  9407. var _pendingFonts = len;
  9408. for (i = 0; i < len; i += 1) {
  9409. var shouldLoadFont = true;
  9410. var loadedSelector;
  9411. var j;
  9412. fontArr[i].loaded = false;
  9413. fontArr[i].monoCase = setUpNode(fontArr[i].fFamily, 'monospace');
  9414. fontArr[i].sansCase = setUpNode(fontArr[i].fFamily, 'sans-serif');
  9415. if (!fontArr[i].fPath) {
  9416. fontArr[i].loaded = true;
  9417. _pendingFonts -= 1;
  9418. } else if (fontArr[i].fOrigin === 'p' || fontArr[i].origin === 3) {
  9419. loadedSelector = document.querySelectorAll('style[f-forigin="p"][f-family="' + fontArr[i].fFamily + '"], style[f-origin="3"][f-family="' + fontArr[i].fFamily + '"]');
  9420. if (loadedSelector.length > 0) {
  9421. shouldLoadFont = false;
  9422. }
  9423. if (shouldLoadFont) {
  9424. var s = createTag('style');
  9425. s.setAttribute('f-forigin', fontArr[i].fOrigin);
  9426. s.setAttribute('f-origin', fontArr[i].origin);
  9427. s.setAttribute('f-family', fontArr[i].fFamily);
  9428. s.type = 'text/css';
  9429. s.innerText = '@font-face {font-family: ' + fontArr[i].fFamily + "; font-style: normal; src: url('" + fontArr[i].fPath + "');}";
  9430. defs.appendChild(s);
  9431. }
  9432. } else if (fontArr[i].fOrigin === 'g' || fontArr[i].origin === 1) {
  9433. loadedSelector = document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]');
  9434. for (j = 0; j < loadedSelector.length; j += 1) {
  9435. if (loadedSelector[j].href.indexOf(fontArr[i].fPath) !== -1) {
  9436. // Font is already loaded
  9437. shouldLoadFont = false;
  9438. }
  9439. }
  9440. if (shouldLoadFont) {
  9441. var l = createTag('link');
  9442. l.setAttribute('f-forigin', fontArr[i].fOrigin);
  9443. l.setAttribute('f-origin', fontArr[i].origin);
  9444. l.type = 'text/css';
  9445. l.rel = 'stylesheet';
  9446. l.href = fontArr[i].fPath;
  9447. document.body.appendChild(l);
  9448. }
  9449. } else if (fontArr[i].fOrigin === 't' || fontArr[i].origin === 2) {
  9450. loadedSelector = document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]');
  9451. for (j = 0; j < loadedSelector.length; j += 1) {
  9452. if (fontArr[i].fPath === loadedSelector[j].src) {
  9453. // Font is already loaded
  9454. shouldLoadFont = false;
  9455. }
  9456. }
  9457. if (shouldLoadFont) {
  9458. var sc = createTag('link');
  9459. sc.setAttribute('f-forigin', fontArr[i].fOrigin);
  9460. sc.setAttribute('f-origin', fontArr[i].origin);
  9461. sc.setAttribute('rel', 'stylesheet');
  9462. sc.setAttribute('href', fontArr[i].fPath);
  9463. defs.appendChild(sc);
  9464. }
  9465. }
  9466. fontArr[i].helper = createHelper(fontArr[i], defs);
  9467. fontArr[i].cache = {};
  9468. this.fonts.push(fontArr[i]);
  9469. }
  9470. if (_pendingFonts === 0) {
  9471. this.isLoaded = true;
  9472. } else {
  9473. // On some cases even if the font is loaded, it won't load correctly when measuring text on canvas.
  9474. // Adding this timeout seems to fix it
  9475. setTimeout(this.checkLoadedFonts.bind(this), 100);
  9476. }
  9477. }
  9478. function addChars(chars) {
  9479. if (!chars) {
  9480. return;
  9481. }
  9482. if (!this.chars) {
  9483. this.chars = [];
  9484. }
  9485. var i;
  9486. var len = chars.length;
  9487. var j;
  9488. var jLen = this.chars.length;
  9489. var found;
  9490. for (i = 0; i < len; i += 1) {
  9491. j = 0;
  9492. found = false;
  9493. while (j < jLen) {
  9494. if (this.chars[j].style === chars[i].style && this.chars[j].fFamily === chars[i].fFamily && this.chars[j].ch === chars[i].ch) {
  9495. found = true;
  9496. }
  9497. j += 1;
  9498. }
  9499. if (!found) {
  9500. this.chars.push(chars[i]);
  9501. jLen += 1;
  9502. }
  9503. }
  9504. }
  9505. function getCharData(_char, style, font) {
  9506. var i = 0;
  9507. var len = this.chars.length;
  9508. while (i < len) {
  9509. if (this.chars[i].ch === _char && this.chars[i].style === style && this.chars[i].fFamily === font) {
  9510. return this.chars[i];
  9511. }
  9512. i += 1;
  9513. }
  9514. if ((typeof _char === 'string' && _char.charCodeAt(0) !== 13 || !_char) && console && console.warn // eslint-disable-line no-console
  9515. && !this._warned) {
  9516. this._warned = true;
  9517. console.warn('Missing character from exported characters list: ', _char, style, font); // eslint-disable-line no-console
  9518. }
  9519. return emptyChar;
  9520. }
  9521. function measureText(_char2, fontName, size) {
  9522. var fontData = this.getFontByName(fontName); // Using the char instead of char.charCodeAt(0)
  9523. // to avoid collisions between equal chars
  9524. var index = _char2;
  9525. if (!fontData.cache[index]) {
  9526. var tHelper = fontData.helper;
  9527. if (_char2 === ' ') {
  9528. var doubleSize = tHelper.measureText('|' + _char2 + '|');
  9529. var singleSize = tHelper.measureText('||');
  9530. fontData.cache[index] = (doubleSize - singleSize) / 100;
  9531. } else {
  9532. fontData.cache[index] = tHelper.measureText(_char2) / 100;
  9533. }
  9534. }
  9535. return fontData.cache[index] * size;
  9536. }
  9537. function getFontByName(name) {
  9538. var i = 0;
  9539. var len = this.fonts.length;
  9540. while (i < len) {
  9541. if (this.fonts[i].fName === name) {
  9542. return this.fonts[i];
  9543. }
  9544. i += 1;
  9545. }
  9546. return this.fonts[0];
  9547. }
  9548. function getCodePoint(string) {
  9549. var codePoint = 0;
  9550. var first = string.charCodeAt(0);
  9551. if (first >= 0xD800 && first <= 0xDBFF) {
  9552. var second = string.charCodeAt(1);
  9553. if (second >= 0xDC00 && second <= 0xDFFF) {
  9554. codePoint = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
  9555. }
  9556. }
  9557. return codePoint;
  9558. } // Skin tone modifiers
  9559. function isModifier(firstCharCode, secondCharCode) {
  9560. var sum = firstCharCode.toString(16) + secondCharCode.toString(16);
  9561. return surrogateModifiers.indexOf(sum) !== -1;
  9562. }
  9563. function isZeroWidthJoiner(charCode) {
  9564. return charCode === ZERO_WIDTH_JOINER_CODE_POINT;
  9565. } // This codepoint may change the appearance of the preceding character.
  9566. // If that is a symbol, dingbat or emoji, U+FE0F forces it to be rendered
  9567. // as a colorful image as compared to a monochrome text variant.
  9568. function isVariationSelector(charCode) {
  9569. return charCode === VARIATION_SELECTOR_16_CODE_POINT;
  9570. } // The regional indicator symbols are a set of 26 alphabetic Unicode
  9571. /// characters (A–Z) intended to be used to encode ISO 3166-1 alpha-2
  9572. // two-letter country codes in a way that allows optional special treatment.
  9573. function isRegionalCode(string) {
  9574. var codePoint = getCodePoint(string);
  9575. if (codePoint >= REGIONAL_CHARACTER_A_CODE_POINT && codePoint <= REGIONAL_CHARACTER_Z_CODE_POINT) {
  9576. return true;
  9577. }
  9578. return false;
  9579. } // Some Emoji implementations represent combinations of
  9580. // two “regional indicator” letters as a single flag symbol.
  9581. function isFlagEmoji(string) {
  9582. return isRegionalCode(string.substr(0, 2)) && isRegionalCode(string.substr(2, 2));
  9583. }
  9584. function isCombinedCharacter(_char3) {
  9585. return combinedCharacters.indexOf(_char3) !== -1;
  9586. } // Regional flags start with a BLACK_FLAG_CODE_POINT
  9587. // folowed by 5 chars in the TAG range
  9588. // and end with a CANCEL_TAG_CODE_POINT
  9589. function isRegionalFlag(text, index) {
  9590. var codePoint = getCodePoint(text.substr(index, 2));
  9591. if (codePoint !== BLACK_FLAG_CODE_POINT) {
  9592. return false;
  9593. }
  9594. var count = 0;
  9595. index += 2;
  9596. while (count < 5) {
  9597. codePoint = getCodePoint(text.substr(index, 2));
  9598. if (codePoint < A_TAG_CODE_POINT || codePoint > Z_TAG_CODE_POINT) {
  9599. return false;
  9600. }
  9601. count += 1;
  9602. index += 2;
  9603. }
  9604. return getCodePoint(text.substr(index, 2)) === CANCEL_TAG_CODE_POINT;
  9605. }
  9606. function setIsLoaded() {
  9607. this.isLoaded = true;
  9608. }
  9609. var Font = function Font() {
  9610. this.fonts = [];
  9611. this.chars = null;
  9612. this.typekitLoaded = 0;
  9613. this.isLoaded = false;
  9614. this._warned = false;
  9615. this.initTime = Date.now();
  9616. this.setIsLoadedBinded = this.setIsLoaded.bind(this);
  9617. this.checkLoadedFontsBinded = this.checkLoadedFonts.bind(this);
  9618. };
  9619. Font.isModifier = isModifier;
  9620. Font.isZeroWidthJoiner = isZeroWidthJoiner;
  9621. Font.isFlagEmoji = isFlagEmoji;
  9622. Font.isRegionalCode = isRegionalCode;
  9623. Font.isCombinedCharacter = isCombinedCharacter;
  9624. Font.isRegionalFlag = isRegionalFlag;
  9625. Font.isVariationSelector = isVariationSelector;
  9626. Font.BLACK_FLAG_CODE_POINT = BLACK_FLAG_CODE_POINT;
  9627. var fontPrototype = {
  9628. addChars: addChars,
  9629. addFonts: addFonts,
  9630. getCharData: getCharData,
  9631. getFontByName: getFontByName,
  9632. measureText: measureText,
  9633. checkLoadedFonts: checkLoadedFonts,
  9634. setIsLoaded: setIsLoaded
  9635. };
  9636. Font.prototype = fontPrototype;
  9637. return Font;
  9638. }();
  9639. function SlotManager(animationData) {
  9640. this.animationData = animationData;
  9641. }
  9642. SlotManager.prototype.getProp = function (data) {
  9643. if (this.animationData.slots && this.animationData.slots[data.sid]) {
  9644. return Object.assign(data, this.animationData.slots[data.sid].p);
  9645. }
  9646. return data;
  9647. };
  9648. function slotFactory(animationData) {
  9649. return new SlotManager(animationData);
  9650. }
  9651. function RenderableElement() {}
  9652. RenderableElement.prototype = {
  9653. initRenderable: function initRenderable() {
  9654. // layer's visibility related to inpoint and outpoint. Rename isVisible to isInRange
  9655. this.isInRange = false; // layer's display state
  9656. this.hidden = false; // If layer's transparency equals 0, it can be hidden
  9657. this.isTransparent = false; // list of animated components
  9658. this.renderableComponents = [];
  9659. },
  9660. addRenderableComponent: function addRenderableComponent(component) {
  9661. if (this.renderableComponents.indexOf(component) === -1) {
  9662. this.renderableComponents.push(component);
  9663. }
  9664. },
  9665. removeRenderableComponent: function removeRenderableComponent(component) {
  9666. if (this.renderableComponents.indexOf(component) !== -1) {
  9667. this.renderableComponents.splice(this.renderableComponents.indexOf(component), 1);
  9668. }
  9669. },
  9670. prepareRenderableFrame: function prepareRenderableFrame(num) {
  9671. this.checkLayerLimits(num);
  9672. },
  9673. checkTransparency: function checkTransparency() {
  9674. if (this.finalTransform.mProp.o.v <= 0) {
  9675. if (!this.isTransparent && this.globalData.renderConfig.hideOnTransparent) {
  9676. this.isTransparent = true;
  9677. this.hide();
  9678. }
  9679. } else if (this.isTransparent) {
  9680. this.isTransparent = false;
  9681. this.show();
  9682. }
  9683. },
  9684. /**
  9685. * @function
  9686. * Initializes frame related properties.
  9687. *
  9688. * @param {number} num
  9689. * current frame number in Layer's time
  9690. *
  9691. */
  9692. checkLayerLimits: function checkLayerLimits(num) {
  9693. if (this.data.ip - this.data.st <= num && this.data.op - this.data.st > num) {
  9694. if (this.isInRange !== true) {
  9695. this.globalData._mdf = true;
  9696. this._mdf = true;
  9697. this.isInRange = true;
  9698. this.show();
  9699. }
  9700. } else if (this.isInRange !== false) {
  9701. this.globalData._mdf = true;
  9702. this.isInRange = false;
  9703. this.hide();
  9704. }
  9705. },
  9706. renderRenderable: function renderRenderable() {
  9707. var i;
  9708. var len = this.renderableComponents.length;
  9709. for (i = 0; i < len; i += 1) {
  9710. this.renderableComponents[i].renderFrame(this._isFirstFrame);
  9711. }
  9712. /* this.maskManager.renderFrame(this.finalTransform.mat);
  9713. this.renderableEffectsManager.renderFrame(this._isFirstFrame); */
  9714. },
  9715. sourceRectAtTime: function sourceRectAtTime() {
  9716. return {
  9717. top: 0,
  9718. left: 0,
  9719. width: 100,
  9720. height: 100
  9721. };
  9722. },
  9723. getLayerSize: function getLayerSize() {
  9724. if (this.data.ty === 5) {
  9725. return {
  9726. w: this.data.textData.width,
  9727. h: this.data.textData.height
  9728. };
  9729. }
  9730. return {
  9731. w: this.data.width,
  9732. h: this.data.height
  9733. };
  9734. }
  9735. };
  9736. var getBlendMode = function () {
  9737. var blendModeEnums = {
  9738. 0: 'source-over',
  9739. 1: 'multiply',
  9740. 2: 'screen',
  9741. 3: 'overlay',
  9742. 4: 'darken',
  9743. 5: 'lighten',
  9744. 6: 'color-dodge',
  9745. 7: 'color-burn',
  9746. 8: 'hard-light',
  9747. 9: 'soft-light',
  9748. 10: 'difference',
  9749. 11: 'exclusion',
  9750. 12: 'hue',
  9751. 13: 'saturation',
  9752. 14: 'color',
  9753. 15: 'luminosity'
  9754. };
  9755. return function (mode) {
  9756. return blendModeEnums[mode] || '';
  9757. };
  9758. }();
  9759. function SliderEffect(data, elem, container) {
  9760. this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
  9761. }
  9762. function AngleEffect(data, elem, container) {
  9763. this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
  9764. }
  9765. function ColorEffect(data, elem, container) {
  9766. this.p = PropertyFactory.getProp(elem, data.v, 1, 0, container);
  9767. }
  9768. function PointEffect(data, elem, container) {
  9769. this.p = PropertyFactory.getProp(elem, data.v, 1, 0, container);
  9770. }
  9771. function LayerIndexEffect(data, elem, container) {
  9772. this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
  9773. }
  9774. function MaskIndexEffect(data, elem, container) {
  9775. this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
  9776. }
  9777. function CheckboxEffect(data, elem, container) {
  9778. this.p = PropertyFactory.getProp(elem, data.v, 0, 0, container);
  9779. }
  9780. function NoValueEffect() {
  9781. this.p = {};
  9782. }
  9783. function EffectsManager(data, element) {
  9784. var effects = data.ef || [];
  9785. this.effectElements = [];
  9786. var i;
  9787. var len = effects.length;
  9788. var effectItem;
  9789. for (i = 0; i < len; i += 1) {
  9790. effectItem = new GroupEffect(effects[i], element);
  9791. this.effectElements.push(effectItem);
  9792. }
  9793. }
  9794. function GroupEffect(data, element) {
  9795. this.init(data, element);
  9796. }
  9797. extendPrototype([DynamicPropertyContainer], GroupEffect);
  9798. GroupEffect.prototype.getValue = GroupEffect.prototype.iterateDynamicProperties;
  9799. GroupEffect.prototype.init = function (data, element) {
  9800. this.data = data;
  9801. this.effectElements = [];
  9802. this.initDynamicPropertyContainer(element);
  9803. var i;
  9804. var len = this.data.ef.length;
  9805. var eff;
  9806. var effects = this.data.ef;
  9807. for (i = 0; i < len; i += 1) {
  9808. eff = null;
  9809. switch (effects[i].ty) {
  9810. case 0:
  9811. eff = new SliderEffect(effects[i], element, this);
  9812. break;
  9813. case 1:
  9814. eff = new AngleEffect(effects[i], element, this);
  9815. break;
  9816. case 2:
  9817. eff = new ColorEffect(effects[i], element, this);
  9818. break;
  9819. case 3:
  9820. eff = new PointEffect(effects[i], element, this);
  9821. break;
  9822. case 4:
  9823. case 7:
  9824. eff = new CheckboxEffect(effects[i], element, this);
  9825. break;
  9826. case 10:
  9827. eff = new LayerIndexEffect(effects[i], element, this);
  9828. break;
  9829. case 11:
  9830. eff = new MaskIndexEffect(effects[i], element, this);
  9831. break;
  9832. case 5:
  9833. eff = new EffectsManager(effects[i], element, this);
  9834. break;
  9835. // case 6:
  9836. default:
  9837. eff = new NoValueEffect(effects[i], element, this);
  9838. break;
  9839. }
  9840. if (eff) {
  9841. this.effectElements.push(eff);
  9842. }
  9843. }
  9844. };
  9845. function BaseElement() {}
  9846. BaseElement.prototype = {
  9847. checkMasks: function checkMasks() {
  9848. if (!this.data.hasMask) {
  9849. return false;
  9850. }
  9851. var i = 0;
  9852. var len = this.data.masksProperties.length;
  9853. while (i < len) {
  9854. if (this.data.masksProperties[i].mode !== 'n' && this.data.masksProperties[i].cl !== false) {
  9855. return true;
  9856. }
  9857. i += 1;
  9858. }
  9859. return false;
  9860. },
  9861. initExpressions: function initExpressions() {
  9862. var expressionsInterfaces = getExpressionInterfaces();
  9863. if (!expressionsInterfaces) {
  9864. return;
  9865. }
  9866. var LayerExpressionInterface = expressionsInterfaces('layer');
  9867. var EffectsExpressionInterface = expressionsInterfaces('effects');
  9868. var ShapeExpressionInterface = expressionsInterfaces('shape');
  9869. var TextExpressionInterface = expressionsInterfaces('text');
  9870. var CompExpressionInterface = expressionsInterfaces('comp');
  9871. this.layerInterface = LayerExpressionInterface(this);
  9872. if (this.data.hasMask && this.maskManager) {
  9873. this.layerInterface.registerMaskInterface(this.maskManager);
  9874. }
  9875. var effectsInterface = EffectsExpressionInterface.createEffectsInterface(this, this.layerInterface);
  9876. this.layerInterface.registerEffectsInterface(effectsInterface);
  9877. if (this.data.ty === 0 || this.data.xt) {
  9878. this.compInterface = CompExpressionInterface(this);
  9879. } else if (this.data.ty === 4) {
  9880. this.layerInterface.shapeInterface = ShapeExpressionInterface(this.shapesData, this.itemsData, this.layerInterface);
  9881. this.layerInterface.content = this.layerInterface.shapeInterface;
  9882. } else if (this.data.ty === 5) {
  9883. this.layerInterface.textInterface = TextExpressionInterface(this);
  9884. this.layerInterface.text = this.layerInterface.textInterface;
  9885. }
  9886. },
  9887. setBlendMode: function setBlendMode() {
  9888. var blendModeValue = getBlendMode(this.data.bm);
  9889. var elem = this.baseElement || this.layerElement;
  9890. elem.style['mix-blend-mode'] = blendModeValue;
  9891. },
  9892. initBaseData: function initBaseData(data, globalData, comp) {
  9893. this.globalData = globalData;
  9894. this.comp = comp;
  9895. this.data = data;
  9896. this.layerId = createElementID(); // Stretch factor for old animations missing this property.
  9897. if (!this.data.sr) {
  9898. this.data.sr = 1;
  9899. } // effects manager
  9900. this.effectsManager = new EffectsManager(this.data, this, this.dynamicProperties);
  9901. },
  9902. getType: function getType() {
  9903. return this.type;
  9904. },
  9905. sourceRectAtTime: function sourceRectAtTime() {}
  9906. };
  9907. /**
  9908. * @file
  9909. * Handles element's layer frame update.
  9910. * Checks layer in point and out point
  9911. *
  9912. */
  9913. function FrameElement() {}
  9914. FrameElement.prototype = {
  9915. /**
  9916. * @function
  9917. * Initializes frame related properties.
  9918. *
  9919. */
  9920. initFrame: function initFrame() {
  9921. // set to true when inpoint is rendered
  9922. this._isFirstFrame = false; // list of animated properties
  9923. this.dynamicProperties = []; // If layer has been modified in current tick this will be true
  9924. this._mdf = false;
  9925. },
  9926. /**
  9927. * @function
  9928. * Calculates all dynamic values
  9929. *
  9930. * @param {number} num
  9931. * current frame number in Layer's time
  9932. * @param {boolean} isVisible
  9933. * if layers is currently in range
  9934. *
  9935. */
  9936. prepareProperties: function prepareProperties(num, isVisible) {
  9937. var i;
  9938. var len = this.dynamicProperties.length;
  9939. for (i = 0; i < len; i += 1) {
  9940. if (isVisible || this._isParent && this.dynamicProperties[i].propType === 'transform') {
  9941. this.dynamicProperties[i].getValue();
  9942. if (this.dynamicProperties[i]._mdf) {
  9943. this.globalData._mdf = true;
  9944. this._mdf = true;
  9945. }
  9946. }
  9947. }
  9948. },
  9949. addDynamicProperty: function addDynamicProperty(prop) {
  9950. if (this.dynamicProperties.indexOf(prop) === -1) {
  9951. this.dynamicProperties.push(prop);
  9952. }
  9953. }
  9954. };
  9955. function FootageElement(data, globalData, comp) {
  9956. this.initFrame();
  9957. this.initRenderable();
  9958. this.assetData = globalData.getAssetData(data.refId);
  9959. this.footageData = globalData.imageLoader.getAsset(this.assetData);
  9960. this.initBaseData(data, globalData, comp);
  9961. }
  9962. FootageElement.prototype.prepareFrame = function () {};
  9963. extendPrototype([RenderableElement, BaseElement, FrameElement], FootageElement);
  9964. FootageElement.prototype.getBaseElement = function () {
  9965. return null;
  9966. };
  9967. FootageElement.prototype.renderFrame = function () {};
  9968. FootageElement.prototype.destroy = function () {};
  9969. FootageElement.prototype.initExpressions = function () {
  9970. var expressionsInterfaces = getExpressionInterfaces();
  9971. if (!expressionsInterfaces) {
  9972. return;
  9973. }
  9974. var FootageInterface = expressionsInterfaces('footage');
  9975. this.layerInterface = FootageInterface(this);
  9976. };
  9977. FootageElement.prototype.getFootageData = function () {
  9978. return this.footageData;
  9979. };
  9980. function AudioElement(data, globalData, comp) {
  9981. this.initFrame();
  9982. this.initRenderable();
  9983. this.assetData = globalData.getAssetData(data.refId);
  9984. this.initBaseData(data, globalData, comp);
  9985. this._isPlaying = false;
  9986. this._canPlay = false;
  9987. var assetPath = this.globalData.getAssetsPath(this.assetData);
  9988. this.audio = this.globalData.audioController.createAudio(assetPath);
  9989. this._currentTime = 0;
  9990. this.globalData.audioController.addAudio(this);
  9991. this._volumeMultiplier = 1;
  9992. this._volume = 1;
  9993. this._previousVolume = null;
  9994. this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : {
  9995. _placeholder: true
  9996. };
  9997. this.lv = PropertyFactory.getProp(this, data.au && data.au.lv ? data.au.lv : {
  9998. k: [100]
  9999. }, 1, 0.01, this);
  10000. }
  10001. AudioElement.prototype.prepareFrame = function (num) {
  10002. this.prepareRenderableFrame(num, true);
  10003. this.prepareProperties(num, true);
  10004. if (!this.tm._placeholder) {
  10005. var timeRemapped = this.tm.v;
  10006. this._currentTime = timeRemapped;
  10007. } else {
  10008. this._currentTime = num / this.data.sr;
  10009. }
  10010. this._volume = this.lv.v[0];
  10011. var totalVolume = this._volume * this._volumeMultiplier;
  10012. if (this._previousVolume !== totalVolume) {
  10013. this._previousVolume = totalVolume;
  10014. this.audio.volume(totalVolume);
  10015. }
  10016. };
  10017. extendPrototype([RenderableElement, BaseElement, FrameElement], AudioElement);
  10018. AudioElement.prototype.renderFrame = function () {
  10019. if (this.isInRange && this._canPlay) {
  10020. if (!this._isPlaying) {
  10021. this.audio.play();
  10022. this.audio.seek(this._currentTime / this.globalData.frameRate);
  10023. this._isPlaying = true;
  10024. } else if (!this.audio.playing() || Math.abs(this._currentTime / this.globalData.frameRate - this.audio.seek()) > 0.1) {
  10025. this.audio.seek(this._currentTime / this.globalData.frameRate);
  10026. }
  10027. }
  10028. };
  10029. AudioElement.prototype.show = function () {// this.audio.play()
  10030. };
  10031. AudioElement.prototype.hide = function () {
  10032. this.audio.pause();
  10033. this._isPlaying = false;
  10034. };
  10035. AudioElement.prototype.pause = function () {
  10036. this.audio.pause();
  10037. this._isPlaying = false;
  10038. this._canPlay = false;
  10039. };
  10040. AudioElement.prototype.resume = function () {
  10041. this._canPlay = true;
  10042. };
  10043. AudioElement.prototype.setRate = function (rateValue) {
  10044. this.audio.rate(rateValue);
  10045. };
  10046. AudioElement.prototype.volume = function (volumeValue) {
  10047. this._volumeMultiplier = volumeValue;
  10048. this._previousVolume = volumeValue * this._volume;
  10049. this.audio.volume(this._previousVolume);
  10050. };
  10051. AudioElement.prototype.getBaseElement = function () {
  10052. return null;
  10053. };
  10054. AudioElement.prototype.destroy = function () {};
  10055. AudioElement.prototype.sourceRectAtTime = function () {};
  10056. AudioElement.prototype.initExpressions = function () {};
  10057. function BaseRenderer() {}
  10058. BaseRenderer.prototype.checkLayers = function (num) {
  10059. var i;
  10060. var len = this.layers.length;
  10061. var data;
  10062. this.completeLayers = true;
  10063. for (i = len - 1; i >= 0; i -= 1) {
  10064. if (!this.elements[i]) {
  10065. data = this.layers[i];
  10066. if (data.ip - data.st <= num - this.layers[i].st && data.op - data.st > num - this.layers[i].st) {
  10067. this.buildItem(i);
  10068. }
  10069. }
  10070. this.completeLayers = this.elements[i] ? this.completeLayers : false;
  10071. }
  10072. this.checkPendingElements();
  10073. };
  10074. BaseRenderer.prototype.createItem = function (layer) {
  10075. switch (layer.ty) {
  10076. case 2:
  10077. return this.createImage(layer);
  10078. case 0:
  10079. return this.createComp(layer);
  10080. case 1:
  10081. return this.createSolid(layer);
  10082. case 3:
  10083. return this.createNull(layer);
  10084. case 4:
  10085. return this.createShape(layer);
  10086. case 5:
  10087. return this.createText(layer);
  10088. case 6:
  10089. return this.createAudio(layer);
  10090. case 13:
  10091. return this.createCamera(layer);
  10092. case 15:
  10093. return this.createFootage(layer);
  10094. default:
  10095. return this.createNull(layer);
  10096. }
  10097. };
  10098. BaseRenderer.prototype.createCamera = function () {
  10099. throw new Error('You\'re using a 3d camera. Try the html renderer.');
  10100. };
  10101. BaseRenderer.prototype.createAudio = function (data) {
  10102. return new AudioElement(data, this.globalData, this);
  10103. };
  10104. BaseRenderer.prototype.createFootage = function (data) {
  10105. return new FootageElement(data, this.globalData, this);
  10106. };
  10107. BaseRenderer.prototype.buildAllItems = function () {
  10108. var i;
  10109. var len = this.layers.length;
  10110. for (i = 0; i < len; i += 1) {
  10111. this.buildItem(i);
  10112. }
  10113. this.checkPendingElements();
  10114. };
  10115. BaseRenderer.prototype.includeLayers = function (newLayers) {
  10116. this.completeLayers = false;
  10117. var i;
  10118. var len = newLayers.length;
  10119. var j;
  10120. var jLen = this.layers.length;
  10121. for (i = 0; i < len; i += 1) {
  10122. j = 0;
  10123. while (j < jLen) {
  10124. if (this.layers[j].id === newLayers[i].id) {
  10125. this.layers[j] = newLayers[i];
  10126. break;
  10127. }
  10128. j += 1;
  10129. }
  10130. }
  10131. };
  10132. BaseRenderer.prototype.setProjectInterface = function (pInterface) {
  10133. this.globalData.projectInterface = pInterface;
  10134. };
  10135. BaseRenderer.prototype.initItems = function () {
  10136. if (!this.globalData.progressiveLoad) {
  10137. this.buildAllItems();
  10138. }
  10139. };
  10140. BaseRenderer.prototype.buildElementParenting = function (element, parentName, hierarchy) {
  10141. var elements = this.elements;
  10142. var layers = this.layers;
  10143. var i = 0;
  10144. var len = layers.length;
  10145. while (i < len) {
  10146. if (layers[i].ind == parentName) {
  10147. // eslint-disable-line eqeqeq
  10148. if (!elements[i] || elements[i] === true) {
  10149. this.buildItem(i);
  10150. this.addPendingElement(element);
  10151. } else {
  10152. hierarchy.push(elements[i]);
  10153. elements[i].setAsParent();
  10154. if (layers[i].parent !== undefined) {
  10155. this.buildElementParenting(element, layers[i].parent, hierarchy);
  10156. } else {
  10157. element.setHierarchy(hierarchy);
  10158. }
  10159. }
  10160. }
  10161. i += 1;
  10162. }
  10163. };
  10164. BaseRenderer.prototype.addPendingElement = function (element) {
  10165. this.pendingElements.push(element);
  10166. };
  10167. BaseRenderer.prototype.searchExtraCompositions = function (assets) {
  10168. var i;
  10169. var len = assets.length;
  10170. for (i = 0; i < len; i += 1) {
  10171. if (assets[i].xt) {
  10172. var comp = this.createComp(assets[i]);
  10173. comp.initExpressions();
  10174. this.globalData.projectInterface.registerComposition(comp);
  10175. }
  10176. }
  10177. };
  10178. BaseRenderer.prototype.getElementById = function (ind) {
  10179. var i;
  10180. var len = this.elements.length;
  10181. for (i = 0; i < len; i += 1) {
  10182. if (this.elements[i].data.ind === ind) {
  10183. return this.elements[i];
  10184. }
  10185. }
  10186. return null;
  10187. };
  10188. BaseRenderer.prototype.getElementByPath = function (path) {
  10189. var pathValue = path.shift();
  10190. var element;
  10191. if (typeof pathValue === 'number') {
  10192. element = this.elements[pathValue];
  10193. } else {
  10194. var i;
  10195. var len = this.elements.length;
  10196. for (i = 0; i < len; i += 1) {
  10197. if (this.elements[i].data.nm === pathValue) {
  10198. element = this.elements[i];
  10199. break;
  10200. }
  10201. }
  10202. }
  10203. if (path.length === 0) {
  10204. return element;
  10205. }
  10206. return element.getElementByPath(path);
  10207. };
  10208. BaseRenderer.prototype.setupGlobalData = function (animData, fontsContainer) {
  10209. this.globalData.fontManager = new FontManager();
  10210. this.globalData.slotManager = slotFactory(animData);
  10211. this.globalData.fontManager.addChars(animData.chars);
  10212. this.globalData.fontManager.addFonts(animData.fonts, fontsContainer);
  10213. this.globalData.getAssetData = this.animationItem.getAssetData.bind(this.animationItem);
  10214. this.globalData.getAssetsPath = this.animationItem.getAssetsPath.bind(this.animationItem);
  10215. this.globalData.imageLoader = this.animationItem.imagePreloader;
  10216. this.globalData.audioController = this.animationItem.audioController;
  10217. this.globalData.frameId = 0;
  10218. this.globalData.frameRate = animData.fr;
  10219. this.globalData.nm = animData.nm;
  10220. this.globalData.compSize = {
  10221. w: animData.w,
  10222. h: animData.h
  10223. };
  10224. };
  10225. var effectTypes = {
  10226. TRANSFORM_EFFECT: 'transformEFfect'
  10227. };
  10228. function TransformElement() {}
  10229. TransformElement.prototype = {
  10230. initTransform: function initTransform() {
  10231. var mat = new Matrix();
  10232. this.finalTransform = {
  10233. mProp: this.data.ks ? TransformPropertyFactory.getTransformProperty(this, this.data.ks, this) : {
  10234. o: 0
  10235. },
  10236. _matMdf: false,
  10237. _localMatMdf: false,
  10238. _opMdf: false,
  10239. mat: mat,
  10240. localMat: mat,
  10241. localOpacity: 1
  10242. };
  10243. if (this.data.ao) {
  10244. this.finalTransform.mProp.autoOriented = true;
  10245. } // TODO: check TYPE 11: Guided elements
  10246. if (this.data.ty !== 11) {// this.createElements();
  10247. }
  10248. },
  10249. renderTransform: function renderTransform() {
  10250. this.finalTransform._opMdf = this.finalTransform.mProp.o._mdf || this._isFirstFrame;
  10251. this.finalTransform._matMdf = this.finalTransform.mProp._mdf || this._isFirstFrame;
  10252. if (this.hierarchy) {
  10253. var mat;
  10254. var finalMat = this.finalTransform.mat;
  10255. var i = 0;
  10256. var len = this.hierarchy.length; // Checking if any of the transformation matrices in the hierarchy chain has changed.
  10257. if (!this.finalTransform._matMdf) {
  10258. while (i < len) {
  10259. if (this.hierarchy[i].finalTransform.mProp._mdf) {
  10260. this.finalTransform._matMdf = true;
  10261. break;
  10262. }
  10263. i += 1;
  10264. }
  10265. }
  10266. if (this.finalTransform._matMdf) {
  10267. mat = this.finalTransform.mProp.v.props;
  10268. finalMat.cloneFromProps(mat);
  10269. for (i = 0; i < len; i += 1) {
  10270. finalMat.multiply(this.hierarchy[i].finalTransform.mProp.v);
  10271. }
  10272. }
  10273. }
  10274. if (this.finalTransform._matMdf) {
  10275. this.finalTransform._localMatMdf = this.finalTransform._matMdf;
  10276. }
  10277. if (this.finalTransform._opMdf) {
  10278. this.finalTransform.localOpacity = this.finalTransform.mProp.o.v;
  10279. }
  10280. },
  10281. renderLocalTransform: function renderLocalTransform() {
  10282. if (this.localTransforms) {
  10283. var i = 0;
  10284. var len = this.localTransforms.length;
  10285. this.finalTransform._localMatMdf = this.finalTransform._matMdf;
  10286. if (!this.finalTransform._localMatMdf || !this.finalTransform._opMdf) {
  10287. while (i < len) {
  10288. if (this.localTransforms[i]._mdf) {
  10289. this.finalTransform._localMatMdf = true;
  10290. }
  10291. if (this.localTransforms[i]._opMdf && !this.finalTransform._opMdf) {
  10292. this.finalTransform.localOpacity = this.finalTransform.mProp.o.v;
  10293. this.finalTransform._opMdf = true;
  10294. }
  10295. i += 1;
  10296. }
  10297. }
  10298. if (this.finalTransform._localMatMdf) {
  10299. var localMat = this.finalTransform.localMat;
  10300. this.localTransforms[0].matrix.clone(localMat);
  10301. for (i = 1; i < len; i += 1) {
  10302. var lmat = this.localTransforms[i].matrix;
  10303. localMat.multiply(lmat);
  10304. }
  10305. localMat.multiply(this.finalTransform.mat);
  10306. }
  10307. if (this.finalTransform._opMdf) {
  10308. var localOp = this.finalTransform.localOpacity;
  10309. for (i = 0; i < len; i += 1) {
  10310. localOp *= this.localTransforms[i].opacity * 0.01;
  10311. }
  10312. this.finalTransform.localOpacity = localOp;
  10313. }
  10314. }
  10315. },
  10316. searchEffectTransforms: function searchEffectTransforms() {
  10317. if (this.renderableEffectsManager) {
  10318. var transformEffects = this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT);
  10319. if (transformEffects.length) {
  10320. this.localTransforms = [];
  10321. this.finalTransform.localMat = new Matrix();
  10322. var i = 0;
  10323. var len = transformEffects.length;
  10324. for (i = 0; i < len; i += 1) {
  10325. this.localTransforms.push(transformEffects[i]);
  10326. }
  10327. }
  10328. }
  10329. },
  10330. globalToLocal: function globalToLocal(pt) {
  10331. var transforms = [];
  10332. transforms.push(this.finalTransform);
  10333. var flag = true;
  10334. var comp = this.comp;
  10335. while (flag) {
  10336. if (comp.finalTransform) {
  10337. if (comp.data.hasMask) {
  10338. transforms.splice(0, 0, comp.finalTransform);
  10339. }
  10340. comp = comp.comp;
  10341. } else {
  10342. flag = false;
  10343. }
  10344. }
  10345. var i;
  10346. var len = transforms.length;
  10347. var ptNew;
  10348. for (i = 0; i < len; i += 1) {
  10349. ptNew = transforms[i].mat.applyToPointArray(0, 0, 0); // ptNew = transforms[i].mat.applyToPointArray(pt[0],pt[1],pt[2]);
  10350. pt = [pt[0] - ptNew[0], pt[1] - ptNew[1], 0];
  10351. }
  10352. return pt;
  10353. },
  10354. mHelper: new Matrix()
  10355. };
  10356. function MaskElement(data, element, globalData) {
  10357. this.data = data;
  10358. this.element = element;
  10359. this.globalData = globalData;
  10360. this.storedData = [];
  10361. this.masksProperties = this.data.masksProperties || [];
  10362. this.maskElement = null;
  10363. var defs = this.globalData.defs;
  10364. var i;
  10365. var len = this.masksProperties ? this.masksProperties.length : 0;
  10366. this.viewData = createSizedArray(len);
  10367. this.solidPath = '';
  10368. var path;
  10369. var properties = this.masksProperties;
  10370. var count = 0;
  10371. var currentMasks = [];
  10372. var j;
  10373. var jLen;
  10374. var layerId = createElementID();
  10375. var rect;
  10376. var expansor;
  10377. var feMorph;
  10378. var x;
  10379. var maskType = 'clipPath';
  10380. var maskRef = 'clip-path';
  10381. for (i = 0; i < len; i += 1) {
  10382. if (properties[i].mode !== 'a' && properties[i].mode !== 'n' || properties[i].inv || properties[i].o.k !== 100 || properties[i].o.x) {
  10383. maskType = 'mask';
  10384. maskRef = 'mask';
  10385. }
  10386. if ((properties[i].mode === 's' || properties[i].mode === 'i') && count === 0) {
  10387. rect = createNS('rect');
  10388. rect.setAttribute('fill', '#ffffff');
  10389. rect.setAttribute('width', this.element.comp.data.w || 0);
  10390. rect.setAttribute('height', this.element.comp.data.h || 0);
  10391. currentMasks.push(rect);
  10392. } else {
  10393. rect = null;
  10394. }
  10395. path = createNS('path');
  10396. if (properties[i].mode === 'n') {
  10397. // TODO move this to a factory or to a constructor
  10398. this.viewData[i] = {
  10399. op: PropertyFactory.getProp(this.element, properties[i].o, 0, 0.01, this.element),
  10400. prop: ShapePropertyFactory.getShapeProp(this.element, properties[i], 3),
  10401. elem: path,
  10402. lastPath: ''
  10403. };
  10404. defs.appendChild(path);
  10405. } else {
  10406. count += 1;
  10407. path.setAttribute('fill', properties[i].mode === 's' ? '#000000' : '#ffffff');
  10408. path.setAttribute('clip-rule', 'nonzero');
  10409. var filterID;
  10410. if (properties[i].x.k !== 0) {
  10411. maskType = 'mask';
  10412. maskRef = 'mask';
  10413. x = PropertyFactory.getProp(this.element, properties[i].x, 0, null, this.element);
  10414. filterID = createElementID();
  10415. expansor = createNS('filter');
  10416. expansor.setAttribute('id', filterID);
  10417. feMorph = createNS('feMorphology');
  10418. feMorph.setAttribute('operator', 'erode');
  10419. feMorph.setAttribute('in', 'SourceGraphic');
  10420. feMorph.setAttribute('radius', '0');
  10421. expansor.appendChild(feMorph);
  10422. defs.appendChild(expansor);
  10423. path.setAttribute('stroke', properties[i].mode === 's' ? '#000000' : '#ffffff');
  10424. } else {
  10425. feMorph = null;
  10426. x = null;
  10427. } // TODO move this to a factory or to a constructor
  10428. this.storedData[i] = {
  10429. elem: path,
  10430. x: x,
  10431. expan: feMorph,
  10432. lastPath: '',
  10433. lastOperator: '',
  10434. filterId: filterID,
  10435. lastRadius: 0
  10436. };
  10437. if (properties[i].mode === 'i') {
  10438. jLen = currentMasks.length;
  10439. var g = createNS('g');
  10440. for (j = 0; j < jLen; j += 1) {
  10441. g.appendChild(currentMasks[j]);
  10442. }
  10443. var mask = createNS('mask');
  10444. mask.setAttribute('mask-type', 'alpha');
  10445. mask.setAttribute('id', layerId + '_' + count);
  10446. mask.appendChild(path);
  10447. defs.appendChild(mask);
  10448. g.setAttribute('mask', 'url(' + getLocationHref() + '#' + layerId + '_' + count + ')');
  10449. currentMasks.length = 0;
  10450. currentMasks.push(g);
  10451. } else {
  10452. currentMasks.push(path);
  10453. }
  10454. if (properties[i].inv && !this.solidPath) {
  10455. this.solidPath = this.createLayerSolidPath();
  10456. } // TODO move this to a factory or to a constructor
  10457. this.viewData[i] = {
  10458. elem: path,
  10459. lastPath: '',
  10460. op: PropertyFactory.getProp(this.element, properties[i].o, 0, 0.01, this.element),
  10461. prop: ShapePropertyFactory.getShapeProp(this.element, properties[i], 3),
  10462. invRect: rect
  10463. };
  10464. if (!this.viewData[i].prop.k) {
  10465. this.drawPath(properties[i], this.viewData[i].prop.v, this.viewData[i]);
  10466. }
  10467. }
  10468. }
  10469. this.maskElement = createNS(maskType);
  10470. len = currentMasks.length;
  10471. for (i = 0; i < len; i += 1) {
  10472. this.maskElement.appendChild(currentMasks[i]);
  10473. }
  10474. if (count > 0) {
  10475. this.maskElement.setAttribute('id', layerId);
  10476. this.element.maskedElement.setAttribute(maskRef, 'url(' + getLocationHref() + '#' + layerId + ')');
  10477. defs.appendChild(this.maskElement);
  10478. }
  10479. if (this.viewData.length) {
  10480. this.element.addRenderableComponent(this);
  10481. }
  10482. }
  10483. MaskElement.prototype.getMaskProperty = function (pos) {
  10484. return this.viewData[pos].prop;
  10485. };
  10486. MaskElement.prototype.renderFrame = function (isFirstFrame) {
  10487. var finalMat = this.element.finalTransform.mat;
  10488. var i;
  10489. var len = this.masksProperties.length;
  10490. for (i = 0; i < len; i += 1) {
  10491. if (this.viewData[i].prop._mdf || isFirstFrame) {
  10492. this.drawPath(this.masksProperties[i], this.viewData[i].prop.v, this.viewData[i]);
  10493. }
  10494. if (this.viewData[i].op._mdf || isFirstFrame) {
  10495. this.viewData[i].elem.setAttribute('fill-opacity', this.viewData[i].op.v);
  10496. }
  10497. if (this.masksProperties[i].mode !== 'n') {
  10498. if (this.viewData[i].invRect && (this.element.finalTransform.mProp._mdf || isFirstFrame)) {
  10499. this.viewData[i].invRect.setAttribute('transform', finalMat.getInverseMatrix().to2dCSS());
  10500. }
  10501. if (this.storedData[i].x && (this.storedData[i].x._mdf || isFirstFrame)) {
  10502. var feMorph = this.storedData[i].expan;
  10503. if (this.storedData[i].x.v < 0) {
  10504. if (this.storedData[i].lastOperator !== 'erode') {
  10505. this.storedData[i].lastOperator = 'erode';
  10506. this.storedData[i].elem.setAttribute('filter', 'url(' + getLocationHref() + '#' + this.storedData[i].filterId + ')');
  10507. }
  10508. feMorph.setAttribute('radius', -this.storedData[i].x.v);
  10509. } else {
  10510. if (this.storedData[i].lastOperator !== 'dilate') {
  10511. this.storedData[i].lastOperator = 'dilate';
  10512. this.storedData[i].elem.setAttribute('filter', null);
  10513. }
  10514. this.storedData[i].elem.setAttribute('stroke-width', this.storedData[i].x.v * 2);
  10515. }
  10516. }
  10517. }
  10518. }
  10519. };
  10520. MaskElement.prototype.getMaskelement = function () {
  10521. return this.maskElement;
  10522. };
  10523. MaskElement.prototype.createLayerSolidPath = function () {
  10524. var path = 'M0,0 ';
  10525. path += ' h' + this.globalData.compSize.w;
  10526. path += ' v' + this.globalData.compSize.h;
  10527. path += ' h-' + this.globalData.compSize.w;
  10528. path += ' v-' + this.globalData.compSize.h + ' ';
  10529. return path;
  10530. };
  10531. MaskElement.prototype.drawPath = function (pathData, pathNodes, viewData) {
  10532. var pathString = ' M' + pathNodes.v[0][0] + ',' + pathNodes.v[0][1];
  10533. var i;
  10534. var len;
  10535. len = pathNodes._length;
  10536. for (i = 1; i < len; i += 1) {
  10537. // pathString += " C"+pathNodes.o[i-1][0]+','+pathNodes.o[i-1][1] + " "+pathNodes.i[i][0]+','+pathNodes.i[i][1] + " "+pathNodes.v[i][0]+','+pathNodes.v[i][1];
  10538. pathString += ' C' + pathNodes.o[i - 1][0] + ',' + pathNodes.o[i - 1][1] + ' ' + pathNodes.i[i][0] + ',' + pathNodes.i[i][1] + ' ' + pathNodes.v[i][0] + ',' + pathNodes.v[i][1];
  10539. } // pathString += " C"+pathNodes.o[i-1][0]+','+pathNodes.o[i-1][1] + " "+pathNodes.i[0][0]+','+pathNodes.i[0][1] + " "+pathNodes.v[0][0]+','+pathNodes.v[0][1];
  10540. if (pathNodes.c && len > 1) {
  10541. pathString += ' C' + pathNodes.o[i - 1][0] + ',' + pathNodes.o[i - 1][1] + ' ' + pathNodes.i[0][0] + ',' + pathNodes.i[0][1] + ' ' + pathNodes.v[0][0] + ',' + pathNodes.v[0][1];
  10542. } // pathNodes.__renderedString = pathString;
  10543. if (viewData.lastPath !== pathString) {
  10544. var pathShapeValue = '';
  10545. if (viewData.elem) {
  10546. if (pathNodes.c) {
  10547. pathShapeValue = pathData.inv ? this.solidPath + pathString : pathString;
  10548. }
  10549. viewData.elem.setAttribute('d', pathShapeValue);
  10550. }
  10551. viewData.lastPath = pathString;
  10552. }
  10553. };
  10554. MaskElement.prototype.destroy = function () {
  10555. this.element = null;
  10556. this.globalData = null;
  10557. this.maskElement = null;
  10558. this.data = null;
  10559. this.masksProperties = null;
  10560. };
  10561. var filtersFactory = function () {
  10562. var ob = {};
  10563. ob.createFilter = createFilter;
  10564. ob.createAlphaToLuminanceFilter = createAlphaToLuminanceFilter;
  10565. function createFilter(filId, skipCoordinates) {
  10566. var fil = createNS('filter');
  10567. fil.setAttribute('id', filId);
  10568. if (skipCoordinates !== true) {
  10569. fil.setAttribute('filterUnits', 'objectBoundingBox');
  10570. fil.setAttribute('x', '0%');
  10571. fil.setAttribute('y', '0%');
  10572. fil.setAttribute('width', '100%');
  10573. fil.setAttribute('height', '100%');
  10574. }
  10575. return fil;
  10576. }
  10577. function createAlphaToLuminanceFilter() {
  10578. var feColorMatrix = createNS('feColorMatrix');
  10579. feColorMatrix.setAttribute('type', 'matrix');
  10580. feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
  10581. feColorMatrix.setAttribute('values', '0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1');
  10582. return feColorMatrix;
  10583. }
  10584. return ob;
  10585. }();
  10586. var featureSupport = function () {
  10587. var ob = {
  10588. maskType: true,
  10589. svgLumaHidden: true,
  10590. offscreenCanvas: typeof OffscreenCanvas !== 'undefined'
  10591. };
  10592. if (/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)) {
  10593. ob.maskType = false;
  10594. }
  10595. if (/firefox/i.test(navigator.userAgent)) {
  10596. ob.svgLumaHidden = false;
  10597. }
  10598. return ob;
  10599. }();
  10600. var registeredEffects$1 = {};
  10601. var idPrefix = 'filter_result_';
  10602. function SVGEffects(elem) {
  10603. var i;
  10604. var source = 'SourceGraphic';
  10605. var len = elem.data.ef ? elem.data.ef.length : 0;
  10606. var filId = createElementID();
  10607. var fil = filtersFactory.createFilter(filId, true);
  10608. var count = 0;
  10609. this.filters = [];
  10610. var filterManager;
  10611. for (i = 0; i < len; i += 1) {
  10612. filterManager = null;
  10613. var type = elem.data.ef[i].ty;
  10614. if (registeredEffects$1[type]) {
  10615. var Effect = registeredEffects$1[type].effect;
  10616. filterManager = new Effect(fil, elem.effectsManager.effectElements[i], elem, idPrefix + count, source);
  10617. source = idPrefix + count;
  10618. if (registeredEffects$1[type].countsAsEffect) {
  10619. count += 1;
  10620. }
  10621. }
  10622. if (filterManager) {
  10623. this.filters.push(filterManager);
  10624. }
  10625. }
  10626. if (count) {
  10627. elem.globalData.defs.appendChild(fil);
  10628. elem.layerElement.setAttribute('filter', 'url(' + getLocationHref() + '#' + filId + ')');
  10629. }
  10630. if (this.filters.length) {
  10631. elem.addRenderableComponent(this);
  10632. }
  10633. }
  10634. SVGEffects.prototype.renderFrame = function (_isFirstFrame) {
  10635. var i;
  10636. var len = this.filters.length;
  10637. for (i = 0; i < len; i += 1) {
  10638. this.filters[i].renderFrame(_isFirstFrame);
  10639. }
  10640. };
  10641. SVGEffects.prototype.getEffects = function (type) {
  10642. var i;
  10643. var len = this.filters.length;
  10644. var effects = [];
  10645. for (i = 0; i < len; i += 1) {
  10646. if (this.filters[i].type === type) {
  10647. effects.push(this.filters[i]);
  10648. }
  10649. }
  10650. return effects;
  10651. };
  10652. function registerEffect$1(id, effect, countsAsEffect) {
  10653. registeredEffects$1[id] = {
  10654. effect: effect,
  10655. countsAsEffect: countsAsEffect
  10656. };
  10657. }
  10658. function SVGBaseElement() {}
  10659. SVGBaseElement.prototype = {
  10660. initRendererElement: function initRendererElement() {
  10661. this.layerElement = createNS('g');
  10662. },
  10663. createContainerElements: function createContainerElements() {
  10664. this.matteElement = createNS('g');
  10665. this.transformedElement = this.layerElement;
  10666. this.maskedElement = this.layerElement;
  10667. this._sizeChanged = false;
  10668. var layerElementParent = null; // If this layer acts as a mask for the following layer
  10669. if (this.data.td) {
  10670. this.matteMasks = {};
  10671. var gg = createNS('g');
  10672. gg.setAttribute('id', this.layerId);
  10673. gg.appendChild(this.layerElement);
  10674. layerElementParent = gg;
  10675. this.globalData.defs.appendChild(gg);
  10676. } else if (this.data.tt) {
  10677. this.matteElement.appendChild(this.layerElement);
  10678. layerElementParent = this.matteElement;
  10679. this.baseElement = this.matteElement;
  10680. } else {
  10681. this.baseElement = this.layerElement;
  10682. }
  10683. if (this.data.ln) {
  10684. this.layerElement.setAttribute('id', this.data.ln);
  10685. }
  10686. if (this.data.cl) {
  10687. this.layerElement.setAttribute('class', this.data.cl);
  10688. } // Clipping compositions to hide content that exceeds boundaries. If collapsed transformations is on, component should not be clipped
  10689. if (this.data.ty === 0 && !this.data.hd) {
  10690. var cp = createNS('clipPath');
  10691. var pt = createNS('path');
  10692. pt.setAttribute('d', 'M0,0 L' + this.data.w + ',0 L' + this.data.w + ',' + this.data.h + ' L0,' + this.data.h + 'z');
  10693. var clipId = createElementID();
  10694. cp.setAttribute('id', clipId);
  10695. cp.appendChild(pt);
  10696. this.globalData.defs.appendChild(cp);
  10697. if (this.checkMasks()) {
  10698. var cpGroup = createNS('g');
  10699. cpGroup.setAttribute('clip-path', 'url(' + getLocationHref() + '#' + clipId + ')');
  10700. cpGroup.appendChild(this.layerElement);
  10701. this.transformedElement = cpGroup;
  10702. if (layerElementParent) {
  10703. layerElementParent.appendChild(this.transformedElement);
  10704. } else {
  10705. this.baseElement = this.transformedElement;
  10706. }
  10707. } else {
  10708. this.layerElement.setAttribute('clip-path', 'url(' + getLocationHref() + '#' + clipId + ')');
  10709. }
  10710. }
  10711. if (this.data.bm !== 0) {
  10712. this.setBlendMode();
  10713. }
  10714. },
  10715. renderElement: function renderElement() {
  10716. if (this.finalTransform._localMatMdf) {
  10717. this.transformedElement.setAttribute('transform', this.finalTransform.localMat.to2dCSS());
  10718. }
  10719. if (this.finalTransform._opMdf) {
  10720. this.transformedElement.setAttribute('opacity', this.finalTransform.localOpacity);
  10721. }
  10722. },
  10723. destroyBaseElement: function destroyBaseElement() {
  10724. this.layerElement = null;
  10725. this.matteElement = null;
  10726. this.maskManager.destroy();
  10727. },
  10728. getBaseElement: function getBaseElement() {
  10729. if (this.data.hd) {
  10730. return null;
  10731. }
  10732. return this.baseElement;
  10733. },
  10734. createRenderableComponents: function createRenderableComponents() {
  10735. this.maskManager = new MaskElement(this.data, this, this.globalData);
  10736. this.renderableEffectsManager = new SVGEffects(this);
  10737. this.searchEffectTransforms();
  10738. },
  10739. getMatte: function getMatte(matteType) {
  10740. // This should not be a common case. But for backward compatibility, we'll create the matte object.
  10741. // It solves animations that have two consecutive layers marked as matte masks.
  10742. // Which is an undefined behavior in AE.
  10743. if (!this.matteMasks) {
  10744. this.matteMasks = {};
  10745. }
  10746. if (!this.matteMasks[matteType]) {
  10747. var id = this.layerId + '_' + matteType;
  10748. var filId;
  10749. var fil;
  10750. var useElement;
  10751. var gg;
  10752. if (matteType === 1 || matteType === 3) {
  10753. var masker = createNS('mask');
  10754. masker.setAttribute('id', id);
  10755. masker.setAttribute('mask-type', matteType === 3 ? 'luminance' : 'alpha');
  10756. useElement = createNS('use');
  10757. useElement.setAttributeNS('http://www.w3.org/1999/xlink', 'href', '#' + this.layerId);
  10758. masker.appendChild(useElement);
  10759. this.globalData.defs.appendChild(masker);
  10760. if (!featureSupport.maskType && matteType === 1) {
  10761. masker.setAttribute('mask-type', 'luminance');
  10762. filId = createElementID();
  10763. fil = filtersFactory.createFilter(filId);
  10764. this.globalData.defs.appendChild(fil);
  10765. fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
  10766. gg = createNS('g');
  10767. gg.appendChild(useElement);
  10768. masker.appendChild(gg);
  10769. gg.setAttribute('filter', 'url(' + getLocationHref() + '#' + filId + ')');
  10770. }
  10771. } else if (matteType === 2) {
  10772. var maskGroup = createNS('mask');
  10773. maskGroup.setAttribute('id', id);
  10774. maskGroup.setAttribute('mask-type', 'alpha');
  10775. var maskGrouper = createNS('g');
  10776. maskGroup.appendChild(maskGrouper);
  10777. filId = createElementID();
  10778. fil = filtersFactory.createFilter(filId); /// /
  10779. var feCTr = createNS('feComponentTransfer');
  10780. feCTr.setAttribute('in', 'SourceGraphic');
  10781. fil.appendChild(feCTr);
  10782. var feFunc = createNS('feFuncA');
  10783. feFunc.setAttribute('type', 'table');
  10784. feFunc.setAttribute('tableValues', '1.0 0.0');
  10785. feCTr.appendChild(feFunc); /// /
  10786. this.globalData.defs.appendChild(fil);
  10787. var alphaRect = createNS('rect');
  10788. alphaRect.setAttribute('width', this.comp.data.w);
  10789. alphaRect.setAttribute('height', this.comp.data.h);
  10790. alphaRect.setAttribute('x', '0');
  10791. alphaRect.setAttribute('y', '0');
  10792. alphaRect.setAttribute('fill', '#ffffff');
  10793. alphaRect.setAttribute('opacity', '0');
  10794. maskGrouper.setAttribute('filter', 'url(' + getLocationHref() + '#' + filId + ')');
  10795. maskGrouper.appendChild(alphaRect);
  10796. useElement = createNS('use');
  10797. useElement.setAttributeNS('http://www.w3.org/1999/xlink', 'href', '#' + this.layerId);
  10798. maskGrouper.appendChild(useElement);
  10799. if (!featureSupport.maskType) {
  10800. maskGroup.setAttribute('mask-type', 'luminance');
  10801. fil.appendChild(filtersFactory.createAlphaToLuminanceFilter());
  10802. gg = createNS('g');
  10803. maskGrouper.appendChild(alphaRect);
  10804. gg.appendChild(this.layerElement);
  10805. maskGrouper.appendChild(gg);
  10806. }
  10807. this.globalData.defs.appendChild(maskGroup);
  10808. }
  10809. this.matteMasks[matteType] = id;
  10810. }
  10811. return this.matteMasks[matteType];
  10812. },
  10813. setMatte: function setMatte(id) {
  10814. if (!this.matteElement) {
  10815. return;
  10816. }
  10817. this.matteElement.setAttribute('mask', 'url(' + getLocationHref() + '#' + id + ')');
  10818. }
  10819. };
  10820. /**
  10821. * @file
  10822. * Handles AE's layer parenting property.
  10823. *
  10824. */
  10825. function HierarchyElement() {}
  10826. HierarchyElement.prototype = {
  10827. /**
  10828. * @function
  10829. * Initializes hierarchy properties
  10830. *
  10831. */
  10832. initHierarchy: function initHierarchy() {
  10833. // element's parent list
  10834. this.hierarchy = []; // if element is parent of another layer _isParent will be true
  10835. this._isParent = false;
  10836. this.checkParenting();
  10837. },
  10838. /**
  10839. * @function
  10840. * Sets layer's hierarchy.
  10841. * @param {array} hierarch
  10842. * layer's parent list
  10843. *
  10844. */
  10845. setHierarchy: function setHierarchy(hierarchy) {
  10846. this.hierarchy = hierarchy;
  10847. },
  10848. /**
  10849. * @function
  10850. * Sets layer as parent.
  10851. *
  10852. */
  10853. setAsParent: function setAsParent() {
  10854. this._isParent = true;
  10855. },
  10856. /**
  10857. * @function
  10858. * Searches layer's parenting chain
  10859. *
  10860. */
  10861. checkParenting: function checkParenting() {
  10862. if (this.data.parent !== undefined) {
  10863. this.comp.buildElementParenting(this, this.data.parent, []);
  10864. }
  10865. }
  10866. };
  10867. function RenderableDOMElement() {}
  10868. (function () {
  10869. var _prototype = {
  10870. initElement: function initElement(data, globalData, comp) {
  10871. this.initFrame();
  10872. this.initBaseData(data, globalData, comp);
  10873. this.initTransform(data, globalData, comp);
  10874. this.initHierarchy();
  10875. this.initRenderable();
  10876. this.initRendererElement();
  10877. this.createContainerElements();
  10878. this.createRenderableComponents();
  10879. this.createContent();
  10880. this.hide();
  10881. },
  10882. hide: function hide() {
  10883. // console.log('HIDE', this);
  10884. if (!this.hidden && (!this.isInRange || this.isTransparent)) {
  10885. var elem = this.baseElement || this.layerElement;
  10886. elem.style.display = 'none';
  10887. this.hidden = true;
  10888. }
  10889. },
  10890. show: function show() {
  10891. // console.log('SHOW', this);
  10892. if (this.isInRange && !this.isTransparent) {
  10893. if (!this.data.hd) {
  10894. var elem = this.baseElement || this.layerElement;
  10895. elem.style.display = 'block';
  10896. }
  10897. this.hidden = false;
  10898. this._isFirstFrame = true;
  10899. }
  10900. },
  10901. renderFrame: function renderFrame() {
  10902. // If it is exported as hidden (data.hd === true) no need to render
  10903. // If it is not visible no need to render
  10904. if (this.data.hd || this.hidden) {
  10905. return;
  10906. }
  10907. this.renderTransform();
  10908. this.renderRenderable();
  10909. this.renderLocalTransform();
  10910. this.renderElement();
  10911. this.renderInnerContent();
  10912. if (this._isFirstFrame) {
  10913. this._isFirstFrame = false;
  10914. }
  10915. },
  10916. renderInnerContent: function renderInnerContent() {},
  10917. prepareFrame: function prepareFrame(num) {
  10918. this._mdf = false;
  10919. this.prepareRenderableFrame(num);
  10920. this.prepareProperties(num, this.isInRange);
  10921. this.checkTransparency();
  10922. },
  10923. destroy: function destroy() {
  10924. this.innerElem = null;
  10925. this.destroyBaseElement();
  10926. }
  10927. };
  10928. extendPrototype([RenderableElement, createProxyFunction(_prototype)], RenderableDOMElement);
  10929. })();
  10930. function IImageElement(data, globalData, comp) {
  10931. this.assetData = globalData.getAssetData(data.refId);
  10932. if (this.assetData && this.assetData.sid) {
  10933. this.assetData = globalData.slotManager.getProp(this.assetData);
  10934. }
  10935. this.initElement(data, globalData, comp);
  10936. this.sourceRect = {
  10937. top: 0,
  10938. left: 0,
  10939. width: this.assetData.w,
  10940. height: this.assetData.h
  10941. };
  10942. }
  10943. extendPrototype([BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement], IImageElement);
  10944. IImageElement.prototype.createContent = function () {
  10945. var assetPath = this.globalData.getAssetsPath(this.assetData);
  10946. this.innerElem = createNS('image');
  10947. this.innerElem.setAttribute('width', this.assetData.w + 'px');
  10948. this.innerElem.setAttribute('height', this.assetData.h + 'px');
  10949. this.innerElem.setAttribute('preserveAspectRatio', this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio);
  10950. this.innerElem.setAttributeNS('http://www.w3.org/1999/xlink', 'href', assetPath);
  10951. this.layerElement.appendChild(this.innerElem);
  10952. };
  10953. IImageElement.prototype.sourceRectAtTime = function () {
  10954. return this.sourceRect;
  10955. };
  10956. function ProcessedElement(element, position) {
  10957. this.elem = element;
  10958. this.pos = position;
  10959. }
  10960. function IShapeElement() {}
  10961. IShapeElement.prototype = {
  10962. addShapeToModifiers: function addShapeToModifiers(data) {
  10963. var i;
  10964. var len = this.shapeModifiers.length;
  10965. for (i = 0; i < len; i += 1) {
  10966. this.shapeModifiers[i].addShape(data);
  10967. }
  10968. },
  10969. isShapeInAnimatedModifiers: function isShapeInAnimatedModifiers(data) {
  10970. var i = 0;
  10971. var len = this.shapeModifiers.length;
  10972. while (i < len) {
  10973. if (this.shapeModifiers[i].isAnimatedWithShape(data)) {
  10974. return true;
  10975. }
  10976. }
  10977. return false;
  10978. },
  10979. renderModifiers: function renderModifiers() {
  10980. if (!this.shapeModifiers.length) {
  10981. return;
  10982. }
  10983. var i;
  10984. var len = this.shapes.length;
  10985. for (i = 0; i < len; i += 1) {
  10986. this.shapes[i].sh.reset();
  10987. }
  10988. len = this.shapeModifiers.length;
  10989. var shouldBreakProcess;
  10990. for (i = len - 1; i >= 0; i -= 1) {
  10991. shouldBreakProcess = this.shapeModifiers[i].processShapes(this._isFirstFrame); // workaround to fix cases where a repeater resets the shape so the following processes get called twice
  10992. // TODO: find a better solution for this
  10993. if (shouldBreakProcess) {
  10994. break;
  10995. }
  10996. }
  10997. },
  10998. searchProcessedElement: function searchProcessedElement(elem) {
  10999. var elements = this.processedElements;
  11000. var i = 0;
  11001. var len = elements.length;
  11002. while (i < len) {
  11003. if (elements[i].elem === elem) {
  11004. return elements[i].pos;
  11005. }
  11006. i += 1;
  11007. }
  11008. return 0;
  11009. },
  11010. addProcessedElement: function addProcessedElement(elem, pos) {
  11011. var elements = this.processedElements;
  11012. var i = elements.length;
  11013. while (i) {
  11014. i -= 1;
  11015. if (elements[i].elem === elem) {
  11016. elements[i].pos = pos;
  11017. return;
  11018. }
  11019. }
  11020. elements.push(new ProcessedElement(elem, pos));
  11021. },
  11022. prepareFrame: function prepareFrame(num) {
  11023. this.prepareRenderableFrame(num);
  11024. this.prepareProperties(num, this.isInRange);
  11025. }
  11026. };
  11027. var lineCapEnum = {
  11028. 1: 'butt',
  11029. 2: 'round',
  11030. 3: 'square'
  11031. };
  11032. var lineJoinEnum = {
  11033. 1: 'miter',
  11034. 2: 'round',
  11035. 3: 'bevel'
  11036. };
  11037. function SVGShapeData(transformers, level, shape) {
  11038. this.caches = [];
  11039. this.styles = [];
  11040. this.transformers = transformers;
  11041. this.lStr = '';
  11042. this.sh = shape;
  11043. this.lvl = level; // TODO find if there are some cases where _isAnimated can be false.
  11044. // For now, since shapes add up with other shapes. They have to be calculated every time.
  11045. // One way of finding out is checking if all styles associated to this shape depend only of this shape
  11046. this._isAnimated = !!shape.k; // TODO: commenting this for now since all shapes are animated
  11047. var i = 0;
  11048. var len = transformers.length;
  11049. while (i < len) {
  11050. if (transformers[i].mProps.dynamicProperties.length) {
  11051. this._isAnimated = true;
  11052. break;
  11053. }
  11054. i += 1;
  11055. }
  11056. }
  11057. SVGShapeData.prototype.setAsAnimated = function () {
  11058. this._isAnimated = true;
  11059. };
  11060. function SVGStyleData(data, level) {
  11061. this.data = data;
  11062. this.type = data.ty;
  11063. this.d = '';
  11064. this.lvl = level;
  11065. this._mdf = false;
  11066. this.closed = data.hd === true;
  11067. this.pElem = createNS('path');
  11068. this.msElem = null;
  11069. }
  11070. SVGStyleData.prototype.reset = function () {
  11071. this.d = '';
  11072. this._mdf = false;
  11073. };
  11074. function DashProperty(elem, data, renderer, container) {
  11075. this.elem = elem;
  11076. this.frameId = -1;
  11077. this.dataProps = createSizedArray(data.length);
  11078. this.renderer = renderer;
  11079. this.k = false;
  11080. this.dashStr = '';
  11081. this.dashArray = createTypedArray('float32', data.length ? data.length - 1 : 0);
  11082. this.dashoffset = createTypedArray('float32', 1);
  11083. this.initDynamicPropertyContainer(container);
  11084. var i;
  11085. var len = data.length || 0;
  11086. var prop;
  11087. for (i = 0; i < len; i += 1) {
  11088. prop = PropertyFactory.getProp(elem, data[i].v, 0, 0, this);
  11089. this.k = prop.k || this.k;
  11090. this.dataProps[i] = {
  11091. n: data[i].n,
  11092. p: prop
  11093. };
  11094. }
  11095. if (!this.k) {
  11096. this.getValue(true);
  11097. }
  11098. this._isAnimated = this.k;
  11099. }
  11100. DashProperty.prototype.getValue = function (forceRender) {
  11101. if (this.elem.globalData.frameId === this.frameId && !forceRender) {
  11102. return;
  11103. }
  11104. this.frameId = this.elem.globalData.frameId;
  11105. this.iterateDynamicProperties();
  11106. this._mdf = this._mdf || forceRender;
  11107. if (this._mdf) {
  11108. var i = 0;
  11109. var len = this.dataProps.length;
  11110. if (this.renderer === 'svg') {
  11111. this.dashStr = '';
  11112. }
  11113. for (i = 0; i < len; i += 1) {
  11114. if (this.dataProps[i].n !== 'o') {
  11115. if (this.renderer === 'svg') {
  11116. this.dashStr += ' ' + this.dataProps[i].p.v;
  11117. } else {
  11118. this.dashArray[i] = this.dataProps[i].p.v;
  11119. }
  11120. } else {
  11121. this.dashoffset[0] = this.dataProps[i].p.v;
  11122. }
  11123. }
  11124. }
  11125. };
  11126. extendPrototype([DynamicPropertyContainer], DashProperty);
  11127. function SVGStrokeStyleData(elem, data, styleOb) {
  11128. this.initDynamicPropertyContainer(elem);
  11129. this.getValue = this.iterateDynamicProperties;
  11130. this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, this);
  11131. this.w = PropertyFactory.getProp(elem, data.w, 0, null, this);
  11132. this.d = new DashProperty(elem, data.d || {}, 'svg', this);
  11133. this.c = PropertyFactory.getProp(elem, data.c, 1, 255, this);
  11134. this.style = styleOb;
  11135. this._isAnimated = !!this._isAnimated;
  11136. }
  11137. extendPrototype([DynamicPropertyContainer], SVGStrokeStyleData);
  11138. function SVGFillStyleData(elem, data, styleOb) {
  11139. this.initDynamicPropertyContainer(elem);
  11140. this.getValue = this.iterateDynamicProperties;
  11141. this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, this);
  11142. this.c = PropertyFactory.getProp(elem, data.c, 1, 255, this);
  11143. this.style = styleOb;
  11144. }
  11145. extendPrototype([DynamicPropertyContainer], SVGFillStyleData);
  11146. function SVGNoStyleData(elem, data, styleOb) {
  11147. this.initDynamicPropertyContainer(elem);
  11148. this.getValue = this.iterateDynamicProperties;
  11149. this.style = styleOb;
  11150. }
  11151. extendPrototype([DynamicPropertyContainer], SVGNoStyleData);
  11152. function GradientProperty(elem, data, container) {
  11153. this.data = data;
  11154. this.c = createTypedArray('uint8c', data.p * 4);
  11155. var cLength = data.k.k[0].s ? data.k.k[0].s.length - data.p * 4 : data.k.k.length - data.p * 4;
  11156. this.o = createTypedArray('float32', cLength);
  11157. this._cmdf = false;
  11158. this._omdf = false;
  11159. this._collapsable = this.checkCollapsable();
  11160. this._hasOpacity = cLength;
  11161. this.initDynamicPropertyContainer(container);
  11162. this.prop = PropertyFactory.getProp(elem, data.k, 1, null, this);
  11163. this.k = this.prop.k;
  11164. this.getValue(true);
  11165. }
  11166. GradientProperty.prototype.comparePoints = function (values, points) {
  11167. var i = 0;
  11168. var len = this.o.length / 2;
  11169. var diff;
  11170. while (i < len) {
  11171. diff = Math.abs(values[i * 4] - values[points * 4 + i * 2]);
  11172. if (diff > 0.01) {
  11173. return false;
  11174. }
  11175. i += 1;
  11176. }
  11177. return true;
  11178. };
  11179. GradientProperty.prototype.checkCollapsable = function () {
  11180. if (this.o.length / 2 !== this.c.length / 4) {
  11181. return false;
  11182. }
  11183. if (this.data.k.k[0].s) {
  11184. var i = 0;
  11185. var len = this.data.k.k.length;
  11186. while (i < len) {
  11187. if (!this.comparePoints(this.data.k.k[i].s, this.data.p)) {
  11188. return false;
  11189. }
  11190. i += 1;
  11191. }
  11192. } else if (!this.comparePoints(this.data.k.k, this.data.p)) {
  11193. return false;
  11194. }
  11195. return true;
  11196. };
  11197. GradientProperty.prototype.getValue = function (forceRender) {
  11198. this.prop.getValue();
  11199. this._mdf = false;
  11200. this._cmdf = false;
  11201. this._omdf = false;
  11202. if (this.prop._mdf || forceRender) {
  11203. var i;
  11204. var len = this.data.p * 4;
  11205. var mult;
  11206. var val;
  11207. for (i = 0; i < len; i += 1) {
  11208. mult = i % 4 === 0 ? 100 : 255;
  11209. val = Math.round(this.prop.v[i] * mult);
  11210. if (this.c[i] !== val) {
  11211. this.c[i] = val;
  11212. this._cmdf = !forceRender;
  11213. }
  11214. }
  11215. if (this.o.length) {
  11216. len = this.prop.v.length;
  11217. for (i = this.data.p * 4; i < len; i += 1) {
  11218. mult = i % 2 === 0 ? 100 : 1;
  11219. val = i % 2 === 0 ? Math.round(this.prop.v[i] * 100) : this.prop.v[i];
  11220. if (this.o[i - this.data.p * 4] !== val) {
  11221. this.o[i - this.data.p * 4] = val;
  11222. this._omdf = !forceRender;
  11223. }
  11224. }
  11225. }
  11226. this._mdf = !forceRender;
  11227. }
  11228. };
  11229. extendPrototype([DynamicPropertyContainer], GradientProperty);
  11230. function SVGGradientFillStyleData(elem, data, styleOb) {
  11231. this.initDynamicPropertyContainer(elem);
  11232. this.getValue = this.iterateDynamicProperties;
  11233. this.initGradientData(elem, data, styleOb);
  11234. }
  11235. SVGGradientFillStyleData.prototype.initGradientData = function (elem, data, styleOb) {
  11236. this.o = PropertyFactory.getProp(elem, data.o, 0, 0.01, this);
  11237. this.s = PropertyFactory.getProp(elem, data.s, 1, null, this);
  11238. this.e = PropertyFactory.getProp(elem, data.e, 1, null, this);
  11239. this.h = PropertyFactory.getProp(elem, data.h || {
  11240. k: 0
  11241. }, 0, 0.01, this);
  11242. this.a = PropertyFactory.getProp(elem, data.a || {
  11243. k: 0
  11244. }, 0, degToRads, this);
  11245. this.g = new GradientProperty(elem, data.g, this);
  11246. this.style = styleOb;
  11247. this.stops = [];
  11248. this.setGradientData(styleOb.pElem, data);
  11249. this.setGradientOpacity(data, styleOb);
  11250. this._isAnimated = !!this._isAnimated;
  11251. };
  11252. SVGGradientFillStyleData.prototype.setGradientData = function (pathElement, data) {
  11253. var gradientId = createElementID();
  11254. var gfill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
  11255. gfill.setAttribute('id', gradientId);
  11256. gfill.setAttribute('spreadMethod', 'pad');
  11257. gfill.setAttribute('gradientUnits', 'userSpaceOnUse');
  11258. var stops = [];
  11259. var stop;
  11260. var j;
  11261. var jLen;
  11262. jLen = data.g.p * 4;
  11263. for (j = 0; j < jLen; j += 4) {
  11264. stop = createNS('stop');
  11265. gfill.appendChild(stop);
  11266. stops.push(stop);
  11267. }
  11268. pathElement.setAttribute(data.ty === 'gf' ? 'fill' : 'stroke', 'url(' + getLocationHref() + '#' + gradientId + ')');
  11269. this.gf = gfill;
  11270. this.cst = stops;
  11271. };
  11272. SVGGradientFillStyleData.prototype.setGradientOpacity = function (data, styleOb) {
  11273. if (this.g._hasOpacity && !this.g._collapsable) {
  11274. var stop;
  11275. var j;
  11276. var jLen;
  11277. var mask = createNS('mask');
  11278. var maskElement = createNS('path');
  11279. mask.appendChild(maskElement);
  11280. var opacityId = createElementID();
  11281. var maskId = createElementID();
  11282. mask.setAttribute('id', maskId);
  11283. var opFill = createNS(data.t === 1 ? 'linearGradient' : 'radialGradient');
  11284. opFill.setAttribute('id', opacityId);
  11285. opFill.setAttribute('spreadMethod', 'pad');
  11286. opFill.setAttribute('gradientUnits', 'userSpaceOnUse');
  11287. jLen = data.g.k.k[0].s ? data.g.k.k[0].s.length : data.g.k.k.length;
  11288. var stops = this.stops;
  11289. for (j = data.g.p * 4; j < jLen; j += 2) {
  11290. stop = createNS('stop');
  11291. stop.setAttribute('stop-color', 'rgb(255,255,255)');
  11292. opFill.appendChild(stop);
  11293. stops.push(stop);
  11294. }
  11295. maskElement.setAttribute(data.ty === 'gf' ? 'fill' : 'stroke', 'url(' + getLocationHref() + '#' + opacityId + ')');
  11296. if (data.ty === 'gs') {
  11297. maskElement.setAttribute('stroke-linecap', lineCapEnum[data.lc || 2]);
  11298. maskElement.setAttribute('stroke-linejoin', lineJoinEnum[data.lj || 2]);
  11299. if (data.lj === 1) {
  11300. maskElement.setAttribute('stroke-miterlimit', data.ml);
  11301. }
  11302. }
  11303. this.of = opFill;
  11304. this.ms = mask;
  11305. this.ost = stops;
  11306. this.maskId = maskId;
  11307. styleOb.msElem = maskElement;
  11308. }
  11309. };
  11310. extendPrototype([DynamicPropertyContainer], SVGGradientFillStyleData);
  11311. function SVGGradientStrokeStyleData(elem, data, styleOb) {
  11312. this.initDynamicPropertyContainer(elem);
  11313. this.getValue = this.iterateDynamicProperties;
  11314. this.w = PropertyFactory.getProp(elem, data.w, 0, null, this);
  11315. this.d = new DashProperty(elem, data.d || {}, 'svg', this);
  11316. this.initGradientData(elem, data, styleOb);
  11317. this._isAnimated = !!this._isAnimated;
  11318. }
  11319. extendPrototype([SVGGradientFillStyleData, DynamicPropertyContainer], SVGGradientStrokeStyleData);
  11320. function ShapeGroupData() {
  11321. this.it = [];
  11322. this.prevViewData = [];
  11323. this.gr = createNS('g');
  11324. }
  11325. function SVGTransformData(mProps, op, container) {
  11326. this.transform = {
  11327. mProps: mProps,
  11328. op: op,
  11329. container: container
  11330. };
  11331. this.elements = [];
  11332. this._isAnimated = this.transform.mProps.dynamicProperties.length || this.transform.op.effectsSequence.length;
  11333. }
  11334. var buildShapeString = function buildShapeString(pathNodes, length, closed, mat) {
  11335. if (length === 0) {
  11336. return '';
  11337. }
  11338. var _o = pathNodes.o;
  11339. var _i = pathNodes.i;
  11340. var _v = pathNodes.v;
  11341. var i;
  11342. var shapeString = ' M' + mat.applyToPointStringified(_v[0][0], _v[0][1]);
  11343. for (i = 1; i < length; i += 1) {
  11344. shapeString += ' C' + mat.applyToPointStringified(_o[i - 1][0], _o[i - 1][1]) + ' ' + mat.applyToPointStringified(_i[i][0], _i[i][1]) + ' ' + mat.applyToPointStringified(_v[i][0], _v[i][1]);
  11345. }
  11346. if (closed && length) {
  11347. shapeString += ' C' + mat.applyToPointStringified(_o[i - 1][0], _o[i - 1][1]) + ' ' + mat.applyToPointStringified(_i[0][0], _i[0][1]) + ' ' + mat.applyToPointStringified(_v[0][0], _v[0][1]);
  11348. shapeString += 'z';
  11349. }
  11350. return shapeString;
  11351. };
  11352. var SVGElementsRenderer = function () {
  11353. var _identityMatrix = new Matrix();
  11354. var _matrixHelper = new Matrix();
  11355. var ob = {
  11356. createRenderFunction: createRenderFunction
  11357. };
  11358. function createRenderFunction(data) {
  11359. switch (data.ty) {
  11360. case 'fl':
  11361. return renderFill;
  11362. case 'gf':
  11363. return renderGradient;
  11364. case 'gs':
  11365. return renderGradientStroke;
  11366. case 'st':
  11367. return renderStroke;
  11368. case 'sh':
  11369. case 'el':
  11370. case 'rc':
  11371. case 'sr':
  11372. return renderPath;
  11373. case 'tr':
  11374. return renderContentTransform;
  11375. case 'no':
  11376. return renderNoop;
  11377. default:
  11378. return null;
  11379. }
  11380. }
  11381. function renderContentTransform(styleData, itemData, isFirstFrame) {
  11382. if (isFirstFrame || itemData.transform.op._mdf) {
  11383. itemData.transform.container.setAttribute('opacity', itemData.transform.op.v);
  11384. }
  11385. if (isFirstFrame || itemData.transform.mProps._mdf) {
  11386. itemData.transform.container.setAttribute('transform', itemData.transform.mProps.v.to2dCSS());
  11387. }
  11388. }
  11389. function renderNoop() {}
  11390. function renderPath(styleData, itemData, isFirstFrame) {
  11391. var j;
  11392. var jLen;
  11393. var pathStringTransformed;
  11394. var redraw;
  11395. var pathNodes;
  11396. var l;
  11397. var lLen = itemData.styles.length;
  11398. var lvl = itemData.lvl;
  11399. var paths;
  11400. var mat;
  11401. var iterations;
  11402. var k;
  11403. for (l = 0; l < lLen; l += 1) {
  11404. redraw = itemData.sh._mdf || isFirstFrame;
  11405. if (itemData.styles[l].lvl < lvl) {
  11406. mat = _matrixHelper.reset();
  11407. iterations = lvl - itemData.styles[l].lvl;
  11408. k = itemData.transformers.length - 1;
  11409. while (!redraw && iterations > 0) {
  11410. redraw = itemData.transformers[k].mProps._mdf || redraw;
  11411. iterations -= 1;
  11412. k -= 1;
  11413. }
  11414. if (redraw) {
  11415. iterations = lvl - itemData.styles[l].lvl;
  11416. k = itemData.transformers.length - 1;
  11417. while (iterations > 0) {
  11418. mat.multiply(itemData.transformers[k].mProps.v);
  11419. iterations -= 1;
  11420. k -= 1;
  11421. }
  11422. }
  11423. } else {
  11424. mat = _identityMatrix;
  11425. }
  11426. paths = itemData.sh.paths;
  11427. jLen = paths._length;
  11428. if (redraw) {
  11429. pathStringTransformed = '';
  11430. for (j = 0; j < jLen; j += 1) {
  11431. pathNodes = paths.shapes[j];
  11432. if (pathNodes && pathNodes._length) {
  11433. pathStringTransformed += buildShapeString(pathNodes, pathNodes._length, pathNodes.c, mat);
  11434. }
  11435. }
  11436. itemData.caches[l] = pathStringTransformed;
  11437. } else {
  11438. pathStringTransformed = itemData.caches[l];
  11439. }
  11440. itemData.styles[l].d += styleData.hd === true ? '' : pathStringTransformed;
  11441. itemData.styles[l]._mdf = redraw || itemData.styles[l]._mdf;
  11442. }
  11443. }
  11444. function renderFill(styleData, itemData, isFirstFrame) {
  11445. var styleElem = itemData.style;
  11446. if (itemData.c._mdf || isFirstFrame) {
  11447. styleElem.pElem.setAttribute('fill', 'rgb(' + bmFloor(itemData.c.v[0]) + ',' + bmFloor(itemData.c.v[1]) + ',' + bmFloor(itemData.c.v[2]) + ')');
  11448. }
  11449. if (itemData.o._mdf || isFirstFrame) {
  11450. styleElem.pElem.setAttribute('fill-opacity', itemData.o.v);
  11451. }
  11452. }
  11453. function renderGradientStroke(styleData, itemData, isFirstFrame) {
  11454. renderGradient(styleData, itemData, isFirstFrame);
  11455. renderStroke(styleData, itemData, isFirstFrame);
  11456. }
  11457. function renderGradient(styleData, itemData, isFirstFrame) {
  11458. var gfill = itemData.gf;
  11459. var hasOpacity = itemData.g._hasOpacity;
  11460. var pt1 = itemData.s.v;
  11461. var pt2 = itemData.e.v;
  11462. if (itemData.o._mdf || isFirstFrame) {
  11463. var attr = styleData.ty === 'gf' ? 'fill-opacity' : 'stroke-opacity';
  11464. itemData.style.pElem.setAttribute(attr, itemData.o.v);
  11465. }
  11466. if (itemData.s._mdf || isFirstFrame) {
  11467. var attr1 = styleData.t === 1 ? 'x1' : 'cx';
  11468. var attr2 = attr1 === 'x1' ? 'y1' : 'cy';
  11469. gfill.setAttribute(attr1, pt1[0]);
  11470. gfill.setAttribute(attr2, pt1[1]);
  11471. if (hasOpacity && !itemData.g._collapsable) {
  11472. itemData.of.setAttribute(attr1, pt1[0]);
  11473. itemData.of.setAttribute(attr2, pt1[1]);
  11474. }
  11475. }
  11476. var stops;
  11477. var i;
  11478. var len;
  11479. var stop;
  11480. if (itemData.g._cmdf || isFirstFrame) {
  11481. stops = itemData.cst;
  11482. var cValues = itemData.g.c;
  11483. len = stops.length;
  11484. for (i = 0; i < len; i += 1) {
  11485. stop = stops[i];
  11486. stop.setAttribute('offset', cValues[i * 4] + '%');
  11487. stop.setAttribute('stop-color', 'rgb(' + cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ',' + cValues[i * 4 + 3] + ')');
  11488. }
  11489. }
  11490. if (hasOpacity && (itemData.g._omdf || isFirstFrame)) {
  11491. var oValues = itemData.g.o;
  11492. if (itemData.g._collapsable) {
  11493. stops = itemData.cst;
  11494. } else {
  11495. stops = itemData.ost;
  11496. }
  11497. len = stops.length;
  11498. for (i = 0; i < len; i += 1) {
  11499. stop = stops[i];
  11500. if (!itemData.g._collapsable) {
  11501. stop.setAttribute('offset', oValues[i * 2] + '%');
  11502. }
  11503. stop.setAttribute('stop-opacity', oValues[i * 2 + 1]);
  11504. }
  11505. }
  11506. if (styleData.t === 1) {
  11507. if (itemData.e._mdf || isFirstFrame) {
  11508. gfill.setAttribute('x2', pt2[0]);
  11509. gfill.setAttribute('y2', pt2[1]);
  11510. if (hasOpacity && !itemData.g._collapsable) {
  11511. itemData.of.setAttribute('x2', pt2[0]);
  11512. itemData.of.setAttribute('y2', pt2[1]);
  11513. }
  11514. }
  11515. } else {
  11516. var rad;
  11517. if (itemData.s._mdf || itemData.e._mdf || isFirstFrame) {
  11518. rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
  11519. gfill.setAttribute('r', rad);
  11520. if (hasOpacity && !itemData.g._collapsable) {
  11521. itemData.of.setAttribute('r', rad);
  11522. }
  11523. }
  11524. if (itemData.e._mdf || itemData.h._mdf || itemData.a._mdf || isFirstFrame) {
  11525. if (!rad) {
  11526. rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
  11527. }
  11528. var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);
  11529. var percent = itemData.h.v;
  11530. if (percent >= 1) {
  11531. percent = 0.99;
  11532. } else if (percent <= -1) {
  11533. percent = -0.99;
  11534. }
  11535. var dist = rad * percent;
  11536. var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];
  11537. var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];
  11538. gfill.setAttribute('fx', x);
  11539. gfill.setAttribute('fy', y);
  11540. if (hasOpacity && !itemData.g._collapsable) {
  11541. itemData.of.setAttribute('fx', x);
  11542. itemData.of.setAttribute('fy', y);
  11543. }
  11544. } // gfill.setAttribute('fy','200');
  11545. }
  11546. }
  11547. function renderStroke(styleData, itemData, isFirstFrame) {
  11548. var styleElem = itemData.style;
  11549. var d = itemData.d;
  11550. if (d && (d._mdf || isFirstFrame) && d.dashStr) {
  11551. styleElem.pElem.setAttribute('stroke-dasharray', d.dashStr);
  11552. styleElem.pElem.setAttribute('stroke-dashoffset', d.dashoffset[0]);
  11553. }
  11554. if (itemData.c && (itemData.c._mdf || isFirstFrame)) {
  11555. styleElem.pElem.setAttribute('stroke', 'rgb(' + bmFloor(itemData.c.v[0]) + ',' + bmFloor(itemData.c.v[1]) + ',' + bmFloor(itemData.c.v[2]) + ')');
  11556. }
  11557. if (itemData.o._mdf || isFirstFrame) {
  11558. styleElem.pElem.setAttribute('stroke-opacity', itemData.o.v);
  11559. }
  11560. if (itemData.w._mdf || isFirstFrame) {
  11561. styleElem.pElem.setAttribute('stroke-width', itemData.w.v);
  11562. if (styleElem.msElem) {
  11563. styleElem.msElem.setAttribute('stroke-width', itemData.w.v);
  11564. }
  11565. }
  11566. }
  11567. return ob;
  11568. }();
  11569. function SVGShapeElement(data, globalData, comp) {
  11570. // List of drawable elements
  11571. this.shapes = []; // Full shape data
  11572. this.shapesData = data.shapes; // List of styles that will be applied to shapes
  11573. this.stylesList = []; // List of modifiers that will be applied to shapes
  11574. this.shapeModifiers = []; // List of items in shape tree
  11575. this.itemsData = []; // List of items in previous shape tree
  11576. this.processedElements = []; // List of animated components
  11577. this.animatedContents = [];
  11578. this.initElement(data, globalData, comp); // Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
  11579. // List of elements that have been created
  11580. this.prevViewData = []; // Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
  11581. }
  11582. extendPrototype([BaseElement, TransformElement, SVGBaseElement, IShapeElement, HierarchyElement, FrameElement, RenderableDOMElement], SVGShapeElement);
  11583. SVGShapeElement.prototype.initSecondaryElement = function () {};
  11584. SVGShapeElement.prototype.identityMatrix = new Matrix();
  11585. SVGShapeElement.prototype.buildExpressionInterface = function () {};
  11586. SVGShapeElement.prototype.createContent = function () {
  11587. this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], true);
  11588. this.filterUniqueShapes();
  11589. };
  11590. /*
  11591. This method searches for multiple shapes that affect a single element and one of them is animated
  11592. */
  11593. SVGShapeElement.prototype.filterUniqueShapes = function () {
  11594. var i;
  11595. var len = this.shapes.length;
  11596. var shape;
  11597. var j;
  11598. var jLen = this.stylesList.length;
  11599. var style;
  11600. var tempShapes = [];
  11601. var areAnimated = false;
  11602. for (j = 0; j < jLen; j += 1) {
  11603. style = this.stylesList[j];
  11604. areAnimated = false;
  11605. tempShapes.length = 0;
  11606. for (i = 0; i < len; i += 1) {
  11607. shape = this.shapes[i];
  11608. if (shape.styles.indexOf(style) !== -1) {
  11609. tempShapes.push(shape);
  11610. areAnimated = shape._isAnimated || areAnimated;
  11611. }
  11612. }
  11613. if (tempShapes.length > 1 && areAnimated) {
  11614. this.setShapesAsAnimated(tempShapes);
  11615. }
  11616. }
  11617. };
  11618. SVGShapeElement.prototype.setShapesAsAnimated = function (shapes) {
  11619. var i;
  11620. var len = shapes.length;
  11621. for (i = 0; i < len; i += 1) {
  11622. shapes[i].setAsAnimated();
  11623. }
  11624. };
  11625. SVGShapeElement.prototype.createStyleElement = function (data, level) {
  11626. // TODO: prevent drawing of hidden styles
  11627. var elementData;
  11628. var styleOb = new SVGStyleData(data, level);
  11629. var pathElement = styleOb.pElem;
  11630. if (data.ty === 'st') {
  11631. elementData = new SVGStrokeStyleData(this, data, styleOb);
  11632. } else if (data.ty === 'fl') {
  11633. elementData = new SVGFillStyleData(this, data, styleOb);
  11634. } else if (data.ty === 'gf' || data.ty === 'gs') {
  11635. var GradientConstructor = data.ty === 'gf' ? SVGGradientFillStyleData : SVGGradientStrokeStyleData;
  11636. elementData = new GradientConstructor(this, data, styleOb);
  11637. this.globalData.defs.appendChild(elementData.gf);
  11638. if (elementData.maskId) {
  11639. this.globalData.defs.appendChild(elementData.ms);
  11640. this.globalData.defs.appendChild(elementData.of);
  11641. pathElement.setAttribute('mask', 'url(' + getLocationHref() + '#' + elementData.maskId + ')');
  11642. }
  11643. } else if (data.ty === 'no') {
  11644. elementData = new SVGNoStyleData(this, data, styleOb);
  11645. }
  11646. if (data.ty === 'st' || data.ty === 'gs') {
  11647. pathElement.setAttribute('stroke-linecap', lineCapEnum[data.lc || 2]);
  11648. pathElement.setAttribute('stroke-linejoin', lineJoinEnum[data.lj || 2]);
  11649. pathElement.setAttribute('fill-opacity', '0');
  11650. if (data.lj === 1) {
  11651. pathElement.setAttribute('stroke-miterlimit', data.ml);
  11652. }
  11653. }
  11654. if (data.r === 2) {
  11655. pathElement.setAttribute('fill-rule', 'evenodd');
  11656. }
  11657. if (data.ln) {
  11658. pathElement.setAttribute('id', data.ln);
  11659. }
  11660. if (data.cl) {
  11661. pathElement.setAttribute('class', data.cl);
  11662. }
  11663. if (data.bm) {
  11664. pathElement.style['mix-blend-mode'] = getBlendMode(data.bm);
  11665. }
  11666. this.stylesList.push(styleOb);
  11667. this.addToAnimatedContents(data, elementData);
  11668. return elementData;
  11669. };
  11670. SVGShapeElement.prototype.createGroupElement = function (data) {
  11671. var elementData = new ShapeGroupData();
  11672. if (data.ln) {
  11673. elementData.gr.setAttribute('id', data.ln);
  11674. }
  11675. if (data.cl) {
  11676. elementData.gr.setAttribute('class', data.cl);
  11677. }
  11678. if (data.bm) {
  11679. elementData.gr.style['mix-blend-mode'] = getBlendMode(data.bm);
  11680. }
  11681. return elementData;
  11682. };
  11683. SVGShapeElement.prototype.createTransformElement = function (data, container) {
  11684. var transformProperty = TransformPropertyFactory.getTransformProperty(this, data, this);
  11685. var elementData = new SVGTransformData(transformProperty, transformProperty.o, container);
  11686. this.addToAnimatedContents(data, elementData);
  11687. return elementData;
  11688. };
  11689. SVGShapeElement.prototype.createShapeElement = function (data, ownTransformers, level) {
  11690. var ty = 4;
  11691. if (data.ty === 'rc') {
  11692. ty = 5;
  11693. } else if (data.ty === 'el') {
  11694. ty = 6;
  11695. } else if (data.ty === 'sr') {
  11696. ty = 7;
  11697. }
  11698. var shapeProperty = ShapePropertyFactory.getShapeProp(this, data, ty, this);
  11699. var elementData = new SVGShapeData(ownTransformers, level, shapeProperty);
  11700. this.shapes.push(elementData);
  11701. this.addShapeToModifiers(elementData);
  11702. this.addToAnimatedContents(data, elementData);
  11703. return elementData;
  11704. };
  11705. SVGShapeElement.prototype.addToAnimatedContents = function (data, element) {
  11706. var i = 0;
  11707. var len = this.animatedContents.length;
  11708. while (i < len) {
  11709. if (this.animatedContents[i].element === element) {
  11710. return;
  11711. }
  11712. i += 1;
  11713. }
  11714. this.animatedContents.push({
  11715. fn: SVGElementsRenderer.createRenderFunction(data),
  11716. element: element,
  11717. data: data
  11718. });
  11719. };
  11720. SVGShapeElement.prototype.setElementStyles = function (elementData) {
  11721. var arr = elementData.styles;
  11722. var j;
  11723. var jLen = this.stylesList.length;
  11724. for (j = 0; j < jLen; j += 1) {
  11725. if (!this.stylesList[j].closed) {
  11726. arr.push(this.stylesList[j]);
  11727. }
  11728. }
  11729. };
  11730. SVGShapeElement.prototype.reloadShapes = function () {
  11731. this._isFirstFrame = true;
  11732. var i;
  11733. var len = this.itemsData.length;
  11734. for (i = 0; i < len; i += 1) {
  11735. this.prevViewData[i] = this.itemsData[i];
  11736. }
  11737. this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], true);
  11738. this.filterUniqueShapes();
  11739. len = this.dynamicProperties.length;
  11740. for (i = 0; i < len; i += 1) {
  11741. this.dynamicProperties[i].getValue();
  11742. }
  11743. this.renderModifiers();
  11744. };
  11745. SVGShapeElement.prototype.searchShapes = function (arr, itemsData, prevViewData, container, level, transformers, render) {
  11746. var ownTransformers = [].concat(transformers);
  11747. var i;
  11748. var len = arr.length - 1;
  11749. var j;
  11750. var jLen;
  11751. var ownStyles = [];
  11752. var ownModifiers = [];
  11753. var currentTransform;
  11754. var modifier;
  11755. var processedPos;
  11756. for (i = len; i >= 0; i -= 1) {
  11757. processedPos = this.searchProcessedElement(arr[i]);
  11758. if (!processedPos) {
  11759. arr[i]._render = render;
  11760. } else {
  11761. itemsData[i] = prevViewData[processedPos - 1];
  11762. }
  11763. if (arr[i].ty === 'fl' || arr[i].ty === 'st' || arr[i].ty === 'gf' || arr[i].ty === 'gs' || arr[i].ty === 'no') {
  11764. if (!processedPos) {
  11765. itemsData[i] = this.createStyleElement(arr[i], level);
  11766. } else {
  11767. itemsData[i].style.closed = false;
  11768. }
  11769. if (arr[i]._render) {
  11770. if (itemsData[i].style.pElem.parentNode !== container) {
  11771. container.appendChild(itemsData[i].style.pElem);
  11772. }
  11773. }
  11774. ownStyles.push(itemsData[i].style);
  11775. } else if (arr[i].ty === 'gr') {
  11776. if (!processedPos) {
  11777. itemsData[i] = this.createGroupElement(arr[i]);
  11778. } else {
  11779. jLen = itemsData[i].it.length;
  11780. for (j = 0; j < jLen; j += 1) {
  11781. itemsData[i].prevViewData[j] = itemsData[i].it[j];
  11782. }
  11783. }
  11784. this.searchShapes(arr[i].it, itemsData[i].it, itemsData[i].prevViewData, itemsData[i].gr, level + 1, ownTransformers, render);
  11785. if (arr[i]._render) {
  11786. if (itemsData[i].gr.parentNode !== container) {
  11787. container.appendChild(itemsData[i].gr);
  11788. }
  11789. }
  11790. } else if (arr[i].ty === 'tr') {
  11791. if (!processedPos) {
  11792. itemsData[i] = this.createTransformElement(arr[i], container);
  11793. }
  11794. currentTransform = itemsData[i].transform;
  11795. ownTransformers.push(currentTransform);
  11796. } else if (arr[i].ty === 'sh' || arr[i].ty === 'rc' || arr[i].ty === 'el' || arr[i].ty === 'sr') {
  11797. if (!processedPos) {
  11798. itemsData[i] = this.createShapeElement(arr[i], ownTransformers, level);
  11799. }
  11800. this.setElementStyles(itemsData[i]);
  11801. } else if (arr[i].ty === 'tm' || arr[i].ty === 'rd' || arr[i].ty === 'ms' || arr[i].ty === 'pb' || arr[i].ty === 'zz' || arr[i].ty === 'op') {
  11802. if (!processedPos) {
  11803. modifier = ShapeModifiers.getModifier(arr[i].ty);
  11804. modifier.init(this, arr[i]);
  11805. itemsData[i] = modifier;
  11806. this.shapeModifiers.push(modifier);
  11807. } else {
  11808. modifier = itemsData[i];
  11809. modifier.closed = false;
  11810. }
  11811. ownModifiers.push(modifier);
  11812. } else if (arr[i].ty === 'rp') {
  11813. if (!processedPos) {
  11814. modifier = ShapeModifiers.getModifier(arr[i].ty);
  11815. itemsData[i] = modifier;
  11816. modifier.init(this, arr, i, itemsData);
  11817. this.shapeModifiers.push(modifier);
  11818. render = false;
  11819. } else {
  11820. modifier = itemsData[i];
  11821. modifier.closed = true;
  11822. }
  11823. ownModifiers.push(modifier);
  11824. }
  11825. this.addProcessedElement(arr[i], i + 1);
  11826. }
  11827. len = ownStyles.length;
  11828. for (i = 0; i < len; i += 1) {
  11829. ownStyles[i].closed = true;
  11830. }
  11831. len = ownModifiers.length;
  11832. for (i = 0; i < len; i += 1) {
  11833. ownModifiers[i].closed = true;
  11834. }
  11835. };
  11836. SVGShapeElement.prototype.renderInnerContent = function () {
  11837. this.renderModifiers();
  11838. var i;
  11839. var len = this.stylesList.length;
  11840. for (i = 0; i < len; i += 1) {
  11841. this.stylesList[i].reset();
  11842. }
  11843. this.renderShape();
  11844. for (i = 0; i < len; i += 1) {
  11845. if (this.stylesList[i]._mdf || this._isFirstFrame) {
  11846. if (this.stylesList[i].msElem) {
  11847. this.stylesList[i].msElem.setAttribute('d', this.stylesList[i].d); // Adding M0 0 fixes same mask bug on all browsers
  11848. this.stylesList[i].d = 'M0 0' + this.stylesList[i].d;
  11849. }
  11850. this.stylesList[i].pElem.setAttribute('d', this.stylesList[i].d || 'M0 0');
  11851. }
  11852. }
  11853. };
  11854. SVGShapeElement.prototype.renderShape = function () {
  11855. var i;
  11856. var len = this.animatedContents.length;
  11857. var animatedContent;
  11858. for (i = 0; i < len; i += 1) {
  11859. animatedContent = this.animatedContents[i];
  11860. if ((this._isFirstFrame || animatedContent.element._isAnimated) && animatedContent.data !== true) {
  11861. animatedContent.fn(animatedContent.data, animatedContent.element, this._isFirstFrame);
  11862. }
  11863. }
  11864. };
  11865. SVGShapeElement.prototype.destroy = function () {
  11866. this.destroyBaseElement();
  11867. this.shapesData = null;
  11868. this.itemsData = null;
  11869. };
  11870. function LetterProps(o, sw, sc, fc, m, p) {
  11871. this.o = o;
  11872. this.sw = sw;
  11873. this.sc = sc;
  11874. this.fc = fc;
  11875. this.m = m;
  11876. this.p = p;
  11877. this._mdf = {
  11878. o: true,
  11879. sw: !!sw,
  11880. sc: !!sc,
  11881. fc: !!fc,
  11882. m: true,
  11883. p: true
  11884. };
  11885. }
  11886. LetterProps.prototype.update = function (o, sw, sc, fc, m, p) {
  11887. this._mdf.o = false;
  11888. this._mdf.sw = false;
  11889. this._mdf.sc = false;
  11890. this._mdf.fc = false;
  11891. this._mdf.m = false;
  11892. this._mdf.p = false;
  11893. var updated = false;
  11894. if (this.o !== o) {
  11895. this.o = o;
  11896. this._mdf.o = true;
  11897. updated = true;
  11898. }
  11899. if (this.sw !== sw) {
  11900. this.sw = sw;
  11901. this._mdf.sw = true;
  11902. updated = true;
  11903. }
  11904. if (this.sc !== sc) {
  11905. this.sc = sc;
  11906. this._mdf.sc = true;
  11907. updated = true;
  11908. }
  11909. if (this.fc !== fc) {
  11910. this.fc = fc;
  11911. this._mdf.fc = true;
  11912. updated = true;
  11913. }
  11914. if (this.m !== m) {
  11915. this.m = m;
  11916. this._mdf.m = true;
  11917. updated = true;
  11918. }
  11919. if (p.length && (this.p[0] !== p[0] || this.p[1] !== p[1] || this.p[4] !== p[4] || this.p[5] !== p[5] || this.p[12] !== p[12] || this.p[13] !== p[13])) {
  11920. this.p = p;
  11921. this._mdf.p = true;
  11922. updated = true;
  11923. }
  11924. return updated;
  11925. };
  11926. function TextProperty(elem, data) {
  11927. this._frameId = initialDefaultFrame;
  11928. this.pv = '';
  11929. this.v = '';
  11930. this.kf = false;
  11931. this._isFirstFrame = true;
  11932. this._mdf = false;
  11933. if (data.d && data.d.sid) {
  11934. data.d = elem.globalData.slotManager.getProp(data.d);
  11935. }
  11936. this.data = data;
  11937. this.elem = elem;
  11938. this.comp = this.elem.comp;
  11939. this.keysIndex = 0;
  11940. this.canResize = false;
  11941. this.minimumFontSize = 1;
  11942. this.effectsSequence = [];
  11943. this.currentData = {
  11944. ascent: 0,
  11945. boxWidth: this.defaultBoxWidth,
  11946. f: '',
  11947. fStyle: '',
  11948. fWeight: '',
  11949. fc: '',
  11950. j: '',
  11951. justifyOffset: '',
  11952. l: [],
  11953. lh: 0,
  11954. lineWidths: [],
  11955. ls: '',
  11956. of: '',
  11957. s: '',
  11958. sc: '',
  11959. sw: 0,
  11960. t: 0,
  11961. tr: 0,
  11962. sz: 0,
  11963. ps: null,
  11964. fillColorAnim: false,
  11965. strokeColorAnim: false,
  11966. strokeWidthAnim: false,
  11967. yOffset: 0,
  11968. finalSize: 0,
  11969. finalText: [],
  11970. finalLineHeight: 0,
  11971. __complete: false
  11972. };
  11973. this.copyData(this.currentData, this.data.d.k[0].s);
  11974. if (!this.searchProperty()) {
  11975. this.completeTextData(this.currentData);
  11976. }
  11977. }
  11978. TextProperty.prototype.defaultBoxWidth = [0, 0];
  11979. TextProperty.prototype.copyData = function (obj, data) {
  11980. for (var s in data) {
  11981. if (Object.prototype.hasOwnProperty.call(data, s)) {
  11982. obj[s] = data[s];
  11983. }
  11984. }
  11985. return obj;
  11986. };
  11987. TextProperty.prototype.setCurrentData = function (data) {
  11988. if (!data.__complete) {
  11989. this.completeTextData(data);
  11990. }
  11991. this.currentData = data;
  11992. this.currentData.boxWidth = this.currentData.boxWidth || this.defaultBoxWidth;
  11993. this._mdf = true;
  11994. };
  11995. TextProperty.prototype.searchProperty = function () {
  11996. return this.searchKeyframes();
  11997. };
  11998. TextProperty.prototype.searchKeyframes = function () {
  11999. this.kf = this.data.d.k.length > 1;
  12000. if (this.kf) {
  12001. this.addEffect(this.getKeyframeValue.bind(this));
  12002. }
  12003. return this.kf;
  12004. };
  12005. TextProperty.prototype.addEffect = function (effectFunction) {
  12006. this.effectsSequence.push(effectFunction);
  12007. this.elem.addDynamicProperty(this);
  12008. };
  12009. TextProperty.prototype.getValue = function (_finalValue) {
  12010. if ((this.elem.globalData.frameId === this.frameId || !this.effectsSequence.length) && !_finalValue) {
  12011. return;
  12012. }
  12013. this.currentData.t = this.data.d.k[this.keysIndex].s.t;
  12014. var currentValue = this.currentData;
  12015. var currentIndex = this.keysIndex;
  12016. if (this.lock) {
  12017. this.setCurrentData(this.currentData);
  12018. return;
  12019. }
  12020. this.lock = true;
  12021. this._mdf = false;
  12022. var i;
  12023. var len = this.effectsSequence.length;
  12024. var finalValue = _finalValue || this.data.d.k[this.keysIndex].s;
  12025. for (i = 0; i < len; i += 1) {
  12026. // Checking if index changed to prevent creating a new object every time the expression updates.
  12027. if (currentIndex !== this.keysIndex) {
  12028. finalValue = this.effectsSequence[i](finalValue, finalValue.t);
  12029. } else {
  12030. finalValue = this.effectsSequence[i](this.currentData, finalValue.t);
  12031. }
  12032. }
  12033. if (currentValue !== finalValue) {
  12034. this.setCurrentData(finalValue);
  12035. }
  12036. this.v = this.currentData;
  12037. this.pv = this.v;
  12038. this.lock = false;
  12039. this.frameId = this.elem.globalData.frameId;
  12040. };
  12041. TextProperty.prototype.getKeyframeValue = function () {
  12042. var textKeys = this.data.d.k;
  12043. var frameNum = this.elem.comp.renderedFrame;
  12044. var i = 0;
  12045. var len = textKeys.length;
  12046. while (i <= len - 1) {
  12047. if (i === len - 1 || textKeys[i + 1].t > frameNum) {
  12048. break;
  12049. }
  12050. i += 1;
  12051. }
  12052. if (this.keysIndex !== i) {
  12053. this.keysIndex = i;
  12054. }
  12055. return this.data.d.k[this.keysIndex].s;
  12056. };
  12057. TextProperty.prototype.buildFinalText = function (text) {
  12058. var charactersArray = [];
  12059. var i = 0;
  12060. var len = text.length;
  12061. var charCode;
  12062. var secondCharCode;
  12063. var shouldCombine = false;
  12064. var shouldCombineNext = false;
  12065. var currentChars = '';
  12066. while (i < len) {
  12067. shouldCombine = shouldCombineNext;
  12068. shouldCombineNext = false;
  12069. charCode = text.charCodeAt(i);
  12070. currentChars = text.charAt(i);
  12071. if (FontManager.isCombinedCharacter(charCode)) {
  12072. shouldCombine = true; // It's a potential surrogate pair (this is the High surrogate)
  12073. } else if (charCode >= 0xD800 && charCode <= 0xDBFF) {
  12074. if (FontManager.isRegionalFlag(text, i)) {
  12075. currentChars = text.substr(i, 14);
  12076. } else {
  12077. secondCharCode = text.charCodeAt(i + 1); // It's a surrogate pair (this is the Low surrogate)
  12078. if (secondCharCode >= 0xDC00 && secondCharCode <= 0xDFFF) {
  12079. if (FontManager.isModifier(charCode, secondCharCode)) {
  12080. currentChars = text.substr(i, 2);
  12081. shouldCombine = true;
  12082. } else if (FontManager.isFlagEmoji(text.substr(i, 4))) {
  12083. currentChars = text.substr(i, 4);
  12084. } else {
  12085. currentChars = text.substr(i, 2);
  12086. }
  12087. }
  12088. }
  12089. } else if (charCode > 0xDBFF) {
  12090. secondCharCode = text.charCodeAt(i + 1);
  12091. if (FontManager.isVariationSelector(charCode)) {
  12092. shouldCombine = true;
  12093. }
  12094. } else if (FontManager.isZeroWidthJoiner(charCode)) {
  12095. shouldCombine = true;
  12096. shouldCombineNext = true;
  12097. }
  12098. if (shouldCombine) {
  12099. charactersArray[charactersArray.length - 1] += currentChars;
  12100. shouldCombine = false;
  12101. } else {
  12102. charactersArray.push(currentChars);
  12103. }
  12104. i += currentChars.length;
  12105. }
  12106. return charactersArray;
  12107. };
  12108. TextProperty.prototype.completeTextData = function (documentData) {
  12109. documentData.__complete = true;
  12110. var fontManager = this.elem.globalData.fontManager;
  12111. var data = this.data;
  12112. var letters = [];
  12113. var i;
  12114. var len;
  12115. var newLineFlag;
  12116. var index = 0;
  12117. var val;
  12118. var anchorGrouping = data.m.g;
  12119. var currentSize = 0;
  12120. var currentPos = 0;
  12121. var currentLine = 0;
  12122. var lineWidths = [];
  12123. var lineWidth = 0;
  12124. var maxLineWidth = 0;
  12125. var j;
  12126. var jLen;
  12127. var fontData = fontManager.getFontByName(documentData.f);
  12128. var charData;
  12129. var cLength = 0;
  12130. var fontProps = getFontProperties(fontData);
  12131. documentData.fWeight = fontProps.weight;
  12132. documentData.fStyle = fontProps.style;
  12133. documentData.finalSize = documentData.s;
  12134. documentData.finalText = this.buildFinalText(documentData.t);
  12135. len = documentData.finalText.length;
  12136. documentData.finalLineHeight = documentData.lh;
  12137. var trackingOffset = documentData.tr / 1000 * documentData.finalSize;
  12138. var charCode;
  12139. if (documentData.sz) {
  12140. var flag = true;
  12141. var boxWidth = documentData.sz[0];
  12142. var boxHeight = documentData.sz[1];
  12143. var currentHeight;
  12144. var finalText;
  12145. while (flag) {
  12146. finalText = this.buildFinalText(documentData.t);
  12147. currentHeight = 0;
  12148. lineWidth = 0;
  12149. len = finalText.length;
  12150. trackingOffset = documentData.tr / 1000 * documentData.finalSize;
  12151. var lastSpaceIndex = -1;
  12152. for (i = 0; i < len; i += 1) {
  12153. charCode = finalText[i].charCodeAt(0);
  12154. newLineFlag = false;
  12155. if (finalText[i] === ' ') {
  12156. lastSpaceIndex = i;
  12157. } else if (charCode === 13 || charCode === 3) {
  12158. lineWidth = 0;
  12159. newLineFlag = true;
  12160. currentHeight += documentData.finalLineHeight || documentData.finalSize * 1.2;
  12161. }
  12162. if (fontManager.chars) {
  12163. charData = fontManager.getCharData(finalText[i], fontData.fStyle, fontData.fFamily);
  12164. cLength = newLineFlag ? 0 : charData.w * documentData.finalSize / 100;
  12165. } else {
  12166. // tCanvasHelper.font = documentData.s + 'px '+ fontData.fFamily;
  12167. cLength = fontManager.measureText(finalText[i], documentData.f, documentData.finalSize);
  12168. }
  12169. if (lineWidth + cLength > boxWidth && finalText[i] !== ' ') {
  12170. if (lastSpaceIndex === -1) {
  12171. len += 1;
  12172. } else {
  12173. i = lastSpaceIndex;
  12174. }
  12175. currentHeight += documentData.finalLineHeight || documentData.finalSize * 1.2;
  12176. finalText.splice(i, lastSpaceIndex === i ? 1 : 0, '\r'); // finalText = finalText.substr(0,i) + "\r" + finalText.substr(i === lastSpaceIndex ? i + 1 : i);
  12177. lastSpaceIndex = -1;
  12178. lineWidth = 0;
  12179. } else {
  12180. lineWidth += cLength;
  12181. lineWidth += trackingOffset;
  12182. }
  12183. }
  12184. currentHeight += fontData.ascent * documentData.finalSize / 100;
  12185. if (this.canResize && documentData.finalSize > this.minimumFontSize && boxHeight < currentHeight) {
  12186. documentData.finalSize -= 1;
  12187. documentData.finalLineHeight = documentData.finalSize * documentData.lh / documentData.s;
  12188. } else {
  12189. documentData.finalText = finalText;
  12190. len = documentData.finalText.length;
  12191. flag = false;
  12192. }
  12193. }
  12194. }
  12195. lineWidth = -trackingOffset;
  12196. cLength = 0;
  12197. var uncollapsedSpaces = 0;
  12198. var currentChar;
  12199. for (i = 0; i < len; i += 1) {
  12200. newLineFlag = false;
  12201. currentChar = documentData.finalText[i];
  12202. charCode = currentChar.charCodeAt(0);
  12203. if (charCode === 13 || charCode === 3) {
  12204. uncollapsedSpaces = 0;
  12205. lineWidths.push(lineWidth);
  12206. maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
  12207. lineWidth = -2 * trackingOffset;
  12208. val = '';
  12209. newLineFlag = true;
  12210. currentLine += 1;
  12211. } else {
  12212. val = currentChar;
  12213. }
  12214. if (fontManager.chars) {
  12215. charData = fontManager.getCharData(currentChar, fontData.fStyle, fontManager.getFontByName(documentData.f).fFamily);
  12216. cLength = newLineFlag ? 0 : charData.w * documentData.finalSize / 100;
  12217. } else {
  12218. // var charWidth = fontManager.measureText(val, documentData.f, documentData.finalSize);
  12219. // tCanvasHelper.font = documentData.finalSize + 'px '+ fontManager.getFontByName(documentData.f).fFamily;
  12220. cLength = fontManager.measureText(val, documentData.f, documentData.finalSize);
  12221. } //
  12222. if (currentChar === ' ') {
  12223. uncollapsedSpaces += cLength + trackingOffset;
  12224. } else {
  12225. lineWidth += cLength + trackingOffset + uncollapsedSpaces;
  12226. uncollapsedSpaces = 0;
  12227. }
  12228. letters.push({
  12229. l: cLength,
  12230. an: cLength,
  12231. add: currentSize,
  12232. n: newLineFlag,
  12233. anIndexes: [],
  12234. val: val,
  12235. line: currentLine,
  12236. animatorJustifyOffset: 0
  12237. });
  12238. if (anchorGrouping == 2) {
  12239. // eslint-disable-line eqeqeq
  12240. currentSize += cLength;
  12241. if (val === '' || val === ' ' || i === len - 1) {
  12242. if (val === '' || val === ' ') {
  12243. currentSize -= cLength;
  12244. }
  12245. while (currentPos <= i) {
  12246. letters[currentPos].an = currentSize;
  12247. letters[currentPos].ind = index;
  12248. letters[currentPos].extra = cLength;
  12249. currentPos += 1;
  12250. }
  12251. index += 1;
  12252. currentSize = 0;
  12253. }
  12254. } else if (anchorGrouping == 3) {
  12255. // eslint-disable-line eqeqeq
  12256. currentSize += cLength;
  12257. if (val === '' || i === len - 1) {
  12258. if (val === '') {
  12259. currentSize -= cLength;
  12260. }
  12261. while (currentPos <= i) {
  12262. letters[currentPos].an = currentSize;
  12263. letters[currentPos].ind = index;
  12264. letters[currentPos].extra = cLength;
  12265. currentPos += 1;
  12266. }
  12267. currentSize = 0;
  12268. index += 1;
  12269. }
  12270. } else {
  12271. letters[index].ind = index;
  12272. letters[index].extra = 0;
  12273. index += 1;
  12274. }
  12275. }
  12276. documentData.l = letters;
  12277. maxLineWidth = lineWidth > maxLineWidth ? lineWidth : maxLineWidth;
  12278. lineWidths.push(lineWidth);
  12279. if (documentData.sz) {
  12280. documentData.boxWidth = documentData.sz[0];
  12281. documentData.justifyOffset = 0;
  12282. } else {
  12283. documentData.boxWidth = maxLineWidth;
  12284. switch (documentData.j) {
  12285. case 1:
  12286. documentData.justifyOffset = -documentData.boxWidth;
  12287. break;
  12288. case 2:
  12289. documentData.justifyOffset = -documentData.boxWidth / 2;
  12290. break;
  12291. default:
  12292. documentData.justifyOffset = 0;
  12293. }
  12294. }
  12295. documentData.lineWidths = lineWidths;
  12296. var animators = data.a;
  12297. var animatorData;
  12298. var letterData;
  12299. jLen = animators.length;
  12300. var based;
  12301. var ind;
  12302. var indexes = [];
  12303. for (j = 0; j < jLen; j += 1) {
  12304. animatorData = animators[j];
  12305. if (animatorData.a.sc) {
  12306. documentData.strokeColorAnim = true;
  12307. }
  12308. if (animatorData.a.sw) {
  12309. documentData.strokeWidthAnim = true;
  12310. }
  12311. if (animatorData.a.fc || animatorData.a.fh || animatorData.a.fs || animatorData.a.fb) {
  12312. documentData.fillColorAnim = true;
  12313. }
  12314. ind = 0;
  12315. based = animatorData.s.b;
  12316. for (i = 0; i < len; i += 1) {
  12317. letterData = letters[i];
  12318. letterData.anIndexes[j] = ind;
  12319. if (based == 1 && letterData.val !== '' || based == 2 && letterData.val !== '' && letterData.val !== ' ' || based == 3 && (letterData.n || letterData.val == ' ' || i == len - 1) || based == 4 && (letterData.n || i == len - 1)) {
  12320. // eslint-disable-line eqeqeq
  12321. if (animatorData.s.rn === 1) {
  12322. indexes.push(ind);
  12323. }
  12324. ind += 1;
  12325. }
  12326. }
  12327. data.a[j].s.totalChars = ind;
  12328. var currentInd = -1;
  12329. var newInd;
  12330. if (animatorData.s.rn === 1) {
  12331. for (i = 0; i < len; i += 1) {
  12332. letterData = letters[i];
  12333. if (currentInd != letterData.anIndexes[j]) {
  12334. // eslint-disable-line eqeqeq
  12335. currentInd = letterData.anIndexes[j];
  12336. newInd = indexes.splice(Math.floor(Math.random() * indexes.length), 1)[0];
  12337. }
  12338. letterData.anIndexes[j] = newInd;
  12339. }
  12340. }
  12341. }
  12342. documentData.yOffset = documentData.finalLineHeight || documentData.finalSize * 1.2;
  12343. documentData.ls = documentData.ls || 0;
  12344. documentData.ascent = fontData.ascent * documentData.finalSize / 100;
  12345. };
  12346. TextProperty.prototype.updateDocumentData = function (newData, index) {
  12347. index = index === undefined ? this.keysIndex : index;
  12348. var dData = this.copyData({}, this.data.d.k[index].s);
  12349. dData = this.copyData(dData, newData);
  12350. this.data.d.k[index].s = dData;
  12351. this.recalculate(index);
  12352. this.setCurrentData(dData);
  12353. this.elem.addDynamicProperty(this);
  12354. };
  12355. TextProperty.prototype.recalculate = function (index) {
  12356. var dData = this.data.d.k[index].s;
  12357. dData.__complete = false;
  12358. this.keysIndex = 0;
  12359. this._isFirstFrame = true;
  12360. this.getValue(dData);
  12361. };
  12362. TextProperty.prototype.canResizeFont = function (_canResize) {
  12363. this.canResize = _canResize;
  12364. this.recalculate(this.keysIndex);
  12365. this.elem.addDynamicProperty(this);
  12366. };
  12367. TextProperty.prototype.setMinimumFontSize = function (_fontValue) {
  12368. this.minimumFontSize = Math.floor(_fontValue) || 1;
  12369. this.recalculate(this.keysIndex);
  12370. this.elem.addDynamicProperty(this);
  12371. };
  12372. var TextSelectorProp = function () {
  12373. var max = Math.max;
  12374. var min = Math.min;
  12375. var floor = Math.floor;
  12376. function TextSelectorPropFactory(elem, data) {
  12377. this._currentTextLength = -1;
  12378. this.k = false;
  12379. this.data = data;
  12380. this.elem = elem;
  12381. this.comp = elem.comp;
  12382. this.finalS = 0;
  12383. this.finalE = 0;
  12384. this.initDynamicPropertyContainer(elem);
  12385. this.s = PropertyFactory.getProp(elem, data.s || {
  12386. k: 0
  12387. }, 0, 0, this);
  12388. if ('e' in data) {
  12389. this.e = PropertyFactory.getProp(elem, data.e, 0, 0, this);
  12390. } else {
  12391. this.e = {
  12392. v: 100
  12393. };
  12394. }
  12395. this.o = PropertyFactory.getProp(elem, data.o || {
  12396. k: 0
  12397. }, 0, 0, this);
  12398. this.xe = PropertyFactory.getProp(elem, data.xe || {
  12399. k: 0
  12400. }, 0, 0, this);
  12401. this.ne = PropertyFactory.getProp(elem, data.ne || {
  12402. k: 0
  12403. }, 0, 0, this);
  12404. this.sm = PropertyFactory.getProp(elem, data.sm || {
  12405. k: 100
  12406. }, 0, 0, this);
  12407. this.a = PropertyFactory.getProp(elem, data.a, 0, 0.01, this);
  12408. if (!this.dynamicProperties.length) {
  12409. this.getValue();
  12410. }
  12411. }
  12412. TextSelectorPropFactory.prototype = {
  12413. getMult: function getMult(ind) {
  12414. if (this._currentTextLength !== this.elem.textProperty.currentData.l.length) {
  12415. this.getValue();
  12416. }
  12417. var x1 = 0;
  12418. var y1 = 0;
  12419. var x2 = 1;
  12420. var y2 = 1;
  12421. if (this.ne.v > 0) {
  12422. x1 = this.ne.v / 100.0;
  12423. } else {
  12424. y1 = -this.ne.v / 100.0;
  12425. }
  12426. if (this.xe.v > 0) {
  12427. x2 = 1.0 - this.xe.v / 100.0;
  12428. } else {
  12429. y2 = 1.0 + this.xe.v / 100.0;
  12430. }
  12431. var easer = BezierFactory.getBezierEasing(x1, y1, x2, y2).get;
  12432. var mult = 0;
  12433. var s = this.finalS;
  12434. var e = this.finalE;
  12435. var type = this.data.sh;
  12436. if (type === 2) {
  12437. if (e === s) {
  12438. mult = ind >= e ? 1 : 0;
  12439. } else {
  12440. mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
  12441. }
  12442. mult = easer(mult);
  12443. } else if (type === 3) {
  12444. if (e === s) {
  12445. mult = ind >= e ? 0 : 1;
  12446. } else {
  12447. mult = 1 - max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
  12448. }
  12449. mult = easer(mult);
  12450. } else if (type === 4) {
  12451. if (e === s) {
  12452. mult = 0;
  12453. } else {
  12454. mult = max(0, min(0.5 / (e - s) + (ind - s) / (e - s), 1));
  12455. if (mult < 0.5) {
  12456. mult *= 2;
  12457. } else {
  12458. mult = 1 - 2 * (mult - 0.5);
  12459. }
  12460. }
  12461. mult = easer(mult);
  12462. } else if (type === 5) {
  12463. if (e === s) {
  12464. mult = 0;
  12465. } else {
  12466. var tot = e - s;
  12467. /* ind += 0.5;
  12468. mult = -4/(tot*tot)*(ind*ind)+(4/tot)*ind; */
  12469. ind = min(max(0, ind + 0.5 - s), e - s);
  12470. var x = -tot / 2 + ind;
  12471. var a = tot / 2;
  12472. mult = Math.sqrt(1 - x * x / (a * a));
  12473. }
  12474. mult = easer(mult);
  12475. } else if (type === 6) {
  12476. if (e === s) {
  12477. mult = 0;
  12478. } else {
  12479. ind = min(max(0, ind + 0.5 - s), e - s);
  12480. mult = (1 + Math.cos(Math.PI + Math.PI * 2 * ind / (e - s))) / 2; // eslint-disable-line
  12481. }
  12482. mult = easer(mult);
  12483. } else {
  12484. if (ind >= floor(s)) {
  12485. if (ind - s < 0) {
  12486. mult = max(0, min(min(e, 1) - (s - ind), 1));
  12487. } else {
  12488. mult = max(0, min(e - ind, 1));
  12489. }
  12490. }
  12491. mult = easer(mult);
  12492. } // Smoothness implementation.
  12493. // The smoothness represents a reduced range of the original [0; 1] range.
  12494. // if smoothness is 25%, the new range will be [0.375; 0.625]
  12495. // Steps are:
  12496. // - find the lower value of the new range (threshold)
  12497. // - if multiplier is smaller than that value, floor it to 0
  12498. // - if it is larger,
  12499. // - subtract the threshold
  12500. // - divide it by the smoothness (this will return the range to [0; 1])
  12501. // Note: If it doesn't work on some scenarios, consider applying it before the easer.
  12502. if (this.sm.v !== 100) {
  12503. var smoothness = this.sm.v * 0.01;
  12504. if (smoothness === 0) {
  12505. smoothness = 0.00000001;
  12506. }
  12507. var threshold = 0.5 - smoothness * 0.5;
  12508. if (mult < threshold) {
  12509. mult = 0;
  12510. } else {
  12511. mult = (mult - threshold) / smoothness;
  12512. if (mult > 1) {
  12513. mult = 1;
  12514. }
  12515. }
  12516. }
  12517. return mult * this.a.v;
  12518. },
  12519. getValue: function getValue(newCharsFlag) {
  12520. this.iterateDynamicProperties();
  12521. this._mdf = newCharsFlag || this._mdf;
  12522. this._currentTextLength = this.elem.textProperty.currentData.l.length || 0;
  12523. if (newCharsFlag && this.data.r === 2) {
  12524. this.e.v = this._currentTextLength;
  12525. }
  12526. var divisor = this.data.r === 2 ? 1 : 100 / this.data.totalChars;
  12527. var o = this.o.v / divisor;
  12528. var s = this.s.v / divisor + o;
  12529. var e = this.e.v / divisor + o;
  12530. if (s > e) {
  12531. var _s = s;
  12532. s = e;
  12533. e = _s;
  12534. }
  12535. this.finalS = s;
  12536. this.finalE = e;
  12537. }
  12538. };
  12539. extendPrototype([DynamicPropertyContainer], TextSelectorPropFactory);
  12540. function getTextSelectorProp(elem, data, arr) {
  12541. return new TextSelectorPropFactory(elem, data, arr);
  12542. }
  12543. return {
  12544. getTextSelectorProp: getTextSelectorProp
  12545. };
  12546. }();
  12547. function TextAnimatorDataProperty(elem, animatorProps, container) {
  12548. var defaultData = {
  12549. propType: false
  12550. };
  12551. var getProp = PropertyFactory.getProp;
  12552. var textAnimatorAnimatables = animatorProps.a;
  12553. this.a = {
  12554. r: textAnimatorAnimatables.r ? getProp(elem, textAnimatorAnimatables.r, 0, degToRads, container) : defaultData,
  12555. rx: textAnimatorAnimatables.rx ? getProp(elem, textAnimatorAnimatables.rx, 0, degToRads, container) : defaultData,
  12556. ry: textAnimatorAnimatables.ry ? getProp(elem, textAnimatorAnimatables.ry, 0, degToRads, container) : defaultData,
  12557. sk: textAnimatorAnimatables.sk ? getProp(elem, textAnimatorAnimatables.sk, 0, degToRads, container) : defaultData,
  12558. sa: textAnimatorAnimatables.sa ? getProp(elem, textAnimatorAnimatables.sa, 0, degToRads, container) : defaultData,
  12559. s: textAnimatorAnimatables.s ? getProp(elem, textAnimatorAnimatables.s, 1, 0.01, container) : defaultData,
  12560. a: textAnimatorAnimatables.a ? getProp(elem, textAnimatorAnimatables.a, 1, 0, container) : defaultData,
  12561. o: textAnimatorAnimatables.o ? getProp(elem, textAnimatorAnimatables.o, 0, 0.01, container) : defaultData,
  12562. p: textAnimatorAnimatables.p ? getProp(elem, textAnimatorAnimatables.p, 1, 0, container) : defaultData,
  12563. sw: textAnimatorAnimatables.sw ? getProp(elem, textAnimatorAnimatables.sw, 0, 0, container) : defaultData,
  12564. sc: textAnimatorAnimatables.sc ? getProp(elem, textAnimatorAnimatables.sc, 1, 0, container) : defaultData,
  12565. fc: textAnimatorAnimatables.fc ? getProp(elem, textAnimatorAnimatables.fc, 1, 0, container) : defaultData,
  12566. fh: textAnimatorAnimatables.fh ? getProp(elem, textAnimatorAnimatables.fh, 0, 0, container) : defaultData,
  12567. fs: textAnimatorAnimatables.fs ? getProp(elem, textAnimatorAnimatables.fs, 0, 0.01, container) : defaultData,
  12568. fb: textAnimatorAnimatables.fb ? getProp(elem, textAnimatorAnimatables.fb, 0, 0.01, container) : defaultData,
  12569. t: textAnimatorAnimatables.t ? getProp(elem, textAnimatorAnimatables.t, 0, 0, container) : defaultData
  12570. };
  12571. this.s = TextSelectorProp.getTextSelectorProp(elem, animatorProps.s, container);
  12572. this.s.t = animatorProps.s.t;
  12573. }
  12574. function TextAnimatorProperty(textData, renderType, elem) {
  12575. this._isFirstFrame = true;
  12576. this._hasMaskedPath = false;
  12577. this._frameId = -1;
  12578. this._textData = textData;
  12579. this._renderType = renderType;
  12580. this._elem = elem;
  12581. this._animatorsData = createSizedArray(this._textData.a.length);
  12582. this._pathData = {};
  12583. this._moreOptions = {
  12584. alignment: {}
  12585. };
  12586. this.renderedLetters = [];
  12587. this.lettersChangedFlag = false;
  12588. this.initDynamicPropertyContainer(elem);
  12589. }
  12590. TextAnimatorProperty.prototype.searchProperties = function () {
  12591. var i;
  12592. var len = this._textData.a.length;
  12593. var animatorProps;
  12594. var getProp = PropertyFactory.getProp;
  12595. for (i = 0; i < len; i += 1) {
  12596. animatorProps = this._textData.a[i];
  12597. this._animatorsData[i] = new TextAnimatorDataProperty(this._elem, animatorProps, this);
  12598. }
  12599. if (this._textData.p && 'm' in this._textData.p) {
  12600. this._pathData = {
  12601. a: getProp(this._elem, this._textData.p.a, 0, 0, this),
  12602. f: getProp(this._elem, this._textData.p.f, 0, 0, this),
  12603. l: getProp(this._elem, this._textData.p.l, 0, 0, this),
  12604. r: getProp(this._elem, this._textData.p.r, 0, 0, this),
  12605. p: getProp(this._elem, this._textData.p.p, 0, 0, this),
  12606. m: this._elem.maskManager.getMaskProperty(this._textData.p.m)
  12607. };
  12608. this._hasMaskedPath = true;
  12609. } else {
  12610. this._hasMaskedPath = false;
  12611. }
  12612. this._moreOptions.alignment = getProp(this._elem, this._textData.m.a, 1, 0, this);
  12613. };
  12614. TextAnimatorProperty.prototype.getMeasures = function (documentData, lettersChangedFlag) {
  12615. this.lettersChangedFlag = lettersChangedFlag;
  12616. if (!this._mdf && !this._isFirstFrame && !lettersChangedFlag && (!this._hasMaskedPath || !this._pathData.m._mdf)) {
  12617. return;
  12618. }
  12619. this._isFirstFrame = false;
  12620. var alignment = this._moreOptions.alignment.v;
  12621. var animators = this._animatorsData;
  12622. var textData = this._textData;
  12623. var matrixHelper = this.mHelper;
  12624. var renderType = this._renderType;
  12625. var renderedLettersCount = this.renderedLetters.length;
  12626. var xPos;
  12627. var yPos;
  12628. var i;
  12629. var len;
  12630. var letters = documentData.l;
  12631. var pathInfo;
  12632. var currentLength;
  12633. var currentPoint;
  12634. var segmentLength;
  12635. var flag;
  12636. var pointInd;
  12637. var segmentInd;
  12638. var prevPoint;
  12639. var points;
  12640. var segments;
  12641. var partialLength;
  12642. var totalLength;
  12643. var perc;
  12644. var tanAngle;
  12645. var mask;
  12646. if (this._hasMaskedPath) {
  12647. mask = this._pathData.m;
  12648. if (!this._pathData.n || this._pathData._mdf) {
  12649. var paths = mask.v;
  12650. if (this._pathData.r.v) {
  12651. paths = paths.reverse();
  12652. } // TODO: release bezier data cached from previous pathInfo: this._pathData.pi
  12653. pathInfo = {
  12654. tLength: 0,
  12655. segments: []
  12656. };
  12657. len = paths._length - 1;
  12658. var bezierData;
  12659. totalLength = 0;
  12660. for (i = 0; i < len; i += 1) {
  12661. bezierData = bez.buildBezierData(paths.v[i], paths.v[i + 1], [paths.o[i][0] - paths.v[i][0], paths.o[i][1] - paths.v[i][1]], [paths.i[i + 1][0] - paths.v[i + 1][0], paths.i[i + 1][1] - paths.v[i + 1][1]]);
  12662. pathInfo.tLength += bezierData.segmentLength;
  12663. pathInfo.segments.push(bezierData);
  12664. totalLength += bezierData.segmentLength;
  12665. }
  12666. i = len;
  12667. if (mask.v.c) {
  12668. bezierData = bez.buildBezierData(paths.v[i], paths.v[0], [paths.o[i][0] - paths.v[i][0], paths.o[i][1] - paths.v[i][1]], [paths.i[0][0] - paths.v[0][0], paths.i[0][1] - paths.v[0][1]]);
  12669. pathInfo.tLength += bezierData.segmentLength;
  12670. pathInfo.segments.push(bezierData);
  12671. totalLength += bezierData.segmentLength;
  12672. }
  12673. this._pathData.pi = pathInfo;
  12674. }
  12675. pathInfo = this._pathData.pi;
  12676. currentLength = this._pathData.f.v;
  12677. segmentInd = 0;
  12678. pointInd = 1;
  12679. segmentLength = 0;
  12680. flag = true;
  12681. segments = pathInfo.segments;
  12682. if (currentLength < 0 && mask.v.c) {
  12683. if (pathInfo.tLength < Math.abs(currentLength)) {
  12684. currentLength = -Math.abs(currentLength) % pathInfo.tLength;
  12685. }
  12686. segmentInd = segments.length - 1;
  12687. points = segments[segmentInd].points;
  12688. pointInd = points.length - 1;
  12689. while (currentLength < 0) {
  12690. currentLength += points[pointInd].partialLength;
  12691. pointInd -= 1;
  12692. if (pointInd < 0) {
  12693. segmentInd -= 1;
  12694. points = segments[segmentInd].points;
  12695. pointInd = points.length - 1;
  12696. }
  12697. }
  12698. }
  12699. points = segments[segmentInd].points;
  12700. prevPoint = points[pointInd - 1];
  12701. currentPoint = points[pointInd];
  12702. partialLength = currentPoint.partialLength;
  12703. }
  12704. len = letters.length;
  12705. xPos = 0;
  12706. yPos = 0;
  12707. var yOff = documentData.finalSize * 1.2 * 0.714;
  12708. var firstLine = true;
  12709. var animatorProps;
  12710. var animatorSelector;
  12711. var j;
  12712. var jLen;
  12713. var letterValue;
  12714. jLen = animators.length;
  12715. var mult;
  12716. var ind = -1;
  12717. var offf;
  12718. var xPathPos;
  12719. var yPathPos;
  12720. var initPathPos = currentLength;
  12721. var initSegmentInd = segmentInd;
  12722. var initPointInd = pointInd;
  12723. var currentLine = -1;
  12724. var elemOpacity;
  12725. var sc;
  12726. var sw;
  12727. var fc;
  12728. var k;
  12729. var letterSw;
  12730. var letterSc;
  12731. var letterFc;
  12732. var letterM = '';
  12733. var letterP = this.defaultPropsArray;
  12734. var letterO; //
  12735. if (documentData.j === 2 || documentData.j === 1) {
  12736. var animatorJustifyOffset = 0;
  12737. var animatorFirstCharOffset = 0;
  12738. var justifyOffsetMult = documentData.j === 2 ? -0.5 : -1;
  12739. var lastIndex = 0;
  12740. var isNewLine = true;
  12741. for (i = 0; i < len; i += 1) {
  12742. if (letters[i].n) {
  12743. if (animatorJustifyOffset) {
  12744. animatorJustifyOffset += animatorFirstCharOffset;
  12745. }
  12746. while (lastIndex < i) {
  12747. letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
  12748. lastIndex += 1;
  12749. }
  12750. animatorJustifyOffset = 0;
  12751. isNewLine = true;
  12752. } else {
  12753. for (j = 0; j < jLen; j += 1) {
  12754. animatorProps = animators[j].a;
  12755. if (animatorProps.t.propType) {
  12756. if (isNewLine && documentData.j === 2) {
  12757. animatorFirstCharOffset += animatorProps.t.v * justifyOffsetMult;
  12758. }
  12759. animatorSelector = animators[j].s;
  12760. mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
  12761. if (mult.length) {
  12762. animatorJustifyOffset += animatorProps.t.v * mult[0] * justifyOffsetMult;
  12763. } else {
  12764. animatorJustifyOffset += animatorProps.t.v * mult * justifyOffsetMult;
  12765. }
  12766. }
  12767. }
  12768. isNewLine = false;
  12769. }
  12770. }
  12771. if (animatorJustifyOffset) {
  12772. animatorJustifyOffset += animatorFirstCharOffset;
  12773. }
  12774. while (lastIndex < i) {
  12775. letters[lastIndex].animatorJustifyOffset = animatorJustifyOffset;
  12776. lastIndex += 1;
  12777. }
  12778. } //
  12779. for (i = 0; i < len; i += 1) {
  12780. matrixHelper.reset();
  12781. elemOpacity = 1;
  12782. if (letters[i].n) {
  12783. xPos = 0;
  12784. yPos += documentData.yOffset;
  12785. yPos += firstLine ? 1 : 0;
  12786. currentLength = initPathPos;
  12787. firstLine = false;
  12788. if (this._hasMaskedPath) {
  12789. segmentInd = initSegmentInd;
  12790. pointInd = initPointInd;
  12791. points = segments[segmentInd].points;
  12792. prevPoint = points[pointInd - 1];
  12793. currentPoint = points[pointInd];
  12794. partialLength = currentPoint.partialLength;
  12795. segmentLength = 0;
  12796. }
  12797. letterM = '';
  12798. letterFc = '';
  12799. letterSw = '';
  12800. letterO = '';
  12801. letterP = this.defaultPropsArray;
  12802. } else {
  12803. if (this._hasMaskedPath) {
  12804. if (currentLine !== letters[i].line) {
  12805. switch (documentData.j) {
  12806. case 1:
  12807. currentLength += totalLength - documentData.lineWidths[letters[i].line];
  12808. break;
  12809. case 2:
  12810. currentLength += (totalLength - documentData.lineWidths[letters[i].line]) / 2;
  12811. break;
  12812. default:
  12813. break;
  12814. }
  12815. currentLine = letters[i].line;
  12816. }
  12817. if (ind !== letters[i].ind) {
  12818. if (letters[ind]) {
  12819. currentLength += letters[ind].extra;
  12820. }
  12821. currentLength += letters[i].an / 2;
  12822. ind = letters[i].ind;
  12823. }
  12824. currentLength += alignment[0] * letters[i].an * 0.005;
  12825. var animatorOffset = 0;
  12826. for (j = 0; j < jLen; j += 1) {
  12827. animatorProps = animators[j].a;
  12828. if (animatorProps.p.propType) {
  12829. animatorSelector = animators[j].s;
  12830. mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
  12831. if (mult.length) {
  12832. animatorOffset += animatorProps.p.v[0] * mult[0];
  12833. } else {
  12834. animatorOffset += animatorProps.p.v[0] * mult;
  12835. }
  12836. }
  12837. if (animatorProps.a.propType) {
  12838. animatorSelector = animators[j].s;
  12839. mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
  12840. if (mult.length) {
  12841. animatorOffset += animatorProps.a.v[0] * mult[0];
  12842. } else {
  12843. animatorOffset += animatorProps.a.v[0] * mult;
  12844. }
  12845. }
  12846. }
  12847. flag = true; // Force alignment only works with a single line for now
  12848. if (this._pathData.a.v) {
  12849. currentLength = letters[0].an * 0.5 + (totalLength - this._pathData.f.v - letters[0].an * 0.5 - letters[letters.length - 1].an * 0.5) * ind / (len - 1);
  12850. currentLength += this._pathData.f.v;
  12851. }
  12852. while (flag) {
  12853. if (segmentLength + partialLength >= currentLength + animatorOffset || !points) {
  12854. perc = (currentLength + animatorOffset - segmentLength) / currentPoint.partialLength;
  12855. xPathPos = prevPoint.point[0] + (currentPoint.point[0] - prevPoint.point[0]) * perc;
  12856. yPathPos = prevPoint.point[1] + (currentPoint.point[1] - prevPoint.point[1]) * perc;
  12857. matrixHelper.translate(-alignment[0] * letters[i].an * 0.005, -(alignment[1] * yOff) * 0.01);
  12858. flag = false;
  12859. } else if (points) {
  12860. segmentLength += currentPoint.partialLength;
  12861. pointInd += 1;
  12862. if (pointInd >= points.length) {
  12863. pointInd = 0;
  12864. segmentInd += 1;
  12865. if (!segments[segmentInd]) {
  12866. if (mask.v.c) {
  12867. pointInd = 0;
  12868. segmentInd = 0;
  12869. points = segments[segmentInd].points;
  12870. } else {
  12871. segmentLength -= currentPoint.partialLength;
  12872. points = null;
  12873. }
  12874. } else {
  12875. points = segments[segmentInd].points;
  12876. }
  12877. }
  12878. if (points) {
  12879. prevPoint = currentPoint;
  12880. currentPoint = points[pointInd];
  12881. partialLength = currentPoint.partialLength;
  12882. }
  12883. }
  12884. }
  12885. offf = letters[i].an / 2 - letters[i].add;
  12886. matrixHelper.translate(-offf, 0, 0);
  12887. } else {
  12888. offf = letters[i].an / 2 - letters[i].add;
  12889. matrixHelper.translate(-offf, 0, 0); // Grouping alignment
  12890. matrixHelper.translate(-alignment[0] * letters[i].an * 0.005, -alignment[1] * yOff * 0.01, 0);
  12891. }
  12892. for (j = 0; j < jLen; j += 1) {
  12893. animatorProps = animators[j].a;
  12894. if (animatorProps.t.propType) {
  12895. animatorSelector = animators[j].s;
  12896. mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars); // This condition is to prevent applying tracking to first character in each line. Might be better to use a boolean "isNewLine"
  12897. if (xPos !== 0 || documentData.j !== 0) {
  12898. if (this._hasMaskedPath) {
  12899. if (mult.length) {
  12900. currentLength += animatorProps.t.v * mult[0];
  12901. } else {
  12902. currentLength += animatorProps.t.v * mult;
  12903. }
  12904. } else if (mult.length) {
  12905. xPos += animatorProps.t.v * mult[0];
  12906. } else {
  12907. xPos += animatorProps.t.v * mult;
  12908. }
  12909. }
  12910. }
  12911. }
  12912. if (documentData.strokeWidthAnim) {
  12913. sw = documentData.sw || 0;
  12914. }
  12915. if (documentData.strokeColorAnim) {
  12916. if (documentData.sc) {
  12917. sc = [documentData.sc[0], documentData.sc[1], documentData.sc[2]];
  12918. } else {
  12919. sc = [0, 0, 0];
  12920. }
  12921. }
  12922. if (documentData.fillColorAnim && documentData.fc) {
  12923. fc = [documentData.fc[0], documentData.fc[1], documentData.fc[2]];
  12924. }
  12925. for (j = 0; j < jLen; j += 1) {
  12926. animatorProps = animators[j].a;
  12927. if (animatorProps.a.propType) {
  12928. animatorSelector = animators[j].s;
  12929. mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
  12930. if (mult.length) {
  12931. matrixHelper.translate(-animatorProps.a.v[0] * mult[0], -animatorProps.a.v[1] * mult[1], animatorProps.a.v[2] * mult[2]);
  12932. } else {
  12933. matrixHelper.translate(-animatorProps.a.v[0] * mult, -animatorProps.a.v[1] * mult, animatorProps.a.v[2] * mult);
  12934. }
  12935. }
  12936. }
  12937. for (j = 0; j < jLen; j += 1) {
  12938. animatorProps = animators[j].a;
  12939. if (animatorProps.s.propType) {
  12940. animatorSelector = animators[j].s;
  12941. mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
  12942. if (mult.length) {
  12943. matrixHelper.scale(1 + (animatorProps.s.v[0] - 1) * mult[0], 1 + (animatorProps.s.v[1] - 1) * mult[1], 1);
  12944. } else {
  12945. matrixHelper.scale(1 + (animatorProps.s.v[0] - 1) * mult, 1 + (animatorProps.s.v[1] - 1) * mult, 1);
  12946. }
  12947. }
  12948. }
  12949. for (j = 0; j < jLen; j += 1) {
  12950. animatorProps = animators[j].a;
  12951. animatorSelector = animators[j].s;
  12952. mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
  12953. if (animatorProps.sk.propType) {
  12954. if (mult.length) {
  12955. matrixHelper.skewFromAxis(-animatorProps.sk.v * mult[0], animatorProps.sa.v * mult[1]);
  12956. } else {
  12957. matrixHelper.skewFromAxis(-animatorProps.sk.v * mult, animatorProps.sa.v * mult);
  12958. }
  12959. }
  12960. if (animatorProps.r.propType) {
  12961. if (mult.length) {
  12962. matrixHelper.rotateZ(-animatorProps.r.v * mult[2]);
  12963. } else {
  12964. matrixHelper.rotateZ(-animatorProps.r.v * mult);
  12965. }
  12966. }
  12967. if (animatorProps.ry.propType) {
  12968. if (mult.length) {
  12969. matrixHelper.rotateY(animatorProps.ry.v * mult[1]);
  12970. } else {
  12971. matrixHelper.rotateY(animatorProps.ry.v * mult);
  12972. }
  12973. }
  12974. if (animatorProps.rx.propType) {
  12975. if (mult.length) {
  12976. matrixHelper.rotateX(animatorProps.rx.v * mult[0]);
  12977. } else {
  12978. matrixHelper.rotateX(animatorProps.rx.v * mult);
  12979. }
  12980. }
  12981. if (animatorProps.o.propType) {
  12982. if (mult.length) {
  12983. elemOpacity += (animatorProps.o.v * mult[0] - elemOpacity) * mult[0];
  12984. } else {
  12985. elemOpacity += (animatorProps.o.v * mult - elemOpacity) * mult;
  12986. }
  12987. }
  12988. if (documentData.strokeWidthAnim && animatorProps.sw.propType) {
  12989. if (mult.length) {
  12990. sw += animatorProps.sw.v * mult[0];
  12991. } else {
  12992. sw += animatorProps.sw.v * mult;
  12993. }
  12994. }
  12995. if (documentData.strokeColorAnim && animatorProps.sc.propType) {
  12996. for (k = 0; k < 3; k += 1) {
  12997. if (mult.length) {
  12998. sc[k] += (animatorProps.sc.v[k] - sc[k]) * mult[0];
  12999. } else {
  13000. sc[k] += (animatorProps.sc.v[k] - sc[k]) * mult;
  13001. }
  13002. }
  13003. }
  13004. if (documentData.fillColorAnim && documentData.fc) {
  13005. if (animatorProps.fc.propType) {
  13006. for (k = 0; k < 3; k += 1) {
  13007. if (mult.length) {
  13008. fc[k] += (animatorProps.fc.v[k] - fc[k]) * mult[0];
  13009. } else {
  13010. fc[k] += (animatorProps.fc.v[k] - fc[k]) * mult;
  13011. }
  13012. }
  13013. }
  13014. if (animatorProps.fh.propType) {
  13015. if (mult.length) {
  13016. fc = addHueToRGB(fc, animatorProps.fh.v * mult[0]);
  13017. } else {
  13018. fc = addHueToRGB(fc, animatorProps.fh.v * mult);
  13019. }
  13020. }
  13021. if (animatorProps.fs.propType) {
  13022. if (mult.length) {
  13023. fc = addSaturationToRGB(fc, animatorProps.fs.v * mult[0]);
  13024. } else {
  13025. fc = addSaturationToRGB(fc, animatorProps.fs.v * mult);
  13026. }
  13027. }
  13028. if (animatorProps.fb.propType) {
  13029. if (mult.length) {
  13030. fc = addBrightnessToRGB(fc, animatorProps.fb.v * mult[0]);
  13031. } else {
  13032. fc = addBrightnessToRGB(fc, animatorProps.fb.v * mult);
  13033. }
  13034. }
  13035. }
  13036. }
  13037. for (j = 0; j < jLen; j += 1) {
  13038. animatorProps = animators[j].a;
  13039. if (animatorProps.p.propType) {
  13040. animatorSelector = animators[j].s;
  13041. mult = animatorSelector.getMult(letters[i].anIndexes[j], textData.a[j].s.totalChars);
  13042. if (this._hasMaskedPath) {
  13043. if (mult.length) {
  13044. matrixHelper.translate(0, animatorProps.p.v[1] * mult[0], -animatorProps.p.v[2] * mult[1]);
  13045. } else {
  13046. matrixHelper.translate(0, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
  13047. }
  13048. } else if (mult.length) {
  13049. matrixHelper.translate(animatorProps.p.v[0] * mult[0], animatorProps.p.v[1] * mult[1], -animatorProps.p.v[2] * mult[2]);
  13050. } else {
  13051. matrixHelper.translate(animatorProps.p.v[0] * mult, animatorProps.p.v[1] * mult, -animatorProps.p.v[2] * mult);
  13052. }
  13053. }
  13054. }
  13055. if (documentData.strokeWidthAnim) {
  13056. letterSw = sw < 0 ? 0 : sw;
  13057. }
  13058. if (documentData.strokeColorAnim) {
  13059. letterSc = 'rgb(' + Math.round(sc[0] * 255) + ',' + Math.round(sc[1] * 255) + ',' + Math.round(sc[2] * 255) + ')';
  13060. }
  13061. if (documentData.fillColorAnim && documentData.fc) {
  13062. letterFc = 'rgb(' + Math.round(fc[0] * 255) + ',' + Math.round(fc[1] * 255) + ',' + Math.round(fc[2] * 255) + ')';
  13063. }
  13064. if (this._hasMaskedPath) {
  13065. matrixHelper.translate(0, -documentData.ls);
  13066. matrixHelper.translate(0, alignment[1] * yOff * 0.01 + yPos, 0);
  13067. if (this._pathData.p.v) {
  13068. tanAngle = (currentPoint.point[1] - prevPoint.point[1]) / (currentPoint.point[0] - prevPoint.point[0]);
  13069. var rot = Math.atan(tanAngle) * 180 / Math.PI;
  13070. if (currentPoint.point[0] < prevPoint.point[0]) {
  13071. rot += 180;
  13072. }
  13073. matrixHelper.rotate(-rot * Math.PI / 180);
  13074. }
  13075. matrixHelper.translate(xPathPos, yPathPos, 0);
  13076. currentLength -= alignment[0] * letters[i].an * 0.005;
  13077. if (letters[i + 1] && ind !== letters[i + 1].ind) {
  13078. currentLength += letters[i].an / 2;
  13079. currentLength += documentData.tr * 0.001 * documentData.finalSize;
  13080. }
  13081. } else {
  13082. matrixHelper.translate(xPos, yPos, 0);
  13083. if (documentData.ps) {
  13084. // matrixHelper.translate(documentData.ps[0],documentData.ps[1],0);
  13085. matrixHelper.translate(documentData.ps[0], documentData.ps[1] + documentData.ascent, 0);
  13086. }
  13087. switch (documentData.j) {
  13088. case 1:
  13089. matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]), 0, 0);
  13090. break;
  13091. case 2:
  13092. matrixHelper.translate(letters[i].animatorJustifyOffset + documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[letters[i].line]) / 2, 0, 0);
  13093. break;
  13094. default:
  13095. break;
  13096. }
  13097. matrixHelper.translate(0, -documentData.ls);
  13098. matrixHelper.translate(offf, 0, 0);
  13099. matrixHelper.translate(alignment[0] * letters[i].an * 0.005, alignment[1] * yOff * 0.01, 0);
  13100. xPos += letters[i].l + documentData.tr * 0.001 * documentData.finalSize;
  13101. }
  13102. if (renderType === 'html') {
  13103. letterM = matrixHelper.toCSS();
  13104. } else if (renderType === 'svg') {
  13105. letterM = matrixHelper.to2dCSS();
  13106. } else {
  13107. letterP = [matrixHelper.props[0], matrixHelper.props[1], matrixHelper.props[2], matrixHelper.props[3], matrixHelper.props[4], matrixHelper.props[5], matrixHelper.props[6], matrixHelper.props[7], matrixHelper.props[8], matrixHelper.props[9], matrixHelper.props[10], matrixHelper.props[11], matrixHelper.props[12], matrixHelper.props[13], matrixHelper.props[14], matrixHelper.props[15]];
  13108. }
  13109. letterO = elemOpacity;
  13110. }
  13111. if (renderedLettersCount <= i) {
  13112. letterValue = new LetterProps(letterO, letterSw, letterSc, letterFc, letterM, letterP);
  13113. this.renderedLetters.push(letterValue);
  13114. renderedLettersCount += 1;
  13115. this.lettersChangedFlag = true;
  13116. } else {
  13117. letterValue = this.renderedLetters[i];
  13118. this.lettersChangedFlag = letterValue.update(letterO, letterSw, letterSc, letterFc, letterM, letterP) || this.lettersChangedFlag;
  13119. }
  13120. }
  13121. };
  13122. TextAnimatorProperty.prototype.getValue = function () {
  13123. if (this._elem.globalData.frameId === this._frameId) {
  13124. return;
  13125. }
  13126. this._frameId = this._elem.globalData.frameId;
  13127. this.iterateDynamicProperties();
  13128. };
  13129. TextAnimatorProperty.prototype.mHelper = new Matrix();
  13130. TextAnimatorProperty.prototype.defaultPropsArray = [];
  13131. extendPrototype([DynamicPropertyContainer], TextAnimatorProperty);
  13132. function ITextElement() {}
  13133. ITextElement.prototype.initElement = function (data, globalData, comp) {
  13134. this.lettersChangedFlag = true;
  13135. this.initFrame();
  13136. this.initBaseData(data, globalData, comp);
  13137. this.textProperty = new TextProperty(this, data.t, this.dynamicProperties);
  13138. this.textAnimator = new TextAnimatorProperty(data.t, this.renderType, this);
  13139. this.initTransform(data, globalData, comp);
  13140. this.initHierarchy();
  13141. this.initRenderable();
  13142. this.initRendererElement();
  13143. this.createContainerElements();
  13144. this.createRenderableComponents();
  13145. this.createContent();
  13146. this.hide();
  13147. this.textAnimator.searchProperties(this.dynamicProperties);
  13148. };
  13149. ITextElement.prototype.prepareFrame = function (num) {
  13150. this._mdf = false;
  13151. this.prepareRenderableFrame(num);
  13152. this.prepareProperties(num, this.isInRange);
  13153. };
  13154. ITextElement.prototype.createPathShape = function (matrixHelper, shapes) {
  13155. var j;
  13156. var jLen = shapes.length;
  13157. var pathNodes;
  13158. var shapeStr = '';
  13159. for (j = 0; j < jLen; j += 1) {
  13160. if (shapes[j].ty === 'sh') {
  13161. pathNodes = shapes[j].ks.k;
  13162. shapeStr += buildShapeString(pathNodes, pathNodes.i.length, true, matrixHelper);
  13163. }
  13164. }
  13165. return shapeStr;
  13166. };
  13167. ITextElement.prototype.updateDocumentData = function (newData, index) {
  13168. this.textProperty.updateDocumentData(newData, index);
  13169. };
  13170. ITextElement.prototype.canResizeFont = function (_canResize) {
  13171. this.textProperty.canResizeFont(_canResize);
  13172. };
  13173. ITextElement.prototype.setMinimumFontSize = function (_fontSize) {
  13174. this.textProperty.setMinimumFontSize(_fontSize);
  13175. };
  13176. ITextElement.prototype.applyTextPropertiesToMatrix = function (documentData, matrixHelper, lineNumber, xPos, yPos) {
  13177. if (documentData.ps) {
  13178. matrixHelper.translate(documentData.ps[0], documentData.ps[1] + documentData.ascent, 0);
  13179. }
  13180. matrixHelper.translate(0, -documentData.ls, 0);
  13181. switch (documentData.j) {
  13182. case 1:
  13183. matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]), 0, 0);
  13184. break;
  13185. case 2:
  13186. matrixHelper.translate(documentData.justifyOffset + (documentData.boxWidth - documentData.lineWidths[lineNumber]) / 2, 0, 0);
  13187. break;
  13188. default:
  13189. break;
  13190. }
  13191. matrixHelper.translate(xPos, yPos, 0);
  13192. };
  13193. ITextElement.prototype.buildColor = function (colorData) {
  13194. return 'rgb(' + Math.round(colorData[0] * 255) + ',' + Math.round(colorData[1] * 255) + ',' + Math.round(colorData[2] * 255) + ')';
  13195. };
  13196. ITextElement.prototype.emptyProp = new LetterProps();
  13197. ITextElement.prototype.destroy = function () {};
  13198. ITextElement.prototype.validateText = function () {
  13199. if (this.textProperty._mdf || this.textProperty._isFirstFrame) {
  13200. this.buildNewText();
  13201. this.textProperty._isFirstFrame = false;
  13202. this.textProperty._mdf = false;
  13203. }
  13204. };
  13205. var emptyShapeData = {
  13206. shapes: []
  13207. };
  13208. function SVGTextLottieElement(data, globalData, comp) {
  13209. this.textSpans = [];
  13210. this.renderType = 'svg';
  13211. this.initElement(data, globalData, comp);
  13212. }
  13213. extendPrototype([BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, ITextElement], SVGTextLottieElement);
  13214. SVGTextLottieElement.prototype.createContent = function () {
  13215. if (this.data.singleShape && !this.globalData.fontManager.chars) {
  13216. this.textContainer = createNS('text');
  13217. }
  13218. };
  13219. SVGTextLottieElement.prototype.buildTextContents = function (textArray) {
  13220. var i = 0;
  13221. var len = textArray.length;
  13222. var textContents = [];
  13223. var currentTextContent = '';
  13224. while (i < len) {
  13225. if (textArray[i] === String.fromCharCode(13) || textArray[i] === String.fromCharCode(3)) {
  13226. textContents.push(currentTextContent);
  13227. currentTextContent = '';
  13228. } else {
  13229. currentTextContent += textArray[i];
  13230. }
  13231. i += 1;
  13232. }
  13233. textContents.push(currentTextContent);
  13234. return textContents;
  13235. };
  13236. SVGTextLottieElement.prototype.buildShapeData = function (data, scale) {
  13237. // data should probably be cloned to apply scale separately to each instance of a text on different layers
  13238. // but since text internal content gets only rendered once and then it's never rerendered,
  13239. // it's probably safe not to clone data and reuse always the same instance even if the object is mutated.
  13240. // Avoiding cloning is preferred since cloning each character shape data is expensive
  13241. if (data.shapes && data.shapes.length) {
  13242. var shape = data.shapes[0];
  13243. if (shape.it) {
  13244. var shapeItem = shape.it[shape.it.length - 1];
  13245. if (shapeItem.s) {
  13246. shapeItem.s.k[0] = scale;
  13247. shapeItem.s.k[1] = scale;
  13248. }
  13249. }
  13250. }
  13251. return data;
  13252. };
  13253. SVGTextLottieElement.prototype.buildNewText = function () {
  13254. this.addDynamicProperty(this);
  13255. var i;
  13256. var len;
  13257. var documentData = this.textProperty.currentData;
  13258. this.renderedLetters = createSizedArray(documentData ? documentData.l.length : 0);
  13259. if (documentData.fc) {
  13260. this.layerElement.setAttribute('fill', this.buildColor(documentData.fc));
  13261. } else {
  13262. this.layerElement.setAttribute('fill', 'rgba(0,0,0,0)');
  13263. }
  13264. if (documentData.sc) {
  13265. this.layerElement.setAttribute('stroke', this.buildColor(documentData.sc));
  13266. this.layerElement.setAttribute('stroke-width', documentData.sw);
  13267. }
  13268. this.layerElement.setAttribute('font-size', documentData.finalSize);
  13269. var fontData = this.globalData.fontManager.getFontByName(documentData.f);
  13270. if (fontData.fClass) {
  13271. this.layerElement.setAttribute('class', fontData.fClass);
  13272. } else {
  13273. this.layerElement.setAttribute('font-family', fontData.fFamily);
  13274. var fWeight = documentData.fWeight;
  13275. var fStyle = documentData.fStyle;
  13276. this.layerElement.setAttribute('font-style', fStyle);
  13277. this.layerElement.setAttribute('font-weight', fWeight);
  13278. }
  13279. this.layerElement.setAttribute('aria-label', documentData.t);
  13280. var letters = documentData.l || [];
  13281. var usesGlyphs = !!this.globalData.fontManager.chars;
  13282. len = letters.length;
  13283. var tSpan;
  13284. var matrixHelper = this.mHelper;
  13285. var shapeStr = '';
  13286. var singleShape = this.data.singleShape;
  13287. var xPos = 0;
  13288. var yPos = 0;
  13289. var firstLine = true;
  13290. var trackingOffset = documentData.tr * 0.001 * documentData.finalSize;
  13291. if (singleShape && !usesGlyphs && !documentData.sz) {
  13292. var tElement = this.textContainer;
  13293. var justify = 'start';
  13294. switch (documentData.j) {
  13295. case 1:
  13296. justify = 'end';
  13297. break;
  13298. case 2:
  13299. justify = 'middle';
  13300. break;
  13301. default:
  13302. justify = 'start';
  13303. break;
  13304. }
  13305. tElement.setAttribute('text-anchor', justify);
  13306. tElement.setAttribute('letter-spacing', trackingOffset);
  13307. var textContent = this.buildTextContents(documentData.finalText);
  13308. len = textContent.length;
  13309. yPos = documentData.ps ? documentData.ps[1] + documentData.ascent : 0;
  13310. for (i = 0; i < len; i += 1) {
  13311. tSpan = this.textSpans[i].span || createNS('tspan');
  13312. tSpan.textContent = textContent[i];
  13313. tSpan.setAttribute('x', 0);
  13314. tSpan.setAttribute('y', yPos);
  13315. tSpan.style.display = 'inherit';
  13316. tElement.appendChild(tSpan);
  13317. if (!this.textSpans[i]) {
  13318. this.textSpans[i] = {
  13319. span: null,
  13320. glyph: null
  13321. };
  13322. }
  13323. this.textSpans[i].span = tSpan;
  13324. yPos += documentData.finalLineHeight;
  13325. }
  13326. this.layerElement.appendChild(tElement);
  13327. } else {
  13328. var cachedSpansLength = this.textSpans.length;
  13329. var charData;
  13330. for (i = 0; i < len; i += 1) {
  13331. if (!this.textSpans[i]) {
  13332. this.textSpans[i] = {
  13333. span: null,
  13334. childSpan: null,
  13335. glyph: null
  13336. };
  13337. }
  13338. if (!usesGlyphs || !singleShape || i === 0) {
  13339. tSpan = cachedSpansLength > i ? this.textSpans[i].span : createNS(usesGlyphs ? 'g' : 'text');
  13340. if (cachedSpansLength <= i) {
  13341. tSpan.setAttribute('stroke-linecap', 'butt');
  13342. tSpan.setAttribute('stroke-linejoin', 'round');
  13343. tSpan.setAttribute('stroke-miterlimit', '4');
  13344. this.textSpans[i].span = tSpan;
  13345. if (usesGlyphs) {
  13346. var childSpan = createNS('g');
  13347. tSpan.appendChild(childSpan);
  13348. this.textSpans[i].childSpan = childSpan;
  13349. }
  13350. this.textSpans[i].span = tSpan;
  13351. this.layerElement.appendChild(tSpan);
  13352. }
  13353. tSpan.style.display = 'inherit';
  13354. }
  13355. matrixHelper.reset();
  13356. if (singleShape) {
  13357. if (letters[i].n) {
  13358. xPos = -trackingOffset;
  13359. yPos += documentData.yOffset;
  13360. yPos += firstLine ? 1 : 0;
  13361. firstLine = false;
  13362. }
  13363. this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos);
  13364. xPos += letters[i].l || 0; // xPos += letters[i].val === ' ' ? 0 : trackingOffset;
  13365. xPos += trackingOffset;
  13366. }
  13367. if (usesGlyphs) {
  13368. charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
  13369. var glyphElement; // t === 1 means the character has been replaced with an animated shaped
  13370. if (charData.t === 1) {
  13371. glyphElement = new SVGCompElement(charData.data, this.globalData, this);
  13372. } else {
  13373. var data = emptyShapeData;
  13374. if (charData.data && charData.data.shapes) {
  13375. data = this.buildShapeData(charData.data, documentData.finalSize);
  13376. }
  13377. glyphElement = new SVGShapeElement(data, this.globalData, this);
  13378. }
  13379. if (this.textSpans[i].glyph) {
  13380. var glyph = this.textSpans[i].glyph;
  13381. this.textSpans[i].childSpan.removeChild(glyph.layerElement);
  13382. glyph.destroy();
  13383. }
  13384. this.textSpans[i].glyph = glyphElement;
  13385. glyphElement._debug = true;
  13386. glyphElement.prepareFrame(0);
  13387. glyphElement.renderFrame();
  13388. this.textSpans[i].childSpan.appendChild(glyphElement.layerElement); // when using animated shapes, the layer will be scaled instead of replacing the internal scale
  13389. // this might have issues with strokes and might need a different solution
  13390. if (charData.t === 1) {
  13391. this.textSpans[i].childSpan.setAttribute('transform', 'scale(' + documentData.finalSize / 100 + ',' + documentData.finalSize / 100 + ')');
  13392. }
  13393. } else {
  13394. if (singleShape) {
  13395. tSpan.setAttribute('transform', 'translate(' + matrixHelper.props[12] + ',' + matrixHelper.props[13] + ')');
  13396. }
  13397. tSpan.textContent = letters[i].val;
  13398. tSpan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');
  13399. } //
  13400. }
  13401. if (singleShape && tSpan) {
  13402. tSpan.setAttribute('d', shapeStr);
  13403. }
  13404. }
  13405. while (i < this.textSpans.length) {
  13406. this.textSpans[i].span.style.display = 'none';
  13407. i += 1;
  13408. }
  13409. this._sizeChanged = true;
  13410. };
  13411. SVGTextLottieElement.prototype.sourceRectAtTime = function () {
  13412. this.prepareFrame(this.comp.renderedFrame - this.data.st);
  13413. this.renderInnerContent();
  13414. if (this._sizeChanged) {
  13415. this._sizeChanged = false;
  13416. var textBox = this.layerElement.getBBox();
  13417. this.bbox = {
  13418. top: textBox.y,
  13419. left: textBox.x,
  13420. width: textBox.width,
  13421. height: textBox.height
  13422. };
  13423. }
  13424. return this.bbox;
  13425. };
  13426. SVGTextLottieElement.prototype.getValue = function () {
  13427. var i;
  13428. var len = this.textSpans.length;
  13429. var glyphElement;
  13430. this.renderedFrame = this.comp.renderedFrame;
  13431. for (i = 0; i < len; i += 1) {
  13432. glyphElement = this.textSpans[i].glyph;
  13433. if (glyphElement) {
  13434. glyphElement.prepareFrame(this.comp.renderedFrame - this.data.st);
  13435. if (glyphElement._mdf) {
  13436. this._mdf = true;
  13437. }
  13438. }
  13439. }
  13440. };
  13441. SVGTextLottieElement.prototype.renderInnerContent = function () {
  13442. this.validateText();
  13443. if (!this.data.singleShape || this._mdf) {
  13444. this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
  13445. if (this.lettersChangedFlag || this.textAnimator.lettersChangedFlag) {
  13446. this._sizeChanged = true;
  13447. var i;
  13448. var len;
  13449. var renderedLetters = this.textAnimator.renderedLetters;
  13450. var letters = this.textProperty.currentData.l;
  13451. len = letters.length;
  13452. var renderedLetter;
  13453. var textSpan;
  13454. var glyphElement;
  13455. for (i = 0; i < len; i += 1) {
  13456. if (!letters[i].n) {
  13457. renderedLetter = renderedLetters[i];
  13458. textSpan = this.textSpans[i].span;
  13459. glyphElement = this.textSpans[i].glyph;
  13460. if (glyphElement) {
  13461. glyphElement.renderFrame();
  13462. }
  13463. if (renderedLetter._mdf.m) {
  13464. textSpan.setAttribute('transform', renderedLetter.m);
  13465. }
  13466. if (renderedLetter._mdf.o) {
  13467. textSpan.setAttribute('opacity', renderedLetter.o);
  13468. }
  13469. if (renderedLetter._mdf.sw) {
  13470. textSpan.setAttribute('stroke-width', renderedLetter.sw);
  13471. }
  13472. if (renderedLetter._mdf.sc) {
  13473. textSpan.setAttribute('stroke', renderedLetter.sc);
  13474. }
  13475. if (renderedLetter._mdf.fc) {
  13476. textSpan.setAttribute('fill', renderedLetter.fc);
  13477. }
  13478. }
  13479. }
  13480. }
  13481. }
  13482. };
  13483. function ISolidElement(data, globalData, comp) {
  13484. this.initElement(data, globalData, comp);
  13485. }
  13486. extendPrototype([IImageElement], ISolidElement);
  13487. ISolidElement.prototype.createContent = function () {
  13488. var rect = createNS('rect'); /// /rect.style.width = this.data.sw;
  13489. /// /rect.style.height = this.data.sh;
  13490. /// /rect.style.fill = this.data.sc;
  13491. rect.setAttribute('width', this.data.sw);
  13492. rect.setAttribute('height', this.data.sh);
  13493. rect.setAttribute('fill', this.data.sc);
  13494. this.layerElement.appendChild(rect);
  13495. };
  13496. function NullElement(data, globalData, comp) {
  13497. this.initFrame();
  13498. this.initBaseData(data, globalData, comp);
  13499. this.initFrame();
  13500. this.initTransform(data, globalData, comp);
  13501. this.initHierarchy();
  13502. }
  13503. NullElement.prototype.prepareFrame = function (num) {
  13504. this.prepareProperties(num, true);
  13505. };
  13506. NullElement.prototype.renderFrame = function () {};
  13507. NullElement.prototype.getBaseElement = function () {
  13508. return null;
  13509. };
  13510. NullElement.prototype.destroy = function () {};
  13511. NullElement.prototype.sourceRectAtTime = function () {};
  13512. NullElement.prototype.hide = function () {};
  13513. extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement], NullElement);
  13514. function SVGRendererBase() {}
  13515. extendPrototype([BaseRenderer], SVGRendererBase);
  13516. SVGRendererBase.prototype.createNull = function (data) {
  13517. return new NullElement(data, this.globalData, this);
  13518. };
  13519. SVGRendererBase.prototype.createShape = function (data) {
  13520. return new SVGShapeElement(data, this.globalData, this);
  13521. };
  13522. SVGRendererBase.prototype.createText = function (data) {
  13523. return new SVGTextLottieElement(data, this.globalData, this);
  13524. };
  13525. SVGRendererBase.prototype.createImage = function (data) {
  13526. return new IImageElement(data, this.globalData, this);
  13527. };
  13528. SVGRendererBase.prototype.createSolid = function (data) {
  13529. return new ISolidElement(data, this.globalData, this);
  13530. };
  13531. SVGRendererBase.prototype.configAnimation = function (animData) {
  13532. this.svgElement.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
  13533. this.svgElement.setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
  13534. if (this.renderConfig.viewBoxSize) {
  13535. this.svgElement.setAttribute('viewBox', this.renderConfig.viewBoxSize);
  13536. } else {
  13537. this.svgElement.setAttribute('viewBox', '0 0 ' + animData.w + ' ' + animData.h);
  13538. }
  13539. if (!this.renderConfig.viewBoxOnly) {
  13540. this.svgElement.setAttribute('width', animData.w);
  13541. this.svgElement.setAttribute('height', animData.h);
  13542. this.svgElement.style.width = '100%';
  13543. this.svgElement.style.height = '100%';
  13544. this.svgElement.style.transform = 'translate3d(0,0,0)';
  13545. this.svgElement.style.contentVisibility = this.renderConfig.contentVisibility;
  13546. }
  13547. if (this.renderConfig.width) {
  13548. this.svgElement.setAttribute('width', this.renderConfig.width);
  13549. }
  13550. if (this.renderConfig.height) {
  13551. this.svgElement.setAttribute('height', this.renderConfig.height);
  13552. }
  13553. if (this.renderConfig.className) {
  13554. this.svgElement.setAttribute('class', this.renderConfig.className);
  13555. }
  13556. if (this.renderConfig.id) {
  13557. this.svgElement.setAttribute('id', this.renderConfig.id);
  13558. }
  13559. if (this.renderConfig.focusable !== undefined) {
  13560. this.svgElement.setAttribute('focusable', this.renderConfig.focusable);
  13561. }
  13562. this.svgElement.setAttribute('preserveAspectRatio', this.renderConfig.preserveAspectRatio); // this.layerElement.style.transform = 'translate3d(0,0,0)';
  13563. // this.layerElement.style.transformOrigin = this.layerElement.style.mozTransformOrigin = this.layerElement.style.webkitTransformOrigin = this.layerElement.style['-webkit-transform'] = "0px 0px 0px";
  13564. this.animationItem.wrapper.appendChild(this.svgElement); // Mask animation
  13565. var defs = this.globalData.defs;
  13566. this.setupGlobalData(animData, defs);
  13567. this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
  13568. this.data = animData;
  13569. var maskElement = createNS('clipPath');
  13570. var rect = createNS('rect');
  13571. rect.setAttribute('width', animData.w);
  13572. rect.setAttribute('height', animData.h);
  13573. rect.setAttribute('x', 0);
  13574. rect.setAttribute('y', 0);
  13575. var maskId = createElementID();
  13576. maskElement.setAttribute('id', maskId);
  13577. maskElement.appendChild(rect);
  13578. this.layerElement.setAttribute('clip-path', 'url(' + getLocationHref() + '#' + maskId + ')');
  13579. defs.appendChild(maskElement);
  13580. this.layers = animData.layers;
  13581. this.elements = createSizedArray(animData.layers.length);
  13582. };
  13583. SVGRendererBase.prototype.destroy = function () {
  13584. if (this.animationItem.wrapper) {
  13585. this.animationItem.wrapper.innerText = '';
  13586. }
  13587. this.layerElement = null;
  13588. this.globalData.defs = null;
  13589. var i;
  13590. var len = this.layers ? this.layers.length : 0;
  13591. for (i = 0; i < len; i += 1) {
  13592. if (this.elements[i] && this.elements[i].destroy) {
  13593. this.elements[i].destroy();
  13594. }
  13595. }
  13596. this.elements.length = 0;
  13597. this.destroyed = true;
  13598. this.animationItem = null;
  13599. };
  13600. SVGRendererBase.prototype.updateContainerSize = function () {};
  13601. SVGRendererBase.prototype.findIndexByInd = function (ind) {
  13602. var i = 0;
  13603. var len = this.layers.length;
  13604. for (i = 0; i < len; i += 1) {
  13605. if (this.layers[i].ind === ind) {
  13606. return i;
  13607. }
  13608. }
  13609. return -1;
  13610. };
  13611. SVGRendererBase.prototype.buildItem = function (pos) {
  13612. var elements = this.elements;
  13613. if (elements[pos] || this.layers[pos].ty === 99) {
  13614. return;
  13615. }
  13616. elements[pos] = true;
  13617. var element = this.createItem(this.layers[pos]);
  13618. elements[pos] = element;
  13619. if (getExpressionsPlugin()) {
  13620. if (this.layers[pos].ty === 0) {
  13621. this.globalData.projectInterface.registerComposition(element);
  13622. }
  13623. element.initExpressions();
  13624. }
  13625. this.appendElementInPos(element, pos);
  13626. if (this.layers[pos].tt) {
  13627. var elementIndex = 'tp' in this.layers[pos] ? this.findIndexByInd(this.layers[pos].tp) : pos - 1;
  13628. if (elementIndex === -1) {
  13629. return;
  13630. }
  13631. if (!this.elements[elementIndex] || this.elements[elementIndex] === true) {
  13632. this.buildItem(elementIndex);
  13633. this.addPendingElement(element);
  13634. } else {
  13635. var matteElement = elements[elementIndex];
  13636. var matteMask = matteElement.getMatte(this.layers[pos].tt);
  13637. element.setMatte(matteMask);
  13638. }
  13639. }
  13640. };
  13641. SVGRendererBase.prototype.checkPendingElements = function () {
  13642. while (this.pendingElements.length) {
  13643. var element = this.pendingElements.pop();
  13644. element.checkParenting();
  13645. if (element.data.tt) {
  13646. var i = 0;
  13647. var len = this.elements.length;
  13648. while (i < len) {
  13649. if (this.elements[i] === element) {
  13650. var elementIndex = 'tp' in element.data ? this.findIndexByInd(element.data.tp) : i - 1;
  13651. var matteElement = this.elements[elementIndex];
  13652. var matteMask = matteElement.getMatte(this.layers[i].tt);
  13653. element.setMatte(matteMask);
  13654. break;
  13655. }
  13656. i += 1;
  13657. }
  13658. }
  13659. }
  13660. };
  13661. SVGRendererBase.prototype.renderFrame = function (num) {
  13662. if (this.renderedFrame === num || this.destroyed) {
  13663. return;
  13664. }
  13665. if (num === null) {
  13666. num = this.renderedFrame;
  13667. } else {
  13668. this.renderedFrame = num;
  13669. } // console.log('-------');
  13670. // console.log('FRAME ',num);
  13671. this.globalData.frameNum = num;
  13672. this.globalData.frameId += 1;
  13673. this.globalData.projectInterface.currentFrame = num;
  13674. this.globalData._mdf = false;
  13675. var i;
  13676. var len = this.layers.length;
  13677. if (!this.completeLayers) {
  13678. this.checkLayers(num);
  13679. }
  13680. for (i = len - 1; i >= 0; i -= 1) {
  13681. if (this.completeLayers || this.elements[i]) {
  13682. this.elements[i].prepareFrame(num - this.layers[i].st);
  13683. }
  13684. }
  13685. if (this.globalData._mdf) {
  13686. for (i = 0; i < len; i += 1) {
  13687. if (this.completeLayers || this.elements[i]) {
  13688. this.elements[i].renderFrame();
  13689. }
  13690. }
  13691. }
  13692. };
  13693. SVGRendererBase.prototype.appendElementInPos = function (element, pos) {
  13694. var newElement = element.getBaseElement();
  13695. if (!newElement) {
  13696. return;
  13697. }
  13698. var i = 0;
  13699. var nextElement;
  13700. while (i < pos) {
  13701. if (this.elements[i] && this.elements[i] !== true && this.elements[i].getBaseElement()) {
  13702. nextElement = this.elements[i].getBaseElement();
  13703. }
  13704. i += 1;
  13705. }
  13706. if (nextElement) {
  13707. this.layerElement.insertBefore(newElement, nextElement);
  13708. } else {
  13709. this.layerElement.appendChild(newElement);
  13710. }
  13711. };
  13712. SVGRendererBase.prototype.hide = function () {
  13713. this.layerElement.style.display = 'none';
  13714. };
  13715. SVGRendererBase.prototype.show = function () {
  13716. this.layerElement.style.display = 'block';
  13717. };
  13718. function ICompElement() {}
  13719. extendPrototype([BaseElement, TransformElement, HierarchyElement, FrameElement, RenderableDOMElement], ICompElement);
  13720. ICompElement.prototype.initElement = function (data, globalData, comp) {
  13721. this.initFrame();
  13722. this.initBaseData(data, globalData, comp);
  13723. this.initTransform(data, globalData, comp);
  13724. this.initRenderable();
  13725. this.initHierarchy();
  13726. this.initRendererElement();
  13727. this.createContainerElements();
  13728. this.createRenderableComponents();
  13729. if (this.data.xt || !globalData.progressiveLoad) {
  13730. this.buildAllItems();
  13731. }
  13732. this.hide();
  13733. };
  13734. /* ICompElement.prototype.hide = function(){
  13735. if(!this.hidden){
  13736. this.hideElement();
  13737. var i,len = this.elements.length;
  13738. for( i = 0; i < len; i+=1 ){
  13739. if(this.elements[i]){
  13740. this.elements[i].hide();
  13741. }
  13742. }
  13743. }
  13744. }; */
  13745. ICompElement.prototype.prepareFrame = function (num) {
  13746. this._mdf = false;
  13747. this.prepareRenderableFrame(num);
  13748. this.prepareProperties(num, this.isInRange);
  13749. if (!this.isInRange && !this.data.xt) {
  13750. return;
  13751. }
  13752. if (!this.tm._placeholder) {
  13753. var timeRemapped = this.tm.v;
  13754. if (timeRemapped === this.data.op) {
  13755. timeRemapped = this.data.op - 1;
  13756. }
  13757. this.renderedFrame = timeRemapped;
  13758. } else {
  13759. this.renderedFrame = num / this.data.sr;
  13760. }
  13761. var i;
  13762. var len = this.elements.length;
  13763. if (!this.completeLayers) {
  13764. this.checkLayers(this.renderedFrame);
  13765. } // This iteration needs to be backwards because of how expressions connect between each other
  13766. for (i = len - 1; i >= 0; i -= 1) {
  13767. if (this.completeLayers || this.elements[i]) {
  13768. this.elements[i].prepareFrame(this.renderedFrame - this.layers[i].st);
  13769. if (this.elements[i]._mdf) {
  13770. this._mdf = true;
  13771. }
  13772. }
  13773. }
  13774. };
  13775. ICompElement.prototype.renderInnerContent = function () {
  13776. var i;
  13777. var len = this.layers.length;
  13778. for (i = 0; i < len; i += 1) {
  13779. if (this.completeLayers || this.elements[i]) {
  13780. this.elements[i].renderFrame();
  13781. }
  13782. }
  13783. };
  13784. ICompElement.prototype.setElements = function (elems) {
  13785. this.elements = elems;
  13786. };
  13787. ICompElement.prototype.getElements = function () {
  13788. return this.elements;
  13789. };
  13790. ICompElement.prototype.destroyElements = function () {
  13791. var i;
  13792. var len = this.layers.length;
  13793. for (i = 0; i < len; i += 1) {
  13794. if (this.elements[i]) {
  13795. this.elements[i].destroy();
  13796. }
  13797. }
  13798. };
  13799. ICompElement.prototype.destroy = function () {
  13800. this.destroyElements();
  13801. this.destroyBaseElement();
  13802. };
  13803. function SVGCompElement(data, globalData, comp) {
  13804. this.layers = data.layers;
  13805. this.supports3d = true;
  13806. this.completeLayers = false;
  13807. this.pendingElements = [];
  13808. this.elements = this.layers ? createSizedArray(this.layers.length) : [];
  13809. this.initElement(data, globalData, comp);
  13810. this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : {
  13811. _placeholder: true
  13812. };
  13813. }
  13814. extendPrototype([SVGRendererBase, ICompElement, SVGBaseElement], SVGCompElement);
  13815. SVGCompElement.prototype.createComp = function (data) {
  13816. return new SVGCompElement(data, this.globalData, this);
  13817. };
  13818. function SVGRenderer(animationItem, config) {
  13819. this.animationItem = animationItem;
  13820. this.layers = null;
  13821. this.renderedFrame = -1;
  13822. this.svgElement = createNS('svg');
  13823. var ariaLabel = '';
  13824. if (config && config.title) {
  13825. var titleElement = createNS('title');
  13826. var titleId = createElementID();
  13827. titleElement.setAttribute('id', titleId);
  13828. titleElement.textContent = config.title;
  13829. this.svgElement.appendChild(titleElement);
  13830. ariaLabel += titleId;
  13831. }
  13832. if (config && config.description) {
  13833. var descElement = createNS('desc');
  13834. var descId = createElementID();
  13835. descElement.setAttribute('id', descId);
  13836. descElement.textContent = config.description;
  13837. this.svgElement.appendChild(descElement);
  13838. ariaLabel += ' ' + descId;
  13839. }
  13840. if (ariaLabel) {
  13841. this.svgElement.setAttribute('aria-labelledby', ariaLabel);
  13842. }
  13843. var defs = createNS('defs');
  13844. this.svgElement.appendChild(defs);
  13845. var maskElement = createNS('g');
  13846. this.svgElement.appendChild(maskElement);
  13847. this.layerElement = maskElement;
  13848. this.renderConfig = {
  13849. preserveAspectRatio: config && config.preserveAspectRatio || 'xMidYMid meet',
  13850. imagePreserveAspectRatio: config && config.imagePreserveAspectRatio || 'xMidYMid slice',
  13851. contentVisibility: config && config.contentVisibility || 'visible',
  13852. progressiveLoad: config && config.progressiveLoad || false,
  13853. hideOnTransparent: !(config && config.hideOnTransparent === false),
  13854. viewBoxOnly: config && config.viewBoxOnly || false,
  13855. viewBoxSize: config && config.viewBoxSize || false,
  13856. className: config && config.className || '',
  13857. id: config && config.id || '',
  13858. focusable: config && config.focusable,
  13859. filterSize: {
  13860. width: config && config.filterSize && config.filterSize.width || '100%',
  13861. height: config && config.filterSize && config.filterSize.height || '100%',
  13862. x: config && config.filterSize && config.filterSize.x || '0%',
  13863. y: config && config.filterSize && config.filterSize.y || '0%'
  13864. },
  13865. width: config && config.width,
  13866. height: config && config.height,
  13867. runExpressions: !config || config.runExpressions === undefined || config.runExpressions
  13868. };
  13869. this.globalData = {
  13870. _mdf: false,
  13871. frameNum: -1,
  13872. defs: defs,
  13873. renderConfig: this.renderConfig
  13874. };
  13875. this.elements = [];
  13876. this.pendingElements = [];
  13877. this.destroyed = false;
  13878. this.rendererType = 'svg';
  13879. }
  13880. extendPrototype([SVGRendererBase], SVGRenderer);
  13881. SVGRenderer.prototype.createComp = function (data) {
  13882. return new SVGCompElement(data, this.globalData, this);
  13883. };
  13884. function ShapeTransformManager() {
  13885. this.sequences = {};
  13886. this.sequenceList = [];
  13887. this.transform_key_count = 0;
  13888. }
  13889. ShapeTransformManager.prototype = {
  13890. addTransformSequence: function addTransformSequence(transforms) {
  13891. var i;
  13892. var len = transforms.length;
  13893. var key = '_';
  13894. for (i = 0; i < len; i += 1) {
  13895. key += transforms[i].transform.key + '_';
  13896. }
  13897. var sequence = this.sequences[key];
  13898. if (!sequence) {
  13899. sequence = {
  13900. transforms: [].concat(transforms),
  13901. finalTransform: new Matrix(),
  13902. _mdf: false
  13903. };
  13904. this.sequences[key] = sequence;
  13905. this.sequenceList.push(sequence);
  13906. }
  13907. return sequence;
  13908. },
  13909. processSequence: function processSequence(sequence, isFirstFrame) {
  13910. var i = 0;
  13911. var len = sequence.transforms.length;
  13912. var _mdf = isFirstFrame;
  13913. while (i < len && !isFirstFrame) {
  13914. if (sequence.transforms[i].transform.mProps._mdf) {
  13915. _mdf = true;
  13916. break;
  13917. }
  13918. i += 1;
  13919. }
  13920. if (_mdf) {
  13921. sequence.finalTransform.reset();
  13922. for (i = len - 1; i >= 0; i -= 1) {
  13923. sequence.finalTransform.multiply(sequence.transforms[i].transform.mProps.v);
  13924. }
  13925. }
  13926. sequence._mdf = _mdf;
  13927. },
  13928. processSequences: function processSequences(isFirstFrame) {
  13929. var i;
  13930. var len = this.sequenceList.length;
  13931. for (i = 0; i < len; i += 1) {
  13932. this.processSequence(this.sequenceList[i], isFirstFrame);
  13933. }
  13934. },
  13935. getNewKey: function getNewKey() {
  13936. this.transform_key_count += 1;
  13937. return '_' + this.transform_key_count;
  13938. }
  13939. };
  13940. var lumaLoader = function lumaLoader() {
  13941. var id = '__lottie_element_luma_buffer';
  13942. var lumaBuffer = null;
  13943. var lumaBufferCtx = null;
  13944. var svg = null; // This alternate solution has a slight delay before the filter is applied, resulting in a flicker on the first frame.
  13945. // Keeping this here for reference, and in the future, if offscreen canvas supports url filters, this can be used.
  13946. // For now, neither of them work for offscreen canvas, so canvas workers can't support the luma track matte mask.
  13947. // Naming it solution 2 to mark the extra comment lines.
  13948. /*
  13949. var svgString = [
  13950. '<svg xmlns="http://www.w3.org/2000/svg">',
  13951. '<filter id="' + id + '">',
  13952. '<feColorMatrix type="matrix" color-interpolation-filters="sRGB" values="',
  13953. '0.3, 0.3, 0.3, 0, 0, ',
  13954. '0.3, 0.3, 0.3, 0, 0, ',
  13955. '0.3, 0.3, 0.3, 0, 0, ',
  13956. '0.3, 0.3, 0.3, 0, 0',
  13957. '"/>',
  13958. '</filter>',
  13959. '</svg>',
  13960. ].join('');
  13961. var blob = new Blob([svgString], { type: 'image/svg+xml' });
  13962. var url = URL.createObjectURL(blob);
  13963. */
  13964. function createLumaSvgFilter() {
  13965. var _svg = createNS('svg');
  13966. var fil = createNS('filter');
  13967. var matrix = createNS('feColorMatrix');
  13968. fil.setAttribute('id', id);
  13969. matrix.setAttribute('type', 'matrix');
  13970. matrix.setAttribute('color-interpolation-filters', 'sRGB');
  13971. matrix.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');
  13972. fil.appendChild(matrix);
  13973. _svg.appendChild(fil);
  13974. _svg.setAttribute('id', id + '_svg');
  13975. if (featureSupport.svgLumaHidden) {
  13976. _svg.style.display = 'none';
  13977. }
  13978. return _svg;
  13979. }
  13980. function loadLuma() {
  13981. if (!lumaBuffer) {
  13982. svg = createLumaSvgFilter();
  13983. document.body.appendChild(svg);
  13984. lumaBuffer = createTag('canvas');
  13985. lumaBufferCtx = lumaBuffer.getContext('2d'); // lumaBufferCtx.filter = `url('${url}#__lottie_element_luma_buffer')`; // part of solution 2
  13986. lumaBufferCtx.filter = 'url(#' + id + ')';
  13987. lumaBufferCtx.fillStyle = 'rgba(0,0,0,0)';
  13988. lumaBufferCtx.fillRect(0, 0, 1, 1);
  13989. }
  13990. }
  13991. function getLuma(canvas) {
  13992. if (!lumaBuffer) {
  13993. loadLuma();
  13994. }
  13995. lumaBuffer.width = canvas.width;
  13996. lumaBuffer.height = canvas.height; // lumaBufferCtx.filter = `url('${url}#__lottie_element_luma_buffer')`; // part of solution 2
  13997. lumaBufferCtx.filter = 'url(#' + id + ')';
  13998. return lumaBuffer;
  13999. }
  14000. return {
  14001. load: loadLuma,
  14002. get: getLuma
  14003. };
  14004. };
  14005. function createCanvas(width, height) {
  14006. if (featureSupport.offscreenCanvas) {
  14007. return new OffscreenCanvas(width, height);
  14008. }
  14009. var canvas = createTag('canvas');
  14010. canvas.width = width;
  14011. canvas.height = height;
  14012. return canvas;
  14013. }
  14014. var assetLoader = function () {
  14015. return {
  14016. loadLumaCanvas: lumaLoader.load,
  14017. getLumaCanvas: lumaLoader.get,
  14018. createCanvas: createCanvas
  14019. };
  14020. }();
  14021. var registeredEffects = {};
  14022. function CVEffects(elem) {
  14023. var i;
  14024. var len = elem.data.ef ? elem.data.ef.length : 0;
  14025. this.filters = [];
  14026. var filterManager;
  14027. for (i = 0; i < len; i += 1) {
  14028. filterManager = null;
  14029. var type = elem.data.ef[i].ty;
  14030. if (registeredEffects[type]) {
  14031. var Effect = registeredEffects[type].effect;
  14032. filterManager = new Effect(elem.effectsManager.effectElements[i], elem);
  14033. }
  14034. if (filterManager) {
  14035. this.filters.push(filterManager);
  14036. }
  14037. }
  14038. if (this.filters.length) {
  14039. elem.addRenderableComponent(this);
  14040. }
  14041. }
  14042. CVEffects.prototype.renderFrame = function (_isFirstFrame) {
  14043. var i;
  14044. var len = this.filters.length;
  14045. for (i = 0; i < len; i += 1) {
  14046. this.filters[i].renderFrame(_isFirstFrame);
  14047. }
  14048. };
  14049. CVEffects.prototype.getEffects = function (type) {
  14050. var i;
  14051. var len = this.filters.length;
  14052. var effects = [];
  14053. for (i = 0; i < len; i += 1) {
  14054. if (this.filters[i].type === type) {
  14055. effects.push(this.filters[i]);
  14056. }
  14057. }
  14058. return effects;
  14059. };
  14060. function registerEffect(id, effect) {
  14061. registeredEffects[id] = {
  14062. effect: effect
  14063. };
  14064. }
  14065. function CVMaskElement(data, element) {
  14066. this.data = data;
  14067. this.element = element;
  14068. this.masksProperties = this.data.masksProperties || [];
  14069. this.viewData = createSizedArray(this.masksProperties.length);
  14070. var i;
  14071. var len = this.masksProperties.length;
  14072. var hasMasks = false;
  14073. for (i = 0; i < len; i += 1) {
  14074. if (this.masksProperties[i].mode !== 'n') {
  14075. hasMasks = true;
  14076. }
  14077. this.viewData[i] = ShapePropertyFactory.getShapeProp(this.element, this.masksProperties[i], 3);
  14078. }
  14079. this.hasMasks = hasMasks;
  14080. if (hasMasks) {
  14081. this.element.addRenderableComponent(this);
  14082. }
  14083. }
  14084. CVMaskElement.prototype.renderFrame = function () {
  14085. if (!this.hasMasks) {
  14086. return;
  14087. }
  14088. var transform = this.element.finalTransform.mat;
  14089. var ctx = this.element.canvasContext;
  14090. var i;
  14091. var len = this.masksProperties.length;
  14092. var pt;
  14093. var pts;
  14094. var data;
  14095. ctx.beginPath();
  14096. for (i = 0; i < len; i += 1) {
  14097. if (this.masksProperties[i].mode !== 'n') {
  14098. if (this.masksProperties[i].inv) {
  14099. ctx.moveTo(0, 0);
  14100. ctx.lineTo(this.element.globalData.compSize.w, 0);
  14101. ctx.lineTo(this.element.globalData.compSize.w, this.element.globalData.compSize.h);
  14102. ctx.lineTo(0, this.element.globalData.compSize.h);
  14103. ctx.lineTo(0, 0);
  14104. }
  14105. data = this.viewData[i].v;
  14106. pt = transform.applyToPointArray(data.v[0][0], data.v[0][1], 0);
  14107. ctx.moveTo(pt[0], pt[1]);
  14108. var j;
  14109. var jLen = data._length;
  14110. for (j = 1; j < jLen; j += 1) {
  14111. pts = transform.applyToTriplePoints(data.o[j - 1], data.i[j], data.v[j]);
  14112. ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]);
  14113. }
  14114. pts = transform.applyToTriplePoints(data.o[j - 1], data.i[0], data.v[0]);
  14115. ctx.bezierCurveTo(pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]);
  14116. }
  14117. }
  14118. this.element.globalData.renderer.save(true);
  14119. ctx.clip();
  14120. };
  14121. CVMaskElement.prototype.getMaskProperty = MaskElement.prototype.getMaskProperty;
  14122. CVMaskElement.prototype.destroy = function () {
  14123. this.element = null;
  14124. };
  14125. function CVBaseElement() {}
  14126. var operationsMap = {
  14127. 1: 'source-in',
  14128. 2: 'source-out',
  14129. 3: 'source-in',
  14130. 4: 'source-out'
  14131. };
  14132. CVBaseElement.prototype = {
  14133. createElements: function createElements() {},
  14134. initRendererElement: function initRendererElement() {},
  14135. createContainerElements: function createContainerElements() {
  14136. // If the layer is masked we will use two buffers to store each different states of the drawing
  14137. // This solution is not ideal for several reason. But unfortunately, because of the recursive
  14138. // nature of the render tree, it's the only simple way to make sure one inner mask doesn't override an outer mask.
  14139. // TODO: try to reduce the size of these buffers to the size of the composition contaning the layer
  14140. // It might be challenging because the layer most likely is transformed in some way
  14141. if (this.data.tt >= 1) {
  14142. this.buffers = [];
  14143. var canvasContext = this.globalData.canvasContext;
  14144. var bufferCanvas = assetLoader.createCanvas(canvasContext.canvas.width, canvasContext.canvas.height);
  14145. this.buffers.push(bufferCanvas);
  14146. var bufferCanvas2 = assetLoader.createCanvas(canvasContext.canvas.width, canvasContext.canvas.height);
  14147. this.buffers.push(bufferCanvas2);
  14148. if (this.data.tt >= 3 && !document._isProxy) {
  14149. assetLoader.loadLumaCanvas();
  14150. }
  14151. }
  14152. this.canvasContext = this.globalData.canvasContext;
  14153. this.transformCanvas = this.globalData.transformCanvas;
  14154. this.renderableEffectsManager = new CVEffects(this);
  14155. this.searchEffectTransforms();
  14156. },
  14157. createContent: function createContent() {},
  14158. setBlendMode: function setBlendMode() {
  14159. var globalData = this.globalData;
  14160. if (globalData.blendMode !== this.data.bm) {
  14161. globalData.blendMode = this.data.bm;
  14162. var blendModeValue = getBlendMode(this.data.bm);
  14163. globalData.canvasContext.globalCompositeOperation = blendModeValue;
  14164. }
  14165. },
  14166. createRenderableComponents: function createRenderableComponents() {
  14167. this.maskManager = new CVMaskElement(this.data, this);
  14168. this.transformEffects = this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT);
  14169. },
  14170. hideElement: function hideElement() {
  14171. if (!this.hidden && (!this.isInRange || this.isTransparent)) {
  14172. this.hidden = true;
  14173. }
  14174. },
  14175. showElement: function showElement() {
  14176. if (this.isInRange && !this.isTransparent) {
  14177. this.hidden = false;
  14178. this._isFirstFrame = true;
  14179. this.maskManager._isFirstFrame = true;
  14180. }
  14181. },
  14182. clearCanvas: function clearCanvas(canvasContext) {
  14183. canvasContext.clearRect(this.transformCanvas.tx, this.transformCanvas.ty, this.transformCanvas.w * this.transformCanvas.sx, this.transformCanvas.h * this.transformCanvas.sy);
  14184. },
  14185. prepareLayer: function prepareLayer() {
  14186. if (this.data.tt >= 1) {
  14187. var buffer = this.buffers[0];
  14188. var bufferCtx = buffer.getContext('2d');
  14189. this.clearCanvas(bufferCtx); // on the first buffer we store the current state of the global drawing
  14190. bufferCtx.drawImage(this.canvasContext.canvas, 0, 0); // The next four lines are to clear the canvas
  14191. // TODO: Check if there is a way to clear the canvas without resetting the transform
  14192. this.currentTransform = this.canvasContext.getTransform();
  14193. this.canvasContext.setTransform(1, 0, 0, 1, 0, 0);
  14194. this.clearCanvas(this.canvasContext);
  14195. this.canvasContext.setTransform(this.currentTransform);
  14196. }
  14197. },
  14198. exitLayer: function exitLayer() {
  14199. if (this.data.tt >= 1) {
  14200. var buffer = this.buffers[1]; // On the second buffer we store the current state of the global drawing
  14201. // that only contains the content of this layer
  14202. // (if it is a composition, it also includes the nested layers)
  14203. var bufferCtx = buffer.getContext('2d');
  14204. this.clearCanvas(bufferCtx);
  14205. bufferCtx.drawImage(this.canvasContext.canvas, 0, 0); // We clear the canvas again
  14206. this.canvasContext.setTransform(1, 0, 0, 1, 0, 0);
  14207. this.clearCanvas(this.canvasContext);
  14208. this.canvasContext.setTransform(this.currentTransform); // We draw the mask
  14209. var mask = this.comp.getElementById('tp' in this.data ? this.data.tp : this.data.ind - 1);
  14210. mask.renderFrame(true); // We draw the second buffer (that contains the content of this layer)
  14211. this.canvasContext.setTransform(1, 0, 0, 1, 0, 0); // If the mask is a Luma matte, we need to do two extra painting operations
  14212. // the _isProxy check is to avoid drawing a fake canvas in workers that will throw an error
  14213. if (this.data.tt >= 3 && !document._isProxy) {
  14214. // We copy the painted mask to a buffer that has a color matrix filter applied to it
  14215. // that applies the rgb values to the alpha channel
  14216. var lumaBuffer = assetLoader.getLumaCanvas(this.canvasContext.canvas);
  14217. var lumaBufferCtx = lumaBuffer.getContext('2d');
  14218. lumaBufferCtx.drawImage(this.canvasContext.canvas, 0, 0);
  14219. this.clearCanvas(this.canvasContext); // we repaint the context with the mask applied to it
  14220. this.canvasContext.drawImage(lumaBuffer, 0, 0);
  14221. }
  14222. this.canvasContext.globalCompositeOperation = operationsMap[this.data.tt];
  14223. this.canvasContext.drawImage(buffer, 0, 0); // We finally draw the first buffer (that contains the content of the global drawing)
  14224. // We use destination-over to draw the global drawing below the current layer
  14225. this.canvasContext.globalCompositeOperation = 'destination-over';
  14226. this.canvasContext.drawImage(this.buffers[0], 0, 0);
  14227. this.canvasContext.setTransform(this.currentTransform); // We reset the globalCompositeOperation to source-over, the standard type of operation
  14228. this.canvasContext.globalCompositeOperation = 'source-over';
  14229. }
  14230. },
  14231. renderFrame: function renderFrame(forceRender) {
  14232. if (this.hidden || this.data.hd) {
  14233. return;
  14234. }
  14235. if (this.data.td === 1 && !forceRender) {
  14236. return;
  14237. }
  14238. this.renderTransform();
  14239. this.renderRenderable();
  14240. this.renderLocalTransform();
  14241. this.setBlendMode();
  14242. var forceRealStack = this.data.ty === 0;
  14243. this.prepareLayer();
  14244. this.globalData.renderer.save(forceRealStack);
  14245. this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props);
  14246. this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity);
  14247. this.renderInnerContent();
  14248. this.globalData.renderer.restore(forceRealStack);
  14249. this.exitLayer();
  14250. if (this.maskManager.hasMasks) {
  14251. this.globalData.renderer.restore(true);
  14252. }
  14253. if (this._isFirstFrame) {
  14254. this._isFirstFrame = false;
  14255. }
  14256. },
  14257. destroy: function destroy() {
  14258. this.canvasContext = null;
  14259. this.data = null;
  14260. this.globalData = null;
  14261. this.maskManager.destroy();
  14262. },
  14263. mHelper: new Matrix()
  14264. };
  14265. CVBaseElement.prototype.hide = CVBaseElement.prototype.hideElement;
  14266. CVBaseElement.prototype.show = CVBaseElement.prototype.showElement;
  14267. function CVShapeData(element, data, styles, transformsManager) {
  14268. this.styledShapes = [];
  14269. this.tr = [0, 0, 0, 0, 0, 0];
  14270. var ty = 4;
  14271. if (data.ty === 'rc') {
  14272. ty = 5;
  14273. } else if (data.ty === 'el') {
  14274. ty = 6;
  14275. } else if (data.ty === 'sr') {
  14276. ty = 7;
  14277. }
  14278. this.sh = ShapePropertyFactory.getShapeProp(element, data, ty, element);
  14279. var i;
  14280. var len = styles.length;
  14281. var styledShape;
  14282. for (i = 0; i < len; i += 1) {
  14283. if (!styles[i].closed) {
  14284. styledShape = {
  14285. transforms: transformsManager.addTransformSequence(styles[i].transforms),
  14286. trNodes: []
  14287. };
  14288. this.styledShapes.push(styledShape);
  14289. styles[i].elements.push(styledShape);
  14290. }
  14291. }
  14292. }
  14293. CVShapeData.prototype.setAsAnimated = SVGShapeData.prototype.setAsAnimated;
  14294. function CVShapeElement(data, globalData, comp) {
  14295. this.shapes = [];
  14296. this.shapesData = data.shapes;
  14297. this.stylesList = [];
  14298. this.itemsData = [];
  14299. this.prevViewData = [];
  14300. this.shapeModifiers = [];
  14301. this.processedElements = [];
  14302. this.transformsManager = new ShapeTransformManager();
  14303. this.initElement(data, globalData, comp);
  14304. }
  14305. extendPrototype([BaseElement, TransformElement, CVBaseElement, IShapeElement, HierarchyElement, FrameElement, RenderableElement], CVShapeElement);
  14306. CVShapeElement.prototype.initElement = RenderableDOMElement.prototype.initElement;
  14307. CVShapeElement.prototype.transformHelper = {
  14308. opacity: 1,
  14309. _opMdf: false
  14310. };
  14311. CVShapeElement.prototype.dashResetter = [];
  14312. CVShapeElement.prototype.createContent = function () {
  14313. this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, true, []);
  14314. };
  14315. CVShapeElement.prototype.createStyleElement = function (data, transforms) {
  14316. var styleElem = {
  14317. data: data,
  14318. type: data.ty,
  14319. preTransforms: this.transformsManager.addTransformSequence(transforms),
  14320. transforms: [],
  14321. elements: [],
  14322. closed: data.hd === true
  14323. };
  14324. var elementData = {};
  14325. if (data.ty === 'fl' || data.ty === 'st') {
  14326. elementData.c = PropertyFactory.getProp(this, data.c, 1, 255, this);
  14327. if (!elementData.c.k) {
  14328. styleElem.co = 'rgb(' + bmFloor(elementData.c.v[0]) + ',' + bmFloor(elementData.c.v[1]) + ',' + bmFloor(elementData.c.v[2]) + ')';
  14329. }
  14330. } else if (data.ty === 'gf' || data.ty === 'gs') {
  14331. elementData.s = PropertyFactory.getProp(this, data.s, 1, null, this);
  14332. elementData.e = PropertyFactory.getProp(this, data.e, 1, null, this);
  14333. elementData.h = PropertyFactory.getProp(this, data.h || {
  14334. k: 0
  14335. }, 0, 0.01, this);
  14336. elementData.a = PropertyFactory.getProp(this, data.a || {
  14337. k: 0
  14338. }, 0, degToRads, this);
  14339. elementData.g = new GradientProperty(this, data.g, this);
  14340. }
  14341. elementData.o = PropertyFactory.getProp(this, data.o, 0, 0.01, this);
  14342. if (data.ty === 'st' || data.ty === 'gs') {
  14343. styleElem.lc = lineCapEnum[data.lc || 2];
  14344. styleElem.lj = lineJoinEnum[data.lj || 2];
  14345. if (data.lj == 1) {
  14346. // eslint-disable-line eqeqeq
  14347. styleElem.ml = data.ml;
  14348. }
  14349. elementData.w = PropertyFactory.getProp(this, data.w, 0, null, this);
  14350. if (!elementData.w.k) {
  14351. styleElem.wi = elementData.w.v;
  14352. }
  14353. if (data.d) {
  14354. var d = new DashProperty(this, data.d, 'canvas', this);
  14355. elementData.d = d;
  14356. if (!elementData.d.k) {
  14357. styleElem.da = elementData.d.dashArray;
  14358. styleElem["do"] = elementData.d.dashoffset[0];
  14359. }
  14360. }
  14361. } else {
  14362. styleElem.r = data.r === 2 ? 'evenodd' : 'nonzero';
  14363. }
  14364. this.stylesList.push(styleElem);
  14365. elementData.style = styleElem;
  14366. return elementData;
  14367. };
  14368. CVShapeElement.prototype.createGroupElement = function () {
  14369. var elementData = {
  14370. it: [],
  14371. prevViewData: []
  14372. };
  14373. return elementData;
  14374. };
  14375. CVShapeElement.prototype.createTransformElement = function (data) {
  14376. var elementData = {
  14377. transform: {
  14378. opacity: 1,
  14379. _opMdf: false,
  14380. key: this.transformsManager.getNewKey(),
  14381. op: PropertyFactory.getProp(this, data.o, 0, 0.01, this),
  14382. mProps: TransformPropertyFactory.getTransformProperty(this, data, this)
  14383. }
  14384. };
  14385. return elementData;
  14386. };
  14387. CVShapeElement.prototype.createShapeElement = function (data) {
  14388. var elementData = new CVShapeData(this, data, this.stylesList, this.transformsManager);
  14389. this.shapes.push(elementData);
  14390. this.addShapeToModifiers(elementData);
  14391. return elementData;
  14392. };
  14393. CVShapeElement.prototype.reloadShapes = function () {
  14394. this._isFirstFrame = true;
  14395. var i;
  14396. var len = this.itemsData.length;
  14397. for (i = 0; i < len; i += 1) {
  14398. this.prevViewData[i] = this.itemsData[i];
  14399. }
  14400. this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, true, []);
  14401. len = this.dynamicProperties.length;
  14402. for (i = 0; i < len; i += 1) {
  14403. this.dynamicProperties[i].getValue();
  14404. }
  14405. this.renderModifiers();
  14406. this.transformsManager.processSequences(this._isFirstFrame);
  14407. };
  14408. CVShapeElement.prototype.addTransformToStyleList = function (transform) {
  14409. var i;
  14410. var len = this.stylesList.length;
  14411. for (i = 0; i < len; i += 1) {
  14412. if (!this.stylesList[i].closed) {
  14413. this.stylesList[i].transforms.push(transform);
  14414. }
  14415. }
  14416. };
  14417. CVShapeElement.prototype.removeTransformFromStyleList = function () {
  14418. var i;
  14419. var len = this.stylesList.length;
  14420. for (i = 0; i < len; i += 1) {
  14421. if (!this.stylesList[i].closed) {
  14422. this.stylesList[i].transforms.pop();
  14423. }
  14424. }
  14425. };
  14426. CVShapeElement.prototype.closeStyles = function (styles) {
  14427. var i;
  14428. var len = styles.length;
  14429. for (i = 0; i < len; i += 1) {
  14430. styles[i].closed = true;
  14431. }
  14432. };
  14433. CVShapeElement.prototype.searchShapes = function (arr, itemsData, prevViewData, shouldRender, transforms) {
  14434. var i;
  14435. var len = arr.length - 1;
  14436. var j;
  14437. var jLen;
  14438. var ownStyles = [];
  14439. var ownModifiers = [];
  14440. var processedPos;
  14441. var modifier;
  14442. var currentTransform;
  14443. var ownTransforms = [].concat(transforms);
  14444. for (i = len; i >= 0; i -= 1) {
  14445. processedPos = this.searchProcessedElement(arr[i]);
  14446. if (!processedPos) {
  14447. arr[i]._shouldRender = shouldRender;
  14448. } else {
  14449. itemsData[i] = prevViewData[processedPos - 1];
  14450. }
  14451. if (arr[i].ty === 'fl' || arr[i].ty === 'st' || arr[i].ty === 'gf' || arr[i].ty === 'gs') {
  14452. if (!processedPos) {
  14453. itemsData[i] = this.createStyleElement(arr[i], ownTransforms);
  14454. } else {
  14455. itemsData[i].style.closed = false;
  14456. }
  14457. ownStyles.push(itemsData[i].style);
  14458. } else if (arr[i].ty === 'gr') {
  14459. if (!processedPos) {
  14460. itemsData[i] = this.createGroupElement(arr[i]);
  14461. } else {
  14462. jLen = itemsData[i].it.length;
  14463. for (j = 0; j < jLen; j += 1) {
  14464. itemsData[i].prevViewData[j] = itemsData[i].it[j];
  14465. }
  14466. }
  14467. this.searchShapes(arr[i].it, itemsData[i].it, itemsData[i].prevViewData, shouldRender, ownTransforms);
  14468. } else if (arr[i].ty === 'tr') {
  14469. if (!processedPos) {
  14470. currentTransform = this.createTransformElement(arr[i]);
  14471. itemsData[i] = currentTransform;
  14472. }
  14473. ownTransforms.push(itemsData[i]);
  14474. this.addTransformToStyleList(itemsData[i]);
  14475. } else if (arr[i].ty === 'sh' || arr[i].ty === 'rc' || arr[i].ty === 'el' || arr[i].ty === 'sr') {
  14476. if (!processedPos) {
  14477. itemsData[i] = this.createShapeElement(arr[i]);
  14478. }
  14479. } else if (arr[i].ty === 'tm' || arr[i].ty === 'rd' || arr[i].ty === 'pb' || arr[i].ty === 'zz' || arr[i].ty === 'op') {
  14480. if (!processedPos) {
  14481. modifier = ShapeModifiers.getModifier(arr[i].ty);
  14482. modifier.init(this, arr[i]);
  14483. itemsData[i] = modifier;
  14484. this.shapeModifiers.push(modifier);
  14485. } else {
  14486. modifier = itemsData[i];
  14487. modifier.closed = false;
  14488. }
  14489. ownModifiers.push(modifier);
  14490. } else if (arr[i].ty === 'rp') {
  14491. if (!processedPos) {
  14492. modifier = ShapeModifiers.getModifier(arr[i].ty);
  14493. itemsData[i] = modifier;
  14494. modifier.init(this, arr, i, itemsData);
  14495. this.shapeModifiers.push(modifier);
  14496. shouldRender = false;
  14497. } else {
  14498. modifier = itemsData[i];
  14499. modifier.closed = true;
  14500. }
  14501. ownModifiers.push(modifier);
  14502. }
  14503. this.addProcessedElement(arr[i], i + 1);
  14504. }
  14505. this.removeTransformFromStyleList();
  14506. this.closeStyles(ownStyles);
  14507. len = ownModifiers.length;
  14508. for (i = 0; i < len; i += 1) {
  14509. ownModifiers[i].closed = true;
  14510. }
  14511. };
  14512. CVShapeElement.prototype.renderInnerContent = function () {
  14513. this.transformHelper.opacity = 1;
  14514. this.transformHelper._opMdf = false;
  14515. this.renderModifiers();
  14516. this.transformsManager.processSequences(this._isFirstFrame);
  14517. this.renderShape(this.transformHelper, this.shapesData, this.itemsData, true);
  14518. };
  14519. CVShapeElement.prototype.renderShapeTransform = function (parentTransform, groupTransform) {
  14520. if (parentTransform._opMdf || groupTransform.op._mdf || this._isFirstFrame) {
  14521. groupTransform.opacity = parentTransform.opacity;
  14522. groupTransform.opacity *= groupTransform.op.v;
  14523. groupTransform._opMdf = true;
  14524. }
  14525. };
  14526. CVShapeElement.prototype.drawLayer = function () {
  14527. var i;
  14528. var len = this.stylesList.length;
  14529. var j;
  14530. var jLen;
  14531. var k;
  14532. var kLen;
  14533. var elems;
  14534. var nodes;
  14535. var renderer = this.globalData.renderer;
  14536. var ctx = this.globalData.canvasContext;
  14537. var type;
  14538. var currentStyle;
  14539. for (i = 0; i < len; i += 1) {
  14540. currentStyle = this.stylesList[i];
  14541. type = currentStyle.type; // Skipping style when
  14542. // Stroke width equals 0
  14543. // style should not be rendered (extra unused repeaters)
  14544. // current opacity equals 0
  14545. // global opacity equals 0
  14546. if (!((type === 'st' || type === 'gs') && currentStyle.wi === 0 || !currentStyle.data._shouldRender || currentStyle.coOp === 0 || this.globalData.currentGlobalAlpha === 0)) {
  14547. renderer.save();
  14548. elems = currentStyle.elements;
  14549. if (type === 'st' || type === 'gs') {
  14550. renderer.ctxStrokeStyle(type === 'st' ? currentStyle.co : currentStyle.grd); // ctx.strokeStyle = type === 'st' ? currentStyle.co : currentStyle.grd;
  14551. renderer.ctxLineWidth(currentStyle.wi); // ctx.lineWidth = currentStyle.wi;
  14552. renderer.ctxLineCap(currentStyle.lc); // ctx.lineCap = currentStyle.lc;
  14553. renderer.ctxLineJoin(currentStyle.lj); // ctx.lineJoin = currentStyle.lj;
  14554. renderer.ctxMiterLimit(currentStyle.ml || 0); // ctx.miterLimit = currentStyle.ml || 0;
  14555. } else {
  14556. renderer.ctxFillStyle(type === 'fl' ? currentStyle.co : currentStyle.grd); // ctx.fillStyle = type === 'fl' ? currentStyle.co : currentStyle.grd;
  14557. }
  14558. renderer.ctxOpacity(currentStyle.coOp);
  14559. if (type !== 'st' && type !== 'gs') {
  14560. ctx.beginPath();
  14561. }
  14562. renderer.ctxTransform(currentStyle.preTransforms.finalTransform.props);
  14563. jLen = elems.length;
  14564. for (j = 0; j < jLen; j += 1) {
  14565. if (type === 'st' || type === 'gs') {
  14566. ctx.beginPath();
  14567. if (currentStyle.da) {
  14568. ctx.setLineDash(currentStyle.da);
  14569. ctx.lineDashOffset = currentStyle["do"];
  14570. }
  14571. }
  14572. nodes = elems[j].trNodes;
  14573. kLen = nodes.length;
  14574. for (k = 0; k < kLen; k += 1) {
  14575. if (nodes[k].t === 'm') {
  14576. ctx.moveTo(nodes[k].p[0], nodes[k].p[1]);
  14577. } else if (nodes[k].t === 'c') {
  14578. ctx.bezierCurveTo(nodes[k].pts[0], nodes[k].pts[1], nodes[k].pts[2], nodes[k].pts[3], nodes[k].pts[4], nodes[k].pts[5]);
  14579. } else {
  14580. ctx.closePath();
  14581. }
  14582. }
  14583. if (type === 'st' || type === 'gs') {
  14584. // ctx.stroke();
  14585. renderer.ctxStroke();
  14586. if (currentStyle.da) {
  14587. ctx.setLineDash(this.dashResetter);
  14588. }
  14589. }
  14590. }
  14591. if (type !== 'st' && type !== 'gs') {
  14592. // ctx.fill(currentStyle.r);
  14593. this.globalData.renderer.ctxFill(currentStyle.r);
  14594. }
  14595. renderer.restore();
  14596. }
  14597. }
  14598. };
  14599. CVShapeElement.prototype.renderShape = function (parentTransform, items, data, isMain) {
  14600. var i;
  14601. var len = items.length - 1;
  14602. var groupTransform;
  14603. groupTransform = parentTransform;
  14604. for (i = len; i >= 0; i -= 1) {
  14605. if (items[i].ty === 'tr') {
  14606. groupTransform = data[i].transform;
  14607. this.renderShapeTransform(parentTransform, groupTransform);
  14608. } else if (items[i].ty === 'sh' || items[i].ty === 'el' || items[i].ty === 'rc' || items[i].ty === 'sr') {
  14609. this.renderPath(items[i], data[i]);
  14610. } else if (items[i].ty === 'fl') {
  14611. this.renderFill(items[i], data[i], groupTransform);
  14612. } else if (items[i].ty === 'st') {
  14613. this.renderStroke(items[i], data[i], groupTransform);
  14614. } else if (items[i].ty === 'gf' || items[i].ty === 'gs') {
  14615. this.renderGradientFill(items[i], data[i], groupTransform);
  14616. } else if (items[i].ty === 'gr') {
  14617. this.renderShape(groupTransform, items[i].it, data[i].it);
  14618. } else if (items[i].ty === 'tm') {//
  14619. }
  14620. }
  14621. if (isMain) {
  14622. this.drawLayer();
  14623. }
  14624. };
  14625. CVShapeElement.prototype.renderStyledShape = function (styledShape, shape) {
  14626. if (this._isFirstFrame || shape._mdf || styledShape.transforms._mdf) {
  14627. var shapeNodes = styledShape.trNodes;
  14628. var paths = shape.paths;
  14629. var i;
  14630. var len;
  14631. var j;
  14632. var jLen = paths._length;
  14633. shapeNodes.length = 0;
  14634. var groupTransformMat = styledShape.transforms.finalTransform;
  14635. for (j = 0; j < jLen; j += 1) {
  14636. var pathNodes = paths.shapes[j];
  14637. if (pathNodes && pathNodes.v) {
  14638. len = pathNodes._length;
  14639. for (i = 1; i < len; i += 1) {
  14640. if (i === 1) {
  14641. shapeNodes.push({
  14642. t: 'm',
  14643. p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0)
  14644. });
  14645. }
  14646. shapeNodes.push({
  14647. t: 'c',
  14648. pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[i], pathNodes.v[i])
  14649. });
  14650. }
  14651. if (len === 1) {
  14652. shapeNodes.push({
  14653. t: 'm',
  14654. p: groupTransformMat.applyToPointArray(pathNodes.v[0][0], pathNodes.v[0][1], 0)
  14655. });
  14656. }
  14657. if (pathNodes.c && len) {
  14658. shapeNodes.push({
  14659. t: 'c',
  14660. pts: groupTransformMat.applyToTriplePoints(pathNodes.o[i - 1], pathNodes.i[0], pathNodes.v[0])
  14661. });
  14662. shapeNodes.push({
  14663. t: 'z'
  14664. });
  14665. }
  14666. }
  14667. }
  14668. styledShape.trNodes = shapeNodes;
  14669. }
  14670. };
  14671. CVShapeElement.prototype.renderPath = function (pathData, itemData) {
  14672. if (pathData.hd !== true && pathData._shouldRender) {
  14673. var i;
  14674. var len = itemData.styledShapes.length;
  14675. for (i = 0; i < len; i += 1) {
  14676. this.renderStyledShape(itemData.styledShapes[i], itemData.sh);
  14677. }
  14678. }
  14679. };
  14680. CVShapeElement.prototype.renderFill = function (styleData, itemData, groupTransform) {
  14681. var styleElem = itemData.style;
  14682. if (itemData.c._mdf || this._isFirstFrame) {
  14683. styleElem.co = 'rgb(' + bmFloor(itemData.c.v[0]) + ',' + bmFloor(itemData.c.v[1]) + ',' + bmFloor(itemData.c.v[2]) + ')';
  14684. }
  14685. if (itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame) {
  14686. styleElem.coOp = itemData.o.v * groupTransform.opacity;
  14687. }
  14688. };
  14689. CVShapeElement.prototype.renderGradientFill = function (styleData, itemData, groupTransform) {
  14690. var styleElem = itemData.style;
  14691. var grd;
  14692. if (!styleElem.grd || itemData.g._mdf || itemData.s._mdf || itemData.e._mdf || styleData.t !== 1 && (itemData.h._mdf || itemData.a._mdf)) {
  14693. var ctx = this.globalData.canvasContext;
  14694. var pt1 = itemData.s.v;
  14695. var pt2 = itemData.e.v;
  14696. if (styleData.t === 1) {
  14697. grd = ctx.createLinearGradient(pt1[0], pt1[1], pt2[0], pt2[1]);
  14698. } else {
  14699. var rad = Math.sqrt(Math.pow(pt1[0] - pt2[0], 2) + Math.pow(pt1[1] - pt2[1], 2));
  14700. var ang = Math.atan2(pt2[1] - pt1[1], pt2[0] - pt1[0]);
  14701. var percent = itemData.h.v;
  14702. if (percent >= 1) {
  14703. percent = 0.99;
  14704. } else if (percent <= -1) {
  14705. percent = -0.99;
  14706. }
  14707. var dist = rad * percent;
  14708. var x = Math.cos(ang + itemData.a.v) * dist + pt1[0];
  14709. var y = Math.sin(ang + itemData.a.v) * dist + pt1[1];
  14710. grd = ctx.createRadialGradient(x, y, 0, pt1[0], pt1[1], rad);
  14711. }
  14712. var i;
  14713. var len = styleData.g.p;
  14714. var cValues = itemData.g.c;
  14715. var opacity = 1;
  14716. for (i = 0; i < len; i += 1) {
  14717. if (itemData.g._hasOpacity && itemData.g._collapsable) {
  14718. opacity = itemData.g.o[i * 2 + 1];
  14719. }
  14720. grd.addColorStop(cValues[i * 4] / 100, 'rgba(' + cValues[i * 4 + 1] + ',' + cValues[i * 4 + 2] + ',' + cValues[i * 4 + 3] + ',' + opacity + ')');
  14721. }
  14722. styleElem.grd = grd;
  14723. }
  14724. styleElem.coOp = itemData.o.v * groupTransform.opacity;
  14725. };
  14726. CVShapeElement.prototype.renderStroke = function (styleData, itemData, groupTransform) {
  14727. var styleElem = itemData.style;
  14728. var d = itemData.d;
  14729. if (d && (d._mdf || this._isFirstFrame)) {
  14730. styleElem.da = d.dashArray;
  14731. styleElem["do"] = d.dashoffset[0];
  14732. }
  14733. if (itemData.c._mdf || this._isFirstFrame) {
  14734. styleElem.co = 'rgb(' + bmFloor(itemData.c.v[0]) + ',' + bmFloor(itemData.c.v[1]) + ',' + bmFloor(itemData.c.v[2]) + ')';
  14735. }
  14736. if (itemData.o._mdf || groupTransform._opMdf || this._isFirstFrame) {
  14737. styleElem.coOp = itemData.o.v * groupTransform.opacity;
  14738. }
  14739. if (itemData.w._mdf || this._isFirstFrame) {
  14740. styleElem.wi = itemData.w.v;
  14741. }
  14742. };
  14743. CVShapeElement.prototype.destroy = function () {
  14744. this.shapesData = null;
  14745. this.globalData = null;
  14746. this.canvasContext = null;
  14747. this.stylesList.length = 0;
  14748. this.itemsData.length = 0;
  14749. };
  14750. function CVTextElement(data, globalData, comp) {
  14751. this.textSpans = [];
  14752. this.yOffset = 0;
  14753. this.fillColorAnim = false;
  14754. this.strokeColorAnim = false;
  14755. this.strokeWidthAnim = false;
  14756. this.stroke = false;
  14757. this.fill = false;
  14758. this.justifyOffset = 0;
  14759. this.currentRender = null;
  14760. this.renderType = 'canvas';
  14761. this.values = {
  14762. fill: 'rgba(0,0,0,0)',
  14763. stroke: 'rgba(0,0,0,0)',
  14764. sWidth: 0,
  14765. fValue: ''
  14766. };
  14767. this.initElement(data, globalData, comp);
  14768. }
  14769. extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement, ITextElement], CVTextElement);
  14770. CVTextElement.prototype.tHelper = createTag('canvas').getContext('2d');
  14771. CVTextElement.prototype.buildNewText = function () {
  14772. var documentData = this.textProperty.currentData;
  14773. this.renderedLetters = createSizedArray(documentData.l ? documentData.l.length : 0);
  14774. var hasFill = false;
  14775. if (documentData.fc) {
  14776. hasFill = true;
  14777. this.values.fill = this.buildColor(documentData.fc);
  14778. } else {
  14779. this.values.fill = 'rgba(0,0,0,0)';
  14780. }
  14781. this.fill = hasFill;
  14782. var hasStroke = false;
  14783. if (documentData.sc) {
  14784. hasStroke = true;
  14785. this.values.stroke = this.buildColor(documentData.sc);
  14786. this.values.sWidth = documentData.sw;
  14787. }
  14788. var fontData = this.globalData.fontManager.getFontByName(documentData.f);
  14789. var i;
  14790. var len;
  14791. var letters = documentData.l;
  14792. var matrixHelper = this.mHelper;
  14793. this.stroke = hasStroke;
  14794. this.values.fValue = documentData.finalSize + 'px ' + this.globalData.fontManager.getFontByName(documentData.f).fFamily;
  14795. len = documentData.finalText.length; // this.tHelper.font = this.values.fValue;
  14796. var charData;
  14797. var shapeData;
  14798. var k;
  14799. var kLen;
  14800. var shapes;
  14801. var j;
  14802. var jLen;
  14803. var pathNodes;
  14804. var commands;
  14805. var pathArr;
  14806. var singleShape = this.data.singleShape;
  14807. var trackingOffset = documentData.tr * 0.001 * documentData.finalSize;
  14808. var xPos = 0;
  14809. var yPos = 0;
  14810. var firstLine = true;
  14811. var cnt = 0;
  14812. for (i = 0; i < len; i += 1) {
  14813. charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
  14814. shapeData = charData && charData.data || {};
  14815. matrixHelper.reset();
  14816. if (singleShape && letters[i].n) {
  14817. xPos = -trackingOffset;
  14818. yPos += documentData.yOffset;
  14819. yPos += firstLine ? 1 : 0;
  14820. firstLine = false;
  14821. }
  14822. shapes = shapeData.shapes ? shapeData.shapes[0].it : [];
  14823. jLen = shapes.length;
  14824. matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100);
  14825. if (singleShape) {
  14826. this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos);
  14827. }
  14828. commands = createSizedArray(jLen - 1);
  14829. var commandsCounter = 0;
  14830. for (j = 0; j < jLen; j += 1) {
  14831. if (shapes[j].ty === 'sh') {
  14832. kLen = shapes[j].ks.k.i.length;
  14833. pathNodes = shapes[j].ks.k;
  14834. pathArr = [];
  14835. for (k = 1; k < kLen; k += 1) {
  14836. if (k === 1) {
  14837. pathArr.push(matrixHelper.applyToX(pathNodes.v[0][0], pathNodes.v[0][1], 0), matrixHelper.applyToY(pathNodes.v[0][0], pathNodes.v[0][1], 0));
  14838. }
  14839. pathArr.push(matrixHelper.applyToX(pathNodes.o[k - 1][0], pathNodes.o[k - 1][1], 0), matrixHelper.applyToY(pathNodes.o[k - 1][0], pathNodes.o[k - 1][1], 0), matrixHelper.applyToX(pathNodes.i[k][0], pathNodes.i[k][1], 0), matrixHelper.applyToY(pathNodes.i[k][0], pathNodes.i[k][1], 0), matrixHelper.applyToX(pathNodes.v[k][0], pathNodes.v[k][1], 0), matrixHelper.applyToY(pathNodes.v[k][0], pathNodes.v[k][1], 0));
  14840. }
  14841. pathArr.push(matrixHelper.applyToX(pathNodes.o[k - 1][0], pathNodes.o[k - 1][1], 0), matrixHelper.applyToY(pathNodes.o[k - 1][0], pathNodes.o[k - 1][1], 0), matrixHelper.applyToX(pathNodes.i[0][0], pathNodes.i[0][1], 0), matrixHelper.applyToY(pathNodes.i[0][0], pathNodes.i[0][1], 0), matrixHelper.applyToX(pathNodes.v[0][0], pathNodes.v[0][1], 0), matrixHelper.applyToY(pathNodes.v[0][0], pathNodes.v[0][1], 0));
  14842. commands[commandsCounter] = pathArr;
  14843. commandsCounter += 1;
  14844. }
  14845. }
  14846. if (singleShape) {
  14847. xPos += letters[i].l;
  14848. xPos += trackingOffset;
  14849. }
  14850. if (this.textSpans[cnt]) {
  14851. this.textSpans[cnt].elem = commands;
  14852. } else {
  14853. this.textSpans[cnt] = {
  14854. elem: commands
  14855. };
  14856. }
  14857. cnt += 1;
  14858. }
  14859. };
  14860. CVTextElement.prototype.renderInnerContent = function () {
  14861. this.validateText();
  14862. var ctx = this.canvasContext;
  14863. ctx.font = this.values.fValue;
  14864. this.globalData.renderer.ctxLineCap('butt'); // ctx.lineCap = 'butt';
  14865. this.globalData.renderer.ctxLineJoin('miter'); // ctx.lineJoin = 'miter';
  14866. this.globalData.renderer.ctxMiterLimit(4); // ctx.miterLimit = 4;
  14867. if (!this.data.singleShape) {
  14868. this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
  14869. }
  14870. var i;
  14871. var len;
  14872. var j;
  14873. var jLen;
  14874. var k;
  14875. var kLen;
  14876. var renderedLetters = this.textAnimator.renderedLetters;
  14877. var letters = this.textProperty.currentData.l;
  14878. len = letters.length;
  14879. var renderedLetter;
  14880. var lastFill = null;
  14881. var lastStroke = null;
  14882. var lastStrokeW = null;
  14883. var commands;
  14884. var pathArr;
  14885. var renderer = this.globalData.renderer;
  14886. for (i = 0; i < len; i += 1) {
  14887. if (!letters[i].n) {
  14888. renderedLetter = renderedLetters[i];
  14889. if (renderedLetter) {
  14890. renderer.save();
  14891. renderer.ctxTransform(renderedLetter.p);
  14892. renderer.ctxOpacity(renderedLetter.o);
  14893. }
  14894. if (this.fill) {
  14895. if (renderedLetter && renderedLetter.fc) {
  14896. if (lastFill !== renderedLetter.fc) {
  14897. renderer.ctxFillStyle(renderedLetter.fc);
  14898. lastFill = renderedLetter.fc; // ctx.fillStyle = renderedLetter.fc;
  14899. }
  14900. } else if (lastFill !== this.values.fill) {
  14901. lastFill = this.values.fill;
  14902. renderer.ctxFillStyle(this.values.fill); // ctx.fillStyle = this.values.fill;
  14903. }
  14904. commands = this.textSpans[i].elem;
  14905. jLen = commands.length;
  14906. this.globalData.canvasContext.beginPath();
  14907. for (j = 0; j < jLen; j += 1) {
  14908. pathArr = commands[j];
  14909. kLen = pathArr.length;
  14910. this.globalData.canvasContext.moveTo(pathArr[0], pathArr[1]);
  14911. for (k = 2; k < kLen; k += 6) {
  14912. this.globalData.canvasContext.bezierCurveTo(pathArr[k], pathArr[k + 1], pathArr[k + 2], pathArr[k + 3], pathArr[k + 4], pathArr[k + 5]);
  14913. }
  14914. }
  14915. this.globalData.canvasContext.closePath();
  14916. renderer.ctxFill(); // this.globalData.canvasContext.fill();
  14917. /// ctx.fillText(this.textSpans[i].val,0,0);
  14918. }
  14919. if (this.stroke) {
  14920. if (renderedLetter && renderedLetter.sw) {
  14921. if (lastStrokeW !== renderedLetter.sw) {
  14922. lastStrokeW = renderedLetter.sw;
  14923. renderer.ctxLineWidth(renderedLetter.sw); // ctx.lineWidth = renderedLetter.sw;
  14924. }
  14925. } else if (lastStrokeW !== this.values.sWidth) {
  14926. lastStrokeW = this.values.sWidth;
  14927. renderer.ctxLineWidth(this.values.sWidth); // ctx.lineWidth = this.values.sWidth;
  14928. }
  14929. if (renderedLetter && renderedLetter.sc) {
  14930. if (lastStroke !== renderedLetter.sc) {
  14931. lastStroke = renderedLetter.sc;
  14932. renderer.ctxStrokeStyle(renderedLetter.sc); // ctx.strokeStyle = renderedLetter.sc;
  14933. }
  14934. } else if (lastStroke !== this.values.stroke) {
  14935. lastStroke = this.values.stroke;
  14936. renderer.ctxStrokeStyle(this.values.stroke); // ctx.strokeStyle = this.values.stroke;
  14937. }
  14938. commands = this.textSpans[i].elem;
  14939. jLen = commands.length;
  14940. this.globalData.canvasContext.beginPath();
  14941. for (j = 0; j < jLen; j += 1) {
  14942. pathArr = commands[j];
  14943. kLen = pathArr.length;
  14944. this.globalData.canvasContext.moveTo(pathArr[0], pathArr[1]);
  14945. for (k = 2; k < kLen; k += 6) {
  14946. this.globalData.canvasContext.bezierCurveTo(pathArr[k], pathArr[k + 1], pathArr[k + 2], pathArr[k + 3], pathArr[k + 4], pathArr[k + 5]);
  14947. }
  14948. }
  14949. this.globalData.canvasContext.closePath();
  14950. renderer.ctxStroke(); // this.globalData.canvasContext.stroke();
  14951. /// ctx.strokeText(letters[i].val,0,0);
  14952. }
  14953. if (renderedLetter) {
  14954. this.globalData.renderer.restore();
  14955. }
  14956. }
  14957. }
  14958. };
  14959. function CVImageElement(data, globalData, comp) {
  14960. this.assetData = globalData.getAssetData(data.refId);
  14961. this.img = globalData.imageLoader.getAsset(this.assetData);
  14962. this.initElement(data, globalData, comp);
  14963. }
  14964. extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement], CVImageElement);
  14965. CVImageElement.prototype.initElement = SVGShapeElement.prototype.initElement;
  14966. CVImageElement.prototype.prepareFrame = IImageElement.prototype.prepareFrame;
  14967. CVImageElement.prototype.createContent = function () {
  14968. if (this.img.width && (this.assetData.w !== this.img.width || this.assetData.h !== this.img.height)) {
  14969. var canvas = createTag('canvas');
  14970. canvas.width = this.assetData.w;
  14971. canvas.height = this.assetData.h;
  14972. var ctx = canvas.getContext('2d');
  14973. var imgW = this.img.width;
  14974. var imgH = this.img.height;
  14975. var imgRel = imgW / imgH;
  14976. var canvasRel = this.assetData.w / this.assetData.h;
  14977. var widthCrop;
  14978. var heightCrop;
  14979. var par = this.assetData.pr || this.globalData.renderConfig.imagePreserveAspectRatio;
  14980. if (imgRel > canvasRel && par === 'xMidYMid slice' || imgRel < canvasRel && par !== 'xMidYMid slice') {
  14981. heightCrop = imgH;
  14982. widthCrop = heightCrop * canvasRel;
  14983. } else {
  14984. widthCrop = imgW;
  14985. heightCrop = widthCrop / canvasRel;
  14986. }
  14987. ctx.drawImage(this.img, (imgW - widthCrop) / 2, (imgH - heightCrop) / 2, widthCrop, heightCrop, 0, 0, this.assetData.w, this.assetData.h);
  14988. this.img = canvas;
  14989. }
  14990. };
  14991. CVImageElement.prototype.renderInnerContent = function () {
  14992. this.canvasContext.drawImage(this.img, 0, 0);
  14993. };
  14994. CVImageElement.prototype.destroy = function () {
  14995. this.img = null;
  14996. };
  14997. function CVSolidElement(data, globalData, comp) {
  14998. this.initElement(data, globalData, comp);
  14999. }
  15000. extendPrototype([BaseElement, TransformElement, CVBaseElement, HierarchyElement, FrameElement, RenderableElement], CVSolidElement);
  15001. CVSolidElement.prototype.initElement = SVGShapeElement.prototype.initElement;
  15002. CVSolidElement.prototype.prepareFrame = IImageElement.prototype.prepareFrame;
  15003. CVSolidElement.prototype.renderInnerContent = function () {
  15004. // var ctx = this.canvasContext;
  15005. this.globalData.renderer.ctxFillStyle(this.data.sc); // ctx.fillStyle = this.data.sc;
  15006. this.globalData.renderer.ctxFillRect(0, 0, this.data.sw, this.data.sh); // ctx.fillRect(0, 0, this.data.sw, this.data.sh);
  15007. //
  15008. };
  15009. function CanvasRendererBase() {}
  15010. extendPrototype([BaseRenderer], CanvasRendererBase);
  15011. CanvasRendererBase.prototype.createShape = function (data) {
  15012. return new CVShapeElement(data, this.globalData, this);
  15013. };
  15014. CanvasRendererBase.prototype.createText = function (data) {
  15015. return new CVTextElement(data, this.globalData, this);
  15016. };
  15017. CanvasRendererBase.prototype.createImage = function (data) {
  15018. return new CVImageElement(data, this.globalData, this);
  15019. };
  15020. CanvasRendererBase.prototype.createSolid = function (data) {
  15021. return new CVSolidElement(data, this.globalData, this);
  15022. };
  15023. CanvasRendererBase.prototype.createNull = SVGRenderer.prototype.createNull;
  15024. CanvasRendererBase.prototype.ctxTransform = function (props) {
  15025. if (props[0] === 1 && props[1] === 0 && props[4] === 0 && props[5] === 1 && props[12] === 0 && props[13] === 0) {
  15026. return;
  15027. }
  15028. this.canvasContext.transform(props[0], props[1], props[4], props[5], props[12], props[13]);
  15029. };
  15030. CanvasRendererBase.prototype.ctxOpacity = function (op) {
  15031. this.canvasContext.globalAlpha *= op < 0 ? 0 : op;
  15032. };
  15033. CanvasRendererBase.prototype.ctxFillStyle = function (value) {
  15034. this.canvasContext.fillStyle = value;
  15035. };
  15036. CanvasRendererBase.prototype.ctxStrokeStyle = function (value) {
  15037. this.canvasContext.strokeStyle = value;
  15038. };
  15039. CanvasRendererBase.prototype.ctxLineWidth = function (value) {
  15040. this.canvasContext.lineWidth = value;
  15041. };
  15042. CanvasRendererBase.prototype.ctxLineCap = function (value) {
  15043. this.canvasContext.lineCap = value;
  15044. };
  15045. CanvasRendererBase.prototype.ctxLineJoin = function (value) {
  15046. this.canvasContext.lineJoin = value;
  15047. };
  15048. CanvasRendererBase.prototype.ctxMiterLimit = function (value) {
  15049. this.canvasContext.miterLimit = value;
  15050. };
  15051. CanvasRendererBase.prototype.ctxFill = function (rule) {
  15052. this.canvasContext.fill(rule);
  15053. };
  15054. CanvasRendererBase.prototype.ctxFillRect = function (x, y, w, h) {
  15055. this.canvasContext.fillRect(x, y, w, h);
  15056. };
  15057. CanvasRendererBase.prototype.ctxStroke = function () {
  15058. this.canvasContext.stroke();
  15059. };
  15060. CanvasRendererBase.prototype.reset = function () {
  15061. if (!this.renderConfig.clearCanvas) {
  15062. this.canvasContext.restore();
  15063. return;
  15064. }
  15065. this.contextData.reset();
  15066. };
  15067. CanvasRendererBase.prototype.save = function () {
  15068. this.canvasContext.save();
  15069. };
  15070. CanvasRendererBase.prototype.restore = function (actionFlag) {
  15071. if (!this.renderConfig.clearCanvas) {
  15072. this.canvasContext.restore();
  15073. return;
  15074. }
  15075. if (actionFlag) {
  15076. this.globalData.blendMode = 'source-over';
  15077. }
  15078. this.contextData.restore(actionFlag);
  15079. };
  15080. CanvasRendererBase.prototype.configAnimation = function (animData) {
  15081. if (this.animationItem.wrapper) {
  15082. this.animationItem.container = createTag('canvas');
  15083. var containerStyle = this.animationItem.container.style;
  15084. containerStyle.width = '100%';
  15085. containerStyle.height = '100%';
  15086. var origin = '0px 0px 0px';
  15087. containerStyle.transformOrigin = origin;
  15088. containerStyle.mozTransformOrigin = origin;
  15089. containerStyle.webkitTransformOrigin = origin;
  15090. containerStyle['-webkit-transform'] = origin;
  15091. containerStyle.contentVisibility = this.renderConfig.contentVisibility;
  15092. this.animationItem.wrapper.appendChild(this.animationItem.container);
  15093. this.canvasContext = this.animationItem.container.getContext('2d');
  15094. if (this.renderConfig.className) {
  15095. this.animationItem.container.setAttribute('class', this.renderConfig.className);
  15096. }
  15097. if (this.renderConfig.id) {
  15098. this.animationItem.container.setAttribute('id', this.renderConfig.id);
  15099. }
  15100. } else {
  15101. this.canvasContext = this.renderConfig.context;
  15102. }
  15103. this.contextData.setContext(this.canvasContext);
  15104. this.data = animData;
  15105. this.layers = animData.layers;
  15106. this.transformCanvas = {
  15107. w: animData.w,
  15108. h: animData.h,
  15109. sx: 0,
  15110. sy: 0,
  15111. tx: 0,
  15112. ty: 0
  15113. };
  15114. this.setupGlobalData(animData, document.body);
  15115. this.globalData.canvasContext = this.canvasContext;
  15116. this.globalData.renderer = this;
  15117. this.globalData.isDashed = false;
  15118. this.globalData.progressiveLoad = this.renderConfig.progressiveLoad;
  15119. this.globalData.transformCanvas = this.transformCanvas;
  15120. this.elements = createSizedArray(animData.layers.length);
  15121. this.updateContainerSize();
  15122. };
  15123. CanvasRendererBase.prototype.updateContainerSize = function (width, height) {
  15124. this.reset();
  15125. var elementWidth;
  15126. var elementHeight;
  15127. if (width) {
  15128. elementWidth = width;
  15129. elementHeight = height;
  15130. this.canvasContext.canvas.width = elementWidth;
  15131. this.canvasContext.canvas.height = elementHeight;
  15132. } else {
  15133. if (this.animationItem.wrapper && this.animationItem.container) {
  15134. elementWidth = this.animationItem.wrapper.offsetWidth;
  15135. elementHeight = this.animationItem.wrapper.offsetHeight;
  15136. } else {
  15137. elementWidth = this.canvasContext.canvas.width;
  15138. elementHeight = this.canvasContext.canvas.height;
  15139. }
  15140. this.canvasContext.canvas.width = elementWidth * this.renderConfig.dpr;
  15141. this.canvasContext.canvas.height = elementHeight * this.renderConfig.dpr;
  15142. }
  15143. var elementRel;
  15144. var animationRel;
  15145. if (this.renderConfig.preserveAspectRatio.indexOf('meet') !== -1 || this.renderConfig.preserveAspectRatio.indexOf('slice') !== -1) {
  15146. var par = this.renderConfig.preserveAspectRatio.split(' ');
  15147. var fillType = par[1] || 'meet';
  15148. var pos = par[0] || 'xMidYMid';
  15149. var xPos = pos.substr(0, 4);
  15150. var yPos = pos.substr(4);
  15151. elementRel = elementWidth / elementHeight;
  15152. animationRel = this.transformCanvas.w / this.transformCanvas.h;
  15153. if (animationRel > elementRel && fillType === 'meet' || animationRel < elementRel && fillType === 'slice') {
  15154. this.transformCanvas.sx = elementWidth / (this.transformCanvas.w / this.renderConfig.dpr);
  15155. this.transformCanvas.sy = elementWidth / (this.transformCanvas.w / this.renderConfig.dpr);
  15156. } else {
  15157. this.transformCanvas.sx = elementHeight / (this.transformCanvas.h / this.renderConfig.dpr);
  15158. this.transformCanvas.sy = elementHeight / (this.transformCanvas.h / this.renderConfig.dpr);
  15159. }
  15160. if (xPos === 'xMid' && (animationRel < elementRel && fillType === 'meet' || animationRel > elementRel && fillType === 'slice')) {
  15161. this.transformCanvas.tx = (elementWidth - this.transformCanvas.w * (elementHeight / this.transformCanvas.h)) / 2 * this.renderConfig.dpr;
  15162. } else if (xPos === 'xMax' && (animationRel < elementRel && fillType === 'meet' || animationRel > elementRel && fillType === 'slice')) {
  15163. this.transformCanvas.tx = (elementWidth - this.transformCanvas.w * (elementHeight / this.transformCanvas.h)) * this.renderConfig.dpr;
  15164. } else {
  15165. this.transformCanvas.tx = 0;
  15166. }
  15167. if (yPos === 'YMid' && (animationRel > elementRel && fillType === 'meet' || animationRel < elementRel && fillType === 'slice')) {
  15168. this.transformCanvas.ty = (elementHeight - this.transformCanvas.h * (elementWidth / this.transformCanvas.w)) / 2 * this.renderConfig.dpr;
  15169. } else if (yPos === 'YMax' && (animationRel > elementRel && fillType === 'meet' || animationRel < elementRel && fillType === 'slice')) {
  15170. this.transformCanvas.ty = (elementHeight - this.transformCanvas.h * (elementWidth / this.transformCanvas.w)) * this.renderConfig.dpr;
  15171. } else {
  15172. this.transformCanvas.ty = 0;
  15173. }
  15174. } else if (this.renderConfig.preserveAspectRatio === 'none') {
  15175. this.transformCanvas.sx = elementWidth / (this.transformCanvas.w / this.renderConfig.dpr);
  15176. this.transformCanvas.sy = elementHeight / (this.transformCanvas.h / this.renderConfig.dpr);
  15177. this.transformCanvas.tx = 0;
  15178. this.transformCanvas.ty = 0;
  15179. } else {
  15180. this.transformCanvas.sx = this.renderConfig.dpr;
  15181. this.transformCanvas.sy = this.renderConfig.dpr;
  15182. this.transformCanvas.tx = 0;
  15183. this.transformCanvas.ty = 0;
  15184. }
  15185. 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];
  15186. /* var i, len = this.elements.length;
  15187. for(i=0;i<len;i+=1){
  15188. if(this.elements[i] && this.elements[i].data.ty === 0){
  15189. this.elements[i].resize(this.globalData.transformCanvas);
  15190. }
  15191. } */
  15192. this.ctxTransform(this.transformCanvas.props);
  15193. this.canvasContext.beginPath();
  15194. this.canvasContext.rect(0, 0, this.transformCanvas.w, this.transformCanvas.h);
  15195. this.canvasContext.closePath();
  15196. this.canvasContext.clip();
  15197. this.renderFrame(this.renderedFrame, true);
  15198. };
  15199. CanvasRendererBase.prototype.destroy = function () {
  15200. if (this.renderConfig.clearCanvas && this.animationItem.wrapper) {
  15201. this.animationItem.wrapper.innerText = '';
  15202. }
  15203. var i;
  15204. var len = this.layers ? this.layers.length : 0;
  15205. for (i = len - 1; i >= 0; i -= 1) {
  15206. if (this.elements[i] && this.elements[i].destroy) {
  15207. this.elements[i].destroy();
  15208. }
  15209. }
  15210. this.elements.length = 0;
  15211. this.globalData.canvasContext = null;
  15212. this.animationItem.container = null;
  15213. this.destroyed = true;
  15214. };
  15215. CanvasRendererBase.prototype.renderFrame = function (num, forceRender) {
  15216. if (this.renderedFrame === num && this.renderConfig.clearCanvas === true && !forceRender || this.destroyed || num === -1) {
  15217. return;
  15218. }
  15219. this.renderedFrame = num;
  15220. this.globalData.frameNum = num - this.animationItem._isFirstFrame;
  15221. this.globalData.frameId += 1;
  15222. this.globalData._mdf = !this.renderConfig.clearCanvas || forceRender;
  15223. this.globalData.projectInterface.currentFrame = num; // console.log('--------');
  15224. // console.log('NEW: ',num);
  15225. var i;
  15226. var len = this.layers.length;
  15227. if (!this.completeLayers) {
  15228. this.checkLayers(num);
  15229. }
  15230. for (i = len - 1; i >= 0; i -= 1) {
  15231. if (this.completeLayers || this.elements[i]) {
  15232. this.elements[i].prepareFrame(num - this.layers[i].st);
  15233. }
  15234. }
  15235. if (this.globalData._mdf) {
  15236. if (this.renderConfig.clearCanvas === true) {
  15237. this.canvasContext.clearRect(0, 0, this.transformCanvas.w, this.transformCanvas.h);
  15238. } else {
  15239. this.save();
  15240. }
  15241. for (i = len - 1; i >= 0; i -= 1) {
  15242. if (this.completeLayers || this.elements[i]) {
  15243. this.elements[i].renderFrame();
  15244. }
  15245. }
  15246. if (this.renderConfig.clearCanvas !== true) {
  15247. this.restore();
  15248. }
  15249. }
  15250. };
  15251. CanvasRendererBase.prototype.buildItem = function (pos) {
  15252. var elements = this.elements;
  15253. if (elements[pos] || this.layers[pos].ty === 99) {
  15254. return;
  15255. }
  15256. var element = this.createItem(this.layers[pos], this, this.globalData);
  15257. elements[pos] = element;
  15258. element.initExpressions();
  15259. /* if(this.layers[pos].ty === 0){
  15260. element.resize(this.globalData.transformCanvas);
  15261. } */
  15262. };
  15263. CanvasRendererBase.prototype.checkPendingElements = function () {
  15264. while (this.pendingElements.length) {
  15265. var element = this.pendingElements.pop();
  15266. element.checkParenting();
  15267. }
  15268. };
  15269. CanvasRendererBase.prototype.hide = function () {
  15270. this.animationItem.container.style.display = 'none';
  15271. };
  15272. CanvasRendererBase.prototype.show = function () {
  15273. this.animationItem.container.style.display = 'block';
  15274. };
  15275. function CanvasContext() {
  15276. this.opacity = -1;
  15277. this.transform = createTypedArray('float32', 16);
  15278. this.fillStyle = '';
  15279. this.strokeStyle = '';
  15280. this.lineWidth = '';
  15281. this.lineCap = '';
  15282. this.lineJoin = '';
  15283. this.miterLimit = '';
  15284. this.id = Math.random();
  15285. }
  15286. function CVContextData() {
  15287. this.stack = [];
  15288. this.cArrPos = 0;
  15289. this.cTr = new Matrix();
  15290. var i;
  15291. var len = 15;
  15292. for (i = 0; i < len; i += 1) {
  15293. var canvasContext = new CanvasContext();
  15294. this.stack[i] = canvasContext;
  15295. }
  15296. this._length = len;
  15297. this.nativeContext = null;
  15298. this.transformMat = new Matrix();
  15299. this.currentOpacity = 1; //
  15300. this.currentFillStyle = '';
  15301. this.appliedFillStyle = ''; //
  15302. this.currentStrokeStyle = '';
  15303. this.appliedStrokeStyle = ''; //
  15304. this.currentLineWidth = '';
  15305. this.appliedLineWidth = ''; //
  15306. this.currentLineCap = '';
  15307. this.appliedLineCap = ''; //
  15308. this.currentLineJoin = '';
  15309. this.appliedLineJoin = ''; //
  15310. this.appliedMiterLimit = '';
  15311. this.currentMiterLimit = '';
  15312. }
  15313. CVContextData.prototype.duplicate = function () {
  15314. var newLength = this._length * 2;
  15315. var i = 0;
  15316. for (i = this._length; i < newLength; i += 1) {
  15317. this.stack[i] = new CanvasContext();
  15318. }
  15319. this._length = newLength;
  15320. };
  15321. CVContextData.prototype.reset = function () {
  15322. this.cArrPos = 0;
  15323. this.cTr.reset();
  15324. this.stack[this.cArrPos].opacity = 1;
  15325. };
  15326. CVContextData.prototype.restore = function (forceRestore) {
  15327. this.cArrPos -= 1;
  15328. var currentContext = this.stack[this.cArrPos];
  15329. var transform = currentContext.transform;
  15330. var i;
  15331. var arr = this.cTr.props;
  15332. for (i = 0; i < 16; i += 1) {
  15333. arr[i] = transform[i];
  15334. }
  15335. if (forceRestore) {
  15336. this.nativeContext.restore();
  15337. var prevStack = this.stack[this.cArrPos + 1];
  15338. this.appliedFillStyle = prevStack.fillStyle;
  15339. this.appliedStrokeStyle = prevStack.strokeStyle;
  15340. this.appliedLineWidth = prevStack.lineWidth;
  15341. this.appliedLineCap = prevStack.lineCap;
  15342. this.appliedLineJoin = prevStack.lineJoin;
  15343. this.appliedMiterLimit = prevStack.miterLimit;
  15344. }
  15345. this.nativeContext.setTransform(transform[0], transform[1], transform[4], transform[5], transform[12], transform[13]);
  15346. if (forceRestore || currentContext.opacity !== -1 && this.currentOpacity !== currentContext.opacity) {
  15347. this.nativeContext.globalAlpha = currentContext.opacity;
  15348. this.currentOpacity = currentContext.opacity;
  15349. }
  15350. this.currentFillStyle = currentContext.fillStyle;
  15351. this.currentStrokeStyle = currentContext.strokeStyle;
  15352. this.currentLineWidth = currentContext.lineWidth;
  15353. this.currentLineCap = currentContext.lineCap;
  15354. this.currentLineJoin = currentContext.lineJoin;
  15355. this.currentMiterLimit = currentContext.miterLimit;
  15356. };
  15357. CVContextData.prototype.save = function (saveOnNativeFlag) {
  15358. if (saveOnNativeFlag) {
  15359. this.nativeContext.save();
  15360. }
  15361. var props = this.cTr.props;
  15362. if (this._length <= this.cArrPos) {
  15363. this.duplicate();
  15364. }
  15365. var currentStack = this.stack[this.cArrPos];
  15366. var i;
  15367. for (i = 0; i < 16; i += 1) {
  15368. currentStack.transform[i] = props[i];
  15369. }
  15370. this.cArrPos += 1;
  15371. var newStack = this.stack[this.cArrPos];
  15372. newStack.opacity = currentStack.opacity;
  15373. newStack.fillStyle = currentStack.fillStyle;
  15374. newStack.strokeStyle = currentStack.strokeStyle;
  15375. newStack.lineWidth = currentStack.lineWidth;
  15376. newStack.lineCap = currentStack.lineCap;
  15377. newStack.lineJoin = currentStack.lineJoin;
  15378. newStack.miterLimit = currentStack.miterLimit;
  15379. };
  15380. CVContextData.prototype.setOpacity = function (value) {
  15381. this.stack[this.cArrPos].opacity = value;
  15382. };
  15383. CVContextData.prototype.setContext = function (value) {
  15384. this.nativeContext = value;
  15385. };
  15386. CVContextData.prototype.fillStyle = function (value) {
  15387. if (this.stack[this.cArrPos].fillStyle !== value) {
  15388. this.currentFillStyle = value;
  15389. this.stack[this.cArrPos].fillStyle = value;
  15390. }
  15391. };
  15392. CVContextData.prototype.strokeStyle = function (value) {
  15393. if (this.stack[this.cArrPos].strokeStyle !== value) {
  15394. this.currentStrokeStyle = value;
  15395. this.stack[this.cArrPos].strokeStyle = value;
  15396. }
  15397. };
  15398. CVContextData.prototype.lineWidth = function (value) {
  15399. if (this.stack[this.cArrPos].lineWidth !== value) {
  15400. this.currentLineWidth = value;
  15401. this.stack[this.cArrPos].lineWidth = value;
  15402. }
  15403. };
  15404. CVContextData.prototype.lineCap = function (value) {
  15405. if (this.stack[this.cArrPos].lineCap !== value) {
  15406. this.currentLineCap = value;
  15407. this.stack[this.cArrPos].lineCap = value;
  15408. }
  15409. };
  15410. CVContextData.prototype.lineJoin = function (value) {
  15411. if (this.stack[this.cArrPos].lineJoin !== value) {
  15412. this.currentLineJoin = value;
  15413. this.stack[this.cArrPos].lineJoin = value;
  15414. }
  15415. };
  15416. CVContextData.prototype.miterLimit = function (value) {
  15417. if (this.stack[this.cArrPos].miterLimit !== value) {
  15418. this.currentMiterLimit = value;
  15419. this.stack[this.cArrPos].miterLimit = value;
  15420. }
  15421. };
  15422. CVContextData.prototype.transform = function (props) {
  15423. this.transformMat.cloneFromProps(props); // Taking the last transform value from the stored stack of transforms
  15424. var currentTransform = this.cTr; // Applying the last transform value after the new transform to respect the order of transformations
  15425. this.transformMat.multiply(currentTransform); // Storing the new transformed value in the stored transform
  15426. currentTransform.cloneFromProps(this.transformMat.props);
  15427. var trProps = currentTransform.props; // Applying the new transform to the canvas
  15428. this.nativeContext.setTransform(trProps[0], trProps[1], trProps[4], trProps[5], trProps[12], trProps[13]);
  15429. };
  15430. CVContextData.prototype.opacity = function (op) {
  15431. var currentOpacity = this.stack[this.cArrPos].opacity;
  15432. currentOpacity *= op < 0 ? 0 : op;
  15433. if (this.stack[this.cArrPos].opacity !== currentOpacity) {
  15434. if (this.currentOpacity !== op) {
  15435. this.nativeContext.globalAlpha = op;
  15436. this.currentOpacity = op;
  15437. }
  15438. this.stack[this.cArrPos].opacity = currentOpacity;
  15439. }
  15440. };
  15441. CVContextData.prototype.fill = function (rule) {
  15442. if (this.appliedFillStyle !== this.currentFillStyle) {
  15443. this.appliedFillStyle = this.currentFillStyle;
  15444. this.nativeContext.fillStyle = this.appliedFillStyle;
  15445. }
  15446. this.nativeContext.fill(rule);
  15447. };
  15448. CVContextData.prototype.fillRect = function (x, y, w, h) {
  15449. if (this.appliedFillStyle !== this.currentFillStyle) {
  15450. this.appliedFillStyle = this.currentFillStyle;
  15451. this.nativeContext.fillStyle = this.appliedFillStyle;
  15452. }
  15453. this.nativeContext.fillRect(x, y, w, h);
  15454. };
  15455. CVContextData.prototype.stroke = function () {
  15456. if (this.appliedStrokeStyle !== this.currentStrokeStyle) {
  15457. this.appliedStrokeStyle = this.currentStrokeStyle;
  15458. this.nativeContext.strokeStyle = this.appliedStrokeStyle;
  15459. }
  15460. if (this.appliedLineWidth !== this.currentLineWidth) {
  15461. this.appliedLineWidth = this.currentLineWidth;
  15462. this.nativeContext.lineWidth = this.appliedLineWidth;
  15463. }
  15464. if (this.appliedLineCap !== this.currentLineCap) {
  15465. this.appliedLineCap = this.currentLineCap;
  15466. this.nativeContext.lineCap = this.appliedLineCap;
  15467. }
  15468. if (this.appliedLineJoin !== this.currentLineJoin) {
  15469. this.appliedLineJoin = this.currentLineJoin;
  15470. this.nativeContext.lineJoin = this.appliedLineJoin;
  15471. }
  15472. if (this.appliedMiterLimit !== this.currentMiterLimit) {
  15473. this.appliedMiterLimit = this.currentMiterLimit;
  15474. this.nativeContext.miterLimit = this.appliedMiterLimit;
  15475. }
  15476. this.nativeContext.stroke();
  15477. };
  15478. function CVCompElement(data, globalData, comp) {
  15479. this.completeLayers = false;
  15480. this.layers = data.layers;
  15481. this.pendingElements = [];
  15482. this.elements = createSizedArray(this.layers.length);
  15483. this.initElement(data, globalData, comp);
  15484. this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : {
  15485. _placeholder: true
  15486. };
  15487. }
  15488. extendPrototype([CanvasRendererBase, ICompElement, CVBaseElement], CVCompElement);
  15489. CVCompElement.prototype.renderInnerContent = function () {
  15490. var ctx = this.canvasContext;
  15491. ctx.beginPath();
  15492. ctx.moveTo(0, 0);
  15493. ctx.lineTo(this.data.w, 0);
  15494. ctx.lineTo(this.data.w, this.data.h);
  15495. ctx.lineTo(0, this.data.h);
  15496. ctx.lineTo(0, 0);
  15497. ctx.clip();
  15498. var i;
  15499. var len = this.layers.length;
  15500. for (i = len - 1; i >= 0; i -= 1) {
  15501. if (this.completeLayers || this.elements[i]) {
  15502. this.elements[i].renderFrame();
  15503. }
  15504. }
  15505. };
  15506. CVCompElement.prototype.destroy = function () {
  15507. var i;
  15508. var len = this.layers.length;
  15509. for (i = len - 1; i >= 0; i -= 1) {
  15510. if (this.elements[i]) {
  15511. this.elements[i].destroy();
  15512. }
  15513. }
  15514. this.layers = null;
  15515. this.elements = null;
  15516. };
  15517. CVCompElement.prototype.createComp = function (data) {
  15518. return new CVCompElement(data, this.globalData, this);
  15519. };
  15520. function CanvasRenderer(animationItem, config) {
  15521. this.animationItem = animationItem;
  15522. this.renderConfig = {
  15523. clearCanvas: config && config.clearCanvas !== undefined ? config.clearCanvas : true,
  15524. context: config && config.context || null,
  15525. progressiveLoad: config && config.progressiveLoad || false,
  15526. preserveAspectRatio: config && config.preserveAspectRatio || 'xMidYMid meet',
  15527. imagePreserveAspectRatio: config && config.imagePreserveAspectRatio || 'xMidYMid slice',
  15528. contentVisibility: config && config.contentVisibility || 'visible',
  15529. className: config && config.className || '',
  15530. id: config && config.id || '',
  15531. runExpressions: !config || config.runExpressions === undefined || config.runExpressions
  15532. };
  15533. this.renderConfig.dpr = config && config.dpr || 1;
  15534. if (this.animationItem.wrapper) {
  15535. this.renderConfig.dpr = config && config.dpr || window.devicePixelRatio || 1;
  15536. }
  15537. this.renderedFrame = -1;
  15538. this.globalData = {
  15539. frameNum: -1,
  15540. _mdf: false,
  15541. renderConfig: this.renderConfig,
  15542. currentGlobalAlpha: -1
  15543. };
  15544. this.contextData = new CVContextData();
  15545. this.elements = [];
  15546. this.pendingElements = [];
  15547. this.transformMat = new Matrix();
  15548. this.completeLayers = false;
  15549. this.rendererType = 'canvas';
  15550. if (this.renderConfig.clearCanvas) {
  15551. this.ctxTransform = this.contextData.transform.bind(this.contextData);
  15552. this.ctxOpacity = this.contextData.opacity.bind(this.contextData);
  15553. this.ctxFillStyle = this.contextData.fillStyle.bind(this.contextData);
  15554. this.ctxStrokeStyle = this.contextData.strokeStyle.bind(this.contextData);
  15555. this.ctxLineWidth = this.contextData.lineWidth.bind(this.contextData);
  15556. this.ctxLineCap = this.contextData.lineCap.bind(this.contextData);
  15557. this.ctxLineJoin = this.contextData.lineJoin.bind(this.contextData);
  15558. this.ctxMiterLimit = this.contextData.miterLimit.bind(this.contextData);
  15559. this.ctxFill = this.contextData.fill.bind(this.contextData);
  15560. this.ctxFillRect = this.contextData.fillRect.bind(this.contextData);
  15561. this.ctxStroke = this.contextData.stroke.bind(this.contextData);
  15562. this.save = this.contextData.save.bind(this.contextData);
  15563. }
  15564. }
  15565. extendPrototype([CanvasRendererBase], CanvasRenderer);
  15566. CanvasRenderer.prototype.createComp = function (data) {
  15567. return new CVCompElement(data, this.globalData, this);
  15568. };
  15569. function HBaseElement() {}
  15570. HBaseElement.prototype = {
  15571. checkBlendMode: function checkBlendMode() {},
  15572. initRendererElement: function initRendererElement() {
  15573. this.baseElement = createTag(this.data.tg || 'div');
  15574. if (this.data.hasMask) {
  15575. this.svgElement = createNS('svg');
  15576. this.layerElement = createNS('g');
  15577. this.maskedElement = this.layerElement;
  15578. this.svgElement.appendChild(this.layerElement);
  15579. this.baseElement.appendChild(this.svgElement);
  15580. } else {
  15581. this.layerElement = this.baseElement;
  15582. }
  15583. styleDiv(this.baseElement);
  15584. },
  15585. createContainerElements: function createContainerElements() {
  15586. this.renderableEffectsManager = new CVEffects(this);
  15587. this.transformedElement = this.baseElement;
  15588. this.maskedElement = this.layerElement;
  15589. if (this.data.ln) {
  15590. this.layerElement.setAttribute('id', this.data.ln);
  15591. }
  15592. if (this.data.cl) {
  15593. this.layerElement.setAttribute('class', this.data.cl);
  15594. }
  15595. if (this.data.bm !== 0) {
  15596. this.setBlendMode();
  15597. }
  15598. },
  15599. renderElement: function renderElement() {
  15600. var transformedElementStyle = this.transformedElement ? this.transformedElement.style : {};
  15601. if (this.finalTransform._matMdf) {
  15602. var matrixValue = this.finalTransform.mat.toCSS();
  15603. transformedElementStyle.transform = matrixValue;
  15604. transformedElementStyle.webkitTransform = matrixValue;
  15605. }
  15606. if (this.finalTransform._opMdf) {
  15607. transformedElementStyle.opacity = this.finalTransform.mProp.o.v;
  15608. }
  15609. },
  15610. renderFrame: function renderFrame() {
  15611. // If it is exported as hidden (data.hd === true) no need to render
  15612. // If it is not visible no need to render
  15613. if (this.data.hd || this.hidden) {
  15614. return;
  15615. }
  15616. this.renderTransform();
  15617. this.renderRenderable();
  15618. this.renderElement();
  15619. this.renderInnerContent();
  15620. if (this._isFirstFrame) {
  15621. this._isFirstFrame = false;
  15622. }
  15623. },
  15624. destroy: function destroy() {
  15625. this.layerElement = null;
  15626. this.transformedElement = null;
  15627. if (this.matteElement) {
  15628. this.matteElement = null;
  15629. }
  15630. if (this.maskManager) {
  15631. this.maskManager.destroy();
  15632. this.maskManager = null;
  15633. }
  15634. },
  15635. createRenderableComponents: function createRenderableComponents() {
  15636. this.maskManager = new MaskElement(this.data, this, this.globalData);
  15637. },
  15638. addEffects: function addEffects() {},
  15639. setMatte: function setMatte() {}
  15640. };
  15641. HBaseElement.prototype.getBaseElement = SVGBaseElement.prototype.getBaseElement;
  15642. HBaseElement.prototype.destroyBaseElement = HBaseElement.prototype.destroy;
  15643. HBaseElement.prototype.buildElementParenting = BaseRenderer.prototype.buildElementParenting;
  15644. function HSolidElement(data, globalData, comp) {
  15645. this.initElement(data, globalData, comp);
  15646. }
  15647. extendPrototype([BaseElement, TransformElement, HBaseElement, HierarchyElement, FrameElement, RenderableDOMElement], HSolidElement);
  15648. HSolidElement.prototype.createContent = function () {
  15649. var rect;
  15650. if (this.data.hasMask) {
  15651. rect = createNS('rect');
  15652. rect.setAttribute('width', this.data.sw);
  15653. rect.setAttribute('height', this.data.sh);
  15654. rect.setAttribute('fill', this.data.sc);
  15655. this.svgElement.setAttribute('width', this.data.sw);
  15656. this.svgElement.setAttribute('height', this.data.sh);
  15657. } else {
  15658. rect = createTag('div');
  15659. rect.style.width = this.data.sw + 'px';
  15660. rect.style.height = this.data.sh + 'px';
  15661. rect.style.backgroundColor = this.data.sc;
  15662. }
  15663. this.layerElement.appendChild(rect);
  15664. };
  15665. function HShapeElement(data, globalData, comp) {
  15666. // List of drawable elements
  15667. this.shapes = []; // Full shape data
  15668. this.shapesData = data.shapes; // List of styles that will be applied to shapes
  15669. this.stylesList = []; // List of modifiers that will be applied to shapes
  15670. this.shapeModifiers = []; // List of items in shape tree
  15671. this.itemsData = []; // List of items in previous shape tree
  15672. this.processedElements = []; // List of animated components
  15673. this.animatedContents = [];
  15674. this.shapesContainer = createNS('g');
  15675. this.initElement(data, globalData, comp); // Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
  15676. // List of elements that have been created
  15677. this.prevViewData = [];
  15678. this.currentBBox = {
  15679. x: 999999,
  15680. y: -999999,
  15681. h: 0,
  15682. w: 0
  15683. };
  15684. }
  15685. extendPrototype([BaseElement, TransformElement, HSolidElement, SVGShapeElement, HBaseElement, HierarchyElement, FrameElement, RenderableElement], HShapeElement);
  15686. HShapeElement.prototype._renderShapeFrame = HShapeElement.prototype.renderInnerContent;
  15687. HShapeElement.prototype.createContent = function () {
  15688. var cont;
  15689. this.baseElement.style.fontSize = 0;
  15690. if (this.data.hasMask) {
  15691. this.layerElement.appendChild(this.shapesContainer);
  15692. cont = this.svgElement;
  15693. } else {
  15694. cont = createNS('svg');
  15695. var size = this.comp.data ? this.comp.data : this.globalData.compSize;
  15696. cont.setAttribute('width', size.w);
  15697. cont.setAttribute('height', size.h);
  15698. cont.appendChild(this.shapesContainer);
  15699. this.layerElement.appendChild(cont);
  15700. }
  15701. this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.shapesContainer, 0, [], true);
  15702. this.filterUniqueShapes();
  15703. this.shapeCont = cont;
  15704. };
  15705. HShapeElement.prototype.getTransformedPoint = function (transformers, point) {
  15706. var i;
  15707. var len = transformers.length;
  15708. for (i = 0; i < len; i += 1) {
  15709. point = transformers[i].mProps.v.applyToPointArray(point[0], point[1], 0);
  15710. }
  15711. return point;
  15712. };
  15713. HShapeElement.prototype.calculateShapeBoundingBox = function (item, boundingBox) {
  15714. var shape = item.sh.v;
  15715. var transformers = item.transformers;
  15716. var i;
  15717. var len = shape._length;
  15718. var vPoint;
  15719. var oPoint;
  15720. var nextIPoint;
  15721. var nextVPoint;
  15722. if (len <= 1) {
  15723. return;
  15724. }
  15725. for (i = 0; i < len - 1; i += 1) {
  15726. vPoint = this.getTransformedPoint(transformers, shape.v[i]);
  15727. oPoint = this.getTransformedPoint(transformers, shape.o[i]);
  15728. nextIPoint = this.getTransformedPoint(transformers, shape.i[i + 1]);
  15729. nextVPoint = this.getTransformedPoint(transformers, shape.v[i + 1]);
  15730. this.checkBounds(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox);
  15731. }
  15732. if (shape.c) {
  15733. vPoint = this.getTransformedPoint(transformers, shape.v[i]);
  15734. oPoint = this.getTransformedPoint(transformers, shape.o[i]);
  15735. nextIPoint = this.getTransformedPoint(transformers, shape.i[0]);
  15736. nextVPoint = this.getTransformedPoint(transformers, shape.v[0]);
  15737. this.checkBounds(vPoint, oPoint, nextIPoint, nextVPoint, boundingBox);
  15738. }
  15739. };
  15740. HShapeElement.prototype.checkBounds = function (vPoint, oPoint, nextIPoint, nextVPoint, boundingBox) {
  15741. this.getBoundsOfCurve(vPoint, oPoint, nextIPoint, nextVPoint);
  15742. var bounds = this.shapeBoundingBox;
  15743. boundingBox.x = bmMin(bounds.left, boundingBox.x);
  15744. boundingBox.xMax = bmMax(bounds.right, boundingBox.xMax);
  15745. boundingBox.y = bmMin(bounds.top, boundingBox.y);
  15746. boundingBox.yMax = bmMax(bounds.bottom, boundingBox.yMax);
  15747. };
  15748. HShapeElement.prototype.shapeBoundingBox = {
  15749. left: 0,
  15750. right: 0,
  15751. top: 0,
  15752. bottom: 0
  15753. };
  15754. HShapeElement.prototype.tempBoundingBox = {
  15755. x: 0,
  15756. xMax: 0,
  15757. y: 0,
  15758. yMax: 0,
  15759. width: 0,
  15760. height: 0
  15761. };
  15762. HShapeElement.prototype.getBoundsOfCurve = function (p0, p1, p2, p3) {
  15763. var bounds = [[p0[0], p3[0]], [p0[1], p3[1]]];
  15764. for (var a, b, c, t, b2ac, t1, t2, i = 0; i < 2; ++i) {
  15765. // eslint-disable-line no-plusplus
  15766. b = 6 * p0[i] - 12 * p1[i] + 6 * p2[i];
  15767. a = -3 * p0[i] + 9 * p1[i] - 9 * p2[i] + 3 * p3[i];
  15768. c = 3 * p1[i] - 3 * p0[i];
  15769. b |= 0; // eslint-disable-line no-bitwise
  15770. a |= 0; // eslint-disable-line no-bitwise
  15771. c |= 0; // eslint-disable-line no-bitwise
  15772. if (a === 0 && b === 0) {//
  15773. } else if (a === 0) {
  15774. t = -c / b;
  15775. if (t > 0 && t < 1) {
  15776. bounds[i].push(this.calculateF(t, p0, p1, p2, p3, i));
  15777. }
  15778. } else {
  15779. b2ac = b * b - 4 * c * a;
  15780. if (b2ac >= 0) {
  15781. t1 = (-b + bmSqrt(b2ac)) / (2 * a);
  15782. if (t1 > 0 && t1 < 1) bounds[i].push(this.calculateF(t1, p0, p1, p2, p3, i));
  15783. t2 = (-b - bmSqrt(b2ac)) / (2 * a);
  15784. if (t2 > 0 && t2 < 1) bounds[i].push(this.calculateF(t2, p0, p1, p2, p3, i));
  15785. }
  15786. }
  15787. }
  15788. this.shapeBoundingBox.left = bmMin.apply(null, bounds[0]);
  15789. this.shapeBoundingBox.top = bmMin.apply(null, bounds[1]);
  15790. this.shapeBoundingBox.right = bmMax.apply(null, bounds[0]);
  15791. this.shapeBoundingBox.bottom = bmMax.apply(null, bounds[1]);
  15792. };
  15793. HShapeElement.prototype.calculateF = function (t, p0, p1, p2, p3, i) {
  15794. return bmPow(1 - t, 3) * p0[i] + 3 * bmPow(1 - t, 2) * t * p1[i] + 3 * (1 - t) * bmPow(t, 2) * p2[i] + bmPow(t, 3) * p3[i];
  15795. };
  15796. HShapeElement.prototype.calculateBoundingBox = function (itemsData, boundingBox) {
  15797. var i;
  15798. var len = itemsData.length;
  15799. for (i = 0; i < len; i += 1) {
  15800. if (itemsData[i] && itemsData[i].sh) {
  15801. this.calculateShapeBoundingBox(itemsData[i], boundingBox);
  15802. } else if (itemsData[i] && itemsData[i].it) {
  15803. this.calculateBoundingBox(itemsData[i].it, boundingBox);
  15804. } else if (itemsData[i] && itemsData[i].style && itemsData[i].w) {
  15805. this.expandStrokeBoundingBox(itemsData[i].w, boundingBox);
  15806. }
  15807. }
  15808. };
  15809. HShapeElement.prototype.expandStrokeBoundingBox = function (widthProperty, boundingBox) {
  15810. var width = 0;
  15811. if (widthProperty.keyframes) {
  15812. for (var i = 0; i < widthProperty.keyframes.length; i += 1) {
  15813. var kfw = widthProperty.keyframes[i].s;
  15814. if (kfw > width) {
  15815. width = kfw;
  15816. }
  15817. }
  15818. width *= widthProperty.mult;
  15819. } else {
  15820. width = widthProperty.v * widthProperty.mult;
  15821. }
  15822. boundingBox.x -= width;
  15823. boundingBox.xMax += width;
  15824. boundingBox.y -= width;
  15825. boundingBox.yMax += width;
  15826. };
  15827. HShapeElement.prototype.currentBoxContains = function (box) {
  15828. return this.currentBBox.x <= box.x && this.currentBBox.y <= box.y && this.currentBBox.width + this.currentBBox.x >= box.x + box.width && this.currentBBox.height + this.currentBBox.y >= box.y + box.height;
  15829. };
  15830. HShapeElement.prototype.renderInnerContent = function () {
  15831. this._renderShapeFrame();
  15832. if (!this.hidden && (this._isFirstFrame || this._mdf)) {
  15833. var tempBoundingBox = this.tempBoundingBox;
  15834. var max = 999999;
  15835. tempBoundingBox.x = max;
  15836. tempBoundingBox.xMax = -max;
  15837. tempBoundingBox.y = max;
  15838. tempBoundingBox.yMax = -max;
  15839. this.calculateBoundingBox(this.itemsData, tempBoundingBox);
  15840. tempBoundingBox.width = tempBoundingBox.xMax < tempBoundingBox.x ? 0 : tempBoundingBox.xMax - tempBoundingBox.x;
  15841. tempBoundingBox.height = tempBoundingBox.yMax < tempBoundingBox.y ? 0 : tempBoundingBox.yMax - tempBoundingBox.y; // var tempBoundingBox = this.shapeCont.getBBox();
  15842. if (this.currentBoxContains(tempBoundingBox)) {
  15843. return;
  15844. }
  15845. var changed = false;
  15846. if (this.currentBBox.w !== tempBoundingBox.width) {
  15847. this.currentBBox.w = tempBoundingBox.width;
  15848. this.shapeCont.setAttribute('width', tempBoundingBox.width);
  15849. changed = true;
  15850. }
  15851. if (this.currentBBox.h !== tempBoundingBox.height) {
  15852. this.currentBBox.h = tempBoundingBox.height;
  15853. this.shapeCont.setAttribute('height', tempBoundingBox.height);
  15854. changed = true;
  15855. }
  15856. if (changed || this.currentBBox.x !== tempBoundingBox.x || this.currentBBox.y !== tempBoundingBox.y) {
  15857. this.currentBBox.w = tempBoundingBox.width;
  15858. this.currentBBox.h = tempBoundingBox.height;
  15859. this.currentBBox.x = tempBoundingBox.x;
  15860. this.currentBBox.y = tempBoundingBox.y;
  15861. this.shapeCont.setAttribute('viewBox', this.currentBBox.x + ' ' + this.currentBBox.y + ' ' + this.currentBBox.w + ' ' + this.currentBBox.h);
  15862. var shapeStyle = this.shapeCont.style;
  15863. var shapeTransform = 'translate(' + this.currentBBox.x + 'px,' + this.currentBBox.y + 'px)';
  15864. shapeStyle.transform = shapeTransform;
  15865. shapeStyle.webkitTransform = shapeTransform;
  15866. }
  15867. }
  15868. };
  15869. function HTextElement(data, globalData, comp) {
  15870. this.textSpans = [];
  15871. this.textPaths = [];
  15872. this.currentBBox = {
  15873. x: 999999,
  15874. y: -999999,
  15875. h: 0,
  15876. w: 0
  15877. };
  15878. this.renderType = 'svg';
  15879. this.isMasked = false;
  15880. this.initElement(data, globalData, comp);
  15881. }
  15882. extendPrototype([BaseElement, TransformElement, HBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, ITextElement], HTextElement);
  15883. HTextElement.prototype.createContent = function () {
  15884. this.isMasked = this.checkMasks();
  15885. if (this.isMasked) {
  15886. this.renderType = 'svg';
  15887. this.compW = this.comp.data.w;
  15888. this.compH = this.comp.data.h;
  15889. this.svgElement.setAttribute('width', this.compW);
  15890. this.svgElement.setAttribute('height', this.compH);
  15891. var g = createNS('g');
  15892. this.maskedElement.appendChild(g);
  15893. this.innerElem = g;
  15894. } else {
  15895. this.renderType = 'html';
  15896. this.innerElem = this.layerElement;
  15897. }
  15898. this.checkParenting();
  15899. };
  15900. HTextElement.prototype.buildNewText = function () {
  15901. var documentData = this.textProperty.currentData;
  15902. this.renderedLetters = createSizedArray(documentData.l ? documentData.l.length : 0);
  15903. var innerElemStyle = this.innerElem.style;
  15904. var textColor = documentData.fc ? this.buildColor(documentData.fc) : 'rgba(0,0,0,0)';
  15905. innerElemStyle.fill = textColor;
  15906. innerElemStyle.color = textColor;
  15907. if (documentData.sc) {
  15908. innerElemStyle.stroke = this.buildColor(documentData.sc);
  15909. innerElemStyle.strokeWidth = documentData.sw + 'px';
  15910. }
  15911. var fontData = this.globalData.fontManager.getFontByName(documentData.f);
  15912. if (!this.globalData.fontManager.chars) {
  15913. innerElemStyle.fontSize = documentData.finalSize + 'px';
  15914. innerElemStyle.lineHeight = documentData.finalSize + 'px';
  15915. if (fontData.fClass) {
  15916. this.innerElem.className = fontData.fClass;
  15917. } else {
  15918. innerElemStyle.fontFamily = fontData.fFamily;
  15919. var fWeight = documentData.fWeight;
  15920. var fStyle = documentData.fStyle;
  15921. innerElemStyle.fontStyle = fStyle;
  15922. innerElemStyle.fontWeight = fWeight;
  15923. }
  15924. }
  15925. var i;
  15926. var len;
  15927. var letters = documentData.l;
  15928. len = letters.length;
  15929. var tSpan;
  15930. var tParent;
  15931. var tCont;
  15932. var matrixHelper = this.mHelper;
  15933. var shapes;
  15934. var shapeStr = '';
  15935. var cnt = 0;
  15936. for (i = 0; i < len; i += 1) {
  15937. if (this.globalData.fontManager.chars) {
  15938. if (!this.textPaths[cnt]) {
  15939. tSpan = createNS('path');
  15940. tSpan.setAttribute('stroke-linecap', lineCapEnum[1]);
  15941. tSpan.setAttribute('stroke-linejoin', lineJoinEnum[2]);
  15942. tSpan.setAttribute('stroke-miterlimit', '4');
  15943. } else {
  15944. tSpan = this.textPaths[cnt];
  15945. }
  15946. if (!this.isMasked) {
  15947. if (this.textSpans[cnt]) {
  15948. tParent = this.textSpans[cnt];
  15949. tCont = tParent.children[0];
  15950. } else {
  15951. tParent = createTag('div');
  15952. tParent.style.lineHeight = 0;
  15953. tCont = createNS('svg');
  15954. tCont.appendChild(tSpan);
  15955. styleDiv(tParent);
  15956. }
  15957. }
  15958. } else if (!this.isMasked) {
  15959. if (this.textSpans[cnt]) {
  15960. tParent = this.textSpans[cnt];
  15961. tSpan = this.textPaths[cnt];
  15962. } else {
  15963. tParent = createTag('span');
  15964. styleDiv(tParent);
  15965. tSpan = createTag('span');
  15966. styleDiv(tSpan);
  15967. tParent.appendChild(tSpan);
  15968. }
  15969. } else {
  15970. tSpan = this.textPaths[cnt] ? this.textPaths[cnt] : createNS('text');
  15971. } // tSpan.setAttribute('visibility', 'hidden');
  15972. if (this.globalData.fontManager.chars) {
  15973. var charData = this.globalData.fontManager.getCharData(documentData.finalText[i], fontData.fStyle, this.globalData.fontManager.getFontByName(documentData.f).fFamily);
  15974. var shapeData;
  15975. if (charData) {
  15976. shapeData = charData.data;
  15977. } else {
  15978. shapeData = null;
  15979. }
  15980. matrixHelper.reset();
  15981. if (shapeData && shapeData.shapes && shapeData.shapes.length) {
  15982. shapes = shapeData.shapes[0].it;
  15983. matrixHelper.scale(documentData.finalSize / 100, documentData.finalSize / 100);
  15984. shapeStr = this.createPathShape(matrixHelper, shapes);
  15985. tSpan.setAttribute('d', shapeStr);
  15986. }
  15987. if (!this.isMasked) {
  15988. this.innerElem.appendChild(tParent);
  15989. if (shapeData && shapeData.shapes) {
  15990. // document.body.appendChild is needed to get exact measure of shape
  15991. document.body.appendChild(tCont);
  15992. var boundingBox = tCont.getBBox();
  15993. tCont.setAttribute('width', boundingBox.width + 2);
  15994. tCont.setAttribute('height', boundingBox.height + 2);
  15995. tCont.setAttribute('viewBox', boundingBox.x - 1 + ' ' + (boundingBox.y - 1) + ' ' + (boundingBox.width + 2) + ' ' + (boundingBox.height + 2));
  15996. var tContStyle = tCont.style;
  15997. var tContTranslation = 'translate(' + (boundingBox.x - 1) + 'px,' + (boundingBox.y - 1) + 'px)';
  15998. tContStyle.transform = tContTranslation;
  15999. tContStyle.webkitTransform = tContTranslation;
  16000. letters[i].yOffset = boundingBox.y - 1;
  16001. } else {
  16002. tCont.setAttribute('width', 1);
  16003. tCont.setAttribute('height', 1);
  16004. }
  16005. tParent.appendChild(tCont);
  16006. } else {
  16007. this.innerElem.appendChild(tSpan);
  16008. }
  16009. } else {
  16010. tSpan.textContent = letters[i].val;
  16011. tSpan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');
  16012. if (!this.isMasked) {
  16013. this.innerElem.appendChild(tParent); //
  16014. var tStyle = tSpan.style;
  16015. var tSpanTranslation = 'translate3d(0,' + -documentData.finalSize / 1.2 + 'px,0)';
  16016. tStyle.transform = tSpanTranslation;
  16017. tStyle.webkitTransform = tSpanTranslation;
  16018. } else {
  16019. this.innerElem.appendChild(tSpan);
  16020. }
  16021. } //
  16022. if (!this.isMasked) {
  16023. this.textSpans[cnt] = tParent;
  16024. } else {
  16025. this.textSpans[cnt] = tSpan;
  16026. }
  16027. this.textSpans[cnt].style.display = 'block';
  16028. this.textPaths[cnt] = tSpan;
  16029. cnt += 1;
  16030. }
  16031. while (cnt < this.textSpans.length) {
  16032. this.textSpans[cnt].style.display = 'none';
  16033. cnt += 1;
  16034. }
  16035. };
  16036. HTextElement.prototype.renderInnerContent = function () {
  16037. this.validateText();
  16038. var svgStyle;
  16039. if (this.data.singleShape) {
  16040. if (!this._isFirstFrame && !this.lettersChangedFlag) {
  16041. return;
  16042. }
  16043. if (this.isMasked && this.finalTransform._matMdf) {
  16044. // Todo Benchmark if using this is better than getBBox
  16045. this.svgElement.setAttribute('viewBox', -this.finalTransform.mProp.p.v[0] + ' ' + -this.finalTransform.mProp.p.v[1] + ' ' + this.compW + ' ' + this.compH);
  16046. svgStyle = this.svgElement.style;
  16047. var translation = 'translate(' + -this.finalTransform.mProp.p.v[0] + 'px,' + -this.finalTransform.mProp.p.v[1] + 'px)';
  16048. svgStyle.transform = translation;
  16049. svgStyle.webkitTransform = translation;
  16050. }
  16051. }
  16052. this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
  16053. if (!this.lettersChangedFlag && !this.textAnimator.lettersChangedFlag) {
  16054. return;
  16055. }
  16056. var i;
  16057. var len;
  16058. var count = 0;
  16059. var renderedLetters = this.textAnimator.renderedLetters;
  16060. var letters = this.textProperty.currentData.l;
  16061. len = letters.length;
  16062. var renderedLetter;
  16063. var textSpan;
  16064. var textPath;
  16065. for (i = 0; i < len; i += 1) {
  16066. if (letters[i].n) {
  16067. count += 1;
  16068. } else {
  16069. textSpan = this.textSpans[i];
  16070. textPath = this.textPaths[i];
  16071. renderedLetter = renderedLetters[count];
  16072. count += 1;
  16073. if (renderedLetter._mdf.m) {
  16074. if (!this.isMasked) {
  16075. textSpan.style.webkitTransform = renderedLetter.m;
  16076. textSpan.style.transform = renderedLetter.m;
  16077. } else {
  16078. textSpan.setAttribute('transform', renderedLetter.m);
  16079. }
  16080. } /// /textSpan.setAttribute('opacity',renderedLetter.o);
  16081. textSpan.style.opacity = renderedLetter.o;
  16082. if (renderedLetter.sw && renderedLetter._mdf.sw) {
  16083. textPath.setAttribute('stroke-width', renderedLetter.sw);
  16084. }
  16085. if (renderedLetter.sc && renderedLetter._mdf.sc) {
  16086. textPath.setAttribute('stroke', renderedLetter.sc);
  16087. }
  16088. if (renderedLetter.fc && renderedLetter._mdf.fc) {
  16089. textPath.setAttribute('fill', renderedLetter.fc);
  16090. textPath.style.color = renderedLetter.fc;
  16091. }
  16092. }
  16093. }
  16094. if (this.innerElem.getBBox && !this.hidden && (this._isFirstFrame || this._mdf)) {
  16095. var boundingBox = this.innerElem.getBBox();
  16096. if (this.currentBBox.w !== boundingBox.width) {
  16097. this.currentBBox.w = boundingBox.width;
  16098. this.svgElement.setAttribute('width', boundingBox.width);
  16099. }
  16100. if (this.currentBBox.h !== boundingBox.height) {
  16101. this.currentBBox.h = boundingBox.height;
  16102. this.svgElement.setAttribute('height', boundingBox.height);
  16103. }
  16104. var margin = 1;
  16105. if (this.currentBBox.w !== boundingBox.width + margin * 2 || this.currentBBox.h !== boundingBox.height + margin * 2 || this.currentBBox.x !== boundingBox.x - margin || this.currentBBox.y !== boundingBox.y - margin) {
  16106. this.currentBBox.w = boundingBox.width + margin * 2;
  16107. this.currentBBox.h = boundingBox.height + margin * 2;
  16108. this.currentBBox.x = boundingBox.x - margin;
  16109. this.currentBBox.y = boundingBox.y - margin;
  16110. this.svgElement.setAttribute('viewBox', this.currentBBox.x + ' ' + this.currentBBox.y + ' ' + this.currentBBox.w + ' ' + this.currentBBox.h);
  16111. svgStyle = this.svgElement.style;
  16112. var svgTransform = 'translate(' + this.currentBBox.x + 'px,' + this.currentBBox.y + 'px)';
  16113. svgStyle.transform = svgTransform;
  16114. svgStyle.webkitTransform = svgTransform;
  16115. }
  16116. }
  16117. };
  16118. function HCameraElement(data, globalData, comp) {
  16119. this.initFrame();
  16120. this.initBaseData(data, globalData, comp);
  16121. this.initHierarchy();
  16122. var getProp = PropertyFactory.getProp;
  16123. this.pe = getProp(this, data.pe, 0, 0, this);
  16124. if (data.ks.p.s) {
  16125. this.px = getProp(this, data.ks.p.x, 1, 0, this);
  16126. this.py = getProp(this, data.ks.p.y, 1, 0, this);
  16127. this.pz = getProp(this, data.ks.p.z, 1, 0, this);
  16128. } else {
  16129. this.p = getProp(this, data.ks.p, 1, 0, this);
  16130. }
  16131. if (data.ks.a) {
  16132. this.a = getProp(this, data.ks.a, 1, 0, this);
  16133. }
  16134. if (data.ks.or.k.length && data.ks.or.k[0].to) {
  16135. var i;
  16136. var len = data.ks.or.k.length;
  16137. for (i = 0; i < len; i += 1) {
  16138. data.ks.or.k[i].to = null;
  16139. data.ks.or.k[i].ti = null;
  16140. }
  16141. }
  16142. this.or = getProp(this, data.ks.or, 1, degToRads, this);
  16143. this.or.sh = true;
  16144. this.rx = getProp(this, data.ks.rx, 0, degToRads, this);
  16145. this.ry = getProp(this, data.ks.ry, 0, degToRads, this);
  16146. this.rz = getProp(this, data.ks.rz, 0, degToRads, this);
  16147. this.mat = new Matrix();
  16148. this._prevMat = new Matrix();
  16149. this._isFirstFrame = true; // TODO: find a better way to make the HCamera element to be compatible with the LayerInterface and TransformInterface.
  16150. this.finalTransform = {
  16151. mProp: this
  16152. };
  16153. }
  16154. extendPrototype([BaseElement, FrameElement, HierarchyElement], HCameraElement);
  16155. HCameraElement.prototype.setup = function () {
  16156. var i;
  16157. var len = this.comp.threeDElements.length;
  16158. var comp;
  16159. var perspectiveStyle;
  16160. var containerStyle;
  16161. for (i = 0; i < len; i += 1) {
  16162. // [perspectiveElem,container]
  16163. comp = this.comp.threeDElements[i];
  16164. if (comp.type === '3d') {
  16165. perspectiveStyle = comp.perspectiveElem.style;
  16166. containerStyle = comp.container.style;
  16167. var perspective = this.pe.v + 'px';
  16168. var origin = '0px 0px 0px';
  16169. var matrix = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)';
  16170. perspectiveStyle.perspective = perspective;
  16171. perspectiveStyle.webkitPerspective = perspective;
  16172. containerStyle.transformOrigin = origin;
  16173. containerStyle.mozTransformOrigin = origin;
  16174. containerStyle.webkitTransformOrigin = origin;
  16175. perspectiveStyle.transform = matrix;
  16176. perspectiveStyle.webkitTransform = matrix;
  16177. }
  16178. }
  16179. };
  16180. HCameraElement.prototype.createElements = function () {};
  16181. HCameraElement.prototype.hide = function () {};
  16182. HCameraElement.prototype.renderFrame = function () {
  16183. var _mdf = this._isFirstFrame;
  16184. var i;
  16185. var len;
  16186. if (this.hierarchy) {
  16187. len = this.hierarchy.length;
  16188. for (i = 0; i < len; i += 1) {
  16189. _mdf = this.hierarchy[i].finalTransform.mProp._mdf || _mdf;
  16190. }
  16191. }
  16192. if (_mdf || 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) {
  16193. this.mat.reset();
  16194. if (this.hierarchy) {
  16195. len = this.hierarchy.length - 1;
  16196. for (i = len; i >= 0; i -= 1) {
  16197. var mTransf = this.hierarchy[i].finalTransform.mProp;
  16198. this.mat.translate(-mTransf.p.v[0], -mTransf.p.v[1], mTransf.p.v[2]);
  16199. this.mat.rotateX(-mTransf.or.v[0]).rotateY(-mTransf.or.v[1]).rotateZ(mTransf.or.v[2]);
  16200. this.mat.rotateX(-mTransf.rx.v).rotateY(-mTransf.ry.v).rotateZ(mTransf.rz.v);
  16201. this.mat.scale(1 / mTransf.s.v[0], 1 / mTransf.s.v[1], 1 / mTransf.s.v[2]);
  16202. this.mat.translate(mTransf.a.v[0], mTransf.a.v[1], mTransf.a.v[2]);
  16203. }
  16204. }
  16205. if (this.p) {
  16206. this.mat.translate(-this.p.v[0], -this.p.v[1], this.p.v[2]);
  16207. } else {
  16208. this.mat.translate(-this.px.v, -this.py.v, this.pz.v);
  16209. }
  16210. if (this.a) {
  16211. var diffVector;
  16212. if (this.p) {
  16213. diffVector = [this.p.v[0] - this.a.v[0], this.p.v[1] - this.a.v[1], this.p.v[2] - this.a.v[2]];
  16214. } else {
  16215. diffVector = [this.px.v - this.a.v[0], this.py.v - this.a.v[1], this.pz.v - this.a.v[2]];
  16216. }
  16217. var mag = Math.sqrt(Math.pow(diffVector[0], 2) + Math.pow(diffVector[1], 2) + Math.pow(diffVector[2], 2)); // var lookDir = getNormalizedPoint(getDiffVector(this.a.v,this.p.v));
  16218. var lookDir = [diffVector[0] / mag, diffVector[1] / mag, diffVector[2] / mag];
  16219. var lookLengthOnXZ = Math.sqrt(lookDir[2] * lookDir[2] + lookDir[0] * lookDir[0]);
  16220. var mRotationX = Math.atan2(lookDir[1], lookLengthOnXZ);
  16221. var mRotationY = Math.atan2(lookDir[0], -lookDir[2]);
  16222. this.mat.rotateY(mRotationY).rotateX(-mRotationX);
  16223. }
  16224. this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v);
  16225. this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]);
  16226. this.mat.translate(this.globalData.compSize.w / 2, this.globalData.compSize.h / 2, 0);
  16227. this.mat.translate(0, 0, this.pe.v);
  16228. var hasMatrixChanged = !this._prevMat.equals(this.mat);
  16229. if ((hasMatrixChanged || this.pe._mdf) && this.comp.threeDElements) {
  16230. len = this.comp.threeDElements.length;
  16231. var comp;
  16232. var perspectiveStyle;
  16233. var containerStyle;
  16234. for (i = 0; i < len; i += 1) {
  16235. comp = this.comp.threeDElements[i];
  16236. if (comp.type === '3d') {
  16237. if (hasMatrixChanged) {
  16238. var matValue = this.mat.toCSS();
  16239. containerStyle = comp.container.style;
  16240. containerStyle.transform = matValue;
  16241. containerStyle.webkitTransform = matValue;
  16242. }
  16243. if (this.pe._mdf) {
  16244. perspectiveStyle = comp.perspectiveElem.style;
  16245. perspectiveStyle.perspective = this.pe.v + 'px';
  16246. perspectiveStyle.webkitPerspective = this.pe.v + 'px';
  16247. }
  16248. }
  16249. }
  16250. this.mat.clone(this._prevMat);
  16251. }
  16252. }
  16253. this._isFirstFrame = false;
  16254. };
  16255. HCameraElement.prototype.prepareFrame = function (num) {
  16256. this.prepareProperties(num, true);
  16257. };
  16258. HCameraElement.prototype.destroy = function () {};
  16259. HCameraElement.prototype.getBaseElement = function () {
  16260. return null;
  16261. };
  16262. function HImageElement(data, globalData, comp) {
  16263. this.assetData = globalData.getAssetData(data.refId);
  16264. this.initElement(data, globalData, comp);
  16265. }
  16266. extendPrototype([BaseElement, TransformElement, HBaseElement, HSolidElement, HierarchyElement, FrameElement, RenderableElement], HImageElement);
  16267. HImageElement.prototype.createContent = function () {
  16268. var assetPath = this.globalData.getAssetsPath(this.assetData);
  16269. var img = new Image();
  16270. if (this.data.hasMask) {
  16271. this.imageElem = createNS('image');
  16272. this.imageElem.setAttribute('width', this.assetData.w + 'px');
  16273. this.imageElem.setAttribute('height', this.assetData.h + 'px');
  16274. this.imageElem.setAttributeNS('http://www.w3.org/1999/xlink', 'href', assetPath);
  16275. this.layerElement.appendChild(this.imageElem);
  16276. this.baseElement.setAttribute('width', this.assetData.w);
  16277. this.baseElement.setAttribute('height', this.assetData.h);
  16278. } else {
  16279. this.layerElement.appendChild(img);
  16280. }
  16281. img.crossOrigin = 'anonymous';
  16282. img.src = assetPath;
  16283. if (this.data.ln) {
  16284. this.baseElement.setAttribute('id', this.data.ln);
  16285. }
  16286. };
  16287. function HybridRendererBase(animationItem, config) {
  16288. this.animationItem = animationItem;
  16289. this.layers = null;
  16290. this.renderedFrame = -1;
  16291. this.renderConfig = {
  16292. className: config && config.className || '',
  16293. imagePreserveAspectRatio: config && config.imagePreserveAspectRatio || 'xMidYMid slice',
  16294. hideOnTransparent: !(config && config.hideOnTransparent === false),
  16295. filterSize: {
  16296. width: config && config.filterSize && config.filterSize.width || '400%',
  16297. height: config && config.filterSize && config.filterSize.height || '400%',
  16298. x: config && config.filterSize && config.filterSize.x || '-100%',
  16299. y: config && config.filterSize && config.filterSize.y || '-100%'
  16300. }
  16301. };
  16302. this.globalData = {
  16303. _mdf: false,
  16304. frameNum: -1,
  16305. renderConfig: this.renderConfig
  16306. };
  16307. this.pendingElements = [];
  16308. this.elements = [];
  16309. this.threeDElements = [];
  16310. this.destroyed = false;
  16311. this.camera = null;
  16312. this.supports3d = true;
  16313. this.rendererType = 'html';
  16314. }
  16315. extendPrototype([BaseRenderer], HybridRendererBase);
  16316. HybridRendererBase.prototype.buildItem = SVGRenderer.prototype.buildItem;
  16317. HybridRendererBase.prototype.checkPendingElements = function () {
  16318. while (this.pendingElements.length) {
  16319. var element = this.pendingElements.pop();
  16320. element.checkParenting();
  16321. }
  16322. };
  16323. HybridRendererBase.prototype.appendElementInPos = function (element, pos) {
  16324. var newDOMElement = element.getBaseElement();
  16325. if (!newDOMElement) {
  16326. return;
  16327. }
  16328. var layer = this.layers[pos];
  16329. if (!layer.ddd || !this.supports3d) {
  16330. if (this.threeDElements) {
  16331. this.addTo3dContainer(newDOMElement, pos);
  16332. } else {
  16333. var i = 0;
  16334. var nextDOMElement;
  16335. var nextLayer;
  16336. var tmpDOMElement;
  16337. while (i < pos) {
  16338. if (this.elements[i] && this.elements[i] !== true && this.elements[i].getBaseElement) {
  16339. nextLayer = this.elements[i];
  16340. tmpDOMElement = this.layers[i].ddd ? this.getThreeDContainerByPos(i) : nextLayer.getBaseElement();
  16341. nextDOMElement = tmpDOMElement || nextDOMElement;
  16342. }
  16343. i += 1;
  16344. }
  16345. if (nextDOMElement) {
  16346. if (!layer.ddd || !this.supports3d) {
  16347. this.layerElement.insertBefore(newDOMElement, nextDOMElement);
  16348. }
  16349. } else if (!layer.ddd || !this.supports3d) {
  16350. this.layerElement.appendChild(newDOMElement);
  16351. }
  16352. }
  16353. } else {
  16354. this.addTo3dContainer(newDOMElement, pos);
  16355. }
  16356. };
  16357. HybridRendererBase.prototype.createShape = function (data) {
  16358. if (!this.supports3d) {
  16359. return new SVGShapeElement(data, this.globalData, this);
  16360. }
  16361. return new HShapeElement(data, this.globalData, this);
  16362. };
  16363. HybridRendererBase.prototype.createText = function (data) {
  16364. if (!this.supports3d) {
  16365. return new SVGTextLottieElement(data, this.globalData, this);
  16366. }
  16367. return new HTextElement(data, this.globalData, this);
  16368. };
  16369. HybridRendererBase.prototype.createCamera = function (data) {
  16370. this.camera = new HCameraElement(data, this.globalData, this);
  16371. return this.camera;
  16372. };
  16373. HybridRendererBase.prototype.createImage = function (data) {
  16374. if (!this.supports3d) {
  16375. return new IImageElement(data, this.globalData, this);
  16376. }
  16377. return new HImageElement(data, this.globalData, this);
  16378. };
  16379. HybridRendererBase.prototype.createSolid = function (data) {
  16380. if (!this.supports3d) {
  16381. return new ISolidElement(data, this.globalData, this);
  16382. }
  16383. return new HSolidElement(data, this.globalData, this);
  16384. };
  16385. HybridRendererBase.prototype.createNull = SVGRenderer.prototype.createNull;
  16386. HybridRendererBase.prototype.getThreeDContainerByPos = function (pos) {
  16387. var i = 0;
  16388. var len = this.threeDElements.length;
  16389. while (i < len) {
  16390. if (this.threeDElements[i].startPos <= pos && this.threeDElements[i].endPos >= pos) {
  16391. return this.threeDElements[i].perspectiveElem;
  16392. }
  16393. i += 1;
  16394. }
  16395. return null;
  16396. };
  16397. HybridRendererBase.prototype.createThreeDContainer = function (pos, type) {
  16398. var perspectiveElem = createTag('div');
  16399. var style;
  16400. var containerStyle;
  16401. styleDiv(perspectiveElem);
  16402. var container = createTag('div');
  16403. styleDiv(container);
  16404. if (type === '3d') {
  16405. style = perspectiveElem.style;
  16406. style.width = this.globalData.compSize.w + 'px';
  16407. style.height = this.globalData.compSize.h + 'px';
  16408. var center = '50% 50%';
  16409. style.webkitTransformOrigin = center;
  16410. style.mozTransformOrigin = center;
  16411. style.transformOrigin = center;
  16412. containerStyle = container.style;
  16413. var matrix = 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)';
  16414. containerStyle.transform = matrix;
  16415. containerStyle.webkitTransform = matrix;
  16416. }
  16417. perspectiveElem.appendChild(container); // this.resizerElem.appendChild(perspectiveElem);
  16418. var threeDContainerData = {
  16419. container: container,
  16420. perspectiveElem: perspectiveElem,
  16421. startPos: pos,
  16422. endPos: pos,
  16423. type: type
  16424. };
  16425. this.threeDElements.push(threeDContainerData);
  16426. return threeDContainerData;
  16427. };
  16428. HybridRendererBase.prototype.build3dContainers = function () {
  16429. var i;
  16430. var len = this.layers.length;
  16431. var lastThreeDContainerData;
  16432. var currentContainer = '';
  16433. for (i = 0; i < len; i += 1) {
  16434. if (this.layers[i].ddd && this.layers[i].ty !== 3) {
  16435. if (currentContainer !== '3d') {
  16436. currentContainer = '3d';
  16437. lastThreeDContainerData = this.createThreeDContainer(i, '3d');
  16438. }
  16439. lastThreeDContainerData.endPos = Math.max(lastThreeDContainerData.endPos, i);
  16440. } else {
  16441. if (currentContainer !== '2d') {
  16442. currentContainer = '2d';
  16443. lastThreeDContainerData = this.createThreeDContainer(i, '2d');
  16444. }
  16445. lastThreeDContainerData.endPos = Math.max(lastThreeDContainerData.endPos, i);
  16446. }
  16447. }
  16448. len = this.threeDElements.length;
  16449. for (i = len - 1; i >= 0; i -= 1) {
  16450. this.resizerElem.appendChild(this.threeDElements[i].perspectiveElem);
  16451. }
  16452. };
  16453. HybridRendererBase.prototype.addTo3dContainer = function (elem, pos) {
  16454. var i = 0;
  16455. var len = this.threeDElements.length;
  16456. while (i < len) {
  16457. if (pos <= this.threeDElements[i].endPos) {
  16458. var j = this.threeDElements[i].startPos;
  16459. var nextElement;
  16460. while (j < pos) {
  16461. if (this.elements[j] && this.elements[j].getBaseElement) {
  16462. nextElement = this.elements[j].getBaseElement();
  16463. }
  16464. j += 1;
  16465. }
  16466. if (nextElement) {
  16467. this.threeDElements[i].container.insertBefore(elem, nextElement);
  16468. } else {
  16469. this.threeDElements[i].container.appendChild(elem);
  16470. }
  16471. break;
  16472. }
  16473. i += 1;
  16474. }
  16475. };
  16476. HybridRendererBase.prototype.configAnimation = function (animData) {
  16477. var resizerElem = createTag('div');
  16478. var wrapper = this.animationItem.wrapper;
  16479. var style = resizerElem.style;
  16480. style.width = animData.w + 'px';
  16481. style.height = animData.h + 'px';
  16482. this.resizerElem = resizerElem;
  16483. styleDiv(resizerElem);
  16484. style.transformStyle = 'flat';
  16485. style.mozTransformStyle = 'flat';
  16486. style.webkitTransformStyle = 'flat';
  16487. if (this.renderConfig.className) {
  16488. resizerElem.setAttribute('class', this.renderConfig.className);
  16489. }
  16490. wrapper.appendChild(resizerElem);
  16491. style.overflow = 'hidden';
  16492. var svg = createNS('svg');
  16493. svg.setAttribute('width', '1');
  16494. svg.setAttribute('height', '1');
  16495. styleDiv(svg);
  16496. this.resizerElem.appendChild(svg);
  16497. var defs = createNS('defs');
  16498. svg.appendChild(defs);
  16499. this.data = animData; // Mask animation
  16500. this.setupGlobalData(animData, svg);
  16501. this.globalData.defs = defs;
  16502. this.layers = animData.layers;
  16503. this.layerElement = this.resizerElem;
  16504. this.build3dContainers();
  16505. this.updateContainerSize();
  16506. };
  16507. HybridRendererBase.prototype.destroy = function () {
  16508. if (this.animationItem.wrapper) {
  16509. this.animationItem.wrapper.innerText = '';
  16510. }
  16511. this.animationItem.container = null;
  16512. this.globalData.defs = null;
  16513. var i;
  16514. var len = this.layers ? this.layers.length : 0;
  16515. for (i = 0; i < len; i += 1) {
  16516. if (this.elements[i] && this.elements[i].destroy) {
  16517. this.elements[i].destroy();
  16518. }
  16519. }
  16520. this.elements.length = 0;
  16521. this.destroyed = true;
  16522. this.animationItem = null;
  16523. };
  16524. HybridRendererBase.prototype.updateContainerSize = function () {
  16525. var elementWidth = this.animationItem.wrapper.offsetWidth;
  16526. var elementHeight = this.animationItem.wrapper.offsetHeight;
  16527. var elementRel = elementWidth / elementHeight;
  16528. var animationRel = this.globalData.compSize.w / this.globalData.compSize.h;
  16529. var sx;
  16530. var sy;
  16531. var tx;
  16532. var ty;
  16533. if (animationRel > elementRel) {
  16534. sx = elementWidth / this.globalData.compSize.w;
  16535. sy = elementWidth / this.globalData.compSize.w;
  16536. tx = 0;
  16537. ty = (elementHeight - this.globalData.compSize.h * (elementWidth / this.globalData.compSize.w)) / 2;
  16538. } else {
  16539. sx = elementHeight / this.globalData.compSize.h;
  16540. sy = elementHeight / this.globalData.compSize.h;
  16541. tx = (elementWidth - this.globalData.compSize.w * (elementHeight / this.globalData.compSize.h)) / 2;
  16542. ty = 0;
  16543. }
  16544. var style = this.resizerElem.style;
  16545. style.webkitTransform = 'matrix3d(' + sx + ',0,0,0,0,' + sy + ',0,0,0,0,1,0,' + tx + ',' + ty + ',0,1)';
  16546. style.transform = style.webkitTransform;
  16547. };
  16548. HybridRendererBase.prototype.renderFrame = SVGRenderer.prototype.renderFrame;
  16549. HybridRendererBase.prototype.hide = function () {
  16550. this.resizerElem.style.display = 'none';
  16551. };
  16552. HybridRendererBase.prototype.show = function () {
  16553. this.resizerElem.style.display = 'block';
  16554. };
  16555. HybridRendererBase.prototype.initItems = function () {
  16556. this.buildAllItems();
  16557. if (this.camera) {
  16558. this.camera.setup();
  16559. } else {
  16560. var cWidth = this.globalData.compSize.w;
  16561. var cHeight = this.globalData.compSize.h;
  16562. var i;
  16563. var len = this.threeDElements.length;
  16564. for (i = 0; i < len; i += 1) {
  16565. var style = this.threeDElements[i].perspectiveElem.style;
  16566. style.webkitPerspective = Math.sqrt(Math.pow(cWidth, 2) + Math.pow(cHeight, 2)) + 'px';
  16567. style.perspective = style.webkitPerspective;
  16568. }
  16569. }
  16570. };
  16571. HybridRendererBase.prototype.searchExtraCompositions = function (assets) {
  16572. var i;
  16573. var len = assets.length;
  16574. var floatingContainer = createTag('div');
  16575. for (i = 0; i < len; i += 1) {
  16576. if (assets[i].xt) {
  16577. var comp = this.createComp(assets[i], floatingContainer, this.globalData.comp, null);
  16578. comp.initExpressions();
  16579. this.globalData.projectInterface.registerComposition(comp);
  16580. }
  16581. }
  16582. };
  16583. function HCompElement(data, globalData, comp) {
  16584. this.layers = data.layers;
  16585. this.supports3d = !data.hasMask;
  16586. this.completeLayers = false;
  16587. this.pendingElements = [];
  16588. this.elements = this.layers ? createSizedArray(this.layers.length) : [];
  16589. this.initElement(data, globalData, comp);
  16590. this.tm = data.tm ? PropertyFactory.getProp(this, data.tm, 0, globalData.frameRate, this) : {
  16591. _placeholder: true
  16592. };
  16593. }
  16594. extendPrototype([HybridRendererBase, ICompElement, HBaseElement], HCompElement);
  16595. HCompElement.prototype._createBaseContainerElements = HCompElement.prototype.createContainerElements;
  16596. HCompElement.prototype.createContainerElements = function () {
  16597. this._createBaseContainerElements(); // divElement.style.clip = 'rect(0px, '+this.data.w+'px, '+this.data.h+'px, 0px)';
  16598. if (this.data.hasMask) {
  16599. this.svgElement.setAttribute('width', this.data.w);
  16600. this.svgElement.setAttribute('height', this.data.h);
  16601. this.transformedElement = this.baseElement;
  16602. } else {
  16603. this.transformedElement = this.layerElement;
  16604. }
  16605. };
  16606. HCompElement.prototype.addTo3dContainer = function (elem, pos) {
  16607. var j = 0;
  16608. var nextElement;
  16609. while (j < pos) {
  16610. if (this.elements[j] && this.elements[j].getBaseElement) {
  16611. nextElement = this.elements[j].getBaseElement();
  16612. }
  16613. j += 1;
  16614. }
  16615. if (nextElement) {
  16616. this.layerElement.insertBefore(elem, nextElement);
  16617. } else {
  16618. this.layerElement.appendChild(elem);
  16619. }
  16620. };
  16621. HCompElement.prototype.createComp = function (data) {
  16622. if (!this.supports3d) {
  16623. return new SVGCompElement(data, this.globalData, this);
  16624. }
  16625. return new HCompElement(data, this.globalData, this);
  16626. };
  16627. function HybridRenderer(animationItem, config) {
  16628. this.animationItem = animationItem;
  16629. this.layers = null;
  16630. this.renderedFrame = -1;
  16631. this.renderConfig = {
  16632. className: config && config.className || '',
  16633. imagePreserveAspectRatio: config && config.imagePreserveAspectRatio || 'xMidYMid slice',
  16634. hideOnTransparent: !(config && config.hideOnTransparent === false),
  16635. filterSize: {
  16636. width: config && config.filterSize && config.filterSize.width || '400%',
  16637. height: config && config.filterSize && config.filterSize.height || '400%',
  16638. x: config && config.filterSize && config.filterSize.x || '-100%',
  16639. y: config && config.filterSize && config.filterSize.y || '-100%'
  16640. },
  16641. runExpressions: !config || config.runExpressions === undefined || config.runExpressions
  16642. };
  16643. this.globalData = {
  16644. _mdf: false,
  16645. frameNum: -1,
  16646. renderConfig: this.renderConfig
  16647. };
  16648. this.pendingElements = [];
  16649. this.elements = [];
  16650. this.threeDElements = [];
  16651. this.destroyed = false;
  16652. this.camera = null;
  16653. this.supports3d = true;
  16654. this.rendererType = 'html';
  16655. }
  16656. extendPrototype([HybridRendererBase], HybridRenderer);
  16657. HybridRenderer.prototype.createComp = function (data) {
  16658. if (!this.supports3d) {
  16659. return new SVGCompElement(data, this.globalData, this);
  16660. }
  16661. return new HCompElement(data, this.globalData, this);
  16662. };
  16663. var CompExpressionInterface = function () {
  16664. return function (comp) {
  16665. function _thisLayerFunction(name) {
  16666. var i = 0;
  16667. var len = comp.layers.length;
  16668. while (i < len) {
  16669. if (comp.layers[i].nm === name || comp.layers[i].ind === name) {
  16670. return comp.elements[i].layerInterface;
  16671. }
  16672. i += 1;
  16673. }
  16674. return null; // return {active:false};
  16675. }
  16676. Object.defineProperty(_thisLayerFunction, '_name', {
  16677. value: comp.data.nm
  16678. });
  16679. _thisLayerFunction.layer = _thisLayerFunction;
  16680. _thisLayerFunction.pixelAspect = 1;
  16681. _thisLayerFunction.height = comp.data.h || comp.globalData.compSize.h;
  16682. _thisLayerFunction.width = comp.data.w || comp.globalData.compSize.w;
  16683. _thisLayerFunction.pixelAspect = 1;
  16684. _thisLayerFunction.frameDuration = 1 / comp.globalData.frameRate;
  16685. _thisLayerFunction.displayStartTime = 0;
  16686. _thisLayerFunction.numLayers = comp.layers.length;
  16687. return _thisLayerFunction;
  16688. };
  16689. }();
  16690. function _typeof$2(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$2 = function _typeof(obj) { return typeof obj; }; } else { _typeof$2 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$2(obj); }
  16691. /* eslint-disable */
  16692. /*
  16693. Copyright 2014 David Bau.
  16694. Permission is hereby granted, free of charge, to any person obtaining
  16695. a copy of this software and associated documentation files (the
  16696. "Software"), to deal in the Software without restriction, including
  16697. without limitation the rights to use, copy, modify, merge, publish,
  16698. distribute, sublicense, and/or sell copies of the Software, and to
  16699. permit persons to whom the Software is furnished to do so, subject to
  16700. the following conditions:
  16701. The above copyright notice and this permission notice shall be
  16702. included in all copies or substantial portions of the Software.
  16703. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  16704. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  16705. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  16706. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  16707. CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  16708. TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  16709. SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  16710. */
  16711. function seedRandom(pool, math) {
  16712. //
  16713. // The following constants are related to IEEE 754 limits.
  16714. //
  16715. var global = this,
  16716. width = 256,
  16717. // each RC4 output is 0 <= x < 256
  16718. chunks = 6,
  16719. // at least six RC4 outputs for each double
  16720. digits = 52,
  16721. // there are 52 significant digits in a double
  16722. rngname = 'random',
  16723. // rngname: name for Math.random and Math.seedrandom
  16724. startdenom = math.pow(width, chunks),
  16725. significance = math.pow(2, digits),
  16726. overflow = significance * 2,
  16727. mask = width - 1,
  16728. nodecrypto; // node.js crypto module, initialized at the bottom.
  16729. //
  16730. // seedrandom()
  16731. // This is the seedrandom function described above.
  16732. //
  16733. function seedrandom(seed, options, callback) {
  16734. var key = [];
  16735. options = options === true ? {
  16736. entropy: true
  16737. } : options || {}; // Flatten the seed string or build one from local entropy if needed.
  16738. var shortseed = mixkey(flatten(options.entropy ? [seed, tostring(pool)] : seed === null ? autoseed() : seed, 3), key); // Use the seed to initialize an ARC4 generator.
  16739. var arc4 = new ARC4(key); // This function returns a random double in [0, 1) that contains
  16740. // randomness in every bit of the mantissa of the IEEE 754 value.
  16741. var prng = function prng() {
  16742. var n = arc4.g(chunks),
  16743. // Start with a numerator n < 2 ^ 48
  16744. d = startdenom,
  16745. // and denominator d = 2 ^ 48.
  16746. x = 0; // and no 'extra last byte'.
  16747. while (n < significance) {
  16748. // Fill up all significant digits by
  16749. n = (n + x) * width; // shifting numerator and
  16750. d *= width; // denominator and generating a
  16751. x = arc4.g(1); // new least-significant-byte.
  16752. }
  16753. while (n >= overflow) {
  16754. // To avoid rounding up, before adding
  16755. n /= 2; // last byte, shift everything
  16756. d /= 2; // right using integer math until
  16757. x >>>= 1; // we have exactly the desired bits.
  16758. }
  16759. return (n + x) / d; // Form the number within [0, 1).
  16760. };
  16761. prng.int32 = function () {
  16762. return arc4.g(4) | 0;
  16763. };
  16764. prng.quick = function () {
  16765. return arc4.g(4) / 0x100000000;
  16766. };
  16767. prng["double"] = prng; // Mix the randomness into accumulated entropy.
  16768. mixkey(tostring(arc4.S), pool); // Calling convention: what to return as a function of prng, seed, is_math.
  16769. return (options.pass || callback || function (prng, seed, is_math_call, state) {
  16770. if (state) {
  16771. // Load the arc4 state from the given state if it has an S array.
  16772. if (state.S) {
  16773. copy(state, arc4);
  16774. } // Only provide the .state method if requested via options.state.
  16775. prng.state = function () {
  16776. return copy(arc4, {});
  16777. };
  16778. } // If called as a method of Math (Math.seedrandom()), mutate
  16779. // Math.random because that is how seedrandom.js has worked since v1.0.
  16780. if (is_math_call) {
  16781. math[rngname] = prng;
  16782. return seed;
  16783. } // Otherwise, it is a newer calling convention, so return the
  16784. // prng directly.
  16785. else return prng;
  16786. })(prng, shortseed, 'global' in options ? options.global : this == math, options.state);
  16787. }
  16788. math['seed' + rngname] = seedrandom; //
  16789. // ARC4
  16790. //
  16791. // An ARC4 implementation. The constructor takes a key in the form of
  16792. // an array of at most (width) integers that should be 0 <= x < (width).
  16793. //
  16794. // The g(count) method returns a pseudorandom integer that concatenates
  16795. // the next (count) outputs from ARC4. Its return value is a number x
  16796. // that is in the range 0 <= x < (width ^ count).
  16797. //
  16798. function ARC4(key) {
  16799. var t,
  16800. keylen = key.length,
  16801. me = this,
  16802. i = 0,
  16803. j = me.i = me.j = 0,
  16804. s = me.S = []; // The empty key [] is treated as [0].
  16805. if (!keylen) {
  16806. key = [keylen++];
  16807. } // Set up S using the standard key scheduling algorithm.
  16808. while (i < width) {
  16809. s[i] = i++;
  16810. }
  16811. for (i = 0; i < width; i++) {
  16812. s[i] = s[j = mask & j + key[i % keylen] + (t = s[i])];
  16813. s[j] = t;
  16814. } // The "g" method returns the next (count) outputs as one number.
  16815. me.g = function (count) {
  16816. // Using instance members instead of closure state nearly doubles speed.
  16817. var t,
  16818. r = 0,
  16819. i = me.i,
  16820. j = me.j,
  16821. s = me.S;
  16822. while (count--) {
  16823. t = s[i = mask & i + 1];
  16824. r = r * width + s[mask & (s[i] = s[j = mask & j + t]) + (s[j] = t)];
  16825. }
  16826. me.i = i;
  16827. me.j = j;
  16828. return r; // For robust unpredictability, the function call below automatically
  16829. // discards an initial batch of values. This is called RC4-drop[256].
  16830. // See http://google.com/search?q=rsa+fluhrer+response&btnI
  16831. };
  16832. } //
  16833. // copy()
  16834. // Copies internal state of ARC4 to or from a plain object.
  16835. //
  16836. function copy(f, t) {
  16837. t.i = f.i;
  16838. t.j = f.j;
  16839. t.S = f.S.slice();
  16840. return t;
  16841. } //
  16842. // flatten()
  16843. // Converts an object tree to nested arrays of strings.
  16844. //
  16845. function flatten(obj, depth) {
  16846. var result = [],
  16847. typ = _typeof$2(obj),
  16848. prop;
  16849. if (depth && typ == 'object') {
  16850. for (prop in obj) {
  16851. try {
  16852. result.push(flatten(obj[prop], depth - 1));
  16853. } catch (e) {}
  16854. }
  16855. }
  16856. return result.length ? result : typ == 'string' ? obj : obj + '\0';
  16857. } //
  16858. // mixkey()
  16859. // Mixes a string seed into a key that is an array of integers, and
  16860. // returns a shortened string seed that is equivalent to the result key.
  16861. //
  16862. function mixkey(seed, key) {
  16863. var stringseed = seed + '',
  16864. smear,
  16865. j = 0;
  16866. while (j < stringseed.length) {
  16867. key[mask & j] = mask & (smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++);
  16868. }
  16869. return tostring(key);
  16870. } //
  16871. // autoseed()
  16872. // Returns an object for autoseeding, using window.crypto and Node crypto
  16873. // module if available.
  16874. //
  16875. function autoseed() {
  16876. try {
  16877. if (nodecrypto) {
  16878. return tostring(nodecrypto.randomBytes(width));
  16879. }
  16880. var out = new Uint8Array(width);
  16881. (global.crypto || global.msCrypto).getRandomValues(out);
  16882. return tostring(out);
  16883. } catch (e) {
  16884. var browser = global.navigator,
  16885. plugins = browser && browser.plugins;
  16886. return [+new Date(), global, plugins, global.screen, tostring(pool)];
  16887. }
  16888. } //
  16889. // tostring()
  16890. // Converts an array of charcodes to a string
  16891. //
  16892. function tostring(a) {
  16893. return String.fromCharCode.apply(0, a);
  16894. } //
  16895. // When seedrandom.js is loaded, we immediately mix a few bits
  16896. // from the built-in RNG into the entropy pool. Because we do
  16897. // not want to interfere with deterministic PRNG state later,
  16898. // seedrandom will not call math.random on its own again after
  16899. // initialization.
  16900. //
  16901. mixkey(math.random(), pool); //
  16902. // Nodejs and AMD support: export the implementation as a module using
  16903. // either convention.
  16904. //
  16905. // End anonymous scope, and pass initial values.
  16906. }
  16907. ;
  16908. function initialize$2(BMMath) {
  16909. seedRandom([], BMMath);
  16910. }
  16911. var propTypes = {
  16912. SHAPE: 'shape'
  16913. };
  16914. function _typeof$1(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$1 = function _typeof(obj) { return typeof obj; }; } else { _typeof$1 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$1(obj); }
  16915. var ExpressionManager = function () {
  16916. 'use strict';
  16917. var ob = {};
  16918. var Math = BMMath;
  16919. var window = null;
  16920. var document = null;
  16921. var XMLHttpRequest = null;
  16922. var fetch = null;
  16923. var frames = null;
  16924. var _lottieGlobal = {};
  16925. initialize$2(BMMath);
  16926. function resetFrame() {
  16927. _lottieGlobal = {};
  16928. }
  16929. function $bm_isInstanceOfArray(arr) {
  16930. return arr.constructor === Array || arr.constructor === Float32Array;
  16931. }
  16932. function isNumerable(tOfV, v) {
  16933. return tOfV === 'number' || v instanceof Number || tOfV === 'boolean' || tOfV === 'string';
  16934. }
  16935. function $bm_neg(a) {
  16936. var tOfA = _typeof$1(a);
  16937. if (tOfA === 'number' || a instanceof Number || tOfA === 'boolean') {
  16938. return -a;
  16939. }
  16940. if ($bm_isInstanceOfArray(a)) {
  16941. var i;
  16942. var lenA = a.length;
  16943. var retArr = [];
  16944. for (i = 0; i < lenA; i += 1) {
  16945. retArr[i] = -a[i];
  16946. }
  16947. return retArr;
  16948. }
  16949. if (a.propType) {
  16950. return a.v;
  16951. }
  16952. return -a;
  16953. }
  16954. var easeInBez = BezierFactory.getBezierEasing(0.333, 0, 0.833, 0.833, 'easeIn').get;
  16955. var easeOutBez = BezierFactory.getBezierEasing(0.167, 0.167, 0.667, 1, 'easeOut').get;
  16956. var easeInOutBez = BezierFactory.getBezierEasing(0.33, 0, 0.667, 1, 'easeInOut').get;
  16957. function sum(a, b) {
  16958. var tOfA = _typeof$1(a);
  16959. var tOfB = _typeof$1(b);
  16960. if (isNumerable(tOfA, a) && isNumerable(tOfB, b) || tOfA === 'string' || tOfB === 'string') {
  16961. return a + b;
  16962. }
  16963. if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
  16964. a = a.slice(0);
  16965. a[0] += b;
  16966. return a;
  16967. }
  16968. if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
  16969. b = b.slice(0);
  16970. b[0] = a + b[0];
  16971. return b;
  16972. }
  16973. if ($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)) {
  16974. var i = 0;
  16975. var lenA = a.length;
  16976. var lenB = b.length;
  16977. var retArr = [];
  16978. while (i < lenA || i < lenB) {
  16979. if ((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)) {
  16980. retArr[i] = a[i] + b[i];
  16981. } else {
  16982. retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
  16983. }
  16984. i += 1;
  16985. }
  16986. return retArr;
  16987. }
  16988. return 0;
  16989. }
  16990. var add = sum;
  16991. function sub(a, b) {
  16992. var tOfA = _typeof$1(a);
  16993. var tOfB = _typeof$1(b);
  16994. if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
  16995. if (tOfA === 'string') {
  16996. a = parseInt(a, 10);
  16997. }
  16998. if (tOfB === 'string') {
  16999. b = parseInt(b, 10);
  17000. }
  17001. return a - b;
  17002. }
  17003. if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
  17004. a = a.slice(0);
  17005. a[0] -= b;
  17006. return a;
  17007. }
  17008. if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
  17009. b = b.slice(0);
  17010. b[0] = a - b[0];
  17011. return b;
  17012. }
  17013. if ($bm_isInstanceOfArray(a) && $bm_isInstanceOfArray(b)) {
  17014. var i = 0;
  17015. var lenA = a.length;
  17016. var lenB = b.length;
  17017. var retArr = [];
  17018. while (i < lenA || i < lenB) {
  17019. if ((typeof a[i] === 'number' || a[i] instanceof Number) && (typeof b[i] === 'number' || b[i] instanceof Number)) {
  17020. retArr[i] = a[i] - b[i];
  17021. } else {
  17022. retArr[i] = b[i] === undefined ? a[i] : a[i] || b[i];
  17023. }
  17024. i += 1;
  17025. }
  17026. return retArr;
  17027. }
  17028. return 0;
  17029. }
  17030. function mul(a, b) {
  17031. var tOfA = _typeof$1(a);
  17032. var tOfB = _typeof$1(b);
  17033. var arr;
  17034. if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
  17035. return a * b;
  17036. }
  17037. var i;
  17038. var len;
  17039. if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
  17040. len = a.length;
  17041. arr = createTypedArray('float32', len);
  17042. for (i = 0; i < len; i += 1) {
  17043. arr[i] = a[i] * b;
  17044. }
  17045. return arr;
  17046. }
  17047. if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
  17048. len = b.length;
  17049. arr = createTypedArray('float32', len);
  17050. for (i = 0; i < len; i += 1) {
  17051. arr[i] = a * b[i];
  17052. }
  17053. return arr;
  17054. }
  17055. return 0;
  17056. }
  17057. function div(a, b) {
  17058. var tOfA = _typeof$1(a);
  17059. var tOfB = _typeof$1(b);
  17060. var arr;
  17061. if (isNumerable(tOfA, a) && isNumerable(tOfB, b)) {
  17062. return a / b;
  17063. }
  17064. var i;
  17065. var len;
  17066. if ($bm_isInstanceOfArray(a) && isNumerable(tOfB, b)) {
  17067. len = a.length;
  17068. arr = createTypedArray('float32', len);
  17069. for (i = 0; i < len; i += 1) {
  17070. arr[i] = a[i] / b;
  17071. }
  17072. return arr;
  17073. }
  17074. if (isNumerable(tOfA, a) && $bm_isInstanceOfArray(b)) {
  17075. len = b.length;
  17076. arr = createTypedArray('float32', len);
  17077. for (i = 0; i < len; i += 1) {
  17078. arr[i] = a / b[i];
  17079. }
  17080. return arr;
  17081. }
  17082. return 0;
  17083. }
  17084. function mod(a, b) {
  17085. if (typeof a === 'string') {
  17086. a = parseInt(a, 10);
  17087. }
  17088. if (typeof b === 'string') {
  17089. b = parseInt(b, 10);
  17090. }
  17091. return a % b;
  17092. }
  17093. var $bm_sum = sum;
  17094. var $bm_sub = sub;
  17095. var $bm_mul = mul;
  17096. var $bm_div = div;
  17097. var $bm_mod = mod;
  17098. function clamp(num, min, max) {
  17099. if (min > max) {
  17100. var mm = max;
  17101. max = min;
  17102. min = mm;
  17103. }
  17104. return Math.min(Math.max(num, min), max);
  17105. }
  17106. function radiansToDegrees(val) {
  17107. return val / degToRads;
  17108. }
  17109. var radians_to_degrees = radiansToDegrees;
  17110. function degreesToRadians(val) {
  17111. return val * degToRads;
  17112. }
  17113. var degrees_to_radians = radiansToDegrees;
  17114. var helperLengthArray = [0, 0, 0, 0, 0, 0];
  17115. function length(arr1, arr2) {
  17116. if (typeof arr1 === 'number' || arr1 instanceof Number) {
  17117. arr2 = arr2 || 0;
  17118. return Math.abs(arr1 - arr2);
  17119. }
  17120. if (!arr2) {
  17121. arr2 = helperLengthArray;
  17122. }
  17123. var i;
  17124. var len = Math.min(arr1.length, arr2.length);
  17125. var addedLength = 0;
  17126. for (i = 0; i < len; i += 1) {
  17127. addedLength += Math.pow(arr2[i] - arr1[i], 2);
  17128. }
  17129. return Math.sqrt(addedLength);
  17130. }
  17131. function normalize(vec) {
  17132. return div(vec, length(vec));
  17133. }
  17134. function rgbToHsl(val) {
  17135. var r = val[0];
  17136. var g = val[1];
  17137. var b = val[2];
  17138. var max = Math.max(r, g, b);
  17139. var min = Math.min(r, g, b);
  17140. var h;
  17141. var s;
  17142. var l = (max + min) / 2;
  17143. if (max === min) {
  17144. h = 0; // achromatic
  17145. s = 0; // achromatic
  17146. } else {
  17147. var d = max - min;
  17148. s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
  17149. switch (max) {
  17150. case r:
  17151. h = (g - b) / d + (g < b ? 6 : 0);
  17152. break;
  17153. case g:
  17154. h = (b - r) / d + 2;
  17155. break;
  17156. case b:
  17157. h = (r - g) / d + 4;
  17158. break;
  17159. default:
  17160. break;
  17161. }
  17162. h /= 6;
  17163. }
  17164. return [h, s, l, val[3]];
  17165. }
  17166. function hue2rgb(p, q, t) {
  17167. if (t < 0) t += 1;
  17168. if (t > 1) t -= 1;
  17169. if (t < 1 / 6) return p + (q - p) * 6 * t;
  17170. if (t < 1 / 2) return q;
  17171. if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
  17172. return p;
  17173. }
  17174. function hslToRgb(val) {
  17175. var h = val[0];
  17176. var s = val[1];
  17177. var l = val[2];
  17178. var r;
  17179. var g;
  17180. var b;
  17181. if (s === 0) {
  17182. r = l; // achromatic
  17183. b = l; // achromatic
  17184. g = l; // achromatic
  17185. } else {
  17186. var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
  17187. var p = 2 * l - q;
  17188. r = hue2rgb(p, q, h + 1 / 3);
  17189. g = hue2rgb(p, q, h);
  17190. b = hue2rgb(p, q, h - 1 / 3);
  17191. }
  17192. return [r, g, b, val[3]];
  17193. }
  17194. function linear(t, tMin, tMax, value1, value2) {
  17195. if (value1 === undefined || value2 === undefined) {
  17196. value1 = tMin;
  17197. value2 = tMax;
  17198. tMin = 0;
  17199. tMax = 1;
  17200. }
  17201. if (tMax < tMin) {
  17202. var _tMin = tMax;
  17203. tMax = tMin;
  17204. tMin = _tMin;
  17205. }
  17206. if (t <= tMin) {
  17207. return value1;
  17208. }
  17209. if (t >= tMax) {
  17210. return value2;
  17211. }
  17212. var perc = tMax === tMin ? 0 : (t - tMin) / (tMax - tMin);
  17213. if (!value1.length) {
  17214. return value1 + (value2 - value1) * perc;
  17215. }
  17216. var i;
  17217. var len = value1.length;
  17218. var arr = createTypedArray('float32', len);
  17219. for (i = 0; i < len; i += 1) {
  17220. arr[i] = value1[i] + (value2[i] - value1[i]) * perc;
  17221. }
  17222. return arr;
  17223. }
  17224. function random(min, max) {
  17225. if (max === undefined) {
  17226. if (min === undefined) {
  17227. min = 0;
  17228. max = 1;
  17229. } else {
  17230. max = min;
  17231. min = undefined;
  17232. }
  17233. }
  17234. if (max.length) {
  17235. var i;
  17236. var len = max.length;
  17237. if (!min) {
  17238. min = createTypedArray('float32', len);
  17239. }
  17240. var arr = createTypedArray('float32', len);
  17241. var rnd = BMMath.random();
  17242. for (i = 0; i < len; i += 1) {
  17243. arr[i] = min[i] + rnd * (max[i] - min[i]);
  17244. }
  17245. return arr;
  17246. }
  17247. if (min === undefined) {
  17248. min = 0;
  17249. }
  17250. var rndm = BMMath.random();
  17251. return min + rndm * (max - min);
  17252. }
  17253. function createPath(points, inTangents, outTangents, closed) {
  17254. var i;
  17255. var len = points.length;
  17256. var path = shapePool.newElement();
  17257. path.setPathData(!!closed, len);
  17258. var arrPlaceholder = [0, 0];
  17259. var inVertexPoint;
  17260. var outVertexPoint;
  17261. for (i = 0; i < len; i += 1) {
  17262. inVertexPoint = inTangents && inTangents[i] ? inTangents[i] : arrPlaceholder;
  17263. outVertexPoint = outTangents && outTangents[i] ? outTangents[i] : arrPlaceholder;
  17264. path.setTripleAt(points[i][0], points[i][1], outVertexPoint[0] + points[i][0], outVertexPoint[1] + points[i][1], inVertexPoint[0] + points[i][0], inVertexPoint[1] + points[i][1], i, true);
  17265. }
  17266. return path;
  17267. }
  17268. function initiateExpression(elem, data, property) {
  17269. // Bail out if we don't want expressions
  17270. function noOp(_value) {
  17271. return _value;
  17272. }
  17273. if (!elem.globalData.renderConfig.runExpressions) {
  17274. return noOp;
  17275. }
  17276. var val = data.x;
  17277. var needsVelocity = /velocity(?![\w\d])/.test(val);
  17278. var _needsRandom = val.indexOf('random') !== -1;
  17279. var elemType = elem.data.ty;
  17280. var transform;
  17281. var $bm_transform;
  17282. var content;
  17283. var effect;
  17284. var thisProperty = property;
  17285. thisProperty.valueAtTime = thisProperty.getValueAtTime;
  17286. Object.defineProperty(thisProperty, 'value', {
  17287. get: function get() {
  17288. return thisProperty.v;
  17289. }
  17290. });
  17291. elem.comp.frameDuration = 1 / elem.comp.globalData.frameRate;
  17292. elem.comp.displayStartTime = 0;
  17293. var inPoint = elem.data.ip / elem.comp.globalData.frameRate;
  17294. var outPoint = elem.data.op / elem.comp.globalData.frameRate;
  17295. var width = elem.data.sw ? elem.data.sw : 0;
  17296. var height = elem.data.sh ? elem.data.sh : 0;
  17297. var name = elem.data.nm;
  17298. var loopIn;
  17299. var loop_in;
  17300. var loopOut;
  17301. var loop_out;
  17302. var smooth;
  17303. var toWorld;
  17304. var fromWorld;
  17305. var fromComp;
  17306. var toComp;
  17307. var fromCompToSurface;
  17308. var position;
  17309. var rotation;
  17310. var anchorPoint;
  17311. var scale;
  17312. var thisLayer;
  17313. var thisComp;
  17314. var mask;
  17315. var valueAtTime;
  17316. var velocityAtTime;
  17317. var scoped_bm_rt; // val = val.replace(/(\\?"|')((http)(s)?(:\/))?\/.*?(\\?"|')/g, "\"\""); // deter potential network calls
  17318. var expression_function = eval('[function _expression_function(){' + val + ';scoped_bm_rt=$bm_rt}]')[0]; // eslint-disable-line no-eval
  17319. var numKeys = property.kf ? data.k.length : 0;
  17320. var active = !this.data || this.data.hd !== true;
  17321. var wiggle = function wiggle(freq, amp) {
  17322. var iWiggle;
  17323. var j;
  17324. var lenWiggle = this.pv.length ? this.pv.length : 1;
  17325. var addedAmps = createTypedArray('float32', lenWiggle);
  17326. freq = 5;
  17327. var iterations = Math.floor(time * freq);
  17328. iWiggle = 0;
  17329. j = 0;
  17330. while (iWiggle < iterations) {
  17331. // var rnd = BMMath.random();
  17332. for (j = 0; j < lenWiggle; j += 1) {
  17333. addedAmps[j] += -amp + amp * 2 * BMMath.random(); // addedAmps[j] += -amp + amp*2*rnd;
  17334. }
  17335. iWiggle += 1;
  17336. } // var rnd2 = BMMath.random();
  17337. var periods = time * freq;
  17338. var perc = periods - Math.floor(periods);
  17339. var arr = createTypedArray('float32', lenWiggle);
  17340. if (lenWiggle > 1) {
  17341. for (j = 0; j < lenWiggle; j += 1) {
  17342. arr[j] = this.pv[j] + addedAmps[j] + (-amp + amp * 2 * BMMath.random()) * perc; // arr[j] = this.pv[j] + addedAmps[j] + (-amp + amp*2*rnd)*perc;
  17343. // arr[i] = this.pv[i] + addedAmp + amp1*perc + amp2*(1-perc);
  17344. }
  17345. return arr;
  17346. }
  17347. return this.pv + addedAmps[0] + (-amp + amp * 2 * BMMath.random()) * perc;
  17348. }.bind(this);
  17349. if (thisProperty.loopIn) {
  17350. loopIn = thisProperty.loopIn.bind(thisProperty);
  17351. loop_in = loopIn;
  17352. }
  17353. if (thisProperty.loopOut) {
  17354. loopOut = thisProperty.loopOut.bind(thisProperty);
  17355. loop_out = loopOut;
  17356. }
  17357. if (thisProperty.smooth) {
  17358. smooth = thisProperty.smooth.bind(thisProperty);
  17359. }
  17360. function loopInDuration(type, duration) {
  17361. return loopIn(type, duration, true);
  17362. }
  17363. function loopOutDuration(type, duration) {
  17364. return loopOut(type, duration, true);
  17365. }
  17366. if (this.getValueAtTime) {
  17367. valueAtTime = this.getValueAtTime.bind(this);
  17368. }
  17369. if (this.getVelocityAtTime) {
  17370. velocityAtTime = this.getVelocityAtTime.bind(this);
  17371. }
  17372. var comp = elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface);
  17373. function lookAt(elem1, elem2) {
  17374. var fVec = [elem2[0] - elem1[0], elem2[1] - elem1[1], elem2[2] - elem1[2]];
  17375. var pitch = Math.atan2(fVec[0], Math.sqrt(fVec[1] * fVec[1] + fVec[2] * fVec[2])) / degToRads;
  17376. var yaw = -Math.atan2(fVec[1], fVec[2]) / degToRads;
  17377. return [yaw, pitch, 0];
  17378. }
  17379. function easeOut(t, tMin, tMax, val1, val2) {
  17380. return applyEase(easeOutBez, t, tMin, tMax, val1, val2);
  17381. }
  17382. function easeIn(t, tMin, tMax, val1, val2) {
  17383. return applyEase(easeInBez, t, tMin, tMax, val1, val2);
  17384. }
  17385. function ease(t, tMin, tMax, val1, val2) {
  17386. return applyEase(easeInOutBez, t, tMin, tMax, val1, val2);
  17387. }
  17388. function applyEase(fn, t, tMin, tMax, val1, val2) {
  17389. if (val1 === undefined) {
  17390. val1 = tMin;
  17391. val2 = tMax;
  17392. } else {
  17393. t = (t - tMin) / (tMax - tMin);
  17394. }
  17395. if (t > 1) {
  17396. t = 1;
  17397. } else if (t < 0) {
  17398. t = 0;
  17399. }
  17400. var mult = fn(t);
  17401. if ($bm_isInstanceOfArray(val1)) {
  17402. var iKey;
  17403. var lenKey = val1.length;
  17404. var arr = createTypedArray('float32', lenKey);
  17405. for (iKey = 0; iKey < lenKey; iKey += 1) {
  17406. arr[iKey] = (val2[iKey] - val1[iKey]) * mult + val1[iKey];
  17407. }
  17408. return arr;
  17409. }
  17410. return (val2 - val1) * mult + val1;
  17411. }
  17412. function nearestKey(time) {
  17413. var iKey;
  17414. var lenKey = data.k.length;
  17415. var index;
  17416. var keyTime;
  17417. if (!data.k.length || typeof data.k[0] === 'number') {
  17418. index = 0;
  17419. keyTime = 0;
  17420. } else {
  17421. index = -1;
  17422. time *= elem.comp.globalData.frameRate;
  17423. if (time < data.k[0].t) {
  17424. index = 1;
  17425. keyTime = data.k[0].t;
  17426. } else {
  17427. for (iKey = 0; iKey < lenKey - 1; iKey += 1) {
  17428. if (time === data.k[iKey].t) {
  17429. index = iKey + 1;
  17430. keyTime = data.k[iKey].t;
  17431. break;
  17432. } else if (time > data.k[iKey].t && time < data.k[iKey + 1].t) {
  17433. if (time - data.k[iKey].t > data.k[iKey + 1].t - time) {
  17434. index = iKey + 2;
  17435. keyTime = data.k[iKey + 1].t;
  17436. } else {
  17437. index = iKey + 1;
  17438. keyTime = data.k[iKey].t;
  17439. }
  17440. break;
  17441. }
  17442. }
  17443. if (index === -1) {
  17444. index = iKey + 1;
  17445. keyTime = data.k[iKey].t;
  17446. }
  17447. }
  17448. }
  17449. var obKey = {};
  17450. obKey.index = index;
  17451. obKey.time = keyTime / elem.comp.globalData.frameRate;
  17452. return obKey;
  17453. }
  17454. function key(ind) {
  17455. var obKey;
  17456. var iKey;
  17457. var lenKey;
  17458. if (!data.k.length || typeof data.k[0] === 'number') {
  17459. throw new Error('The property has no keyframe at index ' + ind);
  17460. }
  17461. ind -= 1;
  17462. obKey = {
  17463. time: data.k[ind].t / elem.comp.globalData.frameRate,
  17464. value: []
  17465. };
  17466. var arr = Object.prototype.hasOwnProperty.call(data.k[ind], 's') ? data.k[ind].s : data.k[ind - 1].e;
  17467. lenKey = arr.length;
  17468. for (iKey = 0; iKey < lenKey; iKey += 1) {
  17469. obKey[iKey] = arr[iKey];
  17470. obKey.value[iKey] = arr[iKey];
  17471. }
  17472. return obKey;
  17473. }
  17474. function framesToTime(fr, fps) {
  17475. if (!fps) {
  17476. fps = elem.comp.globalData.frameRate;
  17477. }
  17478. return fr / fps;
  17479. }
  17480. function timeToFrames(t, fps) {
  17481. if (!t && t !== 0) {
  17482. t = time;
  17483. }
  17484. if (!fps) {
  17485. fps = elem.comp.globalData.frameRate;
  17486. }
  17487. return t * fps;
  17488. }
  17489. function seedRandom(seed) {
  17490. BMMath.seedrandom(randSeed + seed);
  17491. }
  17492. function sourceRectAtTime() {
  17493. return elem.sourceRectAtTime();
  17494. }
  17495. function substring(init, end) {
  17496. if (typeof value === 'string') {
  17497. if (end === undefined) {
  17498. return value.substring(init);
  17499. }
  17500. return value.substring(init, end);
  17501. }
  17502. return '';
  17503. }
  17504. function substr(init, end) {
  17505. if (typeof value === 'string') {
  17506. if (end === undefined) {
  17507. return value.substr(init);
  17508. }
  17509. return value.substr(init, end);
  17510. }
  17511. return '';
  17512. }
  17513. function posterizeTime(framesPerSecond) {
  17514. time = framesPerSecond === 0 ? 0 : Math.floor(time * framesPerSecond) / framesPerSecond;
  17515. value = valueAtTime(time);
  17516. }
  17517. var time;
  17518. var velocity;
  17519. var value;
  17520. var text;
  17521. var textIndex;
  17522. var textTotal;
  17523. var selectorValue;
  17524. var index = elem.data.ind;
  17525. var hasParent = !!(elem.hierarchy && elem.hierarchy.length);
  17526. var parent;
  17527. var randSeed = Math.floor(Math.random() * 1000000);
  17528. var globalData = elem.globalData;
  17529. function executeExpression(_value) {
  17530. // globalData.pushExpression();
  17531. value = _value;
  17532. if (this.frameExpressionId === elem.globalData.frameId && this.propType !== 'textSelector') {
  17533. return value;
  17534. }
  17535. if (this.propType === 'textSelector') {
  17536. textIndex = this.textIndex;
  17537. textTotal = this.textTotal;
  17538. selectorValue = this.selectorValue;
  17539. }
  17540. if (!thisLayer) {
  17541. text = elem.layerInterface.text;
  17542. thisLayer = elem.layerInterface;
  17543. thisComp = elem.comp.compInterface;
  17544. toWorld = thisLayer.toWorld.bind(thisLayer);
  17545. fromWorld = thisLayer.fromWorld.bind(thisLayer);
  17546. fromComp = thisLayer.fromComp.bind(thisLayer);
  17547. toComp = thisLayer.toComp.bind(thisLayer);
  17548. mask = thisLayer.mask ? thisLayer.mask.bind(thisLayer) : null;
  17549. fromCompToSurface = fromComp;
  17550. }
  17551. if (!transform) {
  17552. transform = elem.layerInterface('ADBE Transform Group');
  17553. $bm_transform = transform;
  17554. if (transform) {
  17555. anchorPoint = transform.anchorPoint;
  17556. /* position = transform.position;
  17557. rotation = transform.rotation;
  17558. scale = transform.scale; */
  17559. }
  17560. }
  17561. if (elemType === 4 && !content) {
  17562. content = thisLayer('ADBE Root Vectors Group');
  17563. }
  17564. if (!effect) {
  17565. effect = thisLayer(4);
  17566. }
  17567. hasParent = !!(elem.hierarchy && elem.hierarchy.length);
  17568. if (hasParent && !parent) {
  17569. parent = elem.hierarchy[0].layerInterface;
  17570. }
  17571. time = this.comp.renderedFrame / this.comp.globalData.frameRate;
  17572. if (_needsRandom) {
  17573. seedRandom(randSeed + time);
  17574. }
  17575. if (needsVelocity) {
  17576. velocity = velocityAtTime(time);
  17577. }
  17578. expression_function();
  17579. this.frameExpressionId = elem.globalData.frameId; // TODO: Check if it's possible to return on ShapeInterface the .v value
  17580. // Changed this to a ternary operation because Rollup failed compiling it correctly
  17581. scoped_bm_rt = scoped_bm_rt.propType === propTypes.SHAPE ? scoped_bm_rt.v : scoped_bm_rt;
  17582. return scoped_bm_rt;
  17583. } // Bundlers will see these as dead code and unless we reference them
  17584. 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];
  17585. return executeExpression;
  17586. }
  17587. ob.initiateExpression = initiateExpression;
  17588. 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, _lottieGlobal];
  17589. ob.resetFrame = resetFrame;
  17590. return ob;
  17591. }();
  17592. var Expressions = function () {
  17593. var ob = {};
  17594. ob.initExpressions = initExpressions;
  17595. ob.resetFrame = ExpressionManager.resetFrame;
  17596. function initExpressions(animation) {
  17597. var stackCount = 0;
  17598. var registers = [];
  17599. function pushExpression() {
  17600. stackCount += 1;
  17601. }
  17602. function popExpression() {
  17603. stackCount -= 1;
  17604. if (stackCount === 0) {
  17605. releaseInstances();
  17606. }
  17607. }
  17608. function registerExpressionProperty(expression) {
  17609. if (registers.indexOf(expression) === -1) {
  17610. registers.push(expression);
  17611. }
  17612. }
  17613. function releaseInstances() {
  17614. var i;
  17615. var len = registers.length;
  17616. for (i = 0; i < len; i += 1) {
  17617. registers[i].release();
  17618. }
  17619. registers.length = 0;
  17620. }
  17621. animation.renderer.compInterface = CompExpressionInterface(animation.renderer);
  17622. animation.renderer.globalData.projectInterface.registerComposition(animation.renderer);
  17623. animation.renderer.globalData.pushExpression = pushExpression;
  17624. animation.renderer.globalData.popExpression = popExpression;
  17625. animation.renderer.globalData.registerExpressionProperty = registerExpressionProperty;
  17626. }
  17627. return ob;
  17628. }();
  17629. var MaskManagerInterface = function () {
  17630. function MaskInterface(mask, data) {
  17631. this._mask = mask;
  17632. this._data = data;
  17633. }
  17634. Object.defineProperty(MaskInterface.prototype, 'maskPath', {
  17635. get: function get() {
  17636. if (this._mask.prop.k) {
  17637. this._mask.prop.getValue();
  17638. }
  17639. return this._mask.prop;
  17640. }
  17641. });
  17642. Object.defineProperty(MaskInterface.prototype, 'maskOpacity', {
  17643. get: function get() {
  17644. if (this._mask.op.k) {
  17645. this._mask.op.getValue();
  17646. }
  17647. return this._mask.op.v * 100;
  17648. }
  17649. });
  17650. var MaskManager = function MaskManager(maskManager) {
  17651. var _masksInterfaces = createSizedArray(maskManager.viewData.length);
  17652. var i;
  17653. var len = maskManager.viewData.length;
  17654. for (i = 0; i < len; i += 1) {
  17655. _masksInterfaces[i] = new MaskInterface(maskManager.viewData[i], maskManager.masksProperties[i]);
  17656. }
  17657. var maskFunction = function maskFunction(name) {
  17658. i = 0;
  17659. while (i < len) {
  17660. if (maskManager.masksProperties[i].nm === name) {
  17661. return _masksInterfaces[i];
  17662. }
  17663. i += 1;
  17664. }
  17665. return null;
  17666. };
  17667. return maskFunction;
  17668. };
  17669. return MaskManager;
  17670. }();
  17671. var ExpressionPropertyInterface = function () {
  17672. var defaultUnidimensionalValue = {
  17673. pv: 0,
  17674. v: 0,
  17675. mult: 1
  17676. };
  17677. var defaultMultidimensionalValue = {
  17678. pv: [0, 0, 0],
  17679. v: [0, 0, 0],
  17680. mult: 1
  17681. };
  17682. function completeProperty(expressionValue, property, type) {
  17683. Object.defineProperty(expressionValue, 'velocity', {
  17684. get: function get() {
  17685. return property.getVelocityAtTime(property.comp.currentFrame);
  17686. }
  17687. });
  17688. expressionValue.numKeys = property.keyframes ? property.keyframes.length : 0;
  17689. expressionValue.key = function (pos) {
  17690. if (!expressionValue.numKeys) {
  17691. return 0;
  17692. }
  17693. var value = '';
  17694. if ('s' in property.keyframes[pos - 1]) {
  17695. value = property.keyframes[pos - 1].s;
  17696. } else if ('e' in property.keyframes[pos - 2]) {
  17697. value = property.keyframes[pos - 2].e;
  17698. } else {
  17699. value = property.keyframes[pos - 2].s;
  17700. }
  17701. var valueProp = type === 'unidimensional' ? new Number(value) : Object.assign({}, value); // eslint-disable-line no-new-wrappers
  17702. valueProp.time = property.keyframes[pos - 1].t / property.elem.comp.globalData.frameRate;
  17703. valueProp.value = type === 'unidimensional' ? value[0] : value;
  17704. return valueProp;
  17705. };
  17706. expressionValue.valueAtTime = property.getValueAtTime;
  17707. expressionValue.speedAtTime = property.getSpeedAtTime;
  17708. expressionValue.velocityAtTime = property.getVelocityAtTime;
  17709. expressionValue.propertyGroup = property.propertyGroup;
  17710. }
  17711. function UnidimensionalPropertyInterface(property) {
  17712. if (!property || !('pv' in property)) {
  17713. property = defaultUnidimensionalValue;
  17714. }
  17715. var mult = 1 / property.mult;
  17716. var val = property.pv * mult;
  17717. var expressionValue = new Number(val); // eslint-disable-line no-new-wrappers
  17718. expressionValue.value = val;
  17719. completeProperty(expressionValue, property, 'unidimensional');
  17720. return function () {
  17721. if (property.k) {
  17722. property.getValue();
  17723. }
  17724. val = property.v * mult;
  17725. if (expressionValue.value !== val) {
  17726. expressionValue = new Number(val); // eslint-disable-line no-new-wrappers
  17727. expressionValue.value = val;
  17728. completeProperty(expressionValue, property, 'unidimensional');
  17729. }
  17730. return expressionValue;
  17731. };
  17732. }
  17733. function MultidimensionalPropertyInterface(property) {
  17734. if (!property || !('pv' in property)) {
  17735. property = defaultMultidimensionalValue;
  17736. }
  17737. var mult = 1 / property.mult;
  17738. var len = property.data && property.data.l || property.pv.length;
  17739. var expressionValue = createTypedArray('float32', len);
  17740. var arrValue = createTypedArray('float32', len);
  17741. expressionValue.value = arrValue;
  17742. completeProperty(expressionValue, property, 'multidimensional');
  17743. return function () {
  17744. if (property.k) {
  17745. property.getValue();
  17746. }
  17747. for (var i = 0; i < len; i += 1) {
  17748. arrValue[i] = property.v[i] * mult;
  17749. expressionValue[i] = arrValue[i];
  17750. }
  17751. return expressionValue;
  17752. };
  17753. } // TODO: try to avoid using this getter
  17754. function defaultGetter() {
  17755. return defaultUnidimensionalValue;
  17756. }
  17757. return function (property) {
  17758. if (!property) {
  17759. return defaultGetter;
  17760. }
  17761. if (property.propType === 'unidimensional') {
  17762. return UnidimensionalPropertyInterface(property);
  17763. }
  17764. return MultidimensionalPropertyInterface(property);
  17765. };
  17766. }();
  17767. var TransformExpressionInterface = function () {
  17768. return function (transform) {
  17769. function _thisFunction(name) {
  17770. switch (name) {
  17771. case 'scale':
  17772. case 'Scale':
  17773. case 'ADBE Scale':
  17774. case 6:
  17775. return _thisFunction.scale;
  17776. case 'rotation':
  17777. case 'Rotation':
  17778. case 'ADBE Rotation':
  17779. case 'ADBE Rotate Z':
  17780. case 10:
  17781. return _thisFunction.rotation;
  17782. case 'ADBE Rotate X':
  17783. return _thisFunction.xRotation;
  17784. case 'ADBE Rotate Y':
  17785. return _thisFunction.yRotation;
  17786. case 'position':
  17787. case 'Position':
  17788. case 'ADBE Position':
  17789. case 2:
  17790. return _thisFunction.position;
  17791. case 'ADBE Position_0':
  17792. return _thisFunction.xPosition;
  17793. case 'ADBE Position_1':
  17794. return _thisFunction.yPosition;
  17795. case 'ADBE Position_2':
  17796. return _thisFunction.zPosition;
  17797. case 'anchorPoint':
  17798. case 'AnchorPoint':
  17799. case 'Anchor Point':
  17800. case 'ADBE AnchorPoint':
  17801. case 1:
  17802. return _thisFunction.anchorPoint;
  17803. case 'opacity':
  17804. case 'Opacity':
  17805. case 11:
  17806. return _thisFunction.opacity;
  17807. default:
  17808. return null;
  17809. }
  17810. }
  17811. Object.defineProperty(_thisFunction, 'rotation', {
  17812. get: ExpressionPropertyInterface(transform.r || transform.rz)
  17813. });
  17814. Object.defineProperty(_thisFunction, 'zRotation', {
  17815. get: ExpressionPropertyInterface(transform.rz || transform.r)
  17816. });
  17817. Object.defineProperty(_thisFunction, 'xRotation', {
  17818. get: ExpressionPropertyInterface(transform.rx)
  17819. });
  17820. Object.defineProperty(_thisFunction, 'yRotation', {
  17821. get: ExpressionPropertyInterface(transform.ry)
  17822. });
  17823. Object.defineProperty(_thisFunction, 'scale', {
  17824. get: ExpressionPropertyInterface(transform.s)
  17825. });
  17826. var _px;
  17827. var _py;
  17828. var _pz;
  17829. var _transformFactory;
  17830. if (transform.p) {
  17831. _transformFactory = ExpressionPropertyInterface(transform.p);
  17832. } else {
  17833. _px = ExpressionPropertyInterface(transform.px);
  17834. _py = ExpressionPropertyInterface(transform.py);
  17835. if (transform.pz) {
  17836. _pz = ExpressionPropertyInterface(transform.pz);
  17837. }
  17838. }
  17839. Object.defineProperty(_thisFunction, 'position', {
  17840. get: function get() {
  17841. if (transform.p) {
  17842. return _transformFactory();
  17843. }
  17844. return [_px(), _py(), _pz ? _pz() : 0];
  17845. }
  17846. });
  17847. Object.defineProperty(_thisFunction, 'xPosition', {
  17848. get: ExpressionPropertyInterface(transform.px)
  17849. });
  17850. Object.defineProperty(_thisFunction, 'yPosition', {
  17851. get: ExpressionPropertyInterface(transform.py)
  17852. });
  17853. Object.defineProperty(_thisFunction, 'zPosition', {
  17854. get: ExpressionPropertyInterface(transform.pz)
  17855. });
  17856. Object.defineProperty(_thisFunction, 'anchorPoint', {
  17857. get: ExpressionPropertyInterface(transform.a)
  17858. });
  17859. Object.defineProperty(_thisFunction, 'opacity', {
  17860. get: ExpressionPropertyInterface(transform.o)
  17861. });
  17862. Object.defineProperty(_thisFunction, 'skew', {
  17863. get: ExpressionPropertyInterface(transform.sk)
  17864. });
  17865. Object.defineProperty(_thisFunction, 'skewAxis', {
  17866. get: ExpressionPropertyInterface(transform.sa)
  17867. });
  17868. Object.defineProperty(_thisFunction, 'orientation', {
  17869. get: ExpressionPropertyInterface(transform.or)
  17870. });
  17871. return _thisFunction;
  17872. };
  17873. }();
  17874. var LayerExpressionInterface = function () {
  17875. function getMatrix(time) {
  17876. var toWorldMat = new Matrix();
  17877. if (time !== undefined) {
  17878. var propMatrix = this._elem.finalTransform.mProp.getValueAtTime(time);
  17879. propMatrix.clone(toWorldMat);
  17880. } else {
  17881. var transformMat = this._elem.finalTransform.mProp;
  17882. transformMat.applyToMatrix(toWorldMat);
  17883. }
  17884. return toWorldMat;
  17885. }
  17886. function toWorldVec(arr, time) {
  17887. var toWorldMat = this.getMatrix(time);
  17888. toWorldMat.props[12] = 0;
  17889. toWorldMat.props[13] = 0;
  17890. toWorldMat.props[14] = 0;
  17891. return this.applyPoint(toWorldMat, arr);
  17892. }
  17893. function toWorld(arr, time) {
  17894. var toWorldMat = this.getMatrix(time);
  17895. return this.applyPoint(toWorldMat, arr);
  17896. }
  17897. function fromWorldVec(arr, time) {
  17898. var toWorldMat = this.getMatrix(time);
  17899. toWorldMat.props[12] = 0;
  17900. toWorldMat.props[13] = 0;
  17901. toWorldMat.props[14] = 0;
  17902. return this.invertPoint(toWorldMat, arr);
  17903. }
  17904. function fromWorld(arr, time) {
  17905. var toWorldMat = this.getMatrix(time);
  17906. return this.invertPoint(toWorldMat, arr);
  17907. }
  17908. function applyPoint(matrix, arr) {
  17909. if (this._elem.hierarchy && this._elem.hierarchy.length) {
  17910. var i;
  17911. var len = this._elem.hierarchy.length;
  17912. for (i = 0; i < len; i += 1) {
  17913. this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(matrix);
  17914. }
  17915. }
  17916. return matrix.applyToPointArray(arr[0], arr[1], arr[2] || 0);
  17917. }
  17918. function invertPoint(matrix, arr) {
  17919. if (this._elem.hierarchy && this._elem.hierarchy.length) {
  17920. var i;
  17921. var len = this._elem.hierarchy.length;
  17922. for (i = 0; i < len; i += 1) {
  17923. this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(matrix);
  17924. }
  17925. }
  17926. return matrix.inversePoint(arr);
  17927. }
  17928. function fromComp(arr) {
  17929. var toWorldMat = new Matrix();
  17930. toWorldMat.reset();
  17931. this._elem.finalTransform.mProp.applyToMatrix(toWorldMat);
  17932. if (this._elem.hierarchy && this._elem.hierarchy.length) {
  17933. var i;
  17934. var len = this._elem.hierarchy.length;
  17935. for (i = 0; i < len; i += 1) {
  17936. this._elem.hierarchy[i].finalTransform.mProp.applyToMatrix(toWorldMat);
  17937. }
  17938. return toWorldMat.inversePoint(arr);
  17939. }
  17940. return toWorldMat.inversePoint(arr);
  17941. }
  17942. function sampleImage() {
  17943. return [1, 1, 1, 1];
  17944. }
  17945. return function (elem) {
  17946. var transformInterface;
  17947. function _registerMaskInterface(maskManager) {
  17948. _thisLayerFunction.mask = new MaskManagerInterface(maskManager, elem);
  17949. }
  17950. function _registerEffectsInterface(effects) {
  17951. _thisLayerFunction.effect = effects;
  17952. }
  17953. function _thisLayerFunction(name) {
  17954. switch (name) {
  17955. case 'ADBE Root Vectors Group':
  17956. case 'Contents':
  17957. case 2:
  17958. return _thisLayerFunction.shapeInterface;
  17959. case 1:
  17960. case 6:
  17961. case 'Transform':
  17962. case 'transform':
  17963. case 'ADBE Transform Group':
  17964. return transformInterface;
  17965. case 4:
  17966. case 'ADBE Effect Parade':
  17967. case 'effects':
  17968. case 'Effects':
  17969. return _thisLayerFunction.effect;
  17970. case 'ADBE Text Properties':
  17971. return _thisLayerFunction.textInterface;
  17972. default:
  17973. return null;
  17974. }
  17975. }
  17976. _thisLayerFunction.getMatrix = getMatrix;
  17977. _thisLayerFunction.invertPoint = invertPoint;
  17978. _thisLayerFunction.applyPoint = applyPoint;
  17979. _thisLayerFunction.toWorld = toWorld;
  17980. _thisLayerFunction.toWorldVec = toWorldVec;
  17981. _thisLayerFunction.fromWorld = fromWorld;
  17982. _thisLayerFunction.fromWorldVec = fromWorldVec;
  17983. _thisLayerFunction.toComp = toWorld;
  17984. _thisLayerFunction.fromComp = fromComp;
  17985. _thisLayerFunction.sampleImage = sampleImage;
  17986. _thisLayerFunction.sourceRectAtTime = elem.sourceRectAtTime.bind(elem);
  17987. _thisLayerFunction._elem = elem;
  17988. transformInterface = TransformExpressionInterface(elem.finalTransform.mProp);
  17989. var anchorPointDescriptor = getDescriptor(transformInterface, 'anchorPoint');
  17990. Object.defineProperties(_thisLayerFunction, {
  17991. hasParent: {
  17992. get: function get() {
  17993. return elem.hierarchy.length;
  17994. }
  17995. },
  17996. parent: {
  17997. get: function get() {
  17998. return elem.hierarchy[0].layerInterface;
  17999. }
  18000. },
  18001. rotation: getDescriptor(transformInterface, 'rotation'),
  18002. scale: getDescriptor(transformInterface, 'scale'),
  18003. position: getDescriptor(transformInterface, 'position'),
  18004. opacity: getDescriptor(transformInterface, 'opacity'),
  18005. anchorPoint: anchorPointDescriptor,
  18006. anchor_point: anchorPointDescriptor,
  18007. transform: {
  18008. get: function get() {
  18009. return transformInterface;
  18010. }
  18011. },
  18012. active: {
  18013. get: function get() {
  18014. return elem.isInRange;
  18015. }
  18016. }
  18017. });
  18018. _thisLayerFunction.startTime = elem.data.st;
  18019. _thisLayerFunction.index = elem.data.ind;
  18020. _thisLayerFunction.source = elem.data.refId;
  18021. _thisLayerFunction.height = elem.data.ty === 0 ? elem.data.h : 100;
  18022. _thisLayerFunction.width = elem.data.ty === 0 ? elem.data.w : 100;
  18023. _thisLayerFunction.inPoint = elem.data.ip / elem.comp.globalData.frameRate;
  18024. _thisLayerFunction.outPoint = elem.data.op / elem.comp.globalData.frameRate;
  18025. _thisLayerFunction._name = elem.data.nm;
  18026. _thisLayerFunction.registerMaskInterface = _registerMaskInterface;
  18027. _thisLayerFunction.registerEffectsInterface = _registerEffectsInterface;
  18028. return _thisLayerFunction;
  18029. };
  18030. }();
  18031. var propertyGroupFactory = function () {
  18032. return function (interfaceFunction, parentPropertyGroup) {
  18033. return function (val) {
  18034. val = val === undefined ? 1 : val;
  18035. if (val <= 0) {
  18036. return interfaceFunction;
  18037. }
  18038. return parentPropertyGroup(val - 1);
  18039. };
  18040. };
  18041. }();
  18042. var PropertyInterface = function () {
  18043. return function (propertyName, propertyGroup) {
  18044. var interfaceFunction = {
  18045. _name: propertyName
  18046. };
  18047. function _propertyGroup(val) {
  18048. val = val === undefined ? 1 : val;
  18049. if (val <= 0) {
  18050. return interfaceFunction;
  18051. }
  18052. return propertyGroup(val - 1);
  18053. }
  18054. return _propertyGroup;
  18055. };
  18056. }();
  18057. var EffectsExpressionInterface = function () {
  18058. var ob = {
  18059. createEffectsInterface: createEffectsInterface
  18060. };
  18061. function createEffectsInterface(elem, propertyGroup) {
  18062. if (elem.effectsManager) {
  18063. var effectElements = [];
  18064. var effectsData = elem.data.ef;
  18065. var i;
  18066. var len = elem.effectsManager.effectElements.length;
  18067. for (i = 0; i < len; i += 1) {
  18068. effectElements.push(createGroupInterface(effectsData[i], elem.effectsManager.effectElements[i], propertyGroup, elem));
  18069. }
  18070. var effects = elem.data.ef || [];
  18071. var groupInterface = function groupInterface(name) {
  18072. i = 0;
  18073. len = effects.length;
  18074. while (i < len) {
  18075. if (name === effects[i].nm || name === effects[i].mn || name === effects[i].ix) {
  18076. return effectElements[i];
  18077. }
  18078. i += 1;
  18079. }
  18080. return null;
  18081. };
  18082. Object.defineProperty(groupInterface, 'numProperties', {
  18083. get: function get() {
  18084. return effects.length;
  18085. }
  18086. });
  18087. return groupInterface;
  18088. }
  18089. return null;
  18090. }
  18091. function createGroupInterface(data, elements, propertyGroup, elem) {
  18092. function groupInterface(name) {
  18093. var effects = data.ef;
  18094. var i = 0;
  18095. var len = effects.length;
  18096. while (i < len) {
  18097. if (name === effects[i].nm || name === effects[i].mn || name === effects[i].ix) {
  18098. if (effects[i].ty === 5) {
  18099. return effectElements[i];
  18100. }
  18101. return effectElements[i]();
  18102. }
  18103. i += 1;
  18104. }
  18105. throw new Error();
  18106. }
  18107. var _propertyGroup = propertyGroupFactory(groupInterface, propertyGroup);
  18108. var effectElements = [];
  18109. var i;
  18110. var len = data.ef.length;
  18111. for (i = 0; i < len; i += 1) {
  18112. if (data.ef[i].ty === 5) {
  18113. effectElements.push(createGroupInterface(data.ef[i], elements.effectElements[i], elements.effectElements[i].propertyGroup, elem));
  18114. } else {
  18115. effectElements.push(createValueInterface(elements.effectElements[i], data.ef[i].ty, elem, _propertyGroup));
  18116. }
  18117. }
  18118. if (data.mn === 'ADBE Color Control') {
  18119. Object.defineProperty(groupInterface, 'color', {
  18120. get: function get() {
  18121. return effectElements[0]();
  18122. }
  18123. });
  18124. }
  18125. Object.defineProperties(groupInterface, {
  18126. numProperties: {
  18127. get: function get() {
  18128. return data.np;
  18129. }
  18130. },
  18131. _name: {
  18132. value: data.nm
  18133. },
  18134. propertyGroup: {
  18135. value: _propertyGroup
  18136. }
  18137. });
  18138. groupInterface.enabled = data.en !== 0;
  18139. groupInterface.active = groupInterface.enabled;
  18140. return groupInterface;
  18141. }
  18142. function createValueInterface(element, type, elem, propertyGroup) {
  18143. var expressionProperty = ExpressionPropertyInterface(element.p);
  18144. function interfaceFunction() {
  18145. if (type === 10) {
  18146. return elem.comp.compInterface(element.p.v);
  18147. }
  18148. return expressionProperty();
  18149. }
  18150. if (element.p.setGroupProperty) {
  18151. element.p.setGroupProperty(PropertyInterface('', propertyGroup));
  18152. }
  18153. return interfaceFunction;
  18154. }
  18155. return ob;
  18156. }();
  18157. var ShapePathInterface = function () {
  18158. return function pathInterfaceFactory(shape, view, propertyGroup) {
  18159. var prop = view.sh;
  18160. function interfaceFunction(val) {
  18161. if (val === 'Shape' || val === 'shape' || val === 'Path' || val === 'path' || val === 'ADBE Vector Shape' || val === 2) {
  18162. return interfaceFunction.path;
  18163. }
  18164. return null;
  18165. }
  18166. var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
  18167. prop.setGroupProperty(PropertyInterface('Path', _propertyGroup));
  18168. Object.defineProperties(interfaceFunction, {
  18169. path: {
  18170. get: function get() {
  18171. if (prop.k) {
  18172. prop.getValue();
  18173. }
  18174. return prop;
  18175. }
  18176. },
  18177. shape: {
  18178. get: function get() {
  18179. if (prop.k) {
  18180. prop.getValue();
  18181. }
  18182. return prop;
  18183. }
  18184. },
  18185. _name: {
  18186. value: shape.nm
  18187. },
  18188. ix: {
  18189. value: shape.ix
  18190. },
  18191. propertyIndex: {
  18192. value: shape.ix
  18193. },
  18194. mn: {
  18195. value: shape.mn
  18196. },
  18197. propertyGroup: {
  18198. value: propertyGroup
  18199. }
  18200. });
  18201. return interfaceFunction;
  18202. };
  18203. }();
  18204. var ShapeExpressionInterface = function () {
  18205. function iterateElements(shapes, view, propertyGroup) {
  18206. var arr = [];
  18207. var i;
  18208. var len = shapes ? shapes.length : 0;
  18209. for (i = 0; i < len; i += 1) {
  18210. if (shapes[i].ty === 'gr') {
  18211. arr.push(groupInterfaceFactory(shapes[i], view[i], propertyGroup));
  18212. } else if (shapes[i].ty === 'fl') {
  18213. arr.push(fillInterfaceFactory(shapes[i], view[i], propertyGroup));
  18214. } else if (shapes[i].ty === 'st') {
  18215. arr.push(strokeInterfaceFactory(shapes[i], view[i], propertyGroup));
  18216. } else if (shapes[i].ty === 'tm') {
  18217. arr.push(trimInterfaceFactory(shapes[i], view[i], propertyGroup));
  18218. } else if (shapes[i].ty === 'tr') {// arr.push(transformInterfaceFactory(shapes[i],view[i],propertyGroup));
  18219. } else if (shapes[i].ty === 'el') {
  18220. arr.push(ellipseInterfaceFactory(shapes[i], view[i], propertyGroup));
  18221. } else if (shapes[i].ty === 'sr') {
  18222. arr.push(starInterfaceFactory(shapes[i], view[i], propertyGroup));
  18223. } else if (shapes[i].ty === 'sh') {
  18224. arr.push(ShapePathInterface(shapes[i], view[i], propertyGroup));
  18225. } else if (shapes[i].ty === 'rc') {
  18226. arr.push(rectInterfaceFactory(shapes[i], view[i], propertyGroup));
  18227. } else if (shapes[i].ty === 'rd') {
  18228. arr.push(roundedInterfaceFactory(shapes[i], view[i], propertyGroup));
  18229. } else if (shapes[i].ty === 'rp') {
  18230. arr.push(repeaterInterfaceFactory(shapes[i], view[i], propertyGroup));
  18231. } else if (shapes[i].ty === 'gf') {
  18232. arr.push(gradientFillInterfaceFactory(shapes[i], view[i], propertyGroup));
  18233. } else {
  18234. arr.push(defaultInterfaceFactory(shapes[i], view[i], propertyGroup));
  18235. }
  18236. }
  18237. return arr;
  18238. }
  18239. function contentsInterfaceFactory(shape, view, propertyGroup) {
  18240. var interfaces;
  18241. var interfaceFunction = function _interfaceFunction(value) {
  18242. var i = 0;
  18243. var len = interfaces.length;
  18244. while (i < len) {
  18245. if (interfaces[i]._name === value || interfaces[i].mn === value || interfaces[i].propertyIndex === value || interfaces[i].ix === value || interfaces[i].ind === value) {
  18246. return interfaces[i];
  18247. }
  18248. i += 1;
  18249. }
  18250. if (typeof value === 'number') {
  18251. return interfaces[value - 1];
  18252. }
  18253. return null;
  18254. };
  18255. interfaceFunction.propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
  18256. interfaces = iterateElements(shape.it, view.it, interfaceFunction.propertyGroup);
  18257. interfaceFunction.numProperties = interfaces.length;
  18258. var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1], view.it[view.it.length - 1], interfaceFunction.propertyGroup);
  18259. interfaceFunction.transform = transformInterface;
  18260. interfaceFunction.propertyIndex = shape.cix;
  18261. interfaceFunction._name = shape.nm;
  18262. return interfaceFunction;
  18263. }
  18264. function groupInterfaceFactory(shape, view, propertyGroup) {
  18265. var interfaceFunction = function _interfaceFunction(value) {
  18266. switch (value) {
  18267. case 'ADBE Vectors Group':
  18268. case 'Contents':
  18269. case 2:
  18270. return interfaceFunction.content;
  18271. // Not necessary for now. Keeping them here in case a new case appears
  18272. // case 'ADBE Vector Transform Group':
  18273. // case 3:
  18274. default:
  18275. return interfaceFunction.transform;
  18276. }
  18277. };
  18278. interfaceFunction.propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
  18279. var content = contentsInterfaceFactory(shape, view, interfaceFunction.propertyGroup);
  18280. var transformInterface = transformInterfaceFactory(shape.it[shape.it.length - 1], view.it[view.it.length - 1], interfaceFunction.propertyGroup);
  18281. interfaceFunction.content = content;
  18282. interfaceFunction.transform = transformInterface;
  18283. Object.defineProperty(interfaceFunction, '_name', {
  18284. get: function get() {
  18285. return shape.nm;
  18286. }
  18287. }); // interfaceFunction.content = interfaceFunction;
  18288. interfaceFunction.numProperties = shape.np;
  18289. interfaceFunction.propertyIndex = shape.ix;
  18290. interfaceFunction.nm = shape.nm;
  18291. interfaceFunction.mn = shape.mn;
  18292. return interfaceFunction;
  18293. }
  18294. function fillInterfaceFactory(shape, view, propertyGroup) {
  18295. function interfaceFunction(val) {
  18296. if (val === 'Color' || val === 'color') {
  18297. return interfaceFunction.color;
  18298. }
  18299. if (val === 'Opacity' || val === 'opacity') {
  18300. return interfaceFunction.opacity;
  18301. }
  18302. return null;
  18303. }
  18304. Object.defineProperties(interfaceFunction, {
  18305. color: {
  18306. get: ExpressionPropertyInterface(view.c)
  18307. },
  18308. opacity: {
  18309. get: ExpressionPropertyInterface(view.o)
  18310. },
  18311. _name: {
  18312. value: shape.nm
  18313. },
  18314. mn: {
  18315. value: shape.mn
  18316. }
  18317. });
  18318. view.c.setGroupProperty(PropertyInterface('Color', propertyGroup));
  18319. view.o.setGroupProperty(PropertyInterface('Opacity', propertyGroup));
  18320. return interfaceFunction;
  18321. }
  18322. function gradientFillInterfaceFactory(shape, view, propertyGroup) {
  18323. function interfaceFunction(val) {
  18324. if (val === 'Start Point' || val === 'start point') {
  18325. return interfaceFunction.startPoint;
  18326. }
  18327. if (val === 'End Point' || val === 'end point') {
  18328. return interfaceFunction.endPoint;
  18329. }
  18330. if (val === 'Opacity' || val === 'opacity') {
  18331. return interfaceFunction.opacity;
  18332. }
  18333. return null;
  18334. }
  18335. Object.defineProperties(interfaceFunction, {
  18336. startPoint: {
  18337. get: ExpressionPropertyInterface(view.s)
  18338. },
  18339. endPoint: {
  18340. get: ExpressionPropertyInterface(view.e)
  18341. },
  18342. opacity: {
  18343. get: ExpressionPropertyInterface(view.o)
  18344. },
  18345. type: {
  18346. get: function get() {
  18347. return 'a';
  18348. }
  18349. },
  18350. _name: {
  18351. value: shape.nm
  18352. },
  18353. mn: {
  18354. value: shape.mn
  18355. }
  18356. });
  18357. view.s.setGroupProperty(PropertyInterface('Start Point', propertyGroup));
  18358. view.e.setGroupProperty(PropertyInterface('End Point', propertyGroup));
  18359. view.o.setGroupProperty(PropertyInterface('Opacity', propertyGroup));
  18360. return interfaceFunction;
  18361. }
  18362. function defaultInterfaceFactory() {
  18363. function interfaceFunction() {
  18364. return null;
  18365. }
  18366. return interfaceFunction;
  18367. }
  18368. function strokeInterfaceFactory(shape, view, propertyGroup) {
  18369. var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
  18370. var _dashPropertyGroup = propertyGroupFactory(dashOb, _propertyGroup);
  18371. function addPropertyToDashOb(i) {
  18372. Object.defineProperty(dashOb, shape.d[i].nm, {
  18373. get: ExpressionPropertyInterface(view.d.dataProps[i].p)
  18374. });
  18375. }
  18376. var i;
  18377. var len = shape.d ? shape.d.length : 0;
  18378. var dashOb = {};
  18379. for (i = 0; i < len; i += 1) {
  18380. addPropertyToDashOb(i);
  18381. view.d.dataProps[i].p.setGroupProperty(_dashPropertyGroup);
  18382. }
  18383. function interfaceFunction(val) {
  18384. if (val === 'Color' || val === 'color') {
  18385. return interfaceFunction.color;
  18386. }
  18387. if (val === 'Opacity' || val === 'opacity') {
  18388. return interfaceFunction.opacity;
  18389. }
  18390. if (val === 'Stroke Width' || val === 'stroke width') {
  18391. return interfaceFunction.strokeWidth;
  18392. }
  18393. return null;
  18394. }
  18395. Object.defineProperties(interfaceFunction, {
  18396. color: {
  18397. get: ExpressionPropertyInterface(view.c)
  18398. },
  18399. opacity: {
  18400. get: ExpressionPropertyInterface(view.o)
  18401. },
  18402. strokeWidth: {
  18403. get: ExpressionPropertyInterface(view.w)
  18404. },
  18405. dash: {
  18406. get: function get() {
  18407. return dashOb;
  18408. }
  18409. },
  18410. _name: {
  18411. value: shape.nm
  18412. },
  18413. mn: {
  18414. value: shape.mn
  18415. }
  18416. });
  18417. view.c.setGroupProperty(PropertyInterface('Color', _propertyGroup));
  18418. view.o.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
  18419. view.w.setGroupProperty(PropertyInterface('Stroke Width', _propertyGroup));
  18420. return interfaceFunction;
  18421. }
  18422. function trimInterfaceFactory(shape, view, propertyGroup) {
  18423. function interfaceFunction(val) {
  18424. if (val === shape.e.ix || val === 'End' || val === 'end') {
  18425. return interfaceFunction.end;
  18426. }
  18427. if (val === shape.s.ix) {
  18428. return interfaceFunction.start;
  18429. }
  18430. if (val === shape.o.ix) {
  18431. return interfaceFunction.offset;
  18432. }
  18433. return null;
  18434. }
  18435. var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
  18436. interfaceFunction.propertyIndex = shape.ix;
  18437. view.s.setGroupProperty(PropertyInterface('Start', _propertyGroup));
  18438. view.e.setGroupProperty(PropertyInterface('End', _propertyGroup));
  18439. view.o.setGroupProperty(PropertyInterface('Offset', _propertyGroup));
  18440. interfaceFunction.propertyIndex = shape.ix;
  18441. interfaceFunction.propertyGroup = propertyGroup;
  18442. Object.defineProperties(interfaceFunction, {
  18443. start: {
  18444. get: ExpressionPropertyInterface(view.s)
  18445. },
  18446. end: {
  18447. get: ExpressionPropertyInterface(view.e)
  18448. },
  18449. offset: {
  18450. get: ExpressionPropertyInterface(view.o)
  18451. },
  18452. _name: {
  18453. value: shape.nm
  18454. }
  18455. });
  18456. interfaceFunction.mn = shape.mn;
  18457. return interfaceFunction;
  18458. }
  18459. function transformInterfaceFactory(shape, view, propertyGroup) {
  18460. function interfaceFunction(value) {
  18461. if (shape.a.ix === value || value === 'Anchor Point') {
  18462. return interfaceFunction.anchorPoint;
  18463. }
  18464. if (shape.o.ix === value || value === 'Opacity') {
  18465. return interfaceFunction.opacity;
  18466. }
  18467. if (shape.p.ix === value || value === 'Position') {
  18468. return interfaceFunction.position;
  18469. }
  18470. if (shape.r.ix === value || value === 'Rotation' || value === 'ADBE Vector Rotation') {
  18471. return interfaceFunction.rotation;
  18472. }
  18473. if (shape.s.ix === value || value === 'Scale') {
  18474. return interfaceFunction.scale;
  18475. }
  18476. if (shape.sk && shape.sk.ix === value || value === 'Skew') {
  18477. return interfaceFunction.skew;
  18478. }
  18479. if (shape.sa && shape.sa.ix === value || value === 'Skew Axis') {
  18480. return interfaceFunction.skewAxis;
  18481. }
  18482. return null;
  18483. }
  18484. var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
  18485. view.transform.mProps.o.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
  18486. view.transform.mProps.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
  18487. view.transform.mProps.a.setGroupProperty(PropertyInterface('Anchor Point', _propertyGroup));
  18488. view.transform.mProps.s.setGroupProperty(PropertyInterface('Scale', _propertyGroup));
  18489. view.transform.mProps.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
  18490. if (view.transform.mProps.sk) {
  18491. view.transform.mProps.sk.setGroupProperty(PropertyInterface('Skew', _propertyGroup));
  18492. view.transform.mProps.sa.setGroupProperty(PropertyInterface('Skew Angle', _propertyGroup));
  18493. }
  18494. view.transform.op.setGroupProperty(PropertyInterface('Opacity', _propertyGroup));
  18495. Object.defineProperties(interfaceFunction, {
  18496. opacity: {
  18497. get: ExpressionPropertyInterface(view.transform.mProps.o)
  18498. },
  18499. position: {
  18500. get: ExpressionPropertyInterface(view.transform.mProps.p)
  18501. },
  18502. anchorPoint: {
  18503. get: ExpressionPropertyInterface(view.transform.mProps.a)
  18504. },
  18505. scale: {
  18506. get: ExpressionPropertyInterface(view.transform.mProps.s)
  18507. },
  18508. rotation: {
  18509. get: ExpressionPropertyInterface(view.transform.mProps.r)
  18510. },
  18511. skew: {
  18512. get: ExpressionPropertyInterface(view.transform.mProps.sk)
  18513. },
  18514. skewAxis: {
  18515. get: ExpressionPropertyInterface(view.transform.mProps.sa)
  18516. },
  18517. _name: {
  18518. value: shape.nm
  18519. }
  18520. });
  18521. interfaceFunction.ty = 'tr';
  18522. interfaceFunction.mn = shape.mn;
  18523. interfaceFunction.propertyGroup = propertyGroup;
  18524. return interfaceFunction;
  18525. }
  18526. function ellipseInterfaceFactory(shape, view, propertyGroup) {
  18527. function interfaceFunction(value) {
  18528. if (shape.p.ix === value) {
  18529. return interfaceFunction.position;
  18530. }
  18531. if (shape.s.ix === value) {
  18532. return interfaceFunction.size;
  18533. }
  18534. return null;
  18535. }
  18536. var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
  18537. interfaceFunction.propertyIndex = shape.ix;
  18538. var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
  18539. prop.s.setGroupProperty(PropertyInterface('Size', _propertyGroup));
  18540. prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
  18541. Object.defineProperties(interfaceFunction, {
  18542. size: {
  18543. get: ExpressionPropertyInterface(prop.s)
  18544. },
  18545. position: {
  18546. get: ExpressionPropertyInterface(prop.p)
  18547. },
  18548. _name: {
  18549. value: shape.nm
  18550. }
  18551. });
  18552. interfaceFunction.mn = shape.mn;
  18553. return interfaceFunction;
  18554. }
  18555. function starInterfaceFactory(shape, view, propertyGroup) {
  18556. function interfaceFunction(value) {
  18557. if (shape.p.ix === value) {
  18558. return interfaceFunction.position;
  18559. }
  18560. if (shape.r.ix === value) {
  18561. return interfaceFunction.rotation;
  18562. }
  18563. if (shape.pt.ix === value) {
  18564. return interfaceFunction.points;
  18565. }
  18566. if (shape.or.ix === value || value === 'ADBE Vector Star Outer Radius') {
  18567. return interfaceFunction.outerRadius;
  18568. }
  18569. if (shape.os.ix === value) {
  18570. return interfaceFunction.outerRoundness;
  18571. }
  18572. if (shape.ir && (shape.ir.ix === value || value === 'ADBE Vector Star Inner Radius')) {
  18573. return interfaceFunction.innerRadius;
  18574. }
  18575. if (shape.is && shape.is.ix === value) {
  18576. return interfaceFunction.innerRoundness;
  18577. }
  18578. return null;
  18579. }
  18580. var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
  18581. var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
  18582. interfaceFunction.propertyIndex = shape.ix;
  18583. prop.or.setGroupProperty(PropertyInterface('Outer Radius', _propertyGroup));
  18584. prop.os.setGroupProperty(PropertyInterface('Outer Roundness', _propertyGroup));
  18585. prop.pt.setGroupProperty(PropertyInterface('Points', _propertyGroup));
  18586. prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
  18587. prop.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
  18588. if (shape.ir) {
  18589. prop.ir.setGroupProperty(PropertyInterface('Inner Radius', _propertyGroup));
  18590. prop.is.setGroupProperty(PropertyInterface('Inner Roundness', _propertyGroup));
  18591. }
  18592. Object.defineProperties(interfaceFunction, {
  18593. position: {
  18594. get: ExpressionPropertyInterface(prop.p)
  18595. },
  18596. rotation: {
  18597. get: ExpressionPropertyInterface(prop.r)
  18598. },
  18599. points: {
  18600. get: ExpressionPropertyInterface(prop.pt)
  18601. },
  18602. outerRadius: {
  18603. get: ExpressionPropertyInterface(prop.or)
  18604. },
  18605. outerRoundness: {
  18606. get: ExpressionPropertyInterface(prop.os)
  18607. },
  18608. innerRadius: {
  18609. get: ExpressionPropertyInterface(prop.ir)
  18610. },
  18611. innerRoundness: {
  18612. get: ExpressionPropertyInterface(prop.is)
  18613. },
  18614. _name: {
  18615. value: shape.nm
  18616. }
  18617. });
  18618. interfaceFunction.mn = shape.mn;
  18619. return interfaceFunction;
  18620. }
  18621. function rectInterfaceFactory(shape, view, propertyGroup) {
  18622. function interfaceFunction(value) {
  18623. if (shape.p.ix === value) {
  18624. return interfaceFunction.position;
  18625. }
  18626. if (shape.r.ix === value) {
  18627. return interfaceFunction.roundness;
  18628. }
  18629. if (shape.s.ix === value || value === 'Size' || value === 'ADBE Vector Rect Size') {
  18630. return interfaceFunction.size;
  18631. }
  18632. return null;
  18633. }
  18634. var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
  18635. var prop = view.sh.ty === 'tm' ? view.sh.prop : view.sh;
  18636. interfaceFunction.propertyIndex = shape.ix;
  18637. prop.p.setGroupProperty(PropertyInterface('Position', _propertyGroup));
  18638. prop.s.setGroupProperty(PropertyInterface('Size', _propertyGroup));
  18639. prop.r.setGroupProperty(PropertyInterface('Rotation', _propertyGroup));
  18640. Object.defineProperties(interfaceFunction, {
  18641. position: {
  18642. get: ExpressionPropertyInterface(prop.p)
  18643. },
  18644. roundness: {
  18645. get: ExpressionPropertyInterface(prop.r)
  18646. },
  18647. size: {
  18648. get: ExpressionPropertyInterface(prop.s)
  18649. },
  18650. _name: {
  18651. value: shape.nm
  18652. }
  18653. });
  18654. interfaceFunction.mn = shape.mn;
  18655. return interfaceFunction;
  18656. }
  18657. function roundedInterfaceFactory(shape, view, propertyGroup) {
  18658. function interfaceFunction(value) {
  18659. if (shape.r.ix === value || value === 'Round Corners 1') {
  18660. return interfaceFunction.radius;
  18661. }
  18662. return null;
  18663. }
  18664. var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
  18665. var prop = view;
  18666. interfaceFunction.propertyIndex = shape.ix;
  18667. prop.rd.setGroupProperty(PropertyInterface('Radius', _propertyGroup));
  18668. Object.defineProperties(interfaceFunction, {
  18669. radius: {
  18670. get: ExpressionPropertyInterface(prop.rd)
  18671. },
  18672. _name: {
  18673. value: shape.nm
  18674. }
  18675. });
  18676. interfaceFunction.mn = shape.mn;
  18677. return interfaceFunction;
  18678. }
  18679. function repeaterInterfaceFactory(shape, view, propertyGroup) {
  18680. function interfaceFunction(value) {
  18681. if (shape.c.ix === value || value === 'Copies') {
  18682. return interfaceFunction.copies;
  18683. }
  18684. if (shape.o.ix === value || value === 'Offset') {
  18685. return interfaceFunction.offset;
  18686. }
  18687. return null;
  18688. }
  18689. var _propertyGroup = propertyGroupFactory(interfaceFunction, propertyGroup);
  18690. var prop = view;
  18691. interfaceFunction.propertyIndex = shape.ix;
  18692. prop.c.setGroupProperty(PropertyInterface('Copies', _propertyGroup));
  18693. prop.o.setGroupProperty(PropertyInterface('Offset', _propertyGroup));
  18694. Object.defineProperties(interfaceFunction, {
  18695. copies: {
  18696. get: ExpressionPropertyInterface(prop.c)
  18697. },
  18698. offset: {
  18699. get: ExpressionPropertyInterface(prop.o)
  18700. },
  18701. _name: {
  18702. value: shape.nm
  18703. }
  18704. });
  18705. interfaceFunction.mn = shape.mn;
  18706. return interfaceFunction;
  18707. }
  18708. return function (shapes, view, propertyGroup) {
  18709. var interfaces;
  18710. function _interfaceFunction(value) {
  18711. if (typeof value === 'number') {
  18712. value = value === undefined ? 1 : value;
  18713. if (value === 0) {
  18714. return propertyGroup;
  18715. }
  18716. return interfaces[value - 1];
  18717. }
  18718. var i = 0;
  18719. var len = interfaces.length;
  18720. while (i < len) {
  18721. if (interfaces[i]._name === value) {
  18722. return interfaces[i];
  18723. }
  18724. i += 1;
  18725. }
  18726. return null;
  18727. }
  18728. function parentGroupWrapper() {
  18729. return propertyGroup;
  18730. }
  18731. _interfaceFunction.propertyGroup = propertyGroupFactory(_interfaceFunction, parentGroupWrapper);
  18732. interfaces = iterateElements(shapes, view, _interfaceFunction.propertyGroup);
  18733. _interfaceFunction.numProperties = interfaces.length;
  18734. _interfaceFunction._name = 'Contents';
  18735. return _interfaceFunction;
  18736. };
  18737. }();
  18738. var TextExpressionInterface = function () {
  18739. return function (elem) {
  18740. var _sourceText;
  18741. function _thisLayerFunction(name) {
  18742. switch (name) {
  18743. case 'ADBE Text Document':
  18744. return _thisLayerFunction.sourceText;
  18745. default:
  18746. return null;
  18747. }
  18748. }
  18749. Object.defineProperty(_thisLayerFunction, 'sourceText', {
  18750. get: function get() {
  18751. elem.textProperty.getValue();
  18752. var stringValue = elem.textProperty.currentData.t;
  18753. if (!_sourceText || stringValue !== _sourceText.value) {
  18754. _sourceText = new String(stringValue); // eslint-disable-line no-new-wrappers
  18755. // If stringValue is an empty string, eval returns undefined, so it has to be returned as a String primitive
  18756. _sourceText.value = stringValue || new String(stringValue); // eslint-disable-line no-new-wrappers
  18757. Object.defineProperty(_sourceText, 'style', {
  18758. get: function get() {
  18759. return {
  18760. fillColor: elem.textProperty.currentData.fc
  18761. };
  18762. }
  18763. });
  18764. }
  18765. return _sourceText;
  18766. }
  18767. });
  18768. return _thisLayerFunction;
  18769. };
  18770. }();
  18771. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  18772. var FootageInterface = function () {
  18773. var outlineInterfaceFactory = function outlineInterfaceFactory(elem) {
  18774. var currentPropertyName = '';
  18775. var currentProperty = elem.getFootageData();
  18776. function init() {
  18777. currentPropertyName = '';
  18778. currentProperty = elem.getFootageData();
  18779. return searchProperty;
  18780. }
  18781. function searchProperty(value) {
  18782. if (currentProperty[value]) {
  18783. currentPropertyName = value;
  18784. currentProperty = currentProperty[value];
  18785. if (_typeof(currentProperty) === 'object') {
  18786. return searchProperty;
  18787. }
  18788. return currentProperty;
  18789. }
  18790. var propertyNameIndex = value.indexOf(currentPropertyName);
  18791. if (propertyNameIndex !== -1) {
  18792. var index = parseInt(value.substr(propertyNameIndex + currentPropertyName.length), 10);
  18793. currentProperty = currentProperty[index];
  18794. if (_typeof(currentProperty) === 'object') {
  18795. return searchProperty;
  18796. }
  18797. return currentProperty;
  18798. }
  18799. return '';
  18800. }
  18801. return init;
  18802. };
  18803. var dataInterfaceFactory = function dataInterfaceFactory(elem) {
  18804. function interfaceFunction(value) {
  18805. if (value === 'Outline') {
  18806. return interfaceFunction.outlineInterface();
  18807. }
  18808. return null;
  18809. }
  18810. interfaceFunction._name = 'Outline';
  18811. interfaceFunction.outlineInterface = outlineInterfaceFactory(elem);
  18812. return interfaceFunction;
  18813. };
  18814. return function (elem) {
  18815. function _interfaceFunction(value) {
  18816. if (value === 'Data') {
  18817. return _interfaceFunction.dataInterface;
  18818. }
  18819. return null;
  18820. }
  18821. _interfaceFunction._name = 'Data';
  18822. _interfaceFunction.dataInterface = dataInterfaceFactory(elem);
  18823. return _interfaceFunction;
  18824. };
  18825. }();
  18826. var interfaces = {
  18827. layer: LayerExpressionInterface,
  18828. effects: EffectsExpressionInterface,
  18829. comp: CompExpressionInterface,
  18830. shape: ShapeExpressionInterface,
  18831. text: TextExpressionInterface,
  18832. footage: FootageInterface
  18833. };
  18834. function getInterface(type) {
  18835. return interfaces[type] || null;
  18836. }
  18837. var expressionHelpers = function () {
  18838. function searchExpressions(elem, data, prop) {
  18839. if (data.x) {
  18840. prop.k = true;
  18841. prop.x = true;
  18842. prop.initiateExpression = ExpressionManager.initiateExpression;
  18843. prop.effectsSequence.push(prop.initiateExpression(elem, data, prop).bind(prop));
  18844. }
  18845. }
  18846. function getValueAtTime(frameNum) {
  18847. frameNum *= this.elem.globalData.frameRate;
  18848. frameNum -= this.offsetTime;
  18849. if (frameNum !== this._cachingAtTime.lastFrame) {
  18850. this._cachingAtTime.lastIndex = this._cachingAtTime.lastFrame < frameNum ? this._cachingAtTime.lastIndex : 0;
  18851. this._cachingAtTime.value = this.interpolateValue(frameNum, this._cachingAtTime);
  18852. this._cachingAtTime.lastFrame = frameNum;
  18853. }
  18854. return this._cachingAtTime.value;
  18855. }
  18856. function getSpeedAtTime(frameNum) {
  18857. var delta = -0.01;
  18858. var v1 = this.getValueAtTime(frameNum);
  18859. var v2 = this.getValueAtTime(frameNum + delta);
  18860. var speed = 0;
  18861. if (v1.length) {
  18862. var i;
  18863. for (i = 0; i < v1.length; i += 1) {
  18864. speed += Math.pow(v2[i] - v1[i], 2);
  18865. }
  18866. speed = Math.sqrt(speed) * 100;
  18867. } else {
  18868. speed = 0;
  18869. }
  18870. return speed;
  18871. }
  18872. function getVelocityAtTime(frameNum) {
  18873. if (this.vel !== undefined) {
  18874. return this.vel;
  18875. }
  18876. var delta = -0.001; // frameNum += this.elem.data.st;
  18877. var v1 = this.getValueAtTime(frameNum);
  18878. var v2 = this.getValueAtTime(frameNum + delta);
  18879. var velocity;
  18880. if (v1.length) {
  18881. velocity = createTypedArray('float32', v1.length);
  18882. var i;
  18883. for (i = 0; i < v1.length; i += 1) {
  18884. // removing frameRate
  18885. // if needed, don't add it here
  18886. // velocity[i] = this.elem.globalData.frameRate*((v2[i] - v1[i])/delta);
  18887. velocity[i] = (v2[i] - v1[i]) / delta;
  18888. }
  18889. } else {
  18890. velocity = (v2 - v1) / delta;
  18891. }
  18892. return velocity;
  18893. }
  18894. function getStaticValueAtTime() {
  18895. return this.pv;
  18896. }
  18897. function setGroupProperty(propertyGroup) {
  18898. this.propertyGroup = propertyGroup;
  18899. }
  18900. return {
  18901. searchExpressions: searchExpressions,
  18902. getSpeedAtTime: getSpeedAtTime,
  18903. getVelocityAtTime: getVelocityAtTime,
  18904. getValueAtTime: getValueAtTime,
  18905. getStaticValueAtTime: getStaticValueAtTime,
  18906. setGroupProperty: setGroupProperty
  18907. };
  18908. }();
  18909. function addPropertyDecorator() {
  18910. function loopOut(type, duration, durationFlag) {
  18911. if (!this.k || !this.keyframes) {
  18912. return this.pv;
  18913. }
  18914. type = type ? type.toLowerCase() : '';
  18915. var currentFrame = this.comp.renderedFrame;
  18916. var keyframes = this.keyframes;
  18917. var lastKeyFrame = keyframes[keyframes.length - 1].t;
  18918. if (currentFrame <= lastKeyFrame) {
  18919. return this.pv;
  18920. }
  18921. var cycleDuration;
  18922. var firstKeyFrame;
  18923. if (!durationFlag) {
  18924. if (!duration || duration > keyframes.length - 1) {
  18925. duration = keyframes.length - 1;
  18926. }
  18927. firstKeyFrame = keyframes[keyframes.length - 1 - duration].t;
  18928. cycleDuration = lastKeyFrame - firstKeyFrame;
  18929. } else {
  18930. if (!duration) {
  18931. cycleDuration = Math.max(0, lastKeyFrame - this.elem.data.ip);
  18932. } else {
  18933. cycleDuration = Math.abs(lastKeyFrame - this.elem.comp.globalData.frameRate * duration);
  18934. }
  18935. firstKeyFrame = lastKeyFrame - cycleDuration;
  18936. }
  18937. var i;
  18938. var len;
  18939. var ret;
  18940. if (type === 'pingpong') {
  18941. var iterations = Math.floor((currentFrame - firstKeyFrame) / cycleDuration);
  18942. if (iterations % 2 !== 0) {
  18943. return this.getValueAtTime((cycleDuration - (currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame) / this.comp.globalData.frameRate, 0); // eslint-disable-line
  18944. }
  18945. } else if (type === 'offset') {
  18946. var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
  18947. var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
  18948. var current = this.getValueAtTime(((currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame) / this.comp.globalData.frameRate, 0); // eslint-disable-line
  18949. var repeats = Math.floor((currentFrame - firstKeyFrame) / cycleDuration);
  18950. if (this.pv.length) {
  18951. ret = new Array(initV.length);
  18952. len = ret.length;
  18953. for (i = 0; i < len; i += 1) {
  18954. ret[i] = (endV[i] - initV[i]) * repeats + current[i];
  18955. }
  18956. return ret;
  18957. }
  18958. return (endV - initV) * repeats + current;
  18959. } else if (type === 'continue') {
  18960. var lastValue = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
  18961. var nextLastValue = this.getValueAtTime((lastKeyFrame - 0.001) / this.comp.globalData.frameRate, 0);
  18962. if (this.pv.length) {
  18963. ret = new Array(lastValue.length);
  18964. len = ret.length;
  18965. for (i = 0; i < len; i += 1) {
  18966. ret[i] = lastValue[i] + (lastValue[i] - nextLastValue[i]) * ((currentFrame - lastKeyFrame) / this.comp.globalData.frameRate) / 0.0005; // eslint-disable-line
  18967. }
  18968. return ret;
  18969. }
  18970. return lastValue + (lastValue - nextLastValue) * ((currentFrame - lastKeyFrame) / 0.001);
  18971. }
  18972. return this.getValueAtTime(((currentFrame - firstKeyFrame) % cycleDuration + firstKeyFrame) / this.comp.globalData.frameRate, 0); // eslint-disable-line
  18973. }
  18974. function loopIn(type, duration, durationFlag) {
  18975. if (!this.k) {
  18976. return this.pv;
  18977. }
  18978. type = type ? type.toLowerCase() : '';
  18979. var currentFrame = this.comp.renderedFrame;
  18980. var keyframes = this.keyframes;
  18981. var firstKeyFrame = keyframes[0].t;
  18982. if (currentFrame >= firstKeyFrame) {
  18983. return this.pv;
  18984. }
  18985. var cycleDuration;
  18986. var lastKeyFrame;
  18987. if (!durationFlag) {
  18988. if (!duration || duration > keyframes.length - 1) {
  18989. duration = keyframes.length - 1;
  18990. }
  18991. lastKeyFrame = keyframes[duration].t;
  18992. cycleDuration = lastKeyFrame - firstKeyFrame;
  18993. } else {
  18994. if (!duration) {
  18995. cycleDuration = Math.max(0, this.elem.data.op - firstKeyFrame);
  18996. } else {
  18997. cycleDuration = Math.abs(this.elem.comp.globalData.frameRate * duration);
  18998. }
  18999. lastKeyFrame = firstKeyFrame + cycleDuration;
  19000. }
  19001. var i;
  19002. var len;
  19003. var ret;
  19004. if (type === 'pingpong') {
  19005. var iterations = Math.floor((firstKeyFrame - currentFrame) / cycleDuration);
  19006. if (iterations % 2 === 0) {
  19007. return this.getValueAtTime(((firstKeyFrame - currentFrame) % cycleDuration + firstKeyFrame) / this.comp.globalData.frameRate, 0); // eslint-disable-line
  19008. }
  19009. } else if (type === 'offset') {
  19010. var initV = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
  19011. var endV = this.getValueAtTime(lastKeyFrame / this.comp.globalData.frameRate, 0);
  19012. var current = this.getValueAtTime((cycleDuration - (firstKeyFrame - currentFrame) % cycleDuration + firstKeyFrame) / this.comp.globalData.frameRate, 0);
  19013. var repeats = Math.floor((firstKeyFrame - currentFrame) / cycleDuration) + 1;
  19014. if (this.pv.length) {
  19015. ret = new Array(initV.length);
  19016. len = ret.length;
  19017. for (i = 0; i < len; i += 1) {
  19018. ret[i] = current[i] - (endV[i] - initV[i]) * repeats;
  19019. }
  19020. return ret;
  19021. }
  19022. return current - (endV - initV) * repeats;
  19023. } else if (type === 'continue') {
  19024. var firstValue = this.getValueAtTime(firstKeyFrame / this.comp.globalData.frameRate, 0);
  19025. var nextFirstValue = this.getValueAtTime((firstKeyFrame + 0.001) / this.comp.globalData.frameRate, 0);
  19026. if (this.pv.length) {
  19027. ret = new Array(firstValue.length);
  19028. len = ret.length;
  19029. for (i = 0; i < len; i += 1) {
  19030. ret[i] = firstValue[i] + (firstValue[i] - nextFirstValue[i]) * (firstKeyFrame - currentFrame) / 0.001;
  19031. }
  19032. return ret;
  19033. }
  19034. return firstValue + (firstValue - nextFirstValue) * (firstKeyFrame - currentFrame) / 0.001;
  19035. }
  19036. return this.getValueAtTime((cycleDuration - ((firstKeyFrame - currentFrame) % cycleDuration + firstKeyFrame)) / this.comp.globalData.frameRate, 0); // eslint-disable-line
  19037. }
  19038. function smooth(width, samples) {
  19039. if (!this.k) {
  19040. return this.pv;
  19041. }
  19042. width = (width || 0.4) * 0.5;
  19043. samples = Math.floor(samples || 5);
  19044. if (samples <= 1) {
  19045. return this.pv;
  19046. }
  19047. var currentTime = this.comp.renderedFrame / this.comp.globalData.frameRate;
  19048. var initFrame = currentTime - width;
  19049. var endFrame = currentTime + width;
  19050. var sampleFrequency = samples > 1 ? (endFrame - initFrame) / (samples - 1) : 1;
  19051. var i = 0;
  19052. var j = 0;
  19053. var value;
  19054. if (this.pv.length) {
  19055. value = createTypedArray('float32', this.pv.length);
  19056. } else {
  19057. value = 0;
  19058. }
  19059. var sampleValue;
  19060. while (i < samples) {
  19061. sampleValue = this.getValueAtTime(initFrame + i * sampleFrequency);
  19062. if (this.pv.length) {
  19063. for (j = 0; j < this.pv.length; j += 1) {
  19064. value[j] += sampleValue[j];
  19065. }
  19066. } else {
  19067. value += sampleValue;
  19068. }
  19069. i += 1;
  19070. }
  19071. if (this.pv.length) {
  19072. for (j = 0; j < this.pv.length; j += 1) {
  19073. value[j] /= samples;
  19074. }
  19075. } else {
  19076. value /= samples;
  19077. }
  19078. return value;
  19079. }
  19080. function getTransformValueAtTime(time) {
  19081. if (!this._transformCachingAtTime) {
  19082. this._transformCachingAtTime = {
  19083. v: new Matrix()
  19084. };
  19085. } /// /
  19086. var matrix = this._transformCachingAtTime.v;
  19087. matrix.cloneFromProps(this.pre.props);
  19088. if (this.appliedTransformations < 1) {
  19089. var anchor = this.a.getValueAtTime(time);
  19090. matrix.translate(-anchor[0] * this.a.mult, -anchor[1] * this.a.mult, anchor[2] * this.a.mult);
  19091. }
  19092. if (this.appliedTransformations < 2) {
  19093. var scale = this.s.getValueAtTime(time);
  19094. matrix.scale(scale[0] * this.s.mult, scale[1] * this.s.mult, scale[2] * this.s.mult);
  19095. }
  19096. if (this.sk && this.appliedTransformations < 3) {
  19097. var skew = this.sk.getValueAtTime(time);
  19098. var skewAxis = this.sa.getValueAtTime(time);
  19099. matrix.skewFromAxis(-skew * this.sk.mult, skewAxis * this.sa.mult);
  19100. }
  19101. if (this.r && this.appliedTransformations < 4) {
  19102. var rotation = this.r.getValueAtTime(time);
  19103. matrix.rotate(-rotation * this.r.mult);
  19104. } else if (!this.r && this.appliedTransformations < 4) {
  19105. var rotationZ = this.rz.getValueAtTime(time);
  19106. var rotationY = this.ry.getValueAtTime(time);
  19107. var rotationX = this.rx.getValueAtTime(time);
  19108. var orientation = this.or.getValueAtTime(time);
  19109. matrix.rotateZ(-rotationZ * this.rz.mult).rotateY(rotationY * this.ry.mult).rotateX(rotationX * this.rx.mult).rotateZ(-orientation[2] * this.or.mult).rotateY(orientation[1] * this.or.mult).rotateX(orientation[0] * this.or.mult);
  19110. }
  19111. if (this.data.p && this.data.p.s) {
  19112. var positionX = this.px.getValueAtTime(time);
  19113. var positionY = this.py.getValueAtTime(time);
  19114. if (this.data.p.z) {
  19115. var positionZ = this.pz.getValueAtTime(time);
  19116. matrix.translate(positionX * this.px.mult, positionY * this.py.mult, -positionZ * this.pz.mult);
  19117. } else {
  19118. matrix.translate(positionX * this.px.mult, positionY * this.py.mult, 0);
  19119. }
  19120. } else {
  19121. var position = this.p.getValueAtTime(time);
  19122. matrix.translate(position[0] * this.p.mult, position[1] * this.p.mult, -position[2] * this.p.mult);
  19123. }
  19124. return matrix; /// /
  19125. }
  19126. function getTransformStaticValueAtTime() {
  19127. return this.v.clone(new Matrix());
  19128. }
  19129. var getTransformProperty = TransformPropertyFactory.getTransformProperty;
  19130. TransformPropertyFactory.getTransformProperty = function (elem, data, container) {
  19131. var prop = getTransformProperty(elem, data, container);
  19132. if (prop.dynamicProperties.length) {
  19133. prop.getValueAtTime = getTransformValueAtTime.bind(prop);
  19134. } else {
  19135. prop.getValueAtTime = getTransformStaticValueAtTime.bind(prop);
  19136. }
  19137. prop.setGroupProperty = expressionHelpers.setGroupProperty;
  19138. return prop;
  19139. };
  19140. var propertyGetProp = PropertyFactory.getProp;
  19141. PropertyFactory.getProp = function (elem, data, type, mult, container) {
  19142. var prop = propertyGetProp(elem, data, type, mult, container); // prop.getVelocityAtTime = getVelocityAtTime;
  19143. // prop.loopOut = loopOut;
  19144. // prop.loopIn = loopIn;
  19145. if (prop.kf) {
  19146. prop.getValueAtTime = expressionHelpers.getValueAtTime.bind(prop);
  19147. } else {
  19148. prop.getValueAtTime = expressionHelpers.getStaticValueAtTime.bind(prop);
  19149. }
  19150. prop.setGroupProperty = expressionHelpers.setGroupProperty;
  19151. prop.loopOut = loopOut;
  19152. prop.loopIn = loopIn;
  19153. prop.smooth = smooth;
  19154. prop.getVelocityAtTime = expressionHelpers.getVelocityAtTime.bind(prop);
  19155. prop.getSpeedAtTime = expressionHelpers.getSpeedAtTime.bind(prop);
  19156. prop.numKeys = data.a === 1 ? data.k.length : 0;
  19157. prop.propertyIndex = data.ix;
  19158. var value = 0;
  19159. if (type !== 0) {
  19160. value = createTypedArray('float32', data.a === 1 ? data.k[0].s.length : data.k.length);
  19161. }
  19162. prop._cachingAtTime = {
  19163. lastFrame: initialDefaultFrame,
  19164. lastIndex: 0,
  19165. value: value
  19166. };
  19167. expressionHelpers.searchExpressions(elem, data, prop);
  19168. if (prop.k) {
  19169. container.addDynamicProperty(prop);
  19170. }
  19171. return prop;
  19172. };
  19173. function getShapeValueAtTime(frameNum) {
  19174. // For now this caching object is created only when needed instead of creating it when the shape is initialized.
  19175. if (!this._cachingAtTime) {
  19176. this._cachingAtTime = {
  19177. shapeValue: shapePool.clone(this.pv),
  19178. lastIndex: 0,
  19179. lastTime: initialDefaultFrame
  19180. };
  19181. }
  19182. frameNum *= this.elem.globalData.frameRate;
  19183. frameNum -= this.offsetTime;
  19184. if (frameNum !== this._cachingAtTime.lastTime) {
  19185. this._cachingAtTime.lastIndex = this._cachingAtTime.lastTime < frameNum ? this._caching.lastIndex : 0;
  19186. this._cachingAtTime.lastTime = frameNum;
  19187. this.interpolateShape(frameNum, this._cachingAtTime.shapeValue, this._cachingAtTime);
  19188. }
  19189. return this._cachingAtTime.shapeValue;
  19190. }
  19191. var ShapePropertyConstructorFunction = ShapePropertyFactory.getConstructorFunction();
  19192. var KeyframedShapePropertyConstructorFunction = ShapePropertyFactory.getKeyframedConstructorFunction();
  19193. function ShapeExpressions() {}
  19194. ShapeExpressions.prototype = {
  19195. vertices: function vertices(prop, time) {
  19196. if (this.k) {
  19197. this.getValue();
  19198. }
  19199. var shapePath = this.v;
  19200. if (time !== undefined) {
  19201. shapePath = this.getValueAtTime(time, 0);
  19202. }
  19203. var i;
  19204. var len = shapePath._length;
  19205. var vertices = shapePath[prop];
  19206. var points = shapePath.v;
  19207. var arr = createSizedArray(len);
  19208. for (i = 0; i < len; i += 1) {
  19209. if (prop === 'i' || prop === 'o') {
  19210. arr[i] = [vertices[i][0] - points[i][0], vertices[i][1] - points[i][1]];
  19211. } else {
  19212. arr[i] = [vertices[i][0], vertices[i][1]];
  19213. }
  19214. }
  19215. return arr;
  19216. },
  19217. points: function points(time) {
  19218. return this.vertices('v', time);
  19219. },
  19220. inTangents: function inTangents(time) {
  19221. return this.vertices('i', time);
  19222. },
  19223. outTangents: function outTangents(time) {
  19224. return this.vertices('o', time);
  19225. },
  19226. isClosed: function isClosed() {
  19227. return this.v.c;
  19228. },
  19229. pointOnPath: function pointOnPath(perc, time) {
  19230. var shapePath = this.v;
  19231. if (time !== undefined) {
  19232. shapePath = this.getValueAtTime(time, 0);
  19233. }
  19234. if (!this._segmentsLength) {
  19235. this._segmentsLength = bez.getSegmentsLength(shapePath);
  19236. }
  19237. var segmentsLength = this._segmentsLength;
  19238. var lengths = segmentsLength.lengths;
  19239. var lengthPos = segmentsLength.totalLength * perc;
  19240. var i = 0;
  19241. var len = lengths.length;
  19242. var accumulatedLength = 0;
  19243. var pt;
  19244. while (i < len) {
  19245. if (accumulatedLength + lengths[i].addedLength > lengthPos) {
  19246. var initIndex = i;
  19247. var endIndex = shapePath.c && i === len - 1 ? 0 : i + 1;
  19248. var segmentPerc = (lengthPos - accumulatedLength) / lengths[i].addedLength;
  19249. pt = bez.getPointInSegment(shapePath.v[initIndex], shapePath.v[endIndex], shapePath.o[initIndex], shapePath.i[endIndex], segmentPerc, lengths[i]);
  19250. break;
  19251. } else {
  19252. accumulatedLength += lengths[i].addedLength;
  19253. }
  19254. i += 1;
  19255. }
  19256. if (!pt) {
  19257. pt = shapePath.c ? [shapePath.v[0][0], shapePath.v[0][1]] : [shapePath.v[shapePath._length - 1][0], shapePath.v[shapePath._length - 1][1]];
  19258. }
  19259. return pt;
  19260. },
  19261. vectorOnPath: function vectorOnPath(perc, time, vectorType) {
  19262. // perc doesn't use triple equality because it can be a Number object as well as a primitive.
  19263. if (perc == 1) {
  19264. // eslint-disable-line eqeqeq
  19265. perc = this.v.c;
  19266. } else if (perc == 0) {
  19267. // eslint-disable-line eqeqeq
  19268. perc = 0.999;
  19269. }
  19270. var pt1 = this.pointOnPath(perc, time);
  19271. var pt2 = this.pointOnPath(perc + 0.001, time);
  19272. var xLength = pt2[0] - pt1[0];
  19273. var yLength = pt2[1] - pt1[1];
  19274. var magnitude = Math.sqrt(Math.pow(xLength, 2) + Math.pow(yLength, 2));
  19275. if (magnitude === 0) {
  19276. return [0, 0];
  19277. }
  19278. var unitVector = vectorType === 'tangent' ? [xLength / magnitude, yLength / magnitude] : [-yLength / magnitude, xLength / magnitude];
  19279. return unitVector;
  19280. },
  19281. tangentOnPath: function tangentOnPath(perc, time) {
  19282. return this.vectorOnPath(perc, time, 'tangent');
  19283. },
  19284. normalOnPath: function normalOnPath(perc, time) {
  19285. return this.vectorOnPath(perc, time, 'normal');
  19286. },
  19287. setGroupProperty: expressionHelpers.setGroupProperty,
  19288. getValueAtTime: expressionHelpers.getStaticValueAtTime
  19289. };
  19290. extendPrototype([ShapeExpressions], ShapePropertyConstructorFunction);
  19291. extendPrototype([ShapeExpressions], KeyframedShapePropertyConstructorFunction);
  19292. KeyframedShapePropertyConstructorFunction.prototype.getValueAtTime = getShapeValueAtTime;
  19293. KeyframedShapePropertyConstructorFunction.prototype.initiateExpression = ExpressionManager.initiateExpression;
  19294. var propertyGetShapeProp = ShapePropertyFactory.getShapeProp;
  19295. ShapePropertyFactory.getShapeProp = function (elem, data, type, arr, trims) {
  19296. var prop = propertyGetShapeProp(elem, data, type, arr, trims);
  19297. prop.propertyIndex = data.ix;
  19298. prop.lock = false;
  19299. if (type === 3) {
  19300. expressionHelpers.searchExpressions(elem, data.pt, prop);
  19301. } else if (type === 4) {
  19302. expressionHelpers.searchExpressions(elem, data.ks, prop);
  19303. }
  19304. if (prop.k) {
  19305. elem.addDynamicProperty(prop);
  19306. }
  19307. return prop;
  19308. };
  19309. }
  19310. function initialize$1() {
  19311. addPropertyDecorator();
  19312. }
  19313. function addDecorator() {
  19314. function searchExpressions() {
  19315. if (this.data.d.x) {
  19316. this.calculateExpression = ExpressionManager.initiateExpression.bind(this)(this.elem, this.data.d, this);
  19317. this.addEffect(this.getExpressionValue.bind(this));
  19318. return true;
  19319. }
  19320. return null;
  19321. }
  19322. TextProperty.prototype.getExpressionValue = function (currentValue, text) {
  19323. var newValue = this.calculateExpression(text);
  19324. if (currentValue.t !== newValue) {
  19325. var newData = {};
  19326. this.copyData(newData, currentValue);
  19327. newData.t = newValue.toString();
  19328. newData.__complete = false;
  19329. return newData;
  19330. }
  19331. return currentValue;
  19332. };
  19333. TextProperty.prototype.searchProperty = function () {
  19334. var isKeyframed = this.searchKeyframes();
  19335. var hasExpressions = this.searchExpressions();
  19336. this.kf = isKeyframed || hasExpressions;
  19337. return this.kf;
  19338. };
  19339. TextProperty.prototype.searchExpressions = searchExpressions;
  19340. }
  19341. function initialize() {
  19342. addDecorator();
  19343. }
  19344. function SVGComposableEffect() {}
  19345. SVGComposableEffect.prototype = {
  19346. createMergeNode: function createMergeNode(resultId, ins) {
  19347. var feMerge = createNS('feMerge');
  19348. feMerge.setAttribute('result', resultId);
  19349. var feMergeNode;
  19350. var i;
  19351. for (i = 0; i < ins.length; i += 1) {
  19352. feMergeNode = createNS('feMergeNode');
  19353. feMergeNode.setAttribute('in', ins[i]);
  19354. feMerge.appendChild(feMergeNode);
  19355. feMerge.appendChild(feMergeNode);
  19356. }
  19357. return feMerge;
  19358. }
  19359. };
  19360. 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';
  19361. function SVGTintFilter(filter, filterManager, elem, id, source) {
  19362. this.filterManager = filterManager;
  19363. var feColorMatrix = createNS('feColorMatrix');
  19364. feColorMatrix.setAttribute('type', 'matrix');
  19365. feColorMatrix.setAttribute('color-interpolation-filters', 'linearRGB');
  19366. feColorMatrix.setAttribute('values', linearFilterValue + ' 1 0');
  19367. this.linearFilter = feColorMatrix;
  19368. feColorMatrix.setAttribute('result', id + '_tint_1');
  19369. filter.appendChild(feColorMatrix);
  19370. feColorMatrix = createNS('feColorMatrix');
  19371. feColorMatrix.setAttribute('type', 'matrix');
  19372. feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
  19373. feColorMatrix.setAttribute('values', '1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
  19374. feColorMatrix.setAttribute('result', id + '_tint_2');
  19375. filter.appendChild(feColorMatrix);
  19376. this.matrixFilter = feColorMatrix;
  19377. var feMerge = this.createMergeNode(id, [source, id + '_tint_1', id + '_tint_2']);
  19378. filter.appendChild(feMerge);
  19379. }
  19380. extendPrototype([SVGComposableEffect], SVGTintFilter);
  19381. SVGTintFilter.prototype.renderFrame = function (forceRender) {
  19382. if (forceRender || this.filterManager._mdf) {
  19383. var colorBlack = this.filterManager.effectElements[0].p.v;
  19384. var colorWhite = this.filterManager.effectElements[1].p.v;
  19385. var opacity = this.filterManager.effectElements[2].p.v / 100;
  19386. this.linearFilter.setAttribute('values', linearFilterValue + ' ' + opacity + ' 0');
  19387. this.matrixFilter.setAttribute('values', colorWhite[0] - colorBlack[0] + ' 0 0 0 ' + colorBlack[0] + ' ' + (colorWhite[1] - colorBlack[1]) + ' 0 0 0 ' + colorBlack[1] + ' ' + (colorWhite[2] - colorBlack[2]) + ' 0 0 0 ' + colorBlack[2] + ' 0 0 0 1 0');
  19388. }
  19389. };
  19390. function SVGFillFilter(filter, filterManager, elem, id) {
  19391. this.filterManager = filterManager;
  19392. var feColorMatrix = createNS('feColorMatrix');
  19393. feColorMatrix.setAttribute('type', 'matrix');
  19394. feColorMatrix.setAttribute('color-interpolation-filters', 'sRGB');
  19395. feColorMatrix.setAttribute('values', '1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0');
  19396. feColorMatrix.setAttribute('result', id);
  19397. filter.appendChild(feColorMatrix);
  19398. this.matrixFilter = feColorMatrix;
  19399. }
  19400. SVGFillFilter.prototype.renderFrame = function (forceRender) {
  19401. if (forceRender || this.filterManager._mdf) {
  19402. var color = this.filterManager.effectElements[2].p.v;
  19403. var opacity = this.filterManager.effectElements[6].p.v;
  19404. this.matrixFilter.setAttribute('values', '0 0 0 0 ' + color[0] + ' 0 0 0 0 ' + color[1] + ' 0 0 0 0 ' + color[2] + ' 0 0 0 ' + opacity + ' 0');
  19405. }
  19406. };
  19407. function SVGStrokeEffect(fil, filterManager, elem) {
  19408. this.initialized = false;
  19409. this.filterManager = filterManager;
  19410. this.elem = elem;
  19411. this.paths = [];
  19412. }
  19413. SVGStrokeEffect.prototype.initialize = function () {
  19414. var elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
  19415. var path;
  19416. var groupPath;
  19417. var i;
  19418. var len;
  19419. if (this.filterManager.effectElements[1].p.v === 1) {
  19420. len = this.elem.maskManager.masksProperties.length;
  19421. i = 0;
  19422. } else {
  19423. i = this.filterManager.effectElements[0].p.v - 1;
  19424. len = i + 1;
  19425. }
  19426. groupPath = createNS('g');
  19427. groupPath.setAttribute('fill', 'none');
  19428. groupPath.setAttribute('stroke-linecap', 'round');
  19429. groupPath.setAttribute('stroke-dashoffset', 1);
  19430. for (i; i < len; i += 1) {
  19431. path = createNS('path');
  19432. groupPath.appendChild(path);
  19433. this.paths.push({
  19434. p: path,
  19435. m: i
  19436. });
  19437. }
  19438. if (this.filterManager.effectElements[10].p.v === 3) {
  19439. var mask = createNS('mask');
  19440. var id = createElementID();
  19441. mask.setAttribute('id', id);
  19442. mask.setAttribute('mask-type', 'alpha');
  19443. mask.appendChild(groupPath);
  19444. this.elem.globalData.defs.appendChild(mask);
  19445. var g = createNS('g');
  19446. g.setAttribute('mask', 'url(' + getLocationHref() + '#' + id + ')');
  19447. while (elemChildren[0]) {
  19448. g.appendChild(elemChildren[0]);
  19449. }
  19450. this.elem.layerElement.appendChild(g);
  19451. this.masker = mask;
  19452. groupPath.setAttribute('stroke', '#fff');
  19453. } else if (this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2) {
  19454. if (this.filterManager.effectElements[10].p.v === 2) {
  19455. elemChildren = this.elem.layerElement.children || this.elem.layerElement.childNodes;
  19456. while (elemChildren.length) {
  19457. this.elem.layerElement.removeChild(elemChildren[0]);
  19458. }
  19459. }
  19460. this.elem.layerElement.appendChild(groupPath);
  19461. this.elem.layerElement.removeAttribute('mask');
  19462. groupPath.setAttribute('stroke', '#fff');
  19463. }
  19464. this.initialized = true;
  19465. this.pathMasker = groupPath;
  19466. };
  19467. SVGStrokeEffect.prototype.renderFrame = function (forceRender) {
  19468. if (!this.initialized) {
  19469. this.initialize();
  19470. }
  19471. var i;
  19472. var len = this.paths.length;
  19473. var mask;
  19474. var path;
  19475. for (i = 0; i < len; i += 1) {
  19476. if (this.paths[i].m !== -1) {
  19477. mask = this.elem.maskManager.viewData[this.paths[i].m];
  19478. path = this.paths[i].p;
  19479. if (forceRender || this.filterManager._mdf || mask.prop._mdf) {
  19480. path.setAttribute('d', mask.lastPath);
  19481. }
  19482. if (forceRender || this.filterManager.effectElements[9].p._mdf || this.filterManager.effectElements[4].p._mdf || this.filterManager.effectElements[7].p._mdf || this.filterManager.effectElements[8].p._mdf || mask.prop._mdf) {
  19483. var dasharrayValue;
  19484. if (this.filterManager.effectElements[7].p.v !== 0 || this.filterManager.effectElements[8].p.v !== 100) {
  19485. var s = Math.min(this.filterManager.effectElements[7].p.v, this.filterManager.effectElements[8].p.v) * 0.01;
  19486. var e = Math.max(this.filterManager.effectElements[7].p.v, this.filterManager.effectElements[8].p.v) * 0.01;
  19487. var l = path.getTotalLength();
  19488. dasharrayValue = '0 0 0 ' + l * s + ' ';
  19489. var lineLength = l * (e - s);
  19490. var segment = 1 + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v * 0.01;
  19491. var units = Math.floor(lineLength / segment);
  19492. var j;
  19493. for (j = 0; j < units; j += 1) {
  19494. dasharrayValue += '1 ' + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v * 0.01 + ' ';
  19495. }
  19496. dasharrayValue += '0 ' + l * 10 + ' 0 0';
  19497. } else {
  19498. dasharrayValue = '1 ' + this.filterManager.effectElements[4].p.v * 2 * this.filterManager.effectElements[9].p.v * 0.01;
  19499. }
  19500. path.setAttribute('stroke-dasharray', dasharrayValue);
  19501. }
  19502. }
  19503. }
  19504. if (forceRender || this.filterManager.effectElements[4].p._mdf) {
  19505. this.pathMasker.setAttribute('stroke-width', this.filterManager.effectElements[4].p.v * 2);
  19506. }
  19507. if (forceRender || this.filterManager.effectElements[6].p._mdf) {
  19508. this.pathMasker.setAttribute('opacity', this.filterManager.effectElements[6].p.v);
  19509. }
  19510. if (this.filterManager.effectElements[10].p.v === 1 || this.filterManager.effectElements[10].p.v === 2) {
  19511. if (forceRender || this.filterManager.effectElements[3].p._mdf) {
  19512. var color = this.filterManager.effectElements[3].p.v;
  19513. this.pathMasker.setAttribute('stroke', 'rgb(' + bmFloor(color[0] * 255) + ',' + bmFloor(color[1] * 255) + ',' + bmFloor(color[2] * 255) + ')');
  19514. }
  19515. }
  19516. };
  19517. function SVGTritoneFilter(filter, filterManager, elem, id) {
  19518. this.filterManager = filterManager;
  19519. var feColorMatrix = createNS('feColorMatrix');
  19520. feColorMatrix.setAttribute('type', 'matrix');
  19521. feColorMatrix.setAttribute('color-interpolation-filters', 'linearRGB');
  19522. feColorMatrix.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');
  19523. filter.appendChild(feColorMatrix);
  19524. var feComponentTransfer = createNS('feComponentTransfer');
  19525. feComponentTransfer.setAttribute('color-interpolation-filters', 'sRGB');
  19526. feComponentTransfer.setAttribute('result', id);
  19527. this.matrixFilter = feComponentTransfer;
  19528. var feFuncR = createNS('feFuncR');
  19529. feFuncR.setAttribute('type', 'table');
  19530. feComponentTransfer.appendChild(feFuncR);
  19531. this.feFuncR = feFuncR;
  19532. var feFuncG = createNS('feFuncG');
  19533. feFuncG.setAttribute('type', 'table');
  19534. feComponentTransfer.appendChild(feFuncG);
  19535. this.feFuncG = feFuncG;
  19536. var feFuncB = createNS('feFuncB');
  19537. feFuncB.setAttribute('type', 'table');
  19538. feComponentTransfer.appendChild(feFuncB);
  19539. this.feFuncB = feFuncB;
  19540. filter.appendChild(feComponentTransfer);
  19541. }
  19542. SVGTritoneFilter.prototype.renderFrame = function (forceRender) {
  19543. if (forceRender || this.filterManager._mdf) {
  19544. var color1 = this.filterManager.effectElements[0].p.v;
  19545. var color2 = this.filterManager.effectElements[1].p.v;
  19546. var color3 = this.filterManager.effectElements[2].p.v;
  19547. var tableR = color3[0] + ' ' + color2[0] + ' ' + color1[0];
  19548. var tableG = color3[1] + ' ' + color2[1] + ' ' + color1[1];
  19549. var tableB = color3[2] + ' ' + color2[2] + ' ' + color1[2];
  19550. this.feFuncR.setAttribute('tableValues', tableR);
  19551. this.feFuncG.setAttribute('tableValues', tableG);
  19552. this.feFuncB.setAttribute('tableValues', tableB);
  19553. }
  19554. };
  19555. function SVGProLevelsFilter(filter, filterManager, elem, id) {
  19556. this.filterManager = filterManager;
  19557. var effectElements = this.filterManager.effectElements;
  19558. var feComponentTransfer = createNS('feComponentTransfer'); // Red
  19559. if (effectElements[10].p.k || effectElements[10].p.v !== 0 || effectElements[11].p.k || effectElements[11].p.v !== 1 || effectElements[12].p.k || effectElements[12].p.v !== 1 || effectElements[13].p.k || effectElements[13].p.v !== 0 || effectElements[14].p.k || effectElements[14].p.v !== 1) {
  19560. this.feFuncR = this.createFeFunc('feFuncR', feComponentTransfer);
  19561. } // Green
  19562. if (effectElements[17].p.k || effectElements[17].p.v !== 0 || effectElements[18].p.k || effectElements[18].p.v !== 1 || effectElements[19].p.k || effectElements[19].p.v !== 1 || effectElements[20].p.k || effectElements[20].p.v !== 0 || effectElements[21].p.k || effectElements[21].p.v !== 1) {
  19563. this.feFuncG = this.createFeFunc('feFuncG', feComponentTransfer);
  19564. } // Blue
  19565. if (effectElements[24].p.k || effectElements[24].p.v !== 0 || effectElements[25].p.k || effectElements[25].p.v !== 1 || effectElements[26].p.k || effectElements[26].p.v !== 1 || effectElements[27].p.k || effectElements[27].p.v !== 0 || effectElements[28].p.k || effectElements[28].p.v !== 1) {
  19566. this.feFuncB = this.createFeFunc('feFuncB', feComponentTransfer);
  19567. } // Alpha
  19568. if (effectElements[31].p.k || effectElements[31].p.v !== 0 || effectElements[32].p.k || effectElements[32].p.v !== 1 || effectElements[33].p.k || effectElements[33].p.v !== 1 || effectElements[34].p.k || effectElements[34].p.v !== 0 || effectElements[35].p.k || effectElements[35].p.v !== 1) {
  19569. this.feFuncA = this.createFeFunc('feFuncA', feComponentTransfer);
  19570. } // RGB
  19571. if (this.feFuncR || this.feFuncG || this.feFuncB || this.feFuncA) {
  19572. feComponentTransfer.setAttribute('color-interpolation-filters', 'sRGB');
  19573. filter.appendChild(feComponentTransfer);
  19574. }
  19575. if (effectElements[3].p.k || effectElements[3].p.v !== 0 || effectElements[4].p.k || effectElements[4].p.v !== 1 || effectElements[5].p.k || effectElements[5].p.v !== 1 || effectElements[6].p.k || effectElements[6].p.v !== 0 || effectElements[7].p.k || effectElements[7].p.v !== 1) {
  19576. feComponentTransfer = createNS('feComponentTransfer');
  19577. feComponentTransfer.setAttribute('color-interpolation-filters', 'sRGB');
  19578. feComponentTransfer.setAttribute('result', id);
  19579. filter.appendChild(feComponentTransfer);
  19580. this.feFuncRComposed = this.createFeFunc('feFuncR', feComponentTransfer);
  19581. this.feFuncGComposed = this.createFeFunc('feFuncG', feComponentTransfer);
  19582. this.feFuncBComposed = this.createFeFunc('feFuncB', feComponentTransfer);
  19583. }
  19584. }
  19585. SVGProLevelsFilter.prototype.createFeFunc = function (type, feComponentTransfer) {
  19586. var feFunc = createNS(type);
  19587. feFunc.setAttribute('type', 'table');
  19588. feComponentTransfer.appendChild(feFunc);
  19589. return feFunc;
  19590. };
  19591. SVGProLevelsFilter.prototype.getTableValue = function (inputBlack, inputWhite, gamma, outputBlack, outputWhite) {
  19592. var cnt = 0;
  19593. var segments = 256;
  19594. var perc;
  19595. var min = Math.min(inputBlack, inputWhite);
  19596. var max = Math.max(inputBlack, inputWhite);
  19597. var table = Array.call(null, {
  19598. length: segments
  19599. });
  19600. var colorValue;
  19601. var pos = 0;
  19602. var outputDelta = outputWhite - outputBlack;
  19603. var inputDelta = inputWhite - inputBlack;
  19604. while (cnt <= 256) {
  19605. perc = cnt / 256;
  19606. if (perc <= min) {
  19607. colorValue = inputDelta < 0 ? outputWhite : outputBlack;
  19608. } else if (perc >= max) {
  19609. colorValue = inputDelta < 0 ? outputBlack : outputWhite;
  19610. } else {
  19611. colorValue = outputBlack + outputDelta * Math.pow((perc - inputBlack) / inputDelta, 1 / gamma);
  19612. }
  19613. table[pos] = colorValue;
  19614. pos += 1;
  19615. cnt += 256 / (segments - 1);
  19616. }
  19617. return table.join(' ');
  19618. };
  19619. SVGProLevelsFilter.prototype.renderFrame = function (forceRender) {
  19620. if (forceRender || this.filterManager._mdf) {
  19621. var val;
  19622. var effectElements = this.filterManager.effectElements;
  19623. if (this.feFuncRComposed && (forceRender || effectElements[3].p._mdf || effectElements[4].p._mdf || effectElements[5].p._mdf || effectElements[6].p._mdf || effectElements[7].p._mdf)) {
  19624. val = this.getTableValue(effectElements[3].p.v, effectElements[4].p.v, effectElements[5].p.v, effectElements[6].p.v, effectElements[7].p.v);
  19625. this.feFuncRComposed.setAttribute('tableValues', val);
  19626. this.feFuncGComposed.setAttribute('tableValues', val);
  19627. this.feFuncBComposed.setAttribute('tableValues', val);
  19628. }
  19629. if (this.feFuncR && (forceRender || effectElements[10].p._mdf || effectElements[11].p._mdf || effectElements[12].p._mdf || effectElements[13].p._mdf || effectElements[14].p._mdf)) {
  19630. val = this.getTableValue(effectElements[10].p.v, effectElements[11].p.v, effectElements[12].p.v, effectElements[13].p.v, effectElements[14].p.v);
  19631. this.feFuncR.setAttribute('tableValues', val);
  19632. }
  19633. if (this.feFuncG && (forceRender || effectElements[17].p._mdf || effectElements[18].p._mdf || effectElements[19].p._mdf || effectElements[20].p._mdf || effectElements[21].p._mdf)) {
  19634. val = this.getTableValue(effectElements[17].p.v, effectElements[18].p.v, effectElements[19].p.v, effectElements[20].p.v, effectElements[21].p.v);
  19635. this.feFuncG.setAttribute('tableValues', val);
  19636. }
  19637. if (this.feFuncB && (forceRender || effectElements[24].p._mdf || effectElements[25].p._mdf || effectElements[26].p._mdf || effectElements[27].p._mdf || effectElements[28].p._mdf)) {
  19638. val = this.getTableValue(effectElements[24].p.v, effectElements[25].p.v, effectElements[26].p.v, effectElements[27].p.v, effectElements[28].p.v);
  19639. this.feFuncB.setAttribute('tableValues', val);
  19640. }
  19641. if (this.feFuncA && (forceRender || effectElements[31].p._mdf || effectElements[32].p._mdf || effectElements[33].p._mdf || effectElements[34].p._mdf || effectElements[35].p._mdf)) {
  19642. val = this.getTableValue(effectElements[31].p.v, effectElements[32].p.v, effectElements[33].p.v, effectElements[34].p.v, effectElements[35].p.v);
  19643. this.feFuncA.setAttribute('tableValues', val);
  19644. }
  19645. }
  19646. };
  19647. function SVGDropShadowEffect(filter, filterManager, elem, id, source) {
  19648. var globalFilterSize = filterManager.container.globalData.renderConfig.filterSize;
  19649. var filterSize = filterManager.data.fs || globalFilterSize;
  19650. filter.setAttribute('x', filterSize.x || globalFilterSize.x);
  19651. filter.setAttribute('y', filterSize.y || globalFilterSize.y);
  19652. filter.setAttribute('width', filterSize.width || globalFilterSize.width);
  19653. filter.setAttribute('height', filterSize.height || globalFilterSize.height);
  19654. this.filterManager = filterManager;
  19655. var feGaussianBlur = createNS('feGaussianBlur');
  19656. feGaussianBlur.setAttribute('in', 'SourceAlpha');
  19657. feGaussianBlur.setAttribute('result', id + '_drop_shadow_1');
  19658. feGaussianBlur.setAttribute('stdDeviation', '0');
  19659. this.feGaussianBlur = feGaussianBlur;
  19660. filter.appendChild(feGaussianBlur);
  19661. var feOffset = createNS('feOffset');
  19662. feOffset.setAttribute('dx', '25');
  19663. feOffset.setAttribute('dy', '0');
  19664. feOffset.setAttribute('in', id + '_drop_shadow_1');
  19665. feOffset.setAttribute('result', id + '_drop_shadow_2');
  19666. this.feOffset = feOffset;
  19667. filter.appendChild(feOffset);
  19668. var feFlood = createNS('feFlood');
  19669. feFlood.setAttribute('flood-color', '#00ff00');
  19670. feFlood.setAttribute('flood-opacity', '1');
  19671. feFlood.setAttribute('result', id + '_drop_shadow_3');
  19672. this.feFlood = feFlood;
  19673. filter.appendChild(feFlood);
  19674. var feComposite = createNS('feComposite');
  19675. feComposite.setAttribute('in', id + '_drop_shadow_3');
  19676. feComposite.setAttribute('in2', id + '_drop_shadow_2');
  19677. feComposite.setAttribute('operator', 'in');
  19678. feComposite.setAttribute('result', id + '_drop_shadow_4');
  19679. filter.appendChild(feComposite);
  19680. var feMerge = this.createMergeNode(id, [id + '_drop_shadow_4', source]);
  19681. filter.appendChild(feMerge); //
  19682. }
  19683. extendPrototype([SVGComposableEffect], SVGDropShadowEffect);
  19684. SVGDropShadowEffect.prototype.renderFrame = function (forceRender) {
  19685. if (forceRender || this.filterManager._mdf) {
  19686. if (forceRender || this.filterManager.effectElements[4].p._mdf) {
  19687. this.feGaussianBlur.setAttribute('stdDeviation', this.filterManager.effectElements[4].p.v / 4);
  19688. }
  19689. if (forceRender || this.filterManager.effectElements[0].p._mdf) {
  19690. var col = this.filterManager.effectElements[0].p.v;
  19691. this.feFlood.setAttribute('flood-color', rgbToHex(Math.round(col[0] * 255), Math.round(col[1] * 255), Math.round(col[2] * 255)));
  19692. }
  19693. if (forceRender || this.filterManager.effectElements[1].p._mdf) {
  19694. this.feFlood.setAttribute('flood-opacity', this.filterManager.effectElements[1].p.v / 255);
  19695. }
  19696. if (forceRender || this.filterManager.effectElements[2].p._mdf || this.filterManager.effectElements[3].p._mdf) {
  19697. var distance = this.filterManager.effectElements[3].p.v;
  19698. var angle = (this.filterManager.effectElements[2].p.v - 90) * degToRads;
  19699. var x = distance * Math.cos(angle);
  19700. var y = distance * Math.sin(angle);
  19701. this.feOffset.setAttribute('dx', x);
  19702. this.feOffset.setAttribute('dy', y);
  19703. }
  19704. }
  19705. };
  19706. var _svgMatteSymbols = [];
  19707. function SVGMatte3Effect(filterElem, filterManager, elem) {
  19708. this.initialized = false;
  19709. this.filterManager = filterManager;
  19710. this.filterElem = filterElem;
  19711. this.elem = elem;
  19712. elem.matteElement = createNS('g');
  19713. elem.matteElement.appendChild(elem.layerElement);
  19714. elem.matteElement.appendChild(elem.transformedElement);
  19715. elem.baseElement = elem.matteElement;
  19716. }
  19717. SVGMatte3Effect.prototype.findSymbol = function (mask) {
  19718. var i = 0;
  19719. var len = _svgMatteSymbols.length;
  19720. while (i < len) {
  19721. if (_svgMatteSymbols[i] === mask) {
  19722. return _svgMatteSymbols[i];
  19723. }
  19724. i += 1;
  19725. }
  19726. return null;
  19727. };
  19728. SVGMatte3Effect.prototype.replaceInParent = function (mask, symbolId) {
  19729. var parentNode = mask.layerElement.parentNode;
  19730. if (!parentNode) {
  19731. return;
  19732. }
  19733. var children = parentNode.children;
  19734. var i = 0;
  19735. var len = children.length;
  19736. while (i < len) {
  19737. if (children[i] === mask.layerElement) {
  19738. break;
  19739. }
  19740. i += 1;
  19741. }
  19742. var nextChild;
  19743. if (i <= len - 2) {
  19744. nextChild = children[i + 1];
  19745. }
  19746. var useElem = createNS('use');
  19747. useElem.setAttribute('href', '#' + symbolId);
  19748. if (nextChild) {
  19749. parentNode.insertBefore(useElem, nextChild);
  19750. } else {
  19751. parentNode.appendChild(useElem);
  19752. }
  19753. };
  19754. SVGMatte3Effect.prototype.setElementAsMask = function (elem, mask) {
  19755. if (!this.findSymbol(mask)) {
  19756. var symbolId = createElementID();
  19757. var masker = createNS('mask');
  19758. masker.setAttribute('id', mask.layerId);
  19759. masker.setAttribute('mask-type', 'alpha');
  19760. _svgMatteSymbols.push(mask);
  19761. var defs = elem.globalData.defs;
  19762. defs.appendChild(masker);
  19763. var symbol = createNS('symbol');
  19764. symbol.setAttribute('id', symbolId);
  19765. this.replaceInParent(mask, symbolId);
  19766. symbol.appendChild(mask.layerElement);
  19767. defs.appendChild(symbol);
  19768. var useElem = createNS('use');
  19769. useElem.setAttribute('href', '#' + symbolId);
  19770. masker.appendChild(useElem);
  19771. mask.data.hd = false;
  19772. mask.show();
  19773. }
  19774. elem.setMatte(mask.layerId);
  19775. };
  19776. SVGMatte3Effect.prototype.initialize = function () {
  19777. var ind = this.filterManager.effectElements[0].p.v;
  19778. var elements = this.elem.comp.elements;
  19779. var i = 0;
  19780. var len = elements.length;
  19781. while (i < len) {
  19782. if (elements[i] && elements[i].data.ind === ind) {
  19783. this.setElementAsMask(this.elem, elements[i]);
  19784. }
  19785. i += 1;
  19786. }
  19787. this.initialized = true;
  19788. };
  19789. SVGMatte3Effect.prototype.renderFrame = function () {
  19790. if (!this.initialized) {
  19791. this.initialize();
  19792. }
  19793. };
  19794. function SVGGaussianBlurEffect(filter, filterManager, elem, id) {
  19795. // Outset the filter region by 100% on all sides to accommodate blur expansion.
  19796. filter.setAttribute('x', '-100%');
  19797. filter.setAttribute('y', '-100%');
  19798. filter.setAttribute('width', '300%');
  19799. filter.setAttribute('height', '300%');
  19800. this.filterManager = filterManager;
  19801. var feGaussianBlur = createNS('feGaussianBlur');
  19802. feGaussianBlur.setAttribute('result', id);
  19803. filter.appendChild(feGaussianBlur);
  19804. this.feGaussianBlur = feGaussianBlur;
  19805. }
  19806. SVGGaussianBlurEffect.prototype.renderFrame = function (forceRender) {
  19807. if (forceRender || this.filterManager._mdf) {
  19808. // Empirical value, matching AE's blur appearance.
  19809. var kBlurrinessToSigma = 0.3;
  19810. var sigma = this.filterManager.effectElements[0].p.v * kBlurrinessToSigma; // Dimensions mapping:
  19811. //
  19812. // 1 -> horizontal & vertical
  19813. // 2 -> horizontal only
  19814. // 3 -> vertical only
  19815. //
  19816. var dimensions = this.filterManager.effectElements[1].p.v;
  19817. var sigmaX = dimensions == 3 ? 0 : sigma; // eslint-disable-line eqeqeq
  19818. var sigmaY = dimensions == 2 ? 0 : sigma; // eslint-disable-line eqeqeq
  19819. this.feGaussianBlur.setAttribute('stdDeviation', sigmaX + ' ' + sigmaY); // Repeat edges mapping:
  19820. //
  19821. // 0 -> off -> duplicate
  19822. // 1 -> on -> wrap
  19823. var edgeMode = this.filterManager.effectElements[2].p.v == 1 ? 'wrap' : 'duplicate'; // eslint-disable-line eqeqeq
  19824. this.feGaussianBlur.setAttribute('edgeMode', edgeMode);
  19825. }
  19826. };
  19827. function TransformEffect() {}
  19828. TransformEffect.prototype.init = function (effectsManager) {
  19829. this.effectsManager = effectsManager;
  19830. this.type = effectTypes.TRANSFORM_EFFECT;
  19831. this.matrix = new Matrix();
  19832. this.opacity = -1;
  19833. this._mdf = false;
  19834. this._opMdf = false;
  19835. };
  19836. TransformEffect.prototype.renderFrame = function (forceFrame) {
  19837. this._opMdf = false;
  19838. this._mdf = false;
  19839. if (forceFrame || this.effectsManager._mdf) {
  19840. var effectElements = this.effectsManager.effectElements;
  19841. var anchor = effectElements[0].p.v;
  19842. var position = effectElements[1].p.v;
  19843. var isUniformScale = effectElements[2].p.v === 1;
  19844. var scaleHeight = effectElements[3].p.v;
  19845. var scaleWidth = isUniformScale ? scaleHeight : effectElements[4].p.v;
  19846. var skew = effectElements[5].p.v;
  19847. var skewAxis = effectElements[6].p.v;
  19848. var rotation = effectElements[7].p.v;
  19849. this.matrix.reset();
  19850. this.matrix.translate(-anchor[0], -anchor[1], anchor[2]);
  19851. this.matrix.scale(scaleWidth * 0.01, scaleHeight * 0.01, 1);
  19852. this.matrix.rotate(-rotation * degToRads);
  19853. this.matrix.skewFromAxis(-skew * degToRads, (skewAxis + 90) * degToRads);
  19854. this.matrix.translate(position[0], position[1], 0);
  19855. this._mdf = true;
  19856. if (this.opacity !== effectElements[8].p.v) {
  19857. this.opacity = effectElements[8].p.v;
  19858. this._opMdf = true;
  19859. }
  19860. }
  19861. };
  19862. function SVGTransformEffect(_, filterManager) {
  19863. this.init(filterManager);
  19864. }
  19865. extendPrototype([TransformEffect], SVGTransformEffect);
  19866. function CVTransformEffect(effectsManager) {
  19867. this.init(effectsManager);
  19868. }
  19869. extendPrototype([TransformEffect], CVTransformEffect);
  19870. registerRenderer('canvas', CanvasRenderer);
  19871. registerRenderer('html', HybridRenderer);
  19872. registerRenderer('svg', SVGRenderer); // Registering shape modifiers
  19873. ShapeModifiers.registerModifier('tm', TrimModifier);
  19874. ShapeModifiers.registerModifier('pb', PuckerAndBloatModifier);
  19875. ShapeModifiers.registerModifier('rp', RepeaterModifier);
  19876. ShapeModifiers.registerModifier('rd', RoundCornersModifier);
  19877. ShapeModifiers.registerModifier('zz', ZigZagModifier);
  19878. ShapeModifiers.registerModifier('op', OffsetPathModifier); // Registering expression plugin
  19879. setExpressionsPlugin(Expressions);
  19880. setExpressionInterfaces(getInterface);
  19881. initialize$1();
  19882. initialize(); // Registering svg effects
  19883. registerEffect$1(20, SVGTintFilter, true);
  19884. registerEffect$1(21, SVGFillFilter, true);
  19885. registerEffect$1(22, SVGStrokeEffect, false);
  19886. registerEffect$1(23, SVGTritoneFilter, true);
  19887. registerEffect$1(24, SVGProLevelsFilter, true);
  19888. registerEffect$1(25, SVGDropShadowEffect, true);
  19889. registerEffect$1(28, SVGMatte3Effect, false);
  19890. registerEffect$1(29, SVGGaussianBlurEffect, true);
  19891. registerEffect$1(35, SVGTransformEffect, false);
  19892. registerEffect(35, CVTransformEffect);
  19893. return lottie;
  19894. }));
  19895. /***/ }),
  19896. /***/ "../../node_modules/vue-lottie/src/lottie.vue":
  19897. /*!*********************************************************************!*\
  19898. !*** D:/web_src/4dkankan_v4/node_modules/vue-lottie/src/lottie.vue ***!
  19899. \*********************************************************************/
  19900. /*! exports provided: default */
  19901. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19902. "use strict";
  19903. __webpack_require__.r(__webpack_exports__);
  19904. /* harmony import */ var _lottie_vue_vue_type_template_id_547741c8__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lottie.vue?vue&type=template&id=547741c8 */ "../../node_modules/vue-lottie/src/lottie.vue?vue&type=template&id=547741c8");
  19905. /* harmony import */ var _lottie_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lottie.vue?vue&type=script&lang=js */ "../../node_modules/vue-lottie/src/lottie.vue?vue&type=script&lang=js");
  19906. /* empty/unused harmony star reexport *//* harmony import */ var D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/exportHelper.js */ "../../node_modules/vue-loader-v16/dist/exportHelper.js");
  19907. /* harmony import */ var D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__);
  19908. const __exports__ = /*#__PURE__*/D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2___default()(_lottie_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_lottie_vue_vue_type_template_id_547741c8__WEBPACK_IMPORTED_MODULE_0__["render"]],['__file',"node_modules/vue-lottie/src/lottie.vue"]])
  19909. /* hot reload */
  19910. if (false) {}
  19911. /* harmony default export */ __webpack_exports__["default"] = (__exports__);
  19912. /***/ }),
  19913. /***/ "../../node_modules/vue-lottie/src/lottie.vue?vue&type=script&lang=js":
  19914. /*!*********************************************************************************************!*\
  19915. !*** D:/web_src/4dkankan_v4/node_modules/vue-lottie/src/lottie.vue?vue&type=script&lang=js ***!
  19916. \*********************************************************************************************/
  19917. /*! exports provided: default */
  19918. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19919. "use strict";
  19920. __webpack_require__.r(__webpack_exports__);
  19921. /* harmony import */ var _cache_loader_dist_cjs_js_ref_13_0_babel_loader_lib_index_js_cache_loader_dist_cjs_js_ref_1_0_vue_loader_v16_dist_index_js_ref_1_1_lottie_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../cache-loader/dist/cjs.js??ref--13-0!../../babel-loader/lib!../../cache-loader/dist/cjs.js??ref--1-0!../../vue-loader-v16/dist??ref--1-1!./lottie.vue?vue&type=script&lang=js */ "../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!../../node_modules/vue-lottie/src/lottie.vue?vue&type=script&lang=js");
  19922. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _cache_loader_dist_cjs_js_ref_13_0_babel_loader_lib_index_js_cache_loader_dist_cjs_js_ref_1_0_vue_loader_v16_dist_index_js_ref_1_1_lottie_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  19923. /* empty/unused harmony star reexport */
  19924. /***/ }),
  19925. /***/ "../../node_modules/vue-lottie/src/lottie.vue?vue&type=template&id=547741c8":
  19926. /*!***************************************************************************************************!*\
  19927. !*** D:/web_src/4dkankan_v4/node_modules/vue-lottie/src/lottie.vue?vue&type=template&id=547741c8 ***!
  19928. \***************************************************************************************************/
  19929. /*! exports provided: render */
  19930. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19931. "use strict";
  19932. __webpack_require__.r(__webpack_exports__);
  19933. /* harmony import */ var _cache_loader_dist_cjs_js_ref_13_0_babel_loader_lib_index_js_vue_loader_v16_dist_templateLoader_js_ref_7_cache_loader_dist_cjs_js_ref_1_0_vue_loader_v16_dist_index_js_ref_1_1_lottie_vue_vue_type_template_id_547741c8__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../cache-loader/dist/cjs.js??ref--13-0!../../babel-loader/lib!../../vue-loader-v16/dist/templateLoader.js??ref--7!../../cache-loader/dist/cjs.js??ref--1-0!../../vue-loader-v16/dist??ref--1-1!./lottie.vue?vue&type=template&id=547741c8 */ "../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/babel-loader/lib/index.js!../../node_modules/vue-loader-v16/dist/templateLoader.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!../../node_modules/vue-lottie/src/lottie.vue?vue&type=template&id=547741c8");
  19934. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _cache_loader_dist_cjs_js_ref_13_0_babel_loader_lib_index_js_vue_loader_v16_dist_templateLoader_js_ref_7_cache_loader_dist_cjs_js_ref_1_0_vue_loader_v16_dist_index_js_ref_1_1_lottie_vue_vue_type_template_id_547741c8__WEBPACK_IMPORTED_MODULE_0__["render"]; });
  19935. /***/ }),
  19936. /***/ "../../node_modules/vue-style-loader/index.js?!../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=style&index=1&id=239f642b&lang=css":
  19937. /*!*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  19938. !*** D:/web_src/4dkankan_v4/node_modules/vue-style-loader??ref--7-oneOf-1-0!D:/web_src/4dkankan_v4/node_modules/css-loader/dist/cjs.js??ref--7-oneOf-1-1!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/stylePostLoader.js!D:/web_src/4dkankan_v4/node_modules/postcss-loader/src??ref--7-oneOf-1-2!D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--1-0!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist??ref--1-1!./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=style&index=1&id=239f642b&lang=css ***!
  19939. \*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  19940. /*! no static exports found */
  19941. /***/ (function(module, exports, __webpack_require__) {
  19942. // style-loader: Adds some css to the DOM by adding a <style> tag
  19943. // load the styles
  19944. var content = __webpack_require__(/*! !../../../../../../../../../node_modules/css-loader/dist/cjs.js??ref--7-oneOf-1-1!../../../../../../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../../../../../node_modules/postcss-loader/src??ref--7-oneOf-1-2!../../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../../../../node_modules/vue-loader-v16/dist??ref--1-1!./select-scene.vue?vue&type=style&index=1&id=239f642b&lang=css */ "../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=style&index=1&id=239f642b&lang=css");
  19945. if(content.__esModule) content = content.default;
  19946. if(typeof content === 'string') content = [[module.i, content, '']];
  19947. if(content.locals) module.exports = content.locals;
  19948. // add the styles to the DOM
  19949. var add = __webpack_require__(/*! ../../../../../../../../../node_modules/vue-style-loader/lib/addStylesClient.js */ "../../node_modules/vue-style-loader/lib/addStylesClient.js").default
  19950. var update = add("399fb6f5", content, false, {"sourceMap":false,"shadowMode":false});
  19951. // Hot Module Replacement
  19952. if(false) {}
  19953. /***/ }),
  19954. /***/ "../../node_modules/vue-style-loader/index.js?!../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/sass-loader/dist/cjs.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/scene/detail.vue?vue&type=style&index=0&id=f90fcb32&lang=scss&scoped=true":
  19955. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  19956. !*** D:/web_src/4dkankan_v4/node_modules/vue-style-loader??ref--9-oneOf-1-0!D:/web_src/4dkankan_v4/node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/stylePostLoader.js!D:/web_src/4dkankan_v4/node_modules/postcss-loader/src??ref--9-oneOf-1-2!D:/web_src/4dkankan_v4/node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--1-0!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist??ref--1-1!./src/app/program/views/scene/detail.vue?vue&type=style&index=0&id=f90fcb32&lang=scss&scoped=true ***!
  19957. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  19958. /*! no static exports found */
  19959. /***/ (function(module, exports, __webpack_require__) {
  19960. // style-loader: Adds some css to the DOM by adding a <style> tag
  19961. // load the styles
  19962. var content = __webpack_require__(/*! !../../../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../../../node_modules/postcss-loader/src??ref--9-oneOf-1-2!../../../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../../node_modules/vue-loader-v16/dist??ref--1-1!./detail.vue?vue&type=style&index=0&id=f90fcb32&lang=scss&scoped=true */ "../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/sass-loader/dist/cjs.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/scene/detail.vue?vue&type=style&index=0&id=f90fcb32&lang=scss&scoped=true");
  19963. if(content.__esModule) content = content.default;
  19964. if(typeof content === 'string') content = [[module.i, content, '']];
  19965. if(content.locals) module.exports = content.locals;
  19966. // add the styles to the DOM
  19967. var add = __webpack_require__(/*! ../../../../../../../node_modules/vue-style-loader/lib/addStylesClient.js */ "../../node_modules/vue-style-loader/lib/addStylesClient.js").default
  19968. var update = add("88932a92", content, false, {"sourceMap":false,"shadowMode":false});
  19969. // Hot Module Replacement
  19970. if(false) {}
  19971. /***/ }),
  19972. /***/ "../../node_modules/vue-style-loader/index.js?!../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/sass-loader/dist/cjs.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/scene/index.vue?vue&type=style&index=0&id=41644aac&lang=scss&scoped=true":
  19973. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  19974. !*** D:/web_src/4dkankan_v4/node_modules/vue-style-loader??ref--9-oneOf-1-0!D:/web_src/4dkankan_v4/node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/stylePostLoader.js!D:/web_src/4dkankan_v4/node_modules/postcss-loader/src??ref--9-oneOf-1-2!D:/web_src/4dkankan_v4/node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--1-0!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist??ref--1-1!./src/app/program/views/scene/index.vue?vue&type=style&index=0&id=41644aac&lang=scss&scoped=true ***!
  19975. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  19976. /*! no static exports found */
  19977. /***/ (function(module, exports, __webpack_require__) {
  19978. // style-loader: Adds some css to the DOM by adding a <style> tag
  19979. // load the styles
  19980. var content = __webpack_require__(/*! !../../../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../../../node_modules/postcss-loader/src??ref--9-oneOf-1-2!../../../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../../node_modules/vue-loader-v16/dist??ref--1-1!./index.vue?vue&type=style&index=0&id=41644aac&lang=scss&scoped=true */ "../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/sass-loader/dist/cjs.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/scene/index.vue?vue&type=style&index=0&id=41644aac&lang=scss&scoped=true");
  19981. if(content.__esModule) content = content.default;
  19982. if(typeof content === 'string') content = [[module.i, content, '']];
  19983. if(content.locals) module.exports = content.locals;
  19984. // add the styles to the DOM
  19985. var add = __webpack_require__(/*! ../../../../../../../node_modules/vue-style-loader/lib/addStylesClient.js */ "../../node_modules/vue-style-loader/lib/addStylesClient.js").default
  19986. var update = add("0decd820", content, false, {"sourceMap":false,"shadowMode":false});
  19987. // Hot Module Replacement
  19988. if(false) {}
  19989. /***/ }),
  19990. /***/ "../../node_modules/vue-style-loader/index.js?!../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/sass-loader/dist/cjs.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/help.vue?vue&type=style&index=0&id=32593d35&scoped=true&lang=scss":
  19991. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  19992. !*** D:/web_src/4dkankan_v4/node_modules/vue-style-loader??ref--9-oneOf-1-0!D:/web_src/4dkankan_v4/node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/stylePostLoader.js!D:/web_src/4dkankan_v4/node_modules/postcss-loader/src??ref--9-oneOf-1-2!D:/web_src/4dkankan_v4/node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--1-0!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist??ref--1-1!./src/app/program/views/sys/device/help.vue?vue&type=style&index=0&id=32593d35&scoped=true&lang=scss ***!
  19993. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  19994. /*! no static exports found */
  19995. /***/ (function(module, exports, __webpack_require__) {
  19996. // style-loader: Adds some css to the DOM by adding a <style> tag
  19997. // load the styles
  19998. var content = __webpack_require__(/*! !../../../../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../../../../node_modules/postcss-loader/src??ref--9-oneOf-1-2!../../../../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../../../node_modules/vue-loader-v16/dist??ref--1-1!./help.vue?vue&type=style&index=0&id=32593d35&scoped=true&lang=scss */ "../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/sass-loader/dist/cjs.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/help.vue?vue&type=style&index=0&id=32593d35&scoped=true&lang=scss");
  19999. if(content.__esModule) content = content.default;
  20000. if(typeof content === 'string') content = [[module.i, content, '']];
  20001. if(content.locals) module.exports = content.locals;
  20002. // add the styles to the DOM
  20003. var add = __webpack_require__(/*! ../../../../../../../../node_modules/vue-style-loader/lib/addStylesClient.js */ "../../node_modules/vue-style-loader/lib/addStylesClient.js").default
  20004. var update = add("5e49ea08", content, false, {"sourceMap":false,"shadowMode":false});
  20005. // Hot Module Replacement
  20006. if(false) {}
  20007. /***/ }),
  20008. /***/ "../../node_modules/vue-style-loader/index.js?!../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/sass-loader/dist/cjs.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/sync/index.vue?vue&type=style&index=0&id=05b8aad2&lang=scss&scoped=true":
  20009. /*!*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  20010. !*** D:/web_src/4dkankan_v4/node_modules/vue-style-loader??ref--9-oneOf-1-0!D:/web_src/4dkankan_v4/node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/stylePostLoader.js!D:/web_src/4dkankan_v4/node_modules/postcss-loader/src??ref--9-oneOf-1-2!D:/web_src/4dkankan_v4/node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--1-0!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist??ref--1-1!./src/app/program/views/sys/device/sync/index.vue?vue&type=style&index=0&id=05b8aad2&lang=scss&scoped=true ***!
  20011. \*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  20012. /*! no static exports found */
  20013. /***/ (function(module, exports, __webpack_require__) {
  20014. // style-loader: Adds some css to the DOM by adding a <style> tag
  20015. // load the styles
  20016. var content = __webpack_require__(/*! !../../../../../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../../../../../node_modules/postcss-loader/src??ref--9-oneOf-1-2!../../../../../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../../../../node_modules/vue-loader-v16/dist??ref--1-1!./index.vue?vue&type=style&index=0&id=05b8aad2&lang=scss&scoped=true */ "../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/sass-loader/dist/cjs.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/sync/index.vue?vue&type=style&index=0&id=05b8aad2&lang=scss&scoped=true");
  20017. if(content.__esModule) content = content.default;
  20018. if(typeof content === 'string') content = [[module.i, content, '']];
  20019. if(content.locals) module.exports = content.locals;
  20020. // add the styles to the DOM
  20021. var add = __webpack_require__(/*! ../../../../../../../../../node_modules/vue-style-loader/lib/addStylesClient.js */ "../../node_modules/vue-style-loader/lib/addStylesClient.js").default
  20022. var update = add("e5c7e156", content, false, {"sourceMap":false,"shadowMode":false});
  20023. // Hot Module Replacement
  20024. if(false) {}
  20025. /***/ }),
  20026. /***/ "../../node_modules/vue-style-loader/index.js?!../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/sass-loader/dist/cjs.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/sync/index.vue?vue&type=style&index=1&id=05b8aad2&lang=scss":
  20027. /*!*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  20028. !*** D:/web_src/4dkankan_v4/node_modules/vue-style-loader??ref--9-oneOf-1-0!D:/web_src/4dkankan_v4/node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/stylePostLoader.js!D:/web_src/4dkankan_v4/node_modules/postcss-loader/src??ref--9-oneOf-1-2!D:/web_src/4dkankan_v4/node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--1-0!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist??ref--1-1!./src/app/program/views/sys/device/sync/index.vue?vue&type=style&index=1&id=05b8aad2&lang=scss ***!
  20029. \*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  20030. /*! no static exports found */
  20031. /***/ (function(module, exports, __webpack_require__) {
  20032. // style-loader: Adds some css to the DOM by adding a <style> tag
  20033. // load the styles
  20034. var content = __webpack_require__(/*! !../../../../../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../../../../../node_modules/postcss-loader/src??ref--9-oneOf-1-2!../../../../../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../../../../node_modules/vue-loader-v16/dist??ref--1-1!./index.vue?vue&type=style&index=1&id=05b8aad2&lang=scss */ "../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/sass-loader/dist/cjs.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/sync/index.vue?vue&type=style&index=1&id=05b8aad2&lang=scss");
  20035. if(content.__esModule) content = content.default;
  20036. if(typeof content === 'string') content = [[module.i, content, '']];
  20037. if(content.locals) module.exports = content.locals;
  20038. // add the styles to the DOM
  20039. var add = __webpack_require__(/*! ../../../../../../../../../node_modules/vue-style-loader/lib/addStylesClient.js */ "../../node_modules/vue-style-loader/lib/addStylesClient.js").default
  20040. var update = add("852f197e", content, false, {"sourceMap":false,"shadowMode":false});
  20041. // Hot Module Replacement
  20042. if(false) {}
  20043. /***/ }),
  20044. /***/ "../../node_modules/vue-style-loader/index.js?!../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/sass-loader/dist/cjs.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=style&index=0&id=239f642b&lang=scss&scoped=true":
  20045. /*!********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  20046. !*** D:/web_src/4dkankan_v4/node_modules/vue-style-loader??ref--9-oneOf-1-0!D:/web_src/4dkankan_v4/node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/stylePostLoader.js!D:/web_src/4dkankan_v4/node_modules/postcss-loader/src??ref--9-oneOf-1-2!D:/web_src/4dkankan_v4/node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!D:/web_src/4dkankan_v4/node_modules/cache-loader/dist/cjs.js??ref--1-0!D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist??ref--1-1!./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=style&index=0&id=239f642b&lang=scss&scoped=true ***!
  20047. \********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  20048. /*! no static exports found */
  20049. /***/ (function(module, exports, __webpack_require__) {
  20050. // style-loader: Adds some css to the DOM by adding a <style> tag
  20051. // load the styles
  20052. var content = __webpack_require__(/*! !../../../../../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../../../../../node_modules/postcss-loader/src??ref--9-oneOf-1-2!../../../../../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../../../../node_modules/vue-loader-v16/dist??ref--1-1!./select-scene.vue?vue&type=style&index=0&id=239f642b&lang=scss&scoped=true */ "../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/sass-loader/dist/cjs.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=style&index=0&id=239f642b&lang=scss&scoped=true");
  20053. if(content.__esModule) content = content.default;
  20054. if(typeof content === 'string') content = [[module.i, content, '']];
  20055. if(content.locals) module.exports = content.locals;
  20056. // add the styles to the DOM
  20057. var add = __webpack_require__(/*! ../../../../../../../../../node_modules/vue-style-loader/lib/addStylesClient.js */ "../../node_modules/vue-style-loader/lib/addStylesClient.js").default
  20058. var update = add("2db34360", content, false, {"sourceMap":false,"shadowMode":false});
  20059. // Hot Module Replacement
  20060. if(false) {}
  20061. /***/ }),
  20062. /***/ "../../node_modules/webpack/buildin/amd-options.js":
  20063. /*!****************************************!*\
  20064. !*** (webpack)/buildin/amd-options.js ***!
  20065. \****************************************/
  20066. /*! no static exports found */
  20067. /***/ (function(module, exports) {
  20068. /* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {/* globals __webpack_amd_options__ */
  20069. module.exports = __webpack_amd_options__;
  20070. /* WEBPACK VAR INJECTION */}.call(this, {}))
  20071. /***/ }),
  20072. /***/ "./src/app/program/assets/router.png":
  20073. /*!*******************************************!*\
  20074. !*** ./src/app/program/assets/router.png ***!
  20075. \*******************************************/
  20076. /*! no static exports found */
  20077. /***/ (function(module, exports, __webpack_require__) {
  20078. module.exports = __webpack_require__.p + "img/router.0c45ae92.png";
  20079. /***/ }),
  20080. /***/ "./src/app/program/assets/usb-scene.png":
  20081. /*!**********************************************!*\
  20082. !*** ./src/app/program/assets/usb-scene.png ***!
  20083. \**********************************************/
  20084. /*! no static exports found */
  20085. /***/ (function(module, exports, __webpack_require__) {
  20086. module.exports = __webpack_require__.p + "img/usb-scene.2cd2157d.png";
  20087. /***/ }),
  20088. /***/ "./src/app/program/views/scene/detail.vue":
  20089. /*!************************************************!*\
  20090. !*** ./src/app/program/views/scene/detail.vue ***!
  20091. \************************************************/
  20092. /*! exports provided: default */
  20093. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20094. "use strict";
  20095. __webpack_require__.r(__webpack_exports__);
  20096. /* harmony import */ var _detail_vue_vue_type_template_id_f90fcb32_scoped_true_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./detail.vue?vue&type=template&id=f90fcb32&scoped=true&ts=true */ "./src/app/program/views/scene/detail.vue?vue&type=template&id=f90fcb32&scoped=true&ts=true");
  20097. /* harmony import */ var _detail_vue_vue_type_script_lang_ts_setup_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./detail.vue?vue&type=script&lang=ts&setup=true */ "./src/app/program/views/scene/detail.vue?vue&type=script&lang=ts&setup=true");
  20098. /* empty/unused harmony star reexport *//* harmony import */ var _detail_vue_vue_type_style_index_0_id_f90fcb32_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./detail.vue?vue&type=style&index=0&id=f90fcb32&lang=scss&scoped=true */ "./src/app/program/views/scene/detail.vue?vue&type=style&index=0&id=f90fcb32&lang=scss&scoped=true");
  20099. /* harmony import */ var D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/exportHelper.js */ "../../node_modules/vue-loader-v16/dist/exportHelper.js");
  20100. /* harmony import */ var D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__);
  20101. const __exports__ = /*#__PURE__*/D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3___default()(_detail_vue_vue_type_script_lang_ts_setup_true__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_detail_vue_vue_type_template_id_f90fcb32_scoped_true_ts_true__WEBPACK_IMPORTED_MODULE_0__["render"]],['__scopeId',"data-v-f90fcb32"],['__file',"src/app/program/views/scene/detail.vue"]])
  20102. /* hot reload */
  20103. if (false) {}
  20104. /* harmony default export */ __webpack_exports__["default"] = (__exports__);
  20105. /***/ }),
  20106. /***/ "./src/app/program/views/scene/detail.vue?vue&type=script&lang=ts&setup=true":
  20107. /*!***********************************************************************************!*\
  20108. !*** ./src/app/program/views/scene/detail.vue?vue&type=script&lang=ts&setup=true ***!
  20109. \***********************************************************************************/
  20110. /*! exports provided: default */
  20111. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20112. "use strict";
  20113. __webpack_require__.r(__webpack_exports__);
  20114. /* harmony import */ var _node_modules_cache_loader_dist_cjs_js_ref_14_0_node_modules_babel_loader_lib_index_js_node_modules_ts_loader_index_js_ref_14_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_detail_vue_vue_type_script_lang_ts_setup_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../../../../node_modules/babel-loader/lib!../../../../../../../node_modules/ts-loader??ref--14-2!../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../../node_modules/vue-loader-v16/dist??ref--1-1!./detail.vue?vue&type=script&lang=ts&setup=true */ "../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/scene/detail.vue?vue&type=script&lang=ts&setup=true");
  20115. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _node_modules_cache_loader_dist_cjs_js_ref_14_0_node_modules_babel_loader_lib_index_js_node_modules_ts_loader_index_js_ref_14_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_detail_vue_vue_type_script_lang_ts_setup_true__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  20116. /* empty/unused harmony star reexport */
  20117. /***/ }),
  20118. /***/ "./src/app/program/views/scene/detail.vue?vue&type=style&index=0&id=f90fcb32&lang=scss&scoped=true":
  20119. /*!*********************************************************************************************************!*\
  20120. !*** ./src/app/program/views/scene/detail.vue?vue&type=style&index=0&id=f90fcb32&lang=scss&scoped=true ***!
  20121. \*********************************************************************************************************/
  20122. /*! no static exports found */
  20123. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20124. "use strict";
  20125. __webpack_require__.r(__webpack_exports__);
  20126. /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_detail_vue_vue_type_style_index_0_id_f90fcb32_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../node_modules/vue-style-loader??ref--9-oneOf-1-0!../../../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../../../node_modules/postcss-loader/src??ref--9-oneOf-1-2!../../../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../../node_modules/vue-loader-v16/dist??ref--1-1!./detail.vue?vue&type=style&index=0&id=f90fcb32&lang=scss&scoped=true */ "../../node_modules/vue-style-loader/index.js?!../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/sass-loader/dist/cjs.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/scene/detail.vue?vue&type=style&index=0&id=f90fcb32&lang=scss&scoped=true");
  20127. /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_detail_vue_vue_type_style_index_0_id_f90fcb32_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_detail_vue_vue_type_style_index_0_id_f90fcb32_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
  20128. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_detail_vue_vue_type_style_index_0_id_f90fcb32_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_detail_vue_vue_type_style_index_0_id_f90fcb32_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  20129. /***/ }),
  20130. /***/ "./src/app/program/views/scene/detail.vue?vue&type=template&id=f90fcb32&scoped=true&ts=true":
  20131. /*!**************************************************************************************************!*\
  20132. !*** ./src/app/program/views/scene/detail.vue?vue&type=template&id=f90fcb32&scoped=true&ts=true ***!
  20133. \**************************************************************************************************/
  20134. /*! exports provided: render */
  20135. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20136. "use strict";
  20137. __webpack_require__.r(__webpack_exports__);
  20138. /* harmony import */ var _node_modules_cache_loader_dist_cjs_js_ref_14_0_node_modules_babel_loader_lib_index_js_node_modules_ts_loader_index_js_ref_14_2_node_modules_vue_loader_v16_dist_templateLoader_js_ref_7_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_detail_vue_vue_type_template_id_f90fcb32_scoped_true_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../../../../node_modules/babel-loader/lib!../../../../../../../node_modules/ts-loader??ref--14-2!../../../../../../../node_modules/vue-loader-v16/dist/templateLoader.js??ref--7!../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../../node_modules/vue-loader-v16/dist??ref--1-1!./detail.vue?vue&type=template&id=f90fcb32&scoped=true&ts=true */ "../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js?!../../node_modules/vue-loader-v16/dist/templateLoader.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/scene/detail.vue?vue&type=template&id=f90fcb32&scoped=true&ts=true");
  20139. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_cache_loader_dist_cjs_js_ref_14_0_node_modules_babel_loader_lib_index_js_node_modules_ts_loader_index_js_ref_14_2_node_modules_vue_loader_v16_dist_templateLoader_js_ref_7_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_detail_vue_vue_type_template_id_f90fcb32_scoped_true_ts_true__WEBPACK_IMPORTED_MODULE_0__["render"]; });
  20140. /***/ }),
  20141. /***/ "./src/app/program/views/scene/index.vue":
  20142. /*!***********************************************!*\
  20143. !*** ./src/app/program/views/scene/index.vue ***!
  20144. \***********************************************/
  20145. /*! exports provided: default */
  20146. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20147. "use strict";
  20148. __webpack_require__.r(__webpack_exports__);
  20149. /* harmony import */ var _index_vue_vue_type_template_id_41644aac_scoped_true_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.vue?vue&type=template&id=41644aac&scoped=true&ts=true */ "./src/app/program/views/scene/index.vue?vue&type=template&id=41644aac&scoped=true&ts=true");
  20150. /* harmony import */ var _index_vue_vue_type_script_lang_ts_setup_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.vue?vue&type=script&lang=ts&setup=true */ "./src/app/program/views/scene/index.vue?vue&type=script&lang=ts&setup=true");
  20151. /* empty/unused harmony star reexport *//* harmony import */ var _index_vue_vue_type_style_index_0_id_41644aac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index.vue?vue&type=style&index=0&id=41644aac&lang=scss&scoped=true */ "./src/app/program/views/scene/index.vue?vue&type=style&index=0&id=41644aac&lang=scss&scoped=true");
  20152. /* harmony import */ var D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/exportHelper.js */ "../../node_modules/vue-loader-v16/dist/exportHelper.js");
  20153. /* harmony import */ var D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__);
  20154. const __exports__ = /*#__PURE__*/D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3___default()(_index_vue_vue_type_script_lang_ts_setup_true__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_index_vue_vue_type_template_id_41644aac_scoped_true_ts_true__WEBPACK_IMPORTED_MODULE_0__["render"]],['__scopeId',"data-v-41644aac"],['__file',"src/app/program/views/scene/index.vue"]])
  20155. /* hot reload */
  20156. if (false) {}
  20157. /* harmony default export */ __webpack_exports__["default"] = (__exports__);
  20158. /***/ }),
  20159. /***/ "./src/app/program/views/scene/index.vue?vue&type=script&lang=ts&setup=true":
  20160. /*!**********************************************************************************!*\
  20161. !*** ./src/app/program/views/scene/index.vue?vue&type=script&lang=ts&setup=true ***!
  20162. \**********************************************************************************/
  20163. /*! exports provided: default */
  20164. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20165. "use strict";
  20166. __webpack_require__.r(__webpack_exports__);
  20167. /* harmony import */ var _node_modules_cache_loader_dist_cjs_js_ref_14_0_node_modules_babel_loader_lib_index_js_node_modules_ts_loader_index_js_ref_14_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_script_lang_ts_setup_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../../../../node_modules/babel-loader/lib!../../../../../../../node_modules/ts-loader??ref--14-2!../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../../node_modules/vue-loader-v16/dist??ref--1-1!./index.vue?vue&type=script&lang=ts&setup=true */ "../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/scene/index.vue?vue&type=script&lang=ts&setup=true");
  20168. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _node_modules_cache_loader_dist_cjs_js_ref_14_0_node_modules_babel_loader_lib_index_js_node_modules_ts_loader_index_js_ref_14_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_script_lang_ts_setup_true__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  20169. /* empty/unused harmony star reexport */
  20170. /***/ }),
  20171. /***/ "./src/app/program/views/scene/index.vue?vue&type=style&index=0&id=41644aac&lang=scss&scoped=true":
  20172. /*!********************************************************************************************************!*\
  20173. !*** ./src/app/program/views/scene/index.vue?vue&type=style&index=0&id=41644aac&lang=scss&scoped=true ***!
  20174. \********************************************************************************************************/
  20175. /*! no static exports found */
  20176. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20177. "use strict";
  20178. __webpack_require__.r(__webpack_exports__);
  20179. /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_style_index_0_id_41644aac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../node_modules/vue-style-loader??ref--9-oneOf-1-0!../../../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../../../node_modules/postcss-loader/src??ref--9-oneOf-1-2!../../../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../../node_modules/vue-loader-v16/dist??ref--1-1!./index.vue?vue&type=style&index=0&id=41644aac&lang=scss&scoped=true */ "../../node_modules/vue-style-loader/index.js?!../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/sass-loader/dist/cjs.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/scene/index.vue?vue&type=style&index=0&id=41644aac&lang=scss&scoped=true");
  20180. /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_style_index_0_id_41644aac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_style_index_0_id_41644aac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
  20181. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_style_index_0_id_41644aac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_style_index_0_id_41644aac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  20182. /***/ }),
  20183. /***/ "./src/app/program/views/scene/index.vue?vue&type=template&id=41644aac&scoped=true&ts=true":
  20184. /*!*************************************************************************************************!*\
  20185. !*** ./src/app/program/views/scene/index.vue?vue&type=template&id=41644aac&scoped=true&ts=true ***!
  20186. \*************************************************************************************************/
  20187. /*! exports provided: render */
  20188. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20189. "use strict";
  20190. __webpack_require__.r(__webpack_exports__);
  20191. /* harmony import */ var _node_modules_cache_loader_dist_cjs_js_ref_14_0_node_modules_babel_loader_lib_index_js_node_modules_ts_loader_index_js_ref_14_2_node_modules_vue_loader_v16_dist_templateLoader_js_ref_7_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_template_id_41644aac_scoped_true_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../../../../node_modules/babel-loader/lib!../../../../../../../node_modules/ts-loader??ref--14-2!../../../../../../../node_modules/vue-loader-v16/dist/templateLoader.js??ref--7!../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../../node_modules/vue-loader-v16/dist??ref--1-1!./index.vue?vue&type=template&id=41644aac&scoped=true&ts=true */ "../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js?!../../node_modules/vue-loader-v16/dist/templateLoader.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/scene/index.vue?vue&type=template&id=41644aac&scoped=true&ts=true");
  20192. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_cache_loader_dist_cjs_js_ref_14_0_node_modules_babel_loader_lib_index_js_node_modules_ts_loader_index_js_ref_14_2_node_modules_vue_loader_v16_dist_templateLoader_js_ref_7_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_template_id_41644aac_scoped_true_ts_true__WEBPACK_IMPORTED_MODULE_0__["render"]; });
  20193. /***/ }),
  20194. /***/ "./src/app/program/views/sys/device/help.vue":
  20195. /*!***************************************************!*\
  20196. !*** ./src/app/program/views/sys/device/help.vue ***!
  20197. \***************************************************/
  20198. /*! exports provided: default */
  20199. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20200. "use strict";
  20201. __webpack_require__.r(__webpack_exports__);
  20202. /* harmony import */ var _help_vue_vue_type_template_id_32593d35_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./help.vue?vue&type=template&id=32593d35&scoped=true */ "./src/app/program/views/sys/device/help.vue?vue&type=template&id=32593d35&scoped=true");
  20203. /* harmony import */ var _help_vue_vue_type_style_index_0_id_32593d35_scoped_true_lang_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./help.vue?vue&type=style&index=0&id=32593d35&scoped=true&lang=scss */ "./src/app/program/views/sys/device/help.vue?vue&type=style&index=0&id=32593d35&scoped=true&lang=scss");
  20204. /* harmony import */ var D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/exportHelper.js */ "../../node_modules/vue-loader-v16/dist/exportHelper.js");
  20205. /* harmony import */ var D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__);
  20206. const script = {}
  20207. const __exports__ = /*#__PURE__*/D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2___default()(script, [['render',_help_vue_vue_type_template_id_32593d35_scoped_true__WEBPACK_IMPORTED_MODULE_0__["render"]],['__scopeId',"data-v-32593d35"],['__file',"src/app/program/views/sys/device/help.vue"]])
  20208. /* hot reload */
  20209. if (false) {}
  20210. /* harmony default export */ __webpack_exports__["default"] = (__exports__);
  20211. /***/ }),
  20212. /***/ "./src/app/program/views/sys/device/help.vue?vue&type=style&index=0&id=32593d35&scoped=true&lang=scss":
  20213. /*!************************************************************************************************************!*\
  20214. !*** ./src/app/program/views/sys/device/help.vue?vue&type=style&index=0&id=32593d35&scoped=true&lang=scss ***!
  20215. \************************************************************************************************************/
  20216. /*! no static exports found */
  20217. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20218. "use strict";
  20219. __webpack_require__.r(__webpack_exports__);
  20220. /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_help_vue_vue_type_style_index_0_id_32593d35_scoped_true_lang_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../../node_modules/vue-style-loader??ref--9-oneOf-1-0!../../../../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../../../../node_modules/postcss-loader/src??ref--9-oneOf-1-2!../../../../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../../../node_modules/vue-loader-v16/dist??ref--1-1!./help.vue?vue&type=style&index=0&id=32593d35&scoped=true&lang=scss */ "../../node_modules/vue-style-loader/index.js?!../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/sass-loader/dist/cjs.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/help.vue?vue&type=style&index=0&id=32593d35&scoped=true&lang=scss");
  20221. /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_help_vue_vue_type_style_index_0_id_32593d35_scoped_true_lang_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_help_vue_vue_type_style_index_0_id_32593d35_scoped_true_lang_scss__WEBPACK_IMPORTED_MODULE_0__);
  20222. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_help_vue_vue_type_style_index_0_id_32593d35_scoped_true_lang_scss__WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_help_vue_vue_type_style_index_0_id_32593d35_scoped_true_lang_scss__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  20223. /***/ }),
  20224. /***/ "./src/app/program/views/sys/device/help.vue?vue&type=template&id=32593d35&scoped=true":
  20225. /*!*********************************************************************************************!*\
  20226. !*** ./src/app/program/views/sys/device/help.vue?vue&type=template&id=32593d35&scoped=true ***!
  20227. \*********************************************************************************************/
  20228. /*! exports provided: render */
  20229. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20230. "use strict";
  20231. __webpack_require__.r(__webpack_exports__);
  20232. /* harmony import */ var _node_modules_cache_loader_dist_cjs_js_ref_13_0_node_modules_babel_loader_lib_index_js_node_modules_vue_loader_v16_dist_templateLoader_js_ref_7_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_help_vue_vue_type_template_id_32593d35_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../../../../../node_modules/babel-loader/lib!../../../../../../../../node_modules/vue-loader-v16/dist/templateLoader.js??ref--7!../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../../../node_modules/vue-loader-v16/dist??ref--1-1!./help.vue?vue&type=template&id=32593d35&scoped=true */ "../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/babel-loader/lib/index.js!../../node_modules/vue-loader-v16/dist/templateLoader.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/help.vue?vue&type=template&id=32593d35&scoped=true");
  20233. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_cache_loader_dist_cjs_js_ref_13_0_node_modules_babel_loader_lib_index_js_node_modules_vue_loader_v16_dist_templateLoader_js_ref_7_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_help_vue_vue_type_template_id_32593d35_scoped_true__WEBPACK_IMPORTED_MODULE_0__["render"]; });
  20234. /***/ }),
  20235. /***/ "./src/app/program/views/sys/device/index.vue":
  20236. /*!****************************************************!*\
  20237. !*** ./src/app/program/views/sys/device/index.vue ***!
  20238. \****************************************************/
  20239. /*! exports provided: default */
  20240. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20241. "use strict";
  20242. __webpack_require__.r(__webpack_exports__);
  20243. /* harmony import */ var _index_vue_vue_type_template_id_c40f4be4_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.vue?vue&type=template&id=c40f4be4&ts=true */ "./src/app/program/views/sys/device/index.vue?vue&type=template&id=c40f4be4&ts=true");
  20244. /* harmony import */ var _index_vue_vue_type_script_setup_true_lang_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.vue?vue&type=script&setup=true&lang=ts */ "./src/app/program/views/sys/device/index.vue?vue&type=script&setup=true&lang=ts");
  20245. /* empty/unused harmony star reexport *//* harmony import */ var D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/exportHelper.js */ "../../node_modules/vue-loader-v16/dist/exportHelper.js");
  20246. /* harmony import */ var D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__);
  20247. const __exports__ = /*#__PURE__*/D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2___default()(_index_vue_vue_type_script_setup_true_lang_ts__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_index_vue_vue_type_template_id_c40f4be4_ts_true__WEBPACK_IMPORTED_MODULE_0__["render"]],['__file',"src/app/program/views/sys/device/index.vue"]])
  20248. /* hot reload */
  20249. if (false) {}
  20250. /* harmony default export */ __webpack_exports__["default"] = (__exports__);
  20251. /***/ }),
  20252. /***/ "./src/app/program/views/sys/device/index.vue?vue&type=script&setup=true&lang=ts":
  20253. /*!***************************************************************************************!*\
  20254. !*** ./src/app/program/views/sys/device/index.vue?vue&type=script&setup=true&lang=ts ***!
  20255. \***************************************************************************************/
  20256. /*! exports provided: default */
  20257. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20258. "use strict";
  20259. __webpack_require__.r(__webpack_exports__);
  20260. /* harmony import */ var _node_modules_cache_loader_dist_cjs_js_ref_14_0_node_modules_babel_loader_lib_index_js_node_modules_ts_loader_index_js_ref_14_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_script_setup_true_lang_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../../../../../node_modules/babel-loader/lib!../../../../../../../../node_modules/ts-loader??ref--14-2!../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../../../node_modules/vue-loader-v16/dist??ref--1-1!./index.vue?vue&type=script&setup=true&lang=ts */ "../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/index.vue?vue&type=script&setup=true&lang=ts");
  20261. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _node_modules_cache_loader_dist_cjs_js_ref_14_0_node_modules_babel_loader_lib_index_js_node_modules_ts_loader_index_js_ref_14_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_script_setup_true_lang_ts__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  20262. /* empty/unused harmony star reexport */
  20263. /***/ }),
  20264. /***/ "./src/app/program/views/sys/device/index.vue?vue&type=template&id=c40f4be4&ts=true":
  20265. /*!******************************************************************************************!*\
  20266. !*** ./src/app/program/views/sys/device/index.vue?vue&type=template&id=c40f4be4&ts=true ***!
  20267. \******************************************************************************************/
  20268. /*! exports provided: render */
  20269. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20270. "use strict";
  20271. __webpack_require__.r(__webpack_exports__);
  20272. /* harmony import */ var _node_modules_cache_loader_dist_cjs_js_ref_14_0_node_modules_babel_loader_lib_index_js_node_modules_ts_loader_index_js_ref_14_2_node_modules_vue_loader_v16_dist_templateLoader_js_ref_7_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_template_id_c40f4be4_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../../../../../node_modules/babel-loader/lib!../../../../../../../../node_modules/ts-loader??ref--14-2!../../../../../../../../node_modules/vue-loader-v16/dist/templateLoader.js??ref--7!../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../../../node_modules/vue-loader-v16/dist??ref--1-1!./index.vue?vue&type=template&id=c40f4be4&ts=true */ "../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js?!../../node_modules/vue-loader-v16/dist/templateLoader.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/index.vue?vue&type=template&id=c40f4be4&ts=true");
  20273. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_cache_loader_dist_cjs_js_ref_14_0_node_modules_babel_loader_lib_index_js_node_modules_ts_loader_index_js_ref_14_2_node_modules_vue_loader_v16_dist_templateLoader_js_ref_7_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_template_id_c40f4be4_ts_true__WEBPACK_IMPORTED_MODULE_0__["render"]; });
  20274. /***/ }),
  20275. /***/ "./src/app/program/views/sys/device/sync/index.vue":
  20276. /*!*********************************************************!*\
  20277. !*** ./src/app/program/views/sys/device/sync/index.vue ***!
  20278. \*********************************************************/
  20279. /*! exports provided: default */
  20280. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20281. "use strict";
  20282. __webpack_require__.r(__webpack_exports__);
  20283. /* harmony import */ var _index_vue_vue_type_template_id_05b8aad2_scoped_true_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.vue?vue&type=template&id=05b8aad2&scoped=true&ts=true */ "./src/app/program/views/sys/device/sync/index.vue?vue&type=template&id=05b8aad2&scoped=true&ts=true");
  20284. /* harmony import */ var _index_vue_vue_type_script_setup_true_lang_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.vue?vue&type=script&setup=true&lang=ts */ "./src/app/program/views/sys/device/sync/index.vue?vue&type=script&setup=true&lang=ts");
  20285. /* empty/unused harmony star reexport *//* harmony import */ var _index_vue_vue_type_style_index_0_id_05b8aad2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index.vue?vue&type=style&index=0&id=05b8aad2&lang=scss&scoped=true */ "./src/app/program/views/sys/device/sync/index.vue?vue&type=style&index=0&id=05b8aad2&lang=scss&scoped=true");
  20286. /* harmony import */ var _index_vue_vue_type_style_index_1_id_05b8aad2_lang_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./index.vue?vue&type=style&index=1&id=05b8aad2&lang=scss */ "./src/app/program/views/sys/device/sync/index.vue?vue&type=style&index=1&id=05b8aad2&lang=scss");
  20287. /* harmony import */ var D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/exportHelper.js */ "../../node_modules/vue-loader-v16/dist/exportHelper.js");
  20288. /* harmony import */ var D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_4__);
  20289. const __exports__ = /*#__PURE__*/D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_4___default()(_index_vue_vue_type_script_setup_true_lang_ts__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_index_vue_vue_type_template_id_05b8aad2_scoped_true_ts_true__WEBPACK_IMPORTED_MODULE_0__["render"]],['__scopeId',"data-v-05b8aad2"],['__file',"src/app/program/views/sys/device/sync/index.vue"]])
  20290. /* hot reload */
  20291. if (false) {}
  20292. /* harmony default export */ __webpack_exports__["default"] = (__exports__);
  20293. /***/ }),
  20294. /***/ "./src/app/program/views/sys/device/sync/index.vue?vue&type=script&setup=true&lang=ts":
  20295. /*!********************************************************************************************!*\
  20296. !*** ./src/app/program/views/sys/device/sync/index.vue?vue&type=script&setup=true&lang=ts ***!
  20297. \********************************************************************************************/
  20298. /*! exports provided: default */
  20299. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20300. "use strict";
  20301. __webpack_require__.r(__webpack_exports__);
  20302. /* harmony import */ var _node_modules_cache_loader_dist_cjs_js_ref_14_0_node_modules_babel_loader_lib_index_js_node_modules_ts_loader_index_js_ref_14_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_script_setup_true_lang_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../../../../../../node_modules/babel-loader/lib!../../../../../../../../../node_modules/ts-loader??ref--14-2!../../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../../../../node_modules/vue-loader-v16/dist??ref--1-1!./index.vue?vue&type=script&setup=true&lang=ts */ "../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/sync/index.vue?vue&type=script&setup=true&lang=ts");
  20303. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _node_modules_cache_loader_dist_cjs_js_ref_14_0_node_modules_babel_loader_lib_index_js_node_modules_ts_loader_index_js_ref_14_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_script_setup_true_lang_ts__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  20304. /* empty/unused harmony star reexport */
  20305. /***/ }),
  20306. /***/ "./src/app/program/views/sys/device/sync/index.vue?vue&type=style&index=0&id=05b8aad2&lang=scss&scoped=true":
  20307. /*!******************************************************************************************************************!*\
  20308. !*** ./src/app/program/views/sys/device/sync/index.vue?vue&type=style&index=0&id=05b8aad2&lang=scss&scoped=true ***!
  20309. \******************************************************************************************************************/
  20310. /*! no static exports found */
  20311. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20312. "use strict";
  20313. __webpack_require__.r(__webpack_exports__);
  20314. /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_style_index_0_id_05b8aad2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../../../node_modules/vue-style-loader??ref--9-oneOf-1-0!../../../../../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../../../../../node_modules/postcss-loader/src??ref--9-oneOf-1-2!../../../../../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../../../../node_modules/vue-loader-v16/dist??ref--1-1!./index.vue?vue&type=style&index=0&id=05b8aad2&lang=scss&scoped=true */ "../../node_modules/vue-style-loader/index.js?!../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/sass-loader/dist/cjs.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/sync/index.vue?vue&type=style&index=0&id=05b8aad2&lang=scss&scoped=true");
  20315. /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_style_index_0_id_05b8aad2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_style_index_0_id_05b8aad2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
  20316. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_style_index_0_id_05b8aad2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_style_index_0_id_05b8aad2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  20317. /***/ }),
  20318. /***/ "./src/app/program/views/sys/device/sync/index.vue?vue&type=style&index=1&id=05b8aad2&lang=scss":
  20319. /*!******************************************************************************************************!*\
  20320. !*** ./src/app/program/views/sys/device/sync/index.vue?vue&type=style&index=1&id=05b8aad2&lang=scss ***!
  20321. \******************************************************************************************************/
  20322. /*! no static exports found */
  20323. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20324. "use strict";
  20325. __webpack_require__.r(__webpack_exports__);
  20326. /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_style_index_1_id_05b8aad2_lang_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../../../node_modules/vue-style-loader??ref--9-oneOf-1-0!../../../../../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../../../../../node_modules/postcss-loader/src??ref--9-oneOf-1-2!../../../../../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../../../../node_modules/vue-loader-v16/dist??ref--1-1!./index.vue?vue&type=style&index=1&id=05b8aad2&lang=scss */ "../../node_modules/vue-style-loader/index.js?!../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/sass-loader/dist/cjs.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/sync/index.vue?vue&type=style&index=1&id=05b8aad2&lang=scss");
  20327. /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_style_index_1_id_05b8aad2_lang_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_style_index_1_id_05b8aad2_lang_scss__WEBPACK_IMPORTED_MODULE_0__);
  20328. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_style_index_1_id_05b8aad2_lang_scss__WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_style_index_1_id_05b8aad2_lang_scss__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  20329. /***/ }),
  20330. /***/ "./src/app/program/views/sys/device/sync/index.vue?vue&type=template&id=05b8aad2&scoped=true&ts=true":
  20331. /*!***********************************************************************************************************!*\
  20332. !*** ./src/app/program/views/sys/device/sync/index.vue?vue&type=template&id=05b8aad2&scoped=true&ts=true ***!
  20333. \***********************************************************************************************************/
  20334. /*! exports provided: render */
  20335. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20336. "use strict";
  20337. __webpack_require__.r(__webpack_exports__);
  20338. /* harmony import */ var _node_modules_cache_loader_dist_cjs_js_ref_14_0_node_modules_babel_loader_lib_index_js_node_modules_ts_loader_index_js_ref_14_2_node_modules_vue_loader_v16_dist_templateLoader_js_ref_7_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_template_id_05b8aad2_scoped_true_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../../../../../../node_modules/babel-loader/lib!../../../../../../../../../node_modules/ts-loader??ref--14-2!../../../../../../../../../node_modules/vue-loader-v16/dist/templateLoader.js??ref--7!../../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../../../../node_modules/vue-loader-v16/dist??ref--1-1!./index.vue?vue&type=template&id=05b8aad2&scoped=true&ts=true */ "../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js?!../../node_modules/vue-loader-v16/dist/templateLoader.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/sync/index.vue?vue&type=template&id=05b8aad2&scoped=true&ts=true");
  20339. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_cache_loader_dist_cjs_js_ref_14_0_node_modules_babel_loader_lib_index_js_node_modules_ts_loader_index_js_ref_14_2_node_modules_vue_loader_v16_dist_templateLoader_js_ref_7_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_template_id_05b8aad2_scoped_true_ts_true__WEBPACK_IMPORTED_MODULE_0__["render"]; });
  20340. /***/ }),
  20341. /***/ "./src/app/program/views/sys/device/sync/output/fit-c.json":
  20342. /*!*****************************************************************!*\
  20343. !*** ./src/app/program/views/sys/device/sync/output/fit-c.json ***!
  20344. \*****************************************************************/
  20345. /*! exports provided: v, fr, ip, op, w, h, nm, ddd, assets, layers, markers, default */
  20346. /***/ (function(module) {
  20347. module.exports = JSON.parse("{\"v\":\"5.9.3\",\"fr\":25,\"ip\":0,\"op\":49,\"w\":32,\"h\":32,\"nm\":\"fit-c\",\"ddd\":0,\"assets\":[],\"layers\":[{\"ddd\":0,\"ind\":1,\"ty\":4,\"nm\":\"路径 2\",\"sr\":1,\"ks\":{\"o\":{\"a\":0,\"k\":60,\"ix\":11},\"r\":{\"a\":0,\"k\":0,\"ix\":10},\"p\":{\"a\":0,\"k\":[16,21,0],\"ix\":2,\"l\":2},\"a\":{\"a\":0,\"k\":[0,0,0],\"ix\":1,\"l\":2},\"s\":{\"a\":0,\"k\":[100,100,100],\"ix\":6,\"l\":2}},\"ao\":0,\"shapes\":[{\"ty\":\"gr\",\"it\":[{\"ind\":0,\"ty\":\"sh\",\"ix\":1,\"ks\":{\"a\":0,\"k\":{\"i\":[[-0.55,0],[-0.05,-0.49],[0,0],[0,0],[1.03,-0.07],[0,0],[0,0],[0.07,1.03],[0,0],[0,0],[-0.55,0],[-0.05,-0.49],[0,0],[0,0],[0,0],[0,0]],\"o\":[[0.51,0],[0,0],[0,0],[0,1.05],[0,0],[0,0],[-1.05,0],[0,0],[0,0],[0,-0.55],[0.51,0],[0,0],[0,0],[0,0],[0,0],[0,-0.55]],\"v\":[[7,-3],[7.99,-2.12],[8,-2],[8,1],[6.15,2.99],[6,3],[-6,3],[-7.99,1.15],[-8,1],[-8,-2],[-7,-3],[-6.01,-2.12],[-6,-2],[-6,1],[6,1],[6,-2]],\"c\":true},\"ix\":2},\"nm\":\"路径 1\",\"mn\":\"ADBE Vector Shape - Group\",\"hd\":false},{\"ty\":\"fl\",\"c\":{\"a\":0,\"k\":[1,1,1,1],\"ix\":4},\"o\":{\"a\":0,\"k\":100,\"ix\":5},\"r\":1,\"bm\":0,\"nm\":\"填充 1\",\"mn\":\"ADBE Vector Graphic - Fill\",\"hd\":false},{\"ty\":\"tr\",\"p\":{\"a\":0,\"k\":[0,0],\"ix\":2},\"a\":{\"a\":0,\"k\":[0,0],\"ix\":1},\"s\":{\"a\":0,\"k\":[100,100],\"ix\":3},\"r\":{\"a\":0,\"k\":0,\"ix\":6},\"o\":{\"a\":0,\"k\":100,\"ix\":7},\"sk\":{\"a\":0,\"k\":0,\"ix\":4},\"sa\":{\"a\":0,\"k\":0,\"ix\":5},\"nm\":\"变换\"}],\"nm\":\"路径\",\"np\":2,\"cix\":2,\"bm\":0,\"ix\":1,\"mn\":\"ADBE Vector Group\",\"hd\":false}],\"ip\":0,\"op\":250,\"st\":0,\"ct\":1,\"bm\":0},{\"ddd\":0,\"ind\":2,\"ty\":4,\"nm\":\"路径\",\"sr\":1,\"ks\":{\"o\":{\"a\":1,\"k\":[{\"i\":{\"x\":[0.833],\"y\":[0.833]},\"o\":{\"x\":[0.167],\"y\":[0.167]},\"t\":0,\"s\":[0]},{\"i\":{\"x\":[0.833],\"y\":[0.833]},\"o\":{\"x\":[0.167],\"y\":[0.167]},\"t\":16,\"s\":[60]},{\"i\":{\"x\":[0.833],\"y\":[0.833]},\"o\":{\"x\":[0.167],\"y\":[0.167]},\"t\":29,\"s\":[60]},{\"t\":48,\"s\":[0]}],\"ix\":11},\"r\":{\"a\":0,\"k\":0,\"ix\":10},\"p\":{\"a\":1,\"k\":[{\"i\":{\"x\":0.667,\"y\":1},\"o\":{\"x\":0.167,\"y\":0.167},\"t\":0,\"s\":[16,16.438,0],\"to\":[0,-1.24,0],\"ti\":[0,1.24,0]},{\"t\":48,\"s\":[16,9,0]}],\"ix\":2,\"l\":2},\"a\":{\"a\":0,\"k\":[0,0,0],\"ix\":1,\"l\":2},\"s\":{\"a\":0,\"k\":[100,100,100],\"ix\":6,\"l\":2}},\"ao\":0,\"shapes\":[{\"ty\":\"gr\",\"it\":[{\"ind\":0,\"ty\":\"sh\",\"ix\":1,\"ks\":{\"a\":0,\"k\":{\"i\":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],\"o\":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],\"v\":[[-6,0.5],[0,-5.5],[6,0.5],[2.5,0.5],[2.5,5.5],[-2.5,5.5],[-2.5,0.5]],\"c\":true},\"ix\":2},\"nm\":\"路径 1\",\"mn\":\"ADBE Vector Shape - Group\",\"hd\":false},{\"ty\":\"rd\",\"nm\":\"圆角 1\",\"r\":{\"a\":0,\"k\":1,\"ix\":1},\"ix\":2,\"mn\":\"ADBE Vector Filter - RC\",\"hd\":false},{\"ty\":\"fl\",\"c\":{\"a\":0,\"k\":[1,1,1,1],\"ix\":4},\"o\":{\"a\":0,\"k\":100,\"ix\":5},\"r\":1,\"bm\":0,\"nm\":\"填充 1\",\"mn\":\"ADBE Vector Graphic - Fill\",\"hd\":false},{\"ty\":\"tr\",\"p\":{\"a\":0,\"k\":[0,0],\"ix\":2},\"a\":{\"a\":0,\"k\":[0,0],\"ix\":1},\"s\":{\"a\":0,\"k\":[100,100],\"ix\":3},\"r\":{\"a\":0,\"k\":0,\"ix\":6},\"o\":{\"a\":0,\"k\":100,\"ix\":7},\"sk\":{\"a\":0,\"k\":0,\"ix\":4},\"sa\":{\"a\":0,\"k\":0,\"ix\":5},\"nm\":\"变换\"}],\"nm\":\"路径\",\"np\":3,\"cix\":2,\"bm\":0,\"ix\":1,\"mn\":\"ADBE Vector Group\",\"hd\":false}],\"ip\":0,\"op\":250,\"st\":0,\"ct\":1,\"bm\":0}],\"markers\":[{\"tm\":0,\"cm\":\"1\",\"dr\":0},{\"tm\":50,\"cm\":\"2\",\"dr\":0}]}");
  20348. /***/ }),
  20349. /***/ "./src/app/program/views/sys/device/sync/output/fit-u.json":
  20350. /*!*****************************************************************!*\
  20351. !*** ./src/app/program/views/sys/device/sync/output/fit-u.json ***!
  20352. \*****************************************************************/
  20353. /*! exports provided: v, fr, ip, op, w, h, nm, ddd, assets, layers, markers, default */
  20354. /***/ (function(module) {
  20355. module.exports = JSON.parse("{\"v\":\"5.9.3\",\"fr\":25,\"ip\":0,\"op\":49,\"w\":32,\"h\":32,\"nm\":\"fit-u\",\"ddd\":0,\"assets\":[],\"layers\":[{\"ddd\":0,\"ind\":1,\"ty\":4,\"nm\":\"路径 2\",\"sr\":1,\"ks\":{\"o\":{\"a\":0,\"k\":60,\"ix\":11},\"r\":{\"a\":0,\"k\":0,\"ix\":10},\"p\":{\"a\":0,\"k\":[16,21,0],\"ix\":2,\"l\":2},\"a\":{\"a\":0,\"k\":[0,0,0],\"ix\":1,\"l\":2},\"s\":{\"a\":0,\"k\":[100,100,100],\"ix\":6,\"l\":2}},\"ao\":0,\"shapes\":[{\"ty\":\"gr\",\"it\":[{\"ind\":0,\"ty\":\"sh\",\"ix\":1,\"ks\":{\"a\":0,\"k\":{\"i\":[[-0.55,0],[-0.05,-0.49],[0,0],[0,0],[1.03,-0.07],[0,0],[0,0],[0.07,1.03],[0,0],[0,0],[-0.55,0],[-0.05,-0.49],[0,0],[0,0],[0,0],[0,0]],\"o\":[[0.51,0],[0,0],[0,0],[0,1.05],[0,0],[0,0],[-1.05,0],[0,0],[0,0],[0,-0.55],[0.51,0],[0,0],[0,0],[0,0],[0,0],[0,-0.55]],\"v\":[[7,-3],[7.99,-2.12],[8,-2],[8,1],[6.15,2.99],[6,3],[-6,3],[-7.99,1.15],[-8,1],[-8,-2],[-7,-3],[-6.01,-2.12],[-6,-2],[-6,1],[6,1],[6,-2]],\"c\":true},\"ix\":2},\"nm\":\"路径 1\",\"mn\":\"ADBE Vector Shape - Group\",\"hd\":false},{\"ty\":\"fl\",\"c\":{\"a\":0,\"k\":[1,1,1,1],\"ix\":4},\"o\":{\"a\":0,\"k\":100,\"ix\":5},\"r\":1,\"bm\":0,\"nm\":\"填充 1\",\"mn\":\"ADBE Vector Graphic - Fill\",\"hd\":false},{\"ty\":\"tr\",\"p\":{\"a\":0,\"k\":[0,0],\"ix\":2},\"a\":{\"a\":0,\"k\":[0,0],\"ix\":1},\"s\":{\"a\":0,\"k\":[100,100],\"ix\":3},\"r\":{\"a\":0,\"k\":0,\"ix\":6},\"o\":{\"a\":0,\"k\":100,\"ix\":7},\"sk\":{\"a\":0,\"k\":0,\"ix\":4},\"sa\":{\"a\":0,\"k\":0,\"ix\":5},\"nm\":\"变换\"}],\"nm\":\"路径\",\"np\":2,\"cix\":2,\"bm\":0,\"ix\":1,\"mn\":\"ADBE Vector Group\",\"hd\":false}],\"ip\":0,\"op\":250,\"st\":0,\"ct\":1,\"bm\":0},{\"ddd\":0,\"ind\":2,\"ty\":4,\"nm\":\"路径\",\"sr\":1,\"ks\":{\"o\":{\"a\":1,\"k\":[{\"i\":{\"x\":[0.833],\"y\":[0.833]},\"o\":{\"x\":[0.167],\"y\":[0.167]},\"t\":0,\"s\":[0]},{\"i\":{\"x\":[0.833],\"y\":[0.833]},\"o\":{\"x\":[0.167],\"y\":[0.167]},\"t\":16,\"s\":[60]},{\"i\":{\"x\":[0.833],\"y\":[0.833]},\"o\":{\"x\":[0.167],\"y\":[0.167]},\"t\":29,\"s\":[60]},{\"t\":48,\"s\":[0]}],\"ix\":11},\"r\":{\"a\":0,\"k\":0,\"ix\":10},\"p\":{\"a\":1,\"k\":[{\"i\":{\"x\":0.833,\"y\":0.833},\"o\":{\"x\":0.333,\"y\":0},\"t\":-48,\"s\":[16,9,0],\"to\":[0,1.24,0],\"ti\":[0,1.24,0]},{\"i\":{\"x\":0.833,\"y\":0.833},\"o\":{\"x\":0.167,\"y\":0.167},\"t\":0,\"s\":[16,9,0],\"to\":[0,0,0],\"ti\":[0,0,0]},{\"t\":48,\"s\":[16,16.438,0]}],\"ix\":2,\"l\":2},\"a\":{\"a\":0,\"k\":[0,0,0],\"ix\":1,\"l\":2},\"s\":{\"a\":0,\"k\":[100,-100,100],\"ix\":6,\"l\":2}},\"ao\":0,\"shapes\":[{\"ty\":\"gr\",\"it\":[{\"ind\":0,\"ty\":\"sh\",\"ix\":1,\"ks\":{\"a\":0,\"k\":{\"i\":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],\"o\":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],\"v\":[[-6,0.5],[0,-5.5],[6,0.5],[2.5,0.5],[2.5,5.5],[-2.5,5.5],[-2.5,0.5]],\"c\":true},\"ix\":2},\"nm\":\"路径 1\",\"mn\":\"ADBE Vector Shape - Group\",\"hd\":false},{\"ty\":\"rd\",\"nm\":\"圆角 1\",\"r\":{\"a\":0,\"k\":1,\"ix\":1},\"ix\":2,\"mn\":\"ADBE Vector Filter - RC\",\"hd\":false},{\"ty\":\"fl\",\"c\":{\"a\":0,\"k\":[1,1,1,1],\"ix\":4},\"o\":{\"a\":0,\"k\":100,\"ix\":5},\"r\":1,\"bm\":0,\"nm\":\"填充 1\",\"mn\":\"ADBE Vector Graphic - Fill\",\"hd\":false},{\"ty\":\"tr\",\"p\":{\"a\":0,\"k\":[0,0],\"ix\":2},\"a\":{\"a\":0,\"k\":[0,0],\"ix\":1},\"s\":{\"a\":0,\"k\":[100,100],\"ix\":3},\"r\":{\"a\":0,\"k\":0,\"ix\":6},\"o\":{\"a\":0,\"k\":100,\"ix\":7},\"sk\":{\"a\":0,\"k\":0,\"ix\":4},\"sa\":{\"a\":0,\"k\":0,\"ix\":5},\"nm\":\"变换\"}],\"nm\":\"路径\",\"np\":3,\"cix\":2,\"bm\":0,\"ix\":1,\"mn\":\"ADBE Vector Group\",\"hd\":false}],\"ip\":0,\"op\":250,\"st\":0,\"ct\":1,\"bm\":0}],\"markers\":[{\"tm\":0,\"cm\":\"1\",\"dr\":0},{\"tm\":50,\"cm\":\"2\",\"dr\":0}]}");
  20356. /***/ }),
  20357. /***/ "./src/app/program/views/sys/device/sync/select-scene.vue":
  20358. /*!****************************************************************!*\
  20359. !*** ./src/app/program/views/sys/device/sync/select-scene.vue ***!
  20360. \****************************************************************/
  20361. /*! exports provided: default */
  20362. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20363. "use strict";
  20364. __webpack_require__.r(__webpack_exports__);
  20365. /* harmony import */ var _select_scene_vue_vue_type_template_id_239f642b_scoped_true_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./select-scene.vue?vue&type=template&id=239f642b&scoped=true&ts=true */ "./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=template&id=239f642b&scoped=true&ts=true");
  20366. /* harmony import */ var _select_scene_vue_vue_type_script_setup_true_lang_ts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./select-scene.vue?vue&type=script&setup=true&lang=ts */ "./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=script&setup=true&lang=ts");
  20367. /* empty/unused harmony star reexport *//* harmony import */ var _select_scene_vue_vue_type_style_index_0_id_239f642b_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./select-scene.vue?vue&type=style&index=0&id=239f642b&lang=scss&scoped=true */ "./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=style&index=0&id=239f642b&lang=scss&scoped=true");
  20368. /* harmony import */ var _select_scene_vue_vue_type_style_index_1_id_239f642b_lang_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./select-scene.vue?vue&type=style&index=1&id=239f642b&lang=css */ "./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=style&index=1&id=239f642b&lang=css");
  20369. /* harmony import */ var D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! D:/web_src/4dkankan_v4/node_modules/vue-loader-v16/dist/exportHelper.js */ "../../node_modules/vue-loader-v16/dist/exportHelper.js");
  20370. /* harmony import */ var D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_4__);
  20371. const __exports__ = /*#__PURE__*/D_web_src_4dkankan_v4_node_modules_vue_loader_v16_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_4___default()(_select_scene_vue_vue_type_script_setup_true_lang_ts__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_select_scene_vue_vue_type_template_id_239f642b_scoped_true_ts_true__WEBPACK_IMPORTED_MODULE_0__["render"]],['__scopeId',"data-v-239f642b"],['__file',"src/app/program/views/sys/device/sync/select-scene.vue"]])
  20372. /* hot reload */
  20373. if (false) {}
  20374. /* harmony default export */ __webpack_exports__["default"] = (__exports__);
  20375. /***/ }),
  20376. /***/ "./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=script&setup=true&lang=ts":
  20377. /*!***************************************************************************************************!*\
  20378. !*** ./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=script&setup=true&lang=ts ***!
  20379. \***************************************************************************************************/
  20380. /*! exports provided: default */
  20381. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20382. "use strict";
  20383. __webpack_require__.r(__webpack_exports__);
  20384. /* harmony import */ var _node_modules_cache_loader_dist_cjs_js_ref_14_0_node_modules_babel_loader_lib_index_js_node_modules_ts_loader_index_js_ref_14_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_select_scene_vue_vue_type_script_setup_true_lang_ts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../../../../../../node_modules/babel-loader/lib!../../../../../../../../../node_modules/ts-loader??ref--14-2!../../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../../../../node_modules/vue-loader-v16/dist??ref--1-1!./select-scene.vue?vue&type=script&setup=true&lang=ts */ "../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=script&setup=true&lang=ts");
  20385. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _node_modules_cache_loader_dist_cjs_js_ref_14_0_node_modules_babel_loader_lib_index_js_node_modules_ts_loader_index_js_ref_14_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_select_scene_vue_vue_type_script_setup_true_lang_ts__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  20386. /* empty/unused harmony star reexport */
  20387. /***/ }),
  20388. /***/ "./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=style&index=0&id=239f642b&lang=scss&scoped=true":
  20389. /*!*************************************************************************************************************************!*\
  20390. !*** ./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=style&index=0&id=239f642b&lang=scss&scoped=true ***!
  20391. \*************************************************************************************************************************/
  20392. /*! no static exports found */
  20393. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20394. "use strict";
  20395. __webpack_require__.r(__webpack_exports__);
  20396. /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_select_scene_vue_vue_type_style_index_0_id_239f642b_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../../../node_modules/vue-style-loader??ref--9-oneOf-1-0!../../../../../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../../../../../node_modules/postcss-loader/src??ref--9-oneOf-1-2!../../../../../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../../../../node_modules/vue-loader-v16/dist??ref--1-1!./select-scene.vue?vue&type=style&index=0&id=239f642b&lang=scss&scoped=true */ "../../node_modules/vue-style-loader/index.js?!../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/sass-loader/dist/cjs.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=style&index=0&id=239f642b&lang=scss&scoped=true");
  20397. /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_select_scene_vue_vue_type_style_index_0_id_239f642b_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_select_scene_vue_vue_type_style_index_0_id_239f642b_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
  20398. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_select_scene_vue_vue_type_style_index_0_id_239f642b_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_vue_style_loader_index_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_select_scene_vue_vue_type_style_index_0_id_239f642b_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  20399. /***/ }),
  20400. /***/ "./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=style&index=1&id=239f642b&lang=css":
  20401. /*!************************************************************************************************************!*\
  20402. !*** ./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=style&index=1&id=239f642b&lang=css ***!
  20403. \************************************************************************************************************/
  20404. /*! no static exports found */
  20405. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20406. "use strict";
  20407. __webpack_require__.r(__webpack_exports__);
  20408. /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_select_scene_vue_vue_type_style_index_1_id_239f642b_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../../../node_modules/vue-style-loader??ref--7-oneOf-1-0!../../../../../../../../../node_modules/css-loader/dist/cjs.js??ref--7-oneOf-1-1!../../../../../../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../../../../../node_modules/postcss-loader/src??ref--7-oneOf-1-2!../../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../../../../node_modules/vue-loader-v16/dist??ref--1-1!./select-scene.vue?vue&type=style&index=1&id=239f642b&lang=css */ "../../node_modules/vue-style-loader/index.js?!../../node_modules/css-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=style&index=1&id=239f642b&lang=css");
  20409. /* harmony import */ var _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_select_scene_vue_vue_type_style_index_1_id_239f642b_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_select_scene_vue_vue_type_style_index_1_id_239f642b_lang_css__WEBPACK_IMPORTED_MODULE_0__);
  20410. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_select_scene_vue_vue_type_style_index_1_id_239f642b_lang_css__WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_7_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_select_scene_vue_vue_type_style_index_1_id_239f642b_lang_css__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  20411. /***/ }),
  20412. /***/ "./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=template&id=239f642b&scoped=true&ts=true":
  20413. /*!******************************************************************************************************************!*\
  20414. !*** ./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=template&id=239f642b&scoped=true&ts=true ***!
  20415. \******************************************************************************************************************/
  20416. /*! exports provided: render */
  20417. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20418. "use strict";
  20419. __webpack_require__.r(__webpack_exports__);
  20420. /* harmony import */ var _node_modules_cache_loader_dist_cjs_js_ref_14_0_node_modules_babel_loader_lib_index_js_node_modules_ts_loader_index_js_ref_14_2_node_modules_vue_loader_v16_dist_templateLoader_js_ref_7_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_select_scene_vue_vue_type_template_id_239f642b_scoped_true_ts_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../../../../../../node_modules/babel-loader/lib!../../../../../../../../../node_modules/ts-loader??ref--14-2!../../../../../../../../../node_modules/vue-loader-v16/dist/templateLoader.js??ref--7!../../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../../../../node_modules/vue-loader-v16/dist??ref--1-1!./select-scene.vue?vue&type=template&id=239f642b&scoped=true&ts=true */ "../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js?!../../node_modules/vue-loader-v16/dist/templateLoader.js?!../../node_modules/cache-loader/dist/cjs.js?!../../node_modules/vue-loader-v16/dist/index.js?!./src/app/program/views/sys/device/sync/select-scene.vue?vue&type=template&id=239f642b&scoped=true&ts=true");
  20421. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_cache_loader_dist_cjs_js_ref_14_0_node_modules_babel_loader_lib_index_js_node_modules_ts_loader_index_js_ref_14_2_node_modules_vue_loader_v16_dist_templateLoader_js_ref_7_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_select_scene_vue_vue_type_template_id_239f642b_scoped_true_ts_true__WEBPACK_IMPORTED_MODULE_0__["render"]; });
  20422. /***/ }),
  20423. /***/ "./src/app/program/views/sys/main-layout/hook.ts":
  20424. /*!*******************************************************!*\
  20425. !*** ./src/app/program/views/sys/main-layout/hook.ts ***!
  20426. \*******************************************************/
  20427. /*! exports provided: syncDevice, useSceneSync, cameraAuth, useCameraAuth */
  20428. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20429. "use strict";
  20430. __webpack_require__.r(__webpack_exports__);
  20431. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "syncDevice", function() { return syncDevice; });
  20432. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "useSceneSync", function() { return useSceneSync; });
  20433. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cameraAuth", function() { return cameraAuth; });
  20434. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "useCameraAuth", function() { return useCameraAuth; });
  20435. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "../../node_modules/vue/dist/vue.runtime.esm-bundler.js");
  20436. var syncDevice = Object(vue__WEBPACK_IMPORTED_MODULE_0__["ref"])(false);
  20437. var useSceneSync = function () {
  20438. syncDevice.value = true;
  20439. };
  20440. var cameraAuth = Object(vue__WEBPACK_IMPORTED_MODULE_0__["ref"])();
  20441. var useCameraAuth = function (cameraCode) {
  20442. cameraAuth.value = typeof cameraCode === 'string' ? cameraCode : true;
  20443. };
  20444. /***/ })
  20445. }]);
  20446. //# sourceMappingURL=26.js.map