| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107 |
- (window["webpackJsonp"] = window["webpackJsonp"] || []).push([[25],{
- /***/ "../../node_modules/@babel/runtime/helpers/asyncToGenerator.js":
- /*!**************************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
- \**************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- function asyncGeneratorStep(n, t, e, r, o, a, c) {
- try {
- var i = n[a](c),
- u = i.value;
- } catch (n) {
- return void e(n);
- }
- i.done ? t(u) : Promise.resolve(u).then(r, o);
- }
- function _asyncToGenerator(n) {
- return function () {
- var t = this,
- e = arguments;
- return new Promise(function (r, o) {
- var a = n.apply(t, e);
- function _next(n) {
- asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
- }
- function _throw(n) {
- asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
- }
- _next(void 0);
- });
- };
- }
- module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
- /***/ }),
- /***/ "../../node_modules/@babel/runtime/helpers/defineProperty.js":
- /*!************************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/@babel/runtime/helpers/defineProperty.js ***!
- \************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../../node_modules/@babel/runtime/helpers/toPropertyKey.js");
- function _defineProperty(e, r, t) {
- return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
- value: t,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[r] = t, e;
- }
- module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
- /***/ }),
- /***/ "../../node_modules/@babel/runtime/helpers/toPrimitive.js":
- /*!*********************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/@babel/runtime/helpers/toPrimitive.js ***!
- \*********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(/*! core-js/modules/es.error.cause.js */ "../../node_modules/core-js/modules/es.error.cause.js");
- var _typeof = __webpack_require__(/*! ./typeof.js */ "../../node_modules/@babel/runtime/helpers/typeof.js")["default"];
- function toPrimitive(t, r) {
- if ("object" != _typeof(t) || !t) return t;
- var e = t[Symbol.toPrimitive];
- if (void 0 !== e) {
- var i = e.call(t, r || "default");
- if ("object" != _typeof(i)) return i;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return ("string" === r ? String : Number)(t);
- }
- module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
- /***/ }),
- /***/ "../../node_modules/@babel/runtime/helpers/toPropertyKey.js":
- /*!***********************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
- \***********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- var _typeof = __webpack_require__(/*! ./typeof.js */ "../../node_modules/@babel/runtime/helpers/typeof.js")["default"];
- var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../../node_modules/@babel/runtime/helpers/toPrimitive.js");
- function toPropertyKey(t) {
- var i = toPrimitive(t, "string");
- return "symbol" == _typeof(i) ? i : i + "";
- }
- module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
- /***/ }),
- /***/ "../../node_modules/canvg/lib/index.es.js":
- /*!*****************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/canvg/lib/index.es.js ***!
- \*****************************************************************/
- /*! exports provided: AElement, AnimateColorElement, AnimateElement, AnimateTransformElement, BoundingBox, CB1, CB2, CB3, CB4, Canvg, CircleElement, ClipPathElement, DefsElement, DescElement, Document, Element, EllipseElement, FeColorMatrixElement, FeCompositeElement, FeDropShadowElement, FeGaussianBlurElement, FeMorphologyElement, FilterElement, Font, FontElement, FontFaceElement, GElement, GlyphElement, GradientElement, ImageElement, LineElement, LinearGradientElement, MarkerElement, MaskElement, Matrix, MissingGlyphElement, Mouse, PSEUDO_ZERO, Parser, PathElement, PathParser, PatternElement, Point, PolygonElement, PolylineElement, Property, QB1, QB2, QB3, RadialGradientElement, RectElement, RenderedElement, Rotate, SVGElement, SVGFontLoader, Scale, Screen, Skew, SkewX, SkewY, StopElement, StyleElement, SymbolElement, TRefElement, TSpanElement, TextElement, TextPathElement, TitleElement, Transform, Translate, UnknownElement, UseElement, ViewPort, compressSpaces, default, getSelectorSpecificity, normalizeAttributeName, normalizeColor, parseExternalUrl, presets, toNumbers, trimLeft, trimRight, vectorMagnitude, vectorsAngle, vectorsRatio */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AElement", function() { return AElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimateColorElement", function() { return AnimateColorElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimateElement", function() { return AnimateElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimateTransformElement", function() { return AnimateTransformElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BoundingBox", function() { return BoundingBox; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CB1", function() { return CB1; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CB2", function() { return CB2; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CB3", function() { return CB3; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CB4", function() { return CB4; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Canvg", function() { return Canvg; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CircleElement", function() { return CircleElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClipPathElement", function() { return ClipPathElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefsElement", function() { return DefsElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DescElement", function() { return DescElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Document", function() { return Document; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Element", function() { return Element; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EllipseElement", function() { return EllipseElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeColorMatrixElement", function() { return FeColorMatrixElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeCompositeElement", function() { return FeCompositeElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeDropShadowElement", function() { return FeDropShadowElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeGaussianBlurElement", function() { return FeGaussianBlurElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeMorphologyElement", function() { return FeMorphologyElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FilterElement", function() { return FilterElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Font", function() { return Font; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FontElement", function() { return FontElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FontFaceElement", function() { return FontFaceElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GElement", function() { return GElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GlyphElement", function() { return GlyphElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GradientElement", function() { return GradientElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ImageElement", function() { return ImageElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LineElement", function() { return LineElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinearGradientElement", function() { return LinearGradientElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerElement", function() { return MarkerElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MaskElement", function() { return MaskElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Matrix", function() { return Matrix; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MissingGlyphElement", function() { return MissingGlyphElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Mouse", function() { return Mouse; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PSEUDO_ZERO", function() { return PSEUDO_ZERO; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Parser", function() { return Parser; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PathElement", function() { return PathElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PathParser", function() { return PathParser; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PatternElement", function() { return PatternElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Point", function() { return Point; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PolygonElement", function() { return PolygonElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PolylineElement", function() { return PolylineElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Property", function() { return Property; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QB1", function() { return QB1; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QB2", function() { return QB2; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QB3", function() { return QB3; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RadialGradientElement", function() { return RadialGradientElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RectElement", function() { return RectElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderedElement", function() { return RenderedElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Rotate", function() { return Rotate; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SVGElement", function() { return SVGElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SVGFontLoader", function() { return SVGFontLoader; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Scale", function() { return Scale; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Screen", function() { return Screen; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Skew", function() { return Skew; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SkewX", function() { return SkewX; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SkewY", function() { return SkewY; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StopElement", function() { return StopElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StyleElement", function() { return StyleElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolElement", function() { return SymbolElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TRefElement", function() { return TRefElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TSpanElement", function() { return TSpanElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextElement", function() { return TextElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextPathElement", function() { return TextPathElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TitleElement", function() { return TitleElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Transform", function() { return Transform; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Translate", function() { return Translate; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UnknownElement", function() { return UnknownElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UseElement", function() { return UseElement; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewPort", function() { return ViewPort; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compressSpaces", function() { return compressSpaces; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Canvg; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSelectorSpecificity", function() { return getSelectorSpecificity; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeAttributeName", function() { return normalizeAttributeName; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeColor", function() { return normalizeColor; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseExternalUrl", function() { return parseExternalUrl; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "presets", function() { return index; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toNumbers", function() { return toNumbers; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "trimLeft", function() { return trimLeft; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "trimRight", function() { return trimRight; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "vectorMagnitude", function() { return vectorMagnitude; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "vectorsAngle", function() { return vectorsAngle; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "vectorsRatio", function() { return vectorsRatio; });
- /* harmony import */ var core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.promise.js */ "../../node_modules/core-js/modules/es.promise.js");
- /* harmony import */ var core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_promise_js__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../../node_modules/@babel/runtime/helpers/asyncToGenerator.js");
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.match.js */ "../../node_modules/core-js/modules/es.string.match.js");
- /* harmony import */ var core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.replace.js */ "../../node_modules/core-js/modules/es.string.replace.js");
- /* harmony import */ var core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var core_js_modules_es_string_starts_with_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.string.starts-with.js */ "../../node_modules/core-js/modules/es.string.starts-with.js");
- /* harmony import */ var core_js_modules_es_string_starts_with_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_starts_with_js__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "../../node_modules/core-js/modules/es.array.iterator.js");
- /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_5__);
- /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "../../node_modules/core-js/modules/web.dom-collections.iterator.js");
- /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_6__);
- /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../../node_modules/@babel/runtime/helpers/defineProperty.js");
- /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7__);
- /* harmony import */ var core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.array.reduce.js */ "../../node_modules/core-js/modules/es.array.reduce.js");
- /* harmony import */ var core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_8__);
- /* harmony import */ var core_js_modules_es_string_ends_with_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.string.ends-with.js */ "../../node_modules/core-js/modules/es.string.ends-with.js");
- /* harmony import */ var core_js_modules_es_string_ends_with_js__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_ends_with_js__WEBPACK_IMPORTED_MODULE_9__);
- /* harmony import */ var core_js_modules_es_string_split_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.string.split.js */ "../../node_modules/core-js/modules/es.string.split.js");
- /* harmony import */ var core_js_modules_es_string_split_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_split_js__WEBPACK_IMPORTED_MODULE_10__);
- /* harmony import */ var raf__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! raf */ "../../node_modules/raf/index.js");
- /* harmony import */ var raf__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(raf__WEBPACK_IMPORTED_MODULE_11__);
- /* harmony import */ var core_js_modules_es_string_trim_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.string.trim.js */ "../../node_modules/core-js/modules/es.string.trim.js");
- /* harmony import */ var core_js_modules_es_string_trim_js__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_trim_js__WEBPACK_IMPORTED_MODULE_12__);
- /* harmony import */ var rgbcolor__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! rgbcolor */ "../../node_modules/rgbcolor/index.js");
- /* harmony import */ var rgbcolor__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(rgbcolor__WEBPACK_IMPORTED_MODULE_13__);
- /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "../../node_modules/core-js/modules/es.array.index-of.js");
- /* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_14__);
- /* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.string.includes.js */ "../../node_modules/core-js/modules/es.string.includes.js");
- /* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_15__);
- /* harmony import */ var core_js_modules_es_array_reverse_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.array.reverse.js */ "../../node_modules/core-js/modules/es.array.reverse.js");
- /* harmony import */ var core_js_modules_es_array_reverse_js__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_reverse_js__WEBPACK_IMPORTED_MODULE_16__);
- /* harmony import */ var svg_pathdata__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! svg-pathdata */ "../../node_modules/svg-pathdata/lib/SVGPathData.module.js");
- /* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ "../../node_modules/core-js/modules/es.regexp.to-string.js");
- /* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_18__);
- /* harmony import */ var stackblur_canvas__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! stackblur-canvas */ "../../node_modules/stackblur-canvas/dist/stackblur-es.js");
- /**
- * Options preset for `OffscreenCanvas`.
- * @param config - Preset requirements.
- * @param config.DOMParser - XML/HTML parser from string into DOM Document.
- * @returns Preset object.
- */
- function offscreen() {
- var {
- DOMParser: DOMParserFallback
- } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var preset = {
- window: null,
- ignoreAnimation: true,
- ignoreMouse: true,
- DOMParser: DOMParserFallback,
- createCanvas(width, height) {
- return new OffscreenCanvas(width, height);
- },
- createImage(url) {
- return _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(function* () {
- var response = yield fetch(url);
- var blob = yield response.blob();
- var img = yield createImageBitmap(blob);
- return img;
- })();
- }
- };
- if (typeof DOMParser !== 'undefined' || typeof DOMParserFallback === 'undefined') {
- Reflect.deleteProperty(preset, 'DOMParser');
- }
- return preset;
- }
- /**
- * Options preset for `node-canvas`.
- * @param config - Preset requirements.
- * @param config.DOMParser - XML/HTML parser from string into DOM Document.
- * @param config.canvas - `node-canvas` exports.
- * @param config.fetch - WHATWG-compatible `fetch` function.
- * @returns Preset object.
- */
- function node(_ref) {
- var {
- DOMParser,
- canvas,
- fetch
- } = _ref;
- return {
- window: null,
- ignoreAnimation: true,
- ignoreMouse: true,
- DOMParser,
- fetch,
- createCanvas: canvas.createCanvas,
- createImage: canvas.loadImage
- };
- }
- var index = /*#__PURE__*/Object.freeze({
- __proto__: null,
- offscreen: offscreen,
- node: node
- });
- /**
- * HTML-safe compress white-spaces.
- * @param str - String to compress.
- * @returns String.
- */
- function compressSpaces(str) {
- return str.replace(/(?!\u3000)\s+/gm, ' ');
- }
- /**
- * HTML-safe left trim.
- * @param str - String to trim.
- * @returns String.
- */
- function trimLeft(str) {
- return str.replace(/^[\n \t]+/, '');
- }
- /**
- * HTML-safe right trim.
- * @param str - String to trim.
- * @returns String.
- */
- function trimRight(str) {
- return str.replace(/[\n \t]+$/, '');
- }
- /**
- * String to numbers array.
- * @param str - Numbers string.
- * @returns Numbers array.
- */
- function toNumbers(str) {
- var matches = (str || '').match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm) || [];
- return matches.map(parseFloat);
- } // Microsoft Edge fix
- var allUppercase = /^[A-Z-]+$/;
- /**
- * Normalize attribute name.
- * @param name - Attribute name.
- * @returns Normalized attribute name.
- */
- function normalizeAttributeName(name) {
- if (allUppercase.test(name)) {
- return name.toLowerCase();
- }
- return name;
- }
- /**
- * Parse external URL.
- * @param url - CSS url string.
- * @returns Parsed URL.
- */
- function parseExternalUrl(url) {
- // single quotes [2]
- // v double quotes [3]
- // v v no quotes [4]
- // v v v
- var urlMatch = /url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(url) || [];
- return urlMatch[2] || urlMatch[3] || urlMatch[4];
- }
- /**
- * Transform floats to integers in rgb colors.
- * @param color - Color to normalize.
- * @returns Normalized color.
- */
- function normalizeColor(color) {
- if (!color.startsWith('rgb')) {
- return color;
- }
- var rgbParts = 3;
- var normalizedColor = color.replace(/\d+(\.\d+)?/g, (num, isFloat) => rgbParts-- && isFloat ? String(Math.round(parseFloat(num))) : num);
- return normalizedColor;
- }
- // slightly modified version of https://github.com/keeganstreet/specificity/blob/master/specificity.js
- var attributeRegex = /(\[[^\]]+\])/g;
- var idRegex = /(#[^\s+>~.[:]+)/g;
- var classRegex = /(\.[^\s+>~.[:]+)/g;
- var pseudoElementRegex = /(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi;
- var pseudoClassWithBracketsRegex = /(:[\w-]+\([^)]*\))/gi;
- var pseudoClassRegex = /(:[^\s+>~.[:]+)/g;
- var elementRegex = /([^\s+>~.[:]+)/g;
- function findSelectorMatch(selector, regex) {
- var matches = regex.exec(selector);
- if (!matches) {
- return [selector, 0];
- }
- return [selector.replace(regex, ' '), matches.length];
- }
- /**
- * Measure selector specificity.
- * @param selector - Selector to measure.
- * @returns Specificity.
- */
- function getSelectorSpecificity(selector) {
- var specificity = [0, 0, 0];
- var currentSelector = selector.replace(/:not\(([^)]*)\)/g, ' $1 ').replace(/{[\s\S]*/gm, ' ');
- var delta = 0;
- [currentSelector, delta] = findSelectorMatch(currentSelector, attributeRegex);
- specificity[1] += delta;
- [currentSelector, delta] = findSelectorMatch(currentSelector, idRegex);
- specificity[0] += delta;
- [currentSelector, delta] = findSelectorMatch(currentSelector, classRegex);
- specificity[1] += delta;
- [currentSelector, delta] = findSelectorMatch(currentSelector, pseudoElementRegex);
- specificity[2] += delta;
- [currentSelector, delta] = findSelectorMatch(currentSelector, pseudoClassWithBracketsRegex);
- specificity[1] += delta;
- [currentSelector, delta] = findSelectorMatch(currentSelector, pseudoClassRegex);
- specificity[1] += delta;
- currentSelector = currentSelector.replace(/[*\s+>~]/g, ' ').replace(/[#.]/g, ' ');
- [currentSelector, delta] = findSelectorMatch(currentSelector, elementRegex); // lgtm [js/useless-assignment-to-local]
- specificity[2] += delta;
- return specificity.join('');
- }
- var PSEUDO_ZERO = .00000001;
- /**
- * Vector magnitude.
- * @param v
- * @returns Number result.
- */
- function vectorMagnitude(v) {
- return Math.sqrt(Math.pow(v[0], 2) + Math.pow(v[1], 2));
- }
- /**
- * Ratio between two vectors.
- * @param u
- * @param v
- * @returns Number result.
- */
- function vectorsRatio(u, v) {
- return (u[0] * v[0] + u[1] * v[1]) / (vectorMagnitude(u) * vectorMagnitude(v));
- }
- /**
- * Angle between two vectors.
- * @param u
- * @param v
- * @returns Number result.
- */
- function vectorsAngle(u, v) {
- return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vectorsRatio(u, v));
- }
- function CB1(t) {
- return t * t * t;
- }
- function CB2(t) {
- return 3 * t * t * (1 - t);
- }
- function CB3(t) {
- return 3 * t * (1 - t) * (1 - t);
- }
- function CB4(t) {
- return (1 - t) * (1 - t) * (1 - t);
- }
- function QB1(t) {
- return t * t;
- }
- function QB2(t) {
- return 2 * t * (1 - t);
- }
- function QB3(t) {
- return (1 - t) * (1 - t);
- }
- class Property {
- constructor(document, name, value) {
- this.document = document;
- this.name = name;
- this.value = value;
- this.isNormalizedColor = false;
- }
- static empty(document) {
- return new Property(document, 'EMPTY', '');
- }
- split() {
- var separator = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ' ';
- var {
- document,
- name
- } = this;
- return compressSpaces(this.getString()).trim().split(separator).map(value => new Property(document, name, value));
- }
- hasValue(zeroIsValue) {
- var {
- value
- } = this;
- return value !== null && value !== '' && (zeroIsValue || value !== 0) && typeof value !== 'undefined';
- }
- isString(regexp) {
- var {
- value
- } = this;
- var result = typeof value === 'string';
- if (!result || !regexp) {
- return result;
- }
- return regexp.test(value);
- }
- isUrlDefinition() {
- return this.isString(/^url\(/);
- }
- isPixels() {
- if (!this.hasValue()) {
- return false;
- }
- var asString = this.getString();
- switch (true) {
- case asString.endsWith('px'):
- case /^[0-9]+$/.test(asString):
- return true;
- default:
- return false;
- }
- }
- setValue(value) {
- this.value = value;
- return this;
- }
- getValue(def) {
- if (typeof def === 'undefined' || this.hasValue()) {
- return this.value;
- }
- return def;
- }
- getNumber(def) {
- if (!this.hasValue()) {
- if (typeof def === 'undefined') {
- return 0;
- }
- return parseFloat(def);
- }
- var {
- value
- } = this;
- var n = parseFloat(value);
- if (this.isString(/%$/)) {
- n /= 100.0;
- }
- return n;
- }
- getString(def) {
- if (typeof def === 'undefined' || this.hasValue()) {
- return typeof this.value === 'undefined' ? '' : String(this.value);
- }
- return String(def);
- }
- getColor(def) {
- var color = this.getString(def);
- if (this.isNormalizedColor) {
- return color;
- }
- this.isNormalizedColor = true;
- color = normalizeColor(color);
- this.value = color;
- return color;
- }
- getDpi() {
- return 96.0; // TODO: compute?
- }
- getRem() {
- return this.document.rootEmSize;
- }
- getEm() {
- return this.document.emSize;
- }
- getUnits() {
- return this.getString().replace(/[0-9.-]/g, '');
- }
- getPixels(axisOrIsFontSize) {
- var processPercent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- if (!this.hasValue()) {
- return 0;
- }
- var [axis, isFontSize] = typeof axisOrIsFontSize === 'boolean' ? [undefined, axisOrIsFontSize] : [axisOrIsFontSize];
- var {
- viewPort
- } = this.document.screen;
- switch (true) {
- case this.isString(/vmin$/):
- return this.getNumber() / 100.0 * Math.min(viewPort.computeSize('x'), viewPort.computeSize('y'));
- case this.isString(/vmax$/):
- return this.getNumber() / 100.0 * Math.max(viewPort.computeSize('x'), viewPort.computeSize('y'));
- case this.isString(/vw$/):
- return this.getNumber() / 100.0 * viewPort.computeSize('x');
- case this.isString(/vh$/):
- return this.getNumber() / 100.0 * viewPort.computeSize('y');
- case this.isString(/rem$/):
- return this.getNumber() * this.getRem();
- case this.isString(/em$/):
- return this.getNumber() * this.getEm();
- case this.isString(/ex$/):
- return this.getNumber() * this.getEm() / 2.0;
- case this.isString(/px$/):
- return this.getNumber();
- case this.isString(/pt$/):
- return this.getNumber() * this.getDpi() * (1.0 / 72.0);
- case this.isString(/pc$/):
- return this.getNumber() * 15;
- case this.isString(/cm$/):
- return this.getNumber() * this.getDpi() / 2.54;
- case this.isString(/mm$/):
- return this.getNumber() * this.getDpi() / 25.4;
- case this.isString(/in$/):
- return this.getNumber() * this.getDpi();
- case this.isString(/%$/) && isFontSize:
- return this.getNumber() * this.getEm();
- case this.isString(/%$/):
- return this.getNumber() * viewPort.computeSize(axis);
- default:
- {
- var n = this.getNumber();
- if (processPercent && n < 1.0) {
- return n * viewPort.computeSize(axis);
- }
- return n;
- }
- }
- }
- getMilliseconds() {
- if (!this.hasValue()) {
- return 0;
- }
- if (this.isString(/ms$/)) {
- return this.getNumber();
- }
- return this.getNumber() * 1000;
- }
- getRadians() {
- if (!this.hasValue()) {
- return 0;
- }
- switch (true) {
- case this.isString(/deg$/):
- return this.getNumber() * (Math.PI / 180.0);
- case this.isString(/grad$/):
- return this.getNumber() * (Math.PI / 200.0);
- case this.isString(/rad$/):
- return this.getNumber();
- default:
- return this.getNumber() * (Math.PI / 180.0);
- }
- }
- getDefinition() {
- var asString = this.getString();
- var name = /#([^)'"]+)/.exec(asString);
- if (name) {
- name = name[1];
- }
- if (!name) {
- name = asString;
- }
- return this.document.definitions[name];
- }
- getFillStyleDefinition(element, opacity) {
- var def = this.getDefinition();
- if (!def) {
- return null;
- } // gradient
- if (typeof def.createGradient === 'function') {
- return def.createGradient(this.document.ctx, element, opacity);
- } // pattern
- if (typeof def.createPattern === 'function') {
- if (def.getHrefAttribute().hasValue()) {
- var patternTransform = def.getAttribute('patternTransform');
- def = def.getHrefAttribute().getDefinition();
- if (patternTransform.hasValue()) {
- def.getAttribute('patternTransform', true).setValue(patternTransform.value);
- }
- }
- return def.createPattern(this.document.ctx, element, opacity);
- }
- return null;
- }
- getTextBaseline() {
- if (!this.hasValue()) {
- return null;
- }
- return Property.textBaselineMapping[this.getString()];
- }
- addOpacity(opacity) {
- var value = this.getColor();
- var len = value.length;
- var commas = 0; // Simulate old RGBColor version, which can't parse rgba.
- for (var i = 0; i < len; i++) {
- if (value[i] === ',') {
- commas++;
- }
- if (commas === 3) {
- break;
- }
- }
- if (opacity.hasValue() && this.isString() && commas !== 3) {
- var color = new rgbcolor__WEBPACK_IMPORTED_MODULE_13___default.a(value);
- if (color.ok) {
- color.alpha = opacity.getNumber();
- value = color.toRGBA();
- }
- }
- return new Property(this.document, this.name, value);
- }
- }
- Property.textBaselineMapping = {
- 'baseline': 'alphabetic',
- 'before-edge': 'top',
- 'text-before-edge': 'top',
- 'middle': 'middle',
- 'central': 'middle',
- 'after-edge': 'bottom',
- 'text-after-edge': 'bottom',
- 'ideographic': 'ideographic',
- 'alphabetic': 'alphabetic',
- 'hanging': 'hanging',
- 'mathematical': 'alphabetic'
- };
- class ViewPort {
- constructor() {
- this.viewPorts = [];
- }
- clear() {
- this.viewPorts = [];
- }
- setCurrent(width, height) {
- this.viewPorts.push({
- width,
- height
- });
- }
- removeCurrent() {
- this.viewPorts.pop();
- }
- getCurrent() {
- var {
- viewPorts
- } = this;
- return viewPorts[viewPorts.length - 1];
- }
- get width() {
- return this.getCurrent().width;
- }
- get height() {
- return this.getCurrent().height;
- }
- computeSize(d) {
- if (typeof d === 'number') {
- return d;
- }
- if (d === 'x') {
- return this.width;
- }
- if (d === 'y') {
- return this.height;
- }
- return Math.sqrt(Math.pow(this.width, 2) + Math.pow(this.height, 2)) / Math.sqrt(2);
- }
- }
- class Point {
- constructor(x, y) {
- this.x = x;
- this.y = y;
- }
- static parse(point) {
- var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
- var [x = defaultValue, y = defaultValue] = toNumbers(point);
- return new Point(x, y);
- }
- static parseScale(scale) {
- var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
- var [x = defaultValue, y = x] = toNumbers(scale);
- return new Point(x, y);
- }
- static parsePath(path) {
- var points = toNumbers(path);
- var len = points.length;
- var pathPoints = [];
- for (var i = 0; i < len; i += 2) {
- pathPoints.push(new Point(points[i], points[i + 1]));
- }
- return pathPoints;
- }
- angleTo(point) {
- return Math.atan2(point.y - this.y, point.x - this.x);
- }
- applyTransform(transform) {
- var {
- x,
- y
- } = this;
- var xp = x * transform[0] + y * transform[2] + transform[4];
- var yp = x * transform[1] + y * transform[3] + transform[5];
- this.x = xp;
- this.y = yp;
- }
- }
- class Mouse {
- constructor(screen) {
- this.screen = screen;
- this.working = false;
- this.events = [];
- this.eventElements = []; // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
- this.onClick = this.onClick.bind(this); // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
- this.onMouseMove = this.onMouseMove.bind(this);
- }
- isWorking() {
- return this.working;
- }
- start() {
- if (this.working) {
- return;
- }
- var {
- screen,
- onClick,
- onMouseMove
- } = this;
- var canvas = screen.ctx.canvas;
- canvas.onclick = onClick;
- canvas.onmousemove = onMouseMove;
- this.working = true;
- }
- stop() {
- if (!this.working) {
- return;
- }
- var canvas = this.screen.ctx.canvas;
- this.working = false;
- canvas.onclick = null;
- canvas.onmousemove = null;
- }
- hasEvents() {
- return this.working && this.events.length > 0;
- }
- runEvents() {
- if (!this.working) {
- return;
- }
- var {
- screen: document,
- events,
- eventElements
- } = this;
- var {
- style
- } = document.ctx.canvas;
- if (style) {
- style.cursor = '';
- }
- events.forEach((_ref, i) => {
- var {
- run
- } = _ref;
- var element = eventElements[i];
- while (element) {
- run(element);
- element = element.parent;
- }
- }); // done running, clear
- this.events = [];
- this.eventElements = [];
- }
- checkPath(element, ctx) {
- if (!this.working || !ctx) {
- return;
- }
- var {
- events,
- eventElements
- } = this;
- events.forEach((_ref2, i) => {
- var {
- x,
- y
- } = _ref2;
- if (!eventElements[i] && ctx.isPointInPath && ctx.isPointInPath(x, y)) {
- eventElements[i] = element;
- }
- });
- }
- checkBoundingBox(element, boundingBox) {
- if (!this.working || !boundingBox) {
- return;
- }
- var {
- events,
- eventElements
- } = this;
- events.forEach((_ref3, i) => {
- var {
- x,
- y
- } = _ref3;
- if (!eventElements[i] && boundingBox.isPointInBox(x, y)) {
- eventElements[i] = element;
- }
- });
- }
- mapXY(x, y) {
- var {
- window,
- ctx
- } = this.screen;
- var point = new Point(x, y);
- var element = ctx.canvas;
- while (element) {
- point.x -= element.offsetLeft;
- point.y -= element.offsetTop;
- element = element.offsetParent;
- }
- if (window.scrollX) {
- point.x += window.scrollX;
- }
- if (window.scrollY) {
- point.y += window.scrollY;
- }
- return point;
- }
- onClick(event) {
- var {
- x,
- y
- } = this.mapXY(event.clientX, event.clientY);
- this.events.push({
- type: 'onclick',
- x,
- y,
- run(eventTarget) {
- if (eventTarget.onClick) {
- eventTarget.onClick();
- }
- }
- });
- }
- onMouseMove(event) {
- var {
- x,
- y
- } = this.mapXY(event.clientX, event.clientY);
- this.events.push({
- type: 'onmousemove',
- x,
- y,
- run(eventTarget) {
- if (eventTarget.onMouseMove) {
- eventTarget.onMouseMove();
- }
- }
- });
- }
- }
- var defaultWindow = typeof window !== 'undefined' ? window : null;
- var defaultFetch$1 = typeof fetch !== 'undefined' ? fetch.bind(undefined) // `fetch` depends on context: `someObject.fetch(...)` will throw error.
- : null;
- class Screen {
- constructor(ctx) {
- var {
- fetch = defaultFetch$1,
- window = defaultWindow
- } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- this.ctx = ctx;
- this.FRAMERATE = 30;
- this.MAX_VIRTUAL_PIXELS = 30000;
- this.CLIENT_WIDTH = 800;
- this.CLIENT_HEIGHT = 600;
- this.viewPort = new ViewPort();
- this.mouse = new Mouse(this);
- this.animations = [];
- this.waits = [];
- this.frameDuration = 0;
- this.isReadyLock = false;
- this.isFirstRender = true;
- this.intervalId = null;
- this.window = window;
- this.fetch = fetch;
- }
- wait(checker) {
- this.waits.push(checker);
- }
- ready() {
- // eslint-disable-next-line @typescript-eslint/no-misused-promises
- if (!this.readyPromise) {
- return Promise.resolve();
- }
- return this.readyPromise;
- }
- isReady() {
- if (this.isReadyLock) {
- return true;
- }
- var isReadyLock = this.waits.every(_ => _());
- if (isReadyLock) {
- this.waits = [];
- if (this.resolveReady) {
- this.resolveReady();
- }
- }
- this.isReadyLock = isReadyLock;
- return isReadyLock;
- }
- setDefaults(ctx) {
- // initial values and defaults
- ctx.strokeStyle = 'rgba(0,0,0,0)';
- ctx.lineCap = 'butt';
- ctx.lineJoin = 'miter';
- ctx.miterLimit = 4;
- }
- setViewBox(_ref) {
- var {
- document,
- ctx,
- aspectRatio,
- width,
- desiredWidth,
- height,
- desiredHeight,
- minX = 0,
- minY = 0,
- refX,
- refY,
- clip = false,
- clipX = 0,
- clipY = 0
- } = _ref;
- // aspect ratio - http://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute
- var cleanAspectRatio = compressSpaces(aspectRatio).replace(/^defer\s/, ''); // ignore defer
- var [aspectRatioAlign, aspectRatioMeetOrSlice] = cleanAspectRatio.split(' ');
- var align = aspectRatioAlign || 'xMidYMid';
- var meetOrSlice = aspectRatioMeetOrSlice || 'meet'; // calculate scale
- var scaleX = width / desiredWidth;
- var scaleY = height / desiredHeight;
- var scaleMin = Math.min(scaleX, scaleY);
- var scaleMax = Math.max(scaleX, scaleY);
- var finalDesiredWidth = desiredWidth;
- var finalDesiredHeight = desiredHeight;
- if (meetOrSlice === 'meet') {
- finalDesiredWidth *= scaleMin;
- finalDesiredHeight *= scaleMin;
- }
- if (meetOrSlice === 'slice') {
- finalDesiredWidth *= scaleMax;
- finalDesiredHeight *= scaleMax;
- }
- var refXProp = new Property(document, 'refX', refX);
- var refYProp = new Property(document, 'refY', refY);
- var hasRefs = refXProp.hasValue() && refYProp.hasValue();
- if (hasRefs) {
- ctx.translate(-scaleMin * refXProp.getPixels('x'), -scaleMin * refYProp.getPixels('y'));
- }
- if (clip) {
- var scaledClipX = scaleMin * clipX;
- var scaledClipY = scaleMin * clipY;
- ctx.beginPath();
- ctx.moveTo(scaledClipX, scaledClipY);
- ctx.lineTo(width, scaledClipY);
- ctx.lineTo(width, height);
- ctx.lineTo(scaledClipX, height);
- ctx.closePath();
- ctx.clip();
- }
- if (!hasRefs) {
- var isMeetMinY = meetOrSlice === 'meet' && scaleMin === scaleY;
- var isSliceMaxY = meetOrSlice === 'slice' && scaleMax === scaleY;
- var isMeetMinX = meetOrSlice === 'meet' && scaleMin === scaleX;
- var isSliceMaxX = meetOrSlice === 'slice' && scaleMax === scaleX;
- if (align.startsWith('xMid') && (isMeetMinY || isSliceMaxY)) {
- ctx.translate(width / 2.0 - finalDesiredWidth / 2.0, 0);
- }
- if (align.endsWith('YMid') && (isMeetMinX || isSliceMaxX)) {
- ctx.translate(0, height / 2.0 - finalDesiredHeight / 2.0);
- }
- if (align.startsWith('xMax') && (isMeetMinY || isSliceMaxY)) {
- ctx.translate(width - finalDesiredWidth, 0);
- }
- if (align.endsWith('YMax') && (isMeetMinX || isSliceMaxX)) {
- ctx.translate(0, height - finalDesiredHeight);
- }
- } // scale
- switch (true) {
- case align === 'none':
- ctx.scale(scaleX, scaleY);
- break;
- case meetOrSlice === 'meet':
- ctx.scale(scaleMin, scaleMin);
- break;
- case meetOrSlice === 'slice':
- ctx.scale(scaleMax, scaleMax);
- break;
- } // translate
- ctx.translate(-minX, -minY);
- }
- start(element) {
- var {
- enableRedraw = false,
- ignoreMouse = false,
- ignoreAnimation = false,
- ignoreDimensions = false,
- ignoreClear = false,
- forceRedraw,
- scaleWidth,
- scaleHeight,
- offsetX,
- offsetY
- } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var {
- FRAMERATE,
- mouse
- } = this;
- var frameDuration = 1000 / FRAMERATE;
- this.frameDuration = frameDuration;
- this.readyPromise = new Promise(resolve => {
- this.resolveReady = resolve;
- });
- if (this.isReady()) {
- this.render(element, ignoreDimensions, ignoreClear, scaleWidth, scaleHeight, offsetX, offsetY);
- }
- if (!enableRedraw) {
- return;
- }
- var now = Date.now();
- var then = now;
- var delta = 0;
- var tick = () => {
- now = Date.now();
- delta = now - then;
- if (delta >= frameDuration) {
- then = now - delta % frameDuration;
- if (this.shouldUpdate(ignoreAnimation, forceRedraw)) {
- this.render(element, ignoreDimensions, ignoreClear, scaleWidth, scaleHeight, offsetX, offsetY);
- mouse.runEvents();
- }
- }
- this.intervalId = raf__WEBPACK_IMPORTED_MODULE_11___default()(tick);
- };
- if (!ignoreMouse) {
- mouse.start();
- }
- this.intervalId = raf__WEBPACK_IMPORTED_MODULE_11___default()(tick);
- }
- stop() {
- if (this.intervalId) {
- raf__WEBPACK_IMPORTED_MODULE_11___default.a.cancel(this.intervalId);
- this.intervalId = null;
- }
- this.mouse.stop();
- }
- shouldUpdate(ignoreAnimation, forceRedraw) {
- // need update from animations?
- if (!ignoreAnimation) {
- var {
- frameDuration
- } = this;
- var shouldUpdate = this.animations.reduce((shouldUpdate, animation) => animation.update(frameDuration) || shouldUpdate, false);
- if (shouldUpdate) {
- return true;
- }
- } // need update from redraw?
- if (typeof forceRedraw === 'function' && forceRedraw()) {
- return true;
- }
- if (!this.isReadyLock && this.isReady()) {
- return true;
- } // need update from mouse events?
- if (this.mouse.hasEvents()) {
- return true;
- }
- return false;
- }
- render(element, ignoreDimensions, ignoreClear, scaleWidth, scaleHeight, offsetX, offsetY) {
- var {
- CLIENT_WIDTH,
- CLIENT_HEIGHT,
- viewPort,
- ctx,
- isFirstRender
- } = this;
- var canvas = ctx.canvas;
- viewPort.clear();
- if (canvas.width && canvas.height) {
- viewPort.setCurrent(canvas.width, canvas.height);
- } else {
- viewPort.setCurrent(CLIENT_WIDTH, CLIENT_HEIGHT);
- }
- var widthStyle = element.getStyle('width');
- var heightStyle = element.getStyle('height');
- if (!ignoreDimensions && (isFirstRender || typeof scaleWidth !== 'number' && typeof scaleHeight !== 'number')) {
- // set canvas size
- if (widthStyle.hasValue()) {
- canvas.width = widthStyle.getPixels('x');
- if (canvas.style) {
- canvas.style.width = "".concat(canvas.width, "px");
- }
- }
- if (heightStyle.hasValue()) {
- canvas.height = heightStyle.getPixels('y');
- if (canvas.style) {
- canvas.style.height = "".concat(canvas.height, "px");
- }
- }
- }
- var cWidth = canvas.clientWidth || canvas.width;
- var cHeight = canvas.clientHeight || canvas.height;
- if (ignoreDimensions && widthStyle.hasValue() && heightStyle.hasValue()) {
- cWidth = widthStyle.getPixels('x');
- cHeight = heightStyle.getPixels('y');
- }
- viewPort.setCurrent(cWidth, cHeight);
- if (typeof offsetX === 'number') {
- element.getAttribute('x', true).setValue(offsetX);
- }
- if (typeof offsetY === 'number') {
- element.getAttribute('y', true).setValue(offsetY);
- }
- if (typeof scaleWidth === 'number' || typeof scaleHeight === 'number') {
- var viewBox = toNumbers(element.getAttribute('viewBox').getString());
- var xRatio = 0;
- var yRatio = 0;
- if (typeof scaleWidth === 'number') {
- var _widthStyle = element.getStyle('width');
- if (_widthStyle.hasValue()) {
- xRatio = _widthStyle.getPixels('x') / scaleWidth;
- } else if (!isNaN(viewBox[2])) {
- xRatio = viewBox[2] / scaleWidth;
- }
- }
- if (typeof scaleHeight === 'number') {
- var _heightStyle = element.getStyle('height');
- if (_heightStyle.hasValue()) {
- yRatio = _heightStyle.getPixels('y') / scaleHeight;
- } else if (!isNaN(viewBox[3])) {
- yRatio = viewBox[3] / scaleHeight;
- }
- }
- if (!xRatio) {
- xRatio = yRatio;
- }
- if (!yRatio) {
- yRatio = xRatio;
- }
- element.getAttribute('width', true).setValue(scaleWidth);
- element.getAttribute('height', true).setValue(scaleHeight);
- var transformStyle = element.getStyle('transform', true, true);
- transformStyle.setValue("".concat(transformStyle.getString(), " scale(").concat(1.0 / xRatio, ", ").concat(1.0 / yRatio, ")"));
- } // clear and render
- if (!ignoreClear) {
- ctx.clearRect(0, 0, cWidth, cHeight);
- }
- element.render(ctx);
- if (isFirstRender) {
- this.isFirstRender = false;
- }
- }
- }
- Screen.defaultWindow = defaultWindow;
- Screen.defaultFetch = defaultFetch$1;
- var {
- defaultFetch
- } = Screen;
- var DefaultDOMParser = typeof DOMParser !== 'undefined' ? DOMParser : null;
- class Parser {
- constructor() {
- var {
- fetch = defaultFetch,
- DOMParser = DefaultDOMParser
- } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- this.fetch = fetch;
- this.DOMParser = DOMParser;
- }
- parse(resource) {
- var _this = this;
- return _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(function* () {
- if (resource.startsWith('<')) {
- return _this.parseFromString(resource);
- }
- return _this.load(resource);
- })();
- }
- parseFromString(xml) {
- var parser = new this.DOMParser();
- try {
- return this.checkDocument(parser.parseFromString(xml, 'image/svg+xml'));
- } catch (err) {
- return this.checkDocument(parser.parseFromString(xml, 'text/xml'));
- }
- }
- checkDocument(document) {
- var parserError = document.getElementsByTagName('parsererror')[0];
- if (parserError) {
- throw new Error(parserError.textContent);
- }
- return document;
- }
- load(url) {
- var _this2 = this;
- return _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(function* () {
- var response = yield _this2.fetch(url);
- var xml = yield response.text();
- return _this2.parseFromString(xml);
- })();
- }
- }
- class Translate {
- constructor(_, point) {
- this.type = 'translate';
- this.point = null;
- this.point = Point.parse(point);
- }
- apply(ctx) {
- var {
- x,
- y
- } = this.point;
- ctx.translate(x || 0.0, y || 0.0);
- }
- unapply(ctx) {
- var {
- x,
- y
- } = this.point;
- ctx.translate(-1.0 * x || 0.0, -1.0 * y || 0.0);
- }
- applyToPoint(point) {
- var {
- x,
- y
- } = this.point;
- point.applyTransform([1, 0, 0, 1, x || 0.0, y || 0.0]);
- }
- }
- class Rotate {
- constructor(document, rotate, transformOrigin) {
- this.type = 'rotate';
- this.angle = null;
- this.originX = null;
- this.originY = null;
- this.cx = 0;
- this.cy = 0;
- var numbers = toNumbers(rotate);
- this.angle = new Property(document, 'angle', numbers[0]);
- this.originX = transformOrigin[0];
- this.originY = transformOrigin[1];
- this.cx = numbers[1] || 0;
- this.cy = numbers[2] || 0;
- }
- apply(ctx) {
- var {
- cx,
- cy,
- originX,
- originY,
- angle
- } = this;
- var tx = cx + originX.getPixels('x');
- var ty = cy + originY.getPixels('y');
- ctx.translate(tx, ty);
- ctx.rotate(angle.getRadians());
- ctx.translate(-tx, -ty);
- }
- unapply(ctx) {
- var {
- cx,
- cy,
- originX,
- originY,
- angle
- } = this;
- var tx = cx + originX.getPixels('x');
- var ty = cy + originY.getPixels('y');
- ctx.translate(tx, ty);
- ctx.rotate(-1.0 * angle.getRadians());
- ctx.translate(-tx, -ty);
- }
- applyToPoint(point) {
- var {
- cx,
- cy,
- angle
- } = this;
- var rad = angle.getRadians();
- point.applyTransform([1, 0, 0, 1, cx || 0.0, cy || 0.0 // this.p.y
- ]);
- point.applyTransform([Math.cos(rad), Math.sin(rad), -Math.sin(rad), Math.cos(rad), 0, 0]);
- point.applyTransform([1, 0, 0, 1, -cx || 0.0, -cy || 0.0 // -this.p.y
- ]);
- }
- }
- class Scale {
- constructor(_, scale, transformOrigin) {
- this.type = 'scale';
- this.scale = null;
- this.originX = null;
- this.originY = null;
- var scaleSize = Point.parseScale(scale); // Workaround for node-canvas
- if (scaleSize.x === 0 || scaleSize.y === 0) {
- scaleSize.x = PSEUDO_ZERO;
- scaleSize.y = PSEUDO_ZERO;
- }
- this.scale = scaleSize;
- this.originX = transformOrigin[0];
- this.originY = transformOrigin[1];
- }
- apply(ctx) {
- var {
- scale: {
- x,
- y
- },
- originX,
- originY
- } = this;
- var tx = originX.getPixels('x');
- var ty = originY.getPixels('y');
- ctx.translate(tx, ty);
- ctx.scale(x, y || x);
- ctx.translate(-tx, -ty);
- }
- unapply(ctx) {
- var {
- scale: {
- x,
- y
- },
- originX,
- originY
- } = this;
- var tx = originX.getPixels('x');
- var ty = originY.getPixels('y');
- ctx.translate(tx, ty);
- ctx.scale(1.0 / x, 1.0 / y || x);
- ctx.translate(-tx, -ty);
- }
- applyToPoint(point) {
- var {
- x,
- y
- } = this.scale;
- point.applyTransform([x || 0.0, 0, 0, y || 0.0, 0, 0]);
- }
- }
- class Matrix {
- constructor(_, matrix, transformOrigin) {
- this.type = 'matrix';
- this.matrix = [];
- this.originX = null;
- this.originY = null;
- this.matrix = toNumbers(matrix);
- this.originX = transformOrigin[0];
- this.originY = transformOrigin[1];
- }
- apply(ctx) {
- var {
- originX,
- originY,
- matrix
- } = this;
- var tx = originX.getPixels('x');
- var ty = originY.getPixels('y');
- ctx.translate(tx, ty);
- ctx.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);
- ctx.translate(-tx, -ty);
- }
- unapply(ctx) {
- var {
- originX,
- originY,
- matrix
- } = this;
- var a = matrix[0];
- var b = matrix[2];
- var c = matrix[4];
- var d = matrix[1];
- var e = matrix[3];
- var f = matrix[5];
- var g = 0.0;
- var h = 0.0;
- var i = 1.0;
- var det = 1 / (a * (e * i - f * h) - b * (d * i - f * g) + c * (d * h - e * g));
- var tx = originX.getPixels('x');
- var ty = originY.getPixels('y');
- ctx.translate(tx, ty);
- ctx.transform(det * (e * i - f * h), det * (f * g - d * i), det * (c * h - b * i), det * (a * i - c * g), det * (b * f - c * e), det * (c * d - a * f));
- ctx.translate(-tx, -ty);
- }
- applyToPoint(point) {
- point.applyTransform(this.matrix);
- }
- }
- class Skew extends Matrix {
- constructor(document, skew, transformOrigin) {
- super(document, skew, transformOrigin);
- this.type = 'skew';
- this.angle = null;
- this.angle = new Property(document, 'angle', skew);
- }
- }
- class SkewX extends Skew {
- constructor(document, skew, transformOrigin) {
- super(document, skew, transformOrigin);
- this.type = 'skewX';
- this.matrix = [1, 0, Math.tan(this.angle.getRadians()), 1, 0, 0];
- }
- }
- class SkewY extends Skew {
- constructor(document, skew, transformOrigin) {
- super(document, skew, transformOrigin);
- this.type = 'skewY';
- this.matrix = [1, Math.tan(this.angle.getRadians()), 0, 1, 0, 0];
- }
- }
- function parseTransforms(transform) {
- return compressSpaces(transform).trim().replace(/\)([a-zA-Z])/g, ') $1').replace(/\)(\s?,\s?)/g, ') ').split(/\s(?=[a-z])/);
- }
- function parseTransform(transform) {
- var [type, value] = transform.split('(');
- return [type.trim(), value.trim().replace(')', '')];
- }
- class Transform {
- constructor(document, transform, transformOrigin) {
- this.document = document;
- this.transforms = [];
- var data = parseTransforms(transform);
- data.forEach(transform => {
- if (transform === 'none') {
- return;
- }
- var [type, value] = parseTransform(transform);
- var TransformType = Transform.transformTypes[type];
- if (typeof TransformType !== 'undefined') {
- this.transforms.push(new TransformType(this.document, value, transformOrigin));
- }
- });
- }
- static fromElement(document, element) {
- var transformStyle = element.getStyle('transform', false, true);
- var [transformOriginXProperty, transformOriginYProperty = transformOriginXProperty] = element.getStyle('transform-origin', false, true).split();
- var transformOrigin = [transformOriginXProperty, transformOriginYProperty];
- if (transformStyle.hasValue()) {
- return new Transform(document, transformStyle.getString(), transformOrigin);
- }
- return null;
- }
- apply(ctx) {
- var {
- transforms
- } = this;
- var len = transforms.length;
- for (var i = 0; i < len; i++) {
- transforms[i].apply(ctx);
- }
- }
- unapply(ctx) {
- var {
- transforms
- } = this;
- var len = transforms.length;
- for (var i = len - 1; i >= 0; i--) {
- transforms[i].unapply(ctx);
- }
- } // TODO: applyToPoint unused ... remove?
- applyToPoint(point) {
- var {
- transforms
- } = this;
- var len = transforms.length;
- for (var i = 0; i < len; i++) {
- transforms[i].applyToPoint(point);
- }
- }
- }
- Transform.transformTypes = {
- translate: Translate,
- rotate: Rotate,
- scale: Scale,
- matrix: Matrix,
- skewX: SkewX,
- skewY: SkewY
- };
- class Element {
- constructor(document, node) {
- var captureTextNodes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- this.document = document;
- this.node = node;
- this.captureTextNodes = captureTextNodes;
- this.attributes = {};
- this.styles = {};
- this.stylesSpecificity = {};
- this.animationFrozen = false;
- this.animationFrozenValue = '';
- this.parent = null;
- this.children = [];
- if (!node || node.nodeType !== 1) {
- // ELEMENT_NODE
- return;
- } // add attributes
- Array.from(node.attributes).forEach(attribute => {
- var nodeName = normalizeAttributeName(attribute.nodeName);
- this.attributes[nodeName] = new Property(document, nodeName, attribute.value);
- });
- this.addStylesFromStyleDefinition(); // add inline styles
- if (this.getAttribute('style').hasValue()) {
- var styles = this.getAttribute('style').getString().split(';').map(_ => _.trim());
- styles.forEach(style => {
- if (!style) {
- return;
- }
- var [name, value] = style.split(':').map(_ => _.trim());
- this.styles[name] = new Property(document, name, value);
- });
- }
- var {
- definitions
- } = document;
- var id = this.getAttribute('id'); // add id
- if (id.hasValue()) {
- if (!definitions[id.getString()]) {
- definitions[id.getString()] = this;
- }
- }
- Array.from(node.childNodes).forEach(childNode => {
- if (childNode.nodeType === 1) {
- this.addChild(childNode); // ELEMENT_NODE
- } else if (captureTextNodes && (childNode.nodeType === 3 || childNode.nodeType === 4)) {
- var textNode = document.createTextNode(childNode);
- if (textNode.getText().length > 0) {
- this.addChild(textNode); // TEXT_NODE
- }
- }
- });
- }
- getAttribute(name) {
- var createIfNotExists = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var attr = this.attributes[name];
- if (!attr && createIfNotExists) {
- var _attr = new Property(this.document, name, '');
- this.attributes[name] = _attr;
- return _attr;
- }
- return attr || Property.empty(this.document);
- }
- getHrefAttribute() {
- for (var key in this.attributes) {
- if (key === 'href' || key.endsWith(':href')) {
- return this.attributes[key];
- }
- }
- return Property.empty(this.document);
- }
- getStyle(name) {
- var createIfNotExists = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var skipAncestors = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- var style = this.styles[name];
- if (style) {
- return style;
- }
- var attr = this.getAttribute(name);
- if (attr !== null && attr !== void 0 && attr.hasValue()) {
- this.styles[name] = attr; // move up to me to cache
- return attr;
- }
- if (!skipAncestors) {
- var {
- parent
- } = this;
- if (parent) {
- var parentStyle = parent.getStyle(name);
- if (parentStyle !== null && parentStyle !== void 0 && parentStyle.hasValue()) {
- return parentStyle;
- }
- }
- }
- if (createIfNotExists) {
- var _style = new Property(this.document, name, '');
- this.styles[name] = _style;
- return _style;
- }
- return style || Property.empty(this.document);
- }
- render(ctx) {
- // don't render display=none
- // don't render visibility=hidden
- if (this.getStyle('display').getString() === 'none' || this.getStyle('visibility').getString() === 'hidden') {
- return;
- }
- ctx.save();
- if (this.getStyle('mask').hasValue()) {
- // mask
- var mask = this.getStyle('mask').getDefinition();
- if (mask) {
- this.applyEffects(ctx);
- mask.apply(ctx, this);
- }
- } else if (this.getStyle('filter').getValue('none') !== 'none') {
- // filter
- var filter = this.getStyle('filter').getDefinition();
- if (filter) {
- this.applyEffects(ctx);
- filter.apply(ctx, this);
- }
- } else {
- this.setContext(ctx);
- this.renderChildren(ctx);
- this.clearContext(ctx);
- }
- ctx.restore();
- }
- setContext(_) {// NO RENDER
- }
- applyEffects(ctx) {
- // transform
- var transform = Transform.fromElement(this.document, this);
- if (transform) {
- transform.apply(ctx);
- } // clip
- var clipPathStyleProp = this.getStyle('clip-path', false, true);
- if (clipPathStyleProp.hasValue()) {
- var clip = clipPathStyleProp.getDefinition();
- if (clip) {
- clip.apply(ctx);
- }
- }
- }
- clearContext(_) {// NO RENDER
- }
- renderChildren(ctx) {
- this.children.forEach(child => {
- child.render(ctx);
- });
- }
- addChild(childNode) {
- var child = childNode instanceof Element ? childNode : this.document.createElement(childNode);
- child.parent = this;
- if (!Element.ignoreChildTypes.includes(child.type)) {
- this.children.push(child);
- }
- }
- matchesSelector(selector) {
- var _node$getAttribute;
- var {
- node
- } = this;
- if (typeof node.matches === 'function') {
- return node.matches(selector);
- }
- var styleClasses = (_node$getAttribute = node.getAttribute) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.call(node, 'class');
- if (!styleClasses || styleClasses === '') {
- return false;
- }
- return styleClasses.split(' ').some(styleClass => ".".concat(styleClass) === selector);
- }
- addStylesFromStyleDefinition() {
- var {
- styles,
- stylesSpecificity
- } = this.document;
- for (var selector in styles) {
- if (!selector.startsWith('@') && this.matchesSelector(selector)) {
- var style = styles[selector];
- var specificity = stylesSpecificity[selector];
- if (style) {
- for (var name in style) {
- var existingSpecificity = this.stylesSpecificity[name];
- if (typeof existingSpecificity === 'undefined') {
- existingSpecificity = '000';
- }
- if (specificity >= existingSpecificity) {
- this.styles[name] = style[name];
- this.stylesSpecificity[name] = specificity;
- }
- }
- }
- }
- }
- }
- removeStyles(element, ignoreStyles) {
- var toRestore = ignoreStyles.reduce((toRestore, name) => {
- var styleProp = element.getStyle(name);
- if (!styleProp.hasValue()) {
- return toRestore;
- }
- var value = styleProp.getString();
- styleProp.setValue('');
- return [...toRestore, [name, value]];
- }, []);
- return toRestore;
- }
- restoreStyles(element, styles) {
- styles.forEach(_ref => {
- var [name, value] = _ref;
- element.getStyle(name, true).setValue(value);
- });
- }
- isFirstChild() {
- var _this$parent;
- return ((_this$parent = this.parent) === null || _this$parent === void 0 ? void 0 : _this$parent.children.indexOf(this)) === 0;
- }
- }
- Element.ignoreChildTypes = ['title'];
- class UnknownElement extends Element {
- constructor(document, node, captureTextNodes) {
- super(document, node, captureTextNodes);
- }
- }
- function wrapFontFamily(fontFamily) {
- var trimmed = fontFamily.trim();
- return /^('|")/.test(trimmed) ? trimmed : "\"".concat(trimmed, "\"");
- }
- function prepareFontFamily(fontFamily) {
- return typeof process === 'undefined' ? fontFamily : fontFamily.trim().split(',').map(wrapFontFamily).join(',');
- }
- /**
- * https://developer.mozilla.org/en-US/docs/Web/CSS/font-style
- * @param fontStyle
- * @returns CSS font style.
- */
- function prepareFontStyle(fontStyle) {
- if (!fontStyle) {
- return '';
- }
- var targetFontStyle = fontStyle.trim().toLowerCase();
- switch (targetFontStyle) {
- case 'normal':
- case 'italic':
- case 'oblique':
- case 'inherit':
- case 'initial':
- case 'unset':
- return targetFontStyle;
- default:
- if (/^oblique\s+(-|)\d+deg$/.test(targetFontStyle)) {
- return targetFontStyle;
- }
- return '';
- }
- }
- /**
- * https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight
- * @param fontWeight
- * @returns CSS font weight.
- */
- function prepareFontWeight(fontWeight) {
- if (!fontWeight) {
- return '';
- }
- var targetFontWeight = fontWeight.trim().toLowerCase();
- switch (targetFontWeight) {
- case 'normal':
- case 'bold':
- case 'lighter':
- case 'bolder':
- case 'inherit':
- case 'initial':
- case 'unset':
- return targetFontWeight;
- default:
- if (/^[\d.]+$/.test(targetFontWeight)) {
- return targetFontWeight;
- }
- return '';
- }
- }
- class Font {
- constructor(fontStyle, fontVariant, fontWeight, fontSize, fontFamily, inherit) {
- var inheritFont = inherit ? typeof inherit === 'string' ? Font.parse(inherit) : inherit : {};
- this.fontFamily = fontFamily || inheritFont.fontFamily;
- this.fontSize = fontSize || inheritFont.fontSize;
- this.fontStyle = fontStyle || inheritFont.fontStyle;
- this.fontWeight = fontWeight || inheritFont.fontWeight;
- this.fontVariant = fontVariant || inheritFont.fontVariant;
- }
- static parse() {
- var font = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
- var inherit = arguments.length > 1 ? arguments[1] : undefined;
- var fontStyle = '';
- var fontVariant = '';
- var fontWeight = '';
- var fontSize = '';
- var fontFamily = '';
- var parts = compressSpaces(font).trim().split(' ');
- var set = {
- fontSize: false,
- fontStyle: false,
- fontWeight: false,
- fontVariant: false
- };
- parts.forEach(part => {
- switch (true) {
- case !set.fontStyle && Font.styles.includes(part):
- if (part !== 'inherit') {
- fontStyle = part;
- }
- set.fontStyle = true;
- break;
- case !set.fontVariant && Font.variants.includes(part):
- if (part !== 'inherit') {
- fontVariant = part;
- }
- set.fontStyle = true;
- set.fontVariant = true;
- break;
- case !set.fontWeight && Font.weights.includes(part):
- if (part !== 'inherit') {
- fontWeight = part;
- }
- set.fontStyle = true;
- set.fontVariant = true;
- set.fontWeight = true;
- break;
- case !set.fontSize:
- if (part !== 'inherit') {
- [fontSize] = part.split('/');
- }
- set.fontStyle = true;
- set.fontVariant = true;
- set.fontWeight = true;
- set.fontSize = true;
- break;
- default:
- if (part !== 'inherit') {
- fontFamily += part;
- }
- }
- });
- return new Font(fontStyle, fontVariant, fontWeight, fontSize, fontFamily, inherit);
- }
- toString() {
- return [prepareFontStyle(this.fontStyle), this.fontVariant, prepareFontWeight(this.fontWeight), this.fontSize, // Wrap fontFamily only on nodejs and only for canvas.ctx
- prepareFontFamily(this.fontFamily)].join(' ').trim();
- }
- }
- Font.styles = 'normal|italic|oblique|inherit';
- Font.variants = 'normal|small-caps|inherit';
- Font.weights = 'normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit';
- class BoundingBox {
- constructor() {
- var x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Number.NaN;
- var y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.NaN;
- var x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Number.NaN;
- var y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Number.NaN;
- this.x1 = x1;
- this.y1 = y1;
- this.x2 = x2;
- this.y2 = y2;
- this.addPoint(x1, y1);
- this.addPoint(x2, y2);
- }
- get x() {
- return this.x1;
- }
- get y() {
- return this.y1;
- }
- get width() {
- return this.x2 - this.x1;
- }
- get height() {
- return this.y2 - this.y1;
- }
- addPoint(x, y) {
- if (typeof x !== 'undefined') {
- if (isNaN(this.x1) || isNaN(this.x2)) {
- this.x1 = x;
- this.x2 = x;
- }
- if (x < this.x1) {
- this.x1 = x;
- }
- if (x > this.x2) {
- this.x2 = x;
- }
- }
- if (typeof y !== 'undefined') {
- if (isNaN(this.y1) || isNaN(this.y2)) {
- this.y1 = y;
- this.y2 = y;
- }
- if (y < this.y1) {
- this.y1 = y;
- }
- if (y > this.y2) {
- this.y2 = y;
- }
- }
- }
- addX(x) {
- this.addPoint(x, null);
- }
- addY(y) {
- this.addPoint(null, y);
- }
- addBoundingBox(boundingBox) {
- if (!boundingBox) {
- return;
- }
- var {
- x1,
- y1,
- x2,
- y2
- } = boundingBox;
- this.addPoint(x1, y1);
- this.addPoint(x2, y2);
- }
- sumCubic(t, p0, p1, p2, p3) {
- return Math.pow(1 - t, 3) * p0 + 3 * Math.pow(1 - t, 2) * t * p1 + 3 * (1 - t) * Math.pow(t, 2) * p2 + Math.pow(t, 3) * p3;
- }
- bezierCurveAdd(forX, p0, p1, p2, p3) {
- var b = 6 * p0 - 12 * p1 + 6 * p2;
- var a = -3 * p0 + 9 * p1 - 9 * p2 + 3 * p3;
- var c = 3 * p1 - 3 * p0;
- if (a === 0) {
- if (b === 0) {
- return;
- }
- var t = -c / b;
- if (0 < t && t < 1) {
- if (forX) {
- this.addX(this.sumCubic(t, p0, p1, p2, p3));
- } else {
- this.addY(this.sumCubic(t, p0, p1, p2, p3));
- }
- }
- return;
- }
- var b2ac = Math.pow(b, 2) - 4 * c * a;
- if (b2ac < 0) {
- return;
- }
- var t1 = (-b + Math.sqrt(b2ac)) / (2 * a);
- if (0 < t1 && t1 < 1) {
- if (forX) {
- this.addX(this.sumCubic(t1, p0, p1, p2, p3));
- } else {
- this.addY(this.sumCubic(t1, p0, p1, p2, p3));
- }
- }
- var t2 = (-b - Math.sqrt(b2ac)) / (2 * a);
- if (0 < t2 && t2 < 1) {
- if (forX) {
- this.addX(this.sumCubic(t2, p0, p1, p2, p3));
- } else {
- this.addY(this.sumCubic(t2, p0, p1, p2, p3));
- }
- }
- } // from http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html
- addBezierCurve(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y) {
- this.addPoint(p0x, p0y);
- this.addPoint(p3x, p3y);
- this.bezierCurveAdd(true, p0x, p1x, p2x, p3x);
- this.bezierCurveAdd(false, p0y, p1y, p2y, p3y);
- }
- addQuadraticCurve(p0x, p0y, p1x, p1y, p2x, p2y) {
- var cp1x = p0x + 2 / 3 * (p1x - p0x); // CP1 = QP0 + 2/3 *(QP1-QP0)
- var cp1y = p0y + 2 / 3 * (p1y - p0y); // CP1 = QP0 + 2/3 *(QP1-QP0)
- var cp2x = cp1x + 1 / 3 * (p2x - p0x); // CP2 = CP1 + 1/3 *(QP2-QP0)
- var cp2y = cp1y + 1 / 3 * (p2y - p0y); // CP2 = CP1 + 1/3 *(QP2-QP0)
- this.addBezierCurve(p0x, p0y, cp1x, cp2x, cp1y, cp2y, p2x, p2y);
- }
- isPointInBox(x, y) {
- var {
- x1,
- y1,
- x2,
- y2
- } = this;
- return x1 <= x && x <= x2 && y1 <= y && y <= y2;
- }
- }
- class PathParser extends svg_pathdata__WEBPACK_IMPORTED_MODULE_17__["SVGPathData"] {
- constructor(path) {
- super(path // Fix spaces after signs.
- .replace(/([+\-.])\s+/gm, '$1') // Remove invalid part.
- .replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g, ''));
- this.control = null;
- this.start = null;
- this.current = null;
- this.command = null;
- this.commands = this.commands;
- this.i = -1;
- this.previousCommand = null;
- this.points = [];
- this.angles = [];
- }
- reset() {
- this.i = -1;
- this.command = null;
- this.previousCommand = null;
- this.start = new Point(0, 0);
- this.control = new Point(0, 0);
- this.current = new Point(0, 0);
- this.points = [];
- this.angles = [];
- }
- isEnd() {
- var {
- i,
- commands
- } = this;
- return i >= commands.length - 1;
- }
- next() {
- var command = this.commands[++this.i];
- this.previousCommand = this.command;
- this.command = command;
- return command;
- }
- getPoint() {
- var xProp = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'x';
- var yProp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'y';
- var point = new Point(this.command[xProp], this.command[yProp]);
- return this.makeAbsolute(point);
- }
- getAsControlPoint(xProp, yProp) {
- var point = this.getPoint(xProp, yProp);
- this.control = point;
- return point;
- }
- getAsCurrentPoint(xProp, yProp) {
- var point = this.getPoint(xProp, yProp);
- this.current = point;
- return point;
- }
- getReflectedControlPoint() {
- var previousCommand = this.previousCommand.type;
- if (previousCommand !== svg_pathdata__WEBPACK_IMPORTED_MODULE_17__["SVGPathData"].CURVE_TO && previousCommand !== svg_pathdata__WEBPACK_IMPORTED_MODULE_17__["SVGPathData"].SMOOTH_CURVE_TO && previousCommand !== svg_pathdata__WEBPACK_IMPORTED_MODULE_17__["SVGPathData"].QUAD_TO && previousCommand !== svg_pathdata__WEBPACK_IMPORTED_MODULE_17__["SVGPathData"].SMOOTH_QUAD_TO) {
- return this.current;
- } // reflect point
- var {
- current: {
- x: cx,
- y: cy
- },
- control: {
- x: ox,
- y: oy
- }
- } = this;
- var point = new Point(2 * cx - ox, 2 * cy - oy);
- return point;
- }
- makeAbsolute(point) {
- if (this.command.relative) {
- var {
- x,
- y
- } = this.current;
- point.x += x;
- point.y += y;
- }
- return point;
- }
- addMarker(point, from, priorTo) {
- var {
- points,
- angles
- } = this; // if the last angle isn't filled in because we didn't have this point yet ...
- if (priorTo && angles.length > 0 && !angles[angles.length - 1]) {
- angles[angles.length - 1] = points[points.length - 1].angleTo(priorTo);
- }
- this.addMarkerAngle(point, from ? from.angleTo(point) : null);
- }
- addMarkerAngle(point, angle) {
- this.points.push(point);
- this.angles.push(angle);
- }
- getMarkerPoints() {
- return this.points;
- }
- getMarkerAngles() {
- var {
- angles
- } = this;
- var len = angles.length;
- for (var i = 0; i < len; i++) {
- if (!angles[i]) {
- for (var j = i + 1; j < len; j++) {
- if (angles[j]) {
- angles[i] = angles[j];
- break;
- }
- }
- }
- }
- return angles;
- }
- }
- class RenderedElement extends Element {
- constructor() {
- super(...arguments);
- this.modifiedEmSizeStack = false;
- }
- calculateOpacity() {
- var opacity = 1.0; // eslint-disable-next-line @typescript-eslint/no-this-alias, consistent-this
- var element = this;
- while (element) {
- var opacityStyle = element.getStyle('opacity', false, true); // no ancestors on style call
- if (opacityStyle.hasValue(true)) {
- opacity *= opacityStyle.getNumber();
- }
- element = element.parent;
- }
- return opacity;
- }
- setContext(ctx) {
- var fromMeasure = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- if (!fromMeasure) {
- // causes stack overflow when measuring text with gradients
- // fill
- var fillStyleProp = this.getStyle('fill');
- var fillOpacityStyleProp = this.getStyle('fill-opacity');
- var strokeStyleProp = this.getStyle('stroke');
- var strokeOpacityProp = this.getStyle('stroke-opacity');
- if (fillStyleProp.isUrlDefinition()) {
- var fillStyle = fillStyleProp.getFillStyleDefinition(this, fillOpacityStyleProp);
- if (fillStyle) {
- ctx.fillStyle = fillStyle;
- }
- } else if (fillStyleProp.hasValue()) {
- if (fillStyleProp.getString() === 'currentColor') {
- fillStyleProp.setValue(this.getStyle('color').getColor());
- }
- var _fillStyle = fillStyleProp.getColor();
- if (_fillStyle !== 'inherit') {
- ctx.fillStyle = _fillStyle === 'none' ? 'rgba(0,0,0,0)' : _fillStyle;
- }
- }
- if (fillOpacityStyleProp.hasValue()) {
- var _fillStyle2 = new Property(this.document, 'fill', ctx.fillStyle).addOpacity(fillOpacityStyleProp).getColor();
- ctx.fillStyle = _fillStyle2;
- } // stroke
- if (strokeStyleProp.isUrlDefinition()) {
- var strokeStyle = strokeStyleProp.getFillStyleDefinition(this, strokeOpacityProp);
- if (strokeStyle) {
- ctx.strokeStyle = strokeStyle;
- }
- } else if (strokeStyleProp.hasValue()) {
- if (strokeStyleProp.getString() === 'currentColor') {
- strokeStyleProp.setValue(this.getStyle('color').getColor());
- }
- var _strokeStyle = strokeStyleProp.getString();
- if (_strokeStyle !== 'inherit') {
- ctx.strokeStyle = _strokeStyle === 'none' ? 'rgba(0,0,0,0)' : _strokeStyle;
- }
- }
- if (strokeOpacityProp.hasValue()) {
- var _strokeStyle2 = new Property(this.document, 'stroke', ctx.strokeStyle).addOpacity(strokeOpacityProp).getString();
- ctx.strokeStyle = _strokeStyle2;
- }
- var strokeWidthStyleProp = this.getStyle('stroke-width');
- if (strokeWidthStyleProp.hasValue()) {
- var newLineWidth = strokeWidthStyleProp.getPixels();
- ctx.lineWidth = !newLineWidth ? PSEUDO_ZERO // browsers don't respect 0 (or node-canvas? :-)
- : newLineWidth;
- }
- var strokeLinecapStyleProp = this.getStyle('stroke-linecap');
- var strokeLinejoinStyleProp = this.getStyle('stroke-linejoin');
- var strokeMiterlimitProp = this.getStyle('stroke-miterlimit'); // NEED TEST
- // const pointOrderStyleProp = this.getStyle('paint-order');
- var strokeDasharrayStyleProp = this.getStyle('stroke-dasharray');
- var strokeDashoffsetProp = this.getStyle('stroke-dashoffset');
- if (strokeLinecapStyleProp.hasValue()) {
- ctx.lineCap = strokeLinecapStyleProp.getString();
- }
- if (strokeLinejoinStyleProp.hasValue()) {
- ctx.lineJoin = strokeLinejoinStyleProp.getString();
- }
- if (strokeMiterlimitProp.hasValue()) {
- ctx.miterLimit = strokeMiterlimitProp.getNumber();
- } // NEED TEST
- // if (pointOrderStyleProp.hasValue()) {
- // // ?
- // ctx.paintOrder = pointOrderStyleProp.getValue();
- // }
- if (strokeDasharrayStyleProp.hasValue() && strokeDasharrayStyleProp.getString() !== 'none') {
- var gaps = toNumbers(strokeDasharrayStyleProp.getString());
- if (typeof ctx.setLineDash !== 'undefined') {
- ctx.setLineDash(gaps);
- } else // @ts-expect-error Handle browser prefix.
- if (typeof ctx.webkitLineDash !== 'undefined') {
- // @ts-expect-error Handle browser prefix.
- ctx.webkitLineDash = gaps;
- } else // @ts-expect-error Handle browser prefix.
- if (typeof ctx.mozDash !== 'undefined' && !(gaps.length === 1 && gaps[0] === 0)) {
- // @ts-expect-error Handle browser prefix.
- ctx.mozDash = gaps;
- }
- var offset = strokeDashoffsetProp.getPixels();
- if (typeof ctx.lineDashOffset !== 'undefined') {
- ctx.lineDashOffset = offset;
- } else // @ts-expect-error Handle browser prefix.
- if (typeof ctx.webkitLineDashOffset !== 'undefined') {
- // @ts-expect-error Handle browser prefix.
- ctx.webkitLineDashOffset = offset;
- } else // @ts-expect-error Handle browser prefix.
- if (typeof ctx.mozDashOffset !== 'undefined') {
- // @ts-expect-error Handle browser prefix.
- ctx.mozDashOffset = offset;
- }
- }
- } // font
- this.modifiedEmSizeStack = false;
- if (typeof ctx.font !== 'undefined') {
- var fontStyleProp = this.getStyle('font');
- var fontStyleStyleProp = this.getStyle('font-style');
- var fontVariantStyleProp = this.getStyle('font-variant');
- var fontWeightStyleProp = this.getStyle('font-weight');
- var fontSizeStyleProp = this.getStyle('font-size');
- var fontFamilyStyleProp = this.getStyle('font-family');
- var font = new Font(fontStyleStyleProp.getString(), fontVariantStyleProp.getString(), fontWeightStyleProp.getString(), fontSizeStyleProp.hasValue() ? "".concat(fontSizeStyleProp.getPixels(true), "px") : '', fontFamilyStyleProp.getString(), Font.parse(fontStyleProp.getString(), ctx.font));
- fontStyleStyleProp.setValue(font.fontStyle);
- fontVariantStyleProp.setValue(font.fontVariant);
- fontWeightStyleProp.setValue(font.fontWeight);
- fontSizeStyleProp.setValue(font.fontSize);
- fontFamilyStyleProp.setValue(font.fontFamily);
- ctx.font = font.toString();
- if (fontSizeStyleProp.isPixels()) {
- this.document.emSize = fontSizeStyleProp.getPixels();
- this.modifiedEmSizeStack = true;
- }
- }
- if (!fromMeasure) {
- // effects
- this.applyEffects(ctx); // opacity
- ctx.globalAlpha = this.calculateOpacity();
- }
- }
- clearContext(ctx) {
- super.clearContext(ctx);
- if (this.modifiedEmSizeStack) {
- this.document.popEmSize();
- }
- }
- }
- class PathElement extends RenderedElement {
- constructor(document, node, captureTextNodes) {
- super(document, node, captureTextNodes);
- this.type = 'path';
- this.pathParser = null;
- this.pathParser = new PathParser(this.getAttribute('d').getString());
- }
- path(ctx) {
- var {
- pathParser
- } = this;
- var boundingBox = new BoundingBox();
- pathParser.reset();
- if (ctx) {
- ctx.beginPath();
- }
- while (!pathParser.isEnd()) {
- switch (pathParser.next().type) {
- case PathParser.MOVE_TO:
- this.pathM(ctx, boundingBox);
- break;
- case PathParser.LINE_TO:
- this.pathL(ctx, boundingBox);
- break;
- case PathParser.HORIZ_LINE_TO:
- this.pathH(ctx, boundingBox);
- break;
- case PathParser.VERT_LINE_TO:
- this.pathV(ctx, boundingBox);
- break;
- case PathParser.CURVE_TO:
- this.pathC(ctx, boundingBox);
- break;
- case PathParser.SMOOTH_CURVE_TO:
- this.pathS(ctx, boundingBox);
- break;
- case PathParser.QUAD_TO:
- this.pathQ(ctx, boundingBox);
- break;
- case PathParser.SMOOTH_QUAD_TO:
- this.pathT(ctx, boundingBox);
- break;
- case PathParser.ARC:
- this.pathA(ctx, boundingBox);
- break;
- case PathParser.CLOSE_PATH:
- this.pathZ(ctx, boundingBox);
- break;
- }
- }
- return boundingBox;
- }
- getBoundingBox(_) {
- return this.path();
- }
- getMarkers() {
- var {
- pathParser
- } = this;
- var points = pathParser.getMarkerPoints();
- var angles = pathParser.getMarkerAngles();
- var markers = points.map((point, i) => [point, angles[i]]);
- return markers;
- }
- renderChildren(ctx) {
- this.path(ctx);
- this.document.screen.mouse.checkPath(this, ctx);
- var fillRuleStyleProp = this.getStyle('fill-rule');
- if (ctx.fillStyle !== '') {
- if (fillRuleStyleProp.getString('inherit') !== 'inherit') {
- ctx.fill(fillRuleStyleProp.getString());
- } else {
- ctx.fill();
- }
- }
- if (ctx.strokeStyle !== '') {
- if (this.getAttribute('vector-effect').getString() === 'non-scaling-stroke') {
- ctx.save();
- ctx.setTransform(1, 0, 0, 1, 0, 0);
- ctx.stroke();
- ctx.restore();
- } else {
- ctx.stroke();
- }
- }
- var markers = this.getMarkers();
- if (markers) {
- var markersLastIndex = markers.length - 1;
- var markerStartStyleProp = this.getStyle('marker-start');
- var markerMidStyleProp = this.getStyle('marker-mid');
- var markerEndStyleProp = this.getStyle('marker-end');
- if (markerStartStyleProp.isUrlDefinition()) {
- var marker = markerStartStyleProp.getDefinition();
- var [point, angle] = markers[0];
- marker.render(ctx, point, angle);
- }
- if (markerMidStyleProp.isUrlDefinition()) {
- var _marker = markerMidStyleProp.getDefinition();
- for (var i = 1; i < markersLastIndex; i++) {
- var [_point, _angle] = markers[i];
- _marker.render(ctx, _point, _angle);
- }
- }
- if (markerEndStyleProp.isUrlDefinition()) {
- var _marker2 = markerEndStyleProp.getDefinition();
- var [_point2, _angle2] = markers[markersLastIndex];
- _marker2.render(ctx, _point2, _angle2);
- }
- }
- }
- static pathM(pathParser) {
- var point = pathParser.getAsCurrentPoint();
- pathParser.start = pathParser.current;
- return {
- point
- };
- }
- pathM(ctx, boundingBox) {
- var {
- pathParser
- } = this;
- var {
- point
- } = PathElement.pathM(pathParser);
- var {
- x,
- y
- } = point;
- pathParser.addMarker(point);
- boundingBox.addPoint(x, y);
- if (ctx) {
- ctx.moveTo(x, y);
- }
- }
- static pathL(pathParser) {
- var {
- current
- } = pathParser;
- var point = pathParser.getAsCurrentPoint();
- return {
- current,
- point
- };
- }
- pathL(ctx, boundingBox) {
- var {
- pathParser
- } = this;
- var {
- current,
- point
- } = PathElement.pathL(pathParser);
- var {
- x,
- y
- } = point;
- pathParser.addMarker(point, current);
- boundingBox.addPoint(x, y);
- if (ctx) {
- ctx.lineTo(x, y);
- }
- }
- static pathH(pathParser) {
- var {
- current,
- command
- } = pathParser;
- var point = new Point((command.relative ? current.x : 0) + command.x, current.y);
- pathParser.current = point;
- return {
- current,
- point
- };
- }
- pathH(ctx, boundingBox) {
- var {
- pathParser
- } = this;
- var {
- current,
- point
- } = PathElement.pathH(pathParser);
- var {
- x,
- y
- } = point;
- pathParser.addMarker(point, current);
- boundingBox.addPoint(x, y);
- if (ctx) {
- ctx.lineTo(x, y);
- }
- }
- static pathV(pathParser) {
- var {
- current,
- command
- } = pathParser;
- var point = new Point(current.x, (command.relative ? current.y : 0) + command.y);
- pathParser.current = point;
- return {
- current,
- point
- };
- }
- pathV(ctx, boundingBox) {
- var {
- pathParser
- } = this;
- var {
- current,
- point
- } = PathElement.pathV(pathParser);
- var {
- x,
- y
- } = point;
- pathParser.addMarker(point, current);
- boundingBox.addPoint(x, y);
- if (ctx) {
- ctx.lineTo(x, y);
- }
- }
- static pathC(pathParser) {
- var {
- current
- } = pathParser;
- var point = pathParser.getPoint('x1', 'y1');
- var controlPoint = pathParser.getAsControlPoint('x2', 'y2');
- var currentPoint = pathParser.getAsCurrentPoint();
- return {
- current,
- point,
- controlPoint,
- currentPoint
- };
- }
- pathC(ctx, boundingBox) {
- var {
- pathParser
- } = this;
- var {
- current,
- point,
- controlPoint,
- currentPoint
- } = PathElement.pathC(pathParser);
- pathParser.addMarker(currentPoint, controlPoint, point);
- boundingBox.addBezierCurve(current.x, current.y, point.x, point.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
- if (ctx) {
- ctx.bezierCurveTo(point.x, point.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
- }
- }
- static pathS(pathParser) {
- var {
- current
- } = pathParser;
- var point = pathParser.getReflectedControlPoint();
- var controlPoint = pathParser.getAsControlPoint('x2', 'y2');
- var currentPoint = pathParser.getAsCurrentPoint();
- return {
- current,
- point,
- controlPoint,
- currentPoint
- };
- }
- pathS(ctx, boundingBox) {
- var {
- pathParser
- } = this;
- var {
- current,
- point,
- controlPoint,
- currentPoint
- } = PathElement.pathS(pathParser);
- pathParser.addMarker(currentPoint, controlPoint, point);
- boundingBox.addBezierCurve(current.x, current.y, point.x, point.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
- if (ctx) {
- ctx.bezierCurveTo(point.x, point.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
- }
- }
- static pathQ(pathParser) {
- var {
- current
- } = pathParser;
- var controlPoint = pathParser.getAsControlPoint('x1', 'y1');
- var currentPoint = pathParser.getAsCurrentPoint();
- return {
- current,
- controlPoint,
- currentPoint
- };
- }
- pathQ(ctx, boundingBox) {
- var {
- pathParser
- } = this;
- var {
- current,
- controlPoint,
- currentPoint
- } = PathElement.pathQ(pathParser);
- pathParser.addMarker(currentPoint, controlPoint, controlPoint);
- boundingBox.addQuadraticCurve(current.x, current.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
- if (ctx) {
- ctx.quadraticCurveTo(controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
- }
- }
- static pathT(pathParser) {
- var {
- current
- } = pathParser;
- var controlPoint = pathParser.getReflectedControlPoint();
- pathParser.control = controlPoint;
- var currentPoint = pathParser.getAsCurrentPoint();
- return {
- current,
- controlPoint,
- currentPoint
- };
- }
- pathT(ctx, boundingBox) {
- var {
- pathParser
- } = this;
- var {
- current,
- controlPoint,
- currentPoint
- } = PathElement.pathT(pathParser);
- pathParser.addMarker(currentPoint, controlPoint, controlPoint);
- boundingBox.addQuadraticCurve(current.x, current.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
- if (ctx) {
- ctx.quadraticCurveTo(controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
- }
- }
- static pathA(pathParser) {
- var {
- current,
- command
- } = pathParser;
- var {
- rX,
- rY,
- xRot,
- lArcFlag,
- sweepFlag
- } = command;
- var xAxisRotation = xRot * (Math.PI / 180.0);
- var currentPoint = pathParser.getAsCurrentPoint(); // Conversion from endpoint to center parameterization
- // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes
- // x1', y1'
- var currp = new Point(Math.cos(xAxisRotation) * (current.x - currentPoint.x) / 2.0 + Math.sin(xAxisRotation) * (current.y - currentPoint.y) / 2.0, -Math.sin(xAxisRotation) * (current.x - currentPoint.x) / 2.0 + Math.cos(xAxisRotation) * (current.y - currentPoint.y) / 2.0); // adjust radii
- var l = Math.pow(currp.x, 2) / Math.pow(rX, 2) + Math.pow(currp.y, 2) / Math.pow(rY, 2);
- if (l > 1) {
- rX *= Math.sqrt(l);
- rY *= Math.sqrt(l);
- } // cx', cy'
- var s = (lArcFlag === sweepFlag ? -1 : 1) * Math.sqrt((Math.pow(rX, 2) * Math.pow(rY, 2) - Math.pow(rX, 2) * Math.pow(currp.y, 2) - Math.pow(rY, 2) * Math.pow(currp.x, 2)) / (Math.pow(rX, 2) * Math.pow(currp.y, 2) + Math.pow(rY, 2) * Math.pow(currp.x, 2)));
- if (isNaN(s)) {
- s = 0;
- }
- var cpp = new Point(s * rX * currp.y / rY, s * -rY * currp.x / rX); // cx, cy
- var centp = new Point((current.x + currentPoint.x) / 2.0 + Math.cos(xAxisRotation) * cpp.x - Math.sin(xAxisRotation) * cpp.y, (current.y + currentPoint.y) / 2.0 + Math.sin(xAxisRotation) * cpp.x + Math.cos(xAxisRotation) * cpp.y); // initial angle
- var a1 = vectorsAngle([1, 0], [(currp.x - cpp.x) / rX, (currp.y - cpp.y) / rY]); // θ1
- // angle delta
- var u = [(currp.x - cpp.x) / rX, (currp.y - cpp.y) / rY];
- var v = [(-currp.x - cpp.x) / rX, (-currp.y - cpp.y) / rY];
- var ad = vectorsAngle(u, v); // Δθ
- if (vectorsRatio(u, v) <= -1) {
- ad = Math.PI;
- }
- if (vectorsRatio(u, v) >= 1) {
- ad = 0;
- }
- return {
- currentPoint,
- rX,
- rY,
- sweepFlag,
- xAxisRotation,
- centp,
- a1,
- ad
- };
- }
- pathA(ctx, boundingBox) {
- var {
- pathParser
- } = this;
- var {
- currentPoint,
- rX,
- rY,
- sweepFlag,
- xAxisRotation,
- centp,
- a1,
- ad
- } = PathElement.pathA(pathParser); // for markers
- var dir = 1 - sweepFlag ? 1.0 : -1.0;
- var ah = a1 + dir * (ad / 2.0);
- var halfWay = new Point(centp.x + rX * Math.cos(ah), centp.y + rY * Math.sin(ah));
- pathParser.addMarkerAngle(halfWay, ah - dir * Math.PI / 2);
- pathParser.addMarkerAngle(currentPoint, ah - dir * Math.PI);
- boundingBox.addPoint(currentPoint.x, currentPoint.y); // TODO: this is too naive, make it better
- if (ctx && !isNaN(a1) && !isNaN(ad)) {
- var r = rX > rY ? rX : rY;
- var sx = rX > rY ? 1 : rX / rY;
- var sy = rX > rY ? rY / rX : 1;
- ctx.translate(centp.x, centp.y);
- ctx.rotate(xAxisRotation);
- ctx.scale(sx, sy);
- ctx.arc(0, 0, r, a1, a1 + ad, Boolean(1 - sweepFlag));
- ctx.scale(1 / sx, 1 / sy);
- ctx.rotate(-xAxisRotation);
- ctx.translate(-centp.x, -centp.y);
- }
- }
- static pathZ(pathParser) {
- pathParser.current = pathParser.start;
- }
- pathZ(ctx, boundingBox) {
- PathElement.pathZ(this.pathParser);
- if (ctx) {
- // only close path if it is not a straight line
- if (boundingBox.x1 !== boundingBox.x2 && boundingBox.y1 !== boundingBox.y2) {
- ctx.closePath();
- }
- }
- }
- }
- class GlyphElement extends PathElement {
- constructor(document, node, captureTextNodes) {
- super(document, node, captureTextNodes);
- this.type = 'glyph';
- this.horizAdvX = this.getAttribute('horiz-adv-x').getNumber();
- this.unicode = this.getAttribute('unicode').getString();
- this.arabicForm = this.getAttribute('arabic-form').getString();
- }
- }
- class TextElement extends RenderedElement {
- constructor(document, node, captureTextNodes) {
- super(document, node, new.target === TextElement ? true : captureTextNodes);
- this.type = 'text';
- this.x = 0;
- this.y = 0;
- this.measureCache = -1;
- }
- setContext(ctx) {
- var fromMeasure = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- super.setContext(ctx, fromMeasure);
- var textBaseline = this.getStyle('dominant-baseline').getTextBaseline() || this.getStyle('alignment-baseline').getTextBaseline();
- if (textBaseline) {
- ctx.textBaseline = textBaseline;
- }
- }
- initializeCoordinates() {
- this.x = 0;
- this.y = 0;
- this.leafTexts = [];
- this.textChunkStart = 0;
- this.minX = Number.POSITIVE_INFINITY;
- this.maxX = Number.NEGATIVE_INFINITY;
- }
- getBoundingBox(ctx) {
- if (this.type !== 'text') {
- return this.getTElementBoundingBox(ctx);
- } // first, calculate child positions
- this.initializeCoordinates();
- this.adjustChildCoordinatesRecursive(ctx);
- var boundingBox = null; // then calculate bounding box
- this.children.forEach((_, i) => {
- var childBoundingBox = this.getChildBoundingBox(ctx, this, this, i);
- if (!boundingBox) {
- boundingBox = childBoundingBox;
- } else {
- boundingBox.addBoundingBox(childBoundingBox);
- }
- });
- return boundingBox;
- }
- getFontSize() {
- var {
- document,
- parent
- } = this;
- var inheritFontSize = Font.parse(document.ctx.font).fontSize;
- var fontSize = parent.getStyle('font-size').getNumber(inheritFontSize);
- return fontSize;
- }
- getTElementBoundingBox(ctx) {
- var fontSize = this.getFontSize();
- return new BoundingBox(this.x, this.y - fontSize, this.x + this.measureText(ctx), this.y);
- }
- getGlyph(font, text, i) {
- var char = text[i];
- var glyph = null;
- if (font.isArabic) {
- var len = text.length;
- var prevChar = text[i - 1];
- var nextChar = text[i + 1];
- var arabicForm = 'isolated';
- if ((i === 0 || prevChar === ' ') && i < len - 1 && nextChar !== ' ') {
- arabicForm = 'terminal';
- }
- if (i > 0 && prevChar !== ' ' && i < len - 1 && nextChar !== ' ') {
- arabicForm = 'medial';
- }
- if (i > 0 && prevChar !== ' ' && (i === len - 1 || nextChar === ' ')) {
- arabicForm = 'initial';
- }
- if (typeof font.glyphs[char] !== 'undefined') {
- // NEED TEST
- var maybeGlyph = font.glyphs[char];
- glyph = maybeGlyph instanceof GlyphElement ? maybeGlyph : maybeGlyph[arabicForm];
- }
- } else {
- glyph = font.glyphs[char];
- }
- if (!glyph) {
- glyph = font.missingGlyph;
- }
- return glyph;
- }
- getText() {
- return '';
- }
- getTextFromNode(node) {
- var textNode = node || this.node;
- var childNodes = Array.from(textNode.parentNode.childNodes);
- var index = childNodes.indexOf(textNode);
- var lastIndex = childNodes.length - 1;
- var text = compressSpaces( // textNode.value
- // || textNode.text
- textNode.textContent || '');
- if (index === 0) {
- text = trimLeft(text);
- }
- if (index === lastIndex) {
- text = trimRight(text);
- }
- return text;
- }
- renderChildren(ctx) {
- if (this.type !== 'text') {
- this.renderTElementChildren(ctx);
- return;
- } // first, calculate child positions
- this.initializeCoordinates();
- this.adjustChildCoordinatesRecursive(ctx); // then render
- this.children.forEach((_, i) => {
- this.renderChild(ctx, this, this, i);
- });
- var {
- mouse
- } = this.document.screen; // Do not calc bounding box if mouse is not working.
- if (mouse.isWorking()) {
- mouse.checkBoundingBox(this, this.getBoundingBox(ctx));
- }
- }
- renderTElementChildren(ctx) {
- var {
- document,
- parent
- } = this;
- var renderText = this.getText();
- var customFont = parent.getStyle('font-family').getDefinition();
- if (customFont) {
- var {
- unitsPerEm
- } = customFont.fontFace;
- var ctxFont = Font.parse(document.ctx.font);
- var fontSize = parent.getStyle('font-size').getNumber(ctxFont.fontSize);
- var fontStyle = parent.getStyle('font-style').getString(ctxFont.fontStyle);
- var scale = fontSize / unitsPerEm;
- var text = customFont.isRTL ? renderText.split('').reverse().join('') : renderText;
- var dx = toNumbers(parent.getAttribute('dx').getString());
- var len = text.length;
- for (var i = 0; i < len; i++) {
- var glyph = this.getGlyph(customFont, text, i);
- ctx.translate(this.x, this.y);
- ctx.scale(scale, -scale);
- var lw = ctx.lineWidth;
- ctx.lineWidth = ctx.lineWidth * unitsPerEm / fontSize;
- if (fontStyle === 'italic') {
- ctx.transform(1, 0, .4, 1, 0, 0);
- }
- glyph.render(ctx);
- if (fontStyle === 'italic') {
- ctx.transform(1, 0, -.4, 1, 0, 0);
- }
- ctx.lineWidth = lw;
- ctx.scale(1 / scale, -1 / scale);
- ctx.translate(-this.x, -this.y);
- this.x += fontSize * (glyph.horizAdvX || customFont.horizAdvX) / unitsPerEm;
- if (typeof dx[i] !== 'undefined' && !isNaN(dx[i])) {
- this.x += dx[i];
- }
- }
- return;
- }
- var {
- x,
- y
- } = this; // NEED TEST
- // if (ctx.paintOrder === 'stroke') {
- // if (ctx.strokeStyle) {
- // ctx.strokeText(renderText, x, y);
- // }
- // if (ctx.fillStyle) {
- // ctx.fillText(renderText, x, y);
- // }
- // } else {
- if (ctx.fillStyle) {
- ctx.fillText(renderText, x, y);
- }
- if (ctx.strokeStyle) {
- ctx.strokeText(renderText, x, y);
- } // }
- }
- applyAnchoring() {
- if (this.textChunkStart >= this.leafTexts.length) {
- return;
- } // This is basically the "Apply anchoring" part of https://www.w3.org/TR/SVG2/text.html#TextLayoutAlgorithm.
- // The difference is that we apply the anchoring as soon as a chunk is finished. This saves some extra looping.
- // Vertical text is not supported.
- var firstElement = this.leafTexts[this.textChunkStart];
- var textAnchor = firstElement.getStyle('text-anchor').getString('start');
- var isRTL = false; // we treat RTL like LTR
- var shift = 0;
- if (textAnchor === 'start' && !isRTL || textAnchor === 'end' && isRTL) {
- shift = firstElement.x - this.minX;
- } else if (textAnchor === 'end' && !isRTL || textAnchor === 'start' && isRTL) {
- shift = firstElement.x - this.maxX;
- } else {
- shift = firstElement.x - (this.minX + this.maxX) / 2;
- }
- for (var i = this.textChunkStart; i < this.leafTexts.length; i++) {
- this.leafTexts[i].x += shift;
- } // start new chunk
- this.minX = Number.POSITIVE_INFINITY;
- this.maxX = Number.NEGATIVE_INFINITY;
- this.textChunkStart = this.leafTexts.length;
- }
- adjustChildCoordinatesRecursive(ctx) {
- this.children.forEach((_, i) => {
- this.adjustChildCoordinatesRecursiveCore(ctx, this, this, i);
- });
- this.applyAnchoring();
- }
- adjustChildCoordinatesRecursiveCore(ctx, textParent, parent, i) {
- var child = parent.children[i];
- if (child.children.length > 0) {
- child.children.forEach((_, i) => {
- textParent.adjustChildCoordinatesRecursiveCore(ctx, textParent, child, i);
- });
- } else {
- // only leafs are relevant
- this.adjustChildCoordinates(ctx, textParent, parent, i);
- }
- }
- adjustChildCoordinates(ctx, textParent, parent, i) {
- var child = parent.children[i];
- if (typeof child.measureText !== 'function') {
- return child;
- }
- ctx.save();
- child.setContext(ctx, true);
- var xAttr = child.getAttribute('x');
- var yAttr = child.getAttribute('y');
- var dxAttr = child.getAttribute('dx');
- var dyAttr = child.getAttribute('dy');
- var customFont = child.getStyle('font-family').getDefinition();
- var isRTL = Boolean(customFont) && customFont.isRTL;
- if (i === 0) {
- // First children inherit attributes from parent(s). Positional attributes
- // are only inherited from a parent to it's first child.
- if (!xAttr.hasValue()) {
- xAttr.setValue(child.getInheritedAttribute('x'));
- }
- if (!yAttr.hasValue()) {
- yAttr.setValue(child.getInheritedAttribute('y'));
- }
- if (!dxAttr.hasValue()) {
- dxAttr.setValue(child.getInheritedAttribute('dx'));
- }
- if (!dyAttr.hasValue()) {
- dyAttr.setValue(child.getInheritedAttribute('dy'));
- }
- }
- var width = child.measureText(ctx);
- if (isRTL) {
- textParent.x -= width;
- }
- if (xAttr.hasValue()) {
- // an "x" attribute marks the start of a new chunk
- textParent.applyAnchoring();
- child.x = xAttr.getPixels('x');
- if (dxAttr.hasValue()) {
- child.x += dxAttr.getPixels('x');
- }
- } else {
- if (dxAttr.hasValue()) {
- textParent.x += dxAttr.getPixels('x');
- }
- child.x = textParent.x;
- }
- textParent.x = child.x;
- if (!isRTL) {
- textParent.x += width;
- }
- if (yAttr.hasValue()) {
- child.y = yAttr.getPixels('y');
- if (dyAttr.hasValue()) {
- child.y += dyAttr.getPixels('y');
- }
- } else {
- if (dyAttr.hasValue()) {
- textParent.y += dyAttr.getPixels('y');
- }
- child.y = textParent.y;
- }
- textParent.y = child.y; // update the current chunk and it's bounds
- textParent.leafTexts.push(child);
- textParent.minX = Math.min(textParent.minX, child.x, child.x + width);
- textParent.maxX = Math.max(textParent.maxX, child.x, child.x + width);
- child.clearContext(ctx);
- ctx.restore();
- return child;
- }
- getChildBoundingBox(ctx, textParent, parent, i) {
- var child = parent.children[i]; // not a text node?
- if (typeof child.getBoundingBox !== 'function') {
- return null;
- }
- var boundingBox = child.getBoundingBox(ctx);
- if (!boundingBox) {
- return null;
- }
- child.children.forEach((_, i) => {
- var childBoundingBox = textParent.getChildBoundingBox(ctx, textParent, child, i);
- boundingBox.addBoundingBox(childBoundingBox);
- });
- return boundingBox;
- }
- renderChild(ctx, textParent, parent, i) {
- var child = parent.children[i];
- child.render(ctx);
- child.children.forEach((_, i) => {
- textParent.renderChild(ctx, textParent, child, i);
- });
- }
- measureText(ctx) {
- var {
- measureCache
- } = this;
- if (~measureCache) {
- return measureCache;
- }
- var renderText = this.getText();
- var measure = this.measureTargetText(ctx, renderText);
- this.measureCache = measure;
- return measure;
- }
- measureTargetText(ctx, targetText) {
- if (!targetText.length) {
- return 0;
- }
- var {
- parent
- } = this;
- var customFont = parent.getStyle('font-family').getDefinition();
- if (customFont) {
- var fontSize = this.getFontSize();
- var text = customFont.isRTL ? targetText.split('').reverse().join('') : targetText;
- var dx = toNumbers(parent.getAttribute('dx').getString());
- var len = text.length;
- var _measure = 0;
- for (var i = 0; i < len; i++) {
- var glyph = this.getGlyph(customFont, text, i);
- _measure += (glyph.horizAdvX || customFont.horizAdvX) * fontSize / customFont.fontFace.unitsPerEm;
- if (typeof dx[i] !== 'undefined' && !isNaN(dx[i])) {
- _measure += dx[i];
- }
- }
- return _measure;
- }
- if (!ctx.measureText) {
- return targetText.length * 10;
- }
- ctx.save();
- this.setContext(ctx, true);
- var {
- width: measure
- } = ctx.measureText(targetText);
- this.clearContext(ctx);
- ctx.restore();
- return measure;
- }
- /**
- * Inherits positional attributes from {@link TextElement} parent(s). Attributes
- * are only inherited from a parent to its first child.
- * @param name - The attribute name.
- * @returns The attribute value or null.
- */
- getInheritedAttribute(name) {
- // eslint-disable-next-line @typescript-eslint/no-this-alias,consistent-this
- var current = this;
- while (current instanceof TextElement && current.isFirstChild()) {
- var parentAttr = current.parent.getAttribute(name);
- if (parentAttr.hasValue(true)) {
- return parentAttr.getValue('0');
- }
- current = current.parent;
- }
- return null;
- }
- }
- class TSpanElement extends TextElement {
- constructor(document, node, captureTextNodes) {
- super(document, node, new.target === TSpanElement ? true : captureTextNodes);
- this.type = 'tspan'; // if this node has children, then they own the text
- this.text = this.children.length > 0 ? '' : this.getTextFromNode();
- }
- getText() {
- return this.text;
- }
- }
- class TextNode extends TSpanElement {
- constructor() {
- super(...arguments);
- this.type = 'textNode';
- }
- }
- class SVGElement extends RenderedElement {
- constructor() {
- super(...arguments);
- this.type = 'svg';
- this.root = false;
- }
- setContext(ctx) {
- var _this$node$parentNode;
- var {
- document
- } = this;
- var {
- screen,
- window
- } = document;
- var canvas = ctx.canvas;
- screen.setDefaults(ctx);
- if (canvas.style && typeof ctx.font !== 'undefined' && window && typeof window.getComputedStyle !== 'undefined') {
- ctx.font = window.getComputedStyle(canvas).getPropertyValue('font');
- var fontSizeProp = new Property(document, 'fontSize', Font.parse(ctx.font).fontSize);
- if (fontSizeProp.hasValue()) {
- document.rootEmSize = fontSizeProp.getPixels('y');
- document.emSize = document.rootEmSize;
- }
- } // create new view port
- if (!this.getAttribute('x').hasValue()) {
- this.getAttribute('x', true).setValue(0);
- }
- if (!this.getAttribute('y').hasValue()) {
- this.getAttribute('y', true).setValue(0);
- }
- var {
- width,
- height
- } = screen.viewPort;
- if (!this.getStyle('width').hasValue()) {
- this.getStyle('width', true).setValue('100%');
- }
- if (!this.getStyle('height').hasValue()) {
- this.getStyle('height', true).setValue('100%');
- }
- if (!this.getStyle('color').hasValue()) {
- this.getStyle('color', true).setValue('black');
- }
- var refXAttr = this.getAttribute('refX');
- var refYAttr = this.getAttribute('refY');
- var viewBoxAttr = this.getAttribute('viewBox');
- var viewBox = viewBoxAttr.hasValue() ? toNumbers(viewBoxAttr.getString()) : null;
- var clip = !this.root && this.getStyle('overflow').getValue('hidden') !== 'visible';
- var minX = 0;
- var minY = 0;
- var clipX = 0;
- var clipY = 0;
- if (viewBox) {
- minX = viewBox[0];
- minY = viewBox[1];
- }
- if (!this.root) {
- width = this.getStyle('width').getPixels('x');
- height = this.getStyle('height').getPixels('y');
- if (this.type === 'marker') {
- clipX = minX;
- clipY = minY;
- minX = 0;
- minY = 0;
- }
- }
- screen.viewPort.setCurrent(width, height); // Default value of transform-origin is center only for root SVG elements
- // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform-origin
- if (this.node // is not temporary SVGElement
- && (!this.parent || ((_this$node$parentNode = this.node.parentNode) === null || _this$node$parentNode === void 0 ? void 0 : _this$node$parentNode.nodeName) === 'foreignObject') && this.getStyle('transform', false, true).hasValue() && !this.getStyle('transform-origin', false, true).hasValue()) {
- this.getStyle('transform-origin', true, true).setValue('50% 50%');
- }
- super.setContext(ctx);
- ctx.translate(this.getAttribute('x').getPixels('x'), this.getAttribute('y').getPixels('y'));
- if (viewBox) {
- width = viewBox[2];
- height = viewBox[3];
- }
- document.setViewBox({
- ctx,
- aspectRatio: this.getAttribute('preserveAspectRatio').getString(),
- width: screen.viewPort.width,
- desiredWidth: width,
- height: screen.viewPort.height,
- desiredHeight: height,
- minX,
- minY,
- refX: refXAttr.getValue(),
- refY: refYAttr.getValue(),
- clip,
- clipX,
- clipY
- });
- if (viewBox) {
- screen.viewPort.removeCurrent();
- screen.viewPort.setCurrent(width, height);
- }
- }
- clearContext(ctx) {
- super.clearContext(ctx);
- this.document.screen.viewPort.removeCurrent();
- }
- /**
- * Resize SVG to fit in given size.
- * @param width
- * @param height
- * @param preserveAspectRatio
- */
- resize(width) {
- var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : width;
- var preserveAspectRatio = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- var widthAttr = this.getAttribute('width', true);
- var heightAttr = this.getAttribute('height', true);
- var viewBoxAttr = this.getAttribute('viewBox');
- var styleAttr = this.getAttribute('style');
- var originWidth = widthAttr.getNumber(0);
- var originHeight = heightAttr.getNumber(0);
- if (preserveAspectRatio) {
- if (typeof preserveAspectRatio === 'string') {
- this.getAttribute('preserveAspectRatio', true).setValue(preserveAspectRatio);
- } else {
- var preserveAspectRatioAttr = this.getAttribute('preserveAspectRatio');
- if (preserveAspectRatioAttr.hasValue()) {
- preserveAspectRatioAttr.setValue(preserveAspectRatioAttr.getString().replace(/^\s*(\S.*\S)\s*$/, '$1'));
- }
- }
- }
- widthAttr.setValue(width);
- heightAttr.setValue(height);
- if (!viewBoxAttr.hasValue()) {
- viewBoxAttr.setValue("0 0 ".concat(originWidth || width, " ").concat(originHeight || height));
- }
- if (styleAttr.hasValue()) {
- var widthStyle = this.getStyle('width');
- var heightStyle = this.getStyle('height');
- if (widthStyle.hasValue()) {
- widthStyle.setValue("".concat(width, "px"));
- }
- if (heightStyle.hasValue()) {
- heightStyle.setValue("".concat(height, "px"));
- }
- }
- }
- }
- class RectElement extends PathElement {
- constructor() {
- super(...arguments);
- this.type = 'rect';
- }
- path(ctx) {
- var x = this.getAttribute('x').getPixels('x');
- var y = this.getAttribute('y').getPixels('y');
- var width = this.getStyle('width', false, true).getPixels('x');
- var height = this.getStyle('height', false, true).getPixels('y');
- var rxAttr = this.getAttribute('rx');
- var ryAttr = this.getAttribute('ry');
- var rx = rxAttr.getPixels('x');
- var ry = ryAttr.getPixels('y');
- if (rxAttr.hasValue() && !ryAttr.hasValue()) {
- ry = rx;
- }
- if (ryAttr.hasValue() && !rxAttr.hasValue()) {
- rx = ry;
- }
- rx = Math.min(rx, width / 2.0);
- ry = Math.min(ry, height / 2.0);
- if (ctx) {
- var KAPPA = 4 * ((Math.sqrt(2) - 1) / 3);
- ctx.beginPath(); // always start the path so we don't fill prior paths
- if (height > 0 && width > 0) {
- ctx.moveTo(x + rx, y);
- ctx.lineTo(x + width - rx, y);
- ctx.bezierCurveTo(x + width - rx + KAPPA * rx, y, x + width, y + ry - KAPPA * ry, x + width, y + ry);
- ctx.lineTo(x + width, y + height - ry);
- ctx.bezierCurveTo(x + width, y + height - ry + KAPPA * ry, x + width - rx + KAPPA * rx, y + height, x + width - rx, y + height);
- ctx.lineTo(x + rx, y + height);
- ctx.bezierCurveTo(x + rx - KAPPA * rx, y + height, x, y + height - ry + KAPPA * ry, x, y + height - ry);
- ctx.lineTo(x, y + ry);
- ctx.bezierCurveTo(x, y + ry - KAPPA * ry, x + rx - KAPPA * rx, y, x + rx, y);
- ctx.closePath();
- }
- }
- return new BoundingBox(x, y, x + width, y + height);
- }
- getMarkers() {
- return null;
- }
- }
- class CircleElement extends PathElement {
- constructor() {
- super(...arguments);
- this.type = 'circle';
- }
- path(ctx) {
- var cx = this.getAttribute('cx').getPixels('x');
- var cy = this.getAttribute('cy').getPixels('y');
- var r = this.getAttribute('r').getPixels();
- if (ctx && r > 0) {
- ctx.beginPath();
- ctx.arc(cx, cy, r, 0, Math.PI * 2, false);
- ctx.closePath();
- }
- return new BoundingBox(cx - r, cy - r, cx + r, cy + r);
- }
- getMarkers() {
- return null;
- }
- }
- class EllipseElement extends PathElement {
- constructor() {
- super(...arguments);
- this.type = 'ellipse';
- }
- path(ctx) {
- var KAPPA = 4 * ((Math.sqrt(2) - 1) / 3);
- var rx = this.getAttribute('rx').getPixels('x');
- var ry = this.getAttribute('ry').getPixels('y');
- var cx = this.getAttribute('cx').getPixels('x');
- var cy = this.getAttribute('cy').getPixels('y');
- if (ctx && rx > 0 && ry > 0) {
- ctx.beginPath();
- ctx.moveTo(cx + rx, cy);
- ctx.bezierCurveTo(cx + rx, cy + KAPPA * ry, cx + KAPPA * rx, cy + ry, cx, cy + ry);
- ctx.bezierCurveTo(cx - KAPPA * rx, cy + ry, cx - rx, cy + KAPPA * ry, cx - rx, cy);
- ctx.bezierCurveTo(cx - rx, cy - KAPPA * ry, cx - KAPPA * rx, cy - ry, cx, cy - ry);
- ctx.bezierCurveTo(cx + KAPPA * rx, cy - ry, cx + rx, cy - KAPPA * ry, cx + rx, cy);
- ctx.closePath();
- }
- return new BoundingBox(cx - rx, cy - ry, cx + rx, cy + ry);
- }
- getMarkers() {
- return null;
- }
- }
- class LineElement extends PathElement {
- constructor() {
- super(...arguments);
- this.type = 'line';
- }
- getPoints() {
- return [new Point(this.getAttribute('x1').getPixels('x'), this.getAttribute('y1').getPixels('y')), new Point(this.getAttribute('x2').getPixels('x'), this.getAttribute('y2').getPixels('y'))];
- }
- path(ctx) {
- var [{
- x: x0,
- y: y0
- }, {
- x: x1,
- y: y1
- }] = this.getPoints();
- if (ctx) {
- ctx.beginPath();
- ctx.moveTo(x0, y0);
- ctx.lineTo(x1, y1);
- }
- return new BoundingBox(x0, y0, x1, y1);
- }
- getMarkers() {
- var [p0, p1] = this.getPoints();
- var a = p0.angleTo(p1);
- return [[p0, a], [p1, a]];
- }
- }
- class PolylineElement extends PathElement {
- constructor(document, node, captureTextNodes) {
- super(document, node, captureTextNodes);
- this.type = 'polyline';
- this.points = [];
- this.points = Point.parsePath(this.getAttribute('points').getString());
- }
- path(ctx) {
- var {
- points
- } = this;
- var [{
- x: x0,
- y: y0
- }] = points;
- var boundingBox = new BoundingBox(x0, y0);
- if (ctx) {
- ctx.beginPath();
- ctx.moveTo(x0, y0);
- }
- points.forEach(_ref => {
- var {
- x,
- y
- } = _ref;
- boundingBox.addPoint(x, y);
- if (ctx) {
- ctx.lineTo(x, y);
- }
- });
- return boundingBox;
- }
- getMarkers() {
- var {
- points
- } = this;
- var lastIndex = points.length - 1;
- var markers = [];
- points.forEach((point, i) => {
- if (i === lastIndex) {
- return;
- }
- markers.push([point, point.angleTo(points[i + 1])]);
- });
- if (markers.length > 0) {
- markers.push([points[points.length - 1], markers[markers.length - 1][1]]);
- }
- return markers;
- }
- }
- class PolygonElement extends PolylineElement {
- constructor() {
- super(...arguments);
- this.type = 'polygon';
- }
- path(ctx) {
- var boundingBox = super.path(ctx);
- var [{
- x,
- y
- }] = this.points;
- if (ctx) {
- ctx.lineTo(x, y);
- ctx.closePath();
- }
- return boundingBox;
- }
- }
- class PatternElement extends Element {
- constructor() {
- super(...arguments);
- this.type = 'pattern';
- }
- createPattern(ctx, _, parentOpacityProp) {
- var width = this.getStyle('width').getPixels('x', true);
- var height = this.getStyle('height').getPixels('y', true); // render me using a temporary svg element
- var patternSvg = new SVGElement(this.document, null);
- patternSvg.attributes.viewBox = new Property(this.document, 'viewBox', this.getAttribute('viewBox').getValue());
- patternSvg.attributes.width = new Property(this.document, 'width', "".concat(width, "px"));
- patternSvg.attributes.height = new Property(this.document, 'height', "".concat(height, "px"));
- patternSvg.attributes.transform = new Property(this.document, 'transform', this.getAttribute('patternTransform').getValue());
- patternSvg.children = this.children;
- var patternCanvas = this.document.createCanvas(width, height);
- var patternCtx = patternCanvas.getContext('2d');
- var xAttr = this.getAttribute('x');
- var yAttr = this.getAttribute('y');
- if (xAttr.hasValue() && yAttr.hasValue()) {
- patternCtx.translate(xAttr.getPixels('x', true), yAttr.getPixels('y', true));
- }
- if (parentOpacityProp.hasValue()) {
- this.styles['fill-opacity'] = parentOpacityProp;
- } else {
- Reflect.deleteProperty(this.styles, 'fill-opacity');
- } // render 3x3 grid so when we transform there's no white space on edges
- for (var x = -1; x <= 1; x++) {
- for (var y = -1; y <= 1; y++) {
- patternCtx.save();
- patternSvg.attributes.x = new Property(this.document, 'x', x * patternCanvas.width);
- patternSvg.attributes.y = new Property(this.document, 'y', y * patternCanvas.height);
- patternSvg.render(patternCtx);
- patternCtx.restore();
- }
- }
- var pattern = ctx.createPattern(patternCanvas, 'repeat');
- return pattern;
- }
- }
- class MarkerElement extends Element {
- constructor() {
- super(...arguments);
- this.type = 'marker';
- }
- render(ctx, point, angle) {
- if (!point) {
- return;
- }
- var {
- x,
- y
- } = point;
- var orient = this.getAttribute('orient').getString('auto');
- var markerUnits = this.getAttribute('markerUnits').getString('strokeWidth');
- ctx.translate(x, y);
- if (orient === 'auto') {
- ctx.rotate(angle);
- }
- if (markerUnits === 'strokeWidth') {
- ctx.scale(ctx.lineWidth, ctx.lineWidth);
- }
- ctx.save(); // render me using a temporary svg element
- var markerSvg = new SVGElement(this.document, null);
- markerSvg.type = this.type;
- markerSvg.attributes.viewBox = new Property(this.document, 'viewBox', this.getAttribute('viewBox').getValue());
- markerSvg.attributes.refX = new Property(this.document, 'refX', this.getAttribute('refX').getValue());
- markerSvg.attributes.refY = new Property(this.document, 'refY', this.getAttribute('refY').getValue());
- markerSvg.attributes.width = new Property(this.document, 'width', this.getAttribute('markerWidth').getValue());
- markerSvg.attributes.height = new Property(this.document, 'height', this.getAttribute('markerHeight').getValue());
- markerSvg.attributes.overflow = new Property(this.document, 'overflow', this.getAttribute('overflow').getValue());
- markerSvg.attributes.fill = new Property(this.document, 'fill', this.getAttribute('fill').getColor('black'));
- markerSvg.attributes.stroke = new Property(this.document, 'stroke', this.getAttribute('stroke').getValue('none'));
- markerSvg.children = this.children;
- markerSvg.render(ctx);
- ctx.restore();
- if (markerUnits === 'strokeWidth') {
- ctx.scale(1 / ctx.lineWidth, 1 / ctx.lineWidth);
- }
- if (orient === 'auto') {
- ctx.rotate(-angle);
- }
- ctx.translate(-x, -y);
- }
- }
- class DefsElement extends Element {
- constructor() {
- super(...arguments);
- this.type = 'defs';
- }
- render() {// NOOP
- }
- }
- class GElement extends RenderedElement {
- constructor() {
- super(...arguments);
- this.type = 'g';
- }
- getBoundingBox(ctx) {
- var boundingBox = new BoundingBox();
- this.children.forEach(child => {
- boundingBox.addBoundingBox(child.getBoundingBox(ctx));
- });
- return boundingBox;
- }
- }
- class GradientElement extends Element {
- constructor(document, node, captureTextNodes) {
- super(document, node, captureTextNodes);
- this.attributesToInherit = ['gradientUnits'];
- this.stops = [];
- var {
- stops,
- children
- } = this;
- children.forEach(child => {
- if (child.type === 'stop') {
- stops.push(child);
- }
- });
- }
- getGradientUnits() {
- return this.getAttribute('gradientUnits').getString('objectBoundingBox');
- }
- createGradient(ctx, element, parentOpacityProp) {
- // eslint-disable-next-line @typescript-eslint/no-this-alias, consistent-this
- var stopsContainer = this;
- if (this.getHrefAttribute().hasValue()) {
- stopsContainer = this.getHrefAttribute().getDefinition();
- this.inheritStopContainer(stopsContainer);
- }
- var {
- stops
- } = stopsContainer;
- var gradient = this.getGradient(ctx, element);
- if (!gradient) {
- return this.addParentOpacity(parentOpacityProp, stops[stops.length - 1].color);
- }
- stops.forEach(stop => {
- gradient.addColorStop(stop.offset, this.addParentOpacity(parentOpacityProp, stop.color));
- });
- if (this.getAttribute('gradientTransform').hasValue()) {
- // render as transformed pattern on temporary canvas
- var {
- document
- } = this;
- var {
- MAX_VIRTUAL_PIXELS,
- viewPort
- } = document.screen;
- var [rootView] = viewPort.viewPorts;
- var rect = new RectElement(document, null);
- rect.attributes.x = new Property(document, 'x', -MAX_VIRTUAL_PIXELS / 3.0);
- rect.attributes.y = new Property(document, 'y', -MAX_VIRTUAL_PIXELS / 3.0);
- rect.attributes.width = new Property(document, 'width', MAX_VIRTUAL_PIXELS);
- rect.attributes.height = new Property(document, 'height', MAX_VIRTUAL_PIXELS);
- var group = new GElement(document, null);
- group.attributes.transform = new Property(document, 'transform', this.getAttribute('gradientTransform').getValue());
- group.children = [rect];
- var patternSvg = new SVGElement(document, null);
- patternSvg.attributes.x = new Property(document, 'x', 0);
- patternSvg.attributes.y = new Property(document, 'y', 0);
- patternSvg.attributes.width = new Property(document, 'width', rootView.width);
- patternSvg.attributes.height = new Property(document, 'height', rootView.height);
- patternSvg.children = [group];
- var patternCanvas = document.createCanvas(rootView.width, rootView.height);
- var patternCtx = patternCanvas.getContext('2d');
- patternCtx.fillStyle = gradient;
- patternSvg.render(patternCtx);
- return patternCtx.createPattern(patternCanvas, 'no-repeat');
- }
- return gradient;
- }
- inheritStopContainer(stopsContainer) {
- this.attributesToInherit.forEach(attributeToInherit => {
- if (!this.getAttribute(attributeToInherit).hasValue() && stopsContainer.getAttribute(attributeToInherit).hasValue()) {
- this.getAttribute(attributeToInherit, true).setValue(stopsContainer.getAttribute(attributeToInherit).getValue());
- }
- });
- }
- addParentOpacity(parentOpacityProp, color) {
- if (parentOpacityProp.hasValue()) {
- var colorProp = new Property(this.document, 'color', color);
- return colorProp.addOpacity(parentOpacityProp).getColor();
- }
- return color;
- }
- }
- class LinearGradientElement extends GradientElement {
- constructor(document, node, captureTextNodes) {
- super(document, node, captureTextNodes);
- this.type = 'linearGradient';
- this.attributesToInherit.push('x1', 'y1', 'x2', 'y2');
- }
- getGradient(ctx, element) {
- var isBoundingBoxUnits = this.getGradientUnits() === 'objectBoundingBox';
- var boundingBox = isBoundingBoxUnits ? element.getBoundingBox(ctx) : null;
- if (isBoundingBoxUnits && !boundingBox) {
- return null;
- }
- if (!this.getAttribute('x1').hasValue() && !this.getAttribute('y1').hasValue() && !this.getAttribute('x2').hasValue() && !this.getAttribute('y2').hasValue()) {
- this.getAttribute('x1', true).setValue(0);
- this.getAttribute('y1', true).setValue(0);
- this.getAttribute('x2', true).setValue(1);
- this.getAttribute('y2', true).setValue(0);
- }
- var x1 = isBoundingBoxUnits ? boundingBox.x + boundingBox.width * this.getAttribute('x1').getNumber() : this.getAttribute('x1').getPixels('x');
- var y1 = isBoundingBoxUnits ? boundingBox.y + boundingBox.height * this.getAttribute('y1').getNumber() : this.getAttribute('y1').getPixels('y');
- var x2 = isBoundingBoxUnits ? boundingBox.x + boundingBox.width * this.getAttribute('x2').getNumber() : this.getAttribute('x2').getPixels('x');
- var y2 = isBoundingBoxUnits ? boundingBox.y + boundingBox.height * this.getAttribute('y2').getNumber() : this.getAttribute('y2').getPixels('y');
- if (x1 === x2 && y1 === y2) {
- return null;
- }
- return ctx.createLinearGradient(x1, y1, x2, y2);
- }
- }
- class RadialGradientElement extends GradientElement {
- constructor(document, node, captureTextNodes) {
- super(document, node, captureTextNodes);
- this.type = 'radialGradient';
- this.attributesToInherit.push('cx', 'cy', 'r', 'fx', 'fy', 'fr');
- }
- getGradient(ctx, element) {
- var isBoundingBoxUnits = this.getGradientUnits() === 'objectBoundingBox';
- var boundingBox = element.getBoundingBox(ctx);
- if (isBoundingBoxUnits && !boundingBox) {
- return null;
- }
- if (!this.getAttribute('cx').hasValue()) {
- this.getAttribute('cx', true).setValue('50%');
- }
- if (!this.getAttribute('cy').hasValue()) {
- this.getAttribute('cy', true).setValue('50%');
- }
- if (!this.getAttribute('r').hasValue()) {
- this.getAttribute('r', true).setValue('50%');
- }
- var cx = isBoundingBoxUnits ? boundingBox.x + boundingBox.width * this.getAttribute('cx').getNumber() : this.getAttribute('cx').getPixels('x');
- var cy = isBoundingBoxUnits ? boundingBox.y + boundingBox.height * this.getAttribute('cy').getNumber() : this.getAttribute('cy').getPixels('y');
- var fx = cx;
- var fy = cy;
- if (this.getAttribute('fx').hasValue()) {
- fx = isBoundingBoxUnits ? boundingBox.x + boundingBox.width * this.getAttribute('fx').getNumber() : this.getAttribute('fx').getPixels('x');
- }
- if (this.getAttribute('fy').hasValue()) {
- fy = isBoundingBoxUnits ? boundingBox.y + boundingBox.height * this.getAttribute('fy').getNumber() : this.getAttribute('fy').getPixels('y');
- }
- var r = isBoundingBoxUnits ? (boundingBox.width + boundingBox.height) / 2.0 * this.getAttribute('r').getNumber() : this.getAttribute('r').getPixels();
- var fr = this.getAttribute('fr').getPixels();
- return ctx.createRadialGradient(fx, fy, fr, cx, cy, r);
- }
- }
- class StopElement extends Element {
- constructor(document, node, captureTextNodes) {
- super(document, node, captureTextNodes);
- this.type = 'stop';
- var offset = Math.max(0, Math.min(1, this.getAttribute('offset').getNumber()));
- var stopOpacity = this.getStyle('stop-opacity');
- var stopColor = this.getStyle('stop-color', true);
- if (stopColor.getString() === '') {
- stopColor.setValue('#000');
- }
- if (stopOpacity.hasValue()) {
- stopColor = stopColor.addOpacity(stopOpacity);
- }
- this.offset = offset;
- this.color = stopColor.getColor();
- }
- }
- class AnimateElement extends Element {
- constructor(document, node, captureTextNodes) {
- super(document, node, captureTextNodes);
- this.type = 'animate';
- this.duration = 0;
- this.initialValue = null;
- this.initialUnits = '';
- this.removed = false;
- this.frozen = false;
- document.screen.animations.push(this);
- this.begin = this.getAttribute('begin').getMilliseconds();
- this.maxDuration = this.begin + this.getAttribute('dur').getMilliseconds();
- this.from = this.getAttribute('from');
- this.to = this.getAttribute('to');
- this.values = new Property(document, 'values', null);
- var valuesAttr = this.getAttribute('values');
- if (valuesAttr.hasValue()) {
- this.values.setValue(valuesAttr.getString().split(';'));
- }
- }
- getProperty() {
- var attributeType = this.getAttribute('attributeType').getString();
- var attributeName = this.getAttribute('attributeName').getString();
- if (attributeType === 'CSS') {
- return this.parent.getStyle(attributeName, true);
- }
- return this.parent.getAttribute(attributeName, true);
- }
- calcValue() {
- var {
- initialUnits
- } = this;
- var {
- progress,
- from,
- to
- } = this.getProgress(); // tween value linearly
- var newValue = from.getNumber() + (to.getNumber() - from.getNumber()) * progress;
- if (initialUnits === '%') {
- newValue *= 100.0; // numValue() returns 0-1 whereas properties are 0-100
- }
- return "".concat(newValue).concat(initialUnits);
- }
- update(delta) {
- var {
- parent
- } = this;
- var prop = this.getProperty(); // set initial value
- if (!this.initialValue) {
- this.initialValue = prop.getString();
- this.initialUnits = prop.getUnits();
- } // if we're past the end time
- if (this.duration > this.maxDuration) {
- var fill = this.getAttribute('fill').getString('remove'); // loop for indefinitely repeating animations
- if (this.getAttribute('repeatCount').getString() === 'indefinite' || this.getAttribute('repeatDur').getString() === 'indefinite') {
- this.duration = 0;
- } else if (fill === 'freeze' && !this.frozen) {
- this.frozen = true;
- parent.animationFrozen = true;
- parent.animationFrozenValue = prop.getString();
- } else if (fill === 'remove' && !this.removed) {
- this.removed = true;
- prop.setValue(parent.animationFrozen ? parent.animationFrozenValue : this.initialValue);
- return true;
- }
- return false;
- }
- this.duration += delta; // if we're past the begin time
- var updated = false;
- if (this.begin < this.duration) {
- var newValue = this.calcValue(); // tween
- var typeAttr = this.getAttribute('type');
- if (typeAttr.hasValue()) {
- // for transform, etc.
- var type = typeAttr.getString();
- newValue = "".concat(type, "(").concat(newValue, ")");
- }
- prop.setValue(newValue);
- updated = true;
- }
- return updated;
- }
- getProgress() {
- var {
- document,
- values
- } = this;
- var result = {
- progress: (this.duration - this.begin) / (this.maxDuration - this.begin)
- };
- if (values.hasValue()) {
- var p = result.progress * (values.getValue().length - 1);
- var lb = Math.floor(p);
- var ub = Math.ceil(p);
- result.from = new Property(document, 'from', parseFloat(values.getValue()[lb]));
- result.to = new Property(document, 'to', parseFloat(values.getValue()[ub]));
- result.progress = (p - lb) / (ub - lb);
- } else {
- result.from = this.from;
- result.to = this.to;
- }
- return result;
- }
- }
- class AnimateColorElement extends AnimateElement {
- constructor() {
- super(...arguments);
- this.type = 'animateColor';
- }
- calcValue() {
- var {
- progress,
- from,
- to
- } = this.getProgress();
- var colorFrom = new rgbcolor__WEBPACK_IMPORTED_MODULE_13___default.a(from.getColor());
- var colorTo = new rgbcolor__WEBPACK_IMPORTED_MODULE_13___default.a(to.getColor());
- if (colorFrom.ok && colorTo.ok) {
- // tween color linearly
- var r = colorFrom.r + (colorTo.r - colorFrom.r) * progress;
- var g = colorFrom.g + (colorTo.g - colorFrom.g) * progress;
- var b = colorFrom.b + (colorTo.b - colorFrom.b) * progress; // ? alpha
- return "rgb(".concat(Math.floor(r), ", ").concat(Math.floor(g), ", ").concat(Math.floor(b), ")");
- }
- return this.getAttribute('from').getColor();
- }
- }
- class AnimateTransformElement extends AnimateElement {
- constructor() {
- super(...arguments);
- this.type = 'animateTransform';
- }
- calcValue() {
- var {
- progress,
- from,
- to
- } = this.getProgress(); // tween value linearly
- var transformFrom = toNumbers(from.getString());
- var transformTo = toNumbers(to.getString());
- var newValue = transformFrom.map((from, i) => {
- var to = transformTo[i];
- return from + (to - from) * progress;
- }).join(' ');
- return newValue;
- }
- }
- class FontElement extends Element {
- constructor(document, node, captureTextNodes) {
- super(document, node, captureTextNodes);
- this.type = 'font';
- this.glyphs = {};
- this.horizAdvX = this.getAttribute('horiz-adv-x').getNumber();
- var {
- definitions
- } = document;
- var {
- children
- } = this;
- for (var child of children) {
- switch (child.type) {
- case 'font-face':
- {
- this.fontFace = child;
- var fontFamilyStyle = child.getStyle('font-family');
- if (fontFamilyStyle.hasValue()) {
- definitions[fontFamilyStyle.getString()] = this;
- }
- break;
- }
- case 'missing-glyph':
- this.missingGlyph = child;
- break;
- case 'glyph':
- {
- var glyph = child;
- if (glyph.arabicForm) {
- this.isRTL = true;
- this.isArabic = true;
- if (typeof this.glyphs[glyph.unicode] === 'undefined') {
- this.glyphs[glyph.unicode] = {};
- }
- this.glyphs[glyph.unicode][glyph.arabicForm] = glyph;
- } else {
- this.glyphs[glyph.unicode] = glyph;
- }
- break;
- }
- }
- }
- }
- render() {// NO RENDER
- }
- }
- class FontFaceElement extends Element {
- constructor(document, node, captureTextNodes) {
- super(document, node, captureTextNodes);
- this.type = 'font-face';
- this.ascent = this.getAttribute('ascent').getNumber();
- this.descent = this.getAttribute('descent').getNumber();
- this.unitsPerEm = this.getAttribute('units-per-em').getNumber();
- }
- }
- class MissingGlyphElement extends PathElement {
- constructor() {
- super(...arguments);
- this.type = 'missing-glyph';
- this.horizAdvX = 0;
- }
- }
- class TRefElement extends TextElement {
- constructor() {
- super(...arguments);
- this.type = 'tref';
- }
- getText() {
- var element = this.getHrefAttribute().getDefinition();
- if (element) {
- var firstChild = element.children[0];
- if (firstChild) {
- return firstChild.getText();
- }
- }
- return '';
- }
- }
- class AElement extends TextElement {
- constructor(document, node, captureTextNodes) {
- super(document, node, captureTextNodes);
- this.type = 'a';
- var {
- childNodes
- } = node;
- var firstChild = childNodes[0];
- var hasText = childNodes.length > 0 && Array.from(childNodes).every(node => node.nodeType === 3);
- this.hasText = hasText;
- this.text = hasText ? this.getTextFromNode(firstChild) : '';
- }
- getText() {
- return this.text;
- }
- renderChildren(ctx) {
- if (this.hasText) {
- // render as text element
- super.renderChildren(ctx);
- var {
- document,
- x,
- y
- } = this;
- var {
- mouse
- } = document.screen;
- var fontSize = new Property(document, 'fontSize', Font.parse(document.ctx.font).fontSize); // Do not calc bounding box if mouse is not working.
- if (mouse.isWorking()) {
- mouse.checkBoundingBox(this, new BoundingBox(x, y - fontSize.getPixels('y'), x + this.measureText(ctx), y));
- }
- } else if (this.children.length > 0) {
- // render as temporary group
- var g = new GElement(this.document, null);
- g.children = this.children;
- g.parent = this;
- g.render(ctx);
- }
- }
- onClick() {
- var {
- window
- } = this.document;
- if (window) {
- window.open(this.getHrefAttribute().getString());
- }
- }
- onMouseMove() {
- var ctx = this.document.ctx;
- ctx.canvas.style.cursor = 'pointer';
- }
- }
- function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
- function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$2(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
- class TextPathElement extends TextElement {
- constructor(document, node, captureTextNodes) {
- super(document, node, captureTextNodes);
- this.type = 'textPath';
- this.textWidth = 0;
- this.textHeight = 0;
- this.pathLength = -1;
- this.glyphInfo = null;
- this.letterSpacingCache = [];
- this.measuresCache = new Map([['', 0]]);
- var pathElement = this.getHrefAttribute().getDefinition();
- this.text = this.getTextFromNode();
- this.dataArray = this.parsePathData(pathElement);
- }
- getText() {
- return this.text;
- }
- path(ctx) {
- var {
- dataArray
- } = this;
- if (ctx) {
- ctx.beginPath();
- }
- dataArray.forEach(_ref => {
- var {
- type,
- points
- } = _ref;
- switch (type) {
- case PathParser.LINE_TO:
- if (ctx) {
- ctx.lineTo(points[0], points[1]);
- }
- break;
- case PathParser.MOVE_TO:
- if (ctx) {
- ctx.moveTo(points[0], points[1]);
- }
- break;
- case PathParser.CURVE_TO:
- if (ctx) {
- ctx.bezierCurveTo(points[0], points[1], points[2], points[3], points[4], points[5]);
- }
- break;
- case PathParser.QUAD_TO:
- if (ctx) {
- ctx.quadraticCurveTo(points[0], points[1], points[2], points[3]);
- }
- break;
- case PathParser.ARC:
- {
- var [cx, cy, rx, ry, theta, dTheta, psi, fs] = points;
- var r = rx > ry ? rx : ry;
- var scaleX = rx > ry ? 1 : rx / ry;
- var scaleY = rx > ry ? ry / rx : 1;
- if (ctx) {
- ctx.translate(cx, cy);
- ctx.rotate(psi);
- ctx.scale(scaleX, scaleY);
- ctx.arc(0, 0, r, theta, theta + dTheta, Boolean(1 - fs));
- ctx.scale(1 / scaleX, 1 / scaleY);
- ctx.rotate(-psi);
- ctx.translate(-cx, -cy);
- }
- break;
- }
- case PathParser.CLOSE_PATH:
- if (ctx) {
- ctx.closePath();
- }
- break;
- }
- });
- }
- renderChildren(ctx) {
- this.setTextData(ctx);
- ctx.save();
- var textDecoration = this.parent.getStyle('text-decoration').getString();
- var fontSize = this.getFontSize();
- var {
- glyphInfo
- } = this;
- var fill = ctx.fillStyle;
- if (textDecoration === 'underline') {
- ctx.beginPath();
- }
- glyphInfo.forEach((glyph, i) => {
- var {
- p0,
- p1,
- rotation,
- text: partialText
- } = glyph;
- ctx.save();
- ctx.translate(p0.x, p0.y);
- ctx.rotate(rotation);
- if (ctx.fillStyle) {
- ctx.fillText(partialText, 0, 0);
- }
- if (ctx.strokeStyle) {
- ctx.strokeText(partialText, 0, 0);
- }
- ctx.restore();
- if (textDecoration === 'underline') {
- if (i === 0) {
- ctx.moveTo(p0.x, p0.y + fontSize / 8);
- }
- ctx.lineTo(p1.x, p1.y + fontSize / 5);
- } // // To assist with debugging visually, uncomment following
- //
- // ctx.beginPath();
- // if (i % 2)
- // ctx.strokeStyle = 'red';
- // else
- // ctx.strokeStyle = 'green';
- // ctx.moveTo(p0.x, p0.y);
- // ctx.lineTo(p1.x, p1.y);
- // ctx.stroke();
- // ctx.closePath();
- });
- if (textDecoration === 'underline') {
- ctx.lineWidth = fontSize / 20;
- ctx.strokeStyle = fill;
- ctx.stroke();
- ctx.closePath();
- }
- ctx.restore();
- }
- getLetterSpacingAt() {
- var idx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
- return this.letterSpacingCache[idx] || 0;
- }
- findSegmentToFitChar(ctx, anchor, textFullWidth, fullPathWidth, spacesNumber, inputOffset, dy, c, charI) {
- var offset = inputOffset;
- var glyphWidth = this.measureText(ctx, c);
- if (c === ' ' && anchor === 'justify' && textFullWidth < fullPathWidth) {
- glyphWidth += (fullPathWidth - textFullWidth) / spacesNumber;
- }
- if (charI > -1) {
- offset += this.getLetterSpacingAt(charI);
- }
- var splineStep = this.textHeight / 20;
- var p0 = this.getEquidistantPointOnPath(offset, splineStep, 0);
- var p1 = this.getEquidistantPointOnPath(offset + glyphWidth, splineStep, 0);
- var segment = {
- p0,
- p1
- };
- var rotation = p0 && p1 ? Math.atan2(p1.y - p0.y, p1.x - p0.x) : 0;
- if (dy) {
- var dyX = Math.cos(Math.PI / 2 + rotation) * dy;
- var dyY = Math.cos(-rotation) * dy;
- segment.p0 = _objectSpread$2(_objectSpread$2({}, p0), {}, {
- x: p0.x + dyX,
- y: p0.y + dyY
- });
- segment.p1 = _objectSpread$2(_objectSpread$2({}, p1), {}, {
- x: p1.x + dyX,
- y: p1.y + dyY
- });
- }
- offset += glyphWidth;
- return {
- offset,
- segment,
- rotation
- };
- }
- measureText(ctx, text) {
- var {
- measuresCache
- } = this;
- var targetText = text || this.getText();
- if (measuresCache.has(targetText)) {
- return measuresCache.get(targetText);
- }
- var measure = this.measureTargetText(ctx, targetText);
- measuresCache.set(targetText, measure);
- return measure;
- } // This method supposes what all custom fonts already loaded.
- // If some font will be loaded after this method call, <textPath> will not be rendered correctly.
- // You need to call this method manually to update glyphs cache.
- setTextData(ctx) {
- if (this.glyphInfo) {
- return;
- }
- var renderText = this.getText();
- var chars = renderText.split('');
- var spacesNumber = renderText.split(' ').length - 1;
- var dx = this.parent.getAttribute('dx').split().map(_ => _.getPixels('x'));
- var dy = this.parent.getAttribute('dy').getPixels('y');
- var anchor = this.parent.getStyle('text-anchor').getString('start');
- var thisSpacing = this.getStyle('letter-spacing');
- var parentSpacing = this.parent.getStyle('letter-spacing');
- var letterSpacing = 0;
- if (!thisSpacing.hasValue() || thisSpacing.getValue() === 'inherit') {
- letterSpacing = parentSpacing.getPixels();
- } else if (thisSpacing.hasValue()) {
- if (thisSpacing.getValue() !== 'initial' && thisSpacing.getValue() !== 'unset') {
- letterSpacing = thisSpacing.getPixels();
- }
- } // fill letter-spacing cache
- var letterSpacingCache = [];
- var textLen = renderText.length;
- this.letterSpacingCache = letterSpacingCache;
- for (var i = 0; i < textLen; i++) {
- letterSpacingCache.push(typeof dx[i] !== 'undefined' ? dx[i] : letterSpacing);
- }
- var dxSum = letterSpacingCache.reduce((acc, cur, i) => i === 0 ? 0 : acc + cur || 0, 0);
- var textWidth = this.measureText(ctx);
- var textFullWidth = Math.max(textWidth + dxSum, 0);
- this.textWidth = textWidth;
- this.textHeight = this.getFontSize();
- this.glyphInfo = [];
- var fullPathWidth = this.getPathLength();
- var startOffset = this.getStyle('startOffset').getNumber(0) * fullPathWidth;
- var offset = 0;
- if (anchor === 'middle' || anchor === 'center') {
- offset = -textFullWidth / 2;
- }
- if (anchor === 'end' || anchor === 'right') {
- offset = -textFullWidth;
- }
- offset += startOffset;
- chars.forEach((char, i) => {
- // Find such segment what distance between p0 and p1 is approx. width of glyph
- var {
- offset: nextOffset,
- segment,
- rotation
- } = this.findSegmentToFitChar(ctx, anchor, textFullWidth, fullPathWidth, spacesNumber, offset, dy, char, i);
- offset = nextOffset;
- if (!segment.p0 || !segment.p1) {
- return;
- } // const width = this.getLineLength(
- // segment.p0.x,
- // segment.p0.y,
- // segment.p1.x,
- // segment.p1.y
- // );
- // Note: Since glyphs are rendered one at a time, any kerning pair data built into the font will not be used.
- // Can foresee having a rough pair table built in that the developer can override as needed.
- // Or use "dx" attribute of the <text> node as a naive replacement
- // const kern = 0;
- // placeholder for future implementation
- // const midpoint = this.getPointOnLine(
- // kern + width / 2.0,
- // segment.p0.x, segment.p0.y, segment.p1.x, segment.p1.y
- // );
- this.glyphInfo.push({
- // transposeX: midpoint.x,
- // transposeY: midpoint.y,
- text: chars[i],
- p0: segment.p0,
- p1: segment.p1,
- rotation
- });
- });
- }
- parsePathData(path) {
- this.pathLength = -1; // reset path length
- if (!path) {
- return [];
- }
- var pathCommands = [];
- var {
- pathParser
- } = path;
- pathParser.reset(); // convert l, H, h, V, and v to L
- while (!pathParser.isEnd()) {
- var {
- current
- } = pathParser;
- var startX = current ? current.x : 0;
- var startY = current ? current.y : 0;
- var command = pathParser.next();
- var nextCommandType = command.type;
- var points = [];
- switch (command.type) {
- case PathParser.MOVE_TO:
- this.pathM(pathParser, points);
- break;
- case PathParser.LINE_TO:
- nextCommandType = this.pathL(pathParser, points);
- break;
- case PathParser.HORIZ_LINE_TO:
- nextCommandType = this.pathH(pathParser, points);
- break;
- case PathParser.VERT_LINE_TO:
- nextCommandType = this.pathV(pathParser, points);
- break;
- case PathParser.CURVE_TO:
- this.pathC(pathParser, points);
- break;
- case PathParser.SMOOTH_CURVE_TO:
- nextCommandType = this.pathS(pathParser, points);
- break;
- case PathParser.QUAD_TO:
- this.pathQ(pathParser, points);
- break;
- case PathParser.SMOOTH_QUAD_TO:
- nextCommandType = this.pathT(pathParser, points);
- break;
- case PathParser.ARC:
- points = this.pathA(pathParser);
- break;
- case PathParser.CLOSE_PATH:
- PathElement.pathZ(pathParser);
- break;
- }
- if (command.type !== PathParser.CLOSE_PATH) {
- pathCommands.push({
- type: nextCommandType,
- points,
- start: {
- x: startX,
- y: startY
- },
- pathLength: this.calcLength(startX, startY, nextCommandType, points)
- });
- } else {
- pathCommands.push({
- type: PathParser.CLOSE_PATH,
- points: [],
- pathLength: 0
- });
- }
- }
- return pathCommands;
- }
- pathM(pathParser, points) {
- var {
- x,
- y
- } = PathElement.pathM(pathParser).point;
- points.push(x, y);
- }
- pathL(pathParser, points) {
- var {
- x,
- y
- } = PathElement.pathL(pathParser).point;
- points.push(x, y);
- return PathParser.LINE_TO;
- }
- pathH(pathParser, points) {
- var {
- x,
- y
- } = PathElement.pathH(pathParser).point;
- points.push(x, y);
- return PathParser.LINE_TO;
- }
- pathV(pathParser, points) {
- var {
- x,
- y
- } = PathElement.pathV(pathParser).point;
- points.push(x, y);
- return PathParser.LINE_TO;
- }
- pathC(pathParser, points) {
- var {
- point,
- controlPoint,
- currentPoint
- } = PathElement.pathC(pathParser);
- points.push(point.x, point.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
- }
- pathS(pathParser, points) {
- var {
- point,
- controlPoint,
- currentPoint
- } = PathElement.pathS(pathParser);
- points.push(point.x, point.y, controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
- return PathParser.CURVE_TO;
- }
- pathQ(pathParser, points) {
- var {
- controlPoint,
- currentPoint
- } = PathElement.pathQ(pathParser);
- points.push(controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
- }
- pathT(pathParser, points) {
- var {
- controlPoint,
- currentPoint
- } = PathElement.pathT(pathParser);
- points.push(controlPoint.x, controlPoint.y, currentPoint.x, currentPoint.y);
- return PathParser.QUAD_TO;
- }
- pathA(pathParser) {
- var {
- rX,
- rY,
- sweepFlag,
- xAxisRotation,
- centp,
- a1,
- ad
- } = PathElement.pathA(pathParser);
- if (sweepFlag === 0 && ad > 0) {
- ad -= 2 * Math.PI;
- }
- if (sweepFlag === 1 && ad < 0) {
- ad += 2 * Math.PI;
- }
- return [centp.x, centp.y, rX, rY, a1, ad, xAxisRotation, sweepFlag];
- }
- calcLength(x, y, commandType, points) {
- var len = 0;
- var p1 = null;
- var p2 = null;
- var t = 0;
- switch (commandType) {
- case PathParser.LINE_TO:
- return this.getLineLength(x, y, points[0], points[1]);
- case PathParser.CURVE_TO:
- // Approximates by breaking curve into 100 line segments
- len = 0.0;
- p1 = this.getPointOnCubicBezier(0, x, y, points[0], points[1], points[2], points[3], points[4], points[5]);
- for (t = 0.01; t <= 1; t += 0.01) {
- p2 = this.getPointOnCubicBezier(t, x, y, points[0], points[1], points[2], points[3], points[4], points[5]);
- len += this.getLineLength(p1.x, p1.y, p2.x, p2.y);
- p1 = p2;
- }
- return len;
- case PathParser.QUAD_TO:
- // Approximates by breaking curve into 100 line segments
- len = 0.0;
- p1 = this.getPointOnQuadraticBezier(0, x, y, points[0], points[1], points[2], points[3]);
- for (t = 0.01; t <= 1; t += 0.01) {
- p2 = this.getPointOnQuadraticBezier(t, x, y, points[0], points[1], points[2], points[3]);
- len += this.getLineLength(p1.x, p1.y, p2.x, p2.y);
- p1 = p2;
- }
- return len;
- case PathParser.ARC:
- {
- // Approximates by breaking curve into line segments
- len = 0.0;
- var start = points[4]; // 4 = theta
- var dTheta = points[5]; // 5 = dTheta
- var end = points[4] + dTheta;
- var inc = Math.PI / 180.0; // 1 degree resolution
- if (Math.abs(start - end) < inc) {
- inc = Math.abs(start - end);
- } // Note: for purpose of calculating arc length, not going to worry about rotating X-axis by angle psi
- p1 = this.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], start, 0);
- if (dTheta < 0) {
- // clockwise
- for (t = start - inc; t > end; t -= inc) {
- p2 = this.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], t, 0);
- len += this.getLineLength(p1.x, p1.y, p2.x, p2.y);
- p1 = p2;
- }
- } else {
- // counter-clockwise
- for (t = start + inc; t < end; t += inc) {
- p2 = this.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], t, 0);
- len += this.getLineLength(p1.x, p1.y, p2.x, p2.y);
- p1 = p2;
- }
- }
- p2 = this.getPointOnEllipticalArc(points[0], points[1], points[2], points[3], end, 0);
- len += this.getLineLength(p1.x, p1.y, p2.x, p2.y);
- return len;
- }
- }
- return 0;
- }
- getPointOnLine(dist, p1x, p1y, p2x, p2y) {
- var fromX = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : p1x;
- var fromY = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : p1y;
- var m = (p2y - p1y) / (p2x - p1x + PSEUDO_ZERO);
- var run = Math.sqrt(dist * dist / (1 + m * m));
- if (p2x < p1x) {
- run *= -1;
- }
- var rise = m * run;
- var pt = null;
- if (p2x === p1x) {
- // vertical line
- pt = {
- x: fromX,
- y: fromY + rise
- };
- } else if ((fromY - p1y) / (fromX - p1x + PSEUDO_ZERO) === m) {
- pt = {
- x: fromX + run,
- y: fromY + rise
- };
- } else {
- var ix = 0;
- var iy = 0;
- var len = this.getLineLength(p1x, p1y, p2x, p2y);
- if (len < PSEUDO_ZERO) {
- return null;
- }
- var u = (fromX - p1x) * (p2x - p1x) + (fromY - p1y) * (p2y - p1y);
- u /= len * len;
- ix = p1x + u * (p2x - p1x);
- iy = p1y + u * (p2y - p1y);
- var pRise = this.getLineLength(fromX, fromY, ix, iy);
- var pRun = Math.sqrt(dist * dist - pRise * pRise);
- run = Math.sqrt(pRun * pRun / (1 + m * m));
- if (p2x < p1x) {
- run *= -1;
- }
- rise = m * run;
- pt = {
- x: ix + run,
- y: iy + rise
- };
- }
- return pt;
- }
- getPointOnPath(distance) {
- var fullLen = this.getPathLength();
- var cumulativePathLength = 0;
- var p = null;
- if (distance < -0.00005 || distance - 0.00005 > fullLen) {
- return null;
- }
- var {
- dataArray
- } = this;
- for (var command of dataArray) {
- if (command && (command.pathLength < 0.00005 || cumulativePathLength + command.pathLength + 0.00005 < distance)) {
- cumulativePathLength += command.pathLength;
- continue;
- }
- var delta = distance - cumulativePathLength;
- var currentT = 0;
- switch (command.type) {
- case PathParser.LINE_TO:
- p = this.getPointOnLine(delta, command.start.x, command.start.y, command.points[0], command.points[1], command.start.x, command.start.y);
- break;
- case PathParser.ARC:
- {
- var start = command.points[4]; // 4 = theta
- var dTheta = command.points[5]; // 5 = dTheta
- var end = command.points[4] + dTheta;
- currentT = start + delta / command.pathLength * dTheta;
- if (dTheta < 0 && currentT < end || dTheta >= 0 && currentT > end) {
- break;
- }
- p = this.getPointOnEllipticalArc(command.points[0], command.points[1], command.points[2], command.points[3], currentT, command.points[6]);
- break;
- }
- case PathParser.CURVE_TO:
- currentT = delta / command.pathLength;
- if (currentT > 1) {
- currentT = 1;
- }
- p = this.getPointOnCubicBezier(currentT, command.start.x, command.start.y, command.points[0], command.points[1], command.points[2], command.points[3], command.points[4], command.points[5]);
- break;
- case PathParser.QUAD_TO:
- currentT = delta / command.pathLength;
- if (currentT > 1) {
- currentT = 1;
- }
- p = this.getPointOnQuadraticBezier(currentT, command.start.x, command.start.y, command.points[0], command.points[1], command.points[2], command.points[3]);
- break;
- }
- if (p) {
- return p;
- }
- break;
- }
- return null;
- }
- getLineLength(x1, y1, x2, y2) {
- return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
- }
- getPathLength() {
- if (this.pathLength === -1) {
- this.pathLength = this.dataArray.reduce((length, command) => command.pathLength > 0 ? length + command.pathLength : length, 0);
- }
- return this.pathLength;
- }
- getPointOnCubicBezier(pct, p1x, p1y, p2x, p2y, p3x, p3y, p4x, p4y) {
- var x = p4x * CB1(pct) + p3x * CB2(pct) + p2x * CB3(pct) + p1x * CB4(pct);
- var y = p4y * CB1(pct) + p3y * CB2(pct) + p2y * CB3(pct) + p1y * CB4(pct);
- return {
- x,
- y
- };
- }
- getPointOnQuadraticBezier(pct, p1x, p1y, p2x, p2y, p3x, p3y) {
- var x = p3x * QB1(pct) + p2x * QB2(pct) + p1x * QB3(pct);
- var y = p3y * QB1(pct) + p2y * QB2(pct) + p1y * QB3(pct);
- return {
- x,
- y
- };
- }
- getPointOnEllipticalArc(cx, cy, rx, ry, theta, psi) {
- var cosPsi = Math.cos(psi);
- var sinPsi = Math.sin(psi);
- var pt = {
- x: rx * Math.cos(theta),
- y: ry * Math.sin(theta)
- };
- return {
- x: cx + (pt.x * cosPsi - pt.y * sinPsi),
- y: cy + (pt.x * sinPsi + pt.y * cosPsi)
- };
- } // TODO need some optimisations. possibly build cache only for curved segments?
- buildEquidistantCache(inputStep, inputPrecision) {
- var fullLen = this.getPathLength();
- var precision = inputPrecision || 0.25; // accuracy vs performance
- var step = inputStep || fullLen / 100;
- if (!this.equidistantCache || this.equidistantCache.step !== step || this.equidistantCache.precision !== precision) {
- // Prepare cache
- this.equidistantCache = {
- step,
- precision,
- points: []
- }; // Calculate points
- var s = 0;
- for (var l = 0; l <= fullLen; l += precision) {
- var p0 = this.getPointOnPath(l);
- var p1 = this.getPointOnPath(l + precision);
- if (!p0 || !p1) {
- continue;
- }
- s += this.getLineLength(p0.x, p0.y, p1.x, p1.y);
- if (s >= step) {
- this.equidistantCache.points.push({
- x: p0.x,
- y: p0.y,
- distance: l
- });
- s -= step;
- }
- }
- }
- }
- getEquidistantPointOnPath(targetDistance, step, precision) {
- this.buildEquidistantCache(step, precision);
- if (targetDistance < 0 || targetDistance - this.getPathLength() > 0.00005) {
- return null;
- }
- var idx = Math.round(targetDistance / this.getPathLength() * (this.equidistantCache.points.length - 1));
- return this.equidistantCache.points[idx] || null;
- }
- }
- var dataUriRegex = /^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;
- class ImageElement extends RenderedElement {
- constructor(document, node, captureTextNodes) {
- super(document, node, captureTextNodes);
- this.type = 'image';
- this.loaded = false;
- var href = this.getHrefAttribute().getString();
- if (!href) {
- return;
- }
- var isSvg = href.endsWith('.svg') || /^\s*data:image\/svg\+xml/i.test(href);
- document.images.push(this);
- if (!isSvg) {
- void this.loadImage(href);
- } else {
- void this.loadSvg(href);
- }
- this.isSvg = isSvg;
- }
- loadImage(href) {
- var _this = this;
- return _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(function* () {
- try {
- var image = yield _this.document.createImage(href);
- _this.image = image;
- } catch (err) {
- console.error("Error while loading image \"".concat(href, "\":"), err);
- }
- _this.loaded = true;
- })();
- }
- loadSvg(href) {
- var _this2 = this;
- return _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(function* () {
- var match = dataUriRegex.exec(href);
- if (match) {
- var data = match[5];
- if (match[4] === 'base64') {
- _this2.image = atob(data);
- } else {
- _this2.image = decodeURIComponent(data);
- }
- } else {
- try {
- var response = yield _this2.document.fetch(href);
- var svg = yield response.text();
- _this2.image = svg;
- } catch (err) {
- console.error("Error while loading image \"".concat(href, "\":"), err);
- }
- }
- _this2.loaded = true;
- })();
- }
- renderChildren(ctx) {
- var {
- document,
- image,
- loaded
- } = this;
- var x = this.getAttribute('x').getPixels('x');
- var y = this.getAttribute('y').getPixels('y');
- var width = this.getStyle('width').getPixels('x');
- var height = this.getStyle('height').getPixels('y');
- if (!loaded || !image || !width || !height) {
- return;
- }
- ctx.save();
- ctx.translate(x, y);
- if (this.isSvg) {
- var subDocument = document.canvg.forkString(ctx, this.image, {
- ignoreMouse: true,
- ignoreAnimation: true,
- ignoreDimensions: true,
- ignoreClear: true,
- offsetX: 0,
- offsetY: 0,
- scaleWidth: width,
- scaleHeight: height
- });
- subDocument.document.documentElement.parent = this;
- void subDocument.render();
- } else {
- var _image = this.image;
- document.setViewBox({
- ctx,
- aspectRatio: this.getAttribute('preserveAspectRatio').getString(),
- width,
- desiredWidth: _image.width,
- height,
- desiredHeight: _image.height
- });
- if (this.loaded) {
- if (typeof _image.complete === 'undefined' || _image.complete) {
- ctx.drawImage(_image, 0, 0);
- }
- }
- }
- ctx.restore();
- }
- getBoundingBox() {
- var x = this.getAttribute('x').getPixels('x');
- var y = this.getAttribute('y').getPixels('y');
- var width = this.getStyle('width').getPixels('x');
- var height = this.getStyle('height').getPixels('y');
- return new BoundingBox(x, y, x + width, y + height);
- }
- }
- class SymbolElement extends RenderedElement {
- constructor() {
- super(...arguments);
- this.type = 'symbol';
- }
- render(_) {// NO RENDER
- }
- }
- class SVGFontLoader {
- constructor(document) {
- this.document = document;
- this.loaded = false;
- document.fonts.push(this);
- }
- load(fontFamily, url) {
- var _this = this;
- return _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(function* () {
- try {
- var {
- document
- } = _this;
- var svgDocument = yield document.canvg.parser.load(url);
- var fonts = svgDocument.getElementsByTagName('font');
- Array.from(fonts).forEach(fontNode => {
- var font = document.createElement(fontNode);
- document.definitions[fontFamily] = font;
- });
- } catch (err) {
- console.error("Error while loading font \"".concat(url, "\":"), err);
- }
- _this.loaded = true;
- })();
- }
- }
- class StyleElement extends Element {
- constructor(document, node, captureTextNodes) {
- super(document, node, captureTextNodes);
- this.type = 'style';
- var css = compressSpaces(Array.from(node.childNodes) // NEED TEST
- .map(_ => _.textContent).join('').replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm, '') // remove comments
- .replace(/@import.*;/g, '') // remove imports
- );
- var cssDefs = css.split('}');
- cssDefs.forEach(_ => {
- var def = _.trim();
- if (!def) {
- return;
- }
- var cssParts = def.split('{');
- var cssClasses = cssParts[0].split(',');
- var cssProps = cssParts[1].split(';');
- cssClasses.forEach(_ => {
- var cssClass = _.trim();
- if (!cssClass) {
- return;
- }
- var props = document.styles[cssClass] || {};
- cssProps.forEach(cssProp => {
- var prop = cssProp.indexOf(':');
- var name = cssProp.substr(0, prop).trim();
- var value = cssProp.substr(prop + 1, cssProp.length - prop).trim();
- if (name && value) {
- props[name] = new Property(document, name, value);
- }
- });
- document.styles[cssClass] = props;
- document.stylesSpecificity[cssClass] = getSelectorSpecificity(cssClass);
- if (cssClass === '@font-face') {
- // && !nodeEnv
- var fontFamily = props['font-family'].getString().replace(/"|'/g, '');
- var srcs = props.src.getString().split(',');
- srcs.forEach(src => {
- if (src.indexOf('format("svg")') > 0) {
- var url = parseExternalUrl(src);
- if (url) {
- void new SVGFontLoader(document).load(fontFamily, url);
- }
- }
- });
- }
- });
- });
- }
- }
- StyleElement.parseExternalUrl = parseExternalUrl;
- class UseElement extends RenderedElement {
- constructor() {
- super(...arguments);
- this.type = 'use';
- }
- setContext(ctx) {
- super.setContext(ctx);
- var xAttr = this.getAttribute('x');
- var yAttr = this.getAttribute('y');
- if (xAttr.hasValue()) {
- ctx.translate(xAttr.getPixels('x'), 0);
- }
- if (yAttr.hasValue()) {
- ctx.translate(0, yAttr.getPixels('y'));
- }
- }
- path(ctx) {
- var {
- element
- } = this;
- if (element) {
- element.path(ctx);
- }
- }
- renderChildren(ctx) {
- var {
- document,
- element
- } = this;
- if (element) {
- var tempSvg = element;
- if (element.type === 'symbol') {
- // render me using a temporary svg element in symbol cases (http://www.w3.org/TR/SVG/struct.html#UseElement)
- tempSvg = new SVGElement(document, null);
- tempSvg.attributes.viewBox = new Property(document, 'viewBox', element.getAttribute('viewBox').getString());
- tempSvg.attributes.preserveAspectRatio = new Property(document, 'preserveAspectRatio', element.getAttribute('preserveAspectRatio').getString());
- tempSvg.attributes.overflow = new Property(document, 'overflow', element.getAttribute('overflow').getString());
- tempSvg.children = element.children; // element is still the parent of the children
- element.styles.opacity = new Property(document, 'opacity', this.calculateOpacity());
- }
- if (tempSvg.type === 'svg') {
- var widthStyle = this.getStyle('width', false, true);
- var heightStyle = this.getStyle('height', false, true); // if symbol or svg, inherit width/height from me
- if (widthStyle.hasValue()) {
- tempSvg.attributes.width = new Property(document, 'width', widthStyle.getString());
- }
- if (heightStyle.hasValue()) {
- tempSvg.attributes.height = new Property(document, 'height', heightStyle.getString());
- }
- }
- var oldParent = tempSvg.parent;
- tempSvg.parent = this;
- tempSvg.render(ctx);
- tempSvg.parent = oldParent;
- }
- }
- getBoundingBox(ctx) {
- var {
- element
- } = this;
- if (element) {
- return element.getBoundingBox(ctx);
- }
- return null;
- }
- elementTransform() {
- var {
- document,
- element
- } = this;
- return Transform.fromElement(document, element);
- }
- get element() {
- if (!this.cachedElement) {
- this.cachedElement = this.getHrefAttribute().getDefinition();
- }
- return this.cachedElement;
- }
- }
- function imGet(img, x, y, width, _height, rgba) {
- return img[y * width * 4 + x * 4 + rgba];
- }
- function imSet(img, x, y, width, _height, rgba, val) {
- img[y * width * 4 + x * 4 + rgba] = val;
- }
- function m(matrix, i, v) {
- var mi = matrix[i];
- return mi * v;
- }
- function c(a, m1, m2, m3) {
- return m1 + Math.cos(a) * m2 + Math.sin(a) * m3;
- }
- class FeColorMatrixElement extends Element {
- constructor(document, node, captureTextNodes) {
- super(document, node, captureTextNodes);
- this.type = 'feColorMatrix';
- var matrix = toNumbers(this.getAttribute('values').getString());
- switch (this.getAttribute('type').getString('matrix')) {
- // http://www.w3.org/TR/SVG/filters.html#feColorMatrixElement
- case 'saturate':
- {
- var s = matrix[0];
- /* eslint-disable array-element-newline */
- matrix = [0.213 + 0.787 * s, 0.715 - 0.715 * s, 0.072 - 0.072 * s, 0, 0, 0.213 - 0.213 * s, 0.715 + 0.285 * s, 0.072 - 0.072 * s, 0, 0, 0.213 - 0.213 * s, 0.715 - 0.715 * s, 0.072 + 0.928 * s, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
- /* eslint-enable array-element-newline */
- break;
- }
- case 'hueRotate':
- {
- var a = matrix[0] * Math.PI / 180.0;
- /* eslint-disable array-element-newline */
- matrix = [c(a, 0.213, 0.787, -0.213), c(a, 0.715, -0.715, -0.715), c(a, 0.072, -0.072, 0.928), 0, 0, c(a, 0.213, -0.213, 0.143), c(a, 0.715, 0.285, 0.140), c(a, 0.072, -0.072, -0.283), 0, 0, c(a, 0.213, -0.213, -0.787), c(a, 0.715, -0.715, 0.715), c(a, 0.072, 0.928, 0.072), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
- /* eslint-enable array-element-newline */
- break;
- }
- case 'luminanceToAlpha':
- /* eslint-disable array-element-newline */
- matrix = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2125, 0.7154, 0.0721, 0, 0, 0, 0, 0, 0, 1];
- /* eslint-enable array-element-newline */
- break;
- }
- this.matrix = matrix;
- this.includeOpacity = this.getAttribute('includeOpacity').hasValue();
- }
- apply(ctx, _x, _y, width, height) {
- // assuming x==0 && y==0 for now
- var {
- includeOpacity,
- matrix
- } = this;
- var srcData = ctx.getImageData(0, 0, width, height);
- for (var y = 0; y < height; y++) {
- for (var x = 0; x < width; x++) {
- var r = imGet(srcData.data, x, y, width, height, 0);
- var g = imGet(srcData.data, x, y, width, height, 1);
- var b = imGet(srcData.data, x, y, width, height, 2);
- var a = imGet(srcData.data, x, y, width, height, 3);
- var nr = m(matrix, 0, r) + m(matrix, 1, g) + m(matrix, 2, b) + m(matrix, 3, a) + m(matrix, 4, 1);
- var ng = m(matrix, 5, r) + m(matrix, 6, g) + m(matrix, 7, b) + m(matrix, 8, a) + m(matrix, 9, 1);
- var nb = m(matrix, 10, r) + m(matrix, 11, g) + m(matrix, 12, b) + m(matrix, 13, a) + m(matrix, 14, 1);
- var na = m(matrix, 15, r) + m(matrix, 16, g) + m(matrix, 17, b) + m(matrix, 18, a) + m(matrix, 19, 1);
- if (includeOpacity) {
- nr = 0;
- ng = 0;
- nb = 0;
- na *= a / 255;
- }
- imSet(srcData.data, x, y, width, height, 0, nr);
- imSet(srcData.data, x, y, width, height, 1, ng);
- imSet(srcData.data, x, y, width, height, 2, nb);
- imSet(srcData.data, x, y, width, height, 3, na);
- }
- }
- ctx.clearRect(0, 0, width, height);
- ctx.putImageData(srcData, 0, 0);
- }
- }
- class MaskElement extends Element {
- constructor() {
- super(...arguments);
- this.type = 'mask';
- }
- apply(ctx, element) {
- var {
- document
- } = this; // render as temp svg
- var x = this.getAttribute('x').getPixels('x');
- var y = this.getAttribute('y').getPixels('y');
- var width = this.getStyle('width').getPixels('x');
- var height = this.getStyle('height').getPixels('y');
- if (!width && !height) {
- var boundingBox = new BoundingBox();
- this.children.forEach(child => {
- boundingBox.addBoundingBox(child.getBoundingBox(ctx));
- });
- x = Math.floor(boundingBox.x1);
- y = Math.floor(boundingBox.y1);
- width = Math.floor(boundingBox.width);
- height = Math.floor(boundingBox.height);
- }
- var ignoredStyles = this.removeStyles(element, MaskElement.ignoreStyles);
- var maskCanvas = document.createCanvas(x + width, y + height);
- var maskCtx = maskCanvas.getContext('2d');
- document.screen.setDefaults(maskCtx);
- this.renderChildren(maskCtx); // convert mask to alpha with a fake node
- // TODO: refactor out apply from feColorMatrix
- new FeColorMatrixElement(document, {
- nodeType: 1,
- childNodes: [],
- attributes: [{
- nodeName: 'type',
- value: 'luminanceToAlpha'
- }, {
- nodeName: 'includeOpacity',
- value: 'true'
- }]
- }).apply(maskCtx, 0, 0, x + width, y + height);
- var tmpCanvas = document.createCanvas(x + width, y + height);
- var tmpCtx = tmpCanvas.getContext('2d');
- document.screen.setDefaults(tmpCtx);
- element.render(tmpCtx);
- tmpCtx.globalCompositeOperation = 'destination-in';
- tmpCtx.fillStyle = maskCtx.createPattern(maskCanvas, 'no-repeat');
- tmpCtx.fillRect(0, 0, x + width, y + height);
- ctx.fillStyle = tmpCtx.createPattern(tmpCanvas, 'no-repeat');
- ctx.fillRect(0, 0, x + width, y + height); // reassign mask
- this.restoreStyles(element, ignoredStyles);
- }
- render(_) {// NO RENDER
- }
- }
- MaskElement.ignoreStyles = ['mask', 'transform', 'clip-path'];
- var noop = () => {// NOOP
- };
- class ClipPathElement extends Element {
- constructor() {
- super(...arguments);
- this.type = 'clipPath';
- }
- apply(ctx) {
- var {
- document
- } = this;
- var contextProto = Reflect.getPrototypeOf(ctx);
- var {
- beginPath,
- closePath
- } = ctx;
- if (contextProto) {
- contextProto.beginPath = noop;
- contextProto.closePath = noop;
- }
- Reflect.apply(beginPath, ctx, []);
- this.children.forEach(child => {
- if (typeof child.path === 'undefined') {
- return;
- }
- var transform = typeof child.elementTransform !== 'undefined' ? child.elementTransform() : null; // handle <use />
- if (!transform) {
- transform = Transform.fromElement(document, child);
- }
- if (transform) {
- transform.apply(ctx);
- }
- child.path(ctx);
- if (contextProto) {
- contextProto.closePath = closePath;
- }
- if (transform) {
- transform.unapply(ctx);
- }
- });
- Reflect.apply(closePath, ctx, []);
- ctx.clip();
- if (contextProto) {
- contextProto.beginPath = beginPath;
- contextProto.closePath = closePath;
- }
- }
- render(_) {// NO RENDER
- }
- }
- class FilterElement extends Element {
- constructor() {
- super(...arguments);
- this.type = 'filter';
- }
- apply(ctx, element) {
- // render as temp svg
- var {
- document,
- children
- } = this;
- var boundingBox = element.getBoundingBox(ctx);
- if (!boundingBox) {
- return;
- }
- var px = 0;
- var py = 0;
- children.forEach(child => {
- var efd = child.extraFilterDistance || 0;
- px = Math.max(px, efd);
- py = Math.max(py, efd);
- });
- var width = Math.floor(boundingBox.width);
- var height = Math.floor(boundingBox.height);
- var tmpCanvasWidth = width + 2 * px;
- var tmpCanvasHeight = height + 2 * py;
- if (tmpCanvasWidth < 1 || tmpCanvasHeight < 1) {
- return;
- }
- var x = Math.floor(boundingBox.x);
- var y = Math.floor(boundingBox.y);
- var ignoredStyles = this.removeStyles(element, FilterElement.ignoreStyles);
- var tmpCanvas = document.createCanvas(tmpCanvasWidth, tmpCanvasHeight);
- var tmpCtx = tmpCanvas.getContext('2d');
- document.screen.setDefaults(tmpCtx);
- tmpCtx.translate(-x + px, -y + py);
- element.render(tmpCtx); // apply filters
- children.forEach(child => {
- if (typeof child.apply === 'function') {
- child.apply(tmpCtx, 0, 0, tmpCanvasWidth, tmpCanvasHeight);
- }
- }); // render on me
- ctx.drawImage(tmpCanvas, 0, 0, tmpCanvasWidth, tmpCanvasHeight, x - px, y - py, tmpCanvasWidth, tmpCanvasHeight);
- this.restoreStyles(element, ignoredStyles);
- }
- render(_) {// NO RENDER
- }
- }
- FilterElement.ignoreStyles = ['filter', 'transform', 'clip-path'];
- class FeDropShadowElement extends Element {
- constructor(document, node, captureTextNodes) {
- super(document, node, captureTextNodes);
- this.type = 'feDropShadow';
- this.addStylesFromStyleDefinition();
- }
- apply(_, _x, _y, _width, _height) {// TODO: implement
- }
- }
- class FeMorphologyElement extends Element {
- constructor() {
- super(...arguments);
- this.type = 'feMorphology';
- }
- apply(_, _x, _y, _width, _height) {// TODO: implement
- }
- }
- class FeCompositeElement extends Element {
- constructor() {
- super(...arguments);
- this.type = 'feComposite';
- }
- apply(_, _x, _y, _width, _height) {// TODO: implement
- }
- }
- class FeGaussianBlurElement extends Element {
- constructor(document, node, captureTextNodes) {
- super(document, node, captureTextNodes);
- this.type = 'feGaussianBlur';
- this.blurRadius = Math.floor(this.getAttribute('stdDeviation').getNumber());
- this.extraFilterDistance = this.blurRadius;
- }
- apply(ctx, x, y, width, height) {
- var {
- document,
- blurRadius
- } = this;
- var body = document.window ? document.window.document.body : null;
- var canvas = ctx.canvas; // StackBlur requires canvas be on document
- canvas.id = document.getUniqueId();
- if (body) {
- canvas.style.display = 'none';
- body.appendChild(canvas);
- }
- Object(stackblur_canvas__WEBPACK_IMPORTED_MODULE_19__["canvasRGBA"])(canvas, x, y, width, height, blurRadius);
- if (body) {
- body.removeChild(canvas);
- }
- }
- }
- class TitleElement extends Element {
- constructor() {
- super(...arguments);
- this.type = 'title';
- }
- }
- class DescElement extends Element {
- constructor() {
- super(...arguments);
- this.type = 'desc';
- }
- }
- var elements = {
- 'svg': SVGElement,
- 'rect': RectElement,
- 'circle': CircleElement,
- 'ellipse': EllipseElement,
- 'line': LineElement,
- 'polyline': PolylineElement,
- 'polygon': PolygonElement,
- 'path': PathElement,
- 'pattern': PatternElement,
- 'marker': MarkerElement,
- 'defs': DefsElement,
- 'linearGradient': LinearGradientElement,
- 'radialGradient': RadialGradientElement,
- 'stop': StopElement,
- 'animate': AnimateElement,
- 'animateColor': AnimateColorElement,
- 'animateTransform': AnimateTransformElement,
- 'font': FontElement,
- 'font-face': FontFaceElement,
- 'missing-glyph': MissingGlyphElement,
- 'glyph': GlyphElement,
- 'text': TextElement,
- 'tspan': TSpanElement,
- 'tref': TRefElement,
- 'a': AElement,
- 'textPath': TextPathElement,
- 'image': ImageElement,
- 'g': GElement,
- 'symbol': SymbolElement,
- 'style': StyleElement,
- 'use': UseElement,
- 'mask': MaskElement,
- 'clipPath': ClipPathElement,
- 'filter': FilterElement,
- 'feDropShadow': FeDropShadowElement,
- 'feMorphology': FeMorphologyElement,
- 'feComposite': FeCompositeElement,
- 'feColorMatrix': FeColorMatrixElement,
- 'feGaussianBlur': FeGaussianBlurElement,
- 'title': TitleElement,
- 'desc': DescElement
- };
- function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
- function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
- function createCanvas(width, height) {
- var canvas = document.createElement('canvas');
- canvas.width = width;
- canvas.height = height;
- return canvas;
- }
- function createImage(_x) {
- return _createImage.apply(this, arguments);
- }
- function _createImage() {
- _createImage = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(function* (src) {
- var anonymousCrossOrigin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var image = document.createElement('img');
- if (anonymousCrossOrigin) {
- image.crossOrigin = 'Anonymous';
- }
- return new Promise((resolve, reject) => {
- image.onload = () => {
- resolve(image);
- };
- image.onerror = (_event, _source, _lineno, _colno, error) => {
- reject(error);
- };
- image.src = src;
- });
- });
- return _createImage.apply(this, arguments);
- }
- class Document {
- constructor(canvg) {
- var {
- rootEmSize = 12,
- emSize = 12,
- createCanvas = Document.createCanvas,
- createImage = Document.createImage,
- anonymousCrossOrigin
- } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- this.canvg = canvg;
- this.definitions = {};
- this.styles = {};
- this.stylesSpecificity = {};
- this.images = [];
- this.fonts = [];
- this.emSizeStack = [];
- this.uniqueId = 0;
- this.screen = canvg.screen;
- this.rootEmSize = rootEmSize;
- this.emSize = emSize;
- this.createCanvas = createCanvas;
- this.createImage = this.bindCreateImage(createImage, anonymousCrossOrigin);
- this.screen.wait(this.isImagesLoaded.bind(this));
- this.screen.wait(this.isFontsLoaded.bind(this));
- }
- bindCreateImage(createImage, anonymousCrossOrigin) {
- if (typeof anonymousCrossOrigin === 'boolean') {
- return (source, forceAnonymousCrossOrigin) => createImage(source, typeof forceAnonymousCrossOrigin === 'boolean' ? forceAnonymousCrossOrigin : anonymousCrossOrigin);
- }
- return createImage;
- }
- get window() {
- return this.screen.window;
- }
- get fetch() {
- return this.screen.fetch;
- }
- get ctx() {
- return this.screen.ctx;
- }
- get emSize() {
- var {
- emSizeStack
- } = this;
- return emSizeStack[emSizeStack.length - 1];
- }
- set emSize(value) {
- var {
- emSizeStack
- } = this;
- emSizeStack.push(value);
- }
- popEmSize() {
- var {
- emSizeStack
- } = this;
- emSizeStack.pop();
- }
- getUniqueId() {
- return "canvg".concat(++this.uniqueId);
- }
- isImagesLoaded() {
- return this.images.every(_ => _.loaded);
- }
- isFontsLoaded() {
- return this.fonts.every(_ => _.loaded);
- }
- createDocumentElement(document) {
- var documentElement = this.createElement(document.documentElement);
- documentElement.root = true;
- documentElement.addStylesFromStyleDefinition();
- this.documentElement = documentElement;
- return documentElement;
- }
- createElement(node) {
- var elementType = node.nodeName.replace(/^[^:]+:/, '');
- var ElementType = Document.elementTypes[elementType];
- if (typeof ElementType !== 'undefined') {
- return new ElementType(this, node);
- }
- return new UnknownElement(this, node);
- }
- createTextNode(node) {
- return new TextNode(this, node);
- }
- setViewBox(config) {
- this.screen.setViewBox(_objectSpread$1({
- document: this
- }, config));
- }
- }
- Document.createCanvas = createCanvas;
- Document.createImage = createImage;
- Document.elementTypes = elements;
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
- /**
- * SVG renderer on canvas.
- */
- class Canvg {
- /**
- * Main constructor.
- * @param ctx - Rendering context.
- * @param svg - SVG Document.
- * @param options - Rendering options.
- */
- constructor(ctx, svg) {
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
- this.parser = new Parser(options);
- this.screen = new Screen(ctx, options);
- this.options = options;
- var document = new Document(this, options);
- var documentElement = document.createDocumentElement(svg);
- this.document = document;
- this.documentElement = documentElement;
- }
- /**
- * Create Canvg instance from SVG source string or URL.
- * @param ctx - Rendering context.
- * @param svg - SVG source string or URL.
- * @param options - Rendering options.
- * @returns Canvg instance.
- */
- static from(ctx, svg) {
- var _arguments = arguments;
- return _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(function* () {
- var options = _arguments.length > 2 && _arguments[2] !== undefined ? _arguments[2] : {};
- var parser = new Parser(options);
- var svgDocument = yield parser.parse(svg);
- return new Canvg(ctx, svgDocument, options);
- })();
- }
- /**
- * Create Canvg instance from SVG source string.
- * @param ctx - Rendering context.
- * @param svg - SVG source string.
- * @param options - Rendering options.
- * @returns Canvg instance.
- */
- static fromString(ctx, svg) {
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
- var parser = new Parser(options);
- var svgDocument = parser.parseFromString(svg);
- return new Canvg(ctx, svgDocument, options);
- }
- /**
- * Create new Canvg instance with inherited options.
- * @param ctx - Rendering context.
- * @param svg - SVG source string or URL.
- * @param options - Rendering options.
- * @returns Canvg instance.
- */
- fork(ctx, svg) {
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
- return Canvg.from(ctx, svg, _objectSpread(_objectSpread({}, this.options), options));
- }
- /**
- * Create new Canvg instance with inherited options.
- * @param ctx - Rendering context.
- * @param svg - SVG source string.
- * @param options - Rendering options.
- * @returns Canvg instance.
- */
- forkString(ctx, svg) {
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
- return Canvg.fromString(ctx, svg, _objectSpread(_objectSpread({}, this.options), options));
- }
- /**
- * Document is ready promise.
- * @returns Ready promise.
- */
- ready() {
- return this.screen.ready();
- }
- /**
- * Document is ready value.
- * @returns Is ready or not.
- */
- isReady() {
- return this.screen.isReady();
- }
- /**
- * Render only first frame, ignoring animations and mouse.
- * @param options - Rendering options.
- */
- render() {
- var _arguments2 = arguments,
- _this = this;
- return _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(function* () {
- var options = _arguments2.length > 0 && _arguments2[0] !== undefined ? _arguments2[0] : {};
- _this.start(_objectSpread({
- enableRedraw: true,
- ignoreAnimation: true,
- ignoreMouse: true
- }, options));
- yield _this.ready();
- _this.stop();
- })();
- }
- /**
- * Start rendering.
- * @param options - Render options.
- */
- start() {
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var {
- documentElement,
- screen,
- options: baseOptions
- } = this;
- screen.start(documentElement, _objectSpread(_objectSpread({
- enableRedraw: true
- }, baseOptions), options));
- }
- /**
- * Stop rendering.
- */
- stop() {
- this.screen.stop();
- }
- /**
- * Resize SVG to fit in given size.
- * @param width
- * @param height
- * @param preserveAspectRatio
- */
- resize(width) {
- var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : width;
- var preserveAspectRatio = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
- this.documentElement.resize(width, height, preserveAspectRatio);
- }
- }
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZXMuanMiLCJzb3VyY2VzIjpbXSwic291cmNlc0NvbnRlbnQiOltdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsifQ==
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ "../../node_modules/node-libs-browser/mock/process.js")))
- /***/ }),
- /***/ "../../node_modules/core-js/internals/a-constructor.js":
- /*!******************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/a-constructor.js ***!
- \******************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var isConstructor = __webpack_require__(/*! ../internals/is-constructor */ "../../node_modules/core-js/internals/is-constructor.js");
- var tryToString = __webpack_require__(/*! ../internals/try-to-string */ "../../node_modules/core-js/internals/try-to-string.js");
- var $TypeError = TypeError;
- // `Assert: IsConstructor(argument) is true`
- module.exports = function (argument) {
- if (isConstructor(argument)) return argument;
- throw new $TypeError(tryToString(argument) + ' is not a constructor');
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/add-to-unscopables.js":
- /*!***********************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/add-to-unscopables.js ***!
- \***********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js");
- var create = __webpack_require__(/*! ../internals/object-create */ "../../node_modules/core-js/internals/object-create.js");
- var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "../../node_modules/core-js/internals/object-define-property.js").f;
- var UNSCOPABLES = wellKnownSymbol('unscopables');
- var ArrayPrototype = Array.prototype;
- // Array.prototype[@@unscopables]
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
- if (ArrayPrototype[UNSCOPABLES] === undefined) {
- defineProperty(ArrayPrototype, UNSCOPABLES, {
- configurable: true,
- value: create(null)
- });
- }
- // add a key to Array.prototype[@@unscopables]
- module.exports = function (key) {
- ArrayPrototype[UNSCOPABLES][key] = true;
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/advance-string-index.js":
- /*!*************************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/advance-string-index.js ***!
- \*************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var charAt = __webpack_require__(/*! ../internals/string-multibyte */ "../../node_modules/core-js/internals/string-multibyte.js").charAt;
- // `AdvanceStringIndex` abstract operation
- // https://tc39.es/ecma262/#sec-advancestringindex
- module.exports = function (S, index, unicode) {
- return index + (unicode ? charAt(S, index).length : 1);
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/array-slice.js":
- /*!****************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/array-slice.js ***!
- \****************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "../../node_modules/core-js/internals/function-uncurry-this.js");
- module.exports = uncurryThis([].slice);
- /***/ }),
- /***/ "../../node_modules/core-js/internals/check-correctness-of-iteration.js":
- /*!***********************************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/check-correctness-of-iteration.js ***!
- \***********************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js");
- var ITERATOR = wellKnownSymbol('iterator');
- var SAFE_CLOSING = false;
- try {
- var called = 0;
- var iteratorWithReturn = {
- next: function () {
- return { done: !!called++ };
- },
- 'return': function () {
- SAFE_CLOSING = true;
- }
- };
- iteratorWithReturn[ITERATOR] = function () {
- return this;
- };
- // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
- Array.from(iteratorWithReturn, function () { throw 2; });
- } catch (error) { /* empty */ }
- module.exports = function (exec, SKIP_CLOSING) {
- try {
- if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
- } catch (error) { return false; } // workaround of old WebKit + `eval` bug
- var ITERATION_SUPPORT = false;
- try {
- var object = {};
- object[ITERATOR] = function () {
- return {
- next: function () {
- return { done: ITERATION_SUPPORT = true };
- }
- };
- };
- exec(object);
- } catch (error) { /* empty */ }
- return ITERATION_SUPPORT;
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/correct-is-regexp-logic.js":
- /*!****************************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/correct-is-regexp-logic.js ***!
- \****************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js");
- var MATCH = wellKnownSymbol('match');
- module.exports = function (METHOD_NAME) {
- var regexp = /./;
- try {
- '/./'[METHOD_NAME](regexp);
- } catch (error1) {
- try {
- regexp[MATCH] = false;
- return '/./'[METHOD_NAME](regexp);
- } catch (error2) { /* empty */ }
- } return false;
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/create-iter-result-object.js":
- /*!******************************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/create-iter-result-object.js ***!
- \******************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // `CreateIterResultObject` abstract operation
- // https://tc39.es/ecma262/#sec-createiterresultobject
- module.exports = function (value, done) {
- return { value: value, done: done };
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/dom-iterables.js":
- /*!******************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/dom-iterables.js ***!
- \******************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // iterable DOM collections
- // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
- module.exports = {
- CSSRuleList: 0,
- CSSStyleDeclaration: 0,
- CSSValueList: 0,
- ClientRectList: 0,
- DOMRectList: 0,
- DOMStringList: 0,
- DOMTokenList: 1,
- DataTransferItemList: 0,
- FileList: 0,
- HTMLAllCollection: 0,
- HTMLCollection: 0,
- HTMLFormElement: 0,
- HTMLSelectElement: 0,
- MediaList: 0,
- MimeTypeArray: 0,
- NamedNodeMap: 0,
- NodeList: 1,
- PaintRequestList: 0,
- Plugin: 0,
- PluginArray: 0,
- SVGLengthList: 0,
- SVGNumberList: 0,
- SVGPathSegList: 0,
- SVGPointList: 0,
- SVGStringList: 0,
- SVGTransformList: 0,
- SourceBufferList: 0,
- StyleSheetList: 0,
- TextTrackCueList: 0,
- TextTrackList: 0,
- TouchList: 0
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/dom-token-list-prototype.js":
- /*!*****************************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/dom-token-list-prototype.js ***!
- \*****************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
- var documentCreateElement = __webpack_require__(/*! ../internals/document-create-element */ "../../node_modules/core-js/internals/document-create-element.js");
- var classList = documentCreateElement('span').classList;
- var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype;
- module.exports = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype;
- /***/ }),
- /***/ "../../node_modules/core-js/internals/engine-is-ios-pebble.js":
- /*!*************************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/engine-is-ios-pebble.js ***!
- \*************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var userAgent = __webpack_require__(/*! ../internals/engine-user-agent */ "../../node_modules/core-js/internals/engine-user-agent.js");
- module.exports = /ipad|iphone|ipod/i.test(userAgent) && typeof Pebble != 'undefined';
- /***/ }),
- /***/ "../../node_modules/core-js/internals/engine-is-ios.js":
- /*!******************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/engine-is-ios.js ***!
- \******************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var userAgent = __webpack_require__(/*! ../internals/engine-user-agent */ "../../node_modules/core-js/internals/engine-user-agent.js");
- // eslint-disable-next-line redos/no-vulnerable -- safe
- module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
- /***/ }),
- /***/ "../../node_modules/core-js/internals/engine-is-webos-webkit.js":
- /*!***************************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/engine-is-webos-webkit.js ***!
- \***************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var userAgent = __webpack_require__(/*! ../internals/engine-user-agent */ "../../node_modules/core-js/internals/engine-user-agent.js");
- module.exports = /web0s(?!.*chrome)/i.test(userAgent);
- /***/ }),
- /***/ "../../node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js":
- /*!***************************************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js ***!
- \***************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // TODO: Remove from `core-js@4` since it's moved to entry points
- __webpack_require__(/*! ../modules/es.regexp.exec */ "../../node_modules/core-js/modules/es.regexp.exec.js");
- var call = __webpack_require__(/*! ../internals/function-call */ "../../node_modules/core-js/internals/function-call.js");
- var defineBuiltIn = __webpack_require__(/*! ../internals/define-built-in */ "../../node_modules/core-js/internals/define-built-in.js");
- var regexpExec = __webpack_require__(/*! ../internals/regexp-exec */ "../../node_modules/core-js/internals/regexp-exec.js");
- var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js");
- var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "../../node_modules/core-js/internals/create-non-enumerable-property.js");
- var SPECIES = wellKnownSymbol('species');
- var RegExpPrototype = RegExp.prototype;
- module.exports = function (KEY, exec, FORCED, SHAM) {
- var SYMBOL = wellKnownSymbol(KEY);
- var DELEGATES_TO_SYMBOL = !fails(function () {
- // String methods call symbol-named RegExp methods
- var O = {};
- O[SYMBOL] = function () { return 7; };
- return ''[KEY](O) !== 7;
- });
- var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
- // Symbol-named RegExp methods call .exec
- var execCalled = false;
- var re = /a/;
- if (KEY === 'split') {
- // We can't use real regex here since it causes deoptimization
- // and serious performance degradation in V8
- // https://github.com/zloirock/core-js/issues/306
- re = {};
- // RegExp[@@split] doesn't call the regex's exec method, but first creates
- // a new one. We need to return the patched regex when creating the new one.
- re.constructor = {};
- re.constructor[SPECIES] = function () { return re; };
- re.flags = '';
- re[SYMBOL] = /./[SYMBOL];
- }
- re.exec = function () {
- execCalled = true;
- return null;
- };
- re[SYMBOL]('');
- return !execCalled;
- });
- if (
- !DELEGATES_TO_SYMBOL ||
- !DELEGATES_TO_EXEC ||
- FORCED
- ) {
- var nativeRegExpMethod = /./[SYMBOL];
- var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
- var $exec = regexp.exec;
- if ($exec === regexpExec || $exec === RegExpPrototype.exec) {
- if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
- // The native String method already delegates to @@method (this
- // polyfilled function), leasing to infinite recursion.
- // We avoid it by directly calling the native @@method method.
- return { done: true, value: call(nativeRegExpMethod, regexp, str, arg2) };
- }
- return { done: true, value: call(nativeMethod, str, regexp, arg2) };
- }
- return { done: false };
- });
- defineBuiltIn(String.prototype, KEY, methods[0]);
- defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]);
- }
- if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/get-iterator-method.js":
- /*!************************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/get-iterator-method.js ***!
- \************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var classof = __webpack_require__(/*! ../internals/classof */ "../../node_modules/core-js/internals/classof.js");
- var getMethod = __webpack_require__(/*! ../internals/get-method */ "../../node_modules/core-js/internals/get-method.js");
- var isNullOrUndefined = __webpack_require__(/*! ../internals/is-null-or-undefined */ "../../node_modules/core-js/internals/is-null-or-undefined.js");
- var Iterators = __webpack_require__(/*! ../internals/iterators */ "../../node_modules/core-js/internals/iterators.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js");
- var ITERATOR = wellKnownSymbol('iterator');
- module.exports = function (it) {
- if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR)
- || getMethod(it, '@@iterator')
- || Iterators[classof(it)];
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/get-iterator.js":
- /*!*****************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/get-iterator.js ***!
- \*****************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var call = __webpack_require__(/*! ../internals/function-call */ "../../node_modules/core-js/internals/function-call.js");
- var aCallable = __webpack_require__(/*! ../internals/a-callable */ "../../node_modules/core-js/internals/a-callable.js");
- var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js");
- var tryToString = __webpack_require__(/*! ../internals/try-to-string */ "../../node_modules/core-js/internals/try-to-string.js");
- var getIteratorMethod = __webpack_require__(/*! ../internals/get-iterator-method */ "../../node_modules/core-js/internals/get-iterator-method.js");
- var $TypeError = TypeError;
- module.exports = function (argument, usingIterator) {
- var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
- if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
- throw new $TypeError(tryToString(argument) + ' is not iterable');
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/host-report-errors.js":
- /*!***********************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/host-report-errors.js ***!
- \***********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- module.exports = function (a, b) {
- try {
- // eslint-disable-next-line no-console -- safe
- arguments.length === 1 ? console.error(a) : console.error(a, b);
- } catch (error) { /* empty */ }
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/html.js":
- /*!*********************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/html.js ***!
- \*********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "../../node_modules/core-js/internals/get-built-in.js");
- module.exports = getBuiltIn('document', 'documentElement');
- /***/ }),
- /***/ "../../node_modules/core-js/internals/is-array-iterator-method.js":
- /*!*****************************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/is-array-iterator-method.js ***!
- \*****************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js");
- var Iterators = __webpack_require__(/*! ../internals/iterators */ "../../node_modules/core-js/internals/iterators.js");
- var ITERATOR = wellKnownSymbol('iterator');
- var ArrayPrototype = Array.prototype;
- // check on default Array iterator
- module.exports = function (it) {
- return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/is-constructor.js":
- /*!*******************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/is-constructor.js ***!
- \*******************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "../../node_modules/core-js/internals/function-uncurry-this.js");
- var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js");
- var isCallable = __webpack_require__(/*! ../internals/is-callable */ "../../node_modules/core-js/internals/is-callable.js");
- var classof = __webpack_require__(/*! ../internals/classof */ "../../node_modules/core-js/internals/classof.js");
- var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "../../node_modules/core-js/internals/get-built-in.js");
- var inspectSource = __webpack_require__(/*! ../internals/inspect-source */ "../../node_modules/core-js/internals/inspect-source.js");
- var noop = function () { /* empty */ };
- var construct = getBuiltIn('Reflect', 'construct');
- var constructorRegExp = /^\s*(?:class|function)\b/;
- var exec = uncurryThis(constructorRegExp.exec);
- var INCORRECT_TO_STRING = !constructorRegExp.test(noop);
- var isConstructorModern = function isConstructor(argument) {
- if (!isCallable(argument)) return false;
- try {
- construct(noop, [], argument);
- return true;
- } catch (error) {
- return false;
- }
- };
- var isConstructorLegacy = function isConstructor(argument) {
- if (!isCallable(argument)) return false;
- switch (classof(argument)) {
- case 'AsyncFunction':
- case 'GeneratorFunction':
- case 'AsyncGeneratorFunction': return false;
- }
- try {
- // we can't check .prototype since constructors produced by .bind haven't it
- // `Function#toString` throws on some built-it function in some legacy engines
- // (for example, `DOMQuad` and similar in FF41-)
- return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
- } catch (error) {
- return true;
- }
- };
- isConstructorLegacy.sham = true;
- // `IsConstructor` abstract operation
- // https://tc39.es/ecma262/#sec-isconstructor
- module.exports = !construct || fails(function () {
- var called;
- return isConstructorModern(isConstructorModern.call)
- || !isConstructorModern(Object)
- || !isConstructorModern(function () { called = true; })
- || called;
- }) ? isConstructorLegacy : isConstructorModern;
- /***/ }),
- /***/ "../../node_modules/core-js/internals/iterate.js":
- /*!************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/iterate.js ***!
- \************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var bind = __webpack_require__(/*! ../internals/function-bind-context */ "../../node_modules/core-js/internals/function-bind-context.js");
- var call = __webpack_require__(/*! ../internals/function-call */ "../../node_modules/core-js/internals/function-call.js");
- var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js");
- var tryToString = __webpack_require__(/*! ../internals/try-to-string */ "../../node_modules/core-js/internals/try-to-string.js");
- var isArrayIteratorMethod = __webpack_require__(/*! ../internals/is-array-iterator-method */ "../../node_modules/core-js/internals/is-array-iterator-method.js");
- var lengthOfArrayLike = __webpack_require__(/*! ../internals/length-of-array-like */ "../../node_modules/core-js/internals/length-of-array-like.js");
- var isPrototypeOf = __webpack_require__(/*! ../internals/object-is-prototype-of */ "../../node_modules/core-js/internals/object-is-prototype-of.js");
- var getIterator = __webpack_require__(/*! ../internals/get-iterator */ "../../node_modules/core-js/internals/get-iterator.js");
- var getIteratorMethod = __webpack_require__(/*! ../internals/get-iterator-method */ "../../node_modules/core-js/internals/get-iterator-method.js");
- var iteratorClose = __webpack_require__(/*! ../internals/iterator-close */ "../../node_modules/core-js/internals/iterator-close.js");
- var $TypeError = TypeError;
- var Result = function (stopped, result) {
- this.stopped = stopped;
- this.result = result;
- };
- var ResultPrototype = Result.prototype;
- module.exports = function (iterable, unboundFunction, options) {
- var that = options && options.that;
- var AS_ENTRIES = !!(options && options.AS_ENTRIES);
- var IS_RECORD = !!(options && options.IS_RECORD);
- var IS_ITERATOR = !!(options && options.IS_ITERATOR);
- var INTERRUPTED = !!(options && options.INTERRUPTED);
- var fn = bind(unboundFunction, that);
- var iterator, iterFn, index, length, result, next, step;
- var stop = function (condition) {
- if (iterator) iteratorClose(iterator, 'normal', condition);
- return new Result(true, condition);
- };
- var callFn = function (value) {
- if (AS_ENTRIES) {
- anObject(value);
- return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
- } return INTERRUPTED ? fn(value, stop) : fn(value);
- };
- if (IS_RECORD) {
- iterator = iterable.iterator;
- } else if (IS_ITERATOR) {
- iterator = iterable;
- } else {
- iterFn = getIteratorMethod(iterable);
- if (!iterFn) throw new $TypeError(tryToString(iterable) + ' is not iterable');
- // optimisation for array iterators
- if (isArrayIteratorMethod(iterFn)) {
- for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
- result = callFn(iterable[index]);
- if (result && isPrototypeOf(ResultPrototype, result)) return result;
- } return new Result(false);
- }
- iterator = getIterator(iterable, iterFn);
- }
- next = IS_RECORD ? iterable.next : iterator.next;
- while (!(step = call(next, iterator)).done) {
- try {
- result = callFn(step.value);
- } catch (error) {
- iteratorClose(iterator, 'throw', error);
- }
- if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
- } return new Result(false);
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/iterator-create-constructor.js":
- /*!********************************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/iterator-create-constructor.js ***!
- \********************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var IteratorPrototype = __webpack_require__(/*! ../internals/iterators-core */ "../../node_modules/core-js/internals/iterators-core.js").IteratorPrototype;
- var create = __webpack_require__(/*! ../internals/object-create */ "../../node_modules/core-js/internals/object-create.js");
- var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "../../node_modules/core-js/internals/create-property-descriptor.js");
- var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "../../node_modules/core-js/internals/set-to-string-tag.js");
- var Iterators = __webpack_require__(/*! ../internals/iterators */ "../../node_modules/core-js/internals/iterators.js");
- var returnThis = function () { return this; };
- module.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
- var TO_STRING_TAG = NAME + ' Iterator';
- IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
- setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
- Iterators[TO_STRING_TAG] = returnThis;
- return IteratorConstructor;
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/iterator-define.js":
- /*!********************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/iterator-define.js ***!
- \********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
- var call = __webpack_require__(/*! ../internals/function-call */ "../../node_modules/core-js/internals/function-call.js");
- var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "../../node_modules/core-js/internals/is-pure.js");
- var FunctionName = __webpack_require__(/*! ../internals/function-name */ "../../node_modules/core-js/internals/function-name.js");
- var isCallable = __webpack_require__(/*! ../internals/is-callable */ "../../node_modules/core-js/internals/is-callable.js");
- var createIteratorConstructor = __webpack_require__(/*! ../internals/iterator-create-constructor */ "../../node_modules/core-js/internals/iterator-create-constructor.js");
- var getPrototypeOf = __webpack_require__(/*! ../internals/object-get-prototype-of */ "../../node_modules/core-js/internals/object-get-prototype-of.js");
- var setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ "../../node_modules/core-js/internals/object-set-prototype-of.js");
- var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "../../node_modules/core-js/internals/set-to-string-tag.js");
- var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "../../node_modules/core-js/internals/create-non-enumerable-property.js");
- var defineBuiltIn = __webpack_require__(/*! ../internals/define-built-in */ "../../node_modules/core-js/internals/define-built-in.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js");
- var Iterators = __webpack_require__(/*! ../internals/iterators */ "../../node_modules/core-js/internals/iterators.js");
- var IteratorsCore = __webpack_require__(/*! ../internals/iterators-core */ "../../node_modules/core-js/internals/iterators-core.js");
- var PROPER_FUNCTION_NAME = FunctionName.PROPER;
- var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
- var IteratorPrototype = IteratorsCore.IteratorPrototype;
- var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
- var ITERATOR = wellKnownSymbol('iterator');
- var KEYS = 'keys';
- var VALUES = 'values';
- var ENTRIES = 'entries';
- var returnThis = function () { return this; };
- module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
- createIteratorConstructor(IteratorConstructor, NAME, next);
- var getIterationMethod = function (KIND) {
- if (KIND === DEFAULT && defaultIterator) return defaultIterator;
- if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
- switch (KIND) {
- case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
- case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
- case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
- }
- return function () { return new IteratorConstructor(this); };
- };
- var TO_STRING_TAG = NAME + ' Iterator';
- var INCORRECT_VALUES_NAME = false;
- var IterablePrototype = Iterable.prototype;
- var nativeIterator = IterablePrototype[ITERATOR]
- || IterablePrototype['@@iterator']
- || DEFAULT && IterablePrototype[DEFAULT];
- var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
- var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
- var CurrentIteratorPrototype, methods, KEY;
- // fix native
- if (anyNativeIterator) {
- CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
- if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
- if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
- if (setPrototypeOf) {
- setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
- } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {
- defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis);
- }
- }
- // Set @@toStringTag to native iterators
- setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
- if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
- }
- }
- // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
- if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
- if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {
- createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
- } else {
- INCORRECT_VALUES_NAME = true;
- defaultIterator = function values() { return call(nativeIterator, this); };
- }
- }
- // export additional methods
- if (DEFAULT) {
- methods = {
- values: getIterationMethod(VALUES),
- keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
- entries: getIterationMethod(ENTRIES)
- };
- if (FORCED) for (KEY in methods) {
- if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
- defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
- }
- } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
- }
- // define iterator
- if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
- defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });
- }
- Iterators[NAME] = defaultIterator;
- return methods;
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/iterators-core.js":
- /*!*******************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/iterators-core.js ***!
- \*******************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js");
- var isCallable = __webpack_require__(/*! ../internals/is-callable */ "../../node_modules/core-js/internals/is-callable.js");
- var isObject = __webpack_require__(/*! ../internals/is-object */ "../../node_modules/core-js/internals/is-object.js");
- var create = __webpack_require__(/*! ../internals/object-create */ "../../node_modules/core-js/internals/object-create.js");
- var getPrototypeOf = __webpack_require__(/*! ../internals/object-get-prototype-of */ "../../node_modules/core-js/internals/object-get-prototype-of.js");
- var defineBuiltIn = __webpack_require__(/*! ../internals/define-built-in */ "../../node_modules/core-js/internals/define-built-in.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js");
- var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "../../node_modules/core-js/internals/is-pure.js");
- var ITERATOR = wellKnownSymbol('iterator');
- var BUGGY_SAFARI_ITERATORS = false;
- // `%IteratorPrototype%` object
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
- var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
- /* eslint-disable es/no-array-prototype-keys -- safe */
- if ([].keys) {
- arrayIterator = [].keys();
- // Safari 8 has buggy iterators w/o `next`
- if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
- else {
- PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
- if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
- }
- }
- var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function () {
- var test = {};
- // FF44- legacy iterators case
- return IteratorPrototype[ITERATOR].call(test) !== test;
- });
- if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
- else if (IS_PURE) IteratorPrototype = create(IteratorPrototype);
- // `%IteratorPrototype%[@@iterator]()` method
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
- if (!isCallable(IteratorPrototype[ITERATOR])) {
- defineBuiltIn(IteratorPrototype, ITERATOR, function () {
- return this;
- });
- }
- module.exports = {
- IteratorPrototype: IteratorPrototype,
- BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/iterators.js":
- /*!**************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/iterators.js ***!
- \**************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- module.exports = {};
- /***/ }),
- /***/ "../../node_modules/core-js/internals/microtask.js":
- /*!**************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/microtask.js ***!
- \**************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js");
- var safeGetBuiltIn = __webpack_require__(/*! ../internals/safe-get-built-in */ "../../node_modules/core-js/internals/safe-get-built-in.js");
- var bind = __webpack_require__(/*! ../internals/function-bind-context */ "../../node_modules/core-js/internals/function-bind-context.js");
- var macrotask = __webpack_require__(/*! ../internals/task */ "../../node_modules/core-js/internals/task.js").set;
- var Queue = __webpack_require__(/*! ../internals/queue */ "../../node_modules/core-js/internals/queue.js");
- var IS_IOS = __webpack_require__(/*! ../internals/engine-is-ios */ "../../node_modules/core-js/internals/engine-is-ios.js");
- var IS_IOS_PEBBLE = __webpack_require__(/*! ../internals/engine-is-ios-pebble */ "../../node_modules/core-js/internals/engine-is-ios-pebble.js");
- var IS_WEBOS_WEBKIT = __webpack_require__(/*! ../internals/engine-is-webos-webkit */ "../../node_modules/core-js/internals/engine-is-webos-webkit.js");
- var IS_NODE = __webpack_require__(/*! ../internals/engine-is-node */ "../../node_modules/core-js/internals/engine-is-node.js");
- var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
- var document = global.document;
- var process = global.process;
- var Promise = global.Promise;
- var microtask = safeGetBuiltIn('queueMicrotask');
- var notify, toggle, node, promise, then;
- // modern engines have queueMicrotask method
- if (!microtask) {
- var queue = new Queue();
- var flush = function () {
- var parent, fn;
- if (IS_NODE && (parent = process.domain)) parent.exit();
- while (fn = queue.get()) try {
- fn();
- } catch (error) {
- if (queue.head) notify();
- throw error;
- }
- if (parent) parent.enter();
- };
- // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
- // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
- if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {
- toggle = true;
- node = document.createTextNode('');
- new MutationObserver(flush).observe(node, { characterData: true });
- notify = function () {
- node.data = toggle = !toggle;
- };
- // environments with maybe non-completely correct, but existent Promise
- } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) {
- // Promise.resolve without an argument throws an error in LG WebOS 2
- promise = Promise.resolve(undefined);
- // workaround of WebKit ~ iOS Safari 10.1 bug
- promise.constructor = Promise;
- then = bind(promise.then, promise);
- notify = function () {
- then(flush);
- };
- // Node.js without promises
- } else if (IS_NODE) {
- notify = function () {
- process.nextTick(flush);
- };
- // for other environments - macrotask based on:
- // - setImmediate
- // - MessageChannel
- // - window.postMessage
- // - onreadystatechange
- // - setTimeout
- } else {
- // `webpack` dev server bug on IE global methods - use bind(fn, global)
- macrotask = bind(macrotask, global);
- notify = function () {
- macrotask(flush);
- };
- }
- microtask = function (fn) {
- if (!queue.head) notify();
- queue.add(fn);
- };
- }
- module.exports = microtask;
- /***/ }),
- /***/ "../../node_modules/core-js/internals/new-promise-capability.js":
- /*!***************************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/new-promise-capability.js ***!
- \***************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var aCallable = __webpack_require__(/*! ../internals/a-callable */ "../../node_modules/core-js/internals/a-callable.js");
- var $TypeError = TypeError;
- var PromiseCapability = function (C) {
- var resolve, reject;
- this.promise = new C(function ($$resolve, $$reject) {
- if (resolve !== undefined || reject !== undefined) throw new $TypeError('Bad Promise constructor');
- resolve = $$resolve;
- reject = $$reject;
- });
- this.resolve = aCallable(resolve);
- this.reject = aCallable(reject);
- };
- // `NewPromiseCapability` abstract operation
- // https://tc39.es/ecma262/#sec-newpromisecapability
- module.exports.f = function (C) {
- return new PromiseCapability(C);
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/not-a-regexp.js":
- /*!*****************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/not-a-regexp.js ***!
- \*****************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var isRegExp = __webpack_require__(/*! ../internals/is-regexp */ "../../node_modules/core-js/internals/is-regexp.js");
- var $TypeError = TypeError;
- module.exports = function (it) {
- if (isRegExp(it)) {
- throw new $TypeError("The method doesn't accept regular expressions");
- } return it;
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/object-create.js":
- /*!******************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/object-create.js ***!
- \******************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* global ActiveXObject -- old IE, WSH */
- var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js");
- var definePropertiesModule = __webpack_require__(/*! ../internals/object-define-properties */ "../../node_modules/core-js/internals/object-define-properties.js");
- var enumBugKeys = __webpack_require__(/*! ../internals/enum-bug-keys */ "../../node_modules/core-js/internals/enum-bug-keys.js");
- var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "../../node_modules/core-js/internals/hidden-keys.js");
- var html = __webpack_require__(/*! ../internals/html */ "../../node_modules/core-js/internals/html.js");
- var documentCreateElement = __webpack_require__(/*! ../internals/document-create-element */ "../../node_modules/core-js/internals/document-create-element.js");
- var sharedKey = __webpack_require__(/*! ../internals/shared-key */ "../../node_modules/core-js/internals/shared-key.js");
- var GT = '>';
- var LT = '<';
- var PROTOTYPE = 'prototype';
- var SCRIPT = 'script';
- var IE_PROTO = sharedKey('IE_PROTO');
- var EmptyConstructor = function () { /* empty */ };
- var scriptTag = function (content) {
- return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
- };
- // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
- var NullProtoObjectViaActiveX = function (activeXDocument) {
- activeXDocument.write(scriptTag(''));
- activeXDocument.close();
- var temp = activeXDocument.parentWindow.Object;
- activeXDocument = null; // avoid memory leak
- return temp;
- };
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
- var NullProtoObjectViaIFrame = function () {
- // Thrash, waste and sodomy: IE GC bug
- var iframe = documentCreateElement('iframe');
- var JS = 'java' + SCRIPT + ':';
- var iframeDocument;
- iframe.style.display = 'none';
- html.appendChild(iframe);
- // https://github.com/zloirock/core-js/issues/475
- iframe.src = String(JS);
- iframeDocument = iframe.contentWindow.document;
- iframeDocument.open();
- iframeDocument.write(scriptTag('document.F=Object'));
- iframeDocument.close();
- return iframeDocument.F;
- };
- // Check for document.domain and active x support
- // No need to use active x approach when document.domain is not set
- // see https://github.com/es-shims/es5-shim/issues/150
- // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
- // avoid IE GC bug
- var activeXDocument;
- var NullProtoObject = function () {
- try {
- activeXDocument = new ActiveXObject('htmlfile');
- } catch (error) { /* ignore */ }
- NullProtoObject = typeof document != 'undefined'
- ? document.domain && activeXDocument
- ? NullProtoObjectViaActiveX(activeXDocument) // old IE
- : NullProtoObjectViaIFrame()
- : NullProtoObjectViaActiveX(activeXDocument); // WSH
- var length = enumBugKeys.length;
- while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
- return NullProtoObject();
- };
- hiddenKeys[IE_PROTO] = true;
- // `Object.create` method
- // https://tc39.es/ecma262/#sec-object.create
- // eslint-disable-next-line es/no-object-create -- safe
- module.exports = Object.create || function create(O, Properties) {
- var result;
- if (O !== null) {
- EmptyConstructor[PROTOTYPE] = anObject(O);
- result = new EmptyConstructor();
- EmptyConstructor[PROTOTYPE] = null;
- // add "__proto__" for Object.getPrototypeOf polyfill
- result[IE_PROTO] = O;
- } else result = NullProtoObject();
- return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/object-define-properties.js":
- /*!*****************************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/object-define-properties.js ***!
- \*****************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "../../node_modules/core-js/internals/descriptors.js");
- var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(/*! ../internals/v8-prototype-define-bug */ "../../node_modules/core-js/internals/v8-prototype-define-bug.js");
- var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "../../node_modules/core-js/internals/object-define-property.js");
- var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js");
- var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "../../node_modules/core-js/internals/to-indexed-object.js");
- var objectKeys = __webpack_require__(/*! ../internals/object-keys */ "../../node_modules/core-js/internals/object-keys.js");
- // `Object.defineProperties` method
- // https://tc39.es/ecma262/#sec-object.defineproperties
- // eslint-disable-next-line es/no-object-defineproperties -- safe
- exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
- anObject(O);
- var props = toIndexedObject(Properties);
- var keys = objectKeys(Properties);
- var length = keys.length;
- var index = 0;
- var key;
- while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
- return O;
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/object-keys.js":
- /*!****************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/object-keys.js ***!
- \****************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var internalObjectKeys = __webpack_require__(/*! ../internals/object-keys-internal */ "../../node_modules/core-js/internals/object-keys-internal.js");
- var enumBugKeys = __webpack_require__(/*! ../internals/enum-bug-keys */ "../../node_modules/core-js/internals/enum-bug-keys.js");
- // `Object.keys` method
- // https://tc39.es/ecma262/#sec-object.keys
- // eslint-disable-next-line es/no-object-keys -- safe
- module.exports = Object.keys || function keys(O) {
- return internalObjectKeys(O, enumBugKeys);
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/perform.js":
- /*!************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/perform.js ***!
- \************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- module.exports = function (exec) {
- try {
- return { error: false, value: exec() };
- } catch (error) {
- return { error: true, value: error };
- }
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/promise-constructor-detection.js":
- /*!**********************************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/promise-constructor-detection.js ***!
- \**********************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js");
- var NativePromiseConstructor = __webpack_require__(/*! ../internals/promise-native-constructor */ "../../node_modules/core-js/internals/promise-native-constructor.js");
- var isCallable = __webpack_require__(/*! ../internals/is-callable */ "../../node_modules/core-js/internals/is-callable.js");
- var isForced = __webpack_require__(/*! ../internals/is-forced */ "../../node_modules/core-js/internals/is-forced.js");
- var inspectSource = __webpack_require__(/*! ../internals/inspect-source */ "../../node_modules/core-js/internals/inspect-source.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js");
- var IS_BROWSER = __webpack_require__(/*! ../internals/engine-is-browser */ "../../node_modules/core-js/internals/engine-is-browser.js");
- var IS_DENO = __webpack_require__(/*! ../internals/engine-is-deno */ "../../node_modules/core-js/internals/engine-is-deno.js");
- var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "../../node_modules/core-js/internals/is-pure.js");
- var V8_VERSION = __webpack_require__(/*! ../internals/engine-v8-version */ "../../node_modules/core-js/internals/engine-v8-version.js");
- var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
- var SPECIES = wellKnownSymbol('species');
- var SUBCLASSING = false;
- var NATIVE_PROMISE_REJECTION_EVENT = isCallable(global.PromiseRejectionEvent);
- var FORCED_PROMISE_CONSTRUCTOR = isForced('Promise', function () {
- var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor);
- var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor);
- // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
- // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
- // We can't detect it synchronously, so just check versions
- if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
- // We need Promise#{ catch, finally } in the pure version for preventing prototype pollution
- if (IS_PURE && !(NativePromisePrototype['catch'] && NativePromisePrototype['finally'])) return true;
- // We can't use @@species feature detection in V8 since it causes
- // deoptimization and performance degradation
- // https://github.com/zloirock/core-js/issues/679
- if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
- // Detect correctness of subclassing with @@species support
- var promise = new NativePromiseConstructor(function (resolve) { resolve(1); });
- var FakePromise = function (exec) {
- exec(function () { /* empty */ }, function () { /* empty */ });
- };
- var constructor = promise.constructor = {};
- constructor[SPECIES] = FakePromise;
- SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
- if (!SUBCLASSING) return true;
- // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
- } return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT;
- });
- module.exports = {
- CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR,
- REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT,
- SUBCLASSING: SUBCLASSING
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/promise-native-constructor.js":
- /*!*******************************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/promise-native-constructor.js ***!
- \*******************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js");
- module.exports = global.Promise;
- /***/ }),
- /***/ "../../node_modules/core-js/internals/promise-resolve.js":
- /*!********************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/promise-resolve.js ***!
- \********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js");
- var isObject = __webpack_require__(/*! ../internals/is-object */ "../../node_modules/core-js/internals/is-object.js");
- var newPromiseCapability = __webpack_require__(/*! ../internals/new-promise-capability */ "../../node_modules/core-js/internals/new-promise-capability.js");
- module.exports = function (C, x) {
- anObject(C);
- if (isObject(x) && x.constructor === C) return x;
- var promiseCapability = newPromiseCapability.f(C);
- var resolve = promiseCapability.resolve;
- resolve(x);
- return promiseCapability.promise;
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/promise-statics-incorrect-iteration.js":
- /*!****************************************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/promise-statics-incorrect-iteration.js ***!
- \****************************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var NativePromiseConstructor = __webpack_require__(/*! ../internals/promise-native-constructor */ "../../node_modules/core-js/internals/promise-native-constructor.js");
- var checkCorrectnessOfIteration = __webpack_require__(/*! ../internals/check-correctness-of-iteration */ "../../node_modules/core-js/internals/check-correctness-of-iteration.js");
- var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(/*! ../internals/promise-constructor-detection */ "../../node_modules/core-js/internals/promise-constructor-detection.js").CONSTRUCTOR;
- module.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function (iterable) {
- NativePromiseConstructor.all(iterable).then(undefined, function () { /* empty */ });
- });
- /***/ }),
- /***/ "../../node_modules/core-js/internals/queue.js":
- /*!**********************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/queue.js ***!
- \**********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var Queue = function () {
- this.head = null;
- this.tail = null;
- };
- Queue.prototype = {
- add: function (item) {
- var entry = { item: item, next: null };
- var tail = this.tail;
- if (tail) tail.next = entry;
- else this.head = entry;
- this.tail = entry;
- },
- get: function () {
- var entry = this.head;
- if (entry) {
- var next = this.head = entry.next;
- if (next === null) this.tail = null;
- return entry.item;
- }
- }
- };
- module.exports = Queue;
- /***/ }),
- /***/ "../../node_modules/core-js/internals/regexp-exec-abstract.js":
- /*!*************************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/regexp-exec-abstract.js ***!
- \*************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var call = __webpack_require__(/*! ../internals/function-call */ "../../node_modules/core-js/internals/function-call.js");
- var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js");
- var isCallable = __webpack_require__(/*! ../internals/is-callable */ "../../node_modules/core-js/internals/is-callable.js");
- var classof = __webpack_require__(/*! ../internals/classof-raw */ "../../node_modules/core-js/internals/classof-raw.js");
- var regexpExec = __webpack_require__(/*! ../internals/regexp-exec */ "../../node_modules/core-js/internals/regexp-exec.js");
- var $TypeError = TypeError;
- // `RegExpExec` abstract operation
- // https://tc39.es/ecma262/#sec-regexpexec
- module.exports = function (R, S) {
- var exec = R.exec;
- if (isCallable(exec)) {
- var result = call(exec, R, S);
- if (result !== null) anObject(result);
- return result;
- }
- if (classof(R) === 'RegExp') return call(regexpExec, R, S);
- throw new $TypeError('RegExp#exec called on incompatible receiver');
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/regexp-exec.js":
- /*!****************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/regexp-exec.js ***!
- \****************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
- /* eslint-disable regexp/no-useless-quantifier -- testing */
- var call = __webpack_require__(/*! ../internals/function-call */ "../../node_modules/core-js/internals/function-call.js");
- var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "../../node_modules/core-js/internals/function-uncurry-this.js");
- var toString = __webpack_require__(/*! ../internals/to-string */ "../../node_modules/core-js/internals/to-string.js");
- var regexpFlags = __webpack_require__(/*! ../internals/regexp-flags */ "../../node_modules/core-js/internals/regexp-flags.js");
- var stickyHelpers = __webpack_require__(/*! ../internals/regexp-sticky-helpers */ "../../node_modules/core-js/internals/regexp-sticky-helpers.js");
- var shared = __webpack_require__(/*! ../internals/shared */ "../../node_modules/core-js/internals/shared.js");
- var create = __webpack_require__(/*! ../internals/object-create */ "../../node_modules/core-js/internals/object-create.js");
- var getInternalState = __webpack_require__(/*! ../internals/internal-state */ "../../node_modules/core-js/internals/internal-state.js").get;
- var UNSUPPORTED_DOT_ALL = __webpack_require__(/*! ../internals/regexp-unsupported-dot-all */ "../../node_modules/core-js/internals/regexp-unsupported-dot-all.js");
- var UNSUPPORTED_NCG = __webpack_require__(/*! ../internals/regexp-unsupported-ncg */ "../../node_modules/core-js/internals/regexp-unsupported-ncg.js");
- var nativeReplace = shared('native-string-replace', String.prototype.replace);
- var nativeExec = RegExp.prototype.exec;
- var patchedExec = nativeExec;
- var charAt = uncurryThis(''.charAt);
- var indexOf = uncurryThis(''.indexOf);
- var replace = uncurryThis(''.replace);
- var stringSlice = uncurryThis(''.slice);
- var UPDATES_LAST_INDEX_WRONG = (function () {
- var re1 = /a/;
- var re2 = /b*/g;
- call(nativeExec, re1, 'a');
- call(nativeExec, re2, 'a');
- return re1.lastIndex !== 0 || re2.lastIndex !== 0;
- })();
- var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
- // nonparticipating capturing group, copied from es5-shim's String#split patch.
- var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
- var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
- if (PATCH) {
- patchedExec = function exec(string) {
- var re = this;
- var state = getInternalState(re);
- var str = toString(string);
- var raw = state.raw;
- var result, reCopy, lastIndex, match, i, object, group;
- if (raw) {
- raw.lastIndex = re.lastIndex;
- result = call(patchedExec, raw, str);
- re.lastIndex = raw.lastIndex;
- return result;
- }
- var groups = state.groups;
- var sticky = UNSUPPORTED_Y && re.sticky;
- var flags = call(regexpFlags, re);
- var source = re.source;
- var charsAdded = 0;
- var strCopy = str;
- if (sticky) {
- flags = replace(flags, 'y', '');
- if (indexOf(flags, 'g') === -1) {
- flags += 'g';
- }
- strCopy = stringSlice(str, re.lastIndex);
- // Support anchored sticky behavior.
- if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt(str, re.lastIndex - 1) !== '\n')) {
- source = '(?: ' + source + ')';
- strCopy = ' ' + strCopy;
- charsAdded++;
- }
- // ^(? + rx + ) is needed, in combination with some str slicing, to
- // simulate the 'y' flag.
- reCopy = new RegExp('^(?:' + source + ')', flags);
- }
- if (NPCG_INCLUDED) {
- reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
- }
- if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
- match = call(nativeExec, sticky ? reCopy : re, strCopy);
- if (sticky) {
- if (match) {
- match.input = stringSlice(match.input, charsAdded);
- match[0] = stringSlice(match[0], charsAdded);
- match.index = re.lastIndex;
- re.lastIndex += match[0].length;
- } else re.lastIndex = 0;
- } else if (UPDATES_LAST_INDEX_WRONG && match) {
- re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
- }
- if (NPCG_INCLUDED && match && match.length > 1) {
- // Fix browsers whose `exec` methods don't consistently return `undefined`
- // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
- call(nativeReplace, match[0], reCopy, function () {
- for (i = 1; i < arguments.length - 2; i++) {
- if (arguments[i] === undefined) match[i] = undefined;
- }
- });
- }
- if (match && groups) {
- match.groups = object = create(null);
- for (i = 0; i < groups.length; i++) {
- group = groups[i];
- object[group[0]] = match[group[1]];
- }
- }
- return match;
- };
- }
- module.exports = patchedExec;
- /***/ }),
- /***/ "../../node_modules/core-js/internals/regexp-sticky-helpers.js":
- /*!**************************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/regexp-sticky-helpers.js ***!
- \**************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js");
- var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js");
- // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
- var $RegExp = global.RegExp;
- var UNSUPPORTED_Y = fails(function () {
- var re = $RegExp('a', 'y');
- re.lastIndex = 2;
- return re.exec('abcd') !== null;
- });
- // UC Browser bug
- // https://github.com/zloirock/core-js/issues/1008
- var MISSED_STICKY = UNSUPPORTED_Y || fails(function () {
- return !$RegExp('a', 'y').sticky;
- });
- var BROKEN_CARET = UNSUPPORTED_Y || fails(function () {
- // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
- var re = $RegExp('^r', 'gy');
- re.lastIndex = 2;
- return re.exec('str') !== null;
- });
- module.exports = {
- BROKEN_CARET: BROKEN_CARET,
- MISSED_STICKY: MISSED_STICKY,
- UNSUPPORTED_Y: UNSUPPORTED_Y
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/regexp-unsupported-dot-all.js":
- /*!*******************************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/regexp-unsupported-dot-all.js ***!
- \*******************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js");
- var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js");
- // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
- var $RegExp = global.RegExp;
- module.exports = fails(function () {
- var re = $RegExp('.', 's');
- return !(re.dotAll && re.test('\n') && re.flags === 's');
- });
- /***/ }),
- /***/ "../../node_modules/core-js/internals/regexp-unsupported-ncg.js":
- /*!***************************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/regexp-unsupported-ncg.js ***!
- \***************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js");
- var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js");
- // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
- var $RegExp = global.RegExp;
- module.exports = fails(function () {
- var re = $RegExp('(?<a>b)', 'g');
- return re.exec('b').groups.a !== 'b' ||
- 'b'.replace(re, '$<a>c') !== 'bc';
- });
- /***/ }),
- /***/ "../../node_modules/core-js/internals/safe-get-built-in.js":
- /*!**********************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/safe-get-built-in.js ***!
- \**********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js");
- var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "../../node_modules/core-js/internals/descriptors.js");
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
- // Avoid NodeJS experimental warning
- module.exports = function (name) {
- if (!DESCRIPTORS) return global[name];
- var descriptor = getOwnPropertyDescriptor(global, name);
- return descriptor && descriptor.value;
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/set-species.js":
- /*!****************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/set-species.js ***!
- \****************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "../../node_modules/core-js/internals/get-built-in.js");
- var defineBuiltInAccessor = __webpack_require__(/*! ../internals/define-built-in-accessor */ "../../node_modules/core-js/internals/define-built-in-accessor.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js");
- var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "../../node_modules/core-js/internals/descriptors.js");
- var SPECIES = wellKnownSymbol('species');
- module.exports = function (CONSTRUCTOR_NAME) {
- var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
- if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
- defineBuiltInAccessor(Constructor, SPECIES, {
- configurable: true,
- get: function () { return this; }
- });
- }
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/species-constructor.js":
- /*!************************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/species-constructor.js ***!
- \************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js");
- var aConstructor = __webpack_require__(/*! ../internals/a-constructor */ "../../node_modules/core-js/internals/a-constructor.js");
- var isNullOrUndefined = __webpack_require__(/*! ../internals/is-null-or-undefined */ "../../node_modules/core-js/internals/is-null-or-undefined.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js");
- var SPECIES = wellKnownSymbol('species');
- // `SpeciesConstructor` abstract operation
- // https://tc39.es/ecma262/#sec-speciesconstructor
- module.exports = function (O, defaultConstructor) {
- var C = anObject(O).constructor;
- var S;
- return C === undefined || isNullOrUndefined(S = anObject(C)[SPECIES]) ? defaultConstructor : aConstructor(S);
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/string-multibyte.js":
- /*!*********************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/string-multibyte.js ***!
- \*********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "../../node_modules/core-js/internals/function-uncurry-this.js");
- var toIntegerOrInfinity = __webpack_require__(/*! ../internals/to-integer-or-infinity */ "../../node_modules/core-js/internals/to-integer-or-infinity.js");
- var toString = __webpack_require__(/*! ../internals/to-string */ "../../node_modules/core-js/internals/to-string.js");
- var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "../../node_modules/core-js/internals/require-object-coercible.js");
- var charAt = uncurryThis(''.charAt);
- var charCodeAt = uncurryThis(''.charCodeAt);
- var stringSlice = uncurryThis(''.slice);
- var createMethod = function (CONVERT_TO_STRING) {
- return function ($this, pos) {
- var S = toString(requireObjectCoercible($this));
- var position = toIntegerOrInfinity(pos);
- var size = S.length;
- var first, second;
- if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
- first = charCodeAt(S, position);
- return first < 0xD800 || first > 0xDBFF || position + 1 === size
- || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
- ? CONVERT_TO_STRING
- ? charAt(S, position)
- : first
- : CONVERT_TO_STRING
- ? stringSlice(S, position, position + 2)
- : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
- };
- };
- module.exports = {
- // `String.prototype.codePointAt` method
- // https://tc39.es/ecma262/#sec-string.prototype.codepointat
- codeAt: createMethod(false),
- // `String.prototype.at` method
- // https://github.com/mathiasbynens/String.prototype.at
- charAt: createMethod(true)
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/string-trim-forced.js":
- /*!***********************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/string-trim-forced.js ***!
- \***********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var PROPER_FUNCTION_NAME = __webpack_require__(/*! ../internals/function-name */ "../../node_modules/core-js/internals/function-name.js").PROPER;
- var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js");
- var whitespaces = __webpack_require__(/*! ../internals/whitespaces */ "../../node_modules/core-js/internals/whitespaces.js");
- var non = '\u200B\u0085\u180E';
- // check that a method works with the correct list
- // of whitespaces and has a correct name
- module.exports = function (METHOD_NAME) {
- return fails(function () {
- return !!whitespaces[METHOD_NAME]()
- || non[METHOD_NAME]() !== non
- || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);
- });
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/string-trim.js":
- /*!****************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/string-trim.js ***!
- \****************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "../../node_modules/core-js/internals/function-uncurry-this.js");
- var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "../../node_modules/core-js/internals/require-object-coercible.js");
- var toString = __webpack_require__(/*! ../internals/to-string */ "../../node_modules/core-js/internals/to-string.js");
- var whitespaces = __webpack_require__(/*! ../internals/whitespaces */ "../../node_modules/core-js/internals/whitespaces.js");
- var replace = uncurryThis(''.replace);
- var ltrim = RegExp('^[' + whitespaces + ']+');
- var rtrim = RegExp('(^|[^' + whitespaces + '])[' + whitespaces + ']+$');
- // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
- var createMethod = function (TYPE) {
- return function ($this) {
- var string = toString(requireObjectCoercible($this));
- if (TYPE & 1) string = replace(string, ltrim, '');
- if (TYPE & 2) string = replace(string, rtrim, '$1');
- return string;
- };
- };
- module.exports = {
- // `String.prototype.{ trimLeft, trimStart }` methods
- // https://tc39.es/ecma262/#sec-string.prototype.trimstart
- start: createMethod(1),
- // `String.prototype.{ trimRight, trimEnd }` methods
- // https://tc39.es/ecma262/#sec-string.prototype.trimend
- end: createMethod(2),
- // `String.prototype.trim` method
- // https://tc39.es/ecma262/#sec-string.prototype.trim
- trim: createMethod(3)
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/task.js":
- /*!*********************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/task.js ***!
- \*********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js");
- var apply = __webpack_require__(/*! ../internals/function-apply */ "../../node_modules/core-js/internals/function-apply.js");
- var bind = __webpack_require__(/*! ../internals/function-bind-context */ "../../node_modules/core-js/internals/function-bind-context.js");
- var isCallable = __webpack_require__(/*! ../internals/is-callable */ "../../node_modules/core-js/internals/is-callable.js");
- var hasOwn = __webpack_require__(/*! ../internals/has-own-property */ "../../node_modules/core-js/internals/has-own-property.js");
- var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js");
- var html = __webpack_require__(/*! ../internals/html */ "../../node_modules/core-js/internals/html.js");
- var arraySlice = __webpack_require__(/*! ../internals/array-slice */ "../../node_modules/core-js/internals/array-slice.js");
- var createElement = __webpack_require__(/*! ../internals/document-create-element */ "../../node_modules/core-js/internals/document-create-element.js");
- var validateArgumentsLength = __webpack_require__(/*! ../internals/validate-arguments-length */ "../../node_modules/core-js/internals/validate-arguments-length.js");
- var IS_IOS = __webpack_require__(/*! ../internals/engine-is-ios */ "../../node_modules/core-js/internals/engine-is-ios.js");
- var IS_NODE = __webpack_require__(/*! ../internals/engine-is-node */ "../../node_modules/core-js/internals/engine-is-node.js");
- var set = global.setImmediate;
- var clear = global.clearImmediate;
- var process = global.process;
- var Dispatch = global.Dispatch;
- var Function = global.Function;
- var MessageChannel = global.MessageChannel;
- var String = global.String;
- var counter = 0;
- var queue = {};
- var ONREADYSTATECHANGE = 'onreadystatechange';
- var $location, defer, channel, port;
- fails(function () {
- // Deno throws a ReferenceError on `location` access without `--location` flag
- $location = global.location;
- });
- var run = function (id) {
- if (hasOwn(queue, id)) {
- var fn = queue[id];
- delete queue[id];
- fn();
- }
- };
- var runner = function (id) {
- return function () {
- run(id);
- };
- };
- var eventListener = function (event) {
- run(event.data);
- };
- var globalPostMessageDefer = function (id) {
- // old engines have not location.origin
- global.postMessage(String(id), $location.protocol + '//' + $location.host);
- };
- // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
- if (!set || !clear) {
- set = function setImmediate(handler) {
- validateArgumentsLength(arguments.length, 1);
- var fn = isCallable(handler) ? handler : Function(handler);
- var args = arraySlice(arguments, 1);
- queue[++counter] = function () {
- apply(fn, undefined, args);
- };
- defer(counter);
- return counter;
- };
- clear = function clearImmediate(id) {
- delete queue[id];
- };
- // Node.js 0.8-
- if (IS_NODE) {
- defer = function (id) {
- process.nextTick(runner(id));
- };
- // Sphere (JS game engine) Dispatch API
- } else if (Dispatch && Dispatch.now) {
- defer = function (id) {
- Dispatch.now(runner(id));
- };
- // Browsers with MessageChannel, includes WebWorkers
- // except iOS - https://github.com/zloirock/core-js/issues/624
- } else if (MessageChannel && !IS_IOS) {
- channel = new MessageChannel();
- port = channel.port2;
- channel.port1.onmessage = eventListener;
- defer = bind(port.postMessage, port);
- // Browsers with postMessage, skip WebWorkers
- // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
- } else if (
- global.addEventListener &&
- isCallable(global.postMessage) &&
- !global.importScripts &&
- $location && $location.protocol !== 'file:' &&
- !fails(globalPostMessageDefer)
- ) {
- defer = globalPostMessageDefer;
- global.addEventListener('message', eventListener, false);
- // IE8-
- } else if (ONREADYSTATECHANGE in createElement('script')) {
- defer = function (id) {
- html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
- html.removeChild(this);
- run(id);
- };
- };
- // Rest old browsers
- } else {
- defer = function (id) {
- setTimeout(runner(id), 0);
- };
- }
- }
- module.exports = {
- set: set,
- clear: clear
- };
- /***/ }),
- /***/ "../../node_modules/core-js/internals/whitespaces.js":
- /*!****************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/internals/whitespaces.js ***!
- \****************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // a string of all valid unicode whitespaces
- module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
- '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
- /***/ }),
- /***/ "../../node_modules/core-js/modules/es.array.index-of.js":
- /*!********************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.array.index-of.js ***!
- \********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* eslint-disable es/no-array-prototype-indexof -- required for testing */
- var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
- var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this-clause */ "../../node_modules/core-js/internals/function-uncurry-this-clause.js");
- var $indexOf = __webpack_require__(/*! ../internals/array-includes */ "../../node_modules/core-js/internals/array-includes.js").indexOf;
- var arrayMethodIsStrict = __webpack_require__(/*! ../internals/array-method-is-strict */ "../../node_modules/core-js/internals/array-method-is-strict.js");
- var nativeIndexOf = uncurryThis([].indexOf);
- var NEGATIVE_ZERO = !!nativeIndexOf && 1 / nativeIndexOf([1], 1, -0) < 0;
- var FORCED = NEGATIVE_ZERO || !arrayMethodIsStrict('indexOf');
- // `Array.prototype.indexOf` method
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
- $({ target: 'Array', proto: true, forced: FORCED }, {
- indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
- var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
- return NEGATIVE_ZERO
- // convert -0 to +0
- ? nativeIndexOf(this, searchElement, fromIndex) || 0
- : $indexOf(this, searchElement, fromIndex);
- }
- });
- /***/ }),
- /***/ "../../node_modules/core-js/modules/es.array.iterator.js":
- /*!********************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.array.iterator.js ***!
- \********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "../../node_modules/core-js/internals/to-indexed-object.js");
- var addToUnscopables = __webpack_require__(/*! ../internals/add-to-unscopables */ "../../node_modules/core-js/internals/add-to-unscopables.js");
- var Iterators = __webpack_require__(/*! ../internals/iterators */ "../../node_modules/core-js/internals/iterators.js");
- var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "../../node_modules/core-js/internals/internal-state.js");
- var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "../../node_modules/core-js/internals/object-define-property.js").f;
- var defineIterator = __webpack_require__(/*! ../internals/iterator-define */ "../../node_modules/core-js/internals/iterator-define.js");
- var createIterResultObject = __webpack_require__(/*! ../internals/create-iter-result-object */ "../../node_modules/core-js/internals/create-iter-result-object.js");
- var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "../../node_modules/core-js/internals/is-pure.js");
- var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "../../node_modules/core-js/internals/descriptors.js");
- var ARRAY_ITERATOR = 'Array Iterator';
- var setInternalState = InternalStateModule.set;
- var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
- // `Array.prototype.entries` method
- // https://tc39.es/ecma262/#sec-array.prototype.entries
- // `Array.prototype.keys` method
- // https://tc39.es/ecma262/#sec-array.prototype.keys
- // `Array.prototype.values` method
- // https://tc39.es/ecma262/#sec-array.prototype.values
- // `Array.prototype[@@iterator]` method
- // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
- // `CreateArrayIterator` internal method
- // https://tc39.es/ecma262/#sec-createarrayiterator
- module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
- setInternalState(this, {
- type: ARRAY_ITERATOR,
- target: toIndexedObject(iterated), // target
- index: 0, // next index
- kind: kind // kind
- });
- // `%ArrayIteratorPrototype%.next` method
- // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
- }, function () {
- var state = getInternalState(this);
- var target = state.target;
- var index = state.index++;
- if (!target || index >= target.length) {
- state.target = undefined;
- return createIterResultObject(undefined, true);
- }
- switch (state.kind) {
- case 'keys': return createIterResultObject(index, false);
- case 'values': return createIterResultObject(target[index], false);
- } return createIterResultObject([index, target[index]], false);
- }, 'values');
- // argumentsList[@@iterator] is %ArrayProto_values%
- // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
- // https://tc39.es/ecma262/#sec-createmappedargumentsobject
- var values = Iterators.Arguments = Iterators.Array;
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
- addToUnscopables('keys');
- addToUnscopables('values');
- addToUnscopables('entries');
- // V8 ~ Chrome 45- bug
- if (!IS_PURE && DESCRIPTORS && values.name !== 'values') try {
- defineProperty(values, 'name', { value: 'values' });
- } catch (error) { /* empty */ }
- /***/ }),
- /***/ "../../node_modules/core-js/modules/es.array.reverse.js":
- /*!*******************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.array.reverse.js ***!
- \*******************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
- var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "../../node_modules/core-js/internals/function-uncurry-this.js");
- var isArray = __webpack_require__(/*! ../internals/is-array */ "../../node_modules/core-js/internals/is-array.js");
- var nativeReverse = uncurryThis([].reverse);
- var test = [1, 2];
- // `Array.prototype.reverse` method
- // https://tc39.es/ecma262/#sec-array.prototype.reverse
- // fix for Safari 12.0 bug
- // https://bugs.webkit.org/show_bug.cgi?id=188794
- $({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {
- reverse: function reverse() {
- // eslint-disable-next-line no-self-assign -- dirty hack
- if (isArray(this)) this.length = this.length;
- return nativeReverse(this);
- }
- });
- /***/ }),
- /***/ "../../node_modules/core-js/modules/es.promise.all.js":
- /*!*****************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.promise.all.js ***!
- \*****************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
- var call = __webpack_require__(/*! ../internals/function-call */ "../../node_modules/core-js/internals/function-call.js");
- var aCallable = __webpack_require__(/*! ../internals/a-callable */ "../../node_modules/core-js/internals/a-callable.js");
- var newPromiseCapabilityModule = __webpack_require__(/*! ../internals/new-promise-capability */ "../../node_modules/core-js/internals/new-promise-capability.js");
- var perform = __webpack_require__(/*! ../internals/perform */ "../../node_modules/core-js/internals/perform.js");
- var iterate = __webpack_require__(/*! ../internals/iterate */ "../../node_modules/core-js/internals/iterate.js");
- var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(/*! ../internals/promise-statics-incorrect-iteration */ "../../node_modules/core-js/internals/promise-statics-incorrect-iteration.js");
- // `Promise.all` method
- // https://tc39.es/ecma262/#sec-promise.all
- $({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
- all: function all(iterable) {
- var C = this;
- var capability = newPromiseCapabilityModule.f(C);
- var resolve = capability.resolve;
- var reject = capability.reject;
- var result = perform(function () {
- var $promiseResolve = aCallable(C.resolve);
- var values = [];
- var counter = 0;
- var remaining = 1;
- iterate(iterable, function (promise) {
- var index = counter++;
- var alreadyCalled = false;
- remaining++;
- call($promiseResolve, C, promise).then(function (value) {
- if (alreadyCalled) return;
- alreadyCalled = true;
- values[index] = value;
- --remaining || resolve(values);
- }, reject);
- });
- --remaining || resolve(values);
- });
- if (result.error) reject(result.value);
- return capability.promise;
- }
- });
- /***/ }),
- /***/ "../../node_modules/core-js/modules/es.promise.catch.js":
- /*!*******************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.promise.catch.js ***!
- \*******************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
- var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "../../node_modules/core-js/internals/is-pure.js");
- var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(/*! ../internals/promise-constructor-detection */ "../../node_modules/core-js/internals/promise-constructor-detection.js").CONSTRUCTOR;
- var NativePromiseConstructor = __webpack_require__(/*! ../internals/promise-native-constructor */ "../../node_modules/core-js/internals/promise-native-constructor.js");
- var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "../../node_modules/core-js/internals/get-built-in.js");
- var isCallable = __webpack_require__(/*! ../internals/is-callable */ "../../node_modules/core-js/internals/is-callable.js");
- var defineBuiltIn = __webpack_require__(/*! ../internals/define-built-in */ "../../node_modules/core-js/internals/define-built-in.js");
- var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
- // `Promise.prototype.catch` method
- // https://tc39.es/ecma262/#sec-promise.prototype.catch
- $({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, {
- 'catch': function (onRejected) {
- return this.then(undefined, onRejected);
- }
- });
- // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
- if (!IS_PURE && isCallable(NativePromiseConstructor)) {
- var method = getBuiltIn('Promise').prototype['catch'];
- if (NativePromisePrototype['catch'] !== method) {
- defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
- }
- }
- /***/ }),
- /***/ "../../node_modules/core-js/modules/es.promise.constructor.js":
- /*!*************************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.promise.constructor.js ***!
- \*************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
- var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "../../node_modules/core-js/internals/is-pure.js");
- var IS_NODE = __webpack_require__(/*! ../internals/engine-is-node */ "../../node_modules/core-js/internals/engine-is-node.js");
- var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js");
- var call = __webpack_require__(/*! ../internals/function-call */ "../../node_modules/core-js/internals/function-call.js");
- var defineBuiltIn = __webpack_require__(/*! ../internals/define-built-in */ "../../node_modules/core-js/internals/define-built-in.js");
- var setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ "../../node_modules/core-js/internals/object-set-prototype-of.js");
- var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "../../node_modules/core-js/internals/set-to-string-tag.js");
- var setSpecies = __webpack_require__(/*! ../internals/set-species */ "../../node_modules/core-js/internals/set-species.js");
- var aCallable = __webpack_require__(/*! ../internals/a-callable */ "../../node_modules/core-js/internals/a-callable.js");
- var isCallable = __webpack_require__(/*! ../internals/is-callable */ "../../node_modules/core-js/internals/is-callable.js");
- var isObject = __webpack_require__(/*! ../internals/is-object */ "../../node_modules/core-js/internals/is-object.js");
- var anInstance = __webpack_require__(/*! ../internals/an-instance */ "../../node_modules/core-js/internals/an-instance.js");
- var speciesConstructor = __webpack_require__(/*! ../internals/species-constructor */ "../../node_modules/core-js/internals/species-constructor.js");
- var task = __webpack_require__(/*! ../internals/task */ "../../node_modules/core-js/internals/task.js").set;
- var microtask = __webpack_require__(/*! ../internals/microtask */ "../../node_modules/core-js/internals/microtask.js");
- var hostReportErrors = __webpack_require__(/*! ../internals/host-report-errors */ "../../node_modules/core-js/internals/host-report-errors.js");
- var perform = __webpack_require__(/*! ../internals/perform */ "../../node_modules/core-js/internals/perform.js");
- var Queue = __webpack_require__(/*! ../internals/queue */ "../../node_modules/core-js/internals/queue.js");
- var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "../../node_modules/core-js/internals/internal-state.js");
- var NativePromiseConstructor = __webpack_require__(/*! ../internals/promise-native-constructor */ "../../node_modules/core-js/internals/promise-native-constructor.js");
- var PromiseConstructorDetection = __webpack_require__(/*! ../internals/promise-constructor-detection */ "../../node_modules/core-js/internals/promise-constructor-detection.js");
- var newPromiseCapabilityModule = __webpack_require__(/*! ../internals/new-promise-capability */ "../../node_modules/core-js/internals/new-promise-capability.js");
- var PROMISE = 'Promise';
- var FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR;
- var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
- var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
- var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
- var setInternalState = InternalStateModule.set;
- var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
- var PromiseConstructor = NativePromiseConstructor;
- var PromisePrototype = NativePromisePrototype;
- var TypeError = global.TypeError;
- var document = global.document;
- var process = global.process;
- var newPromiseCapability = newPromiseCapabilityModule.f;
- var newGenericPromiseCapability = newPromiseCapability;
- var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);
- var UNHANDLED_REJECTION = 'unhandledrejection';
- var REJECTION_HANDLED = 'rejectionhandled';
- var PENDING = 0;
- var FULFILLED = 1;
- var REJECTED = 2;
- var HANDLED = 1;
- var UNHANDLED = 2;
- var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
- // helpers
- var isThenable = function (it) {
- var then;
- return isObject(it) && isCallable(then = it.then) ? then : false;
- };
- var callReaction = function (reaction, state) {
- var value = state.value;
- var ok = state.state === FULFILLED;
- var handler = ok ? reaction.ok : reaction.fail;
- var resolve = reaction.resolve;
- var reject = reaction.reject;
- var domain = reaction.domain;
- var result, then, exited;
- try {
- if (handler) {
- if (!ok) {
- if (state.rejection === UNHANDLED) onHandleUnhandled(state);
- state.rejection = HANDLED;
- }
- if (handler === true) result = value;
- else {
- if (domain) domain.enter();
- result = handler(value); // can throw
- if (domain) {
- domain.exit();
- exited = true;
- }
- }
- if (result === reaction.promise) {
- reject(new TypeError('Promise-chain cycle'));
- } else if (then = isThenable(result)) {
- call(then, result, resolve, reject);
- } else resolve(result);
- } else reject(value);
- } catch (error) {
- if (domain && !exited) domain.exit();
- reject(error);
- }
- };
- var notify = function (state, isReject) {
- if (state.notified) return;
- state.notified = true;
- microtask(function () {
- var reactions = state.reactions;
- var reaction;
- while (reaction = reactions.get()) {
- callReaction(reaction, state);
- }
- state.notified = false;
- if (isReject && !state.rejection) onUnhandled(state);
- });
- };
- var dispatchEvent = function (name, promise, reason) {
- var event, handler;
- if (DISPATCH_EVENT) {
- event = document.createEvent('Event');
- event.promise = promise;
- event.reason = reason;
- event.initEvent(name, false, true);
- global.dispatchEvent(event);
- } else event = { promise: promise, reason: reason };
- if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);
- else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
- };
- var onUnhandled = function (state) {
- call(task, global, function () {
- var promise = state.facade;
- var value = state.value;
- var IS_UNHANDLED = isUnhandled(state);
- var result;
- if (IS_UNHANDLED) {
- result = perform(function () {
- if (IS_NODE) {
- process.emit('unhandledRejection', value, promise);
- } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
- });
- // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
- state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
- if (result.error) throw result.value;
- }
- });
- };
- var isUnhandled = function (state) {
- return state.rejection !== HANDLED && !state.parent;
- };
- var onHandleUnhandled = function (state) {
- call(task, global, function () {
- var promise = state.facade;
- if (IS_NODE) {
- process.emit('rejectionHandled', promise);
- } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
- });
- };
- var bind = function (fn, state, unwrap) {
- return function (value) {
- fn(state, value, unwrap);
- };
- };
- var internalReject = function (state, value, unwrap) {
- if (state.done) return;
- state.done = true;
- if (unwrap) state = unwrap;
- state.value = value;
- state.state = REJECTED;
- notify(state, true);
- };
- var internalResolve = function (state, value, unwrap) {
- if (state.done) return;
- state.done = true;
- if (unwrap) state = unwrap;
- try {
- if (state.facade === value) throw new TypeError("Promise can't be resolved itself");
- var then = isThenable(value);
- if (then) {
- microtask(function () {
- var wrapper = { done: false };
- try {
- call(then, value,
- bind(internalResolve, wrapper, state),
- bind(internalReject, wrapper, state)
- );
- } catch (error) {
- internalReject(wrapper, error, state);
- }
- });
- } else {
- state.value = value;
- state.state = FULFILLED;
- notify(state, false);
- }
- } catch (error) {
- internalReject({ done: false }, error, state);
- }
- };
- // constructor polyfill
- if (FORCED_PROMISE_CONSTRUCTOR) {
- // 25.4.3.1 Promise(executor)
- PromiseConstructor = function Promise(executor) {
- anInstance(this, PromisePrototype);
- aCallable(executor);
- call(Internal, this);
- var state = getInternalPromiseState(this);
- try {
- executor(bind(internalResolve, state), bind(internalReject, state));
- } catch (error) {
- internalReject(state, error);
- }
- };
- PromisePrototype = PromiseConstructor.prototype;
- // eslint-disable-next-line no-unused-vars -- required for `.length`
- Internal = function Promise(executor) {
- setInternalState(this, {
- type: PROMISE,
- done: false,
- notified: false,
- parent: false,
- reactions: new Queue(),
- rejection: false,
- state: PENDING,
- value: undefined
- });
- };
- // `Promise.prototype.then` method
- // https://tc39.es/ecma262/#sec-promise.prototype.then
- Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
- var state = getInternalPromiseState(this);
- var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
- state.parent = true;
- reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
- reaction.fail = isCallable(onRejected) && onRejected;
- reaction.domain = IS_NODE ? process.domain : undefined;
- if (state.state === PENDING) state.reactions.add(reaction);
- else microtask(function () {
- callReaction(reaction, state);
- });
- return reaction.promise;
- });
- OwnPromiseCapability = function () {
- var promise = new Internal();
- var state = getInternalPromiseState(promise);
- this.promise = promise;
- this.resolve = bind(internalResolve, state);
- this.reject = bind(internalReject, state);
- };
- newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
- return C === PromiseConstructor || C === PromiseWrapper
- ? new OwnPromiseCapability(C)
- : newGenericPromiseCapability(C);
- };
- if (!IS_PURE && isCallable(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) {
- nativeThen = NativePromisePrototype.then;
- if (!NATIVE_PROMISE_SUBCLASSING) {
- // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
- defineBuiltIn(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {
- var that = this;
- return new PromiseConstructor(function (resolve, reject) {
- call(nativeThen, that, resolve, reject);
- }).then(onFulfilled, onRejected);
- // https://github.com/zloirock/core-js/issues/640
- }, { unsafe: true });
- }
- // make `.constructor === Promise` work for native promise-based APIs
- try {
- delete NativePromisePrototype.constructor;
- } catch (error) { /* empty */ }
- // make `instanceof Promise` work for native promise-based APIs
- if (setPrototypeOf) {
- setPrototypeOf(NativePromisePrototype, PromisePrototype);
- }
- }
- }
- $({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
- Promise: PromiseConstructor
- });
- setToStringTag(PromiseConstructor, PROMISE, false, true);
- setSpecies(PROMISE);
- /***/ }),
- /***/ "../../node_modules/core-js/modules/es.promise.js":
- /*!*************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.promise.js ***!
- \*************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // TODO: Remove this module from `core-js@4` since it's split to modules listed below
- __webpack_require__(/*! ../modules/es.promise.constructor */ "../../node_modules/core-js/modules/es.promise.constructor.js");
- __webpack_require__(/*! ../modules/es.promise.all */ "../../node_modules/core-js/modules/es.promise.all.js");
- __webpack_require__(/*! ../modules/es.promise.catch */ "../../node_modules/core-js/modules/es.promise.catch.js");
- __webpack_require__(/*! ../modules/es.promise.race */ "../../node_modules/core-js/modules/es.promise.race.js");
- __webpack_require__(/*! ../modules/es.promise.reject */ "../../node_modules/core-js/modules/es.promise.reject.js");
- __webpack_require__(/*! ../modules/es.promise.resolve */ "../../node_modules/core-js/modules/es.promise.resolve.js");
- /***/ }),
- /***/ "../../node_modules/core-js/modules/es.promise.race.js":
- /*!******************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.promise.race.js ***!
- \******************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
- var call = __webpack_require__(/*! ../internals/function-call */ "../../node_modules/core-js/internals/function-call.js");
- var aCallable = __webpack_require__(/*! ../internals/a-callable */ "../../node_modules/core-js/internals/a-callable.js");
- var newPromiseCapabilityModule = __webpack_require__(/*! ../internals/new-promise-capability */ "../../node_modules/core-js/internals/new-promise-capability.js");
- var perform = __webpack_require__(/*! ../internals/perform */ "../../node_modules/core-js/internals/perform.js");
- var iterate = __webpack_require__(/*! ../internals/iterate */ "../../node_modules/core-js/internals/iterate.js");
- var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(/*! ../internals/promise-statics-incorrect-iteration */ "../../node_modules/core-js/internals/promise-statics-incorrect-iteration.js");
- // `Promise.race` method
- // https://tc39.es/ecma262/#sec-promise.race
- $({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
- race: function race(iterable) {
- var C = this;
- var capability = newPromiseCapabilityModule.f(C);
- var reject = capability.reject;
- var result = perform(function () {
- var $promiseResolve = aCallable(C.resolve);
- iterate(iterable, function (promise) {
- call($promiseResolve, C, promise).then(capability.resolve, reject);
- });
- });
- if (result.error) reject(result.value);
- return capability.promise;
- }
- });
- /***/ }),
- /***/ "../../node_modules/core-js/modules/es.promise.reject.js":
- /*!********************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.promise.reject.js ***!
- \********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
- var newPromiseCapabilityModule = __webpack_require__(/*! ../internals/new-promise-capability */ "../../node_modules/core-js/internals/new-promise-capability.js");
- var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(/*! ../internals/promise-constructor-detection */ "../../node_modules/core-js/internals/promise-constructor-detection.js").CONSTRUCTOR;
- // `Promise.reject` method
- // https://tc39.es/ecma262/#sec-promise.reject
- $({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
- reject: function reject(r) {
- var capability = newPromiseCapabilityModule.f(this);
- var capabilityReject = capability.reject;
- capabilityReject(r);
- return capability.promise;
- }
- });
- /***/ }),
- /***/ "../../node_modules/core-js/modules/es.promise.resolve.js":
- /*!*********************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.promise.resolve.js ***!
- \*********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
- var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "../../node_modules/core-js/internals/get-built-in.js");
- var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "../../node_modules/core-js/internals/is-pure.js");
- var NativePromiseConstructor = __webpack_require__(/*! ../internals/promise-native-constructor */ "../../node_modules/core-js/internals/promise-native-constructor.js");
- var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(/*! ../internals/promise-constructor-detection */ "../../node_modules/core-js/internals/promise-constructor-detection.js").CONSTRUCTOR;
- var promiseResolve = __webpack_require__(/*! ../internals/promise-resolve */ "../../node_modules/core-js/internals/promise-resolve.js");
- var PromiseConstructorWrapper = getBuiltIn('Promise');
- var CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR;
- // `Promise.resolve` method
- // https://tc39.es/ecma262/#sec-promise.resolve
- $({ target: 'Promise', stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR }, {
- resolve: function resolve(x) {
- return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x);
- }
- });
- /***/ }),
- /***/ "../../node_modules/core-js/modules/es.regexp.exec.js":
- /*!*****************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.regexp.exec.js ***!
- \*****************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
- var exec = __webpack_require__(/*! ../internals/regexp-exec */ "../../node_modules/core-js/internals/regexp-exec.js");
- // `RegExp.prototype.exec` method
- // https://tc39.es/ecma262/#sec-regexp.prototype.exec
- $({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
- exec: exec
- });
- /***/ }),
- /***/ "../../node_modules/core-js/modules/es.regexp.to-string.js":
- /*!**********************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.regexp.to-string.js ***!
- \**********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var PROPER_FUNCTION_NAME = __webpack_require__(/*! ../internals/function-name */ "../../node_modules/core-js/internals/function-name.js").PROPER;
- var defineBuiltIn = __webpack_require__(/*! ../internals/define-built-in */ "../../node_modules/core-js/internals/define-built-in.js");
- var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js");
- var $toString = __webpack_require__(/*! ../internals/to-string */ "../../node_modules/core-js/internals/to-string.js");
- var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js");
- var getRegExpFlags = __webpack_require__(/*! ../internals/regexp-get-flags */ "../../node_modules/core-js/internals/regexp-get-flags.js");
- var TO_STRING = 'toString';
- var RegExpPrototype = RegExp.prototype;
- var nativeToString = RegExpPrototype[TO_STRING];
- var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; });
- // FF44- RegExp#toString has a wrong name
- var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name !== TO_STRING;
- // `RegExp.prototype.toString` method
- // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
- if (NOT_GENERIC || INCORRECT_NAME) {
- defineBuiltIn(RegExpPrototype, TO_STRING, function toString() {
- var R = anObject(this);
- var pattern = $toString(R.source);
- var flags = $toString(getRegExpFlags(R));
- return '/' + pattern + '/' + flags;
- }, { unsafe: true });
- }
- /***/ }),
- /***/ "../../node_modules/core-js/modules/es.string.ends-with.js":
- /*!**********************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.string.ends-with.js ***!
- \**********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
- var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this-clause */ "../../node_modules/core-js/internals/function-uncurry-this-clause.js");
- var getOwnPropertyDescriptor = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "../../node_modules/core-js/internals/object-get-own-property-descriptor.js").f;
- var toLength = __webpack_require__(/*! ../internals/to-length */ "../../node_modules/core-js/internals/to-length.js");
- var toString = __webpack_require__(/*! ../internals/to-string */ "../../node_modules/core-js/internals/to-string.js");
- var notARegExp = __webpack_require__(/*! ../internals/not-a-regexp */ "../../node_modules/core-js/internals/not-a-regexp.js");
- var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "../../node_modules/core-js/internals/require-object-coercible.js");
- var correctIsRegExpLogic = __webpack_require__(/*! ../internals/correct-is-regexp-logic */ "../../node_modules/core-js/internals/correct-is-regexp-logic.js");
- var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "../../node_modules/core-js/internals/is-pure.js");
- var slice = uncurryThis(''.slice);
- var min = Math.min;
- var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('endsWith');
- // https://github.com/zloirock/core-js/pull/702
- var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () {
- var descriptor = getOwnPropertyDescriptor(String.prototype, 'endsWith');
- return descriptor && !descriptor.writable;
- }();
- // `String.prototype.endsWith` method
- // https://tc39.es/ecma262/#sec-string.prototype.endswith
- $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
- endsWith: function endsWith(searchString /* , endPosition = @length */) {
- var that = toString(requireObjectCoercible(this));
- notARegExp(searchString);
- var endPosition = arguments.length > 1 ? arguments[1] : undefined;
- var len = that.length;
- var end = endPosition === undefined ? len : min(toLength(endPosition), len);
- var search = toString(searchString);
- return slice(that, end - search.length, end) === search;
- }
- });
- /***/ }),
- /***/ "../../node_modules/core-js/modules/es.string.includes.js":
- /*!*********************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.string.includes.js ***!
- \*********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
- var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "../../node_modules/core-js/internals/function-uncurry-this.js");
- var notARegExp = __webpack_require__(/*! ../internals/not-a-regexp */ "../../node_modules/core-js/internals/not-a-regexp.js");
- var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "../../node_modules/core-js/internals/require-object-coercible.js");
- var toString = __webpack_require__(/*! ../internals/to-string */ "../../node_modules/core-js/internals/to-string.js");
- var correctIsRegExpLogic = __webpack_require__(/*! ../internals/correct-is-regexp-logic */ "../../node_modules/core-js/internals/correct-is-regexp-logic.js");
- var stringIndexOf = uncurryThis(''.indexOf);
- // `String.prototype.includes` method
- // https://tc39.es/ecma262/#sec-string.prototype.includes
- $({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
- includes: function includes(searchString /* , position = 0 */) {
- return !!~stringIndexOf(
- toString(requireObjectCoercible(this)),
- toString(notARegExp(searchString)),
- arguments.length > 1 ? arguments[1] : undefined
- );
- }
- });
- /***/ }),
- /***/ "../../node_modules/core-js/modules/es.string.match.js":
- /*!******************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.string.match.js ***!
- \******************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var call = __webpack_require__(/*! ../internals/function-call */ "../../node_modules/core-js/internals/function-call.js");
- var fixRegExpWellKnownSymbolLogic = __webpack_require__(/*! ../internals/fix-regexp-well-known-symbol-logic */ "../../node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js");
- var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js");
- var isNullOrUndefined = __webpack_require__(/*! ../internals/is-null-or-undefined */ "../../node_modules/core-js/internals/is-null-or-undefined.js");
- var toLength = __webpack_require__(/*! ../internals/to-length */ "../../node_modules/core-js/internals/to-length.js");
- var toString = __webpack_require__(/*! ../internals/to-string */ "../../node_modules/core-js/internals/to-string.js");
- var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "../../node_modules/core-js/internals/require-object-coercible.js");
- var getMethod = __webpack_require__(/*! ../internals/get-method */ "../../node_modules/core-js/internals/get-method.js");
- var advanceStringIndex = __webpack_require__(/*! ../internals/advance-string-index */ "../../node_modules/core-js/internals/advance-string-index.js");
- var regExpExec = __webpack_require__(/*! ../internals/regexp-exec-abstract */ "../../node_modules/core-js/internals/regexp-exec-abstract.js");
- // @@match logic
- fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {
- return [
- // `String.prototype.match` method
- // https://tc39.es/ecma262/#sec-string.prototype.match
- function match(regexp) {
- var O = requireObjectCoercible(this);
- var matcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, MATCH);
- return matcher ? call(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString(O));
- },
- // `RegExp.prototype[@@match]` method
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
- function (string) {
- var rx = anObject(this);
- var S = toString(string);
- var res = maybeCallNative(nativeMatch, rx, S);
- if (res.done) return res.value;
- if (!rx.global) return regExpExec(rx, S);
- var fullUnicode = rx.unicode;
- rx.lastIndex = 0;
- var A = [];
- var n = 0;
- var result;
- while ((result = regExpExec(rx, S)) !== null) {
- var matchStr = toString(result[0]);
- A[n] = matchStr;
- if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
- n++;
- }
- return n === 0 ? null : A;
- }
- ];
- });
- /***/ }),
- /***/ "../../node_modules/core-js/modules/es.string.replace.js":
- /*!********************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.string.replace.js ***!
- \********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var apply = __webpack_require__(/*! ../internals/function-apply */ "../../node_modules/core-js/internals/function-apply.js");
- var call = __webpack_require__(/*! ../internals/function-call */ "../../node_modules/core-js/internals/function-call.js");
- var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "../../node_modules/core-js/internals/function-uncurry-this.js");
- var fixRegExpWellKnownSymbolLogic = __webpack_require__(/*! ../internals/fix-regexp-well-known-symbol-logic */ "../../node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js");
- var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js");
- var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js");
- var isCallable = __webpack_require__(/*! ../internals/is-callable */ "../../node_modules/core-js/internals/is-callable.js");
- var isNullOrUndefined = __webpack_require__(/*! ../internals/is-null-or-undefined */ "../../node_modules/core-js/internals/is-null-or-undefined.js");
- var toIntegerOrInfinity = __webpack_require__(/*! ../internals/to-integer-or-infinity */ "../../node_modules/core-js/internals/to-integer-or-infinity.js");
- var toLength = __webpack_require__(/*! ../internals/to-length */ "../../node_modules/core-js/internals/to-length.js");
- var toString = __webpack_require__(/*! ../internals/to-string */ "../../node_modules/core-js/internals/to-string.js");
- var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "../../node_modules/core-js/internals/require-object-coercible.js");
- var advanceStringIndex = __webpack_require__(/*! ../internals/advance-string-index */ "../../node_modules/core-js/internals/advance-string-index.js");
- var getMethod = __webpack_require__(/*! ../internals/get-method */ "../../node_modules/core-js/internals/get-method.js");
- var getSubstitution = __webpack_require__(/*! ../internals/get-substitution */ "../../node_modules/core-js/internals/get-substitution.js");
- var regExpExec = __webpack_require__(/*! ../internals/regexp-exec-abstract */ "../../node_modules/core-js/internals/regexp-exec-abstract.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js");
- var REPLACE = wellKnownSymbol('replace');
- var max = Math.max;
- var min = Math.min;
- var concat = uncurryThis([].concat);
- var push = uncurryThis([].push);
- var stringIndexOf = uncurryThis(''.indexOf);
- var stringSlice = uncurryThis(''.slice);
- var maybeToString = function (it) {
- return it === undefined ? it : String(it);
- };
- // IE <= 11 replaces $0 with the whole match, as if it was $&
- // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
- var REPLACE_KEEPS_$0 = (function () {
- // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
- return 'a'.replace(/./, '$0') === '$0';
- })();
- // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
- var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
- if (/./[REPLACE]) {
- return /./[REPLACE]('a', '$0') === '';
- }
- return false;
- })();
- var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
- var re = /./;
- re.exec = function () {
- var result = [];
- result.groups = { a: '7' };
- return result;
- };
- // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
- return ''.replace(re, '$<a>') !== '7';
- });
- // @@replace logic
- fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
- var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
- return [
- // `String.prototype.replace` method
- // https://tc39.es/ecma262/#sec-string.prototype.replace
- function replace(searchValue, replaceValue) {
- var O = requireObjectCoercible(this);
- var replacer = isNullOrUndefined(searchValue) ? undefined : getMethod(searchValue, REPLACE);
- return replacer
- ? call(replacer, searchValue, O, replaceValue)
- : call(nativeReplace, toString(O), searchValue, replaceValue);
- },
- // `RegExp.prototype[@@replace]` method
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
- function (string, replaceValue) {
- var rx = anObject(this);
- var S = toString(string);
- if (
- typeof replaceValue == 'string' &&
- stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
- stringIndexOf(replaceValue, '$<') === -1
- ) {
- var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
- if (res.done) return res.value;
- }
- var functionalReplace = isCallable(replaceValue);
- if (!functionalReplace) replaceValue = toString(replaceValue);
- var global = rx.global;
- var fullUnicode;
- if (global) {
- fullUnicode = rx.unicode;
- rx.lastIndex = 0;
- }
- var results = [];
- var result;
- while (true) {
- result = regExpExec(rx, S);
- if (result === null) break;
- push(results, result);
- if (!global) break;
- var matchStr = toString(result[0]);
- if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
- }
- var accumulatedResult = '';
- var nextSourcePosition = 0;
- for (var i = 0; i < results.length; i++) {
- result = results[i];
- var matched = toString(result[0]);
- var position = max(min(toIntegerOrInfinity(result.index), S.length), 0);
- var captures = [];
- var replacement;
- // NOTE: This is equivalent to
- // captures = result.slice(1).map(maybeToString)
- // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
- // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
- // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
- for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j]));
- var namedCaptures = result.groups;
- if (functionalReplace) {
- var replacerArgs = concat([matched], captures, position, S);
- if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);
- replacement = toString(apply(replaceValue, undefined, replacerArgs));
- } else {
- replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
- }
- if (position >= nextSourcePosition) {
- accumulatedResult += stringSlice(S, nextSourcePosition, position) + replacement;
- nextSourcePosition = position + matched.length;
- }
- }
- return accumulatedResult + stringSlice(S, nextSourcePosition);
- }
- ];
- }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
- /***/ }),
- /***/ "../../node_modules/core-js/modules/es.string.split.js":
- /*!******************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.string.split.js ***!
- \******************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var call = __webpack_require__(/*! ../internals/function-call */ "../../node_modules/core-js/internals/function-call.js");
- var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ "../../node_modules/core-js/internals/function-uncurry-this.js");
- var fixRegExpWellKnownSymbolLogic = __webpack_require__(/*! ../internals/fix-regexp-well-known-symbol-logic */ "../../node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js");
- var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js");
- var isNullOrUndefined = __webpack_require__(/*! ../internals/is-null-or-undefined */ "../../node_modules/core-js/internals/is-null-or-undefined.js");
- var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "../../node_modules/core-js/internals/require-object-coercible.js");
- var speciesConstructor = __webpack_require__(/*! ../internals/species-constructor */ "../../node_modules/core-js/internals/species-constructor.js");
- var advanceStringIndex = __webpack_require__(/*! ../internals/advance-string-index */ "../../node_modules/core-js/internals/advance-string-index.js");
- var toLength = __webpack_require__(/*! ../internals/to-length */ "../../node_modules/core-js/internals/to-length.js");
- var toString = __webpack_require__(/*! ../internals/to-string */ "../../node_modules/core-js/internals/to-string.js");
- var getMethod = __webpack_require__(/*! ../internals/get-method */ "../../node_modules/core-js/internals/get-method.js");
- var regExpExec = __webpack_require__(/*! ../internals/regexp-exec-abstract */ "../../node_modules/core-js/internals/regexp-exec-abstract.js");
- var stickyHelpers = __webpack_require__(/*! ../internals/regexp-sticky-helpers */ "../../node_modules/core-js/internals/regexp-sticky-helpers.js");
- var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js");
- var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
- var MAX_UINT32 = 0xFFFFFFFF;
- var min = Math.min;
- var push = uncurryThis([].push);
- var stringSlice = uncurryThis(''.slice);
- // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
- // Weex JS has frozen built-in prototypes, so use try / catch wrapper
- var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
- // eslint-disable-next-line regexp/no-empty-group -- required for testing
- var re = /(?:)/;
- var originalExec = re.exec;
- re.exec = function () { return originalExec.apply(this, arguments); };
- var result = 'ab'.split(re);
- return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
- });
- var BUGGY = 'abbc'.split(/(b)*/)[1] === 'c' ||
- // eslint-disable-next-line regexp/no-empty-group -- required for testing
- 'test'.split(/(?:)/, -1).length !== 4 ||
- 'ab'.split(/(?:ab)*/).length !== 2 ||
- '.'.split(/(.?)(.?)/).length !== 4 ||
- // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
- '.'.split(/()()/).length > 1 ||
- ''.split(/.?/).length;
- // @@split logic
- fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {
- var internalSplit = '0'.split(undefined, 0).length ? function (separator, limit) {
- return separator === undefined && limit === 0 ? [] : call(nativeSplit, this, separator, limit);
- } : nativeSplit;
- return [
- // `String.prototype.split` method
- // https://tc39.es/ecma262/#sec-string.prototype.split
- function split(separator, limit) {
- var O = requireObjectCoercible(this);
- var splitter = isNullOrUndefined(separator) ? undefined : getMethod(separator, SPLIT);
- return splitter
- ? call(splitter, separator, O, limit)
- : call(internalSplit, toString(O), separator, limit);
- },
- // `RegExp.prototype[@@split]` method
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
- //
- // NOTE: This cannot be properly polyfilled in engines that don't support
- // the 'y' flag.
- function (string, limit) {
- var rx = anObject(this);
- var S = toString(string);
- if (!BUGGY) {
- var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
- if (res.done) return res.value;
- }
- var C = speciesConstructor(rx, RegExp);
- var unicodeMatching = rx.unicode;
- var flags = (rx.ignoreCase ? 'i' : '') +
- (rx.multiline ? 'm' : '') +
- (rx.unicode ? 'u' : '') +
- (UNSUPPORTED_Y ? 'g' : 'y');
- // ^(? + rx + ) is needed, in combination with some S slicing, to
- // simulate the 'y' flag.
- var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
- var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
- if (lim === 0) return [];
- if (S.length === 0) return regExpExec(splitter, S) === null ? [S] : [];
- var p = 0;
- var q = 0;
- var A = [];
- while (q < S.length) {
- splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
- var z = regExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S);
- var e;
- if (
- z === null ||
- (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p
- ) {
- q = advanceStringIndex(S, q, unicodeMatching);
- } else {
- push(A, stringSlice(S, p, q));
- if (A.length === lim) return A;
- for (var i = 1; i <= z.length - 1; i++) {
- push(A, z[i]);
- if (A.length === lim) return A;
- }
- q = p = e;
- }
- }
- push(A, stringSlice(S, p));
- return A;
- }
- ];
- }, BUGGY || !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
- /***/ }),
- /***/ "../../node_modules/core-js/modules/es.string.starts-with.js":
- /*!************************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.string.starts-with.js ***!
- \************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
- var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this-clause */ "../../node_modules/core-js/internals/function-uncurry-this-clause.js");
- var getOwnPropertyDescriptor = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "../../node_modules/core-js/internals/object-get-own-property-descriptor.js").f;
- var toLength = __webpack_require__(/*! ../internals/to-length */ "../../node_modules/core-js/internals/to-length.js");
- var toString = __webpack_require__(/*! ../internals/to-string */ "../../node_modules/core-js/internals/to-string.js");
- var notARegExp = __webpack_require__(/*! ../internals/not-a-regexp */ "../../node_modules/core-js/internals/not-a-regexp.js");
- var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "../../node_modules/core-js/internals/require-object-coercible.js");
- var correctIsRegExpLogic = __webpack_require__(/*! ../internals/correct-is-regexp-logic */ "../../node_modules/core-js/internals/correct-is-regexp-logic.js");
- var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "../../node_modules/core-js/internals/is-pure.js");
- var stringSlice = uncurryThis(''.slice);
- var min = Math.min;
- var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith');
- // https://github.com/zloirock/core-js/pull/702
- var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () {
- var descriptor = getOwnPropertyDescriptor(String.prototype, 'startsWith');
- return descriptor && !descriptor.writable;
- }();
- // `String.prototype.startsWith` method
- // https://tc39.es/ecma262/#sec-string.prototype.startswith
- $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
- startsWith: function startsWith(searchString /* , position = 0 */) {
- var that = toString(requireObjectCoercible(this));
- notARegExp(searchString);
- var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length));
- var search = toString(searchString);
- return stringSlice(that, index, index + search.length) === search;
- }
- });
- /***/ }),
- /***/ "../../node_modules/core-js/modules/es.string.trim.js":
- /*!*****************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/es.string.trim.js ***!
- \*****************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js");
- var $trim = __webpack_require__(/*! ../internals/string-trim */ "../../node_modules/core-js/internals/string-trim.js").trim;
- var forcedStringTrimMethod = __webpack_require__(/*! ../internals/string-trim-forced */ "../../node_modules/core-js/internals/string-trim-forced.js");
- // `String.prototype.trim` method
- // https://tc39.es/ecma262/#sec-string.prototype.trim
- $({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
- trim: function trim() {
- return $trim(this);
- }
- });
- /***/ }),
- /***/ "../../node_modules/core-js/modules/web.dom-collections.iterator.js":
- /*!*******************************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/core-js/modules/web.dom-collections.iterator.js ***!
- \*******************************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js");
- var DOMIterables = __webpack_require__(/*! ../internals/dom-iterables */ "../../node_modules/core-js/internals/dom-iterables.js");
- var DOMTokenListPrototype = __webpack_require__(/*! ../internals/dom-token-list-prototype */ "../../node_modules/core-js/internals/dom-token-list-prototype.js");
- var ArrayIteratorMethods = __webpack_require__(/*! ../modules/es.array.iterator */ "../../node_modules/core-js/modules/es.array.iterator.js");
- var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "../../node_modules/core-js/internals/create-non-enumerable-property.js");
- var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "../../node_modules/core-js/internals/set-to-string-tag.js");
- var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js");
- var ITERATOR = wellKnownSymbol('iterator');
- var ArrayValues = ArrayIteratorMethods.values;
- var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
- if (CollectionPrototype) {
- // some Chrome versions have non-configurable methods on DOMTokenList
- if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
- createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
- } catch (error) {
- CollectionPrototype[ITERATOR] = ArrayValues;
- }
- setToStringTag(CollectionPrototype, COLLECTION_NAME, true);
- if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
- // some Chrome versions have non-configurable methods on DOMTokenList
- if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
- createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
- } catch (error) {
- CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
- }
- }
- }
- };
- for (var COLLECTION_NAME in DOMIterables) {
- handlePrototype(global[COLLECTION_NAME] && global[COLLECTION_NAME].prototype, COLLECTION_NAME);
- }
- handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
- /***/ }),
- /***/ "../../node_modules/performance-now/lib/performance-now.js":
- /*!**********************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/performance-now/lib/performance-now.js ***!
- \**********************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- /* WEBPACK VAR INJECTION */(function(process) {// Generated by CoffeeScript 1.12.2
- (function() {
- var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime;
- if ((typeof performance !== "undefined" && performance !== null) && performance.now) {
- module.exports = function() {
- return performance.now();
- };
- } else if ((typeof process !== "undefined" && process !== null) && process.hrtime) {
- module.exports = function() {
- return (getNanoSeconds() - nodeLoadTime) / 1e6;
- };
- hrtime = process.hrtime;
- getNanoSeconds = function() {
- var hr;
- hr = hrtime();
- return hr[0] * 1e9 + hr[1];
- };
- moduleLoadTime = getNanoSeconds();
- upTime = process.uptime() * 1e9;
- nodeLoadTime = moduleLoadTime - upTime;
- } else if (Date.now) {
- module.exports = function() {
- return Date.now() - loadTime;
- };
- loadTime = Date.now();
- } else {
- module.exports = function() {
- return new Date().getTime() - loadTime;
- };
- loadTime = new Date().getTime();
- }
- }).call(this);
- //# sourceMappingURL=performance-now.js.map
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ "../../node_modules/node-libs-browser/mock/process.js")))
- /***/ }),
- /***/ "../../node_modules/raf/index.js":
- /*!********************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/raf/index.js ***!
- \********************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
- /* WEBPACK VAR INJECTION */(function(global) {var now = __webpack_require__(/*! performance-now */ "../../node_modules/performance-now/lib/performance-now.js")
- , root = typeof window === 'undefined' ? global : window
- , vendors = ['moz', 'webkit']
- , suffix = 'AnimationFrame'
- , raf = root['request' + suffix]
- , caf = root['cancel' + suffix] || root['cancelRequest' + suffix]
- for(var i = 0; !raf && i < vendors.length; i++) {
- raf = root[vendors[i] + 'Request' + suffix]
- caf = root[vendors[i] + 'Cancel' + suffix]
- || root[vendors[i] + 'CancelRequest' + suffix]
- }
- // Some versions of FF have rAF but not cAF
- if(!raf || !caf) {
- var last = 0
- , id = 0
- , queue = []
- , frameDuration = 1000 / 60
- raf = function(callback) {
- if(queue.length === 0) {
- var _now = now()
- , next = Math.max(0, frameDuration - (_now - last))
- last = next + _now
- setTimeout(function() {
- var cp = queue.slice(0)
- // Clear queue here to prevent
- // callbacks from appending listeners
- // to the current frame's queue
- queue.length = 0
- for(var i = 0; i < cp.length; i++) {
- if(!cp[i].cancelled) {
- try{
- cp[i].callback(last)
- } catch(e) {
- setTimeout(function() { throw e }, 0)
- }
- }
- }
- }, Math.round(next))
- }
- queue.push({
- handle: ++id,
- callback: callback,
- cancelled: false
- })
- return id
- }
- caf = function(handle) {
- for(var i = 0; i < queue.length; i++) {
- if(queue[i].handle === handle) {
- queue[i].cancelled = true
- }
- }
- }
- }
- module.exports = function(fn) {
- // Wrap in a new function to prevent
- // `cancel` potentially being assigned
- // to the native rAF function
- return raf.call(root, fn)
- }
- module.exports.cancel = function() {
- caf.apply(root, arguments)
- }
- module.exports.polyfill = function(object) {
- if (!object) {
- object = root;
- }
- object.requestAnimationFrame = raf
- object.cancelAnimationFrame = caf
- }
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "../../node_modules/webpack/buildin/global.js")))
- /***/ }),
- /***/ "../../node_modules/rgbcolor/index.js":
- /*!*************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/rgbcolor/index.js ***!
- \*************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
- /*
- Based on rgbcolor.js by Stoyan Stefanov <sstoo@gmail.com>
- http://www.phpied.com/rgb-color-parser-in-javascript/
- */
- module.exports = function(color_string) {
- this.ok = false;
- this.alpha = 1.0;
- // strip any leading #
- if (color_string.charAt(0) == '#') { // remove # if any
- color_string = color_string.substr(1,6);
- }
- color_string = color_string.replace(/ /g,'');
- color_string = color_string.toLowerCase();
- // before getting into regexps, try simple matches
- // and overwrite the input
- var simple_colors = {
- aliceblue: 'f0f8ff',
- antiquewhite: 'faebd7',
- aqua: '00ffff',
- aquamarine: '7fffd4',
- azure: 'f0ffff',
- beige: 'f5f5dc',
- bisque: 'ffe4c4',
- black: '000000',
- blanchedalmond: 'ffebcd',
- blue: '0000ff',
- blueviolet: '8a2be2',
- brown: 'a52a2a',
- burlywood: 'deb887',
- cadetblue: '5f9ea0',
- chartreuse: '7fff00',
- chocolate: 'd2691e',
- coral: 'ff7f50',
- cornflowerblue: '6495ed',
- cornsilk: 'fff8dc',
- crimson: 'dc143c',
- cyan: '00ffff',
- darkblue: '00008b',
- darkcyan: '008b8b',
- darkgoldenrod: 'b8860b',
- darkgray: 'a9a9a9',
- darkgreen: '006400',
- darkkhaki: 'bdb76b',
- darkmagenta: '8b008b',
- darkolivegreen: '556b2f',
- darkorange: 'ff8c00',
- darkorchid: '9932cc',
- darkred: '8b0000',
- darksalmon: 'e9967a',
- darkseagreen: '8fbc8f',
- darkslateblue: '483d8b',
- darkslategray: '2f4f4f',
- darkturquoise: '00ced1',
- darkviolet: '9400d3',
- deeppink: 'ff1493',
- deepskyblue: '00bfff',
- dimgray: '696969',
- dodgerblue: '1e90ff',
- feldspar: 'd19275',
- firebrick: 'b22222',
- floralwhite: 'fffaf0',
- forestgreen: '228b22',
- fuchsia: 'ff00ff',
- gainsboro: 'dcdcdc',
- ghostwhite: 'f8f8ff',
- gold: 'ffd700',
- goldenrod: 'daa520',
- gray: '808080',
- green: '008000',
- greenyellow: 'adff2f',
- honeydew: 'f0fff0',
- hotpink: 'ff69b4',
- indianred : 'cd5c5c',
- indigo : '4b0082',
- ivory: 'fffff0',
- khaki: 'f0e68c',
- lavender: 'e6e6fa',
- lavenderblush: 'fff0f5',
- lawngreen: '7cfc00',
- lemonchiffon: 'fffacd',
- lightblue: 'add8e6',
- lightcoral: 'f08080',
- lightcyan: 'e0ffff',
- lightgoldenrodyellow: 'fafad2',
- lightgrey: 'd3d3d3',
- lightgreen: '90ee90',
- lightpink: 'ffb6c1',
- lightsalmon: 'ffa07a',
- lightseagreen: '20b2aa',
- lightskyblue: '87cefa',
- lightslateblue: '8470ff',
- lightslategray: '778899',
- lightsteelblue: 'b0c4de',
- lightyellow: 'ffffe0',
- lime: '00ff00',
- limegreen: '32cd32',
- linen: 'faf0e6',
- magenta: 'ff00ff',
- maroon: '800000',
- mediumaquamarine: '66cdaa',
- mediumblue: '0000cd',
- mediumorchid: 'ba55d3',
- mediumpurple: '9370d8',
- mediumseagreen: '3cb371',
- mediumslateblue: '7b68ee',
- mediumspringgreen: '00fa9a',
- mediumturquoise: '48d1cc',
- mediumvioletred: 'c71585',
- midnightblue: '191970',
- mintcream: 'f5fffa',
- mistyrose: 'ffe4e1',
- moccasin: 'ffe4b5',
- navajowhite: 'ffdead',
- navy: '000080',
- oldlace: 'fdf5e6',
- olive: '808000',
- olivedrab: '6b8e23',
- orange: 'ffa500',
- orangered: 'ff4500',
- orchid: 'da70d6',
- palegoldenrod: 'eee8aa',
- palegreen: '98fb98',
- paleturquoise: 'afeeee',
- palevioletred: 'd87093',
- papayawhip: 'ffefd5',
- peachpuff: 'ffdab9',
- peru: 'cd853f',
- pink: 'ffc0cb',
- plum: 'dda0dd',
- powderblue: 'b0e0e6',
- purple: '800080',
- rebeccapurple: '663399',
- red: 'ff0000',
- rosybrown: 'bc8f8f',
- royalblue: '4169e1',
- saddlebrown: '8b4513',
- salmon: 'fa8072',
- sandybrown: 'f4a460',
- seagreen: '2e8b57',
- seashell: 'fff5ee',
- sienna: 'a0522d',
- silver: 'c0c0c0',
- skyblue: '87ceeb',
- slateblue: '6a5acd',
- slategray: '708090',
- snow: 'fffafa',
- springgreen: '00ff7f',
- steelblue: '4682b4',
- tan: 'd2b48c',
- teal: '008080',
- thistle: 'd8bfd8',
- tomato: 'ff6347',
- turquoise: '40e0d0',
- violet: 'ee82ee',
- violetred: 'd02090',
- wheat: 'f5deb3',
- white: 'ffffff',
- whitesmoke: 'f5f5f5',
- yellow: 'ffff00',
- yellowgreen: '9acd32'
- };
- color_string = simple_colors[color_string] || color_string;
- // emd of simple type-in colors
- // array of color definition objects
- var color_defs = [
- {
- re: /^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,
- example: ['rgba(123, 234, 45, 0.8)', 'rgba(255,234,245,1.0)'],
- process: function (bits){
- return [
- parseInt(bits[1]),
- parseInt(bits[2]),
- parseInt(bits[3]),
- parseFloat(bits[4])
- ];
- }
- },
- {
- re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
- example: ['rgb(123, 234, 45)', 'rgb(255,234,245)'],
- process: function (bits){
- return [
- parseInt(bits[1]),
- parseInt(bits[2]),
- parseInt(bits[3])
- ];
- }
- },
- {
- re: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
- example: ['#00ff00', '336699'],
- process: function (bits){
- return [
- parseInt(bits[1], 16),
- parseInt(bits[2], 16),
- parseInt(bits[3], 16)
- ];
- }
- },
- {
- re: /^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
- example: ['#fb0', 'f0f'],
- process: function (bits){
- return [
- parseInt(bits[1] + bits[1], 16),
- parseInt(bits[2] + bits[2], 16),
- parseInt(bits[3] + bits[3], 16)
- ];
- }
- }
- ];
- // search through the definitions to find a match
- for (var i = 0; i < color_defs.length; i++) {
- var re = color_defs[i].re;
- var processor = color_defs[i].process;
- var bits = re.exec(color_string);
- if (bits) {
- var channels = processor(bits);
- this.r = channels[0];
- this.g = channels[1];
- this.b = channels[2];
- if (channels.length > 3) {
- this.alpha = channels[3];
- }
- this.ok = true;
- }
- }
- // validate/cleanup values
- this.r = (this.r < 0 || isNaN(this.r)) ? 0 : ((this.r > 255) ? 255 : this.r);
- this.g = (this.g < 0 || isNaN(this.g)) ? 0 : ((this.g > 255) ? 255 : this.g);
- this.b = (this.b < 0 || isNaN(this.b)) ? 0 : ((this.b > 255) ? 255 : this.b);
- this.alpha = (this.alpha < 0) ? 0 : ((this.alpha > 1.0 || isNaN(this.alpha)) ? 1.0 : this.alpha);
- // some getters
- this.toRGB = function () {
- return 'rgb(' + this.r + ', ' + this.g + ', ' + this.b + ')';
- }
- this.toRGBA = function () {
- return 'rgba(' + this.r + ', ' + this.g + ', ' + this.b + ', ' + this.alpha + ')';
- }
- this.toHex = function () {
- var r = this.r.toString(16);
- var g = this.g.toString(16);
- var b = this.b.toString(16);
- if (r.length == 1) r = '0' + r;
- if (g.length == 1) g = '0' + g;
- if (b.length == 1) b = '0' + b;
- return '#' + r + g + b;
- }
- // help
- this.getHelpXML = function () {
- var examples = new Array();
- // add regexps
- for (var i = 0; i < color_defs.length; i++) {
- var example = color_defs[i].example;
- for (var j = 0; j < example.length; j++) {
- examples[examples.length] = example[j];
- }
- }
- // add type-in colors
- for (var sc in simple_colors) {
- examples[examples.length] = sc;
- }
- var xml = document.createElement('ul');
- xml.setAttribute('id', 'rgbcolor-examples');
- for (var i = 0; i < examples.length; i++) {
- try {
- var list_item = document.createElement('li');
- var list_color = new RGBColor(examples[i]);
- var example_div = document.createElement('div');
- example_div.style.cssText =
- 'margin: 3px; '
- + 'border: 1px solid black; '
- + 'background:' + list_color.toHex() + '; '
- + 'color:' + list_color.toHex()
- ;
- example_div.appendChild(document.createTextNode('test'));
- var list_item_value = document.createTextNode(
- ' ' + examples[i] + ' -> ' + list_color.toRGB() + ' -> ' + list_color.toHex()
- );
- list_item.appendChild(example_div);
- list_item.appendChild(list_item_value);
- xml.appendChild(list_item);
- } catch(e){}
- }
- return xml;
- }
- }
- /***/ }),
- /***/ "../../node_modules/stackblur-canvas/dist/stackblur-es.js":
- /*!*********************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/stackblur-canvas/dist/stackblur-es.js ***!
- \*********************************************************************************/
- /*! exports provided: BlurStack, canvasRGB, canvasRGBA, image, imageDataRGB, imageDataRGBA */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BlurStack", function() { return BlurStack; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canvasRGB", function() { return processCanvasRGB; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canvasRGBA", function() { return processCanvasRGBA; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "image", function() { return processImage; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "imageDataRGB", function() { return processImageDataRGB; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "imageDataRGBA", function() { return processImageDataRGBA; });
- function _typeof(obj) {
- "@babel/helpers - typeof";
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
- _typeof = function (obj) {
- return typeof obj;
- };
- } else {
- _typeof = function (obj) {
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
- };
- }
- return _typeof(obj);
- }
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- /* eslint-disable no-bitwise -- used for calculations */
- /* eslint-disable unicorn/prefer-query-selector -- aiming at
- backward-compatibility */
- /**
- * StackBlur - a fast almost Gaussian Blur For Canvas
- *
- * In case you find this class useful - especially in commercial projects -
- * I am not totally unhappy for a small donation to my PayPal account
- * mario@quasimondo.de
- *
- * Or support me on flattr:
- * {@link https://flattr.com/thing/72791/StackBlur-a-fast-almost-Gaussian-Blur-Effect-for-CanvasJavascript}.
- *
- * @module StackBlur
- * @author Mario Klingemann
- * Contact: mario@quasimondo.com
- * Website: {@link http://www.quasimondo.com/StackBlurForCanvas/StackBlurDemo.html}
- * Twitter: @quasimondo
- *
- * @copyright (c) 2010 Mario Klingemann
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use,
- * copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following
- * conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */
- var mulTable = [512, 512, 456, 512, 328, 456, 335, 512, 405, 328, 271, 456, 388, 335, 292, 512, 454, 405, 364, 328, 298, 271, 496, 456, 420, 388, 360, 335, 312, 292, 273, 512, 482, 454, 428, 405, 383, 364, 345, 328, 312, 298, 284, 271, 259, 496, 475, 456, 437, 420, 404, 388, 374, 360, 347, 335, 323, 312, 302, 292, 282, 273, 265, 512, 497, 482, 468, 454, 441, 428, 417, 405, 394, 383, 373, 364, 354, 345, 337, 328, 320, 312, 305, 298, 291, 284, 278, 271, 265, 259, 507, 496, 485, 475, 465, 456, 446, 437, 428, 420, 412, 404, 396, 388, 381, 374, 367, 360, 354, 347, 341, 335, 329, 323, 318, 312, 307, 302, 297, 292, 287, 282, 278, 273, 269, 265, 261, 512, 505, 497, 489, 482, 475, 468, 461, 454, 447, 441, 435, 428, 422, 417, 411, 405, 399, 394, 389, 383, 378, 373, 368, 364, 359, 354, 350, 345, 341, 337, 332, 328, 324, 320, 316, 312, 309, 305, 301, 298, 294, 291, 287, 284, 281, 278, 274, 271, 268, 265, 262, 259, 257, 507, 501, 496, 491, 485, 480, 475, 470, 465, 460, 456, 451, 446, 442, 437, 433, 428, 424, 420, 416, 412, 408, 404, 400, 396, 392, 388, 385, 381, 377, 374, 370, 367, 363, 360, 357, 354, 350, 347, 344, 341, 338, 335, 332, 329, 326, 323, 320, 318, 315, 312, 310, 307, 304, 302, 299, 297, 294, 292, 289, 287, 285, 282, 280, 278, 275, 273, 271, 269, 267, 265, 263, 261, 259];
- var shgTable = [9, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24];
- /**
- * @param {string|HTMLImageElement} img
- * @param {string|HTMLCanvasElement} canvas
- * @param {Float} radius
- * @param {boolean} blurAlphaChannel
- * @param {boolean} useOffset
- * @param {boolean} skipStyles
- * @returns {undefined}
- */
- function processImage(img, canvas, radius, blurAlphaChannel, useOffset, skipStyles) {
- if (typeof img === 'string') {
- img = document.getElementById(img);
- }
- if (!img || Object.prototype.toString.call(img).slice(8, -1) === 'HTMLImageElement' && !('naturalWidth' in img)) {
- return;
- }
- var dimensionType = useOffset ? 'offset' : 'natural';
- var w = img[dimensionType + 'Width'];
- var h = img[dimensionType + 'Height']; // add ImageBitmap support,can blur texture source
- if (Object.prototype.toString.call(img).slice(8, -1) === 'ImageBitmap') {
- w = img.width;
- h = img.height;
- }
- if (typeof canvas === 'string') {
- canvas = document.getElementById(canvas);
- }
- if (!canvas || !('getContext' in canvas)) {
- return;
- }
- if (!skipStyles) {
- canvas.style.width = w + 'px';
- canvas.style.height = h + 'px';
- }
- canvas.width = w;
- canvas.height = h;
- var context = canvas.getContext('2d');
- context.clearRect(0, 0, w, h);
- context.drawImage(img, 0, 0, img.naturalWidth, img.naturalHeight, 0, 0, w, h);
- if (isNaN(radius) || radius < 1) {
- return;
- }
- if (blurAlphaChannel) {
- processCanvasRGBA(canvas, 0, 0, w, h, radius);
- } else {
- processCanvasRGB(canvas, 0, 0, w, h, radius);
- }
- }
- /**
- * @param {string|HTMLCanvasElement} canvas
- * @param {Integer} topX
- * @param {Integer} topY
- * @param {Integer} width
- * @param {Integer} height
- * @throws {Error|TypeError}
- * @returns {ImageData} See {@link https://html.spec.whatwg.org/multipage/canvas.html#imagedata}
- */
- function getImageDataFromCanvas(canvas, topX, topY, width, height) {
- if (typeof canvas === 'string') {
- canvas = document.getElementById(canvas);
- }
- if (!canvas || _typeof(canvas) !== 'object' || !('getContext' in canvas)) {
- throw new TypeError('Expecting canvas with `getContext` method ' + 'in processCanvasRGB(A) calls!');
- }
- var context = canvas.getContext('2d');
- try {
- return context.getImageData(topX, topY, width, height);
- } catch (e) {
- throw new Error('unable to access image data: ' + e);
- }
- }
- /**
- * @param {HTMLCanvasElement} canvas
- * @param {Integer} topX
- * @param {Integer} topY
- * @param {Integer} width
- * @param {Integer} height
- * @param {Float} radius
- * @returns {undefined}
- */
- function processCanvasRGBA(canvas, topX, topY, width, height, radius) {
- if (isNaN(radius) || radius < 1) {
- return;
- }
- radius |= 0;
- var imageData = getImageDataFromCanvas(canvas, topX, topY, width, height);
- imageData = processImageDataRGBA(imageData, topX, topY, width, height, radius);
- canvas.getContext('2d').putImageData(imageData, topX, topY);
- }
- /**
- * @param {ImageData} imageData
- * @param {Integer} topX
- * @param {Integer} topY
- * @param {Integer} width
- * @param {Integer} height
- * @param {Float} radius
- * @returns {ImageData}
- */
- function processImageDataRGBA(imageData, topX, topY, width, height, radius) {
- var pixels = imageData.data;
- var div = 2 * radius + 1; // const w4 = width << 2;
- var widthMinus1 = width - 1;
- var heightMinus1 = height - 1;
- var radiusPlus1 = radius + 1;
- var sumFactor = radiusPlus1 * (radiusPlus1 + 1) / 2;
- var stackStart = new BlurStack();
- var stack = stackStart;
- var stackEnd;
- for (var i = 1; i < div; i++) {
- stack = stack.next = new BlurStack();
- if (i === radiusPlus1) {
- stackEnd = stack;
- }
- }
- stack.next = stackStart;
- var stackIn = null,
- stackOut = null,
- yw = 0,
- yi = 0;
- var mulSum = mulTable[radius];
- var shgSum = shgTable[radius];
- for (var y = 0; y < height; y++) {
- stack = stackStart;
- var pr = pixels[yi],
- pg = pixels[yi + 1],
- pb = pixels[yi + 2],
- pa = pixels[yi + 3];
- for (var _i = 0; _i < radiusPlus1; _i++) {
- stack.r = pr;
- stack.g = pg;
- stack.b = pb;
- stack.a = pa;
- stack = stack.next;
- }
- var rInSum = 0,
- gInSum = 0,
- bInSum = 0,
- aInSum = 0,
- rOutSum = radiusPlus1 * pr,
- gOutSum = radiusPlus1 * pg,
- bOutSum = radiusPlus1 * pb,
- aOutSum = radiusPlus1 * pa,
- rSum = sumFactor * pr,
- gSum = sumFactor * pg,
- bSum = sumFactor * pb,
- aSum = sumFactor * pa;
- for (var _i2 = 1; _i2 < radiusPlus1; _i2++) {
- var p = yi + ((widthMinus1 < _i2 ? widthMinus1 : _i2) << 2);
- var r = pixels[p],
- g = pixels[p + 1],
- b = pixels[p + 2],
- a = pixels[p + 3];
- var rbs = radiusPlus1 - _i2;
- rSum += (stack.r = r) * rbs;
- gSum += (stack.g = g) * rbs;
- bSum += (stack.b = b) * rbs;
- aSum += (stack.a = a) * rbs;
- rInSum += r;
- gInSum += g;
- bInSum += b;
- aInSum += a;
- stack = stack.next;
- }
- stackIn = stackStart;
- stackOut = stackEnd;
- for (var x = 0; x < width; x++) {
- var paInitial = aSum * mulSum >>> shgSum;
- pixels[yi + 3] = paInitial;
- if (paInitial !== 0) {
- var _a2 = 255 / paInitial;
- pixels[yi] = (rSum * mulSum >>> shgSum) * _a2;
- pixels[yi + 1] = (gSum * mulSum >>> shgSum) * _a2;
- pixels[yi + 2] = (bSum * mulSum >>> shgSum) * _a2;
- } else {
- pixels[yi] = pixels[yi + 1] = pixels[yi + 2] = 0;
- }
- rSum -= rOutSum;
- gSum -= gOutSum;
- bSum -= bOutSum;
- aSum -= aOutSum;
- rOutSum -= stackIn.r;
- gOutSum -= stackIn.g;
- bOutSum -= stackIn.b;
- aOutSum -= stackIn.a;
- var _p = x + radius + 1;
- _p = yw + (_p < widthMinus1 ? _p : widthMinus1) << 2;
- rInSum += stackIn.r = pixels[_p];
- gInSum += stackIn.g = pixels[_p + 1];
- bInSum += stackIn.b = pixels[_p + 2];
- aInSum += stackIn.a = pixels[_p + 3];
- rSum += rInSum;
- gSum += gInSum;
- bSum += bInSum;
- aSum += aInSum;
- stackIn = stackIn.next;
- var _stackOut = stackOut,
- _r = _stackOut.r,
- _g = _stackOut.g,
- _b = _stackOut.b,
- _a = _stackOut.a;
- rOutSum += _r;
- gOutSum += _g;
- bOutSum += _b;
- aOutSum += _a;
- rInSum -= _r;
- gInSum -= _g;
- bInSum -= _b;
- aInSum -= _a;
- stackOut = stackOut.next;
- yi += 4;
- }
- yw += width;
- }
- for (var _x = 0; _x < width; _x++) {
- yi = _x << 2;
- var _pr = pixels[yi],
- _pg = pixels[yi + 1],
- _pb = pixels[yi + 2],
- _pa = pixels[yi + 3],
- _rOutSum = radiusPlus1 * _pr,
- _gOutSum = radiusPlus1 * _pg,
- _bOutSum = radiusPlus1 * _pb,
- _aOutSum = radiusPlus1 * _pa,
- _rSum = sumFactor * _pr,
- _gSum = sumFactor * _pg,
- _bSum = sumFactor * _pb,
- _aSum = sumFactor * _pa;
- stack = stackStart;
- for (var _i3 = 0; _i3 < radiusPlus1; _i3++) {
- stack.r = _pr;
- stack.g = _pg;
- stack.b = _pb;
- stack.a = _pa;
- stack = stack.next;
- }
- var yp = width;
- var _gInSum = 0,
- _bInSum = 0,
- _aInSum = 0,
- _rInSum = 0;
- for (var _i4 = 1; _i4 <= radius; _i4++) {
- yi = yp + _x << 2;
- var _rbs = radiusPlus1 - _i4;
- _rSum += (stack.r = _pr = pixels[yi]) * _rbs;
- _gSum += (stack.g = _pg = pixels[yi + 1]) * _rbs;
- _bSum += (stack.b = _pb = pixels[yi + 2]) * _rbs;
- _aSum += (stack.a = _pa = pixels[yi + 3]) * _rbs;
- _rInSum += _pr;
- _gInSum += _pg;
- _bInSum += _pb;
- _aInSum += _pa;
- stack = stack.next;
- if (_i4 < heightMinus1) {
- yp += width;
- }
- }
- yi = _x;
- stackIn = stackStart;
- stackOut = stackEnd;
- for (var _y = 0; _y < height; _y++) {
- var _p2 = yi << 2;
- pixels[_p2 + 3] = _pa = _aSum * mulSum >>> shgSum;
- if (_pa > 0) {
- _pa = 255 / _pa;
- pixels[_p2] = (_rSum * mulSum >>> shgSum) * _pa;
- pixels[_p2 + 1] = (_gSum * mulSum >>> shgSum) * _pa;
- pixels[_p2 + 2] = (_bSum * mulSum >>> shgSum) * _pa;
- } else {
- pixels[_p2] = pixels[_p2 + 1] = pixels[_p2 + 2] = 0;
- }
- _rSum -= _rOutSum;
- _gSum -= _gOutSum;
- _bSum -= _bOutSum;
- _aSum -= _aOutSum;
- _rOutSum -= stackIn.r;
- _gOutSum -= stackIn.g;
- _bOutSum -= stackIn.b;
- _aOutSum -= stackIn.a;
- _p2 = _x + ((_p2 = _y + radiusPlus1) < heightMinus1 ? _p2 : heightMinus1) * width << 2;
- _rSum += _rInSum += stackIn.r = pixels[_p2];
- _gSum += _gInSum += stackIn.g = pixels[_p2 + 1];
- _bSum += _bInSum += stackIn.b = pixels[_p2 + 2];
- _aSum += _aInSum += stackIn.a = pixels[_p2 + 3];
- stackIn = stackIn.next;
- _rOutSum += _pr = stackOut.r;
- _gOutSum += _pg = stackOut.g;
- _bOutSum += _pb = stackOut.b;
- _aOutSum += _pa = stackOut.a;
- _rInSum -= _pr;
- _gInSum -= _pg;
- _bInSum -= _pb;
- _aInSum -= _pa;
- stackOut = stackOut.next;
- yi += width;
- }
- }
- return imageData;
- }
- /**
- * @param {HTMLCanvasElement} canvas
- * @param {Integer} topX
- * @param {Integer} topY
- * @param {Integer} width
- * @param {Integer} height
- * @param {Float} radius
- * @returns {undefined}
- */
- function processCanvasRGB(canvas, topX, topY, width, height, radius) {
- if (isNaN(radius) || radius < 1) {
- return;
- }
- radius |= 0;
- var imageData = getImageDataFromCanvas(canvas, topX, topY, width, height);
- imageData = processImageDataRGB(imageData, topX, topY, width, height, radius);
- canvas.getContext('2d').putImageData(imageData, topX, topY);
- }
- /**
- * @param {ImageData} imageData
- * @param {Integer} topX
- * @param {Integer} topY
- * @param {Integer} width
- * @param {Integer} height
- * @param {Float} radius
- * @returns {ImageData}
- */
- function processImageDataRGB(imageData, topX, topY, width, height, radius) {
- var pixels = imageData.data;
- var div = 2 * radius + 1; // const w4 = width << 2;
- var widthMinus1 = width - 1;
- var heightMinus1 = height - 1;
- var radiusPlus1 = radius + 1;
- var sumFactor = radiusPlus1 * (radiusPlus1 + 1) / 2;
- var stackStart = new BlurStack();
- var stack = stackStart;
- var stackEnd;
- for (var i = 1; i < div; i++) {
- stack = stack.next = new BlurStack();
- if (i === radiusPlus1) {
- stackEnd = stack;
- }
- }
- stack.next = stackStart;
- var stackIn = null;
- var stackOut = null;
- var mulSum = mulTable[radius];
- var shgSum = shgTable[radius];
- var p, rbs;
- var yw = 0,
- yi = 0;
- for (var y = 0; y < height; y++) {
- var pr = pixels[yi],
- pg = pixels[yi + 1],
- pb = pixels[yi + 2],
- rOutSum = radiusPlus1 * pr,
- gOutSum = radiusPlus1 * pg,
- bOutSum = radiusPlus1 * pb,
- rSum = sumFactor * pr,
- gSum = sumFactor * pg,
- bSum = sumFactor * pb;
- stack = stackStart;
- for (var _i5 = 0; _i5 < radiusPlus1; _i5++) {
- stack.r = pr;
- stack.g = pg;
- stack.b = pb;
- stack = stack.next;
- }
- var rInSum = 0,
- gInSum = 0,
- bInSum = 0;
- for (var _i6 = 1; _i6 < radiusPlus1; _i6++) {
- p = yi + ((widthMinus1 < _i6 ? widthMinus1 : _i6) << 2);
- rSum += (stack.r = pr = pixels[p]) * (rbs = radiusPlus1 - _i6);
- gSum += (stack.g = pg = pixels[p + 1]) * rbs;
- bSum += (stack.b = pb = pixels[p + 2]) * rbs;
- rInSum += pr;
- gInSum += pg;
- bInSum += pb;
- stack = stack.next;
- }
- stackIn = stackStart;
- stackOut = stackEnd;
- for (var x = 0; x < width; x++) {
- pixels[yi] = rSum * mulSum >>> shgSum;
- pixels[yi + 1] = gSum * mulSum >>> shgSum;
- pixels[yi + 2] = bSum * mulSum >>> shgSum;
- rSum -= rOutSum;
- gSum -= gOutSum;
- bSum -= bOutSum;
- rOutSum -= stackIn.r;
- gOutSum -= stackIn.g;
- bOutSum -= stackIn.b;
- p = yw + ((p = x + radius + 1) < widthMinus1 ? p : widthMinus1) << 2;
- rInSum += stackIn.r = pixels[p];
- gInSum += stackIn.g = pixels[p + 1];
- bInSum += stackIn.b = pixels[p + 2];
- rSum += rInSum;
- gSum += gInSum;
- bSum += bInSum;
- stackIn = stackIn.next;
- rOutSum += pr = stackOut.r;
- gOutSum += pg = stackOut.g;
- bOutSum += pb = stackOut.b;
- rInSum -= pr;
- gInSum -= pg;
- bInSum -= pb;
- stackOut = stackOut.next;
- yi += 4;
- }
- yw += width;
- }
- for (var _x2 = 0; _x2 < width; _x2++) {
- yi = _x2 << 2;
- var _pr2 = pixels[yi],
- _pg2 = pixels[yi + 1],
- _pb2 = pixels[yi + 2],
- _rOutSum2 = radiusPlus1 * _pr2,
- _gOutSum2 = radiusPlus1 * _pg2,
- _bOutSum2 = radiusPlus1 * _pb2,
- _rSum2 = sumFactor * _pr2,
- _gSum2 = sumFactor * _pg2,
- _bSum2 = sumFactor * _pb2;
- stack = stackStart;
- for (var _i7 = 0; _i7 < radiusPlus1; _i7++) {
- stack.r = _pr2;
- stack.g = _pg2;
- stack.b = _pb2;
- stack = stack.next;
- }
- var _rInSum2 = 0,
- _gInSum2 = 0,
- _bInSum2 = 0;
- for (var _i8 = 1, yp = width; _i8 <= radius; _i8++) {
- yi = yp + _x2 << 2;
- _rSum2 += (stack.r = _pr2 = pixels[yi]) * (rbs = radiusPlus1 - _i8);
- _gSum2 += (stack.g = _pg2 = pixels[yi + 1]) * rbs;
- _bSum2 += (stack.b = _pb2 = pixels[yi + 2]) * rbs;
- _rInSum2 += _pr2;
- _gInSum2 += _pg2;
- _bInSum2 += _pb2;
- stack = stack.next;
- if (_i8 < heightMinus1) {
- yp += width;
- }
- }
- yi = _x2;
- stackIn = stackStart;
- stackOut = stackEnd;
- for (var _y2 = 0; _y2 < height; _y2++) {
- p = yi << 2;
- pixels[p] = _rSum2 * mulSum >>> shgSum;
- pixels[p + 1] = _gSum2 * mulSum >>> shgSum;
- pixels[p + 2] = _bSum2 * mulSum >>> shgSum;
- _rSum2 -= _rOutSum2;
- _gSum2 -= _gOutSum2;
- _bSum2 -= _bOutSum2;
- _rOutSum2 -= stackIn.r;
- _gOutSum2 -= stackIn.g;
- _bOutSum2 -= stackIn.b;
- p = _x2 + ((p = _y2 + radiusPlus1) < heightMinus1 ? p : heightMinus1) * width << 2;
- _rSum2 += _rInSum2 += stackIn.r = pixels[p];
- _gSum2 += _gInSum2 += stackIn.g = pixels[p + 1];
- _bSum2 += _bInSum2 += stackIn.b = pixels[p + 2];
- stackIn = stackIn.next;
- _rOutSum2 += _pr2 = stackOut.r;
- _gOutSum2 += _pg2 = stackOut.g;
- _bOutSum2 += _pb2 = stackOut.b;
- _rInSum2 -= _pr2;
- _gInSum2 -= _pg2;
- _bInSum2 -= _pb2;
- stackOut = stackOut.next;
- yi += width;
- }
- }
- return imageData;
- }
- /**
- *
- */
- var BlurStack =
- /**
- * Set properties.
- */
- function BlurStack() {
- _classCallCheck(this, BlurStack);
- this.r = 0;
- this.g = 0;
- this.b = 0;
- this.a = 0;
- this.next = null;
- };
- /***/ }),
- /***/ "../../node_modules/svg-pathdata/lib/SVGPathData.module.js":
- /*!**********************************************************************************!*\
- !*** D:/web_src/4dkankan_v4/node_modules/svg-pathdata/lib/SVGPathData.module.js ***!
- \**********************************************************************************/
- /*! exports provided: COMMAND_ARG_COUNTS, SVGPathData, SVGPathDataParser, SVGPathDataTransformer, encodeSVGPath */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "COMMAND_ARG_COUNTS", function() { return N; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SVGPathData", function() { return _; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SVGPathDataParser", function() { return f; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SVGPathDataTransformer", function() { return u; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "encodeSVGPath", function() { return e; });
- /*! *****************************************************************************
- Copyright (c) Microsoft Corporation.
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted.
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
- ***************************************************************************** */
- var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])})(r,e)};function r(r,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function e(t){var r="";Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i=t[e];if(i.type===_.CLOSE_PATH)r+="z";else if(i.type===_.HORIZ_LINE_TO)r+=(i.relative?"h":"H")+i.x;else if(i.type===_.VERT_LINE_TO)r+=(i.relative?"v":"V")+i.y;else if(i.type===_.MOVE_TO)r+=(i.relative?"m":"M")+i.x+" "+i.y;else if(i.type===_.LINE_TO)r+=(i.relative?"l":"L")+i.x+" "+i.y;else if(i.type===_.CURVE_TO)r+=(i.relative?"c":"C")+i.x1+" "+i.y1+" "+i.x2+" "+i.y2+" "+i.x+" "+i.y;else if(i.type===_.SMOOTH_CURVE_TO)r+=(i.relative?"s":"S")+i.x2+" "+i.y2+" "+i.x+" "+i.y;else if(i.type===_.QUAD_TO)r+=(i.relative?"q":"Q")+i.x1+" "+i.y1+" "+i.x+" "+i.y;else if(i.type===_.SMOOTH_QUAD_TO)r+=(i.relative?"t":"T")+i.x+" "+i.y;else{if(i.type!==_.ARC)throw new Error('Unexpected command type "'+i.type+'" at index '+e+".");r+=(i.relative?"a":"A")+i.rX+" "+i.rY+" "+i.xRot+" "+ +i.lArcFlag+" "+ +i.sweepFlag+" "+i.x+" "+i.y}}return r}function i(t,r){var e=t[0],i=t[1];return[e*Math.cos(r)-i*Math.sin(r),e*Math.sin(r)+i*Math.cos(r)]}function a(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var e=0;e<t.length;e++)if("number"!=typeof t[e])throw new Error("assertNumbers arguments["+e+"] is not a number. "+typeof t[e]+" == typeof "+t[e]);return!0}var n=Math.PI;function o(t,r,e){t.lArcFlag=0===t.lArcFlag?0:1,t.sweepFlag=0===t.sweepFlag?0:1;var a=t.rX,o=t.rY,s=t.x,u=t.y;a=Math.abs(t.rX),o=Math.abs(t.rY);var h=i([(r-s)/2,(e-u)/2],-t.xRot/180*n),c=h[0],y=h[1],p=Math.pow(c,2)/Math.pow(a,2)+Math.pow(y,2)/Math.pow(o,2);1<p&&(a*=Math.sqrt(p),o*=Math.sqrt(p)),t.rX=a,t.rY=o;var m=Math.pow(a,2)*Math.pow(y,2)+Math.pow(o,2)*Math.pow(c,2),O=(t.lArcFlag!==t.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(a,2)*Math.pow(o,2)-m)/m)),l=a*y/o*O,T=-o*c/a*O,v=i([l,T],t.xRot/180*n);t.cX=v[0]+(r+s)/2,t.cY=v[1]+(e+u)/2,t.phi1=Math.atan2((y-T)/o,(c-l)/a),t.phi2=Math.atan2((-y-T)/o,(-c-l)/a),0===t.sweepFlag&&t.phi2>t.phi1&&(t.phi2-=2*n),1===t.sweepFlag&&t.phi2<t.phi1&&(t.phi2+=2*n),t.phi1*=180/n,t.phi2*=180/n}function s(t,r,e){a(t,r,e);var i=t*t+r*r-e*e;if(0>i)return[];if(0===i)return[[t*e/(t*t+r*r),r*e/(t*t+r*r)]];var n=Math.sqrt(i);return[[(t*e+r*n)/(t*t+r*r),(r*e-t*n)/(t*t+r*r)],[(t*e-r*n)/(t*t+r*r),(r*e+t*n)/(t*t+r*r)]]}var u,h=Math.PI/180;function c(t,r,e){return(1-e)*t+e*r}function y(t,r,e,i){return t+Math.cos(i/180*n)*r+Math.sin(i/180*n)*e}function p(t,r,e,i){var a=1e-6,n=r-t,o=e-r,s=3*n+3*(i-e)-6*o,u=6*(o-n),h=3*n;return Math.abs(s)<a?[-h/u]:function(t,r,e){void 0===e&&(e=1e-6);var i=t*t/4-r;if(i<-e)return[];if(i<=e)return[-t/2];var a=Math.sqrt(i);return[-t/2-a,-t/2+a]}(u/s,h/s,a)}function m(t,r,e,i,a){var n=1-a;return t*(n*n*n)+r*(3*n*n*a)+e*(3*n*a*a)+i*(a*a*a)}!function(t){function r(){return u((function(t,r,e){return t.relative&&(void 0!==t.x1&&(t.x1+=r),void 0!==t.y1&&(t.y1+=e),void 0!==t.x2&&(t.x2+=r),void 0!==t.y2&&(t.y2+=e),void 0!==t.x&&(t.x+=r),void 0!==t.y&&(t.y+=e),t.relative=!1),t}))}function e(){var t=NaN,r=NaN,e=NaN,i=NaN;return u((function(a,n,o){return a.type&_.SMOOTH_CURVE_TO&&(a.type=_.CURVE_TO,t=isNaN(t)?n:t,r=isNaN(r)?o:r,a.x1=a.relative?n-t:2*n-t,a.y1=a.relative?o-r:2*o-r),a.type&_.CURVE_TO?(t=a.relative?n+a.x2:a.x2,r=a.relative?o+a.y2:a.y2):(t=NaN,r=NaN),a.type&_.SMOOTH_QUAD_TO&&(a.type=_.QUAD_TO,e=isNaN(e)?n:e,i=isNaN(i)?o:i,a.x1=a.relative?n-e:2*n-e,a.y1=a.relative?o-i:2*o-i),a.type&_.QUAD_TO?(e=a.relative?n+a.x1:a.x1,i=a.relative?o+a.y1:a.y1):(e=NaN,i=NaN),a}))}function n(){var t=NaN,r=NaN;return u((function(e,i,a){if(e.type&_.SMOOTH_QUAD_TO&&(e.type=_.QUAD_TO,t=isNaN(t)?i:t,r=isNaN(r)?a:r,e.x1=e.relative?i-t:2*i-t,e.y1=e.relative?a-r:2*a-r),e.type&_.QUAD_TO){t=e.relative?i+e.x1:e.x1,r=e.relative?a+e.y1:e.y1;var n=e.x1,o=e.y1;e.type=_.CURVE_TO,e.x1=((e.relative?0:i)+2*n)/3,e.y1=((e.relative?0:a)+2*o)/3,e.x2=(e.x+2*n)/3,e.y2=(e.y+2*o)/3}else t=NaN,r=NaN;return e}))}function u(t){var r=0,e=0,i=NaN,a=NaN;return function(n){if(isNaN(i)&&!(n.type&_.MOVE_TO))throw new Error("path must start with moveto");var o=t(n,r,e,i,a);return n.type&_.CLOSE_PATH&&(r=i,e=a),void 0!==n.x&&(r=n.relative?r+n.x:n.x),void 0!==n.y&&(e=n.relative?e+n.y:n.y),n.type&_.MOVE_TO&&(i=r,a=e),o}}function O(t,r,e,i,n,o){return a(t,r,e,i,n,o),u((function(a,s,u,h){var c=a.x1,y=a.x2,p=a.relative&&!isNaN(h),m=void 0!==a.x?a.x:p?0:s,O=void 0!==a.y?a.y:p?0:u;function l(t){return t*t}a.type&_.HORIZ_LINE_TO&&0!==r&&(a.type=_.LINE_TO,a.y=a.relative?0:u),a.type&_.VERT_LINE_TO&&0!==e&&(a.type=_.LINE_TO,a.x=a.relative?0:s),void 0!==a.x&&(a.x=a.x*t+O*e+(p?0:n)),void 0!==a.y&&(a.y=m*r+a.y*i+(p?0:o)),void 0!==a.x1&&(a.x1=a.x1*t+a.y1*e+(p?0:n)),void 0!==a.y1&&(a.y1=c*r+a.y1*i+(p?0:o)),void 0!==a.x2&&(a.x2=a.x2*t+a.y2*e+(p?0:n)),void 0!==a.y2&&(a.y2=y*r+a.y2*i+(p?0:o));var T=t*i-r*e;if(void 0!==a.xRot&&(1!==t||0!==r||0!==e||1!==i))if(0===T)delete a.rX,delete a.rY,delete a.xRot,delete a.lArcFlag,delete a.sweepFlag,a.type=_.LINE_TO;else{var v=a.xRot*Math.PI/180,f=Math.sin(v),N=Math.cos(v),x=1/l(a.rX),d=1/l(a.rY),E=l(N)*x+l(f)*d,A=2*f*N*(x-d),C=l(f)*x+l(N)*d,M=E*i*i-A*r*i+C*r*r,R=A*(t*i+r*e)-2*(E*e*i+C*t*r),g=E*e*e-A*t*e+C*t*t,I=(Math.atan2(R,M-g)+Math.PI)%Math.PI/2,S=Math.sin(I),L=Math.cos(I);a.rX=Math.abs(T)/Math.sqrt(M*l(L)+R*S*L+g*l(S)),a.rY=Math.abs(T)/Math.sqrt(M*l(S)-R*S*L+g*l(L)),a.xRot=180*I/Math.PI}return void 0!==a.sweepFlag&&0>T&&(a.sweepFlag=+!a.sweepFlag),a}))}function l(){return function(t){var r={};for(var e in t)r[e]=t[e];return r}}t.ROUND=function(t){function r(r){return Math.round(r*t)/t}return void 0===t&&(t=1e13),a(t),function(t){return void 0!==t.x1&&(t.x1=r(t.x1)),void 0!==t.y1&&(t.y1=r(t.y1)),void 0!==t.x2&&(t.x2=r(t.x2)),void 0!==t.y2&&(t.y2=r(t.y2)),void 0!==t.x&&(t.x=r(t.x)),void 0!==t.y&&(t.y=r(t.y)),void 0!==t.rX&&(t.rX=r(t.rX)),void 0!==t.rY&&(t.rY=r(t.rY)),t}},t.TO_ABS=r,t.TO_REL=function(){return u((function(t,r,e){return t.relative||(void 0!==t.x1&&(t.x1-=r),void 0!==t.y1&&(t.y1-=e),void 0!==t.x2&&(t.x2-=r),void 0!==t.y2&&(t.y2-=e),void 0!==t.x&&(t.x-=r),void 0!==t.y&&(t.y-=e),t.relative=!0),t}))},t.NORMALIZE_HVZ=function(t,r,e){return void 0===t&&(t=!0),void 0===r&&(r=!0),void 0===e&&(e=!0),u((function(i,a,n,o,s){if(isNaN(o)&&!(i.type&_.MOVE_TO))throw new Error("path must start with moveto");return r&&i.type&_.HORIZ_LINE_TO&&(i.type=_.LINE_TO,i.y=i.relative?0:n),e&&i.type&_.VERT_LINE_TO&&(i.type=_.LINE_TO,i.x=i.relative?0:a),t&&i.type&_.CLOSE_PATH&&(i.type=_.LINE_TO,i.x=i.relative?o-a:o,i.y=i.relative?s-n:s),i.type&_.ARC&&(0===i.rX||0===i.rY)&&(i.type=_.LINE_TO,delete i.rX,delete i.rY,delete i.xRot,delete i.lArcFlag,delete i.sweepFlag),i}))},t.NORMALIZE_ST=e,t.QT_TO_C=n,t.INFO=u,t.SANITIZE=function(t){void 0===t&&(t=0),a(t);var r=NaN,e=NaN,i=NaN,n=NaN;return u((function(a,o,s,u,h){var c=Math.abs,y=!1,p=0,m=0;if(a.type&_.SMOOTH_CURVE_TO&&(p=isNaN(r)?0:o-r,m=isNaN(e)?0:s-e),a.type&(_.CURVE_TO|_.SMOOTH_CURVE_TO)?(r=a.relative?o+a.x2:a.x2,e=a.relative?s+a.y2:a.y2):(r=NaN,e=NaN),a.type&_.SMOOTH_QUAD_TO?(i=isNaN(i)?o:2*o-i,n=isNaN(n)?s:2*s-n):a.type&_.QUAD_TO?(i=a.relative?o+a.x1:a.x1,n=a.relative?s+a.y1:a.y2):(i=NaN,n=NaN),a.type&_.LINE_COMMANDS||a.type&_.ARC&&(0===a.rX||0===a.rY||!a.lArcFlag)||a.type&_.CURVE_TO||a.type&_.SMOOTH_CURVE_TO||a.type&_.QUAD_TO||a.type&_.SMOOTH_QUAD_TO){var O=void 0===a.x?0:a.relative?a.x:a.x-o,l=void 0===a.y?0:a.relative?a.y:a.y-s;p=isNaN(i)?void 0===a.x1?p:a.relative?a.x:a.x1-o:i-o,m=isNaN(n)?void 0===a.y1?m:a.relative?a.y:a.y1-s:n-s;var T=void 0===a.x2?0:a.relative?a.x:a.x2-o,v=void 0===a.y2?0:a.relative?a.y:a.y2-s;c(O)<=t&&c(l)<=t&&c(p)<=t&&c(m)<=t&&c(T)<=t&&c(v)<=t&&(y=!0)}return a.type&_.CLOSE_PATH&&c(o-u)<=t&&c(s-h)<=t&&(y=!0),y?[]:a}))},t.MATRIX=O,t.ROTATE=function(t,r,e){void 0===r&&(r=0),void 0===e&&(e=0),a(t,r,e);var i=Math.sin(t),n=Math.cos(t);return O(n,i,-i,n,r-r*n+e*i,e-r*i-e*n)},t.TRANSLATE=function(t,r){return void 0===r&&(r=0),a(t,r),O(1,0,0,1,t,r)},t.SCALE=function(t,r){return void 0===r&&(r=t),a(t,r),O(t,0,0,r,0,0)},t.SKEW_X=function(t){return a(t),O(1,0,Math.atan(t),1,0,0)},t.SKEW_Y=function(t){return a(t),O(1,Math.atan(t),0,1,0,0)},t.X_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),a(t),O(-1,0,0,1,t,0)},t.Y_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),a(t),O(1,0,0,-1,0,t)},t.A_TO_C=function(){return u((function(t,r,e){return _.ARC===t.type?function(t,r,e){var a,n,s,u;t.cX||o(t,r,e);for(var y=Math.min(t.phi1,t.phi2),p=Math.max(t.phi1,t.phi2)-y,m=Math.ceil(p/90),O=new Array(m),l=r,T=e,v=0;v<m;v++){var f=c(t.phi1,t.phi2,v/m),N=c(t.phi1,t.phi2,(v+1)/m),x=N-f,d=4/3*Math.tan(x*h/4),E=[Math.cos(f*h)-d*Math.sin(f*h),Math.sin(f*h)+d*Math.cos(f*h)],A=E[0],C=E[1],M=[Math.cos(N*h),Math.sin(N*h)],R=M[0],g=M[1],I=[R+d*Math.sin(N*h),g-d*Math.cos(N*h)],S=I[0],L=I[1];O[v]={relative:t.relative,type:_.CURVE_TO};var H=function(r,e){var a=i([r*t.rX,e*t.rY],t.xRot),n=a[0],o=a[1];return[t.cX+n,t.cY+o]};a=H(A,C),O[v].x1=a[0],O[v].y1=a[1],n=H(S,L),O[v].x2=n[0],O[v].y2=n[1],s=H(R,g),O[v].x=s[0],O[v].y=s[1],t.relative&&(O[v].x1-=l,O[v].y1-=T,O[v].x2-=l,O[v].y2-=T,O[v].x-=l,O[v].y-=T),l=(u=[O[v].x,O[v].y])[0],T=u[1]}return O}(t,t.relative?0:r,t.relative?0:e):t}))},t.ANNOTATE_ARCS=function(){return u((function(t,r,e){return t.relative&&(r=0,e=0),_.ARC===t.type&&o(t,r,e),t}))},t.CLONE=l,t.CALCULATE_BOUNDS=function(){var t=function(t){var r={};for(var e in t)r[e]=t[e];return r},i=r(),a=n(),h=e(),c=u((function(r,e,n){var u=h(a(i(t(r))));function O(t){t>c.maxX&&(c.maxX=t),t<c.minX&&(c.minX=t)}function l(t){t>c.maxY&&(c.maxY=t),t<c.minY&&(c.minY=t)}if(u.type&_.DRAWING_COMMANDS&&(O(e),l(n)),u.type&_.HORIZ_LINE_TO&&O(u.x),u.type&_.VERT_LINE_TO&&l(u.y),u.type&_.LINE_TO&&(O(u.x),l(u.y)),u.type&_.CURVE_TO){O(u.x),l(u.y);for(var T=0,v=p(e,u.x1,u.x2,u.x);T<v.length;T++){0<(w=v[T])&&1>w&&O(m(e,u.x1,u.x2,u.x,w))}for(var f=0,N=p(n,u.y1,u.y2,u.y);f<N.length;f++){0<(w=N[f])&&1>w&&l(m(n,u.y1,u.y2,u.y,w))}}if(u.type&_.ARC){O(u.x),l(u.y),o(u,e,n);for(var x=u.xRot/180*Math.PI,d=Math.cos(x)*u.rX,E=Math.sin(x)*u.rX,A=-Math.sin(x)*u.rY,C=Math.cos(x)*u.rY,M=u.phi1<u.phi2?[u.phi1,u.phi2]:-180>u.phi2?[u.phi2+360,u.phi1+360]:[u.phi2,u.phi1],R=M[0],g=M[1],I=function(t){var r=t[0],e=t[1],i=180*Math.atan2(e,r)/Math.PI;return i<R?i+360:i},S=0,L=s(A,-d,0).map(I);S<L.length;S++){(w=L[S])>R&&w<g&&O(y(u.cX,d,A,w))}for(var H=0,U=s(C,-E,0).map(I);H<U.length;H++){var w;(w=U[H])>R&&w<g&&l(y(u.cY,E,C,w))}}return r}));return c.minX=1/0,c.maxX=-1/0,c.minY=1/0,c.maxY=-1/0,c}}(u||(u={}));var O,l=function(){function t(){}return t.prototype.round=function(t){return this.transform(u.ROUND(t))},t.prototype.toAbs=function(){return this.transform(u.TO_ABS())},t.prototype.toRel=function(){return this.transform(u.TO_REL())},t.prototype.normalizeHVZ=function(t,r,e){return this.transform(u.NORMALIZE_HVZ(t,r,e))},t.prototype.normalizeST=function(){return this.transform(u.NORMALIZE_ST())},t.prototype.qtToC=function(){return this.transform(u.QT_TO_C())},t.prototype.aToC=function(){return this.transform(u.A_TO_C())},t.prototype.sanitize=function(t){return this.transform(u.SANITIZE(t))},t.prototype.translate=function(t,r){return this.transform(u.TRANSLATE(t,r))},t.prototype.scale=function(t,r){return this.transform(u.SCALE(t,r))},t.prototype.rotate=function(t,r,e){return this.transform(u.ROTATE(t,r,e))},t.prototype.matrix=function(t,r,e,i,a,n){return this.transform(u.MATRIX(t,r,e,i,a,n))},t.prototype.skewX=function(t){return this.transform(u.SKEW_X(t))},t.prototype.skewY=function(t){return this.transform(u.SKEW_Y(t))},t.prototype.xSymmetry=function(t){return this.transform(u.X_AXIS_SYMMETRY(t))},t.prototype.ySymmetry=function(t){return this.transform(u.Y_AXIS_SYMMETRY(t))},t.prototype.annotateArcs=function(){return this.transform(u.ANNOTATE_ARCS())},t}(),T=function(t){return" "===t||"\t"===t||"\r"===t||"\n"===t},v=function(t){return"0".charCodeAt(0)<=t.charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0)},f=function(t){function e(){var r=t.call(this)||this;return r.curNumber="",r.curCommandType=-1,r.curCommandRelative=!1,r.canParseCommandOrComma=!0,r.curNumberHasExp=!1,r.curNumberHasExpDigits=!1,r.curNumberHasDecimal=!1,r.curArgs=[],r}return r(e,t),e.prototype.finish=function(t){if(void 0===t&&(t=[]),this.parse(" ",t),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t},e.prototype.parse=function(t,r){var e=this;void 0===r&&(r=[]);for(var i=function(t){r.push(t),e.curArgs.length=0,e.canParseCommandOrComma=!0},a=0;a<t.length;a++){var n=t[a],o=!(this.curCommandType!==_.ARC||3!==this.curArgs.length&&4!==this.curArgs.length||1!==this.curNumber.length||"0"!==this.curNumber&&"1"!==this.curNumber),s=v(n)&&("0"===this.curNumber&&"0"===n||o);if(!v(n)||s)if("e"!==n&&"E"!==n)if("-"!==n&&"+"!==n||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==n||this.curNumberHasExp||this.curNumberHasDecimal||o){if(this.curNumber&&-1!==this.curCommandType){var u=Number(this.curNumber);if(isNaN(u))throw new SyntaxError("Invalid number ending at "+a);if(this.curCommandType===_.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>u)throw new SyntaxError('Expected positive number, got "'+u+'" at index "'+a+'"')}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+a+'"');this.curArgs.push(u),this.curArgs.length===N[this.curCommandType]&&(_.HORIZ_LINE_TO===this.curCommandType?i({type:_.HORIZ_LINE_TO,relative:this.curCommandRelative,x:u}):_.VERT_LINE_TO===this.curCommandType?i({type:_.VERT_LINE_TO,relative:this.curCommandRelative,y:u}):this.curCommandType===_.MOVE_TO||this.curCommandType===_.LINE_TO||this.curCommandType===_.SMOOTH_QUAD_TO?(i({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),_.MOVE_TO===this.curCommandType&&(this.curCommandType=_.LINE_TO)):this.curCommandType===_.CURVE_TO?i({type:_.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===_.SMOOTH_CURVE_TO?i({type:_.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===_.QUAD_TO?i({type:_.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===_.ARC&&i({type:_.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!T(n))if(","===n&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==n&&"-"!==n&&"."!==n)if(s)this.curNumber=n,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError("Unterminated command at index "+a+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+n+'" at index '+a+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,"z"!==n&&"Z"!==n)if("h"===n||"H"===n)this.curCommandType=_.HORIZ_LINE_TO,this.curCommandRelative="h"===n;else if("v"===n||"V"===n)this.curCommandType=_.VERT_LINE_TO,this.curCommandRelative="v"===n;else if("m"===n||"M"===n)this.curCommandType=_.MOVE_TO,this.curCommandRelative="m"===n;else if("l"===n||"L"===n)this.curCommandType=_.LINE_TO,this.curCommandRelative="l"===n;else if("c"===n||"C"===n)this.curCommandType=_.CURVE_TO,this.curCommandRelative="c"===n;else if("s"===n||"S"===n)this.curCommandType=_.SMOOTH_CURVE_TO,this.curCommandRelative="s"===n;else if("q"===n||"Q"===n)this.curCommandType=_.QUAD_TO,this.curCommandRelative="q"===n;else if("t"===n||"T"===n)this.curCommandType=_.SMOOTH_QUAD_TO,this.curCommandRelative="t"===n;else{if("a"!==n&&"A"!==n)throw new SyntaxError('Unexpected character "'+n+'" at index '+a+".");this.curCommandType=_.ARC,this.curCommandRelative="a"===n}else r.push({type:_.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=n,this.curNumberHasDecimal="."===n}else this.curNumber+=n,this.curNumberHasDecimal=!0;else this.curNumber+=n;else this.curNumber+=n,this.curNumberHasExp=!0;else this.curNumber+=n,this.curNumberHasExpDigits=this.curNumberHasExp}return r},e.prototype.transform=function(t){return Object.create(this,{parse:{value:function(r,e){void 0===e&&(e=[]);for(var i=0,a=Object.getPrototypeOf(this).parse.call(this,r);i<a.length;i++){var n=a[i],o=t(n);Array.isArray(o)?e.push.apply(e,o):e.push(o)}return e}}})},e}(l),_=function(t){function i(r){var e=t.call(this)||this;return e.commands="string"==typeof r?i.parse(r):r,e}return r(i,t),i.prototype.encode=function(){return i.encode(this.commands)},i.prototype.getBounds=function(){var t=u.CALCULATE_BOUNDS();return this.transform(t),t},i.prototype.transform=function(t){for(var r=[],e=0,i=this.commands;e<i.length;e++){var a=t(i[e]);Array.isArray(a)?r.push.apply(r,a):r.push(a)}return this.commands=r,this},i.encode=function(t){return e(t)},i.parse=function(t){var r=new f,e=[];return r.parse(t,e),r.finish(e),e},i.CLOSE_PATH=1,i.MOVE_TO=2,i.HORIZ_LINE_TO=4,i.VERT_LINE_TO=8,i.LINE_TO=16,i.CURVE_TO=32,i.SMOOTH_CURVE_TO=64,i.QUAD_TO=128,i.SMOOTH_QUAD_TO=256,i.ARC=512,i.LINE_COMMANDS=i.LINE_TO|i.HORIZ_LINE_TO|i.VERT_LINE_TO,i.DRAWING_COMMANDS=i.HORIZ_LINE_TO|i.VERT_LINE_TO|i.LINE_TO|i.CURVE_TO|i.SMOOTH_CURVE_TO|i.QUAD_TO|i.SMOOTH_QUAD_TO|i.ARC,i}(l),N=((O={})[_.MOVE_TO]=2,O[_.LINE_TO]=2,O[_.HORIZ_LINE_TO]=1,O[_.VERT_LINE_TO]=1,O[_.CLOSE_PATH]=0,O[_.QUAD_TO]=4,O[_.SMOOTH_QUAD_TO]=2,O[_.CURVE_TO]=6,O[_.SMOOTH_CURVE_TO]=4,O[_.ARC]=7,O);
- //# sourceMappingURL=SVGPathData.module.js.map
- /***/ })
- }]);
- //# sourceMappingURL=25.js.map
|