1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895 |
- // ../../../../project/banma/node_modules/html2canvas/dist/html2canvas.esm.js
- var extendStatics = function(d, b) {
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
- d2.__proto__ = b2;
- } || function(d2, b2) {
- for (var p in b2)
- if (b2.hasOwnProperty(p))
- d2[p] = b2[p];
- };
- return extendStatics(d, b);
- };
- function __extends(d, b) {
- extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- }
- var __assign = function() {
- __assign = Object.assign || function __assign2(t) {
- for (var s, i = 1, n = arguments.length; i < n; i++) {
- s = arguments[i];
- for (var p in s)
- if (Object.prototype.hasOwnProperty.call(s, p))
- t[p] = s[p];
- }
- return t;
- };
- return __assign.apply(this, arguments);
- };
- function __awaiter(thisArg, _arguments, P, generator) {
- return new (P || (P = Promise))(function(resolve, reject) {
- function fulfilled(value) {
- try {
- step(generator.next(value));
- } catch (e2) {
- reject(e2);
- }
- }
- function rejected(value) {
- try {
- step(generator["throw"](value));
- } catch (e2) {
- reject(e2);
- }
- }
- function step(result) {
- result.done ? resolve(result.value) : new P(function(resolve2) {
- resolve2(result.value);
- }).then(fulfilled, rejected);
- }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
- }
- function __generator(thisArg, body) {
- var _ = { label: 0, sent: function() {
- if (t[0] & 1)
- throw t[1];
- return t[1];
- }, trys: [], ops: [] }, f2, y, t, g;
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
- return this;
- }), g;
- function verb(n) {
- return function(v) {
- return step([n, v]);
- };
- }
- function step(op) {
- if (f2)
- throw new TypeError("Generator is already executing.");
- while (_)
- try {
- if (f2 = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
- return t;
- if (y = 0, t)
- op = [op[0] & 2, t.value];
- switch (op[0]) {
- case 0:
- case 1:
- t = op;
- break;
- case 4:
- _.label++;
- return { value: op[1], done: false };
- case 5:
- _.label++;
- y = op[1];
- op = [0];
- continue;
- case 7:
- op = _.ops.pop();
- _.trys.pop();
- continue;
- default:
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
- _ = 0;
- continue;
- }
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
- _.label = op[1];
- break;
- }
- if (op[0] === 6 && _.label < t[1]) {
- _.label = t[1];
- t = op;
- break;
- }
- if (t && _.label < t[2]) {
- _.label = t[2];
- _.ops.push(op);
- break;
- }
- if (t[2])
- _.ops.pop();
- _.trys.pop();
- continue;
- }
- op = body.call(thisArg, _);
- } catch (e2) {
- op = [6, e2];
- y = 0;
- } finally {
- f2 = t = 0;
- }
- if (op[0] & 5)
- throw op[1];
- return { value: op[0] ? op[1] : void 0, done: true };
- }
- }
- var Bounds = (
- /** @class */
- function() {
- function Bounds2(x, y, w, h) {
- this.left = x;
- this.top = y;
- this.width = w;
- this.height = h;
- }
- Bounds2.prototype.add = function(x, y, w, h) {
- return new Bounds2(this.left + x, this.top + y, this.width + w, this.height + h);
- };
- Bounds2.fromClientRect = function(clientRect) {
- return new Bounds2(clientRect.left, clientRect.top, clientRect.width, clientRect.height);
- };
- return Bounds2;
- }()
- );
- var parseBounds = function(node) {
- return Bounds.fromClientRect(node.getBoundingClientRect());
- };
- var parseDocumentSize = function(document2) {
- var body = document2.body;
- var documentElement = document2.documentElement;
- if (!body || !documentElement) {
- throw new Error("Unable to get document size");
- }
- var width = Math.max(Math.max(body.scrollWidth, documentElement.scrollWidth), Math.max(body.offsetWidth, documentElement.offsetWidth), Math.max(body.clientWidth, documentElement.clientWidth));
- var height = Math.max(Math.max(body.scrollHeight, documentElement.scrollHeight), Math.max(body.offsetHeight, documentElement.offsetHeight), Math.max(body.clientHeight, documentElement.clientHeight));
- return new Bounds(0, 0, width, height);
- };
- var toCodePoints = function(str) {
- var codePoints = [];
- var i = 0;
- var length = str.length;
- while (i < length) {
- var value = str.charCodeAt(i++);
- if (value >= 55296 && value <= 56319 && i < length) {
- var extra = str.charCodeAt(i++);
- if ((extra & 64512) === 56320) {
- codePoints.push(((value & 1023) << 10) + (extra & 1023) + 65536);
- } else {
- codePoints.push(value);
- i--;
- }
- } else {
- codePoints.push(value);
- }
- }
- return codePoints;
- };
- var fromCodePoint = function() {
- var codePoints = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- codePoints[_i] = arguments[_i];
- }
- if (String.fromCodePoint) {
- return String.fromCodePoint.apply(String, codePoints);
- }
- var length = codePoints.length;
- if (!length) {
- return "";
- }
- var codeUnits = [];
- var index = -1;
- var result = "";
- while (++index < length) {
- var codePoint = codePoints[index];
- if (codePoint <= 65535) {
- codeUnits.push(codePoint);
- } else {
- codePoint -= 65536;
- codeUnits.push((codePoint >> 10) + 55296, codePoint % 1024 + 56320);
- }
- if (index + 1 === length || codeUnits.length > 16384) {
- result += String.fromCharCode.apply(String, codeUnits);
- codeUnits.length = 0;
- }
- }
- return result;
- };
- var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
- var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
- for (i = 0; i < chars.length; i++) {
- lookup[chars.charCodeAt(i)] = i;
- }
- var i;
- var decode = function(base642) {
- var bufferLength = base642.length * 0.75, len = base642.length, i, p = 0, encoded1, encoded2, encoded3, encoded4;
- if (base642[base642.length - 1] === "=") {
- bufferLength--;
- if (base642[base642.length - 2] === "=") {
- bufferLength--;
- }
- }
- var buffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined" && typeof Uint8Array.prototype.slice !== "undefined" ? new ArrayBuffer(bufferLength) : new Array(bufferLength);
- var bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer);
- for (i = 0; i < len; i += 4) {
- encoded1 = lookup[base642.charCodeAt(i)];
- encoded2 = lookup[base642.charCodeAt(i + 1)];
- encoded3 = lookup[base642.charCodeAt(i + 2)];
- encoded4 = lookup[base642.charCodeAt(i + 3)];
- bytes[p++] = encoded1 << 2 | encoded2 >> 4;
- bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;
- bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;
- }
- return buffer;
- };
- var polyUint16Array = function(buffer) {
- var length = buffer.length;
- var bytes = [];
- for (var i = 0; i < length; i += 2) {
- bytes.push(buffer[i + 1] << 8 | buffer[i]);
- }
- return bytes;
- };
- var polyUint32Array = function(buffer) {
- var length = buffer.length;
- var bytes = [];
- for (var i = 0; i < length; i += 4) {
- bytes.push(buffer[i + 3] << 24 | buffer[i + 2] << 16 | buffer[i + 1] << 8 | buffer[i]);
- }
- return bytes;
- };
- var UTRIE2_SHIFT_2 = 5;
- var UTRIE2_SHIFT_1 = 6 + 5;
- var UTRIE2_INDEX_SHIFT = 2;
- var UTRIE2_SHIFT_1_2 = UTRIE2_SHIFT_1 - UTRIE2_SHIFT_2;
- var UTRIE2_LSCP_INDEX_2_OFFSET = 65536 >> UTRIE2_SHIFT_2;
- var UTRIE2_DATA_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_2;
- var UTRIE2_DATA_MASK = UTRIE2_DATA_BLOCK_LENGTH - 1;
- var UTRIE2_LSCP_INDEX_2_LENGTH = 1024 >> UTRIE2_SHIFT_2;
- var UTRIE2_INDEX_2_BMP_LENGTH = UTRIE2_LSCP_INDEX_2_OFFSET + UTRIE2_LSCP_INDEX_2_LENGTH;
- var UTRIE2_UTF8_2B_INDEX_2_OFFSET = UTRIE2_INDEX_2_BMP_LENGTH;
- var UTRIE2_UTF8_2B_INDEX_2_LENGTH = 2048 >> 6;
- var UTRIE2_INDEX_1_OFFSET = UTRIE2_UTF8_2B_INDEX_2_OFFSET + UTRIE2_UTF8_2B_INDEX_2_LENGTH;
- var UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = 65536 >> UTRIE2_SHIFT_1;
- var UTRIE2_INDEX_2_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_1_2;
- var UTRIE2_INDEX_2_MASK = UTRIE2_INDEX_2_BLOCK_LENGTH - 1;
- var slice16 = function(view, start, end) {
- if (view.slice) {
- return view.slice(start, end);
- }
- return new Uint16Array(Array.prototype.slice.call(view, start, end));
- };
- var slice32 = function(view, start, end) {
- if (view.slice) {
- return view.slice(start, end);
- }
- return new Uint32Array(Array.prototype.slice.call(view, start, end));
- };
- var createTrieFromBase64 = function(base642) {
- var buffer = decode(base642);
- var view32 = Array.isArray(buffer) ? polyUint32Array(buffer) : new Uint32Array(buffer);
- var view16 = Array.isArray(buffer) ? polyUint16Array(buffer) : new Uint16Array(buffer);
- var headerLength = 24;
- var index = slice16(view16, headerLength / 2, view32[4] / 2);
- var data = view32[5] === 2 ? slice16(view16, (headerLength + view32[4]) / 2) : slice32(view32, Math.ceil((headerLength + view32[4]) / 4));
- return new Trie(view32[0], view32[1], view32[2], view32[3], index, data);
- };
- var Trie = (
- /** @class */
- function() {
- function Trie2(initialValue, errorValue, highStart, highValueIndex, index, data) {
- this.initialValue = initialValue;
- this.errorValue = errorValue;
- this.highStart = highStart;
- this.highValueIndex = highValueIndex;
- this.index = index;
- this.data = data;
- }
- Trie2.prototype.get = function(codePoint) {
- var ix;
- if (codePoint >= 0) {
- if (codePoint < 55296 || codePoint > 56319 && codePoint <= 65535) {
- ix = this.index[codePoint >> UTRIE2_SHIFT_2];
- ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
- return this.data[ix];
- }
- if (codePoint <= 65535) {
- ix = this.index[UTRIE2_LSCP_INDEX_2_OFFSET + (codePoint - 55296 >> UTRIE2_SHIFT_2)];
- ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
- return this.data[ix];
- }
- if (codePoint < this.highStart) {
- ix = UTRIE2_INDEX_1_OFFSET - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH + (codePoint >> UTRIE2_SHIFT_1);
- ix = this.index[ix];
- ix += codePoint >> UTRIE2_SHIFT_2 & UTRIE2_INDEX_2_MASK;
- ix = this.index[ix];
- ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
- return this.data[ix];
- }
- if (codePoint <= 1114111) {
- return this.data[this.highValueIndex];
- }
- }
- return this.errorValue;
- };
- return Trie2;
- }()
- );
- var base64 = "KwAAAAAAAAAACA4AIDoAAPAfAAACAAAAAAAIABAAGABAAEgAUABYAF4AZgBeAGYAYABoAHAAeABeAGYAfACEAIAAiACQAJgAoACoAK0AtQC9AMUAXgBmAF4AZgBeAGYAzQDVAF4AZgDRANkA3gDmAOwA9AD8AAQBDAE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AIJCgkSCRoJIgknCTYHLwk3CZYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiAAIAAAAFAAXgBeAGAAcABeAHwAQACQAKAArQC9AJ4AXgBeAE0A3gBRAN4A7AD8AMwBGgEAAKcBNwEFAUwBXAF4QkhCmEKnArcCgAHHAsABz4LAAcABwAHAAd+C6ABoAG+C/4LAAcABwAHAAc+DF4MAAcAB54M3gweDV4Nng3eDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEeDqABVg6WDqABoQ6gAaABoAHXDvcONw/3DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DncPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB7cPPwlGCU4JMACAAIAAgABWCV4JYQmAAGkJcAl4CXwJgAkwADAAMAAwAIgJgACLCZMJgACZCZ8JowmrCYAAswkwAF4AXgB8AIAAuwkABMMJyQmAAM4JgADVCTAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAqwYWBNkIMAAwADAAMADdCeAJ6AnuCR4E9gkwAP4JBQoNCjAAMACAABUK0wiAAB0KJAosCjQKgAAwADwKQwqAAEsKvQmdCVMKWwowADAAgACAALcEMACAAGMKgABrCjAAMAAwADAAMAAwADAAMAAwADAAMAAeBDAAMAAwADAAMAAwADAAMAAwADAAMAAwAIkEPQFzCnoKiQSCCooKkAqJBJgKoAqkCokEGAGsCrQKvArBCjAAMADJCtEKFQHZCuEK/gHpCvEKMAAwADAAMACAAIwE+QowAIAAPwEBCzAAMAAwADAAMACAAAkLEQswAIAAPwEZCyELgAAOCCkLMAAxCzkLMAAwADAAMAAwADAAXgBeAEELMAAwADAAMAAwADAAMAAwAEkLTQtVC4AAXAtkC4AAiQkwADAAMAAwADAAMAAwADAAbAtxC3kLgAuFC4sLMAAwAJMLlwufCzAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAApwswADAAMACAAIAAgACvC4AAgACAAIAAgACAALcLMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAvwuAAMcLgACAAIAAgACAAIAAyguAAIAAgACAAIAA0QswADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAw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gAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwArAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAAQABAANAA0ASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAUAArACsAKwArACsAKwArACsABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAGgAaAFAAUABQAFAAUABMAB4AGwBQAB4AKwArACsABAAEAAQAKwBQAFAAUABQAFAAUAArACsAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUAArAFAAUAArACsABAArAAQABAAEAAQABAArACsAKwArAAQABAArACsABAAEAAQAKwArACsABAArACsAKwArACsAKwArAFAAUABQAFAAKwBQACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwAEAAQAUABQAFAABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQAKwArAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeABsAKwArACsAKwArACsAKwBQAAQABAAEAAQABAAEACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAKwArACsAKwArACsAKwArAAQABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwAEAFAAKwBQAFAAUABQAFAAUAArACsAKwBQAFAAUAArAFAAUABQAFAAKwArACsAUABQACsAUAArAFAAUAArACsAKwBQAFAAKwArACsAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQAKwArACsABAAEAAQAKwAEAAQABAAEACsAKwBQACsAKwArACsAKwArAAQAKwArACsAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAB4AHgAeAB4AHgAeABsAHgArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArAFAAUABQACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAB4AUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArACsAKwArACsAKwArAFAAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwArAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAKwBcAFwAKwBcACsAKwBcACsAKwArACsAKwArAFwAXABcAFwAKwBcAFwAXABcAFwAXABcACsAXABcAFwAKwBcACsAXAArACsAXABcACsAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgArACoAKgBcACsAKwBcAFwAXABcAFwAKwBcACsAKgAqACoAKgAqACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAFwAXABcAFwAUAAOAA4ADgAOAB4ADgAOAAkADgAOAA0ACQATABMAEwATABMACQAeABMAHgAeAB4ABAAEAB4AHgAeAB4AHgAeAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUAANAAQAHgAEAB4ABAAWABEAFgARAAQABABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAAQABAAEAAQABAANAAQABABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsADQANAB4AHgAeAB4AHgAeAAQAHgAeAB4AHgAeAB4AKwAeAB4ADgAOAA0ADgAeAB4AHgAeAB4ACQAJACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgAeAB4AHgBcAFwAXABcAFwAXAAqACoAKgAqAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAKgAqACoAKgAqACoAKgBcAFwAXAAqACoAKgAqAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAXAAqAEsASwBLAEsASwBLAEsASwBLAEsAKgAqACoAKgAqACoAUABQAFAAUABQAFAAKwBQACsAKwArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQACsAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwAEAAQABAAeAA0AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAEQArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAADQANAA0AUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAA0ADQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoADQANABUAXAANAB4ADQAbAFwAKgArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAB4AHgATABMADQANAA4AHgATABMAHgAEAAQABAAJACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAUABQAFAAUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwAeACsAKwArABMAEwBLAEsASwBLAEsASwBLAEsASwBLAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwBcAFwAXABcAFwAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcACsAKwArACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwAeAB4AXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsABABLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKgAqACoAKgAqACoAKgBcACoAKgAqACoAKgAqACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAUABQAFAAUABQAFAAUAArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4ADQANAA0ADQAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAHgAeAB4AHgBQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwANAA0ADQANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwBQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwAr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ABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAV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QAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeACsAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUAArACsAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFA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AFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQBQAFAAUABQACsAKwArACsAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAABAAEAAQAKwAEAAQAKwArACsAKwArAAQABAAEAAQAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsABAAEAAQAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsADQANAA0ADQANAA0ADQANAB4AKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAUABQAFAAUABQAA0ADQANAA0ADQANABQAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwANAA0ADQANAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAeAAQABAAEAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLACsADQArAB4AKwArAAQABAAEAAQAUABQAB4AUAArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwAEAAQABAAEAAQABAAEAAQABAAOAA0ADQATABMAHgAeAB4ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0AUABQAFAAUAAEAAQAKwArAAQADQANAB4AUAArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXABcAA0ADQANACoASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUAArACsAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANACsADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEcARwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwAeAAQABAANAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAEAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUAArACsAUAArACsAUABQACsAKwBQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAeAB4ADQANAA0ADQAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAArAAQABAArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAEAAQABAAEAAQABAAEACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAFgAWAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAKwBQACsAKwArACsAKwArAFAAKwArACsAKwBQACsAUAArAFAAKwBQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQACsAUAArAFAAKwBQACsAUABQACsAUAArACsAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAUABQAFAAUAArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUAArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAlACUAJQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeACUAJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeACUAJQAlACUAJQAeACUAJQAlACUAJQAgACAAIAAlACUAIAAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIQAhACEAIQAhACUAJQAgACAAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAIAAlACUAJQAlACAAJQAgACAAIAAgACAAIAAgACAAIAAlACUAJQAgACUAJQAlACUAIAAgACAAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeACUAHgAlAB4AJQAlACUAJQAlACAAJQAlACUAJQAeACUAHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAIAAgACAAIAAgAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeA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UAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsA";
- var LETTER_NUMBER_MODIFIER = 50;
- var BK = 1;
- var CR = 2;
- var LF = 3;
- var CM = 4;
- var NL = 5;
- var WJ = 7;
- var ZW = 8;
- var GL = 9;
- var SP = 10;
- var ZWJ = 11;
- var B2 = 12;
- var BA = 13;
- var BB = 14;
- var HY = 15;
- var CB = 16;
- var CL = 17;
- var CP = 18;
- var EX = 19;
- var IN = 20;
- var NS = 21;
- var OP = 22;
- var QU = 23;
- var IS = 24;
- var NU = 25;
- var PO = 26;
- var PR = 27;
- var SY = 28;
- var AI = 29;
- var AL = 30;
- var CJ = 31;
- var EB = 32;
- var EM = 33;
- var H2 = 34;
- var H3 = 35;
- var HL = 36;
- var ID = 37;
- var JL = 38;
- var JV = 39;
- var JT = 40;
- var RI = 41;
- var SA = 42;
- var XX = 43;
- var BREAK_MANDATORY = "!";
- var BREAK_NOT_ALLOWED = "×";
- var BREAK_ALLOWED = "÷";
- var UnicodeTrie = createTrieFromBase64(base64);
- var ALPHABETICS = [AL, HL];
- var HARD_LINE_BREAKS = [BK, CR, LF, NL];
- var SPACE = [SP, ZW];
- var PREFIX_POSTFIX = [PR, PO];
- var LINE_BREAKS = HARD_LINE_BREAKS.concat(SPACE);
- var KOREAN_SYLLABLE_BLOCK = [JL, JV, JT, H2, H3];
- var HYPHEN = [HY, BA];
- var codePointsToCharacterClasses = function(codePoints, lineBreak2) {
- if (lineBreak2 === void 0) {
- lineBreak2 = "strict";
- }
- var types = [];
- var indicies = [];
- var categories = [];
- codePoints.forEach(function(codePoint, index) {
- var classType = UnicodeTrie.get(codePoint);
- if (classType > LETTER_NUMBER_MODIFIER) {
- categories.push(true);
- classType -= LETTER_NUMBER_MODIFIER;
- } else {
- categories.push(false);
- }
- if (["normal", "auto", "loose"].indexOf(lineBreak2) !== -1) {
- if ([8208, 8211, 12316, 12448].indexOf(codePoint) !== -1) {
- indicies.push(index);
- return types.push(CB);
- }
- }
- if (classType === CM || classType === ZWJ) {
- if (index === 0) {
- indicies.push(index);
- return types.push(AL);
- }
- var prev = types[index - 1];
- if (LINE_BREAKS.indexOf(prev) === -1) {
- indicies.push(indicies[index - 1]);
- return types.push(prev);
- }
- indicies.push(index);
- return types.push(AL);
- }
- indicies.push(index);
- if (classType === CJ) {
- return types.push(lineBreak2 === "strict" ? NS : ID);
- }
- if (classType === SA) {
- return types.push(AL);
- }
- if (classType === AI) {
- return types.push(AL);
- }
- if (classType === XX) {
- if (codePoint >= 131072 && codePoint <= 196605 || codePoint >= 196608 && codePoint <= 262141) {
- return types.push(ID);
- } else {
- return types.push(AL);
- }
- }
- types.push(classType);
- });
- return [indicies, types, categories];
- };
- var isAdjacentWithSpaceIgnored = function(a2, b, currentIndex, classTypes) {
- var current = classTypes[currentIndex];
- if (Array.isArray(a2) ? a2.indexOf(current) !== -1 : a2 === current) {
- var i = currentIndex;
- while (i <= classTypes.length) {
- i++;
- var next = classTypes[i];
- if (next === b) {
- return true;
- }
- if (next !== SP) {
- break;
- }
- }
- }
- if (current === SP) {
- var i = currentIndex;
- while (i > 0) {
- i--;
- var prev = classTypes[i];
- if (Array.isArray(a2) ? a2.indexOf(prev) !== -1 : a2 === prev) {
- var n = currentIndex;
- while (n <= classTypes.length) {
- n++;
- var next = classTypes[n];
- if (next === b) {
- return true;
- }
- if (next !== SP) {
- break;
- }
- }
- }
- if (prev !== SP) {
- break;
- }
- }
- }
- return false;
- };
- var previousNonSpaceClassType = function(currentIndex, classTypes) {
- var i = currentIndex;
- while (i >= 0) {
- var type = classTypes[i];
- if (type === SP) {
- i--;
- } else {
- return type;
- }
- }
- return 0;
- };
- var _lineBreakAtIndex = function(codePoints, classTypes, indicies, index, forbiddenBreaks) {
- if (indicies[index] === 0) {
- return BREAK_NOT_ALLOWED;
- }
- var currentIndex = index - 1;
- if (Array.isArray(forbiddenBreaks) && forbiddenBreaks[currentIndex] === true) {
- return BREAK_NOT_ALLOWED;
- }
- var beforeIndex = currentIndex - 1;
- var afterIndex = currentIndex + 1;
- var current = classTypes[currentIndex];
- var before = beforeIndex >= 0 ? classTypes[beforeIndex] : 0;
- var next = classTypes[afterIndex];
- if (current === CR && next === LF) {
- return BREAK_NOT_ALLOWED;
- }
- if (HARD_LINE_BREAKS.indexOf(current) !== -1) {
- return BREAK_MANDATORY;
- }
- if (HARD_LINE_BREAKS.indexOf(next) !== -1) {
- return BREAK_NOT_ALLOWED;
- }
- if (SPACE.indexOf(next) !== -1) {
- return BREAK_NOT_ALLOWED;
- }
- if (previousNonSpaceClassType(currentIndex, classTypes) === ZW) {
- return BREAK_ALLOWED;
- }
- if (UnicodeTrie.get(codePoints[currentIndex]) === ZWJ && (next === ID || next === EB || next === EM)) {
- return BREAK_NOT_ALLOWED;
- }
- if (current === WJ || next === WJ) {
- return BREAK_NOT_ALLOWED;
- }
- if (current === GL) {
- return BREAK_NOT_ALLOWED;
- }
- if ([SP, BA, HY].indexOf(current) === -1 && next === GL) {
- return BREAK_NOT_ALLOWED;
- }
- if ([CL, CP, EX, IS, SY].indexOf(next) !== -1) {
- return BREAK_NOT_ALLOWED;
- }
- if (previousNonSpaceClassType(currentIndex, classTypes) === OP) {
- return BREAK_NOT_ALLOWED;
- }
- if (isAdjacentWithSpaceIgnored(QU, OP, currentIndex, classTypes)) {
- return BREAK_NOT_ALLOWED;
- }
- if (isAdjacentWithSpaceIgnored([CL, CP], NS, currentIndex, classTypes)) {
- return BREAK_NOT_ALLOWED;
- }
- if (isAdjacentWithSpaceIgnored(B2, B2, currentIndex, classTypes)) {
- return BREAK_NOT_ALLOWED;
- }
- if (current === SP) {
- return BREAK_ALLOWED;
- }
- if (current === QU || next === QU) {
- return BREAK_NOT_ALLOWED;
- }
- if (next === CB || current === CB) {
- return BREAK_ALLOWED;
- }
- if ([BA, HY, NS].indexOf(next) !== -1 || current === BB) {
- return BREAK_NOT_ALLOWED;
- }
- if (before === HL && HYPHEN.indexOf(current) !== -1) {
- return BREAK_NOT_ALLOWED;
- }
- if (current === SY && next === HL) {
- return BREAK_NOT_ALLOWED;
- }
- if (next === IN && ALPHABETICS.concat(IN, EX, NU, ID, EB, EM).indexOf(current) !== -1) {
- return BREAK_NOT_ALLOWED;
- }
- if (ALPHABETICS.indexOf(next) !== -1 && current === NU || ALPHABETICS.indexOf(current) !== -1 && next === NU) {
- return BREAK_NOT_ALLOWED;
- }
- if (current === PR && [ID, EB, EM].indexOf(next) !== -1 || [ID, EB, EM].indexOf(current) !== -1 && next === PO) {
- return BREAK_NOT_ALLOWED;
- }
- if (ALPHABETICS.indexOf(current) !== -1 && PREFIX_POSTFIX.indexOf(next) !== -1 || PREFIX_POSTFIX.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) {
- return BREAK_NOT_ALLOWED;
- }
- if (
- // (PR | PO) × ( OP | HY )? NU
- [PR, PO].indexOf(current) !== -1 && (next === NU || [OP, HY].indexOf(next) !== -1 && classTypes[afterIndex + 1] === NU) || // ( OP | HY ) × NU
- [OP, HY].indexOf(current) !== -1 && next === NU || // NU × (NU | SY | IS)
- current === NU && [NU, SY, IS].indexOf(next) !== -1
- ) {
- return BREAK_NOT_ALLOWED;
- }
- if ([NU, SY, IS, CL, CP].indexOf(next) !== -1) {
- var prevIndex = currentIndex;
- while (prevIndex >= 0) {
- var type = classTypes[prevIndex];
- if (type === NU) {
- return BREAK_NOT_ALLOWED;
- } else if ([SY, IS].indexOf(type) !== -1) {
- prevIndex--;
- } else {
- break;
- }
- }
- }
- if ([PR, PO].indexOf(next) !== -1) {
- var prevIndex = [CL, CP].indexOf(current) !== -1 ? beforeIndex : currentIndex;
- while (prevIndex >= 0) {
- var type = classTypes[prevIndex];
- if (type === NU) {
- return BREAK_NOT_ALLOWED;
- } else if ([SY, IS].indexOf(type) !== -1) {
- prevIndex--;
- } else {
- break;
- }
- }
- }
- if (JL === current && [JL, JV, H2, H3].indexOf(next) !== -1 || [JV, H2].indexOf(current) !== -1 && [JV, JT].indexOf(next) !== -1 || [JT, H3].indexOf(current) !== -1 && next === JT) {
- return BREAK_NOT_ALLOWED;
- }
- if (KOREAN_SYLLABLE_BLOCK.indexOf(current) !== -1 && [IN, PO].indexOf(next) !== -1 || KOREAN_SYLLABLE_BLOCK.indexOf(next) !== -1 && current === PR) {
- return BREAK_NOT_ALLOWED;
- }
- if (ALPHABETICS.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) {
- return BREAK_NOT_ALLOWED;
- }
- if (current === IS && ALPHABETICS.indexOf(next) !== -1) {
- return BREAK_NOT_ALLOWED;
- }
- if (ALPHABETICS.concat(NU).indexOf(current) !== -1 && next === OP || ALPHABETICS.concat(NU).indexOf(next) !== -1 && current === CP) {
- return BREAK_NOT_ALLOWED;
- }
- if (current === RI && next === RI) {
- var i = indicies[currentIndex];
- var count = 1;
- while (i > 0) {
- i--;
- if (classTypes[i] === RI) {
- count++;
- } else {
- break;
- }
- }
- if (count % 2 !== 0) {
- return BREAK_NOT_ALLOWED;
- }
- }
- if (current === EB && next === EM) {
- return BREAK_NOT_ALLOWED;
- }
- return BREAK_ALLOWED;
- };
- var cssFormattedClasses = function(codePoints, options) {
- if (!options) {
- options = { lineBreak: "normal", wordBreak: "normal" };
- }
- var _a = codePointsToCharacterClasses(codePoints, options.lineBreak), indicies = _a[0], classTypes = _a[1], isLetterNumber = _a[2];
- if (options.wordBreak === "break-all" || options.wordBreak === "break-word") {
- classTypes = classTypes.map(function(type) {
- return [NU, AL, SA].indexOf(type) !== -1 ? ID : type;
- });
- }
- var forbiddenBreakpoints = options.wordBreak === "keep-all" ? isLetterNumber.map(function(letterNumber, i) {
- return letterNumber && codePoints[i] >= 19968 && codePoints[i] <= 40959;
- }) : void 0;
- return [indicies, classTypes, forbiddenBreakpoints];
- };
- var Break = (
- /** @class */
- function() {
- function Break2(codePoints, lineBreak2, start, end) {
- this.codePoints = codePoints;
- this.required = lineBreak2 === BREAK_MANDATORY;
- this.start = start;
- this.end = end;
- }
- Break2.prototype.slice = function() {
- return fromCodePoint.apply(void 0, this.codePoints.slice(this.start, this.end));
- };
- return Break2;
- }()
- );
- var LineBreaker = function(str, options) {
- var codePoints = toCodePoints(str);
- var _a = cssFormattedClasses(codePoints, options), indicies = _a[0], classTypes = _a[1], forbiddenBreakpoints = _a[2];
- var length = codePoints.length;
- var lastEnd = 0;
- var nextIndex = 0;
- return {
- next: function() {
- if (nextIndex >= length) {
- return { done: true, value: null };
- }
- var lineBreak2 = BREAK_NOT_ALLOWED;
- while (nextIndex < length && (lineBreak2 = _lineBreakAtIndex(codePoints, classTypes, indicies, ++nextIndex, forbiddenBreakpoints)) === BREAK_NOT_ALLOWED) {
- }
- if (lineBreak2 !== BREAK_NOT_ALLOWED || nextIndex === length) {
- var value = new Break(codePoints, lineBreak2, lastEnd, nextIndex);
- lastEnd = nextIndex;
- return { value, done: false };
- }
- return { done: true, value: null };
- }
- };
- };
- var TokenType;
- (function(TokenType2) {
- TokenType2[TokenType2["STRING_TOKEN"] = 0] = "STRING_TOKEN";
- TokenType2[TokenType2["BAD_STRING_TOKEN"] = 1] = "BAD_STRING_TOKEN";
- TokenType2[TokenType2["LEFT_PARENTHESIS_TOKEN"] = 2] = "LEFT_PARENTHESIS_TOKEN";
- TokenType2[TokenType2["RIGHT_PARENTHESIS_TOKEN"] = 3] = "RIGHT_PARENTHESIS_TOKEN";
- TokenType2[TokenType2["COMMA_TOKEN"] = 4] = "COMMA_TOKEN";
- TokenType2[TokenType2["HASH_TOKEN"] = 5] = "HASH_TOKEN";
- TokenType2[TokenType2["DELIM_TOKEN"] = 6] = "DELIM_TOKEN";
- TokenType2[TokenType2["AT_KEYWORD_TOKEN"] = 7] = "AT_KEYWORD_TOKEN";
- TokenType2[TokenType2["PREFIX_MATCH_TOKEN"] = 8] = "PREFIX_MATCH_TOKEN";
- TokenType2[TokenType2["DASH_MATCH_TOKEN"] = 9] = "DASH_MATCH_TOKEN";
- TokenType2[TokenType2["INCLUDE_MATCH_TOKEN"] = 10] = "INCLUDE_MATCH_TOKEN";
- TokenType2[TokenType2["LEFT_CURLY_BRACKET_TOKEN"] = 11] = "LEFT_CURLY_BRACKET_TOKEN";
- TokenType2[TokenType2["RIGHT_CURLY_BRACKET_TOKEN"] = 12] = "RIGHT_CURLY_BRACKET_TOKEN";
- TokenType2[TokenType2["SUFFIX_MATCH_TOKEN"] = 13] = "SUFFIX_MATCH_TOKEN";
- TokenType2[TokenType2["SUBSTRING_MATCH_TOKEN"] = 14] = "SUBSTRING_MATCH_TOKEN";
- TokenType2[TokenType2["DIMENSION_TOKEN"] = 15] = "DIMENSION_TOKEN";
- TokenType2[TokenType2["PERCENTAGE_TOKEN"] = 16] = "PERCENTAGE_TOKEN";
- TokenType2[TokenType2["NUMBER_TOKEN"] = 17] = "NUMBER_TOKEN";
- TokenType2[TokenType2["FUNCTION"] = 18] = "FUNCTION";
- TokenType2[TokenType2["FUNCTION_TOKEN"] = 19] = "FUNCTION_TOKEN";
- TokenType2[TokenType2["IDENT_TOKEN"] = 20] = "IDENT_TOKEN";
- TokenType2[TokenType2["COLUMN_TOKEN"] = 21] = "COLUMN_TOKEN";
- TokenType2[TokenType2["URL_TOKEN"] = 22] = "URL_TOKEN";
- TokenType2[TokenType2["BAD_URL_TOKEN"] = 23] = "BAD_URL_TOKEN";
- TokenType2[TokenType2["CDC_TOKEN"] = 24] = "CDC_TOKEN";
- TokenType2[TokenType2["CDO_TOKEN"] = 25] = "CDO_TOKEN";
- TokenType2[TokenType2["COLON_TOKEN"] = 26] = "COLON_TOKEN";
- TokenType2[TokenType2["SEMICOLON_TOKEN"] = 27] = "SEMICOLON_TOKEN";
- TokenType2[TokenType2["LEFT_SQUARE_BRACKET_TOKEN"] = 28] = "LEFT_SQUARE_BRACKET_TOKEN";
- TokenType2[TokenType2["RIGHT_SQUARE_BRACKET_TOKEN"] = 29] = "RIGHT_SQUARE_BRACKET_TOKEN";
- TokenType2[TokenType2["UNICODE_RANGE_TOKEN"] = 30] = "UNICODE_RANGE_TOKEN";
- TokenType2[TokenType2["WHITESPACE_TOKEN"] = 31] = "WHITESPACE_TOKEN";
- TokenType2[TokenType2["EOF_TOKEN"] = 32] = "EOF_TOKEN";
- })(TokenType || (TokenType = {}));
- var FLAG_UNRESTRICTED = 1 << 0;
- var FLAG_ID = 1 << 1;
- var FLAG_INTEGER = 1 << 2;
- var FLAG_NUMBER = 1 << 3;
- var LINE_FEED = 10;
- var SOLIDUS = 47;
- var REVERSE_SOLIDUS = 92;
- var CHARACTER_TABULATION = 9;
- var SPACE$1 = 32;
- var QUOTATION_MARK = 34;
- var EQUALS_SIGN = 61;
- var NUMBER_SIGN = 35;
- var DOLLAR_SIGN = 36;
- var PERCENTAGE_SIGN = 37;
- var APOSTROPHE = 39;
- var LEFT_PARENTHESIS = 40;
- var RIGHT_PARENTHESIS = 41;
- var LOW_LINE = 95;
- var HYPHEN_MINUS = 45;
- var EXCLAMATION_MARK = 33;
- var LESS_THAN_SIGN = 60;
- var GREATER_THAN_SIGN = 62;
- var COMMERCIAL_AT = 64;
- var LEFT_SQUARE_BRACKET = 91;
- var RIGHT_SQUARE_BRACKET = 93;
- var CIRCUMFLEX_ACCENT = 61;
- var LEFT_CURLY_BRACKET = 123;
- var QUESTION_MARK = 63;
- var RIGHT_CURLY_BRACKET = 125;
- var VERTICAL_LINE = 124;
- var TILDE = 126;
- var CONTROL = 128;
- var REPLACEMENT_CHARACTER = 65533;
- var ASTERISK = 42;
- var PLUS_SIGN = 43;
- var COMMA = 44;
- var COLON = 58;
- var SEMICOLON = 59;
- var FULL_STOP = 46;
- var NULL = 0;
- var BACKSPACE = 8;
- var LINE_TABULATION = 11;
- var SHIFT_OUT = 14;
- var INFORMATION_SEPARATOR_ONE = 31;
- var DELETE = 127;
- var EOF = -1;
- var ZERO = 48;
- var a = 97;
- var e = 101;
- var f = 102;
- var u = 117;
- var z = 122;
- var A = 65;
- var E = 69;
- var F = 70;
- var U = 85;
- var Z = 90;
- var isDigit = function(codePoint) {
- return codePoint >= ZERO && codePoint <= 57;
- };
- var isSurrogateCodePoint = function(codePoint) {
- return codePoint >= 55296 && codePoint <= 57343;
- };
- var isHex = function(codePoint) {
- return isDigit(codePoint) || codePoint >= A && codePoint <= F || codePoint >= a && codePoint <= f;
- };
- var isLowerCaseLetter = function(codePoint) {
- return codePoint >= a && codePoint <= z;
- };
- var isUpperCaseLetter = function(codePoint) {
- return codePoint >= A && codePoint <= Z;
- };
- var isLetter = function(codePoint) {
- return isLowerCaseLetter(codePoint) || isUpperCaseLetter(codePoint);
- };
- var isNonASCIICodePoint = function(codePoint) {
- return codePoint >= CONTROL;
- };
- var isWhiteSpace = function(codePoint) {
- return codePoint === LINE_FEED || codePoint === CHARACTER_TABULATION || codePoint === SPACE$1;
- };
- var isNameStartCodePoint = function(codePoint) {
- return isLetter(codePoint) || isNonASCIICodePoint(codePoint) || codePoint === LOW_LINE;
- };
- var isNameCodePoint = function(codePoint) {
- return isNameStartCodePoint(codePoint) || isDigit(codePoint) || codePoint === HYPHEN_MINUS;
- };
- var isNonPrintableCodePoint = function(codePoint) {
- return codePoint >= NULL && codePoint <= BACKSPACE || codePoint === LINE_TABULATION || codePoint >= SHIFT_OUT && codePoint <= INFORMATION_SEPARATOR_ONE || codePoint === DELETE;
- };
- var isValidEscape = function(c1, c2) {
- if (c1 !== REVERSE_SOLIDUS) {
- return false;
- }
- return c2 !== LINE_FEED;
- };
- var isIdentifierStart = function(c1, c2, c3) {
- if (c1 === HYPHEN_MINUS) {
- return isNameStartCodePoint(c2) || isValidEscape(c2, c3);
- } else if (isNameStartCodePoint(c1)) {
- return true;
- } else if (c1 === REVERSE_SOLIDUS && isValidEscape(c1, c2)) {
- return true;
- }
- return false;
- };
- var isNumberStart = function(c1, c2, c3) {
- if (c1 === PLUS_SIGN || c1 === HYPHEN_MINUS) {
- if (isDigit(c2)) {
- return true;
- }
- return c2 === FULL_STOP && isDigit(c3);
- }
- if (c1 === FULL_STOP) {
- return isDigit(c2);
- }
- return isDigit(c1);
- };
- var stringToNumber = function(codePoints) {
- var c = 0;
- var sign = 1;
- if (codePoints[c] === PLUS_SIGN || codePoints[c] === HYPHEN_MINUS) {
- if (codePoints[c] === HYPHEN_MINUS) {
- sign = -1;
- }
- c++;
- }
- var integers = [];
- while (isDigit(codePoints[c])) {
- integers.push(codePoints[c++]);
- }
- var int = integers.length ? parseInt(fromCodePoint.apply(void 0, integers), 10) : 0;
- if (codePoints[c] === FULL_STOP) {
- c++;
- }
- var fraction = [];
- while (isDigit(codePoints[c])) {
- fraction.push(codePoints[c++]);
- }
- var fracd = fraction.length;
- var frac = fracd ? parseInt(fromCodePoint.apply(void 0, fraction), 10) : 0;
- if (codePoints[c] === E || codePoints[c] === e) {
- c++;
- }
- var expsign = 1;
- if (codePoints[c] === PLUS_SIGN || codePoints[c] === HYPHEN_MINUS) {
- if (codePoints[c] === HYPHEN_MINUS) {
- expsign = -1;
- }
- c++;
- }
- var exponent = [];
- while (isDigit(codePoints[c])) {
- exponent.push(codePoints[c++]);
- }
- var exp = exponent.length ? parseInt(fromCodePoint.apply(void 0, exponent), 10) : 0;
- return sign * (int + frac * Math.pow(10, -fracd)) * Math.pow(10, expsign * exp);
- };
- var LEFT_PARENTHESIS_TOKEN = {
- type: TokenType.LEFT_PARENTHESIS_TOKEN
- };
- var RIGHT_PARENTHESIS_TOKEN = {
- type: TokenType.RIGHT_PARENTHESIS_TOKEN
- };
- var COMMA_TOKEN = { type: TokenType.COMMA_TOKEN };
- var SUFFIX_MATCH_TOKEN = { type: TokenType.SUFFIX_MATCH_TOKEN };
- var PREFIX_MATCH_TOKEN = { type: TokenType.PREFIX_MATCH_TOKEN };
- var COLUMN_TOKEN = { type: TokenType.COLUMN_TOKEN };
- var DASH_MATCH_TOKEN = { type: TokenType.DASH_MATCH_TOKEN };
- var INCLUDE_MATCH_TOKEN = { type: TokenType.INCLUDE_MATCH_TOKEN };
- var LEFT_CURLY_BRACKET_TOKEN = {
- type: TokenType.LEFT_CURLY_BRACKET_TOKEN
- };
- var RIGHT_CURLY_BRACKET_TOKEN = {
- type: TokenType.RIGHT_CURLY_BRACKET_TOKEN
- };
- var SUBSTRING_MATCH_TOKEN = { type: TokenType.SUBSTRING_MATCH_TOKEN };
- var BAD_URL_TOKEN = { type: TokenType.BAD_URL_TOKEN };
- var BAD_STRING_TOKEN = { type: TokenType.BAD_STRING_TOKEN };
- var CDO_TOKEN = { type: TokenType.CDO_TOKEN };
- var CDC_TOKEN = { type: TokenType.CDC_TOKEN };
- var COLON_TOKEN = { type: TokenType.COLON_TOKEN };
- var SEMICOLON_TOKEN = { type: TokenType.SEMICOLON_TOKEN };
- var LEFT_SQUARE_BRACKET_TOKEN = {
- type: TokenType.LEFT_SQUARE_BRACKET_TOKEN
- };
- var RIGHT_SQUARE_BRACKET_TOKEN = {
- type: TokenType.RIGHT_SQUARE_BRACKET_TOKEN
- };
- var WHITESPACE_TOKEN = { type: TokenType.WHITESPACE_TOKEN };
- var EOF_TOKEN = { type: TokenType.EOF_TOKEN };
- var Tokenizer = (
- /** @class */
- function() {
- function Tokenizer2() {
- this._value = [];
- }
- Tokenizer2.prototype.write = function(chunk) {
- this._value = this._value.concat(toCodePoints(chunk));
- };
- Tokenizer2.prototype.read = function() {
- var tokens = [];
- var token = this.consumeToken();
- while (token !== EOF_TOKEN) {
- tokens.push(token);
- token = this.consumeToken();
- }
- return tokens;
- };
- Tokenizer2.prototype.consumeToken = function() {
- var codePoint = this.consumeCodePoint();
- switch (codePoint) {
- case QUOTATION_MARK:
- return this.consumeStringToken(QUOTATION_MARK);
- case NUMBER_SIGN:
- var c1 = this.peekCodePoint(0);
- var c2 = this.peekCodePoint(1);
- var c3 = this.peekCodePoint(2);
- if (isNameCodePoint(c1) || isValidEscape(c2, c3)) {
- var flags = isIdentifierStart(c1, c2, c3) ? FLAG_ID : FLAG_UNRESTRICTED;
- var value = this.consumeName();
- return { type: TokenType.HASH_TOKEN, value, flags };
- }
- break;
- case DOLLAR_SIGN:
- if (this.peekCodePoint(0) === EQUALS_SIGN) {
- this.consumeCodePoint();
- return SUFFIX_MATCH_TOKEN;
- }
- break;
- case APOSTROPHE:
- return this.consumeStringToken(APOSTROPHE);
- case LEFT_PARENTHESIS:
- return LEFT_PARENTHESIS_TOKEN;
- case RIGHT_PARENTHESIS:
- return RIGHT_PARENTHESIS_TOKEN;
- case ASTERISK:
- if (this.peekCodePoint(0) === EQUALS_SIGN) {
- this.consumeCodePoint();
- return SUBSTRING_MATCH_TOKEN;
- }
- break;
- case PLUS_SIGN:
- if (isNumberStart(codePoint, this.peekCodePoint(0), this.peekCodePoint(1))) {
- this.reconsumeCodePoint(codePoint);
- return this.consumeNumericToken();
- }
- break;
- case COMMA:
- return COMMA_TOKEN;
- case HYPHEN_MINUS:
- var e1 = codePoint;
- var e2 = this.peekCodePoint(0);
- var e3 = this.peekCodePoint(1);
- if (isNumberStart(e1, e2, e3)) {
- this.reconsumeCodePoint(codePoint);
- return this.consumeNumericToken();
- }
- if (isIdentifierStart(e1, e2, e3)) {
- this.reconsumeCodePoint(codePoint);
- return this.consumeIdentLikeToken();
- }
- if (e2 === HYPHEN_MINUS && e3 === GREATER_THAN_SIGN) {
- this.consumeCodePoint();
- this.consumeCodePoint();
- return CDC_TOKEN;
- }
- break;
- case FULL_STOP:
- if (isNumberStart(codePoint, this.peekCodePoint(0), this.peekCodePoint(1))) {
- this.reconsumeCodePoint(codePoint);
- return this.consumeNumericToken();
- }
- break;
- case SOLIDUS:
- if (this.peekCodePoint(0) === ASTERISK) {
- this.consumeCodePoint();
- while (true) {
- var c = this.consumeCodePoint();
- if (c === ASTERISK) {
- c = this.consumeCodePoint();
- if (c === SOLIDUS) {
- return this.consumeToken();
- }
- }
- if (c === EOF) {
- return this.consumeToken();
- }
- }
- }
- break;
- case COLON:
- return COLON_TOKEN;
- case SEMICOLON:
- return SEMICOLON_TOKEN;
- case LESS_THAN_SIGN:
- if (this.peekCodePoint(0) === EXCLAMATION_MARK && this.peekCodePoint(1) === HYPHEN_MINUS && this.peekCodePoint(2) === HYPHEN_MINUS) {
- this.consumeCodePoint();
- this.consumeCodePoint();
- return CDO_TOKEN;
- }
- break;
- case COMMERCIAL_AT:
- var a1 = this.peekCodePoint(0);
- var a2 = this.peekCodePoint(1);
- var a3 = this.peekCodePoint(2);
- if (isIdentifierStart(a1, a2, a3)) {
- var value = this.consumeName();
- return { type: TokenType.AT_KEYWORD_TOKEN, value };
- }
- break;
- case LEFT_SQUARE_BRACKET:
- return LEFT_SQUARE_BRACKET_TOKEN;
- case REVERSE_SOLIDUS:
- if (isValidEscape(codePoint, this.peekCodePoint(0))) {
- this.reconsumeCodePoint(codePoint);
- return this.consumeIdentLikeToken();
- }
- break;
- case RIGHT_SQUARE_BRACKET:
- return RIGHT_SQUARE_BRACKET_TOKEN;
- case CIRCUMFLEX_ACCENT:
- if (this.peekCodePoint(0) === EQUALS_SIGN) {
- this.consumeCodePoint();
- return PREFIX_MATCH_TOKEN;
- }
- break;
- case LEFT_CURLY_BRACKET:
- return LEFT_CURLY_BRACKET_TOKEN;
- case RIGHT_CURLY_BRACKET:
- return RIGHT_CURLY_BRACKET_TOKEN;
- case u:
- case U:
- var u1 = this.peekCodePoint(0);
- var u2 = this.peekCodePoint(1);
- if (u1 === PLUS_SIGN && (isHex(u2) || u2 === QUESTION_MARK)) {
- this.consumeCodePoint();
- this.consumeUnicodeRangeToken();
- }
- this.reconsumeCodePoint(codePoint);
- return this.consumeIdentLikeToken();
- case VERTICAL_LINE:
- if (this.peekCodePoint(0) === EQUALS_SIGN) {
- this.consumeCodePoint();
- return DASH_MATCH_TOKEN;
- }
- if (this.peekCodePoint(0) === VERTICAL_LINE) {
- this.consumeCodePoint();
- return COLUMN_TOKEN;
- }
- break;
- case TILDE:
- if (this.peekCodePoint(0) === EQUALS_SIGN) {
- this.consumeCodePoint();
- return INCLUDE_MATCH_TOKEN;
- }
- break;
- case EOF:
- return EOF_TOKEN;
- }
- if (isWhiteSpace(codePoint)) {
- this.consumeWhiteSpace();
- return WHITESPACE_TOKEN;
- }
- if (isDigit(codePoint)) {
- this.reconsumeCodePoint(codePoint);
- return this.consumeNumericToken();
- }
- if (isNameStartCodePoint(codePoint)) {
- this.reconsumeCodePoint(codePoint);
- return this.consumeIdentLikeToken();
- }
- return { type: TokenType.DELIM_TOKEN, value: fromCodePoint(codePoint) };
- };
- Tokenizer2.prototype.consumeCodePoint = function() {
- var value = this._value.shift();
- return typeof value === "undefined" ? -1 : value;
- };
- Tokenizer2.prototype.reconsumeCodePoint = function(codePoint) {
- this._value.unshift(codePoint);
- };
- Tokenizer2.prototype.peekCodePoint = function(delta) {
- if (delta >= this._value.length) {
- return -1;
- }
- return this._value[delta];
- };
- Tokenizer2.prototype.consumeUnicodeRangeToken = function() {
- var digits = [];
- var codePoint = this.consumeCodePoint();
- while (isHex(codePoint) && digits.length < 6) {
- digits.push(codePoint);
- codePoint = this.consumeCodePoint();
- }
- var questionMarks = false;
- while (codePoint === QUESTION_MARK && digits.length < 6) {
- digits.push(codePoint);
- codePoint = this.consumeCodePoint();
- questionMarks = true;
- }
- if (questionMarks) {
- var start_1 = parseInt(fromCodePoint.apply(void 0, digits.map(function(digit) {
- return digit === QUESTION_MARK ? ZERO : digit;
- })), 16);
- var end = parseInt(fromCodePoint.apply(void 0, digits.map(function(digit) {
- return digit === QUESTION_MARK ? F : digit;
- })), 16);
- return { type: TokenType.UNICODE_RANGE_TOKEN, start: start_1, end };
- }
- var start = parseInt(fromCodePoint.apply(void 0, digits), 16);
- if (this.peekCodePoint(0) === HYPHEN_MINUS && isHex(this.peekCodePoint(1))) {
- this.consumeCodePoint();
- codePoint = this.consumeCodePoint();
- var endDigits = [];
- while (isHex(codePoint) && endDigits.length < 6) {
- endDigits.push(codePoint);
- codePoint = this.consumeCodePoint();
- }
- var end = parseInt(fromCodePoint.apply(void 0, endDigits), 16);
- return { type: TokenType.UNICODE_RANGE_TOKEN, start, end };
- } else {
- return { type: TokenType.UNICODE_RANGE_TOKEN, start, end: start };
- }
- };
- Tokenizer2.prototype.consumeIdentLikeToken = function() {
- var value = this.consumeName();
- if (value.toLowerCase() === "url" && this.peekCodePoint(0) === LEFT_PARENTHESIS) {
- this.consumeCodePoint();
- return this.consumeUrlToken();
- } else if (this.peekCodePoint(0) === LEFT_PARENTHESIS) {
- this.consumeCodePoint();
- return { type: TokenType.FUNCTION_TOKEN, value };
- }
- return { type: TokenType.IDENT_TOKEN, value };
- };
- Tokenizer2.prototype.consumeUrlToken = function() {
- var value = [];
- this.consumeWhiteSpace();
- if (this.peekCodePoint(0) === EOF) {
- return { type: TokenType.URL_TOKEN, value: "" };
- }
- var next = this.peekCodePoint(0);
- if (next === APOSTROPHE || next === QUOTATION_MARK) {
- var stringToken = this.consumeStringToken(this.consumeCodePoint());
- if (stringToken.type === TokenType.STRING_TOKEN) {
- this.consumeWhiteSpace();
- if (this.peekCodePoint(0) === EOF || this.peekCodePoint(0) === RIGHT_PARENTHESIS) {
- this.consumeCodePoint();
- return { type: TokenType.URL_TOKEN, value: stringToken.value };
- }
- }
- this.consumeBadUrlRemnants();
- return BAD_URL_TOKEN;
- }
- while (true) {
- var codePoint = this.consumeCodePoint();
- if (codePoint === EOF || codePoint === RIGHT_PARENTHESIS) {
- return { type: TokenType.URL_TOKEN, value: fromCodePoint.apply(void 0, value) };
- } else if (isWhiteSpace(codePoint)) {
- this.consumeWhiteSpace();
- if (this.peekCodePoint(0) === EOF || this.peekCodePoint(0) === RIGHT_PARENTHESIS) {
- this.consumeCodePoint();
- return { type: TokenType.URL_TOKEN, value: fromCodePoint.apply(void 0, value) };
- }
- this.consumeBadUrlRemnants();
- return BAD_URL_TOKEN;
- } else if (codePoint === QUOTATION_MARK || codePoint === APOSTROPHE || codePoint === LEFT_PARENTHESIS || isNonPrintableCodePoint(codePoint)) {
- this.consumeBadUrlRemnants();
- return BAD_URL_TOKEN;
- } else if (codePoint === REVERSE_SOLIDUS) {
- if (isValidEscape(codePoint, this.peekCodePoint(0))) {
- value.push(this.consumeEscapedCodePoint());
- } else {
- this.consumeBadUrlRemnants();
- return BAD_URL_TOKEN;
- }
- } else {
- value.push(codePoint);
- }
- }
- };
- Tokenizer2.prototype.consumeWhiteSpace = function() {
- while (isWhiteSpace(this.peekCodePoint(0))) {
- this.consumeCodePoint();
- }
- };
- Tokenizer2.prototype.consumeBadUrlRemnants = function() {
- while (true) {
- var codePoint = this.consumeCodePoint();
- if (codePoint === RIGHT_PARENTHESIS || codePoint === EOF) {
- return;
- }
- if (isValidEscape(codePoint, this.peekCodePoint(0))) {
- this.consumeEscapedCodePoint();
- }
- }
- };
- Tokenizer2.prototype.consumeStringSlice = function(count) {
- var SLICE_STACK_SIZE = 6e4;
- var value = "";
- while (count > 0) {
- var amount = Math.min(SLICE_STACK_SIZE, count);
- value += fromCodePoint.apply(void 0, this._value.splice(0, amount));
- count -= amount;
- }
- this._value.shift();
- return value;
- };
- Tokenizer2.prototype.consumeStringToken = function(endingCodePoint) {
- var value = "";
- var i = 0;
- do {
- var codePoint = this._value[i];
- if (codePoint === EOF || codePoint === void 0 || codePoint === endingCodePoint) {
- value += this.consumeStringSlice(i);
- return { type: TokenType.STRING_TOKEN, value };
- }
- if (codePoint === LINE_FEED) {
- this._value.splice(0, i);
- return BAD_STRING_TOKEN;
- }
- if (codePoint === REVERSE_SOLIDUS) {
- var next = this._value[i + 1];
- if (next !== EOF && next !== void 0) {
- if (next === LINE_FEED) {
- value += this.consumeStringSlice(i);
- i = -1;
- this._value.shift();
- } else if (isValidEscape(codePoint, next)) {
- value += this.consumeStringSlice(i);
- value += fromCodePoint(this.consumeEscapedCodePoint());
- i = -1;
- }
- }
- }
- i++;
- } while (true);
- };
- Tokenizer2.prototype.consumeNumber = function() {
- var repr = [];
- var type = FLAG_INTEGER;
- var c1 = this.peekCodePoint(0);
- if (c1 === PLUS_SIGN || c1 === HYPHEN_MINUS) {
- repr.push(this.consumeCodePoint());
- }
- while (isDigit(this.peekCodePoint(0))) {
- repr.push(this.consumeCodePoint());
- }
- c1 = this.peekCodePoint(0);
- var c2 = this.peekCodePoint(1);
- if (c1 === FULL_STOP && isDigit(c2)) {
- repr.push(this.consumeCodePoint(), this.consumeCodePoint());
- type = FLAG_NUMBER;
- while (isDigit(this.peekCodePoint(0))) {
- repr.push(this.consumeCodePoint());
- }
- }
- c1 = this.peekCodePoint(0);
- c2 = this.peekCodePoint(1);
- var c3 = this.peekCodePoint(2);
- if ((c1 === E || c1 === e) && ((c2 === PLUS_SIGN || c2 === HYPHEN_MINUS) && isDigit(c3) || isDigit(c2))) {
- repr.push(this.consumeCodePoint(), this.consumeCodePoint());
- type = FLAG_NUMBER;
- while (isDigit(this.peekCodePoint(0))) {
- repr.push(this.consumeCodePoint());
- }
- }
- return [stringToNumber(repr), type];
- };
- Tokenizer2.prototype.consumeNumericToken = function() {
- var _a = this.consumeNumber(), number = _a[0], flags = _a[1];
- var c1 = this.peekCodePoint(0);
- var c2 = this.peekCodePoint(1);
- var c3 = this.peekCodePoint(2);
- if (isIdentifierStart(c1, c2, c3)) {
- var unit = this.consumeName();
- return { type: TokenType.DIMENSION_TOKEN, number, flags, unit };
- }
- if (c1 === PERCENTAGE_SIGN) {
- this.consumeCodePoint();
- return { type: TokenType.PERCENTAGE_TOKEN, number, flags };
- }
- return { type: TokenType.NUMBER_TOKEN, number, flags };
- };
- Tokenizer2.prototype.consumeEscapedCodePoint = function() {
- var codePoint = this.consumeCodePoint();
- if (isHex(codePoint)) {
- var hex = fromCodePoint(codePoint);
- while (isHex(this.peekCodePoint(0)) && hex.length < 6) {
- hex += fromCodePoint(this.consumeCodePoint());
- }
- if (isWhiteSpace(this.peekCodePoint(0))) {
- this.consumeCodePoint();
- }
- var hexCodePoint = parseInt(hex, 16);
- if (hexCodePoint === 0 || isSurrogateCodePoint(hexCodePoint) || hexCodePoint > 1114111) {
- return REPLACEMENT_CHARACTER;
- }
- return hexCodePoint;
- }
- if (codePoint === EOF) {
- return REPLACEMENT_CHARACTER;
- }
- return codePoint;
- };
- Tokenizer2.prototype.consumeName = function() {
- var result = "";
- while (true) {
- var codePoint = this.consumeCodePoint();
- if (isNameCodePoint(codePoint)) {
- result += fromCodePoint(codePoint);
- } else if (isValidEscape(codePoint, this.peekCodePoint(0))) {
- result += fromCodePoint(this.consumeEscapedCodePoint());
- } else {
- this.reconsumeCodePoint(codePoint);
- return result;
- }
- }
- };
- return Tokenizer2;
- }()
- );
- var Parser = (
- /** @class */
- function() {
- function Parser2(tokens) {
- this._tokens = tokens;
- }
- Parser2.create = function(value) {
- var tokenizer = new Tokenizer();
- tokenizer.write(value);
- return new Parser2(tokenizer.read());
- };
- Parser2.parseValue = function(value) {
- return Parser2.create(value).parseComponentValue();
- };
- Parser2.parseValues = function(value) {
- return Parser2.create(value).parseComponentValues();
- };
- Parser2.prototype.parseComponentValue = function() {
- var token = this.consumeToken();
- while (token.type === TokenType.WHITESPACE_TOKEN) {
- token = this.consumeToken();
- }
- if (token.type === TokenType.EOF_TOKEN) {
- throw new SyntaxError("Error parsing CSS component value, unexpected EOF");
- }
- this.reconsumeToken(token);
- var value = this.consumeComponentValue();
- do {
- token = this.consumeToken();
- } while (token.type === TokenType.WHITESPACE_TOKEN);
- if (token.type === TokenType.EOF_TOKEN) {
- return value;
- }
- throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one");
- };
- Parser2.prototype.parseComponentValues = function() {
- var values = [];
- while (true) {
- var value = this.consumeComponentValue();
- if (value.type === TokenType.EOF_TOKEN) {
- return values;
- }
- values.push(value);
- values.push();
- }
- };
- Parser2.prototype.consumeComponentValue = function() {
- var token = this.consumeToken();
- switch (token.type) {
- case TokenType.LEFT_CURLY_BRACKET_TOKEN:
- case TokenType.LEFT_SQUARE_BRACKET_TOKEN:
- case TokenType.LEFT_PARENTHESIS_TOKEN:
- return this.consumeSimpleBlock(token.type);
- case TokenType.FUNCTION_TOKEN:
- return this.consumeFunction(token);
- }
- return token;
- };
- Parser2.prototype.consumeSimpleBlock = function(type) {
- var block = { type, values: [] };
- var token = this.consumeToken();
- while (true) {
- if (token.type === TokenType.EOF_TOKEN || isEndingTokenFor(token, type)) {
- return block;
- }
- this.reconsumeToken(token);
- block.values.push(this.consumeComponentValue());
- token = this.consumeToken();
- }
- };
- Parser2.prototype.consumeFunction = function(functionToken) {
- var cssFunction = {
- name: functionToken.value,
- values: [],
- type: TokenType.FUNCTION
- };
- while (true) {
- var token = this.consumeToken();
- if (token.type === TokenType.EOF_TOKEN || token.type === TokenType.RIGHT_PARENTHESIS_TOKEN) {
- return cssFunction;
- }
- this.reconsumeToken(token);
- cssFunction.values.push(this.consumeComponentValue());
- }
- };
- Parser2.prototype.consumeToken = function() {
- var token = this._tokens.shift();
- return typeof token === "undefined" ? EOF_TOKEN : token;
- };
- Parser2.prototype.reconsumeToken = function(token) {
- this._tokens.unshift(token);
- };
- return Parser2;
- }()
- );
- var isDimensionToken = function(token) {
- return token.type === TokenType.DIMENSION_TOKEN;
- };
- var isNumberToken = function(token) {
- return token.type === TokenType.NUMBER_TOKEN;
- };
- var isIdentToken = function(token) {
- return token.type === TokenType.IDENT_TOKEN;
- };
- var isStringToken = function(token) {
- return token.type === TokenType.STRING_TOKEN;
- };
- var isIdentWithValue = function(token, value) {
- return isIdentToken(token) && token.value === value;
- };
- var nonWhiteSpace = function(token) {
- return token.type !== TokenType.WHITESPACE_TOKEN;
- };
- var nonFunctionArgSeparator = function(token) {
- return token.type !== TokenType.WHITESPACE_TOKEN && token.type !== TokenType.COMMA_TOKEN;
- };
- var parseFunctionArgs = function(tokens) {
- var args = [];
- var arg = [];
- tokens.forEach(function(token) {
- if (token.type === TokenType.COMMA_TOKEN) {
- if (arg.length === 0) {
- throw new Error("Error parsing function args, zero tokens for arg");
- }
- args.push(arg);
- arg = [];
- return;
- }
- if (token.type !== TokenType.WHITESPACE_TOKEN) {
- arg.push(token);
- }
- });
- if (arg.length) {
- args.push(arg);
- }
- return args;
- };
- var isEndingTokenFor = function(token, type) {
- if (type === TokenType.LEFT_CURLY_BRACKET_TOKEN && token.type === TokenType.RIGHT_CURLY_BRACKET_TOKEN) {
- return true;
- }
- if (type === TokenType.LEFT_SQUARE_BRACKET_TOKEN && token.type === TokenType.RIGHT_SQUARE_BRACKET_TOKEN) {
- return true;
- }
- return type === TokenType.LEFT_PARENTHESIS_TOKEN && token.type === TokenType.RIGHT_PARENTHESIS_TOKEN;
- };
- var isLength = function(token) {
- return token.type === TokenType.NUMBER_TOKEN || token.type === TokenType.DIMENSION_TOKEN;
- };
- var isLengthPercentage = function(token) {
- return token.type === TokenType.PERCENTAGE_TOKEN || isLength(token);
- };
- var parseLengthPercentageTuple = function(tokens) {
- return tokens.length > 1 ? [tokens[0], tokens[1]] : [tokens[0]];
- };
- var ZERO_LENGTH = {
- type: TokenType.NUMBER_TOKEN,
- number: 0,
- flags: FLAG_INTEGER
- };
- var FIFTY_PERCENT = {
- type: TokenType.PERCENTAGE_TOKEN,
- number: 50,
- flags: FLAG_INTEGER
- };
- var HUNDRED_PERCENT = {
- type: TokenType.PERCENTAGE_TOKEN,
- number: 100,
- flags: FLAG_INTEGER
- };
- var getAbsoluteValueForTuple = function(tuple, width, height) {
- var x = tuple[0], y = tuple[1];
- return [getAbsoluteValue(x, width), getAbsoluteValue(typeof y !== "undefined" ? y : x, height)];
- };
- var getAbsoluteValue = function(token, parent) {
- if (token.type === TokenType.PERCENTAGE_TOKEN) {
- return token.number / 100 * parent;
- }
- if (isDimensionToken(token)) {
- switch (token.unit) {
- case "rem":
- case "em":
- return 16 * token.number;
- case "px":
- default:
- return token.number;
- }
- }
- return token.number;
- };
- var DEG = "deg";
- var GRAD = "grad";
- var RAD = "rad";
- var TURN = "turn";
- var angle = {
- name: "angle",
- parse: function(value) {
- if (value.type === TokenType.DIMENSION_TOKEN) {
- switch (value.unit) {
- case DEG:
- return Math.PI * value.number / 180;
- case GRAD:
- return Math.PI / 200 * value.number;
- case RAD:
- return value.number;
- case TURN:
- return Math.PI * 2 * value.number;
- }
- }
- throw new Error("Unsupported angle type");
- }
- };
- var isAngle = function(value) {
- if (value.type === TokenType.DIMENSION_TOKEN) {
- if (value.unit === DEG || value.unit === GRAD || value.unit === RAD || value.unit === TURN) {
- return true;
- }
- }
- return false;
- };
- var parseNamedSide = function(tokens) {
- var sideOrCorner = tokens.filter(isIdentToken).map(function(ident) {
- return ident.value;
- }).join(" ");
- switch (sideOrCorner) {
- case "to bottom right":
- case "to right bottom":
- case "left top":
- case "top left":
- return [ZERO_LENGTH, ZERO_LENGTH];
- case "to top":
- case "bottom":
- return deg(0);
- case "to bottom left":
- case "to left bottom":
- case "right top":
- case "top right":
- return [ZERO_LENGTH, HUNDRED_PERCENT];
- case "to right":
- case "left":
- return deg(90);
- case "to top left":
- case "to left top":
- case "right bottom":
- case "bottom right":
- return [HUNDRED_PERCENT, HUNDRED_PERCENT];
- case "to bottom":
- case "top":
- return deg(180);
- case "to top right":
- case "to right top":
- case "left bottom":
- case "bottom left":
- return [HUNDRED_PERCENT, ZERO_LENGTH];
- case "to left":
- case "right":
- return deg(270);
- }
- return 0;
- };
- var deg = function(deg2) {
- return Math.PI * deg2 / 180;
- };
- var color = {
- name: "color",
- parse: function(value) {
- if (value.type === TokenType.FUNCTION) {
- var colorFunction = SUPPORTED_COLOR_FUNCTIONS[value.name];
- if (typeof colorFunction === "undefined") {
- throw new Error('Attempting to parse an unsupported color function "' + value.name + '"');
- }
- return colorFunction(value.values);
- }
- if (value.type === TokenType.HASH_TOKEN) {
- if (value.value.length === 3) {
- var r = value.value.substring(0, 1);
- var g = value.value.substring(1, 2);
- var b = value.value.substring(2, 3);
- return pack(parseInt(r + r, 16), parseInt(g + g, 16), parseInt(b + b, 16), 1);
- }
- if (value.value.length === 4) {
- var r = value.value.substring(0, 1);
- var g = value.value.substring(1, 2);
- var b = value.value.substring(2, 3);
- var a2 = value.value.substring(3, 4);
- return pack(parseInt(r + r, 16), parseInt(g + g, 16), parseInt(b + b, 16), parseInt(a2 + a2, 16) / 255);
- }
- if (value.value.length === 6) {
- var r = value.value.substring(0, 2);
- var g = value.value.substring(2, 4);
- var b = value.value.substring(4, 6);
- return pack(parseInt(r, 16), parseInt(g, 16), parseInt(b, 16), 1);
- }
- if (value.value.length === 8) {
- var r = value.value.substring(0, 2);
- var g = value.value.substring(2, 4);
- var b = value.value.substring(4, 6);
- var a2 = value.value.substring(6, 8);
- return pack(parseInt(r, 16), parseInt(g, 16), parseInt(b, 16), parseInt(a2, 16) / 255);
- }
- }
- if (value.type === TokenType.IDENT_TOKEN) {
- var namedColor = COLORS[value.value.toUpperCase()];
- if (typeof namedColor !== "undefined") {
- return namedColor;
- }
- }
- return COLORS.TRANSPARENT;
- }
- };
- var isTransparent = function(color2) {
- return (255 & color2) === 0;
- };
- var asString = function(color2) {
- var alpha = 255 & color2;
- var blue = 255 & color2 >> 8;
- var green = 255 & color2 >> 16;
- var red = 255 & color2 >> 24;
- return alpha < 255 ? "rgba(" + red + "," + green + "," + blue + "," + alpha / 255 + ")" : "rgb(" + red + "," + green + "," + blue + ")";
- };
- var pack = function(r, g, b, a2) {
- return (r << 24 | g << 16 | b << 8 | Math.round(a2 * 255) << 0) >>> 0;
- };
- var getTokenColorValue = function(token, i) {
- if (token.type === TokenType.NUMBER_TOKEN) {
- return token.number;
- }
- if (token.type === TokenType.PERCENTAGE_TOKEN) {
- var max = i === 3 ? 1 : 255;
- return i === 3 ? token.number / 100 * max : Math.round(token.number / 100 * max);
- }
- return 0;
- };
- var rgb = function(args) {
- var tokens = args.filter(nonFunctionArgSeparator);
- if (tokens.length === 3) {
- var _a = tokens.map(getTokenColorValue), r = _a[0], g = _a[1], b = _a[2];
- return pack(r, g, b, 1);
- }
- if (tokens.length === 4) {
- var _b = tokens.map(getTokenColorValue), r = _b[0], g = _b[1], b = _b[2], a2 = _b[3];
- return pack(r, g, b, a2);
- }
- return 0;
- };
- function hue2rgb(t1, t2, hue) {
- if (hue < 0) {
- hue += 1;
- }
- if (hue >= 1) {
- hue -= 1;
- }
- if (hue < 1 / 6) {
- return (t2 - t1) * hue * 6 + t1;
- } else if (hue < 1 / 2) {
- return t2;
- } else if (hue < 2 / 3) {
- return (t2 - t1) * 6 * (2 / 3 - hue) + t1;
- } else {
- return t1;
- }
- }
- var hsl = function(args) {
- var tokens = args.filter(nonFunctionArgSeparator);
- var hue = tokens[0], saturation = tokens[1], lightness = tokens[2], alpha = tokens[3];
- var h = (hue.type === TokenType.NUMBER_TOKEN ? deg(hue.number) : angle.parse(hue)) / (Math.PI * 2);
- var s = isLengthPercentage(saturation) ? saturation.number / 100 : 0;
- var l = isLengthPercentage(lightness) ? lightness.number / 100 : 0;
- var a2 = typeof alpha !== "undefined" && isLengthPercentage(alpha) ? getAbsoluteValue(alpha, 1) : 1;
- if (s === 0) {
- return pack(l * 255, l * 255, l * 255, 1);
- }
- var t2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;
- var t1 = l * 2 - t2;
- var r = hue2rgb(t1, t2, h + 1 / 3);
- var g = hue2rgb(t1, t2, h);
- var b = hue2rgb(t1, t2, h - 1 / 3);
- return pack(r * 255, g * 255, b * 255, a2);
- };
- var SUPPORTED_COLOR_FUNCTIONS = {
- hsl,
- hsla: hsl,
- rgb,
- rgba: rgb
- };
- var COLORS = {
- ALICEBLUE: 4042850303,
- ANTIQUEWHITE: 4209760255,
- AQUA: 16777215,
- AQUAMARINE: 2147472639,
- AZURE: 4043309055,
- BEIGE: 4126530815,
- BISQUE: 4293182719,
- BLACK: 255,
- BLANCHEDALMOND: 4293643775,
- BLUE: 65535,
- BLUEVIOLET: 2318131967,
- BROWN: 2771004159,
- BURLYWOOD: 3736635391,
- CADETBLUE: 1604231423,
- CHARTREUSE: 2147418367,
- CHOCOLATE: 3530104575,
- CORAL: 4286533887,
- CORNFLOWERBLUE: 1687547391,
- CORNSILK: 4294499583,
- CRIMSON: 3692313855,
- CYAN: 16777215,
- DARKBLUE: 35839,
- DARKCYAN: 9145343,
- DARKGOLDENROD: 3095837695,
- DARKGRAY: 2846468607,
- DARKGREEN: 6553855,
- DARKGREY: 2846468607,
- DARKKHAKI: 3182914559,
- DARKMAGENTA: 2332068863,
- DARKOLIVEGREEN: 1433087999,
- DARKORANGE: 4287365375,
- DARKORCHID: 2570243327,
- DARKRED: 2332033279,
- DARKSALMON: 3918953215,
- DARKSEAGREEN: 2411499519,
- DARKSLATEBLUE: 1211993087,
- DARKSLATEGRAY: 793726975,
- DARKSLATEGREY: 793726975,
- DARKTURQUOISE: 13554175,
- DARKVIOLET: 2483082239,
- DEEPPINK: 4279538687,
- DEEPSKYBLUE: 12582911,
- DIMGRAY: 1768516095,
- DIMGREY: 1768516095,
- DODGERBLUE: 512819199,
- FIREBRICK: 2988581631,
- FLORALWHITE: 4294635775,
- FORESTGREEN: 579543807,
- FUCHSIA: 4278255615,
- GAINSBORO: 3705462015,
- GHOSTWHITE: 4177068031,
- GOLD: 4292280575,
- GOLDENROD: 3668254975,
- GRAY: 2155905279,
- GREEN: 8388863,
- GREENYELLOW: 2919182335,
- GREY: 2155905279,
- HONEYDEW: 4043305215,
- HOTPINK: 4285117695,
- INDIANRED: 3445382399,
- INDIGO: 1258324735,
- IVORY: 4294963455,
- KHAKI: 4041641215,
- LAVENDER: 3873897215,
- LAVENDERBLUSH: 4293981695,
- LAWNGREEN: 2096890111,
- LEMONCHIFFON: 4294626815,
- LIGHTBLUE: 2916673279,
- LIGHTCORAL: 4034953471,
- LIGHTCYAN: 3774873599,
- LIGHTGOLDENRODYELLOW: 4210742015,
- LIGHTGRAY: 3553874943,
- LIGHTGREEN: 2431553791,
- LIGHTGREY: 3553874943,
- LIGHTPINK: 4290167295,
- LIGHTSALMON: 4288707327,
- LIGHTSEAGREEN: 548580095,
- LIGHTSKYBLUE: 2278488831,
- LIGHTSLATEGRAY: 2005441023,
- LIGHTSLATEGREY: 2005441023,
- LIGHTSTEELBLUE: 2965692159,
- LIGHTYELLOW: 4294959359,
- LIME: 16711935,
- LIMEGREEN: 852308735,
- LINEN: 4210091775,
- MAGENTA: 4278255615,
- MAROON: 2147483903,
- MEDIUMAQUAMARINE: 1724754687,
- MEDIUMBLUE: 52735,
- MEDIUMORCHID: 3126187007,
- MEDIUMPURPLE: 2473647103,
- MEDIUMSEAGREEN: 1018393087,
- MEDIUMSLATEBLUE: 2070474495,
- MEDIUMSPRINGGREEN: 16423679,
- MEDIUMTURQUOISE: 1221709055,
- MEDIUMVIOLETRED: 3340076543,
- MIDNIGHTBLUE: 421097727,
- MINTCREAM: 4127193855,
- MISTYROSE: 4293190143,
- MOCCASIN: 4293178879,
- NAVAJOWHITE: 4292783615,
- NAVY: 33023,
- OLDLACE: 4260751103,
- OLIVE: 2155872511,
- OLIVEDRAB: 1804477439,
- ORANGE: 4289003775,
- ORANGERED: 4282712319,
- ORCHID: 3664828159,
- PALEGOLDENROD: 4008225535,
- PALEGREEN: 2566625535,
- PALETURQUOISE: 2951671551,
- PALEVIOLETRED: 3681588223,
- PAPAYAWHIP: 4293907967,
- PEACHPUFF: 4292524543,
- PERU: 3448061951,
- PINK: 4290825215,
- PLUM: 3718307327,
- POWDERBLUE: 2967529215,
- PURPLE: 2147516671,
- REBECCAPURPLE: 1714657791,
- RED: 4278190335,
- ROSYBROWN: 3163525119,
- ROYALBLUE: 1097458175,
- SADDLEBROWN: 2336560127,
- SALMON: 4202722047,
- SANDYBROWN: 4104413439,
- SEAGREEN: 780883967,
- SEASHELL: 4294307583,
- SIENNA: 2689740287,
- SILVER: 3233857791,
- SKYBLUE: 2278484991,
- SLATEBLUE: 1784335871,
- SLATEGRAY: 1887473919,
- SLATEGREY: 1887473919,
- SNOW: 4294638335,
- SPRINGGREEN: 16744447,
- STEELBLUE: 1182971135,
- TAN: 3535047935,
- TEAL: 8421631,
- THISTLE: 3636451583,
- TOMATO: 4284696575,
- TRANSPARENT: 0,
- TURQUOISE: 1088475391,
- VIOLET: 4001558271,
- WHEAT: 4125012991,
- WHITE: 4294967295,
- WHITESMOKE: 4126537215,
- YELLOW: 4294902015,
- YELLOWGREEN: 2597139199
- };
- var PropertyDescriptorParsingType;
- (function(PropertyDescriptorParsingType2) {
- PropertyDescriptorParsingType2[PropertyDescriptorParsingType2["VALUE"] = 0] = "VALUE";
- PropertyDescriptorParsingType2[PropertyDescriptorParsingType2["LIST"] = 1] = "LIST";
- PropertyDescriptorParsingType2[PropertyDescriptorParsingType2["IDENT_VALUE"] = 2] = "IDENT_VALUE";
- PropertyDescriptorParsingType2[PropertyDescriptorParsingType2["TYPE_VALUE"] = 3] = "TYPE_VALUE";
- PropertyDescriptorParsingType2[PropertyDescriptorParsingType2["TOKEN_VALUE"] = 4] = "TOKEN_VALUE";
- })(PropertyDescriptorParsingType || (PropertyDescriptorParsingType = {}));
- var BACKGROUND_CLIP;
- (function(BACKGROUND_CLIP2) {
- BACKGROUND_CLIP2[BACKGROUND_CLIP2["BORDER_BOX"] = 0] = "BORDER_BOX";
- BACKGROUND_CLIP2[BACKGROUND_CLIP2["PADDING_BOX"] = 1] = "PADDING_BOX";
- BACKGROUND_CLIP2[BACKGROUND_CLIP2["CONTENT_BOX"] = 2] = "CONTENT_BOX";
- })(BACKGROUND_CLIP || (BACKGROUND_CLIP = {}));
- var backgroundClip = {
- name: "background-clip",
- initialValue: "border-box",
- prefix: false,
- type: PropertyDescriptorParsingType.LIST,
- parse: function(tokens) {
- return tokens.map(function(token) {
- if (isIdentToken(token)) {
- switch (token.value) {
- case "padding-box":
- return BACKGROUND_CLIP.PADDING_BOX;
- case "content-box":
- return BACKGROUND_CLIP.CONTENT_BOX;
- }
- }
- return BACKGROUND_CLIP.BORDER_BOX;
- });
- }
- };
- var backgroundColor = {
- name: "background-color",
- initialValue: "transparent",
- prefix: false,
- type: PropertyDescriptorParsingType.TYPE_VALUE,
- format: "color"
- };
- var parseColorStop = function(args) {
- var color$12 = color.parse(args[0]);
- var stop = args[1];
- return stop && isLengthPercentage(stop) ? { color: color$12, stop } : { color: color$12, stop: null };
- };
- var processColorStops = function(stops, lineLength) {
- var first = stops[0];
- var last = stops[stops.length - 1];
- if (first.stop === null) {
- first.stop = ZERO_LENGTH;
- }
- if (last.stop === null) {
- last.stop = HUNDRED_PERCENT;
- }
- var processStops = [];
- var previous = 0;
- for (var i = 0; i < stops.length; i++) {
- var stop_1 = stops[i].stop;
- if (stop_1 !== null) {
- var absoluteValue = getAbsoluteValue(stop_1, lineLength);
- if (absoluteValue > previous) {
- processStops.push(absoluteValue);
- } else {
- processStops.push(previous);
- }
- previous = absoluteValue;
- } else {
- processStops.push(null);
- }
- }
- var gapBegin = null;
- for (var i = 0; i < processStops.length; i++) {
- var stop_2 = processStops[i];
- if (stop_2 === null) {
- if (gapBegin === null) {
- gapBegin = i;
- }
- } else if (gapBegin !== null) {
- var gapLength = i - gapBegin;
- var beforeGap = processStops[gapBegin - 1];
- var gapValue = (stop_2 - beforeGap) / (gapLength + 1);
- for (var g = 1; g <= gapLength; g++) {
- processStops[gapBegin + g - 1] = gapValue * g;
- }
- gapBegin = null;
- }
- }
- return stops.map(function(_a, i2) {
- var color2 = _a.color;
- return { color: color2, stop: Math.max(Math.min(1, processStops[i2] / lineLength), 0) };
- });
- };
- var getAngleFromCorner = function(corner, width, height) {
- var centerX = width / 2;
- var centerY = height / 2;
- var x = getAbsoluteValue(corner[0], width) - centerX;
- var y = centerY - getAbsoluteValue(corner[1], height);
- return (Math.atan2(y, x) + Math.PI * 2) % (Math.PI * 2);
- };
- var calculateGradientDirection = function(angle2, width, height) {
- var radian = typeof angle2 === "number" ? angle2 : getAngleFromCorner(angle2, width, height);
- var lineLength = Math.abs(width * Math.sin(radian)) + Math.abs(height * Math.cos(radian));
- var halfWidth = width / 2;
- var halfHeight = height / 2;
- var halfLineLength = lineLength / 2;
- var yDiff = Math.sin(radian - Math.PI / 2) * halfLineLength;
- var xDiff = Math.cos(radian - Math.PI / 2) * halfLineLength;
- return [lineLength, halfWidth - xDiff, halfWidth + xDiff, halfHeight - yDiff, halfHeight + yDiff];
- };
- var distance = function(a2, b) {
- return Math.sqrt(a2 * a2 + b * b);
- };
- var findCorner = function(width, height, x, y, closest) {
- var corners = [[0, 0], [0, height], [width, 0], [width, height]];
- return corners.reduce(function(stat, corner) {
- var cx = corner[0], cy = corner[1];
- var d = distance(x - cx, y - cy);
- if (closest ? d < stat.optimumDistance : d > stat.optimumDistance) {
- return {
- optimumCorner: corner,
- optimumDistance: d
- };
- }
- return stat;
- }, {
- optimumDistance: closest ? Infinity : -Infinity,
- optimumCorner: null
- }).optimumCorner;
- };
- var calculateRadius = function(gradient, x, y, width, height) {
- var rx = 0;
- var ry = 0;
- switch (gradient.size) {
- case CSSRadialExtent.CLOSEST_SIDE:
- if (gradient.shape === CSSRadialShape.CIRCLE) {
- rx = ry = Math.min(Math.abs(x), Math.abs(x - width), Math.abs(y), Math.abs(y - height));
- } else if (gradient.shape === CSSRadialShape.ELLIPSE) {
- rx = Math.min(Math.abs(x), Math.abs(x - width));
- ry = Math.min(Math.abs(y), Math.abs(y - height));
- }
- break;
- case CSSRadialExtent.CLOSEST_CORNER:
- if (gradient.shape === CSSRadialShape.CIRCLE) {
- rx = ry = Math.min(distance(x, y), distance(x, y - height), distance(x - width, y), distance(x - width, y - height));
- } else if (gradient.shape === CSSRadialShape.ELLIPSE) {
- var c = Math.min(Math.abs(y), Math.abs(y - height)) / Math.min(Math.abs(x), Math.abs(x - width));
- var _a = findCorner(width, height, x, y, true), cx = _a[0], cy = _a[1];
- rx = distance(cx - x, (cy - y) / c);
- ry = c * rx;
- }
- break;
- case CSSRadialExtent.FARTHEST_SIDE:
- if (gradient.shape === CSSRadialShape.CIRCLE) {
- rx = ry = Math.max(Math.abs(x), Math.abs(x - width), Math.abs(y), Math.abs(y - height));
- } else if (gradient.shape === CSSRadialShape.ELLIPSE) {
- rx = Math.max(Math.abs(x), Math.abs(x - width));
- ry = Math.max(Math.abs(y), Math.abs(y - height));
- }
- break;
- case CSSRadialExtent.FARTHEST_CORNER:
- if (gradient.shape === CSSRadialShape.CIRCLE) {
- rx = ry = Math.max(distance(x, y), distance(x, y - height), distance(x - width, y), distance(x - width, y - height));
- } else if (gradient.shape === CSSRadialShape.ELLIPSE) {
- var c = Math.max(Math.abs(y), Math.abs(y - height)) / Math.max(Math.abs(x), Math.abs(x - width));
- var _b = findCorner(width, height, x, y, false), cx = _b[0], cy = _b[1];
- rx = distance(cx - x, (cy - y) / c);
- ry = c * rx;
- }
- break;
- }
- if (Array.isArray(gradient.size)) {
- rx = getAbsoluteValue(gradient.size[0], width);
- ry = gradient.size.length === 2 ? getAbsoluteValue(gradient.size[1], height) : rx;
- }
- return [rx, ry];
- };
- var linearGradient = function(tokens) {
- var angle$1 = deg(180);
- var stops = [];
- parseFunctionArgs(tokens).forEach(function(arg, i) {
- if (i === 0) {
- var firstToken = arg[0];
- if (firstToken.type === TokenType.IDENT_TOKEN && firstToken.value === "to") {
- angle$1 = parseNamedSide(arg);
- return;
- } else if (isAngle(firstToken)) {
- angle$1 = angle.parse(firstToken);
- return;
- }
- }
- var colorStop = parseColorStop(arg);
- stops.push(colorStop);
- });
- return { angle: angle$1, stops, type: CSSImageType.LINEAR_GRADIENT };
- };
- var prefixLinearGradient = function(tokens) {
- var angle$1 = deg(180);
- var stops = [];
- parseFunctionArgs(tokens).forEach(function(arg, i) {
- if (i === 0) {
- var firstToken = arg[0];
- if (firstToken.type === TokenType.IDENT_TOKEN && ["top", "left", "right", "bottom"].indexOf(firstToken.value) !== -1) {
- angle$1 = parseNamedSide(arg);
- return;
- } else if (isAngle(firstToken)) {
- angle$1 = (angle.parse(firstToken) + deg(270)) % deg(360);
- return;
- }
- }
- var colorStop = parseColorStop(arg);
- stops.push(colorStop);
- });
- return {
- angle: angle$1,
- stops,
- type: CSSImageType.LINEAR_GRADIENT
- };
- };
- var testRangeBounds = function(document2) {
- var TEST_HEIGHT = 123;
- if (document2.createRange) {
- var range = document2.createRange();
- if (range.getBoundingClientRect) {
- var testElement = document2.createElement("boundtest");
- testElement.style.height = TEST_HEIGHT + "px";
- testElement.style.display = "block";
- document2.body.appendChild(testElement);
- range.selectNode(testElement);
- var rangeBounds = range.getBoundingClientRect();
- var rangeHeight = Math.round(rangeBounds.height);
- document2.body.removeChild(testElement);
- if (rangeHeight === TEST_HEIGHT) {
- return true;
- }
- }
- }
- return false;
- };
- var testCORS = function() {
- return typeof new Image().crossOrigin !== "undefined";
- };
- var testResponseType = function() {
- return typeof new XMLHttpRequest().responseType === "string";
- };
- var testSVG = function(document2) {
- var img = new Image();
- var canvas = document2.createElement("canvas");
- var ctx = canvas.getContext("2d");
- if (!ctx) {
- return false;
- }
- img.src = "data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";
- try {
- ctx.drawImage(img, 0, 0);
- canvas.toDataURL();
- } catch (e2) {
- return false;
- }
- return true;
- };
- var isGreenPixel = function(data) {
- return data[0] === 0 && data[1] === 255 && data[2] === 0 && data[3] === 255;
- };
- var testForeignObject = function(document2) {
- var canvas = document2.createElement("canvas");
- var size = 100;
- canvas.width = size;
- canvas.height = size;
- var ctx = canvas.getContext("2d");
- if (!ctx) {
- return Promise.reject(false);
- }
- ctx.fillStyle = "rgb(0, 255, 0)";
- ctx.fillRect(0, 0, size, size);
- var img = new Image();
- var greenImageSrc = canvas.toDataURL();
- img.src = greenImageSrc;
- var svg = createForeignObjectSVG(size, size, 0, 0, img);
- ctx.fillStyle = "red";
- ctx.fillRect(0, 0, size, size);
- return loadSerializedSVG(svg).then(function(img2) {
- ctx.drawImage(img2, 0, 0);
- var data = ctx.getImageData(0, 0, size, size).data;
- ctx.fillStyle = "red";
- ctx.fillRect(0, 0, size, size);
- var node = document2.createElement("div");
- node.style.backgroundImage = "url(" + greenImageSrc + ")";
- node.style.height = size + "px";
- return isGreenPixel(data) ? loadSerializedSVG(createForeignObjectSVG(size, size, 0, 0, node)) : Promise.reject(false);
- }).then(function(img2) {
- ctx.drawImage(img2, 0, 0);
- return isGreenPixel(ctx.getImageData(0, 0, size, size).data);
- }).catch(function() {
- return false;
- });
- };
- var createForeignObjectSVG = function(width, height, x, y, node) {
- var xmlns = "http://www.w3.org/2000/svg";
- var svg = document.createElementNS(xmlns, "svg");
- var foreignObject = document.createElementNS(xmlns, "foreignObject");
- svg.setAttributeNS(null, "width", width.toString());
- svg.setAttributeNS(null, "height", height.toString());
- foreignObject.setAttributeNS(null, "width", "100%");
- foreignObject.setAttributeNS(null, "height", "100%");
- foreignObject.setAttributeNS(null, "x", x.toString());
- foreignObject.setAttributeNS(null, "y", y.toString());
- foreignObject.setAttributeNS(null, "externalResourcesRequired", "true");
- svg.appendChild(foreignObject);
- foreignObject.appendChild(node);
- return svg;
- };
- var loadSerializedSVG = function(svg) {
- return new Promise(function(resolve, reject) {
- var img = new Image();
- img.onload = function() {
- return resolve(img);
- };
- img.onerror = reject;
- img.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(new XMLSerializer().serializeToString(svg));
- });
- };
- var FEATURES = {
- get SUPPORT_RANGE_BOUNDS() {
- var value = testRangeBounds(document);
- Object.defineProperty(FEATURES, "SUPPORT_RANGE_BOUNDS", { value });
- return value;
- },
- get SUPPORT_SVG_DRAWING() {
- var value = testSVG(document);
- Object.defineProperty(FEATURES, "SUPPORT_SVG_DRAWING", { value });
- return value;
- },
- get SUPPORT_FOREIGNOBJECT_DRAWING() {
- var value = typeof Array.from === "function" && typeof window.fetch === "function" ? testForeignObject(document) : Promise.resolve(false);
- Object.defineProperty(FEATURES, "SUPPORT_FOREIGNOBJECT_DRAWING", { value });
- return value;
- },
- get SUPPORT_CORS_IMAGES() {
- var value = testCORS();
- Object.defineProperty(FEATURES, "SUPPORT_CORS_IMAGES", { value });
- return value;
- },
- get SUPPORT_RESPONSE_TYPE() {
- var value = testResponseType();
- Object.defineProperty(FEATURES, "SUPPORT_RESPONSE_TYPE", { value });
- return value;
- },
- get SUPPORT_CORS_XHR() {
- var value = "withCredentials" in new XMLHttpRequest();
- Object.defineProperty(FEATURES, "SUPPORT_CORS_XHR", { value });
- return value;
- }
- };
- var Logger = (
- /** @class */
- function() {
- function Logger2(id) {
- this.id = id;
- this.start = Date.now();
- }
- Logger2.prototype.debug = function() {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- if (typeof window !== "undefined" && window.console && typeof console.debug === "function") {
- console.debug.apply(console, [this.id, this.getTime() + "ms"].concat(args));
- } else {
- this.info.apply(this, args);
- }
- };
- Logger2.prototype.getTime = function() {
- return Date.now() - this.start;
- };
- Logger2.create = function(id) {
- Logger2.instances[id] = new Logger2(id);
- };
- Logger2.destroy = function(id) {
- delete Logger2.instances[id];
- };
- Logger2.getInstance = function(id) {
- var instance = Logger2.instances[id];
- if (typeof instance === "undefined") {
- throw new Error("No logger instance found with id " + id);
- }
- return instance;
- };
- Logger2.prototype.info = function() {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- if (typeof window !== "undefined" && window.console && typeof console.info === "function") {
- console.info.apply(console, [this.id, this.getTime() + "ms"].concat(args));
- }
- };
- Logger2.prototype.error = function() {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- if (typeof window !== "undefined" && window.console && typeof console.error === "function") {
- console.error.apply(console, [this.id, this.getTime() + "ms"].concat(args));
- } else {
- this.info.apply(this, args);
- }
- };
- Logger2.instances = {};
- return Logger2;
- }()
- );
- var CacheStorage = (
- /** @class */
- function() {
- function CacheStorage2() {
- }
- CacheStorage2.create = function(name, options) {
- return CacheStorage2._caches[name] = new Cache(name, options);
- };
- CacheStorage2.destroy = function(name) {
- delete CacheStorage2._caches[name];
- };
- CacheStorage2.open = function(name) {
- var cache = CacheStorage2._caches[name];
- if (typeof cache !== "undefined") {
- return cache;
- }
- throw new Error('Cache with key "' + name + '" not found');
- };
- CacheStorage2.getOrigin = function(url) {
- var link = CacheStorage2._link;
- if (!link) {
- return "about:blank";
- }
- link.href = url;
- link.href = link.href;
- return link.protocol + link.hostname + link.port;
- };
- CacheStorage2.isSameOrigin = function(src) {
- return CacheStorage2.getOrigin(src) === CacheStorage2._origin;
- };
- CacheStorage2.setContext = function(window2) {
- CacheStorage2._link = window2.document.createElement("a");
- CacheStorage2._origin = CacheStorage2.getOrigin(window2.location.href);
- };
- CacheStorage2.getInstance = function() {
- var current = CacheStorage2._current;
- if (current === null) {
- throw new Error("No cache instance attached");
- }
- return current;
- };
- CacheStorage2.attachInstance = function(cache) {
- CacheStorage2._current = cache;
- };
- CacheStorage2.detachInstance = function() {
- CacheStorage2._current = null;
- };
- CacheStorage2._caches = {};
- CacheStorage2._origin = "about:blank";
- CacheStorage2._current = null;
- return CacheStorage2;
- }()
- );
- var Cache = (
- /** @class */
- function() {
- function Cache2(id, options) {
- this.id = id;
- this._options = options;
- this._cache = {};
- }
- Cache2.prototype.addImage = function(src) {
- var result = Promise.resolve();
- if (this.has(src)) {
- return result;
- }
- if (isBlobImage(src) || isRenderable(src)) {
- this._cache[src] = this.loadImage(src);
- return result;
- }
- return result;
- };
- Cache2.prototype.match = function(src) {
- return this._cache[src];
- };
- Cache2.prototype.loadImage = function(key) {
- return __awaiter(this, void 0, void 0, function() {
- var isSameOrigin, useCORS, useProxy, src;
- var _this2 = this;
- return __generator(this, function(_a) {
- switch (_a.label) {
- case 0:
- isSameOrigin = CacheStorage.isSameOrigin(key);
- useCORS = !isInlineImage(key) && this._options.useCORS === true && FEATURES.SUPPORT_CORS_IMAGES && !isSameOrigin;
- useProxy = !isInlineImage(key) && !isSameOrigin && typeof this._options.proxy === "string" && FEATURES.SUPPORT_CORS_XHR && !useCORS;
- if (!isSameOrigin && this._options.allowTaint === false && !isInlineImage(key) && !useProxy && !useCORS) {
- return [
- 2
- /*return*/
- ];
- }
- src = key;
- if (!useProxy)
- return [3, 2];
- return [4, this.proxy(src)];
- case 1:
- src = _a.sent();
- _a.label = 2;
- case 2:
- Logger.getInstance(this.id).debug("Added image " + key.substring(0, 256));
- return [4, new Promise(function(resolve, reject) {
- var img = new Image();
- img.onload = function() {
- return resolve(img);
- };
- img.onerror = reject;
- if (isInlineBase64Image(src) || useCORS) {
- img.crossOrigin = "anonymous";
- }
- img.src = src;
- if (img.complete === true) {
- setTimeout(function() {
- return resolve(img);
- }, 500);
- }
- if (_this2._options.imageTimeout > 0) {
- setTimeout(function() {
- return reject("Timed out (" + _this2._options.imageTimeout + "ms) loading image");
- }, _this2._options.imageTimeout);
- }
- })];
- case 3:
- return [2, _a.sent()];
- }
- });
- });
- };
- Cache2.prototype.has = function(key) {
- return typeof this._cache[key] !== "undefined";
- };
- Cache2.prototype.keys = function() {
- return Promise.resolve(Object.keys(this._cache));
- };
- Cache2.prototype.proxy = function(src) {
- var _this2 = this;
- var proxy = this._options.proxy;
- if (!proxy) {
- throw new Error("No proxy defined");
- }
- var key = src.substring(0, 256);
- return new Promise(function(resolve, reject) {
- var responseType = FEATURES.SUPPORT_RESPONSE_TYPE ? "blob" : "text";
- var xhr = new XMLHttpRequest();
- xhr.onload = function() {
- if (xhr.status === 200) {
- if (responseType === "text") {
- resolve(xhr.response);
- } else {
- var reader_1 = new FileReader();
- reader_1.addEventListener("load", function() {
- return resolve(reader_1.result);
- }, false);
- reader_1.addEventListener("error", function(e2) {
- return reject(e2);
- }, false);
- reader_1.readAsDataURL(xhr.response);
- }
- } else {
- reject("Failed to proxy resource " + key + " with status code " + xhr.status);
- }
- };
- xhr.onerror = reject;
- xhr.open("GET", proxy + "?url=" + encodeURIComponent(src) + "&responseType=" + responseType);
- if (responseType !== "text" && xhr instanceof XMLHttpRequest) {
- xhr.responseType = responseType;
- }
- if (_this2._options.imageTimeout) {
- var timeout_1 = _this2._options.imageTimeout;
- xhr.timeout = timeout_1;
- xhr.ontimeout = function() {
- return reject("Timed out (" + timeout_1 + "ms) proxying " + key);
- };
- }
- xhr.send();
- });
- };
- return Cache2;
- }()
- );
- var INLINE_SVG = /^data:image\/svg\+xml/i;
- var INLINE_BASE64 = /^data:image\/.*;base64,/i;
- var INLINE_IMG = /^data:image\/.*/i;
- var isRenderable = function(src) {
- return FEATURES.SUPPORT_SVG_DRAWING || !isSVG(src);
- };
- var isInlineImage = function(src) {
- return INLINE_IMG.test(src);
- };
- var isInlineBase64Image = function(src) {
- return INLINE_BASE64.test(src);
- };
- var isBlobImage = function(src) {
- return src.substr(0, 4) === "blob";
- };
- var isSVG = function(src) {
- return src.substr(-3).toLowerCase() === "svg" || INLINE_SVG.test(src);
- };
- var webkitGradient = function(tokens) {
- var angle2 = deg(180);
- var stops = [];
- var type = CSSImageType.LINEAR_GRADIENT;
- var shape = CSSRadialShape.CIRCLE;
- var size = CSSRadialExtent.FARTHEST_CORNER;
- var position2 = [];
- parseFunctionArgs(tokens).forEach(function(arg, i) {
- var firstToken = arg[0];
- if (i === 0) {
- if (isIdentToken(firstToken) && firstToken.value === "linear") {
- type = CSSImageType.LINEAR_GRADIENT;
- return;
- } else if (isIdentToken(firstToken) && firstToken.value === "radial") {
- type = CSSImageType.RADIAL_GRADIENT;
- return;
- }
- }
- if (firstToken.type === TokenType.FUNCTION) {
- if (firstToken.name === "from") {
- var color$12 = color.parse(firstToken.values[0]);
- stops.push({ stop: ZERO_LENGTH, color: color$12 });
- } else if (firstToken.name === "to") {
- var color$12 = color.parse(firstToken.values[0]);
- stops.push({ stop: HUNDRED_PERCENT, color: color$12 });
- } else if (firstToken.name === "color-stop") {
- var values = firstToken.values.filter(nonFunctionArgSeparator);
- if (values.length === 2) {
- var color$12 = color.parse(values[1]);
- var stop_1 = values[0];
- if (isNumberToken(stop_1)) {
- stops.push({
- stop: { type: TokenType.PERCENTAGE_TOKEN, number: stop_1.number * 100, flags: stop_1.flags },
- color: color$12
- });
- }
- }
- }
- }
- });
- return type === CSSImageType.LINEAR_GRADIENT ? {
- angle: (angle2 + deg(180)) % deg(360),
- stops,
- type
- } : { size, shape, stops, position: position2, type };
- };
- var CLOSEST_SIDE = "closest-side";
- var FARTHEST_SIDE = "farthest-side";
- var CLOSEST_CORNER = "closest-corner";
- var FARTHEST_CORNER = "farthest-corner";
- var CIRCLE = "circle";
- var ELLIPSE = "ellipse";
- var COVER = "cover";
- var CONTAIN = "contain";
- var radialGradient = function(tokens) {
- var shape = CSSRadialShape.CIRCLE;
- var size = CSSRadialExtent.FARTHEST_CORNER;
- var stops = [];
- var position2 = [];
- parseFunctionArgs(tokens).forEach(function(arg, i) {
- var isColorStop = true;
- if (i === 0) {
- var isAtPosition_1 = false;
- isColorStop = arg.reduce(function(acc, token) {
- if (isAtPosition_1) {
- if (isIdentToken(token)) {
- switch (token.value) {
- case "center":
- position2.push(FIFTY_PERCENT);
- return acc;
- case "top":
- case "left":
- position2.push(ZERO_LENGTH);
- return acc;
- case "right":
- case "bottom":
- position2.push(HUNDRED_PERCENT);
- return acc;
- }
- } else if (isLengthPercentage(token) || isLength(token)) {
- position2.push(token);
- }
- } else if (isIdentToken(token)) {
- switch (token.value) {
- case CIRCLE:
- shape = CSSRadialShape.CIRCLE;
- return false;
- case ELLIPSE:
- shape = CSSRadialShape.ELLIPSE;
- return false;
- case "at":
- isAtPosition_1 = true;
- return false;
- case CLOSEST_SIDE:
- size = CSSRadialExtent.CLOSEST_SIDE;
- return false;
- case COVER:
- case FARTHEST_SIDE:
- size = CSSRadialExtent.FARTHEST_SIDE;
- return false;
- case CONTAIN:
- case CLOSEST_CORNER:
- size = CSSRadialExtent.CLOSEST_CORNER;
- return false;
- case FARTHEST_CORNER:
- size = CSSRadialExtent.FARTHEST_CORNER;
- return false;
- }
- } else if (isLength(token) || isLengthPercentage(token)) {
- if (!Array.isArray(size)) {
- size = [];
- }
- size.push(token);
- return false;
- }
- return acc;
- }, isColorStop);
- }
- if (isColorStop) {
- var colorStop = parseColorStop(arg);
- stops.push(colorStop);
- }
- });
- return { size, shape, stops, position: position2, type: CSSImageType.RADIAL_GRADIENT };
- };
- var prefixRadialGradient = function(tokens) {
- var shape = CSSRadialShape.CIRCLE;
- var size = CSSRadialExtent.FARTHEST_CORNER;
- var stops = [];
- var position2 = [];
- parseFunctionArgs(tokens).forEach(function(arg, i) {
- var isColorStop = true;
- if (i === 0) {
- isColorStop = arg.reduce(function(acc, token) {
- if (isIdentToken(token)) {
- switch (token.value) {
- case "center":
- position2.push(FIFTY_PERCENT);
- return false;
- case "top":
- case "left":
- position2.push(ZERO_LENGTH);
- return false;
- case "right":
- case "bottom":
- position2.push(HUNDRED_PERCENT);
- return false;
- }
- } else if (isLengthPercentage(token) || isLength(token)) {
- position2.push(token);
- return false;
- }
- return acc;
- }, isColorStop);
- } else if (i === 1) {
- isColorStop = arg.reduce(function(acc, token) {
- if (isIdentToken(token)) {
- switch (token.value) {
- case CIRCLE:
- shape = CSSRadialShape.CIRCLE;
- return false;
- case ELLIPSE:
- shape = CSSRadialShape.ELLIPSE;
- return false;
- case CONTAIN:
- case CLOSEST_SIDE:
- size = CSSRadialExtent.CLOSEST_SIDE;
- return false;
- case FARTHEST_SIDE:
- size = CSSRadialExtent.FARTHEST_SIDE;
- return false;
- case CLOSEST_CORNER:
- size = CSSRadialExtent.CLOSEST_CORNER;
- return false;
- case COVER:
- case FARTHEST_CORNER:
- size = CSSRadialExtent.FARTHEST_CORNER;
- return false;
- }
- } else if (isLength(token) || isLengthPercentage(token)) {
- if (!Array.isArray(size)) {
- size = [];
- }
- size.push(token);
- return false;
- }
- return acc;
- }, isColorStop);
- }
- if (isColorStop) {
- var colorStop = parseColorStop(arg);
- stops.push(colorStop);
- }
- });
- return { size, shape, stops, position: position2, type: CSSImageType.RADIAL_GRADIENT };
- };
- var CSSImageType;
- (function(CSSImageType2) {
- CSSImageType2[CSSImageType2["URL"] = 0] = "URL";
- CSSImageType2[CSSImageType2["LINEAR_GRADIENT"] = 1] = "LINEAR_GRADIENT";
- CSSImageType2[CSSImageType2["RADIAL_GRADIENT"] = 2] = "RADIAL_GRADIENT";
- })(CSSImageType || (CSSImageType = {}));
- var isLinearGradient = function(background) {
- return background.type === CSSImageType.LINEAR_GRADIENT;
- };
- var isRadialGradient = function(background) {
- return background.type === CSSImageType.RADIAL_GRADIENT;
- };
- var CSSRadialShape;
- (function(CSSRadialShape2) {
- CSSRadialShape2[CSSRadialShape2["CIRCLE"] = 0] = "CIRCLE";
- CSSRadialShape2[CSSRadialShape2["ELLIPSE"] = 1] = "ELLIPSE";
- })(CSSRadialShape || (CSSRadialShape = {}));
- var CSSRadialExtent;
- (function(CSSRadialExtent2) {
- CSSRadialExtent2[CSSRadialExtent2["CLOSEST_SIDE"] = 0] = "CLOSEST_SIDE";
- CSSRadialExtent2[CSSRadialExtent2["FARTHEST_SIDE"] = 1] = "FARTHEST_SIDE";
- CSSRadialExtent2[CSSRadialExtent2["CLOSEST_CORNER"] = 2] = "CLOSEST_CORNER";
- CSSRadialExtent2[CSSRadialExtent2["FARTHEST_CORNER"] = 3] = "FARTHEST_CORNER";
- })(CSSRadialExtent || (CSSRadialExtent = {}));
- var image = {
- name: "image",
- parse: function(value) {
- if (value.type === TokenType.URL_TOKEN) {
- var image_1 = { url: value.value, type: CSSImageType.URL };
- CacheStorage.getInstance().addImage(value.value);
- return image_1;
- }
- if (value.type === TokenType.FUNCTION) {
- var imageFunction = SUPPORTED_IMAGE_FUNCTIONS[value.name];
- if (typeof imageFunction === "undefined") {
- throw new Error('Attempting to parse an unsupported image function "' + value.name + '"');
- }
- return imageFunction(value.values);
- }
- throw new Error("Unsupported image type");
- }
- };
- function isSupportedImage(value) {
- return value.type !== TokenType.FUNCTION || SUPPORTED_IMAGE_FUNCTIONS[value.name];
- }
- var SUPPORTED_IMAGE_FUNCTIONS = {
- "linear-gradient": linearGradient,
- "-moz-linear-gradient": prefixLinearGradient,
- "-ms-linear-gradient": prefixLinearGradient,
- "-o-linear-gradient": prefixLinearGradient,
- "-webkit-linear-gradient": prefixLinearGradient,
- "radial-gradient": radialGradient,
- "-moz-radial-gradient": prefixRadialGradient,
- "-ms-radial-gradient": prefixRadialGradient,
- "-o-radial-gradient": prefixRadialGradient,
- "-webkit-radial-gradient": prefixRadialGradient,
- "-webkit-gradient": webkitGradient
- };
- var backgroundImage = {
- name: "background-image",
- initialValue: "none",
- type: PropertyDescriptorParsingType.LIST,
- prefix: false,
- parse: function(tokens) {
- if (tokens.length === 0) {
- return [];
- }
- var first = tokens[0];
- if (first.type === TokenType.IDENT_TOKEN && first.value === "none") {
- return [];
- }
- return tokens.filter(function(value) {
- return nonFunctionArgSeparator(value) && isSupportedImage(value);
- }).map(image.parse);
- }
- };
- var backgroundOrigin = {
- name: "background-origin",
- initialValue: "border-box",
- prefix: false,
- type: PropertyDescriptorParsingType.LIST,
- parse: function(tokens) {
- return tokens.map(function(token) {
- if (isIdentToken(token)) {
- switch (token.value) {
- case "padding-box":
- return 1;
- case "content-box":
- return 2;
- }
- }
- return 0;
- });
- }
- };
- var backgroundPosition = {
- name: "background-position",
- initialValue: "0% 0%",
- type: PropertyDescriptorParsingType.LIST,
- prefix: false,
- parse: function(tokens) {
- return parseFunctionArgs(tokens).map(function(values) {
- return values.filter(isLengthPercentage);
- }).map(parseLengthPercentageTuple);
- }
- };
- var BACKGROUND_REPEAT;
- (function(BACKGROUND_REPEAT2) {
- BACKGROUND_REPEAT2[BACKGROUND_REPEAT2["REPEAT"] = 0] = "REPEAT";
- BACKGROUND_REPEAT2[BACKGROUND_REPEAT2["NO_REPEAT"] = 1] = "NO_REPEAT";
- BACKGROUND_REPEAT2[BACKGROUND_REPEAT2["REPEAT_X"] = 2] = "REPEAT_X";
- BACKGROUND_REPEAT2[BACKGROUND_REPEAT2["REPEAT_Y"] = 3] = "REPEAT_Y";
- })(BACKGROUND_REPEAT || (BACKGROUND_REPEAT = {}));
- var backgroundRepeat = {
- name: "background-repeat",
- initialValue: "repeat",
- prefix: false,
- type: PropertyDescriptorParsingType.LIST,
- parse: function(tokens) {
- return parseFunctionArgs(tokens).map(function(values) {
- return values.filter(isIdentToken).map(function(token) {
- return token.value;
- }).join(" ");
- }).map(parseBackgroundRepeat);
- }
- };
- var parseBackgroundRepeat = function(value) {
- switch (value) {
- case "no-repeat":
- return BACKGROUND_REPEAT.NO_REPEAT;
- case "repeat-x":
- case "repeat no-repeat":
- return BACKGROUND_REPEAT.REPEAT_X;
- case "repeat-y":
- case "no-repeat repeat":
- return BACKGROUND_REPEAT.REPEAT_Y;
- case "repeat":
- default:
- return BACKGROUND_REPEAT.REPEAT;
- }
- };
- var BACKGROUND_SIZE;
- (function(BACKGROUND_SIZE2) {
- BACKGROUND_SIZE2["AUTO"] = "auto";
- BACKGROUND_SIZE2["CONTAIN"] = "contain";
- BACKGROUND_SIZE2["COVER"] = "cover";
- })(BACKGROUND_SIZE || (BACKGROUND_SIZE = {}));
- var backgroundSize = {
- name: "background-size",
- initialValue: "0",
- prefix: false,
- type: PropertyDescriptorParsingType.LIST,
- parse: function(tokens) {
- return parseFunctionArgs(tokens).map(function(values) {
- return values.filter(isBackgroundSizeInfoToken);
- });
- }
- };
- var isBackgroundSizeInfoToken = function(value) {
- return isIdentToken(value) || isLengthPercentage(value);
- };
- var borderColorForSide = function(side) {
- return {
- name: "border-" + side + "-color",
- initialValue: "transparent",
- prefix: false,
- type: PropertyDescriptorParsingType.TYPE_VALUE,
- format: "color"
- };
- };
- var borderTopColor = borderColorForSide("top");
- var borderRightColor = borderColorForSide("right");
- var borderBottomColor = borderColorForSide("bottom");
- var borderLeftColor = borderColorForSide("left");
- var borderRadiusForSide = function(side) {
- return {
- name: "border-radius-" + side,
- initialValue: "0 0",
- prefix: false,
- type: PropertyDescriptorParsingType.LIST,
- parse: function(tokens) {
- return parseLengthPercentageTuple(tokens.filter(isLengthPercentage));
- }
- };
- };
- var borderTopLeftRadius = borderRadiusForSide("top-left");
- var borderTopRightRadius = borderRadiusForSide("top-right");
- var borderBottomRightRadius = borderRadiusForSide("bottom-right");
- var borderBottomLeftRadius = borderRadiusForSide("bottom-left");
- var BORDER_STYLE;
- (function(BORDER_STYLE2) {
- BORDER_STYLE2[BORDER_STYLE2["NONE"] = 0] = "NONE";
- BORDER_STYLE2[BORDER_STYLE2["SOLID"] = 1] = "SOLID";
- })(BORDER_STYLE || (BORDER_STYLE = {}));
- var borderStyleForSide = function(side) {
- return {
- name: "border-" + side + "-style",
- initialValue: "solid",
- prefix: false,
- type: PropertyDescriptorParsingType.IDENT_VALUE,
- parse: function(style) {
- switch (style) {
- case "none":
- return BORDER_STYLE.NONE;
- }
- return BORDER_STYLE.SOLID;
- }
- };
- };
- var borderTopStyle = borderStyleForSide("top");
- var borderRightStyle = borderStyleForSide("right");
- var borderBottomStyle = borderStyleForSide("bottom");
- var borderLeftStyle = borderStyleForSide("left");
- var borderWidthForSide = function(side) {
- return {
- name: "border-" + side + "-width",
- initialValue: "0",
- type: PropertyDescriptorParsingType.VALUE,
- prefix: false,
- parse: function(token) {
- if (isDimensionToken(token)) {
- return token.number;
- }
- return 0;
- }
- };
- };
- var borderTopWidth = borderWidthForSide("top");
- var borderRightWidth = borderWidthForSide("right");
- var borderBottomWidth = borderWidthForSide("bottom");
- var borderLeftWidth = borderWidthForSide("left");
- var color$1 = {
- name: "color",
- initialValue: "transparent",
- prefix: false,
- type: PropertyDescriptorParsingType.TYPE_VALUE,
- format: "color"
- };
- var display = {
- name: "display",
- initialValue: "inline-block",
- prefix: false,
- type: PropertyDescriptorParsingType.LIST,
- parse: function(tokens) {
- return tokens.filter(isIdentToken).reduce(
- function(bit, token) {
- return bit | parseDisplayValue(token.value);
- },
- 0
- /* NONE */
- );
- }
- };
- var parseDisplayValue = function(display2) {
- switch (display2) {
- case "block":
- return 2;
- case "inline":
- return 4;
- case "run-in":
- return 8;
- case "flow":
- return 16;
- case "flow-root":
- return 32;
- case "table":
- return 64;
- case "flex":
- case "-webkit-flex":
- return 128;
- case "grid":
- case "-ms-grid":
- return 256;
- case "ruby":
- return 512;
- case "subgrid":
- return 1024;
- case "list-item":
- return 2048;
- case "table-row-group":
- return 4096;
- case "table-header-group":
- return 8192;
- case "table-footer-group":
- return 16384;
- case "table-row":
- return 32768;
- case "table-cell":
- return 65536;
- case "table-column-group":
- return 131072;
- case "table-column":
- return 262144;
- case "table-caption":
- return 524288;
- case "ruby-base":
- return 1048576;
- case "ruby-text":
- return 2097152;
- case "ruby-base-container":
- return 4194304;
- case "ruby-text-container":
- return 8388608;
- case "contents":
- return 16777216;
- case "inline-block":
- return 33554432;
- case "inline-list-item":
- return 67108864;
- case "inline-table":
- return 134217728;
- case "inline-flex":
- return 268435456;
- case "inline-grid":
- return 536870912;
- }
- return 0;
- };
- var FLOAT;
- (function(FLOAT2) {
- FLOAT2[FLOAT2["NONE"] = 0] = "NONE";
- FLOAT2[FLOAT2["LEFT"] = 1] = "LEFT";
- FLOAT2[FLOAT2["RIGHT"] = 2] = "RIGHT";
- FLOAT2[FLOAT2["INLINE_START"] = 3] = "INLINE_START";
- FLOAT2[FLOAT2["INLINE_END"] = 4] = "INLINE_END";
- })(FLOAT || (FLOAT = {}));
- var float = {
- name: "float",
- initialValue: "none",
- prefix: false,
- type: PropertyDescriptorParsingType.IDENT_VALUE,
- parse: function(float2) {
- switch (float2) {
- case "left":
- return FLOAT.LEFT;
- case "right":
- return FLOAT.RIGHT;
- case "inline-start":
- return FLOAT.INLINE_START;
- case "inline-end":
- return FLOAT.INLINE_END;
- }
- return FLOAT.NONE;
- }
- };
- var letterSpacing = {
- name: "letter-spacing",
- initialValue: "0",
- prefix: false,
- type: PropertyDescriptorParsingType.VALUE,
- parse: function(token) {
- if (token.type === TokenType.IDENT_TOKEN && token.value === "normal") {
- return 0;
- }
- if (token.type === TokenType.NUMBER_TOKEN) {
- return token.number;
- }
- if (token.type === TokenType.DIMENSION_TOKEN) {
- return token.number;
- }
- return 0;
- }
- };
- var LINE_BREAK;
- (function(LINE_BREAK2) {
- LINE_BREAK2["NORMAL"] = "normal";
- LINE_BREAK2["STRICT"] = "strict";
- })(LINE_BREAK || (LINE_BREAK = {}));
- var lineBreak = {
- name: "line-break",
- initialValue: "normal",
- prefix: false,
- type: PropertyDescriptorParsingType.IDENT_VALUE,
- parse: function(lineBreak2) {
- switch (lineBreak2) {
- case "strict":
- return LINE_BREAK.STRICT;
- case "normal":
- default:
- return LINE_BREAK.NORMAL;
- }
- }
- };
- var lineHeight = {
- name: "line-height",
- initialValue: "normal",
- prefix: false,
- type: PropertyDescriptorParsingType.TOKEN_VALUE
- };
- var computeLineHeight = function(token, fontSize2) {
- if (isIdentToken(token) && token.value === "normal") {
- return 1.2 * fontSize2;
- } else if (token.type === TokenType.NUMBER_TOKEN) {
- return fontSize2 * token.number;
- } else if (isLengthPercentage(token)) {
- return getAbsoluteValue(token, fontSize2);
- }
- return fontSize2;
- };
- var listStyleImage = {
- name: "list-style-image",
- initialValue: "none",
- type: PropertyDescriptorParsingType.VALUE,
- prefix: false,
- parse: function(token) {
- if (token.type === TokenType.IDENT_TOKEN && token.value === "none") {
- return null;
- }
- return image.parse(token);
- }
- };
- var LIST_STYLE_POSITION;
- (function(LIST_STYLE_POSITION2) {
- LIST_STYLE_POSITION2[LIST_STYLE_POSITION2["INSIDE"] = 0] = "INSIDE";
- LIST_STYLE_POSITION2[LIST_STYLE_POSITION2["OUTSIDE"] = 1] = "OUTSIDE";
- })(LIST_STYLE_POSITION || (LIST_STYLE_POSITION = {}));
- var listStylePosition = {
- name: "list-style-position",
- initialValue: "outside",
- prefix: false,
- type: PropertyDescriptorParsingType.IDENT_VALUE,
- parse: function(position2) {
- switch (position2) {
- case "inside":
- return LIST_STYLE_POSITION.INSIDE;
- case "outside":
- default:
- return LIST_STYLE_POSITION.OUTSIDE;
- }
- }
- };
- var LIST_STYLE_TYPE;
- (function(LIST_STYLE_TYPE2) {
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["NONE"] = -1] = "NONE";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["DISC"] = 0] = "DISC";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["CIRCLE"] = 1] = "CIRCLE";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["SQUARE"] = 2] = "SQUARE";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["DECIMAL"] = 3] = "DECIMAL";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["CJK_DECIMAL"] = 4] = "CJK_DECIMAL";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["DECIMAL_LEADING_ZERO"] = 5] = "DECIMAL_LEADING_ZERO";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["LOWER_ROMAN"] = 6] = "LOWER_ROMAN";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["UPPER_ROMAN"] = 7] = "UPPER_ROMAN";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["LOWER_GREEK"] = 8] = "LOWER_GREEK";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["LOWER_ALPHA"] = 9] = "LOWER_ALPHA";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["UPPER_ALPHA"] = 10] = "UPPER_ALPHA";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["ARABIC_INDIC"] = 11] = "ARABIC_INDIC";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["ARMENIAN"] = 12] = "ARMENIAN";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["BENGALI"] = 13] = "BENGALI";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["CAMBODIAN"] = 14] = "CAMBODIAN";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["CJK_EARTHLY_BRANCH"] = 15] = "CJK_EARTHLY_BRANCH";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["CJK_HEAVENLY_STEM"] = 16] = "CJK_HEAVENLY_STEM";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["CJK_IDEOGRAPHIC"] = 17] = "CJK_IDEOGRAPHIC";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["DEVANAGARI"] = 18] = "DEVANAGARI";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["ETHIOPIC_NUMERIC"] = 19] = "ETHIOPIC_NUMERIC";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["GEORGIAN"] = 20] = "GEORGIAN";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["GUJARATI"] = 21] = "GUJARATI";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["GURMUKHI"] = 22] = "GURMUKHI";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["HEBREW"] = 22] = "HEBREW";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["HIRAGANA"] = 23] = "HIRAGANA";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["HIRAGANA_IROHA"] = 24] = "HIRAGANA_IROHA";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["JAPANESE_FORMAL"] = 25] = "JAPANESE_FORMAL";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["JAPANESE_INFORMAL"] = 26] = "JAPANESE_INFORMAL";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["KANNADA"] = 27] = "KANNADA";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["KATAKANA"] = 28] = "KATAKANA";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["KATAKANA_IROHA"] = 29] = "KATAKANA_IROHA";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["KHMER"] = 30] = "KHMER";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["KOREAN_HANGUL_FORMAL"] = 31] = "KOREAN_HANGUL_FORMAL";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["KOREAN_HANJA_FORMAL"] = 32] = "KOREAN_HANJA_FORMAL";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["KOREAN_HANJA_INFORMAL"] = 33] = "KOREAN_HANJA_INFORMAL";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["LAO"] = 34] = "LAO";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["LOWER_ARMENIAN"] = 35] = "LOWER_ARMENIAN";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["MALAYALAM"] = 36] = "MALAYALAM";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["MONGOLIAN"] = 37] = "MONGOLIAN";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["MYANMAR"] = 38] = "MYANMAR";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["ORIYA"] = 39] = "ORIYA";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["PERSIAN"] = 40] = "PERSIAN";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["SIMP_CHINESE_FORMAL"] = 41] = "SIMP_CHINESE_FORMAL";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["SIMP_CHINESE_INFORMAL"] = 42] = "SIMP_CHINESE_INFORMAL";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["TAMIL"] = 43] = "TAMIL";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["TELUGU"] = 44] = "TELUGU";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["THAI"] = 45] = "THAI";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["TIBETAN"] = 46] = "TIBETAN";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["TRAD_CHINESE_FORMAL"] = 47] = "TRAD_CHINESE_FORMAL";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["TRAD_CHINESE_INFORMAL"] = 48] = "TRAD_CHINESE_INFORMAL";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["UPPER_ARMENIAN"] = 49] = "UPPER_ARMENIAN";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["DISCLOSURE_OPEN"] = 50] = "DISCLOSURE_OPEN";
- LIST_STYLE_TYPE2[LIST_STYLE_TYPE2["DISCLOSURE_CLOSED"] = 51] = "DISCLOSURE_CLOSED";
- })(LIST_STYLE_TYPE || (LIST_STYLE_TYPE = {}));
- var listStyleType = {
- name: "list-style-type",
- initialValue: "none",
- prefix: false,
- type: PropertyDescriptorParsingType.IDENT_VALUE,
- parse: function(type) {
- switch (type) {
- case "disc":
- return LIST_STYLE_TYPE.DISC;
- case "circle":
- return LIST_STYLE_TYPE.CIRCLE;
- case "square":
- return LIST_STYLE_TYPE.SQUARE;
- case "decimal":
- return LIST_STYLE_TYPE.DECIMAL;
- case "cjk-decimal":
- return LIST_STYLE_TYPE.CJK_DECIMAL;
- case "decimal-leading-zero":
- return LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO;
- case "lower-roman":
- return LIST_STYLE_TYPE.LOWER_ROMAN;
- case "upper-roman":
- return LIST_STYLE_TYPE.UPPER_ROMAN;
- case "lower-greek":
- return LIST_STYLE_TYPE.LOWER_GREEK;
- case "lower-alpha":
- return LIST_STYLE_TYPE.LOWER_ALPHA;
- case "upper-alpha":
- return LIST_STYLE_TYPE.UPPER_ALPHA;
- case "arabic-indic":
- return LIST_STYLE_TYPE.ARABIC_INDIC;
- case "armenian":
- return LIST_STYLE_TYPE.ARMENIAN;
- case "bengali":
- return LIST_STYLE_TYPE.BENGALI;
- case "cambodian":
- return LIST_STYLE_TYPE.CAMBODIAN;
- case "cjk-earthly-branch":
- return LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH;
- case "cjk-heavenly-stem":
- return LIST_STYLE_TYPE.CJK_HEAVENLY_STEM;
- case "cjk-ideographic":
- return LIST_STYLE_TYPE.CJK_IDEOGRAPHIC;
- case "devanagari":
- return LIST_STYLE_TYPE.DEVANAGARI;
- case "ethiopic-numeric":
- return LIST_STYLE_TYPE.ETHIOPIC_NUMERIC;
- case "georgian":
- return LIST_STYLE_TYPE.GEORGIAN;
- case "gujarati":
- return LIST_STYLE_TYPE.GUJARATI;
- case "gurmukhi":
- return LIST_STYLE_TYPE.GURMUKHI;
- case "hebrew":
- return LIST_STYLE_TYPE.HEBREW;
- case "hiragana":
- return LIST_STYLE_TYPE.HIRAGANA;
- case "hiragana-iroha":
- return LIST_STYLE_TYPE.HIRAGANA_IROHA;
- case "japanese-formal":
- return LIST_STYLE_TYPE.JAPANESE_FORMAL;
- case "japanese-informal":
- return LIST_STYLE_TYPE.JAPANESE_INFORMAL;
- case "kannada":
- return LIST_STYLE_TYPE.KANNADA;
- case "katakana":
- return LIST_STYLE_TYPE.KATAKANA;
- case "katakana-iroha":
- return LIST_STYLE_TYPE.KATAKANA_IROHA;
- case "khmer":
- return LIST_STYLE_TYPE.KHMER;
- case "korean-hangul-formal":
- return LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL;
- case "korean-hanja-formal":
- return LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL;
- case "korean-hanja-informal":
- return LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL;
- case "lao":
- return LIST_STYLE_TYPE.LAO;
- case "lower-armenian":
- return LIST_STYLE_TYPE.LOWER_ARMENIAN;
- case "malayalam":
- return LIST_STYLE_TYPE.MALAYALAM;
- case "mongolian":
- return LIST_STYLE_TYPE.MONGOLIAN;
- case "myanmar":
- return LIST_STYLE_TYPE.MYANMAR;
- case "oriya":
- return LIST_STYLE_TYPE.ORIYA;
- case "persian":
- return LIST_STYLE_TYPE.PERSIAN;
- case "simp-chinese-formal":
- return LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL;
- case "simp-chinese-informal":
- return LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL;
- case "tamil":
- return LIST_STYLE_TYPE.TAMIL;
- case "telugu":
- return LIST_STYLE_TYPE.TELUGU;
- case "thai":
- return LIST_STYLE_TYPE.THAI;
- case "tibetan":
- return LIST_STYLE_TYPE.TIBETAN;
- case "trad-chinese-formal":
- return LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL;
- case "trad-chinese-informal":
- return LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL;
- case "upper-armenian":
- return LIST_STYLE_TYPE.UPPER_ARMENIAN;
- case "disclosure-open":
- return LIST_STYLE_TYPE.DISCLOSURE_OPEN;
- case "disclosure-closed":
- return LIST_STYLE_TYPE.DISCLOSURE_CLOSED;
- case "none":
- default:
- return LIST_STYLE_TYPE.NONE;
- }
- }
- };
- var marginForSide = function(side) {
- return {
- name: "margin-" + side,
- initialValue: "0",
- prefix: false,
- type: PropertyDescriptorParsingType.TOKEN_VALUE
- };
- };
- var marginTop = marginForSide("top");
- var marginRight = marginForSide("right");
- var marginBottom = marginForSide("bottom");
- var marginLeft = marginForSide("left");
- var OVERFLOW;
- (function(OVERFLOW2) {
- OVERFLOW2[OVERFLOW2["VISIBLE"] = 0] = "VISIBLE";
- OVERFLOW2[OVERFLOW2["HIDDEN"] = 1] = "HIDDEN";
- OVERFLOW2[OVERFLOW2["SCROLL"] = 2] = "SCROLL";
- OVERFLOW2[OVERFLOW2["AUTO"] = 3] = "AUTO";
- })(OVERFLOW || (OVERFLOW = {}));
- var overflow = {
- name: "overflow",
- initialValue: "visible",
- prefix: false,
- type: PropertyDescriptorParsingType.LIST,
- parse: function(tokens) {
- return tokens.filter(isIdentToken).map(function(overflow2) {
- switch (overflow2.value) {
- case "hidden":
- return OVERFLOW.HIDDEN;
- case "scroll":
- return OVERFLOW.SCROLL;
- case "auto":
- return OVERFLOW.AUTO;
- case "visible":
- default:
- return OVERFLOW.VISIBLE;
- }
- });
- }
- };
- var OVERFLOW_WRAP;
- (function(OVERFLOW_WRAP2) {
- OVERFLOW_WRAP2["NORMAL"] = "normal";
- OVERFLOW_WRAP2["BREAK_WORD"] = "break-word";
- })(OVERFLOW_WRAP || (OVERFLOW_WRAP = {}));
- var overflowWrap = {
- name: "overflow-wrap",
- initialValue: "normal",
- prefix: false,
- type: PropertyDescriptorParsingType.IDENT_VALUE,
- parse: function(overflow2) {
- switch (overflow2) {
- case "break-word":
- return OVERFLOW_WRAP.BREAK_WORD;
- case "normal":
- default:
- return OVERFLOW_WRAP.NORMAL;
- }
- }
- };
- var paddingForSide = function(side) {
- return {
- name: "padding-" + side,
- initialValue: "0",
- prefix: false,
- type: PropertyDescriptorParsingType.TYPE_VALUE,
- format: "length-percentage"
- };
- };
- var paddingTop = paddingForSide("top");
- var paddingRight = paddingForSide("right");
- var paddingBottom = paddingForSide("bottom");
- var paddingLeft = paddingForSide("left");
- var TEXT_ALIGN;
- (function(TEXT_ALIGN2) {
- TEXT_ALIGN2[TEXT_ALIGN2["LEFT"] = 0] = "LEFT";
- TEXT_ALIGN2[TEXT_ALIGN2["CENTER"] = 1] = "CENTER";
- TEXT_ALIGN2[TEXT_ALIGN2["RIGHT"] = 2] = "RIGHT";
- })(TEXT_ALIGN || (TEXT_ALIGN = {}));
- var textAlign = {
- name: "text-align",
- initialValue: "left",
- prefix: false,
- type: PropertyDescriptorParsingType.IDENT_VALUE,
- parse: function(textAlign2) {
- switch (textAlign2) {
- case "right":
- return TEXT_ALIGN.RIGHT;
- case "center":
- case "justify":
- return TEXT_ALIGN.CENTER;
- case "left":
- default:
- return TEXT_ALIGN.LEFT;
- }
- }
- };
- var POSITION;
- (function(POSITION2) {
- POSITION2[POSITION2["STATIC"] = 0] = "STATIC";
- POSITION2[POSITION2["RELATIVE"] = 1] = "RELATIVE";
- POSITION2[POSITION2["ABSOLUTE"] = 2] = "ABSOLUTE";
- POSITION2[POSITION2["FIXED"] = 3] = "FIXED";
- POSITION2[POSITION2["STICKY"] = 4] = "STICKY";
- })(POSITION || (POSITION = {}));
- var position = {
- name: "position",
- initialValue: "static",
- prefix: false,
- type: PropertyDescriptorParsingType.IDENT_VALUE,
- parse: function(position2) {
- switch (position2) {
- case "relative":
- return POSITION.RELATIVE;
- case "absolute":
- return POSITION.ABSOLUTE;
- case "fixed":
- return POSITION.FIXED;
- case "sticky":
- return POSITION.STICKY;
- }
- return POSITION.STATIC;
- }
- };
- var textShadow = {
- name: "text-shadow",
- initialValue: "none",
- type: PropertyDescriptorParsingType.LIST,
- prefix: false,
- parse: function(tokens) {
- if (tokens.length === 1 && isIdentWithValue(tokens[0], "none")) {
- return [];
- }
- return parseFunctionArgs(tokens).map(function(values) {
- var shadow = {
- color: COLORS.TRANSPARENT,
- offsetX: ZERO_LENGTH,
- offsetY: ZERO_LENGTH,
- blur: ZERO_LENGTH
- };
- var c = 0;
- for (var i = 0; i < values.length; i++) {
- var token = values[i];
- if (isLength(token)) {
- if (c === 0) {
- shadow.offsetX = token;
- } else if (c === 1) {
- shadow.offsetY = token;
- } else {
- shadow.blur = token;
- }
- c++;
- } else {
- shadow.color = color.parse(token);
- }
- }
- return shadow;
- });
- }
- };
- var TEXT_TRANSFORM;
- (function(TEXT_TRANSFORM2) {
- TEXT_TRANSFORM2[TEXT_TRANSFORM2["NONE"] = 0] = "NONE";
- TEXT_TRANSFORM2[TEXT_TRANSFORM2["LOWERCASE"] = 1] = "LOWERCASE";
- TEXT_TRANSFORM2[TEXT_TRANSFORM2["UPPERCASE"] = 2] = "UPPERCASE";
- TEXT_TRANSFORM2[TEXT_TRANSFORM2["CAPITALIZE"] = 3] = "CAPITALIZE";
- })(TEXT_TRANSFORM || (TEXT_TRANSFORM = {}));
- var textTransform = {
- name: "text-transform",
- initialValue: "none",
- prefix: false,
- type: PropertyDescriptorParsingType.IDENT_VALUE,
- parse: function(textTransform2) {
- switch (textTransform2) {
- case "uppercase":
- return TEXT_TRANSFORM.UPPERCASE;
- case "lowercase":
- return TEXT_TRANSFORM.LOWERCASE;
- case "capitalize":
- return TEXT_TRANSFORM.CAPITALIZE;
- }
- return TEXT_TRANSFORM.NONE;
- }
- };
- var transform = {
- name: "transform",
- initialValue: "none",
- prefix: true,
- type: PropertyDescriptorParsingType.VALUE,
- parse: function(token) {
- if (token.type === TokenType.IDENT_TOKEN && token.value === "none") {
- return null;
- }
- if (token.type === TokenType.FUNCTION) {
- var transformFunction = SUPPORTED_TRANSFORM_FUNCTIONS[token.name];
- if (typeof transformFunction === "undefined") {
- throw new Error('Attempting to parse an unsupported transform function "' + token.name + '"');
- }
- return transformFunction(token.values);
- }
- return null;
- }
- };
- var matrix = function(args) {
- var values = args.filter(function(arg) {
- return arg.type === TokenType.NUMBER_TOKEN;
- }).map(function(arg) {
- return arg.number;
- });
- return values.length === 6 ? values : null;
- };
- var matrix3d = function(args) {
- var values = args.filter(function(arg) {
- return arg.type === TokenType.NUMBER_TOKEN;
- }).map(function(arg) {
- return arg.number;
- });
- var a1 = values[0], b1 = values[1], _a = values[2], _b = values[3], a2 = values[4], b2 = values[5], _c = values[6], _d = values[7], _e = values[8], _f = values[9], _g = values[10], _h = values[11], a4 = values[12], b4 = values[13], _j = values[14], _k = values[15];
- return values.length === 16 ? [a1, b1, a2, b2, a4, b4] : null;
- };
- var SUPPORTED_TRANSFORM_FUNCTIONS = {
- matrix,
- matrix3d
- };
- var DEFAULT_VALUE = {
- type: TokenType.PERCENTAGE_TOKEN,
- number: 50,
- flags: FLAG_INTEGER
- };
- var DEFAULT = [DEFAULT_VALUE, DEFAULT_VALUE];
- var transformOrigin = {
- name: "transform-origin",
- initialValue: "50% 50%",
- prefix: true,
- type: PropertyDescriptorParsingType.LIST,
- parse: function(tokens) {
- var origins = tokens.filter(isLengthPercentage);
- if (origins.length !== 2) {
- return DEFAULT;
- }
- return [origins[0], origins[1]];
- }
- };
- var VISIBILITY;
- (function(VISIBILITY2) {
- VISIBILITY2[VISIBILITY2["VISIBLE"] = 0] = "VISIBLE";
- VISIBILITY2[VISIBILITY2["HIDDEN"] = 1] = "HIDDEN";
- VISIBILITY2[VISIBILITY2["COLLAPSE"] = 2] = "COLLAPSE";
- })(VISIBILITY || (VISIBILITY = {}));
- var visibility = {
- name: "visible",
- initialValue: "none",
- prefix: false,
- type: PropertyDescriptorParsingType.IDENT_VALUE,
- parse: function(visibility2) {
- switch (visibility2) {
- case "hidden":
- return VISIBILITY.HIDDEN;
- case "collapse":
- return VISIBILITY.COLLAPSE;
- case "visible":
- default:
- return VISIBILITY.VISIBLE;
- }
- }
- };
- var WORD_BREAK;
- (function(WORD_BREAK2) {
- WORD_BREAK2["NORMAL"] = "normal";
- WORD_BREAK2["BREAK_ALL"] = "break-all";
- WORD_BREAK2["KEEP_ALL"] = "keep-all";
- })(WORD_BREAK || (WORD_BREAK = {}));
- var wordBreak = {
- name: "word-break",
- initialValue: "normal",
- prefix: false,
- type: PropertyDescriptorParsingType.IDENT_VALUE,
- parse: function(wordBreak2) {
- switch (wordBreak2) {
- case "break-all":
- return WORD_BREAK.BREAK_ALL;
- case "keep-all":
- return WORD_BREAK.KEEP_ALL;
- case "normal":
- default:
- return WORD_BREAK.NORMAL;
- }
- }
- };
- var zIndex = {
- name: "z-index",
- initialValue: "auto",
- prefix: false,
- type: PropertyDescriptorParsingType.VALUE,
- parse: function(token) {
- if (token.type === TokenType.IDENT_TOKEN) {
- return { auto: true, order: 0 };
- }
- if (isNumberToken(token)) {
- return { auto: false, order: token.number };
- }
- throw new Error("Invalid z-index number parsed");
- }
- };
- var opacity = {
- name: "opacity",
- initialValue: "1",
- type: PropertyDescriptorParsingType.VALUE,
- prefix: false,
- parse: function(token) {
- if (isNumberToken(token)) {
- return token.number;
- }
- return 1;
- }
- };
- var textDecorationColor = {
- name: "text-decoration-color",
- initialValue: "transparent",
- prefix: false,
- type: PropertyDescriptorParsingType.TYPE_VALUE,
- format: "color"
- };
- var textDecorationLine = {
- name: "text-decoration-line",
- initialValue: "none",
- prefix: false,
- type: PropertyDescriptorParsingType.LIST,
- parse: function(tokens) {
- return tokens.filter(isIdentToken).map(function(token) {
- switch (token.value) {
- case "underline":
- return 1;
- case "overline":
- return 2;
- case "line-through":
- return 3;
- case "none":
- return 4;
- }
- return 0;
- }).filter(function(line) {
- return line !== 0;
- });
- }
- };
- var fontFamily = {
- name: "font-family",
- initialValue: "",
- prefix: false,
- type: PropertyDescriptorParsingType.LIST,
- parse: function(tokens) {
- return tokens.filter(isStringToken$1).map(function(token) {
- return token.value;
- });
- }
- };
- var isStringToken$1 = function(token) {
- return token.type === TokenType.STRING_TOKEN || token.type === TokenType.IDENT_TOKEN;
- };
- var fontSize = {
- name: "font-size",
- initialValue: "0",
- prefix: false,
- type: PropertyDescriptorParsingType.TYPE_VALUE,
- format: "length"
- };
- var fontWeight = {
- name: "font-weight",
- initialValue: "normal",
- type: PropertyDescriptorParsingType.VALUE,
- prefix: false,
- parse: function(token) {
- if (isNumberToken(token)) {
- return token.number;
- }
- if (isIdentToken(token)) {
- switch (token.value) {
- case "bold":
- return 700;
- case "normal":
- default:
- return 400;
- }
- }
- return 400;
- }
- };
- var fontVariant = {
- name: "font-variant",
- initialValue: "none",
- type: PropertyDescriptorParsingType.LIST,
- prefix: false,
- parse: function(tokens) {
- return tokens.filter(isIdentToken).map(function(token) {
- return token.value;
- });
- }
- };
- var FONT_STYLE;
- (function(FONT_STYLE2) {
- FONT_STYLE2["NORMAL"] = "normal";
- FONT_STYLE2["ITALIC"] = "italic";
- FONT_STYLE2["OBLIQUE"] = "oblique";
- })(FONT_STYLE || (FONT_STYLE = {}));
- var fontStyle = {
- name: "font-style",
- initialValue: "normal",
- prefix: false,
- type: PropertyDescriptorParsingType.IDENT_VALUE,
- parse: function(overflow2) {
- switch (overflow2) {
- case "oblique":
- return FONT_STYLE.OBLIQUE;
- case "italic":
- return FONT_STYLE.ITALIC;
- case "normal":
- default:
- return FONT_STYLE.NORMAL;
- }
- }
- };
- var contains = function(bit, value) {
- return (bit & value) !== 0;
- };
- var content = {
- name: "content",
- initialValue: "none",
- type: PropertyDescriptorParsingType.LIST,
- prefix: false,
- parse: function(tokens) {
- if (tokens.length === 0) {
- return [];
- }
- var first = tokens[0];
- if (first.type === TokenType.IDENT_TOKEN && first.value === "none") {
- return [];
- }
- return tokens;
- }
- };
- var counterIncrement = {
- name: "counter-increment",
- initialValue: "none",
- prefix: true,
- type: PropertyDescriptorParsingType.LIST,
- parse: function(tokens) {
- if (tokens.length === 0) {
- return null;
- }
- var first = tokens[0];
- if (first.type === TokenType.IDENT_TOKEN && first.value === "none") {
- return null;
- }
- var increments = [];
- var filtered = tokens.filter(nonWhiteSpace);
- for (var i = 0; i < filtered.length; i++) {
- var counter = filtered[i];
- var next = filtered[i + 1];
- if (counter.type === TokenType.IDENT_TOKEN) {
- var increment = next && isNumberToken(next) ? next.number : 1;
- increments.push({ counter: counter.value, increment });
- }
- }
- return increments;
- }
- };
- var counterReset = {
- name: "counter-reset",
- initialValue: "none",
- prefix: true,
- type: PropertyDescriptorParsingType.LIST,
- parse: function(tokens) {
- if (tokens.length === 0) {
- return [];
- }
- var resets = [];
- var filtered = tokens.filter(nonWhiteSpace);
- for (var i = 0; i < filtered.length; i++) {
- var counter = filtered[i];
- var next = filtered[i + 1];
- if (isIdentToken(counter) && counter.value !== "none") {
- var reset = next && isNumberToken(next) ? next.number : 0;
- resets.push({ counter: counter.value, reset });
- }
- }
- return resets;
- }
- };
- var quotes = {
- name: "quotes",
- initialValue: "none",
- prefix: true,
- type: PropertyDescriptorParsingType.LIST,
- parse: function(tokens) {
- if (tokens.length === 0) {
- return null;
- }
- var first = tokens[0];
- if (first.type === TokenType.IDENT_TOKEN && first.value === "none") {
- return null;
- }
- var quotes2 = [];
- var filtered = tokens.filter(isStringToken);
- if (filtered.length % 2 !== 0) {
- return null;
- }
- for (var i = 0; i < filtered.length; i += 2) {
- var open_1 = filtered[i].value;
- var close_1 = filtered[i + 1].value;
- quotes2.push({ open: open_1, close: close_1 });
- }
- return quotes2;
- }
- };
- var getQuote = function(quotes2, depth, open) {
- if (!quotes2) {
- return "";
- }
- var quote = quotes2[Math.min(depth, quotes2.length - 1)];
- if (!quote) {
- return "";
- }
- return open ? quote.open : quote.close;
- };
- var boxShadow = {
- name: "box-shadow",
- initialValue: "none",
- type: PropertyDescriptorParsingType.LIST,
- prefix: false,
- parse: function(tokens) {
- if (tokens.length === 1 && isIdentWithValue(tokens[0], "none")) {
- return [];
- }
- return parseFunctionArgs(tokens).map(function(values) {
- var shadow = {
- color: 255,
- offsetX: ZERO_LENGTH,
- offsetY: ZERO_LENGTH,
- blur: ZERO_LENGTH,
- spread: ZERO_LENGTH,
- inset: false
- };
- var c = 0;
- for (var i = 0; i < values.length; i++) {
- var token = values[i];
- if (isIdentWithValue(token, "inset")) {
- shadow.inset = true;
- } else if (isLength(token)) {
- if (c === 0) {
- shadow.offsetX = token;
- } else if (c === 1) {
- shadow.offsetY = token;
- } else if (c === 2) {
- shadow.blur = token;
- } else {
- shadow.spread = token;
- }
- c++;
- } else {
- shadow.color = color.parse(token);
- }
- }
- return shadow;
- });
- }
- };
- var CSSParsedDeclaration = (
- /** @class */
- function() {
- function CSSParsedDeclaration2(declaration) {
- this.backgroundClip = parse(backgroundClip, declaration.backgroundClip);
- this.backgroundColor = parse(backgroundColor, declaration.backgroundColor);
- this.backgroundImage = parse(backgroundImage, declaration.backgroundImage);
- this.backgroundOrigin = parse(backgroundOrigin, declaration.backgroundOrigin);
- this.backgroundPosition = parse(backgroundPosition, declaration.backgroundPosition);
- this.backgroundRepeat = parse(backgroundRepeat, declaration.backgroundRepeat);
- this.backgroundSize = parse(backgroundSize, declaration.backgroundSize);
- this.borderTopColor = parse(borderTopColor, declaration.borderTopColor);
- this.borderRightColor = parse(borderRightColor, declaration.borderRightColor);
- this.borderBottomColor = parse(borderBottomColor, declaration.borderBottomColor);
- this.borderLeftColor = parse(borderLeftColor, declaration.borderLeftColor);
- this.borderTopLeftRadius = parse(borderTopLeftRadius, declaration.borderTopLeftRadius);
- this.borderTopRightRadius = parse(borderTopRightRadius, declaration.borderTopRightRadius);
- this.borderBottomRightRadius = parse(borderBottomRightRadius, declaration.borderBottomRightRadius);
- this.borderBottomLeftRadius = parse(borderBottomLeftRadius, declaration.borderBottomLeftRadius);
- this.borderTopStyle = parse(borderTopStyle, declaration.borderTopStyle);
- this.borderRightStyle = parse(borderRightStyle, declaration.borderRightStyle);
- this.borderBottomStyle = parse(borderBottomStyle, declaration.borderBottomStyle);
- this.borderLeftStyle = parse(borderLeftStyle, declaration.borderLeftStyle);
- this.borderTopWidth = parse(borderTopWidth, declaration.borderTopWidth);
- this.borderRightWidth = parse(borderRightWidth, declaration.borderRightWidth);
- this.borderBottomWidth = parse(borderBottomWidth, declaration.borderBottomWidth);
- this.borderLeftWidth = parse(borderLeftWidth, declaration.borderLeftWidth);
- this.boxShadow = parse(boxShadow, declaration.boxShadow);
- this.color = parse(color$1, declaration.color);
- this.display = parse(display, declaration.display);
- this.float = parse(float, declaration.cssFloat);
- this.fontFamily = parse(fontFamily, declaration.fontFamily);
- this.fontSize = parse(fontSize, declaration.fontSize);
- this.fontStyle = parse(fontStyle, declaration.fontStyle);
- this.fontVariant = parse(fontVariant, declaration.fontVariant);
- this.fontWeight = parse(fontWeight, declaration.fontWeight);
- this.letterSpacing = parse(letterSpacing, declaration.letterSpacing);
- this.lineBreak = parse(lineBreak, declaration.lineBreak);
- this.lineHeight = parse(lineHeight, declaration.lineHeight);
- this.listStyleImage = parse(listStyleImage, declaration.listStyleImage);
- this.listStylePosition = parse(listStylePosition, declaration.listStylePosition);
- this.listStyleType = parse(listStyleType, declaration.listStyleType);
- this.marginTop = parse(marginTop, declaration.marginTop);
- this.marginRight = parse(marginRight, declaration.marginRight);
- this.marginBottom = parse(marginBottom, declaration.marginBottom);
- this.marginLeft = parse(marginLeft, declaration.marginLeft);
- this.opacity = parse(opacity, declaration.opacity);
- var overflowTuple = parse(overflow, declaration.overflow);
- this.overflowX = overflowTuple[0];
- this.overflowY = overflowTuple[overflowTuple.length > 1 ? 1 : 0];
- this.overflowWrap = parse(overflowWrap, declaration.overflowWrap);
- this.paddingTop = parse(paddingTop, declaration.paddingTop);
- this.paddingRight = parse(paddingRight, declaration.paddingRight);
- this.paddingBottom = parse(paddingBottom, declaration.paddingBottom);
- this.paddingLeft = parse(paddingLeft, declaration.paddingLeft);
- this.position = parse(position, declaration.position);
- this.textAlign = parse(textAlign, declaration.textAlign);
- this.textDecorationColor = parse(textDecorationColor, declaration.textDecorationColor || declaration.color);
- this.textDecorationLine = parse(textDecorationLine, declaration.textDecorationLine);
- this.textShadow = parse(textShadow, declaration.textShadow);
- this.textTransform = parse(textTransform, declaration.textTransform);
- this.transform = parse(transform, declaration.transform);
- this.transformOrigin = parse(transformOrigin, declaration.transformOrigin);
- this.visibility = parse(visibility, declaration.visibility);
- this.wordBreak = parse(wordBreak, declaration.wordBreak);
- this.zIndex = parse(zIndex, declaration.zIndex);
- }
- CSSParsedDeclaration2.prototype.isVisible = function() {
- return this.display > 0 && this.opacity > 0 && this.visibility === VISIBILITY.VISIBLE;
- };
- CSSParsedDeclaration2.prototype.isTransparent = function() {
- return isTransparent(this.backgroundColor);
- };
- CSSParsedDeclaration2.prototype.isTransformed = function() {
- return this.transform !== null;
- };
- CSSParsedDeclaration2.prototype.isPositioned = function() {
- return this.position !== POSITION.STATIC;
- };
- CSSParsedDeclaration2.prototype.isPositionedWithZIndex = function() {
- return this.isPositioned() && !this.zIndex.auto;
- };
- CSSParsedDeclaration2.prototype.isFloating = function() {
- return this.float !== FLOAT.NONE;
- };
- CSSParsedDeclaration2.prototype.isInlineLevel = function() {
- return contains(
- this.display,
- 4
- /* INLINE */
- ) || contains(
- this.display,
- 33554432
- /* INLINE_BLOCK */
- ) || contains(
- this.display,
- 268435456
- /* INLINE_FLEX */
- ) || contains(
- this.display,
- 536870912
- /* INLINE_GRID */
- ) || contains(
- this.display,
- 67108864
- /* INLINE_LIST_ITEM */
- ) || contains(
- this.display,
- 134217728
- /* INLINE_TABLE */
- );
- };
- return CSSParsedDeclaration2;
- }()
- );
- var CSSParsedPseudoDeclaration = (
- /** @class */
- function() {
- function CSSParsedPseudoDeclaration2(declaration) {
- this.content = parse(content, declaration.content);
- this.quotes = parse(quotes, declaration.quotes);
- }
- return CSSParsedPseudoDeclaration2;
- }()
- );
- var CSSParsedCounterDeclaration = (
- /** @class */
- function() {
- function CSSParsedCounterDeclaration2(declaration) {
- this.counterIncrement = parse(counterIncrement, declaration.counterIncrement);
- this.counterReset = parse(counterReset, declaration.counterReset);
- }
- return CSSParsedCounterDeclaration2;
- }()
- );
- var parse = function(descriptor, style) {
- var tokenizer = new Tokenizer();
- var value = style !== null && typeof style !== "undefined" ? style.toString() : descriptor.initialValue;
- tokenizer.write(value);
- var parser = new Parser(tokenizer.read());
- switch (descriptor.type) {
- case PropertyDescriptorParsingType.IDENT_VALUE:
- var token = parser.parseComponentValue();
- return descriptor.parse(isIdentToken(token) ? token.value : descriptor.initialValue);
- case PropertyDescriptorParsingType.VALUE:
- return descriptor.parse(parser.parseComponentValue());
- case PropertyDescriptorParsingType.LIST:
- return descriptor.parse(parser.parseComponentValues());
- case PropertyDescriptorParsingType.TOKEN_VALUE:
- return parser.parseComponentValue();
- case PropertyDescriptorParsingType.TYPE_VALUE:
- switch (descriptor.format) {
- case "angle":
- return angle.parse(parser.parseComponentValue());
- case "color":
- return color.parse(parser.parseComponentValue());
- case "image":
- return image.parse(parser.parseComponentValue());
- case "length":
- var length_1 = parser.parseComponentValue();
- return isLength(length_1) ? length_1 : ZERO_LENGTH;
- case "length-percentage":
- var value_1 = parser.parseComponentValue();
- return isLengthPercentage(value_1) ? value_1 : ZERO_LENGTH;
- }
- }
- throw new Error("Attempting to parse unsupported css format type " + descriptor.format);
- };
- var ElementContainer = (
- /** @class */
- function() {
- function ElementContainer2(element) {
- this.styles = new CSSParsedDeclaration(window.getComputedStyle(element, null));
- this.textNodes = [];
- this.elements = [];
- if (this.styles.transform !== null && isHTMLElementNode(element)) {
- element.style.transform = "none";
- }
- this.bounds = parseBounds(element);
- this.flags = 0;
- }
- return ElementContainer2;
- }()
- );
- var TextBounds = (
- /** @class */
- function() {
- function TextBounds2(text, bounds) {
- this.text = text;
- this.bounds = bounds;
- }
- return TextBounds2;
- }()
- );
- var parseTextBounds = function(value, styles, node) {
- var textList = breakText(value, styles);
- var textBounds = [];
- var offset = 0;
- textList.forEach(function(text) {
- if (styles.textDecorationLine.length || text.trim().length > 0) {
- if (FEATURES.SUPPORT_RANGE_BOUNDS) {
- textBounds.push(new TextBounds(text, getRangeBounds(node, offset, text.length)));
- } else {
- var replacementNode = node.splitText(text.length);
- textBounds.push(new TextBounds(text, getWrapperBounds(node)));
- node = replacementNode;
- }
- } else if (!FEATURES.SUPPORT_RANGE_BOUNDS) {
- node = node.splitText(text.length);
- }
- offset += text.length;
- });
- return textBounds;
- };
- var getWrapperBounds = function(node) {
- var ownerDocument = node.ownerDocument;
- if (ownerDocument) {
- var wrapper = ownerDocument.createElement("html2canvaswrapper");
- wrapper.appendChild(node.cloneNode(true));
- var parentNode = node.parentNode;
- if (parentNode) {
- parentNode.replaceChild(wrapper, node);
- var bounds = parseBounds(wrapper);
- if (wrapper.firstChild) {
- parentNode.replaceChild(wrapper.firstChild, wrapper);
- }
- return bounds;
- }
- }
- return new Bounds(0, 0, 0, 0);
- };
- var getRangeBounds = function(node, offset, length) {
- var ownerDocument = node.ownerDocument;
- if (!ownerDocument) {
- throw new Error("Node has no owner document");
- }
- var range = ownerDocument.createRange();
- range.setStart(node, offset);
- range.setEnd(node, offset + length);
- return Bounds.fromClientRect(range.getBoundingClientRect());
- };
- var breakText = function(value, styles) {
- return styles.letterSpacing !== 0 ? toCodePoints(value).map(function(i) {
- return fromCodePoint(i);
- }) : breakWords(value, styles);
- };
- var breakWords = function(str, styles) {
- var breaker = LineBreaker(str, {
- lineBreak: styles.lineBreak,
- wordBreak: styles.overflowWrap === OVERFLOW_WRAP.BREAK_WORD ? "break-word" : styles.wordBreak
- });
- var words = [];
- var bk;
- while (!(bk = breaker.next()).done) {
- if (bk.value) {
- words.push(bk.value.slice());
- }
- }
- return words;
- };
- var TextContainer = (
- /** @class */
- function() {
- function TextContainer2(node, styles) {
- this.text = transform$1(node.data, styles.textTransform);
- this.textBounds = parseTextBounds(this.text, styles, node);
- }
- return TextContainer2;
- }()
- );
- var transform$1 = function(text, transform2) {
- switch (transform2) {
- case TEXT_TRANSFORM.LOWERCASE:
- return text.toLowerCase();
- case TEXT_TRANSFORM.CAPITALIZE:
- return text.replace(CAPITALIZE, capitalize);
- case TEXT_TRANSFORM.UPPERCASE:
- return text.toUpperCase();
- default:
- return text;
- }
- };
- var CAPITALIZE = /(^|\s|:|-|\(|\))([a-z])/g;
- var capitalize = function(m, p1, p2) {
- if (m.length > 0) {
- return p1 + p2.toUpperCase();
- }
- return m;
- };
- var ImageElementContainer = (
- /** @class */
- function(_super) {
- __extends(ImageElementContainer2, _super);
- function ImageElementContainer2(img) {
- var _this2 = _super.call(this, img) || this;
- _this2.src = img.currentSrc || img.src;
- _this2.intrinsicWidth = img.naturalWidth;
- _this2.intrinsicHeight = img.naturalHeight;
- CacheStorage.getInstance().addImage(_this2.src);
- return _this2;
- }
- return ImageElementContainer2;
- }(ElementContainer)
- );
- var CanvasElementContainer = (
- /** @class */
- function(_super) {
- __extends(CanvasElementContainer2, _super);
- function CanvasElementContainer2(canvas) {
- var _this2 = _super.call(this, canvas) || this;
- _this2.canvas = canvas;
- _this2.intrinsicWidth = canvas.width;
- _this2.intrinsicHeight = canvas.height;
- return _this2;
- }
- return CanvasElementContainer2;
- }(ElementContainer)
- );
- var SVGElementContainer = (
- /** @class */
- function(_super) {
- __extends(SVGElementContainer2, _super);
- function SVGElementContainer2(img) {
- var _this2 = _super.call(this, img) || this;
- var s = new XMLSerializer();
- _this2.svg = "data:image/svg+xml," + encodeURIComponent(s.serializeToString(img));
- _this2.intrinsicWidth = img.width.baseVal.value;
- _this2.intrinsicHeight = img.height.baseVal.value;
- CacheStorage.getInstance().addImage(_this2.svg);
- return _this2;
- }
- return SVGElementContainer2;
- }(ElementContainer)
- );
- var LIElementContainer = (
- /** @class */
- function(_super) {
- __extends(LIElementContainer2, _super);
- function LIElementContainer2(element) {
- var _this2 = _super.call(this, element) || this;
- _this2.value = element.value;
- return _this2;
- }
- return LIElementContainer2;
- }(ElementContainer)
- );
- var OLElementContainer = (
- /** @class */
- function(_super) {
- __extends(OLElementContainer2, _super);
- function OLElementContainer2(element) {
- var _this2 = _super.call(this, element) || this;
- _this2.start = element.start;
- _this2.reversed = typeof element.reversed === "boolean" && element.reversed === true;
- return _this2;
- }
- return OLElementContainer2;
- }(ElementContainer)
- );
- var CHECKBOX_BORDER_RADIUS = [
- {
- type: TokenType.DIMENSION_TOKEN,
- flags: 0,
- unit: "px",
- number: 3
- }
- ];
- var RADIO_BORDER_RADIUS = [
- {
- type: TokenType.PERCENTAGE_TOKEN,
- flags: 0,
- number: 50
- }
- ];
- var reformatInputBounds = function(bounds) {
- if (bounds.width > bounds.height) {
- return new Bounds(bounds.left + (bounds.width - bounds.height) / 2, bounds.top, bounds.height, bounds.height);
- } else if (bounds.width < bounds.height) {
- return new Bounds(bounds.left, bounds.top + (bounds.height - bounds.width) / 2, bounds.width, bounds.width);
- }
- return bounds;
- };
- var getInputValue = function(node) {
- var value = node.type === PASSWORD ? new Array(node.value.length + 1).join("•") : node.value;
- return value.length === 0 ? node.placeholder || "" : value;
- };
- var CHECKBOX = "checkbox";
- var RADIO = "radio";
- var PASSWORD = "password";
- var INPUT_COLOR = 707406591;
- var InputElementContainer = (
- /** @class */
- function(_super) {
- __extends(InputElementContainer2, _super);
- function InputElementContainer2(input) {
- var _this2 = _super.call(this, input) || this;
- _this2.type = input.type.toLowerCase();
- _this2.checked = input.checked;
- _this2.value = getInputValue(input);
- if (_this2.type === CHECKBOX || _this2.type === RADIO) {
- _this2.styles.backgroundColor = 3739148031;
- _this2.styles.borderTopColor = _this2.styles.borderRightColor = _this2.styles.borderBottomColor = _this2.styles.borderLeftColor = 2779096575;
- _this2.styles.borderTopWidth = _this2.styles.borderRightWidth = _this2.styles.borderBottomWidth = _this2.styles.borderLeftWidth = 1;
- _this2.styles.borderTopStyle = _this2.styles.borderRightStyle = _this2.styles.borderBottomStyle = _this2.styles.borderLeftStyle = BORDER_STYLE.SOLID;
- _this2.styles.backgroundClip = [BACKGROUND_CLIP.BORDER_BOX];
- _this2.styles.backgroundOrigin = [
- 0
- /* BORDER_BOX */
- ];
- _this2.bounds = reformatInputBounds(_this2.bounds);
- }
- switch (_this2.type) {
- case CHECKBOX:
- _this2.styles.borderTopRightRadius = _this2.styles.borderTopLeftRadius = _this2.styles.borderBottomRightRadius = _this2.styles.borderBottomLeftRadius = CHECKBOX_BORDER_RADIUS;
- break;
- case RADIO:
- _this2.styles.borderTopRightRadius = _this2.styles.borderTopLeftRadius = _this2.styles.borderBottomRightRadius = _this2.styles.borderBottomLeftRadius = RADIO_BORDER_RADIUS;
- break;
- }
- return _this2;
- }
- return InputElementContainer2;
- }(ElementContainer)
- );
- var SelectElementContainer = (
- /** @class */
- function(_super) {
- __extends(SelectElementContainer2, _super);
- function SelectElementContainer2(element) {
- var _this2 = _super.call(this, element) || this;
- var option = element.options[element.selectedIndex || 0];
- _this2.value = option ? option.text || "" : "";
- return _this2;
- }
- return SelectElementContainer2;
- }(ElementContainer)
- );
- var TextareaElementContainer = (
- /** @class */
- function(_super) {
- __extends(TextareaElementContainer2, _super);
- function TextareaElementContainer2(element) {
- var _this2 = _super.call(this, element) || this;
- _this2.value = element.value;
- return _this2;
- }
- return TextareaElementContainer2;
- }(ElementContainer)
- );
- var parseColor = function(value) {
- return color.parse(Parser.create(value).parseComponentValue());
- };
- var IFrameElementContainer = (
- /** @class */
- function(_super) {
- __extends(IFrameElementContainer2, _super);
- function IFrameElementContainer2(iframe) {
- var _this2 = _super.call(this, iframe) || this;
- _this2.src = iframe.src;
- _this2.width = parseInt(iframe.width, 10) || 0;
- _this2.height = parseInt(iframe.height, 10) || 0;
- _this2.backgroundColor = _this2.styles.backgroundColor;
- try {
- if (iframe.contentWindow && iframe.contentWindow.document && iframe.contentWindow.document.documentElement) {
- _this2.tree = parseTree(iframe.contentWindow.document.documentElement);
- var documentBackgroundColor = iframe.contentWindow.document.documentElement ? parseColor(getComputedStyle(iframe.contentWindow.document.documentElement).backgroundColor) : COLORS.TRANSPARENT;
- var bodyBackgroundColor = iframe.contentWindow.document.body ? parseColor(getComputedStyle(iframe.contentWindow.document.body).backgroundColor) : COLORS.TRANSPARENT;
- _this2.backgroundColor = isTransparent(documentBackgroundColor) ? isTransparent(bodyBackgroundColor) ? _this2.styles.backgroundColor : bodyBackgroundColor : documentBackgroundColor;
- }
- } catch (e2) {
- }
- return _this2;
- }
- return IFrameElementContainer2;
- }(ElementContainer)
- );
- var LIST_OWNERS = ["OL", "UL", "MENU"];
- var parseNodeTree = function(node, parent, root) {
- for (var childNode = node.firstChild, nextNode = void 0; childNode; childNode = nextNode) {
- nextNode = childNode.nextSibling;
- if (isTextNode(childNode) && childNode.data.trim().length > 0) {
- parent.textNodes.push(new TextContainer(childNode, parent.styles));
- } else if (isElementNode(childNode)) {
- var container = createContainer(childNode);
- if (container.styles.isVisible()) {
- if (createsRealStackingContext(childNode, container, root)) {
- container.flags |= 4;
- } else if (createsStackingContext(container.styles)) {
- container.flags |= 2;
- }
- if (LIST_OWNERS.indexOf(childNode.tagName) !== -1) {
- container.flags |= 8;
- }
- parent.elements.push(container);
- if (!isTextareaElement(childNode) && !isSVGElement(childNode) && !isSelectElement(childNode)) {
- parseNodeTree(childNode, container, root);
- }
- }
- }
- }
- };
- var createContainer = function(element) {
- if (isImageElement(element)) {
- return new ImageElementContainer(element);
- }
- if (isCanvasElement(element)) {
- return new CanvasElementContainer(element);
- }
- if (isSVGElement(element)) {
- return new SVGElementContainer(element);
- }
- if (isLIElement(element)) {
- return new LIElementContainer(element);
- }
- if (isOLElement(element)) {
- return new OLElementContainer(element);
- }
- if (isInputElement(element)) {
- return new InputElementContainer(element);
- }
- if (isSelectElement(element)) {
- return new SelectElementContainer(element);
- }
- if (isTextareaElement(element)) {
- return new TextareaElementContainer(element);
- }
- if (isIFrameElement(element)) {
- return new IFrameElementContainer(element);
- }
- return new ElementContainer(element);
- };
- var parseTree = function(element) {
- var container = createContainer(element);
- container.flags |= 4;
- parseNodeTree(element, container, container);
- return container;
- };
- var createsRealStackingContext = function(node, container, root) {
- return container.styles.isPositionedWithZIndex() || container.styles.opacity < 1 || container.styles.isTransformed() || isBodyElement(node) && root.styles.isTransparent();
- };
- var createsStackingContext = function(styles) {
- return styles.isPositioned() || styles.isFloating();
- };
- var isTextNode = function(node) {
- return node.nodeType === Node.TEXT_NODE;
- };
- var isElementNode = function(node) {
- return node.nodeType === Node.ELEMENT_NODE;
- };
- var isHTMLElementNode = function(node) {
- return typeof node.style !== "undefined";
- };
- var isLIElement = function(node) {
- return node.tagName === "LI";
- };
- var isOLElement = function(node) {
- return node.tagName === "OL";
- };
- var isInputElement = function(node) {
- return node.tagName === "INPUT";
- };
- var isHTMLElement = function(node) {
- return node.tagName === "HTML";
- };
- var isSVGElement = function(node) {
- return node.tagName === "svg";
- };
- var isBodyElement = function(node) {
- return node.tagName === "BODY";
- };
- var isCanvasElement = function(node) {
- return node.tagName === "CANVAS";
- };
- var isImageElement = function(node) {
- return node.tagName === "IMG";
- };
- var isIFrameElement = function(node) {
- return node.tagName === "IFRAME";
- };
- var isStyleElement = function(node) {
- return node.tagName === "STYLE";
- };
- var isScriptElement = function(node) {
- return node.tagName === "SCRIPT";
- };
- var isTextareaElement = function(node) {
- return node.tagName === "TEXTAREA";
- };
- var isSelectElement = function(node) {
- return node.tagName === "SELECT";
- };
- var CounterState = (
- /** @class */
- function() {
- function CounterState2() {
- this.counters = {};
- }
- CounterState2.prototype.getCounterValue = function(name) {
- var counter = this.counters[name];
- if (counter && counter.length) {
- return counter[counter.length - 1];
- }
- return 1;
- };
- CounterState2.prototype.getCounterValues = function(name) {
- var counter = this.counters[name];
- return counter ? counter : [];
- };
- CounterState2.prototype.pop = function(counters) {
- var _this2 = this;
- counters.forEach(function(counter) {
- return _this2.counters[counter].pop();
- });
- };
- CounterState2.prototype.parse = function(style) {
- var _this2 = this;
- var counterIncrement2 = style.counterIncrement;
- var counterReset2 = style.counterReset;
- if (counterIncrement2 !== null) {
- counterIncrement2.forEach(function(entry) {
- var counter = _this2.counters[entry.counter];
- if (counter) {
- counter[Math.max(0, counter.length - 1)] += entry.increment;
- }
- });
- }
- var counterNames = [];
- counterReset2.forEach(function(entry) {
- var counter = _this2.counters[entry.counter];
- counterNames.push(entry.counter);
- if (!counter) {
- counter = _this2.counters[entry.counter] = [];
- }
- counter.push(entry.reset);
- });
- return counterNames;
- };
- return CounterState2;
- }()
- );
- var ROMAN_UPPER = {
- integers: [1e3, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1],
- values: ["M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"]
- };
- var ARMENIAN = {
- integers: [
- 9e3,
- 8e3,
- 7e3,
- 6e3,
- 5e3,
- 4e3,
- 3e3,
- 2e3,
- 1e3,
- 900,
- 800,
- 700,
- 600,
- 500,
- 400,
- 300,
- 200,
- 100,
- 90,
- 80,
- 70,
- 60,
- 50,
- 40,
- 30,
- 20,
- 10,
- 9,
- 8,
- 7,
- 6,
- 5,
- 4,
- 3,
- 2,
- 1
- ],
- values: [
- "Ք",
- "Փ",
- "Ւ",
- "Ց",
- "Ր",
- "Տ",
- "Վ",
- "Ս",
- "Ռ",
- "Ջ",
- "Պ",
- "Չ",
- "Ո",
- "Շ",
- "Ն",
- "Յ",
- "Մ",
- "Ճ",
- "Ղ",
- "Ձ",
- "Հ",
- "Կ",
- "Ծ",
- "Խ",
- "Լ",
- "Ի",
- "Ժ",
- "Թ",
- "Ը",
- "Է",
- "Զ",
- "Ե",
- "Դ",
- "Գ",
- "Բ",
- "Ա"
- ]
- };
- var HEBREW = {
- integers: [
- 1e4,
- 9e3,
- 8e3,
- 7e3,
- 6e3,
- 5e3,
- 4e3,
- 3e3,
- 2e3,
- 1e3,
- 400,
- 300,
- 200,
- 100,
- 90,
- 80,
- 70,
- 60,
- 50,
- 40,
- 30,
- 20,
- 19,
- 18,
- 17,
- 16,
- 15,
- 10,
- 9,
- 8,
- 7,
- 6,
- 5,
- 4,
- 3,
- 2,
- 1
- ],
- values: [
- "י׳",
- "ט׳",
- "ח׳",
- "ז׳",
- "ו׳",
- "ה׳",
- "ד׳",
- "ג׳",
- "ב׳",
- "א׳",
- "ת",
- "ש",
- "ר",
- "ק",
- "צ",
- "פ",
- "ע",
- "ס",
- "נ",
- "מ",
- "ל",
- "כ",
- "יט",
- "יח",
- "יז",
- "טז",
- "טו",
- "י",
- "ט",
- "ח",
- "ז",
- "ו",
- "ה",
- "ד",
- "ג",
- "ב",
- "א"
- ]
- };
- var GEORGIAN = {
- integers: [
- 1e4,
- 9e3,
- 8e3,
- 7e3,
- 6e3,
- 5e3,
- 4e3,
- 3e3,
- 2e3,
- 1e3,
- 900,
- 800,
- 700,
- 600,
- 500,
- 400,
- 300,
- 200,
- 100,
- 90,
- 80,
- 70,
- 60,
- 50,
- 40,
- 30,
- 20,
- 10,
- 9,
- 8,
- 7,
- 6,
- 5,
- 4,
- 3,
- 2,
- 1
- ],
- values: [
- "ჵ",
- "ჰ",
- "ჯ",
- "ჴ",
- "ხ",
- "ჭ",
- "წ",
- "ძ",
- "ც",
- "ჩ",
- "შ",
- "ყ",
- "ღ",
- "ქ",
- "ფ",
- "ჳ",
- "ტ",
- "ს",
- "რ",
- "ჟ",
- "პ",
- "ო",
- "ჲ",
- "ნ",
- "მ",
- "ლ",
- "კ",
- "ი",
- "თ",
- "ჱ",
- "ზ",
- "ვ",
- "ე",
- "დ",
- "გ",
- "ბ",
- "ა"
- ]
- };
- var createAdditiveCounter = function(value, min, max, symbols, fallback, suffix) {
- if (value < min || value > max) {
- return createCounterText(value, fallback, suffix.length > 0);
- }
- return symbols.integers.reduce(function(string, integer, index) {
- while (value >= integer) {
- value -= integer;
- string += symbols.values[index];
- }
- return string;
- }, "") + suffix;
- };
- var createCounterStyleWithSymbolResolver = function(value, codePointRangeLength, isNumeric, resolver) {
- var string = "";
- do {
- if (!isNumeric) {
- value--;
- }
- string = resolver(value) + string;
- value /= codePointRangeLength;
- } while (value * codePointRangeLength >= codePointRangeLength);
- return string;
- };
- var createCounterStyleFromRange = function(value, codePointRangeStart, codePointRangeEnd, isNumeric, suffix) {
- var codePointRangeLength = codePointRangeEnd - codePointRangeStart + 1;
- return (value < 0 ? "-" : "") + (createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, isNumeric, function(codePoint) {
- return fromCodePoint(Math.floor(codePoint % codePointRangeLength) + codePointRangeStart);
- }) + suffix);
- };
- var createCounterStyleFromSymbols = function(value, symbols, suffix) {
- if (suffix === void 0) {
- suffix = ". ";
- }
- var codePointRangeLength = symbols.length;
- return createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, false, function(codePoint) {
- return symbols[Math.floor(codePoint % codePointRangeLength)];
- }) + suffix;
- };
- var CJK_ZEROS = 1 << 0;
- var CJK_TEN_COEFFICIENTS = 1 << 1;
- var CJK_TEN_HIGH_COEFFICIENTS = 1 << 2;
- var CJK_HUNDRED_COEFFICIENTS = 1 << 3;
- var createCJKCounter = function(value, numbers, multipliers, negativeSign, suffix, flags) {
- if (value < -9999 || value > 9999) {
- return createCounterText(value, LIST_STYLE_TYPE.CJK_DECIMAL, suffix.length > 0);
- }
- var tmp = Math.abs(value);
- var string = suffix;
- if (tmp === 0) {
- return numbers[0] + string;
- }
- for (var digit = 0; tmp > 0 && digit <= 4; digit++) {
- var coefficient = tmp % 10;
- if (coefficient === 0 && contains(flags, CJK_ZEROS) && string !== "") {
- string = numbers[coefficient] + string;
- } else if (coefficient > 1 || coefficient === 1 && digit === 0 || coefficient === 1 && digit === 1 && contains(flags, CJK_TEN_COEFFICIENTS) || coefficient === 1 && digit === 1 && contains(flags, CJK_TEN_HIGH_COEFFICIENTS) && value > 100 || coefficient === 1 && digit > 1 && contains(flags, CJK_HUNDRED_COEFFICIENTS)) {
- string = numbers[coefficient] + (digit > 0 ? multipliers[digit - 1] : "") + string;
- } else if (coefficient === 1 && digit > 0) {
- string = multipliers[digit - 1] + string;
- }
- tmp = Math.floor(tmp / 10);
- }
- return (value < 0 ? negativeSign : "") + string;
- };
- var CHINESE_INFORMAL_MULTIPLIERS = "十百千萬";
- var CHINESE_FORMAL_MULTIPLIERS = "拾佰仟萬";
- var JAPANESE_NEGATIVE = "マイナス";
- var KOREAN_NEGATIVE = "마이너스";
- var createCounterText = function(value, type, appendSuffix) {
- var defaultSuffix = appendSuffix ? ". " : "";
- var cjkSuffix = appendSuffix ? "、" : "";
- var koreanSuffix = appendSuffix ? ", " : "";
- var spaceSuffix = appendSuffix ? " " : "";
- switch (type) {
- case LIST_STYLE_TYPE.DISC:
- return "•" + spaceSuffix;
- case LIST_STYLE_TYPE.CIRCLE:
- return "◦" + spaceSuffix;
- case LIST_STYLE_TYPE.SQUARE:
- return "◾" + spaceSuffix;
- case LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO:
- var string = createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);
- return string.length < 4 ? "0" + string : string;
- case LIST_STYLE_TYPE.CJK_DECIMAL:
- return createCounterStyleFromSymbols(value, "〇一二三四五六七八九", cjkSuffix);
- case LIST_STYLE_TYPE.LOWER_ROMAN:
- return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, LIST_STYLE_TYPE.DECIMAL, defaultSuffix).toLowerCase();
- case LIST_STYLE_TYPE.UPPER_ROMAN:
- return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
- case LIST_STYLE_TYPE.LOWER_GREEK:
- return createCounterStyleFromRange(value, 945, 969, false, defaultSuffix);
- case LIST_STYLE_TYPE.LOWER_ALPHA:
- return createCounterStyleFromRange(value, 97, 122, false, defaultSuffix);
- case LIST_STYLE_TYPE.UPPER_ALPHA:
- return createCounterStyleFromRange(value, 65, 90, false, defaultSuffix);
- case LIST_STYLE_TYPE.ARABIC_INDIC:
- return createCounterStyleFromRange(value, 1632, 1641, true, defaultSuffix);
- case LIST_STYLE_TYPE.ARMENIAN:
- case LIST_STYLE_TYPE.UPPER_ARMENIAN:
- return createAdditiveCounter(value, 1, 9999, ARMENIAN, LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
- case LIST_STYLE_TYPE.LOWER_ARMENIAN:
- return createAdditiveCounter(value, 1, 9999, ARMENIAN, LIST_STYLE_TYPE.DECIMAL, defaultSuffix).toLowerCase();
- case LIST_STYLE_TYPE.BENGALI:
- return createCounterStyleFromRange(value, 2534, 2543, true, defaultSuffix);
- case LIST_STYLE_TYPE.CAMBODIAN:
- case LIST_STYLE_TYPE.KHMER:
- return createCounterStyleFromRange(value, 6112, 6121, true, defaultSuffix);
- case LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH:
- return createCounterStyleFromSymbols(value, "子丑寅卯辰巳午未申酉戌亥", cjkSuffix);
- case LIST_STYLE_TYPE.CJK_HEAVENLY_STEM:
- return createCounterStyleFromSymbols(value, "甲乙丙丁戊己庚辛壬癸", cjkSuffix);
- case LIST_STYLE_TYPE.CJK_IDEOGRAPHIC:
- case LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL:
- return createCJKCounter(value, "零一二三四五六七八九", CHINESE_INFORMAL_MULTIPLIERS, "負", cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
- case LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL:
- return createCJKCounter(value, "零壹貳參肆伍陸柒捌玖", CHINESE_FORMAL_MULTIPLIERS, "負", cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
- case LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL:
- return createCJKCounter(value, "零一二三四五六七八九", CHINESE_INFORMAL_MULTIPLIERS, "负", cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
- case LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL:
- return createCJKCounter(value, "零壹贰叁肆伍陆柒捌玖", CHINESE_FORMAL_MULTIPLIERS, "负", cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
- case LIST_STYLE_TYPE.JAPANESE_INFORMAL:
- return createCJKCounter(value, "〇一二三四五六七八九", "十百千万", JAPANESE_NEGATIVE, cjkSuffix, 0);
- case LIST_STYLE_TYPE.JAPANESE_FORMAL:
- return createCJKCounter(value, "零壱弐参四伍六七八九", "拾百千万", JAPANESE_NEGATIVE, cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
- case LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL:
- return createCJKCounter(value, "영일이삼사오육칠팔구", "십백천만", KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
- case LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL:
- return createCJKCounter(value, "零一二三四五六七八九", "十百千萬", KOREAN_NEGATIVE, koreanSuffix, 0);
- case LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL:
- return createCJKCounter(value, "零壹貳參四五六七八九", "拾百千", KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
- case LIST_STYLE_TYPE.DEVANAGARI:
- return createCounterStyleFromRange(value, 2406, 2415, true, defaultSuffix);
- case LIST_STYLE_TYPE.GEORGIAN:
- return createAdditiveCounter(value, 1, 19999, GEORGIAN, LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
- case LIST_STYLE_TYPE.GUJARATI:
- return createCounterStyleFromRange(value, 2790, 2799, true, defaultSuffix);
- case LIST_STYLE_TYPE.GURMUKHI:
- return createCounterStyleFromRange(value, 2662, 2671, true, defaultSuffix);
- case LIST_STYLE_TYPE.HEBREW:
- return createAdditiveCounter(value, 1, 10999, HEBREW, LIST_STYLE_TYPE.DECIMAL, defaultSuffix);
- case LIST_STYLE_TYPE.HIRAGANA:
- return createCounterStyleFromSymbols(value, "あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");
- case LIST_STYLE_TYPE.HIRAGANA_IROHA:
- return createCounterStyleFromSymbols(value, "いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");
- case LIST_STYLE_TYPE.KANNADA:
- return createCounterStyleFromRange(value, 3302, 3311, true, defaultSuffix);
- case LIST_STYLE_TYPE.KATAKANA:
- return createCounterStyleFromSymbols(value, "アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン", cjkSuffix);
- case LIST_STYLE_TYPE.KATAKANA_IROHA:
- return createCounterStyleFromSymbols(value, "イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス", cjkSuffix);
- case LIST_STYLE_TYPE.LAO:
- return createCounterStyleFromRange(value, 3792, 3801, true, defaultSuffix);
- case LIST_STYLE_TYPE.MONGOLIAN:
- return createCounterStyleFromRange(value, 6160, 6169, true, defaultSuffix);
- case LIST_STYLE_TYPE.MYANMAR:
- return createCounterStyleFromRange(value, 4160, 4169, true, defaultSuffix);
- case LIST_STYLE_TYPE.ORIYA:
- return createCounterStyleFromRange(value, 2918, 2927, true, defaultSuffix);
- case LIST_STYLE_TYPE.PERSIAN:
- return createCounterStyleFromRange(value, 1776, 1785, true, defaultSuffix);
- case LIST_STYLE_TYPE.TAMIL:
- return createCounterStyleFromRange(value, 3046, 3055, true, defaultSuffix);
- case LIST_STYLE_TYPE.TELUGU:
- return createCounterStyleFromRange(value, 3174, 3183, true, defaultSuffix);
- case LIST_STYLE_TYPE.THAI:
- return createCounterStyleFromRange(value, 3664, 3673, true, defaultSuffix);
- case LIST_STYLE_TYPE.TIBETAN:
- return createCounterStyleFromRange(value, 3872, 3881, true, defaultSuffix);
- case LIST_STYLE_TYPE.DECIMAL:
- default:
- return createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);
- }
- };
- var IGNORE_ATTRIBUTE = "data-html2canvas-ignore";
- var DocumentCloner = (
- /** @class */
- function() {
- function DocumentCloner2(element, options) {
- this.options = options;
- this.scrolledElements = [];
- this.referenceElement = element;
- this.counters = new CounterState();
- this.quoteDepth = 0;
- if (!element.ownerDocument) {
- throw new Error("Cloned element does not have an owner document");
- }
- this.documentElement = this.cloneNode(element.ownerDocument.documentElement);
- }
- DocumentCloner2.prototype.toIFrame = function(ownerDocument, windowSize) {
- var _this2 = this;
- var iframe = createIFrameContainer(ownerDocument, windowSize);
- if (!iframe.contentWindow) {
- return Promise.reject("Unable to find iframe window");
- }
- var scrollX = ownerDocument.defaultView.pageXOffset;
- var scrollY = ownerDocument.defaultView.pageYOffset;
- var cloneWindow = iframe.contentWindow;
- var documentClone = cloneWindow.document;
- var iframeLoad = iframeLoader(iframe).then(function() {
- _this2.scrolledElements.forEach(restoreNodeScroll);
- if (cloneWindow) {
- cloneWindow.scrollTo(windowSize.left, windowSize.top);
- if (/(iPad|iPhone|iPod)/g.test(navigator.userAgent) && (cloneWindow.scrollY !== windowSize.top || cloneWindow.scrollX !== windowSize.left)) {
- documentClone.documentElement.style.top = -windowSize.top + "px";
- documentClone.documentElement.style.left = -windowSize.left + "px";
- documentClone.documentElement.style.position = "absolute";
- }
- }
- var onclone = _this2.options.onclone;
- if (typeof _this2.clonedReferenceElement === "undefined") {
- return Promise.reject("Error finding the " + _this2.referenceElement.nodeName + " in the cloned document");
- }
- if (typeof onclone === "function") {
- return Promise.resolve().then(function() {
- return onclone(documentClone);
- }).then(function() {
- return iframe;
- });
- }
- return iframe;
- });
- documentClone.open();
- documentClone.write(serializeDoctype(document.doctype) + "<html></html>");
- restoreOwnerScroll(this.referenceElement.ownerDocument, scrollX, scrollY);
- documentClone.replaceChild(documentClone.adoptNode(this.documentElement), documentClone.documentElement);
- documentClone.close();
- return iframeLoad;
- };
- DocumentCloner2.prototype.createElementClone = function(node) {
- if (isCanvasElement(node)) {
- return this.createCanvasClone(node);
- }
- if (isStyleElement(node)) {
- return this.createStyleClone(node);
- }
- return node.cloneNode(false);
- };
- DocumentCloner2.prototype.createStyleClone = function(node) {
- try {
- var sheet = node.sheet;
- if (sheet && sheet.cssRules) {
- var css = [].slice.call(sheet.cssRules, 0).reduce(function(css2, rule) {
- if (rule && typeof rule.cssText === "string") {
- return css2 + rule.cssText;
- }
- return css2;
- }, "");
- var style = node.cloneNode(false);
- style.textContent = css;
- return style;
- }
- } catch (e2) {
- Logger.getInstance(this.options.id).error("Unable to access cssRules property", e2);
- if (e2.name !== "SecurityError") {
- throw e2;
- }
- }
- return node.cloneNode(false);
- };
- DocumentCloner2.prototype.createCanvasClone = function(canvas) {
- if (this.options.inlineImages && canvas.ownerDocument) {
- var img = canvas.ownerDocument.createElement("img");
- try {
- img.src = canvas.toDataURL();
- return img;
- } catch (e2) {
- Logger.getInstance(this.options.id).info("Unable to clone canvas contents, canvas is tainted");
- }
- }
- var clonedCanvas = canvas.cloneNode(false);
- try {
- clonedCanvas.width = canvas.width;
- clonedCanvas.height = canvas.height;
- var ctx = canvas.getContext("2d");
- var clonedCtx = clonedCanvas.getContext("2d");
- if (clonedCtx) {
- if (ctx) {
- clonedCtx.putImageData(ctx.getImageData(0, 0, canvas.width, canvas.height), 0, 0);
- } else {
- clonedCtx.drawImage(canvas, 0, 0);
- }
- }
- return clonedCanvas;
- } catch (e2) {
- }
- return clonedCanvas;
- };
- DocumentCloner2.prototype.cloneNode = function(node) {
- if (isTextNode(node)) {
- return document.createTextNode(node.data);
- }
- if (!node.ownerDocument) {
- return node.cloneNode(false);
- }
- var window2 = node.ownerDocument.defaultView;
- if (isHTMLElementNode(node) && window2) {
- var clone = this.createElementClone(node);
- var style = window2.getComputedStyle(node);
- var styleBefore = window2.getComputedStyle(node, ":before");
- var styleAfter = window2.getComputedStyle(node, ":after");
- if (this.referenceElement === node) {
- this.clonedReferenceElement = clone;
- }
- if (isBodyElement(clone)) {
- createPseudoHideStyles(clone);
- }
- var counters = this.counters.parse(new CSSParsedCounterDeclaration(style));
- var before_1 = this.resolvePseudoContent(node, clone, styleBefore, PseudoElementType.BEFORE);
- for (var child = node.firstChild; child; child = child.nextSibling) {
- if (!isElementNode(child) || !isScriptElement(child) && !child.hasAttribute(IGNORE_ATTRIBUTE) && (typeof this.options.ignoreElements !== "function" || !this.options.ignoreElements(child))) {
- if (!this.options.copyStyles || !isElementNode(child) || !isStyleElement(child)) {
- clone.appendChild(this.cloneNode(child));
- }
- }
- }
- if (before_1) {
- clone.insertBefore(before_1, clone.firstChild);
- }
- var after_1 = this.resolvePseudoContent(node, clone, styleAfter, PseudoElementType.AFTER);
- if (after_1) {
- clone.appendChild(after_1);
- }
- this.counters.pop(counters);
- if (style && this.options.copyStyles && !isIFrameElement(node)) {
- copyCSSStyles(style, clone);
- }
- if (node.scrollTop !== 0 || node.scrollLeft !== 0) {
- this.scrolledElements.push([clone, node.scrollLeft, node.scrollTop]);
- }
- if ((isTextareaElement(node) || isSelectElement(node)) && (isTextareaElement(clone) || isSelectElement(clone))) {
- clone.value = node.value;
- }
- return clone;
- }
- return node.cloneNode(false);
- };
- DocumentCloner2.prototype.resolvePseudoContent = function(node, clone, style, pseudoElt) {
- var _this2 = this;
- if (!style) {
- return;
- }
- var value = style.content;
- var document2 = clone.ownerDocument;
- if (!document2 || !value || value === "none" || value === "-moz-alt-content" || style.display === "none") {
- return;
- }
- this.counters.parse(new CSSParsedCounterDeclaration(style));
- var declaration = new CSSParsedPseudoDeclaration(style);
- var anonymousReplacedElement = document2.createElement("html2canvaspseudoelement");
- copyCSSStyles(style, anonymousReplacedElement);
- declaration.content.forEach(function(token) {
- if (token.type === TokenType.STRING_TOKEN) {
- anonymousReplacedElement.appendChild(document2.createTextNode(token.value));
- } else if (token.type === TokenType.URL_TOKEN) {
- var img = document2.createElement("img");
- img.src = token.value;
- img.style.opacity = "1";
- anonymousReplacedElement.appendChild(img);
- } else if (token.type === TokenType.FUNCTION) {
- if (token.name === "attr") {
- var attr = token.values.filter(isIdentToken);
- if (attr.length) {
- anonymousReplacedElement.appendChild(document2.createTextNode(node.getAttribute(attr[0].value) || ""));
- }
- } else if (token.name === "counter") {
- var _a = token.values.filter(nonFunctionArgSeparator), counter = _a[0], counterStyle = _a[1];
- if (counter && isIdentToken(counter)) {
- var counterState = _this2.counters.getCounterValue(counter.value);
- var counterType = counterStyle && isIdentToken(counterStyle) ? listStyleType.parse(counterStyle.value) : LIST_STYLE_TYPE.DECIMAL;
- anonymousReplacedElement.appendChild(document2.createTextNode(createCounterText(counterState, counterType, false)));
- }
- } else if (token.name === "counters") {
- var _b = token.values.filter(nonFunctionArgSeparator), counter = _b[0], delim = _b[1], counterStyle = _b[2];
- if (counter && isIdentToken(counter)) {
- var counterStates = _this2.counters.getCounterValues(counter.value);
- var counterType_1 = counterStyle && isIdentToken(counterStyle) ? listStyleType.parse(counterStyle.value) : LIST_STYLE_TYPE.DECIMAL;
- var separator = delim && delim.type === TokenType.STRING_TOKEN ? delim.value : "";
- var text = counterStates.map(function(value2) {
- return createCounterText(value2, counterType_1, false);
- }).join(separator);
- anonymousReplacedElement.appendChild(document2.createTextNode(text));
- }
- }
- } else if (token.type === TokenType.IDENT_TOKEN) {
- switch (token.value) {
- case "open-quote":
- anonymousReplacedElement.appendChild(document2.createTextNode(getQuote(declaration.quotes, _this2.quoteDepth++, true)));
- break;
- case "close-quote":
- anonymousReplacedElement.appendChild(document2.createTextNode(getQuote(declaration.quotes, --_this2.quoteDepth, false)));
- break;
- default:
- }
- }
- });
- anonymousReplacedElement.className = PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + " " + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;
- clone.className += pseudoElt === PseudoElementType.BEFORE ? " " + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE : " " + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;
- return anonymousReplacedElement;
- };
- return DocumentCloner2;
- }()
- );
- var PseudoElementType;
- (function(PseudoElementType2) {
- PseudoElementType2[PseudoElementType2["BEFORE"] = 0] = "BEFORE";
- PseudoElementType2[PseudoElementType2["AFTER"] = 1] = "AFTER";
- })(PseudoElementType || (PseudoElementType = {}));
- var createIFrameContainer = function(ownerDocument, bounds) {
- var cloneIframeContainer = ownerDocument.createElement("iframe");
- cloneIframeContainer.className = "html2canvas-container";
- cloneIframeContainer.style.visibility = "hidden";
- cloneIframeContainer.style.position = "fixed";
- cloneIframeContainer.style.left = "-10000px";
- cloneIframeContainer.style.top = "0px";
- cloneIframeContainer.style.border = "0";
- cloneIframeContainer.width = bounds.width.toString();
- cloneIframeContainer.height = bounds.height.toString();
- cloneIframeContainer.scrolling = "no";
- cloneIframeContainer.setAttribute(IGNORE_ATTRIBUTE, "true");
- ownerDocument.body.appendChild(cloneIframeContainer);
- return cloneIframeContainer;
- };
- var iframeLoader = function(iframe) {
- return new Promise(function(resolve, reject) {
- var cloneWindow = iframe.contentWindow;
- if (!cloneWindow) {
- return reject("No window assigned for iframe");
- }
- var documentClone = cloneWindow.document;
- cloneWindow.onload = iframe.onload = documentClone.onreadystatechange = function() {
- cloneWindow.onload = iframe.onload = documentClone.onreadystatechange = null;
- var interval = setInterval(function() {
- if (documentClone.body.childNodes.length > 0 && documentClone.readyState === "complete") {
- clearInterval(interval);
- resolve(iframe);
- }
- }, 50);
- };
- });
- };
- var copyCSSStyles = function(style, target) {
- for (var i = style.length - 1; i >= 0; i--) {
- var property = style.item(i);
- if (property !== "content") {
- target.style.setProperty(property, style.getPropertyValue(property));
- }
- }
- return target;
- };
- var serializeDoctype = function(doctype) {
- var str = "";
- if (doctype) {
- str += "<!DOCTYPE ";
- if (doctype.name) {
- str += doctype.name;
- }
- if (doctype.internalSubset) {
- str += doctype.internalSubset;
- }
- if (doctype.publicId) {
- str += '"' + doctype.publicId + '"';
- }
- if (doctype.systemId) {
- str += '"' + doctype.systemId + '"';
- }
- str += ">";
- }
- return str;
- };
- var restoreOwnerScroll = function(ownerDocument, x, y) {
- if (ownerDocument && ownerDocument.defaultView && (x !== ownerDocument.defaultView.pageXOffset || y !== ownerDocument.defaultView.pageYOffset)) {
- ownerDocument.defaultView.scrollTo(x, y);
- }
- };
- var restoreNodeScroll = function(_a) {
- var element = _a[0], x = _a[1], y = _a[2];
- element.scrollLeft = x;
- element.scrollTop = y;
- };
- var PSEUDO_BEFORE = ":before";
- var PSEUDO_AFTER = ":after";
- var PSEUDO_HIDE_ELEMENT_CLASS_BEFORE = "___html2canvas___pseudoelement_before";
- var PSEUDO_HIDE_ELEMENT_CLASS_AFTER = "___html2canvas___pseudoelement_after";
- var PSEUDO_HIDE_ELEMENT_STYLE = '{\n content: "" !important;\n display: none !important;\n}';
- var createPseudoHideStyles = function(body) {
- createStyles(body, "." + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + PSEUDO_BEFORE + PSEUDO_HIDE_ELEMENT_STYLE + "\n ." + PSEUDO_HIDE_ELEMENT_CLASS_AFTER + PSEUDO_AFTER + PSEUDO_HIDE_ELEMENT_STYLE);
- };
- var createStyles = function(body, styles) {
- var document2 = body.ownerDocument;
- if (document2) {
- var style = document2.createElement("style");
- style.textContent = styles;
- body.appendChild(style);
- }
- };
- var PathType;
- (function(PathType2) {
- PathType2[PathType2["VECTOR"] = 0] = "VECTOR";
- PathType2[PathType2["BEZIER_CURVE"] = 1] = "BEZIER_CURVE";
- })(PathType || (PathType = {}));
- var equalPath = function(a2, b) {
- if (a2.length === b.length) {
- return a2.some(function(v, i) {
- return v === b[i];
- });
- }
- return false;
- };
- var transformPath = function(path, deltaX, deltaY, deltaW, deltaH) {
- return path.map(function(point, index) {
- switch (index) {
- case 0:
- return point.add(deltaX, deltaY);
- case 1:
- return point.add(deltaX + deltaW, deltaY);
- case 2:
- return point.add(deltaX + deltaW, deltaY + deltaH);
- case 3:
- return point.add(deltaX, deltaY + deltaH);
- }
- return point;
- });
- };
- var Vector = (
- /** @class */
- function() {
- function Vector2(x, y) {
- this.type = PathType.VECTOR;
- this.x = x;
- this.y = y;
- }
- Vector2.prototype.add = function(deltaX, deltaY) {
- return new Vector2(this.x + deltaX, this.y + deltaY);
- };
- return Vector2;
- }()
- );
- var lerp = function(a2, b, t) {
- return new Vector(a2.x + (b.x - a2.x) * t, a2.y + (b.y - a2.y) * t);
- };
- var BezierCurve = (
- /** @class */
- function() {
- function BezierCurve2(start, startControl, endControl, end) {
- this.type = PathType.BEZIER_CURVE;
- this.start = start;
- this.startControl = startControl;
- this.endControl = endControl;
- this.end = end;
- }
- BezierCurve2.prototype.subdivide = function(t, firstHalf) {
- var ab = lerp(this.start, this.startControl, t);
- var bc = lerp(this.startControl, this.endControl, t);
- var cd = lerp(this.endControl, this.end, t);
- var abbc = lerp(ab, bc, t);
- var bccd = lerp(bc, cd, t);
- var dest = lerp(abbc, bccd, t);
- return firstHalf ? new BezierCurve2(this.start, ab, abbc, dest) : new BezierCurve2(dest, bccd, cd, this.end);
- };
- BezierCurve2.prototype.add = function(deltaX, deltaY) {
- return new BezierCurve2(this.start.add(deltaX, deltaY), this.startControl.add(deltaX, deltaY), this.endControl.add(deltaX, deltaY), this.end.add(deltaX, deltaY));
- };
- BezierCurve2.prototype.reverse = function() {
- return new BezierCurve2(this.end, this.endControl, this.startControl, this.start);
- };
- return BezierCurve2;
- }()
- );
- var isBezierCurve = function(path) {
- return path.type === PathType.BEZIER_CURVE;
- };
- var BoundCurves = (
- /** @class */
- function() {
- function BoundCurves2(element) {
- var styles = element.styles;
- var bounds = element.bounds;
- var _a = getAbsoluteValueForTuple(styles.borderTopLeftRadius, bounds.width, bounds.height), tlh = _a[0], tlv = _a[1];
- var _b = getAbsoluteValueForTuple(styles.borderTopRightRadius, bounds.width, bounds.height), trh = _b[0], trv = _b[1];
- var _c = getAbsoluteValueForTuple(styles.borderBottomRightRadius, bounds.width, bounds.height), brh = _c[0], brv = _c[1];
- var _d = getAbsoluteValueForTuple(styles.borderBottomLeftRadius, bounds.width, bounds.height), blh = _d[0], blv = _d[1];
- var factors = [];
- factors.push((tlh + trh) / bounds.width);
- factors.push((blh + brh) / bounds.width);
- factors.push((tlv + blv) / bounds.height);
- factors.push((trv + brv) / bounds.height);
- var maxFactor = Math.max.apply(Math, factors);
- if (maxFactor > 1) {
- tlh /= maxFactor;
- tlv /= maxFactor;
- trh /= maxFactor;
- trv /= maxFactor;
- brh /= maxFactor;
- brv /= maxFactor;
- blh /= maxFactor;
- blv /= maxFactor;
- }
- var topWidth = bounds.width - trh;
- var rightHeight = bounds.height - brv;
- var bottomWidth = bounds.width - brh;
- var leftHeight = bounds.height - blv;
- var borderTopWidth2 = styles.borderTopWidth;
- var borderRightWidth2 = styles.borderRightWidth;
- var borderBottomWidth2 = styles.borderBottomWidth;
- var borderLeftWidth2 = styles.borderLeftWidth;
- var paddingTop2 = getAbsoluteValue(styles.paddingTop, element.bounds.width);
- var paddingRight2 = getAbsoluteValue(styles.paddingRight, element.bounds.width);
- var paddingBottom2 = getAbsoluteValue(styles.paddingBottom, element.bounds.width);
- var paddingLeft2 = getAbsoluteValue(styles.paddingLeft, element.bounds.width);
- this.topLeftBorderBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left, bounds.top, tlh, tlv, CORNER.TOP_LEFT) : new Vector(bounds.left, bounds.top);
- this.topRightBorderBox = trh > 0 || trv > 0 ? getCurvePoints(bounds.left + topWidth, bounds.top, trh, trv, CORNER.TOP_RIGHT) : new Vector(bounds.left + bounds.width, bounds.top);
- this.bottomRightBorderBox = brh > 0 || brv > 0 ? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh, brv, CORNER.BOTTOM_RIGHT) : new Vector(bounds.left + bounds.width, bounds.top + bounds.height);
- this.bottomLeftBorderBox = blh > 0 || blv > 0 ? getCurvePoints(bounds.left, bounds.top + leftHeight, blh, blv, CORNER.BOTTOM_LEFT) : new Vector(bounds.left, bounds.top + bounds.height);
- this.topLeftPaddingBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2, bounds.top + borderTopWidth2, Math.max(0, tlh - borderLeftWidth2), Math.max(0, tlv - borderTopWidth2), CORNER.TOP_LEFT) : new Vector(bounds.left + borderLeftWidth2, bounds.top + borderTopWidth2);
- this.topRightPaddingBox = trh > 0 || trv > 0 ? getCurvePoints(bounds.left + Math.min(topWidth, bounds.width + borderLeftWidth2), bounds.top + borderTopWidth2, topWidth > bounds.width + borderLeftWidth2 ? 0 : trh - borderLeftWidth2, trv - borderTopWidth2, CORNER.TOP_RIGHT) : new Vector(bounds.left + bounds.width - borderRightWidth2, bounds.top + borderTopWidth2);
- this.bottomRightPaddingBox = brh > 0 || brv > 0 ? getCurvePoints(bounds.left + Math.min(bottomWidth, bounds.width - borderLeftWidth2), bounds.top + Math.min(rightHeight, bounds.height + borderTopWidth2), Math.max(0, brh - borderRightWidth2), brv - borderBottomWidth2, CORNER.BOTTOM_RIGHT) : new Vector(bounds.left + bounds.width - borderRightWidth2, bounds.top + bounds.height - borderBottomWidth2);
- this.bottomLeftPaddingBox = blh > 0 || blv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2, bounds.top + leftHeight, Math.max(0, blh - borderLeftWidth2), blv - borderBottomWidth2, CORNER.BOTTOM_LEFT) : new Vector(bounds.left + borderLeftWidth2, bounds.top + bounds.height - borderBottomWidth2);
- this.topLeftContentBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2 + paddingLeft2, bounds.top + borderTopWidth2 + paddingTop2, Math.max(0, tlh - (borderLeftWidth2 + paddingLeft2)), Math.max(0, tlv - (borderTopWidth2 + paddingTop2)), CORNER.TOP_LEFT) : new Vector(bounds.left + borderLeftWidth2 + paddingLeft2, bounds.top + borderTopWidth2 + paddingTop2);
- this.topRightContentBox = trh > 0 || trv > 0 ? getCurvePoints(bounds.left + Math.min(topWidth, bounds.width + borderLeftWidth2 + paddingLeft2), bounds.top + borderTopWidth2 + paddingTop2, topWidth > bounds.width + borderLeftWidth2 + paddingLeft2 ? 0 : trh - borderLeftWidth2 + paddingLeft2, trv - (borderTopWidth2 + paddingTop2), CORNER.TOP_RIGHT) : new Vector(bounds.left + bounds.width - (borderRightWidth2 + paddingRight2), bounds.top + borderTopWidth2 + paddingTop2);
- this.bottomRightContentBox = brh > 0 || brv > 0 ? getCurvePoints(bounds.left + Math.min(bottomWidth, bounds.width - (borderLeftWidth2 + paddingLeft2)), bounds.top + Math.min(rightHeight, bounds.height + borderTopWidth2 + paddingTop2), Math.max(0, brh - (borderRightWidth2 + paddingRight2)), brv - (borderBottomWidth2 + paddingBottom2), CORNER.BOTTOM_RIGHT) : new Vector(bounds.left + bounds.width - (borderRightWidth2 + paddingRight2), bounds.top + bounds.height - (borderBottomWidth2 + paddingBottom2));
- this.bottomLeftContentBox = blh > 0 || blv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2 + paddingLeft2, bounds.top + leftHeight, Math.max(0, blh - (borderLeftWidth2 + paddingLeft2)), blv - (borderBottomWidth2 + paddingBottom2), CORNER.BOTTOM_LEFT) : new Vector(bounds.left + borderLeftWidth2 + paddingLeft2, bounds.top + bounds.height - (borderBottomWidth2 + paddingBottom2));
- }
- return BoundCurves2;
- }()
- );
- var CORNER;
- (function(CORNER2) {
- CORNER2[CORNER2["TOP_LEFT"] = 0] = "TOP_LEFT";
- CORNER2[CORNER2["TOP_RIGHT"] = 1] = "TOP_RIGHT";
- CORNER2[CORNER2["BOTTOM_RIGHT"] = 2] = "BOTTOM_RIGHT";
- CORNER2[CORNER2["BOTTOM_LEFT"] = 3] = "BOTTOM_LEFT";
- })(CORNER || (CORNER = {}));
- var getCurvePoints = function(x, y, r1, r2, position2) {
- var kappa = 4 * ((Math.sqrt(2) - 1) / 3);
- var ox = r1 * kappa;
- var oy = r2 * kappa;
- var xm = x + r1;
- var ym = y + r2;
- switch (position2) {
- case CORNER.TOP_LEFT:
- return new BezierCurve(new Vector(x, ym), new Vector(x, ym - oy), new Vector(xm - ox, y), new Vector(xm, y));
- case CORNER.TOP_RIGHT:
- return new BezierCurve(new Vector(x, y), new Vector(x + ox, y), new Vector(xm, ym - oy), new Vector(xm, ym));
- case CORNER.BOTTOM_RIGHT:
- return new BezierCurve(new Vector(xm, y), new Vector(xm, y + oy), new Vector(x + ox, ym), new Vector(x, ym));
- case CORNER.BOTTOM_LEFT:
- default:
- return new BezierCurve(new Vector(xm, ym), new Vector(xm - ox, ym), new Vector(x, y + oy), new Vector(x, y));
- }
- };
- var calculateBorderBoxPath = function(curves) {
- return [curves.topLeftBorderBox, curves.topRightBorderBox, curves.bottomRightBorderBox, curves.bottomLeftBorderBox];
- };
- var calculateContentBoxPath = function(curves) {
- return [
- curves.topLeftContentBox,
- curves.topRightContentBox,
- curves.bottomRightContentBox,
- curves.bottomLeftContentBox
- ];
- };
- var calculatePaddingBoxPath = function(curves) {
- return [
- curves.topLeftPaddingBox,
- curves.topRightPaddingBox,
- curves.bottomRightPaddingBox,
- curves.bottomLeftPaddingBox
- ];
- };
- var TransformEffect = (
- /** @class */
- function() {
- function TransformEffect2(offsetX, offsetY, matrix2) {
- this.type = 0;
- this.offsetX = offsetX;
- this.offsetY = offsetY;
- this.matrix = matrix2;
- this.target = 2 | 4;
- }
- return TransformEffect2;
- }()
- );
- var ClipEffect = (
- /** @class */
- function() {
- function ClipEffect2(path, target) {
- this.type = 1;
- this.target = target;
- this.path = path;
- }
- return ClipEffect2;
- }()
- );
- var isTransformEffect = function(effect) {
- return effect.type === 0;
- };
- var isClipEffect = function(effect) {
- return effect.type === 1;
- };
- var StackingContext = (
- /** @class */
- function() {
- function StackingContext2(container) {
- this.element = container;
- this.inlineLevel = [];
- this.nonInlineLevel = [];
- this.negativeZIndex = [];
- this.zeroOrAutoZIndexOrTransformedOrOpacity = [];
- this.positiveZIndex = [];
- this.nonPositionedFloats = [];
- this.nonPositionedInlineLevel = [];
- }
- return StackingContext2;
- }()
- );
- var ElementPaint = (
- /** @class */
- function() {
- function ElementPaint2(element, parentStack) {
- this.container = element;
- this.effects = parentStack.slice(0);
- this.curves = new BoundCurves(element);
- if (element.styles.transform !== null) {
- var offsetX = element.bounds.left + element.styles.transformOrigin[0].number;
- var offsetY = element.bounds.top + element.styles.transformOrigin[1].number;
- var matrix2 = element.styles.transform;
- this.effects.push(new TransformEffect(offsetX, offsetY, matrix2));
- }
- if (element.styles.overflowX !== OVERFLOW.VISIBLE) {
- var borderBox = calculateBorderBoxPath(this.curves);
- var paddingBox2 = calculatePaddingBoxPath(this.curves);
- if (equalPath(borderBox, paddingBox2)) {
- this.effects.push(new ClipEffect(
- borderBox,
- 2 | 4
- /* CONTENT */
- ));
- } else {
- this.effects.push(new ClipEffect(
- borderBox,
- 2
- /* BACKGROUND_BORDERS */
- ));
- this.effects.push(new ClipEffect(
- paddingBox2,
- 4
- /* CONTENT */
- ));
- }
- }
- }
- ElementPaint2.prototype.getParentEffects = function() {
- var effects = this.effects.slice(0);
- if (this.container.styles.overflowX !== OVERFLOW.VISIBLE) {
- var borderBox = calculateBorderBoxPath(this.curves);
- var paddingBox2 = calculatePaddingBoxPath(this.curves);
- if (!equalPath(borderBox, paddingBox2)) {
- effects.push(new ClipEffect(
- paddingBox2,
- 2 | 4
- /* CONTENT */
- ));
- }
- }
- return effects;
- };
- return ElementPaint2;
- }()
- );
- var parseStackTree = function(parent, stackingContext, realStackingContext, listItems) {
- parent.container.elements.forEach(function(child) {
- var treatAsRealStackingContext = contains(
- child.flags,
- 4
- /* CREATES_REAL_STACKING_CONTEXT */
- );
- var createsStackingContext2 = contains(
- child.flags,
- 2
- /* CREATES_STACKING_CONTEXT */
- );
- var paintContainer = new ElementPaint(child, parent.getParentEffects());
- if (contains(
- child.styles.display,
- 2048
- /* LIST_ITEM */
- )) {
- listItems.push(paintContainer);
- }
- var listOwnerItems = contains(
- child.flags,
- 8
- /* IS_LIST_OWNER */
- ) ? [] : listItems;
- if (treatAsRealStackingContext || createsStackingContext2) {
- var parentStack = treatAsRealStackingContext || child.styles.isPositioned() ? realStackingContext : stackingContext;
- var stack = new StackingContext(paintContainer);
- if (child.styles.isPositioned() || child.styles.opacity < 1 || child.styles.isTransformed()) {
- var order_1 = child.styles.zIndex.order;
- if (order_1 < 0) {
- var index_1 = 0;
- parentStack.negativeZIndex.some(function(current, i) {
- if (order_1 > current.element.container.styles.zIndex.order) {
- index_1 = i;
- return false;
- } else if (index_1 > 0) {
- return true;
- }
- return false;
- });
- parentStack.negativeZIndex.splice(index_1, 0, stack);
- } else if (order_1 > 0) {
- var index_2 = 0;
- parentStack.positiveZIndex.some(function(current, i) {
- if (order_1 > current.element.container.styles.zIndex.order) {
- index_2 = i + 1;
- return false;
- } else if (index_2 > 0) {
- return true;
- }
- return false;
- });
- parentStack.positiveZIndex.splice(index_2, 0, stack);
- } else {
- parentStack.zeroOrAutoZIndexOrTransformedOrOpacity.push(stack);
- }
- } else {
- if (child.styles.isFloating()) {
- parentStack.nonPositionedFloats.push(stack);
- } else {
- parentStack.nonPositionedInlineLevel.push(stack);
- }
- }
- parseStackTree(paintContainer, stack, treatAsRealStackingContext ? stack : realStackingContext, listOwnerItems);
- } else {
- if (child.styles.isInlineLevel()) {
- stackingContext.inlineLevel.push(paintContainer);
- } else {
- stackingContext.nonInlineLevel.push(paintContainer);
- }
- parseStackTree(paintContainer, stackingContext, realStackingContext, listOwnerItems);
- }
- if (contains(
- child.flags,
- 8
- /* IS_LIST_OWNER */
- )) {
- processListItems(child, listOwnerItems);
- }
- });
- };
- var processListItems = function(owner, elements) {
- var numbering = owner instanceof OLElementContainer ? owner.start : 1;
- var reversed = owner instanceof OLElementContainer ? owner.reversed : false;
- for (var i = 0; i < elements.length; i++) {
- var item = elements[i];
- if (item.container instanceof LIElementContainer && typeof item.container.value === "number" && item.container.value !== 0) {
- numbering = item.container.value;
- }
- item.listValue = createCounterText(numbering, item.container.styles.listStyleType, true);
- numbering += reversed ? -1 : 1;
- }
- };
- var parseStackingContexts = function(container) {
- var paintContainer = new ElementPaint(container, []);
- var root = new StackingContext(paintContainer);
- var listItems = [];
- parseStackTree(paintContainer, root, root, listItems);
- processListItems(paintContainer.container, listItems);
- return root;
- };
- var parsePathForBorder = function(curves, borderSide) {
- switch (borderSide) {
- case 0:
- return createPathFromCurves(curves.topLeftBorderBox, curves.topLeftPaddingBox, curves.topRightBorderBox, curves.topRightPaddingBox);
- case 1:
- return createPathFromCurves(curves.topRightBorderBox, curves.topRightPaddingBox, curves.bottomRightBorderBox, curves.bottomRightPaddingBox);
- case 2:
- return createPathFromCurves(curves.bottomRightBorderBox, curves.bottomRightPaddingBox, curves.bottomLeftBorderBox, curves.bottomLeftPaddingBox);
- case 3:
- default:
- return createPathFromCurves(curves.bottomLeftBorderBox, curves.bottomLeftPaddingBox, curves.topLeftBorderBox, curves.topLeftPaddingBox);
- }
- };
- var createPathFromCurves = function(outer1, inner1, outer2, inner2) {
- var path = [];
- if (isBezierCurve(outer1)) {
- path.push(outer1.subdivide(0.5, false));
- } else {
- path.push(outer1);
- }
- if (isBezierCurve(outer2)) {
- path.push(outer2.subdivide(0.5, true));
- } else {
- path.push(outer2);
- }
- if (isBezierCurve(inner2)) {
- path.push(inner2.subdivide(0.5, true).reverse());
- } else {
- path.push(inner2);
- }
- if (isBezierCurve(inner1)) {
- path.push(inner1.subdivide(0.5, false).reverse());
- } else {
- path.push(inner1);
- }
- return path;
- };
- var paddingBox = function(element) {
- var bounds = element.bounds;
- var styles = element.styles;
- return bounds.add(styles.borderLeftWidth, styles.borderTopWidth, -(styles.borderRightWidth + styles.borderLeftWidth), -(styles.borderTopWidth + styles.borderBottomWidth));
- };
- var contentBox = function(element) {
- var styles = element.styles;
- var bounds = element.bounds;
- var paddingLeft2 = getAbsoluteValue(styles.paddingLeft, bounds.width);
- var paddingRight2 = getAbsoluteValue(styles.paddingRight, bounds.width);
- var paddingTop2 = getAbsoluteValue(styles.paddingTop, bounds.width);
- var paddingBottom2 = getAbsoluteValue(styles.paddingBottom, bounds.width);
- return bounds.add(paddingLeft2 + styles.borderLeftWidth, paddingTop2 + styles.borderTopWidth, -(styles.borderRightWidth + styles.borderLeftWidth + paddingLeft2 + paddingRight2), -(styles.borderTopWidth + styles.borderBottomWidth + paddingTop2 + paddingBottom2));
- };
- var calculateBackgroundPositioningArea = function(backgroundOrigin2, element) {
- if (backgroundOrigin2 === 0) {
- return element.bounds;
- }
- if (backgroundOrigin2 === 2) {
- return contentBox(element);
- }
- return paddingBox(element);
- };
- var calculateBackgroundPaintingArea = function(backgroundClip2, element) {
- if (backgroundClip2 === BACKGROUND_CLIP.BORDER_BOX) {
- return element.bounds;
- }
- if (backgroundClip2 === BACKGROUND_CLIP.CONTENT_BOX) {
- return contentBox(element);
- }
- return paddingBox(element);
- };
- var calculateBackgroundRendering = function(container, index, intrinsicSize) {
- var backgroundPositioningArea = calculateBackgroundPositioningArea(getBackgroundValueForIndex(container.styles.backgroundOrigin, index), container);
- var backgroundPaintingArea = calculateBackgroundPaintingArea(getBackgroundValueForIndex(container.styles.backgroundClip, index), container);
- var backgroundImageSize = calculateBackgroundSize(getBackgroundValueForIndex(container.styles.backgroundSize, index), intrinsicSize, backgroundPositioningArea);
- var sizeWidth = backgroundImageSize[0], sizeHeight = backgroundImageSize[1];
- var position2 = getAbsoluteValueForTuple(getBackgroundValueForIndex(container.styles.backgroundPosition, index), backgroundPositioningArea.width - sizeWidth, backgroundPositioningArea.height - sizeHeight);
- var path = calculateBackgroundRepeatPath(getBackgroundValueForIndex(container.styles.backgroundRepeat, index), position2, backgroundImageSize, backgroundPositioningArea, backgroundPaintingArea);
- var offsetX = Math.round(backgroundPositioningArea.left + position2[0]);
- var offsetY = Math.round(backgroundPositioningArea.top + position2[1]);
- return [path, offsetX, offsetY, sizeWidth, sizeHeight];
- };
- var isAuto = function(token) {
- return isIdentToken(token) && token.value === BACKGROUND_SIZE.AUTO;
- };
- var hasIntrinsicValue = function(value) {
- return typeof value === "number";
- };
- var calculateBackgroundSize = function(size, _a, bounds) {
- var intrinsicWidth = _a[0], intrinsicHeight = _a[1], intrinsicProportion = _a[2];
- var first = size[0], second = size[1];
- if (isLengthPercentage(first) && second && isLengthPercentage(second)) {
- return [getAbsoluteValue(first, bounds.width), getAbsoluteValue(second, bounds.height)];
- }
- var hasIntrinsicProportion = hasIntrinsicValue(intrinsicProportion);
- if (isIdentToken(first) && (first.value === BACKGROUND_SIZE.CONTAIN || first.value === BACKGROUND_SIZE.COVER)) {
- if (hasIntrinsicValue(intrinsicProportion)) {
- var targetRatio = bounds.width / bounds.height;
- return targetRatio < intrinsicProportion !== (first.value === BACKGROUND_SIZE.COVER) ? [bounds.width, bounds.width / intrinsicProportion] : [bounds.height * intrinsicProportion, bounds.height];
- }
- return [bounds.width, bounds.height];
- }
- var hasIntrinsicWidth = hasIntrinsicValue(intrinsicWidth);
- var hasIntrinsicHeight = hasIntrinsicValue(intrinsicHeight);
- var hasIntrinsicDimensions = hasIntrinsicWidth || hasIntrinsicHeight;
- if (isAuto(first) && (!second || isAuto(second))) {
- if (hasIntrinsicWidth && hasIntrinsicHeight) {
- return [intrinsicWidth, intrinsicHeight];
- }
- if (!hasIntrinsicProportion && !hasIntrinsicDimensions) {
- return [bounds.width, bounds.height];
- }
- if (hasIntrinsicDimensions && hasIntrinsicProportion) {
- var width_1 = hasIntrinsicWidth ? intrinsicWidth : intrinsicHeight * intrinsicProportion;
- var height_1 = hasIntrinsicHeight ? intrinsicHeight : intrinsicWidth / intrinsicProportion;
- return [width_1, height_1];
- }
- var width_2 = hasIntrinsicWidth ? intrinsicWidth : bounds.width;
- var height_2 = hasIntrinsicHeight ? intrinsicHeight : bounds.height;
- return [width_2, height_2];
- }
- if (hasIntrinsicProportion) {
- var width_3 = 0;
- var height_3 = 0;
- if (isLengthPercentage(first)) {
- width_3 = getAbsoluteValue(first, bounds.width);
- } else if (isLengthPercentage(second)) {
- height_3 = getAbsoluteValue(second, bounds.height);
- }
- if (isAuto(first)) {
- width_3 = height_3 * intrinsicProportion;
- } else if (!second || isAuto(second)) {
- height_3 = width_3 / intrinsicProportion;
- }
- return [width_3, height_3];
- }
- var width = null;
- var height = null;
- if (isLengthPercentage(first)) {
- width = getAbsoluteValue(first, bounds.width);
- } else if (second && isLengthPercentage(second)) {
- height = getAbsoluteValue(second, bounds.height);
- }
- if (width !== null && (!second || isAuto(second))) {
- height = hasIntrinsicWidth && hasIntrinsicHeight ? width / intrinsicWidth * intrinsicHeight : bounds.height;
- }
- if (height !== null && isAuto(first)) {
- width = hasIntrinsicWidth && hasIntrinsicHeight ? height / intrinsicHeight * intrinsicWidth : bounds.width;
- }
- if (width !== null && height !== null) {
- return [width, height];
- }
- throw new Error("Unable to calculate background-size for element");
- };
- var getBackgroundValueForIndex = function(values, index) {
- var value = values[index];
- if (typeof value === "undefined") {
- return values[0];
- }
- return value;
- };
- var calculateBackgroundRepeatPath = function(repeat, _a, _b, backgroundPositioningArea, backgroundPaintingArea) {
- var x = _a[0], y = _a[1];
- var width = _b[0], height = _b[1];
- switch (repeat) {
- case BACKGROUND_REPEAT.REPEAT_X:
- return [
- new Vector(Math.round(backgroundPositioningArea.left), Math.round(backgroundPositioningArea.top + y)),
- new Vector(Math.round(backgroundPositioningArea.left + backgroundPositioningArea.width), Math.round(backgroundPositioningArea.top + y)),
- new Vector(Math.round(backgroundPositioningArea.left + backgroundPositioningArea.width), Math.round(height + backgroundPositioningArea.top + y)),
- new Vector(Math.round(backgroundPositioningArea.left), Math.round(height + backgroundPositioningArea.top + y))
- ];
- case BACKGROUND_REPEAT.REPEAT_Y:
- return [
- new Vector(Math.round(backgroundPositioningArea.left + x), Math.round(backgroundPositioningArea.top)),
- new Vector(Math.round(backgroundPositioningArea.left + x + width), Math.round(backgroundPositioningArea.top)),
- new Vector(Math.round(backgroundPositioningArea.left + x + width), Math.round(backgroundPositioningArea.height + backgroundPositioningArea.top)),
- new Vector(Math.round(backgroundPositioningArea.left + x), Math.round(backgroundPositioningArea.height + backgroundPositioningArea.top))
- ];
- case BACKGROUND_REPEAT.NO_REPEAT:
- return [
- new Vector(Math.round(backgroundPositioningArea.left + x), Math.round(backgroundPositioningArea.top + y)),
- new Vector(Math.round(backgroundPositioningArea.left + x + width), Math.round(backgroundPositioningArea.top + y)),
- new Vector(Math.round(backgroundPositioningArea.left + x + width), Math.round(backgroundPositioningArea.top + y + height)),
- new Vector(Math.round(backgroundPositioningArea.left + x), Math.round(backgroundPositioningArea.top + y + height))
- ];
- default:
- return [
- new Vector(Math.round(backgroundPaintingArea.left), Math.round(backgroundPaintingArea.top)),
- new Vector(Math.round(backgroundPaintingArea.left + backgroundPaintingArea.width), Math.round(backgroundPaintingArea.top)),
- new Vector(Math.round(backgroundPaintingArea.left + backgroundPaintingArea.width), Math.round(backgroundPaintingArea.height + backgroundPaintingArea.top)),
- new Vector(Math.round(backgroundPaintingArea.left), Math.round(backgroundPaintingArea.height + backgroundPaintingArea.top))
- ];
- }
- };
- var SMALL_IMAGE = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
- var SAMPLE_TEXT = "Hidden Text";
- var FontMetrics = (
- /** @class */
- function() {
- function FontMetrics2(document2) {
- this._data = {};
- this._document = document2;
- }
- FontMetrics2.prototype.parseMetrics = function(fontFamily2, fontSize2) {
- var container = this._document.createElement("div");
- var img = this._document.createElement("img");
- var span = this._document.createElement("span");
- var body = this._document.body;
- container.style.visibility = "hidden";
- container.style.fontFamily = fontFamily2;
- container.style.fontSize = fontSize2;
- container.style.margin = "0";
- container.style.padding = "0";
- body.appendChild(container);
- img.src = SMALL_IMAGE;
- img.width = 1;
- img.height = 1;
- img.style.margin = "0";
- img.style.padding = "0";
- img.style.verticalAlign = "baseline";
- span.style.fontFamily = fontFamily2;
- span.style.fontSize = fontSize2;
- span.style.margin = "0";
- span.style.padding = "0";
- span.appendChild(this._document.createTextNode(SAMPLE_TEXT));
- container.appendChild(span);
- container.appendChild(img);
- var baseline = img.offsetTop - span.offsetTop + 2;
- container.removeChild(span);
- container.appendChild(this._document.createTextNode(SAMPLE_TEXT));
- container.style.lineHeight = "normal";
- img.style.verticalAlign = "super";
- var middle = img.offsetTop - container.offsetTop + 2;
- body.removeChild(container);
- return { baseline, middle };
- };
- FontMetrics2.prototype.getMetrics = function(fontFamily2, fontSize2) {
- var key = fontFamily2 + " " + fontSize2;
- if (typeof this._data[key] === "undefined") {
- this._data[key] = this.parseMetrics(fontFamily2, fontSize2);
- }
- return this._data[key];
- };
- return FontMetrics2;
- }()
- );
- var MASK_OFFSET = 1e4;
- var CanvasRenderer = (
- /** @class */
- function() {
- function CanvasRenderer2(options) {
- this._activeEffects = [];
- this.canvas = options.canvas ? options.canvas : document.createElement("canvas");
- this.ctx = this.canvas.getContext("2d");
- this.options = options;
- this.canvas.width = Math.floor(options.width * options.scale);
- this.canvas.height = Math.floor(options.height * options.scale);
- this.canvas.style.width = options.width + "px";
- this.canvas.style.height = options.height + "px";
- this.fontMetrics = new FontMetrics(document);
- this.ctx.scale(this.options.scale, this.options.scale);
- this.ctx.translate(-options.x + options.scrollX, -options.y + options.scrollY);
- this.ctx.textBaseline = "bottom";
- this._activeEffects = [];
- Logger.getInstance(options.id).debug("Canvas renderer initialized (" + options.width + "x" + options.height + " at " + options.x + "," + options.y + ") with scale " + options.scale);
- }
- CanvasRenderer2.prototype.applyEffects = function(effects, target) {
- var _this2 = this;
- while (this._activeEffects.length) {
- this.popEffect();
- }
- effects.filter(function(effect) {
- return contains(effect.target, target);
- }).forEach(function(effect) {
- return _this2.applyEffect(effect);
- });
- };
- CanvasRenderer2.prototype.applyEffect = function(effect) {
- this.ctx.save();
- if (isTransformEffect(effect)) {
- this.ctx.translate(effect.offsetX, effect.offsetY);
- this.ctx.transform(effect.matrix[0], effect.matrix[1], effect.matrix[2], effect.matrix[3], effect.matrix[4], effect.matrix[5]);
- this.ctx.translate(-effect.offsetX, -effect.offsetY);
- }
- if (isClipEffect(effect)) {
- this.path(effect.path);
- this.ctx.clip();
- }
- this._activeEffects.push(effect);
- };
- CanvasRenderer2.prototype.popEffect = function() {
- this._activeEffects.pop();
- this.ctx.restore();
- };
- CanvasRenderer2.prototype.renderStack = function(stack) {
- return __awaiter(this, void 0, void 0, function() {
- var styles;
- return __generator(this, function(_a) {
- switch (_a.label) {
- case 0:
- styles = stack.element.container.styles;
- if (!styles.isVisible())
- return [3, 2];
- this.ctx.globalAlpha = styles.opacity;
- return [4, this.renderStackContent(stack)];
- case 1:
- _a.sent();
- _a.label = 2;
- case 2:
- return [
- 2
- /*return*/
- ];
- }
- });
- });
- };
- CanvasRenderer2.prototype.renderNode = function(paint) {
- return __awaiter(this, void 0, void 0, function() {
- return __generator(this, function(_a) {
- switch (_a.label) {
- case 0:
- if (!paint.container.styles.isVisible())
- return [3, 3];
- return [4, this.renderNodeBackgroundAndBorders(paint)];
- case 1:
- _a.sent();
- return [4, this.renderNodeContent(paint)];
- case 2:
- _a.sent();
- _a.label = 3;
- case 3:
- return [
- 2
- /*return*/
- ];
- }
- });
- });
- };
- CanvasRenderer2.prototype.renderTextWithLetterSpacing = function(text, letterSpacing2) {
- var _this2 = this;
- if (letterSpacing2 === 0) {
- this.ctx.fillText(text.text, text.bounds.left, text.bounds.top + text.bounds.height);
- } else {
- var letters = toCodePoints(text.text).map(function(i) {
- return fromCodePoint(i);
- });
- letters.reduce(function(left, letter) {
- _this2.ctx.fillText(letter, left, text.bounds.top + text.bounds.height);
- return left + _this2.ctx.measureText(letter).width;
- }, text.bounds.left);
- }
- };
- CanvasRenderer2.prototype.createFontStyle = function(styles) {
- var fontVariant2 = styles.fontVariant.filter(function(variant) {
- return variant === "normal" || variant === "small-caps";
- }).join("");
- var fontFamily2 = styles.fontFamily.join(", ");
- var fontSize2 = isDimensionToken(styles.fontSize) ? "" + styles.fontSize.number + styles.fontSize.unit : styles.fontSize.number + "px";
- return [
- [styles.fontStyle, fontVariant2, styles.fontWeight, fontSize2, fontFamily2].join(" "),
- fontFamily2,
- fontSize2
- ];
- };
- CanvasRenderer2.prototype.renderTextNode = function(text, styles) {
- return __awaiter(this, void 0, void 0, function() {
- var _a, font, fontFamily2, fontSize2;
- var _this2 = this;
- return __generator(this, function(_b) {
- _a = this.createFontStyle(styles), font = _a[0], fontFamily2 = _a[1], fontSize2 = _a[2];
- this.ctx.font = font;
- text.textBounds.forEach(function(text2) {
- _this2.ctx.fillStyle = asString(styles.color);
- _this2.renderTextWithLetterSpacing(text2, styles.letterSpacing);
- var textShadows = styles.textShadow;
- if (textShadows.length && text2.text.trim().length) {
- textShadows.slice(0).reverse().forEach(function(textShadow2) {
- _this2.ctx.shadowColor = asString(textShadow2.color);
- _this2.ctx.shadowOffsetX = textShadow2.offsetX.number * _this2.options.scale;
- _this2.ctx.shadowOffsetY = textShadow2.offsetY.number * _this2.options.scale;
- _this2.ctx.shadowBlur = textShadow2.blur.number;
- _this2.ctx.fillText(text2.text, text2.bounds.left, text2.bounds.top + text2.bounds.height);
- });
- _this2.ctx.shadowColor = "";
- _this2.ctx.shadowOffsetX = 0;
- _this2.ctx.shadowOffsetY = 0;
- _this2.ctx.shadowBlur = 0;
- }
- if (styles.textDecorationLine.length) {
- _this2.ctx.fillStyle = asString(styles.textDecorationColor || styles.color);
- styles.textDecorationLine.forEach(function(textDecorationLine2) {
- switch (textDecorationLine2) {
- case 1:
- var baseline = _this2.fontMetrics.getMetrics(fontFamily2, fontSize2).baseline;
- _this2.ctx.fillRect(text2.bounds.left, Math.round(text2.bounds.top + baseline), text2.bounds.width, 1);
- break;
- case 2:
- _this2.ctx.fillRect(text2.bounds.left, Math.round(text2.bounds.top), text2.bounds.width, 1);
- break;
- case 3:
- var middle = _this2.fontMetrics.getMetrics(fontFamily2, fontSize2).middle;
- _this2.ctx.fillRect(text2.bounds.left, Math.ceil(text2.bounds.top + middle), text2.bounds.width, 1);
- break;
- }
- });
- }
- });
- return [
- 2
- /*return*/
- ];
- });
- });
- };
- CanvasRenderer2.prototype.renderReplacedElement = function(container, curves, image2) {
- if (image2 && container.intrinsicWidth > 0 && container.intrinsicHeight > 0) {
- var box = contentBox(container);
- var path = calculatePaddingBoxPath(curves);
- this.path(path);
- this.ctx.save();
- this.ctx.clip();
- this.ctx.drawImage(image2, 0, 0, container.intrinsicWidth, container.intrinsicHeight, box.left, box.top, box.width, box.height);
- this.ctx.restore();
- }
- };
- CanvasRenderer2.prototype.renderNodeContent = function(paint) {
- return __awaiter(this, void 0, void 0, function() {
- var container, curves, styles, _i, _a, child, image2, e_1, image2, e_2, iframeRenderer, canvas, size, bounds, x, textBounds, img, image2, url, e_3, bounds;
- return __generator(this, function(_b) {
- switch (_b.label) {
- case 0:
- this.applyEffects(
- paint.effects,
- 4
- /* CONTENT */
- );
- container = paint.container;
- curves = paint.curves;
- styles = container.styles;
- _i = 0, _a = container.textNodes;
- _b.label = 1;
- case 1:
- if (!(_i < _a.length))
- return [3, 4];
- child = _a[_i];
- return [4, this.renderTextNode(child, styles)];
- case 2:
- _b.sent();
- _b.label = 3;
- case 3:
- _i++;
- return [3, 1];
- case 4:
- if (!(container instanceof ImageElementContainer))
- return [3, 8];
- _b.label = 5;
- case 5:
- _b.trys.push([5, 7, , 8]);
- return [4, this.options.cache.match(container.src)];
- case 6:
- image2 = _b.sent();
- this.renderReplacedElement(container, curves, image2);
- return [3, 8];
- case 7:
- e_1 = _b.sent();
- Logger.getInstance(this.options.id).error("Error loading image " + container.src);
- return [3, 8];
- case 8:
- if (container instanceof CanvasElementContainer) {
- this.renderReplacedElement(container, curves, container.canvas);
- }
- if (!(container instanceof SVGElementContainer))
- return [3, 12];
- _b.label = 9;
- case 9:
- _b.trys.push([9, 11, , 12]);
- return [4, this.options.cache.match(container.svg)];
- case 10:
- image2 = _b.sent();
- this.renderReplacedElement(container, curves, image2);
- return [3, 12];
- case 11:
- e_2 = _b.sent();
- Logger.getInstance(this.options.id).error("Error loading svg " + container.svg.substring(0, 255));
- return [3, 12];
- case 12:
- if (!(container instanceof IFrameElementContainer && container.tree))
- return [3, 14];
- iframeRenderer = new CanvasRenderer2({
- id: this.options.id,
- scale: this.options.scale,
- backgroundColor: container.backgroundColor,
- x: 0,
- y: 0,
- scrollX: 0,
- scrollY: 0,
- width: container.width,
- height: container.height,
- cache: this.options.cache,
- windowWidth: container.width,
- windowHeight: container.height
- });
- return [4, iframeRenderer.render(container.tree)];
- case 13:
- canvas = _b.sent();
- if (container.width && container.height) {
- this.ctx.drawImage(canvas, 0, 0, container.width, container.height, container.bounds.left, container.bounds.top, container.bounds.width, container.bounds.height);
- }
- _b.label = 14;
- case 14:
- if (container instanceof InputElementContainer) {
- size = Math.min(container.bounds.width, container.bounds.height);
- if (container.type === CHECKBOX) {
- if (container.checked) {
- this.ctx.save();
- this.path([
- new Vector(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79),
- new Vector(container.bounds.left + size * 0.16, container.bounds.top + size * 0.5549),
- new Vector(container.bounds.left + size * 0.27347, container.bounds.top + size * 0.44071),
- new Vector(container.bounds.left + size * 0.39694, container.bounds.top + size * 0.5649),
- new Vector(container.bounds.left + size * 0.72983, container.bounds.top + size * 0.23),
- new Vector(container.bounds.left + size * 0.84, container.bounds.top + size * 0.34085),
- new Vector(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79)
- ]);
- this.ctx.fillStyle = asString(INPUT_COLOR);
- this.ctx.fill();
- this.ctx.restore();
- }
- } else if (container.type === RADIO) {
- if (container.checked) {
- this.ctx.save();
- this.ctx.beginPath();
- this.ctx.arc(container.bounds.left + size / 2, container.bounds.top + size / 2, size / 4, 0, Math.PI * 2, true);
- this.ctx.fillStyle = asString(INPUT_COLOR);
- this.ctx.fill();
- this.ctx.restore();
- }
- }
- }
- if (isTextInputElement(container) && container.value.length) {
- this.ctx.font = this.createFontStyle(styles)[0];
- this.ctx.fillStyle = asString(styles.color);
- this.ctx.textBaseline = "middle";
- this.ctx.textAlign = canvasTextAlign(container.styles.textAlign);
- bounds = contentBox(container);
- x = 0;
- switch (container.styles.textAlign) {
- case TEXT_ALIGN.CENTER:
- x += bounds.width / 2;
- break;
- case TEXT_ALIGN.RIGHT:
- x += bounds.width;
- break;
- }
- textBounds = bounds.add(x, 0, 0, -bounds.height / 2 + 1);
- this.ctx.save();
- this.path([
- new Vector(bounds.left, bounds.top),
- new Vector(bounds.left + bounds.width, bounds.top),
- new Vector(bounds.left + bounds.width, bounds.top + bounds.height),
- new Vector(bounds.left, bounds.top + bounds.height)
- ]);
- this.ctx.clip();
- this.renderTextWithLetterSpacing(new TextBounds(container.value, textBounds), styles.letterSpacing);
- this.ctx.restore();
- this.ctx.textBaseline = "bottom";
- this.ctx.textAlign = "left";
- }
- if (!contains(
- container.styles.display,
- 2048
- /* LIST_ITEM */
- ))
- return [3, 20];
- if (!(container.styles.listStyleImage !== null))
- return [3, 19];
- img = container.styles.listStyleImage;
- if (!(img.type === CSSImageType.URL))
- return [3, 18];
- image2 = void 0;
- url = img.url;
- _b.label = 15;
- case 15:
- _b.trys.push([15, 17, , 18]);
- return [4, this.options.cache.match(url)];
- case 16:
- image2 = _b.sent();
- this.ctx.drawImage(image2, container.bounds.left - (image2.width + 10), container.bounds.top);
- return [3, 18];
- case 17:
- e_3 = _b.sent();
- Logger.getInstance(this.options.id).error("Error loading list-style-image " + url);
- return [3, 18];
- case 18:
- return [3, 20];
- case 19:
- if (paint.listValue && container.styles.listStyleType !== LIST_STYLE_TYPE.NONE) {
- this.ctx.font = this.createFontStyle(styles)[0];
- this.ctx.fillStyle = asString(styles.color);
- this.ctx.textBaseline = "middle";
- this.ctx.textAlign = "right";
- bounds = new Bounds(container.bounds.left, container.bounds.top + getAbsoluteValue(container.styles.paddingTop, container.bounds.width), container.bounds.width, computeLineHeight(styles.lineHeight, styles.fontSize.number) / 2 + 1);
- this.renderTextWithLetterSpacing(new TextBounds(paint.listValue, bounds), styles.letterSpacing);
- this.ctx.textBaseline = "bottom";
- this.ctx.textAlign = "left";
- }
- _b.label = 20;
- case 20:
- return [
- 2
- /*return*/
- ];
- }
- });
- });
- };
- CanvasRenderer2.prototype.renderStackContent = function(stack) {
- return __awaiter(this, void 0, void 0, function() {
- var _i, _a, child, _b, _c, child, _d, _e, child, _f, _g, child, _h, _j, child, _k, _l, child, _m, _o, child;
- return __generator(this, function(_p) {
- switch (_p.label) {
- case 0:
- return [4, this.renderNodeBackgroundAndBorders(stack.element)];
- case 1:
- _p.sent();
- _i = 0, _a = stack.negativeZIndex;
- _p.label = 2;
- case 2:
- if (!(_i < _a.length))
- return [3, 5];
- child = _a[_i];
- return [4, this.renderStack(child)];
- case 3:
- _p.sent();
- _p.label = 4;
- case 4:
- _i++;
- return [3, 2];
- case 5:
- return [4, this.renderNodeContent(stack.element)];
- case 6:
- _p.sent();
- _b = 0, _c = stack.nonInlineLevel;
- _p.label = 7;
- case 7:
- if (!(_b < _c.length))
- return [3, 10];
- child = _c[_b];
- return [4, this.renderNode(child)];
- case 8:
- _p.sent();
- _p.label = 9;
- case 9:
- _b++;
- return [3, 7];
- case 10:
- _d = 0, _e = stack.nonPositionedFloats;
- _p.label = 11;
- case 11:
- if (!(_d < _e.length))
- return [3, 14];
- child = _e[_d];
- return [4, this.renderStack(child)];
- case 12:
- _p.sent();
- _p.label = 13;
- case 13:
- _d++;
- return [3, 11];
- case 14:
- _f = 0, _g = stack.nonPositionedInlineLevel;
- _p.label = 15;
- case 15:
- if (!(_f < _g.length))
- return [3, 18];
- child = _g[_f];
- return [4, this.renderStack(child)];
- case 16:
- _p.sent();
- _p.label = 17;
- case 17:
- _f++;
- return [3, 15];
- case 18:
- _h = 0, _j = stack.inlineLevel;
- _p.label = 19;
- case 19:
- if (!(_h < _j.length))
- return [3, 22];
- child = _j[_h];
- return [4, this.renderNode(child)];
- case 20:
- _p.sent();
- _p.label = 21;
- case 21:
- _h++;
- return [3, 19];
- case 22:
- _k = 0, _l = stack.zeroOrAutoZIndexOrTransformedOrOpacity;
- _p.label = 23;
- case 23:
- if (!(_k < _l.length))
- return [3, 26];
- child = _l[_k];
- return [4, this.renderStack(child)];
- case 24:
- _p.sent();
- _p.label = 25;
- case 25:
- _k++;
- return [3, 23];
- case 26:
- _m = 0, _o = stack.positiveZIndex;
- _p.label = 27;
- case 27:
- if (!(_m < _o.length))
- return [3, 30];
- child = _o[_m];
- return [4, this.renderStack(child)];
- case 28:
- _p.sent();
- _p.label = 29;
- case 29:
- _m++;
- return [3, 27];
- case 30:
- return [
- 2
- /*return*/
- ];
- }
- });
- });
- };
- CanvasRenderer2.prototype.mask = function(paths) {
- this.ctx.beginPath();
- this.ctx.moveTo(0, 0);
- this.ctx.lineTo(this.canvas.width, 0);
- this.ctx.lineTo(this.canvas.width, this.canvas.height);
- this.ctx.lineTo(0, this.canvas.height);
- this.ctx.lineTo(0, 0);
- this.formatPath(paths.slice(0).reverse());
- this.ctx.closePath();
- };
- CanvasRenderer2.prototype.path = function(paths) {
- this.ctx.beginPath();
- this.formatPath(paths);
- this.ctx.closePath();
- };
- CanvasRenderer2.prototype.formatPath = function(paths) {
- var _this2 = this;
- paths.forEach(function(point, index) {
- var start = isBezierCurve(point) ? point.start : point;
- if (index === 0) {
- _this2.ctx.moveTo(start.x, start.y);
- } else {
- _this2.ctx.lineTo(start.x, start.y);
- }
- if (isBezierCurve(point)) {
- _this2.ctx.bezierCurveTo(point.startControl.x, point.startControl.y, point.endControl.x, point.endControl.y, point.end.x, point.end.y);
- }
- });
- };
- CanvasRenderer2.prototype.renderRepeat = function(path, pattern, offsetX, offsetY) {
- this.path(path);
- this.ctx.fillStyle = pattern;
- this.ctx.translate(offsetX, offsetY);
- this.ctx.fill();
- this.ctx.translate(-offsetX, -offsetY);
- };
- CanvasRenderer2.prototype.resizeImage = function(image2, width, height) {
- if (image2.width === width && image2.height === height) {
- return image2;
- }
- var canvas = this.canvas.ownerDocument.createElement("canvas");
- canvas.width = width;
- canvas.height = height;
- var ctx = canvas.getContext("2d");
- ctx.drawImage(image2, 0, 0, image2.width, image2.height, 0, 0, width, height);
- return canvas;
- };
- CanvasRenderer2.prototype.renderBackgroundImage = function(container) {
- return __awaiter(this, void 0, void 0, function() {
- var index, _loop_1, this_1, _i, _a, backgroundImage2;
- return __generator(this, function(_b) {
- switch (_b.label) {
- case 0:
- index = container.styles.backgroundImage.length - 1;
- _loop_1 = function(backgroundImage3) {
- var image2, url, e_4, _a2, path, x, y, width, height, pattern, _b2, path, x, y, width, height, _c, lineLength, x0, x1, y0, y1, canvas, ctx, gradient_1, pattern, _d, path, left, top_1, width, height, position2, x, y, _e, rx, ry, radialGradient_1, midX, midY, f2, invF;
- return __generator(this, function(_f) {
- switch (_f.label) {
- case 0:
- if (!(backgroundImage3.type === CSSImageType.URL))
- return [3, 5];
- image2 = void 0;
- url = backgroundImage3.url;
- _f.label = 1;
- case 1:
- _f.trys.push([1, 3, , 4]);
- return [4, this_1.options.cache.match(url)];
- case 2:
- image2 = _f.sent();
- return [3, 4];
- case 3:
- e_4 = _f.sent();
- Logger.getInstance(this_1.options.id).error("Error loading background-image " + url);
- return [3, 4];
- case 4:
- if (image2) {
- _a2 = calculateBackgroundRendering(container, index, [
- image2.width,
- image2.height,
- image2.width / image2.height
- ]), path = _a2[0], x = _a2[1], y = _a2[2], width = _a2[3], height = _a2[4];
- pattern = this_1.ctx.createPattern(this_1.resizeImage(image2, width, height), "repeat");
- this_1.renderRepeat(path, pattern, x, y);
- }
- return [3, 6];
- case 5:
- if (isLinearGradient(backgroundImage3)) {
- _b2 = calculateBackgroundRendering(container, index, [null, null, null]), path = _b2[0], x = _b2[1], y = _b2[2], width = _b2[3], height = _b2[4];
- _c = calculateGradientDirection(backgroundImage3.angle, width, height), lineLength = _c[0], x0 = _c[1], x1 = _c[2], y0 = _c[3], y1 = _c[4];
- canvas = document.createElement("canvas");
- canvas.width = width;
- canvas.height = height;
- ctx = canvas.getContext("2d");
- gradient_1 = ctx.createLinearGradient(x0, y0, x1, y1);
- processColorStops(backgroundImage3.stops, lineLength).forEach(function(colorStop) {
- return gradient_1.addColorStop(colorStop.stop, asString(colorStop.color));
- });
- ctx.fillStyle = gradient_1;
- ctx.fillRect(0, 0, width, height);
- if (width > 0 && height > 0) {
- pattern = this_1.ctx.createPattern(canvas, "repeat");
- this_1.renderRepeat(path, pattern, x, y);
- }
- } else if (isRadialGradient(backgroundImage3)) {
- _d = calculateBackgroundRendering(container, index, [
- null,
- null,
- null
- ]), path = _d[0], left = _d[1], top_1 = _d[2], width = _d[3], height = _d[4];
- position2 = backgroundImage3.position.length === 0 ? [FIFTY_PERCENT] : backgroundImage3.position;
- x = getAbsoluteValue(position2[0], width);
- y = getAbsoluteValue(position2[position2.length - 1], height);
- _e = calculateRadius(backgroundImage3, x, y, width, height), rx = _e[0], ry = _e[1];
- if (rx > 0 && rx > 0) {
- radialGradient_1 = this_1.ctx.createRadialGradient(left + x, top_1 + y, 0, left + x, top_1 + y, rx);
- processColorStops(backgroundImage3.stops, rx * 2).forEach(function(colorStop) {
- return radialGradient_1.addColorStop(colorStop.stop, asString(colorStop.color));
- });
- this_1.path(path);
- this_1.ctx.fillStyle = radialGradient_1;
- if (rx !== ry) {
- midX = container.bounds.left + 0.5 * container.bounds.width;
- midY = container.bounds.top + 0.5 * container.bounds.height;
- f2 = ry / rx;
- invF = 1 / f2;
- this_1.ctx.save();
- this_1.ctx.translate(midX, midY);
- this_1.ctx.transform(1, 0, 0, f2, 0, 0);
- this_1.ctx.translate(-midX, -midY);
- this_1.ctx.fillRect(left, invF * (top_1 - midY) + midY, width, height * invF);
- this_1.ctx.restore();
- } else {
- this_1.ctx.fill();
- }
- }
- }
- _f.label = 6;
- case 6:
- index--;
- return [
- 2
- /*return*/
- ];
- }
- });
- };
- this_1 = this;
- _i = 0, _a = container.styles.backgroundImage.slice(0).reverse();
- _b.label = 1;
- case 1:
- if (!(_i < _a.length))
- return [3, 4];
- backgroundImage2 = _a[_i];
- return [5, _loop_1(backgroundImage2)];
- case 2:
- _b.sent();
- _b.label = 3;
- case 3:
- _i++;
- return [3, 1];
- case 4:
- return [
- 2
- /*return*/
- ];
- }
- });
- });
- };
- CanvasRenderer2.prototype.renderBorder = function(color2, side, curvePoints) {
- return __awaiter(this, void 0, void 0, function() {
- return __generator(this, function(_a) {
- this.path(parsePathForBorder(curvePoints, side));
- this.ctx.fillStyle = asString(color2);
- this.ctx.fill();
- return [
- 2
- /*return*/
- ];
- });
- });
- };
- CanvasRenderer2.prototype.renderNodeBackgroundAndBorders = function(paint) {
- return __awaiter(this, void 0, void 0, function() {
- var styles, hasBackground, borders, backgroundPaintingArea, side, _i, borders_1, border;
- var _this2 = this;
- return __generator(this, function(_a) {
- switch (_a.label) {
- case 0:
- this.applyEffects(
- paint.effects,
- 2
- /* BACKGROUND_BORDERS */
- );
- styles = paint.container.styles;
- hasBackground = !isTransparent(styles.backgroundColor) || styles.backgroundImage.length;
- borders = [
- { style: styles.borderTopStyle, color: styles.borderTopColor },
- { style: styles.borderRightStyle, color: styles.borderRightColor },
- { style: styles.borderBottomStyle, color: styles.borderBottomColor },
- { style: styles.borderLeftStyle, color: styles.borderLeftColor }
- ];
- backgroundPaintingArea = calculateBackgroundCurvedPaintingArea(getBackgroundValueForIndex(styles.backgroundClip, 0), paint.curves);
- if (!(hasBackground || styles.boxShadow.length))
- return [3, 2];
- this.ctx.save();
- this.path(backgroundPaintingArea);
- this.ctx.clip();
- if (!isTransparent(styles.backgroundColor)) {
- this.ctx.fillStyle = asString(styles.backgroundColor);
- this.ctx.fill();
- }
- return [4, this.renderBackgroundImage(paint.container)];
- case 1:
- _a.sent();
- this.ctx.restore();
- styles.boxShadow.slice(0).reverse().forEach(function(shadow) {
- _this2.ctx.save();
- var borderBoxArea = calculateBorderBoxPath(paint.curves);
- var maskOffset = shadow.inset ? 0 : MASK_OFFSET;
- var shadowPaintingArea = transformPath(borderBoxArea, -maskOffset + (shadow.inset ? 1 : -1) * shadow.spread.number, (shadow.inset ? 1 : -1) * shadow.spread.number, shadow.spread.number * (shadow.inset ? -2 : 2), shadow.spread.number * (shadow.inset ? -2 : 2));
- if (shadow.inset) {
- _this2.path(borderBoxArea);
- _this2.ctx.clip();
- _this2.mask(shadowPaintingArea);
- } else {
- _this2.mask(borderBoxArea);
- _this2.ctx.clip();
- _this2.path(shadowPaintingArea);
- }
- _this2.ctx.shadowOffsetX = shadow.offsetX.number + maskOffset;
- _this2.ctx.shadowOffsetY = shadow.offsetY.number;
- _this2.ctx.shadowColor = asString(shadow.color);
- _this2.ctx.shadowBlur = shadow.blur.number;
- _this2.ctx.fillStyle = shadow.inset ? asString(shadow.color) : "rgba(0,0,0,1)";
- _this2.ctx.fill();
- _this2.ctx.restore();
- });
- _a.label = 2;
- case 2:
- side = 0;
- _i = 0, borders_1 = borders;
- _a.label = 3;
- case 3:
- if (!(_i < borders_1.length))
- return [3, 7];
- border = borders_1[_i];
- if (!(border.style !== BORDER_STYLE.NONE && !isTransparent(border.color)))
- return [3, 5];
- return [4, this.renderBorder(border.color, side, paint.curves)];
- case 4:
- _a.sent();
- _a.label = 5;
- case 5:
- side++;
- _a.label = 6;
- case 6:
- _i++;
- return [3, 3];
- case 7:
- return [
- 2
- /*return*/
- ];
- }
- });
- });
- };
- CanvasRenderer2.prototype.render = function(element) {
- return __awaiter(this, void 0, void 0, function() {
- var stack;
- return __generator(this, function(_a) {
- switch (_a.label) {
- case 0:
- if (this.options.backgroundColor) {
- this.ctx.fillStyle = asString(this.options.backgroundColor);
- this.ctx.fillRect(this.options.x - this.options.scrollX, this.options.y - this.options.scrollY, this.options.width, this.options.height);
- }
- stack = parseStackingContexts(element);
- return [4, this.renderStack(stack)];
- case 1:
- _a.sent();
- this.applyEffects(
- [],
- 2
- /* BACKGROUND_BORDERS */
- );
- return [2, this.canvas];
- }
- });
- });
- };
- return CanvasRenderer2;
- }()
- );
- var isTextInputElement = function(container) {
- if (container instanceof TextareaElementContainer) {
- return true;
- } else if (container instanceof SelectElementContainer) {
- return true;
- } else if (container instanceof InputElementContainer && container.type !== RADIO && container.type !== CHECKBOX) {
- return true;
- }
- return false;
- };
- var calculateBackgroundCurvedPaintingArea = function(clip, curves) {
- switch (clip) {
- case BACKGROUND_CLIP.BORDER_BOX:
- return calculateBorderBoxPath(curves);
- case BACKGROUND_CLIP.CONTENT_BOX:
- return calculateContentBoxPath(curves);
- case BACKGROUND_CLIP.PADDING_BOX:
- default:
- return calculatePaddingBoxPath(curves);
- }
- };
- var canvasTextAlign = function(textAlign2) {
- switch (textAlign2) {
- case TEXT_ALIGN.CENTER:
- return "center";
- case TEXT_ALIGN.RIGHT:
- return "right";
- case TEXT_ALIGN.LEFT:
- default:
- return "left";
- }
- };
- var ForeignObjectRenderer = (
- /** @class */
- function() {
- function ForeignObjectRenderer2(options) {
- this.canvas = options.canvas ? options.canvas : document.createElement("canvas");
- this.ctx = this.canvas.getContext("2d");
- this.options = options;
- this.canvas.width = Math.floor(options.width * options.scale);
- this.canvas.height = Math.floor(options.height * options.scale);
- this.canvas.style.width = options.width + "px";
- this.canvas.style.height = options.height + "px";
- this.ctx.scale(this.options.scale, this.options.scale);
- this.ctx.translate(-options.x + options.scrollX, -options.y + options.scrollY);
- Logger.getInstance(options.id).debug("EXPERIMENTAL ForeignObject renderer initialized (" + options.width + "x" + options.height + " at " + options.x + "," + options.y + ") with scale " + options.scale);
- }
- ForeignObjectRenderer2.prototype.render = function(element) {
- return __awaiter(this, void 0, void 0, function() {
- var svg, img;
- return __generator(this, function(_a) {
- switch (_a.label) {
- case 0:
- svg = createForeignObjectSVG(Math.max(this.options.windowWidth, this.options.width) * this.options.scale, Math.max(this.options.windowHeight, this.options.height) * this.options.scale, this.options.scrollX * this.options.scale, this.options.scrollY * this.options.scale, element);
- return [4, loadSerializedSVG$1(svg)];
- case 1:
- img = _a.sent();
- if (this.options.backgroundColor) {
- this.ctx.fillStyle = asString(this.options.backgroundColor);
- this.ctx.fillRect(0, 0, this.options.width * this.options.scale, this.options.height * this.options.scale);
- }
- this.ctx.drawImage(img, -this.options.x * this.options.scale, -this.options.y * this.options.scale);
- return [2, this.canvas];
- }
- });
- });
- };
- return ForeignObjectRenderer2;
- }()
- );
- var loadSerializedSVG$1 = function(svg) {
- return new Promise(function(resolve, reject) {
- var img = new Image();
- img.onload = function() {
- resolve(img);
- };
- img.onerror = reject;
- img.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(new XMLSerializer().serializeToString(svg));
- });
- };
- var _this = void 0;
- var parseColor$1 = function(value) {
- return color.parse(Parser.create(value).parseComponentValue());
- };
- var html2canvas = function(element, options) {
- if (options === void 0) {
- options = {};
- }
- return renderElement(element, options);
- };
- CacheStorage.setContext(window);
- var renderElement = function(element, opts) {
- return __awaiter(_this, void 0, void 0, function() {
- var ownerDocument, defaultView, instanceName, _a, width, height, left, top, defaultResourceOptions, resourceOptions, defaultOptions, options, windowBounds, documentCloner, clonedElement, container, documentBackgroundColor, bodyBackgroundColor, bgColor, defaultBackgroundColor, backgroundColor2, renderOptions, canvas, renderer, root, renderer;
- return __generator(this, function(_b) {
- switch (_b.label) {
- case 0:
- ownerDocument = element.ownerDocument;
- if (!ownerDocument) {
- throw new Error("Element is not attached to a Document");
- }
- defaultView = ownerDocument.defaultView;
- if (!defaultView) {
- throw new Error("Document is not attached to a Window");
- }
- instanceName = (Math.round(Math.random() * 1e3) + Date.now()).toString(16);
- _a = isBodyElement(element) || isHTMLElement(element) ? parseDocumentSize(ownerDocument) : parseBounds(element), width = _a.width, height = _a.height, left = _a.left, top = _a.top;
- defaultResourceOptions = {
- allowTaint: false,
- imageTimeout: 15e3,
- proxy: void 0,
- useCORS: false
- };
- resourceOptions = __assign({}, defaultResourceOptions, opts);
- defaultOptions = {
- backgroundColor: "#ffffff",
- cache: opts.cache ? opts.cache : CacheStorage.create(instanceName, resourceOptions),
- logging: true,
- removeContainer: true,
- foreignObjectRendering: false,
- scale: defaultView.devicePixelRatio || 1,
- windowWidth: defaultView.innerWidth,
- windowHeight: defaultView.innerHeight,
- scrollX: defaultView.pageXOffset,
- scrollY: defaultView.pageYOffset,
- x: left,
- y: top,
- width: Math.ceil(width),
- height: Math.ceil(height),
- id: instanceName
- };
- options = __assign({}, defaultOptions, resourceOptions, opts);
- windowBounds = new Bounds(options.scrollX, options.scrollY, options.windowWidth, options.windowHeight);
- Logger.create(instanceName);
- Logger.getInstance(instanceName).debug("Starting document clone");
- documentCloner = new DocumentCloner(element, {
- id: instanceName,
- onclone: options.onclone,
- ignoreElements: options.ignoreElements,
- inlineImages: options.foreignObjectRendering,
- copyStyles: options.foreignObjectRendering
- });
- clonedElement = documentCloner.clonedReferenceElement;
- if (!clonedElement) {
- return [2, Promise.reject("Unable to find element in cloned iframe")];
- }
- return [4, documentCloner.toIFrame(ownerDocument, windowBounds)];
- case 1:
- container = _b.sent();
- documentBackgroundColor = ownerDocument.documentElement ? parseColor$1(getComputedStyle(ownerDocument.documentElement).backgroundColor) : COLORS.TRANSPARENT;
- bodyBackgroundColor = ownerDocument.body ? parseColor$1(getComputedStyle(ownerDocument.body).backgroundColor) : COLORS.TRANSPARENT;
- bgColor = opts.backgroundColor;
- defaultBackgroundColor = typeof bgColor === "string" ? parseColor$1(bgColor) : bgColor === null ? COLORS.TRANSPARENT : 4294967295;
- backgroundColor2 = element === ownerDocument.documentElement ? isTransparent(documentBackgroundColor) ? isTransparent(bodyBackgroundColor) ? defaultBackgroundColor : bodyBackgroundColor : documentBackgroundColor : defaultBackgroundColor;
- renderOptions = {
- id: instanceName,
- cache: options.cache,
- backgroundColor: backgroundColor2,
- scale: options.scale,
- x: options.x,
- y: options.y,
- scrollX: options.scrollX,
- scrollY: options.scrollY,
- width: options.width,
- height: options.height,
- windowWidth: options.windowWidth,
- windowHeight: options.windowHeight
- };
- if (!options.foreignObjectRendering)
- return [3, 3];
- Logger.getInstance(instanceName).debug("Document cloned, using foreign object rendering");
- renderer = new ForeignObjectRenderer(renderOptions);
- return [4, renderer.render(clonedElement)];
- case 2:
- canvas = _b.sent();
- return [3, 5];
- case 3:
- Logger.getInstance(instanceName).debug("Document cloned, using computed rendering");
- CacheStorage.attachInstance(options.cache);
- Logger.getInstance(instanceName).debug("Starting DOM parsing");
- root = parseTree(clonedElement);
- CacheStorage.detachInstance();
- if (backgroundColor2 === root.styles.backgroundColor) {
- root.styles.backgroundColor = COLORS.TRANSPARENT;
- }
- Logger.getInstance(instanceName).debug("Starting renderer");
- renderer = new CanvasRenderer(renderOptions);
- return [4, renderer.render(root)];
- case 4:
- canvas = _b.sent();
- _b.label = 5;
- case 5:
- if (options.removeContainer === true) {
- if (!cleanContainer(container)) {
- Logger.getInstance(instanceName).error("Cannot detach cloned iframe as it is not in the DOM anymore");
- }
- }
- Logger.getInstance(instanceName).debug("Finished rendering");
- Logger.destroy(instanceName);
- CacheStorage.destroy(instanceName);
- return [2, canvas];
- }
- });
- });
- };
- var cleanContainer = function(container) {
- if (container.parentNode) {
- container.parentNode.removeChild(container);
- return true;
- }
- return false;
- };
- var html2canvas_esm_default = html2canvas;
- export {
- html2canvas_esm_default as default
- };
- /*! Bundled license information:
- html2canvas/dist/html2canvas.esm.js:
- (*!
- * html2canvas 1.0.0-rc.4 <https://html2canvas.hertzen.com>
- * Copyright (c) 2019 Niklas von Hertzen <https://hertzen.com>
- * Released under MIT License
- *)
- (*! *****************************************************************************
- Copyright (c) Microsoft Corporation. All rights reserved.
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
- this file except in compliance with the License. You may obtain a copy of the
- License at http://www.apache.org/licenses/LICENSE-2.0
-
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
- MERCHANTABLITY OR NON-INFRINGEMENT.
-
- See the Apache Version 2.0 License for specific language governing permissions
- and limitations under the License.
- ***************************************************************************** *)
- */
- //# sourceMappingURL=html2canvas.js.map
|