axe.js 1.2 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720
  1. /*! axe v4.10.3
  2. * Copyright (c) 2015 - 2025 Deque Systems, Inc.
  3. *
  4. * Your use of this Source Code Form is subject to the terms of the Mozilla Public
  5. * License, v. 2.0. If a copy of the MPL was not distributed with this
  6. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  7. *
  8. * This entire copyright notice must appear in every copy of this file you
  9. * distribute or in any file that contains substantial portions of this source
  10. * code.
  11. */
  12. (function axeFunction(window) {
  13. var global = window;
  14. var document = window.document;
  15. 'use strict';
  16. function _typeof(o) {
  17. '@babel/helpers - typeof';
  18. return _typeof = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function(o) {
  19. return typeof o;
  20. } : function(o) {
  21. return o && 'function' == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? 'symbol' : typeof o;
  22. }, _typeof(o);
  23. }
  24. var axe = axe || {};
  25. axe.version = '4.10.3';
  26. if (typeof define === 'function' && define.amd) {
  27. define('axe-core', [], function() {
  28. return axe;
  29. });
  30. }
  31. if ((typeof module === 'undefined' ? 'undefined' : _typeof(module)) === 'object' && module.exports && typeof axeFunction.toString === 'function') {
  32. axe.source = '(' + axeFunction.toString() + ')(typeof window === "object" ? window : this);';
  33. module.exports = axe;
  34. }
  35. if (typeof window.getComputedStyle === 'function') {
  36. window.axe = axe;
  37. }
  38. var commons;
  39. function SupportError(error) {
  40. this.name = 'SupportError';
  41. this.cause = error.cause;
  42. this.message = '`'.concat(error.cause, '` - feature unsupported in your environment.');
  43. if (error.ruleId) {
  44. this.ruleId = error.ruleId;
  45. this.message += ' Skipping '.concat(this.ruleId, ' rule.');
  46. }
  47. this.stack = new Error().stack;
  48. }
  49. SupportError.prototype = Object.create(Error.prototype);
  50. SupportError.prototype.constructor = SupportError;
  51. 'use strict';
  52. var _excluded = [ 'node' ], _excluded2 = [ 'relatedNodes' ], _excluded3 = [ 'node' ], _excluded4 = [ 'variant' ], _excluded5 = [ 'matches' ], _excluded6 = [ 'chromium' ], _excluded7 = [ 'noImplicit' ], _excluded8 = [ 'noPresentational' ], _excluded9 = [ 'precision', 'format', 'inGamut' ], _excluded10 = [ 'space' ], _excluded11 = [ 'algorithm' ], _excluded12 = [ 'method' ], _excluded13 = [ 'maxDeltaE', 'deltaEMethod', 'steps', 'maxSteps' ], _excluded14 = [ 'node' ], _excluded15 = [ 'environmentData' ], _excluded16 = [ 'environmentData' ], _excluded17 = [ 'environmentData' ], _excluded18 = [ 'environmentData' ], _excluded19 = [ 'environmentData' ];
  53. function _toArray(r) {
  54. return _arrayWithHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableRest();
  55. }
  56. function _defineProperty(e, r, t) {
  57. return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
  58. value: t,
  59. enumerable: !0,
  60. configurable: !0,
  61. writable: !0
  62. }) : e[r] = t, e;
  63. }
  64. function _construct(t, e, r) {
  65. if (_isNativeReflectConstruct()) {
  66. return Reflect.construct.apply(null, arguments);
  67. }
  68. var o = [ null ];
  69. o.push.apply(o, e);
  70. var p = new (t.bind.apply(t, o))();
  71. return r && _setPrototypeOf(p, r.prototype), p;
  72. }
  73. function _callSuper(t, o, e) {
  74. return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
  75. }
  76. function _possibleConstructorReturn(t, e) {
  77. if (e && ('object' == _typeof(e) || 'function' == typeof e)) {
  78. return e;
  79. }
  80. if (void 0 !== e) {
  81. throw new TypeError('Derived constructors may only return object or undefined');
  82. }
  83. return _assertThisInitialized(t);
  84. }
  85. function _assertThisInitialized(e) {
  86. if (void 0 === e) {
  87. throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
  88. }
  89. return e;
  90. }
  91. function _isNativeReflectConstruct() {
  92. try {
  93. var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
  94. } catch (t) {}
  95. return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
  96. return !!t;
  97. })();
  98. }
  99. function _getPrototypeOf(t) {
  100. return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
  101. return t.__proto__ || Object.getPrototypeOf(t);
  102. }, _getPrototypeOf(t);
  103. }
  104. function _inherits(t, e) {
  105. if ('function' != typeof e && null !== e) {
  106. throw new TypeError('Super expression must either be null or a function');
  107. }
  108. t.prototype = Object.create(e && e.prototype, {
  109. constructor: {
  110. value: t,
  111. writable: !0,
  112. configurable: !0
  113. }
  114. }), Object.defineProperty(t, 'prototype', {
  115. writable: !1
  116. }), e && _setPrototypeOf(t, e);
  117. }
  118. function _setPrototypeOf(t, e) {
  119. return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
  120. return t.__proto__ = e, t;
  121. }, _setPrototypeOf(t, e);
  122. }
  123. function _classPrivateFieldInitSpec(e, t, a) {
  124. _checkPrivateRedeclaration(e, t), t.set(e, a);
  125. }
  126. function _classPrivateMethodInitSpec(e, a) {
  127. _checkPrivateRedeclaration(e, a), a.add(e);
  128. }
  129. function _checkPrivateRedeclaration(e, t) {
  130. if (t.has(e)) {
  131. throw new TypeError('Cannot initialize the same private elements twice on an object');
  132. }
  133. }
  134. function _classPrivateFieldGet(s, a) {
  135. return s.get(_assertClassBrand(s, a));
  136. }
  137. function _classPrivateFieldSet(s, a, r) {
  138. return s.set(_assertClassBrand(s, a), r), r;
  139. }
  140. function _assertClassBrand(e, t, n) {
  141. if ('function' == typeof e ? e === t : e.has(t)) {
  142. return arguments.length < 3 ? t : n;
  143. }
  144. throw new TypeError('Private element is not present on this object');
  145. }
  146. function _objectWithoutProperties(e, t) {
  147. if (null == e) {
  148. return {};
  149. }
  150. var o, r, i = _objectWithoutPropertiesLoose(e, t);
  151. if (Object.getOwnPropertySymbols) {
  152. var s = Object.getOwnPropertySymbols(e);
  153. for (r = 0; r < s.length; r++) {
  154. o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
  155. }
  156. }
  157. return i;
  158. }
  159. function _objectWithoutPropertiesLoose(r, e) {
  160. if (null == r) {
  161. return {};
  162. }
  163. var t = {};
  164. for (var n in r) {
  165. if ({}.hasOwnProperty.call(r, n)) {
  166. if (e.includes(n)) {
  167. continue;
  168. }
  169. t[n] = r[n];
  170. }
  171. }
  172. return t;
  173. }
  174. function _toConsumableArray(r) {
  175. return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
  176. }
  177. function _nonIterableSpread() {
  178. throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
  179. }
  180. function _iterableToArray(r) {
  181. if ('undefined' != typeof Symbol && null != r[Symbol.iterator] || null != r['@@iterator']) {
  182. return Array.from(r);
  183. }
  184. }
  185. function _arrayWithoutHoles(r) {
  186. if (Array.isArray(r)) {
  187. return _arrayLikeToArray(r);
  188. }
  189. }
  190. function _extends() {
  191. return _extends = Object.assign ? Object.assign.bind() : function(n) {
  192. for (var e = 1; e < arguments.length; e++) {
  193. var t = arguments[e];
  194. for (var r in t) {
  195. ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
  196. }
  197. }
  198. return n;
  199. }, _extends.apply(null, arguments);
  200. }
  201. function _slicedToArray(r, e) {
  202. return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
  203. }
  204. function _nonIterableRest() {
  205. throw new TypeError('Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
  206. }
  207. function _iterableToArrayLimit(r, l) {
  208. var t = null == r ? null : 'undefined' != typeof Symbol && r[Symbol.iterator] || r['@@iterator'];
  209. if (null != t) {
  210. var e, n, i, u, a = [], f = !0, o = !1;
  211. try {
  212. if (i = (t = t.call(r)).next, 0 === l) {
  213. if (Object(t) !== t) {
  214. return;
  215. }
  216. f = !1;
  217. } else {
  218. for (;!(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) {}
  219. }
  220. } catch (r) {
  221. o = !0, n = r;
  222. } finally {
  223. try {
  224. if (!f && null != t['return'] && (u = t['return'](), Object(u) !== u)) {
  225. return;
  226. }
  227. } finally {
  228. if (o) {
  229. throw n;
  230. }
  231. }
  232. }
  233. return a;
  234. }
  235. }
  236. function _arrayWithHoles(r) {
  237. if (Array.isArray(r)) {
  238. return r;
  239. }
  240. }
  241. function _classCallCheck(a, n) {
  242. if (!(a instanceof n)) {
  243. throw new TypeError('Cannot call a class as a function');
  244. }
  245. }
  246. function _defineProperties(e, r) {
  247. for (var t = 0; t < r.length; t++) {
  248. var o = r[t];
  249. o.enumerable = o.enumerable || !1, o.configurable = !0, 'value' in o && (o.writable = !0),
  250. Object.defineProperty(e, _toPropertyKey(o.key), o);
  251. }
  252. }
  253. function _createClass(e, r, t) {
  254. return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t),
  255. Object.defineProperty(e, 'prototype', {
  256. writable: !1
  257. }), e;
  258. }
  259. function _toPropertyKey(t) {
  260. var i = _toPrimitive(t, 'string');
  261. return 'symbol' == _typeof(i) ? i : i + '';
  262. }
  263. function _toPrimitive(t, r) {
  264. if ('object' != _typeof(t) || !t) {
  265. return t;
  266. }
  267. var e = t[Symbol.toPrimitive];
  268. if (void 0 !== e) {
  269. var i = e.call(t, r || 'default');
  270. if ('object' != _typeof(i)) {
  271. return i;
  272. }
  273. throw new TypeError('@@toPrimitive must return a primitive value.');
  274. }
  275. return ('string' === r ? String : Number)(t);
  276. }
  277. function _createForOfIteratorHelper(r, e) {
  278. var t = 'undefined' != typeof Symbol && r[Symbol.iterator] || r['@@iterator'];
  279. if (!t) {
  280. if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && 'number' == typeof r.length) {
  281. t && (r = t);
  282. var _n = 0, F = function F() {};
  283. return {
  284. s: F,
  285. n: function n() {
  286. return _n >= r.length ? {
  287. done: !0
  288. } : {
  289. done: !1,
  290. value: r[_n++]
  291. };
  292. },
  293. e: function e(r) {
  294. throw r;
  295. },
  296. f: F
  297. };
  298. }
  299. throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
  300. }
  301. var o, a = !0, u = !1;
  302. return {
  303. s: function s() {
  304. t = t.call(r);
  305. },
  306. n: function n() {
  307. var r = t.next();
  308. return a = r.done, r;
  309. },
  310. e: function e(r) {
  311. u = !0, o = r;
  312. },
  313. f: function f() {
  314. try {
  315. a || null == t['return'] || t['return']();
  316. } finally {
  317. if (u) {
  318. throw o;
  319. }
  320. }
  321. }
  322. };
  323. }
  324. function _unsupportedIterableToArray(r, a) {
  325. if (r) {
  326. if ('string' == typeof r) {
  327. return _arrayLikeToArray(r, a);
  328. }
  329. var t = {}.toString.call(r).slice(8, -1);
  330. return 'Object' === t && r.constructor && (t = r.constructor.name), 'Map' === t || 'Set' === t ? Array.from(r) : 'Arguments' === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
  331. }
  332. }
  333. function _arrayLikeToArray(r, a) {
  334. (null == a || a > r.length) && (a = r.length);
  335. for (var e = 0, n = Array(a); e < a; e++) {
  336. n[e] = r[e];
  337. }
  338. return n;
  339. }
  340. function _typeof(o) {
  341. '@babel/helpers - typeof';
  342. return _typeof = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function(o) {
  343. return typeof o;
  344. } : function(o) {
  345. return o && 'function' == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? 'symbol' : typeof o;
  346. }, _typeof(o);
  347. }
  348. (function(_Class_brand, _path, _CSS, _space, _r, _g, _b, _red, _green, _blue, _Class3_brand) {
  349. var __create = Object.create;
  350. var __defProp = Object.defineProperty;
  351. var __getProtoOf = Object.getPrototypeOf;
  352. var __hasOwnProp = Object.prototype.hasOwnProperty;
  353. var __getOwnPropNames = Object.getOwnPropertyNames;
  354. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  355. var __defNormalProp = function __defNormalProp(obj, key, value) {
  356. return key in obj ? __defProp(obj, key, {
  357. enumerable: true,
  358. configurable: true,
  359. writable: true,
  360. value: value
  361. }) : obj[key] = value;
  362. };
  363. var __markAsModule = function __markAsModule(target) {
  364. return __defProp(target, '__esModule', {
  365. value: true
  366. });
  367. };
  368. var __commonJS = function __commonJS(cb, mod) {
  369. return function() {
  370. return mod || cb((mod = {
  371. exports: {}
  372. }).exports, mod), mod.exports;
  373. };
  374. };
  375. var __export = function __export(target, all) {
  376. for (var name in all) {
  377. __defProp(target, name, {
  378. get: all[name],
  379. enumerable: true
  380. });
  381. }
  382. };
  383. var __exportStar = function __exportStar(target, module, desc) {
  384. if (module && _typeof(module) === 'object' || typeof module === 'function') {
  385. var _iterator = _createForOfIteratorHelper(__getOwnPropNames(module)), _step;
  386. try {
  387. var _loop = function _loop() {
  388. var key = _step.value;
  389. if (!__hasOwnProp.call(target, key) && key !== 'default') {
  390. __defProp(target, key, {
  391. get: function get() {
  392. return module[key];
  393. },
  394. enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable
  395. });
  396. }
  397. };
  398. for (_iterator.s(); !(_step = _iterator.n()).done; ) {
  399. _loop();
  400. }
  401. } catch (err) {
  402. _iterator.e(err);
  403. } finally {
  404. _iterator.f();
  405. }
  406. }
  407. return target;
  408. };
  409. var __toModule = function __toModule(module) {
  410. return __exportStar(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, 'default', module && module.__esModule && 'default' in module ? {
  411. get: function get() {
  412. return module['default'];
  413. },
  414. enumerable: true
  415. } : {
  416. value: module,
  417. enumerable: true
  418. })), module);
  419. };
  420. var __publicField = function __publicField(obj, key, value) {
  421. __defNormalProp(obj, _typeof(key) !== 'symbol' ? key + '' : key, value);
  422. return value;
  423. };
  424. var require_noop = __commonJS(function(exports, module) {
  425. 'use strict';
  426. module.exports = function() {};
  427. });
  428. var require_is_value = __commonJS(function(exports, module) {
  429. 'use strict';
  430. var _undefined = require_noop()();
  431. module.exports = function(val) {
  432. return val !== _undefined && val !== null;
  433. };
  434. });
  435. var require_normalize_options = __commonJS(function(exports, module) {
  436. 'use strict';
  437. var isValue = require_is_value();
  438. var forEach = Array.prototype.forEach;
  439. var create = Object.create;
  440. var process2 = function process2(src, obj) {
  441. var key;
  442. for (key in src) {
  443. obj[key] = src[key];
  444. }
  445. };
  446. module.exports = function(opts1) {
  447. var result = create(null);
  448. forEach.call(arguments, function(options) {
  449. if (!isValue(options)) {
  450. return;
  451. }
  452. process2(Object(options), result);
  453. });
  454. return result;
  455. };
  456. });
  457. var require_is_implemented = __commonJS(function(exports, module) {
  458. 'use strict';
  459. module.exports = function() {
  460. var sign = Math.sign;
  461. if (typeof sign !== 'function') {
  462. return false;
  463. }
  464. return sign(10) === 1 && sign(-20) === -1;
  465. };
  466. });
  467. var require_shim = __commonJS(function(exports, module) {
  468. 'use strict';
  469. module.exports = function(value) {
  470. value = Number(value);
  471. if (isNaN(value) || value === 0) {
  472. return value;
  473. }
  474. return value > 0 ? 1 : -1;
  475. };
  476. });
  477. var require_sign = __commonJS(function(exports, module) {
  478. 'use strict';
  479. module.exports = require_is_implemented()() ? Math.sign : require_shim();
  480. });
  481. var require_to_integer = __commonJS(function(exports, module) {
  482. 'use strict';
  483. var sign = require_sign();
  484. var abs = Math.abs;
  485. var floor = Math.floor;
  486. module.exports = function(value) {
  487. if (isNaN(value)) {
  488. return 0;
  489. }
  490. value = Number(value);
  491. if (value === 0 || !isFinite(value)) {
  492. return value;
  493. }
  494. return sign(value) * floor(abs(value));
  495. };
  496. });
  497. var require_to_pos_integer = __commonJS(function(exports, module) {
  498. 'use strict';
  499. var toInteger = require_to_integer();
  500. var max2 = Math.max;
  501. module.exports = function(value) {
  502. return max2(0, toInteger(value));
  503. };
  504. });
  505. var require_resolve_length = __commonJS(function(exports, module) {
  506. 'use strict';
  507. var toPosInt = require_to_pos_integer();
  508. module.exports = function(optsLength, fnLength, isAsync) {
  509. var length;
  510. if (isNaN(optsLength)) {
  511. length = fnLength;
  512. if (!(length >= 0)) {
  513. return 1;
  514. }
  515. if (isAsync && length) {
  516. return length - 1;
  517. }
  518. return length;
  519. }
  520. if (optsLength === false) {
  521. return false;
  522. }
  523. return toPosInt(optsLength);
  524. };
  525. });
  526. var require_valid_callable = __commonJS(function(exports, module) {
  527. 'use strict';
  528. module.exports = function(fn) {
  529. if (typeof fn !== 'function') {
  530. throw new TypeError(fn + ' is not a function');
  531. }
  532. return fn;
  533. };
  534. });
  535. var require_valid_value = __commonJS(function(exports, module) {
  536. 'use strict';
  537. var isValue = require_is_value();
  538. module.exports = function(value) {
  539. if (!isValue(value)) {
  540. throw new TypeError('Cannot use null or undefined');
  541. }
  542. return value;
  543. };
  544. });
  545. var require_iterate = __commonJS(function(exports, module) {
  546. 'use strict';
  547. var callable = require_valid_callable();
  548. var value = require_valid_value();
  549. var bind = Function.prototype.bind;
  550. var call = Function.prototype.call;
  551. var keys = Object.keys;
  552. var objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable;
  553. module.exports = function(method, defVal) {
  554. return function(obj, cb) {
  555. var list, thisArg = arguments[2], compareFn = arguments[3];
  556. obj = Object(value(obj));
  557. callable(cb);
  558. list = keys(obj);
  559. if (compareFn) {
  560. list.sort(typeof compareFn === 'function' ? bind.call(compareFn, obj) : void 0);
  561. }
  562. if (typeof method !== 'function') {
  563. method = list[method];
  564. }
  565. return call.call(method, list, function(key, index) {
  566. if (!objPropertyIsEnumerable.call(obj, key)) {
  567. return defVal;
  568. }
  569. return call.call(cb, thisArg, obj[key], key, obj, index);
  570. });
  571. };
  572. };
  573. });
  574. var require_for_each = __commonJS(function(exports, module) {
  575. 'use strict';
  576. module.exports = require_iterate()('forEach');
  577. });
  578. var require_registered_extensions = __commonJS(function() {
  579. 'use strict';
  580. });
  581. var require_is_implemented2 = __commonJS(function(exports, module) {
  582. 'use strict';
  583. module.exports = function() {
  584. var assign = Object.assign, obj;
  585. if (typeof assign !== 'function') {
  586. return false;
  587. }
  588. obj = {
  589. foo: 'raz'
  590. };
  591. assign(obj, {
  592. bar: 'dwa'
  593. }, {
  594. trzy: 'trzy'
  595. });
  596. return obj.foo + obj.bar + obj.trzy === 'razdwatrzy';
  597. };
  598. });
  599. var require_is_implemented3 = __commonJS(function(exports, module) {
  600. 'use strict';
  601. module.exports = function() {
  602. try {
  603. Object.keys('primitive');
  604. return true;
  605. } catch (e) {
  606. return false;
  607. }
  608. };
  609. });
  610. var require_shim2 = __commonJS(function(exports, module) {
  611. 'use strict';
  612. var isValue = require_is_value();
  613. var keys = Object.keys;
  614. module.exports = function(object) {
  615. return keys(isValue(object) ? Object(object) : object);
  616. };
  617. });
  618. var require_keys = __commonJS(function(exports, module) {
  619. 'use strict';
  620. module.exports = require_is_implemented3()() ? Object.keys : require_shim2();
  621. });
  622. var require_shim3 = __commonJS(function(exports, module) {
  623. 'use strict';
  624. var keys = require_keys();
  625. var value = require_valid_value();
  626. var max2 = Math.max;
  627. module.exports = function(dest, src) {
  628. var error, i, length = max2(arguments.length, 2), assign;
  629. dest = Object(value(dest));
  630. assign = function assign(key) {
  631. try {
  632. dest[key] = src[key];
  633. } catch (e) {
  634. if (!error) {
  635. error = e;
  636. }
  637. }
  638. };
  639. for (i = 1; i < length; ++i) {
  640. src = arguments[i];
  641. keys(src).forEach(assign);
  642. }
  643. if (error !== void 0) {
  644. throw error;
  645. }
  646. return dest;
  647. };
  648. });
  649. var require_assign = __commonJS(function(exports, module) {
  650. 'use strict';
  651. module.exports = require_is_implemented2()() ? Object.assign : require_shim3();
  652. });
  653. var require_is_object = __commonJS(function(exports, module) {
  654. 'use strict';
  655. var isValue = require_is_value();
  656. var map = {
  657. function: true,
  658. object: true
  659. };
  660. module.exports = function(value) {
  661. return isValue(value) && map[_typeof(value)] || false;
  662. };
  663. });
  664. var require_custom = __commonJS(function(exports, module) {
  665. 'use strict';
  666. var assign = require_assign();
  667. var isObject = require_is_object();
  668. var isValue = require_is_value();
  669. var captureStackTrace = Error.captureStackTrace;
  670. module.exports = function(message) {
  671. var err2 = new Error(message), code = arguments[1], ext = arguments[2];
  672. if (!isValue(ext)) {
  673. if (isObject(code)) {
  674. ext = code;
  675. code = null;
  676. }
  677. }
  678. if (isValue(ext)) {
  679. assign(err2, ext);
  680. }
  681. if (isValue(code)) {
  682. err2.code = code;
  683. }
  684. if (captureStackTrace) {
  685. captureStackTrace(err2, module.exports);
  686. }
  687. return err2;
  688. };
  689. });
  690. var require_mixin = __commonJS(function(exports, module) {
  691. 'use strict';
  692. var value = require_valid_value();
  693. var defineProperty = Object.defineProperty;
  694. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  695. var getOwnPropertyNames = Object.getOwnPropertyNames;
  696. var getOwnPropertySymbols = Object.getOwnPropertySymbols;
  697. module.exports = function(target, source) {
  698. var error, sourceObject = Object(value(source));
  699. target = Object(value(target));
  700. getOwnPropertyNames(sourceObject).forEach(function(name) {
  701. try {
  702. defineProperty(target, name, getOwnPropertyDescriptor(source, name));
  703. } catch (e) {
  704. error = e;
  705. }
  706. });
  707. if (typeof getOwnPropertySymbols === 'function') {
  708. getOwnPropertySymbols(sourceObject).forEach(function(symbol) {
  709. try {
  710. defineProperty(target, symbol, getOwnPropertyDescriptor(source, symbol));
  711. } catch (e) {
  712. error = e;
  713. }
  714. });
  715. }
  716. if (error !== void 0) {
  717. throw error;
  718. }
  719. return target;
  720. };
  721. });
  722. var require_define_length = __commonJS(function(exports, module) {
  723. 'use strict';
  724. var toPosInt = require_to_pos_integer();
  725. var test = function test(arg1, arg2) {
  726. return arg2;
  727. };
  728. var desc;
  729. var defineProperty;
  730. var generate;
  731. var mixin;
  732. try {
  733. Object.defineProperty(test, 'length', {
  734. configurable: true,
  735. writable: false,
  736. enumerable: false,
  737. value: 1
  738. });
  739. } catch (ignore) {}
  740. if (test.length === 1) {
  741. desc = {
  742. configurable: true,
  743. writable: false,
  744. enumerable: false
  745. };
  746. defineProperty = Object.defineProperty;
  747. module.exports = function(fn, length) {
  748. length = toPosInt(length);
  749. if (fn.length === length) {
  750. return fn;
  751. }
  752. desc.value = length;
  753. return defineProperty(fn, 'length', desc);
  754. };
  755. } else {
  756. mixin = require_mixin();
  757. generate = function() {
  758. var cache2 = [];
  759. return function(length) {
  760. var args, i = 0;
  761. if (cache2[length]) {
  762. return cache2[length];
  763. }
  764. args = [];
  765. while (length--) {
  766. args.push('a' + (++i).toString(36));
  767. }
  768. return new Function('fn', 'return function (' + args.join(', ') + ') { return fn.apply(this, arguments); };');
  769. };
  770. }();
  771. module.exports = function(src, length) {
  772. var target;
  773. length = toPosInt(length);
  774. if (src.length === length) {
  775. return src;
  776. }
  777. target = generate(length)(src);
  778. try {
  779. mixin(target, src);
  780. } catch (ignore) {}
  781. return target;
  782. };
  783. }
  784. });
  785. var require_is = __commonJS(function(exports, module) {
  786. 'use strict';
  787. var _undefined = void 0;
  788. module.exports = function(value) {
  789. return value !== _undefined && value !== null;
  790. };
  791. });
  792. var require_is2 = __commonJS(function(exports, module) {
  793. 'use strict';
  794. var isValue = require_is();
  795. var possibleTypes = {
  796. object: true,
  797. function: true,
  798. undefined: true
  799. };
  800. module.exports = function(value) {
  801. if (!isValue(value)) {
  802. return false;
  803. }
  804. return hasOwnProperty.call(possibleTypes, _typeof(value));
  805. };
  806. });
  807. var require_is3 = __commonJS(function(exports, module) {
  808. 'use strict';
  809. var isObject = require_is2();
  810. module.exports = function(value) {
  811. if (!isObject(value)) {
  812. return false;
  813. }
  814. try {
  815. if (!value.constructor) {
  816. return false;
  817. }
  818. return value.constructor.prototype === value;
  819. } catch (error) {
  820. return false;
  821. }
  822. };
  823. });
  824. var require_is4 = __commonJS(function(exports, module) {
  825. 'use strict';
  826. var isPrototype = require_is3();
  827. module.exports = function(value) {
  828. if (typeof value !== 'function') {
  829. return false;
  830. }
  831. if (!hasOwnProperty.call(value, 'length')) {
  832. return false;
  833. }
  834. try {
  835. if (typeof value.length !== 'number') {
  836. return false;
  837. }
  838. if (typeof value.call !== 'function') {
  839. return false;
  840. }
  841. if (typeof value.apply !== 'function') {
  842. return false;
  843. }
  844. } catch (error) {
  845. return false;
  846. }
  847. return !isPrototype(value);
  848. };
  849. });
  850. var require_is5 = __commonJS(function(exports, module) {
  851. 'use strict';
  852. var isFunction = require_is4();
  853. var classRe = /^\s*class[\s{/}]/;
  854. var functionToString = Function.prototype.toString;
  855. module.exports = function(value) {
  856. if (!isFunction(value)) {
  857. return false;
  858. }
  859. if (classRe.test(functionToString.call(value))) {
  860. return false;
  861. }
  862. return true;
  863. };
  864. });
  865. var require_is_implemented4 = __commonJS(function(exports, module) {
  866. 'use strict';
  867. var str = 'razdwatrzy';
  868. module.exports = function() {
  869. if (typeof str.contains !== 'function') {
  870. return false;
  871. }
  872. return str.contains('dwa') === true && str.contains('foo') === false;
  873. };
  874. });
  875. var require_shim4 = __commonJS(function(exports, module) {
  876. 'use strict';
  877. var indexOf = String.prototype.indexOf;
  878. module.exports = function(searchString) {
  879. return indexOf.call(this, searchString, arguments[1]) > -1;
  880. };
  881. });
  882. var require_contains = __commonJS(function(exports, module) {
  883. 'use strict';
  884. module.exports = require_is_implemented4()() ? String.prototype.contains : require_shim4();
  885. });
  886. var require_d = __commonJS(function(exports, module) {
  887. 'use strict';
  888. var isValue = require_is();
  889. var isPlainFunction = require_is5();
  890. var assign = require_assign();
  891. var normalizeOpts = require_normalize_options();
  892. var contains3 = require_contains();
  893. var d2 = module.exports = function(dscr, value) {
  894. var c4, e, w, options, desc;
  895. if (arguments.length < 2 || typeof dscr !== 'string') {
  896. options = value;
  897. value = dscr;
  898. dscr = null;
  899. } else {
  900. options = arguments[2];
  901. }
  902. if (isValue(dscr)) {
  903. c4 = contains3.call(dscr, 'c');
  904. e = contains3.call(dscr, 'e');
  905. w = contains3.call(dscr, 'w');
  906. } else {
  907. c4 = w = true;
  908. e = false;
  909. }
  910. desc = {
  911. value: value,
  912. configurable: c4,
  913. enumerable: e,
  914. writable: w
  915. };
  916. return !options ? desc : assign(normalizeOpts(options), desc);
  917. };
  918. d2.gs = function(dscr, get2, set2) {
  919. var c4, e, options, desc;
  920. if (typeof dscr !== 'string') {
  921. options = set2;
  922. set2 = get2;
  923. get2 = dscr;
  924. dscr = null;
  925. } else {
  926. options = arguments[3];
  927. }
  928. if (!isValue(get2)) {
  929. get2 = void 0;
  930. } else if (!isPlainFunction(get2)) {
  931. options = get2;
  932. get2 = set2 = void 0;
  933. } else if (!isValue(set2)) {
  934. set2 = void 0;
  935. } else if (!isPlainFunction(set2)) {
  936. options = set2;
  937. set2 = void 0;
  938. }
  939. if (isValue(dscr)) {
  940. c4 = contains3.call(dscr, 'c');
  941. e = contains3.call(dscr, 'e');
  942. } else {
  943. c4 = true;
  944. e = false;
  945. }
  946. desc = {
  947. get: get2,
  948. set: set2,
  949. configurable: c4,
  950. enumerable: e
  951. };
  952. return !options ? desc : assign(normalizeOpts(options), desc);
  953. };
  954. });
  955. var require_event_emitter = __commonJS(function(exports, module) {
  956. 'use strict';
  957. var d2 = require_d();
  958. var callable = require_valid_callable();
  959. var apply = Function.prototype.apply;
  960. var call = Function.prototype.call;
  961. var create = Object.create;
  962. var defineProperty = Object.defineProperty;
  963. var defineProperties = Object.defineProperties;
  964. var hasOwnProperty2 = Object.prototype.hasOwnProperty;
  965. var descriptor = {
  966. configurable: true,
  967. enumerable: false,
  968. writable: true
  969. };
  970. var on;
  971. var once;
  972. var off;
  973. var emit;
  974. var methods;
  975. var descriptors;
  976. var base;
  977. on = function on(type2, listener) {
  978. var data;
  979. callable(listener);
  980. if (!hasOwnProperty2.call(this, '__ee__')) {
  981. data = descriptor.value = create(null);
  982. defineProperty(this, '__ee__', descriptor);
  983. descriptor.value = null;
  984. } else {
  985. data = this.__ee__;
  986. }
  987. if (!data[type2]) {
  988. data[type2] = listener;
  989. } else if (_typeof(data[type2]) === 'object') {
  990. data[type2].push(listener);
  991. } else {
  992. data[type2] = [ data[type2], listener ];
  993. }
  994. return this;
  995. };
  996. once = function once(type2, listener) {
  997. var _once, self2;
  998. callable(listener);
  999. self2 = this;
  1000. on.call(this, type2, _once = function once2() {
  1001. off.call(self2, type2, _once);
  1002. apply.call(listener, this, arguments);
  1003. });
  1004. _once.__eeOnceListener__ = listener;
  1005. return this;
  1006. };
  1007. off = function off(type2, listener) {
  1008. var data, listeners, candidate, i;
  1009. callable(listener);
  1010. if (!hasOwnProperty2.call(this, '__ee__')) {
  1011. return this;
  1012. }
  1013. data = this.__ee__;
  1014. if (!data[type2]) {
  1015. return this;
  1016. }
  1017. listeners = data[type2];
  1018. if (_typeof(listeners) === 'object') {
  1019. for (i = 0; candidate = listeners[i]; ++i) {
  1020. if (candidate === listener || candidate.__eeOnceListener__ === listener) {
  1021. if (listeners.length === 2) {
  1022. data[type2] = listeners[i ? 0 : 1];
  1023. } else {
  1024. listeners.splice(i, 1);
  1025. }
  1026. }
  1027. }
  1028. } else {
  1029. if (listeners === listener || listeners.__eeOnceListener__ === listener) {
  1030. delete data[type2];
  1031. }
  1032. }
  1033. return this;
  1034. };
  1035. emit = function emit(type2) {
  1036. var i, l, listener, listeners, args;
  1037. if (!hasOwnProperty2.call(this, '__ee__')) {
  1038. return;
  1039. }
  1040. listeners = this.__ee__[type2];
  1041. if (!listeners) {
  1042. return;
  1043. }
  1044. if (_typeof(listeners) === 'object') {
  1045. l = arguments.length;
  1046. args = new Array(l - 1);
  1047. for (i = 1; i < l; ++i) {
  1048. args[i - 1] = arguments[i];
  1049. }
  1050. listeners = listeners.slice();
  1051. for (i = 0; listener = listeners[i]; ++i) {
  1052. apply.call(listener, this, args);
  1053. }
  1054. } else {
  1055. switch (arguments.length) {
  1056. case 1:
  1057. call.call(listeners, this);
  1058. break;
  1059. case 2:
  1060. call.call(listeners, this, arguments[1]);
  1061. break;
  1062. case 3:
  1063. call.call(listeners, this, arguments[1], arguments[2]);
  1064. break;
  1065. default:
  1066. l = arguments.length;
  1067. args = new Array(l - 1);
  1068. for (i = 1; i < l; ++i) {
  1069. args[i - 1] = arguments[i];
  1070. }
  1071. apply.call(listeners, this, args);
  1072. }
  1073. }
  1074. };
  1075. methods = {
  1076. on: on,
  1077. once: once,
  1078. off: off,
  1079. emit: emit
  1080. };
  1081. descriptors = {
  1082. on: d2(on),
  1083. once: d2(once),
  1084. off: d2(off),
  1085. emit: d2(emit)
  1086. };
  1087. base = defineProperties({}, descriptors);
  1088. module.exports = exports = function exports(o) {
  1089. return o == null ? create(base) : defineProperties(Object(o), descriptors);
  1090. };
  1091. exports.methods = methods;
  1092. });
  1093. var require_is_implemented5 = __commonJS(function(exports, module) {
  1094. 'use strict';
  1095. module.exports = function() {
  1096. var from = Array.from, arr, result;
  1097. if (typeof from !== 'function') {
  1098. return false;
  1099. }
  1100. arr = [ 'raz', 'dwa' ];
  1101. result = from(arr);
  1102. return Boolean(result && result !== arr && result[1] === 'dwa');
  1103. };
  1104. });
  1105. var require_is_implemented6 = __commonJS(function(exports, module) {
  1106. 'use strict';
  1107. module.exports = function() {
  1108. if ((typeof globalThis === 'undefined' ? 'undefined' : _typeof(globalThis)) !== 'object') {
  1109. return false;
  1110. }
  1111. if (!globalThis) {
  1112. return false;
  1113. }
  1114. return globalThis.Array === Array;
  1115. };
  1116. });
  1117. var require_implementation = __commonJS(function(exports, module) {
  1118. var naiveFallback = function naiveFallback() {
  1119. if ((typeof self === 'undefined' ? 'undefined' : _typeof(self)) === 'object' && self) {
  1120. return self;
  1121. }
  1122. if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window) {
  1123. return window;
  1124. }
  1125. throw new Error('Unable to resolve global `this`');
  1126. };
  1127. module.exports = function() {
  1128. if (this) {
  1129. return this;
  1130. }
  1131. try {
  1132. Object.defineProperty(Object.prototype, '__global__', {
  1133. get: function get() {
  1134. return this;
  1135. },
  1136. configurable: true
  1137. });
  1138. } catch (error) {
  1139. return naiveFallback();
  1140. }
  1141. try {
  1142. if (!__global__) {
  1143. return naiveFallback();
  1144. }
  1145. return __global__;
  1146. } finally {
  1147. delete Object.prototype.__global__;
  1148. }
  1149. }();
  1150. });
  1151. var require_global_this = __commonJS(function(exports, module) {
  1152. 'use strict';
  1153. module.exports = require_is_implemented6()() ? globalThis : require_implementation();
  1154. });
  1155. var require_is_implemented7 = __commonJS(function(exports, module) {
  1156. 'use strict';
  1157. var global2 = require_global_this();
  1158. var validTypes = {
  1159. object: true,
  1160. symbol: true
  1161. };
  1162. module.exports = function() {
  1163. var Symbol2 = global2.Symbol;
  1164. var symbol;
  1165. if (typeof Symbol2 !== 'function') {
  1166. return false;
  1167. }
  1168. symbol = Symbol2('test symbol');
  1169. try {
  1170. String(symbol);
  1171. } catch (e) {
  1172. return false;
  1173. }
  1174. if (!validTypes[_typeof(Symbol2.iterator)]) {
  1175. return false;
  1176. }
  1177. if (!validTypes[_typeof(Symbol2.toPrimitive)]) {
  1178. return false;
  1179. }
  1180. if (!validTypes[_typeof(Symbol2.toStringTag)]) {
  1181. return false;
  1182. }
  1183. return true;
  1184. };
  1185. });
  1186. var require_is_symbol = __commonJS(function(exports, module) {
  1187. 'use strict';
  1188. module.exports = function(value) {
  1189. if (!value) {
  1190. return false;
  1191. }
  1192. if (_typeof(value) === 'symbol') {
  1193. return true;
  1194. }
  1195. if (!value.constructor) {
  1196. return false;
  1197. }
  1198. if (value.constructor.name !== 'Symbol') {
  1199. return false;
  1200. }
  1201. return value[value.constructor.toStringTag] === 'Symbol';
  1202. };
  1203. });
  1204. var require_validate_symbol = __commonJS(function(exports, module) {
  1205. 'use strict';
  1206. var isSymbol = require_is_symbol();
  1207. module.exports = function(value) {
  1208. if (!isSymbol(value)) {
  1209. throw new TypeError(value + ' is not a symbol');
  1210. }
  1211. return value;
  1212. };
  1213. });
  1214. var require_generate_name = __commonJS(function(exports, module) {
  1215. 'use strict';
  1216. var d2 = require_d();
  1217. var create = Object.create;
  1218. var defineProperty = Object.defineProperty;
  1219. var objPrototype = Object.prototype;
  1220. var created = create(null);
  1221. module.exports = function(desc) {
  1222. var postfix = 0, name, ie11BugWorkaround;
  1223. while (created[desc + (postfix || '')]) {
  1224. ++postfix;
  1225. }
  1226. desc += postfix || '';
  1227. created[desc] = true;
  1228. name = '@@' + desc;
  1229. defineProperty(objPrototype, name, d2.gs(null, function(value) {
  1230. if (ie11BugWorkaround) {
  1231. return;
  1232. }
  1233. ie11BugWorkaround = true;
  1234. defineProperty(this, name, d2(value));
  1235. ie11BugWorkaround = false;
  1236. }));
  1237. return name;
  1238. };
  1239. });
  1240. var require_standard_symbols = __commonJS(function(exports, module) {
  1241. 'use strict';
  1242. var d2 = require_d();
  1243. var NativeSymbol = require_global_this().Symbol;
  1244. module.exports = function(SymbolPolyfill) {
  1245. return Object.defineProperties(SymbolPolyfill, {
  1246. hasInstance: d2('', NativeSymbol && NativeSymbol.hasInstance || SymbolPolyfill('hasInstance')),
  1247. isConcatSpreadable: d2('', NativeSymbol && NativeSymbol.isConcatSpreadable || SymbolPolyfill('isConcatSpreadable')),
  1248. iterator: d2('', NativeSymbol && NativeSymbol.iterator || SymbolPolyfill('iterator')),
  1249. match: d2('', NativeSymbol && NativeSymbol.match || SymbolPolyfill('match')),
  1250. replace: d2('', NativeSymbol && NativeSymbol.replace || SymbolPolyfill('replace')),
  1251. search: d2('', NativeSymbol && NativeSymbol.search || SymbolPolyfill('search')),
  1252. species: d2('', NativeSymbol && NativeSymbol.species || SymbolPolyfill('species')),
  1253. split: d2('', NativeSymbol && NativeSymbol.split || SymbolPolyfill('split')),
  1254. toPrimitive: d2('', NativeSymbol && NativeSymbol.toPrimitive || SymbolPolyfill('toPrimitive')),
  1255. toStringTag: d2('', NativeSymbol && NativeSymbol.toStringTag || SymbolPolyfill('toStringTag')),
  1256. unscopables: d2('', NativeSymbol && NativeSymbol.unscopables || SymbolPolyfill('unscopables'))
  1257. });
  1258. };
  1259. });
  1260. var require_symbol_registry = __commonJS(function(exports, module) {
  1261. 'use strict';
  1262. var d2 = require_d();
  1263. var validateSymbol = require_validate_symbol();
  1264. var registry = Object.create(null);
  1265. module.exports = function(SymbolPolyfill) {
  1266. return Object.defineProperties(SymbolPolyfill, {
  1267. for: d2(function(key) {
  1268. if (registry[key]) {
  1269. return registry[key];
  1270. }
  1271. return registry[key] = SymbolPolyfill(String(key));
  1272. }),
  1273. keyFor: d2(function(symbol) {
  1274. var key;
  1275. validateSymbol(symbol);
  1276. for (key in registry) {
  1277. if (registry[key] === symbol) {
  1278. return key;
  1279. }
  1280. }
  1281. return void 0;
  1282. })
  1283. });
  1284. };
  1285. });
  1286. var require_polyfill = __commonJS(function(exports, module) {
  1287. 'use strict';
  1288. var d2 = require_d();
  1289. var validateSymbol = require_validate_symbol();
  1290. var NativeSymbol = require_global_this().Symbol;
  1291. var generateName = require_generate_name();
  1292. var setupStandardSymbols = require_standard_symbols();
  1293. var setupSymbolRegistry = require_symbol_registry();
  1294. var create = Object.create;
  1295. var defineProperties = Object.defineProperties;
  1296. var defineProperty = Object.defineProperty;
  1297. var SymbolPolyfill;
  1298. var HiddenSymbol;
  1299. var isNativeSafe;
  1300. if (typeof NativeSymbol === 'function') {
  1301. try {
  1302. String(NativeSymbol());
  1303. isNativeSafe = true;
  1304. } catch (ignore) {}
  1305. } else {
  1306. NativeSymbol = null;
  1307. }
  1308. HiddenSymbol = function Symbol2(description) {
  1309. if (this instanceof HiddenSymbol) {
  1310. throw new TypeError('Symbol is not a constructor');
  1311. }
  1312. return SymbolPolyfill(description);
  1313. };
  1314. module.exports = SymbolPolyfill = function Symbol2(description) {
  1315. var symbol;
  1316. if (this instanceof Symbol2) {
  1317. throw new TypeError('Symbol is not a constructor');
  1318. }
  1319. if (isNativeSafe) {
  1320. return NativeSymbol(description);
  1321. }
  1322. symbol = create(HiddenSymbol.prototype);
  1323. description = description === void 0 ? '' : String(description);
  1324. return defineProperties(symbol, {
  1325. __description__: d2('', description),
  1326. __name__: d2('', generateName(description))
  1327. });
  1328. };
  1329. setupStandardSymbols(SymbolPolyfill);
  1330. setupSymbolRegistry(SymbolPolyfill);
  1331. defineProperties(HiddenSymbol.prototype, {
  1332. constructor: d2(SymbolPolyfill),
  1333. toString: d2('', function() {
  1334. return this.__name__;
  1335. })
  1336. });
  1337. defineProperties(SymbolPolyfill.prototype, {
  1338. toString: d2(function() {
  1339. return 'Symbol (' + validateSymbol(this).__description__ + ')';
  1340. }),
  1341. valueOf: d2(function() {
  1342. return validateSymbol(this);
  1343. })
  1344. });
  1345. defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toPrimitive, d2('', function() {
  1346. var symbol = validateSymbol(this);
  1347. if (_typeof(symbol) === 'symbol') {
  1348. return symbol;
  1349. }
  1350. return symbol.toString();
  1351. }));
  1352. defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d2('c', 'Symbol'));
  1353. defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toStringTag, d2('c', SymbolPolyfill.prototype[SymbolPolyfill.toStringTag]));
  1354. defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toPrimitive, d2('c', SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive]));
  1355. });
  1356. var require_es6_symbol = __commonJS(function(exports, module) {
  1357. 'use strict';
  1358. module.exports = require_is_implemented7()() ? require_global_this().Symbol : require_polyfill();
  1359. });
  1360. var require_is_arguments = __commonJS(function(exports, module) {
  1361. 'use strict';
  1362. var objToString = Object.prototype.toString;
  1363. var id = objToString.call(function() {
  1364. return arguments;
  1365. }());
  1366. module.exports = function(value) {
  1367. return objToString.call(value) === id;
  1368. };
  1369. });
  1370. var require_is_function = __commonJS(function(exports, module) {
  1371. 'use strict';
  1372. var objToString = Object.prototype.toString;
  1373. var isFunctionStringTag = RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);
  1374. module.exports = function(value) {
  1375. return typeof value === 'function' && isFunctionStringTag(objToString.call(value));
  1376. };
  1377. });
  1378. var require_is_string = __commonJS(function(exports, module) {
  1379. 'use strict';
  1380. var objToString = Object.prototype.toString;
  1381. var id = objToString.call('');
  1382. module.exports = function(value) {
  1383. return typeof value === 'string' || value && _typeof(value) === 'object' && (value instanceof String || objToString.call(value) === id) || false;
  1384. };
  1385. });
  1386. var require_shim5 = __commonJS(function(exports, module) {
  1387. 'use strict';
  1388. var iteratorSymbol = require_es6_symbol().iterator;
  1389. var isArguments = require_is_arguments();
  1390. var isFunction = require_is_function();
  1391. var toPosInt = require_to_pos_integer();
  1392. var callable = require_valid_callable();
  1393. var validValue = require_valid_value();
  1394. var isValue = require_is_value();
  1395. var isString2 = require_is_string();
  1396. var isArray = Array.isArray;
  1397. var call = Function.prototype.call;
  1398. var desc = {
  1399. configurable: true,
  1400. enumerable: true,
  1401. writable: true,
  1402. value: null
  1403. };
  1404. var defineProperty = Object.defineProperty;
  1405. module.exports = function(arrayLike) {
  1406. var mapFn = arguments[1], thisArg = arguments[2], Context2, i, j, arr, length, code, iterator, result, getIterator, value;
  1407. arrayLike = Object(validValue(arrayLike));
  1408. if (isValue(mapFn)) {
  1409. callable(mapFn);
  1410. }
  1411. if (!this || this === Array || !isFunction(this)) {
  1412. if (!mapFn) {
  1413. if (isArguments(arrayLike)) {
  1414. length = arrayLike.length;
  1415. if (length !== 1) {
  1416. return Array.apply(null, arrayLike);
  1417. }
  1418. arr = new Array(1);
  1419. arr[0] = arrayLike[0];
  1420. return arr;
  1421. }
  1422. if (isArray(arrayLike)) {
  1423. arr = new Array(length = arrayLike.length);
  1424. for (i = 0; i < length; ++i) {
  1425. arr[i] = arrayLike[i];
  1426. }
  1427. return arr;
  1428. }
  1429. }
  1430. arr = [];
  1431. } else {
  1432. Context2 = this;
  1433. }
  1434. if (!isArray(arrayLike)) {
  1435. if ((getIterator = arrayLike[iteratorSymbol]) !== void 0) {
  1436. iterator = callable(getIterator).call(arrayLike);
  1437. if (Context2) {
  1438. arr = new Context2();
  1439. }
  1440. result = iterator.next();
  1441. i = 0;
  1442. while (!result.done) {
  1443. value = mapFn ? call.call(mapFn, thisArg, result.value, i) : result.value;
  1444. if (Context2) {
  1445. desc.value = value;
  1446. defineProperty(arr, i, desc);
  1447. } else {
  1448. arr[i] = value;
  1449. }
  1450. result = iterator.next();
  1451. ++i;
  1452. }
  1453. length = i;
  1454. } else if (isString2(arrayLike)) {
  1455. length = arrayLike.length;
  1456. if (Context2) {
  1457. arr = new Context2();
  1458. }
  1459. for (i = 0, j = 0; i < length; ++i) {
  1460. value = arrayLike[i];
  1461. if (i + 1 < length) {
  1462. code = value.charCodeAt(0);
  1463. if (code >= 55296 && code <= 56319) {
  1464. value += arrayLike[++i];
  1465. }
  1466. }
  1467. value = mapFn ? call.call(mapFn, thisArg, value, j) : value;
  1468. if (Context2) {
  1469. desc.value = value;
  1470. defineProperty(arr, j, desc);
  1471. } else {
  1472. arr[j] = value;
  1473. }
  1474. ++j;
  1475. }
  1476. length = j;
  1477. }
  1478. }
  1479. if (length === void 0) {
  1480. length = toPosInt(arrayLike.length);
  1481. if (Context2) {
  1482. arr = new Context2(length);
  1483. }
  1484. for (i = 0; i < length; ++i) {
  1485. value = mapFn ? call.call(mapFn, thisArg, arrayLike[i], i) : arrayLike[i];
  1486. if (Context2) {
  1487. desc.value = value;
  1488. defineProperty(arr, i, desc);
  1489. } else {
  1490. arr[i] = value;
  1491. }
  1492. }
  1493. }
  1494. if (Context2) {
  1495. desc.value = null;
  1496. arr.length = length;
  1497. }
  1498. return arr;
  1499. };
  1500. });
  1501. var require_from = __commonJS(function(exports, module) {
  1502. 'use strict';
  1503. module.exports = require_is_implemented5()() ? Array.from : require_shim5();
  1504. });
  1505. var require_to_array = __commonJS(function(exports, module) {
  1506. 'use strict';
  1507. var from = require_from();
  1508. var isArray = Array.isArray;
  1509. module.exports = function(arrayLike) {
  1510. return isArray(arrayLike) ? arrayLike : from(arrayLike);
  1511. };
  1512. });
  1513. var require_resolve_resolve = __commonJS(function(exports, module) {
  1514. 'use strict';
  1515. var toArray2 = require_to_array();
  1516. var isValue = require_is_value();
  1517. var callable = require_valid_callable();
  1518. var slice = Array.prototype.slice;
  1519. var resolveArgs;
  1520. resolveArgs = function resolveArgs(args) {
  1521. return this.map(function(resolve, i) {
  1522. return resolve ? resolve(args[i]) : args[i];
  1523. }).concat(slice.call(args, this.length));
  1524. };
  1525. module.exports = function(resolvers) {
  1526. resolvers = toArray2(resolvers);
  1527. resolvers.forEach(function(resolve) {
  1528. if (isValue(resolve)) {
  1529. callable(resolve);
  1530. }
  1531. });
  1532. return resolveArgs.bind(resolvers);
  1533. };
  1534. });
  1535. var require_resolve_normalize = __commonJS(function(exports, module) {
  1536. 'use strict';
  1537. var callable = require_valid_callable();
  1538. module.exports = function(userNormalizer) {
  1539. var normalizer;
  1540. if (typeof userNormalizer === 'function') {
  1541. return {
  1542. set: userNormalizer,
  1543. get: userNormalizer
  1544. };
  1545. }
  1546. normalizer = {
  1547. get: callable(userNormalizer.get)
  1548. };
  1549. if (userNormalizer.set !== void 0) {
  1550. normalizer.set = callable(userNormalizer.set);
  1551. if (userNormalizer['delete']) {
  1552. normalizer['delete'] = callable(userNormalizer['delete']);
  1553. }
  1554. if (userNormalizer.clear) {
  1555. normalizer.clear = callable(userNormalizer.clear);
  1556. }
  1557. return normalizer;
  1558. }
  1559. normalizer.set = normalizer.get;
  1560. return normalizer;
  1561. };
  1562. });
  1563. var require_configure_map = __commonJS(function(exports, module) {
  1564. 'use strict';
  1565. var customError = require_custom();
  1566. var defineLength = require_define_length();
  1567. var d2 = require_d();
  1568. var ee = require_event_emitter().methods;
  1569. var resolveResolve = require_resolve_resolve();
  1570. var resolveNormalize = require_resolve_normalize();
  1571. var apply = Function.prototype.apply;
  1572. var call = Function.prototype.call;
  1573. var create = Object.create;
  1574. var defineProperties = Object.defineProperties;
  1575. var _on = ee.on;
  1576. var emit = ee.emit;
  1577. module.exports = function(original, length, options) {
  1578. var cache2 = create(null), conf, memLength, get2, set2, del, _clear, extDel, extGet, extHas, normalizer, getListeners, setListeners, deleteListeners, memoized, resolve;
  1579. if (length !== false) {
  1580. memLength = length;
  1581. } else if (isNaN(original.length)) {
  1582. memLength = 1;
  1583. } else {
  1584. memLength = original.length;
  1585. }
  1586. if (options.normalizer) {
  1587. normalizer = resolveNormalize(options.normalizer);
  1588. get2 = normalizer.get;
  1589. set2 = normalizer.set;
  1590. del = normalizer['delete'];
  1591. _clear = normalizer.clear;
  1592. }
  1593. if (options.resolvers != null) {
  1594. resolve = resolveResolve(options.resolvers);
  1595. }
  1596. if (get2) {
  1597. memoized = defineLength(function(arg) {
  1598. var id, result, args = arguments;
  1599. if (resolve) {
  1600. args = resolve(args);
  1601. }
  1602. id = get2(args);
  1603. if (id !== null) {
  1604. if (hasOwnProperty.call(cache2, id)) {
  1605. if (getListeners) {
  1606. conf.emit('get', id, args, this);
  1607. }
  1608. return cache2[id];
  1609. }
  1610. }
  1611. if (args.length === 1) {
  1612. result = call.call(original, this, args[0]);
  1613. } else {
  1614. result = apply.call(original, this, args);
  1615. }
  1616. if (id === null) {
  1617. id = get2(args);
  1618. if (id !== null) {
  1619. throw customError('Circular invocation', 'CIRCULAR_INVOCATION');
  1620. }
  1621. id = set2(args);
  1622. } else if (hasOwnProperty.call(cache2, id)) {
  1623. throw customError('Circular invocation', 'CIRCULAR_INVOCATION');
  1624. }
  1625. cache2[id] = result;
  1626. if (setListeners) {
  1627. conf.emit('set', id, null, result);
  1628. }
  1629. return result;
  1630. }, memLength);
  1631. } else if (length === 0) {
  1632. memoized = function memoized() {
  1633. var result;
  1634. if (hasOwnProperty.call(cache2, 'data')) {
  1635. if (getListeners) {
  1636. conf.emit('get', 'data', arguments, this);
  1637. }
  1638. return cache2.data;
  1639. }
  1640. if (arguments.length) {
  1641. result = apply.call(original, this, arguments);
  1642. } else {
  1643. result = call.call(original, this);
  1644. }
  1645. if (hasOwnProperty.call(cache2, 'data')) {
  1646. throw customError('Circular invocation', 'CIRCULAR_INVOCATION');
  1647. }
  1648. cache2.data = result;
  1649. if (setListeners) {
  1650. conf.emit('set', 'data', null, result);
  1651. }
  1652. return result;
  1653. };
  1654. } else {
  1655. memoized = function memoized(arg) {
  1656. var result, args = arguments, id;
  1657. if (resolve) {
  1658. args = resolve(arguments);
  1659. }
  1660. id = String(args[0]);
  1661. if (hasOwnProperty.call(cache2, id)) {
  1662. if (getListeners) {
  1663. conf.emit('get', id, args, this);
  1664. }
  1665. return cache2[id];
  1666. }
  1667. if (args.length === 1) {
  1668. result = call.call(original, this, args[0]);
  1669. } else {
  1670. result = apply.call(original, this, args);
  1671. }
  1672. if (hasOwnProperty.call(cache2, id)) {
  1673. throw customError('Circular invocation', 'CIRCULAR_INVOCATION');
  1674. }
  1675. cache2[id] = result;
  1676. if (setListeners) {
  1677. conf.emit('set', id, null, result);
  1678. }
  1679. return result;
  1680. };
  1681. }
  1682. conf = {
  1683. original: original,
  1684. memoized: memoized,
  1685. profileName: options.profileName,
  1686. get: function get(args) {
  1687. if (resolve) {
  1688. args = resolve(args);
  1689. }
  1690. if (get2) {
  1691. return get2(args);
  1692. }
  1693. return String(args[0]);
  1694. },
  1695. has: function has(id) {
  1696. return hasOwnProperty.call(cache2, id);
  1697. },
  1698. delete: function _delete(id) {
  1699. var result;
  1700. if (!hasOwnProperty.call(cache2, id)) {
  1701. return;
  1702. }
  1703. if (del) {
  1704. del(id);
  1705. }
  1706. result = cache2[id];
  1707. delete cache2[id];
  1708. if (deleteListeners) {
  1709. conf.emit('delete', id, result);
  1710. }
  1711. },
  1712. clear: function clear() {
  1713. var oldCache = cache2;
  1714. if (_clear) {
  1715. _clear();
  1716. }
  1717. cache2 = create(null);
  1718. conf.emit('clear', oldCache);
  1719. },
  1720. on: function on(type2, listener) {
  1721. if (type2 === 'get') {
  1722. getListeners = true;
  1723. } else if (type2 === 'set') {
  1724. setListeners = true;
  1725. } else if (type2 === 'delete') {
  1726. deleteListeners = true;
  1727. }
  1728. return _on.call(this, type2, listener);
  1729. },
  1730. emit: emit,
  1731. updateEnv: function updateEnv() {
  1732. original = conf.original;
  1733. }
  1734. };
  1735. if (get2) {
  1736. extDel = defineLength(function(arg) {
  1737. var id, args = arguments;
  1738. if (resolve) {
  1739. args = resolve(args);
  1740. }
  1741. id = get2(args);
  1742. if (id === null) {
  1743. return;
  1744. }
  1745. conf['delete'](id);
  1746. }, memLength);
  1747. } else if (length === 0) {
  1748. extDel = function extDel() {
  1749. return conf['delete']('data');
  1750. };
  1751. } else {
  1752. extDel = function extDel(arg) {
  1753. if (resolve) {
  1754. arg = resolve(arguments)[0];
  1755. }
  1756. return conf['delete'](arg);
  1757. };
  1758. }
  1759. extGet = defineLength(function() {
  1760. var id, args = arguments;
  1761. if (length === 0) {
  1762. return cache2.data;
  1763. }
  1764. if (resolve) {
  1765. args = resolve(args);
  1766. }
  1767. if (get2) {
  1768. id = get2(args);
  1769. } else {
  1770. id = String(args[0]);
  1771. }
  1772. return cache2[id];
  1773. });
  1774. extHas = defineLength(function() {
  1775. var id, args = arguments;
  1776. if (length === 0) {
  1777. return conf.has('data');
  1778. }
  1779. if (resolve) {
  1780. args = resolve(args);
  1781. }
  1782. if (get2) {
  1783. id = get2(args);
  1784. } else {
  1785. id = String(args[0]);
  1786. }
  1787. if (id === null) {
  1788. return false;
  1789. }
  1790. return conf.has(id);
  1791. });
  1792. defineProperties(memoized, {
  1793. __memoized__: d2(true),
  1794. delete: d2(extDel),
  1795. clear: d2(conf.clear),
  1796. _get: d2(extGet),
  1797. _has: d2(extHas)
  1798. });
  1799. return conf;
  1800. };
  1801. });
  1802. var require_plain = __commonJS(function(exports, module) {
  1803. 'use strict';
  1804. var callable = require_valid_callable();
  1805. var forEach = require_for_each();
  1806. var extensions = require_registered_extensions();
  1807. var configure4 = require_configure_map();
  1808. var resolveLength = require_resolve_length();
  1809. module.exports = function self2(fn) {
  1810. var options, length, conf;
  1811. callable(fn);
  1812. options = Object(arguments[1]);
  1813. if (options.async && options.promise) {
  1814. throw new Error('Options \'async\' and \'promise\' cannot be used together');
  1815. }
  1816. if (hasOwnProperty.call(fn, '__memoized__') && !options.force) {
  1817. return fn;
  1818. }
  1819. length = resolveLength(options.length, fn.length, options.async && extensions.async);
  1820. conf = configure4(fn, length, options);
  1821. forEach(extensions, function(extFn, name) {
  1822. if (options[name]) {
  1823. extFn(options[name], conf, options);
  1824. }
  1825. });
  1826. if (self2.__profiler__) {
  1827. self2.__profiler__(conf);
  1828. }
  1829. conf.updateEnv();
  1830. return conf.memoized;
  1831. };
  1832. });
  1833. var require_primitive = __commonJS(function(exports, module) {
  1834. 'use strict';
  1835. module.exports = function(args) {
  1836. var id, i, length = args.length;
  1837. if (!length) {
  1838. return '\x02';
  1839. }
  1840. id = String(args[i = 0]);
  1841. while (--length) {
  1842. id += '\x01' + args[++i];
  1843. }
  1844. return id;
  1845. };
  1846. });
  1847. var require_get_primitive_fixed = __commonJS(function(exports, module) {
  1848. 'use strict';
  1849. module.exports = function(length) {
  1850. if (!length) {
  1851. return function() {
  1852. return '';
  1853. };
  1854. }
  1855. return function(args) {
  1856. var id = String(args[0]), i = 0, currentLength = length;
  1857. while (--currentLength) {
  1858. id += '\x01' + args[++i];
  1859. }
  1860. return id;
  1861. };
  1862. };
  1863. });
  1864. var require_is_implemented8 = __commonJS(function(exports, module) {
  1865. 'use strict';
  1866. module.exports = function() {
  1867. var numberIsNaN = Number.isNaN;
  1868. if (typeof numberIsNaN !== 'function') {
  1869. return false;
  1870. }
  1871. return !numberIsNaN({}) && numberIsNaN(NaN) && !numberIsNaN(34);
  1872. };
  1873. });
  1874. var require_shim6 = __commonJS(function(exports, module) {
  1875. 'use strict';
  1876. module.exports = function(value) {
  1877. return value !== value;
  1878. };
  1879. });
  1880. var require_is_nan = __commonJS(function(exports, module) {
  1881. 'use strict';
  1882. module.exports = require_is_implemented8()() ? Number.isNaN : require_shim6();
  1883. });
  1884. var require_e_index_of = __commonJS(function(exports, module) {
  1885. 'use strict';
  1886. var numberIsNaN = require_is_nan();
  1887. var toPosInt = require_to_pos_integer();
  1888. var value = require_valid_value();
  1889. var indexOf = Array.prototype.indexOf;
  1890. var objHasOwnProperty = Object.prototype.hasOwnProperty;
  1891. var abs = Math.abs;
  1892. var floor = Math.floor;
  1893. module.exports = function(searchElement) {
  1894. var i, length, fromIndex, val;
  1895. if (!numberIsNaN(searchElement)) {
  1896. return indexOf.apply(this, arguments);
  1897. }
  1898. length = toPosInt(value(this).length);
  1899. fromIndex = arguments[1];
  1900. if (isNaN(fromIndex)) {
  1901. fromIndex = 0;
  1902. } else if (fromIndex >= 0) {
  1903. fromIndex = floor(fromIndex);
  1904. } else {
  1905. fromIndex = toPosInt(this.length) - floor(abs(fromIndex));
  1906. }
  1907. for (i = fromIndex; i < length; ++i) {
  1908. if (objHasOwnProperty.call(this, i)) {
  1909. val = this[i];
  1910. if (numberIsNaN(val)) {
  1911. return i;
  1912. }
  1913. }
  1914. }
  1915. return -1;
  1916. };
  1917. });
  1918. var require_get = __commonJS(function(exports, module) {
  1919. 'use strict';
  1920. var indexOf = require_e_index_of();
  1921. var create = Object.create;
  1922. module.exports = function() {
  1923. var lastId = 0, map = [], cache2 = create(null);
  1924. return {
  1925. get: function get(args) {
  1926. var index = 0, set2 = map, i, length = args.length;
  1927. if (length === 0) {
  1928. return set2[length] || null;
  1929. }
  1930. if (set2 = set2[length]) {
  1931. while (index < length - 1) {
  1932. i = indexOf.call(set2[0], args[index]);
  1933. if (i === -1) {
  1934. return null;
  1935. }
  1936. set2 = set2[1][i];
  1937. ++index;
  1938. }
  1939. i = indexOf.call(set2[0], args[index]);
  1940. if (i === -1) {
  1941. return null;
  1942. }
  1943. return set2[1][i] || null;
  1944. }
  1945. return null;
  1946. },
  1947. set: function set(args) {
  1948. var index = 0, set2 = map, i, length = args.length;
  1949. if (length === 0) {
  1950. set2[length] = ++lastId;
  1951. } else {
  1952. if (!set2[length]) {
  1953. set2[length] = [ [], [] ];
  1954. }
  1955. set2 = set2[length];
  1956. while (index < length - 1) {
  1957. i = indexOf.call(set2[0], args[index]);
  1958. if (i === -1) {
  1959. i = set2[0].push(args[index]) - 1;
  1960. set2[1].push([ [], [] ]);
  1961. }
  1962. set2 = set2[1][i];
  1963. ++index;
  1964. }
  1965. i = indexOf.call(set2[0], args[index]);
  1966. if (i === -1) {
  1967. i = set2[0].push(args[index]) - 1;
  1968. }
  1969. set2[1][i] = ++lastId;
  1970. }
  1971. cache2[lastId] = args;
  1972. return lastId;
  1973. },
  1974. delete: function _delete(id) {
  1975. var index = 0, set2 = map, i, args = cache2[id], length = args.length, path = [];
  1976. if (length === 0) {
  1977. delete set2[length];
  1978. } else if (set2 = set2[length]) {
  1979. while (index < length - 1) {
  1980. i = indexOf.call(set2[0], args[index]);
  1981. if (i === -1) {
  1982. return;
  1983. }
  1984. path.push(set2, i);
  1985. set2 = set2[1][i];
  1986. ++index;
  1987. }
  1988. i = indexOf.call(set2[0], args[index]);
  1989. if (i === -1) {
  1990. return;
  1991. }
  1992. id = set2[1][i];
  1993. set2[0].splice(i, 1);
  1994. set2[1].splice(i, 1);
  1995. while (!set2[0].length && path.length) {
  1996. i = path.pop();
  1997. set2 = path.pop();
  1998. set2[0].splice(i, 1);
  1999. set2[1].splice(i, 1);
  2000. }
  2001. }
  2002. delete cache2[id];
  2003. },
  2004. clear: function clear() {
  2005. map = [];
  2006. cache2 = create(null);
  2007. }
  2008. };
  2009. };
  2010. });
  2011. var require_get_1 = __commonJS(function(exports, module) {
  2012. 'use strict';
  2013. var indexOf = require_e_index_of();
  2014. module.exports = function() {
  2015. var lastId = 0, argsMap = [], cache2 = [];
  2016. return {
  2017. get: function get(args) {
  2018. var index = indexOf.call(argsMap, args[0]);
  2019. return index === -1 ? null : cache2[index];
  2020. },
  2021. set: function set(args) {
  2022. argsMap.push(args[0]);
  2023. cache2.push(++lastId);
  2024. return lastId;
  2025. },
  2026. delete: function _delete(id) {
  2027. var index = indexOf.call(cache2, id);
  2028. if (index !== -1) {
  2029. argsMap.splice(index, 1);
  2030. cache2.splice(index, 1);
  2031. }
  2032. },
  2033. clear: function clear() {
  2034. argsMap = [];
  2035. cache2 = [];
  2036. }
  2037. };
  2038. };
  2039. });
  2040. var require_get_fixed = __commonJS(function(exports, module) {
  2041. 'use strict';
  2042. var indexOf = require_e_index_of();
  2043. var create = Object.create;
  2044. module.exports = function(length) {
  2045. var lastId = 0, map = [ [], [] ], cache2 = create(null);
  2046. return {
  2047. get: function get(args) {
  2048. var index = 0, set2 = map, i;
  2049. while (index < length - 1) {
  2050. i = indexOf.call(set2[0], args[index]);
  2051. if (i === -1) {
  2052. return null;
  2053. }
  2054. set2 = set2[1][i];
  2055. ++index;
  2056. }
  2057. i = indexOf.call(set2[0], args[index]);
  2058. if (i === -1) {
  2059. return null;
  2060. }
  2061. return set2[1][i] || null;
  2062. },
  2063. set: function set(args) {
  2064. var index = 0, set2 = map, i;
  2065. while (index < length - 1) {
  2066. i = indexOf.call(set2[0], args[index]);
  2067. if (i === -1) {
  2068. i = set2[0].push(args[index]) - 1;
  2069. set2[1].push([ [], [] ]);
  2070. }
  2071. set2 = set2[1][i];
  2072. ++index;
  2073. }
  2074. i = indexOf.call(set2[0], args[index]);
  2075. if (i === -1) {
  2076. i = set2[0].push(args[index]) - 1;
  2077. }
  2078. set2[1][i] = ++lastId;
  2079. cache2[lastId] = args;
  2080. return lastId;
  2081. },
  2082. delete: function _delete(id) {
  2083. var index = 0, set2 = map, i, path = [], args = cache2[id];
  2084. while (index < length - 1) {
  2085. i = indexOf.call(set2[0], args[index]);
  2086. if (i === -1) {
  2087. return;
  2088. }
  2089. path.push(set2, i);
  2090. set2 = set2[1][i];
  2091. ++index;
  2092. }
  2093. i = indexOf.call(set2[0], args[index]);
  2094. if (i === -1) {
  2095. return;
  2096. }
  2097. id = set2[1][i];
  2098. set2[0].splice(i, 1);
  2099. set2[1].splice(i, 1);
  2100. while (!set2[0].length && path.length) {
  2101. i = path.pop();
  2102. set2 = path.pop();
  2103. set2[0].splice(i, 1);
  2104. set2[1].splice(i, 1);
  2105. }
  2106. delete cache2[id];
  2107. },
  2108. clear: function clear() {
  2109. map = [ [], [] ];
  2110. cache2 = create(null);
  2111. }
  2112. };
  2113. };
  2114. });
  2115. var require_map = __commonJS(function(exports, module) {
  2116. 'use strict';
  2117. var callable = require_valid_callable();
  2118. var forEach = require_for_each();
  2119. var call = Function.prototype.call;
  2120. module.exports = function(obj, cb) {
  2121. var result = {}, thisArg = arguments[2];
  2122. callable(cb);
  2123. forEach(obj, function(value, key, targetObj, index) {
  2124. result[key] = call.call(cb, thisArg, value, key, targetObj, index);
  2125. });
  2126. return result;
  2127. };
  2128. });
  2129. var require_next_tick = __commonJS(function(exports, module) {
  2130. 'use strict';
  2131. var ensureCallable = function ensureCallable(fn) {
  2132. if (typeof fn !== 'function') {
  2133. throw new TypeError(fn + ' is not a function');
  2134. }
  2135. return fn;
  2136. };
  2137. var byObserver = function byObserver(Observer) {
  2138. var node = document.createTextNode(''), queue2, currentQueue, i = 0;
  2139. new Observer(function() {
  2140. var callback;
  2141. if (!queue2) {
  2142. if (!currentQueue) {
  2143. return;
  2144. }
  2145. queue2 = currentQueue;
  2146. } else if (currentQueue) {
  2147. queue2 = currentQueue.concat(queue2);
  2148. }
  2149. currentQueue = queue2;
  2150. queue2 = null;
  2151. if (typeof currentQueue === 'function') {
  2152. callback = currentQueue;
  2153. currentQueue = null;
  2154. callback();
  2155. return;
  2156. }
  2157. node.data = i = ++i % 2;
  2158. while (currentQueue) {
  2159. callback = currentQueue.shift();
  2160. if (!currentQueue.length) {
  2161. currentQueue = null;
  2162. }
  2163. callback();
  2164. }
  2165. }).observe(node, {
  2166. characterData: true
  2167. });
  2168. return function(fn) {
  2169. ensureCallable(fn);
  2170. if (queue2) {
  2171. if (typeof queue2 === 'function') {
  2172. queue2 = [ queue2, fn ];
  2173. } else {
  2174. queue2.push(fn);
  2175. }
  2176. return;
  2177. }
  2178. queue2 = fn;
  2179. node.data = i = ++i % 2;
  2180. };
  2181. };
  2182. module.exports = function() {
  2183. if ((typeof process === 'undefined' ? 'undefined' : _typeof(process)) === 'object' && process && typeof process.nextTick === 'function') {
  2184. return process.nextTick;
  2185. }
  2186. if (typeof queueMicrotask === 'function') {
  2187. return function(cb) {
  2188. queueMicrotask(ensureCallable(cb));
  2189. };
  2190. }
  2191. if ((typeof document === 'undefined' ? 'undefined' : _typeof(document)) === 'object' && document) {
  2192. if (typeof MutationObserver === 'function') {
  2193. return byObserver(MutationObserver);
  2194. }
  2195. if (typeof WebKitMutationObserver === 'function') {
  2196. return byObserver(WebKitMutationObserver);
  2197. }
  2198. }
  2199. if (typeof setImmediate === 'function') {
  2200. return function(cb) {
  2201. setImmediate(ensureCallable(cb));
  2202. };
  2203. }
  2204. if (typeof setTimeout === 'function' || (typeof setTimeout === 'undefined' ? 'undefined' : _typeof(setTimeout)) === 'object') {
  2205. return function(cb) {
  2206. setTimeout(ensureCallable(cb), 0);
  2207. };
  2208. }
  2209. return null;
  2210. }();
  2211. });
  2212. var require_async = __commonJS(function() {
  2213. 'use strict';
  2214. var aFrom = require_from();
  2215. var objectMap = require_map();
  2216. var mixin = require_mixin();
  2217. var defineLength = require_define_length();
  2218. var nextTick = require_next_tick();
  2219. var slice = Array.prototype.slice;
  2220. var apply = Function.prototype.apply;
  2221. var create = Object.create;
  2222. require_registered_extensions().async = function(tbi, conf) {
  2223. var waiting = create(null), cache2 = create(null), base = conf.memoized, original = conf.original, currentCallback, currentContext, currentArgs;
  2224. conf.memoized = defineLength(function(arg) {
  2225. var args = arguments, last2 = args[args.length - 1];
  2226. if (typeof last2 === 'function') {
  2227. currentCallback = last2;
  2228. args = slice.call(args, 0, -1);
  2229. }
  2230. return base.apply(currentContext = this, currentArgs = args);
  2231. }, base);
  2232. try {
  2233. mixin(conf.memoized, base);
  2234. } catch (ignore) {}
  2235. conf.on('get', function(id) {
  2236. var cb, context, args;
  2237. if (!currentCallback) {
  2238. return;
  2239. }
  2240. if (waiting[id]) {
  2241. if (typeof waiting[id] === 'function') {
  2242. waiting[id] = [ waiting[id], currentCallback ];
  2243. } else {
  2244. waiting[id].push(currentCallback);
  2245. }
  2246. currentCallback = null;
  2247. return;
  2248. }
  2249. cb = currentCallback;
  2250. context = currentContext;
  2251. args = currentArgs;
  2252. currentCallback = currentContext = currentArgs = null;
  2253. nextTick(function() {
  2254. var data;
  2255. if (hasOwnProperty.call(cache2, id)) {
  2256. data = cache2[id];
  2257. conf.emit('getasync', id, args, context);
  2258. apply.call(cb, data.context, data.args);
  2259. } else {
  2260. currentCallback = cb;
  2261. currentContext = context;
  2262. currentArgs = args;
  2263. base.apply(context, args);
  2264. }
  2265. });
  2266. });
  2267. conf.original = function() {
  2268. var args, cb, origCb, result;
  2269. if (!currentCallback) {
  2270. return apply.call(original, this, arguments);
  2271. }
  2272. args = aFrom(arguments);
  2273. cb = function self2(err2) {
  2274. var cb2, args2, id = self2.id;
  2275. if (id == null) {
  2276. nextTick(apply.bind(self2, this, arguments));
  2277. return void 0;
  2278. }
  2279. delete self2.id;
  2280. cb2 = waiting[id];
  2281. delete waiting[id];
  2282. if (!cb2) {
  2283. return void 0;
  2284. }
  2285. args2 = aFrom(arguments);
  2286. if (conf.has(id)) {
  2287. if (err2) {
  2288. conf['delete'](id);
  2289. } else {
  2290. cache2[id] = {
  2291. context: this,
  2292. args: args2
  2293. };
  2294. conf.emit('setasync', id, typeof cb2 === 'function' ? 1 : cb2.length);
  2295. }
  2296. }
  2297. if (typeof cb2 === 'function') {
  2298. result = apply.call(cb2, this, args2);
  2299. } else {
  2300. cb2.forEach(function(cb3) {
  2301. result = apply.call(cb3, this, args2);
  2302. }, this);
  2303. }
  2304. return result;
  2305. };
  2306. origCb = currentCallback;
  2307. currentCallback = currentContext = currentArgs = null;
  2308. args.push(cb);
  2309. result = apply.call(original, this, args);
  2310. cb.cb = origCb;
  2311. currentCallback = cb;
  2312. return result;
  2313. };
  2314. conf.on('set', function(id) {
  2315. if (!currentCallback) {
  2316. conf['delete'](id);
  2317. return;
  2318. }
  2319. if (waiting[id]) {
  2320. if (typeof waiting[id] === 'function') {
  2321. waiting[id] = [ waiting[id], currentCallback.cb ];
  2322. } else {
  2323. waiting[id].push(currentCallback.cb);
  2324. }
  2325. } else {
  2326. waiting[id] = currentCallback.cb;
  2327. }
  2328. delete currentCallback.cb;
  2329. currentCallback.id = id;
  2330. currentCallback = null;
  2331. });
  2332. conf.on('delete', function(id) {
  2333. var result;
  2334. if (hasOwnProperty.call(waiting, id)) {
  2335. return;
  2336. }
  2337. if (!cache2[id]) {
  2338. return;
  2339. }
  2340. result = cache2[id];
  2341. delete cache2[id];
  2342. conf.emit('deleteasync', id, slice.call(result.args, 1));
  2343. });
  2344. conf.on('clear', function() {
  2345. var oldCache = cache2;
  2346. cache2 = create(null);
  2347. conf.emit('clearasync', objectMap(oldCache, function(data) {
  2348. return slice.call(data.args, 1);
  2349. }));
  2350. });
  2351. };
  2352. });
  2353. var require_primitive_set = __commonJS(function(exports, module) {
  2354. 'use strict';
  2355. var forEach = Array.prototype.forEach;
  2356. var create = Object.create;
  2357. module.exports = function(arg) {
  2358. var set2 = create(null);
  2359. forEach.call(arguments, function(name) {
  2360. set2[name] = true;
  2361. });
  2362. return set2;
  2363. };
  2364. });
  2365. var require_is_callable = __commonJS(function(exports, module) {
  2366. 'use strict';
  2367. module.exports = function(obj) {
  2368. return typeof obj === 'function';
  2369. };
  2370. });
  2371. var require_validate_stringifiable = __commonJS(function(exports, module) {
  2372. 'use strict';
  2373. var isCallable = require_is_callable();
  2374. module.exports = function(stringifiable) {
  2375. try {
  2376. if (stringifiable && isCallable(stringifiable.toString)) {
  2377. return stringifiable.toString();
  2378. }
  2379. return String(stringifiable);
  2380. } catch (e) {
  2381. throw new TypeError('Passed argument cannot be stringifed');
  2382. }
  2383. };
  2384. });
  2385. var require_validate_stringifiable_value = __commonJS(function(exports, module) {
  2386. 'use strict';
  2387. var ensureValue = require_valid_value();
  2388. var stringifiable = require_validate_stringifiable();
  2389. module.exports = function(value) {
  2390. return stringifiable(ensureValue(value));
  2391. };
  2392. });
  2393. var require_safe_to_string = __commonJS(function(exports, module) {
  2394. 'use strict';
  2395. var isCallable = require_is_callable();
  2396. module.exports = function(value) {
  2397. try {
  2398. if (value && isCallable(value.toString)) {
  2399. return value.toString();
  2400. }
  2401. return String(value);
  2402. } catch (e) {
  2403. return '<Non-coercible to string value>';
  2404. }
  2405. };
  2406. });
  2407. var require_to_short_string_representation = __commonJS(function(exports, module) {
  2408. 'use strict';
  2409. var safeToString = require_safe_to_string();
  2410. var reNewLine = /[\n\r\u2028\u2029]/g;
  2411. module.exports = function(value) {
  2412. var string = safeToString(value);
  2413. if (string.length > 100) {
  2414. string = string.slice(0, 99) + '\u2026';
  2415. }
  2416. string = string.replace(reNewLine, function(_char) {
  2417. return JSON.stringify(_char).slice(1, -1);
  2418. });
  2419. return string;
  2420. };
  2421. });
  2422. var require_is_promise = __commonJS(function(exports, module) {
  2423. module.exports = isPromise;
  2424. module.exports['default'] = isPromise;
  2425. function isPromise(obj) {
  2426. return !!obj && (_typeof(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  2427. }
  2428. });
  2429. var require_promise = __commonJS(function() {
  2430. 'use strict';
  2431. var objectMap = require_map();
  2432. var primitiveSet = require_primitive_set();
  2433. var ensureString = require_validate_stringifiable_value();
  2434. var toShortString = require_to_short_string_representation();
  2435. var isPromise = require_is_promise();
  2436. var nextTick = require_next_tick();
  2437. var create = Object.create;
  2438. var supportedModes = primitiveSet('then', 'then:finally', 'done', 'done:finally');
  2439. require_registered_extensions().promise = function(mode, conf) {
  2440. var waiting = create(null), cache2 = create(null), promises = create(null);
  2441. if (mode === true) {
  2442. mode = null;
  2443. } else {
  2444. mode = ensureString(mode);
  2445. if (!supportedModes[mode]) {
  2446. throw new TypeError('\'' + toShortString(mode) + '\' is not valid promise mode');
  2447. }
  2448. }
  2449. conf.on('set', function(id, ignore, promise) {
  2450. var isFailed = false;
  2451. if (!isPromise(promise)) {
  2452. cache2[id] = promise;
  2453. conf.emit('setasync', id, 1);
  2454. return;
  2455. }
  2456. waiting[id] = 1;
  2457. promises[id] = promise;
  2458. var onSuccess = function onSuccess(result) {
  2459. var count = waiting[id];
  2460. if (isFailed) {
  2461. throw new Error('Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in \'done:finally\' mode)\nConsider to rely on \'then\' or \'done\' mode instead.');
  2462. }
  2463. if (!count) {
  2464. return;
  2465. }
  2466. delete waiting[id];
  2467. cache2[id] = result;
  2468. conf.emit('setasync', id, count);
  2469. };
  2470. var onFailure = function onFailure() {
  2471. isFailed = true;
  2472. if (!waiting[id]) {
  2473. return;
  2474. }
  2475. delete waiting[id];
  2476. delete promises[id];
  2477. conf['delete'](id);
  2478. };
  2479. var resolvedMode = mode;
  2480. if (!resolvedMode) {
  2481. resolvedMode = 'then';
  2482. }
  2483. if (resolvedMode === 'then') {
  2484. var nextTickFailure = function nextTickFailure() {
  2485. nextTick(onFailure);
  2486. };
  2487. promise = promise.then(function(result) {
  2488. nextTick(onSuccess.bind(this, result));
  2489. }, nextTickFailure);
  2490. if (typeof promise['finally'] === 'function') {
  2491. promise['finally'](nextTickFailure);
  2492. }
  2493. } else if (resolvedMode === 'done') {
  2494. if (typeof promise.done !== 'function') {
  2495. throw new Error('Memoizee error: Retrieved promise does not implement \'done\' in \'done\' mode');
  2496. }
  2497. promise.done(onSuccess, onFailure);
  2498. } else if (resolvedMode === 'done:finally') {
  2499. if (typeof promise.done !== 'function') {
  2500. throw new Error('Memoizee error: Retrieved promise does not implement \'done\' in \'done:finally\' mode');
  2501. }
  2502. if (typeof promise['finally'] !== 'function') {
  2503. throw new Error('Memoizee error: Retrieved promise does not implement \'finally\' in \'done:finally\' mode');
  2504. }
  2505. promise.done(onSuccess);
  2506. promise['finally'](onFailure);
  2507. }
  2508. });
  2509. conf.on('get', function(id, args, context) {
  2510. var promise;
  2511. if (waiting[id]) {
  2512. ++waiting[id];
  2513. return;
  2514. }
  2515. promise = promises[id];
  2516. var emit = function emit() {
  2517. conf.emit('getasync', id, args, context);
  2518. };
  2519. if (isPromise(promise)) {
  2520. if (typeof promise.done === 'function') {
  2521. promise.done(emit);
  2522. } else {
  2523. promise.then(function() {
  2524. nextTick(emit);
  2525. });
  2526. }
  2527. } else {
  2528. emit();
  2529. }
  2530. });
  2531. conf.on('delete', function(id) {
  2532. delete promises[id];
  2533. if (waiting[id]) {
  2534. delete waiting[id];
  2535. return;
  2536. }
  2537. if (!hasOwnProperty.call(cache2, id)) {
  2538. return;
  2539. }
  2540. var result = cache2[id];
  2541. delete cache2[id];
  2542. conf.emit('deleteasync', id, [ result ]);
  2543. });
  2544. conf.on('clear', function() {
  2545. var oldCache = cache2;
  2546. cache2 = create(null);
  2547. waiting = create(null);
  2548. promises = create(null);
  2549. conf.emit('clearasync', objectMap(oldCache, function(data) {
  2550. return [ data ];
  2551. }));
  2552. });
  2553. };
  2554. });
  2555. var require_dispose = __commonJS(function() {
  2556. 'use strict';
  2557. var callable = require_valid_callable();
  2558. var forEach = require_for_each();
  2559. var extensions = require_registered_extensions();
  2560. var apply = Function.prototype.apply;
  2561. extensions.dispose = function(dispose, conf, options) {
  2562. var del;
  2563. callable(dispose);
  2564. if (options.async && extensions.async || options.promise && extensions.promise) {
  2565. conf.on('deleteasync', del = function del(id, resultArray) {
  2566. apply.call(dispose, null, resultArray);
  2567. });
  2568. conf.on('clearasync', function(cache2) {
  2569. forEach(cache2, function(result, id) {
  2570. del(id, result);
  2571. });
  2572. });
  2573. return;
  2574. }
  2575. conf.on('delete', del = function del(id, result) {
  2576. dispose(result);
  2577. });
  2578. conf.on('clear', function(cache2) {
  2579. forEach(cache2, function(result, id) {
  2580. del(id, result);
  2581. });
  2582. });
  2583. };
  2584. });
  2585. var require_max_timeout = __commonJS(function(exports, module) {
  2586. 'use strict';
  2587. module.exports = 2147483647;
  2588. });
  2589. var require_valid_timeout = __commonJS(function(exports, module) {
  2590. 'use strict';
  2591. var toPosInt = require_to_pos_integer();
  2592. var maxTimeout = require_max_timeout();
  2593. module.exports = function(value) {
  2594. value = toPosInt(value);
  2595. if (value > maxTimeout) {
  2596. throw new TypeError(value + ' exceeds maximum possible timeout');
  2597. }
  2598. return value;
  2599. };
  2600. });
  2601. var require_max_age = __commonJS(function() {
  2602. 'use strict';
  2603. var aFrom = require_from();
  2604. var forEach = require_for_each();
  2605. var nextTick = require_next_tick();
  2606. var isPromise = require_is_promise();
  2607. var timeout = require_valid_timeout();
  2608. var extensions = require_registered_extensions();
  2609. var noop3 = Function.prototype;
  2610. var max2 = Math.max;
  2611. var min = Math.min;
  2612. var create = Object.create;
  2613. extensions.maxAge = function(maxAge, conf, options) {
  2614. var timeouts, postfix, preFetchAge, preFetchTimeouts;
  2615. maxAge = timeout(maxAge);
  2616. if (!maxAge) {
  2617. return;
  2618. }
  2619. timeouts = create(null);
  2620. postfix = options.async && extensions.async || options.promise && extensions.promise ? 'async' : '';
  2621. conf.on('set' + postfix, function(id) {
  2622. timeouts[id] = setTimeout(function() {
  2623. conf['delete'](id);
  2624. }, maxAge);
  2625. if (typeof timeouts[id].unref === 'function') {
  2626. timeouts[id].unref();
  2627. }
  2628. if (!preFetchTimeouts) {
  2629. return;
  2630. }
  2631. if (preFetchTimeouts[id]) {
  2632. if (preFetchTimeouts[id] !== 'nextTick') {
  2633. clearTimeout(preFetchTimeouts[id]);
  2634. }
  2635. }
  2636. preFetchTimeouts[id] = setTimeout(function() {
  2637. delete preFetchTimeouts[id];
  2638. }, preFetchAge);
  2639. if (typeof preFetchTimeouts[id].unref === 'function') {
  2640. preFetchTimeouts[id].unref();
  2641. }
  2642. });
  2643. conf.on('delete' + postfix, function(id) {
  2644. clearTimeout(timeouts[id]);
  2645. delete timeouts[id];
  2646. if (!preFetchTimeouts) {
  2647. return;
  2648. }
  2649. if (preFetchTimeouts[id] !== 'nextTick') {
  2650. clearTimeout(preFetchTimeouts[id]);
  2651. }
  2652. delete preFetchTimeouts[id];
  2653. });
  2654. if (options.preFetch) {
  2655. if (options.preFetch === true || isNaN(options.preFetch)) {
  2656. preFetchAge = .333;
  2657. } else {
  2658. preFetchAge = max2(min(Number(options.preFetch), 1), 0);
  2659. }
  2660. if (preFetchAge) {
  2661. preFetchTimeouts = {};
  2662. preFetchAge = (1 - preFetchAge) * maxAge;
  2663. conf.on('get' + postfix, function(id, args, context) {
  2664. if (!preFetchTimeouts[id]) {
  2665. preFetchTimeouts[id] = 'nextTick';
  2666. nextTick(function() {
  2667. var result;
  2668. if (preFetchTimeouts[id] !== 'nextTick') {
  2669. return;
  2670. }
  2671. delete preFetchTimeouts[id];
  2672. conf['delete'](id);
  2673. if (options.async) {
  2674. args = aFrom(args);
  2675. args.push(noop3);
  2676. }
  2677. result = conf.memoized.apply(context, args);
  2678. if (options.promise) {
  2679. if (isPromise(result)) {
  2680. if (typeof result.done === 'function') {
  2681. result.done(noop3, noop3);
  2682. } else {
  2683. result.then(noop3, noop3);
  2684. }
  2685. }
  2686. }
  2687. });
  2688. }
  2689. });
  2690. }
  2691. }
  2692. conf.on('clear' + postfix, function() {
  2693. forEach(timeouts, function(id) {
  2694. clearTimeout(id);
  2695. });
  2696. timeouts = {};
  2697. if (preFetchTimeouts) {
  2698. forEach(preFetchTimeouts, function(id) {
  2699. if (id !== 'nextTick') {
  2700. clearTimeout(id);
  2701. }
  2702. });
  2703. preFetchTimeouts = {};
  2704. }
  2705. });
  2706. };
  2707. });
  2708. var require_lru_queue = __commonJS(function(exports, module) {
  2709. 'use strict';
  2710. var toPosInt = require_to_pos_integer();
  2711. var create = Object.create;
  2712. var hasOwnProperty2 = Object.prototype.hasOwnProperty;
  2713. module.exports = function(limit) {
  2714. var size = 0, base = 1, queue2 = create(null), map = create(null), index = 0, del;
  2715. limit = toPosInt(limit);
  2716. return {
  2717. hit: function hit(id) {
  2718. var oldIndex = map[id], nuIndex = ++index;
  2719. queue2[nuIndex] = id;
  2720. map[id] = nuIndex;
  2721. if (!oldIndex) {
  2722. ++size;
  2723. if (size <= limit) {
  2724. return;
  2725. }
  2726. id = queue2[base];
  2727. del(id);
  2728. return id;
  2729. }
  2730. delete queue2[oldIndex];
  2731. if (base !== oldIndex) {
  2732. return;
  2733. }
  2734. while (!hasOwnProperty2.call(queue2, ++base)) {
  2735. continue;
  2736. }
  2737. },
  2738. delete: del = function del(id) {
  2739. var oldIndex = map[id];
  2740. if (!oldIndex) {
  2741. return;
  2742. }
  2743. delete queue2[oldIndex];
  2744. delete map[id];
  2745. --size;
  2746. if (base !== oldIndex) {
  2747. return;
  2748. }
  2749. if (!size) {
  2750. index = 0;
  2751. base = 1;
  2752. return;
  2753. }
  2754. while (!hasOwnProperty2.call(queue2, ++base)) {
  2755. continue;
  2756. }
  2757. },
  2758. clear: function clear() {
  2759. size = 0;
  2760. base = 1;
  2761. queue2 = create(null);
  2762. map = create(null);
  2763. index = 0;
  2764. }
  2765. };
  2766. };
  2767. });
  2768. var require_max = __commonJS(function() {
  2769. 'use strict';
  2770. var toPosInteger = require_to_pos_integer();
  2771. var lruQueue = require_lru_queue();
  2772. var extensions = require_registered_extensions();
  2773. extensions.max = function(max2, conf, options) {
  2774. var postfix, queue2, hit;
  2775. max2 = toPosInteger(max2);
  2776. if (!max2) {
  2777. return;
  2778. }
  2779. queue2 = lruQueue(max2);
  2780. postfix = options.async && extensions.async || options.promise && extensions.promise ? 'async' : '';
  2781. conf.on('set' + postfix, hit = function hit(id) {
  2782. id = queue2.hit(id);
  2783. if (id === void 0) {
  2784. return;
  2785. }
  2786. conf['delete'](id);
  2787. });
  2788. conf.on('get' + postfix, hit);
  2789. conf.on('delete' + postfix, queue2['delete']);
  2790. conf.on('clear' + postfix, queue2.clear);
  2791. };
  2792. });
  2793. var require_ref_counter = __commonJS(function() {
  2794. 'use strict';
  2795. var d2 = require_d();
  2796. var extensions = require_registered_extensions();
  2797. var create = Object.create;
  2798. var defineProperties = Object.defineProperties;
  2799. extensions.refCounter = function(ignore, conf, options) {
  2800. var cache2, postfix;
  2801. cache2 = create(null);
  2802. postfix = options.async && extensions.async || options.promise && extensions.promise ? 'async' : '';
  2803. conf.on('set' + postfix, function(id, length) {
  2804. cache2[id] = length || 1;
  2805. });
  2806. conf.on('get' + postfix, function(id) {
  2807. ++cache2[id];
  2808. });
  2809. conf.on('delete' + postfix, function(id) {
  2810. delete cache2[id];
  2811. });
  2812. conf.on('clear' + postfix, function() {
  2813. cache2 = {};
  2814. });
  2815. defineProperties(conf.memoized, {
  2816. deleteRef: d2(function() {
  2817. var id = conf.get(arguments);
  2818. if (id === null) {
  2819. return null;
  2820. }
  2821. if (!cache2[id]) {
  2822. return null;
  2823. }
  2824. if (!--cache2[id]) {
  2825. conf['delete'](id);
  2826. return true;
  2827. }
  2828. return false;
  2829. }),
  2830. getRefCount: d2(function() {
  2831. var id = conf.get(arguments);
  2832. if (id === null) {
  2833. return 0;
  2834. }
  2835. if (!cache2[id]) {
  2836. return 0;
  2837. }
  2838. return cache2[id];
  2839. })
  2840. });
  2841. };
  2842. });
  2843. var require_memoizee = __commonJS(function(exports, module) {
  2844. 'use strict';
  2845. var normalizeOpts = require_normalize_options();
  2846. var resolveLength = require_resolve_length();
  2847. var plain = require_plain();
  2848. module.exports = function(fn) {
  2849. var options = normalizeOpts(arguments[1]), length;
  2850. if (!options.normalizer) {
  2851. length = options.length = resolveLength(options.length, fn.length, options.async);
  2852. if (length !== 0) {
  2853. if (options.primitive) {
  2854. if (length === false) {
  2855. options.normalizer = require_primitive();
  2856. } else if (length > 1) {
  2857. options.normalizer = require_get_primitive_fixed()(length);
  2858. }
  2859. } else if (length === false) {
  2860. options.normalizer = require_get()();
  2861. } else if (length === 1) {
  2862. options.normalizer = require_get_1()();
  2863. } else {
  2864. options.normalizer = require_get_fixed()(length);
  2865. }
  2866. }
  2867. }
  2868. if (options.async) {
  2869. require_async();
  2870. }
  2871. if (options.promise) {
  2872. require_promise();
  2873. }
  2874. if (options.dispose) {
  2875. require_dispose();
  2876. }
  2877. if (options.maxAge) {
  2878. require_max_age();
  2879. }
  2880. if (options.max) {
  2881. require_max();
  2882. }
  2883. if (options.refCounter) {
  2884. require_ref_counter();
  2885. }
  2886. return plain(fn, options);
  2887. };
  2888. });
  2889. var require_utils = __commonJS(function(exports) {
  2890. 'use strict';
  2891. Object.defineProperty(exports, '__esModule', {
  2892. value: true
  2893. });
  2894. function isIdentStart(c4) {
  2895. return c4 >= 'a' && c4 <= 'z' || c4 >= 'A' && c4 <= 'Z' || c4 === '-' || c4 === '_';
  2896. }
  2897. exports.isIdentStart = isIdentStart;
  2898. function isIdent(c4) {
  2899. return c4 >= 'a' && c4 <= 'z' || c4 >= 'A' && c4 <= 'Z' || c4 >= '0' && c4 <= '9' || c4 === '-' || c4 === '_';
  2900. }
  2901. exports.isIdent = isIdent;
  2902. function isHex(c4) {
  2903. return c4 >= 'a' && c4 <= 'f' || c4 >= 'A' && c4 <= 'F' || c4 >= '0' && c4 <= '9';
  2904. }
  2905. exports.isHex = isHex;
  2906. function escapeIdentifier(s) {
  2907. var len = s.length;
  2908. var result = '';
  2909. var i = 0;
  2910. while (i < len) {
  2911. var chr = s.charAt(i);
  2912. if (exports.identSpecialChars[chr]) {
  2913. result += '\\' + chr;
  2914. } else {
  2915. if (!(chr === '_' || chr === '-' || chr >= 'A' && chr <= 'Z' || chr >= 'a' && chr <= 'z' || i !== 0 && chr >= '0' && chr <= '9')) {
  2916. var charCode = chr.charCodeAt(0);
  2917. if ((charCode & 63488) === 55296) {
  2918. var extraCharCode = s.charCodeAt(i++);
  2919. if ((charCode & 64512) !== 55296 || (extraCharCode & 64512) !== 56320) {
  2920. throw Error('UCS-2(decode): illegal sequence');
  2921. }
  2922. charCode = ((charCode & 1023) << 10) + (extraCharCode & 1023) + 65536;
  2923. }
  2924. result += '\\' + charCode.toString(16) + ' ';
  2925. } else {
  2926. result += chr;
  2927. }
  2928. }
  2929. i++;
  2930. }
  2931. return result;
  2932. }
  2933. exports.escapeIdentifier = escapeIdentifier;
  2934. function escapeStr(s) {
  2935. var len = s.length;
  2936. var result = '';
  2937. var i = 0;
  2938. var replacement;
  2939. while (i < len) {
  2940. var chr = s.charAt(i);
  2941. if (chr === '"') {
  2942. chr = '\\"';
  2943. } else if (chr === '\\') {
  2944. chr = '\\\\';
  2945. } else if ((replacement = exports.strReplacementsRev[chr]) !== void 0) {
  2946. chr = replacement;
  2947. }
  2948. result += chr;
  2949. i++;
  2950. }
  2951. return '"' + result + '"';
  2952. }
  2953. exports.escapeStr = escapeStr;
  2954. exports.identSpecialChars = {
  2955. '!': true,
  2956. '"': true,
  2957. '#': true,
  2958. $: true,
  2959. '%': true,
  2960. '&': true,
  2961. '\'': true,
  2962. '(': true,
  2963. ')': true,
  2964. '*': true,
  2965. '+': true,
  2966. ',': true,
  2967. '.': true,
  2968. '/': true,
  2969. ';': true,
  2970. '<': true,
  2971. '=': true,
  2972. '>': true,
  2973. '?': true,
  2974. '@': true,
  2975. '[': true,
  2976. '\\': true,
  2977. ']': true,
  2978. '^': true,
  2979. '`': true,
  2980. '{': true,
  2981. '|': true,
  2982. '}': true,
  2983. '~': true
  2984. };
  2985. exports.strReplacementsRev = {
  2986. '\n': '\\n',
  2987. '\r': '\\r',
  2988. '\t': '\\t',
  2989. '\f': '\\f',
  2990. '\v': '\\v'
  2991. };
  2992. exports.singleQuoteEscapeChars = {
  2993. n: '\n',
  2994. r: '\r',
  2995. t: '\t',
  2996. f: '\f',
  2997. '\\': '\\',
  2998. '\'': '\''
  2999. };
  3000. exports.doubleQuotesEscapeChars = {
  3001. n: '\n',
  3002. r: '\r',
  3003. t: '\t',
  3004. f: '\f',
  3005. '\\': '\\',
  3006. '"': '"'
  3007. };
  3008. });
  3009. var require_parser_context = __commonJS(function(exports) {
  3010. 'use strict';
  3011. Object.defineProperty(exports, '__esModule', {
  3012. value: true
  3013. });
  3014. var utils_1 = require_utils();
  3015. function parseCssSelector(str, pos, pseudos, attrEqualityMods, ruleNestingOperators, substitutesEnabled) {
  3016. var l = str.length;
  3017. var chr = '';
  3018. function getStr(quote, escapeTable) {
  3019. var result = '';
  3020. pos++;
  3021. chr = str.charAt(pos);
  3022. while (pos < l) {
  3023. if (chr === quote) {
  3024. pos++;
  3025. return result;
  3026. } else if (chr === '\\') {
  3027. pos++;
  3028. chr = str.charAt(pos);
  3029. var esc = void 0;
  3030. if (chr === quote) {
  3031. result += quote;
  3032. } else if ((esc = escapeTable[chr]) !== void 0) {
  3033. result += esc;
  3034. } else if (utils_1.isHex(chr)) {
  3035. var hex = chr;
  3036. pos++;
  3037. chr = str.charAt(pos);
  3038. while (utils_1.isHex(chr)) {
  3039. hex += chr;
  3040. pos++;
  3041. chr = str.charAt(pos);
  3042. }
  3043. if (chr === ' ') {
  3044. pos++;
  3045. chr = str.charAt(pos);
  3046. }
  3047. result += String.fromCharCode(parseInt(hex, 16));
  3048. continue;
  3049. } else {
  3050. result += chr;
  3051. }
  3052. } else {
  3053. result += chr;
  3054. }
  3055. pos++;
  3056. chr = str.charAt(pos);
  3057. }
  3058. return result;
  3059. }
  3060. function getIdent() {
  3061. var result = '';
  3062. chr = str.charAt(pos);
  3063. while (pos < l) {
  3064. if (utils_1.isIdent(chr)) {
  3065. result += chr;
  3066. } else if (chr === '\\') {
  3067. pos++;
  3068. if (pos >= l) {
  3069. throw Error('Expected symbol but end of file reached.');
  3070. }
  3071. chr = str.charAt(pos);
  3072. if (utils_1.identSpecialChars[chr]) {
  3073. result += chr;
  3074. } else if (utils_1.isHex(chr)) {
  3075. var hex = chr;
  3076. pos++;
  3077. chr = str.charAt(pos);
  3078. while (utils_1.isHex(chr)) {
  3079. hex += chr;
  3080. pos++;
  3081. chr = str.charAt(pos);
  3082. }
  3083. if (chr === ' ') {
  3084. pos++;
  3085. chr = str.charAt(pos);
  3086. }
  3087. result += String.fromCharCode(parseInt(hex, 16));
  3088. continue;
  3089. } else {
  3090. result += chr;
  3091. }
  3092. } else {
  3093. return result;
  3094. }
  3095. pos++;
  3096. chr = str.charAt(pos);
  3097. }
  3098. return result;
  3099. }
  3100. function skipWhitespace() {
  3101. chr = str.charAt(pos);
  3102. var result = false;
  3103. while (chr === ' ' || chr === '\t' || chr === '\n' || chr === '\r' || chr === '\f') {
  3104. result = true;
  3105. pos++;
  3106. chr = str.charAt(pos);
  3107. }
  3108. return result;
  3109. }
  3110. function parse3() {
  3111. var res = parseSelector();
  3112. if (pos < l) {
  3113. throw Error('Rule expected but "' + str.charAt(pos) + '" found.');
  3114. }
  3115. return res;
  3116. }
  3117. function parseSelector() {
  3118. var selector = parseSingleSelector();
  3119. if (!selector) {
  3120. return null;
  3121. }
  3122. var res = selector;
  3123. chr = str.charAt(pos);
  3124. while (chr === ',') {
  3125. pos++;
  3126. skipWhitespace();
  3127. if (res.type !== 'selectors') {
  3128. res = {
  3129. type: 'selectors',
  3130. selectors: [ selector ]
  3131. };
  3132. }
  3133. selector = parseSingleSelector();
  3134. if (!selector) {
  3135. throw Error('Rule expected after ",".');
  3136. }
  3137. res.selectors.push(selector);
  3138. }
  3139. return res;
  3140. }
  3141. function parseSingleSelector() {
  3142. skipWhitespace();
  3143. var selector = {
  3144. type: 'ruleSet'
  3145. };
  3146. var rule = parseRule();
  3147. if (!rule) {
  3148. return null;
  3149. }
  3150. var currentRule = selector;
  3151. while (rule) {
  3152. rule.type = 'rule';
  3153. currentRule.rule = rule;
  3154. currentRule = rule;
  3155. skipWhitespace();
  3156. chr = str.charAt(pos);
  3157. if (pos >= l || chr === ',' || chr === ')') {
  3158. break;
  3159. }
  3160. if (ruleNestingOperators[chr]) {
  3161. var op = chr;
  3162. pos++;
  3163. skipWhitespace();
  3164. rule = parseRule();
  3165. if (!rule) {
  3166. throw Error('Rule expected after "' + op + '".');
  3167. }
  3168. rule.nestingOperator = op;
  3169. } else {
  3170. rule = parseRule();
  3171. if (rule) {
  3172. rule.nestingOperator = null;
  3173. }
  3174. }
  3175. }
  3176. return selector;
  3177. }
  3178. function parseRule() {
  3179. var rule = null;
  3180. while (pos < l) {
  3181. chr = str.charAt(pos);
  3182. if (chr === '*') {
  3183. pos++;
  3184. (rule = rule || {}).tagName = '*';
  3185. } else if (utils_1.isIdentStart(chr) || chr === '\\') {
  3186. (rule = rule || {}).tagName = getIdent();
  3187. } else if (chr === '.') {
  3188. pos++;
  3189. rule = rule || {};
  3190. (rule.classNames = rule.classNames || []).push(getIdent());
  3191. } else if (chr === '#') {
  3192. pos++;
  3193. (rule = rule || {}).id = getIdent();
  3194. } else if (chr === '[') {
  3195. pos++;
  3196. skipWhitespace();
  3197. var attr = {
  3198. name: getIdent()
  3199. };
  3200. skipWhitespace();
  3201. if (chr === ']') {
  3202. pos++;
  3203. } else {
  3204. var operator = '';
  3205. if (attrEqualityMods[chr]) {
  3206. operator = chr;
  3207. pos++;
  3208. chr = str.charAt(pos);
  3209. }
  3210. if (pos >= l) {
  3211. throw Error('Expected "=" but end of file reached.');
  3212. }
  3213. if (chr !== '=') {
  3214. throw Error('Expected "=" but "' + chr + '" found.');
  3215. }
  3216. attr.operator = operator + '=';
  3217. pos++;
  3218. skipWhitespace();
  3219. var attrValue = '';
  3220. attr.valueType = 'string';
  3221. if (chr === '"') {
  3222. attrValue = getStr('"', utils_1.doubleQuotesEscapeChars);
  3223. } else if (chr === '\'') {
  3224. attrValue = getStr('\'', utils_1.singleQuoteEscapeChars);
  3225. } else if (substitutesEnabled && chr === '$') {
  3226. pos++;
  3227. attrValue = getIdent();
  3228. attr.valueType = 'substitute';
  3229. } else {
  3230. while (pos < l) {
  3231. if (chr === ']') {
  3232. break;
  3233. }
  3234. attrValue += chr;
  3235. pos++;
  3236. chr = str.charAt(pos);
  3237. }
  3238. attrValue = attrValue.trim();
  3239. }
  3240. skipWhitespace();
  3241. if (pos >= l) {
  3242. throw Error('Expected "]" but end of file reached.');
  3243. }
  3244. if (chr !== ']') {
  3245. throw Error('Expected "]" but "' + chr + '" found.');
  3246. }
  3247. pos++;
  3248. attr.value = attrValue;
  3249. }
  3250. rule = rule || {};
  3251. (rule.attrs = rule.attrs || []).push(attr);
  3252. } else if (chr === ':') {
  3253. pos++;
  3254. var pseudoName = getIdent();
  3255. var pseudo = {
  3256. name: pseudoName
  3257. };
  3258. if (chr === '(') {
  3259. pos++;
  3260. var value = '';
  3261. skipWhitespace();
  3262. if (pseudos[pseudoName] === 'selector') {
  3263. pseudo.valueType = 'selector';
  3264. value = parseSelector();
  3265. } else {
  3266. pseudo.valueType = pseudos[pseudoName] || 'string';
  3267. if (chr === '"') {
  3268. value = getStr('"', utils_1.doubleQuotesEscapeChars);
  3269. } else if (chr === '\'') {
  3270. value = getStr('\'', utils_1.singleQuoteEscapeChars);
  3271. } else if (substitutesEnabled && chr === '$') {
  3272. pos++;
  3273. value = getIdent();
  3274. pseudo.valueType = 'substitute';
  3275. } else {
  3276. while (pos < l) {
  3277. if (chr === ')') {
  3278. break;
  3279. }
  3280. value += chr;
  3281. pos++;
  3282. chr = str.charAt(pos);
  3283. }
  3284. value = value.trim();
  3285. }
  3286. skipWhitespace();
  3287. }
  3288. if (pos >= l) {
  3289. throw Error('Expected ")" but end of file reached.');
  3290. }
  3291. if (chr !== ')') {
  3292. throw Error('Expected ")" but "' + chr + '" found.');
  3293. }
  3294. pos++;
  3295. pseudo.value = value;
  3296. }
  3297. rule = rule || {};
  3298. (rule.pseudos = rule.pseudos || []).push(pseudo);
  3299. } else {
  3300. break;
  3301. }
  3302. }
  3303. return rule;
  3304. }
  3305. return parse3();
  3306. }
  3307. exports.parseCssSelector = parseCssSelector;
  3308. });
  3309. var require_render = __commonJS(function(exports) {
  3310. 'use strict';
  3311. Object.defineProperty(exports, '__esModule', {
  3312. value: true
  3313. });
  3314. var utils_1 = require_utils();
  3315. function renderEntity(entity) {
  3316. var res = '';
  3317. switch (entity.type) {
  3318. case 'ruleSet':
  3319. var currentEntity = entity.rule;
  3320. var parts = [];
  3321. while (currentEntity) {
  3322. if (currentEntity.nestingOperator) {
  3323. parts.push(currentEntity.nestingOperator);
  3324. }
  3325. parts.push(renderEntity(currentEntity));
  3326. currentEntity = currentEntity.rule;
  3327. }
  3328. res = parts.join(' ');
  3329. break;
  3330. case 'selectors':
  3331. res = entity.selectors.map(renderEntity).join(', ');
  3332. break;
  3333. case 'rule':
  3334. if (entity.tagName) {
  3335. if (entity.tagName === '*') {
  3336. res = '*';
  3337. } else {
  3338. res = utils_1.escapeIdentifier(entity.tagName);
  3339. }
  3340. }
  3341. if (entity.id) {
  3342. res += '#' + utils_1.escapeIdentifier(entity.id);
  3343. }
  3344. if (entity.classNames) {
  3345. res += entity.classNames.map(function(cn) {
  3346. return '.' + utils_1.escapeIdentifier(cn);
  3347. }).join('');
  3348. }
  3349. if (entity.attrs) {
  3350. res += entity.attrs.map(function(attr) {
  3351. if ('operator' in attr) {
  3352. if (attr.valueType === 'substitute') {
  3353. return '[' + utils_1.escapeIdentifier(attr.name) + attr.operator + '$' + attr.value + ']';
  3354. } else {
  3355. return '[' + utils_1.escapeIdentifier(attr.name) + attr.operator + utils_1.escapeStr(attr.value) + ']';
  3356. }
  3357. } else {
  3358. return '[' + utils_1.escapeIdentifier(attr.name) + ']';
  3359. }
  3360. }).join('');
  3361. }
  3362. if (entity.pseudos) {
  3363. res += entity.pseudos.map(function(pseudo) {
  3364. if (pseudo.valueType) {
  3365. if (pseudo.valueType === 'selector') {
  3366. return ':' + utils_1.escapeIdentifier(pseudo.name) + '(' + renderEntity(pseudo.value) + ')';
  3367. } else if (pseudo.valueType === 'substitute') {
  3368. return ':' + utils_1.escapeIdentifier(pseudo.name) + '($' + pseudo.value + ')';
  3369. } else if (pseudo.valueType === 'numeric') {
  3370. return ':' + utils_1.escapeIdentifier(pseudo.name) + '(' + pseudo.value + ')';
  3371. } else {
  3372. return ':' + utils_1.escapeIdentifier(pseudo.name) + '(' + utils_1.escapeIdentifier(pseudo.value) + ')';
  3373. }
  3374. } else {
  3375. return ':' + utils_1.escapeIdentifier(pseudo.name);
  3376. }
  3377. }).join('');
  3378. }
  3379. break;
  3380. default:
  3381. throw Error('Unknown entity type: "' + entity.type + '".');
  3382. }
  3383. return res;
  3384. }
  3385. exports.renderEntity = renderEntity;
  3386. });
  3387. var require_lib = __commonJS(function(exports) {
  3388. 'use strict';
  3389. Object.defineProperty(exports, '__esModule', {
  3390. value: true
  3391. });
  3392. var parser_context_1 = require_parser_context();
  3393. var render_1 = require_render();
  3394. var CssSelectorParser3 = function() {
  3395. function CssSelectorParser4() {
  3396. this.pseudos = {};
  3397. this.attrEqualityMods = {};
  3398. this.ruleNestingOperators = {};
  3399. this.substitutesEnabled = false;
  3400. }
  3401. CssSelectorParser4.prototype.registerSelectorPseudos = function() {
  3402. var pseudos = [];
  3403. for (var _i = 0; _i < arguments.length; _i++) {
  3404. pseudos[_i] = arguments[_i];
  3405. }
  3406. for (var _a = 0, pseudos_1 = pseudos; _a < pseudos_1.length; _a++) {
  3407. var pseudo = pseudos_1[_a];
  3408. this.pseudos[pseudo] = 'selector';
  3409. }
  3410. return this;
  3411. };
  3412. CssSelectorParser4.prototype.unregisterSelectorPseudos = function() {
  3413. var pseudos = [];
  3414. for (var _i = 0; _i < arguments.length; _i++) {
  3415. pseudos[_i] = arguments[_i];
  3416. }
  3417. for (var _a = 0, pseudos_2 = pseudos; _a < pseudos_2.length; _a++) {
  3418. var pseudo = pseudos_2[_a];
  3419. delete this.pseudos[pseudo];
  3420. }
  3421. return this;
  3422. };
  3423. CssSelectorParser4.prototype.registerNumericPseudos = function() {
  3424. var pseudos = [];
  3425. for (var _i = 0; _i < arguments.length; _i++) {
  3426. pseudos[_i] = arguments[_i];
  3427. }
  3428. for (var _a = 0, pseudos_3 = pseudos; _a < pseudos_3.length; _a++) {
  3429. var pseudo = pseudos_3[_a];
  3430. this.pseudos[pseudo] = 'numeric';
  3431. }
  3432. return this;
  3433. };
  3434. CssSelectorParser4.prototype.unregisterNumericPseudos = function() {
  3435. var pseudos = [];
  3436. for (var _i = 0; _i < arguments.length; _i++) {
  3437. pseudos[_i] = arguments[_i];
  3438. }
  3439. for (var _a = 0, pseudos_4 = pseudos; _a < pseudos_4.length; _a++) {
  3440. var pseudo = pseudos_4[_a];
  3441. delete this.pseudos[pseudo];
  3442. }
  3443. return this;
  3444. };
  3445. CssSelectorParser4.prototype.registerNestingOperators = function() {
  3446. var operators = [];
  3447. for (var _i = 0; _i < arguments.length; _i++) {
  3448. operators[_i] = arguments[_i];
  3449. }
  3450. for (var _a = 0, operators_1 = operators; _a < operators_1.length; _a++) {
  3451. var operator = operators_1[_a];
  3452. this.ruleNestingOperators[operator] = true;
  3453. }
  3454. return this;
  3455. };
  3456. CssSelectorParser4.prototype.unregisterNestingOperators = function() {
  3457. var operators = [];
  3458. for (var _i = 0; _i < arguments.length; _i++) {
  3459. operators[_i] = arguments[_i];
  3460. }
  3461. for (var _a = 0, operators_2 = operators; _a < operators_2.length; _a++) {
  3462. var operator = operators_2[_a];
  3463. delete this.ruleNestingOperators[operator];
  3464. }
  3465. return this;
  3466. };
  3467. CssSelectorParser4.prototype.registerAttrEqualityMods = function() {
  3468. var mods = [];
  3469. for (var _i = 0; _i < arguments.length; _i++) {
  3470. mods[_i] = arguments[_i];
  3471. }
  3472. for (var _a = 0, mods_1 = mods; _a < mods_1.length; _a++) {
  3473. var mod = mods_1[_a];
  3474. this.attrEqualityMods[mod] = true;
  3475. }
  3476. return this;
  3477. };
  3478. CssSelectorParser4.prototype.unregisterAttrEqualityMods = function() {
  3479. var mods = [];
  3480. for (var _i = 0; _i < arguments.length; _i++) {
  3481. mods[_i] = arguments[_i];
  3482. }
  3483. for (var _a = 0, mods_2 = mods; _a < mods_2.length; _a++) {
  3484. var mod = mods_2[_a];
  3485. delete this.attrEqualityMods[mod];
  3486. }
  3487. return this;
  3488. };
  3489. CssSelectorParser4.prototype.enableSubstitutes = function() {
  3490. this.substitutesEnabled = true;
  3491. return this;
  3492. };
  3493. CssSelectorParser4.prototype.disableSubstitutes = function() {
  3494. this.substitutesEnabled = false;
  3495. return this;
  3496. };
  3497. CssSelectorParser4.prototype.parse = function(str) {
  3498. return parser_context_1.parseCssSelector(str, 0, this.pseudos, this.attrEqualityMods, this.ruleNestingOperators, this.substitutesEnabled);
  3499. };
  3500. CssSelectorParser4.prototype.render = function(path) {
  3501. return render_1.renderEntity(path).trim();
  3502. };
  3503. return CssSelectorParser4;
  3504. }();
  3505. exports.CssSelectorParser = CssSelectorParser3;
  3506. });
  3507. var require_es6_promise = __commonJS(function(exports, module) {
  3508. (function(global2, factory) {
  3509. _typeof(exports) === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global2.ES6Promise = factory();
  3510. })(exports, function() {
  3511. 'use strict';
  3512. function objectOrFunction(x) {
  3513. var type2 = _typeof(x);
  3514. return x !== null && (type2 === 'object' || type2 === 'function');
  3515. }
  3516. function isFunction(x) {
  3517. return typeof x === 'function';
  3518. }
  3519. var _isArray = void 0;
  3520. if (Array.isArray) {
  3521. _isArray = Array.isArray;
  3522. } else {
  3523. _isArray = function _isArray(x) {
  3524. return Object.prototype.toString.call(x) === '[object Array]';
  3525. };
  3526. }
  3527. var isArray = _isArray;
  3528. var len = 0;
  3529. var vertxNext = void 0;
  3530. var customSchedulerFn = void 0;
  3531. var asap = function asap2(callback, arg) {
  3532. queue2[len] = callback;
  3533. queue2[len + 1] = arg;
  3534. len += 2;
  3535. if (len === 2) {
  3536. if (customSchedulerFn) {
  3537. customSchedulerFn(flush);
  3538. } else {
  3539. scheduleFlush();
  3540. }
  3541. }
  3542. };
  3543. function setScheduler(scheduleFn) {
  3544. customSchedulerFn = scheduleFn;
  3545. }
  3546. function setAsap(asapFn) {
  3547. asap = asapFn;
  3548. }
  3549. var browserWindow = typeof window !== 'undefined' ? window : void 0;
  3550. var browserGlobal = browserWindow || {};
  3551. var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
  3552. var isNode2 = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';
  3553. var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';
  3554. function useNextTick() {
  3555. return function() {
  3556. return process.nextTick(flush);
  3557. };
  3558. }
  3559. function useVertxTimer() {
  3560. if (typeof vertxNext !== 'undefined') {
  3561. return function() {
  3562. vertxNext(flush);
  3563. };
  3564. }
  3565. return useSetTimeout();
  3566. }
  3567. function useMutationObserver() {
  3568. var iterations = 0;
  3569. var observer = new BrowserMutationObserver(flush);
  3570. var node = document.createTextNode('');
  3571. observer.observe(node, {
  3572. characterData: true
  3573. });
  3574. return function() {
  3575. node.data = iterations = ++iterations % 2;
  3576. };
  3577. }
  3578. function useMessageChannel() {
  3579. var channel = new MessageChannel();
  3580. channel.port1.onmessage = flush;
  3581. return function() {
  3582. return channel.port2.postMessage(0);
  3583. };
  3584. }
  3585. function useSetTimeout() {
  3586. var globalSetTimeout = setTimeout;
  3587. return function() {
  3588. return globalSetTimeout(flush, 1);
  3589. };
  3590. }
  3591. var queue2 = new Array(1e3);
  3592. function flush() {
  3593. for (var i = 0; i < len; i += 2) {
  3594. var callback = queue2[i];
  3595. var arg = queue2[i + 1];
  3596. callback(arg);
  3597. queue2[i] = void 0;
  3598. queue2[i + 1] = void 0;
  3599. }
  3600. len = 0;
  3601. }
  3602. function attemptVertx() {
  3603. try {
  3604. var vertx = Function('return this')().require('vertx');
  3605. vertxNext = vertx.runOnLoop || vertx.runOnContext;
  3606. return useVertxTimer();
  3607. } catch (e) {
  3608. return useSetTimeout();
  3609. }
  3610. }
  3611. var scheduleFlush = void 0;
  3612. if (isNode2) {
  3613. scheduleFlush = useNextTick();
  3614. } else if (BrowserMutationObserver) {
  3615. scheduleFlush = useMutationObserver();
  3616. } else if (isWorker) {
  3617. scheduleFlush = useMessageChannel();
  3618. } else if (browserWindow === void 0 && true) {
  3619. scheduleFlush = attemptVertx();
  3620. } else {
  3621. scheduleFlush = useSetTimeout();
  3622. }
  3623. function then(onFulfillment, onRejection) {
  3624. var parent = this;
  3625. var child = new this.constructor(noop3);
  3626. if (child[PROMISE_ID] === void 0) {
  3627. makePromise(child);
  3628. }
  3629. var _state = parent._state;
  3630. if (_state) {
  3631. var callback = arguments[_state - 1];
  3632. asap(function() {
  3633. return invokeCallback(_state, child, callback, parent._result);
  3634. });
  3635. } else {
  3636. subscribe2(parent, child, onFulfillment, onRejection);
  3637. }
  3638. return child;
  3639. }
  3640. function resolve$1(object) {
  3641. var Constructor = this;
  3642. if (object && _typeof(object) === 'object' && object.constructor === Constructor) {
  3643. return object;
  3644. }
  3645. var promise = new Constructor(noop3);
  3646. resolve(promise, object);
  3647. return promise;
  3648. }
  3649. var PROMISE_ID = Math.random().toString(36).substring(2);
  3650. function noop3() {}
  3651. var PENDING = void 0;
  3652. var FULFILLED = 1;
  3653. var REJECTED = 2;
  3654. function selfFulfillment() {
  3655. return new TypeError('You cannot resolve a promise with itself');
  3656. }
  3657. function cannotReturnOwn() {
  3658. return new TypeError('A promises callback cannot return that same promise.');
  3659. }
  3660. function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {
  3661. try {
  3662. then$$1.call(value, fulfillmentHandler, rejectionHandler);
  3663. } catch (e) {
  3664. return e;
  3665. }
  3666. }
  3667. function handleForeignThenable(promise, thenable, then$$1) {
  3668. asap(function(promise2) {
  3669. var sealed = false;
  3670. var error = tryThen(then$$1, thenable, function(value) {
  3671. if (sealed) {
  3672. return;
  3673. }
  3674. sealed = true;
  3675. if (thenable !== value) {
  3676. resolve(promise2, value);
  3677. } else {
  3678. fulfill(promise2, value);
  3679. }
  3680. }, function(reason) {
  3681. if (sealed) {
  3682. return;
  3683. }
  3684. sealed = true;
  3685. reject(promise2, reason);
  3686. }, 'Settle: ' + (promise2._label || ' unknown promise'));
  3687. if (!sealed && error) {
  3688. sealed = true;
  3689. reject(promise2, error);
  3690. }
  3691. }, promise);
  3692. }
  3693. function handleOwnThenable(promise, thenable) {
  3694. if (thenable._state === FULFILLED) {
  3695. fulfill(promise, thenable._result);
  3696. } else if (thenable._state === REJECTED) {
  3697. reject(promise, thenable._result);
  3698. } else {
  3699. subscribe2(thenable, void 0, function(value) {
  3700. return resolve(promise, value);
  3701. }, function(reason) {
  3702. return reject(promise, reason);
  3703. });
  3704. }
  3705. }
  3706. function handleMaybeThenable(promise, maybeThenable, then$$1) {
  3707. if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) {
  3708. handleOwnThenable(promise, maybeThenable);
  3709. } else {
  3710. if (then$$1 === void 0) {
  3711. fulfill(promise, maybeThenable);
  3712. } else if (isFunction(then$$1)) {
  3713. handleForeignThenable(promise, maybeThenable, then$$1);
  3714. } else {
  3715. fulfill(promise, maybeThenable);
  3716. }
  3717. }
  3718. }
  3719. function resolve(promise, value) {
  3720. if (promise === value) {
  3721. reject(promise, selfFulfillment());
  3722. } else if (objectOrFunction(value)) {
  3723. var then$$1 = void 0;
  3724. try {
  3725. then$$1 = value.then;
  3726. } catch (error) {
  3727. reject(promise, error);
  3728. return;
  3729. }
  3730. handleMaybeThenable(promise, value, then$$1);
  3731. } else {
  3732. fulfill(promise, value);
  3733. }
  3734. }
  3735. function publishRejection(promise) {
  3736. if (promise._onerror) {
  3737. promise._onerror(promise._result);
  3738. }
  3739. publish(promise);
  3740. }
  3741. function fulfill(promise, value) {
  3742. if (promise._state !== PENDING) {
  3743. return;
  3744. }
  3745. promise._result = value;
  3746. promise._state = FULFILLED;
  3747. if (promise._subscribers.length !== 0) {
  3748. asap(publish, promise);
  3749. }
  3750. }
  3751. function reject(promise, reason) {
  3752. if (promise._state !== PENDING) {
  3753. return;
  3754. }
  3755. promise._state = REJECTED;
  3756. promise._result = reason;
  3757. asap(publishRejection, promise);
  3758. }
  3759. function subscribe2(parent, child, onFulfillment, onRejection) {
  3760. var _subscribers = parent._subscribers;
  3761. var length = _subscribers.length;
  3762. parent._onerror = null;
  3763. _subscribers[length] = child;
  3764. _subscribers[length + FULFILLED] = onFulfillment;
  3765. _subscribers[length + REJECTED] = onRejection;
  3766. if (length === 0 && parent._state) {
  3767. asap(publish, parent);
  3768. }
  3769. }
  3770. function publish(promise) {
  3771. var subscribers = promise._subscribers;
  3772. var settled = promise._state;
  3773. if (subscribers.length === 0) {
  3774. return;
  3775. }
  3776. var child = void 0, callback = void 0, detail = promise._result;
  3777. for (var i = 0; i < subscribers.length; i += 3) {
  3778. child = subscribers[i];
  3779. callback = subscribers[i + settled];
  3780. if (child) {
  3781. invokeCallback(settled, child, callback, detail);
  3782. } else {
  3783. callback(detail);
  3784. }
  3785. }
  3786. promise._subscribers.length = 0;
  3787. }
  3788. function invokeCallback(settled, promise, callback, detail) {
  3789. var hasCallback = isFunction(callback), value = void 0, error = void 0, succeeded = true;
  3790. if (hasCallback) {
  3791. try {
  3792. value = callback(detail);
  3793. } catch (e) {
  3794. succeeded = false;
  3795. error = e;
  3796. }
  3797. if (promise === value) {
  3798. reject(promise, cannotReturnOwn());
  3799. return;
  3800. }
  3801. } else {
  3802. value = detail;
  3803. }
  3804. if (promise._state !== PENDING) {} else if (hasCallback && succeeded) {
  3805. resolve(promise, value);
  3806. } else if (succeeded === false) {
  3807. reject(promise, error);
  3808. } else if (settled === FULFILLED) {
  3809. fulfill(promise, value);
  3810. } else if (settled === REJECTED) {
  3811. reject(promise, value);
  3812. }
  3813. }
  3814. function initializePromise(promise, resolver) {
  3815. try {
  3816. resolver(function resolvePromise(value) {
  3817. resolve(promise, value);
  3818. }, function rejectPromise(reason) {
  3819. reject(promise, reason);
  3820. });
  3821. } catch (e) {
  3822. reject(promise, e);
  3823. }
  3824. }
  3825. var id = 0;
  3826. function nextId() {
  3827. return id++;
  3828. }
  3829. function makePromise(promise) {
  3830. promise[PROMISE_ID] = id++;
  3831. promise._state = void 0;
  3832. promise._result = void 0;
  3833. promise._subscribers = [];
  3834. }
  3835. function validationError() {
  3836. return new Error('Array Methods must be provided an Array');
  3837. }
  3838. var Enumerator = function() {
  3839. function Enumerator2(Constructor, input) {
  3840. this._instanceConstructor = Constructor;
  3841. this.promise = new Constructor(noop3);
  3842. if (!this.promise[PROMISE_ID]) {
  3843. makePromise(this.promise);
  3844. }
  3845. if (isArray(input)) {
  3846. this.length = input.length;
  3847. this._remaining = input.length;
  3848. this._result = new Array(this.length);
  3849. if (this.length === 0) {
  3850. fulfill(this.promise, this._result);
  3851. } else {
  3852. this.length = this.length || 0;
  3853. this._enumerate(input);
  3854. if (this._remaining === 0) {
  3855. fulfill(this.promise, this._result);
  3856. }
  3857. }
  3858. } else {
  3859. reject(this.promise, validationError());
  3860. }
  3861. }
  3862. Enumerator2.prototype._enumerate = function _enumerate(input) {
  3863. for (var i = 0; this._state === PENDING && i < input.length; i++) {
  3864. this._eachEntry(input[i], i);
  3865. }
  3866. };
  3867. Enumerator2.prototype._eachEntry = function _eachEntry(entry, i) {
  3868. var c4 = this._instanceConstructor;
  3869. var resolve$$1 = c4.resolve;
  3870. if (resolve$$1 === resolve$1) {
  3871. var _then = void 0;
  3872. var error = void 0;
  3873. var didError = false;
  3874. try {
  3875. _then = entry.then;
  3876. } catch (e) {
  3877. didError = true;
  3878. error = e;
  3879. }
  3880. if (_then === then && entry._state !== PENDING) {
  3881. this._settledAt(entry._state, i, entry._result);
  3882. } else if (typeof _then !== 'function') {
  3883. this._remaining--;
  3884. this._result[i] = entry;
  3885. } else if (c4 === Promise$1) {
  3886. var promise = new c4(noop3);
  3887. if (didError) {
  3888. reject(promise, error);
  3889. } else {
  3890. handleMaybeThenable(promise, entry, _then);
  3891. }
  3892. this._willSettleAt(promise, i);
  3893. } else {
  3894. this._willSettleAt(new c4(function(resolve$$12) {
  3895. return resolve$$12(entry);
  3896. }), i);
  3897. }
  3898. } else {
  3899. this._willSettleAt(resolve$$1(entry), i);
  3900. }
  3901. };
  3902. Enumerator2.prototype._settledAt = function _settledAt(state, i, value) {
  3903. var promise = this.promise;
  3904. if (promise._state === PENDING) {
  3905. this._remaining--;
  3906. if (state === REJECTED) {
  3907. reject(promise, value);
  3908. } else {
  3909. this._result[i] = value;
  3910. }
  3911. }
  3912. if (this._remaining === 0) {
  3913. fulfill(promise, this._result);
  3914. }
  3915. };
  3916. Enumerator2.prototype._willSettleAt = function _willSettleAt(promise, i) {
  3917. var enumerator = this;
  3918. subscribe2(promise, void 0, function(value) {
  3919. return enumerator._settledAt(FULFILLED, i, value);
  3920. }, function(reason) {
  3921. return enumerator._settledAt(REJECTED, i, reason);
  3922. });
  3923. };
  3924. return Enumerator2;
  3925. }();
  3926. function all(entries) {
  3927. return new Enumerator(this, entries).promise;
  3928. }
  3929. function race(entries) {
  3930. var Constructor = this;
  3931. if (!isArray(entries)) {
  3932. return new Constructor(function(_, reject2) {
  3933. return reject2(new TypeError('You must pass an array to race.'));
  3934. });
  3935. } else {
  3936. return new Constructor(function(resolve2, reject2) {
  3937. var length = entries.length;
  3938. for (var i = 0; i < length; i++) {
  3939. Constructor.resolve(entries[i]).then(resolve2, reject2);
  3940. }
  3941. });
  3942. }
  3943. }
  3944. function reject$1(reason) {
  3945. var Constructor = this;
  3946. var promise = new Constructor(noop3);
  3947. reject(promise, reason);
  3948. return promise;
  3949. }
  3950. function needsResolver() {
  3951. throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
  3952. }
  3953. function needsNew() {
  3954. throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.');
  3955. }
  3956. var Promise$1 = function() {
  3957. function Promise2(resolver) {
  3958. this[PROMISE_ID] = nextId();
  3959. this._result = this._state = void 0;
  3960. this._subscribers = [];
  3961. if (noop3 !== resolver) {
  3962. typeof resolver !== 'function' && needsResolver();
  3963. this instanceof Promise2 ? initializePromise(this, resolver) : needsNew();
  3964. }
  3965. }
  3966. Promise2.prototype['catch'] = function _catch(onRejection) {
  3967. return this.then(null, onRejection);
  3968. };
  3969. Promise2.prototype['finally'] = function _finally(callback) {
  3970. var promise = this;
  3971. var constructor = promise.constructor;
  3972. if (isFunction(callback)) {
  3973. return promise.then(function(value) {
  3974. return constructor.resolve(callback()).then(function() {
  3975. return value;
  3976. });
  3977. }, function(reason) {
  3978. return constructor.resolve(callback()).then(function() {
  3979. throw reason;
  3980. });
  3981. });
  3982. }
  3983. return promise.then(callback, callback);
  3984. };
  3985. return Promise2;
  3986. }();
  3987. Promise$1.prototype.then = then;
  3988. Promise$1.all = all;
  3989. Promise$1.race = race;
  3990. Promise$1.resolve = resolve$1;
  3991. Promise$1.reject = reject$1;
  3992. Promise$1._setScheduler = setScheduler;
  3993. Promise$1._setAsap = setAsap;
  3994. Promise$1._asap = asap;
  3995. function polyfill() {
  3996. var local = void 0;
  3997. if (typeof global !== 'undefined') {
  3998. local = global;
  3999. } else if (typeof self !== 'undefined') {
  4000. local = self;
  4001. } else {
  4002. try {
  4003. local = Function('return this')();
  4004. } catch (e) {
  4005. throw new Error('polyfill failed because global object is unavailable in this environment');
  4006. }
  4007. }
  4008. var P = local.Promise;
  4009. if (P) {
  4010. var promiseToString = null;
  4011. try {
  4012. promiseToString = Object.prototype.toString.call(P.resolve());
  4013. } catch (e) {}
  4014. if (promiseToString === '[object Promise]' && !P.cast) {
  4015. return;
  4016. }
  4017. }
  4018. local.Promise = Promise$1;
  4019. }
  4020. Promise$1.polyfill = polyfill;
  4021. Promise$1.Promise = Promise$1;
  4022. return Promise$1;
  4023. });
  4024. });
  4025. var require_typedarray = __commonJS(function(exports) {
  4026. var MAX_ARRAY_LENGTH = 1e5;
  4027. var ECMAScript = function() {
  4028. var opts = Object.prototype.toString;
  4029. var ophop = Object.prototype.hasOwnProperty;
  4030. return {
  4031. Class: function Class(v) {
  4032. return opts.call(v).replace(/^\[object *|\]$/g, '');
  4033. },
  4034. HasProperty: function HasProperty(o, p2) {
  4035. return p2 in o;
  4036. },
  4037. HasOwnProperty: function HasOwnProperty(o, p2) {
  4038. return ophop.call(o, p2);
  4039. },
  4040. IsCallable: function IsCallable(o) {
  4041. return typeof o === 'function';
  4042. },
  4043. ToInt32: function ToInt32(v) {
  4044. return v >> 0;
  4045. },
  4046. ToUint32: function ToUint32(v) {
  4047. return v >>> 0;
  4048. }
  4049. };
  4050. }();
  4051. var LN2 = Math.LN2;
  4052. var abs = Math.abs;
  4053. var floor = Math.floor;
  4054. var log2 = Math.log;
  4055. var min = Math.min;
  4056. var pow = Math.pow;
  4057. var round = Math.round;
  4058. function clamp3(v, minimum, max2) {
  4059. return v < minimum ? minimum : v > max2 ? max2 : v;
  4060. }
  4061. var getOwnPropNames = Object.getOwnPropertyNames || function(o) {
  4062. if (o !== Object(o)) {
  4063. throw new TypeError('Object.getOwnPropertyNames called on non-object');
  4064. }
  4065. var props = [], p2;
  4066. for (p2 in o) {
  4067. if (ECMAScript.HasOwnProperty(o, p2)) {
  4068. props.push(p2);
  4069. }
  4070. }
  4071. return props;
  4072. };
  4073. var defineProp;
  4074. if (Object.defineProperty && function() {
  4075. try {
  4076. Object.defineProperty({}, 'x', {});
  4077. return true;
  4078. } catch (e) {
  4079. return false;
  4080. }
  4081. }()) {
  4082. defineProp = Object.defineProperty;
  4083. } else {
  4084. defineProp = function defineProp(o, p2, desc) {
  4085. if (!o === Object(o)) {
  4086. throw new TypeError('Object.defineProperty called on non-object');
  4087. }
  4088. if (ECMAScript.HasProperty(desc, 'get') && Object.prototype.__defineGetter__) {
  4089. Object.prototype.__defineGetter__.call(o, p2, desc.get);
  4090. }
  4091. if (ECMAScript.HasProperty(desc, 'set') && Object.prototype.__defineSetter__) {
  4092. Object.prototype.__defineSetter__.call(o, p2, desc.set);
  4093. }
  4094. if (ECMAScript.HasProperty(desc, 'value')) {
  4095. o[p2] = desc.value;
  4096. }
  4097. return o;
  4098. };
  4099. }
  4100. function configureProperties(obj) {
  4101. if (getOwnPropNames && defineProp) {
  4102. var props = getOwnPropNames(obj), i;
  4103. for (i = 0; i < props.length; i += 1) {
  4104. defineProp(obj, props[i], {
  4105. value: obj[props[i]],
  4106. writable: false,
  4107. enumerable: false,
  4108. configurable: false
  4109. });
  4110. }
  4111. }
  4112. }
  4113. function makeArrayAccessors(obj) {
  4114. if (!defineProp) {
  4115. return;
  4116. }
  4117. if (obj.length > MAX_ARRAY_LENGTH) {
  4118. throw new RangeError('Array too large for polyfill');
  4119. }
  4120. function makeArrayAccessor(index) {
  4121. defineProp(obj, index, {
  4122. get: function get() {
  4123. return obj._getter(index);
  4124. },
  4125. set: function set(v) {
  4126. obj._setter(index, v);
  4127. },
  4128. enumerable: true,
  4129. configurable: false
  4130. });
  4131. }
  4132. var i;
  4133. for (i = 0; i < obj.length; i += 1) {
  4134. makeArrayAccessor(i);
  4135. }
  4136. }
  4137. function as_signed(value, bits) {
  4138. var s = 32 - bits;
  4139. return value << s >> s;
  4140. }
  4141. function as_unsigned(value, bits) {
  4142. var s = 32 - bits;
  4143. return value << s >>> s;
  4144. }
  4145. function packI8(n2) {
  4146. return [ n2 & 255 ];
  4147. }
  4148. function unpackI8(bytes) {
  4149. return as_signed(bytes[0], 8);
  4150. }
  4151. function packU8(n2) {
  4152. return [ n2 & 255 ];
  4153. }
  4154. function unpackU8(bytes) {
  4155. return as_unsigned(bytes[0], 8);
  4156. }
  4157. function packU8Clamped(n2) {
  4158. n2 = round(Number(n2));
  4159. return [ n2 < 0 ? 0 : n2 > 255 ? 255 : n2 & 255 ];
  4160. }
  4161. function packI16(n2) {
  4162. return [ n2 >> 8 & 255, n2 & 255 ];
  4163. }
  4164. function unpackI16(bytes) {
  4165. return as_signed(bytes[0] << 8 | bytes[1], 16);
  4166. }
  4167. function packU16(n2) {
  4168. return [ n2 >> 8 & 255, n2 & 255 ];
  4169. }
  4170. function unpackU16(bytes) {
  4171. return as_unsigned(bytes[0] << 8 | bytes[1], 16);
  4172. }
  4173. function packI32(n2) {
  4174. return [ n2 >> 24 & 255, n2 >> 16 & 255, n2 >> 8 & 255, n2 & 255 ];
  4175. }
  4176. function unpackI32(bytes) {
  4177. return as_signed(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32);
  4178. }
  4179. function packU32(n2) {
  4180. return [ n2 >> 24 & 255, n2 >> 16 & 255, n2 >> 8 & 255, n2 & 255 ];
  4181. }
  4182. function unpackU32(bytes) {
  4183. return as_unsigned(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32);
  4184. }
  4185. function packIEEE754(v, ebits, fbits) {
  4186. var bias = (1 << ebits - 1) - 1;
  4187. var s, e, f, i, bits, str, bytes;
  4188. function roundToEven(n2) {
  4189. var w = floor(n2);
  4190. var fl = n2 - w;
  4191. if (fl < .5) {
  4192. return w;
  4193. }
  4194. if (fl > .5) {
  4195. return w + 1;
  4196. }
  4197. return w % 2 ? w + 1 : w;
  4198. }
  4199. if (v !== v) {
  4200. e = (1 << ebits) - 1;
  4201. f = pow(2, fbits - 1);
  4202. s = 0;
  4203. } else if (v === Infinity || v === -Infinity) {
  4204. e = (1 << ebits) - 1;
  4205. f = 0;
  4206. s = v < 0 ? 1 : 0;
  4207. } else if (v === 0) {
  4208. e = 0;
  4209. f = 0;
  4210. s = 1 / v === -Infinity ? 1 : 0;
  4211. } else {
  4212. s = v < 0;
  4213. v = abs(v);
  4214. if (v >= pow(2, 1 - bias)) {
  4215. e = min(floor(log2(v) / LN2), 1023);
  4216. f = roundToEven(v / pow(2, e) * pow(2, fbits));
  4217. if (f / pow(2, fbits) >= 2) {
  4218. e = e + 1;
  4219. f = 1;
  4220. }
  4221. if (e > bias) {
  4222. e = (1 << ebits) - 1;
  4223. f = 0;
  4224. } else {
  4225. e = e + bias;
  4226. f = f - pow(2, fbits);
  4227. }
  4228. } else {
  4229. e = 0;
  4230. f = roundToEven(v / pow(2, 1 - bias - fbits));
  4231. }
  4232. }
  4233. bits = [];
  4234. for (i = fbits; i; i -= 1) {
  4235. bits.push(f % 2 ? 1 : 0);
  4236. f = floor(f / 2);
  4237. }
  4238. for (i = ebits; i; i -= 1) {
  4239. bits.push(e % 2 ? 1 : 0);
  4240. e = floor(e / 2);
  4241. }
  4242. bits.push(s ? 1 : 0);
  4243. bits.reverse();
  4244. str = bits.join('');
  4245. bytes = [];
  4246. while (str.length) {
  4247. bytes.push(parseInt(str.substring(0, 8), 2));
  4248. str = str.substring(8);
  4249. }
  4250. return bytes;
  4251. }
  4252. function unpackIEEE754(bytes, ebits, fbits) {
  4253. var bits = [], i, j, b2, str, bias, s, e, f;
  4254. for (i = bytes.length; i; i -= 1) {
  4255. b2 = bytes[i - 1];
  4256. for (j = 8; j; j -= 1) {
  4257. bits.push(b2 % 2 ? 1 : 0);
  4258. b2 = b2 >> 1;
  4259. }
  4260. }
  4261. bits.reverse();
  4262. str = bits.join('');
  4263. bias = (1 << ebits - 1) - 1;
  4264. s = parseInt(str.substring(0, 1), 2) ? -1 : 1;
  4265. e = parseInt(str.substring(1, 1 + ebits), 2);
  4266. f = parseInt(str.substring(1 + ebits), 2);
  4267. if (e === (1 << ebits) - 1) {
  4268. return f === 0 ? s * Infinity : NaN;
  4269. } else if (e > 0) {
  4270. return s * pow(2, e - bias) * (1 + f / pow(2, fbits));
  4271. } else if (f !== 0) {
  4272. return s * pow(2, -(bias - 1)) * (f / pow(2, fbits));
  4273. }
  4274. return s < 0 ? -0 : 0;
  4275. }
  4276. function unpackF64(b2) {
  4277. return unpackIEEE754(b2, 11, 52);
  4278. }
  4279. function packF64(v) {
  4280. return packIEEE754(v, 11, 52);
  4281. }
  4282. function unpackF32(b2) {
  4283. return unpackIEEE754(b2, 8, 23);
  4284. }
  4285. function packF32(v) {
  4286. return packIEEE754(v, 8, 23);
  4287. }
  4288. (function() {
  4289. function ArrayBuffer(length) {
  4290. length = ECMAScript.ToInt32(length);
  4291. if (length < 0) {
  4292. throw new RangeError('ArrayBuffer size is not a small enough positive integer');
  4293. }
  4294. this.byteLength = length;
  4295. this._bytes = [];
  4296. this._bytes.length = length;
  4297. var i;
  4298. for (i = 0; i < this.byteLength; i += 1) {
  4299. this._bytes[i] = 0;
  4300. }
  4301. configureProperties(this);
  4302. }
  4303. exports.ArrayBuffer = exports.ArrayBuffer || ArrayBuffer;
  4304. function ArrayBufferView() {}
  4305. function makeConstructor(bytesPerElement, pack, unpack) {
  4306. var _ctor;
  4307. _ctor = function ctor(buffer, byteOffset, length) {
  4308. var array, sequence, i, s;
  4309. if (!arguments.length || typeof arguments[0] === 'number') {
  4310. this.length = ECMAScript.ToInt32(arguments[0]);
  4311. if (length < 0) {
  4312. throw new RangeError('ArrayBufferView size is not a small enough positive integer');
  4313. }
  4314. this.byteLength = this.length * this.BYTES_PER_ELEMENT;
  4315. this.buffer = new ArrayBuffer(this.byteLength);
  4316. this.byteOffset = 0;
  4317. } else if (_typeof(arguments[0]) === 'object' && arguments[0].constructor === _ctor) {
  4318. array = arguments[0];
  4319. this.length = array.length;
  4320. this.byteLength = this.length * this.BYTES_PER_ELEMENT;
  4321. this.buffer = new ArrayBuffer(this.byteLength);
  4322. this.byteOffset = 0;
  4323. for (i = 0; i < this.length; i += 1) {
  4324. this._setter(i, array._getter(i));
  4325. }
  4326. } else if (_typeof(arguments[0]) === 'object' && !(arguments[0] instanceof ArrayBuffer || ECMAScript.Class(arguments[0]) === 'ArrayBuffer')) {
  4327. sequence = arguments[0];
  4328. this.length = ECMAScript.ToUint32(sequence.length);
  4329. this.byteLength = this.length * this.BYTES_PER_ELEMENT;
  4330. this.buffer = new ArrayBuffer(this.byteLength);
  4331. this.byteOffset = 0;
  4332. for (i = 0; i < this.length; i += 1) {
  4333. s = sequence[i];
  4334. this._setter(i, Number(s));
  4335. }
  4336. } else if (_typeof(arguments[0]) === 'object' && (arguments[0] instanceof ArrayBuffer || ECMAScript.Class(arguments[0]) === 'ArrayBuffer')) {
  4337. this.buffer = buffer;
  4338. this.byteOffset = ECMAScript.ToUint32(byteOffset);
  4339. if (this.byteOffset > this.buffer.byteLength) {
  4340. throw new RangeError('byteOffset out of range');
  4341. }
  4342. if (this.byteOffset % this.BYTES_PER_ELEMENT) {
  4343. throw new RangeError('ArrayBuffer length minus the byteOffset is not a multiple of the element size.');
  4344. }
  4345. if (arguments.length < 3) {
  4346. this.byteLength = this.buffer.byteLength - this.byteOffset;
  4347. if (this.byteLength % this.BYTES_PER_ELEMENT) {
  4348. throw new RangeError('length of buffer minus byteOffset not a multiple of the element size');
  4349. }
  4350. this.length = this.byteLength / this.BYTES_PER_ELEMENT;
  4351. } else {
  4352. this.length = ECMAScript.ToUint32(length);
  4353. this.byteLength = this.length * this.BYTES_PER_ELEMENT;
  4354. }
  4355. if (this.byteOffset + this.byteLength > this.buffer.byteLength) {
  4356. throw new RangeError('byteOffset and length reference an area beyond the end of the buffer');
  4357. }
  4358. } else {
  4359. throw new TypeError('Unexpected argument type(s)');
  4360. }
  4361. this.constructor = _ctor;
  4362. configureProperties(this);
  4363. makeArrayAccessors(this);
  4364. };
  4365. _ctor.prototype = new ArrayBufferView();
  4366. _ctor.prototype.BYTES_PER_ELEMENT = bytesPerElement;
  4367. _ctor.prototype._pack = pack;
  4368. _ctor.prototype._unpack = unpack;
  4369. _ctor.BYTES_PER_ELEMENT = bytesPerElement;
  4370. _ctor.prototype._getter = function(index) {
  4371. if (arguments.length < 1) {
  4372. throw new SyntaxError('Not enough arguments');
  4373. }
  4374. index = ECMAScript.ToUint32(index);
  4375. if (index >= this.length) {
  4376. return void 0;
  4377. }
  4378. var bytes = [];
  4379. for (var i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; i < this.BYTES_PER_ELEMENT; i += 1,
  4380. o += 1) {
  4381. bytes.push(this.buffer._bytes[o]);
  4382. }
  4383. return this._unpack(bytes);
  4384. };
  4385. _ctor.prototype.get = _ctor.prototype._getter;
  4386. _ctor.prototype._setter = function(index, value) {
  4387. if (arguments.length < 2) {
  4388. throw new SyntaxError('Not enough arguments');
  4389. }
  4390. index = ECMAScript.ToUint32(index);
  4391. if (index < this.length) {
  4392. var bytes = this._pack(value);
  4393. var i;
  4394. var o;
  4395. for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; i < this.BYTES_PER_ELEMENT; i += 1,
  4396. o += 1) {
  4397. this.buffer._bytes[o] = bytes[i];
  4398. }
  4399. }
  4400. };
  4401. _ctor.prototype.set = function(index, value) {
  4402. if (arguments.length < 1) {
  4403. throw new SyntaxError('Not enough arguments');
  4404. }
  4405. var array, sequence, offset, len, i, s, d2, byteOffset, byteLength, tmp;
  4406. if (_typeof(arguments[0]) === 'object' && arguments[0].constructor === this.constructor) {
  4407. array = arguments[0];
  4408. offset = ECMAScript.ToUint32(arguments[1]);
  4409. if (offset + array.length > this.length) {
  4410. throw new RangeError('Offset plus length of array is out of range');
  4411. }
  4412. byteOffset = this.byteOffset + offset * this.BYTES_PER_ELEMENT;
  4413. byteLength = array.length * this.BYTES_PER_ELEMENT;
  4414. if (array.buffer === this.buffer) {
  4415. tmp = [];
  4416. for (i = 0, s = array.byteOffset; i < byteLength; i += 1, s += 1) {
  4417. tmp[i] = array.buffer._bytes[s];
  4418. }
  4419. for (i = 0, d2 = byteOffset; i < byteLength; i += 1, d2 += 1) {
  4420. this.buffer._bytes[d2] = tmp[i];
  4421. }
  4422. } else {
  4423. for (i = 0, s = array.byteOffset, d2 = byteOffset; i < byteLength; i += 1,
  4424. s += 1, d2 += 1) {
  4425. this.buffer._bytes[d2] = array.buffer._bytes[s];
  4426. }
  4427. }
  4428. } else if (_typeof(arguments[0]) === 'object' && typeof arguments[0].length !== 'undefined') {
  4429. sequence = arguments[0];
  4430. len = ECMAScript.ToUint32(sequence.length);
  4431. offset = ECMAScript.ToUint32(arguments[1]);
  4432. if (offset + len > this.length) {
  4433. throw new RangeError('Offset plus length of array is out of range');
  4434. }
  4435. for (i = 0; i < len; i += 1) {
  4436. s = sequence[i];
  4437. this._setter(offset + i, Number(s));
  4438. }
  4439. } else {
  4440. throw new TypeError('Unexpected argument type(s)');
  4441. }
  4442. };
  4443. _ctor.prototype.subarray = function(start, end) {
  4444. start = ECMAScript.ToInt32(start);
  4445. end = ECMAScript.ToInt32(end);
  4446. if (arguments.length < 1) {
  4447. start = 0;
  4448. }
  4449. if (arguments.length < 2) {
  4450. end = this.length;
  4451. }
  4452. if (start < 0) {
  4453. start = this.length + start;
  4454. }
  4455. if (end < 0) {
  4456. end = this.length + end;
  4457. }
  4458. start = clamp3(start, 0, this.length);
  4459. end = clamp3(end, 0, this.length);
  4460. var len = end - start;
  4461. if (len < 0) {
  4462. len = 0;
  4463. }
  4464. return new this.constructor(this.buffer, this.byteOffset + start * this.BYTES_PER_ELEMENT, len);
  4465. };
  4466. return _ctor;
  4467. }
  4468. var Int8Array = makeConstructor(1, packI8, unpackI8);
  4469. var Uint8Array2 = makeConstructor(1, packU8, unpackU8);
  4470. var Uint8ClampedArray2 = makeConstructor(1, packU8Clamped, unpackU8);
  4471. var Int16Array = makeConstructor(2, packI16, unpackI16);
  4472. var Uint16Array = makeConstructor(2, packU16, unpackU16);
  4473. var Int32Array = makeConstructor(4, packI32, unpackI32);
  4474. var Uint32Array3 = makeConstructor(4, packU32, unpackU32);
  4475. var Float32Array = makeConstructor(4, packF32, unpackF32);
  4476. var Float64Array = makeConstructor(8, packF64, unpackF64);
  4477. exports.Int8Array = exports.Int8Array || Int8Array;
  4478. exports.Uint8Array = exports.Uint8Array || Uint8Array2;
  4479. exports.Uint8ClampedArray = exports.Uint8ClampedArray || Uint8ClampedArray2;
  4480. exports.Int16Array = exports.Int16Array || Int16Array;
  4481. exports.Uint16Array = exports.Uint16Array || Uint16Array;
  4482. exports.Int32Array = exports.Int32Array || Int32Array;
  4483. exports.Uint32Array = exports.Uint32Array || Uint32Array3;
  4484. exports.Float32Array = exports.Float32Array || Float32Array;
  4485. exports.Float64Array = exports.Float64Array || Float64Array;
  4486. })();
  4487. (function() {
  4488. function r(array, index) {
  4489. return ECMAScript.IsCallable(array.get) ? array.get(index) : array[index];
  4490. }
  4491. var IS_BIG_ENDIAN = function() {
  4492. var u16array = new exports.Uint16Array([ 4660 ]), u8array = new exports.Uint8Array(u16array.buffer);
  4493. return r(u8array, 0) === 18;
  4494. }();
  4495. function DataView(buffer, byteOffset, byteLength) {
  4496. if (arguments.length === 0) {
  4497. buffer = new exports.ArrayBuffer(0);
  4498. } else if (!(buffer instanceof exports.ArrayBuffer || ECMAScript.Class(buffer) === 'ArrayBuffer')) {
  4499. throw new TypeError('TypeError');
  4500. }
  4501. this.buffer = buffer || new exports.ArrayBuffer(0);
  4502. this.byteOffset = ECMAScript.ToUint32(byteOffset);
  4503. if (this.byteOffset > this.buffer.byteLength) {
  4504. throw new RangeError('byteOffset out of range');
  4505. }
  4506. if (arguments.length < 3) {
  4507. this.byteLength = this.buffer.byteLength - this.byteOffset;
  4508. } else {
  4509. this.byteLength = ECMAScript.ToUint32(byteLength);
  4510. }
  4511. if (this.byteOffset + this.byteLength > this.buffer.byteLength) {
  4512. throw new RangeError('byteOffset and length reference an area beyond the end of the buffer');
  4513. }
  4514. configureProperties(this);
  4515. }
  4516. function makeGetter(arrayType) {
  4517. return function(byteOffset, littleEndian) {
  4518. byteOffset = ECMAScript.ToUint32(byteOffset);
  4519. if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) {
  4520. throw new RangeError('Array index out of range');
  4521. }
  4522. byteOffset += this.byteOffset;
  4523. var uint8Array = new exports.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT), bytes = [], i;
  4524. for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) {
  4525. bytes.push(r(uint8Array, i));
  4526. }
  4527. if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) {
  4528. bytes.reverse();
  4529. }
  4530. return r(new arrayType(new exports.Uint8Array(bytes).buffer), 0);
  4531. };
  4532. }
  4533. DataView.prototype.getUint8 = makeGetter(exports.Uint8Array);
  4534. DataView.prototype.getInt8 = makeGetter(exports.Int8Array);
  4535. DataView.prototype.getUint16 = makeGetter(exports.Uint16Array);
  4536. DataView.prototype.getInt16 = makeGetter(exports.Int16Array);
  4537. DataView.prototype.getUint32 = makeGetter(exports.Uint32Array);
  4538. DataView.prototype.getInt32 = makeGetter(exports.Int32Array);
  4539. DataView.prototype.getFloat32 = makeGetter(exports.Float32Array);
  4540. DataView.prototype.getFloat64 = makeGetter(exports.Float64Array);
  4541. function makeSetter(arrayType) {
  4542. return function(byteOffset, value, littleEndian) {
  4543. byteOffset = ECMAScript.ToUint32(byteOffset);
  4544. if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) {
  4545. throw new RangeError('Array index out of range');
  4546. }
  4547. var typeArray = new arrayType([ value ]), byteArray = new exports.Uint8Array(typeArray.buffer), bytes = [], i, byteView;
  4548. for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) {
  4549. bytes.push(r(byteArray, i));
  4550. }
  4551. if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) {
  4552. bytes.reverse();
  4553. }
  4554. byteView = new exports.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT);
  4555. byteView.set(bytes);
  4556. };
  4557. }
  4558. DataView.prototype.setUint8 = makeSetter(exports.Uint8Array);
  4559. DataView.prototype.setInt8 = makeSetter(exports.Int8Array);
  4560. DataView.prototype.setUint16 = makeSetter(exports.Uint16Array);
  4561. DataView.prototype.setInt16 = makeSetter(exports.Int16Array);
  4562. DataView.prototype.setUint32 = makeSetter(exports.Uint32Array);
  4563. DataView.prototype.setInt32 = makeSetter(exports.Int32Array);
  4564. DataView.prototype.setFloat32 = makeSetter(exports.Float32Array);
  4565. DataView.prototype.setFloat64 = makeSetter(exports.Float64Array);
  4566. exports.DataView = exports.DataView || DataView;
  4567. })();
  4568. });
  4569. var require_weakmap_polyfill = __commonJS(function(exports) {
  4570. (function(self2) {
  4571. 'use strict';
  4572. if (self2.WeakMap) {
  4573. return;
  4574. }
  4575. var hasOwnProperty2 = Object.prototype.hasOwnProperty;
  4576. var hasDefine = Object.defineProperty && function() {
  4577. try {
  4578. return Object.defineProperty({}, 'x', {
  4579. value: 1
  4580. }).x === 1;
  4581. } catch (e) {}
  4582. }();
  4583. var defineProperty = function defineProperty(object, name, value) {
  4584. if (hasDefine) {
  4585. Object.defineProperty(object, name, {
  4586. configurable: true,
  4587. writable: true,
  4588. value: value
  4589. });
  4590. } else {
  4591. object[name] = value;
  4592. }
  4593. };
  4594. self2.WeakMap = function() {
  4595. function WeakMap2() {
  4596. if (this === void 0) {
  4597. throw new TypeError('Constructor WeakMap requires \'new\'');
  4598. }
  4599. defineProperty(this, '_id', genId('_WeakMap'));
  4600. if (arguments.length > 0) {
  4601. throw new TypeError('WeakMap iterable is not supported');
  4602. }
  4603. }
  4604. defineProperty(WeakMap2.prototype, 'delete', function(key) {
  4605. checkInstance(this, 'delete');
  4606. if (!isObject(key)) {
  4607. return false;
  4608. }
  4609. var entry = key[this._id];
  4610. if (entry && entry[0] === key) {
  4611. delete key[this._id];
  4612. return true;
  4613. }
  4614. return false;
  4615. });
  4616. defineProperty(WeakMap2.prototype, 'get', function(key) {
  4617. checkInstance(this, 'get');
  4618. if (!isObject(key)) {
  4619. return void 0;
  4620. }
  4621. var entry = key[this._id];
  4622. if (entry && entry[0] === key) {
  4623. return entry[1];
  4624. }
  4625. return void 0;
  4626. });
  4627. defineProperty(WeakMap2.prototype, 'has', function(key) {
  4628. checkInstance(this, 'has');
  4629. if (!isObject(key)) {
  4630. return false;
  4631. }
  4632. var entry = key[this._id];
  4633. if (entry && entry[0] === key) {
  4634. return true;
  4635. }
  4636. return false;
  4637. });
  4638. defineProperty(WeakMap2.prototype, 'set', function(key, value) {
  4639. checkInstance(this, 'set');
  4640. if (!isObject(key)) {
  4641. throw new TypeError('Invalid value used as weak map key');
  4642. }
  4643. var entry = key[this._id];
  4644. if (entry && entry[0] === key) {
  4645. entry[1] = value;
  4646. return this;
  4647. }
  4648. defineProperty(key, this._id, [ key, value ]);
  4649. return this;
  4650. });
  4651. function checkInstance(x, methodName) {
  4652. if (!isObject(x) || !hasOwnProperty2.call(x, '_id')) {
  4653. throw new TypeError(methodName + ' method called on incompatible receiver ' + _typeof(x));
  4654. }
  4655. }
  4656. function genId(prefix) {
  4657. return prefix + '_' + rand() + '.' + rand();
  4658. }
  4659. function rand() {
  4660. return Math.random().toString().substring(2);
  4661. }
  4662. defineProperty(WeakMap2, '_polyfill', true);
  4663. return WeakMap2;
  4664. }();
  4665. function isObject(x) {
  4666. return Object(x) === x;
  4667. }
  4668. })(typeof globalThis !== 'undefined' ? globalThis : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : exports);
  4669. });
  4670. var require_global = __commonJS(function(exports, module) {
  4671. 'use strict';
  4672. var check = function check(it) {
  4673. return it && it.Math === Math && it;
  4674. };
  4675. module.exports = check((typeof globalThis === 'undefined' ? 'undefined' : _typeof(globalThis)) == 'object' && globalThis) || check((typeof window === 'undefined' ? 'undefined' : _typeof(window)) == 'object' && window) || check((typeof self === 'undefined' ? 'undefined' : _typeof(self)) == 'object' && self) || check((typeof global === 'undefined' ? 'undefined' : _typeof(global)) == 'object' && global) || function() {
  4676. return this;
  4677. }() || exports || Function('return this')();
  4678. });
  4679. var require_fails = __commonJS(function(exports, module) {
  4680. 'use strict';
  4681. module.exports = function(exec) {
  4682. try {
  4683. return !!exec();
  4684. } catch (error) {
  4685. return true;
  4686. }
  4687. };
  4688. });
  4689. var require_function_bind_native = __commonJS(function(exports, module) {
  4690. 'use strict';
  4691. var fails = require_fails();
  4692. module.exports = !fails(function() {
  4693. var test = function() {}.bind();
  4694. return typeof test != 'function' || test.hasOwnProperty('prototype');
  4695. });
  4696. });
  4697. var require_function_apply = __commonJS(function(exports, module) {
  4698. 'use strict';
  4699. var NATIVE_BIND = require_function_bind_native();
  4700. var FunctionPrototype = Function.prototype;
  4701. var apply = FunctionPrototype.apply;
  4702. var call = FunctionPrototype.call;
  4703. module.exports = (typeof Reflect === 'undefined' ? 'undefined' : _typeof(Reflect)) == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function() {
  4704. return call.apply(apply, arguments);
  4705. });
  4706. });
  4707. var require_function_uncurry_this = __commonJS(function(exports, module) {
  4708. 'use strict';
  4709. var NATIVE_BIND = require_function_bind_native();
  4710. var FunctionPrototype = Function.prototype;
  4711. var call = FunctionPrototype.call;
  4712. var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);
  4713. module.exports = NATIVE_BIND ? uncurryThisWithBind : function(fn) {
  4714. return function() {
  4715. return call.apply(fn, arguments);
  4716. };
  4717. };
  4718. });
  4719. var require_classof_raw = __commonJS(function(exports, module) {
  4720. 'use strict';
  4721. var uncurryThis = require_function_uncurry_this();
  4722. var toString = uncurryThis({}.toString);
  4723. var stringSlice = uncurryThis(''.slice);
  4724. module.exports = function(it) {
  4725. return stringSlice(toString(it), 8, -1);
  4726. };
  4727. });
  4728. var require_function_uncurry_this_clause = __commonJS(function(exports, module) {
  4729. 'use strict';
  4730. var classofRaw = require_classof_raw();
  4731. var uncurryThis = require_function_uncurry_this();
  4732. module.exports = function(fn) {
  4733. if (classofRaw(fn) === 'Function') {
  4734. return uncurryThis(fn);
  4735. }
  4736. };
  4737. });
  4738. var require_document_all = __commonJS(function(exports, module) {
  4739. 'use strict';
  4740. var documentAll = (typeof document === 'undefined' ? 'undefined' : _typeof(document)) == 'object' && document.all;
  4741. var IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== void 0;
  4742. module.exports = {
  4743. all: documentAll,
  4744. IS_HTMLDDA: IS_HTMLDDA
  4745. };
  4746. });
  4747. var require_is_callable2 = __commonJS(function(exports, module) {
  4748. 'use strict';
  4749. var $documentAll = require_document_all();
  4750. var documentAll = $documentAll.all;
  4751. module.exports = $documentAll.IS_HTMLDDA ? function(argument) {
  4752. return typeof argument == 'function' || argument === documentAll;
  4753. } : function(argument) {
  4754. return typeof argument == 'function';
  4755. };
  4756. });
  4757. var require_descriptors = __commonJS(function(exports, module) {
  4758. 'use strict';
  4759. var fails = require_fails();
  4760. module.exports = !fails(function() {
  4761. return Object.defineProperty({}, 1, {
  4762. get: function get() {
  4763. return 7;
  4764. }
  4765. })[1] !== 7;
  4766. });
  4767. });
  4768. var require_function_call = __commonJS(function(exports, module) {
  4769. 'use strict';
  4770. var NATIVE_BIND = require_function_bind_native();
  4771. var call = Function.prototype.call;
  4772. module.exports = NATIVE_BIND ? call.bind(call) : function() {
  4773. return call.apply(call, arguments);
  4774. };
  4775. });
  4776. var require_object_property_is_enumerable = __commonJS(function(exports) {
  4777. 'use strict';
  4778. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  4779. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  4780. var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({
  4781. 1: 2
  4782. }, 1);
  4783. exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  4784. var descriptor = getOwnPropertyDescriptor(this, V);
  4785. return !!descriptor && descriptor.enumerable;
  4786. } : $propertyIsEnumerable;
  4787. });
  4788. var require_create_property_descriptor = __commonJS(function(exports, module) {
  4789. 'use strict';
  4790. module.exports = function(bitmap, value) {
  4791. return {
  4792. enumerable: !(bitmap & 1),
  4793. configurable: !(bitmap & 2),
  4794. writable: !(bitmap & 4),
  4795. value: value
  4796. };
  4797. };
  4798. });
  4799. var require_indexed_object = __commonJS(function(exports, module) {
  4800. 'use strict';
  4801. var uncurryThis = require_function_uncurry_this();
  4802. var fails = require_fails();
  4803. var classof = require_classof_raw();
  4804. var $Object = Object;
  4805. var split = uncurryThis(''.split);
  4806. module.exports = fails(function() {
  4807. return !$Object('z').propertyIsEnumerable(0);
  4808. }) ? function(it) {
  4809. return classof(it) === 'String' ? split(it, '') : $Object(it);
  4810. } : $Object;
  4811. });
  4812. var require_is_null_or_undefined = __commonJS(function(exports, module) {
  4813. 'use strict';
  4814. module.exports = function(it) {
  4815. return it === null || it === void 0;
  4816. };
  4817. });
  4818. var require_require_object_coercible = __commonJS(function(exports, module) {
  4819. 'use strict';
  4820. var isNullOrUndefined = require_is_null_or_undefined();
  4821. var $TypeError = TypeError;
  4822. module.exports = function(it) {
  4823. if (isNullOrUndefined(it)) {
  4824. throw new $TypeError('Can\'t call method on ' + it);
  4825. }
  4826. return it;
  4827. };
  4828. });
  4829. var require_to_indexed_object = __commonJS(function(exports, module) {
  4830. 'use strict';
  4831. var IndexedObject = require_indexed_object();
  4832. var requireObjectCoercible = require_require_object_coercible();
  4833. module.exports = function(it) {
  4834. return IndexedObject(requireObjectCoercible(it));
  4835. };
  4836. });
  4837. var require_is_object2 = __commonJS(function(exports, module) {
  4838. 'use strict';
  4839. var isCallable = require_is_callable2();
  4840. var $documentAll = require_document_all();
  4841. var documentAll = $documentAll.all;
  4842. module.exports = $documentAll.IS_HTMLDDA ? function(it) {
  4843. return _typeof(it) == 'object' ? it !== null : isCallable(it) || it === documentAll;
  4844. } : function(it) {
  4845. return _typeof(it) == 'object' ? it !== null : isCallable(it);
  4846. };
  4847. });
  4848. var require_path = __commonJS(function(exports, module) {
  4849. 'use strict';
  4850. module.exports = {};
  4851. });
  4852. var require_get_built_in = __commonJS(function(exports, module) {
  4853. 'use strict';
  4854. var path = require_path();
  4855. var global2 = require_global();
  4856. var isCallable = require_is_callable2();
  4857. var aFunction = function aFunction(variable) {
  4858. return isCallable(variable) ? variable : void 0;
  4859. };
  4860. module.exports = function(namespace, method) {
  4861. return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global2[namespace]) : path[namespace] && path[namespace][method] || global2[namespace] && global2[namespace][method];
  4862. };
  4863. });
  4864. var require_object_is_prototype_of = __commonJS(function(exports, module) {
  4865. 'use strict';
  4866. var uncurryThis = require_function_uncurry_this();
  4867. module.exports = uncurryThis({}.isPrototypeOf);
  4868. });
  4869. var require_engine_user_agent = __commonJS(function(exports, module) {
  4870. 'use strict';
  4871. module.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
  4872. });
  4873. var require_engine_v8_version = __commonJS(function(exports, module) {
  4874. 'use strict';
  4875. var global2 = require_global();
  4876. var userAgent = require_engine_user_agent();
  4877. var process2 = global2.process;
  4878. var Deno = global2.Deno;
  4879. var versions = process2 && process2.versions || Deno && Deno.version;
  4880. var v8 = versions && versions.v8;
  4881. var match;
  4882. var version;
  4883. if (v8) {
  4884. match = v8.split('.');
  4885. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  4886. }
  4887. if (!version && userAgent) {
  4888. match = userAgent.match(/Edge\/(\d+)/);
  4889. if (!match || match[1] >= 74) {
  4890. match = userAgent.match(/Chrome\/(\d+)/);
  4891. if (match) {
  4892. version = +match[1];
  4893. }
  4894. }
  4895. }
  4896. module.exports = version;
  4897. });
  4898. var require_symbol_constructor_detection = __commonJS(function(exports, module) {
  4899. 'use strict';
  4900. var V8_VERSION = require_engine_v8_version();
  4901. var fails = require_fails();
  4902. var global2 = require_global();
  4903. var $String = global2.String;
  4904. module.exports = !!Object.getOwnPropertySymbols && !fails(function() {
  4905. var symbol = Symbol('symbol detection');
  4906. return !$String(symbol) || !(Object(symbol) instanceof Symbol) || !Symbol.sham && V8_VERSION && V8_VERSION < 41;
  4907. });
  4908. });
  4909. var require_use_symbol_as_uid = __commonJS(function(exports, module) {
  4910. 'use strict';
  4911. var NATIVE_SYMBOL = require_symbol_constructor_detection();
  4912. module.exports = NATIVE_SYMBOL && !Symbol.sham && _typeof(Symbol.iterator) == 'symbol';
  4913. });
  4914. var require_is_symbol2 = __commonJS(function(exports, module) {
  4915. 'use strict';
  4916. var getBuiltIn = require_get_built_in();
  4917. var isCallable = require_is_callable2();
  4918. var isPrototypeOf = require_object_is_prototype_of();
  4919. var USE_SYMBOL_AS_UID = require_use_symbol_as_uid();
  4920. var $Object = Object;
  4921. module.exports = USE_SYMBOL_AS_UID ? function(it) {
  4922. return _typeof(it) == 'symbol';
  4923. } : function(it) {
  4924. var $Symbol = getBuiltIn('Symbol');
  4925. return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));
  4926. };
  4927. });
  4928. var require_try_to_string = __commonJS(function(exports, module) {
  4929. 'use strict';
  4930. var $String = String;
  4931. module.exports = function(argument) {
  4932. try {
  4933. return $String(argument);
  4934. } catch (error) {
  4935. return 'Object';
  4936. }
  4937. };
  4938. });
  4939. var require_a_callable = __commonJS(function(exports, module) {
  4940. 'use strict';
  4941. var isCallable = require_is_callable2();
  4942. var tryToString = require_try_to_string();
  4943. var $TypeError = TypeError;
  4944. module.exports = function(argument) {
  4945. if (isCallable(argument)) {
  4946. return argument;
  4947. }
  4948. throw new $TypeError(tryToString(argument) + ' is not a function');
  4949. };
  4950. });
  4951. var require_get_method = __commonJS(function(exports, module) {
  4952. 'use strict';
  4953. var aCallable = require_a_callable();
  4954. var isNullOrUndefined = require_is_null_or_undefined();
  4955. module.exports = function(V, P) {
  4956. var func = V[P];
  4957. return isNullOrUndefined(func) ? void 0 : aCallable(func);
  4958. };
  4959. });
  4960. var require_ordinary_to_primitive = __commonJS(function(exports, module) {
  4961. 'use strict';
  4962. var call = require_function_call();
  4963. var isCallable = require_is_callable2();
  4964. var isObject = require_is_object2();
  4965. var $TypeError = TypeError;
  4966. module.exports = function(input, pref) {
  4967. var fn, val;
  4968. if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) {
  4969. return val;
  4970. }
  4971. if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) {
  4972. return val;
  4973. }
  4974. if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) {
  4975. return val;
  4976. }
  4977. throw new $TypeError('Can\'t convert object to primitive value');
  4978. };
  4979. });
  4980. var require_is_pure = __commonJS(function(exports, module) {
  4981. 'use strict';
  4982. module.exports = true;
  4983. });
  4984. var require_define_global_property = __commonJS(function(exports, module) {
  4985. 'use strict';
  4986. var global2 = require_global();
  4987. var defineProperty = Object.defineProperty;
  4988. module.exports = function(key, value) {
  4989. try {
  4990. defineProperty(global2, key, {
  4991. value: value,
  4992. configurable: true,
  4993. writable: true
  4994. });
  4995. } catch (error) {
  4996. global2[key] = value;
  4997. }
  4998. return value;
  4999. };
  5000. });
  5001. var require_shared_store = __commonJS(function(exports, module) {
  5002. 'use strict';
  5003. var global2 = require_global();
  5004. var defineGlobalProperty = require_define_global_property();
  5005. var SHARED = '__core-js_shared__';
  5006. var store = global2[SHARED] || defineGlobalProperty(SHARED, {});
  5007. module.exports = store;
  5008. });
  5009. var require_shared = __commonJS(function(exports, module) {
  5010. 'use strict';
  5011. var IS_PURE = require_is_pure();
  5012. var store = require_shared_store();
  5013. (module.exports = function(key, value) {
  5014. return store[key] || (store[key] = value !== void 0 ? value : {});
  5015. })('versions', []).push({
  5016. version: '3.33.0',
  5017. mode: IS_PURE ? 'pure' : 'global',
  5018. copyright: '\xa9 2014-2023 Denis Pushkarev (zloirock.ru)',
  5019. license: 'https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE',
  5020. source: 'https://github.com/zloirock/core-js'
  5021. });
  5022. });
  5023. var require_to_object = __commonJS(function(exports, module) {
  5024. 'use strict';
  5025. var requireObjectCoercible = require_require_object_coercible();
  5026. var $Object = Object;
  5027. module.exports = function(argument) {
  5028. return $Object(requireObjectCoercible(argument));
  5029. };
  5030. });
  5031. var require_has_own_property = __commonJS(function(exports, module) {
  5032. 'use strict';
  5033. var uncurryThis = require_function_uncurry_this();
  5034. var toObject = require_to_object();
  5035. var hasOwnProperty2 = uncurryThis({}.hasOwnProperty);
  5036. module.exports = Object.hasOwn || function hasOwn2(it, key) {
  5037. return hasOwnProperty2(toObject(it), key);
  5038. };
  5039. });
  5040. var require_uid = __commonJS(function(exports, module) {
  5041. 'use strict';
  5042. var uncurryThis = require_function_uncurry_this();
  5043. var id = 0;
  5044. var postfix = Math.random();
  5045. var toString = uncurryThis(1..toString);
  5046. module.exports = function(key) {
  5047. return 'Symbol(' + (key === void 0 ? '' : key) + ')_' + toString(++id + postfix, 36);
  5048. };
  5049. });
  5050. var require_well_known_symbol = __commonJS(function(exports, module) {
  5051. 'use strict';
  5052. var global2 = require_global();
  5053. var shared = require_shared();
  5054. var hasOwn2 = require_has_own_property();
  5055. var uid = require_uid();
  5056. var NATIVE_SYMBOL = require_symbol_constructor_detection();
  5057. var USE_SYMBOL_AS_UID = require_use_symbol_as_uid();
  5058. var Symbol2 = global2.Symbol;
  5059. var WellKnownSymbolsStore = shared('wks');
  5060. var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol2['for'] || Symbol2 : Symbol2 && Symbol2.withoutSetter || uid;
  5061. module.exports = function(name) {
  5062. if (!hasOwn2(WellKnownSymbolsStore, name)) {
  5063. WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn2(Symbol2, name) ? Symbol2[name] : createWellKnownSymbol('Symbol.' + name);
  5064. }
  5065. return WellKnownSymbolsStore[name];
  5066. };
  5067. });
  5068. var require_to_primitive = __commonJS(function(exports, module) {
  5069. 'use strict';
  5070. var call = require_function_call();
  5071. var isObject = require_is_object2();
  5072. var isSymbol = require_is_symbol2();
  5073. var getMethod = require_get_method();
  5074. var ordinaryToPrimitive = require_ordinary_to_primitive();
  5075. var wellKnownSymbol = require_well_known_symbol();
  5076. var $TypeError = TypeError;
  5077. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  5078. module.exports = function(input, pref) {
  5079. if (!isObject(input) || isSymbol(input)) {
  5080. return input;
  5081. }
  5082. var exoticToPrim = getMethod(input, TO_PRIMITIVE);
  5083. var result;
  5084. if (exoticToPrim) {
  5085. if (pref === void 0) {
  5086. pref = 'default';
  5087. }
  5088. result = call(exoticToPrim, input, pref);
  5089. if (!isObject(result) || isSymbol(result)) {
  5090. return result;
  5091. }
  5092. throw new $TypeError('Can\'t convert object to primitive value');
  5093. }
  5094. if (pref === void 0) {
  5095. pref = 'number';
  5096. }
  5097. return ordinaryToPrimitive(input, pref);
  5098. };
  5099. });
  5100. var require_to_property_key = __commonJS(function(exports, module) {
  5101. 'use strict';
  5102. var toPrimitive = require_to_primitive();
  5103. var isSymbol = require_is_symbol2();
  5104. module.exports = function(argument) {
  5105. var key = toPrimitive(argument, 'string');
  5106. return isSymbol(key) ? key : key + '';
  5107. };
  5108. });
  5109. var require_document_create_element = __commonJS(function(exports, module) {
  5110. 'use strict';
  5111. var global2 = require_global();
  5112. var isObject = require_is_object2();
  5113. var document2 = global2.document;
  5114. var EXISTS = isObject(document2) && isObject(document2.createElement);
  5115. module.exports = function(it) {
  5116. return EXISTS ? document2.createElement(it) : {};
  5117. };
  5118. });
  5119. var require_ie8_dom_define = __commonJS(function(exports, module) {
  5120. 'use strict';
  5121. var DESCRIPTORS = require_descriptors();
  5122. var fails = require_fails();
  5123. var createElement = require_document_create_element();
  5124. module.exports = !DESCRIPTORS && !fails(function() {
  5125. return Object.defineProperty(createElement('div'), 'a', {
  5126. get: function get() {
  5127. return 7;
  5128. }
  5129. }).a !== 7;
  5130. });
  5131. });
  5132. var require_object_get_own_property_descriptor = __commonJS(function(exports) {
  5133. 'use strict';
  5134. var DESCRIPTORS = require_descriptors();
  5135. var call = require_function_call();
  5136. var propertyIsEnumerableModule = require_object_property_is_enumerable();
  5137. var createPropertyDescriptor = require_create_property_descriptor();
  5138. var toIndexedObject = require_to_indexed_object();
  5139. var toPropertyKey = require_to_property_key();
  5140. var hasOwn2 = require_has_own_property();
  5141. var IE8_DOM_DEFINE = require_ie8_dom_define();
  5142. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  5143. exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  5144. O = toIndexedObject(O);
  5145. P = toPropertyKey(P);
  5146. if (IE8_DOM_DEFINE) {
  5147. try {
  5148. return $getOwnPropertyDescriptor(O, P);
  5149. } catch (error) {}
  5150. }
  5151. if (hasOwn2(O, P)) {
  5152. return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
  5153. }
  5154. };
  5155. });
  5156. var require_is_forced = __commonJS(function(exports, module) {
  5157. 'use strict';
  5158. var fails = require_fails();
  5159. var isCallable = require_is_callable2();
  5160. var replacement = /#|\.prototype\./;
  5161. var isForced = function isForced(feature, detection) {
  5162. var value = data[normalize(feature)];
  5163. return value === POLYFILL ? true : value === NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection;
  5164. };
  5165. var normalize = isForced.normalize = function(string) {
  5166. return String(string).replace(replacement, '.').toLowerCase();
  5167. };
  5168. var data = isForced.data = {};
  5169. var NATIVE = isForced.NATIVE = 'N';
  5170. var POLYFILL = isForced.POLYFILL = 'P';
  5171. module.exports = isForced;
  5172. });
  5173. var require_function_bind_context = __commonJS(function(exports, module) {
  5174. 'use strict';
  5175. var uncurryThis = require_function_uncurry_this_clause();
  5176. var aCallable = require_a_callable();
  5177. var NATIVE_BIND = require_function_bind_native();
  5178. var bind = uncurryThis(uncurryThis.bind);
  5179. module.exports = function(fn, that) {
  5180. aCallable(fn);
  5181. return that === void 0 ? fn : NATIVE_BIND ? bind(fn, that) : function() {
  5182. return fn.apply(that, arguments);
  5183. };
  5184. };
  5185. });
  5186. var require_v8_prototype_define_bug = __commonJS(function(exports, module) {
  5187. 'use strict';
  5188. var DESCRIPTORS = require_descriptors();
  5189. var fails = require_fails();
  5190. module.exports = DESCRIPTORS && fails(function() {
  5191. return Object.defineProperty(function() {}, 'prototype', {
  5192. value: 42,
  5193. writable: false
  5194. }).prototype !== 42;
  5195. });
  5196. });
  5197. var require_an_object = __commonJS(function(exports, module) {
  5198. 'use strict';
  5199. var isObject = require_is_object2();
  5200. var $String = String;
  5201. var $TypeError = TypeError;
  5202. module.exports = function(argument) {
  5203. if (isObject(argument)) {
  5204. return argument;
  5205. }
  5206. throw new $TypeError($String(argument) + ' is not an object');
  5207. };
  5208. });
  5209. var require_object_define_property = __commonJS(function(exports) {
  5210. 'use strict';
  5211. var DESCRIPTORS = require_descriptors();
  5212. var IE8_DOM_DEFINE = require_ie8_dom_define();
  5213. var V8_PROTOTYPE_DEFINE_BUG = require_v8_prototype_define_bug();
  5214. var anObject = require_an_object();
  5215. var toPropertyKey = require_to_property_key();
  5216. var $TypeError = TypeError;
  5217. var $defineProperty = Object.defineProperty;
  5218. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  5219. var ENUMERABLE = 'enumerable';
  5220. var CONFIGURABLE = 'configurable';
  5221. var WRITABLE = 'writable';
  5222. exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
  5223. anObject(O);
  5224. P = toPropertyKey(P);
  5225. anObject(Attributes);
  5226. if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  5227. var current = $getOwnPropertyDescriptor(O, P);
  5228. if (current && current[WRITABLE]) {
  5229. O[P] = Attributes.value;
  5230. Attributes = {
  5231. configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
  5232. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  5233. writable: false
  5234. };
  5235. }
  5236. }
  5237. return $defineProperty(O, P, Attributes);
  5238. } : $defineProperty : function defineProperty(O, P, Attributes) {
  5239. anObject(O);
  5240. P = toPropertyKey(P);
  5241. anObject(Attributes);
  5242. if (IE8_DOM_DEFINE) {
  5243. try {
  5244. return $defineProperty(O, P, Attributes);
  5245. } catch (error) {}
  5246. }
  5247. if ('get' in Attributes || 'set' in Attributes) {
  5248. throw new $TypeError('Accessors not supported');
  5249. }
  5250. if ('value' in Attributes) {
  5251. O[P] = Attributes.value;
  5252. }
  5253. return O;
  5254. };
  5255. });
  5256. var require_create_non_enumerable_property = __commonJS(function(exports, module) {
  5257. 'use strict';
  5258. var DESCRIPTORS = require_descriptors();
  5259. var definePropertyModule = require_object_define_property();
  5260. var createPropertyDescriptor = require_create_property_descriptor();
  5261. module.exports = DESCRIPTORS ? function(object, key, value) {
  5262. return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
  5263. } : function(object, key, value) {
  5264. object[key] = value;
  5265. return object;
  5266. };
  5267. });
  5268. var require_export = __commonJS(function(exports, module) {
  5269. 'use strict';
  5270. var global2 = require_global();
  5271. var apply = require_function_apply();
  5272. var uncurryThis = require_function_uncurry_this_clause();
  5273. var isCallable = require_is_callable2();
  5274. var getOwnPropertyDescriptor = require_object_get_own_property_descriptor().f;
  5275. var isForced = require_is_forced();
  5276. var path = require_path();
  5277. var bind = require_function_bind_context();
  5278. var createNonEnumerableProperty = require_create_non_enumerable_property();
  5279. var hasOwn2 = require_has_own_property();
  5280. var wrapConstructor = function wrapConstructor(NativeConstructor) {
  5281. var _Wrapper = function Wrapper(a2, b2, c4) {
  5282. if (this instanceof _Wrapper) {
  5283. switch (arguments.length) {
  5284. case 0:
  5285. return new NativeConstructor();
  5286. case 1:
  5287. return new NativeConstructor(a2);
  5288. case 2:
  5289. return new NativeConstructor(a2, b2);
  5290. }
  5291. return new NativeConstructor(a2, b2, c4);
  5292. }
  5293. return apply(NativeConstructor, this, arguments);
  5294. };
  5295. _Wrapper.prototype = NativeConstructor.prototype;
  5296. return _Wrapper;
  5297. };
  5298. module.exports = function(options, source) {
  5299. var TARGET = options.target;
  5300. var GLOBAL = options.global;
  5301. var STATIC = options.stat;
  5302. var PROTO = options.proto;
  5303. var nativeSource = GLOBAL ? global2 : STATIC ? global2[TARGET] : (global2[TARGET] || {}).prototype;
  5304. var target = GLOBAL ? path : path[TARGET] || createNonEnumerableProperty(path, TARGET, {})[TARGET];
  5305. var targetPrototype = target.prototype;
  5306. var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;
  5307. var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;
  5308. for (key in source) {
  5309. FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  5310. USE_NATIVE = !FORCED && nativeSource && hasOwn2(nativeSource, key);
  5311. targetProperty = target[key];
  5312. if (USE_NATIVE) {
  5313. if (options.dontCallGetSet) {
  5314. descriptor = getOwnPropertyDescriptor(nativeSource, key);
  5315. nativeProperty = descriptor && descriptor.value;
  5316. } else {
  5317. nativeProperty = nativeSource[key];
  5318. }
  5319. }
  5320. sourceProperty = USE_NATIVE && nativeProperty ? nativeProperty : source[key];
  5321. if (USE_NATIVE && _typeof(targetProperty) == _typeof(sourceProperty)) {
  5322. continue;
  5323. }
  5324. if (options.bind && USE_NATIVE) {
  5325. resultProperty = bind(sourceProperty, global2);
  5326. } else if (options.wrap && USE_NATIVE) {
  5327. resultProperty = wrapConstructor(sourceProperty);
  5328. } else if (PROTO && isCallable(sourceProperty)) {
  5329. resultProperty = uncurryThis(sourceProperty);
  5330. } else {
  5331. resultProperty = sourceProperty;
  5332. }
  5333. if (options.sham || sourceProperty && sourceProperty.sham || targetProperty && targetProperty.sham) {
  5334. createNonEnumerableProperty(resultProperty, 'sham', true);
  5335. }
  5336. createNonEnumerableProperty(target, key, resultProperty);
  5337. if (PROTO) {
  5338. VIRTUAL_PROTOTYPE = TARGET + 'Prototype';
  5339. if (!hasOwn2(path, VIRTUAL_PROTOTYPE)) {
  5340. createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {});
  5341. }
  5342. createNonEnumerableProperty(path[VIRTUAL_PROTOTYPE], key, sourceProperty);
  5343. if (options.real && targetPrototype && (FORCED || !targetPrototype[key])) {
  5344. createNonEnumerableProperty(targetPrototype, key, sourceProperty);
  5345. }
  5346. }
  5347. }
  5348. };
  5349. });
  5350. var require_es_object_has_own = __commonJS(function() {
  5351. 'use strict';
  5352. var $ = require_export();
  5353. var hasOwn2 = require_has_own_property();
  5354. $({
  5355. target: 'Object',
  5356. stat: true
  5357. }, {
  5358. hasOwn: hasOwn2
  5359. });
  5360. });
  5361. var require_has_own = __commonJS(function(exports, module) {
  5362. 'use strict';
  5363. require_es_object_has_own();
  5364. var path = require_path();
  5365. module.exports = path.Object.hasOwn;
  5366. });
  5367. var require_has_own2 = __commonJS(function(exports, module) {
  5368. 'use strict';
  5369. var parent = require_has_own();
  5370. module.exports = parent;
  5371. });
  5372. var require_has_own3 = __commonJS(function(exports, module) {
  5373. 'use strict';
  5374. var parent = require_has_own2();
  5375. module.exports = parent;
  5376. });
  5377. var require_shared_key = __commonJS(function(exports, module) {
  5378. 'use strict';
  5379. var shared = require_shared();
  5380. var uid = require_uid();
  5381. var keys = shared('keys');
  5382. module.exports = function(key) {
  5383. return keys[key] || (keys[key] = uid(key));
  5384. };
  5385. });
  5386. var require_correct_prototype_getter = __commonJS(function(exports, module) {
  5387. 'use strict';
  5388. var fails = require_fails();
  5389. module.exports = !fails(function() {
  5390. function F() {}
  5391. F.prototype.constructor = null;
  5392. return Object.getPrototypeOf(new F()) !== F.prototype;
  5393. });
  5394. });
  5395. var require_object_get_prototype_of = __commonJS(function(exports, module) {
  5396. 'use strict';
  5397. var hasOwn2 = require_has_own_property();
  5398. var isCallable = require_is_callable2();
  5399. var toObject = require_to_object();
  5400. var sharedKey = require_shared_key();
  5401. var CORRECT_PROTOTYPE_GETTER = require_correct_prototype_getter();
  5402. var IE_PROTO = sharedKey('IE_PROTO');
  5403. var $Object = Object;
  5404. var ObjectPrototype = $Object.prototype;
  5405. module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function(O) {
  5406. var object = toObject(O);
  5407. if (hasOwn2(object, IE_PROTO)) {
  5408. return object[IE_PROTO];
  5409. }
  5410. var constructor = object.constructor;
  5411. if (isCallable(constructor) && object instanceof constructor) {
  5412. return constructor.prototype;
  5413. }
  5414. return object instanceof $Object ? ObjectPrototype : null;
  5415. };
  5416. });
  5417. var require_math_trunc = __commonJS(function(exports, module) {
  5418. 'use strict';
  5419. var ceil = Math.ceil;
  5420. var floor = Math.floor;
  5421. module.exports = Math.trunc || function trunc(x) {
  5422. var n2 = +x;
  5423. return (n2 > 0 ? floor : ceil)(n2);
  5424. };
  5425. });
  5426. var require_to_integer_or_infinity = __commonJS(function(exports, module) {
  5427. 'use strict';
  5428. var trunc = require_math_trunc();
  5429. module.exports = function(argument) {
  5430. var number = +argument;
  5431. return number !== number || number === 0 ? 0 : trunc(number);
  5432. };
  5433. });
  5434. var require_to_absolute_index = __commonJS(function(exports, module) {
  5435. 'use strict';
  5436. var toIntegerOrInfinity = require_to_integer_or_infinity();
  5437. var max2 = Math.max;
  5438. var min = Math.min;
  5439. module.exports = function(index, length) {
  5440. var integer = toIntegerOrInfinity(index);
  5441. return integer < 0 ? max2(integer + length, 0) : min(integer, length);
  5442. };
  5443. });
  5444. var require_to_length = __commonJS(function(exports, module) {
  5445. 'use strict';
  5446. var toIntegerOrInfinity = require_to_integer_or_infinity();
  5447. var min = Math.min;
  5448. module.exports = function(argument) {
  5449. return argument > 0 ? min(toIntegerOrInfinity(argument), 9007199254740991) : 0;
  5450. };
  5451. });
  5452. var require_length_of_array_like = __commonJS(function(exports, module) {
  5453. 'use strict';
  5454. var toLength = require_to_length();
  5455. module.exports = function(obj) {
  5456. return toLength(obj.length);
  5457. };
  5458. });
  5459. var require_array_includes = __commonJS(function(exports, module) {
  5460. 'use strict';
  5461. var toIndexedObject = require_to_indexed_object();
  5462. var toAbsoluteIndex = require_to_absolute_index();
  5463. var lengthOfArrayLike = require_length_of_array_like();
  5464. var createMethod = function createMethod(IS_INCLUDES) {
  5465. return function($this, el, fromIndex) {
  5466. var O = toIndexedObject($this);
  5467. var length = lengthOfArrayLike(O);
  5468. var index = toAbsoluteIndex(fromIndex, length);
  5469. var value;
  5470. if (IS_INCLUDES && el !== el) {
  5471. while (length > index) {
  5472. value = O[index++];
  5473. if (value !== value) {
  5474. return true;
  5475. }
  5476. }
  5477. } else {
  5478. for (;length > index; index++) {
  5479. if ((IS_INCLUDES || index in O) && O[index] === el) {
  5480. return IS_INCLUDES || index || 0;
  5481. }
  5482. }
  5483. }
  5484. return !IS_INCLUDES && -1;
  5485. };
  5486. };
  5487. module.exports = {
  5488. includes: createMethod(true),
  5489. indexOf: createMethod(false)
  5490. };
  5491. });
  5492. var require_hidden_keys = __commonJS(function(exports, module) {
  5493. 'use strict';
  5494. module.exports = {};
  5495. });
  5496. var require_object_keys_internal = __commonJS(function(exports, module) {
  5497. 'use strict';
  5498. var uncurryThis = require_function_uncurry_this();
  5499. var hasOwn2 = require_has_own_property();
  5500. var toIndexedObject = require_to_indexed_object();
  5501. var indexOf = require_array_includes().indexOf;
  5502. var hiddenKeys = require_hidden_keys();
  5503. var push = uncurryThis([].push);
  5504. module.exports = function(object, names) {
  5505. var O = toIndexedObject(object);
  5506. var i = 0;
  5507. var result = [];
  5508. var key;
  5509. for (key in O) {
  5510. !hasOwn2(hiddenKeys, key) && hasOwn2(O, key) && push(result, key);
  5511. }
  5512. while (names.length > i) {
  5513. if (hasOwn2(O, key = names[i++])) {
  5514. ~indexOf(result, key) || push(result, key);
  5515. }
  5516. }
  5517. return result;
  5518. };
  5519. });
  5520. var require_enum_bug_keys = __commonJS(function(exports, module) {
  5521. 'use strict';
  5522. module.exports = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ];
  5523. });
  5524. var require_object_keys = __commonJS(function(exports, module) {
  5525. 'use strict';
  5526. var internalObjectKeys = require_object_keys_internal();
  5527. var enumBugKeys = require_enum_bug_keys();
  5528. module.exports = Object.keys || function keys(O) {
  5529. return internalObjectKeys(O, enumBugKeys);
  5530. };
  5531. });
  5532. var require_object_to_array = __commonJS(function(exports, module) {
  5533. 'use strict';
  5534. var DESCRIPTORS = require_descriptors();
  5535. var fails = require_fails();
  5536. var uncurryThis = require_function_uncurry_this();
  5537. var objectGetPrototypeOf = require_object_get_prototype_of();
  5538. var objectKeys = require_object_keys();
  5539. var toIndexedObject = require_to_indexed_object();
  5540. var $propertyIsEnumerable = require_object_property_is_enumerable().f;
  5541. var propertyIsEnumerable = uncurryThis($propertyIsEnumerable);
  5542. var push = uncurryThis([].push);
  5543. var IE_BUG = DESCRIPTORS && fails(function() {
  5544. var O = Object.create(null);
  5545. O[2] = 2;
  5546. return !propertyIsEnumerable(O, 2);
  5547. });
  5548. var createMethod = function createMethod(TO_ENTRIES) {
  5549. return function(it) {
  5550. var O = toIndexedObject(it);
  5551. var keys = objectKeys(O);
  5552. var IE_WORKAROUND = IE_BUG && objectGetPrototypeOf(O) === null;
  5553. var length = keys.length;
  5554. var i = 0;
  5555. var result = [];
  5556. var key;
  5557. while (length > i) {
  5558. key = keys[i++];
  5559. if (!DESCRIPTORS || (IE_WORKAROUND ? key in O : propertyIsEnumerable(O, key))) {
  5560. push(result, TO_ENTRIES ? [ key, O[key] ] : O[key]);
  5561. }
  5562. }
  5563. return result;
  5564. };
  5565. };
  5566. module.exports = {
  5567. entries: createMethod(true),
  5568. values: createMethod(false)
  5569. };
  5570. });
  5571. var require_es_object_values = __commonJS(function() {
  5572. 'use strict';
  5573. var $ = require_export();
  5574. var $values = require_object_to_array().values;
  5575. $({
  5576. target: 'Object',
  5577. stat: true
  5578. }, {
  5579. values: function values2(O) {
  5580. return $values(O);
  5581. }
  5582. });
  5583. });
  5584. var require_values = __commonJS(function(exports, module) {
  5585. 'use strict';
  5586. require_es_object_values();
  5587. var path = require_path();
  5588. module.exports = path.Object.values;
  5589. });
  5590. var require_values2 = __commonJS(function(exports, module) {
  5591. 'use strict';
  5592. var parent = require_values();
  5593. module.exports = parent;
  5594. });
  5595. var require_values3 = __commonJS(function(exports, module) {
  5596. 'use strict';
  5597. var parent = require_values2();
  5598. module.exports = parent;
  5599. });
  5600. var require_to_string_tag_support = __commonJS(function(exports, module) {
  5601. 'use strict';
  5602. var wellKnownSymbol = require_well_known_symbol();
  5603. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  5604. var test = {};
  5605. test[TO_STRING_TAG] = 'z';
  5606. module.exports = String(test) === '[object z]';
  5607. });
  5608. var require_classof = __commonJS(function(exports, module) {
  5609. 'use strict';
  5610. var TO_STRING_TAG_SUPPORT = require_to_string_tag_support();
  5611. var isCallable = require_is_callable2();
  5612. var classofRaw = require_classof_raw();
  5613. var wellKnownSymbol = require_well_known_symbol();
  5614. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  5615. var $Object = Object;
  5616. var CORRECT_ARGUMENTS = classofRaw(function() {
  5617. return arguments;
  5618. }()) === 'Arguments';
  5619. var tryGet = function tryGet(it, key) {
  5620. try {
  5621. return it[key];
  5622. } catch (error) {}
  5623. };
  5624. module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function(it) {
  5625. var O, tag, result;
  5626. return it === void 0 ? 'Undefined' : it === null ? 'Null' : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag : CORRECT_ARGUMENTS ? classofRaw(O) : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;
  5627. };
  5628. });
  5629. var require_to_string = __commonJS(function(exports, module) {
  5630. 'use strict';
  5631. var classof = require_classof();
  5632. var $String = String;
  5633. module.exports = function(argument) {
  5634. if (classof(argument) === 'Symbol') {
  5635. throw new TypeError('Cannot convert a Symbol value to a string');
  5636. }
  5637. return $String(argument);
  5638. };
  5639. });
  5640. var require_string_multibyte = __commonJS(function(exports, module) {
  5641. 'use strict';
  5642. var uncurryThis = require_function_uncurry_this();
  5643. var toIntegerOrInfinity = require_to_integer_or_infinity();
  5644. var toString = require_to_string();
  5645. var requireObjectCoercible = require_require_object_coercible();
  5646. var charAt = uncurryThis(''.charAt);
  5647. var charCodeAt = uncurryThis(''.charCodeAt);
  5648. var stringSlice = uncurryThis(''.slice);
  5649. var createMethod = function createMethod(CONVERT_TO_STRING) {
  5650. return function($this, pos) {
  5651. var S = toString(requireObjectCoercible($this));
  5652. var position = toIntegerOrInfinity(pos);
  5653. var size = S.length;
  5654. var first, second;
  5655. if (position < 0 || position >= size) {
  5656. return CONVERT_TO_STRING ? '' : void 0;
  5657. }
  5658. first = charCodeAt(S, position);
  5659. return first < 55296 || first > 56319 || position + 1 === size || (second = charCodeAt(S, position + 1)) < 56320 || second > 57343 ? CONVERT_TO_STRING ? charAt(S, position) : first : CONVERT_TO_STRING ? stringSlice(S, position, position + 2) : (first - 55296 << 10) + (second - 56320) + 65536;
  5660. };
  5661. };
  5662. module.exports = {
  5663. codeAt: createMethod(false),
  5664. charAt: createMethod(true)
  5665. };
  5666. });
  5667. var require_weak_map_basic_detection = __commonJS(function(exports, module) {
  5668. 'use strict';
  5669. var global2 = require_global();
  5670. var isCallable = require_is_callable2();
  5671. var WeakMap2 = global2.WeakMap;
  5672. module.exports = isCallable(WeakMap2) && /native code/.test(String(WeakMap2));
  5673. });
  5674. var require_internal_state = __commonJS(function(exports, module) {
  5675. 'use strict';
  5676. var NATIVE_WEAK_MAP = require_weak_map_basic_detection();
  5677. var global2 = require_global();
  5678. var isObject = require_is_object2();
  5679. var createNonEnumerableProperty = require_create_non_enumerable_property();
  5680. var hasOwn2 = require_has_own_property();
  5681. var shared = require_shared_store();
  5682. var sharedKey = require_shared_key();
  5683. var hiddenKeys = require_hidden_keys();
  5684. var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
  5685. var TypeError2 = global2.TypeError;
  5686. var WeakMap2 = global2.WeakMap;
  5687. var set2;
  5688. var get2;
  5689. var has;
  5690. var enforce = function enforce(it) {
  5691. return has(it) ? get2(it) : set2(it, {});
  5692. };
  5693. var getterFor = function getterFor(TYPE) {
  5694. return function(it) {
  5695. var state;
  5696. if (!isObject(it) || (state = get2(it)).type !== TYPE) {
  5697. throw new TypeError2('Incompatible receiver, ' + TYPE + ' required');
  5698. }
  5699. return state;
  5700. };
  5701. };
  5702. if (NATIVE_WEAK_MAP || shared.state) {
  5703. store = shared.state || (shared.state = new WeakMap2());
  5704. store.get = store.get;
  5705. store.has = store.has;
  5706. store.set = store.set;
  5707. set2 = function set2(it, metadata) {
  5708. if (store.has(it)) {
  5709. throw new TypeError2(OBJECT_ALREADY_INITIALIZED);
  5710. }
  5711. metadata.facade = it;
  5712. store.set(it, metadata);
  5713. return metadata;
  5714. };
  5715. get2 = function get2(it) {
  5716. return store.get(it) || {};
  5717. };
  5718. has = function has(it) {
  5719. return store.has(it);
  5720. };
  5721. } else {
  5722. STATE = sharedKey('state');
  5723. hiddenKeys[STATE] = true;
  5724. set2 = function set2(it, metadata) {
  5725. if (hasOwn2(it, STATE)) {
  5726. throw new TypeError2(OBJECT_ALREADY_INITIALIZED);
  5727. }
  5728. metadata.facade = it;
  5729. createNonEnumerableProperty(it, STATE, metadata);
  5730. return metadata;
  5731. };
  5732. get2 = function get2(it) {
  5733. return hasOwn2(it, STATE) ? it[STATE] : {};
  5734. };
  5735. has = function has(it) {
  5736. return hasOwn2(it, STATE);
  5737. };
  5738. }
  5739. var store;
  5740. var STATE;
  5741. module.exports = {
  5742. set: set2,
  5743. get: get2,
  5744. has: has,
  5745. enforce: enforce,
  5746. getterFor: getterFor
  5747. };
  5748. });
  5749. var require_function_name = __commonJS(function(exports, module) {
  5750. 'use strict';
  5751. var DESCRIPTORS = require_descriptors();
  5752. var hasOwn2 = require_has_own_property();
  5753. var FunctionPrototype = Function.prototype;
  5754. var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
  5755. var EXISTS = hasOwn2(FunctionPrototype, 'name');
  5756. var PROPER = EXISTS && function something() {}.name === 'something';
  5757. var CONFIGURABLE = EXISTS && (!DESCRIPTORS || DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable);
  5758. module.exports = {
  5759. EXISTS: EXISTS,
  5760. PROPER: PROPER,
  5761. CONFIGURABLE: CONFIGURABLE
  5762. };
  5763. });
  5764. var require_object_define_properties = __commonJS(function(exports) {
  5765. 'use strict';
  5766. var DESCRIPTORS = require_descriptors();
  5767. var V8_PROTOTYPE_DEFINE_BUG = require_v8_prototype_define_bug();
  5768. var definePropertyModule = require_object_define_property();
  5769. var anObject = require_an_object();
  5770. var toIndexedObject = require_to_indexed_object();
  5771. var objectKeys = require_object_keys();
  5772. exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
  5773. anObject(O);
  5774. var props = toIndexedObject(Properties);
  5775. var keys = objectKeys(Properties);
  5776. var length = keys.length;
  5777. var index = 0;
  5778. var key;
  5779. while (length > index) {
  5780. definePropertyModule.f(O, key = keys[index++], props[key]);
  5781. }
  5782. return O;
  5783. };
  5784. });
  5785. var require_html = __commonJS(function(exports, module) {
  5786. 'use strict';
  5787. var getBuiltIn = require_get_built_in();
  5788. module.exports = getBuiltIn('document', 'documentElement');
  5789. });
  5790. var require_object_create = __commonJS(function(exports, module) {
  5791. 'use strict';
  5792. var anObject = require_an_object();
  5793. var definePropertiesModule = require_object_define_properties();
  5794. var enumBugKeys = require_enum_bug_keys();
  5795. var hiddenKeys = require_hidden_keys();
  5796. var html = require_html();
  5797. var documentCreateElement = require_document_create_element();
  5798. var sharedKey = require_shared_key();
  5799. var GT = '>';
  5800. var LT = '<';
  5801. var PROTOTYPE = 'prototype';
  5802. var SCRIPT = 'script';
  5803. var IE_PROTO = sharedKey('IE_PROTO');
  5804. var EmptyConstructor = function EmptyConstructor() {};
  5805. var scriptTag = function scriptTag(content) {
  5806. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  5807. };
  5808. var NullProtoObjectViaActiveX = function NullProtoObjectViaActiveX(activeXDocument2) {
  5809. activeXDocument2.write(scriptTag(''));
  5810. activeXDocument2.close();
  5811. var temp = activeXDocument2.parentWindow.Object;
  5812. activeXDocument2 = null;
  5813. return temp;
  5814. };
  5815. var NullProtoObjectViaIFrame = function NullProtoObjectViaIFrame() {
  5816. var iframe = documentCreateElement('iframe');
  5817. var JS = 'java' + SCRIPT + ':';
  5818. var iframeDocument;
  5819. iframe.style.display = 'none';
  5820. html.appendChild(iframe);
  5821. iframe.src = String(JS);
  5822. iframeDocument = iframe.contentWindow.document;
  5823. iframeDocument.open();
  5824. iframeDocument.write(scriptTag('document.F=Object'));
  5825. iframeDocument.close();
  5826. return iframeDocument.F;
  5827. };
  5828. var activeXDocument;
  5829. var _NullProtoObject = function NullProtoObject() {
  5830. try {
  5831. activeXDocument = new ActiveXObject('htmlfile');
  5832. } catch (error) {}
  5833. _NullProtoObject = typeof document != 'undefined' ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument);
  5834. var length = enumBugKeys.length;
  5835. while (length--) {
  5836. delete _NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  5837. }
  5838. return _NullProtoObject();
  5839. };
  5840. hiddenKeys[IE_PROTO] = true;
  5841. module.exports = Object.create || function create(O, Properties) {
  5842. var result;
  5843. if (O !== null) {
  5844. EmptyConstructor[PROTOTYPE] = anObject(O);
  5845. result = new EmptyConstructor();
  5846. EmptyConstructor[PROTOTYPE] = null;
  5847. result[IE_PROTO] = O;
  5848. } else {
  5849. result = _NullProtoObject();
  5850. }
  5851. return Properties === void 0 ? result : definePropertiesModule.f(result, Properties);
  5852. };
  5853. });
  5854. var require_define_built_in = __commonJS(function(exports, module) {
  5855. 'use strict';
  5856. var createNonEnumerableProperty = require_create_non_enumerable_property();
  5857. module.exports = function(target, key, value, options) {
  5858. if (options && options.enumerable) {
  5859. target[key] = value;
  5860. } else {
  5861. createNonEnumerableProperty(target, key, value);
  5862. }
  5863. return target;
  5864. };
  5865. });
  5866. var require_iterators_core = __commonJS(function(exports, module) {
  5867. 'use strict';
  5868. var fails = require_fails();
  5869. var isCallable = require_is_callable2();
  5870. var isObject = require_is_object2();
  5871. var create = require_object_create();
  5872. var getPrototypeOf = require_object_get_prototype_of();
  5873. var defineBuiltIn = require_define_built_in();
  5874. var wellKnownSymbol = require_well_known_symbol();
  5875. var IS_PURE = require_is_pure();
  5876. var ITERATOR = wellKnownSymbol('iterator');
  5877. var BUGGY_SAFARI_ITERATORS = false;
  5878. var IteratorPrototype;
  5879. var PrototypeOfArrayIteratorPrototype;
  5880. var arrayIterator;
  5881. if ([].keys) {
  5882. arrayIterator = [].keys();
  5883. if (!('next' in arrayIterator)) {
  5884. BUGGY_SAFARI_ITERATORS = true;
  5885. } else {
  5886. PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
  5887. if (PrototypeOfArrayIteratorPrototype !== Object.prototype) {
  5888. IteratorPrototype = PrototypeOfArrayIteratorPrototype;
  5889. }
  5890. }
  5891. }
  5892. var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function() {
  5893. var test = {};
  5894. return IteratorPrototype[ITERATOR].call(test) !== test;
  5895. });
  5896. if (NEW_ITERATOR_PROTOTYPE) {
  5897. IteratorPrototype = {};
  5898. } else if (IS_PURE) {
  5899. IteratorPrototype = create(IteratorPrototype);
  5900. }
  5901. if (!isCallable(IteratorPrototype[ITERATOR])) {
  5902. defineBuiltIn(IteratorPrototype, ITERATOR, function() {
  5903. return this;
  5904. });
  5905. }
  5906. module.exports = {
  5907. IteratorPrototype: IteratorPrototype,
  5908. BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
  5909. };
  5910. });
  5911. var require_object_to_string = __commonJS(function(exports, module) {
  5912. 'use strict';
  5913. var TO_STRING_TAG_SUPPORT = require_to_string_tag_support();
  5914. var classof = require_classof();
  5915. module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
  5916. return '[object ' + classof(this) + ']';
  5917. };
  5918. });
  5919. var require_set_to_string_tag = __commonJS(function(exports, module) {
  5920. 'use strict';
  5921. var TO_STRING_TAG_SUPPORT = require_to_string_tag_support();
  5922. var defineProperty = require_object_define_property().f;
  5923. var createNonEnumerableProperty = require_create_non_enumerable_property();
  5924. var hasOwn2 = require_has_own_property();
  5925. var toString = require_object_to_string();
  5926. var wellKnownSymbol = require_well_known_symbol();
  5927. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  5928. module.exports = function(it, TAG, STATIC, SET_METHOD) {
  5929. if (it) {
  5930. var target = STATIC ? it : it.prototype;
  5931. if (!hasOwn2(target, TO_STRING_TAG)) {
  5932. defineProperty(target, TO_STRING_TAG, {
  5933. configurable: true,
  5934. value: TAG
  5935. });
  5936. }
  5937. if (SET_METHOD && !TO_STRING_TAG_SUPPORT) {
  5938. createNonEnumerableProperty(target, 'toString', toString);
  5939. }
  5940. }
  5941. };
  5942. });
  5943. var require_iterators = __commonJS(function(exports, module) {
  5944. 'use strict';
  5945. module.exports = {};
  5946. });
  5947. var require_iterator_create_constructor = __commonJS(function(exports, module) {
  5948. 'use strict';
  5949. var IteratorPrototype = require_iterators_core().IteratorPrototype;
  5950. var create = require_object_create();
  5951. var createPropertyDescriptor = require_create_property_descriptor();
  5952. var setToStringTag = require_set_to_string_tag();
  5953. var Iterators = require_iterators();
  5954. var returnThis = function returnThis() {
  5955. return this;
  5956. };
  5957. module.exports = function(IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
  5958. var TO_STRING_TAG = NAME + ' Iterator';
  5959. IteratorConstructor.prototype = create(IteratorPrototype, {
  5960. next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next)
  5961. });
  5962. setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
  5963. Iterators[TO_STRING_TAG] = returnThis;
  5964. return IteratorConstructor;
  5965. };
  5966. });
  5967. var require_function_uncurry_this_accessor = __commonJS(function(exports, module) {
  5968. 'use strict';
  5969. var uncurryThis = require_function_uncurry_this();
  5970. var aCallable = require_a_callable();
  5971. module.exports = function(object, key, method) {
  5972. try {
  5973. return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));
  5974. } catch (error) {}
  5975. };
  5976. });
  5977. var require_a_possible_prototype = __commonJS(function(exports, module) {
  5978. 'use strict';
  5979. var isCallable = require_is_callable2();
  5980. var $String = String;
  5981. var $TypeError = TypeError;
  5982. module.exports = function(argument) {
  5983. if (_typeof(argument) == 'object' || isCallable(argument)) {
  5984. return argument;
  5985. }
  5986. throw new $TypeError('Can\'t set ' + $String(argument) + ' as a prototype');
  5987. };
  5988. });
  5989. var require_object_set_prototype_of = __commonJS(function(exports, module) {
  5990. 'use strict';
  5991. var uncurryThisAccessor = require_function_uncurry_this_accessor();
  5992. var anObject = require_an_object();
  5993. var aPossiblePrototype = require_a_possible_prototype();
  5994. module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function() {
  5995. var CORRECT_SETTER = false;
  5996. var test = {};
  5997. var setter;
  5998. try {
  5999. setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');
  6000. setter(test, []);
  6001. CORRECT_SETTER = test instanceof Array;
  6002. } catch (error) {}
  6003. return function setPrototypeOf(O, proto) {
  6004. anObject(O);
  6005. aPossiblePrototype(proto);
  6006. if (CORRECT_SETTER) {
  6007. setter(O, proto);
  6008. } else {
  6009. O.__proto__ = proto;
  6010. }
  6011. return O;
  6012. };
  6013. }() : void 0);
  6014. });
  6015. var require_iterator_define = __commonJS(function(exports, module) {
  6016. 'use strict';
  6017. var $ = require_export();
  6018. var call = require_function_call();
  6019. var IS_PURE = require_is_pure();
  6020. var FunctionName = require_function_name();
  6021. var isCallable = require_is_callable2();
  6022. var createIteratorConstructor = require_iterator_create_constructor();
  6023. var getPrototypeOf = require_object_get_prototype_of();
  6024. var setPrototypeOf = require_object_set_prototype_of();
  6025. var setToStringTag = require_set_to_string_tag();
  6026. var createNonEnumerableProperty = require_create_non_enumerable_property();
  6027. var defineBuiltIn = require_define_built_in();
  6028. var wellKnownSymbol = require_well_known_symbol();
  6029. var Iterators = require_iterators();
  6030. var IteratorsCore = require_iterators_core();
  6031. var PROPER_FUNCTION_NAME = FunctionName.PROPER;
  6032. var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
  6033. var IteratorPrototype = IteratorsCore.IteratorPrototype;
  6034. var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
  6035. var ITERATOR = wellKnownSymbol('iterator');
  6036. var KEYS = 'keys';
  6037. var VALUES = 'values';
  6038. var ENTRIES = 'entries';
  6039. var returnThis = function returnThis() {
  6040. return this;
  6041. };
  6042. module.exports = function(Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
  6043. createIteratorConstructor(IteratorConstructor, NAME, next);
  6044. var getIterationMethod = function getIterationMethod(KIND) {
  6045. if (KIND === DEFAULT && defaultIterator) {
  6046. return defaultIterator;
  6047. }
  6048. if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) {
  6049. return IterablePrototype[KIND];
  6050. }
  6051. switch (KIND) {
  6052. case KEYS:
  6053. return function keys() {
  6054. return new IteratorConstructor(this, KIND);
  6055. };
  6056. case VALUES:
  6057. return function values2() {
  6058. return new IteratorConstructor(this, KIND);
  6059. };
  6060. case ENTRIES:
  6061. return function entries() {
  6062. return new IteratorConstructor(this, KIND);
  6063. };
  6064. }
  6065. return function() {
  6066. return new IteratorConstructor(this);
  6067. };
  6068. };
  6069. var TO_STRING_TAG = NAME + ' Iterator';
  6070. var INCORRECT_VALUES_NAME = false;
  6071. var IterablePrototype = Iterable.prototype;
  6072. var nativeIterator = IterablePrototype[ITERATOR] || IterablePrototype['@@iterator'] || DEFAULT && IterablePrototype[DEFAULT];
  6073. var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
  6074. var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
  6075. var CurrentIteratorPrototype, methods, KEY;
  6076. if (anyNativeIterator) {
  6077. CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
  6078. if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
  6079. if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
  6080. if (setPrototypeOf) {
  6081. setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
  6082. } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {
  6083. defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis);
  6084. }
  6085. }
  6086. setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
  6087. if (IS_PURE) {
  6088. Iterators[TO_STRING_TAG] = returnThis;
  6089. }
  6090. }
  6091. }
  6092. if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
  6093. if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {
  6094. createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
  6095. } else {
  6096. INCORRECT_VALUES_NAME = true;
  6097. defaultIterator = function values2() {
  6098. return call(nativeIterator, this);
  6099. };
  6100. }
  6101. }
  6102. if (DEFAULT) {
  6103. methods = {
  6104. values: getIterationMethod(VALUES),
  6105. keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
  6106. entries: getIterationMethod(ENTRIES)
  6107. };
  6108. if (FORCED) {
  6109. for (KEY in methods) {
  6110. if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
  6111. defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
  6112. }
  6113. }
  6114. } else {
  6115. $({
  6116. target: NAME,
  6117. proto: true,
  6118. forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME
  6119. }, methods);
  6120. }
  6121. }
  6122. if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
  6123. defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, {
  6124. name: DEFAULT
  6125. });
  6126. }
  6127. Iterators[NAME] = defaultIterator;
  6128. return methods;
  6129. };
  6130. });
  6131. var require_create_iter_result_object = __commonJS(function(exports, module) {
  6132. 'use strict';
  6133. module.exports = function(value, done) {
  6134. return {
  6135. value: value,
  6136. done: done
  6137. };
  6138. };
  6139. });
  6140. var require_es_string_iterator = __commonJS(function() {
  6141. 'use strict';
  6142. var charAt = require_string_multibyte().charAt;
  6143. var toString = require_to_string();
  6144. var InternalStateModule = require_internal_state();
  6145. var defineIterator = require_iterator_define();
  6146. var createIterResultObject = require_create_iter_result_object();
  6147. var STRING_ITERATOR = 'String Iterator';
  6148. var setInternalState = InternalStateModule.set;
  6149. var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
  6150. defineIterator(String, 'String', function(iterated) {
  6151. setInternalState(this, {
  6152. type: STRING_ITERATOR,
  6153. string: toString(iterated),
  6154. index: 0
  6155. });
  6156. }, function next() {
  6157. var state = getInternalState(this);
  6158. var string = state.string;
  6159. var index = state.index;
  6160. var point;
  6161. if (index >= string.length) {
  6162. return createIterResultObject(void 0, true);
  6163. }
  6164. point = charAt(string, index);
  6165. state.index += point.length;
  6166. return createIterResultObject(point, false);
  6167. });
  6168. });
  6169. var require_iterator_close = __commonJS(function(exports, module) {
  6170. 'use strict';
  6171. var call = require_function_call();
  6172. var anObject = require_an_object();
  6173. var getMethod = require_get_method();
  6174. module.exports = function(iterator, kind, value) {
  6175. var innerResult, innerError;
  6176. anObject(iterator);
  6177. try {
  6178. innerResult = getMethod(iterator, 'return');
  6179. if (!innerResult) {
  6180. if (kind === 'throw') {
  6181. throw value;
  6182. }
  6183. return value;
  6184. }
  6185. innerResult = call(innerResult, iterator);
  6186. } catch (error) {
  6187. innerError = true;
  6188. innerResult = error;
  6189. }
  6190. if (kind === 'throw') {
  6191. throw value;
  6192. }
  6193. if (innerError) {
  6194. throw innerResult;
  6195. }
  6196. anObject(innerResult);
  6197. return value;
  6198. };
  6199. });
  6200. var require_call_with_safe_iteration_closing = __commonJS(function(exports, module) {
  6201. 'use strict';
  6202. var anObject = require_an_object();
  6203. var iteratorClose = require_iterator_close();
  6204. module.exports = function(iterator, fn, value, ENTRIES) {
  6205. try {
  6206. return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
  6207. } catch (error) {
  6208. iteratorClose(iterator, 'throw', error);
  6209. }
  6210. };
  6211. });
  6212. var require_is_array_iterator_method = __commonJS(function(exports, module) {
  6213. 'use strict';
  6214. var wellKnownSymbol = require_well_known_symbol();
  6215. var Iterators = require_iterators();
  6216. var ITERATOR = wellKnownSymbol('iterator');
  6217. var ArrayPrototype = Array.prototype;
  6218. module.exports = function(it) {
  6219. return it !== void 0 && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
  6220. };
  6221. });
  6222. var require_inspect_source = __commonJS(function(exports, module) {
  6223. 'use strict';
  6224. var uncurryThis = require_function_uncurry_this();
  6225. var isCallable = require_is_callable2();
  6226. var store = require_shared_store();
  6227. var functionToString = uncurryThis(Function.toString);
  6228. if (!isCallable(store.inspectSource)) {
  6229. store.inspectSource = function(it) {
  6230. return functionToString(it);
  6231. };
  6232. }
  6233. module.exports = store.inspectSource;
  6234. });
  6235. var require_is_constructor = __commonJS(function(exports, module) {
  6236. 'use strict';
  6237. var uncurryThis = require_function_uncurry_this();
  6238. var fails = require_fails();
  6239. var isCallable = require_is_callable2();
  6240. var classof = require_classof();
  6241. var getBuiltIn = require_get_built_in();
  6242. var inspectSource = require_inspect_source();
  6243. var noop3 = function noop3() {};
  6244. var empty = [];
  6245. var construct = getBuiltIn('Reflect', 'construct');
  6246. var constructorRegExp = /^\s*(?:class|function)\b/;
  6247. var exec = uncurryThis(constructorRegExp.exec);
  6248. var INCORRECT_TO_STRING = !constructorRegExp.test(noop3);
  6249. var isConstructorModern = function isConstructor(argument) {
  6250. if (!isCallable(argument)) {
  6251. return false;
  6252. }
  6253. try {
  6254. construct(noop3, empty, argument);
  6255. return true;
  6256. } catch (error) {
  6257. return false;
  6258. }
  6259. };
  6260. var isConstructorLegacy = function isConstructor(argument) {
  6261. if (!isCallable(argument)) {
  6262. return false;
  6263. }
  6264. switch (classof(argument)) {
  6265. case 'AsyncFunction':
  6266. case 'GeneratorFunction':
  6267. case 'AsyncGeneratorFunction':
  6268. return false;
  6269. }
  6270. try {
  6271. return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
  6272. } catch (error) {
  6273. return true;
  6274. }
  6275. };
  6276. isConstructorLegacy.sham = true;
  6277. module.exports = !construct || fails(function() {
  6278. var called;
  6279. return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function() {
  6280. called = true;
  6281. }) || called;
  6282. }) ? isConstructorLegacy : isConstructorModern;
  6283. });
  6284. var require_create_property = __commonJS(function(exports, module) {
  6285. 'use strict';
  6286. var toPropertyKey = require_to_property_key();
  6287. var definePropertyModule = require_object_define_property();
  6288. var createPropertyDescriptor = require_create_property_descriptor();
  6289. module.exports = function(object, key, value) {
  6290. var propertyKey = toPropertyKey(key);
  6291. if (propertyKey in object) {
  6292. definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
  6293. } else {
  6294. object[propertyKey] = value;
  6295. }
  6296. };
  6297. });
  6298. var require_get_iterator_method = __commonJS(function(exports, module) {
  6299. 'use strict';
  6300. var classof = require_classof();
  6301. var getMethod = require_get_method();
  6302. var isNullOrUndefined = require_is_null_or_undefined();
  6303. var Iterators = require_iterators();
  6304. var wellKnownSymbol = require_well_known_symbol();
  6305. var ITERATOR = wellKnownSymbol('iterator');
  6306. module.exports = function(it) {
  6307. if (!isNullOrUndefined(it)) {
  6308. return getMethod(it, ITERATOR) || getMethod(it, '@@iterator') || Iterators[classof(it)];
  6309. }
  6310. };
  6311. });
  6312. var require_get_iterator = __commonJS(function(exports, module) {
  6313. 'use strict';
  6314. var call = require_function_call();
  6315. var aCallable = require_a_callable();
  6316. var anObject = require_an_object();
  6317. var tryToString = require_try_to_string();
  6318. var getIteratorMethod = require_get_iterator_method();
  6319. var $TypeError = TypeError;
  6320. module.exports = function(argument, usingIterator) {
  6321. var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
  6322. if (aCallable(iteratorMethod)) {
  6323. return anObject(call(iteratorMethod, argument));
  6324. }
  6325. throw new $TypeError(tryToString(argument) + ' is not iterable');
  6326. };
  6327. });
  6328. var require_array_from = __commonJS(function(exports, module) {
  6329. 'use strict';
  6330. var bind = require_function_bind_context();
  6331. var call = require_function_call();
  6332. var toObject = require_to_object();
  6333. var callWithSafeIterationClosing = require_call_with_safe_iteration_closing();
  6334. var isArrayIteratorMethod = require_is_array_iterator_method();
  6335. var isConstructor = require_is_constructor();
  6336. var lengthOfArrayLike = require_length_of_array_like();
  6337. var createProperty = require_create_property();
  6338. var getIterator = require_get_iterator();
  6339. var getIteratorMethod = require_get_iterator_method();
  6340. var $Array = Array;
  6341. module.exports = function from(arrayLike) {
  6342. var O = toObject(arrayLike);
  6343. var IS_CONSTRUCTOR = isConstructor(this);
  6344. var argumentsLength = arguments.length;
  6345. var mapfn = argumentsLength > 1 ? arguments[1] : void 0;
  6346. var mapping = mapfn !== void 0;
  6347. if (mapping) {
  6348. mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : void 0);
  6349. }
  6350. var iteratorMethod = getIteratorMethod(O);
  6351. var index = 0;
  6352. var length, result, step, iterator, next, value;
  6353. if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {
  6354. iterator = getIterator(O, iteratorMethod);
  6355. next = iterator.next;
  6356. result = IS_CONSTRUCTOR ? new this() : [];
  6357. for (;!(step = call(next, iterator)).done; index++) {
  6358. value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [ step.value, index ], true) : step.value;
  6359. createProperty(result, index, value);
  6360. }
  6361. } else {
  6362. length = lengthOfArrayLike(O);
  6363. result = IS_CONSTRUCTOR ? new this(length) : $Array(length);
  6364. for (;length > index; index++) {
  6365. value = mapping ? mapfn(O[index], index) : O[index];
  6366. createProperty(result, index, value);
  6367. }
  6368. }
  6369. result.length = index;
  6370. return result;
  6371. };
  6372. });
  6373. var require_check_correctness_of_iteration = __commonJS(function(exports, module) {
  6374. 'use strict';
  6375. var wellKnownSymbol = require_well_known_symbol();
  6376. var ITERATOR = wellKnownSymbol('iterator');
  6377. var SAFE_CLOSING = false;
  6378. try {
  6379. called = 0;
  6380. iteratorWithReturn = {
  6381. next: function next() {
  6382. return {
  6383. done: !!called++
  6384. };
  6385. },
  6386. return: function _return() {
  6387. SAFE_CLOSING = true;
  6388. }
  6389. };
  6390. iteratorWithReturn[ITERATOR] = function() {
  6391. return this;
  6392. };
  6393. Array.from(iteratorWithReturn, function() {
  6394. throw 2;
  6395. });
  6396. } catch (error) {}
  6397. var called;
  6398. var iteratorWithReturn;
  6399. module.exports = function(exec, SKIP_CLOSING) {
  6400. try {
  6401. if (!SKIP_CLOSING && !SAFE_CLOSING) {
  6402. return false;
  6403. }
  6404. } catch (error) {
  6405. return false;
  6406. }
  6407. var ITERATION_SUPPORT = false;
  6408. try {
  6409. var object = {};
  6410. object[ITERATOR] = function() {
  6411. return {
  6412. next: function next() {
  6413. return {
  6414. done: ITERATION_SUPPORT = true
  6415. };
  6416. }
  6417. };
  6418. };
  6419. exec(object);
  6420. } catch (error) {}
  6421. return ITERATION_SUPPORT;
  6422. };
  6423. });
  6424. var require_es_array_from = __commonJS(function() {
  6425. 'use strict';
  6426. var $ = require_export();
  6427. var from = require_array_from();
  6428. var checkCorrectnessOfIteration = require_check_correctness_of_iteration();
  6429. var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function(iterable) {
  6430. Array.from(iterable);
  6431. });
  6432. $({
  6433. target: 'Array',
  6434. stat: true,
  6435. forced: INCORRECT_ITERATION
  6436. }, {
  6437. from: from
  6438. });
  6439. });
  6440. var require_from2 = __commonJS(function(exports, module) {
  6441. 'use strict';
  6442. require_es_string_iterator();
  6443. require_es_array_from();
  6444. var path = require_path();
  6445. module.exports = path.Array.from;
  6446. });
  6447. var require_from3 = __commonJS(function(exports, module) {
  6448. 'use strict';
  6449. var parent = require_from2();
  6450. module.exports = parent;
  6451. });
  6452. var require_from4 = __commonJS(function(exports, module) {
  6453. 'use strict';
  6454. var parent = require_from3();
  6455. module.exports = parent;
  6456. });
  6457. var require_doT = __commonJS(function(exports, module) {
  6458. (function() {
  6459. 'use strict';
  6460. var doT3 = {
  6461. name: 'doT',
  6462. version: '1.1.1',
  6463. templateSettings: {
  6464. evaluate: /\{\{([\s\S]+?(\}?)+)\}\}/g,
  6465. interpolate: /\{\{=([\s\S]+?)\}\}/g,
  6466. encode: /\{\{!([\s\S]+?)\}\}/g,
  6467. use: /\{\{#([\s\S]+?)\}\}/g,
  6468. useParams: /(^|[^\w$])def(?:\.|\[[\'\"])([\w$\.]+)(?:[\'\"]\])?\s*\:\s*([\w$\.]+|\"[^\"]+\"|\'[^\']+\'|\{[^\}]+\})/g,
  6469. define: /\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,
  6470. defineParams: /^\s*([\w$]+):([\s\S]+)/,
  6471. conditional: /\{\{\?(\?)?\s*([\s\S]*?)\s*\}\}/g,
  6472. iterate: /\{\{~\s*(?:\}\}|([\s\S]+?)\s*\:\s*([\w$]+)\s*(?:\:\s*([\w$]+))?\s*\}\})/g,
  6473. varname: 'it',
  6474. strip: true,
  6475. append: true,
  6476. selfcontained: false,
  6477. doNotSkipEncoded: false
  6478. },
  6479. template: void 0,
  6480. compile: void 0,
  6481. log: true
  6482. };
  6483. (function() {
  6484. if ((typeof globalThis === 'undefined' ? 'undefined' : _typeof(globalThis)) === 'object') {
  6485. return;
  6486. }
  6487. try {
  6488. Object.defineProperty(Object.prototype, '__magic__', {
  6489. get: function get() {
  6490. return this;
  6491. },
  6492. configurable: true
  6493. });
  6494. __magic__.globalThis = __magic__;
  6495. delete Object.prototype.__magic__;
  6496. } catch (e) {
  6497. window.globalThis = function() {
  6498. if (typeof self !== 'undefined') {
  6499. return self;
  6500. }
  6501. if (typeof window !== 'undefined') {
  6502. return window;
  6503. }
  6504. if (typeof global !== 'undefined') {
  6505. return global;
  6506. }
  6507. if (typeof this !== 'undefined') {
  6508. return this;
  6509. }
  6510. throw new Error('Unable to locate global `this`');
  6511. }();
  6512. }
  6513. })();
  6514. doT3.encodeHTMLSource = function(doNotSkipEncoded) {
  6515. var encodeHTMLRules = {
  6516. '&': '&#38;',
  6517. '<': '&#60;',
  6518. '>': '&#62;',
  6519. '"': '&#34;',
  6520. '\'': '&#39;',
  6521. '/': '&#47;'
  6522. }, matchHTML = doNotSkipEncoded ? /[&<>"'\/]/g : /&(?!#?\w+;)|<|>|"|'|\//g;
  6523. return function(code) {
  6524. return code ? code.toString().replace(matchHTML, function(m3) {
  6525. return encodeHTMLRules[m3] || m3;
  6526. }) : '';
  6527. };
  6528. };
  6529. if (typeof module !== 'undefined' && module.exports) {
  6530. module.exports = doT3;
  6531. } else if (typeof define === 'function' && define.amd) {
  6532. define(function() {
  6533. return doT3;
  6534. });
  6535. } else {
  6536. globalThis.doT = doT3;
  6537. }
  6538. var startend = {
  6539. append: {
  6540. start: '\'+(',
  6541. end: ')+\'',
  6542. startencode: '\'+encodeHTML('
  6543. },
  6544. split: {
  6545. start: '\';out+=(',
  6546. end: ');out+=\'',
  6547. startencode: '\';out+=encodeHTML('
  6548. }
  6549. }, skip = /$^/;
  6550. function resolveDefs(c4, block, def) {
  6551. return (typeof block === 'string' ? block : block.toString()).replace(c4.define || skip, function(m3, code, assign, value) {
  6552. if (code.indexOf('def.') === 0) {
  6553. code = code.substring(4);
  6554. }
  6555. if (!(code in def)) {
  6556. if (assign === ':') {
  6557. if (c4.defineParams) {
  6558. value.replace(c4.defineParams, function(m4, param, v) {
  6559. def[code] = {
  6560. arg: param,
  6561. text: v
  6562. };
  6563. });
  6564. }
  6565. if (!(code in def)) {
  6566. def[code] = value;
  6567. }
  6568. } else {
  6569. new Function('def', 'def[\'' + code + '\']=' + value)(def);
  6570. }
  6571. }
  6572. return '';
  6573. }).replace(c4.use || skip, function(m3, code) {
  6574. if (c4.useParams) {
  6575. code = code.replace(c4.useParams, function(m4, s, d2, param) {
  6576. if (def[d2] && def[d2].arg && param) {
  6577. var rw = (d2 + ':' + param).replace(/'|\\/g, '_');
  6578. def.__exp = def.__exp || {};
  6579. def.__exp[rw] = def[d2].text.replace(new RegExp('(^|[^\\w$])' + def[d2].arg + '([^\\w$])', 'g'), '$1' + param + '$2');
  6580. return s + 'def.__exp[\'' + rw + '\']';
  6581. }
  6582. });
  6583. }
  6584. var v = new Function('def', 'return ' + code)(def);
  6585. return v ? resolveDefs(c4, v, def) : v;
  6586. });
  6587. }
  6588. function unescape(code) {
  6589. return code.replace(/\\('|\\)/g, '$1').replace(/[\r\t\n]/g, ' ');
  6590. }
  6591. doT3.template = function(tmpl, c4, def) {
  6592. c4 = c4 || doT3.templateSettings;
  6593. var cse = c4.append ? startend.append : startend.split, needhtmlencode, sid = 0, indv, str = c4.use || c4.define ? resolveDefs(c4, tmpl, def || {}) : tmpl;
  6594. str = ('var out=\'' + (c4.strip ? str.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g, ' ').replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g, '') : str).replace(/'|\\/g, '\\$&').replace(c4.interpolate || skip, function(m3, code) {
  6595. return cse.start + unescape(code) + cse.end;
  6596. }).replace(c4.encode || skip, function(m3, code) {
  6597. needhtmlencode = true;
  6598. return cse.startencode + unescape(code) + cse.end;
  6599. }).replace(c4.conditional || skip, function(m3, elsecase, code) {
  6600. return elsecase ? code ? '\';}else if(' + unescape(code) + '){out+=\'' : '\';}else{out+=\'' : code ? '\';if(' + unescape(code) + '){out+=\'' : '\';}out+=\'';
  6601. }).replace(c4.iterate || skip, function(m3, iterate, vname, iname) {
  6602. if (!iterate) {
  6603. return '\';} } out+=\'';
  6604. }
  6605. sid += 1;
  6606. indv = iname || 'i' + sid;
  6607. iterate = unescape(iterate);
  6608. return '\';var arr' + sid + '=' + iterate + ';if(arr' + sid + '){var ' + vname + ',' + indv + '=-1,l' + sid + '=arr' + sid + '.length-1;while(' + indv + '<l' + sid + '){' + vname + '=arr' + sid + '[' + indv + '+=1];out+=\'';
  6609. }).replace(c4.evaluate || skip, function(m3, code) {
  6610. return '\';' + unescape(code) + 'out+=\'';
  6611. }) + '\';return out;').replace(/\n/g, '\\n').replace(/\t/g, '\\t').replace(/\r/g, '\\r').replace(/(\s|;|\}|^|\{)out\+='';/g, '$1').replace(/\+''/g, '');
  6612. if (needhtmlencode) {
  6613. if (!c4.selfcontained && globalThis && !globalThis._encodeHTML) {
  6614. globalThis._encodeHTML = doT3.encodeHTMLSource(c4.doNotSkipEncoded);
  6615. }
  6616. str = 'var encodeHTML = typeof _encodeHTML !== \'undefined\' ? _encodeHTML : (' + doT3.encodeHTMLSource.toString() + '(' + (c4.doNotSkipEncoded || '') + '));' + str;
  6617. }
  6618. try {
  6619. return new Function(c4.varname, str);
  6620. } catch (e) {
  6621. if (typeof console !== 'undefined') {
  6622. console.log('Could not create a template function: ' + str);
  6623. }
  6624. throw e;
  6625. }
  6626. };
  6627. doT3.compile = function(tmpl, def) {
  6628. return doT3.template(tmpl, null, def);
  6629. };
  6630. })();
  6631. });
  6632. var definitions = [ {
  6633. name: 'NA',
  6634. value: 'inapplicable',
  6635. priority: 0,
  6636. group: 'inapplicable'
  6637. }, {
  6638. name: 'PASS',
  6639. value: 'passed',
  6640. priority: 1,
  6641. group: 'passes'
  6642. }, {
  6643. name: 'CANTTELL',
  6644. value: 'cantTell',
  6645. priority: 2,
  6646. group: 'incomplete'
  6647. }, {
  6648. name: 'FAIL',
  6649. value: 'failed',
  6650. priority: 3,
  6651. group: 'violations'
  6652. } ];
  6653. var constants = {
  6654. helpUrlBase: 'https://dequeuniversity.com/rules/',
  6655. gridSize: 200,
  6656. selectorSimilarFilterLimit: 700,
  6657. results: [],
  6658. resultGroups: [],
  6659. resultGroupMap: {},
  6660. impact: Object.freeze([ 'minor', 'moderate', 'serious', 'critical' ]),
  6661. preload: Object.freeze({
  6662. assets: [ 'cssom', 'media' ],
  6663. timeout: 1e4
  6664. }),
  6665. allOrigins: '<unsafe_all_origins>',
  6666. sameOrigin: '<same_origin>'
  6667. };
  6668. definitions.forEach(function(definition) {
  6669. var name = definition.name;
  6670. var value = definition.value;
  6671. var priority = definition.priority;
  6672. var group = definition.group;
  6673. constants[name] = value;
  6674. constants[name + '_PRIO'] = priority;
  6675. constants[name + '_GROUP'] = group;
  6676. constants.results[priority] = value;
  6677. constants.resultGroups[priority] = group;
  6678. constants.resultGroupMap[value] = group;
  6679. });
  6680. Object.freeze(constants.results);
  6681. Object.freeze(constants.resultGroups);
  6682. Object.freeze(constants.resultGroupMap);
  6683. Object.freeze(constants);
  6684. var constants_default = constants;
  6685. function log() {
  6686. if ((typeof console === 'undefined' ? 'undefined' : _typeof(console)) === 'object' && console.log) {
  6687. Function.prototype.apply.call(console.log, console, arguments);
  6688. }
  6689. }
  6690. var log_default = log;
  6691. var whitespaceRegex = /[\t\r\n\f]/g;
  6692. var AbstractVirtualNode = function() {
  6693. function AbstractVirtualNode() {
  6694. _classCallCheck(this, AbstractVirtualNode);
  6695. this.parent = void 0;
  6696. }
  6697. return _createClass(AbstractVirtualNode, [ {
  6698. key: 'props',
  6699. get: function get() {
  6700. throw new Error('VirtualNode class must have a "props" object consisting of "nodeType" and "nodeName" properties');
  6701. }
  6702. }, {
  6703. key: 'attrNames',
  6704. get: function get() {
  6705. throw new Error('VirtualNode class must have an "attrNames" property');
  6706. }
  6707. }, {
  6708. key: 'attr',
  6709. value: function attr() {
  6710. throw new Error('VirtualNode class must have an "attr" function');
  6711. }
  6712. }, {
  6713. key: 'hasAttr',
  6714. value: function hasAttr() {
  6715. throw new Error('VirtualNode class must have a "hasAttr" function');
  6716. }
  6717. }, {
  6718. key: 'hasClass',
  6719. value: function hasClass(className) {
  6720. var classAttr = this.attr('class');
  6721. if (!classAttr) {
  6722. return false;
  6723. }
  6724. var selector = ' ' + className + ' ';
  6725. return (' ' + classAttr + ' ').replace(whitespaceRegex, ' ').indexOf(selector) >= 0;
  6726. }
  6727. } ]);
  6728. }();
  6729. var abstract_virtual_node_default = AbstractVirtualNode;
  6730. var utils_exports = {};
  6731. __export(utils_exports, {
  6732. DqElement: function DqElement() {
  6733. return dq_element_default;
  6734. },
  6735. aggregate: function aggregate() {
  6736. return aggregate_default;
  6737. },
  6738. aggregateChecks: function aggregateChecks() {
  6739. return aggregate_checks_default;
  6740. },
  6741. aggregateNodeResults: function aggregateNodeResults() {
  6742. return aggregate_node_results_default;
  6743. },
  6744. aggregateResult: function aggregateResult() {
  6745. return aggregate_result_default;
  6746. },
  6747. areStylesSet: function areStylesSet() {
  6748. return are_styles_set_default;
  6749. },
  6750. assert: function assert() {
  6751. return assert_default;
  6752. },
  6753. checkHelper: function checkHelper() {
  6754. return check_helper_default;
  6755. },
  6756. clone: function clone() {
  6757. return _clone;
  6758. },
  6759. closest: function closest() {
  6760. return closest_default;
  6761. },
  6762. collectResultsFromFrames: function collectResultsFromFrames() {
  6763. return _collectResultsFromFrames;
  6764. },
  6765. contains: function contains() {
  6766. return _contains;
  6767. },
  6768. convertSelector: function convertSelector() {
  6769. return _convertSelector;
  6770. },
  6771. cssParser: function cssParser() {
  6772. return css_parser_default;
  6773. },
  6774. deepMerge: function deepMerge() {
  6775. return deep_merge_default;
  6776. },
  6777. escapeSelector: function escapeSelector() {
  6778. return escape_selector_default;
  6779. },
  6780. extendMetaData: function extendMetaData() {
  6781. return extend_meta_data_default;
  6782. },
  6783. filterHtmlAttrs: function filterHtmlAttrs() {
  6784. return _filterHtmlAttrs;
  6785. },
  6786. finalizeRuleResult: function finalizeRuleResult() {
  6787. return _finalizeRuleResult;
  6788. },
  6789. findBy: function findBy() {
  6790. return find_by_default;
  6791. },
  6792. getAllChecks: function getAllChecks() {
  6793. return get_all_checks_default;
  6794. },
  6795. getAncestry: function getAncestry() {
  6796. return _getAncestry;
  6797. },
  6798. getBaseLang: function getBaseLang() {
  6799. return get_base_lang_default;
  6800. },
  6801. getCheckMessage: function getCheckMessage() {
  6802. return get_check_message_default;
  6803. },
  6804. getCheckOption: function getCheckOption() {
  6805. return get_check_option_default;
  6806. },
  6807. getEnvironmentData: function getEnvironmentData() {
  6808. return _getEnvironmentData;
  6809. },
  6810. getFlattenedTree: function getFlattenedTree() {
  6811. return _getFlattenedTree;
  6812. },
  6813. getFrameContexts: function getFrameContexts() {
  6814. return _getFrameContexts;
  6815. },
  6816. getFriendlyUriEnd: function getFriendlyUriEnd() {
  6817. return get_friendly_uri_end_default;
  6818. },
  6819. getNodeAttributes: function getNodeAttributes() {
  6820. return get_node_attributes_default;
  6821. },
  6822. getNodeFromTree: function getNodeFromTree() {
  6823. return get_node_from_tree_default;
  6824. },
  6825. getPreloadConfig: function getPreloadConfig() {
  6826. return _getPreloadConfig;
  6827. },
  6828. getRootNode: function getRootNode() {
  6829. return get_root_node_default;
  6830. },
  6831. getRule: function getRule() {
  6832. return _getRule;
  6833. },
  6834. getScroll: function getScroll() {
  6835. return get_scroll_default;
  6836. },
  6837. getScrollState: function getScrollState() {
  6838. return get_scroll_state_default;
  6839. },
  6840. getSelector: function getSelector() {
  6841. return get_selector_default;
  6842. },
  6843. getSelectorData: function getSelectorData() {
  6844. return _getSelectorData;
  6845. },
  6846. getShadowSelector: function getShadowSelector() {
  6847. return _getShadowSelector;
  6848. },
  6849. getStandards: function getStandards() {
  6850. return _getStandards;
  6851. },
  6852. getStyleSheetFactory: function getStyleSheetFactory() {
  6853. return get_stylesheet_factory_default;
  6854. },
  6855. getXpath: function getXpath() {
  6856. return get_xpath_default;
  6857. },
  6858. injectStyle: function injectStyle() {
  6859. return inject_style_default;
  6860. },
  6861. isArrayLike: function isArrayLike() {
  6862. return _isArrayLike;
  6863. },
  6864. isContextObject: function isContextObject() {
  6865. return _isContextObject;
  6866. },
  6867. isContextProp: function isContextProp() {
  6868. return _isContextProp;
  6869. },
  6870. isContextSpec: function isContextSpec() {
  6871. return _isContextSpec;
  6872. },
  6873. isHidden: function isHidden() {
  6874. return is_hidden_default;
  6875. },
  6876. isHtmlElement: function isHtmlElement() {
  6877. return is_html_element_default;
  6878. },
  6879. isLabelledFramesSelector: function isLabelledFramesSelector() {
  6880. return _isLabelledFramesSelector;
  6881. },
  6882. isLabelledShadowDomSelector: function isLabelledShadowDomSelector() {
  6883. return _isLabelledShadowDomSelector;
  6884. },
  6885. isNodeInContext: function isNodeInContext() {
  6886. return _isNodeInContext;
  6887. },
  6888. isShadowRoot: function isShadowRoot() {
  6889. return is_shadow_root_default;
  6890. },
  6891. isValidLang: function isValidLang() {
  6892. return valid_langs_default;
  6893. },
  6894. isXHTML: function isXHTML() {
  6895. return is_xhtml_default;
  6896. },
  6897. matchAncestry: function matchAncestry() {
  6898. return _matchAncestry;
  6899. },
  6900. matches: function matches() {
  6901. return _matches;
  6902. },
  6903. matchesExpression: function matchesExpression() {
  6904. return _matchesExpression;
  6905. },
  6906. matchesSelector: function matchesSelector() {
  6907. return element_matches_default;
  6908. },
  6909. memoize: function memoize() {
  6910. return memoize_default;
  6911. },
  6912. mergeResults: function mergeResults() {
  6913. return merge_results_default;
  6914. },
  6915. nodeLookup: function nodeLookup() {
  6916. return _nodeLookup;
  6917. },
  6918. nodeSerializer: function nodeSerializer() {
  6919. return node_serializer_default;
  6920. },
  6921. nodeSorter: function nodeSorter() {
  6922. return node_sorter_default;
  6923. },
  6924. objectHasOwn: function objectHasOwn() {
  6925. return _objectHasOwn;
  6926. },
  6927. parseCrossOriginStylesheet: function parseCrossOriginStylesheet() {
  6928. return parse_crossorigin_stylesheet_default;
  6929. },
  6930. parseSameOriginStylesheet: function parseSameOriginStylesheet() {
  6931. return parse_sameorigin_stylesheet_default;
  6932. },
  6933. parseStylesheet: function parseStylesheet() {
  6934. return parse_stylesheet_default;
  6935. },
  6936. parseTabindex: function parseTabindex() {
  6937. return parse_tabindex_default;
  6938. },
  6939. performanceTimer: function performanceTimer() {
  6940. return performance_timer_default;
  6941. },
  6942. pollyfillElementsFromPoint: function pollyfillElementsFromPoint() {
  6943. return _pollyfillElementsFromPoint;
  6944. },
  6945. preload: function preload() {
  6946. return _preload;
  6947. },
  6948. preloadCssom: function preloadCssom() {
  6949. return preload_cssom_default;
  6950. },
  6951. preloadMedia: function preloadMedia() {
  6952. return preload_media_default;
  6953. },
  6954. processMessage: function processMessage() {
  6955. return process_message_default;
  6956. },
  6957. publishMetaData: function publishMetaData() {
  6958. return _publishMetaData;
  6959. },
  6960. querySelectorAll: function querySelectorAll() {
  6961. return query_selector_all_default;
  6962. },
  6963. querySelectorAllFilter: function querySelectorAllFilter() {
  6964. return query_selector_all_filter_default;
  6965. },
  6966. queue: function queue() {
  6967. return queue_default;
  6968. },
  6969. respondable: function respondable() {
  6970. return _respondable;
  6971. },
  6972. ruleShouldRun: function ruleShouldRun() {
  6973. return rule_should_run_default;
  6974. },
  6975. select: function select() {
  6976. return _select;
  6977. },
  6978. sendCommandToFrame: function sendCommandToFrame() {
  6979. return _sendCommandToFrame;
  6980. },
  6981. setScrollState: function setScrollState() {
  6982. return set_scroll_state_default;
  6983. },
  6984. shadowSelect: function shadowSelect() {
  6985. return _shadowSelect;
  6986. },
  6987. shadowSelectAll: function shadowSelectAll() {
  6988. return _shadowSelectAll;
  6989. },
  6990. shouldPreload: function shouldPreload() {
  6991. return _shouldPreload;
  6992. },
  6993. toArray: function toArray() {
  6994. return to_array_default;
  6995. },
  6996. tokenList: function tokenList() {
  6997. return token_list_default;
  6998. },
  6999. uniqueArray: function uniqueArray() {
  7000. return unique_array_default;
  7001. },
  7002. uuid: function uuid() {
  7003. return uuid_default;
  7004. },
  7005. validInputTypes: function validInputTypes() {
  7006. return valid_input_type_default;
  7007. },
  7008. validLangs: function validLangs() {
  7009. return _validLangs;
  7010. }
  7011. });
  7012. function aggregate(map, values2, initial) {
  7013. values2 = values2.slice();
  7014. if (initial) {
  7015. values2.push(initial);
  7016. }
  7017. var sorting = values2.map(function(val) {
  7018. return map.indexOf(val);
  7019. }).sort();
  7020. return map[sorting.pop()];
  7021. }
  7022. var aggregate_default = aggregate;
  7023. var CANTTELL_PRIO = constants_default.CANTTELL_PRIO, FAIL_PRIO = constants_default.FAIL_PRIO;
  7024. var checkMap = [];
  7025. checkMap[constants_default.PASS_PRIO] = true;
  7026. checkMap[constants_default.CANTTELL_PRIO] = null;
  7027. checkMap[constants_default.FAIL_PRIO] = false;
  7028. var checkTypes = [ 'any', 'all', 'none' ];
  7029. function anyAllNone(obj, functor) {
  7030. return checkTypes.reduce(function(out, type2) {
  7031. out[type2] = (obj[type2] || []).map(function(val) {
  7032. return functor(val, type2);
  7033. });
  7034. return out;
  7035. }, {});
  7036. }
  7037. function aggregateChecks(nodeResOriginal) {
  7038. var nodeResult = Object.assign({}, nodeResOriginal);
  7039. anyAllNone(nodeResult, function(check, type2) {
  7040. var i = typeof check.result === 'undefined' ? -1 : checkMap.indexOf(check.result);
  7041. check.priority = i !== -1 ? i : constants_default.CANTTELL_PRIO;
  7042. if (type2 === 'none') {
  7043. if (check.priority === constants_default.PASS_PRIO) {
  7044. check.priority = constants_default.FAIL_PRIO;
  7045. } else if (check.priority === constants_default.FAIL_PRIO) {
  7046. check.priority = constants_default.PASS_PRIO;
  7047. }
  7048. }
  7049. });
  7050. var priorities = {
  7051. all: nodeResult.all.reduce(function(a2, b2) {
  7052. return Math.max(a2, b2.priority);
  7053. }, 0),
  7054. none: nodeResult.none.reduce(function(a2, b2) {
  7055. return Math.max(a2, b2.priority);
  7056. }, 0),
  7057. any: nodeResult.any.reduce(function(a2, b2) {
  7058. return Math.min(a2, b2.priority);
  7059. }, 4) % 4
  7060. };
  7061. nodeResult.priority = Math.max(priorities.all, priorities.none, priorities.any);
  7062. var impacts = [];
  7063. checkTypes.forEach(function(type2) {
  7064. nodeResult[type2] = nodeResult[type2].filter(function(check) {
  7065. return check.priority === nodeResult.priority && check.priority === priorities[type2];
  7066. });
  7067. nodeResult[type2].forEach(function(check) {
  7068. return impacts.push(check.impact);
  7069. });
  7070. });
  7071. if ([ CANTTELL_PRIO, FAIL_PRIO ].includes(nodeResult.priority)) {
  7072. nodeResult.impact = aggregate_default(constants_default.impact, impacts);
  7073. } else {
  7074. nodeResult.impact = null;
  7075. }
  7076. anyAllNone(nodeResult, function(c4) {
  7077. delete c4.result;
  7078. delete c4.priority;
  7079. });
  7080. nodeResult.result = constants_default.results[nodeResult.priority];
  7081. delete nodeResult.priority;
  7082. return nodeResult;
  7083. }
  7084. var aggregate_checks_default = aggregateChecks;
  7085. function _finalizeRuleResult(ruleResult) {
  7086. var rule = axe._audit.rules.find(function(_ref) {
  7087. var id = _ref.id;
  7088. return id === ruleResult.id;
  7089. });
  7090. if (rule && rule.impact) {
  7091. ruleResult.nodes.forEach(function(node) {
  7092. [ 'any', 'all', 'none' ].forEach(function(checkType) {
  7093. (node[checkType] || []).forEach(function(checkResult) {
  7094. checkResult.impact = rule.impact;
  7095. });
  7096. });
  7097. });
  7098. }
  7099. Object.assign(ruleResult, aggregate_node_results_default(ruleResult.nodes));
  7100. delete ruleResult.nodes;
  7101. return ruleResult;
  7102. }
  7103. function aggregateNodeResults(nodeResults) {
  7104. var ruleResult = {};
  7105. nodeResults = nodeResults.map(function(nodeResult) {
  7106. if (nodeResult.any && nodeResult.all && nodeResult.none) {
  7107. return aggregate_checks_default(nodeResult);
  7108. } else if (Array.isArray(nodeResult.node)) {
  7109. return _finalizeRuleResult(nodeResult);
  7110. } else {
  7111. throw new TypeError('Invalid Result type');
  7112. }
  7113. });
  7114. if (nodeResults && nodeResults.length) {
  7115. var resultList = nodeResults.map(function(node) {
  7116. return node.result;
  7117. });
  7118. ruleResult.result = aggregate_default(constants_default.results, resultList, ruleResult.result);
  7119. } else {
  7120. ruleResult.result = 'inapplicable';
  7121. }
  7122. constants_default.resultGroups.forEach(function(group) {
  7123. return ruleResult[group] = [];
  7124. });
  7125. nodeResults.forEach(function(nodeResult) {
  7126. var groupName = constants_default.resultGroupMap[nodeResult.result];
  7127. ruleResult[groupName].push(nodeResult);
  7128. });
  7129. var impactGroup = constants_default.FAIL_GROUP;
  7130. if (ruleResult[impactGroup].length === 0) {
  7131. impactGroup = constants_default.CANTTELL_GROUP;
  7132. }
  7133. if (ruleResult[impactGroup].length > 0) {
  7134. var impactList = ruleResult[impactGroup].map(function(failure) {
  7135. return failure.impact;
  7136. });
  7137. ruleResult.impact = aggregate_default(constants_default.impact, impactList) || null;
  7138. } else {
  7139. ruleResult.impact = null;
  7140. }
  7141. return ruleResult;
  7142. }
  7143. var aggregate_node_results_default = aggregateNodeResults;
  7144. function copyToGroup(resultObject, subResult, group) {
  7145. var resultCopy = Object.assign({}, subResult);
  7146. resultCopy.nodes = (resultCopy[group] || []).concat();
  7147. constants_default.resultGroups.forEach(function(resultGroup) {
  7148. delete resultCopy[resultGroup];
  7149. });
  7150. resultObject[group].push(resultCopy);
  7151. }
  7152. function aggregateResult(results) {
  7153. var resultObject = {};
  7154. constants_default.resultGroups.forEach(function(groupName) {
  7155. return resultObject[groupName] = [];
  7156. });
  7157. results.forEach(function(subResult) {
  7158. if (subResult.error) {
  7159. copyToGroup(resultObject, subResult, constants_default.CANTTELL_GROUP);
  7160. } else if (subResult.result === constants_default.NA) {
  7161. copyToGroup(resultObject, subResult, constants_default.NA_GROUP);
  7162. } else {
  7163. constants_default.resultGroups.forEach(function(group) {
  7164. if (Array.isArray(subResult[group]) && subResult[group].length > 0) {
  7165. copyToGroup(resultObject, subResult, group);
  7166. }
  7167. });
  7168. }
  7169. });
  7170. return resultObject;
  7171. }
  7172. var aggregate_result_default = aggregateResult;
  7173. function areStylesSet(el, styles, stopAt) {
  7174. var styl = window.getComputedStyle(el, null);
  7175. if (!styl) {
  7176. return false;
  7177. }
  7178. for (var i = 0; i < styles.length; ++i) {
  7179. var att = styles[i];
  7180. if (styl.getPropertyValue(att.property) === att.value) {
  7181. return true;
  7182. }
  7183. }
  7184. if (!el.parentNode || el.nodeName.toUpperCase() === stopAt.toUpperCase()) {
  7185. return false;
  7186. }
  7187. return areStylesSet(el.parentNode, styles, stopAt);
  7188. }
  7189. var are_styles_set_default = areStylesSet;
  7190. function assert(bool, message) {
  7191. if (!bool) {
  7192. throw new Error(message);
  7193. }
  7194. }
  7195. var assert_default = assert;
  7196. function toArray(thing) {
  7197. return Array.prototype.slice.call(thing);
  7198. }
  7199. var to_array_default = toArray;
  7200. function escapeSelector(value) {
  7201. var string = String(value);
  7202. var length = string.length;
  7203. var index = -1;
  7204. var codeUnit;
  7205. var result = '';
  7206. var firstCodeUnit = string.charCodeAt(0);
  7207. while (++index < length) {
  7208. codeUnit = string.charCodeAt(index);
  7209. if (codeUnit == 0) {
  7210. result += '\ufffd';
  7211. continue;
  7212. }
  7213. if (codeUnit >= 1 && codeUnit <= 31 || codeUnit == 127 || index == 0 && codeUnit >= 48 && codeUnit <= 57 || index == 1 && codeUnit >= 48 && codeUnit <= 57 && firstCodeUnit == 45) {
  7214. result += '\\' + codeUnit.toString(16) + ' ';
  7215. continue;
  7216. }
  7217. if (index == 0 && length == 1 && codeUnit == 45) {
  7218. result += '\\' + string.charAt(index);
  7219. continue;
  7220. }
  7221. if (codeUnit >= 128 || codeUnit == 45 || codeUnit == 95 || codeUnit >= 48 && codeUnit <= 57 || codeUnit >= 65 && codeUnit <= 90 || codeUnit >= 97 && codeUnit <= 122) {
  7222. result += string.charAt(index);
  7223. continue;
  7224. }
  7225. result += '\\' + string.charAt(index);
  7226. }
  7227. return result;
  7228. }
  7229. var escape_selector_default = escapeSelector;
  7230. function isMostlyNumbers() {
  7231. var str = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  7232. return str.length !== 0 && (str.match(/[0-9]/g) || '').length >= str.length / 2;
  7233. }
  7234. function splitString(str, splitIndex) {
  7235. return [ str.substring(0, splitIndex), str.substring(splitIndex) ];
  7236. }
  7237. function trimRight(str) {
  7238. return str.replace(/\s+$/, '');
  7239. }
  7240. function uriParser(url) {
  7241. var original = url;
  7242. var protocol = '', domain = '', port = '', path = '', query = '', hash = '';
  7243. if (url.includes('#')) {
  7244. var _splitString = splitString(url, url.indexOf('#'));
  7245. var _splitString2 = _slicedToArray(_splitString, 2);
  7246. url = _splitString2[0];
  7247. hash = _splitString2[1];
  7248. }
  7249. if (url.includes('?')) {
  7250. var _splitString3 = splitString(url, url.indexOf('?'));
  7251. var _splitString4 = _slicedToArray(_splitString3, 2);
  7252. url = _splitString4[0];
  7253. query = _splitString4[1];
  7254. }
  7255. if (url.includes('://')) {
  7256. var _url$split = url.split('://');
  7257. var _url$split2 = _slicedToArray(_url$split, 2);
  7258. protocol = _url$split2[0];
  7259. url = _url$split2[1];
  7260. var _splitString5 = splitString(url, url.indexOf('/'));
  7261. var _splitString6 = _slicedToArray(_splitString5, 2);
  7262. domain = _splitString6[0];
  7263. url = _splitString6[1];
  7264. } else if (url.substr(0, 2) === '//') {
  7265. url = url.substr(2);
  7266. var _splitString7 = splitString(url, url.indexOf('/'));
  7267. var _splitString8 = _slicedToArray(_splitString7, 2);
  7268. domain = _splitString8[0];
  7269. url = _splitString8[1];
  7270. }
  7271. if (domain.substr(0, 4) === 'www.') {
  7272. domain = domain.substr(4);
  7273. }
  7274. if (domain && domain.includes(':')) {
  7275. var _splitString9 = splitString(domain, domain.indexOf(':'));
  7276. var _splitString10 = _slicedToArray(_splitString9, 2);
  7277. domain = _splitString10[0];
  7278. port = _splitString10[1];
  7279. }
  7280. path = url;
  7281. return {
  7282. original: original,
  7283. protocol: protocol,
  7284. domain: domain,
  7285. port: port,
  7286. path: path,
  7287. query: query,
  7288. hash: hash
  7289. };
  7290. }
  7291. function getFriendlyUriEnd() {
  7292. var uri = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  7293. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7294. if (uri.length <= 1 || uri.substr(0, 5) === 'data:' || uri.substr(0, 11) === 'javascript:' || uri.includes('?')) {
  7295. return;
  7296. }
  7297. var currentDomain = options.currentDomain, _options$maxLength = options.maxLength, maxLength = _options$maxLength === void 0 ? 25 : _options$maxLength;
  7298. var _uriParser = uriParser(uri), path = _uriParser.path, domain = _uriParser.domain, hash = _uriParser.hash;
  7299. var pathEnd = path.substr(path.substr(0, path.length - 2).lastIndexOf('/') + 1);
  7300. if (hash) {
  7301. if (pathEnd && (pathEnd + hash).length <= maxLength) {
  7302. return trimRight(pathEnd + hash);
  7303. } else if (pathEnd.length < 2 && hash.length > 2 && hash.length <= maxLength) {
  7304. return trimRight(hash);
  7305. } else {
  7306. return;
  7307. }
  7308. } else if (domain && domain.length < maxLength && path.length <= 1) {
  7309. return trimRight(domain + path);
  7310. }
  7311. if (path === '/' + pathEnd && domain && currentDomain && domain !== currentDomain && (domain + path).length <= maxLength) {
  7312. return trimRight(domain + path);
  7313. }
  7314. var lastDotIndex = pathEnd.lastIndexOf('.');
  7315. if ((lastDotIndex === -1 || lastDotIndex > 1) && (lastDotIndex !== -1 || pathEnd.length > 2) && pathEnd.length <= maxLength && !pathEnd.match(/index(\.[a-zA-Z]{2-4})?/) && !isMostlyNumbers(pathEnd)) {
  7316. return trimRight(pathEnd);
  7317. }
  7318. }
  7319. var get_friendly_uri_end_default = getFriendlyUriEnd;
  7320. function getNodeAttributes(node) {
  7321. if (node.attributes instanceof window.NamedNodeMap) {
  7322. return node.attributes;
  7323. }
  7324. return node.cloneNode(false).attributes;
  7325. }
  7326. var get_node_attributes_default = getNodeAttributes;
  7327. var matchesSelector = function() {
  7328. var method;
  7329. function getMethod(node) {
  7330. var candidates = [ 'matches', 'matchesSelector', 'mozMatchesSelector', 'webkitMatchesSelector', 'msMatchesSelector' ];
  7331. var length = candidates.length;
  7332. var index, candidate;
  7333. for (index = 0; index < length; index++) {
  7334. candidate = candidates[index];
  7335. if (node[candidate]) {
  7336. return candidate;
  7337. }
  7338. }
  7339. }
  7340. return function(node, selector) {
  7341. if (!method || !node[method]) {
  7342. method = getMethod(node);
  7343. }
  7344. if (node[method]) {
  7345. return node[method](selector);
  7346. }
  7347. return false;
  7348. };
  7349. }();
  7350. var element_matches_default = matchesSelector;
  7351. var import_memoizee = __toModule(require_memoizee());
  7352. axe._memoizedFns = [];
  7353. function memoizeImplementation(fn) {
  7354. var memoized = (0, import_memoizee['default'])(fn);
  7355. axe._memoizedFns.push(memoized);
  7356. return memoized;
  7357. }
  7358. var memoize_default = memoizeImplementation;
  7359. var isXHTML = memoize_default(function(doc) {
  7360. if (!(doc !== null && doc !== void 0 && doc.createElement)) {
  7361. return false;
  7362. }
  7363. return doc.createElement('A').localName === 'A';
  7364. });
  7365. var is_xhtml_default = isXHTML;
  7366. function _getShadowSelector(generateSelector2, elm) {
  7367. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  7368. if (!elm) {
  7369. return '';
  7370. }
  7371. var doc = elm.getRootNode && elm.getRootNode() || document;
  7372. if (doc.nodeType !== 11) {
  7373. return generateSelector2(elm, options, doc);
  7374. }
  7375. var stack = [];
  7376. while (doc.nodeType === 11) {
  7377. if (!doc.host) {
  7378. return '';
  7379. }
  7380. stack.unshift({
  7381. elm: elm,
  7382. doc: doc
  7383. });
  7384. elm = doc.host;
  7385. doc = elm.getRootNode();
  7386. }
  7387. stack.unshift({
  7388. elm: elm,
  7389. doc: doc
  7390. });
  7391. return stack.map(function(item) {
  7392. return generateSelector2(item.elm, options, item.doc);
  7393. });
  7394. }
  7395. var ignoredAttributes = [ 'class', 'style', 'id', 'selected', 'checked', 'disabled', 'tabindex', 'aria-checked', 'aria-selected', 'aria-invalid', 'aria-activedescendant', 'aria-busy', 'aria-disabled', 'aria-expanded', 'aria-grabbed', 'aria-pressed', 'aria-valuenow', 'xmlns' ];
  7396. var MAXATTRIBUTELENGTH = 31;
  7397. var attrCharsRegex = /([\\"])/g;
  7398. var newlineChars = /(\r\n|\r|\n)/g;
  7399. function escapeAttribute(str) {
  7400. return str.replace(attrCharsRegex, '\\$1').replace(newlineChars, '\\a ');
  7401. }
  7402. function getAttributeNameValue(node, at) {
  7403. var name = at.name;
  7404. var atnv;
  7405. if (name.indexOf('href') !== -1 || name.indexOf('src') !== -1) {
  7406. var friendly = get_friendly_uri_end_default(node.getAttribute(name));
  7407. if (friendly) {
  7408. atnv = escape_selector_default(at.name) + '$="' + escapeAttribute(friendly) + '"';
  7409. } else {
  7410. atnv = escape_selector_default(at.name) + '="' + escapeAttribute(node.getAttribute(name)) + '"';
  7411. }
  7412. } else {
  7413. atnv = escape_selector_default(name) + '="' + escapeAttribute(at.value) + '"';
  7414. }
  7415. return atnv;
  7416. }
  7417. function countSort(a2, b2) {
  7418. return a2.count < b2.count ? -1 : a2.count === b2.count ? 0 : 1;
  7419. }
  7420. function filterAttributes(at) {
  7421. return !ignoredAttributes.includes(at.name) && at.name.indexOf(':') === -1 && (!at.value || at.value.length < MAXATTRIBUTELENGTH);
  7422. }
  7423. function _getSelectorData(domTree) {
  7424. var data = {
  7425. classes: {},
  7426. tags: {},
  7427. attributes: {}
  7428. };
  7429. domTree = Array.isArray(domTree) ? domTree : [ domTree ];
  7430. var currentLevel = domTree.slice();
  7431. var stack = [];
  7432. var _loop2 = function _loop2() {
  7433. var current = currentLevel.pop();
  7434. var node = current.actualNode;
  7435. if (!!node.querySelectorAll) {
  7436. var tag = node.nodeName;
  7437. if (data.tags[tag]) {
  7438. data.tags[tag]++;
  7439. } else {
  7440. data.tags[tag] = 1;
  7441. }
  7442. if (node.classList) {
  7443. Array.from(node.classList).forEach(function(cl) {
  7444. var ind = escape_selector_default(cl);
  7445. if (data.classes[ind]) {
  7446. data.classes[ind]++;
  7447. } else {
  7448. data.classes[ind] = 1;
  7449. }
  7450. });
  7451. }
  7452. if (node.hasAttributes()) {
  7453. Array.from(get_node_attributes_default(node)).filter(filterAttributes).forEach(function(at) {
  7454. var atnv = getAttributeNameValue(node, at);
  7455. if (atnv) {
  7456. if (data.attributes[atnv]) {
  7457. data.attributes[atnv]++;
  7458. } else {
  7459. data.attributes[atnv] = 1;
  7460. }
  7461. }
  7462. });
  7463. }
  7464. }
  7465. if (current.children.length) {
  7466. stack.push(currentLevel);
  7467. currentLevel = current.children.slice();
  7468. }
  7469. while (!currentLevel.length && stack.length) {
  7470. currentLevel = stack.pop();
  7471. }
  7472. };
  7473. while (currentLevel.length) {
  7474. _loop2();
  7475. }
  7476. return data;
  7477. }
  7478. function uncommonClasses(node, selectorData) {
  7479. var retVal = [];
  7480. var classData = selectorData.classes;
  7481. var tagData = selectorData.tags;
  7482. if (node.classList) {
  7483. Array.from(node.classList).forEach(function(cl) {
  7484. var ind = escape_selector_default(cl);
  7485. if (classData[ind] < tagData[node.nodeName]) {
  7486. retVal.push({
  7487. name: ind,
  7488. count: classData[ind],
  7489. species: 'class'
  7490. });
  7491. }
  7492. });
  7493. }
  7494. return retVal.sort(countSort);
  7495. }
  7496. function getNthChildString(elm, selector) {
  7497. var siblings = elm.parentNode && Array.from(elm.parentNode.children || '') || [];
  7498. var hasMatchingSiblings = siblings.find(function(sibling) {
  7499. return sibling !== elm && element_matches_default(sibling, selector);
  7500. });
  7501. if (hasMatchingSiblings) {
  7502. var nthChild = 1 + siblings.indexOf(elm);
  7503. return ':nth-child(' + nthChild + ')';
  7504. } else {
  7505. return '';
  7506. }
  7507. }
  7508. function getElmId(elm) {
  7509. if (!elm.getAttribute('id')) {
  7510. return;
  7511. }
  7512. var doc = elm.getRootNode && elm.getRootNode() || document;
  7513. var id = '#' + escape_selector_default(elm.getAttribute('id') || '');
  7514. if (!id.match(/player_uid_/) && doc.querySelectorAll(id).length === 1) {
  7515. return id;
  7516. }
  7517. }
  7518. function getBaseSelector(elm) {
  7519. var xhtml = is_xhtml_default(document);
  7520. return escape_selector_default(xhtml ? elm.localName : elm.nodeName.toLowerCase());
  7521. }
  7522. function uncommonAttributes(node, selectorData) {
  7523. var retVal = [];
  7524. var attData = selectorData.attributes;
  7525. var tagData = selectorData.tags;
  7526. if (node.hasAttributes()) {
  7527. Array.from(get_node_attributes_default(node)).filter(filterAttributes).forEach(function(at) {
  7528. var atnv = getAttributeNameValue(node, at);
  7529. if (atnv && attData[atnv] < tagData[node.nodeName]) {
  7530. retVal.push({
  7531. name: atnv,
  7532. count: attData[atnv],
  7533. species: 'attribute'
  7534. });
  7535. }
  7536. });
  7537. }
  7538. return retVal.sort(countSort);
  7539. }
  7540. function getThreeLeastCommonFeatures(elm, selectorData) {
  7541. var selector = '';
  7542. var features;
  7543. var clss = uncommonClasses(elm, selectorData);
  7544. var atts = uncommonAttributes(elm, selectorData);
  7545. if (clss.length && clss[0].count === 1) {
  7546. features = [ clss[0] ];
  7547. } else if (atts.length && atts[0].count === 1) {
  7548. features = [ atts[0] ];
  7549. selector = getBaseSelector(elm);
  7550. } else {
  7551. features = clss.concat(atts);
  7552. features.sort(countSort);
  7553. features = features.slice(0, 3);
  7554. if (!features.some(function(feat) {
  7555. return feat.species === 'class';
  7556. })) {
  7557. selector = getBaseSelector(elm);
  7558. } else {
  7559. features.sort(function(a2, b2) {
  7560. return a2.species !== b2.species && a2.species === 'class' ? -1 : a2.species === b2.species ? 0 : 1;
  7561. });
  7562. }
  7563. }
  7564. return selector += features.reduce(function(val, feat) {
  7565. switch (feat.species) {
  7566. case 'class':
  7567. return val + '.' + feat.name;
  7568. case 'attribute':
  7569. return val + '[' + feat.name + ']';
  7570. }
  7571. return val;
  7572. }, '');
  7573. }
  7574. function generateSelector(elm, options, doc) {
  7575. if (!axe._selectorData) {
  7576. throw new Error('Expect axe._selectorData to be set up');
  7577. }
  7578. var _options$toRoot = options.toRoot, toRoot = _options$toRoot === void 0 ? false : _options$toRoot;
  7579. var selector;
  7580. var similar;
  7581. do {
  7582. var features = getElmId(elm);
  7583. if (!features) {
  7584. features = getThreeLeastCommonFeatures(elm, axe._selectorData);
  7585. features += getNthChildString(elm, features);
  7586. }
  7587. if (selector) {
  7588. selector = features + ' > ' + selector;
  7589. } else {
  7590. selector = features;
  7591. }
  7592. if (!similar || similar.length > constants_default.selectorSimilarFilterLimit) {
  7593. similar = findSimilar(doc, selector);
  7594. } else {
  7595. similar = similar.filter(function(item) {
  7596. return element_matches_default(item, selector);
  7597. });
  7598. }
  7599. elm = elm.parentElement;
  7600. } while ((similar.length > 1 || toRoot) && elm && elm.nodeType !== 11);
  7601. if (similar.length === 1) {
  7602. return selector;
  7603. } else if (selector.indexOf(' > ') !== -1) {
  7604. return ':root' + selector.substring(selector.indexOf(' > '));
  7605. }
  7606. return ':root';
  7607. }
  7608. function getSelector(elm, options) {
  7609. return _getShadowSelector(generateSelector, elm, options);
  7610. }
  7611. var get_selector_default = memoize_default(getSelector);
  7612. var findSimilar = memoize_default(function(doc, selector) {
  7613. return Array.from(doc.querySelectorAll(selector));
  7614. });
  7615. function generateAncestry(node) {
  7616. var nodeName2 = node.nodeName.toLowerCase();
  7617. var parentElement = node.parentElement;
  7618. var parentNode = node.parentNode;
  7619. var nthChild = '';
  7620. if (nodeName2 !== 'head' && nodeName2 !== 'body' && (parentNode === null || parentNode === void 0 ? void 0 : parentNode.children.length) > 1) {
  7621. var index = Array.prototype.indexOf.call(parentNode.children, node) + 1;
  7622. nthChild = ':nth-child('.concat(index, ')');
  7623. }
  7624. if (!parentElement) {
  7625. return nodeName2 + nthChild;
  7626. }
  7627. return generateAncestry(parentElement) + ' > ' + nodeName2 + nthChild;
  7628. }
  7629. function _getAncestry(elm, options) {
  7630. return _getShadowSelector(generateAncestry, elm, options);
  7631. }
  7632. function getXPathArray(node, path) {
  7633. var sibling, count;
  7634. if (!node) {
  7635. return [];
  7636. }
  7637. if (!path && node.nodeType === 9) {
  7638. path = [ {
  7639. str: 'html'
  7640. } ];
  7641. return path;
  7642. }
  7643. path = path || [];
  7644. if (node.parentNode && node.parentNode !== node) {
  7645. path = getXPathArray(node.parentNode, path);
  7646. }
  7647. if (node.previousSibling) {
  7648. count = 1;
  7649. sibling = node.previousSibling;
  7650. do {
  7651. if (sibling.nodeType === 1 && sibling.nodeName === node.nodeName) {
  7652. count++;
  7653. }
  7654. sibling = sibling.previousSibling;
  7655. } while (sibling);
  7656. if (count === 1) {
  7657. count = null;
  7658. }
  7659. } else if (node.nextSibling) {
  7660. sibling = node.nextSibling;
  7661. do {
  7662. if (sibling.nodeType === 1 && sibling.nodeName === node.nodeName) {
  7663. count = 1;
  7664. sibling = null;
  7665. } else {
  7666. count = null;
  7667. sibling = sibling.previousSibling;
  7668. }
  7669. } while (sibling);
  7670. }
  7671. if (node.nodeType === 1) {
  7672. var element = {};
  7673. element.str = node.nodeName.toLowerCase();
  7674. var id = node.getAttribute && escape_selector_default(node.getAttribute('id'));
  7675. if (id && node.ownerDocument.querySelectorAll('#' + id).length === 1) {
  7676. element.id = node.getAttribute('id');
  7677. }
  7678. if (count > 1) {
  7679. element.count = count;
  7680. }
  7681. path.push(element);
  7682. }
  7683. return path;
  7684. }
  7685. function xpathToString(xpathArray) {
  7686. return xpathArray.reduce(function(str, elm) {
  7687. if (elm.id) {
  7688. return '/'.concat(elm.str, '[@id=\'').concat(elm.id, '\']');
  7689. } else {
  7690. return str + '/'.concat(elm.str) + (elm.count > 0 ? '['.concat(elm.count, ']') : '');
  7691. }
  7692. }, '');
  7693. }
  7694. function getXpath(node) {
  7695. var xpathArray = getXPathArray(node);
  7696. return xpathToString(xpathArray);
  7697. }
  7698. var get_xpath_default = getXpath;
  7699. var _cache = {};
  7700. var cache = {
  7701. set: function set(key, value) {
  7702. validateKey(key);
  7703. _cache[key] = value;
  7704. },
  7705. get: function get(key, creator) {
  7706. validateCreator(creator);
  7707. if (key in _cache) {
  7708. return _cache[key];
  7709. }
  7710. if (typeof creator === 'function') {
  7711. var value = creator();
  7712. assert_default(value !== void 0, 'Cache creator function should not return undefined');
  7713. this.set(key, value);
  7714. return _cache[key];
  7715. }
  7716. },
  7717. clear: function clear() {
  7718. _cache = {};
  7719. }
  7720. };
  7721. function validateKey(key) {
  7722. assert_default(typeof key === 'string', 'key must be a string, ' + _typeof(key) + ' given');
  7723. assert_default(key !== '', 'key must not be empty');
  7724. }
  7725. function validateCreator(creator) {
  7726. assert_default(typeof creator === 'function' || typeof creator === 'undefined', 'creator must be a function or undefined, ' + _typeof(creator) + ' given');
  7727. }
  7728. var cache_default = cache;
  7729. function getNodeFromTree(vNode, node) {
  7730. var el = node || vNode;
  7731. return cache_default.get('nodeMap') ? cache_default.get('nodeMap').get(el) : null;
  7732. }
  7733. var get_node_from_tree_default = getNodeFromTree;
  7734. var CACHE_KEY = 'DqElm.RunOptions';
  7735. function truncate(str, maxLength) {
  7736. maxLength = maxLength || 300;
  7737. if (str.length > maxLength) {
  7738. var index = str.indexOf('>');
  7739. str = str.substring(0, index + 1);
  7740. }
  7741. return str;
  7742. }
  7743. function getSource(element) {
  7744. if (!(element !== null && element !== void 0 && element.outerHTML)) {
  7745. return '';
  7746. }
  7747. var source = element.outerHTML;
  7748. if (!source && typeof window.XMLSerializer === 'function') {
  7749. source = new window.XMLSerializer().serializeToString(element);
  7750. }
  7751. return truncate(source || '');
  7752. }
  7753. var DqElement = memoize_default(function DqElement2(elm, options, spec) {
  7754. var _options, _spec, _this$spec$selector, _this$_virtualNode;
  7755. (_options = options) !== null && _options !== void 0 ? _options : options = null;
  7756. (_spec = spec) !== null && _spec !== void 0 ? _spec : spec = {};
  7757. if (!options) {
  7758. var _cache_default$get;
  7759. options = (_cache_default$get = cache_default.get(CACHE_KEY)) !== null && _cache_default$get !== void 0 ? _cache_default$get : {};
  7760. }
  7761. this.spec = spec;
  7762. if (elm instanceof abstract_virtual_node_default) {
  7763. this._virtualNode = elm;
  7764. this._element = elm.actualNode;
  7765. } else {
  7766. this._element = elm;
  7767. this._virtualNode = get_node_from_tree_default(elm);
  7768. }
  7769. this.fromFrame = ((_this$spec$selector = this.spec.selector) === null || _this$spec$selector === void 0 ? void 0 : _this$spec$selector.length) > 1;
  7770. this._includeElementInJson = options.elementRef;
  7771. if (options.absolutePaths) {
  7772. this._options = {
  7773. toRoot: true
  7774. };
  7775. }
  7776. this.nodeIndexes = [];
  7777. if (Array.isArray(this.spec.nodeIndexes)) {
  7778. this.nodeIndexes = this.spec.nodeIndexes;
  7779. } else if (typeof ((_this$_virtualNode = this._virtualNode) === null || _this$_virtualNode === void 0 ? void 0 : _this$_virtualNode.nodeIndex) === 'number') {
  7780. this.nodeIndexes = [ this._virtualNode.nodeIndex ];
  7781. }
  7782. this.source = null;
  7783. if (!axe._audit.noHtml) {
  7784. var _this$spec$source;
  7785. this.source = (_this$spec$source = this.spec.source) !== null && _this$spec$source !== void 0 ? _this$spec$source : getSource(this._element);
  7786. }
  7787. return this;
  7788. });
  7789. DqElement.prototype = {
  7790. get selector() {
  7791. return this.spec.selector || [ get_selector_default(this.element, this._options) ];
  7792. },
  7793. get ancestry() {
  7794. return this.spec.ancestry || [ _getAncestry(this.element) ];
  7795. },
  7796. get xpath() {
  7797. return this.spec.xpath || [ get_xpath_default(this.element) ];
  7798. },
  7799. get element() {
  7800. return this._element;
  7801. },
  7802. toJSON: function toJSON() {
  7803. var spec = {
  7804. selector: this.selector,
  7805. source: this.source,
  7806. xpath: this.xpath,
  7807. ancestry: this.ancestry,
  7808. nodeIndexes: this.nodeIndexes,
  7809. fromFrame: this.fromFrame
  7810. };
  7811. if (this._includeElementInJson) {
  7812. spec.element = this._element;
  7813. }
  7814. return spec;
  7815. }
  7816. };
  7817. DqElement.fromFrame = function fromFrame(node, options, frame) {
  7818. var spec = DqElement.mergeSpecs(node, frame);
  7819. return new DqElement(frame.element, options, spec);
  7820. };
  7821. DqElement.mergeSpecs = function mergeSpecs(child, parentFrame) {
  7822. return _extends({}, child, {
  7823. selector: [].concat(_toConsumableArray(parentFrame.selector), _toConsumableArray(child.selector)),
  7824. ancestry: [].concat(_toConsumableArray(parentFrame.ancestry), _toConsumableArray(child.ancestry)),
  7825. xpath: [].concat(_toConsumableArray(parentFrame.xpath), _toConsumableArray(child.xpath)),
  7826. nodeIndexes: [].concat(_toConsumableArray(parentFrame.nodeIndexes), _toConsumableArray(child.nodeIndexes)),
  7827. fromFrame: true
  7828. });
  7829. };
  7830. DqElement.setRunOptions = function setRunOptions(_ref2) {
  7831. var elementRef = _ref2.elementRef, absolutePaths = _ref2.absolutePaths;
  7832. cache_default.set(CACHE_KEY, {
  7833. elementRef: elementRef,
  7834. absolutePaths: absolutePaths
  7835. });
  7836. };
  7837. var dq_element_default = DqElement;
  7838. function checkHelper(checkResult, options, resolve, reject) {
  7839. return {
  7840. isAsync: false,
  7841. async: function async() {
  7842. this.isAsync = true;
  7843. return function(result) {
  7844. if (result instanceof Error === false) {
  7845. checkResult.result = result;
  7846. resolve(checkResult);
  7847. } else {
  7848. reject(result);
  7849. }
  7850. };
  7851. },
  7852. data: function data(_data) {
  7853. checkResult.data = _data;
  7854. },
  7855. relatedNodes: function relatedNodes(nodes) {
  7856. if (!window.Node) {
  7857. return;
  7858. }
  7859. if (nodes instanceof window.Node || nodes instanceof abstract_virtual_node_default) {
  7860. nodes = [ nodes ];
  7861. } else {
  7862. nodes = to_array_default(nodes);
  7863. }
  7864. checkResult.relatedNodes = [];
  7865. nodes.forEach(function(node) {
  7866. if (node instanceof abstract_virtual_node_default) {
  7867. node = node.actualNode;
  7868. }
  7869. if (node instanceof window.Node) {
  7870. var dqElm = new dq_element_default(node);
  7871. checkResult.relatedNodes.push(dqElm);
  7872. }
  7873. });
  7874. }
  7875. };
  7876. }
  7877. var check_helper_default = checkHelper;
  7878. function _clone(obj) {
  7879. return cloneRecused(obj, new Map());
  7880. }
  7881. function cloneRecused(obj, seen) {
  7882. var _window, _window2;
  7883. if (obj === null || _typeof(obj) !== 'object') {
  7884. return obj;
  7885. }
  7886. if ((_window = window) !== null && _window !== void 0 && _window.Node && obj instanceof window.Node || (_window2 = window) !== null && _window2 !== void 0 && _window2.HTMLCollection && obj instanceof window.HTMLCollection || 'nodeName' in obj && 'nodeType' in obj && 'ownerDocument' in obj) {
  7887. return obj;
  7888. }
  7889. if (seen.has(obj)) {
  7890. return seen.get(obj);
  7891. }
  7892. if (Array.isArray(obj)) {
  7893. var out2 = [];
  7894. seen.set(obj, out2);
  7895. obj.forEach(function(value) {
  7896. out2.push(cloneRecused(value, seen));
  7897. });
  7898. return out2;
  7899. }
  7900. var out = {};
  7901. seen.set(obj, out);
  7902. for (var key in obj) {
  7903. out[key] = cloneRecused(obj[key], seen);
  7904. }
  7905. return out;
  7906. }
  7907. var import_css_selector_parser = __toModule(require_lib());
  7908. var parser = new import_css_selector_parser.CssSelectorParser();
  7909. parser.registerSelectorPseudos('not');
  7910. parser.registerSelectorPseudos('is');
  7911. parser.registerNestingOperators('>');
  7912. parser.registerAttrEqualityMods('^', '$', '*', '~');
  7913. var css_parser_default = parser;
  7914. function _matches(vNode, selector) {
  7915. var expressions = _convertSelector(selector);
  7916. return expressions.some(function(expression) {
  7917. return _matchesExpression(vNode, expression);
  7918. });
  7919. }
  7920. function matchesTag(vNode, exp) {
  7921. return vNode.props.nodeType === 1 && (exp.tag === '*' || vNode.props.nodeName === exp.tag);
  7922. }
  7923. function matchesClasses(vNode, exp) {
  7924. return !exp.classes || exp.classes.every(function(cl) {
  7925. return vNode.hasClass(cl.value);
  7926. });
  7927. }
  7928. function matchesAttributes(vNode, exp) {
  7929. return !exp.attributes || exp.attributes.every(function(att) {
  7930. var nodeAtt = vNode.attr(att.key);
  7931. return nodeAtt !== null && att.test(nodeAtt);
  7932. });
  7933. }
  7934. function matchesId(vNode, exp) {
  7935. return !exp.id || vNode.props.id === exp.id;
  7936. }
  7937. function matchesPseudos(target, exp) {
  7938. if (!exp.pseudos || exp.pseudos.every(function(pseudo) {
  7939. if (pseudo.name === 'not') {
  7940. return !pseudo.expressions.some(function(expression) {
  7941. return _matchesExpression(target, expression);
  7942. });
  7943. } else if (pseudo.name === 'is') {
  7944. return pseudo.expressions.some(function(expression) {
  7945. return _matchesExpression(target, expression);
  7946. });
  7947. }
  7948. throw new Error('the pseudo selector ' + pseudo.name + ' has not yet been implemented');
  7949. })) {
  7950. return true;
  7951. }
  7952. return false;
  7953. }
  7954. function matchExpression(vNode, expression) {
  7955. return matchesTag(vNode, expression) && matchesClasses(vNode, expression) && matchesAttributes(vNode, expression) && matchesId(vNode, expression) && matchesPseudos(vNode, expression);
  7956. }
  7957. var escapeRegExp = function() {
  7958. var from = /(?=[\-\[\]{}()*+?.\\\^$|,#\s])/g;
  7959. var to2 = '\\';
  7960. return function(string) {
  7961. return string.replace(from, to2);
  7962. };
  7963. }();
  7964. var reUnescape = /\\/g;
  7965. function convertAttributes(atts) {
  7966. if (!atts) {
  7967. return;
  7968. }
  7969. return atts.map(function(att) {
  7970. var attributeKey = att.name.replace(reUnescape, '');
  7971. var attributeValue = (att.value || '').replace(reUnescape, '');
  7972. var test, regexp;
  7973. switch (att.operator) {
  7974. case '^=':
  7975. regexp = new RegExp('^' + escapeRegExp(attributeValue));
  7976. break;
  7977. case '$=':
  7978. regexp = new RegExp(escapeRegExp(attributeValue) + '$');
  7979. break;
  7980. case '~=':
  7981. regexp = new RegExp('(^|\\s)' + escapeRegExp(attributeValue) + '(\\s|$)');
  7982. break;
  7983. case '|=':
  7984. regexp = new RegExp('^' + escapeRegExp(attributeValue) + '(-|$)');
  7985. break;
  7986. case '=':
  7987. test = function test(value) {
  7988. return attributeValue === value;
  7989. };
  7990. break;
  7991. case '*=':
  7992. test = function test(value) {
  7993. return value && value.includes(attributeValue);
  7994. };
  7995. break;
  7996. case '!=':
  7997. test = function test(value) {
  7998. return attributeValue !== value;
  7999. };
  8000. break;
  8001. default:
  8002. test = function test(value) {
  8003. return value !== null;
  8004. };
  8005. }
  8006. if (attributeValue === '' && /^[*$^]=$/.test(att.operator)) {
  8007. test = function test() {
  8008. return false;
  8009. };
  8010. }
  8011. if (!test) {
  8012. test = function test(value) {
  8013. return value && regexp.test(value);
  8014. };
  8015. }
  8016. return {
  8017. key: attributeKey,
  8018. value: attributeValue,
  8019. type: typeof att.value === 'undefined' ? 'attrExist' : 'attrValue',
  8020. test: test
  8021. };
  8022. });
  8023. }
  8024. function convertClasses(classes) {
  8025. if (!classes) {
  8026. return;
  8027. }
  8028. return classes.map(function(className) {
  8029. className = className.replace(reUnescape, '');
  8030. return {
  8031. value: className,
  8032. regexp: new RegExp('(^|\\s)' + escapeRegExp(className) + '(\\s|$)')
  8033. };
  8034. });
  8035. }
  8036. function convertPseudos(pseudos) {
  8037. if (!pseudos) {
  8038. return;
  8039. }
  8040. return pseudos.map(function(p2) {
  8041. var expressions;
  8042. if ([ 'is', 'not' ].includes(p2.name)) {
  8043. expressions = p2.value;
  8044. expressions = expressions.selectors ? expressions.selectors : [ expressions ];
  8045. expressions = convertExpressions(expressions);
  8046. }
  8047. return {
  8048. name: p2.name,
  8049. expressions: expressions,
  8050. value: p2.value
  8051. };
  8052. });
  8053. }
  8054. function convertExpressions(expressions) {
  8055. return expressions.map(function(exp) {
  8056. var newExp = [];
  8057. var rule = exp.rule;
  8058. while (rule) {
  8059. newExp.push({
  8060. tag: rule.tagName ? rule.tagName.toLowerCase() : '*',
  8061. combinator: rule.nestingOperator ? rule.nestingOperator : ' ',
  8062. id: rule.id,
  8063. attributes: convertAttributes(rule.attrs),
  8064. classes: convertClasses(rule.classNames),
  8065. pseudos: convertPseudos(rule.pseudos)
  8066. });
  8067. rule = rule.rule;
  8068. }
  8069. return newExp;
  8070. });
  8071. }
  8072. function _convertSelector(selector) {
  8073. var expressions = css_parser_default.parse(selector);
  8074. expressions = expressions.selectors ? expressions.selectors : [ expressions ];
  8075. return convertExpressions(expressions);
  8076. }
  8077. function optimizedMatchesExpression(vNode, expressions, index, matchAnyParent) {
  8078. if (!vNode) {
  8079. return false;
  8080. }
  8081. var isArray = Array.isArray(expressions);
  8082. var expression = isArray ? expressions[index] : expressions;
  8083. var machedExpression = matchExpression(vNode, expression);
  8084. while (!machedExpression && matchAnyParent && vNode.parent) {
  8085. vNode = vNode.parent;
  8086. machedExpression = matchExpression(vNode, expression);
  8087. }
  8088. if (index > 0) {
  8089. if ([ ' ', '>' ].includes(expression.combinator) === false) {
  8090. throw new Error('axe.utils.matchesExpression does not support the combinator: ' + expression.combinator);
  8091. }
  8092. machedExpression = machedExpression && optimizedMatchesExpression(vNode.parent, expressions, index - 1, expression.combinator === ' ');
  8093. }
  8094. return machedExpression;
  8095. }
  8096. function _matchesExpression(vNode, expressions, matchAnyParent) {
  8097. return optimizedMatchesExpression(vNode, expressions, expressions.length - 1, matchAnyParent);
  8098. }
  8099. function closest(vNode, selector) {
  8100. while (vNode) {
  8101. if (_matches(vNode, selector)) {
  8102. return vNode;
  8103. }
  8104. if (typeof vNode.parent === 'undefined') {
  8105. throw new TypeError('Cannot resolve parent for non-DOM nodes');
  8106. }
  8107. vNode = vNode.parent;
  8108. }
  8109. return null;
  8110. }
  8111. var closest_default = closest;
  8112. function noop() {}
  8113. function funcGuard(f) {
  8114. if (typeof f !== 'function') {
  8115. throw new TypeError('Queue methods require functions as arguments');
  8116. }
  8117. }
  8118. function queue() {
  8119. var tasks = [];
  8120. var started = 0;
  8121. var remaining = 0;
  8122. var completeQueue = noop;
  8123. var complete = false;
  8124. var err2;
  8125. var defaultFail = function defaultFail(e) {
  8126. err2 = e;
  8127. setTimeout(function() {
  8128. if (err2 !== void 0 && err2 !== null) {
  8129. log_default('Uncaught error (of queue)', err2);
  8130. }
  8131. }, 1);
  8132. };
  8133. var failed = defaultFail;
  8134. function createResolve(i) {
  8135. return function(r) {
  8136. tasks[i] = r;
  8137. remaining -= 1;
  8138. if (!remaining && completeQueue !== noop) {
  8139. complete = true;
  8140. completeQueue(tasks);
  8141. }
  8142. };
  8143. }
  8144. function abort(msg) {
  8145. completeQueue = noop;
  8146. failed(msg);
  8147. return tasks;
  8148. }
  8149. function pop() {
  8150. var length = tasks.length;
  8151. for (;started < length; started++) {
  8152. var task = tasks[started];
  8153. try {
  8154. task.call(null, createResolve(started), abort);
  8155. } catch (e) {
  8156. abort(e);
  8157. }
  8158. }
  8159. }
  8160. var q = {
  8161. defer: function defer(fn) {
  8162. if (_typeof(fn) === 'object' && fn.then && fn['catch']) {
  8163. var defer = fn;
  8164. fn = function fn(resolve, reject) {
  8165. defer.then(resolve)['catch'](reject);
  8166. };
  8167. }
  8168. funcGuard(fn);
  8169. if (err2 !== void 0) {
  8170. return;
  8171. } else if (complete) {
  8172. throw new Error('Queue already completed');
  8173. }
  8174. tasks.push(fn);
  8175. ++remaining;
  8176. pop();
  8177. return q;
  8178. },
  8179. then: function then(fn) {
  8180. funcGuard(fn);
  8181. if (completeQueue !== noop) {
  8182. throw new Error('queue `then` already set');
  8183. }
  8184. if (!err2) {
  8185. completeQueue = fn;
  8186. if (!remaining) {
  8187. complete = true;
  8188. completeQueue(tasks);
  8189. }
  8190. }
  8191. return q;
  8192. },
  8193. catch: function _catch(fn) {
  8194. funcGuard(fn);
  8195. if (failed !== defaultFail) {
  8196. throw new Error('queue `catch` already set');
  8197. }
  8198. if (!err2) {
  8199. failed = fn;
  8200. } else {
  8201. fn(err2);
  8202. err2 = null;
  8203. }
  8204. return q;
  8205. },
  8206. abort: abort
  8207. };
  8208. return q;
  8209. }
  8210. var queue_default = queue;
  8211. var uuid;
  8212. var _rng;
  8213. var _crypto = window.crypto || window.msCrypto;
  8214. if (!_rng && _crypto && _crypto.getRandomValues) {
  8215. var _rnds8 = new Uint8Array(16);
  8216. _rng = function whatwgRNG() {
  8217. _crypto.getRandomValues(_rnds8);
  8218. return _rnds8;
  8219. };
  8220. }
  8221. if (!_rng) {
  8222. var _rnds = new Array(16);
  8223. _rng = function _rng() {
  8224. for (var i = 0, r; i < 16; i++) {
  8225. if ((i & 3) === 0) {
  8226. r = Math.random() * 4294967296;
  8227. }
  8228. _rnds[i] = r >>> ((i & 3) << 3) & 255;
  8229. }
  8230. return _rnds;
  8231. };
  8232. }
  8233. var BufferClass = typeof window.Buffer == 'function' ? window.Buffer : Array;
  8234. var _byteToHex = [];
  8235. var _hexToByte = {};
  8236. for (var i = 0; i < 256; i++) {
  8237. _byteToHex[i] = (i + 256).toString(16).substr(1);
  8238. _hexToByte[_byteToHex[i]] = i;
  8239. }
  8240. function parse(s, buf, offset) {
  8241. var i = buf && offset || 0, ii = 0;
  8242. buf = buf || [];
  8243. s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) {
  8244. if (ii < 16) {
  8245. buf[i + ii++] = _hexToByte[oct];
  8246. }
  8247. });
  8248. while (ii < 16) {
  8249. buf[i + ii++] = 0;
  8250. }
  8251. return buf;
  8252. }
  8253. function unparse(buf, offset) {
  8254. var i = offset || 0, bth = _byteToHex;
  8255. return bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]];
  8256. }
  8257. var _seedBytes = _rng();
  8258. var _nodeId = [ _seedBytes[0] | 1, _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5] ];
  8259. var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 16383;
  8260. var _lastMSecs = 0;
  8261. var _lastNSecs = 0;
  8262. function v1(options, buf, offset) {
  8263. var i = buf && offset || 0;
  8264. var b2 = buf || [];
  8265. options = options || {};
  8266. var clockseq = options.clockseq != null ? options.clockseq : _clockseq;
  8267. var msecs = options.msecs != null ? options.msecs : new Date().getTime();
  8268. var nsecs = options.nsecs != null ? options.nsecs : _lastNSecs + 1;
  8269. var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 1e4;
  8270. if (dt < 0 && options.clockseq == null) {
  8271. clockseq = clockseq + 1 & 16383;
  8272. }
  8273. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs == null) {
  8274. nsecs = 0;
  8275. }
  8276. if (nsecs >= 1e4) {
  8277. throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
  8278. }
  8279. _lastMSecs = msecs;
  8280. _lastNSecs = nsecs;
  8281. _clockseq = clockseq;
  8282. msecs += 122192928e5;
  8283. var tl = ((msecs & 268435455) * 1e4 + nsecs) % 4294967296;
  8284. b2[i++] = tl >>> 24 & 255;
  8285. b2[i++] = tl >>> 16 & 255;
  8286. b2[i++] = tl >>> 8 & 255;
  8287. b2[i++] = tl & 255;
  8288. var tmh = msecs / 4294967296 * 1e4 & 268435455;
  8289. b2[i++] = tmh >>> 8 & 255;
  8290. b2[i++] = tmh & 255;
  8291. b2[i++] = tmh >>> 24 & 15 | 16;
  8292. b2[i++] = tmh >>> 16 & 255;
  8293. b2[i++] = clockseq >>> 8 | 128;
  8294. b2[i++] = clockseq & 255;
  8295. var node = options.node || _nodeId;
  8296. for (var n2 = 0; n2 < 6; n2++) {
  8297. b2[i + n2] = node[n2];
  8298. }
  8299. return buf ? buf : unparse(b2);
  8300. }
  8301. function v4(options, buf, offset) {
  8302. var i = buf && offset || 0;
  8303. if (typeof options == 'string') {
  8304. buf = options == 'binary' ? new BufferClass(16) : null;
  8305. options = null;
  8306. }
  8307. options = options || {};
  8308. var rnds = options.random || (options.rng || _rng)();
  8309. rnds[6] = rnds[6] & 15 | 64;
  8310. rnds[8] = rnds[8] & 63 | 128;
  8311. if (buf) {
  8312. for (var ii = 0; ii < 16; ii++) {
  8313. buf[i + ii] = rnds[ii];
  8314. }
  8315. }
  8316. return buf || unparse(rnds);
  8317. }
  8318. uuid = v4;
  8319. uuid.v1 = v1;
  8320. uuid.v4 = v4;
  8321. uuid.parse = parse;
  8322. uuid.unparse = unparse;
  8323. uuid.BufferClass = BufferClass;
  8324. axe._uuid = v1();
  8325. var uuid_default = v4;
  8326. var errorTypes = Object.freeze([ 'EvalError', 'RangeError', 'ReferenceError', 'SyntaxError', 'TypeError', 'URIError' ]);
  8327. function stringifyMessage(_ref3) {
  8328. var topic = _ref3.topic, channelId = _ref3.channelId, message = _ref3.message, messageId = _ref3.messageId, keepalive = _ref3.keepalive;
  8329. var data = {
  8330. channelId: channelId,
  8331. topic: topic,
  8332. messageId: messageId,
  8333. keepalive: !!keepalive,
  8334. source: getSource2()
  8335. };
  8336. if (message instanceof Error) {
  8337. data.error = {
  8338. name: message.name,
  8339. message: message.message,
  8340. stack: message.stack
  8341. };
  8342. } else {
  8343. data.payload = message;
  8344. }
  8345. return JSON.stringify(data);
  8346. }
  8347. function parseMessage(dataString) {
  8348. var data;
  8349. try {
  8350. data = JSON.parse(dataString);
  8351. } catch (_unused) {
  8352. return;
  8353. }
  8354. if (!isRespondableMessage(data)) {
  8355. return;
  8356. }
  8357. var _data2 = data, topic = _data2.topic, channelId = _data2.channelId, messageId = _data2.messageId, keepalive = _data2.keepalive;
  8358. var message = _typeof(data.error) === 'object' ? buildErrorObject(data.error) : data.payload;
  8359. return {
  8360. topic: topic,
  8361. message: message,
  8362. messageId: messageId,
  8363. channelId: channelId,
  8364. keepalive: !!keepalive
  8365. };
  8366. }
  8367. function isRespondableMessage(postedMessage) {
  8368. return postedMessage !== null && _typeof(postedMessage) === 'object' && typeof postedMessage.channelId === 'string' && postedMessage.source === getSource2();
  8369. }
  8370. function buildErrorObject(error) {
  8371. var msg = error.message || 'Unknown error occurred';
  8372. var errorName = errorTypes.includes(error.name) ? error.name : 'Error';
  8373. var ErrConstructor = window[errorName] || Error;
  8374. if (error.stack) {
  8375. msg += '\n' + error.stack.replace(error.message, '');
  8376. }
  8377. return new ErrConstructor(msg);
  8378. }
  8379. function getSource2() {
  8380. var application = 'axeAPI';
  8381. var version = '';
  8382. if (typeof axe !== 'undefined' && axe._audit && axe._audit.application) {
  8383. application = axe._audit.application;
  8384. }
  8385. if (typeof axe !== 'undefined') {
  8386. version = axe.version;
  8387. }
  8388. return application + '.' + version;
  8389. }
  8390. function assertIsParentWindow(win) {
  8391. assetNotGlobalWindow(win);
  8392. assert_default(window.parent === win, 'Source of the response must be the parent window.');
  8393. }
  8394. function assertIsFrameWindow(win) {
  8395. assetNotGlobalWindow(win);
  8396. assert_default(win.parent === window, 'Respondable target must be a frame in the current window');
  8397. }
  8398. function assetNotGlobalWindow(win) {
  8399. assert_default(window !== win, 'Messages can not be sent to the same window.');
  8400. }
  8401. var channels = {};
  8402. function storeReplyHandler(channelId, replyHandler) {
  8403. var sendToParent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  8404. assert_default(!channels[channelId], 'A replyHandler already exists for this message channel.');
  8405. channels[channelId] = {
  8406. replyHandler: replyHandler,
  8407. sendToParent: sendToParent
  8408. };
  8409. }
  8410. function getReplyHandler(channelId) {
  8411. return channels[channelId];
  8412. }
  8413. function deleteReplyHandler(channelId) {
  8414. delete channels[channelId];
  8415. }
  8416. var messageIds = [];
  8417. function createMessageId() {
  8418. var uuid2 = ''.concat(v4(), ':').concat(v4());
  8419. if (messageIds.includes(uuid2)) {
  8420. return createMessageId();
  8421. }
  8422. messageIds.push(uuid2);
  8423. return uuid2;
  8424. }
  8425. function isNewMessage(uuid2) {
  8426. if (messageIds.includes(uuid2)) {
  8427. return false;
  8428. }
  8429. messageIds.push(uuid2);
  8430. return true;
  8431. }
  8432. function postMessage(win, data, sendToParent, replyHandler) {
  8433. sendToParent ? assertIsParentWindow(win) : assertIsFrameWindow(win);
  8434. if (data.message instanceof Error && !sendToParent) {
  8435. axe.log(data.message);
  8436. return false;
  8437. }
  8438. var dataString = stringifyMessage(_extends({
  8439. messageId: createMessageId()
  8440. }, data));
  8441. var allowedOrigins = axe._audit.allowedOrigins;
  8442. if (!allowedOrigins || !allowedOrigins.length) {
  8443. return false;
  8444. }
  8445. if (typeof replyHandler === 'function') {
  8446. storeReplyHandler(data.channelId, replyHandler, sendToParent);
  8447. }
  8448. allowedOrigins.forEach(function(origin) {
  8449. try {
  8450. win.postMessage(dataString, origin);
  8451. } catch (err2) {
  8452. if (err2 instanceof win.DOMException) {
  8453. throw new Error('allowedOrigins value "'.concat(origin, '" is not a valid origin'));
  8454. }
  8455. throw err2;
  8456. }
  8457. });
  8458. return true;
  8459. }
  8460. function processError(win, error, channelId) {
  8461. if (!win.parent !== window) {
  8462. return axe.log(error);
  8463. }
  8464. try {
  8465. postMessage(win, {
  8466. topic: null,
  8467. channelId: channelId,
  8468. message: error,
  8469. messageId: createMessageId(),
  8470. keepalive: true
  8471. }, true);
  8472. } catch (err2) {
  8473. return axe.log(err2);
  8474. }
  8475. }
  8476. function createResponder(win, channelId) {
  8477. var sendToParent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  8478. return function respond(message, keepalive, replyHandler) {
  8479. var data = {
  8480. channelId: channelId,
  8481. message: message,
  8482. keepalive: keepalive
  8483. };
  8484. postMessage(win, data, sendToParent, replyHandler);
  8485. };
  8486. }
  8487. function originIsAllowed(origin) {
  8488. var allowedOrigins = axe._audit.allowedOrigins;
  8489. return allowedOrigins && allowedOrigins.includes('*') || allowedOrigins.includes(origin);
  8490. }
  8491. function messageHandler(_ref4, topicHandler) {
  8492. var origin = _ref4.origin, dataString = _ref4.data, win = _ref4.source;
  8493. try {
  8494. var data = parseMessage(dataString) || {};
  8495. var channelId = data.channelId, message = data.message, messageId = data.messageId;
  8496. if (!originIsAllowed(origin) || !isNewMessage(messageId)) {
  8497. return;
  8498. }
  8499. if (message instanceof Error && win.parent !== window) {
  8500. axe.log(message);
  8501. return false;
  8502. }
  8503. try {
  8504. if (data.topic) {
  8505. var responder = createResponder(win, channelId);
  8506. assertIsParentWindow(win);
  8507. topicHandler(data, responder);
  8508. } else {
  8509. callReplyHandler(win, data);
  8510. }
  8511. } catch (error) {
  8512. processError(win, error, channelId);
  8513. }
  8514. } catch (error) {
  8515. axe.log(error);
  8516. return false;
  8517. }
  8518. }
  8519. function callReplyHandler(win, data) {
  8520. var channelId = data.channelId, message = data.message, keepalive = data.keepalive;
  8521. var _ref5 = getReplyHandler(channelId) || {}, replyHandler = _ref5.replyHandler, sendToParent = _ref5.sendToParent;
  8522. if (!replyHandler) {
  8523. return;
  8524. }
  8525. sendToParent ? assertIsParentWindow(win) : assertIsFrameWindow(win);
  8526. var responder = createResponder(win, channelId, sendToParent);
  8527. if (!keepalive && channelId) {
  8528. deleteReplyHandler(channelId);
  8529. }
  8530. try {
  8531. replyHandler(message, keepalive, responder);
  8532. } catch (error) {
  8533. axe.log(error);
  8534. responder(error, keepalive);
  8535. }
  8536. }
  8537. var frameMessenger = {
  8538. open: function open(topicHandler) {
  8539. if (typeof window.addEventListener !== 'function') {
  8540. return;
  8541. }
  8542. var handler = function handler(messageEvent) {
  8543. messageHandler(messageEvent, topicHandler);
  8544. };
  8545. window.addEventListener('message', handler, false);
  8546. return function() {
  8547. window.removeEventListener('message', handler, false);
  8548. };
  8549. },
  8550. post: function post(win, data, replyHandler) {
  8551. if (typeof window.addEventListener !== 'function') {
  8552. return false;
  8553. }
  8554. return postMessage(win, data, false, replyHandler);
  8555. }
  8556. };
  8557. function setDefaultFrameMessenger(respondable2) {
  8558. respondable2.updateMessenger(frameMessenger);
  8559. }
  8560. var closeHandler;
  8561. var postMessage2;
  8562. var topicHandlers = {};
  8563. function _respondable(win, topic, message, keepalive, replyHandler) {
  8564. var data = {
  8565. topic: topic,
  8566. message: message,
  8567. channelId: ''.concat(v4(), ':').concat(v4()),
  8568. keepalive: keepalive
  8569. };
  8570. return postMessage2(win, data, replyHandler);
  8571. }
  8572. function messageListener(data, responder) {
  8573. var topic = data.topic, message = data.message, keepalive = data.keepalive;
  8574. var topicHandler = topicHandlers[topic];
  8575. if (!topicHandler) {
  8576. return;
  8577. }
  8578. try {
  8579. topicHandler(message, keepalive, responder);
  8580. } catch (error) {
  8581. axe.log(error);
  8582. responder(error, keepalive);
  8583. }
  8584. }
  8585. _respondable.updateMessenger = function updateMessenger(_ref6) {
  8586. var open = _ref6.open, post = _ref6.post;
  8587. assert_default(typeof open === 'function', 'open callback must be a function');
  8588. assert_default(typeof post === 'function', 'post callback must be a function');
  8589. if (closeHandler) {
  8590. closeHandler();
  8591. }
  8592. var close = open(messageListener);
  8593. if (close) {
  8594. assert_default(typeof close === 'function', 'open callback must return a cleanup function');
  8595. closeHandler = close;
  8596. } else {
  8597. closeHandler = null;
  8598. }
  8599. postMessage2 = post;
  8600. };
  8601. _respondable.subscribe = function subscribe(topic, topicHandler) {
  8602. assert_default(typeof topicHandler === 'function', 'Subscriber callback must be a function');
  8603. assert_default(!topicHandlers[topic], 'Topic '.concat(topic, ' is already registered to.'));
  8604. topicHandlers[topic] = topicHandler;
  8605. };
  8606. _respondable.isInFrame = function isInFrame() {
  8607. var win = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
  8608. return !!win.frameElement;
  8609. };
  8610. setDefaultFrameMessenger(_respondable);
  8611. function _sendCommandToFrame(node, parameters, resolve, reject) {
  8612. var _parameters$options$p, _parameters$options;
  8613. var win = node.contentWindow;
  8614. var pingWaitTime = (_parameters$options$p = (_parameters$options = parameters.options) === null || _parameters$options === void 0 ? void 0 : _parameters$options.pingWaitTime) !== null && _parameters$options$p !== void 0 ? _parameters$options$p : 500;
  8615. if (!win) {
  8616. log_default('Frame does not have a content window', node);
  8617. resolve(null);
  8618. return;
  8619. }
  8620. if (pingWaitTime === 0) {
  8621. callAxeStart(node, parameters, resolve, reject);
  8622. return;
  8623. }
  8624. var timeout = setTimeout(function() {
  8625. timeout = setTimeout(function() {
  8626. if (!parameters.debug) {
  8627. resolve(null);
  8628. } else {
  8629. reject(err('No response from frame', node));
  8630. }
  8631. }, 0);
  8632. }, pingWaitTime);
  8633. _respondable(win, 'axe.ping', null, void 0, function() {
  8634. clearTimeout(timeout);
  8635. callAxeStart(node, parameters, resolve, reject);
  8636. });
  8637. }
  8638. function callAxeStart(node, parameters, resolve, reject) {
  8639. var _parameters$options$f, _parameters$options2;
  8640. var frameWaitTime = (_parameters$options$f = (_parameters$options2 = parameters.options) === null || _parameters$options2 === void 0 ? void 0 : _parameters$options2.frameWaitTime) !== null && _parameters$options$f !== void 0 ? _parameters$options$f : 6e4;
  8641. var win = node.contentWindow;
  8642. var timeout = setTimeout(function collectResultFramesTimeout() {
  8643. reject(err('Axe in frame timed out', node));
  8644. }, frameWaitTime);
  8645. _respondable(win, 'axe.start', parameters, void 0, function(data) {
  8646. clearTimeout(timeout);
  8647. if (data instanceof Error === false) {
  8648. resolve(data);
  8649. } else {
  8650. reject(data);
  8651. }
  8652. });
  8653. }
  8654. function err(message, node) {
  8655. var selector;
  8656. if (axe._tree) {
  8657. selector = get_selector_default(node);
  8658. }
  8659. return new Error(message + ': ' + (selector || node));
  8660. }
  8661. var customSerializer = null;
  8662. var nodeSerializer = {
  8663. update: function update(serializer) {
  8664. assert_default(_typeof(serializer) === 'object', 'serializer must be an object');
  8665. customSerializer = serializer;
  8666. },
  8667. toSpec: function toSpec(node) {
  8668. return nodeSerializer.dqElmToSpec(new dq_element_default(node));
  8669. },
  8670. dqElmToSpec: function dqElmToSpec(dqElm, runOptions) {
  8671. var _customSerializer;
  8672. if (dqElm instanceof dq_element_default === false) {
  8673. return dqElm;
  8674. }
  8675. if (runOptions) {
  8676. dqElm = cloneLimitedDqElement(dqElm, runOptions);
  8677. }
  8678. if (typeof ((_customSerializer = customSerializer) === null || _customSerializer === void 0 ? void 0 : _customSerializer.toSpec) === 'function') {
  8679. return customSerializer.toSpec(dqElm);
  8680. }
  8681. return dqElm.toJSON();
  8682. },
  8683. mergeSpecs: function mergeSpecs(nodeSpec, parentFrameSpec) {
  8684. var _customSerializer2;
  8685. if (typeof ((_customSerializer2 = customSerializer) === null || _customSerializer2 === void 0 ? void 0 : _customSerializer2.mergeSpecs) === 'function') {
  8686. return customSerializer.mergeSpecs(nodeSpec, parentFrameSpec);
  8687. }
  8688. return dq_element_default.mergeSpecs(nodeSpec, parentFrameSpec);
  8689. },
  8690. mapRawResults: function mapRawResults(rawResults) {
  8691. return rawResults.map(function(rawResult) {
  8692. return _extends({}, rawResult, {
  8693. nodes: nodeSerializer.mapRawNodeResults(rawResult.nodes)
  8694. });
  8695. });
  8696. },
  8697. mapRawNodeResults: function mapRawNodeResults(nodeResults) {
  8698. return nodeResults === null || nodeResults === void 0 ? void 0 : nodeResults.map(function(_ref7) {
  8699. var node = _ref7.node, nodeResult = _objectWithoutProperties(_ref7, _excluded);
  8700. nodeResult.node = nodeSerializer.dqElmToSpec(node);
  8701. for (var _i2 = 0, _arr = [ 'any', 'all', 'none' ]; _i2 < _arr.length; _i2++) {
  8702. var type2 = _arr[_i2];
  8703. nodeResult[type2] = nodeResult[type2].map(function(_ref8) {
  8704. var relatedNodes = _ref8.relatedNodes, checkResult = _objectWithoutProperties(_ref8, _excluded2);
  8705. checkResult.relatedNodes = relatedNodes.map(nodeSerializer.dqElmToSpec);
  8706. return checkResult;
  8707. });
  8708. }
  8709. return nodeResult;
  8710. });
  8711. }
  8712. };
  8713. var node_serializer_default = nodeSerializer;
  8714. function cloneLimitedDqElement(dqElm, runOptions) {
  8715. var fromFrame2 = dqElm.fromFrame;
  8716. var hasAncestry = runOptions.ancestry, hasXpath = runOptions.xpath;
  8717. var hasSelectors = runOptions.selectors !== false || fromFrame2;
  8718. dqElm = new dq_element_default(dqElm.element, runOptions, {
  8719. source: dqElm.source,
  8720. nodeIndexes: dqElm.nodeIndexes,
  8721. selector: hasSelectors ? dqElm.selector : [ ':root' ],
  8722. ancestry: hasAncestry ? dqElm.ancestry : [ ':root' ],
  8723. xpath: hasXpath ? dqElm.xpath : '/'
  8724. });
  8725. dqElm.fromFrame = fromFrame2;
  8726. return dqElm;
  8727. }
  8728. function getAllChecks(object) {
  8729. var result = [];
  8730. return result.concat(object.any || []).concat(object.all || []).concat(object.none || []);
  8731. }
  8732. var get_all_checks_default = getAllChecks;
  8733. function findBy(array, key, value) {
  8734. if (Array.isArray(array)) {
  8735. return array.find(function(obj) {
  8736. return obj !== null && _typeof(obj) === 'object' && Object.hasOwn(obj, key) && obj[key] === value;
  8737. });
  8738. }
  8739. }
  8740. var find_by_default = findBy;
  8741. function pushFrame(resultSet, options, frameSpec) {
  8742. resultSet.forEach(function(res) {
  8743. res.node = node_serializer_default.mergeSpecs(res.node, frameSpec);
  8744. var checks = get_all_checks_default(res);
  8745. checks.forEach(function(check) {
  8746. check.relatedNodes = check.relatedNodes.map(function(node) {
  8747. return node_serializer_default.mergeSpecs(node, frameSpec);
  8748. });
  8749. });
  8750. });
  8751. }
  8752. function spliceNodes(target, to2) {
  8753. var firstFromFrame = to2[0].node;
  8754. var node;
  8755. for (var _i3 = 0; _i3 < target.length; _i3++) {
  8756. node = target[_i3].node;
  8757. var resultSort = nodeIndexSort(node.nodeIndexes, firstFromFrame.nodeIndexes);
  8758. if (resultSort > 0 || resultSort === 0 && firstFromFrame.selector.length < node.selector.length) {
  8759. target.splice.apply(target, [ _i3, 0 ].concat(_toConsumableArray(to2)));
  8760. return;
  8761. }
  8762. }
  8763. target.push.apply(target, _toConsumableArray(to2));
  8764. }
  8765. function normalizeResult(result) {
  8766. if (!result || !result.results) {
  8767. return null;
  8768. }
  8769. if (!Array.isArray(result.results)) {
  8770. return [ result.results ];
  8771. }
  8772. if (!result.results.length) {
  8773. return null;
  8774. }
  8775. return result.results;
  8776. }
  8777. function mergeResults(frameResults, options) {
  8778. var mergedResult = [];
  8779. frameResults.forEach(function(frameResult) {
  8780. var results = normalizeResult(frameResult);
  8781. if (!results || !results.length) {
  8782. return;
  8783. }
  8784. var frameSpec = getFrameSpec(frameResult);
  8785. results.forEach(function(ruleResult) {
  8786. if (ruleResult.nodes && frameSpec) {
  8787. pushFrame(ruleResult.nodes, options, frameSpec);
  8788. }
  8789. var res = find_by_default(mergedResult, 'id', ruleResult.id);
  8790. if (!res) {
  8791. mergedResult.push(ruleResult);
  8792. } else {
  8793. if (ruleResult.nodes.length) {
  8794. spliceNodes(res.nodes, ruleResult.nodes);
  8795. }
  8796. }
  8797. });
  8798. });
  8799. mergedResult.forEach(function(result) {
  8800. if (result.nodes) {
  8801. result.nodes.sort(function(nodeA, nodeB) {
  8802. return nodeIndexSort(nodeA.node.nodeIndexes, nodeB.node.nodeIndexes);
  8803. });
  8804. }
  8805. });
  8806. return mergedResult;
  8807. }
  8808. function nodeIndexSort() {
  8809. var nodeIndexesA = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  8810. var nodeIndexesB = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  8811. var length = Math.max(nodeIndexesA === null || nodeIndexesA === void 0 ? void 0 : nodeIndexesA.length, nodeIndexesB === null || nodeIndexesB === void 0 ? void 0 : nodeIndexesB.length);
  8812. for (var _i4 = 0; _i4 < length; _i4++) {
  8813. var indexA = nodeIndexesA === null || nodeIndexesA === void 0 ? void 0 : nodeIndexesA[_i4];
  8814. var indexB = nodeIndexesB === null || nodeIndexesB === void 0 ? void 0 : nodeIndexesB[_i4];
  8815. if (typeof indexA !== 'number' || isNaN(indexA)) {
  8816. return _i4 === 0 ? 1 : -1;
  8817. }
  8818. if (typeof indexB !== 'number' || isNaN(indexB)) {
  8819. return _i4 === 0 ? -1 : 1;
  8820. }
  8821. if (indexA !== indexB) {
  8822. return indexA - indexB;
  8823. }
  8824. }
  8825. return 0;
  8826. }
  8827. var merge_results_default = mergeResults;
  8828. function getFrameSpec(frameResult) {
  8829. if (frameResult.frameElement) {
  8830. return node_serializer_default.toSpec(frameResult.frameElement);
  8831. } else if (frameResult.frameSpec) {
  8832. return frameResult.frameSpec;
  8833. }
  8834. return null;
  8835. }
  8836. function _collectResultsFromFrames(parentContent, options, command, parameter, resolve, reject) {
  8837. options = _extends({}, options, {
  8838. elementRef: false
  8839. });
  8840. var q = queue_default();
  8841. var frames = parentContent.frames;
  8842. frames.forEach(function(_ref9) {
  8843. var frameElement = _ref9.node, context = _objectWithoutProperties(_ref9, _excluded3);
  8844. q.defer(function(res, rej) {
  8845. var params = {
  8846. options: options,
  8847. command: command,
  8848. parameter: parameter,
  8849. context: context
  8850. };
  8851. function callback(results) {
  8852. if (!results) {
  8853. return res(null);
  8854. }
  8855. return res({
  8856. results: results,
  8857. frameElement: frameElement
  8858. });
  8859. }
  8860. _sendCommandToFrame(frameElement, params, callback, rej);
  8861. });
  8862. });
  8863. q.then(function(data) {
  8864. resolve(merge_results_default(data, options));
  8865. })['catch'](reject);
  8866. }
  8867. function _contains(vNode, otherVNode) {
  8868. if (!vNode.shadowId && !otherVNode.shadowId && vNode.actualNode && typeof vNode.actualNode.contains === 'function') {
  8869. return vNode.actualNode.contains(otherVNode.actualNode);
  8870. }
  8871. do {
  8872. if (vNode === otherVNode) {
  8873. return true;
  8874. } else if (otherVNode.nodeIndex < vNode.nodeIndex) {
  8875. return false;
  8876. }
  8877. otherVNode = otherVNode.parent;
  8878. } while (otherVNode);
  8879. return false;
  8880. }
  8881. function deepMerge() {
  8882. var target = {};
  8883. for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {
  8884. sources[_key] = arguments[_key];
  8885. }
  8886. sources.forEach(function(source) {
  8887. if (!source || _typeof(source) !== 'object' || Array.isArray(source)) {
  8888. return;
  8889. }
  8890. for (var _i5 = 0, _Object$keys = Object.keys(source); _i5 < _Object$keys.length; _i5++) {
  8891. var key = _Object$keys[_i5];
  8892. if (!target.hasOwnProperty(key) || _typeof(source[key]) !== 'object' || Array.isArray(target[key])) {
  8893. target[key] = source[key];
  8894. } else {
  8895. target[key] = deepMerge(target[key], source[key]);
  8896. }
  8897. }
  8898. });
  8899. return target;
  8900. }
  8901. var deep_merge_default = deepMerge;
  8902. function extendMetaData(to2, from) {
  8903. Object.assign(to2, from);
  8904. Object.keys(from).filter(function(prop) {
  8905. return typeof from[prop] === 'function';
  8906. }).forEach(function(prop) {
  8907. to2[prop] = null;
  8908. try {
  8909. to2[prop] = from[prop](to2);
  8910. } catch (_unused2) {}
  8911. });
  8912. }
  8913. var extend_meta_data_default = extendMetaData;
  8914. var possibleShadowRoots = [ 'article', 'aside', 'blockquote', 'body', 'div', 'footer', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'main', 'nav', 'p', 'section', 'span' ];
  8915. function isShadowRoot(node) {
  8916. if (node.shadowRoot) {
  8917. var nodeName2 = node.nodeName.toLowerCase();
  8918. if (possibleShadowRoots.includes(nodeName2) || /^[a-z][a-z0-9_.-]*-[a-z0-9_.-]*$/.test(nodeName2)) {
  8919. return true;
  8920. }
  8921. }
  8922. return false;
  8923. }
  8924. var is_shadow_root_default = isShadowRoot;
  8925. var dom_exports = {};
  8926. __export(dom_exports, {
  8927. createGrid: function createGrid() {
  8928. return _createGrid;
  8929. },
  8930. findElmsInContext: function findElmsInContext() {
  8931. return find_elms_in_context_default;
  8932. },
  8933. findNearbyElms: function findNearbyElms() {
  8934. return _findNearbyElms;
  8935. },
  8936. findUp: function findUp() {
  8937. return find_up_default;
  8938. },
  8939. findUpVirtual: function findUpVirtual() {
  8940. return find_up_virtual_default;
  8941. },
  8942. focusDisabled: function focusDisabled() {
  8943. return focus_disabled_default;
  8944. },
  8945. getComposedParent: function getComposedParent() {
  8946. return get_composed_parent_default;
  8947. },
  8948. getElementByReference: function getElementByReference() {
  8949. return get_element_by_reference_default;
  8950. },
  8951. getElementCoordinates: function getElementCoordinates() {
  8952. return get_element_coordinates_default;
  8953. },
  8954. getElementStack: function getElementStack() {
  8955. return get_element_stack_default;
  8956. },
  8957. getModalDialog: function getModalDialog() {
  8958. return get_modal_dialog_default;
  8959. },
  8960. getOverflowHiddenAncestors: function getOverflowHiddenAncestors() {
  8961. return get_overflow_hidden_ancestors_default;
  8962. },
  8963. getRootNode: function getRootNode() {
  8964. return get_root_node_default2;
  8965. },
  8966. getScrollOffset: function getScrollOffset() {
  8967. return get_scroll_offset_default;
  8968. },
  8969. getTabbableElements: function getTabbableElements() {
  8970. return get_tabbable_elements_default;
  8971. },
  8972. getTargetRects: function getTargetRects() {
  8973. return get_target_rects_default;
  8974. },
  8975. getTargetSize: function getTargetSize() {
  8976. return get_target_size_default;
  8977. },
  8978. getTextElementStack: function getTextElementStack() {
  8979. return get_text_element_stack_default;
  8980. },
  8981. getViewportSize: function getViewportSize() {
  8982. return get_viewport_size_default;
  8983. },
  8984. getVisibleChildTextRects: function getVisibleChildTextRects() {
  8985. return get_visible_child_text_rects_default;
  8986. },
  8987. hasContent: function hasContent() {
  8988. return has_content_default;
  8989. },
  8990. hasContentVirtual: function hasContentVirtual() {
  8991. return has_content_virtual_default;
  8992. },
  8993. hasLangText: function hasLangText() {
  8994. return _hasLangText;
  8995. },
  8996. idrefs: function idrefs() {
  8997. return idrefs_default;
  8998. },
  8999. insertedIntoFocusOrder: function insertedIntoFocusOrder() {
  9000. return inserted_into_focus_order_default;
  9001. },
  9002. isCurrentPageLink: function isCurrentPageLink() {
  9003. return _isCurrentPageLink;
  9004. },
  9005. isFocusable: function isFocusable() {
  9006. return _isFocusable;
  9007. },
  9008. isHTML5: function isHTML5() {
  9009. return is_html5_default;
  9010. },
  9011. isHiddenForEveryone: function isHiddenForEveryone() {
  9012. return _isHiddenForEveryone;
  9013. },
  9014. isHiddenWithCSS: function isHiddenWithCSS() {
  9015. return is_hidden_with_css_default;
  9016. },
  9017. isInTabOrder: function isInTabOrder() {
  9018. return _isInTabOrder;
  9019. },
  9020. isInTextBlock: function isInTextBlock() {
  9021. return is_in_text_block_default;
  9022. },
  9023. isInert: function isInert() {
  9024. return _isInert;
  9025. },
  9026. isModalOpen: function isModalOpen() {
  9027. return is_modal_open_default;
  9028. },
  9029. isMultiline: function isMultiline() {
  9030. return _isMultiline;
  9031. },
  9032. isNativelyFocusable: function isNativelyFocusable() {
  9033. return is_natively_focusable_default;
  9034. },
  9035. isNode: function isNode() {
  9036. return is_node_default;
  9037. },
  9038. isOffscreen: function isOffscreen() {
  9039. return is_offscreen_default;
  9040. },
  9041. isOpaque: function isOpaque() {
  9042. return is_opaque_default;
  9043. },
  9044. isSkipLink: function isSkipLink() {
  9045. return _isSkipLink;
  9046. },
  9047. isVisible: function isVisible() {
  9048. return is_visible_default;
  9049. },
  9050. isVisibleOnScreen: function isVisibleOnScreen() {
  9051. return _isVisibleOnScreen;
  9052. },
  9053. isVisibleToScreenReaders: function isVisibleToScreenReaders() {
  9054. return _isVisibleToScreenReaders;
  9055. },
  9056. isVisualContent: function isVisualContent() {
  9057. return is_visual_content_default;
  9058. },
  9059. reduceToElementsBelowFloating: function reduceToElementsBelowFloating() {
  9060. return reduce_to_elements_below_floating_default;
  9061. },
  9062. shadowElementsFromPoint: function shadowElementsFromPoint() {
  9063. return shadow_elements_from_point_default;
  9064. },
  9065. urlPropsFromAttribute: function urlPropsFromAttribute() {
  9066. return url_props_from_attribute_default;
  9067. },
  9068. visuallyContains: function visuallyContains() {
  9069. return _visuallyContains;
  9070. },
  9071. visuallyOverlaps: function visuallyOverlaps() {
  9072. return visually_overlaps_default;
  9073. },
  9074. visuallySort: function visuallySort() {
  9075. return _visuallySort;
  9076. }
  9077. });
  9078. function getRootNode(node) {
  9079. var doc = node.getRootNode && node.getRootNode() || document;
  9080. if (doc === node) {
  9081. doc = document;
  9082. }
  9083. return doc;
  9084. }
  9085. var get_root_node_default = getRootNode;
  9086. var get_root_node_default2 = get_root_node_default;
  9087. function findElmsInContext(_ref10) {
  9088. var context = _ref10.context, value = _ref10.value, attr = _ref10.attr, _ref10$elm = _ref10.elm, elm = _ref10$elm === void 0 ? '' : _ref10$elm;
  9089. var root;
  9090. var escapedValue = escape_selector_default(value);
  9091. if (context.nodeType === 9 || context.nodeType === 11) {
  9092. root = context;
  9093. } else {
  9094. root = get_root_node_default2(context);
  9095. }
  9096. return Array.from(root.querySelectorAll(elm + '[' + attr + '=' + escapedValue + ']'));
  9097. }
  9098. var find_elms_in_context_default = findElmsInContext;
  9099. function findUpVirtual(element, target) {
  9100. var parent;
  9101. parent = element.actualNode;
  9102. if (!element.shadowId && typeof element.actualNode.closest === 'function') {
  9103. var match = element.actualNode.closest(target);
  9104. if (match) {
  9105. return match;
  9106. }
  9107. return null;
  9108. }
  9109. do {
  9110. parent = parent.assignedSlot ? parent.assignedSlot : parent.parentNode;
  9111. if (parent && parent.nodeType === 11) {
  9112. parent = parent.host;
  9113. }
  9114. } while (parent && !element_matches_default(parent, target) && parent !== document.documentElement);
  9115. if (!parent) {
  9116. return null;
  9117. }
  9118. if (!element_matches_default(parent, target)) {
  9119. return null;
  9120. }
  9121. return parent;
  9122. }
  9123. var find_up_virtual_default = findUpVirtual;
  9124. function findUp(element, target) {
  9125. return find_up_virtual_default(get_node_from_tree_default(element), target);
  9126. }
  9127. var find_up_default = findUp;
  9128. function _rectsOverlap(rect1, rect2) {
  9129. return (rect1.left | 0) < (rect2.right | 0) && (rect1.right | 0) > (rect2.left | 0) && (rect1.top | 0) < (rect2.bottom | 0) && (rect1.bottom | 0) > (rect2.top | 0);
  9130. }
  9131. var getOverflowHiddenAncestors = memoize_default(function getOverflowHiddenAncestorsMemoized(vNode) {
  9132. var ancestors = [];
  9133. if (!vNode) {
  9134. return ancestors;
  9135. }
  9136. var overflow = vNode.getComputedStylePropertyValue('overflow');
  9137. if (overflow === 'hidden') {
  9138. ancestors.push(vNode);
  9139. }
  9140. return ancestors.concat(getOverflowHiddenAncestors(vNode.parent));
  9141. });
  9142. var get_overflow_hidden_ancestors_default = getOverflowHiddenAncestors;
  9143. var clipRegex = /rect\s*\(([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px\s*\)/;
  9144. var clipPathRegex = /(\w+)\((\d+)/;
  9145. function nativelyHidden(vNode) {
  9146. return [ 'style', 'script', 'noscript', 'template' ].includes(vNode.props.nodeName);
  9147. }
  9148. function displayHidden(vNode) {
  9149. if (vNode.props.nodeName === 'area') {
  9150. return false;
  9151. }
  9152. return vNode.getComputedStylePropertyValue('display') === 'none';
  9153. }
  9154. function visibilityHidden(vNode) {
  9155. var _ref11 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, isAncestor = _ref11.isAncestor;
  9156. return !isAncestor && [ 'hidden', 'collapse' ].includes(vNode.getComputedStylePropertyValue('visibility'));
  9157. }
  9158. function contentVisibiltyHidden(vNode) {
  9159. var _ref12 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, isAncestor = _ref12.isAncestor;
  9160. return !!isAncestor && vNode.getComputedStylePropertyValue('content-visibility') === 'hidden';
  9161. }
  9162. function ariaHidden(vNode) {
  9163. return vNode.attr('aria-hidden') === 'true';
  9164. }
  9165. function opacityHidden(vNode) {
  9166. return vNode.getComputedStylePropertyValue('opacity') === '0';
  9167. }
  9168. function scrollHidden(vNode) {
  9169. var scroll = get_scroll_default(vNode.actualNode);
  9170. var elHeight = parseInt(vNode.getComputedStylePropertyValue('height'));
  9171. var elWidth = parseInt(vNode.getComputedStylePropertyValue('width'));
  9172. return !!scroll && (elHeight === 0 || elWidth === 0);
  9173. }
  9174. function overflowHidden(vNode) {
  9175. var _ref13 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, isAncestor = _ref13.isAncestor;
  9176. if (isAncestor) {
  9177. return false;
  9178. }
  9179. var position = vNode.getComputedStylePropertyValue('position');
  9180. if (position === 'fixed') {
  9181. return false;
  9182. }
  9183. var nodes = get_overflow_hidden_ancestors_default(vNode);
  9184. if (!nodes.length) {
  9185. return false;
  9186. }
  9187. var rect = vNode.boundingClientRect;
  9188. return nodes.some(function(node) {
  9189. if (position === 'absolute' && !hasPositionedAncestorBetween(vNode, node) && node.getComputedStylePropertyValue('position') === 'static') {
  9190. return false;
  9191. }
  9192. var nodeRect = node.boundingClientRect;
  9193. if (nodeRect.width < 2 || nodeRect.height < 2) {
  9194. return true;
  9195. }
  9196. return !_rectsOverlap(rect, nodeRect);
  9197. });
  9198. }
  9199. function clipHidden(vNode) {
  9200. var matchesClip = vNode.getComputedStylePropertyValue('clip').match(clipRegex);
  9201. var matchesClipPath = vNode.getComputedStylePropertyValue('clip-path').match(clipPathRegex);
  9202. if (matchesClip && matchesClip.length === 5) {
  9203. var position = vNode.getComputedStylePropertyValue('position');
  9204. if ([ 'fixed', 'absolute' ].includes(position)) {
  9205. return matchesClip[3] - matchesClip[1] <= 0 && matchesClip[2] - matchesClip[4] <= 0;
  9206. }
  9207. }
  9208. if (matchesClipPath) {
  9209. var type2 = matchesClipPath[1];
  9210. var value = parseInt(matchesClipPath[2], 10);
  9211. switch (type2) {
  9212. case 'inset':
  9213. return value >= 50;
  9214. case 'circle':
  9215. return value === 0;
  9216. default:
  9217. }
  9218. }
  9219. return false;
  9220. }
  9221. function areaHidden(vNode, visibleFunction) {
  9222. var mapEl = closest_default(vNode, 'map');
  9223. if (!mapEl) {
  9224. return true;
  9225. }
  9226. var mapElName = mapEl.attr('name');
  9227. if (!mapElName) {
  9228. return true;
  9229. }
  9230. var mapElRootNode = get_root_node_default(vNode.actualNode);
  9231. if (!mapElRootNode || mapElRootNode.nodeType !== 9) {
  9232. return true;
  9233. }
  9234. var refs = query_selector_all_default(axe._tree, 'img[usemap="#'.concat(escape_selector_default(mapElName), '"]'));
  9235. if (!refs || !refs.length) {
  9236. return true;
  9237. }
  9238. return refs.some(function(ref) {
  9239. return !visibleFunction(ref);
  9240. });
  9241. }
  9242. function detailsHidden(vNode) {
  9243. var _vNode$parent;
  9244. if (((_vNode$parent = vNode.parent) === null || _vNode$parent === void 0 ? void 0 : _vNode$parent.props.nodeName) !== 'details') {
  9245. return false;
  9246. }
  9247. if (vNode.props.nodeName === 'summary') {
  9248. var firstSummary = vNode.parent.children.find(function(node) {
  9249. return node.props.nodeName === 'summary';
  9250. });
  9251. if (firstSummary === vNode) {
  9252. return false;
  9253. }
  9254. }
  9255. return !vNode.parent.hasAttr('open');
  9256. }
  9257. function hasPositionedAncestorBetween(child, ancestor) {
  9258. var node = child.parent;
  9259. while (node && node !== ancestor) {
  9260. if ([ 'relative', 'sticky' ].includes(node.getComputedStylePropertyValue('position'))) {
  9261. return true;
  9262. }
  9263. node = node.parent;
  9264. }
  9265. return false;
  9266. }
  9267. var hiddenMethods = [ displayHidden, visibilityHidden, contentVisibiltyHidden, detailsHidden ];
  9268. function _isHiddenForEveryone(vNode) {
  9269. var _ref14 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, skipAncestors = _ref14.skipAncestors, _ref14$isAncestor = _ref14.isAncestor, isAncestor = _ref14$isAncestor === void 0 ? false : _ref14$isAncestor;
  9270. vNode = _nodeLookup(vNode).vNode;
  9271. if (skipAncestors) {
  9272. return isHiddenSelf(vNode, isAncestor);
  9273. }
  9274. return isHiddenAncestors(vNode, isAncestor);
  9275. }
  9276. var isHiddenSelf = memoize_default(function isHiddenSelfMemoized(vNode, isAncestor) {
  9277. if (nativelyHidden(vNode)) {
  9278. return true;
  9279. }
  9280. if (!vNode.actualNode) {
  9281. return false;
  9282. }
  9283. if (hiddenMethods.some(function(method) {
  9284. return method(vNode, {
  9285. isAncestor: isAncestor
  9286. });
  9287. })) {
  9288. return true;
  9289. }
  9290. if (!vNode.actualNode.isConnected) {
  9291. return true;
  9292. }
  9293. return false;
  9294. });
  9295. var isHiddenAncestors = memoize_default(function isHiddenAncestorsMemoized(vNode, isAncestor) {
  9296. if (isHiddenSelf(vNode, isAncestor)) {
  9297. return true;
  9298. }
  9299. if (!vNode.parent) {
  9300. return false;
  9301. }
  9302. return isHiddenAncestors(vNode.parent, true);
  9303. });
  9304. function getComposedParent(element) {
  9305. if (element.assignedSlot) {
  9306. return getComposedParent(element.assignedSlot);
  9307. } else if (element.parentNode) {
  9308. var parentNode = element.parentNode;
  9309. if (parentNode.nodeType === 1) {
  9310. return parentNode;
  9311. } else if (parentNode.host) {
  9312. return parentNode.host;
  9313. }
  9314. }
  9315. return null;
  9316. }
  9317. var get_composed_parent_default = getComposedParent;
  9318. function getScrollOffset(element) {
  9319. if (!element.nodeType && element.document) {
  9320. element = element.document;
  9321. }
  9322. if (element.nodeType === 9) {
  9323. var docElement = element.documentElement, body = element.body;
  9324. return {
  9325. left: docElement && docElement.scrollLeft || body && body.scrollLeft || 0,
  9326. top: docElement && docElement.scrollTop || body && body.scrollTop || 0
  9327. };
  9328. }
  9329. return {
  9330. left: element.scrollLeft,
  9331. top: element.scrollTop
  9332. };
  9333. }
  9334. var get_scroll_offset_default = getScrollOffset;
  9335. function getElementCoordinates(element) {
  9336. var scrollOffset = get_scroll_offset_default(document), xOffset = scrollOffset.left, yOffset = scrollOffset.top, coords = element.getBoundingClientRect();
  9337. return {
  9338. top: coords.top + yOffset,
  9339. right: coords.right + xOffset,
  9340. bottom: coords.bottom + yOffset,
  9341. left: coords.left + xOffset,
  9342. width: coords.right - coords.left,
  9343. height: coords.bottom - coords.top
  9344. };
  9345. }
  9346. var get_element_coordinates_default = getElementCoordinates;
  9347. function getViewportSize(win) {
  9348. var doc = win.document;
  9349. var docElement = doc.documentElement;
  9350. if (win.innerWidth) {
  9351. return {
  9352. width: win.innerWidth,
  9353. height: win.innerHeight
  9354. };
  9355. }
  9356. if (docElement) {
  9357. return {
  9358. width: docElement.clientWidth,
  9359. height: docElement.clientHeight
  9360. };
  9361. }
  9362. var body = doc.body;
  9363. return {
  9364. width: body.clientWidth,
  9365. height: body.clientHeight
  9366. };
  9367. }
  9368. var get_viewport_size_default = getViewportSize;
  9369. function noParentScrolled(element, offset) {
  9370. element = get_composed_parent_default(element);
  9371. while (element && element.nodeName.toLowerCase() !== 'html') {
  9372. if (element.scrollTop) {
  9373. offset += element.scrollTop;
  9374. if (offset >= 0) {
  9375. return false;
  9376. }
  9377. }
  9378. element = get_composed_parent_default(element);
  9379. }
  9380. return true;
  9381. }
  9382. function isOffscreen(element) {
  9383. var _ref15 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, isAncestor = _ref15.isAncestor;
  9384. if (isAncestor) {
  9385. return false;
  9386. }
  9387. var _nodeLookup2 = _nodeLookup(element), domNode = _nodeLookup2.domNode;
  9388. if (!domNode) {
  9389. return void 0;
  9390. }
  9391. var leftBoundary;
  9392. var docElement = document.documentElement;
  9393. var styl = window.getComputedStyle(domNode);
  9394. var dir = window.getComputedStyle(document.body || docElement).getPropertyValue('direction');
  9395. var coords = get_element_coordinates_default(domNode);
  9396. if (coords.bottom < 0 && (noParentScrolled(domNode, coords.bottom) || styl.position === 'absolute')) {
  9397. return true;
  9398. }
  9399. if (coords.left === 0 && coords.right === 0) {
  9400. return false;
  9401. }
  9402. if (dir === 'ltr') {
  9403. if (coords.right <= 0) {
  9404. return true;
  9405. }
  9406. } else {
  9407. leftBoundary = Math.max(docElement.scrollWidth, get_viewport_size_default(window).width);
  9408. if (coords.left >= leftBoundary) {
  9409. return true;
  9410. }
  9411. }
  9412. return false;
  9413. }
  9414. var is_offscreen_default = isOffscreen;
  9415. var hiddenMethods2 = [ opacityHidden, scrollHidden, overflowHidden, clipHidden, is_offscreen_default ];
  9416. function _isVisibleOnScreen(vNode) {
  9417. vNode = _nodeLookup(vNode).vNode;
  9418. return isVisibleOnScreenVirtual(vNode);
  9419. }
  9420. var isVisibleOnScreenVirtual = memoize_default(function isVisibleOnScreenMemoized(vNode, isAncestor) {
  9421. if (vNode.actualNode && vNode.props.nodeName === 'area') {
  9422. return !areaHidden(vNode, isVisibleOnScreenVirtual);
  9423. }
  9424. if (_isHiddenForEveryone(vNode, {
  9425. skipAncestors: true,
  9426. isAncestor: isAncestor
  9427. })) {
  9428. return false;
  9429. }
  9430. if (vNode.actualNode && hiddenMethods2.some(function(method) {
  9431. return method(vNode, {
  9432. isAncestor: isAncestor
  9433. });
  9434. })) {
  9435. return false;
  9436. }
  9437. if (!vNode.parent) {
  9438. return true;
  9439. }
  9440. return isVisibleOnScreenVirtual(vNode.parent, true);
  9441. });
  9442. function _getBoundingRect(rectA, rectB) {
  9443. var top = Math.min(rectA.top, rectB.top);
  9444. var right = Math.max(rectA.right, rectB.right);
  9445. var bottom = Math.max(rectA.bottom, rectB.bottom);
  9446. var left = Math.min(rectA.left, rectB.left);
  9447. return new window.DOMRect(left, top, right - left, bottom - top);
  9448. }
  9449. function _isPointInRect(_ref16, _ref17) {
  9450. var x = _ref16.x, y = _ref16.y;
  9451. var top = _ref17.top, right = _ref17.right, bottom = _ref17.bottom, left = _ref17.left;
  9452. return y >= top && x <= right && y <= bottom && x >= left;
  9453. }
  9454. var math_exports = {};
  9455. __export(math_exports, {
  9456. getBoundingRect: function getBoundingRect() {
  9457. return _getBoundingRect;
  9458. },
  9459. getIntersectionRect: function getIntersectionRect() {
  9460. return _getIntersectionRect;
  9461. },
  9462. getOffset: function getOffset() {
  9463. return _getOffset;
  9464. },
  9465. getRectCenter: function getRectCenter() {
  9466. return _getRectCenter;
  9467. },
  9468. hasVisualOverlap: function hasVisualOverlap() {
  9469. return _hasVisualOverlap;
  9470. },
  9471. isPointInRect: function isPointInRect() {
  9472. return _isPointInRect;
  9473. },
  9474. rectHasMinimumSize: function rectHasMinimumSize() {
  9475. return _rectHasMinimumSize;
  9476. },
  9477. rectsOverlap: function rectsOverlap() {
  9478. return _rectsOverlap;
  9479. },
  9480. splitRects: function splitRects() {
  9481. return _splitRects;
  9482. }
  9483. });
  9484. function _getIntersectionRect(rect1, rect2) {
  9485. var leftX = Math.max(rect1.left, rect2.left);
  9486. var rightX = Math.min(rect1.right, rect2.right);
  9487. var topY = Math.max(rect1.top, rect2.top);
  9488. var bottomY = Math.min(rect1.bottom, rect2.bottom);
  9489. if (leftX >= rightX || topY >= bottomY) {
  9490. return null;
  9491. }
  9492. return new window.DOMRect(leftX, topY, rightX - leftX, bottomY - topY);
  9493. }
  9494. function _getRectCenter(_ref18) {
  9495. var left = _ref18.left, top = _ref18.top, width = _ref18.width, height = _ref18.height;
  9496. return new window.DOMPoint(left + width / 2, top + height / 2);
  9497. }
  9498. var roundingMargin = .05;
  9499. function _rectHasMinimumSize(minSize, _ref19) {
  9500. var width = _ref19.width, height = _ref19.height;
  9501. return width + roundingMargin >= minSize && height + roundingMargin >= minSize;
  9502. }
  9503. function _getOffset(vTarget, vNeighbor) {
  9504. var minRadiusNeighbour = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 12;
  9505. var targetRects = get_target_rects_default(vTarget);
  9506. var neighborRects = get_target_rects_default(vNeighbor);
  9507. if (!targetRects.length || !neighborRects.length) {
  9508. return null;
  9509. }
  9510. var targetBoundingBox = targetRects.reduce(_getBoundingRect);
  9511. var targetCenter = _getRectCenter(targetBoundingBox);
  9512. var minDistance = Infinity;
  9513. var _iterator2 = _createForOfIteratorHelper(neighborRects), _step2;
  9514. try {
  9515. for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
  9516. var rect = _step2.value;
  9517. if (_isPointInRect(targetCenter, rect)) {
  9518. return 0;
  9519. }
  9520. var closestPoint = getClosestPoint(targetCenter, rect);
  9521. var distance2 = pointDistance(targetCenter, closestPoint);
  9522. minDistance = Math.min(minDistance, distance2);
  9523. }
  9524. } catch (err) {
  9525. _iterator2.e(err);
  9526. } finally {
  9527. _iterator2.f();
  9528. }
  9529. var neighborTargetSize = get_target_size_default(vNeighbor);
  9530. if (_rectHasMinimumSize(minRadiusNeighbour * 2, neighborTargetSize)) {
  9531. return minDistance;
  9532. }
  9533. var neighborBoundingBox = neighborRects.reduce(_getBoundingRect);
  9534. var neighborCenter = _getRectCenter(neighborBoundingBox);
  9535. var centerDistance = pointDistance(targetCenter, neighborCenter) - minRadiusNeighbour;
  9536. return Math.max(0, Math.min(minDistance, centerDistance));
  9537. }
  9538. function getClosestPoint(point, rect) {
  9539. var x;
  9540. var y;
  9541. if (point.x < rect.left) {
  9542. x = rect.left;
  9543. } else if (point.x > rect.right) {
  9544. x = rect.right;
  9545. } else {
  9546. x = point.x;
  9547. }
  9548. if (point.y < rect.top) {
  9549. y = rect.top;
  9550. } else if (point.y > rect.bottom) {
  9551. y = rect.bottom;
  9552. } else {
  9553. y = point.y;
  9554. }
  9555. return {
  9556. x: x,
  9557. y: y
  9558. };
  9559. }
  9560. function pointDistance(pointA, pointB) {
  9561. return Math.hypot(pointA.x - pointB.x, pointA.y - pointB.y);
  9562. }
  9563. function _hasVisualOverlap(vNodeA, vNodeB) {
  9564. var rectA = vNodeA.boundingClientRect;
  9565. var rectB = vNodeB.boundingClientRect;
  9566. if (rectA.left >= rectB.right || rectA.right <= rectB.left || rectA.top >= rectB.bottom || rectA.bottom <= rectB.top) {
  9567. return false;
  9568. }
  9569. return _visuallySort(vNodeA, vNodeB) > 0;
  9570. }
  9571. function _splitRects(outerRect, overlapRects) {
  9572. var uniqueRects = [ outerRect ];
  9573. var _iterator3 = _createForOfIteratorHelper(overlapRects), _step3;
  9574. try {
  9575. var _loop3 = function _loop3() {
  9576. var overlapRect = _step3.value;
  9577. uniqueRects = uniqueRects.reduce(function(rects, inputRect) {
  9578. return rects.concat(splitRect(inputRect, overlapRect));
  9579. }, []);
  9580. if (uniqueRects.length > 4e3) {
  9581. throw new Error('splitRects: Too many rects');
  9582. }
  9583. };
  9584. for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
  9585. _loop3();
  9586. }
  9587. } catch (err) {
  9588. _iterator3.e(err);
  9589. } finally {
  9590. _iterator3.f();
  9591. }
  9592. return uniqueRects;
  9593. }
  9594. function splitRect(inputRect, clipRect) {
  9595. var top = inputRect.top, left = inputRect.left, bottom = inputRect.bottom, right = inputRect.right;
  9596. var yAligned = top < clipRect.bottom && bottom > clipRect.top;
  9597. var xAligned = left < clipRect.right && right > clipRect.left;
  9598. var rects = [];
  9599. if (between(clipRect.top, top, bottom) && xAligned) {
  9600. rects.push({
  9601. top: top,
  9602. left: left,
  9603. bottom: clipRect.top,
  9604. right: right
  9605. });
  9606. }
  9607. if (between(clipRect.right, left, right) && yAligned) {
  9608. rects.push({
  9609. top: top,
  9610. left: clipRect.right,
  9611. bottom: bottom,
  9612. right: right
  9613. });
  9614. }
  9615. if (between(clipRect.bottom, top, bottom) && xAligned) {
  9616. rects.push({
  9617. top: clipRect.bottom,
  9618. right: right,
  9619. bottom: bottom,
  9620. left: left
  9621. });
  9622. }
  9623. if (between(clipRect.left, left, right) && yAligned) {
  9624. rects.push({
  9625. top: top,
  9626. left: left,
  9627. bottom: bottom,
  9628. right: clipRect.left
  9629. });
  9630. }
  9631. if (rects.length === 0) {
  9632. if (isEnclosedRect(inputRect, clipRect)) {
  9633. return [];
  9634. }
  9635. rects.push(inputRect);
  9636. }
  9637. return rects.map(computeRect);
  9638. }
  9639. var between = function between(num, min, max2) {
  9640. return num > min && num < max2;
  9641. };
  9642. function computeRect(baseRect) {
  9643. return new window.DOMRect(baseRect.left, baseRect.top, baseRect.right - baseRect.left, baseRect.bottom - baseRect.top);
  9644. }
  9645. function isEnclosedRect(rectA, rectB) {
  9646. return rectA.top >= rectB.top && rectA.left >= rectB.left && rectA.bottom <= rectB.bottom && rectA.right <= rectB.right;
  9647. }
  9648. var ROOT_LEVEL = 0;
  9649. var DEFAULT_LEVEL = .1;
  9650. var FLOAT_LEVEL = .2;
  9651. var POSITION_LEVEL = .3;
  9652. var nodeIndex = 0;
  9653. function _createGrid() {
  9654. var root = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.body;
  9655. var rootGrid = arguments.length > 1 ? arguments[1] : undefined;
  9656. var parentVNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  9657. if (cache_default.get('gridCreated') && !parentVNode) {
  9658. return constants_default.gridSize;
  9659. }
  9660. cache_default.set('gridCreated', true);
  9661. if (!parentVNode) {
  9662. var _rootGrid;
  9663. var vNode = get_node_from_tree_default(document.documentElement);
  9664. if (!vNode) {
  9665. vNode = new virtual_node_default(document.documentElement);
  9666. }
  9667. nodeIndex = 0;
  9668. vNode._stackingOrder = [ createStackingContext(ROOT_LEVEL, nodeIndex++, null) ];
  9669. (_rootGrid = rootGrid) !== null && _rootGrid !== void 0 ? _rootGrid : rootGrid = new Grid();
  9670. addNodeToGrid(rootGrid, vNode);
  9671. if (get_scroll_default(vNode.actualNode)) {
  9672. var subGrid = new Grid(vNode);
  9673. vNode._subGrid = subGrid;
  9674. }
  9675. }
  9676. var treeWalker = document.createTreeWalker(root, window.NodeFilter.SHOW_ELEMENT, null, false);
  9677. var node = parentVNode ? treeWalker.nextNode() : treeWalker.currentNode;
  9678. while (node) {
  9679. var _vNode = get_node_from_tree_default(node);
  9680. if (_vNode && _vNode.parent) {
  9681. parentVNode = _vNode.parent;
  9682. } else if (node.assignedSlot) {
  9683. parentVNode = get_node_from_tree_default(node.assignedSlot);
  9684. } else if (node.parentElement) {
  9685. parentVNode = get_node_from_tree_default(node.parentElement);
  9686. } else if (node.parentNode && get_node_from_tree_default(node.parentNode)) {
  9687. parentVNode = get_node_from_tree_default(node.parentNode);
  9688. }
  9689. if (!_vNode) {
  9690. _vNode = new axe.VirtualNode(node, parentVNode);
  9691. }
  9692. _vNode._stackingOrder = createStackingOrder(_vNode, parentVNode, nodeIndex++);
  9693. var scrollRegionParent = findScrollRegionParent(_vNode, parentVNode);
  9694. var grid = scrollRegionParent ? scrollRegionParent._subGrid : rootGrid;
  9695. if (get_scroll_default(_vNode.actualNode)) {
  9696. var _subGrid = new Grid(_vNode);
  9697. _vNode._subGrid = _subGrid;
  9698. }
  9699. var rect = _vNode.boundingClientRect;
  9700. if (rect.width !== 0 && rect.height !== 0 && _isVisibleOnScreen(node)) {
  9701. addNodeToGrid(grid, _vNode);
  9702. }
  9703. if (is_shadow_root_default(node)) {
  9704. _createGrid(node.shadowRoot, grid, _vNode);
  9705. }
  9706. node = treeWalker.nextNode();
  9707. }
  9708. return constants_default.gridSize;
  9709. }
  9710. function isStackingContext(vNode, parentVNode) {
  9711. var position = vNode.getComputedStylePropertyValue('position');
  9712. var zIndex = vNode.getComputedStylePropertyValue('z-index');
  9713. if (position === 'fixed' || position === 'sticky') {
  9714. return true;
  9715. }
  9716. if (zIndex !== 'auto' && position !== 'static') {
  9717. return true;
  9718. }
  9719. if (vNode.getComputedStylePropertyValue('opacity') !== '1') {
  9720. return true;
  9721. }
  9722. var transform = vNode.getComputedStylePropertyValue('-webkit-transform') || vNode.getComputedStylePropertyValue('-ms-transform') || vNode.getComputedStylePropertyValue('transform') || 'none';
  9723. if (transform !== 'none') {
  9724. return true;
  9725. }
  9726. var mixBlendMode = vNode.getComputedStylePropertyValue('mix-blend-mode');
  9727. if (mixBlendMode && mixBlendMode !== 'normal') {
  9728. return true;
  9729. }
  9730. var filter = vNode.getComputedStylePropertyValue('filter');
  9731. if (filter && filter !== 'none') {
  9732. return true;
  9733. }
  9734. var perspective = vNode.getComputedStylePropertyValue('perspective');
  9735. if (perspective && perspective !== 'none') {
  9736. return true;
  9737. }
  9738. var clipPath = vNode.getComputedStylePropertyValue('clip-path');
  9739. if (clipPath && clipPath !== 'none') {
  9740. return true;
  9741. }
  9742. var mask = vNode.getComputedStylePropertyValue('-webkit-mask') || vNode.getComputedStylePropertyValue('mask') || 'none';
  9743. if (mask !== 'none') {
  9744. return true;
  9745. }
  9746. var maskImage = vNode.getComputedStylePropertyValue('-webkit-mask-image') || vNode.getComputedStylePropertyValue('mask-image') || 'none';
  9747. if (maskImage !== 'none') {
  9748. return true;
  9749. }
  9750. var maskBorder = vNode.getComputedStylePropertyValue('-webkit-mask-border') || vNode.getComputedStylePropertyValue('mask-border') || 'none';
  9751. if (maskBorder !== 'none') {
  9752. return true;
  9753. }
  9754. if (vNode.getComputedStylePropertyValue('isolation') === 'isolate') {
  9755. return true;
  9756. }
  9757. var willChange = vNode.getComputedStylePropertyValue('will-change');
  9758. if (willChange === 'transform' || willChange === 'opacity') {
  9759. return true;
  9760. }
  9761. if (vNode.getComputedStylePropertyValue('-webkit-overflow-scrolling') === 'touch') {
  9762. return true;
  9763. }
  9764. var contain = vNode.getComputedStylePropertyValue('contain');
  9765. if ([ 'layout', 'paint', 'strict', 'content' ].includes(contain)) {
  9766. return true;
  9767. }
  9768. if (zIndex !== 'auto' && isFlexOrGridContainer(parentVNode)) {
  9769. return true;
  9770. }
  9771. return false;
  9772. }
  9773. function isFlexOrGridContainer(vNode) {
  9774. if (!vNode) {
  9775. return false;
  9776. }
  9777. var display2 = vNode.getComputedStylePropertyValue('display');
  9778. return [ 'flex', 'inline-flex', 'grid', 'inline-grid' ].includes(display2);
  9779. }
  9780. function createStackingOrder(vNode, parentVNode, treeOrder) {
  9781. var stackingOrder = parentVNode._stackingOrder.slice();
  9782. if (isStackingContext(vNode, parentVNode)) {
  9783. var index = stackingOrder.findIndex(function(_ref20) {
  9784. var stackLevel2 = _ref20.stackLevel;
  9785. return [ ROOT_LEVEL, FLOAT_LEVEL, POSITION_LEVEL ].includes(stackLevel2);
  9786. });
  9787. if (index !== -1) {
  9788. stackingOrder.splice(index, stackingOrder.length - index);
  9789. }
  9790. }
  9791. var stackLevel = getStackLevel(vNode, parentVNode);
  9792. if (stackLevel !== null) {
  9793. stackingOrder.push(createStackingContext(stackLevel, treeOrder, vNode));
  9794. }
  9795. return stackingOrder;
  9796. }
  9797. function createStackingContext(stackLevel, treeOrder, vNode) {
  9798. return {
  9799. stackLevel: stackLevel,
  9800. treeOrder: treeOrder,
  9801. vNode: vNode
  9802. };
  9803. }
  9804. function getStackLevel(vNode, parentVNode) {
  9805. var zIndex = getRealZIndex(vNode, parentVNode);
  9806. if (![ 'auto', '0' ].includes(zIndex)) {
  9807. return parseInt(zIndex);
  9808. }
  9809. if (vNode.getComputedStylePropertyValue('position') !== 'static') {
  9810. return POSITION_LEVEL;
  9811. }
  9812. if (vNode.getComputedStylePropertyValue('float') !== 'none') {
  9813. return FLOAT_LEVEL;
  9814. }
  9815. if (isStackingContext(vNode, parentVNode)) {
  9816. return DEFAULT_LEVEL;
  9817. }
  9818. return null;
  9819. }
  9820. function getRealZIndex(vNode, parentVNode) {
  9821. var position = vNode.getComputedStylePropertyValue('position');
  9822. if (position === 'static' && !isFlexOrGridContainer(parentVNode)) {
  9823. return 'auto';
  9824. }
  9825. return vNode.getComputedStylePropertyValue('z-index');
  9826. }
  9827. function findScrollRegionParent(vNode, parentVNode) {
  9828. var scrollRegionParent = null;
  9829. var checkedNodes = [ vNode ];
  9830. while (parentVNode) {
  9831. if (get_scroll_default(parentVNode.actualNode)) {
  9832. scrollRegionParent = parentVNode;
  9833. break;
  9834. }
  9835. if (parentVNode._scrollRegionParent) {
  9836. scrollRegionParent = parentVNode._scrollRegionParent;
  9837. break;
  9838. }
  9839. checkedNodes.push(parentVNode);
  9840. parentVNode = get_node_from_tree_default(parentVNode.actualNode.parentElement || parentVNode.actualNode.parentNode);
  9841. }
  9842. checkedNodes.forEach(function(virtualNode) {
  9843. return virtualNode._scrollRegionParent = scrollRegionParent;
  9844. });
  9845. return scrollRegionParent;
  9846. }
  9847. function addNodeToGrid(grid, vNode) {
  9848. var overflowHiddenNodes = get_overflow_hidden_ancestors_default(vNode);
  9849. vNode.clientRects.forEach(function(clientRect) {
  9850. var _vNode$_grid;
  9851. var visibleRect = overflowHiddenNodes.reduce(function(rect, overflowNode) {
  9852. return rect && _getIntersectionRect(rect, overflowNode.boundingClientRect);
  9853. }, clientRect);
  9854. if (!visibleRect) {
  9855. return;
  9856. }
  9857. (_vNode$_grid = vNode._grid) !== null && _vNode$_grid !== void 0 ? _vNode$_grid : vNode._grid = grid;
  9858. var gridRect = grid.getGridPositionOfRect(visibleRect);
  9859. grid.loopGridPosition(gridRect, function(gridCell) {
  9860. if (!gridCell.includes(vNode)) {
  9861. gridCell.push(vNode);
  9862. }
  9863. });
  9864. });
  9865. }
  9866. var Grid = function() {
  9867. function Grid() {
  9868. var container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  9869. _classCallCheck(this, Grid);
  9870. this.container = container;
  9871. this.cells = [];
  9872. }
  9873. return _createClass(Grid, [ {
  9874. key: 'toGridIndex',
  9875. value: function toGridIndex(num) {
  9876. return Math.floor(num / constants_default.gridSize);
  9877. }
  9878. }, {
  9879. key: 'getCellFromPoint',
  9880. value: function getCellFromPoint(_ref21) {
  9881. var _this$cells, _row;
  9882. var x = _ref21.x, y = _ref21.y;
  9883. assert_default(this.boundaries, 'Grid does not have cells added');
  9884. var rowIndex = this.toGridIndex(y);
  9885. var colIndex = this.toGridIndex(x);
  9886. assert_default(_isPointInRect({
  9887. y: rowIndex,
  9888. x: colIndex
  9889. }, this.boundaries), 'Element midpoint exceeds the grid bounds');
  9890. var row = (_this$cells = this.cells[rowIndex - this.cells._negativeIndex]) !== null && _this$cells !== void 0 ? _this$cells : [];
  9891. return (_row = row[colIndex - row._negativeIndex]) !== null && _row !== void 0 ? _row : [];
  9892. }
  9893. }, {
  9894. key: 'loopGridPosition',
  9895. value: function loopGridPosition(gridPosition, callback) {
  9896. var _gridPosition = gridPosition, left = _gridPosition.left, right = _gridPosition.right, top = _gridPosition.top, bottom = _gridPosition.bottom;
  9897. if (this.boundaries) {
  9898. gridPosition = _getBoundingRect(this.boundaries, gridPosition);
  9899. }
  9900. this.boundaries = gridPosition;
  9901. loopNegativeIndexMatrix(this.cells, top, bottom, function(gridRow, row) {
  9902. loopNegativeIndexMatrix(gridRow, left, right, function(gridCell, col) {
  9903. callback(gridCell, {
  9904. row: row,
  9905. col: col
  9906. });
  9907. });
  9908. });
  9909. }
  9910. }, {
  9911. key: 'getGridPositionOfRect',
  9912. value: function getGridPositionOfRect(_ref22) {
  9913. var top = _ref22.top, right = _ref22.right, bottom = _ref22.bottom, left = _ref22.left;
  9914. var margin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  9915. top = this.toGridIndex(top - margin);
  9916. right = this.toGridIndex(right + margin - 1);
  9917. bottom = this.toGridIndex(bottom + margin - 1);
  9918. left = this.toGridIndex(left - margin);
  9919. return new window.DOMRect(left, top, right - left, bottom - top);
  9920. }
  9921. } ]);
  9922. }();
  9923. function loopNegativeIndexMatrix(matrix, start, end, callback) {
  9924. var _matrix$_negativeInde;
  9925. (_matrix$_negativeInde = matrix._negativeIndex) !== null && _matrix$_negativeInde !== void 0 ? _matrix$_negativeInde : matrix._negativeIndex = 0;
  9926. if (start < matrix._negativeIndex) {
  9927. for (var _i6 = 0; _i6 < matrix._negativeIndex - start; _i6++) {
  9928. matrix.splice(0, 0, []);
  9929. }
  9930. matrix._negativeIndex = start;
  9931. }
  9932. var startOffset = start - matrix._negativeIndex;
  9933. var endOffset = end - matrix._negativeIndex;
  9934. for (var index = startOffset; index <= endOffset; index++) {
  9935. var _index, _matrix$_index;
  9936. (_matrix$_index = matrix[_index = index]) !== null && _matrix$_index !== void 0 ? _matrix$_index : matrix[_index] = [];
  9937. callback(matrix[index], index + matrix._negativeIndex);
  9938. }
  9939. }
  9940. function _findNearbyElms(vNode) {
  9941. var _vNode$_grid2;
  9942. var margin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  9943. _createGrid();
  9944. if (!((_vNode$_grid2 = vNode._grid) !== null && _vNode$_grid2 !== void 0 && (_vNode$_grid2 = _vNode$_grid2.cells) !== null && _vNode$_grid2 !== void 0 && _vNode$_grid2.length)) {
  9945. return [];
  9946. }
  9947. var rect = vNode.boundingClientRect;
  9948. var grid = vNode._grid;
  9949. var selfIsFixed = hasFixedPosition(vNode);
  9950. var gridPosition = grid.getGridPositionOfRect(rect, margin);
  9951. var neighbors = [];
  9952. grid.loopGridPosition(gridPosition, function(vNeighbors) {
  9953. var _iterator4 = _createForOfIteratorHelper(vNeighbors), _step4;
  9954. try {
  9955. for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) {
  9956. var vNeighbor = _step4.value;
  9957. if (vNeighbor && vNeighbor !== vNode && !neighbors.includes(vNeighbor) && selfIsFixed === hasFixedPosition(vNeighbor)) {
  9958. neighbors.push(vNeighbor);
  9959. }
  9960. }
  9961. } catch (err) {
  9962. _iterator4.e(err);
  9963. } finally {
  9964. _iterator4.f();
  9965. }
  9966. });
  9967. return neighbors;
  9968. }
  9969. var hasFixedPosition = memoize_default(function(vNode) {
  9970. if (!vNode) {
  9971. return false;
  9972. }
  9973. if (vNode.getComputedStylePropertyValue('position') === 'fixed') {
  9974. return true;
  9975. }
  9976. return hasFixedPosition(vNode.parent);
  9977. });
  9978. var getModalDialog = memoize_default(function getModalDialogMemoized() {
  9979. var _dialogs$find;
  9980. if (!axe._tree) {
  9981. return null;
  9982. }
  9983. var dialogs = query_selector_all_filter_default(axe._tree[0], 'dialog[open]', function(vNode) {
  9984. var rect = vNode.boundingClientRect;
  9985. var stack = document.elementsFromPoint(rect.left + 1, rect.top + 1);
  9986. return stack.includes(vNode.actualNode) && _isVisibleOnScreen(vNode);
  9987. });
  9988. if (!dialogs.length) {
  9989. return null;
  9990. }
  9991. var modalDialog = dialogs.find(function(dialog) {
  9992. var rect = dialog.boundingClientRect;
  9993. var stack = document.elementsFromPoint(rect.left - 10, rect.top - 10);
  9994. return stack.includes(dialog.actualNode);
  9995. });
  9996. if (modalDialog) {
  9997. return modalDialog;
  9998. }
  9999. return (_dialogs$find = dialogs.find(function(dialog) {
  10000. var _getNodeFromGrid;
  10001. var _ref23 = (_getNodeFromGrid = getNodeFromGrid(dialog)) !== null && _getNodeFromGrid !== void 0 ? _getNodeFromGrid : {}, vNode = _ref23.vNode, rect = _ref23.rect;
  10002. if (!vNode) {
  10003. return false;
  10004. }
  10005. var stack = document.elementsFromPoint(rect.left + 1, rect.top + 1);
  10006. return !stack.includes(vNode.actualNode);
  10007. })) !== null && _dialogs$find !== void 0 ? _dialogs$find : null;
  10008. });
  10009. var get_modal_dialog_default = getModalDialog;
  10010. function getNodeFromGrid(dialog) {
  10011. _createGrid();
  10012. var grid = axe._tree[0]._grid;
  10013. var viewRect = new window.DOMRect(0, 0, window.innerWidth, window.innerHeight);
  10014. if (!grid) {
  10015. return;
  10016. }
  10017. for (var row = 0; row < grid.cells.length; row++) {
  10018. var cols = grid.cells[row];
  10019. if (!cols) {
  10020. continue;
  10021. }
  10022. for (var col = 0; col < cols.length; col++) {
  10023. var cells = cols[col];
  10024. if (!cells) {
  10025. continue;
  10026. }
  10027. for (var _i7 = 0; _i7 < cells.length; _i7++) {
  10028. var vNode = cells[_i7];
  10029. var rect = vNode.boundingClientRect;
  10030. var intersection = _getIntersectionRect(rect, viewRect);
  10031. if (vNode.props.nodeName !== 'html' && vNode !== dialog && vNode.getComputedStylePropertyValue('pointer-events') !== 'none' && intersection) {
  10032. return {
  10033. vNode: vNode,
  10034. rect: intersection
  10035. };
  10036. }
  10037. }
  10038. }
  10039. }
  10040. }
  10041. function _isInert(vNode) {
  10042. var _ref24 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, skipAncestors = _ref24.skipAncestors, isAncestor = _ref24.isAncestor;
  10043. if (skipAncestors) {
  10044. return isInertSelf(vNode, isAncestor);
  10045. }
  10046. return isInertAncestors(vNode, isAncestor);
  10047. }
  10048. var isInertSelf = memoize_default(function isInertSelfMemoized(vNode, isAncestor) {
  10049. if (vNode.hasAttr('inert')) {
  10050. return true;
  10051. }
  10052. if (!isAncestor && vNode.actualNode) {
  10053. var modalDialog = get_modal_dialog_default();
  10054. if (modalDialog && !_contains(modalDialog, vNode)) {
  10055. return true;
  10056. }
  10057. }
  10058. return false;
  10059. });
  10060. var isInertAncestors = memoize_default(function isInertAncestorsMemoized(vNode, isAncestor) {
  10061. if (isInertSelf(vNode, isAncestor)) {
  10062. return true;
  10063. }
  10064. if (!vNode.parent) {
  10065. return false;
  10066. }
  10067. return isInertAncestors(vNode.parent, true);
  10068. });
  10069. var allowedDisabledNodeNames = [ 'button', 'command', 'fieldset', 'keygen', 'optgroup', 'option', 'select', 'textarea', 'input' ];
  10070. function isDisabledAttrAllowed(nodeName2) {
  10071. return allowedDisabledNodeNames.includes(nodeName2);
  10072. }
  10073. function focusDisabled(el) {
  10074. var _nodeLookup3 = _nodeLookup(el), vNode = _nodeLookup3.vNode;
  10075. if (isDisabledAttrAllowed(vNode.props.nodeName) && vNode.hasAttr('disabled') || _isInert(vNode)) {
  10076. return true;
  10077. }
  10078. var parentNode = vNode.parent;
  10079. var ancestors = [];
  10080. var fieldsetDisabled = false;
  10081. while (parentNode && parentNode.shadowId === vNode.shadowId && !fieldsetDisabled) {
  10082. ancestors.push(parentNode);
  10083. if (parentNode.props.nodeName === 'legend') {
  10084. break;
  10085. }
  10086. if (parentNode._inDisabledFieldset !== void 0) {
  10087. fieldsetDisabled = parentNode._inDisabledFieldset;
  10088. break;
  10089. }
  10090. if (parentNode.props.nodeName === 'fieldset' && parentNode.hasAttr('disabled')) {
  10091. fieldsetDisabled = true;
  10092. }
  10093. parentNode = parentNode.parent;
  10094. }
  10095. ancestors.forEach(function(ancestor) {
  10096. return ancestor._inDisabledFieldset = fieldsetDisabled;
  10097. });
  10098. if (fieldsetDisabled) {
  10099. return true;
  10100. }
  10101. if (vNode.props.nodeName !== 'area') {
  10102. if (!vNode.actualNode) {
  10103. return false;
  10104. }
  10105. return _isHiddenForEveryone(vNode);
  10106. }
  10107. return false;
  10108. }
  10109. var focus_disabled_default = focusDisabled;
  10110. var angularSkipLinkRegex = /^\/\#/;
  10111. var angularRouterLinkRegex = /^#[!/]/;
  10112. function _isCurrentPageLink(anchor) {
  10113. var _window$location;
  10114. var href = anchor.getAttribute('href');
  10115. if (!href || href === '#') {
  10116. return false;
  10117. }
  10118. if (angularSkipLinkRegex.test(href)) {
  10119. return true;
  10120. }
  10121. var hash = anchor.hash, protocol = anchor.protocol, hostname = anchor.hostname, port = anchor.port, pathname = anchor.pathname;
  10122. if (angularRouterLinkRegex.test(hash)) {
  10123. return false;
  10124. }
  10125. if (href.charAt(0) === '#') {
  10126. return true;
  10127. }
  10128. if (typeof ((_window$location = window.location) === null || _window$location === void 0 ? void 0 : _window$location.origin) !== 'string' || window.location.origin.indexOf('://') === -1) {
  10129. return null;
  10130. }
  10131. var currentPageUrl = window.location.origin + window.location.pathname;
  10132. var url;
  10133. if (!hostname) {
  10134. url = window.location.origin;
  10135. } else {
  10136. url = ''.concat(protocol, '//').concat(hostname).concat(port ? ':'.concat(port) : '');
  10137. }
  10138. if (!pathname) {
  10139. url += window.location.pathname;
  10140. } else {
  10141. url += (pathname[0] !== '/' ? '/' : '') + pathname;
  10142. }
  10143. return url === currentPageUrl;
  10144. }
  10145. function getElementByReference(node, attr) {
  10146. var fragment = node.getAttribute(attr);
  10147. if (!fragment) {
  10148. return null;
  10149. }
  10150. if (attr === 'href' && !_isCurrentPageLink(node)) {
  10151. return null;
  10152. }
  10153. if (fragment.indexOf('#') !== -1) {
  10154. fragment = decodeURIComponent(fragment.substr(fragment.indexOf('#') + 1));
  10155. }
  10156. var candidate = document.getElementById(fragment);
  10157. if (candidate) {
  10158. return candidate;
  10159. }
  10160. candidate = document.getElementsByName(fragment);
  10161. if (candidate.length) {
  10162. return candidate[0];
  10163. }
  10164. return null;
  10165. }
  10166. var get_element_by_reference_default = getElementByReference;
  10167. function _visuallySort(a2, b2) {
  10168. _createGrid();
  10169. var length = Math.max(a2._stackingOrder.length, b2._stackingOrder.length);
  10170. for (var _i8 = 0; _i8 < length; _i8++) {
  10171. if (typeof b2._stackingOrder[_i8] === 'undefined') {
  10172. return -1;
  10173. } else if (typeof a2._stackingOrder[_i8] === 'undefined') {
  10174. return 1;
  10175. }
  10176. if (b2._stackingOrder[_i8].stackLevel > a2._stackingOrder[_i8].stackLevel) {
  10177. return 1;
  10178. }
  10179. if (b2._stackingOrder[_i8].stackLevel < a2._stackingOrder[_i8].stackLevel) {
  10180. return -1;
  10181. }
  10182. if (b2._stackingOrder[_i8].treeOrder !== a2._stackingOrder[_i8].treeOrder) {
  10183. return b2._stackingOrder[_i8].treeOrder - a2._stackingOrder[_i8].treeOrder;
  10184. }
  10185. }
  10186. var aNode = a2.actualNode;
  10187. var bNode = b2.actualNode;
  10188. if (aNode.getRootNode && aNode.getRootNode() !== bNode.getRootNode()) {
  10189. var boundaries = [];
  10190. while (aNode) {
  10191. boundaries.push({
  10192. root: aNode.getRootNode(),
  10193. node: aNode
  10194. });
  10195. aNode = aNode.getRootNode().host;
  10196. }
  10197. while (bNode && !boundaries.find(function(boundary) {
  10198. return boundary.root === bNode.getRootNode();
  10199. })) {
  10200. bNode = bNode.getRootNode().host;
  10201. }
  10202. aNode = boundaries.find(function(boundary) {
  10203. return boundary.root === bNode.getRootNode();
  10204. }).node;
  10205. if (aNode === bNode) {
  10206. return a2.actualNode.getRootNode() !== aNode.getRootNode() ? -1 : 1;
  10207. }
  10208. }
  10209. var _window$Node = window.Node, DOCUMENT_POSITION_FOLLOWING = _window$Node.DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_CONTAINS = _window$Node.DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_CONTAINED_BY = _window$Node.DOCUMENT_POSITION_CONTAINED_BY;
  10210. var docPosition = aNode.compareDocumentPosition(bNode);
  10211. var DOMOrder = docPosition & DOCUMENT_POSITION_FOLLOWING ? 1 : -1;
  10212. var isDescendant = docPosition & DOCUMENT_POSITION_CONTAINS || docPosition & DOCUMENT_POSITION_CONTAINED_BY;
  10213. var aPosition = getPositionOrder(a2);
  10214. var bPosition = getPositionOrder(b2);
  10215. if (aPosition === bPosition || isDescendant) {
  10216. return DOMOrder;
  10217. }
  10218. return bPosition - aPosition;
  10219. }
  10220. function getPositionOrder(vNode) {
  10221. if (vNode.getComputedStylePropertyValue('display').indexOf('inline') !== -1) {
  10222. return 2;
  10223. }
  10224. if (isFloated(vNode)) {
  10225. return 1;
  10226. }
  10227. return 0;
  10228. }
  10229. function isFloated(vNode) {
  10230. if (!vNode) {
  10231. return false;
  10232. }
  10233. if (vNode._isFloated !== void 0) {
  10234. return vNode._isFloated;
  10235. }
  10236. var floatStyle = vNode.getComputedStylePropertyValue('float');
  10237. if (floatStyle !== 'none') {
  10238. vNode._isFloated = true;
  10239. return true;
  10240. }
  10241. var floated = isFloated(vNode.parent);
  10242. vNode._isFloated = floated;
  10243. return floated;
  10244. }
  10245. function getRectStack(grid, rect) {
  10246. var recursed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  10247. var center = _getRectCenter(rect);
  10248. var gridCell = grid.getCellFromPoint(center) || [];
  10249. var floorX = Math.floor(center.x);
  10250. var floorY = Math.floor(center.y);
  10251. var stack = gridCell.filter(function(gridCellNode) {
  10252. return gridCellNode.clientRects.some(function(clientRect) {
  10253. var rectX = clientRect.left;
  10254. var rectY = clientRect.top;
  10255. return floorX < Math.floor(rectX + clientRect.width) && floorX >= Math.floor(rectX) && floorY < Math.floor(rectY + clientRect.height) && floorY >= Math.floor(rectY);
  10256. });
  10257. });
  10258. var gridContainer = grid.container;
  10259. if (gridContainer) {
  10260. stack = getRectStack(gridContainer._grid, gridContainer.boundingClientRect, true).concat(stack);
  10261. }
  10262. if (!recursed) {
  10263. stack = stack.sort(_visuallySort).map(function(vNode) {
  10264. return vNode.actualNode;
  10265. }).concat(document.documentElement).filter(function(node, index, array) {
  10266. return array.indexOf(node) === index;
  10267. });
  10268. }
  10269. return stack;
  10270. }
  10271. function getElementStack(node) {
  10272. _createGrid();
  10273. var vNode = get_node_from_tree_default(node);
  10274. var grid = vNode._grid;
  10275. if (!grid) {
  10276. return [];
  10277. }
  10278. return getRectStack(grid, vNode.boundingClientRect);
  10279. }
  10280. var get_element_stack_default = getElementStack;
  10281. function getTabbableElements(virtualNode) {
  10282. var nodeAndDescendents = query_selector_all_default(virtualNode, '*');
  10283. var tabbableElements = nodeAndDescendents.filter(function(vNode) {
  10284. var isFocusable2 = vNode.isFocusable;
  10285. var tabIndex = parse_tabindex_default(vNode.actualNode.getAttribute('tabindex'));
  10286. return tabIndex !== null ? isFocusable2 && tabIndex >= 0 : isFocusable2;
  10287. });
  10288. return tabbableElements;
  10289. }
  10290. var get_tabbable_elements_default = getTabbableElements;
  10291. function isNativelyFocusable(el) {
  10292. var _nodeLookup4 = _nodeLookup(el), vNode = _nodeLookup4.vNode;
  10293. if (!vNode || focus_disabled_default(vNode)) {
  10294. return false;
  10295. }
  10296. switch (vNode.props.nodeName) {
  10297. case 'a':
  10298. case 'area':
  10299. if (vNode.hasAttr('href')) {
  10300. return true;
  10301. }
  10302. break;
  10303. case 'input':
  10304. return vNode.props.type !== 'hidden';
  10305. case 'textarea':
  10306. case 'select':
  10307. case 'summary':
  10308. case 'button':
  10309. return true;
  10310. case 'details':
  10311. return !query_selector_all_default(vNode, 'summary').length;
  10312. }
  10313. return false;
  10314. }
  10315. var is_natively_focusable_default = isNativelyFocusable;
  10316. function _isFocusable(el) {
  10317. var _nodeLookup5 = _nodeLookup(el), vNode = _nodeLookup5.vNode;
  10318. if (vNode.props.nodeType !== 1) {
  10319. return false;
  10320. }
  10321. if (focus_disabled_default(vNode)) {
  10322. return false;
  10323. } else if (is_natively_focusable_default(vNode)) {
  10324. return true;
  10325. }
  10326. var tabindex = parse_tabindex_default(vNode.attr('tabindex'));
  10327. return tabindex !== null;
  10328. }
  10329. function _isInTabOrder(el) {
  10330. var _nodeLookup6 = _nodeLookup(el), vNode = _nodeLookup6.vNode;
  10331. if (vNode.props.nodeType !== 1) {
  10332. return false;
  10333. }
  10334. var tabindex = parse_tabindex_default(vNode.attr('tabindex'));
  10335. if (tabindex <= -1) {
  10336. return false;
  10337. }
  10338. return _isFocusable(vNode);
  10339. }
  10340. var get_target_rects_default = memoize_default(getTargetRects);
  10341. function getTargetRects(vNode) {
  10342. var nodeRect = vNode.boundingClientRect;
  10343. var overlappingVNodes = _findNearbyElms(vNode).filter(function(vNeighbor) {
  10344. return _hasVisualOverlap(vNode, vNeighbor) && vNeighbor.getComputedStylePropertyValue('pointer-events') !== 'none' && !isDescendantNotInTabOrder(vNode, vNeighbor);
  10345. });
  10346. if (!overlappingVNodes.length) {
  10347. return [ nodeRect ];
  10348. }
  10349. var obscuringRects = overlappingVNodes.map(function(_ref25) {
  10350. var rect = _ref25.boundingClientRect;
  10351. return rect;
  10352. });
  10353. return _splitRects(nodeRect, obscuringRects);
  10354. }
  10355. function isDescendantNotInTabOrder(vAncestor, vNode) {
  10356. return _contains(vAncestor, vNode) && !_isInTabOrder(vNode);
  10357. }
  10358. var get_target_size_default = memoize_default(getTargetSize);
  10359. function getTargetSize(vNode, minSize) {
  10360. var rects = get_target_rects_default(vNode);
  10361. return getLargestRect(rects, minSize);
  10362. }
  10363. function getLargestRect(rects, minSize) {
  10364. return rects.reduce(function(rectA, rectB) {
  10365. var rectAisMinimum = _rectHasMinimumSize(minSize, rectA);
  10366. var rectBisMinimum = _rectHasMinimumSize(minSize, rectB);
  10367. if (rectAisMinimum !== rectBisMinimum) {
  10368. return rectAisMinimum ? rectA : rectB;
  10369. }
  10370. var areaA = rectA.width * rectA.height;
  10371. var areaB = rectB.width * rectB.height;
  10372. return areaA > areaB ? rectA : rectB;
  10373. });
  10374. }
  10375. var text_exports = {};
  10376. __export(text_exports, {
  10377. accessibleText: function accessibleText() {
  10378. return accessible_text_default;
  10379. },
  10380. accessibleTextVirtual: function accessibleTextVirtual() {
  10381. return _accessibleTextVirtual;
  10382. },
  10383. autocomplete: function autocomplete() {
  10384. return _autocomplete;
  10385. },
  10386. formControlValue: function formControlValue() {
  10387. return form_control_value_default;
  10388. },
  10389. formControlValueMethods: function formControlValueMethods() {
  10390. return _formControlValueMethods;
  10391. },
  10392. hasUnicode: function hasUnicode() {
  10393. return has_unicode_default;
  10394. },
  10395. isHumanInterpretable: function isHumanInterpretable() {
  10396. return is_human_interpretable_default;
  10397. },
  10398. isIconLigature: function isIconLigature() {
  10399. return _isIconLigature;
  10400. },
  10401. isValidAutocomplete: function isValidAutocomplete() {
  10402. return is_valid_autocomplete_default;
  10403. },
  10404. label: function label() {
  10405. return label_default;
  10406. },
  10407. labelText: function labelText() {
  10408. return label_text_default;
  10409. },
  10410. labelVirtual: function labelVirtual() {
  10411. return label_virtual_default2;
  10412. },
  10413. nativeElementType: function nativeElementType() {
  10414. return native_element_type_default;
  10415. },
  10416. nativeTextAlternative: function nativeTextAlternative() {
  10417. return _nativeTextAlternative;
  10418. },
  10419. nativeTextMethods: function nativeTextMethods() {
  10420. return native_text_methods_default;
  10421. },
  10422. removeUnicode: function removeUnicode() {
  10423. return remove_unicode_default;
  10424. },
  10425. sanitize: function sanitize() {
  10426. return sanitize_default;
  10427. },
  10428. subtreeText: function subtreeText() {
  10429. return subtree_text_default;
  10430. },
  10431. titleText: function titleText() {
  10432. return title_text_default;
  10433. },
  10434. unsupported: function unsupported() {
  10435. return unsupported_default;
  10436. },
  10437. visible: function visible() {
  10438. return visible_default;
  10439. },
  10440. visibleTextNodes: function visibleTextNodes() {
  10441. return visible_text_nodes_default;
  10442. },
  10443. visibleVirtual: function visibleVirtual() {
  10444. return visible_virtual_default;
  10445. }
  10446. });
  10447. function idrefs(node, attr) {
  10448. node = node.actualNode || node;
  10449. try {
  10450. var doc = get_root_node_default2(node);
  10451. var result = [];
  10452. var attrValue = node.getAttribute(attr);
  10453. if (attrValue) {
  10454. attrValue = token_list_default(attrValue);
  10455. for (var index = 0; index < attrValue.length; index++) {
  10456. result.push(doc.getElementById(attrValue[index]));
  10457. }
  10458. }
  10459. return result;
  10460. } catch (_unused3) {
  10461. throw new TypeError('Cannot resolve id references for non-DOM nodes');
  10462. }
  10463. }
  10464. var idrefs_default = idrefs;
  10465. function accessibleText(element, context) {
  10466. var virtualNode = get_node_from_tree_default(element);
  10467. return _accessibleTextVirtual(virtualNode, context);
  10468. }
  10469. var accessible_text_default = accessibleText;
  10470. function arialabelledbyText(element) {
  10471. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10472. var _nodeLookup7 = _nodeLookup(element), vNode = _nodeLookup7.vNode;
  10473. if ((vNode === null || vNode === void 0 ? void 0 : vNode.props.nodeType) !== 1) {
  10474. return '';
  10475. }
  10476. if (vNode.props.nodeType !== 1 || context.inLabelledByContext || context.inControlContext || !vNode.attr('aria-labelledby')) {
  10477. return '';
  10478. }
  10479. var refs = idrefs_default(vNode, 'aria-labelledby').filter(function(elm) {
  10480. return elm;
  10481. });
  10482. return refs.reduce(function(accessibleName, elm) {
  10483. var accessibleNameAdd = accessible_text_default(elm, _extends({
  10484. inLabelledByContext: true,
  10485. startNode: context.startNode || vNode
  10486. }, context));
  10487. if (!accessibleName) {
  10488. return accessibleNameAdd;
  10489. } else {
  10490. return ''.concat(accessibleName, ' ').concat(accessibleNameAdd);
  10491. }
  10492. }, '');
  10493. }
  10494. var arialabelledby_text_default = arialabelledbyText;
  10495. function _arialabelText(element) {
  10496. var _nodeLookup8 = _nodeLookup(element), vNode = _nodeLookup8.vNode;
  10497. if ((vNode === null || vNode === void 0 ? void 0 : vNode.props.nodeType) !== 1) {
  10498. return '';
  10499. }
  10500. return vNode.attr('aria-label') || '';
  10501. }
  10502. var ariaAttrs = {
  10503. 'aria-activedescendant': {
  10504. type: 'idref',
  10505. allowEmpty: true
  10506. },
  10507. 'aria-atomic': {
  10508. type: 'boolean',
  10509. global: true
  10510. },
  10511. 'aria-autocomplete': {
  10512. type: 'nmtoken',
  10513. values: [ 'inline', 'list', 'both', 'none' ]
  10514. },
  10515. 'aria-braillelabel': {
  10516. type: 'string',
  10517. allowEmpty: true,
  10518. global: true
  10519. },
  10520. 'aria-brailleroledescription': {
  10521. type: 'string',
  10522. allowEmpty: true,
  10523. global: true
  10524. },
  10525. 'aria-busy': {
  10526. type: 'boolean',
  10527. global: true
  10528. },
  10529. 'aria-checked': {
  10530. type: 'nmtoken',
  10531. values: [ 'false', 'mixed', 'true', 'undefined' ]
  10532. },
  10533. 'aria-colcount': {
  10534. type: 'int',
  10535. minValue: -1
  10536. },
  10537. 'aria-colindex': {
  10538. type: 'int',
  10539. minValue: 1
  10540. },
  10541. 'aria-colspan': {
  10542. type: 'int',
  10543. minValue: 1
  10544. },
  10545. 'aria-controls': {
  10546. type: 'idrefs',
  10547. allowEmpty: true,
  10548. global: true
  10549. },
  10550. 'aria-current': {
  10551. type: 'nmtoken',
  10552. allowEmpty: true,
  10553. values: [ 'page', 'step', 'location', 'date', 'time', 'true', 'false' ],
  10554. global: true
  10555. },
  10556. 'aria-describedby': {
  10557. type: 'idrefs',
  10558. allowEmpty: true,
  10559. global: true
  10560. },
  10561. 'aria-description': {
  10562. type: 'string',
  10563. allowEmpty: true,
  10564. global: true
  10565. },
  10566. 'aria-details': {
  10567. type: 'idref',
  10568. allowEmpty: true,
  10569. global: true
  10570. },
  10571. 'aria-disabled': {
  10572. type: 'boolean',
  10573. global: true
  10574. },
  10575. 'aria-dropeffect': {
  10576. type: 'nmtokens',
  10577. values: [ 'copy', 'execute', 'link', 'move', 'none', 'popup' ],
  10578. global: true
  10579. },
  10580. 'aria-errormessage': {
  10581. type: 'idref',
  10582. allowEmpty: true,
  10583. global: true
  10584. },
  10585. 'aria-expanded': {
  10586. type: 'nmtoken',
  10587. values: [ 'true', 'false', 'undefined' ]
  10588. },
  10589. 'aria-flowto': {
  10590. type: 'idrefs',
  10591. allowEmpty: true,
  10592. global: true
  10593. },
  10594. 'aria-grabbed': {
  10595. type: 'nmtoken',
  10596. values: [ 'true', 'false', 'undefined' ],
  10597. global: true
  10598. },
  10599. 'aria-haspopup': {
  10600. type: 'nmtoken',
  10601. allowEmpty: true,
  10602. values: [ 'true', 'false', 'menu', 'listbox', 'tree', 'grid', 'dialog' ],
  10603. global: true
  10604. },
  10605. 'aria-hidden': {
  10606. type: 'nmtoken',
  10607. values: [ 'true', 'false', 'undefined' ],
  10608. global: true
  10609. },
  10610. 'aria-invalid': {
  10611. type: 'nmtoken',
  10612. values: [ 'grammar', 'false', 'spelling', 'true' ],
  10613. global: true
  10614. },
  10615. 'aria-keyshortcuts': {
  10616. type: 'string',
  10617. allowEmpty: true,
  10618. global: true
  10619. },
  10620. 'aria-label': {
  10621. type: 'string',
  10622. allowEmpty: true,
  10623. global: true
  10624. },
  10625. 'aria-labelledby': {
  10626. type: 'idrefs',
  10627. allowEmpty: true,
  10628. global: true
  10629. },
  10630. 'aria-level': {
  10631. type: 'int',
  10632. minValue: 1
  10633. },
  10634. 'aria-live': {
  10635. type: 'nmtoken',
  10636. values: [ 'assertive', 'off', 'polite' ],
  10637. global: true
  10638. },
  10639. 'aria-modal': {
  10640. type: 'boolean'
  10641. },
  10642. 'aria-multiline': {
  10643. type: 'boolean'
  10644. },
  10645. 'aria-multiselectable': {
  10646. type: 'boolean'
  10647. },
  10648. 'aria-orientation': {
  10649. type: 'nmtoken',
  10650. values: [ 'horizontal', 'undefined', 'vertical' ]
  10651. },
  10652. 'aria-owns': {
  10653. type: 'idrefs',
  10654. allowEmpty: true,
  10655. global: true
  10656. },
  10657. 'aria-placeholder': {
  10658. type: 'string',
  10659. allowEmpty: true
  10660. },
  10661. 'aria-posinset': {
  10662. type: 'int',
  10663. minValue: 1
  10664. },
  10665. 'aria-pressed': {
  10666. type: 'nmtoken',
  10667. values: [ 'false', 'mixed', 'true', 'undefined' ]
  10668. },
  10669. 'aria-readonly': {
  10670. type: 'boolean'
  10671. },
  10672. 'aria-relevant': {
  10673. type: 'nmtokens',
  10674. values: [ 'additions', 'all', 'removals', 'text' ],
  10675. global: true
  10676. },
  10677. 'aria-required': {
  10678. type: 'boolean'
  10679. },
  10680. 'aria-roledescription': {
  10681. type: 'string',
  10682. allowEmpty: true,
  10683. global: true
  10684. },
  10685. 'aria-rowcount': {
  10686. type: 'int',
  10687. minValue: -1
  10688. },
  10689. 'aria-rowindex': {
  10690. type: 'int',
  10691. minValue: 1
  10692. },
  10693. 'aria-rowspan': {
  10694. type: 'int',
  10695. minValue: 0
  10696. },
  10697. 'aria-selected': {
  10698. type: 'nmtoken',
  10699. values: [ 'false', 'true', 'undefined' ]
  10700. },
  10701. 'aria-setsize': {
  10702. type: 'int',
  10703. minValue: -1
  10704. },
  10705. 'aria-sort': {
  10706. type: 'nmtoken',
  10707. values: [ 'ascending', 'descending', 'none', 'other' ]
  10708. },
  10709. 'aria-valuemax': {
  10710. type: 'decimal'
  10711. },
  10712. 'aria-valuemin': {
  10713. type: 'decimal'
  10714. },
  10715. 'aria-valuenow': {
  10716. type: 'decimal'
  10717. },
  10718. 'aria-valuetext': {
  10719. type: 'string',
  10720. allowEmpty: true
  10721. }
  10722. };
  10723. var aria_attrs_default = ariaAttrs;
  10724. var ariaRoles = {
  10725. alert: {
  10726. type: 'structure',
  10727. allowedAttrs: [ 'aria-expanded' ],
  10728. superclassRole: [ 'section' ]
  10729. },
  10730. alertdialog: {
  10731. type: 'window',
  10732. allowedAttrs: [ 'aria-expanded', 'aria-modal' ],
  10733. superclassRole: [ 'alert', 'dialog' ],
  10734. accessibleNameRequired: true
  10735. },
  10736. application: {
  10737. type: 'landmark',
  10738. allowedAttrs: [ 'aria-activedescendant', 'aria-expanded' ],
  10739. superclassRole: [ 'structure' ],
  10740. accessibleNameRequired: true
  10741. },
  10742. article: {
  10743. type: 'structure',
  10744. allowedAttrs: [ 'aria-posinset', 'aria-setsize', 'aria-expanded' ],
  10745. superclassRole: [ 'document' ]
  10746. },
  10747. banner: {
  10748. type: 'landmark',
  10749. allowedAttrs: [ 'aria-expanded' ],
  10750. superclassRole: [ 'landmark' ]
  10751. },
  10752. blockquote: {
  10753. type: 'structure',
  10754. superclassRole: [ 'section' ]
  10755. },
  10756. button: {
  10757. type: 'widget',
  10758. allowedAttrs: [ 'aria-expanded', 'aria-pressed' ],
  10759. superclassRole: [ 'command' ],
  10760. accessibleNameRequired: true,
  10761. nameFromContent: true,
  10762. childrenPresentational: true
  10763. },
  10764. caption: {
  10765. type: 'structure',
  10766. requiredContext: [ 'figure', 'table', 'grid', 'treegrid' ],
  10767. superclassRole: [ 'section' ],
  10768. prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
  10769. },
  10770. cell: {
  10771. type: 'structure',
  10772. requiredContext: [ 'row' ],
  10773. allowedAttrs: [ 'aria-colindex', 'aria-colspan', 'aria-rowindex', 'aria-rowspan', 'aria-expanded' ],
  10774. superclassRole: [ 'section' ],
  10775. nameFromContent: true
  10776. },
  10777. checkbox: {
  10778. type: 'widget',
  10779. requiredAttrs: [ 'aria-checked' ],
  10780. allowedAttrs: [ 'aria-readonly', 'aria-expanded', 'aria-required' ],
  10781. superclassRole: [ 'input' ],
  10782. accessibleNameRequired: true,
  10783. nameFromContent: true,
  10784. childrenPresentational: true
  10785. },
  10786. code: {
  10787. type: 'structure',
  10788. superclassRole: [ 'section' ],
  10789. prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
  10790. },
  10791. columnheader: {
  10792. type: 'structure',
  10793. requiredContext: [ 'row' ],
  10794. allowedAttrs: [ 'aria-sort', 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-readonly', 'aria-required', 'aria-rowindex', 'aria-rowspan', 'aria-selected' ],
  10795. superclassRole: [ 'cell', 'gridcell', 'sectionhead' ],
  10796. accessibleNameRequired: false,
  10797. nameFromContent: true
  10798. },
  10799. combobox: {
  10800. type: 'widget',
  10801. requiredAttrs: [ 'aria-expanded', 'aria-controls' ],
  10802. allowedAttrs: [ 'aria-owns', 'aria-autocomplete', 'aria-readonly', 'aria-required', 'aria-activedescendant', 'aria-orientation' ],
  10803. superclassRole: [ 'select' ],
  10804. accessibleNameRequired: true
  10805. },
  10806. command: {
  10807. type: 'abstract',
  10808. superclassRole: [ 'widget' ]
  10809. },
  10810. complementary: {
  10811. type: 'landmark',
  10812. allowedAttrs: [ 'aria-expanded' ],
  10813. superclassRole: [ 'landmark' ]
  10814. },
  10815. composite: {
  10816. type: 'abstract',
  10817. superclassRole: [ 'widget' ]
  10818. },
  10819. contentinfo: {
  10820. type: 'landmark',
  10821. allowedAttrs: [ 'aria-expanded' ],
  10822. superclassRole: [ 'landmark' ]
  10823. },
  10824. comment: {
  10825. type: 'structure',
  10826. allowedAttrs: [ 'aria-level', 'aria-posinset', 'aria-setsize' ],
  10827. superclassRole: [ 'article' ]
  10828. },
  10829. definition: {
  10830. type: 'structure',
  10831. allowedAttrs: [ 'aria-expanded' ],
  10832. superclassRole: [ 'section' ]
  10833. },
  10834. deletion: {
  10835. type: 'structure',
  10836. superclassRole: [ 'section' ],
  10837. prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
  10838. },
  10839. dialog: {
  10840. type: 'window',
  10841. allowedAttrs: [ 'aria-expanded', 'aria-modal' ],
  10842. superclassRole: [ 'window' ],
  10843. accessibleNameRequired: true
  10844. },
  10845. directory: {
  10846. type: 'structure',
  10847. deprecated: true,
  10848. allowedAttrs: [ 'aria-expanded' ],
  10849. superclassRole: [ 'list' ],
  10850. nameFromContent: true
  10851. },
  10852. document: {
  10853. type: 'structure',
  10854. allowedAttrs: [ 'aria-expanded' ],
  10855. superclassRole: [ 'structure' ]
  10856. },
  10857. emphasis: {
  10858. type: 'structure',
  10859. superclassRole: [ 'section' ],
  10860. prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
  10861. },
  10862. feed: {
  10863. type: 'structure',
  10864. requiredOwned: [ 'article' ],
  10865. allowedAttrs: [ 'aria-expanded' ],
  10866. superclassRole: [ 'list' ]
  10867. },
  10868. figure: {
  10869. type: 'structure',
  10870. allowedAttrs: [ 'aria-expanded' ],
  10871. superclassRole: [ 'section' ],
  10872. nameFromContent: true
  10873. },
  10874. form: {
  10875. type: 'landmark',
  10876. allowedAttrs: [ 'aria-expanded' ],
  10877. superclassRole: [ 'landmark' ]
  10878. },
  10879. grid: {
  10880. type: 'composite',
  10881. requiredOwned: [ 'rowgroup', 'row' ],
  10882. allowedAttrs: [ 'aria-level', 'aria-multiselectable', 'aria-readonly', 'aria-activedescendant', 'aria-colcount', 'aria-expanded', 'aria-rowcount' ],
  10883. superclassRole: [ 'composite', 'table' ],
  10884. accessibleNameRequired: false
  10885. },
  10886. gridcell: {
  10887. type: 'widget',
  10888. requiredContext: [ 'row' ],
  10889. allowedAttrs: [ 'aria-readonly', 'aria-required', 'aria-selected', 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan' ],
  10890. superclassRole: [ 'cell', 'widget' ],
  10891. nameFromContent: true
  10892. },
  10893. group: {
  10894. type: 'structure',
  10895. allowedAttrs: [ 'aria-activedescendant', 'aria-expanded' ],
  10896. superclassRole: [ 'section' ]
  10897. },
  10898. heading: {
  10899. type: 'structure',
  10900. requiredAttrs: [ 'aria-level' ],
  10901. allowedAttrs: [ 'aria-expanded' ],
  10902. superclassRole: [ 'sectionhead' ],
  10903. accessibleNameRequired: false,
  10904. nameFromContent: true
  10905. },
  10906. img: {
  10907. type: 'structure',
  10908. allowedAttrs: [ 'aria-expanded' ],
  10909. superclassRole: [ 'section' ],
  10910. accessibleNameRequired: true,
  10911. childrenPresentational: true
  10912. },
  10913. input: {
  10914. type: 'abstract',
  10915. superclassRole: [ 'widget' ]
  10916. },
  10917. insertion: {
  10918. type: 'structure',
  10919. superclassRole: [ 'section' ],
  10920. prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
  10921. },
  10922. landmark: {
  10923. type: 'abstract',
  10924. superclassRole: [ 'section' ]
  10925. },
  10926. link: {
  10927. type: 'widget',
  10928. allowedAttrs: [ 'aria-expanded' ],
  10929. superclassRole: [ 'command' ],
  10930. accessibleNameRequired: true,
  10931. nameFromContent: true
  10932. },
  10933. list: {
  10934. type: 'structure',
  10935. requiredOwned: [ 'listitem' ],
  10936. allowedAttrs: [ 'aria-expanded' ],
  10937. superclassRole: [ 'section' ]
  10938. },
  10939. listbox: {
  10940. type: 'widget',
  10941. requiredOwned: [ 'group', 'option' ],
  10942. allowedAttrs: [ 'aria-multiselectable', 'aria-readonly', 'aria-required', 'aria-activedescendant', 'aria-expanded', 'aria-orientation' ],
  10943. superclassRole: [ 'select' ],
  10944. accessibleNameRequired: true
  10945. },
  10946. listitem: {
  10947. type: 'structure',
  10948. requiredContext: [ 'list' ],
  10949. allowedAttrs: [ 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-expanded' ],
  10950. superclassRole: [ 'section' ],
  10951. nameFromContent: true
  10952. },
  10953. log: {
  10954. type: 'structure',
  10955. allowedAttrs: [ 'aria-expanded' ],
  10956. superclassRole: [ 'section' ]
  10957. },
  10958. main: {
  10959. type: 'landmark',
  10960. allowedAttrs: [ 'aria-expanded' ],
  10961. superclassRole: [ 'landmark' ]
  10962. },
  10963. marquee: {
  10964. type: 'structure',
  10965. allowedAttrs: [ 'aria-expanded' ],
  10966. superclassRole: [ 'section' ]
  10967. },
  10968. math: {
  10969. type: 'structure',
  10970. allowedAttrs: [ 'aria-expanded' ],
  10971. superclassRole: [ 'section' ],
  10972. childrenPresentational: true
  10973. },
  10974. menu: {
  10975. type: 'composite',
  10976. requiredOwned: [ 'group', 'menuitemradio', 'menuitem', 'menuitemcheckbox', 'menu', 'separator' ],
  10977. allowedAttrs: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation' ],
  10978. superclassRole: [ 'select' ]
  10979. },
  10980. menubar: {
  10981. type: 'composite',
  10982. requiredOwned: [ 'group', 'menuitemradio', 'menuitem', 'menuitemcheckbox', 'menu', 'separator' ],
  10983. allowedAttrs: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation' ],
  10984. superclassRole: [ 'menu' ]
  10985. },
  10986. menuitem: {
  10987. type: 'widget',
  10988. requiredContext: [ 'menu', 'menubar', 'group' ],
  10989. allowedAttrs: [ 'aria-posinset', 'aria-setsize', 'aria-expanded' ],
  10990. superclassRole: [ 'command' ],
  10991. accessibleNameRequired: true,
  10992. nameFromContent: true
  10993. },
  10994. menuitemcheckbox: {
  10995. type: 'widget',
  10996. requiredContext: [ 'menu', 'menubar', 'group' ],
  10997. requiredAttrs: [ 'aria-checked' ],
  10998. allowedAttrs: [ 'aria-expanded', 'aria-posinset', 'aria-readonly', 'aria-setsize' ],
  10999. superclassRole: [ 'checkbox', 'menuitem' ],
  11000. accessibleNameRequired: true,
  11001. nameFromContent: true,
  11002. childrenPresentational: true
  11003. },
  11004. menuitemradio: {
  11005. type: 'widget',
  11006. requiredContext: [ 'menu', 'menubar', 'group' ],
  11007. requiredAttrs: [ 'aria-checked' ],
  11008. allowedAttrs: [ 'aria-expanded', 'aria-posinset', 'aria-readonly', 'aria-setsize' ],
  11009. superclassRole: [ 'menuitemcheckbox', 'radio' ],
  11010. accessibleNameRequired: true,
  11011. nameFromContent: true,
  11012. childrenPresentational: true
  11013. },
  11014. meter: {
  11015. type: 'structure',
  11016. requiredAttrs: [ 'aria-valuenow' ],
  11017. allowedAttrs: [ 'aria-valuemax', 'aria-valuemin', 'aria-valuetext' ],
  11018. superclassRole: [ 'range' ],
  11019. accessibleNameRequired: true,
  11020. childrenPresentational: true
  11021. },
  11022. mark: {
  11023. type: 'structure',
  11024. superclassRole: [ 'section' ],
  11025. prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
  11026. },
  11027. navigation: {
  11028. type: 'landmark',
  11029. allowedAttrs: [ 'aria-expanded' ],
  11030. superclassRole: [ 'landmark' ]
  11031. },
  11032. none: {
  11033. type: 'structure',
  11034. superclassRole: [ 'structure' ],
  11035. prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
  11036. },
  11037. note: {
  11038. type: 'structure',
  11039. allowedAttrs: [ 'aria-expanded' ],
  11040. superclassRole: [ 'section' ]
  11041. },
  11042. option: {
  11043. type: 'widget',
  11044. requiredContext: [ 'group', 'listbox' ],
  11045. allowedAttrs: [ 'aria-selected', 'aria-checked', 'aria-posinset', 'aria-setsize' ],
  11046. superclassRole: [ 'input' ],
  11047. accessibleNameRequired: true,
  11048. nameFromContent: true,
  11049. childrenPresentational: true
  11050. },
  11051. paragraph: {
  11052. type: 'structure',
  11053. superclassRole: [ 'section' ],
  11054. prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
  11055. },
  11056. presentation: {
  11057. type: 'structure',
  11058. superclassRole: [ 'structure' ],
  11059. prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
  11060. },
  11061. progressbar: {
  11062. type: 'widget',
  11063. allowedAttrs: [ 'aria-expanded', 'aria-valuemax', 'aria-valuemin', 'aria-valuenow', 'aria-valuetext' ],
  11064. superclassRole: [ 'range' ],
  11065. accessibleNameRequired: true,
  11066. childrenPresentational: true
  11067. },
  11068. radio: {
  11069. type: 'widget',
  11070. requiredAttrs: [ 'aria-checked' ],
  11071. allowedAttrs: [ 'aria-posinset', 'aria-setsize', 'aria-required' ],
  11072. superclassRole: [ 'input' ],
  11073. accessibleNameRequired: true,
  11074. nameFromContent: true,
  11075. childrenPresentational: true
  11076. },
  11077. radiogroup: {
  11078. type: 'composite',
  11079. allowedAttrs: [ 'aria-readonly', 'aria-required', 'aria-activedescendant', 'aria-expanded', 'aria-orientation' ],
  11080. superclassRole: [ 'select' ],
  11081. accessibleNameRequired: false
  11082. },
  11083. range: {
  11084. type: 'abstract',
  11085. superclassRole: [ 'widget' ]
  11086. },
  11087. region: {
  11088. type: 'landmark',
  11089. allowedAttrs: [ 'aria-expanded' ],
  11090. superclassRole: [ 'landmark' ],
  11091. accessibleNameRequired: false
  11092. },
  11093. roletype: {
  11094. type: 'abstract',
  11095. superclassRole: []
  11096. },
  11097. row: {
  11098. type: 'structure',
  11099. requiredContext: [ 'grid', 'rowgroup', 'table', 'treegrid' ],
  11100. requiredOwned: [ 'cell', 'columnheader', 'gridcell', 'rowheader' ],
  11101. allowedAttrs: [ 'aria-colindex', 'aria-level', 'aria-rowindex', 'aria-selected', 'aria-activedescendant', 'aria-expanded', 'aria-posinset', 'aria-setsize' ],
  11102. superclassRole: [ 'group', 'widget' ],
  11103. nameFromContent: true
  11104. },
  11105. rowgroup: {
  11106. type: 'structure',
  11107. requiredContext: [ 'grid', 'table', 'treegrid' ],
  11108. requiredOwned: [ 'row' ],
  11109. superclassRole: [ 'structure' ],
  11110. nameFromContent: true
  11111. },
  11112. rowheader: {
  11113. type: 'structure',
  11114. requiredContext: [ 'row' ],
  11115. allowedAttrs: [ 'aria-sort', 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-readonly', 'aria-required', 'aria-rowindex', 'aria-rowspan', 'aria-selected' ],
  11116. superclassRole: [ 'cell', 'gridcell', 'sectionhead' ],
  11117. accessibleNameRequired: false,
  11118. nameFromContent: true
  11119. },
  11120. scrollbar: {
  11121. type: 'widget',
  11122. requiredAttrs: [ 'aria-valuenow' ],
  11123. allowedAttrs: [ 'aria-controls', 'aria-orientation', 'aria-valuemax', 'aria-valuemin', 'aria-valuetext' ],
  11124. superclassRole: [ 'range' ],
  11125. childrenPresentational: true
  11126. },
  11127. search: {
  11128. type: 'landmark',
  11129. allowedAttrs: [ 'aria-expanded' ],
  11130. superclassRole: [ 'landmark' ]
  11131. },
  11132. searchbox: {
  11133. type: 'widget',
  11134. allowedAttrs: [ 'aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-placeholder', 'aria-readonly', 'aria-required' ],
  11135. superclassRole: [ 'textbox' ],
  11136. accessibleNameRequired: true
  11137. },
  11138. section: {
  11139. type: 'abstract',
  11140. superclassRole: [ 'structure' ],
  11141. nameFromContent: true
  11142. },
  11143. sectionhead: {
  11144. type: 'abstract',
  11145. superclassRole: [ 'structure' ],
  11146. nameFromContent: true
  11147. },
  11148. select: {
  11149. type: 'abstract',
  11150. superclassRole: [ 'composite', 'group' ]
  11151. },
  11152. separator: {
  11153. type: 'structure',
  11154. requiredAttrs: [ 'aria-valuenow' ],
  11155. allowedAttrs: [ 'aria-valuemax', 'aria-valuemin', 'aria-orientation', 'aria-valuetext' ],
  11156. superclassRole: [ 'structure', 'widget' ],
  11157. childrenPresentational: true
  11158. },
  11159. slider: {
  11160. type: 'widget',
  11161. requiredAttrs: [ 'aria-valuenow' ],
  11162. allowedAttrs: [ 'aria-valuemax', 'aria-valuemin', 'aria-orientation', 'aria-readonly', 'aria-required', 'aria-valuetext' ],
  11163. superclassRole: [ 'input', 'range' ],
  11164. accessibleNameRequired: true,
  11165. childrenPresentational: true
  11166. },
  11167. spinbutton: {
  11168. type: 'widget',
  11169. allowedAttrs: [ 'aria-valuemax', 'aria-valuemin', 'aria-readonly', 'aria-required', 'aria-activedescendant', 'aria-valuetext', 'aria-valuenow' ],
  11170. superclassRole: [ 'composite', 'input', 'range' ],
  11171. accessibleNameRequired: true
  11172. },
  11173. status: {
  11174. type: 'structure',
  11175. allowedAttrs: [ 'aria-expanded' ],
  11176. superclassRole: [ 'section' ]
  11177. },
  11178. strong: {
  11179. type: 'structure',
  11180. superclassRole: [ 'section' ],
  11181. prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
  11182. },
  11183. structure: {
  11184. type: 'abstract',
  11185. superclassRole: [ 'roletype' ]
  11186. },
  11187. subscript: {
  11188. type: 'structure',
  11189. superclassRole: [ 'section' ],
  11190. prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
  11191. },
  11192. superscript: {
  11193. type: 'structure',
  11194. superclassRole: [ 'section' ],
  11195. prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
  11196. },
  11197. switch: {
  11198. type: 'widget',
  11199. requiredAttrs: [ 'aria-checked' ],
  11200. allowedAttrs: [ 'aria-expanded', 'aria-readonly', 'aria-required' ],
  11201. superclassRole: [ 'checkbox' ],
  11202. accessibleNameRequired: true,
  11203. nameFromContent: true,
  11204. childrenPresentational: true
  11205. },
  11206. suggestion: {
  11207. type: 'structure',
  11208. requiredOwned: [ 'insertion', 'deletion' ],
  11209. superclassRole: [ 'section' ],
  11210. prohibitedAttrs: [ 'aria-label', 'aria-labelledby' ]
  11211. },
  11212. tab: {
  11213. type: 'widget',
  11214. requiredContext: [ 'tablist' ],
  11215. allowedAttrs: [ 'aria-posinset', 'aria-selected', 'aria-setsize', 'aria-expanded' ],
  11216. superclassRole: [ 'sectionhead', 'widget' ],
  11217. nameFromContent: true,
  11218. childrenPresentational: true
  11219. },
  11220. table: {
  11221. type: 'structure',
  11222. requiredOwned: [ 'rowgroup', 'row' ],
  11223. allowedAttrs: [ 'aria-colcount', 'aria-rowcount', 'aria-expanded' ],
  11224. superclassRole: [ 'section' ],
  11225. accessibleNameRequired: false,
  11226. nameFromContent: true
  11227. },
  11228. tablist: {
  11229. type: 'composite',
  11230. requiredOwned: [ 'tab' ],
  11231. allowedAttrs: [ 'aria-level', 'aria-multiselectable', 'aria-orientation', 'aria-activedescendant', 'aria-expanded' ],
  11232. superclassRole: [ 'composite' ]
  11233. },
  11234. tabpanel: {
  11235. type: 'structure',
  11236. allowedAttrs: [ 'aria-expanded' ],
  11237. superclassRole: [ 'section' ],
  11238. accessibleNameRequired: false
  11239. },
  11240. term: {
  11241. type: 'structure',
  11242. allowedAttrs: [ 'aria-expanded' ],
  11243. superclassRole: [ 'section' ],
  11244. nameFromContent: true
  11245. },
  11246. text: {
  11247. type: 'structure',
  11248. superclassRole: [ 'section' ],
  11249. nameFromContent: true
  11250. },
  11251. textbox: {
  11252. type: 'widget',
  11253. allowedAttrs: [ 'aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-placeholder', 'aria-readonly', 'aria-required' ],
  11254. superclassRole: [ 'input' ],
  11255. accessibleNameRequired: true
  11256. },
  11257. time: {
  11258. type: 'structure',
  11259. superclassRole: [ 'section' ]
  11260. },
  11261. timer: {
  11262. type: 'structure',
  11263. allowedAttrs: [ 'aria-expanded' ],
  11264. superclassRole: [ 'status' ]
  11265. },
  11266. toolbar: {
  11267. type: 'structure',
  11268. allowedAttrs: [ 'aria-orientation', 'aria-activedescendant', 'aria-expanded' ],
  11269. superclassRole: [ 'group' ],
  11270. accessibleNameRequired: true
  11271. },
  11272. tooltip: {
  11273. type: 'structure',
  11274. allowedAttrs: [ 'aria-expanded' ],
  11275. superclassRole: [ 'section' ],
  11276. nameFromContent: true
  11277. },
  11278. tree: {
  11279. type: 'composite',
  11280. requiredOwned: [ 'group', 'treeitem' ],
  11281. allowedAttrs: [ 'aria-multiselectable', 'aria-required', 'aria-activedescendant', 'aria-expanded', 'aria-orientation' ],
  11282. superclassRole: [ 'select' ],
  11283. accessibleNameRequired: false
  11284. },
  11285. treegrid: {
  11286. type: 'composite',
  11287. requiredOwned: [ 'rowgroup', 'row' ],
  11288. allowedAttrs: [ 'aria-activedescendant', 'aria-colcount', 'aria-expanded', 'aria-level', 'aria-multiselectable', 'aria-orientation', 'aria-readonly', 'aria-required', 'aria-rowcount' ],
  11289. superclassRole: [ 'grid', 'tree' ],
  11290. accessibleNameRequired: false
  11291. },
  11292. treeitem: {
  11293. type: 'widget',
  11294. requiredContext: [ 'group', 'tree' ],
  11295. allowedAttrs: [ 'aria-checked', 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-selected', 'aria-setsize' ],
  11296. superclassRole: [ 'listitem', 'option' ],
  11297. accessibleNameRequired: true,
  11298. nameFromContent: true
  11299. },
  11300. widget: {
  11301. type: 'abstract',
  11302. superclassRole: [ 'roletype' ]
  11303. },
  11304. window: {
  11305. type: 'abstract',
  11306. superclassRole: [ 'roletype' ]
  11307. }
  11308. };
  11309. var aria_roles_default = ariaRoles;
  11310. var dpubRoles = {
  11311. 'doc-abstract': {
  11312. type: 'section',
  11313. allowedAttrs: [ 'aria-expanded' ],
  11314. superclassRole: [ 'section' ]
  11315. },
  11316. 'doc-acknowledgments': {
  11317. type: 'landmark',
  11318. allowedAttrs: [ 'aria-expanded' ],
  11319. superclassRole: [ 'landmark' ]
  11320. },
  11321. 'doc-afterword': {
  11322. type: 'landmark',
  11323. allowedAttrs: [ 'aria-expanded' ],
  11324. superclassRole: [ 'landmark' ]
  11325. },
  11326. 'doc-appendix': {
  11327. type: 'landmark',
  11328. allowedAttrs: [ 'aria-expanded' ],
  11329. superclassRole: [ 'landmark' ]
  11330. },
  11331. 'doc-backlink': {
  11332. type: 'link',
  11333. allowedAttrs: [ 'aria-expanded' ],
  11334. nameFromContent: true,
  11335. superclassRole: [ 'link' ]
  11336. },
  11337. 'doc-biblioentry': {
  11338. type: 'listitem',
  11339. allowedAttrs: [ 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize' ],
  11340. superclassRole: [ 'listitem' ],
  11341. deprecated: true
  11342. },
  11343. 'doc-bibliography': {
  11344. type: 'landmark',
  11345. allowedAttrs: [ 'aria-expanded' ],
  11346. superclassRole: [ 'landmark' ]
  11347. },
  11348. 'doc-biblioref': {
  11349. type: 'link',
  11350. allowedAttrs: [ 'aria-expanded' ],
  11351. nameFromContent: true,
  11352. superclassRole: [ 'link' ]
  11353. },
  11354. 'doc-chapter': {
  11355. type: 'landmark',
  11356. allowedAttrs: [ 'aria-expanded' ],
  11357. superclassRole: [ 'landmark' ]
  11358. },
  11359. 'doc-colophon': {
  11360. type: 'section',
  11361. allowedAttrs: [ 'aria-expanded' ],
  11362. superclassRole: [ 'section' ]
  11363. },
  11364. 'doc-conclusion': {
  11365. type: 'landmark',
  11366. allowedAttrs: [ 'aria-expanded' ],
  11367. superclassRole: [ 'landmark' ]
  11368. },
  11369. 'doc-cover': {
  11370. type: 'img',
  11371. allowedAttrs: [ 'aria-expanded' ],
  11372. superclassRole: [ 'img' ]
  11373. },
  11374. 'doc-credit': {
  11375. type: 'section',
  11376. allowedAttrs: [ 'aria-expanded' ],
  11377. superclassRole: [ 'section' ]
  11378. },
  11379. 'doc-credits': {
  11380. type: 'landmark',
  11381. allowedAttrs: [ 'aria-expanded' ],
  11382. superclassRole: [ 'landmark' ]
  11383. },
  11384. 'doc-dedication': {
  11385. type: 'section',
  11386. allowedAttrs: [ 'aria-expanded' ],
  11387. superclassRole: [ 'section' ]
  11388. },
  11389. 'doc-endnote': {
  11390. type: 'listitem',
  11391. allowedAttrs: [ 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize' ],
  11392. superclassRole: [ 'listitem' ],
  11393. deprecated: true
  11394. },
  11395. 'doc-endnotes': {
  11396. type: 'landmark',
  11397. allowedAttrs: [ 'aria-expanded' ],
  11398. superclassRole: [ 'landmark' ]
  11399. },
  11400. 'doc-epigraph': {
  11401. type: 'section',
  11402. allowedAttrs: [ 'aria-expanded' ],
  11403. superclassRole: [ 'section' ]
  11404. },
  11405. 'doc-epilogue': {
  11406. type: 'landmark',
  11407. allowedAttrs: [ 'aria-expanded' ],
  11408. superclassRole: [ 'landmark' ]
  11409. },
  11410. 'doc-errata': {
  11411. type: 'landmark',
  11412. allowedAttrs: [ 'aria-expanded' ],
  11413. superclassRole: [ 'landmark' ]
  11414. },
  11415. 'doc-example': {
  11416. type: 'section',
  11417. allowedAttrs: [ 'aria-expanded' ],
  11418. superclassRole: [ 'section' ]
  11419. },
  11420. 'doc-footnote': {
  11421. type: 'section',
  11422. allowedAttrs: [ 'aria-expanded' ],
  11423. superclassRole: [ 'section' ]
  11424. },
  11425. 'doc-foreword': {
  11426. type: 'landmark',
  11427. allowedAttrs: [ 'aria-expanded' ],
  11428. superclassRole: [ 'landmark' ]
  11429. },
  11430. 'doc-glossary': {
  11431. type: 'landmark',
  11432. allowedAttrs: [ 'aria-expanded' ],
  11433. superclassRole: [ 'landmark' ]
  11434. },
  11435. 'doc-glossref': {
  11436. type: 'link',
  11437. allowedAttrs: [ 'aria-expanded' ],
  11438. nameFromContent: true,
  11439. superclassRole: [ 'link' ]
  11440. },
  11441. 'doc-index': {
  11442. type: 'navigation',
  11443. allowedAttrs: [ 'aria-expanded' ],
  11444. superclassRole: [ 'navigation' ]
  11445. },
  11446. 'doc-introduction': {
  11447. type: 'landmark',
  11448. allowedAttrs: [ 'aria-expanded' ],
  11449. superclassRole: [ 'landmark' ]
  11450. },
  11451. 'doc-noteref': {
  11452. type: 'link',
  11453. allowedAttrs: [ 'aria-expanded' ],
  11454. nameFromContent: true,
  11455. superclassRole: [ 'link' ]
  11456. },
  11457. 'doc-notice': {
  11458. type: 'note',
  11459. allowedAttrs: [ 'aria-expanded' ],
  11460. superclassRole: [ 'note' ]
  11461. },
  11462. 'doc-pagebreak': {
  11463. type: 'separator',
  11464. allowedAttrs: [ 'aria-expanded', 'aria-orientation' ],
  11465. superclassRole: [ 'separator' ],
  11466. childrenPresentational: true
  11467. },
  11468. 'doc-pagelist': {
  11469. type: 'navigation',
  11470. allowedAttrs: [ 'aria-expanded' ],
  11471. superclassRole: [ 'navigation' ]
  11472. },
  11473. 'doc-part': {
  11474. type: 'landmark',
  11475. allowedAttrs: [ 'aria-expanded' ],
  11476. superclassRole: [ 'landmark' ]
  11477. },
  11478. 'doc-preface': {
  11479. type: 'landmark',
  11480. allowedAttrs: [ 'aria-expanded' ],
  11481. superclassRole: [ 'landmark' ]
  11482. },
  11483. 'doc-prologue': {
  11484. type: 'landmark',
  11485. allowedAttrs: [ 'aria-expanded' ],
  11486. superclassRole: [ 'landmark' ]
  11487. },
  11488. 'doc-pullquote': {
  11489. type: 'none',
  11490. superclassRole: [ 'none' ]
  11491. },
  11492. 'doc-qna': {
  11493. type: 'section',
  11494. allowedAttrs: [ 'aria-expanded' ],
  11495. superclassRole: [ 'section' ]
  11496. },
  11497. 'doc-subtitle': {
  11498. type: 'sectionhead',
  11499. allowedAttrs: [ 'aria-expanded' ],
  11500. superclassRole: [ 'sectionhead' ]
  11501. },
  11502. 'doc-tip': {
  11503. type: 'note',
  11504. allowedAttrs: [ 'aria-expanded' ],
  11505. superclassRole: [ 'note' ]
  11506. },
  11507. 'doc-toc': {
  11508. type: 'navigation',
  11509. allowedAttrs: [ 'aria-expanded' ],
  11510. superclassRole: [ 'navigation' ]
  11511. }
  11512. };
  11513. var dpub_roles_default = dpubRoles;
  11514. var graphicsRoles = {
  11515. 'graphics-document': {
  11516. type: 'structure',
  11517. superclassRole: [ 'document' ],
  11518. accessibleNameRequired: true
  11519. },
  11520. 'graphics-object': {
  11521. type: 'structure',
  11522. superclassRole: [ 'group' ],
  11523. nameFromContent: true
  11524. },
  11525. 'graphics-symbol': {
  11526. type: 'structure',
  11527. superclassRole: [ 'img' ],
  11528. accessibleNameRequired: true,
  11529. childrenPresentational: true
  11530. }
  11531. };
  11532. var graphics_roles_default = graphicsRoles;
  11533. var htmlElms = {
  11534. a: {
  11535. variant: {
  11536. href: {
  11537. matches: '[href]',
  11538. contentTypes: [ 'interactive', 'phrasing', 'flow' ],
  11539. allowedRoles: [ 'button', 'checkbox', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'radio', 'switch', 'tab', 'treeitem', 'doc-backlink', 'doc-biblioref', 'doc-glossref', 'doc-noteref' ],
  11540. namingMethods: [ 'subtreeText' ]
  11541. },
  11542. default: {
  11543. contentTypes: [ 'phrasing', 'flow' ],
  11544. allowedRoles: true
  11545. }
  11546. }
  11547. },
  11548. abbr: {
  11549. contentTypes: [ 'phrasing', 'flow' ],
  11550. allowedRoles: true
  11551. },
  11552. address: {
  11553. contentTypes: [ 'flow' ],
  11554. allowedRoles: true
  11555. },
  11556. area: {
  11557. variant: {
  11558. href: {
  11559. matches: '[href]',
  11560. allowedRoles: false
  11561. },
  11562. default: {
  11563. allowedRoles: [ 'button', 'link' ]
  11564. }
  11565. },
  11566. contentTypes: [ 'phrasing', 'flow' ],
  11567. namingMethods: [ 'altText' ]
  11568. },
  11569. article: {
  11570. contentTypes: [ 'sectioning', 'flow' ],
  11571. allowedRoles: [ 'feed', 'presentation', 'none', 'document', 'application', 'main', 'region' ],
  11572. shadowRoot: true
  11573. },
  11574. aside: {
  11575. contentTypes: [ 'sectioning', 'flow' ],
  11576. allowedRoles: [ 'feed', 'note', 'presentation', 'none', 'region', 'search', 'doc-dedication', 'doc-example', 'doc-footnote', 'doc-glossary', 'doc-pullquote', 'doc-tip' ]
  11577. },
  11578. audio: {
  11579. variant: {
  11580. controls: {
  11581. matches: '[controls]',
  11582. contentTypes: [ 'interactive', 'embedded', 'phrasing', 'flow' ]
  11583. },
  11584. default: {
  11585. contentTypes: [ 'embedded', 'phrasing', 'flow' ]
  11586. }
  11587. },
  11588. allowedRoles: [ 'application' ],
  11589. chromiumRole: 'Audio'
  11590. },
  11591. b: {
  11592. contentTypes: [ 'phrasing', 'flow' ],
  11593. allowedRoles: true
  11594. },
  11595. base: {
  11596. allowedRoles: false,
  11597. noAriaAttrs: true
  11598. },
  11599. bdi: {
  11600. contentTypes: [ 'phrasing', 'flow' ],
  11601. allowedRoles: true
  11602. },
  11603. bdo: {
  11604. contentTypes: [ 'phrasing', 'flow' ],
  11605. allowedRoles: true
  11606. },
  11607. blockquote: {
  11608. contentTypes: [ 'flow' ],
  11609. allowedRoles: true,
  11610. shadowRoot: true
  11611. },
  11612. body: {
  11613. allowedRoles: false,
  11614. shadowRoot: true
  11615. },
  11616. br: {
  11617. contentTypes: [ 'phrasing', 'flow' ],
  11618. allowedRoles: [ 'presentation', 'none' ],
  11619. namingMethods: [ 'titleText', 'singleSpace' ]
  11620. },
  11621. button: {
  11622. contentTypes: [ 'interactive', 'phrasing', 'flow' ],
  11623. allowedRoles: [ 'checkbox', 'combobox', 'gridcell', 'link', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'radio', 'separator', 'slider', 'switch', 'tab', 'treeitem' ],
  11624. namingMethods: [ 'subtreeText' ]
  11625. },
  11626. canvas: {
  11627. allowedRoles: true,
  11628. contentTypes: [ 'embedded', 'phrasing', 'flow' ],
  11629. chromiumRole: 'Canvas'
  11630. },
  11631. caption: {
  11632. allowedRoles: false
  11633. },
  11634. cite: {
  11635. contentTypes: [ 'phrasing', 'flow' ],
  11636. allowedRoles: true
  11637. },
  11638. code: {
  11639. contentTypes: [ 'phrasing', 'flow' ],
  11640. allowedRoles: true
  11641. },
  11642. col: {
  11643. allowedRoles: false,
  11644. noAriaAttrs: true
  11645. },
  11646. colgroup: {
  11647. allowedRoles: false,
  11648. noAriaAttrs: true
  11649. },
  11650. data: {
  11651. contentTypes: [ 'phrasing', 'flow' ],
  11652. allowedRoles: true
  11653. },
  11654. datalist: {
  11655. contentTypes: [ 'phrasing', 'flow' ],
  11656. allowedRoles: false,
  11657. noAriaAttrs: true,
  11658. implicitAttrs: {
  11659. 'aria-multiselectable': 'false'
  11660. }
  11661. },
  11662. dd: {
  11663. allowedRoles: false
  11664. },
  11665. del: {
  11666. contentTypes: [ 'phrasing', 'flow' ],
  11667. allowedRoles: true
  11668. },
  11669. dfn: {
  11670. contentTypes: [ 'phrasing', 'flow' ],
  11671. allowedRoles: true
  11672. },
  11673. details: {
  11674. contentTypes: [ 'interactive', 'flow' ],
  11675. allowedRoles: false
  11676. },
  11677. dialog: {
  11678. contentTypes: [ 'flow' ],
  11679. allowedRoles: [ 'alertdialog' ]
  11680. },
  11681. div: {
  11682. contentTypes: [ 'flow' ],
  11683. allowedRoles: true,
  11684. shadowRoot: true
  11685. },
  11686. dl: {
  11687. contentTypes: [ 'flow' ],
  11688. allowedRoles: [ 'group', 'list', 'presentation', 'none' ],
  11689. chromiumRole: 'DescriptionList'
  11690. },
  11691. dt: {
  11692. allowedRoles: [ 'listitem' ]
  11693. },
  11694. em: {
  11695. contentTypes: [ 'phrasing', 'flow' ],
  11696. allowedRoles: true
  11697. },
  11698. embed: {
  11699. contentTypes: [ 'interactive', 'embedded', 'phrasing', 'flow' ],
  11700. allowedRoles: [ 'application', 'document', 'img', 'presentation', 'none' ],
  11701. chromiumRole: 'EmbeddedObject'
  11702. },
  11703. fieldset: {
  11704. contentTypes: [ 'flow' ],
  11705. allowedRoles: [ 'none', 'presentation', 'radiogroup' ],
  11706. namingMethods: [ 'fieldsetLegendText' ]
  11707. },
  11708. figcaption: {
  11709. allowedRoles: [ 'group', 'none', 'presentation' ]
  11710. },
  11711. figure: {
  11712. contentTypes: [ 'flow' ],
  11713. allowedRoles: true,
  11714. namingMethods: [ 'figureText', 'titleText' ]
  11715. },
  11716. footer: {
  11717. contentTypes: [ 'flow' ],
  11718. allowedRoles: [ 'group', 'none', 'presentation', 'doc-footnote' ],
  11719. shadowRoot: true
  11720. },
  11721. form: {
  11722. contentTypes: [ 'flow' ],
  11723. allowedRoles: [ 'form', 'search', 'none', 'presentation' ]
  11724. },
  11725. h1: {
  11726. contentTypes: [ 'heading', 'flow' ],
  11727. allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
  11728. shadowRoot: true,
  11729. implicitAttrs: {
  11730. 'aria-level': '1'
  11731. }
  11732. },
  11733. h2: {
  11734. contentTypes: [ 'heading', 'flow' ],
  11735. allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
  11736. shadowRoot: true,
  11737. implicitAttrs: {
  11738. 'aria-level': '2'
  11739. }
  11740. },
  11741. h3: {
  11742. contentTypes: [ 'heading', 'flow' ],
  11743. allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
  11744. shadowRoot: true,
  11745. implicitAttrs: {
  11746. 'aria-level': '3'
  11747. }
  11748. },
  11749. h4: {
  11750. contentTypes: [ 'heading', 'flow' ],
  11751. allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
  11752. shadowRoot: true,
  11753. implicitAttrs: {
  11754. 'aria-level': '4'
  11755. }
  11756. },
  11757. h5: {
  11758. contentTypes: [ 'heading', 'flow' ],
  11759. allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
  11760. shadowRoot: true,
  11761. implicitAttrs: {
  11762. 'aria-level': '5'
  11763. }
  11764. },
  11765. h6: {
  11766. contentTypes: [ 'heading', 'flow' ],
  11767. allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
  11768. shadowRoot: true,
  11769. implicitAttrs: {
  11770. 'aria-level': '6'
  11771. }
  11772. },
  11773. head: {
  11774. allowedRoles: false,
  11775. noAriaAttrs: true
  11776. },
  11777. header: {
  11778. contentTypes: [ 'flow' ],
  11779. allowedRoles: [ 'group', 'none', 'presentation', 'doc-footnote' ],
  11780. shadowRoot: true
  11781. },
  11782. hgroup: {
  11783. contentTypes: [ 'heading', 'flow' ],
  11784. allowedRoles: true
  11785. },
  11786. hr: {
  11787. contentTypes: [ 'flow' ],
  11788. allowedRoles: [ 'none', 'presentation', 'doc-pagebreak' ],
  11789. namingMethods: [ 'titleText', 'singleSpace' ]
  11790. },
  11791. html: {
  11792. allowedRoles: false,
  11793. noAriaAttrs: true
  11794. },
  11795. i: {
  11796. contentTypes: [ 'phrasing', 'flow' ],
  11797. allowedRoles: true
  11798. },
  11799. iframe: {
  11800. contentTypes: [ 'interactive', 'embedded', 'phrasing', 'flow' ],
  11801. allowedRoles: [ 'application', 'document', 'img', 'none', 'presentation' ],
  11802. chromiumRole: 'Iframe'
  11803. },
  11804. img: {
  11805. variant: {
  11806. nonEmptyAlt: {
  11807. matches: [ {
  11808. attributes: {
  11809. alt: '/.+/'
  11810. }
  11811. }, {
  11812. hasAccessibleName: true
  11813. } ],
  11814. allowedRoles: [ 'button', 'checkbox', 'link', 'math', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'meter', 'option', 'progressbar', 'radio', 'scrollbar', 'separator', 'slider', 'switch', 'tab', 'treeitem', 'doc-cover' ]
  11815. },
  11816. usemap: {
  11817. matches: '[usemap]',
  11818. contentTypes: [ 'interactive', 'embedded', 'flow' ]
  11819. },
  11820. default: {
  11821. allowedRoles: [ 'presentation', 'none' ],
  11822. contentTypes: [ 'embedded', 'flow' ]
  11823. }
  11824. },
  11825. namingMethods: [ 'altText' ]
  11826. },
  11827. input: {
  11828. variant: {
  11829. button: {
  11830. matches: {
  11831. properties: {
  11832. type: 'button'
  11833. }
  11834. },
  11835. allowedRoles: [ 'checkbox', 'combobox', 'link', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'radio', 'switch', 'tab' ]
  11836. },
  11837. buttonType: {
  11838. matches: {
  11839. properties: {
  11840. type: [ 'button', 'submit', 'reset' ]
  11841. }
  11842. },
  11843. namingMethods: [ 'valueText', 'titleText', 'buttonDefaultText' ]
  11844. },
  11845. checkboxPressed: {
  11846. matches: {
  11847. properties: {
  11848. type: 'checkbox'
  11849. },
  11850. attributes: {
  11851. 'aria-pressed': '/.*/'
  11852. }
  11853. },
  11854. allowedRoles: [ 'button', 'menuitemcheckbox', 'option', 'switch' ],
  11855. implicitAttrs: {
  11856. 'aria-checked': 'false'
  11857. }
  11858. },
  11859. checkbox: {
  11860. matches: {
  11861. properties: {
  11862. type: 'checkbox'
  11863. },
  11864. attributes: {
  11865. 'aria-pressed': null
  11866. }
  11867. },
  11868. allowedRoles: [ 'menuitemcheckbox', 'option', 'switch' ],
  11869. implicitAttrs: {
  11870. 'aria-checked': 'false'
  11871. }
  11872. },
  11873. noRoles: {
  11874. matches: {
  11875. properties: {
  11876. type: [ 'color', 'date', 'datetime-local', 'file', 'month', 'number', 'password', 'range', 'reset', 'submit', 'time', 'week' ]
  11877. }
  11878. },
  11879. allowedRoles: false
  11880. },
  11881. hidden: {
  11882. matches: {
  11883. properties: {
  11884. type: 'hidden'
  11885. }
  11886. },
  11887. contentTypes: [ 'flow' ],
  11888. allowedRoles: false,
  11889. noAriaAttrs: true
  11890. },
  11891. image: {
  11892. matches: {
  11893. properties: {
  11894. type: 'image'
  11895. }
  11896. },
  11897. allowedRoles: [ 'link', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'radio', 'switch' ],
  11898. namingMethods: [ 'altText', 'valueText', 'labelText', 'titleText', 'buttonDefaultText' ]
  11899. },
  11900. radio: {
  11901. matches: {
  11902. properties: {
  11903. type: 'radio'
  11904. }
  11905. },
  11906. allowedRoles: [ 'menuitemradio' ],
  11907. implicitAttrs: {
  11908. 'aria-checked': 'false'
  11909. }
  11910. },
  11911. textWithList: {
  11912. matches: {
  11913. properties: {
  11914. type: 'text'
  11915. },
  11916. attributes: {
  11917. list: '/.*/'
  11918. }
  11919. },
  11920. allowedRoles: false
  11921. },
  11922. default: {
  11923. contentTypes: [ 'interactive', 'flow' ],
  11924. allowedRoles: [ 'combobox', 'searchbox', 'spinbutton' ],
  11925. implicitAttrs: {
  11926. 'aria-valuenow': ''
  11927. },
  11928. namingMethods: [ 'labelText', 'placeholderText' ]
  11929. }
  11930. }
  11931. },
  11932. ins: {
  11933. contentTypes: [ 'phrasing', 'flow' ],
  11934. allowedRoles: true
  11935. },
  11936. kbd: {
  11937. contentTypes: [ 'phrasing', 'flow' ],
  11938. allowedRoles: true
  11939. },
  11940. label: {
  11941. contentTypes: [ 'interactive', 'phrasing', 'flow' ],
  11942. allowedRoles: false,
  11943. chromiumRole: 'Label'
  11944. },
  11945. legend: {
  11946. allowedRoles: false
  11947. },
  11948. li: {
  11949. allowedRoles: [ 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'none', 'presentation', 'radio', 'separator', 'tab', 'treeitem', 'doc-biblioentry', 'doc-endnote' ],
  11950. implicitAttrs: {
  11951. 'aria-setsize': '1',
  11952. 'aria-posinset': '1'
  11953. }
  11954. },
  11955. link: {
  11956. contentTypes: [ 'phrasing', 'flow' ],
  11957. allowedRoles: false,
  11958. noAriaAttrs: true
  11959. },
  11960. main: {
  11961. contentTypes: [ 'flow' ],
  11962. allowedRoles: false,
  11963. shadowRoot: true
  11964. },
  11965. map: {
  11966. contentTypes: [ 'phrasing', 'flow' ],
  11967. allowedRoles: false,
  11968. noAriaAttrs: true
  11969. },
  11970. math: {
  11971. contentTypes: [ 'embedded', 'phrasing', 'flow' ],
  11972. allowedRoles: false
  11973. },
  11974. mark: {
  11975. contentTypes: [ 'phrasing', 'flow' ],
  11976. allowedRoles: true
  11977. },
  11978. menu: {
  11979. contentTypes: [ 'flow' ],
  11980. allowedRoles: [ 'directory', 'group', 'listbox', 'menu', 'menubar', 'none', 'presentation', 'radiogroup', 'tablist', 'toolbar', 'tree' ]
  11981. },
  11982. meta: {
  11983. variant: {
  11984. itemprop: {
  11985. matches: '[itemprop]',
  11986. contentTypes: [ 'phrasing', 'flow' ]
  11987. }
  11988. },
  11989. allowedRoles: false,
  11990. noAriaAttrs: true
  11991. },
  11992. meter: {
  11993. contentTypes: [ 'phrasing', 'flow' ],
  11994. allowedRoles: false,
  11995. chromiumRole: 'progressbar'
  11996. },
  11997. nav: {
  11998. contentTypes: [ 'sectioning', 'flow' ],
  11999. allowedRoles: [ 'doc-index', 'doc-pagelist', 'doc-toc', 'menu', 'menubar', 'none', 'presentation', 'tablist' ],
  12000. shadowRoot: true
  12001. },
  12002. noscript: {
  12003. contentTypes: [ 'phrasing', 'flow' ],
  12004. allowedRoles: false,
  12005. noAriaAttrs: true
  12006. },
  12007. object: {
  12008. variant: {
  12009. usemap: {
  12010. matches: '[usemap]',
  12011. contentTypes: [ 'interactive', 'embedded', 'phrasing', 'flow' ]
  12012. },
  12013. default: {
  12014. contentTypes: [ 'embedded', 'phrasing', 'flow' ]
  12015. }
  12016. },
  12017. allowedRoles: [ 'application', 'document', 'img' ],
  12018. chromiumRole: 'PluginObject'
  12019. },
  12020. ol: {
  12021. contentTypes: [ 'flow' ],
  12022. allowedRoles: [ 'directory', 'group', 'listbox', 'menu', 'menubar', 'none', 'presentation', 'radiogroup', 'tablist', 'toolbar', 'tree' ]
  12023. },
  12024. optgroup: {
  12025. allowedRoles: false
  12026. },
  12027. option: {
  12028. allowedRoles: false,
  12029. implicitAttrs: {
  12030. 'aria-selected': 'false'
  12031. }
  12032. },
  12033. output: {
  12034. contentTypes: [ 'phrasing', 'flow' ],
  12035. allowedRoles: true,
  12036. namingMethods: [ 'subtreeText' ]
  12037. },
  12038. p: {
  12039. contentTypes: [ 'flow' ],
  12040. allowedRoles: true,
  12041. shadowRoot: true
  12042. },
  12043. param: {
  12044. allowedRoles: false,
  12045. noAriaAttrs: true
  12046. },
  12047. picture: {
  12048. contentTypes: [ 'phrasing', 'flow' ],
  12049. allowedRoles: false,
  12050. noAriaAttrs: true
  12051. },
  12052. pre: {
  12053. contentTypes: [ 'flow' ],
  12054. allowedRoles: true
  12055. },
  12056. progress: {
  12057. contentTypes: [ 'phrasing', 'flow' ],
  12058. allowedRoles: false,
  12059. implicitAttrs: {
  12060. 'aria-valuemax': '100',
  12061. 'aria-valuemin': '0',
  12062. 'aria-valuenow': '0'
  12063. }
  12064. },
  12065. q: {
  12066. contentTypes: [ 'phrasing', 'flow' ],
  12067. allowedRoles: true
  12068. },
  12069. rp: {
  12070. allowedRoles: true
  12071. },
  12072. rt: {
  12073. allowedRoles: true
  12074. },
  12075. ruby: {
  12076. contentTypes: [ 'phrasing', 'flow' ],
  12077. allowedRoles: true
  12078. },
  12079. s: {
  12080. contentTypes: [ 'phrasing', 'flow' ],
  12081. allowedRoles: true
  12082. },
  12083. samp: {
  12084. contentTypes: [ 'phrasing', 'flow' ],
  12085. allowedRoles: true
  12086. },
  12087. script: {
  12088. contentTypes: [ 'phrasing', 'flow' ],
  12089. allowedRoles: false,
  12090. noAriaAttrs: true
  12091. },
  12092. search: {
  12093. contentTypes: [ 'flow' ],
  12094. allowedRoles: [ 'form', 'group', 'none', 'presentation', 'region', 'search' ]
  12095. },
  12096. section: {
  12097. contentTypes: [ 'sectioning', 'flow' ],
  12098. allowedRoles: [ 'alert', 'alertdialog', 'application', 'banner', 'complementary', 'contentinfo', 'dialog', 'document', 'feed', 'group', 'log', 'main', 'marquee', 'navigation', 'none', 'note', 'presentation', 'search', 'status', 'tabpanel', 'doc-abstract', 'doc-acknowledgments', 'doc-afterword', 'doc-appendix', 'doc-bibliography', 'doc-chapter', 'doc-colophon', 'doc-conclusion', 'doc-credit', 'doc-credits', 'doc-dedication', 'doc-endnotes', 'doc-epigraph', 'doc-epilogue', 'doc-errata', 'doc-example', 'doc-foreword', 'doc-glossary', 'doc-index', 'doc-introduction', 'doc-notice', 'doc-pagelist', 'doc-part', 'doc-preface', 'doc-prologue', 'doc-pullquote', 'doc-qna', 'doc-toc' ],
  12099. shadowRoot: true
  12100. },
  12101. select: {
  12102. variant: {
  12103. combobox: {
  12104. matches: {
  12105. attributes: {
  12106. multiple: null,
  12107. size: [ null, '1' ]
  12108. }
  12109. },
  12110. allowedRoles: [ 'menu' ]
  12111. },
  12112. default: {
  12113. allowedRoles: false
  12114. }
  12115. },
  12116. contentTypes: [ 'interactive', 'phrasing', 'flow' ],
  12117. implicitAttrs: {
  12118. 'aria-valuenow': ''
  12119. },
  12120. namingMethods: [ 'labelText' ]
  12121. },
  12122. slot: {
  12123. contentTypes: [ 'phrasing', 'flow' ],
  12124. allowedRoles: false,
  12125. noAriaAttrs: true
  12126. },
  12127. small: {
  12128. contentTypes: [ 'phrasing', 'flow' ],
  12129. allowedRoles: true
  12130. },
  12131. source: {
  12132. allowedRoles: false,
  12133. noAriaAttrs: true
  12134. },
  12135. span: {
  12136. contentTypes: [ 'phrasing', 'flow' ],
  12137. allowedRoles: true,
  12138. shadowRoot: true
  12139. },
  12140. strong: {
  12141. contentTypes: [ 'phrasing', 'flow' ],
  12142. allowedRoles: true
  12143. },
  12144. style: {
  12145. allowedRoles: false,
  12146. noAriaAttrs: true
  12147. },
  12148. svg: {
  12149. contentTypes: [ 'embedded', 'phrasing', 'flow' ],
  12150. allowedRoles: true,
  12151. chromiumRole: 'SVGRoot',
  12152. namingMethods: [ 'svgTitleText' ]
  12153. },
  12154. sub: {
  12155. contentTypes: [ 'phrasing', 'flow' ],
  12156. allowedRoles: true
  12157. },
  12158. summary: {
  12159. allowedRoles: false,
  12160. namingMethods: [ 'subtreeText' ]
  12161. },
  12162. sup: {
  12163. contentTypes: [ 'phrasing', 'flow' ],
  12164. allowedRoles: true
  12165. },
  12166. table: {
  12167. contentTypes: [ 'flow' ],
  12168. allowedRoles: true,
  12169. namingMethods: [ 'tableCaptionText', 'tableSummaryText' ]
  12170. },
  12171. tbody: {
  12172. allowedRoles: true
  12173. },
  12174. template: {
  12175. contentTypes: [ 'phrasing', 'flow' ],
  12176. allowedRoles: false,
  12177. noAriaAttrs: true
  12178. },
  12179. textarea: {
  12180. contentTypes: [ 'interactive', 'phrasing', 'flow' ],
  12181. allowedRoles: false,
  12182. implicitAttrs: {
  12183. 'aria-valuenow': '',
  12184. 'aria-multiline': 'true'
  12185. },
  12186. namingMethods: [ 'labelText', 'placeholderText' ]
  12187. },
  12188. tfoot: {
  12189. allowedRoles: true
  12190. },
  12191. thead: {
  12192. allowedRoles: true
  12193. },
  12194. time: {
  12195. contentTypes: [ 'phrasing', 'flow' ],
  12196. allowedRoles: true
  12197. },
  12198. title: {
  12199. allowedRoles: false,
  12200. noAriaAttrs: true
  12201. },
  12202. td: {
  12203. allowedRoles: true
  12204. },
  12205. th: {
  12206. allowedRoles: true
  12207. },
  12208. tr: {
  12209. allowedRoles: true
  12210. },
  12211. track: {
  12212. allowedRoles: false,
  12213. noAriaAttrs: true
  12214. },
  12215. u: {
  12216. contentTypes: [ 'phrasing', 'flow' ],
  12217. allowedRoles: true
  12218. },
  12219. ul: {
  12220. contentTypes: [ 'flow' ],
  12221. allowedRoles: [ 'directory', 'group', 'listbox', 'menu', 'menubar', 'none', 'presentation', 'radiogroup', 'tablist', 'toolbar', 'tree' ]
  12222. },
  12223. var: {
  12224. contentTypes: [ 'phrasing', 'flow' ],
  12225. allowedRoles: true
  12226. },
  12227. video: {
  12228. variant: {
  12229. controls: {
  12230. matches: '[controls]',
  12231. contentTypes: [ 'interactive', 'embedded', 'phrasing', 'flow' ]
  12232. },
  12233. default: {
  12234. contentTypes: [ 'embedded', 'phrasing', 'flow' ]
  12235. }
  12236. },
  12237. allowedRoles: [ 'application' ],
  12238. chromiumRole: 'video'
  12239. },
  12240. wbr: {
  12241. contentTypes: [ 'phrasing', 'flow' ],
  12242. allowedRoles: [ 'presentation', 'none' ]
  12243. }
  12244. };
  12245. var html_elms_default = htmlElms;
  12246. var cssColors = {
  12247. aliceblue: [ 240, 248, 255 ],
  12248. antiquewhite: [ 250, 235, 215 ],
  12249. aqua: [ 0, 255, 255 ],
  12250. aquamarine: [ 127, 255, 212 ],
  12251. azure: [ 240, 255, 255 ],
  12252. beige: [ 245, 245, 220 ],
  12253. bisque: [ 255, 228, 196 ],
  12254. black: [ 0, 0, 0 ],
  12255. blanchedalmond: [ 255, 235, 205 ],
  12256. blue: [ 0, 0, 255 ],
  12257. blueviolet: [ 138, 43, 226 ],
  12258. brown: [ 165, 42, 42 ],
  12259. burlywood: [ 222, 184, 135 ],
  12260. cadetblue: [ 95, 158, 160 ],
  12261. chartreuse: [ 127, 255, 0 ],
  12262. chocolate: [ 210, 105, 30 ],
  12263. coral: [ 255, 127, 80 ],
  12264. cornflowerblue: [ 100, 149, 237 ],
  12265. cornsilk: [ 255, 248, 220 ],
  12266. crimson: [ 220, 20, 60 ],
  12267. cyan: [ 0, 255, 255 ],
  12268. darkblue: [ 0, 0, 139 ],
  12269. darkcyan: [ 0, 139, 139 ],
  12270. darkgoldenrod: [ 184, 134, 11 ],
  12271. darkgray: [ 169, 169, 169 ],
  12272. darkgreen: [ 0, 100, 0 ],
  12273. darkgrey: [ 169, 169, 169 ],
  12274. darkkhaki: [ 189, 183, 107 ],
  12275. darkmagenta: [ 139, 0, 139 ],
  12276. darkolivegreen: [ 85, 107, 47 ],
  12277. darkorange: [ 255, 140, 0 ],
  12278. darkorchid: [ 153, 50, 204 ],
  12279. darkred: [ 139, 0, 0 ],
  12280. darksalmon: [ 233, 150, 122 ],
  12281. darkseagreen: [ 143, 188, 143 ],
  12282. darkslateblue: [ 72, 61, 139 ],
  12283. darkslategray: [ 47, 79, 79 ],
  12284. darkslategrey: [ 47, 79, 79 ],
  12285. darkturquoise: [ 0, 206, 209 ],
  12286. darkviolet: [ 148, 0, 211 ],
  12287. deeppink: [ 255, 20, 147 ],
  12288. deepskyblue: [ 0, 191, 255 ],
  12289. dimgray: [ 105, 105, 105 ],
  12290. dimgrey: [ 105, 105, 105 ],
  12291. dodgerblue: [ 30, 144, 255 ],
  12292. firebrick: [ 178, 34, 34 ],
  12293. floralwhite: [ 255, 250, 240 ],
  12294. forestgreen: [ 34, 139, 34 ],
  12295. fuchsia: [ 255, 0, 255 ],
  12296. gainsboro: [ 220, 220, 220 ],
  12297. ghostwhite: [ 248, 248, 255 ],
  12298. gold: [ 255, 215, 0 ],
  12299. goldenrod: [ 218, 165, 32 ],
  12300. gray: [ 128, 128, 128 ],
  12301. green: [ 0, 128, 0 ],
  12302. greenyellow: [ 173, 255, 47 ],
  12303. grey: [ 128, 128, 128 ],
  12304. honeydew: [ 240, 255, 240 ],
  12305. hotpink: [ 255, 105, 180 ],
  12306. indianred: [ 205, 92, 92 ],
  12307. indigo: [ 75, 0, 130 ],
  12308. ivory: [ 255, 255, 240 ],
  12309. khaki: [ 240, 230, 140 ],
  12310. lavender: [ 230, 230, 250 ],
  12311. lavenderblush: [ 255, 240, 245 ],
  12312. lawngreen: [ 124, 252, 0 ],
  12313. lemonchiffon: [ 255, 250, 205 ],
  12314. lightblue: [ 173, 216, 230 ],
  12315. lightcoral: [ 240, 128, 128 ],
  12316. lightcyan: [ 224, 255, 255 ],
  12317. lightgoldenrodyellow: [ 250, 250, 210 ],
  12318. lightgray: [ 211, 211, 211 ],
  12319. lightgreen: [ 144, 238, 144 ],
  12320. lightgrey: [ 211, 211, 211 ],
  12321. lightpink: [ 255, 182, 193 ],
  12322. lightsalmon: [ 255, 160, 122 ],
  12323. lightseagreen: [ 32, 178, 170 ],
  12324. lightskyblue: [ 135, 206, 250 ],
  12325. lightslategray: [ 119, 136, 153 ],
  12326. lightslategrey: [ 119, 136, 153 ],
  12327. lightsteelblue: [ 176, 196, 222 ],
  12328. lightyellow: [ 255, 255, 224 ],
  12329. lime: [ 0, 255, 0 ],
  12330. limegreen: [ 50, 205, 50 ],
  12331. linen: [ 250, 240, 230 ],
  12332. magenta: [ 255, 0, 255 ],
  12333. maroon: [ 128, 0, 0 ],
  12334. mediumaquamarine: [ 102, 205, 170 ],
  12335. mediumblue: [ 0, 0, 205 ],
  12336. mediumorchid: [ 186, 85, 211 ],
  12337. mediumpurple: [ 147, 112, 219 ],
  12338. mediumseagreen: [ 60, 179, 113 ],
  12339. mediumslateblue: [ 123, 104, 238 ],
  12340. mediumspringgreen: [ 0, 250, 154 ],
  12341. mediumturquoise: [ 72, 209, 204 ],
  12342. mediumvioletred: [ 199, 21, 133 ],
  12343. midnightblue: [ 25, 25, 112 ],
  12344. mintcream: [ 245, 255, 250 ],
  12345. mistyrose: [ 255, 228, 225 ],
  12346. moccasin: [ 255, 228, 181 ],
  12347. navajowhite: [ 255, 222, 173 ],
  12348. navy: [ 0, 0, 128 ],
  12349. oldlace: [ 253, 245, 230 ],
  12350. olive: [ 128, 128, 0 ],
  12351. olivedrab: [ 107, 142, 35 ],
  12352. orange: [ 255, 165, 0 ],
  12353. orangered: [ 255, 69, 0 ],
  12354. orchid: [ 218, 112, 214 ],
  12355. palegoldenrod: [ 238, 232, 170 ],
  12356. palegreen: [ 152, 251, 152 ],
  12357. paleturquoise: [ 175, 238, 238 ],
  12358. palevioletred: [ 219, 112, 147 ],
  12359. papayawhip: [ 255, 239, 213 ],
  12360. peachpuff: [ 255, 218, 185 ],
  12361. peru: [ 205, 133, 63 ],
  12362. pink: [ 255, 192, 203 ],
  12363. plum: [ 221, 160, 221 ],
  12364. powderblue: [ 176, 224, 230 ],
  12365. purple: [ 128, 0, 128 ],
  12366. rebeccapurple: [ 102, 51, 153 ],
  12367. red: [ 255, 0, 0 ],
  12368. rosybrown: [ 188, 143, 143 ],
  12369. royalblue: [ 65, 105, 225 ],
  12370. saddlebrown: [ 139, 69, 19 ],
  12371. salmon: [ 250, 128, 114 ],
  12372. sandybrown: [ 244, 164, 96 ],
  12373. seagreen: [ 46, 139, 87 ],
  12374. seashell: [ 255, 245, 238 ],
  12375. sienna: [ 160, 82, 45 ],
  12376. silver: [ 192, 192, 192 ],
  12377. skyblue: [ 135, 206, 235 ],
  12378. slateblue: [ 106, 90, 205 ],
  12379. slategray: [ 112, 128, 144 ],
  12380. slategrey: [ 112, 128, 144 ],
  12381. snow: [ 255, 250, 250 ],
  12382. springgreen: [ 0, 255, 127 ],
  12383. steelblue: [ 70, 130, 180 ],
  12384. tan: [ 210, 180, 140 ],
  12385. teal: [ 0, 128, 128 ],
  12386. thistle: [ 216, 191, 216 ],
  12387. tomato: [ 255, 99, 71 ],
  12388. turquoise: [ 64, 224, 208 ],
  12389. violet: [ 238, 130, 238 ],
  12390. wheat: [ 245, 222, 179 ],
  12391. white: [ 255, 255, 255 ],
  12392. whitesmoke: [ 245, 245, 245 ],
  12393. yellow: [ 255, 255, 0 ],
  12394. yellowgreen: [ 154, 205, 50 ]
  12395. };
  12396. var css_colors_default = cssColors;
  12397. var originals = {
  12398. ariaAttrs: aria_attrs_default,
  12399. ariaRoles: _extends({}, aria_roles_default, dpub_roles_default, graphics_roles_default),
  12400. htmlElms: html_elms_default,
  12401. cssColors: css_colors_default
  12402. };
  12403. var standards = _extends({}, originals);
  12404. function configureStandards(config) {
  12405. Object.keys(standards).forEach(function(propName) {
  12406. if (config[propName]) {
  12407. standards[propName] = deep_merge_default(standards[propName], config[propName]);
  12408. }
  12409. });
  12410. }
  12411. function resetStandards() {
  12412. Object.keys(standards).forEach(function(propName) {
  12413. standards[propName] = originals[propName];
  12414. });
  12415. }
  12416. var standards_default = standards;
  12417. function isUnsupportedRole(role) {
  12418. var roleDefinition = standards_default.ariaRoles[role];
  12419. return roleDefinition ? !!roleDefinition.unsupported : false;
  12420. }
  12421. var is_unsupported_role_default = isUnsupportedRole;
  12422. function isValidRole(role) {
  12423. var _ref26 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, allowAbstract = _ref26.allowAbstract, _ref26$flagUnsupporte = _ref26.flagUnsupported, flagUnsupported = _ref26$flagUnsupporte === void 0 ? false : _ref26$flagUnsupporte;
  12424. var roleDefinition = standards_default.ariaRoles[role];
  12425. var isRoleUnsupported = is_unsupported_role_default(role);
  12426. if (!roleDefinition || flagUnsupported && isRoleUnsupported) {
  12427. return false;
  12428. }
  12429. return allowAbstract ? true : roleDefinition.type !== 'abstract';
  12430. }
  12431. var is_valid_role_default = isValidRole;
  12432. function getExplicitRole(vNode) {
  12433. var _ref27 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, fallback = _ref27.fallback, abstracts = _ref27.abstracts, dpub = _ref27.dpub;
  12434. vNode = vNode instanceof abstract_virtual_node_default ? vNode : get_node_from_tree_default(vNode);
  12435. if (vNode.props.nodeType !== 1) {
  12436. return null;
  12437. }
  12438. var roleAttr = (vNode.attr('role') || '').trim().toLowerCase();
  12439. var roleList = fallback ? token_list_default(roleAttr) : [ roleAttr ];
  12440. var firstValidRole = roleList.find(function(role) {
  12441. if (!dpub && role.substr(0, 4) === 'doc-') {
  12442. return false;
  12443. }
  12444. return is_valid_role_default(role, {
  12445. allowAbstract: abstracts
  12446. });
  12447. });
  12448. return firstValidRole || null;
  12449. }
  12450. var get_explicit_role_default = getExplicitRole;
  12451. function getElementsByContentType(type2) {
  12452. return Object.keys(standards_default.htmlElms).filter(function(nodeName2) {
  12453. var elm = standards_default.htmlElms[nodeName2];
  12454. if (elm.contentTypes) {
  12455. return elm.contentTypes.includes(type2);
  12456. }
  12457. if (!elm.variant) {
  12458. return false;
  12459. }
  12460. if (elm.variant['default'] && elm.variant['default'].contentTypes) {
  12461. return elm.variant['default'].contentTypes.includes(type2);
  12462. }
  12463. return false;
  12464. });
  12465. }
  12466. var get_elements_by_content_type_default = getElementsByContentType;
  12467. function getGlobalAriaAttrs() {
  12468. return cache_default.get('globalAriaAttrs', function() {
  12469. return Object.keys(standards_default.ariaAttrs).filter(function(attrName) {
  12470. return standards_default.ariaAttrs[attrName].global;
  12471. });
  12472. });
  12473. }
  12474. var get_global_aria_attrs_default = getGlobalAriaAttrs;
  12475. function toGrid(node) {
  12476. var table = [];
  12477. var rows = node.rows;
  12478. for (var _i9 = 0, rowLength = rows.length; _i9 < rowLength; _i9++) {
  12479. var cells = rows[_i9].cells;
  12480. table[_i9] = table[_i9] || [];
  12481. var columnIndex = 0;
  12482. for (var j = 0, cellLength = cells.length; j < cellLength; j++) {
  12483. for (var colSpan = 0; colSpan < cells[j].colSpan; colSpan++) {
  12484. var rowspanAttr = cells[j].getAttribute('rowspan');
  12485. var rowspanValue = parseInt(rowspanAttr) === 0 || cells[j].rowspan === 0 ? rows.length : cells[j].rowSpan;
  12486. for (var rowSpan = 0; rowSpan < rowspanValue; rowSpan++) {
  12487. table[_i9 + rowSpan] = table[_i9 + rowSpan] || [];
  12488. while (table[_i9 + rowSpan][columnIndex]) {
  12489. columnIndex++;
  12490. }
  12491. table[_i9 + rowSpan][columnIndex] = cells[j];
  12492. }
  12493. columnIndex++;
  12494. }
  12495. }
  12496. }
  12497. return table;
  12498. }
  12499. var to_grid_default = memoize_default(toGrid);
  12500. function getCellPosition(cell, tableGrid) {
  12501. var rowIndex, index;
  12502. if (!tableGrid) {
  12503. tableGrid = to_grid_default(find_up_default(cell, 'table'));
  12504. }
  12505. for (rowIndex = 0; rowIndex < tableGrid.length; rowIndex++) {
  12506. if (tableGrid[rowIndex]) {
  12507. index = tableGrid[rowIndex].indexOf(cell);
  12508. if (index !== -1) {
  12509. return {
  12510. x: index,
  12511. y: rowIndex
  12512. };
  12513. }
  12514. }
  12515. }
  12516. }
  12517. var get_cell_position_default = memoize_default(getCellPosition);
  12518. function _getScope(el) {
  12519. var _nodeLookup9 = _nodeLookup(el), vNode = _nodeLookup9.vNode, cell = _nodeLookup9.domNode;
  12520. var scope = vNode.attr('scope');
  12521. var role = vNode.attr('role');
  12522. if (![ 'td', 'th' ].includes(vNode.props.nodeName)) {
  12523. throw new TypeError('Expected TD or TH element');
  12524. }
  12525. if (role === 'columnheader') {
  12526. return 'col';
  12527. } else if (role === 'rowheader') {
  12528. return 'row';
  12529. } else if (scope === 'col' || scope === 'row') {
  12530. return scope;
  12531. } else if (vNode.props.nodeName !== 'th') {
  12532. return false;
  12533. } else if (!vNode.actualNode) {
  12534. return 'auto';
  12535. }
  12536. var tableGrid = to_grid_default(find_up_default(cell, 'table'));
  12537. var pos = get_cell_position_default(cell, tableGrid);
  12538. var headerRow = tableGrid[pos.y].every(function(node) {
  12539. return node.nodeName.toUpperCase() === 'TH';
  12540. });
  12541. if (headerRow) {
  12542. return 'col';
  12543. }
  12544. var headerCol = tableGrid.map(function(col) {
  12545. return col[pos.x];
  12546. }).every(function(node) {
  12547. return node && node.nodeName.toUpperCase() === 'TH';
  12548. });
  12549. if (headerCol) {
  12550. return 'row';
  12551. }
  12552. return 'auto';
  12553. }
  12554. function isColumnHeader(element) {
  12555. return [ 'col', 'auto' ].indexOf(_getScope(element)) !== -1;
  12556. }
  12557. var is_column_header_default = isColumnHeader;
  12558. function isRowHeader(cell) {
  12559. return [ 'row', 'auto' ].includes(_getScope(cell));
  12560. }
  12561. var is_row_header_default = isRowHeader;
  12562. function sanitize(str) {
  12563. if (!str) {
  12564. return '';
  12565. }
  12566. return str.replace(/\r\n/g, '\n').replace(/\u00A0/g, ' ').replace(/[\s]{2,}/g, ' ').trim();
  12567. }
  12568. var sanitize_default = sanitize;
  12569. var getSectioningContentSelector = function getSectioningContentSelector() {
  12570. return cache_default.get('sectioningContentSelector', function() {
  12571. return get_elements_by_content_type_default('sectioning').map(function(nodeName2) {
  12572. return ''.concat(nodeName2, ':not([role])');
  12573. }).join(', ') + ' , [role=article], [role=complementary], [role=navigation], [role=region]';
  12574. });
  12575. };
  12576. var getSectioningContentPlusMainSelector = function getSectioningContentPlusMainSelector() {
  12577. return cache_default.get('sectioningContentPlusMainSelector', function() {
  12578. return getSectioningContentSelector() + ' , main:not([role]), [role=main]';
  12579. });
  12580. };
  12581. function hasAccessibleName(vNode) {
  12582. var _ref28 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref28$checkTitle = _ref28.checkTitle, checkTitle = _ref28$checkTitle === void 0 ? false : _ref28$checkTitle;
  12583. return !!(sanitize_default(arialabelledby_text_default(vNode)) || sanitize_default(_arialabelText(vNode)) || checkTitle && (vNode === null || vNode === void 0 ? void 0 : vNode.props.nodeType) === 1 && sanitize_default(vNode.attr('title')));
  12584. }
  12585. var implicitHtmlRoles = {
  12586. a: function a(vNode) {
  12587. return vNode.hasAttr('href') ? 'link' : null;
  12588. },
  12589. area: function area(vNode) {
  12590. return vNode.hasAttr('href') ? 'link' : null;
  12591. },
  12592. article: 'article',
  12593. aside: function aside(vNode) {
  12594. if (closest_default(vNode.parent, getSectioningContentSelector()) && !hasAccessibleName(vNode, {
  12595. checkTitle: true
  12596. })) {
  12597. return null;
  12598. }
  12599. return 'complementary';
  12600. },
  12601. body: 'document',
  12602. button: 'button',
  12603. datalist: 'listbox',
  12604. dd: 'definition',
  12605. dfn: 'term',
  12606. details: 'group',
  12607. dialog: 'dialog',
  12608. dt: 'term',
  12609. fieldset: 'group',
  12610. figure: 'figure',
  12611. footer: function footer(vNode) {
  12612. var sectioningElement = closest_default(vNode, getSectioningContentPlusMainSelector());
  12613. return !sectioningElement ? 'contentinfo' : null;
  12614. },
  12615. form: function form(vNode) {
  12616. return hasAccessibleName(vNode) ? 'form' : null;
  12617. },
  12618. h1: 'heading',
  12619. h2: 'heading',
  12620. h3: 'heading',
  12621. h4: 'heading',
  12622. h5: 'heading',
  12623. h6: 'heading',
  12624. header: function header(vNode) {
  12625. var sectioningElement = closest_default(vNode, getSectioningContentPlusMainSelector());
  12626. return !sectioningElement ? 'banner' : null;
  12627. },
  12628. hr: 'separator',
  12629. img: function img(vNode) {
  12630. var emptyAlt = vNode.hasAttr('alt') && !vNode.attr('alt');
  12631. var hasGlobalAria = get_global_aria_attrs_default().find(function(attr) {
  12632. return vNode.hasAttr(attr);
  12633. });
  12634. return emptyAlt && !hasGlobalAria && !_isFocusable(vNode) ? 'presentation' : 'img';
  12635. },
  12636. input: function input(vNode) {
  12637. var suggestionsSourceElement;
  12638. if (vNode.hasAttr('list')) {
  12639. var listElement = idrefs_default(vNode.actualNode, 'list').filter(function(node) {
  12640. return !!node;
  12641. })[0];
  12642. suggestionsSourceElement = listElement && listElement.nodeName.toLowerCase() === 'datalist';
  12643. }
  12644. switch (vNode.props.type) {
  12645. case 'checkbox':
  12646. return 'checkbox';
  12647. case 'number':
  12648. return 'spinbutton';
  12649. case 'radio':
  12650. return 'radio';
  12651. case 'range':
  12652. return 'slider';
  12653. case 'search':
  12654. return !suggestionsSourceElement ? 'searchbox' : 'combobox';
  12655. case 'button':
  12656. case 'image':
  12657. case 'reset':
  12658. case 'submit':
  12659. return 'button';
  12660. case 'text':
  12661. case 'tel':
  12662. case 'url':
  12663. case 'email':
  12664. case '':
  12665. return !suggestionsSourceElement ? 'textbox' : 'combobox';
  12666. default:
  12667. return 'textbox';
  12668. }
  12669. },
  12670. li: 'listitem',
  12671. main: 'main',
  12672. math: 'math',
  12673. menu: 'list',
  12674. meter: 'meter',
  12675. nav: 'navigation',
  12676. ol: 'list',
  12677. optgroup: 'group',
  12678. option: 'option',
  12679. output: 'status',
  12680. progress: 'progressbar',
  12681. search: 'search',
  12682. section: function section(vNode) {
  12683. return hasAccessibleName(vNode) ? 'region' : null;
  12684. },
  12685. select: function select(vNode) {
  12686. return vNode.hasAttr('multiple') || parseInt(vNode.attr('size')) > 1 ? 'listbox' : 'combobox';
  12687. },
  12688. summary: 'button',
  12689. table: 'table',
  12690. tbody: 'rowgroup',
  12691. td: function td(vNode) {
  12692. var table = closest_default(vNode, 'table');
  12693. var role = get_explicit_role_default(table);
  12694. return [ 'grid', 'treegrid' ].includes(role) ? 'gridcell' : 'cell';
  12695. },
  12696. textarea: 'textbox',
  12697. tfoot: 'rowgroup',
  12698. th: function th(vNode) {
  12699. if (is_column_header_default(vNode)) {
  12700. return 'columnheader';
  12701. }
  12702. if (is_row_header_default(vNode)) {
  12703. return 'rowheader';
  12704. }
  12705. },
  12706. thead: 'rowgroup',
  12707. tr: 'row',
  12708. ul: 'list'
  12709. };
  12710. var implicit_html_roles_default = implicitHtmlRoles;
  12711. function fromPrimative(someString, matcher) {
  12712. var matcherType = _typeof(matcher);
  12713. if (Array.isArray(matcher) && typeof someString !== 'undefined') {
  12714. return matcher.includes(someString);
  12715. }
  12716. if (matcherType === 'function') {
  12717. return !!matcher(someString);
  12718. }
  12719. if (someString !== null && someString !== void 0) {
  12720. if (matcher instanceof RegExp) {
  12721. return matcher.test(someString);
  12722. }
  12723. if (/^\/.*\/$/.test(matcher)) {
  12724. var pattern = matcher.substring(1, matcher.length - 1);
  12725. return new RegExp(pattern).test(someString);
  12726. }
  12727. }
  12728. return matcher === someString;
  12729. }
  12730. var from_primative_default = fromPrimative;
  12731. function hasAccessibleName2(vNode, matcher) {
  12732. return from_primative_default(!!_accessibleTextVirtual(vNode), matcher);
  12733. }
  12734. var has_accessible_name_default = hasAccessibleName2;
  12735. function fromFunction(getValue, matcher) {
  12736. var matcherType = _typeof(matcher);
  12737. if (matcherType !== 'object' || Array.isArray(matcher) || matcher instanceof RegExp) {
  12738. throw new Error('Expect matcher to be an object');
  12739. }
  12740. return Object.keys(matcher).every(function(propName) {
  12741. return from_primative_default(getValue(propName), matcher[propName]);
  12742. });
  12743. }
  12744. var from_function_default = fromFunction;
  12745. function attributes(vNode, matcher) {
  12746. vNode = _nodeLookup(vNode).vNode;
  12747. return from_function_default(function(attrName) {
  12748. return vNode.attr(attrName);
  12749. }, matcher);
  12750. }
  12751. var attributes_default = attributes;
  12752. function condition(arg, matcher) {
  12753. return !!matcher(arg);
  12754. }
  12755. function explicitRole(vNode, matcher) {
  12756. return from_primative_default(get_explicit_role_default(vNode), matcher);
  12757. }
  12758. var explicit_role_default = explicitRole;
  12759. function implicitRole(vNode, matcher) {
  12760. return from_primative_default(implicit_role_default(vNode), matcher);
  12761. }
  12762. var implicit_role_default2 = implicitRole;
  12763. function nodeName(vNode, matcher) {
  12764. vNode = _nodeLookup(vNode).vNode;
  12765. return from_primative_default(vNode.props.nodeName, matcher);
  12766. }
  12767. var node_name_default = nodeName;
  12768. function properties(vNode, matcher) {
  12769. vNode = _nodeLookup(vNode).vNode;
  12770. return from_function_default(function(propName) {
  12771. return vNode.props[propName];
  12772. }, matcher);
  12773. }
  12774. var properties_default = properties;
  12775. function semanticRole(vNode, matcher) {
  12776. return from_primative_default(get_role_default(vNode), matcher);
  12777. }
  12778. var semantic_role_default = semanticRole;
  12779. var matchers = {
  12780. hasAccessibleName: has_accessible_name_default,
  12781. attributes: attributes_default,
  12782. condition: condition,
  12783. explicitRole: explicit_role_default,
  12784. implicitRole: implicit_role_default2,
  12785. nodeName: node_name_default,
  12786. properties: properties_default,
  12787. semanticRole: semantic_role_default
  12788. };
  12789. function fromDefinition(vNode, definition) {
  12790. vNode = _nodeLookup(vNode).vNode;
  12791. if (Array.isArray(definition)) {
  12792. return definition.some(function(definitionItem) {
  12793. return fromDefinition(vNode, definitionItem);
  12794. });
  12795. }
  12796. if (typeof definition === 'string') {
  12797. return _matches(vNode, definition);
  12798. }
  12799. return Object.keys(definition).every(function(matcherName) {
  12800. if (!matchers[matcherName]) {
  12801. throw new Error('Unknown matcher type "'.concat(matcherName, '"'));
  12802. }
  12803. var matchMethod = matchers[matcherName];
  12804. var matcher = definition[matcherName];
  12805. return matchMethod(vNode, matcher);
  12806. });
  12807. }
  12808. var from_definition_default = fromDefinition;
  12809. function matches2(vNode, definition) {
  12810. return from_definition_default(vNode, definition);
  12811. }
  12812. var matches_default = matches2;
  12813. matches_default.hasAccessibleName = has_accessible_name_default;
  12814. matches_default.attributes = attributes_default;
  12815. matches_default.condition = condition;
  12816. matches_default.explicitRole = explicit_role_default;
  12817. matches_default.fromDefinition = from_definition_default;
  12818. matches_default.fromFunction = from_function_default;
  12819. matches_default.fromPrimative = from_primative_default;
  12820. matches_default.implicitRole = implicit_role_default2;
  12821. matches_default.nodeName = node_name_default;
  12822. matches_default.properties = properties_default;
  12823. matches_default.semanticRole = semantic_role_default;
  12824. var matches_default2 = matches_default;
  12825. function getElementSpec(vNode) {
  12826. var _ref29 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref29$noMatchAccessi = _ref29.noMatchAccessibleName, noMatchAccessibleName = _ref29$noMatchAccessi === void 0 ? false : _ref29$noMatchAccessi;
  12827. var standard = standards_default.htmlElms[vNode.props.nodeName];
  12828. if (!standard) {
  12829. return {};
  12830. }
  12831. if (!standard.variant) {
  12832. return standard;
  12833. }
  12834. var variant = standard.variant, spec = _objectWithoutProperties(standard, _excluded4);
  12835. for (var variantName in variant) {
  12836. if (!variant.hasOwnProperty(variantName) || variantName === 'default') {
  12837. continue;
  12838. }
  12839. var _variant$variantName = variant[variantName], matches4 = _variant$variantName.matches, props = _objectWithoutProperties(_variant$variantName, _excluded5);
  12840. var matchProperties = Array.isArray(matches4) ? matches4 : [ matches4 ];
  12841. for (var _i10 = 0; _i10 < matchProperties.length && noMatchAccessibleName; _i10++) {
  12842. if (matchProperties[_i10].hasOwnProperty('hasAccessibleName')) {
  12843. return standard;
  12844. }
  12845. }
  12846. if (matches_default2(vNode, matches4)) {
  12847. for (var propName in props) {
  12848. if (props.hasOwnProperty(propName)) {
  12849. spec[propName] = props[propName];
  12850. }
  12851. }
  12852. }
  12853. }
  12854. for (var _propName in variant['default']) {
  12855. if (variant['default'].hasOwnProperty(_propName) && typeof spec[_propName] === 'undefined') {
  12856. spec[_propName] = variant['default'][_propName];
  12857. }
  12858. }
  12859. return spec;
  12860. }
  12861. var get_element_spec_default = getElementSpec;
  12862. function implicitRole2(node) {
  12863. var _ref30 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, chromium = _ref30.chromium;
  12864. var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  12865. node = vNode.actualNode;
  12866. if (!vNode) {
  12867. throw new ReferenceError('Cannot get implicit role of a node outside the current scope.');
  12868. }
  12869. var nodeName2 = vNode.props.nodeName;
  12870. var role = implicit_html_roles_default[nodeName2];
  12871. if (!role && chromium) {
  12872. var _get_element_spec_def = get_element_spec_default(vNode), chromiumRole = _get_element_spec_def.chromiumRole;
  12873. return chromiumRole || null;
  12874. }
  12875. if (typeof role === 'function') {
  12876. return role(vNode);
  12877. }
  12878. return role || null;
  12879. }
  12880. var implicit_role_default = implicitRole2;
  12881. var inheritsPresentationChain = {
  12882. td: [ 'tr' ],
  12883. th: [ 'tr' ],
  12884. tr: [ 'thead', 'tbody', 'tfoot', 'table' ],
  12885. thead: [ 'table' ],
  12886. tbody: [ 'table' ],
  12887. tfoot: [ 'table' ],
  12888. li: [ 'ol', 'ul' ],
  12889. dt: [ 'dl', 'div' ],
  12890. dd: [ 'dl', 'div' ],
  12891. div: [ 'dl' ]
  12892. };
  12893. function getInheritedRole(vNode, explicitRoleOptions) {
  12894. var parentNodeNames = inheritsPresentationChain[vNode.props.nodeName];
  12895. if (!parentNodeNames) {
  12896. return null;
  12897. }
  12898. if (!vNode.parent) {
  12899. if (!vNode.actualNode) {
  12900. return null;
  12901. }
  12902. throw new ReferenceError('Cannot determine role presentational inheritance of a required parent outside the current scope.');
  12903. }
  12904. if (!parentNodeNames.includes(vNode.parent.props.nodeName)) {
  12905. return null;
  12906. }
  12907. var parentRole = get_explicit_role_default(vNode.parent, explicitRoleOptions);
  12908. if ([ 'none', 'presentation' ].includes(parentRole) && !hasConflictResolution(vNode.parent)) {
  12909. return parentRole;
  12910. }
  12911. if (parentRole) {
  12912. return null;
  12913. }
  12914. return getInheritedRole(vNode.parent, explicitRoleOptions);
  12915. }
  12916. function resolveImplicitRole(vNode, _ref31) {
  12917. var chromium = _ref31.chromium, explicitRoleOptions = _objectWithoutProperties(_ref31, _excluded6);
  12918. var implicitRole3 = implicit_role_default(vNode, {
  12919. chromium: chromium
  12920. });
  12921. if (!implicitRole3) {
  12922. return null;
  12923. }
  12924. var presentationalRole = getInheritedRole(vNode, explicitRoleOptions);
  12925. if (presentationalRole) {
  12926. return presentationalRole;
  12927. }
  12928. return implicitRole3;
  12929. }
  12930. function hasConflictResolution(vNode) {
  12931. var hasGlobalAria = get_global_aria_attrs_default().some(function(attr) {
  12932. return vNode.hasAttr(attr);
  12933. });
  12934. return hasGlobalAria || _isFocusable(vNode);
  12935. }
  12936. function resolveRole(node) {
  12937. var _ref32 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  12938. var noImplicit = _ref32.noImplicit, roleOptions = _objectWithoutProperties(_ref32, _excluded7);
  12939. var _nodeLookup10 = _nodeLookup(node), vNode = _nodeLookup10.vNode;
  12940. if (vNode.props.nodeType !== 1) {
  12941. return null;
  12942. }
  12943. var explicitRole2 = get_explicit_role_default(vNode, roleOptions);
  12944. if (!explicitRole2) {
  12945. return noImplicit ? null : resolveImplicitRole(vNode, roleOptions);
  12946. }
  12947. if (![ 'presentation', 'none' ].includes(explicitRole2)) {
  12948. return explicitRole2;
  12949. }
  12950. if (hasConflictResolution(vNode)) {
  12951. return noImplicit ? null : resolveImplicitRole(vNode, roleOptions);
  12952. }
  12953. return explicitRole2;
  12954. }
  12955. function getRole(node) {
  12956. var _ref33 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  12957. var noPresentational = _ref33.noPresentational, options = _objectWithoutProperties(_ref33, _excluded8);
  12958. var role = resolveRole(node, options);
  12959. if (noPresentational && [ 'presentation', 'none' ].includes(role)) {
  12960. return null;
  12961. }
  12962. return role;
  12963. }
  12964. var get_role_default = getRole;
  12965. var alwaysTitleElements = [ 'iframe' ];
  12966. function titleText(node) {
  12967. var _nodeLookup11 = _nodeLookup(node), vNode = _nodeLookup11.vNode;
  12968. if (vNode.props.nodeType !== 1 || !node.hasAttr('title')) {
  12969. return '';
  12970. }
  12971. if (!matches_default(vNode, alwaysTitleElements) && [ 'none', 'presentation' ].includes(get_role_default(vNode))) {
  12972. return '';
  12973. }
  12974. return vNode.attr('title');
  12975. }
  12976. var title_text_default = titleText;
  12977. function namedFromContents(vNode) {
  12978. var _ref34 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, strict = _ref34.strict;
  12979. vNode = vNode instanceof abstract_virtual_node_default ? vNode : get_node_from_tree_default(vNode);
  12980. if (vNode.props.nodeType !== 1) {
  12981. return false;
  12982. }
  12983. var role = get_role_default(vNode);
  12984. var roleDef = standards_default.ariaRoles[role];
  12985. if (roleDef && roleDef.nameFromContent) {
  12986. return true;
  12987. }
  12988. if (strict) {
  12989. return false;
  12990. }
  12991. return !roleDef || [ 'presentation', 'none' ].includes(role);
  12992. }
  12993. var named_from_contents_default = namedFromContents;
  12994. function getOwnedVirtual(virtualNode) {
  12995. var actualNode = virtualNode.actualNode, children = virtualNode.children;
  12996. if (!children) {
  12997. throw new Error('getOwnedVirtual requires a virtual node');
  12998. }
  12999. if (virtualNode.hasAttr('aria-owns')) {
  13000. var owns = idrefs_default(actualNode, 'aria-owns').filter(function(element) {
  13001. return !!element;
  13002. }).map(function(element) {
  13003. return axe.utils.getNodeFromTree(element);
  13004. });
  13005. return [].concat(_toConsumableArray(children), _toConsumableArray(owns));
  13006. }
  13007. return _toConsumableArray(children);
  13008. }
  13009. var get_owned_virtual_default = getOwnedVirtual;
  13010. var unsupported_default = {
  13011. accessibleNameFromFieldValue: [ 'progressbar' ]
  13012. };
  13013. function _isVisibleToScreenReaders(vNode) {
  13014. vNode = _nodeLookup(vNode).vNode;
  13015. return isVisibleToScreenReadersVirtual(vNode);
  13016. }
  13017. var isVisibleToScreenReadersVirtual = memoize_default(function isVisibleToScreenReadersMemoized(vNode, isAncestor) {
  13018. if (ariaHidden(vNode) || _isInert(vNode, {
  13019. skipAncestors: true,
  13020. isAncestor: isAncestor
  13021. })) {
  13022. return false;
  13023. }
  13024. if (vNode.actualNode && vNode.props.nodeName === 'area') {
  13025. return !areaHidden(vNode, isVisibleToScreenReadersVirtual);
  13026. }
  13027. if (_isHiddenForEveryone(vNode, {
  13028. skipAncestors: true,
  13029. isAncestor: isAncestor
  13030. })) {
  13031. return false;
  13032. }
  13033. if (!vNode.parent) {
  13034. return true;
  13035. }
  13036. return isVisibleToScreenReadersVirtual(vNode.parent, true);
  13037. });
  13038. function visibleVirtual(element, screenReader, noRecursing) {
  13039. var _nodeLookup12 = _nodeLookup(element), vNode = _nodeLookup12.vNode;
  13040. var visibleMethod = screenReader ? _isVisibleToScreenReaders : _isVisibleOnScreen;
  13041. var visible2 = !element.actualNode || element.actualNode && visibleMethod(element);
  13042. var result = vNode.children.map(function(child) {
  13043. var _child$props = child.props, nodeType = _child$props.nodeType, nodeValue = _child$props.nodeValue;
  13044. if (nodeType === 3) {
  13045. if (nodeValue && visible2) {
  13046. return nodeValue;
  13047. }
  13048. } else if (!noRecursing) {
  13049. return visibleVirtual(child, screenReader);
  13050. }
  13051. }).join('');
  13052. return sanitize_default(result);
  13053. }
  13054. var visible_virtual_default = visibleVirtual;
  13055. var nonTextInputTypes = [ 'button', 'checkbox', 'color', 'file', 'hidden', 'image', 'password', 'radio', 'reset', 'submit' ];
  13056. function isNativeTextbox(node) {
  13057. node = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  13058. var nodeName2 = node.props.nodeName;
  13059. return nodeName2 === 'textarea' || nodeName2 === 'input' && !nonTextInputTypes.includes((node.attr('type') || '').toLowerCase());
  13060. }
  13061. var is_native_textbox_default = isNativeTextbox;
  13062. function isNativeSelect(node) {
  13063. node = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  13064. var nodeName2 = node.props.nodeName;
  13065. return nodeName2 === 'select';
  13066. }
  13067. var is_native_select_default = isNativeSelect;
  13068. function isAriaTextbox(node) {
  13069. var role = get_explicit_role_default(node);
  13070. return role === 'textbox';
  13071. }
  13072. var is_aria_textbox_default = isAriaTextbox;
  13073. function isAriaListbox(node) {
  13074. var role = get_explicit_role_default(node);
  13075. return role === 'listbox';
  13076. }
  13077. var is_aria_listbox_default = isAriaListbox;
  13078. function isAriaCombobox(node) {
  13079. var role = get_explicit_role_default(node);
  13080. return role === 'combobox';
  13081. }
  13082. var is_aria_combobox_default = isAriaCombobox;
  13083. var rangeRoles = [ 'progressbar', 'scrollbar', 'slider', 'spinbutton' ];
  13084. function isAriaRange(node) {
  13085. var role = get_explicit_role_default(node);
  13086. return rangeRoles.includes(role);
  13087. }
  13088. var is_aria_range_default = isAriaRange;
  13089. var controlValueRoles = [ 'textbox', 'progressbar', 'scrollbar', 'slider', 'spinbutton', 'combobox', 'listbox' ];
  13090. var _formControlValueMethods = {
  13091. nativeTextboxValue: nativeTextboxValue,
  13092. nativeSelectValue: nativeSelectValue,
  13093. ariaTextboxValue: ariaTextboxValue,
  13094. ariaListboxValue: ariaListboxValue,
  13095. ariaComboboxValue: ariaComboboxValue,
  13096. ariaRangeValue: ariaRangeValue
  13097. };
  13098. function formControlValue(virtualNode) {
  13099. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  13100. var actualNode = virtualNode.actualNode;
  13101. var unsupportedRoles = unsupported_default.accessibleNameFromFieldValue || [];
  13102. var role = get_role_default(virtualNode);
  13103. if (context.startNode === virtualNode || !controlValueRoles.includes(role) || unsupportedRoles.includes(role)) {
  13104. return '';
  13105. }
  13106. var valueMethods = Object.keys(_formControlValueMethods).map(function(name) {
  13107. return _formControlValueMethods[name];
  13108. });
  13109. var valueString = valueMethods.reduce(function(accName, step) {
  13110. return accName || step(virtualNode, context);
  13111. }, '');
  13112. if (context.debug) {
  13113. log_default(valueString || '{empty-value}', actualNode, context);
  13114. }
  13115. return valueString;
  13116. }
  13117. function nativeTextboxValue(node) {
  13118. var _nodeLookup13 = _nodeLookup(node), vNode = _nodeLookup13.vNode;
  13119. if (is_native_textbox_default(vNode)) {
  13120. return vNode.props.value || '';
  13121. }
  13122. return '';
  13123. }
  13124. function nativeSelectValue(node) {
  13125. var _nodeLookup14 = _nodeLookup(node), vNode = _nodeLookup14.vNode;
  13126. if (!is_native_select_default(vNode)) {
  13127. return '';
  13128. }
  13129. var options = query_selector_all_default(vNode, 'option');
  13130. var selectedOptions = options.filter(function(option) {
  13131. return option.props.selected;
  13132. });
  13133. if (!selectedOptions.length) {
  13134. selectedOptions.push(options[0]);
  13135. }
  13136. return selectedOptions.map(function(option) {
  13137. return visible_virtual_default(option);
  13138. }).join(' ') || '';
  13139. }
  13140. function ariaTextboxValue(node) {
  13141. var _nodeLookup15 = _nodeLookup(node), vNode = _nodeLookup15.vNode, domNode = _nodeLookup15.domNode;
  13142. if (!is_aria_textbox_default(vNode)) {
  13143. return '';
  13144. }
  13145. if (!domNode || domNode && !_isHiddenForEveryone(domNode)) {
  13146. return visible_virtual_default(vNode, true);
  13147. } else {
  13148. return domNode.textContent;
  13149. }
  13150. }
  13151. function ariaListboxValue(node, context) {
  13152. var _nodeLookup16 = _nodeLookup(node), vNode = _nodeLookup16.vNode;
  13153. if (!is_aria_listbox_default(vNode)) {
  13154. return '';
  13155. }
  13156. var selected = get_owned_virtual_default(vNode).filter(function(owned) {
  13157. return get_role_default(owned) === 'option' && owned.attr('aria-selected') === 'true';
  13158. });
  13159. if (selected.length === 0) {
  13160. return '';
  13161. }
  13162. return _accessibleTextVirtual(selected[0], context);
  13163. }
  13164. function ariaComboboxValue(node, context) {
  13165. var _nodeLookup17 = _nodeLookup(node), vNode = _nodeLookup17.vNode;
  13166. if (!is_aria_combobox_default(vNode)) {
  13167. return '';
  13168. }
  13169. var listbox = get_owned_virtual_default(vNode).filter(function(elm) {
  13170. return get_role_default(elm) === 'listbox';
  13171. })[0];
  13172. return listbox ? ariaListboxValue(listbox, context) : '';
  13173. }
  13174. function ariaRangeValue(node) {
  13175. var _nodeLookup18 = _nodeLookup(node), vNode = _nodeLookup18.vNode;
  13176. if (!is_aria_range_default(vNode) || !vNode.hasAttr('aria-valuenow')) {
  13177. return '';
  13178. }
  13179. var valueNow = +vNode.attr('aria-valuenow');
  13180. return !isNaN(valueNow) ? String(valueNow) : '0';
  13181. }
  13182. var form_control_value_default = formControlValue;
  13183. function subtreeText(virtualNode) {
  13184. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  13185. var alreadyProcessed2 = _accessibleTextVirtual.alreadyProcessed;
  13186. context.startNode = context.startNode || virtualNode;
  13187. var _context = context, strict = _context.strict, inControlContext = _context.inControlContext, inLabelledByContext = _context.inLabelledByContext;
  13188. var role = get_role_default(virtualNode);
  13189. var _get_element_spec_def2 = get_element_spec_default(virtualNode, {
  13190. noMatchAccessibleName: true
  13191. }), contentTypes = _get_element_spec_def2.contentTypes;
  13192. if (alreadyProcessed2(virtualNode, context) || virtualNode.props.nodeType !== 1 || contentTypes !== null && contentTypes !== void 0 && contentTypes.includes('embedded') || controlValueRoles.includes(role)) {
  13193. return '';
  13194. }
  13195. if (!context.subtreeDescendant && !context.inLabelledByContext && !named_from_contents_default(virtualNode, {
  13196. strict: strict
  13197. })) {
  13198. return '';
  13199. }
  13200. if (!strict) {
  13201. var subtreeDescendant = !inControlContext && !inLabelledByContext;
  13202. context = _extends({
  13203. subtreeDescendant: subtreeDescendant
  13204. }, context);
  13205. }
  13206. return get_owned_virtual_default(virtualNode).reduce(function(contentText, child) {
  13207. return appendAccessibleText(contentText, child, context);
  13208. }, '');
  13209. }
  13210. var phrasingElements = get_elements_by_content_type_default('phrasing').concat([ '#text' ]);
  13211. function appendAccessibleText(contentText, virtualNode, context) {
  13212. var nodeName2 = virtualNode.props.nodeName;
  13213. var contentTextAdd = _accessibleTextVirtual(virtualNode, context);
  13214. if (!contentTextAdd) {
  13215. return contentText;
  13216. }
  13217. if (!phrasingElements.includes(nodeName2)) {
  13218. if (contentTextAdd[0] !== ' ') {
  13219. contentTextAdd += ' ';
  13220. }
  13221. if (contentText && contentText[contentText.length - 1] !== ' ') {
  13222. contentTextAdd = ' ' + contentTextAdd;
  13223. }
  13224. }
  13225. return contentText + contentTextAdd;
  13226. }
  13227. var subtree_text_default = subtreeText;
  13228. function labelText(virtualNode) {
  13229. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  13230. var alreadyProcessed2 = _accessibleTextVirtual.alreadyProcessed;
  13231. if (context.inControlContext || context.inLabelledByContext || alreadyProcessed2(virtualNode, context)) {
  13232. return '';
  13233. }
  13234. if (!context.startNode) {
  13235. context.startNode = virtualNode;
  13236. }
  13237. var labelContext = _extends({
  13238. inControlContext: true
  13239. }, context);
  13240. var explicitLabels = getExplicitLabels(virtualNode);
  13241. var implicitLabel = closest_default(virtualNode, 'label');
  13242. var labels;
  13243. if (implicitLabel) {
  13244. labels = [].concat(_toConsumableArray(explicitLabels), [ implicitLabel.actualNode ]);
  13245. labels.sort(node_sorter_default);
  13246. } else {
  13247. labels = explicitLabels;
  13248. }
  13249. return labels.map(function(label3) {
  13250. return accessible_text_default(label3, labelContext);
  13251. }).filter(function(text) {
  13252. return text !== '';
  13253. }).join(' ');
  13254. }
  13255. function getExplicitLabels(virtualNode) {
  13256. if (!virtualNode.attr('id')) {
  13257. return [];
  13258. }
  13259. if (!virtualNode.actualNode) {
  13260. throw new TypeError('Cannot resolve explicit label reference for non-DOM nodes');
  13261. }
  13262. return find_elms_in_context_default({
  13263. elm: 'label',
  13264. attr: 'for',
  13265. value: virtualNode.attr('id'),
  13266. context: virtualNode.actualNode
  13267. });
  13268. }
  13269. var label_text_default = labelText;
  13270. var defaultButtonValues = {
  13271. submit: 'Submit',
  13272. image: 'Submit',
  13273. reset: 'Reset',
  13274. button: ''
  13275. };
  13276. var nativeTextMethods = {
  13277. valueText: function valueText(vNode) {
  13278. return vNode.props.value || '';
  13279. },
  13280. buttonDefaultText: function buttonDefaultText(vNode) {
  13281. return defaultButtonValues[vNode.props.type] || '';
  13282. },
  13283. tableCaptionText: descendantText.bind(null, 'caption'),
  13284. figureText: descendantText.bind(null, 'figcaption'),
  13285. svgTitleText: descendantText.bind(null, 'title'),
  13286. fieldsetLegendText: descendantText.bind(null, 'legend'),
  13287. altText: attrText.bind(null, 'alt'),
  13288. tableSummaryText: attrText.bind(null, 'summary'),
  13289. titleText: title_text_default,
  13290. subtreeText: subtree_text_default,
  13291. labelText: label_text_default,
  13292. singleSpace: function singleSpace() {
  13293. return ' ';
  13294. },
  13295. placeholderText: attrText.bind(null, 'placeholder')
  13296. };
  13297. function attrText(attr, vNode) {
  13298. return vNode.attr(attr) || '';
  13299. }
  13300. function descendantText(nodeName2, _ref35, context) {
  13301. var actualNode = _ref35.actualNode;
  13302. nodeName2 = nodeName2.toLowerCase();
  13303. var nodeNames2 = [ nodeName2, actualNode.nodeName.toLowerCase() ].join(',');
  13304. var candidate = actualNode.querySelector(nodeNames2);
  13305. if (!candidate || candidate.nodeName.toLowerCase() !== nodeName2) {
  13306. return '';
  13307. }
  13308. return accessible_text_default(candidate, context);
  13309. }
  13310. var native_text_methods_default = nativeTextMethods;
  13311. function _nativeTextAlternative(virtualNode) {
  13312. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  13313. var actualNode = virtualNode.actualNode;
  13314. if (virtualNode.props.nodeType !== 1 || [ 'presentation', 'none' ].includes(get_role_default(virtualNode))) {
  13315. return '';
  13316. }
  13317. var textMethods = findTextMethods(virtualNode);
  13318. var accessibleName = textMethods.reduce(function(accName, step) {
  13319. return accName || step(virtualNode, context);
  13320. }, '');
  13321. if (context.debug) {
  13322. axe.log(accessibleName || '{empty-value}', actualNode, context);
  13323. }
  13324. return accessibleName;
  13325. }
  13326. function findTextMethods(virtualNode) {
  13327. var elmSpec = get_element_spec_default(virtualNode, {
  13328. noMatchAccessibleName: true
  13329. });
  13330. var methods = elmSpec.namingMethods || [];
  13331. return methods.map(function(methodName) {
  13332. return native_text_methods_default[methodName];
  13333. });
  13334. }
  13335. function getUnicodeNonBmpRegExp() {
  13336. return /[\u1D00-\u1D7F\u1D80-\u1DBF\u1DC0-\u1DFF\u20A0-\u20CF\u20D0-\u20FF\u2100-\u214F\u2150-\u218F\u2190-\u21FF\u2200-\u22FF\u2300-\u23FF\u2400-\u243F\u2440-\u245F\u2460-\u24FF\u2500-\u257F\u2580-\u259F\u25A0-\u25FF\u2600-\u26FF\u2700-\u27BF\uE000-\uF8FF]/g;
  13337. }
  13338. function getPunctuationRegExp() {
  13339. return /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&\xa3\xa2\xa5\xa7\u20ac()*+,\-.\/:;<=>?@\[\]^_`{|}~\xb1]/g;
  13340. }
  13341. function getSupplementaryPrivateUseRegExp() {
  13342. return /[\uDB80-\uDBBF][\uDC00-\uDFFF]/g;
  13343. }
  13344. function getCategoryFormatRegExp() {
  13345. return /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC38]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/g;
  13346. }
  13347. var emoji_regex_default = function emoji_regex_default() {
  13348. return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
  13349. };
  13350. function hasUnicode(str, options) {
  13351. var emoji = options.emoji, nonBmp = options.nonBmp, punctuations = options.punctuations;
  13352. var value = false;
  13353. if (emoji) {
  13354. value || (value = emoji_regex_default().test(str));
  13355. }
  13356. if (nonBmp) {
  13357. value || (value = getUnicodeNonBmpRegExp().test(str) || getSupplementaryPrivateUseRegExp().test(str) || getCategoryFormatRegExp().test(str));
  13358. }
  13359. if (punctuations) {
  13360. value || (value = getPunctuationRegExp().test(str));
  13361. }
  13362. return value;
  13363. }
  13364. var has_unicode_default = hasUnicode;
  13365. function _isIconLigature(textVNode) {
  13366. var differenceThreshold = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .15;
  13367. var occurrenceThreshold = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 3;
  13368. var nodeValue = textVNode.actualNode.nodeValue.trim();
  13369. if (!sanitize_default(nodeValue) || has_unicode_default(nodeValue, {
  13370. emoji: true,
  13371. nonBmp: true
  13372. })) {
  13373. return false;
  13374. }
  13375. var canvasContext = cache_default.get('canvasContext', function() {
  13376. return document.createElement('canvas').getContext('2d', {
  13377. willReadFrequently: true
  13378. });
  13379. });
  13380. var canvas = canvasContext.canvas;
  13381. var fonts = cache_default.get('fonts', function() {
  13382. return {};
  13383. });
  13384. var style = window.getComputedStyle(textVNode.parent.actualNode);
  13385. var fontFamily = style.getPropertyValue('font-family');
  13386. if (!fonts[fontFamily]) {
  13387. fonts[fontFamily] = {
  13388. occurrences: 0,
  13389. numLigatures: 0
  13390. };
  13391. }
  13392. var font = fonts[fontFamily];
  13393. if (font.occurrences >= occurrenceThreshold) {
  13394. if (font.numLigatures / font.occurrences === 1) {
  13395. return true;
  13396. } else if (font.numLigatures === 0) {
  13397. return false;
  13398. }
  13399. }
  13400. font.occurrences++;
  13401. var fontSize = 30;
  13402. var fontStyle = ''.concat(fontSize, 'px ').concat(fontFamily);
  13403. canvasContext.font = fontStyle;
  13404. var firstChar = nodeValue.charAt(0);
  13405. var width = canvasContext.measureText(firstChar).width;
  13406. if (width === 0) {
  13407. font.numLigatures++;
  13408. return true;
  13409. }
  13410. if (width < 30) {
  13411. var diff = 30 / width;
  13412. width *= diff;
  13413. fontSize *= diff;
  13414. fontStyle = ''.concat(fontSize, 'px ').concat(fontFamily);
  13415. }
  13416. canvas.width = width;
  13417. canvas.height = fontSize;
  13418. canvasContext.font = fontStyle;
  13419. canvasContext.textAlign = 'left';
  13420. canvasContext.textBaseline = 'top';
  13421. canvasContext.fillText(firstChar, 0, 0);
  13422. var compareData = new Uint32Array(canvasContext.getImageData(0, 0, width, fontSize).data.buffer);
  13423. if (!compareData.some(function(pixel) {
  13424. return pixel;
  13425. })) {
  13426. font.numLigatures++;
  13427. return true;
  13428. }
  13429. canvasContext.clearRect(0, 0, width, fontSize);
  13430. canvasContext.fillText(nodeValue, 0, 0);
  13431. var compareWith = new Uint32Array(canvasContext.getImageData(0, 0, width, fontSize).data.buffer);
  13432. var differences = compareData.reduce(function(diff, pixel, i) {
  13433. if (pixel === 0 && compareWith[i] === 0) {
  13434. return diff;
  13435. }
  13436. if (pixel !== 0 && compareWith[i] !== 0) {
  13437. return diff;
  13438. }
  13439. return ++diff;
  13440. }, 0);
  13441. var expectedWidth = nodeValue.split('').reduce(function(totalWidth, _char2) {
  13442. return totalWidth + canvasContext.measureText(_char2).width;
  13443. }, 0);
  13444. var actualWidth = canvasContext.measureText(nodeValue).width;
  13445. var pixelDifference = differences / compareData.length;
  13446. var sizeDifference = 1 - actualWidth / expectedWidth;
  13447. if (pixelDifference >= differenceThreshold && sizeDifference >= differenceThreshold) {
  13448. font.numLigatures++;
  13449. return true;
  13450. }
  13451. return false;
  13452. }
  13453. function _accessibleTextVirtual(virtualNode) {
  13454. var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  13455. context = prepareContext(virtualNode, context);
  13456. if (shouldIgnoreHidden(virtualNode, context)) {
  13457. return '';
  13458. }
  13459. if (shouldIgnoreIconLigature(virtualNode, context)) {
  13460. return '';
  13461. }
  13462. var computationSteps = [ arialabelledby_text_default, _arialabelText, _nativeTextAlternative, form_control_value_default, subtree_text_default, textNodeValue, title_text_default ];
  13463. var accessibleName = computationSteps.reduce(function(accName, step) {
  13464. if (context.startNode === virtualNode) {
  13465. accName = sanitize_default(accName);
  13466. }
  13467. if (accName !== '') {
  13468. return accName;
  13469. }
  13470. return step(virtualNode, context);
  13471. }, '');
  13472. if (context.debug) {
  13473. axe.log(accessibleName || '{empty-value}', virtualNode.actualNode, context);
  13474. }
  13475. return accessibleName;
  13476. }
  13477. function textNodeValue(virtualNode) {
  13478. if (virtualNode.props.nodeType !== 3) {
  13479. return '';
  13480. }
  13481. return virtualNode.props.nodeValue;
  13482. }
  13483. function shouldIgnoreHidden(virtualNode, context) {
  13484. if (!virtualNode) {
  13485. return false;
  13486. }
  13487. if (virtualNode.props.nodeType !== 1 || context.includeHidden) {
  13488. return false;
  13489. }
  13490. return !_isVisibleToScreenReaders(virtualNode);
  13491. }
  13492. function shouldIgnoreIconLigature(virtualNode, context) {
  13493. var _context$occurrenceTh;
  13494. var ignoreIconLigature = context.ignoreIconLigature, pixelThreshold = context.pixelThreshold;
  13495. var occurrenceThreshold = (_context$occurrenceTh = context.occurrenceThreshold) !== null && _context$occurrenceTh !== void 0 ? _context$occurrenceTh : context.occuranceThreshold;
  13496. if (virtualNode.props.nodeType !== 3 || !ignoreIconLigature) {
  13497. return false;
  13498. }
  13499. return _isIconLigature(virtualNode, pixelThreshold, occurrenceThreshold);
  13500. }
  13501. function prepareContext(virtualNode, context) {
  13502. if (!context.startNode) {
  13503. context = _extends({
  13504. startNode: virtualNode
  13505. }, context);
  13506. }
  13507. if (virtualNode.props.nodeType === 1 && context.inLabelledByContext && context.includeHidden === void 0) {
  13508. context = _extends({
  13509. includeHidden: !_isVisibleToScreenReaders(virtualNode)
  13510. }, context);
  13511. }
  13512. return context;
  13513. }
  13514. _accessibleTextVirtual.alreadyProcessed = function alreadyProcessed(virtualnode, context) {
  13515. context.processed = context.processed || [];
  13516. if (context.processed.includes(virtualnode)) {
  13517. return true;
  13518. }
  13519. context.processed.push(virtualnode);
  13520. return false;
  13521. };
  13522. function removeUnicode(str, options) {
  13523. var emoji = options.emoji, nonBmp = options.nonBmp, punctuations = options.punctuations;
  13524. if (emoji) {
  13525. str = str.replace(emoji_regex_default(), '');
  13526. }
  13527. if (nonBmp) {
  13528. str = str.replace(getUnicodeNonBmpRegExp(), '').replace(getSupplementaryPrivateUseRegExp(), '').replace(getCategoryFormatRegExp(), '');
  13529. }
  13530. if (punctuations) {
  13531. str = str.replace(getPunctuationRegExp(), '');
  13532. }
  13533. return str;
  13534. }
  13535. var remove_unicode_default = removeUnicode;
  13536. function isHumanInterpretable(str) {
  13537. if (isEmpty(str) || isNonDigitCharacter(str) || isSymbolicText(str) || isUnicodeOrPunctuation(str)) {
  13538. return 0;
  13539. }
  13540. return 1;
  13541. }
  13542. function isEmpty(str) {
  13543. return sanitize_default(str).length === 0;
  13544. }
  13545. function isNonDigitCharacter(str) {
  13546. return str.length === 1 && str.match(/\D/);
  13547. }
  13548. function isSymbolicText(str) {
  13549. var symbolicText = [ 'aa', 'abc' ];
  13550. return symbolicText.includes(str.toLowerCase());
  13551. }
  13552. function isUnicodeOrPunctuation(str) {
  13553. var noUnicodeStr = remove_unicode_default(str, {
  13554. emoji: true,
  13555. nonBmp: true,
  13556. punctuations: true
  13557. });
  13558. return !sanitize_default(noUnicodeStr);
  13559. }
  13560. var is_human_interpretable_default = isHumanInterpretable;
  13561. var _autocomplete = {
  13562. stateTerms: [ 'on', 'off' ],
  13563. standaloneTerms: [ 'name', 'honorific-prefix', 'given-name', 'additional-name', 'family-name', 'honorific-suffix', 'nickname', 'username', 'new-password', 'current-password', 'organization-title', 'organization', 'street-address', 'address-line1', 'address-line2', 'address-line3', 'address-level4', 'address-level3', 'address-level2', 'address-level1', 'country', 'country-name', 'postal-code', 'cc-name', 'cc-given-name', 'cc-additional-name', 'cc-family-name', 'cc-number', 'cc-exp', 'cc-exp-month', 'cc-exp-year', 'cc-csc', 'cc-type', 'transaction-currency', 'transaction-amount', 'language', 'bday', 'bday-day', 'bday-month', 'bday-year', 'sex', 'url', 'photo', 'one-time-code' ],
  13564. qualifiers: [ 'home', 'work', 'mobile', 'fax', 'pager' ],
  13565. qualifiedTerms: [ 'tel', 'tel-country-code', 'tel-national', 'tel-area-code', 'tel-local', 'tel-local-prefix', 'tel-local-suffix', 'tel-extension', 'email', 'impp' ],
  13566. locations: [ 'billing', 'shipping' ]
  13567. };
  13568. function isValidAutocomplete(autocompleteValue) {
  13569. var _ref36 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref36$looseTyped = _ref36.looseTyped, looseTyped = _ref36$looseTyped === void 0 ? false : _ref36$looseTyped, _ref36$stateTerms = _ref36.stateTerms, stateTerms = _ref36$stateTerms === void 0 ? [] : _ref36$stateTerms, _ref36$locations = _ref36.locations, locations = _ref36$locations === void 0 ? [] : _ref36$locations, _ref36$qualifiers = _ref36.qualifiers, qualifiers = _ref36$qualifiers === void 0 ? [] : _ref36$qualifiers, _ref36$standaloneTerm = _ref36.standaloneTerms, standaloneTerms = _ref36$standaloneTerm === void 0 ? [] : _ref36$standaloneTerm, _ref36$qualifiedTerms = _ref36.qualifiedTerms, qualifiedTerms = _ref36$qualifiedTerms === void 0 ? [] : _ref36$qualifiedTerms, _ref36$ignoredValues = _ref36.ignoredValues, ignoredValues = _ref36$ignoredValues === void 0 ? [] : _ref36$ignoredValues;
  13570. autocompleteValue = autocompleteValue.toLowerCase().trim();
  13571. stateTerms = stateTerms.concat(_autocomplete.stateTerms);
  13572. if (stateTerms.includes(autocompleteValue) || autocompleteValue === '') {
  13573. return true;
  13574. }
  13575. qualifiers = qualifiers.concat(_autocomplete.qualifiers);
  13576. locations = locations.concat(_autocomplete.locations);
  13577. standaloneTerms = standaloneTerms.concat(_autocomplete.standaloneTerms);
  13578. qualifiedTerms = qualifiedTerms.concat(_autocomplete.qualifiedTerms);
  13579. var autocompleteTerms = autocompleteValue.split(/\s+/g);
  13580. if (autocompleteTerms[autocompleteTerms.length - 1] === 'webauthn') {
  13581. autocompleteTerms.pop();
  13582. if (autocompleteTerms.length === 0) {
  13583. return false;
  13584. }
  13585. }
  13586. if (!looseTyped) {
  13587. if (autocompleteTerms[0].length > 8 && autocompleteTerms[0].substr(0, 8) === 'section-') {
  13588. autocompleteTerms.shift();
  13589. }
  13590. if (locations.includes(autocompleteTerms[0])) {
  13591. autocompleteTerms.shift();
  13592. }
  13593. if (qualifiers.includes(autocompleteTerms[0])) {
  13594. autocompleteTerms.shift();
  13595. standaloneTerms = [];
  13596. }
  13597. if (autocompleteTerms.length !== 1) {
  13598. return false;
  13599. }
  13600. }
  13601. var purposeTerm = autocompleteTerms[autocompleteTerms.length - 1];
  13602. if (ignoredValues.includes(purposeTerm)) {
  13603. return void 0;
  13604. }
  13605. return standaloneTerms.includes(purposeTerm) || qualifiedTerms.includes(purposeTerm);
  13606. }
  13607. var is_valid_autocomplete_default = isValidAutocomplete;
  13608. function labelVirtual(virtualNode) {
  13609. var ref, candidate;
  13610. if (virtualNode.attr('aria-labelledby')) {
  13611. ref = idrefs_default(virtualNode.actualNode, 'aria-labelledby');
  13612. candidate = ref.map(function(thing) {
  13613. var vNode = get_node_from_tree_default(thing);
  13614. return vNode ? visible_virtual_default(vNode) : '';
  13615. }).join(' ').trim();
  13616. if (candidate) {
  13617. return candidate;
  13618. }
  13619. }
  13620. candidate = virtualNode.attr('aria-label');
  13621. if (candidate) {
  13622. candidate = sanitize_default(candidate);
  13623. if (candidate) {
  13624. return candidate;
  13625. }
  13626. }
  13627. return null;
  13628. }
  13629. var label_virtual_default = labelVirtual;
  13630. function visible(element, screenReader, noRecursing) {
  13631. element = get_node_from_tree_default(element);
  13632. return visible_virtual_default(element, screenReader, noRecursing);
  13633. }
  13634. var visible_default = visible;
  13635. function labelVirtual2(virtualNode) {
  13636. var ref, candidate, doc;
  13637. candidate = label_virtual_default(virtualNode);
  13638. if (candidate) {
  13639. return candidate;
  13640. }
  13641. if (virtualNode.attr('id')) {
  13642. if (!virtualNode.actualNode) {
  13643. throw new TypeError('Cannot resolve explicit label reference for non-DOM nodes');
  13644. }
  13645. var id = escape_selector_default(virtualNode.attr('id'));
  13646. doc = get_root_node_default2(virtualNode.actualNode);
  13647. ref = doc.querySelector('label[for="' + id + '"]');
  13648. candidate = ref && visible_default(ref, true);
  13649. if (candidate) {
  13650. return candidate;
  13651. }
  13652. }
  13653. ref = closest_default(virtualNode, 'label');
  13654. candidate = ref && visible_virtual_default(ref, true);
  13655. if (candidate) {
  13656. return candidate;
  13657. }
  13658. return null;
  13659. }
  13660. var label_virtual_default2 = labelVirtual2;
  13661. function label(node) {
  13662. node = get_node_from_tree_default(node);
  13663. return label_virtual_default2(node);
  13664. }
  13665. var label_default = label;
  13666. var nativeElementType = [ {
  13667. matches: [ {
  13668. nodeName: 'textarea'
  13669. }, {
  13670. nodeName: 'input',
  13671. properties: {
  13672. type: [ 'text', 'password', 'search', 'tel', 'email', 'url' ]
  13673. }
  13674. } ],
  13675. namingMethods: 'labelText'
  13676. }, {
  13677. matches: {
  13678. nodeName: 'input',
  13679. properties: {
  13680. type: [ 'button', 'submit', 'reset' ]
  13681. }
  13682. },
  13683. namingMethods: [ 'valueText', 'titleText', 'buttonDefaultText' ]
  13684. }, {
  13685. matches: {
  13686. nodeName: 'input',
  13687. properties: {
  13688. type: 'image'
  13689. }
  13690. },
  13691. namingMethods: [ 'altText', 'valueText', 'labelText', 'titleText', 'buttonDefaultText' ]
  13692. }, {
  13693. matches: 'button',
  13694. namingMethods: 'subtreeText'
  13695. }, {
  13696. matches: 'fieldset',
  13697. namingMethods: 'fieldsetLegendText'
  13698. }, {
  13699. matches: 'OUTPUT',
  13700. namingMethods: 'subtreeText'
  13701. }, {
  13702. matches: [ {
  13703. nodeName: 'select'
  13704. }, {
  13705. nodeName: 'input',
  13706. properties: {
  13707. type: /^(?!text|password|search|tel|email|url|button|submit|reset)/
  13708. }
  13709. } ],
  13710. namingMethods: 'labelText'
  13711. }, {
  13712. matches: 'summary',
  13713. namingMethods: 'subtreeText'
  13714. }, {
  13715. matches: 'figure',
  13716. namingMethods: [ 'figureText', 'titleText' ]
  13717. }, {
  13718. matches: 'img',
  13719. namingMethods: 'altText'
  13720. }, {
  13721. matches: 'table',
  13722. namingMethods: [ 'tableCaptionText', 'tableSummaryText' ]
  13723. }, {
  13724. matches: [ 'hr', 'br' ],
  13725. namingMethods: [ 'titleText', 'singleSpace' ]
  13726. } ];
  13727. var native_element_type_default = nativeElementType;
  13728. function visibleTextNodes(vNode) {
  13729. var parentVisible = _isVisibleOnScreen(vNode);
  13730. var nodes = [];
  13731. vNode.children.forEach(function(child) {
  13732. if (child.actualNode.nodeType === 3) {
  13733. if (parentVisible) {
  13734. nodes.push(child);
  13735. }
  13736. } else {
  13737. nodes = nodes.concat(visibleTextNodes(child));
  13738. }
  13739. });
  13740. return nodes;
  13741. }
  13742. var visible_text_nodes_default = visibleTextNodes;
  13743. var getVisibleChildTextRects = memoize_default(function getVisibleChildTextRectsMemoized(node) {
  13744. var vNode = get_node_from_tree_default(node);
  13745. var nodeRect = vNode.boundingClientRect;
  13746. var clientRects = [];
  13747. var overflowHiddenNodes = get_overflow_hidden_ancestors_default(vNode);
  13748. node.childNodes.forEach(function(textNode) {
  13749. if (textNode.nodeType !== 3 || sanitize_default(textNode.nodeValue) === '') {
  13750. return;
  13751. }
  13752. var contentRects = getContentRects(textNode);
  13753. if (isOutsideNodeBounds(contentRects, nodeRect)) {
  13754. return;
  13755. }
  13756. clientRects.push.apply(clientRects, _toConsumableArray(filterHiddenRects(contentRects, overflowHiddenNodes)));
  13757. });
  13758. return clientRects.length ? clientRects : filterHiddenRects([ nodeRect ], overflowHiddenNodes);
  13759. });
  13760. var get_visible_child_text_rects_default = getVisibleChildTextRects;
  13761. function getContentRects(node) {
  13762. var range2 = document.createRange();
  13763. range2.selectNodeContents(node);
  13764. return Array.from(range2.getClientRects());
  13765. }
  13766. function isOutsideNodeBounds(rects, nodeRect) {
  13767. return rects.some(function(rect) {
  13768. var centerPoint = _getRectCenter(rect);
  13769. return !_isPointInRect(centerPoint, nodeRect);
  13770. });
  13771. }
  13772. function filterHiddenRects(contentRects, overflowHiddenNodes) {
  13773. var visibleRects = [];
  13774. contentRects.forEach(function(contentRect) {
  13775. if (contentRect.width < 1 || contentRect.height < 1) {
  13776. return;
  13777. }
  13778. var visibleRect = overflowHiddenNodes.reduce(function(rect, overflowNode) {
  13779. return rect && _getIntersectionRect(rect, overflowNode.boundingClientRect);
  13780. }, contentRect);
  13781. if (visibleRect) {
  13782. visibleRects.push(visibleRect);
  13783. }
  13784. });
  13785. return visibleRects;
  13786. }
  13787. function getTextElementStack(node) {
  13788. _createGrid();
  13789. var vNode = get_node_from_tree_default(node);
  13790. var grid = vNode._grid;
  13791. if (!grid) {
  13792. return [];
  13793. }
  13794. var clientRects = get_visible_child_text_rects_default(node);
  13795. return clientRects.map(function(rect) {
  13796. return getRectStack(grid, rect);
  13797. });
  13798. }
  13799. var get_text_element_stack_default = getTextElementStack;
  13800. var visualRoles = [ 'checkbox', 'img', 'meter', 'progressbar', 'scrollbar', 'radio', 'slider', 'spinbutton', 'textbox' ];
  13801. function isVisualContent(el) {
  13802. var _nodeLookup19 = _nodeLookup(el), vNode = _nodeLookup19.vNode;
  13803. var role = axe.commons.aria.getExplicitRole(vNode);
  13804. if (role) {
  13805. return visualRoles.indexOf(role) !== -1;
  13806. }
  13807. switch (vNode.props.nodeName) {
  13808. case 'img':
  13809. case 'iframe':
  13810. case 'object':
  13811. case 'video':
  13812. case 'audio':
  13813. case 'canvas':
  13814. case 'svg':
  13815. case 'math':
  13816. case 'button':
  13817. case 'select':
  13818. case 'textarea':
  13819. case 'keygen':
  13820. case 'progress':
  13821. case 'meter':
  13822. return true;
  13823. case 'input':
  13824. return vNode.props.type !== 'hidden';
  13825. default:
  13826. return false;
  13827. }
  13828. }
  13829. var is_visual_content_default = isVisualContent;
  13830. var hiddenTextElms = [ 'head', 'title', 'template', 'script', 'style', 'iframe', 'object', 'video', 'audio', 'noscript' ];
  13831. function hasChildTextNodes(elm) {
  13832. if (hiddenTextElms.includes(elm.props.nodeName)) {
  13833. return false;
  13834. }
  13835. return elm.children.some(function(_ref37) {
  13836. var props = _ref37.props;
  13837. return props.nodeType === 3 && props.nodeValue.trim();
  13838. });
  13839. }
  13840. function hasContentVirtual(elm, noRecursion, ignoreAria) {
  13841. return hasChildTextNodes(elm) || is_visual_content_default(elm.actualNode) || !ignoreAria && !!label_virtual_default(elm) || !noRecursion && elm.children.some(function(child) {
  13842. return child.actualNode.nodeType === 1 && hasContentVirtual(child);
  13843. });
  13844. }
  13845. var has_content_virtual_default = hasContentVirtual;
  13846. function hasContent(elm, noRecursion, ignoreAria) {
  13847. elm = get_node_from_tree_default(elm);
  13848. return has_content_virtual_default(elm, noRecursion, ignoreAria);
  13849. }
  13850. var has_content_default = hasContent;
  13851. function _hasLangText(virtualNode) {
  13852. if (typeof virtualNode.children === 'undefined' || hasChildTextNodes(virtualNode)) {
  13853. return true;
  13854. }
  13855. if (virtualNode.props.nodeType === 1 && is_visual_content_default(virtualNode)) {
  13856. return !!axe.commons.text.accessibleTextVirtual(virtualNode);
  13857. }
  13858. return virtualNode.children.some(function(child) {
  13859. return !child.attr('lang') && _hasLangText(child) && !_isHiddenForEveryone(child);
  13860. });
  13861. }
  13862. function insertedIntoFocusOrder(el) {
  13863. var tabIndex = parse_tabindex_default(el.getAttribute('tabindex'));
  13864. return tabIndex > -1 && _isFocusable(el) && !is_natively_focusable_default(el);
  13865. }
  13866. var inserted_into_focus_order_default = insertedIntoFocusOrder;
  13867. function isHiddenWithCSS(el, descendentVisibilityValue) {
  13868. var _nodeLookup20 = _nodeLookup(el), vNode = _nodeLookup20.vNode, domNode = _nodeLookup20.domNode;
  13869. if (!vNode) {
  13870. return _isHiddenWithCSS(domNode, descendentVisibilityValue);
  13871. }
  13872. if (vNode._isHiddenWithCSS === void 0) {
  13873. vNode._isHiddenWithCSS = _isHiddenWithCSS(domNode, descendentVisibilityValue);
  13874. }
  13875. return vNode._isHiddenWithCSS;
  13876. }
  13877. function _isHiddenWithCSS(el, descendentVisibilityValue) {
  13878. if (el.nodeType === 9) {
  13879. return false;
  13880. }
  13881. if (el.nodeType === 11) {
  13882. el = el.host;
  13883. }
  13884. if ([ 'STYLE', 'SCRIPT' ].includes(el.nodeName.toUpperCase())) {
  13885. return false;
  13886. }
  13887. var style = window.getComputedStyle(el, null);
  13888. if (!style) {
  13889. throw new Error('Style does not exist for the given element.');
  13890. }
  13891. var displayValue = style.getPropertyValue('display');
  13892. if (displayValue === 'none') {
  13893. return true;
  13894. }
  13895. var HIDDEN_VISIBILITY_VALUES = [ 'hidden', 'collapse' ];
  13896. var visibilityValue = style.getPropertyValue('visibility');
  13897. if (HIDDEN_VISIBILITY_VALUES.includes(visibilityValue) && !descendentVisibilityValue) {
  13898. return true;
  13899. }
  13900. if (HIDDEN_VISIBILITY_VALUES.includes(visibilityValue) && descendentVisibilityValue && HIDDEN_VISIBILITY_VALUES.includes(descendentVisibilityValue)) {
  13901. return true;
  13902. }
  13903. var parent = get_composed_parent_default(el);
  13904. if (parent && !HIDDEN_VISIBILITY_VALUES.includes(visibilityValue)) {
  13905. return isHiddenWithCSS(parent, visibilityValue);
  13906. }
  13907. return false;
  13908. }
  13909. var is_hidden_with_css_default = isHiddenWithCSS;
  13910. function isHTML5(doc) {
  13911. var node = doc.doctype;
  13912. if (node === null) {
  13913. return false;
  13914. }
  13915. return node.name === 'html' && !node.publicId && !node.systemId;
  13916. }
  13917. var is_html5_default = isHTML5;
  13918. function getRoleType(role) {
  13919. var _window3;
  13920. if (role instanceof abstract_virtual_node_default || (_window3 = window) !== null && _window3 !== void 0 && _window3.Node && role instanceof window.Node) {
  13921. role = axe.commons.aria.getRole(role);
  13922. }
  13923. var roleDef = standards_default.ariaRoles[role];
  13924. return (roleDef === null || roleDef === void 0 ? void 0 : roleDef.type) || null;
  13925. }
  13926. var get_role_type_default = getRoleType;
  13927. function walkDomNode(node, functor) {
  13928. if (functor(node.actualNode) !== false) {
  13929. node.children.forEach(function(child) {
  13930. return walkDomNode(child, functor);
  13931. });
  13932. }
  13933. }
  13934. var blockLike = [ 'block', 'list-item', 'table', 'flex', 'grid', 'inline-block' ];
  13935. function isBlock(elm) {
  13936. var display2 = window.getComputedStyle(elm).getPropertyValue('display');
  13937. return blockLike.includes(display2) || display2.substr(0, 6) === 'table-';
  13938. }
  13939. function getBlockParent(node) {
  13940. var parentBlock = get_composed_parent_default(node);
  13941. while (parentBlock && !isBlock(parentBlock)) {
  13942. parentBlock = get_composed_parent_default(parentBlock);
  13943. }
  13944. return get_node_from_tree_default(parentBlock);
  13945. }
  13946. function isInTextBlock(node, options) {
  13947. if (isBlock(node)) {
  13948. return false;
  13949. }
  13950. var virtualParent = getBlockParent(node);
  13951. var parentText = '';
  13952. var widgetText = '';
  13953. var inBrBlock = 0;
  13954. walkDomNode(virtualParent, function(currNode) {
  13955. if (inBrBlock === 2) {
  13956. return false;
  13957. }
  13958. if (currNode.nodeType === 3) {
  13959. parentText += currNode.nodeValue;
  13960. }
  13961. if (currNode.nodeType !== 1) {
  13962. return;
  13963. }
  13964. var nodeName2 = (currNode.nodeName || '').toUpperCase();
  13965. if (currNode === node) {
  13966. inBrBlock = 1;
  13967. }
  13968. if ([ 'BR', 'HR' ].includes(nodeName2)) {
  13969. if (inBrBlock === 0) {
  13970. parentText = '';
  13971. widgetText = '';
  13972. } else {
  13973. inBrBlock = 2;
  13974. }
  13975. } else if (currNode.style.display === 'none' || currNode.style.overflow === 'hidden' || ![ '', null, 'none' ].includes(currNode.style['float']) || ![ '', null, 'relative' ].includes(currNode.style.position)) {
  13976. return false;
  13977. } else if (get_role_type_default(currNode) === 'widget') {
  13978. widgetText += currNode.textContent;
  13979. return false;
  13980. }
  13981. });
  13982. parentText = sanitize_default(parentText);
  13983. if (options !== null && options !== void 0 && options.noLengthCompare) {
  13984. return parentText.length !== 0;
  13985. }
  13986. widgetText = sanitize_default(widgetText);
  13987. return parentText.length > widgetText.length;
  13988. }
  13989. var is_in_text_block_default = isInTextBlock;
  13990. function isModalOpen(options) {
  13991. options = options || {};
  13992. var modalPercent = options.modalPercent || .75;
  13993. if (cache_default.get('isModalOpen')) {
  13994. return cache_default.get('isModalOpen');
  13995. }
  13996. var definiteModals = query_selector_all_filter_default(axe._tree[0], 'dialog, [role=dialog], [aria-modal=true]', _isVisibleOnScreen);
  13997. if (definiteModals.length) {
  13998. cache_default.set('isModalOpen', true);
  13999. return true;
  14000. }
  14001. var viewport = get_viewport_size_default(window);
  14002. var percentWidth = viewport.width * modalPercent;
  14003. var percentHeight = viewport.height * modalPercent;
  14004. var x = (viewport.width - percentWidth) / 2;
  14005. var y = (viewport.height - percentHeight) / 2;
  14006. var points = [ {
  14007. x: x,
  14008. y: y
  14009. }, {
  14010. x: viewport.width - x,
  14011. y: y
  14012. }, {
  14013. x: viewport.width / 2,
  14014. y: viewport.height / 2
  14015. }, {
  14016. x: x,
  14017. y: viewport.height - y
  14018. }, {
  14019. x: viewport.width - x,
  14020. y: viewport.height - y
  14021. } ];
  14022. var stacks = points.map(function(point) {
  14023. return Array.from(document.elementsFromPoint(point.x, point.y));
  14024. });
  14025. var _loop4 = function _loop4() {
  14026. var modalElement = stacks[_i11].find(function(elm) {
  14027. var style = window.getComputedStyle(elm);
  14028. return parseInt(style.width, 10) >= percentWidth && parseInt(style.height, 10) >= percentHeight && style.getPropertyValue('pointer-events') !== 'none' && (style.position === 'absolute' || style.position === 'fixed');
  14029. });
  14030. if (modalElement && stacks.every(function(stack) {
  14031. return stack.includes(modalElement);
  14032. })) {
  14033. cache_default.set('isModalOpen', true);
  14034. return {
  14035. v: true
  14036. };
  14037. }
  14038. }, _ret;
  14039. for (var _i11 = 0; _i11 < stacks.length; _i11++) {
  14040. _ret = _loop4();
  14041. if (_ret) {
  14042. return _ret.v;
  14043. }
  14044. }
  14045. cache_default.set('isModalOpen', void 0);
  14046. return void 0;
  14047. }
  14048. var is_modal_open_default = isModalOpen;
  14049. function _isMultiline(domNode) {
  14050. var margin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
  14051. var range2 = domNode.ownerDocument.createRange();
  14052. range2.setStart(domNode, 0);
  14053. range2.setEnd(domNode, domNode.childNodes.length);
  14054. var lastLineEnd = 0;
  14055. var lineCount = 0;
  14056. var _iterator5 = _createForOfIteratorHelper(range2.getClientRects()), _step5;
  14057. try {
  14058. for (_iterator5.s(); !(_step5 = _iterator5.n()).done; ) {
  14059. var rect = _step5.value;
  14060. if (rect.height <= margin) {
  14061. continue;
  14062. }
  14063. if (lastLineEnd > rect.top + margin) {
  14064. lastLineEnd = Math.max(lastLineEnd, rect.bottom);
  14065. } else if (lineCount === 0) {
  14066. lastLineEnd = rect.bottom;
  14067. lineCount++;
  14068. } else {
  14069. return true;
  14070. }
  14071. }
  14072. } catch (err) {
  14073. _iterator5.e(err);
  14074. } finally {
  14075. _iterator5.f();
  14076. }
  14077. return false;
  14078. }
  14079. function isNode(element) {
  14080. return element instanceof window.Node;
  14081. }
  14082. var is_node_default = isNode;
  14083. var cacheKey = 'color.incompleteData';
  14084. var incompleteData = {
  14085. set: function set(key, reason) {
  14086. if (typeof key !== 'string') {
  14087. throw new Error('Incomplete data: key must be a string');
  14088. }
  14089. var data = cache_default.get(cacheKey, function() {
  14090. return {};
  14091. });
  14092. if (reason) {
  14093. data[key] = reason;
  14094. }
  14095. return data[key];
  14096. },
  14097. get: function get(key) {
  14098. var data = cache_default.get(cacheKey);
  14099. return data === null || data === void 0 ? void 0 : data[key];
  14100. },
  14101. clear: function clear() {
  14102. cache_default.set(cacheKey, {});
  14103. }
  14104. };
  14105. var incomplete_data_default = incompleteData;
  14106. function elementHasImage(elm, style) {
  14107. var graphicNodes = [ 'IMG', 'CANVAS', 'OBJECT', 'IFRAME', 'VIDEO', 'SVG' ];
  14108. var nodeName2 = elm.nodeName.toUpperCase();
  14109. if (graphicNodes.includes(nodeName2)) {
  14110. incomplete_data_default.set('bgColor', 'imgNode');
  14111. return true;
  14112. }
  14113. style = style || window.getComputedStyle(elm);
  14114. var bgImageStyle = style.getPropertyValue('background-image');
  14115. var hasBgImage = bgImageStyle !== 'none';
  14116. if (hasBgImage) {
  14117. var hasGradient = /gradient/.test(bgImageStyle);
  14118. incomplete_data_default.set('bgColor', hasGradient ? 'bgGradient' : 'bgImage');
  14119. }
  14120. return hasBgImage;
  14121. }
  14122. var element_has_image_default = elementHasImage;
  14123. var imports_exports = {};
  14124. __export(imports_exports, {
  14125. ArrayFrom: function ArrayFrom() {
  14126. return import_from2['default'];
  14127. },
  14128. Colorjs: function Colorjs() {
  14129. return _Color;
  14130. },
  14131. CssSelectorParser: function CssSelectorParser() {
  14132. return import_css_selector_parser2.CssSelectorParser;
  14133. },
  14134. doT: function doT() {
  14135. return import_dot['default'];
  14136. },
  14137. emojiRegexText: function emojiRegexText() {
  14138. return emoji_regex_default;
  14139. },
  14140. memoize: function memoize() {
  14141. return import_memoizee2['default'];
  14142. }
  14143. });
  14144. var import_es6_promise = __toModule(require_es6_promise());
  14145. var import_typedarray = __toModule(require_typedarray());
  14146. var import_weakmap_polyfill = __toModule(require_weakmap_polyfill());
  14147. var import_has_own = __toModule(require_has_own3());
  14148. var import_values = __toModule(require_values3());
  14149. var import_from = __toModule(require_from4());
  14150. if (!('hasOwn' in Object)) {
  14151. Object.hasOwn = import_has_own['default'];
  14152. }
  14153. if (!('values' in Object)) {
  14154. Object.values = import_values['default'];
  14155. }
  14156. if (!('Promise' in window)) {
  14157. import_es6_promise['default'].polyfill();
  14158. }
  14159. if (!('Uint32Array' in window)) {
  14160. window.Uint32Array = import_typedarray.Uint32Array;
  14161. }
  14162. if (window.Uint32Array) {
  14163. if (!('some' in window.Uint32Array.prototype)) {
  14164. Object.defineProperty(window.Uint32Array.prototype, 'some', {
  14165. value: Array.prototype.some
  14166. });
  14167. }
  14168. if (!('reduce' in window.Uint32Array.prototype)) {
  14169. Object.defineProperty(window.Uint32Array.prototype, 'reduce', {
  14170. value: Array.prototype.reduce
  14171. });
  14172. }
  14173. }
  14174. if (typeof Object.assign !== 'function') {
  14175. (function() {
  14176. Object.assign = function(target) {
  14177. if (target === void 0 || target === null) {
  14178. throw new TypeError('Cannot convert undefined or null to object');
  14179. }
  14180. var output = Object(target);
  14181. for (var index = 1; index < arguments.length; index++) {
  14182. var source = arguments[index];
  14183. if (source !== void 0 && source !== null) {
  14184. for (var nextKey in source) {
  14185. if (source.hasOwnProperty(nextKey)) {
  14186. output[nextKey] = source[nextKey];
  14187. }
  14188. }
  14189. }
  14190. }
  14191. return output;
  14192. };
  14193. })();
  14194. }
  14195. if (!Array.prototype.find) {
  14196. Object.defineProperty(Array.prototype, 'find', {
  14197. value: function value(predicate) {
  14198. if (this === null) {
  14199. throw new TypeError('Array.prototype.find called on null or undefined');
  14200. }
  14201. if (typeof predicate !== 'function') {
  14202. throw new TypeError('predicate must be a function');
  14203. }
  14204. var list = Object(this);
  14205. var length = list.length >>> 0;
  14206. var thisArg = arguments[1];
  14207. var value;
  14208. for (var _i12 = 0; _i12 < length; _i12++) {
  14209. value = list[_i12];
  14210. if (predicate.call(thisArg, value, _i12, list)) {
  14211. return value;
  14212. }
  14213. }
  14214. return void 0;
  14215. }
  14216. });
  14217. }
  14218. if (!Array.prototype.findIndex) {
  14219. Object.defineProperty(Array.prototype, 'findIndex', {
  14220. value: function value(predicate, thisArg) {
  14221. if (this === null) {
  14222. throw new TypeError('Array.prototype.find called on null or undefined');
  14223. }
  14224. if (typeof predicate !== 'function') {
  14225. throw new TypeError('predicate must be a function');
  14226. }
  14227. var list = Object(this);
  14228. var length = list.length >>> 0;
  14229. var value;
  14230. for (var _i13 = 0; _i13 < length; _i13++) {
  14231. value = list[_i13];
  14232. if (predicate.call(thisArg, value, _i13, list)) {
  14233. return _i13;
  14234. }
  14235. }
  14236. return -1;
  14237. }
  14238. });
  14239. }
  14240. if (!Array.prototype.includes) {
  14241. Object.defineProperty(Array.prototype, 'includes', {
  14242. value: function value(searchElement) {
  14243. var O = Object(this);
  14244. var len = parseInt(O.length, 10) || 0;
  14245. if (len === 0) {
  14246. return false;
  14247. }
  14248. var n2 = parseInt(arguments[1], 10) || 0;
  14249. var k;
  14250. if (n2 >= 0) {
  14251. k = n2;
  14252. } else {
  14253. k = len + n2;
  14254. if (k < 0) {
  14255. k = 0;
  14256. }
  14257. }
  14258. var currentElement;
  14259. while (k < len) {
  14260. currentElement = O[k];
  14261. if (searchElement === currentElement || searchElement !== searchElement && currentElement !== currentElement) {
  14262. return true;
  14263. }
  14264. k++;
  14265. }
  14266. return false;
  14267. }
  14268. });
  14269. }
  14270. if (!Array.prototype.some) {
  14271. Object.defineProperty(Array.prototype, 'some', {
  14272. value: function value(fun) {
  14273. if (this == null) {
  14274. throw new TypeError('Array.prototype.some called on null or undefined');
  14275. }
  14276. if (typeof fun !== 'function') {
  14277. throw new TypeError();
  14278. }
  14279. var t = Object(this);
  14280. var len = t.length >>> 0;
  14281. var thisArg = arguments.length >= 2 ? arguments[1] : void 0;
  14282. for (var _i14 = 0; _i14 < len; _i14++) {
  14283. if (_i14 in t && fun.call(thisArg, t[_i14], _i14, t)) {
  14284. return true;
  14285. }
  14286. }
  14287. return false;
  14288. }
  14289. });
  14290. }
  14291. if (!Array.from) {
  14292. Array.from = import_from['default'];
  14293. }
  14294. if (!String.prototype.includes) {
  14295. String.prototype.includes = function(search, start) {
  14296. if (typeof start !== 'number') {
  14297. start = 0;
  14298. }
  14299. if (start + search.length > this.length) {
  14300. return false;
  14301. } else {
  14302. return this.indexOf(search, start) !== -1;
  14303. }
  14304. };
  14305. }
  14306. if (!Array.prototype.flat) {
  14307. Object.defineProperty(Array.prototype, 'flat', {
  14308. configurable: true,
  14309. value: function flat() {
  14310. var depth = isNaN(arguments[0]) ? 1 : Number(arguments[0]);
  14311. return depth ? Array.prototype.reduce.call(this, function(acc, cur) {
  14312. if (Array.isArray(cur)) {
  14313. acc.push.apply(acc, flat.call(cur, depth - 1));
  14314. } else {
  14315. acc.push(cur);
  14316. }
  14317. return acc;
  14318. }, []) : Array.prototype.slice.call(this);
  14319. },
  14320. writable: true
  14321. });
  14322. }
  14323. if (window.Node && !('isConnected' in window.Node.prototype)) {
  14324. Object.defineProperty(window.Node.prototype, 'isConnected', {
  14325. get: function get() {
  14326. return !this.ownerDocument || !(this.ownerDocument.compareDocumentPosition(this) & this.DOCUMENT_POSITION_DISCONNECTED);
  14327. }
  14328. });
  14329. }
  14330. var import_css_selector_parser2 = __toModule(require_lib());
  14331. var import_dot = __toModule(require_doT());
  14332. var import_memoizee2 = __toModule(require_memoizee());
  14333. function multiplyMatrices(A, B) {
  14334. var m3 = A.length;
  14335. if (!Array.isArray(A[0])) {
  14336. A = [ A ];
  14337. }
  14338. if (!Array.isArray(B[0])) {
  14339. B = B.map(function(x) {
  14340. return [ x ];
  14341. });
  14342. }
  14343. var p2 = B[0].length;
  14344. var B_cols = B[0].map(function(_, i) {
  14345. return B.map(function(x) {
  14346. return x[i];
  14347. });
  14348. });
  14349. var product = A.map(function(row) {
  14350. return B_cols.map(function(col) {
  14351. var ret = 0;
  14352. if (!Array.isArray(row)) {
  14353. var _iterator6 = _createForOfIteratorHelper(col), _step6;
  14354. try {
  14355. for (_iterator6.s(); !(_step6 = _iterator6.n()).done; ) {
  14356. var c4 = _step6.value;
  14357. ret += row * c4;
  14358. }
  14359. } catch (err) {
  14360. _iterator6.e(err);
  14361. } finally {
  14362. _iterator6.f();
  14363. }
  14364. return ret;
  14365. }
  14366. for (var _i15 = 0; _i15 < row.length; _i15++) {
  14367. ret += row[_i15] * (col[_i15] || 0);
  14368. }
  14369. return ret;
  14370. });
  14371. });
  14372. if (m3 === 1) {
  14373. product = product[0];
  14374. }
  14375. if (p2 === 1) {
  14376. return product.map(function(x) {
  14377. return x[0];
  14378. });
  14379. }
  14380. return product;
  14381. }
  14382. function isString(str) {
  14383. return type(str) === 'string';
  14384. }
  14385. function type(o) {
  14386. var str = Object.prototype.toString.call(o);
  14387. return (str.match(/^\[object\s+(.*?)\]$/)[1] || '').toLowerCase();
  14388. }
  14389. function toPrecision(n2, precision) {
  14390. n2 = +n2;
  14391. precision = +precision;
  14392. var integerLength = (Math.floor(n2) + '').length;
  14393. if (precision > integerLength) {
  14394. return +n2.toFixed(precision - integerLength);
  14395. } else {
  14396. var p10 = Math.pow(10, integerLength - precision);
  14397. return Math.round(n2 / p10) * p10;
  14398. }
  14399. }
  14400. function parseFunction(str) {
  14401. if (!str) {
  14402. return;
  14403. }
  14404. str = str.trim();
  14405. var isFunctionRegex = /^([a-z]+)\((.+?)\)$/i;
  14406. var isNumberRegex = /^-?[\d.]+$/;
  14407. var parts = str.match(isFunctionRegex);
  14408. if (parts) {
  14409. var args = [];
  14410. parts[2].replace(/\/?\s*([-\w.]+(?:%|deg)?)/g, function($0, arg) {
  14411. if (/%$/.test(arg)) {
  14412. arg = new Number(arg.slice(0, -1) / 100);
  14413. arg.type = '<percentage>';
  14414. } else if (/deg$/.test(arg)) {
  14415. arg = new Number(+arg.slice(0, -3));
  14416. arg.type = '<angle>';
  14417. arg.unit = 'deg';
  14418. } else if (isNumberRegex.test(arg)) {
  14419. arg = new Number(arg);
  14420. arg.type = '<number>';
  14421. }
  14422. if ($0.startsWith('/')) {
  14423. arg = arg instanceof Number ? arg : new Number(arg);
  14424. arg.alpha = true;
  14425. }
  14426. args.push(arg);
  14427. });
  14428. return {
  14429. name: parts[1].toLowerCase(),
  14430. rawName: parts[1],
  14431. rawArgs: parts[2],
  14432. args: args
  14433. };
  14434. }
  14435. }
  14436. function last(arr) {
  14437. return arr[arr.length - 1];
  14438. }
  14439. function interpolate(start, end, p2) {
  14440. if (isNaN(start)) {
  14441. return end;
  14442. }
  14443. if (isNaN(end)) {
  14444. return start;
  14445. }
  14446. return start + (end - start) * p2;
  14447. }
  14448. function interpolateInv(start, end, value) {
  14449. return (value - start) / (end - start);
  14450. }
  14451. function mapRange(from, to2, value) {
  14452. return interpolate(to2[0], to2[1], interpolateInv(from[0], from[1], value));
  14453. }
  14454. function parseCoordGrammar(coordGrammars) {
  14455. return coordGrammars.map(function(coordGrammar2) {
  14456. return coordGrammar2.split('|').map(function(type2) {
  14457. type2 = type2.trim();
  14458. var range2 = type2.match(/^(<[a-z]+>)\[(-?[.\d]+),\s*(-?[.\d]+)\]?$/);
  14459. if (range2) {
  14460. var ret = new String(range2[1]);
  14461. ret.range = [ +range2[2], +range2[3] ];
  14462. return ret;
  14463. }
  14464. return type2;
  14465. });
  14466. });
  14467. }
  14468. var util = Object.freeze({
  14469. __proto__: null,
  14470. isString: isString,
  14471. type: type,
  14472. toPrecision: toPrecision,
  14473. parseFunction: parseFunction,
  14474. last: last,
  14475. interpolate: interpolate,
  14476. interpolateInv: interpolateInv,
  14477. mapRange: mapRange,
  14478. parseCoordGrammar: parseCoordGrammar,
  14479. multiplyMatrices: multiplyMatrices
  14480. });
  14481. var Hooks = function() {
  14482. function Hooks() {
  14483. _classCallCheck(this, Hooks);
  14484. }
  14485. return _createClass(Hooks, [ {
  14486. key: 'add',
  14487. value: function add(name, callback, first) {
  14488. if (typeof arguments[0] != 'string') {
  14489. for (var name in arguments[0]) {
  14490. this.add(name, arguments[0][name], arguments[1]);
  14491. }
  14492. return;
  14493. }
  14494. (Array.isArray(name) ? name : [ name ]).forEach(function(name2) {
  14495. this[name2] = this[name2] || [];
  14496. if (callback) {
  14497. this[name2][first ? 'unshift' : 'push'](callback);
  14498. }
  14499. }, this);
  14500. }
  14501. }, {
  14502. key: 'run',
  14503. value: function run(name, env) {
  14504. this[name] = this[name] || [];
  14505. this[name].forEach(function(callback) {
  14506. callback.call(env && env.context ? env.context : env, env);
  14507. });
  14508. }
  14509. } ]);
  14510. }();
  14511. var hooks = new Hooks();
  14512. var defaults = {
  14513. gamut_mapping: 'lch.c',
  14514. precision: 5,
  14515. deltaE: '76'
  14516. };
  14517. var WHITES = {
  14518. D50: [ .3457 / .3585, 1, (1 - .3457 - .3585) / .3585 ],
  14519. D65: [ .3127 / .329, 1, (1 - .3127 - .329) / .329 ]
  14520. };
  14521. function getWhite(name) {
  14522. if (Array.isArray(name)) {
  14523. return name;
  14524. }
  14525. return WHITES[name];
  14526. }
  14527. function adapt$1(W1, W2, XYZ) {
  14528. var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  14529. W1 = getWhite(W1);
  14530. W2 = getWhite(W2);
  14531. if (!W1 || !W2) {
  14532. throw new TypeError('Missing white point to convert '.concat(!W1 ? 'from' : '').concat(!W1 && !W2 ? '/' : '').concat(!W2 ? 'to' : ''));
  14533. }
  14534. if (W1 === W2) {
  14535. return XYZ;
  14536. }
  14537. var env = {
  14538. W1: W1,
  14539. W2: W2,
  14540. XYZ: XYZ,
  14541. options: options
  14542. };
  14543. hooks.run('chromatic-adaptation-start', env);
  14544. if (!env.M) {
  14545. if (env.W1 === WHITES.D65 && env.W2 === WHITES.D50) {
  14546. env.M = [ [ 1.0479298208405488, .022946793341019088, -.05019222954313557 ], [ .029627815688159344, .990434484573249, -.01707382502938514 ], [ -.009243058152591178, .015055144896577895, .7518742899580008 ] ];
  14547. } else if (env.W1 === WHITES.D50 && env.W2 === WHITES.D65) {
  14548. env.M = [ [ .9554734527042182, -.023098536874261423, .0632593086610217 ], [ -.028369706963208136, 1.0099954580058226, .021041398966943008 ], [ .012314001688319899, -.020507696433477912, 1.3303659366080753 ] ];
  14549. }
  14550. }
  14551. hooks.run('chromatic-adaptation-end', env);
  14552. if (env.M) {
  14553. return multiplyMatrices(env.M, env.XYZ);
  14554. } else {
  14555. throw new TypeError('Only Bradford CAT with white points D50 and D65 supported for now.');
  14556. }
  14557. }
  14558. var \u03b5$4 = 75e-6;
  14559. var _ColorSpace2 = (_Class_brand = new WeakSet(), _path = new WeakMap(), function() {
  14560. function _ColorSpace(options) {
  14561. var _options$coords, _ref38, _options$white, _options$formats, _this$formats$functio, _this$formats, _this$formats2;
  14562. _classCallCheck(this, _ColorSpace);
  14563. _classPrivateMethodInitSpec(this, _Class_brand);
  14564. _classPrivateFieldInitSpec(this, _path, void 0);
  14565. this.id = options.id;
  14566. this.name = options.name;
  14567. this.base = options.base ? _ColorSpace2.get(options.base) : null;
  14568. this.aliases = options.aliases;
  14569. if (this.base) {
  14570. this.fromBase = options.fromBase;
  14571. this.toBase = options.toBase;
  14572. }
  14573. var _coords = (_options$coords = options.coords) !== null && _options$coords !== void 0 ? _options$coords : this.base.coords;
  14574. this.coords = _coords;
  14575. var white2 = (_ref38 = (_options$white = options.white) !== null && _options$white !== void 0 ? _options$white : this.base.white) !== null && _ref38 !== void 0 ? _ref38 : 'D65';
  14576. this.white = getWhite(white2);
  14577. this.formats = (_options$formats = options.formats) !== null && _options$formats !== void 0 ? _options$formats : {};
  14578. for (var name in this.formats) {
  14579. var format = this.formats[name];
  14580. format.type || (format.type = 'function');
  14581. format.name || (format.name = name);
  14582. }
  14583. if (options.cssId && !((_this$formats$functio = this.formats.functions) !== null && _this$formats$functio !== void 0 && _this$formats$functio.color)) {
  14584. this.formats.color = {
  14585. id: options.cssId
  14586. };
  14587. Object.defineProperty(this, 'cssId', {
  14588. value: options.cssId
  14589. });
  14590. } else if ((_this$formats = this.formats) !== null && _this$formats !== void 0 && _this$formats.color && !((_this$formats2 = this.formats) !== null && _this$formats2 !== void 0 && _this$formats2.color.id)) {
  14591. this.formats.color.id = this.id;
  14592. }
  14593. this.referred = options.referred;
  14594. _classPrivateFieldSet(_path, this, _assertClassBrand(_Class_brand, this, _getPath).call(this).reverse());
  14595. hooks.run('colorspace-init-end', this);
  14596. }
  14597. return _createClass(_ColorSpace, [ {
  14598. key: 'inGamut',
  14599. value: function inGamut(coords) {
  14600. var _ref39 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref39$epsilon = _ref39.epsilon, epsilon = _ref39$epsilon === void 0 ? \u03b5$4 : _ref39$epsilon;
  14601. if (this.isPolar) {
  14602. coords = this.toBase(coords);
  14603. return this.base.inGamut(coords, {
  14604. epsilon: epsilon
  14605. });
  14606. }
  14607. var coordMeta = Object.values(this.coords);
  14608. return coords.every(function(c4, i) {
  14609. var meta = coordMeta[i];
  14610. if (meta.type !== 'angle' && meta.range) {
  14611. if (Number.isNaN(c4)) {
  14612. return true;
  14613. }
  14614. var _meta$range = _slicedToArray(meta.range, 2), min = _meta$range[0], max2 = _meta$range[1];
  14615. return (min === void 0 || c4 >= min - epsilon) && (max2 === void 0 || c4 <= max2 + epsilon);
  14616. }
  14617. return true;
  14618. });
  14619. }
  14620. }, {
  14621. key: 'cssId',
  14622. get: function get() {
  14623. var _this$formats$functio2;
  14624. return ((_this$formats$functio2 = this.formats.functions) === null || _this$formats$functio2 === void 0 || (_this$formats$functio2 = _this$formats$functio2.color) === null || _this$formats$functio2 === void 0 ? void 0 : _this$formats$functio2.id) || this.id;
  14625. }
  14626. }, {
  14627. key: 'isPolar',
  14628. get: function get() {
  14629. for (var id in this.coords) {
  14630. if (this.coords[id].type === 'angle') {
  14631. return true;
  14632. }
  14633. }
  14634. return false;
  14635. }
  14636. }, {
  14637. key: 'getFormat',
  14638. value: function getFormat(format) {
  14639. if (_typeof(format) === 'object') {
  14640. format = _assertClassBrand(_Class_brand, this, _processFormat).call(this, format);
  14641. return format;
  14642. }
  14643. var ret;
  14644. if (format === 'default') {
  14645. ret = Object.values(this.formats)[0];
  14646. } else {
  14647. ret = this.formats[format];
  14648. }
  14649. if (ret) {
  14650. ret = _assertClassBrand(_Class_brand, this, _processFormat).call(this, ret);
  14651. return ret;
  14652. }
  14653. return null;
  14654. }
  14655. }, {
  14656. key: 'to',
  14657. value: function to(space, coords) {
  14658. if (arguments.length === 1) {
  14659. var _ref40 = [ space.space, space.coords ];
  14660. space = _ref40[0];
  14661. coords = _ref40[1];
  14662. }
  14663. space = _ColorSpace2.get(space);
  14664. if (this === space) {
  14665. return coords;
  14666. }
  14667. coords = coords.map(function(c4) {
  14668. return Number.isNaN(c4) ? 0 : c4;
  14669. });
  14670. var myPath = _classPrivateFieldGet(_path, this);
  14671. var otherPath = _classPrivateFieldGet(_path, space);
  14672. var connectionSpace, connectionSpaceIndex;
  14673. for (var _i16 = 0; _i16 < myPath.length; _i16++) {
  14674. if (myPath[_i16] === otherPath[_i16]) {
  14675. connectionSpace = myPath[_i16];
  14676. connectionSpaceIndex = _i16;
  14677. } else {
  14678. break;
  14679. }
  14680. }
  14681. if (!connectionSpace) {
  14682. throw new Error('Cannot convert between color spaces '.concat(this, ' and ').concat(space, ': no connection space was found'));
  14683. }
  14684. for (var _i17 = myPath.length - 1; _i17 > connectionSpaceIndex; _i17--) {
  14685. coords = myPath[_i17].toBase(coords);
  14686. }
  14687. for (var _i18 = connectionSpaceIndex + 1; _i18 < otherPath.length; _i18++) {
  14688. coords = otherPath[_i18].fromBase(coords);
  14689. }
  14690. return coords;
  14691. }
  14692. }, {
  14693. key: 'from',
  14694. value: function from(space, coords) {
  14695. if (arguments.length === 1) {
  14696. var _ref41 = [ space.space, space.coords ];
  14697. space = _ref41[0];
  14698. coords = _ref41[1];
  14699. }
  14700. space = _ColorSpace2.get(space);
  14701. return space.to(this, coords);
  14702. }
  14703. }, {
  14704. key: 'toString',
  14705. value: function toString() {
  14706. return ''.concat(this.name, ' (').concat(this.id, ')');
  14707. }
  14708. }, {
  14709. key: 'getMinCoords',
  14710. value: function getMinCoords() {
  14711. var ret = [];
  14712. for (var id in this.coords) {
  14713. var _range2$min;
  14714. var meta = this.coords[id];
  14715. var range2 = meta.range || meta.refRange;
  14716. ret.push((_range2$min = range2 === null || range2 === void 0 ? void 0 : range2.min) !== null && _range2$min !== void 0 ? _range2$min : 0);
  14717. }
  14718. return ret;
  14719. }
  14720. } ], [ {
  14721. key: 'all',
  14722. get: function get() {
  14723. return _toConsumableArray(new Set(Object.values(_ColorSpace2.registry)));
  14724. }
  14725. }, {
  14726. key: 'register',
  14727. value: function register(id, space) {
  14728. if (arguments.length === 1) {
  14729. space = arguments[0];
  14730. id = space.id;
  14731. }
  14732. space = this.get(space);
  14733. if (this.registry[id] && this.registry[id] !== space) {
  14734. throw new Error('Duplicate color space registration: \''.concat(id, '\''));
  14735. }
  14736. this.registry[id] = space;
  14737. if (arguments.length === 1 && space.aliases) {
  14738. var _iterator7 = _createForOfIteratorHelper(space.aliases), _step7;
  14739. try {
  14740. for (_iterator7.s(); !(_step7 = _iterator7.n()).done; ) {
  14741. var alias = _step7.value;
  14742. this.register(alias, space);
  14743. }
  14744. } catch (err) {
  14745. _iterator7.e(err);
  14746. } finally {
  14747. _iterator7.f();
  14748. }
  14749. }
  14750. return space;
  14751. }
  14752. }, {
  14753. key: 'get',
  14754. value: function get(space) {
  14755. if (!space || space instanceof _ColorSpace2) {
  14756. return space;
  14757. }
  14758. var argType = type(space);
  14759. if (argType === 'string') {
  14760. var ret = _ColorSpace2.registry[space.toLowerCase()];
  14761. if (!ret) {
  14762. throw new TypeError('No color space found with id = "'.concat(space, '"'));
  14763. }
  14764. return ret;
  14765. }
  14766. for (var _len2 = arguments.length, alternatives = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  14767. alternatives[_key2 - 1] = arguments[_key2];
  14768. }
  14769. if (alternatives.length) {
  14770. return _ColorSpace2.get.apply(_ColorSpace2, alternatives);
  14771. }
  14772. throw new TypeError(''.concat(space, ' is not a valid color space'));
  14773. }
  14774. }, {
  14775. key: 'resolveCoord',
  14776. value: function resolveCoord(ref, workingSpace) {
  14777. var coordType = type(ref);
  14778. var space, coord;
  14779. if (coordType === 'string') {
  14780. if (ref.includes('.')) {
  14781. var _ref$split = ref.split('.');
  14782. var _ref$split2 = _slicedToArray(_ref$split, 2);
  14783. space = _ref$split2[0];
  14784. coord = _ref$split2[1];
  14785. } else {
  14786. space = void 0;
  14787. coord = ref;
  14788. }
  14789. } else if (Array.isArray(ref)) {
  14790. var _ref42 = _slicedToArray(ref, 2);
  14791. space = _ref42[0];
  14792. coord = _ref42[1];
  14793. } else {
  14794. space = ref.space;
  14795. coord = ref.coordId;
  14796. }
  14797. space = _ColorSpace2.get(space);
  14798. if (!space) {
  14799. space = workingSpace;
  14800. }
  14801. if (!space) {
  14802. throw new TypeError('Cannot resolve coordinate reference '.concat(ref, ': No color space specified and relative references are not allowed here'));
  14803. }
  14804. coordType = type(coord);
  14805. if (coordType === 'number' || coordType === 'string' && coord >= 0) {
  14806. var meta = Object.entries(space.coords)[coord];
  14807. if (meta) {
  14808. return _extends({
  14809. space: space,
  14810. id: meta[0],
  14811. index: coord
  14812. }, meta[1]);
  14813. }
  14814. }
  14815. space = _ColorSpace2.get(space);
  14816. var normalizedCoord = coord.toLowerCase();
  14817. var i = 0;
  14818. for (var id in space.coords) {
  14819. var _meta$name;
  14820. var _meta = space.coords[id];
  14821. if (id.toLowerCase() === normalizedCoord || ((_meta$name = _meta.name) === null || _meta$name === void 0 ? void 0 : _meta$name.toLowerCase()) === normalizedCoord) {
  14822. return _extends({
  14823. space: space,
  14824. id: id,
  14825. index: i
  14826. }, _meta);
  14827. }
  14828. i++;
  14829. }
  14830. throw new TypeError('No "'.concat(coord, '" coordinate found in ').concat(space.name, '. Its coordinates are: ').concat(Object.keys(space.coords).join(', ')));
  14831. }
  14832. } ]);
  14833. }());
  14834. function _processFormat(format) {
  14835. if (format.coords && !format.coordGrammar) {
  14836. format.type || (format.type = 'function');
  14837. format.name || (format.name = 'color');
  14838. format.coordGrammar = parseCoordGrammar(format.coords);
  14839. var coordFormats = Object.entries(this.coords).map(function(_ref150, i) {
  14840. var _ref151 = _slicedToArray(_ref150, 2), id = _ref151[0], coordMeta = _ref151[1];
  14841. var outputType = format.coordGrammar[i][0];
  14842. var fromRange = coordMeta.range || coordMeta.refRange;
  14843. var toRange = outputType.range, suffix = '';
  14844. if (outputType == '<percentage>') {
  14845. toRange = [ 0, 100 ];
  14846. suffix = '%';
  14847. } else if (outputType == '<angle>') {
  14848. suffix = 'deg';
  14849. }
  14850. return {
  14851. fromRange: fromRange,
  14852. toRange: toRange,
  14853. suffix: suffix
  14854. };
  14855. });
  14856. format.serializeCoords = function(coords, precision) {
  14857. return coords.map(function(c4, i) {
  14858. var _coordFormats$i = coordFormats[i], fromRange = _coordFormats$i.fromRange, toRange = _coordFormats$i.toRange, suffix = _coordFormats$i.suffix;
  14859. if (fromRange && toRange) {
  14860. c4 = mapRange(fromRange, toRange, c4);
  14861. }
  14862. c4 = toPrecision(c4, precision);
  14863. if (suffix) {
  14864. c4 += suffix;
  14865. }
  14866. return c4;
  14867. });
  14868. };
  14869. }
  14870. return format;
  14871. }
  14872. function _getPath() {
  14873. var ret = [ this ];
  14874. for (var _space2 = this; _space2 = _space2.base; ) {
  14875. ret.push(_space2);
  14876. }
  14877. return ret;
  14878. }
  14879. var ColorSpace = _ColorSpace2;
  14880. __publicField(ColorSpace, 'registry', {});
  14881. __publicField(ColorSpace, 'DEFAULT_FORMAT', {
  14882. type: 'functions',
  14883. name: 'color'
  14884. });
  14885. var XYZ_D65 = new ColorSpace({
  14886. id: 'xyz-d65',
  14887. name: 'XYZ D65',
  14888. coords: {
  14889. x: {
  14890. name: 'X'
  14891. },
  14892. y: {
  14893. name: 'Y'
  14894. },
  14895. z: {
  14896. name: 'Z'
  14897. }
  14898. },
  14899. white: 'D65',
  14900. formats: {
  14901. color: {
  14902. ids: [ 'xyz-d65', 'xyz' ]
  14903. }
  14904. },
  14905. aliases: [ 'xyz' ]
  14906. });
  14907. var RGBColorSpace = function(_ColorSpace3) {
  14908. function RGBColorSpace(options) {
  14909. var _options$referred;
  14910. var _this;
  14911. _classCallCheck(this, RGBColorSpace);
  14912. if (!options.coords) {
  14913. options.coords = {
  14914. r: {
  14915. range: [ 0, 1 ],
  14916. name: 'Red'
  14917. },
  14918. g: {
  14919. range: [ 0, 1 ],
  14920. name: 'Green'
  14921. },
  14922. b: {
  14923. range: [ 0, 1 ],
  14924. name: 'Blue'
  14925. }
  14926. };
  14927. }
  14928. if (!options.base) {
  14929. options.base = XYZ_D65;
  14930. }
  14931. if (options.toXYZ_M && options.fromXYZ_M) {
  14932. var _options$toBase, _options$fromBase;
  14933. (_options$toBase = options.toBase) !== null && _options$toBase !== void 0 ? _options$toBase : options.toBase = function(rgb) {
  14934. var xyz = multiplyMatrices(options.toXYZ_M, rgb);
  14935. if (_this.white !== _this.base.white) {
  14936. xyz = adapt$1(_this.white, _this.base.white, xyz);
  14937. }
  14938. return xyz;
  14939. };
  14940. (_options$fromBase = options.fromBase) !== null && _options$fromBase !== void 0 ? _options$fromBase : options.fromBase = function(xyz) {
  14941. xyz = adapt$1(_this.base.white, _this.white, xyz);
  14942. return multiplyMatrices(options.fromXYZ_M, xyz);
  14943. };
  14944. }
  14945. (_options$referred = options.referred) !== null && _options$referred !== void 0 ? _options$referred : options.referred = 'display';
  14946. return _this = _callSuper(this, RGBColorSpace, [ options ]);
  14947. }
  14948. _inherits(RGBColorSpace, _ColorSpace3);
  14949. return _createClass(RGBColorSpace);
  14950. }(ColorSpace);
  14951. function parse2(str) {
  14952. var _String;
  14953. var env = {
  14954. str: (_String = String(str)) === null || _String === void 0 ? void 0 : _String.trim()
  14955. };
  14956. hooks.run('parse-start', env);
  14957. if (env.color) {
  14958. return env.color;
  14959. }
  14960. env.parsed = parseFunction(env.str);
  14961. if (env.parsed) {
  14962. var name = env.parsed.name;
  14963. if (name === 'color') {
  14964. var id = env.parsed.args.shift();
  14965. var alpha = env.parsed.rawArgs.indexOf('/') > 0 ? env.parsed.args.pop() : 1;
  14966. var _iterator8 = _createForOfIteratorHelper(ColorSpace.all), _step8;
  14967. try {
  14968. var _loop5 = function _loop5() {
  14969. var space = _step8.value;
  14970. var colorSpec = space.getFormat('color');
  14971. if (colorSpec) {
  14972. var _colorSpec$ids;
  14973. if (id === colorSpec.id || (_colorSpec$ids = colorSpec.ids) !== null && _colorSpec$ids !== void 0 && _colorSpec$ids.includes(id)) {
  14974. var argCount = Object.keys(space.coords).length;
  14975. var coords = Array(argCount).fill(0);
  14976. coords.forEach(function(_, i) {
  14977. return coords[i] = env.parsed.args[i] || 0;
  14978. });
  14979. return {
  14980. v: {
  14981. spaceId: space.id,
  14982. coords: coords,
  14983. alpha: alpha
  14984. }
  14985. };
  14986. }
  14987. }
  14988. }, _ret2;
  14989. for (_iterator8.s(); !(_step8 = _iterator8.n()).done; ) {
  14990. _ret2 = _loop5();
  14991. if (_ret2) {
  14992. return _ret2.v;
  14993. }
  14994. }
  14995. } catch (err) {
  14996. _iterator8.e(err);
  14997. } finally {
  14998. _iterator8.f();
  14999. }
  15000. var didYouMean = '';
  15001. if (id in ColorSpace.registry) {
  15002. var _ColorSpace$registry$;
  15003. var cssId = (_ColorSpace$registry$ = ColorSpace.registry[id].formats) === null || _ColorSpace$registry$ === void 0 || (_ColorSpace$registry$ = _ColorSpace$registry$.functions) === null || _ColorSpace$registry$ === void 0 || (_ColorSpace$registry$ = _ColorSpace$registry$.color) === null || _ColorSpace$registry$ === void 0 ? void 0 : _ColorSpace$registry$.id;
  15004. if (cssId) {
  15005. didYouMean = 'Did you mean color('.concat(cssId, ')?');
  15006. }
  15007. }
  15008. throw new TypeError('Cannot parse color('.concat(id, '). ') + (didYouMean || 'Missing a plugin?'));
  15009. } else {
  15010. var _iterator9 = _createForOfIteratorHelper(ColorSpace.all), _step9;
  15011. try {
  15012. var _loop6 = function _loop6() {
  15013. var space = _step9.value;
  15014. var format = space.getFormat(name);
  15015. if (format && format.type === 'function') {
  15016. var _alpha = 1;
  15017. if (format.lastAlpha || last(env.parsed.args).alpha) {
  15018. _alpha = env.parsed.args.pop();
  15019. }
  15020. var coords = env.parsed.args;
  15021. if (format.coordGrammar) {
  15022. Object.entries(space.coords).forEach(function(_ref43, i) {
  15023. var _coords$i;
  15024. var _ref44 = _slicedToArray(_ref43, 2), id = _ref44[0], coordMeta = _ref44[1];
  15025. var coordGrammar2 = format.coordGrammar[i];
  15026. var providedType = (_coords$i = coords[i]) === null || _coords$i === void 0 ? void 0 : _coords$i.type;
  15027. coordGrammar2 = coordGrammar2.find(function(c4) {
  15028. return c4 == providedType;
  15029. });
  15030. if (!coordGrammar2) {
  15031. var coordName = coordMeta.name || id;
  15032. throw new TypeError(''.concat(providedType, ' not allowed for ').concat(coordName, ' in ').concat(name, '()'));
  15033. }
  15034. var fromRange = coordGrammar2.range;
  15035. if (providedType === '<percentage>') {
  15036. fromRange || (fromRange = [ 0, 1 ]);
  15037. }
  15038. var toRange = coordMeta.range || coordMeta.refRange;
  15039. if (fromRange && toRange) {
  15040. coords[i] = mapRange(fromRange, toRange, coords[i]);
  15041. }
  15042. });
  15043. }
  15044. return {
  15045. v: {
  15046. spaceId: space.id,
  15047. coords: coords,
  15048. alpha: _alpha
  15049. }
  15050. };
  15051. }
  15052. }, _ret3;
  15053. for (_iterator9.s(); !(_step9 = _iterator9.n()).done; ) {
  15054. _ret3 = _loop6();
  15055. if (_ret3) {
  15056. return _ret3.v;
  15057. }
  15058. }
  15059. } catch (err) {
  15060. _iterator9.e(err);
  15061. } finally {
  15062. _iterator9.f();
  15063. }
  15064. }
  15065. } else {
  15066. var _iterator10 = _createForOfIteratorHelper(ColorSpace.all), _step10;
  15067. try {
  15068. for (_iterator10.s(); !(_step10 = _iterator10.n()).done; ) {
  15069. var space = _step10.value;
  15070. for (var formatId in space.formats) {
  15071. var format = space.formats[formatId];
  15072. if (format.type !== 'custom') {
  15073. continue;
  15074. }
  15075. if (format.test && !format.test(env.str)) {
  15076. continue;
  15077. }
  15078. var color = format.parse(env.str);
  15079. if (color) {
  15080. var _color$alpha;
  15081. (_color$alpha = color.alpha) !== null && _color$alpha !== void 0 ? _color$alpha : color.alpha = 1;
  15082. return color;
  15083. }
  15084. }
  15085. }
  15086. } catch (err) {
  15087. _iterator10.e(err);
  15088. } finally {
  15089. _iterator10.f();
  15090. }
  15091. }
  15092. throw new TypeError('Could not parse '.concat(str, ' as a color. Missing a plugin?'));
  15093. }
  15094. function getColor(color) {
  15095. if (!color) {
  15096. throw new TypeError('Empty color reference');
  15097. }
  15098. if (isString(color)) {
  15099. color = parse2(color);
  15100. }
  15101. var space = color.space || color.spaceId;
  15102. if (!(space instanceof ColorSpace)) {
  15103. color.space = ColorSpace.get(space);
  15104. }
  15105. if (color.alpha === void 0) {
  15106. color.alpha = 1;
  15107. }
  15108. return color;
  15109. }
  15110. function getAll(color, space) {
  15111. space = ColorSpace.get(space);
  15112. return space.from(color);
  15113. }
  15114. function get(color, prop) {
  15115. var _ColorSpace$resolveCo = ColorSpace.resolveCoord(prop, color.space), space = _ColorSpace$resolveCo.space, index = _ColorSpace$resolveCo.index;
  15116. var coords = getAll(color, space);
  15117. return coords[index];
  15118. }
  15119. function setAll(color, space, coords) {
  15120. space = ColorSpace.get(space);
  15121. color.coords = space.to(color.space, coords);
  15122. return color;
  15123. }
  15124. function set(color, prop, value) {
  15125. color = getColor(color);
  15126. if (arguments.length === 2 && type(arguments[1]) === 'object') {
  15127. var object = arguments[1];
  15128. for (var p2 in object) {
  15129. set(color, p2, object[p2]);
  15130. }
  15131. } else {
  15132. if (typeof value === 'function') {
  15133. value = value(get(color, prop));
  15134. }
  15135. var _ColorSpace$resolveCo2 = ColorSpace.resolveCoord(prop, color.space), space = _ColorSpace$resolveCo2.space, index = _ColorSpace$resolveCo2.index;
  15136. var coords = getAll(color, space);
  15137. coords[index] = value;
  15138. setAll(color, space, coords);
  15139. }
  15140. return color;
  15141. }
  15142. var XYZ_D50 = new ColorSpace({
  15143. id: 'xyz-d50',
  15144. name: 'XYZ D50',
  15145. white: 'D50',
  15146. base: XYZ_D65,
  15147. fromBase: function fromBase(coords) {
  15148. return adapt$1(XYZ_D65.white, 'D50', coords);
  15149. },
  15150. toBase: function toBase(coords) {
  15151. return adapt$1('D50', XYZ_D65.white, coords);
  15152. },
  15153. formats: {
  15154. color: {}
  15155. }
  15156. });
  15157. var \u03b5$3 = 216 / 24389;
  15158. var \u03b53$1 = 24 / 116;
  15159. var \u03ba$1 = 24389 / 27;
  15160. var white$1 = WHITES.D50;
  15161. var lab = new ColorSpace({
  15162. id: 'lab',
  15163. name: 'Lab',
  15164. coords: {
  15165. l: {
  15166. refRange: [ 0, 100 ],
  15167. name: 'L'
  15168. },
  15169. a: {
  15170. refRange: [ -125, 125 ]
  15171. },
  15172. b: {
  15173. refRange: [ -125, 125 ]
  15174. }
  15175. },
  15176. white: white$1,
  15177. base: XYZ_D50,
  15178. fromBase: function fromBase(XYZ) {
  15179. var xyz = XYZ.map(function(value, i) {
  15180. return value / white$1[i];
  15181. });
  15182. var f = xyz.map(function(value) {
  15183. return value > \u03b5$3 ? Math.cbrt(value) : (\u03ba$1 * value + 16) / 116;
  15184. });
  15185. return [ 116 * f[1] - 16, 500 * (f[0] - f[1]), 200 * (f[1] - f[2]) ];
  15186. },
  15187. toBase: function toBase(Lab) {
  15188. var f = [];
  15189. f[1] = (Lab[0] + 16) / 116;
  15190. f[0] = Lab[1] / 500 + f[1];
  15191. f[2] = f[1] - Lab[2] / 200;
  15192. var xyz = [ f[0] > \u03b53$1 ? Math.pow(f[0], 3) : (116 * f[0] - 16) / \u03ba$1, Lab[0] > 8 ? Math.pow((Lab[0] + 16) / 116, 3) : Lab[0] / \u03ba$1, f[2] > \u03b53$1 ? Math.pow(f[2], 3) : (116 * f[2] - 16) / \u03ba$1 ];
  15193. return xyz.map(function(value, i) {
  15194. return value * white$1[i];
  15195. });
  15196. },
  15197. formats: {
  15198. lab: {
  15199. coords: [ '<number> | <percentage>', '<number>', '<number>' ]
  15200. }
  15201. }
  15202. });
  15203. function constrain(angle) {
  15204. return (angle % 360 + 360) % 360;
  15205. }
  15206. function adjust(arc, angles) {
  15207. if (arc === 'raw') {
  15208. return angles;
  15209. }
  15210. var _angles$map = angles.map(constrain), _angles$map2 = _slicedToArray(_angles$map, 2), a1 = _angles$map2[0], a2 = _angles$map2[1];
  15211. var angleDiff = a2 - a1;
  15212. if (arc === 'increasing') {
  15213. if (angleDiff < 0) {
  15214. a2 += 360;
  15215. }
  15216. } else if (arc === 'decreasing') {
  15217. if (angleDiff > 0) {
  15218. a1 += 360;
  15219. }
  15220. } else if (arc === 'longer') {
  15221. if (-180 < angleDiff && angleDiff < 180) {
  15222. if (angleDiff > 0) {
  15223. a2 += 360;
  15224. } else {
  15225. a1 += 360;
  15226. }
  15227. }
  15228. } else if (arc === 'shorter') {
  15229. if (angleDiff > 180) {
  15230. a1 += 360;
  15231. } else if (angleDiff < -180) {
  15232. a2 += 360;
  15233. }
  15234. }
  15235. return [ a1, a2 ];
  15236. }
  15237. var lch = new ColorSpace({
  15238. id: 'lch',
  15239. name: 'LCH',
  15240. coords: {
  15241. l: {
  15242. refRange: [ 0, 100 ],
  15243. name: 'Lightness'
  15244. },
  15245. c: {
  15246. refRange: [ 0, 150 ],
  15247. name: 'Chroma'
  15248. },
  15249. h: {
  15250. refRange: [ 0, 360 ],
  15251. type: 'angle',
  15252. name: 'Hue'
  15253. }
  15254. },
  15255. base: lab,
  15256. fromBase: function fromBase(Lab) {
  15257. var _Lab = _slicedToArray(Lab, 3), L = _Lab[0], a2 = _Lab[1], b2 = _Lab[2];
  15258. var hue;
  15259. var \u03b52 = .02;
  15260. if (Math.abs(a2) < \u03b52 && Math.abs(b2) < \u03b52) {
  15261. hue = NaN;
  15262. } else {
  15263. hue = Math.atan2(b2, a2) * 180 / Math.PI;
  15264. }
  15265. return [ L, Math.sqrt(Math.pow(a2, 2) + Math.pow(b2, 2)), constrain(hue) ];
  15266. },
  15267. toBase: function toBase(LCH) {
  15268. var _LCH = _slicedToArray(LCH, 3), Lightness = _LCH[0], Chroma = _LCH[1], Hue = _LCH[2];
  15269. if (Chroma < 0) {
  15270. Chroma = 0;
  15271. }
  15272. if (isNaN(Hue)) {
  15273. Hue = 0;
  15274. }
  15275. return [ Lightness, Chroma * Math.cos(Hue * Math.PI / 180), Chroma * Math.sin(Hue * Math.PI / 180) ];
  15276. },
  15277. formats: {
  15278. lch: {
  15279. coords: [ '<number> | <percentage>', '<number>', '<number> | <angle>' ]
  15280. }
  15281. }
  15282. });
  15283. var Gfactor = Math.pow(25, 7);
  15284. var \u03c0$1 = Math.PI;
  15285. var r2d = 180 / \u03c0$1;
  15286. var d2r$1 = \u03c0$1 / 180;
  15287. function deltaE2000(color, sample) {
  15288. var _ref45 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, _ref45$kL = _ref45.kL, kL = _ref45$kL === void 0 ? 1 : _ref45$kL, _ref45$kC = _ref45.kC, kC = _ref45$kC === void 0 ? 1 : _ref45$kC, _ref45$kH = _ref45.kH, kH = _ref45$kH === void 0 ? 1 : _ref45$kH;
  15289. var _lab$from = lab.from(color), _lab$from2 = _slicedToArray(_lab$from, 3), L1 = _lab$from2[0], a1 = _lab$from2[1], b1 = _lab$from2[2];
  15290. var C1 = lch.from(lab, [ L1, a1, b1 ])[1];
  15291. var _lab$from3 = lab.from(sample), _lab$from4 = _slicedToArray(_lab$from3, 3), L2 = _lab$from4[0], a2 = _lab$from4[1], b2 = _lab$from4[2];
  15292. var C2 = lch.from(lab, [ L2, a2, b2 ])[1];
  15293. if (C1 < 0) {
  15294. C1 = 0;
  15295. }
  15296. if (C2 < 0) {
  15297. C2 = 0;
  15298. }
  15299. var Cbar = (C1 + C2) / 2;
  15300. var C7 = Math.pow(Cbar, 7);
  15301. var G = .5 * (1 - Math.sqrt(C7 / (C7 + Gfactor)));
  15302. var adash1 = (1 + G) * a1;
  15303. var adash2 = (1 + G) * a2;
  15304. var Cdash1 = Math.sqrt(Math.pow(adash1, 2) + Math.pow(b1, 2));
  15305. var Cdash2 = Math.sqrt(Math.pow(adash2, 2) + Math.pow(b2, 2));
  15306. var h1 = adash1 === 0 && b1 === 0 ? 0 : Math.atan2(b1, adash1);
  15307. var h2 = adash2 === 0 && b2 === 0 ? 0 : Math.atan2(b2, adash2);
  15308. if (h1 < 0) {
  15309. h1 += 2 * \u03c0$1;
  15310. }
  15311. if (h2 < 0) {
  15312. h2 += 2 * \u03c0$1;
  15313. }
  15314. h1 *= r2d;
  15315. h2 *= r2d;
  15316. var \u0394L = L2 - L1;
  15317. var \u0394C = Cdash2 - Cdash1;
  15318. var hdiff = h2 - h1;
  15319. var hsum = h1 + h2;
  15320. var habs = Math.abs(hdiff);
  15321. var \u0394h;
  15322. if (Cdash1 * Cdash2 === 0) {
  15323. \u0394h = 0;
  15324. } else if (habs <= 180) {
  15325. \u0394h = hdiff;
  15326. } else if (hdiff > 180) {
  15327. \u0394h = hdiff - 360;
  15328. } else if (hdiff < -180) {
  15329. \u0394h = hdiff + 360;
  15330. } else {
  15331. console.log('the unthinkable has happened');
  15332. }
  15333. var \u0394H = 2 * Math.sqrt(Cdash2 * Cdash1) * Math.sin(\u0394h * d2r$1 / 2);
  15334. var Ldash = (L1 + L2) / 2;
  15335. var Cdash = (Cdash1 + Cdash2) / 2;
  15336. var Cdash7 = Math.pow(Cdash, 7);
  15337. var hdash;
  15338. if (Cdash1 * Cdash2 === 0) {
  15339. hdash = hsum;
  15340. } else if (habs <= 180) {
  15341. hdash = hsum / 2;
  15342. } else if (hsum < 360) {
  15343. hdash = (hsum + 360) / 2;
  15344. } else {
  15345. hdash = (hsum - 360) / 2;
  15346. }
  15347. var lsq = Math.pow(Ldash - 50, 2);
  15348. var SL = 1 + .015 * lsq / Math.sqrt(20 + lsq);
  15349. var SC = 1 + .045 * Cdash;
  15350. var T = 1;
  15351. T -= .17 * Math.cos((hdash - 30) * d2r$1);
  15352. T += .24 * Math.cos(2 * hdash * d2r$1);
  15353. T += .32 * Math.cos((3 * hdash + 6) * d2r$1);
  15354. T -= .2 * Math.cos((4 * hdash - 63) * d2r$1);
  15355. var SH = 1 + .015 * Cdash * T;
  15356. var \u0394\u03b8 = 30 * Math.exp(-1 * Math.pow((hdash - 275) / 25, 2));
  15357. var RC = 2 * Math.sqrt(Cdash7 / (Cdash7 + Gfactor));
  15358. var RT = -1 * Math.sin(2 * \u0394\u03b8 * d2r$1) * RC;
  15359. var dE = Math.pow(\u0394L / (kL * SL), 2);
  15360. dE += Math.pow(\u0394C / (kC * SC), 2);
  15361. dE += Math.pow(\u0394H / (kH * SH), 2);
  15362. dE += RT * (\u0394C / (kC * SC)) * (\u0394H / (kH * SH));
  15363. return Math.sqrt(dE);
  15364. }
  15365. var \u03b5$2 = 75e-6;
  15366. function inGamut(color) {
  15367. var space = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : color.space;
  15368. var _ref46 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, _ref46$epsilon = _ref46.epsilon, epsilon = _ref46$epsilon === void 0 ? \u03b5$2 : _ref46$epsilon;
  15369. color = getColor(color);
  15370. space = ColorSpace.get(space);
  15371. var coords = color.coords;
  15372. if (space !== color.space) {
  15373. coords = space.from(color);
  15374. }
  15375. return space.inGamut(coords, {
  15376. epsilon: epsilon
  15377. });
  15378. }
  15379. function clone2(color) {
  15380. return {
  15381. space: color.space,
  15382. coords: color.coords.slice(),
  15383. alpha: color.alpha
  15384. };
  15385. }
  15386. function toGamut(color) {
  15387. var _ref47 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref47$method = _ref47.method, method = _ref47$method === void 0 ? defaults.gamut_mapping : _ref47$method, _ref47$space = _ref47.space, space = _ref47$space === void 0 ? color.space : _ref47$space;
  15388. if (isString(arguments[1])) {
  15389. space = arguments[1];
  15390. }
  15391. space = ColorSpace.get(space);
  15392. if (inGamut(color, space, {
  15393. epsilon: 0
  15394. })) {
  15395. return color;
  15396. }
  15397. var spaceColor = to(color, space);
  15398. if (method !== 'clip' && !inGamut(color, space)) {
  15399. var clipped = toGamut(clone2(spaceColor), {
  15400. method: 'clip',
  15401. space: space
  15402. });
  15403. if (deltaE2000(color, clipped) > 2) {
  15404. var coordMeta = ColorSpace.resolveCoord(method);
  15405. var mapSpace = coordMeta.space;
  15406. var coordId = coordMeta.id;
  15407. var mappedColor = to(spaceColor, mapSpace);
  15408. var bounds = coordMeta.range || coordMeta.refRange;
  15409. var min = bounds[0];
  15410. var \u03b52 = .01;
  15411. var low = min;
  15412. var high = get(mappedColor, coordId);
  15413. while (high - low > \u03b52) {
  15414. var clipped2 = clone2(mappedColor);
  15415. clipped2 = toGamut(clipped2, {
  15416. space: space,
  15417. method: 'clip'
  15418. });
  15419. var deltaE2 = deltaE2000(mappedColor, clipped2);
  15420. if (deltaE2 - 2 < \u03b52) {
  15421. low = get(mappedColor, coordId);
  15422. } else {
  15423. high = get(mappedColor, coordId);
  15424. }
  15425. set(mappedColor, coordId, (low + high) / 2);
  15426. }
  15427. spaceColor = to(mappedColor, space);
  15428. } else {
  15429. spaceColor = clipped;
  15430. }
  15431. }
  15432. if (method === 'clip' || !inGamut(spaceColor, space, {
  15433. epsilon: 0
  15434. })) {
  15435. var _bounds = Object.values(space.coords).map(function(c4) {
  15436. return c4.range || [];
  15437. });
  15438. spaceColor.coords = spaceColor.coords.map(function(c4, i) {
  15439. var _bounds$i = _slicedToArray(_bounds[i], 2), min = _bounds$i[0], max2 = _bounds$i[1];
  15440. if (min !== void 0) {
  15441. c4 = Math.max(min, c4);
  15442. }
  15443. if (max2 !== void 0) {
  15444. c4 = Math.min(c4, max2);
  15445. }
  15446. return c4;
  15447. });
  15448. }
  15449. if (space !== color.space) {
  15450. spaceColor = to(spaceColor, color.space);
  15451. }
  15452. color.coords = spaceColor.coords;
  15453. return color;
  15454. }
  15455. toGamut.returns = 'color';
  15456. function to(color, space) {
  15457. var _ref48 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, inGamut2 = _ref48.inGamut;
  15458. color = getColor(color);
  15459. space = ColorSpace.get(space);
  15460. var coords = space.from(color);
  15461. var ret = {
  15462. space: space,
  15463. coords: coords,
  15464. alpha: color.alpha
  15465. };
  15466. if (inGamut2) {
  15467. ret = toGamut(ret);
  15468. }
  15469. return ret;
  15470. }
  15471. to.returns = 'color';
  15472. function serialize(color) {
  15473. var _ref50, _color$space$getForma;
  15474. var _ref49 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  15475. var _ref49$precision = _ref49.precision, precision = _ref49$precision === void 0 ? defaults.precision : _ref49$precision, _ref49$format = _ref49.format, format = _ref49$format === void 0 ? 'default' : _ref49$format, _ref49$inGamut = _ref49.inGamut, inGamut$1 = _ref49$inGamut === void 0 ? true : _ref49$inGamut, customOptions = _objectWithoutProperties(_ref49, _excluded9);
  15476. var ret;
  15477. color = getColor(color);
  15478. var formatId = format;
  15479. format = (_ref50 = (_color$space$getForma = color.space.getFormat(format)) !== null && _color$space$getForma !== void 0 ? _color$space$getForma : color.space.getFormat('default')) !== null && _ref50 !== void 0 ? _ref50 : ColorSpace.DEFAULT_FORMAT;
  15480. inGamut$1 || (inGamut$1 = format.toGamut);
  15481. var coords = color.coords;
  15482. coords = coords.map(function(c4) {
  15483. return c4 ? c4 : 0;
  15484. });
  15485. if (inGamut$1 && !inGamut(color)) {
  15486. coords = toGamut(clone2(color), inGamut$1 === true ? void 0 : inGamut$1).coords;
  15487. }
  15488. if (format.type === 'custom') {
  15489. customOptions.precision = precision;
  15490. if (format.serialize) {
  15491. ret = format.serialize(coords, color.alpha, customOptions);
  15492. } else {
  15493. throw new TypeError('format '.concat(formatId, ' can only be used to parse colors, not for serialization'));
  15494. }
  15495. } else {
  15496. var name = format.name || 'color';
  15497. if (format.serializeCoords) {
  15498. coords = format.serializeCoords(coords, precision);
  15499. } else {
  15500. if (precision !== null) {
  15501. coords = coords.map(function(c4) {
  15502. return toPrecision(c4, precision);
  15503. });
  15504. }
  15505. }
  15506. var args = _toConsumableArray(coords);
  15507. if (name === 'color') {
  15508. var _format$ids;
  15509. var cssId = format.id || ((_format$ids = format.ids) === null || _format$ids === void 0 ? void 0 : _format$ids[0]) || color.space.id;
  15510. args.unshift(cssId);
  15511. }
  15512. var alpha = color.alpha;
  15513. if (precision !== null) {
  15514. alpha = toPrecision(alpha, precision);
  15515. }
  15516. var strAlpha = color.alpha < 1 && !format.noAlpha ? ''.concat(format.commas ? ',' : ' /', ' ').concat(alpha) : '';
  15517. ret = ''.concat(name, '(').concat(args.join(format.commas ? ', ' : ' ')).concat(strAlpha, ')');
  15518. }
  15519. return ret;
  15520. }
  15521. var toXYZ_M$5 = [ [ .6369580483012914, .14461690358620832, .1688809751641721 ], [ .2627002120112671, .6779980715188708, .05930171646986196 ], [ 0, .028072693049087428, 1.060985057710791 ] ];
  15522. var fromXYZ_M$5 = [ [ 1.716651187971268, -.355670783776392, -.25336628137366 ], [ -.666684351832489, 1.616481236634939, .0157685458139111 ], [ .017639857445311, -.042770613257809, .942103121235474 ] ];
  15523. var REC2020Linear = new RGBColorSpace({
  15524. id: 'rec2020-linear',
  15525. name: 'Linear REC.2020',
  15526. white: 'D65',
  15527. toXYZ_M: toXYZ_M$5,
  15528. fromXYZ_M: fromXYZ_M$5,
  15529. formats: {
  15530. color: {}
  15531. }
  15532. });
  15533. var \u03b1 = 1.09929682680944;
  15534. var \u03b2 = .018053968510807;
  15535. var REC2020 = new RGBColorSpace({
  15536. id: 'rec2020',
  15537. name: 'REC.2020',
  15538. base: REC2020Linear,
  15539. toBase: function toBase(RGB) {
  15540. return RGB.map(function(val) {
  15541. if (val < \u03b2 * 4.5) {
  15542. return val / 4.5;
  15543. }
  15544. return Math.pow((val + \u03b1 - 1) / \u03b1, 1 / .45);
  15545. });
  15546. },
  15547. fromBase: function fromBase(RGB) {
  15548. return RGB.map(function(val) {
  15549. if (val >= \u03b2) {
  15550. return \u03b1 * Math.pow(val, .45) - (\u03b1 - 1);
  15551. }
  15552. return 4.5 * val;
  15553. });
  15554. },
  15555. formats: {
  15556. color: {}
  15557. }
  15558. });
  15559. var toXYZ_M$4 = [ [ .4865709486482162, .26566769316909306, .1982172852343625 ], [ .2289745640697488, .6917385218365064, .079286914093745 ], [ 0, .04511338185890264, 1.043944368900976 ] ];
  15560. var fromXYZ_M$4 = [ [ 2.493496911941425, -.9313836179191239, -.40271078445071684 ], [ -.8294889695615747, 1.7626640603183463, .023624685841943577 ], [ .03584583024378447, -.07617238926804182, .9568845240076872 ] ];
  15561. var P3Linear = new RGBColorSpace({
  15562. id: 'p3-linear',
  15563. name: 'Linear P3',
  15564. white: 'D65',
  15565. toXYZ_M: toXYZ_M$4,
  15566. fromXYZ_M: fromXYZ_M$4
  15567. });
  15568. var toXYZ_M$3 = [ [ .41239079926595934, .357584339383878, .1804807884018343 ], [ .21263900587151027, .715168678767756, .07219231536073371 ], [ .01933081871559182, .11919477979462598, .9505321522496607 ] ];
  15569. var fromXYZ_M$3 = [ [ 3.2409699419045226, -1.537383177570094, -.4986107602930034 ], [ -.9692436362808796, 1.8759675015077202, .04155505740717559 ], [ .05563007969699366, -.20397695888897652, 1.0569715142428786 ] ];
  15570. var sRGBLinear = new RGBColorSpace({
  15571. id: 'srgb-linear',
  15572. name: 'Linear sRGB',
  15573. white: 'D65',
  15574. toXYZ_M: toXYZ_M$3,
  15575. fromXYZ_M: fromXYZ_M$3,
  15576. formats: {
  15577. color: {}
  15578. }
  15579. });
  15580. var KEYWORDS = {
  15581. aliceblue: [ 240 / 255, 248 / 255, 1 ],
  15582. antiquewhite: [ 250 / 255, 235 / 255, 215 / 255 ],
  15583. aqua: [ 0, 1, 1 ],
  15584. aquamarine: [ 127 / 255, 1, 212 / 255 ],
  15585. azure: [ 240 / 255, 1, 1 ],
  15586. beige: [ 245 / 255, 245 / 255, 220 / 255 ],
  15587. bisque: [ 1, 228 / 255, 196 / 255 ],
  15588. black: [ 0, 0, 0 ],
  15589. blanchedalmond: [ 1, 235 / 255, 205 / 255 ],
  15590. blue: [ 0, 0, 1 ],
  15591. blueviolet: [ 138 / 255, 43 / 255, 226 / 255 ],
  15592. brown: [ 165 / 255, 42 / 255, 42 / 255 ],
  15593. burlywood: [ 222 / 255, 184 / 255, 135 / 255 ],
  15594. cadetblue: [ 95 / 255, 158 / 255, 160 / 255 ],
  15595. chartreuse: [ 127 / 255, 1, 0 ],
  15596. chocolate: [ 210 / 255, 105 / 255, 30 / 255 ],
  15597. coral: [ 1, 127 / 255, 80 / 255 ],
  15598. cornflowerblue: [ 100 / 255, 149 / 255, 237 / 255 ],
  15599. cornsilk: [ 1, 248 / 255, 220 / 255 ],
  15600. crimson: [ 220 / 255, 20 / 255, 60 / 255 ],
  15601. cyan: [ 0, 1, 1 ],
  15602. darkblue: [ 0, 0, 139 / 255 ],
  15603. darkcyan: [ 0, 139 / 255, 139 / 255 ],
  15604. darkgoldenrod: [ 184 / 255, 134 / 255, 11 / 255 ],
  15605. darkgray: [ 169 / 255, 169 / 255, 169 / 255 ],
  15606. darkgreen: [ 0, 100 / 255, 0 ],
  15607. darkgrey: [ 169 / 255, 169 / 255, 169 / 255 ],
  15608. darkkhaki: [ 189 / 255, 183 / 255, 107 / 255 ],
  15609. darkmagenta: [ 139 / 255, 0, 139 / 255 ],
  15610. darkolivegreen: [ 85 / 255, 107 / 255, 47 / 255 ],
  15611. darkorange: [ 1, 140 / 255, 0 ],
  15612. darkorchid: [ 153 / 255, 50 / 255, 204 / 255 ],
  15613. darkred: [ 139 / 255, 0, 0 ],
  15614. darksalmon: [ 233 / 255, 150 / 255, 122 / 255 ],
  15615. darkseagreen: [ 143 / 255, 188 / 255, 143 / 255 ],
  15616. darkslateblue: [ 72 / 255, 61 / 255, 139 / 255 ],
  15617. darkslategray: [ 47 / 255, 79 / 255, 79 / 255 ],
  15618. darkslategrey: [ 47 / 255, 79 / 255, 79 / 255 ],
  15619. darkturquoise: [ 0, 206 / 255, 209 / 255 ],
  15620. darkviolet: [ 148 / 255, 0, 211 / 255 ],
  15621. deeppink: [ 1, 20 / 255, 147 / 255 ],
  15622. deepskyblue: [ 0, 191 / 255, 1 ],
  15623. dimgray: [ 105 / 255, 105 / 255, 105 / 255 ],
  15624. dimgrey: [ 105 / 255, 105 / 255, 105 / 255 ],
  15625. dodgerblue: [ 30 / 255, 144 / 255, 1 ],
  15626. firebrick: [ 178 / 255, 34 / 255, 34 / 255 ],
  15627. floralwhite: [ 1, 250 / 255, 240 / 255 ],
  15628. forestgreen: [ 34 / 255, 139 / 255, 34 / 255 ],
  15629. fuchsia: [ 1, 0, 1 ],
  15630. gainsboro: [ 220 / 255, 220 / 255, 220 / 255 ],
  15631. ghostwhite: [ 248 / 255, 248 / 255, 1 ],
  15632. gold: [ 1, 215 / 255, 0 ],
  15633. goldenrod: [ 218 / 255, 165 / 255, 32 / 255 ],
  15634. gray: [ 128 / 255, 128 / 255, 128 / 255 ],
  15635. green: [ 0, 128 / 255, 0 ],
  15636. greenyellow: [ 173 / 255, 1, 47 / 255 ],
  15637. grey: [ 128 / 255, 128 / 255, 128 / 255 ],
  15638. honeydew: [ 240 / 255, 1, 240 / 255 ],
  15639. hotpink: [ 1, 105 / 255, 180 / 255 ],
  15640. indianred: [ 205 / 255, 92 / 255, 92 / 255 ],
  15641. indigo: [ 75 / 255, 0, 130 / 255 ],
  15642. ivory: [ 1, 1, 240 / 255 ],
  15643. khaki: [ 240 / 255, 230 / 255, 140 / 255 ],
  15644. lavender: [ 230 / 255, 230 / 255, 250 / 255 ],
  15645. lavenderblush: [ 1, 240 / 255, 245 / 255 ],
  15646. lawngreen: [ 124 / 255, 252 / 255, 0 ],
  15647. lemonchiffon: [ 1, 250 / 255, 205 / 255 ],
  15648. lightblue: [ 173 / 255, 216 / 255, 230 / 255 ],
  15649. lightcoral: [ 240 / 255, 128 / 255, 128 / 255 ],
  15650. lightcyan: [ 224 / 255, 1, 1 ],
  15651. lightgoldenrodyellow: [ 250 / 255, 250 / 255, 210 / 255 ],
  15652. lightgray: [ 211 / 255, 211 / 255, 211 / 255 ],
  15653. lightgreen: [ 144 / 255, 238 / 255, 144 / 255 ],
  15654. lightgrey: [ 211 / 255, 211 / 255, 211 / 255 ],
  15655. lightpink: [ 1, 182 / 255, 193 / 255 ],
  15656. lightsalmon: [ 1, 160 / 255, 122 / 255 ],
  15657. lightseagreen: [ 32 / 255, 178 / 255, 170 / 255 ],
  15658. lightskyblue: [ 135 / 255, 206 / 255, 250 / 255 ],
  15659. lightslategray: [ 119 / 255, 136 / 255, 153 / 255 ],
  15660. lightslategrey: [ 119 / 255, 136 / 255, 153 / 255 ],
  15661. lightsteelblue: [ 176 / 255, 196 / 255, 222 / 255 ],
  15662. lightyellow: [ 1, 1, 224 / 255 ],
  15663. lime: [ 0, 1, 0 ],
  15664. limegreen: [ 50 / 255, 205 / 255, 50 / 255 ],
  15665. linen: [ 250 / 255, 240 / 255, 230 / 255 ],
  15666. magenta: [ 1, 0, 1 ],
  15667. maroon: [ 128 / 255, 0, 0 ],
  15668. mediumaquamarine: [ 102 / 255, 205 / 255, 170 / 255 ],
  15669. mediumblue: [ 0, 0, 205 / 255 ],
  15670. mediumorchid: [ 186 / 255, 85 / 255, 211 / 255 ],
  15671. mediumpurple: [ 147 / 255, 112 / 255, 219 / 255 ],
  15672. mediumseagreen: [ 60 / 255, 179 / 255, 113 / 255 ],
  15673. mediumslateblue: [ 123 / 255, 104 / 255, 238 / 255 ],
  15674. mediumspringgreen: [ 0, 250 / 255, 154 / 255 ],
  15675. mediumturquoise: [ 72 / 255, 209 / 255, 204 / 255 ],
  15676. mediumvioletred: [ 199 / 255, 21 / 255, 133 / 255 ],
  15677. midnightblue: [ 25 / 255, 25 / 255, 112 / 255 ],
  15678. mintcream: [ 245 / 255, 1, 250 / 255 ],
  15679. mistyrose: [ 1, 228 / 255, 225 / 255 ],
  15680. moccasin: [ 1, 228 / 255, 181 / 255 ],
  15681. navajowhite: [ 1, 222 / 255, 173 / 255 ],
  15682. navy: [ 0, 0, 128 / 255 ],
  15683. oldlace: [ 253 / 255, 245 / 255, 230 / 255 ],
  15684. olive: [ 128 / 255, 128 / 255, 0 ],
  15685. olivedrab: [ 107 / 255, 142 / 255, 35 / 255 ],
  15686. orange: [ 1, 165 / 255, 0 ],
  15687. orangered: [ 1, 69 / 255, 0 ],
  15688. orchid: [ 218 / 255, 112 / 255, 214 / 255 ],
  15689. palegoldenrod: [ 238 / 255, 232 / 255, 170 / 255 ],
  15690. palegreen: [ 152 / 255, 251 / 255, 152 / 255 ],
  15691. paleturquoise: [ 175 / 255, 238 / 255, 238 / 255 ],
  15692. palevioletred: [ 219 / 255, 112 / 255, 147 / 255 ],
  15693. papayawhip: [ 1, 239 / 255, 213 / 255 ],
  15694. peachpuff: [ 1, 218 / 255, 185 / 255 ],
  15695. peru: [ 205 / 255, 133 / 255, 63 / 255 ],
  15696. pink: [ 1, 192 / 255, 203 / 255 ],
  15697. plum: [ 221 / 255, 160 / 255, 221 / 255 ],
  15698. powderblue: [ 176 / 255, 224 / 255, 230 / 255 ],
  15699. purple: [ 128 / 255, 0, 128 / 255 ],
  15700. rebeccapurple: [ 102 / 255, 51 / 255, 153 / 255 ],
  15701. red: [ 1, 0, 0 ],
  15702. rosybrown: [ 188 / 255, 143 / 255, 143 / 255 ],
  15703. royalblue: [ 65 / 255, 105 / 255, 225 / 255 ],
  15704. saddlebrown: [ 139 / 255, 69 / 255, 19 / 255 ],
  15705. salmon: [ 250 / 255, 128 / 255, 114 / 255 ],
  15706. sandybrown: [ 244 / 255, 164 / 255, 96 / 255 ],
  15707. seagreen: [ 46 / 255, 139 / 255, 87 / 255 ],
  15708. seashell: [ 1, 245 / 255, 238 / 255 ],
  15709. sienna: [ 160 / 255, 82 / 255, 45 / 255 ],
  15710. silver: [ 192 / 255, 192 / 255, 192 / 255 ],
  15711. skyblue: [ 135 / 255, 206 / 255, 235 / 255 ],
  15712. slateblue: [ 106 / 255, 90 / 255, 205 / 255 ],
  15713. slategray: [ 112 / 255, 128 / 255, 144 / 255 ],
  15714. slategrey: [ 112 / 255, 128 / 255, 144 / 255 ],
  15715. snow: [ 1, 250 / 255, 250 / 255 ],
  15716. springgreen: [ 0, 1, 127 / 255 ],
  15717. steelblue: [ 70 / 255, 130 / 255, 180 / 255 ],
  15718. tan: [ 210 / 255, 180 / 255, 140 / 255 ],
  15719. teal: [ 0, 128 / 255, 128 / 255 ],
  15720. thistle: [ 216 / 255, 191 / 255, 216 / 255 ],
  15721. tomato: [ 1, 99 / 255, 71 / 255 ],
  15722. turquoise: [ 64 / 255, 224 / 255, 208 / 255 ],
  15723. violet: [ 238 / 255, 130 / 255, 238 / 255 ],
  15724. wheat: [ 245 / 255, 222 / 255, 179 / 255 ],
  15725. white: [ 1, 1, 1 ],
  15726. whitesmoke: [ 245 / 255, 245 / 255, 245 / 255 ],
  15727. yellow: [ 1, 1, 0 ],
  15728. yellowgreen: [ 154 / 255, 205 / 255, 50 / 255 ]
  15729. };
  15730. var coordGrammar = Array(3).fill('<percentage> | <number>[0, 255]');
  15731. var coordGrammarNumber = Array(3).fill('<number>[0, 255]');
  15732. var sRGB = new RGBColorSpace({
  15733. id: 'srgb',
  15734. name: 'sRGB',
  15735. base: sRGBLinear,
  15736. fromBase: function fromBase(rgb) {
  15737. return rgb.map(function(val) {
  15738. var sign = val < 0 ? -1 : 1;
  15739. var abs = val * sign;
  15740. if (abs > .0031308) {
  15741. return sign * (1.055 * Math.pow(abs, 1 / 2.4) - .055);
  15742. }
  15743. return 12.92 * val;
  15744. });
  15745. },
  15746. toBase: function toBase(rgb) {
  15747. return rgb.map(function(val) {
  15748. var sign = val < 0 ? -1 : 1;
  15749. var abs = val * sign;
  15750. if (abs < .04045) {
  15751. return val / 12.92;
  15752. }
  15753. return sign * Math.pow((abs + .055) / 1.055, 2.4);
  15754. });
  15755. },
  15756. formats: {
  15757. rgb: {
  15758. coords: coordGrammar
  15759. },
  15760. rgb_number: {
  15761. name: 'rgb',
  15762. commas: true,
  15763. coords: coordGrammarNumber,
  15764. noAlpha: true
  15765. },
  15766. color: {},
  15767. rgba: {
  15768. coords: coordGrammar,
  15769. commas: true,
  15770. lastAlpha: true
  15771. },
  15772. rgba_number: {
  15773. name: 'rgba',
  15774. commas: true,
  15775. coords: coordGrammarNumber
  15776. },
  15777. hex: {
  15778. type: 'custom',
  15779. toGamut: true,
  15780. test: function test(str) {
  15781. return /^#([a-f0-9]{3,4}){1,2}$/i.test(str);
  15782. },
  15783. parse: function parse(str) {
  15784. if (str.length <= 5) {
  15785. str = str.replace(/[a-f0-9]/gi, '$&$&');
  15786. }
  15787. var rgba = [];
  15788. str.replace(/[a-f0-9]{2}/gi, function(component) {
  15789. rgba.push(parseInt(component, 16) / 255);
  15790. });
  15791. return {
  15792. spaceId: 'srgb',
  15793. coords: rgba.slice(0, 3),
  15794. alpha: rgba.slice(3)[0]
  15795. };
  15796. },
  15797. serialize: function serialize(coords, alpha) {
  15798. var _ref51 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, _ref51$collapse = _ref51.collapse, collapse = _ref51$collapse === void 0 ? true : _ref51$collapse;
  15799. if (alpha < 1) {
  15800. coords.push(alpha);
  15801. }
  15802. coords = coords.map(function(c4) {
  15803. return Math.round(c4 * 255);
  15804. });
  15805. var collapsible = collapse && coords.every(function(c4) {
  15806. return c4 % 17 === 0;
  15807. });
  15808. var hex = coords.map(function(c4) {
  15809. if (collapsible) {
  15810. return (c4 / 17).toString(16);
  15811. }
  15812. return c4.toString(16).padStart(2, '0');
  15813. }).join('');
  15814. return '#' + hex;
  15815. }
  15816. },
  15817. keyword: {
  15818. type: 'custom',
  15819. test: function test(str) {
  15820. return /^[a-z]+$/i.test(str);
  15821. },
  15822. parse: function parse(str) {
  15823. str = str.toLowerCase();
  15824. var ret = {
  15825. spaceId: 'srgb',
  15826. coords: null,
  15827. alpha: 1
  15828. };
  15829. if (str === 'transparent') {
  15830. ret.coords = KEYWORDS.black;
  15831. ret.alpha = 0;
  15832. } else {
  15833. ret.coords = KEYWORDS[str];
  15834. }
  15835. if (ret.coords) {
  15836. return ret;
  15837. }
  15838. }
  15839. }
  15840. }
  15841. });
  15842. var P3 = new RGBColorSpace({
  15843. id: 'p3',
  15844. name: 'P3',
  15845. base: P3Linear,
  15846. fromBase: sRGB.fromBase,
  15847. toBase: sRGB.toBase,
  15848. formats: {
  15849. color: {
  15850. id: 'display-p3'
  15851. }
  15852. }
  15853. });
  15854. defaults.display_space = sRGB;
  15855. if (typeof CSS !== 'undefined' && (_CSS = CSS) !== null && _CSS !== void 0 && _CSS.supports) {
  15856. for (var _i19 = 0, _arr2 = [ lab, REC2020, P3 ]; _i19 < _arr2.length; _i19++) {
  15857. var space = _arr2[_i19];
  15858. var coords = space.getMinCoords();
  15859. var color = {
  15860. space: space,
  15861. coords: coords,
  15862. alpha: 1
  15863. };
  15864. var str = serialize(color);
  15865. if (CSS.supports('color', str)) {
  15866. defaults.display_space = space;
  15867. break;
  15868. }
  15869. }
  15870. }
  15871. function _display(color) {
  15872. var _CSS2;
  15873. var _ref52 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  15874. var _ref52$space = _ref52.space, space = _ref52$space === void 0 ? defaults.display_space : _ref52$space, options = _objectWithoutProperties(_ref52, _excluded10);
  15875. var ret = serialize(color, options);
  15876. if (typeof CSS === 'undefined' || (_CSS2 = CSS) !== null && _CSS2 !== void 0 && _CSS2.supports('color', ret) || !defaults.display_space) {
  15877. ret = new String(ret);
  15878. ret.color = color;
  15879. } else {
  15880. var fallbackColor = to(color, space);
  15881. ret = new String(serialize(fallbackColor, options));
  15882. ret.color = fallbackColor;
  15883. }
  15884. return ret;
  15885. }
  15886. function distance(color1, color2) {
  15887. var space = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'lab';
  15888. space = ColorSpace.get(space);
  15889. var coords1 = space.from(color1);
  15890. var coords2 = space.from(color2);
  15891. return Math.sqrt(coords1.reduce(function(acc, c12, i) {
  15892. var c22 = coords2[i];
  15893. if (isNaN(c12) || isNaN(c22)) {
  15894. return acc;
  15895. }
  15896. return acc + Math.pow(c22 - c12, 2);
  15897. }, 0));
  15898. }
  15899. function equals(color1, color2) {
  15900. color1 = getColor(color1);
  15901. color2 = getColor(color2);
  15902. return color1.space === color2.space && color1.alpha === color2.alpha && color1.coords.every(function(c4, i) {
  15903. return c4 === color2.coords[i];
  15904. });
  15905. }
  15906. function getLuminance(color) {
  15907. return get(color, [ XYZ_D65, 'y' ]);
  15908. }
  15909. function setLuminance(color, value) {
  15910. set(color, [ XYZ_D65, 'y' ], value);
  15911. }
  15912. function register$2(Color3) {
  15913. Object.defineProperty(Color3.prototype, 'luminance', {
  15914. get: function get() {
  15915. return getLuminance(this);
  15916. },
  15917. set: function set(value) {
  15918. setLuminance(this, value);
  15919. }
  15920. });
  15921. }
  15922. var luminance = Object.freeze({
  15923. __proto__: null,
  15924. getLuminance: getLuminance,
  15925. setLuminance: setLuminance,
  15926. register: register$2
  15927. });
  15928. function contrastWCAG21(color1, color2) {
  15929. color1 = getColor(color1);
  15930. color2 = getColor(color2);
  15931. var Y1 = Math.max(getLuminance(color1), 0);
  15932. var Y2 = Math.max(getLuminance(color2), 0);
  15933. if (Y2 > Y1) {
  15934. var _ref53 = [ Y2, Y1 ];
  15935. Y1 = _ref53[0];
  15936. Y2 = _ref53[1];
  15937. }
  15938. return (Y1 + .05) / (Y2 + .05);
  15939. }
  15940. var normBG = .56;
  15941. var normTXT = .57;
  15942. var revTXT = .62;
  15943. var revBG = .65;
  15944. var blkThrs = .022;
  15945. var blkClmp = 1.414;
  15946. var loClip = .1;
  15947. var deltaYmin = 5e-4;
  15948. var scaleBoW = 1.14;
  15949. var loBoWoffset = .027;
  15950. var scaleWoB = 1.14;
  15951. function fclamp(Y) {
  15952. if (Y >= blkThrs) {
  15953. return Y;
  15954. }
  15955. return Y + Math.pow(blkThrs - Y, blkClmp);
  15956. }
  15957. function linearize(val) {
  15958. var sign = val < 0 ? -1 : 1;
  15959. var abs = Math.abs(val);
  15960. return sign * Math.pow(abs, 2.4);
  15961. }
  15962. function contrastAPCA(background, foreground) {
  15963. foreground = getColor(foreground);
  15964. background = getColor(background);
  15965. var S;
  15966. var C;
  15967. var Sapc;
  15968. var R, G, B;
  15969. foreground = to(foreground, 'srgb');
  15970. var _foreground$coords = _slicedToArray(foreground.coords, 3);
  15971. R = _foreground$coords[0];
  15972. G = _foreground$coords[1];
  15973. B = _foreground$coords[2];
  15974. var lumTxt = linearize(R) * .2126729 + linearize(G) * .7151522 + linearize(B) * .072175;
  15975. background = to(background, 'srgb');
  15976. var _background$coords = _slicedToArray(background.coords, 3);
  15977. R = _background$coords[0];
  15978. G = _background$coords[1];
  15979. B = _background$coords[2];
  15980. var lumBg = linearize(R) * .2126729 + linearize(G) * .7151522 + linearize(B) * .072175;
  15981. var Ytxt = fclamp(lumTxt);
  15982. var Ybg = fclamp(lumBg);
  15983. var BoW = Ybg > Ytxt;
  15984. if (Math.abs(Ybg - Ytxt) < deltaYmin) {
  15985. C = 0;
  15986. } else {
  15987. if (BoW) {
  15988. S = Math.pow(Ybg, normBG) - Math.pow(Ytxt, normTXT);
  15989. C = S * scaleBoW;
  15990. } else {
  15991. S = Math.pow(Ybg, revBG) - Math.pow(Ytxt, revTXT);
  15992. C = S * scaleWoB;
  15993. }
  15994. }
  15995. if (Math.abs(C) < loClip) {
  15996. Sapc = 0;
  15997. } else if (C > 0) {
  15998. Sapc = C - loBoWoffset;
  15999. } else {
  16000. Sapc = C + loBoWoffset;
  16001. }
  16002. return Sapc * 100;
  16003. }
  16004. function contrastMichelson(color1, color2) {
  16005. color1 = getColor(color1);
  16006. color2 = getColor(color2);
  16007. var Y1 = Math.max(getLuminance(color1), 0);
  16008. var Y2 = Math.max(getLuminance(color2), 0);
  16009. if (Y2 > Y1) {
  16010. var _ref54 = [ Y2, Y1 ];
  16011. Y1 = _ref54[0];
  16012. Y2 = _ref54[1];
  16013. }
  16014. var denom = Y1 + Y2;
  16015. return denom === 0 ? 0 : (Y1 - Y2) / denom;
  16016. }
  16017. var max = 5e4;
  16018. function contrastWeber(color1, color2) {
  16019. color1 = getColor(color1);
  16020. color2 = getColor(color2);
  16021. var Y1 = Math.max(getLuminance(color1), 0);
  16022. var Y2 = Math.max(getLuminance(color2), 0);
  16023. if (Y2 > Y1) {
  16024. var _ref55 = [ Y2, Y1 ];
  16025. Y1 = _ref55[0];
  16026. Y2 = _ref55[1];
  16027. }
  16028. return Y2 === 0 ? max : (Y1 - Y2) / Y2;
  16029. }
  16030. function contrastLstar(color1, color2) {
  16031. color1 = getColor(color1);
  16032. color2 = getColor(color2);
  16033. var L1 = get(color1, [ lab, 'l' ]);
  16034. var L2 = get(color2, [ lab, 'l' ]);
  16035. return Math.abs(L1 - L2);
  16036. }
  16037. var \u03b5$1 = 216 / 24389;
  16038. var \u03b53 = 24 / 116;
  16039. var \u03ba = 24389 / 27;
  16040. var white = WHITES.D65;
  16041. var lab_d65 = new ColorSpace({
  16042. id: 'lab-d65',
  16043. name: 'Lab D65',
  16044. coords: {
  16045. l: {
  16046. refRange: [ 0, 100 ],
  16047. name: 'L'
  16048. },
  16049. a: {
  16050. refRange: [ -125, 125 ]
  16051. },
  16052. b: {
  16053. refRange: [ -125, 125 ]
  16054. }
  16055. },
  16056. white: white,
  16057. base: XYZ_D65,
  16058. fromBase: function fromBase(XYZ) {
  16059. var xyz = XYZ.map(function(value, i) {
  16060. return value / white[i];
  16061. });
  16062. var f = xyz.map(function(value) {
  16063. return value > \u03b5$1 ? Math.cbrt(value) : (\u03ba * value + 16) / 116;
  16064. });
  16065. return [ 116 * f[1] - 16, 500 * (f[0] - f[1]), 200 * (f[1] - f[2]) ];
  16066. },
  16067. toBase: function toBase(Lab) {
  16068. var f = [];
  16069. f[1] = (Lab[0] + 16) / 116;
  16070. f[0] = Lab[1] / 500 + f[1];
  16071. f[2] = f[1] - Lab[2] / 200;
  16072. var xyz = [ f[0] > \u03b53 ? Math.pow(f[0], 3) : (116 * f[0] - 16) / \u03ba, Lab[0] > 8 ? Math.pow((Lab[0] + 16) / 116, 3) : Lab[0] / \u03ba, f[2] > \u03b53 ? Math.pow(f[2], 3) : (116 * f[2] - 16) / \u03ba ];
  16073. return xyz.map(function(value, i) {
  16074. return value * white[i];
  16075. });
  16076. },
  16077. formats: {
  16078. 'lab-d65': {
  16079. coords: [ '<number> | <percentage>', '<number>', '<number>' ]
  16080. }
  16081. }
  16082. });
  16083. var phi = Math.pow(5, .5) * .5 + .5;
  16084. function contrastDeltaPhi(color1, color2) {
  16085. color1 = getColor(color1);
  16086. color2 = getColor(color2);
  16087. var Lstr1 = get(color1, [ lab_d65, 'l' ]);
  16088. var Lstr2 = get(color2, [ lab_d65, 'l' ]);
  16089. var deltaPhiStar = Math.abs(Math.pow(Lstr1, phi) - Math.pow(Lstr2, phi));
  16090. var contrast2 = Math.pow(deltaPhiStar, 1 / phi) * Math.SQRT2 - 40;
  16091. return contrast2 < 7.5 ? 0 : contrast2;
  16092. }
  16093. var contrastMethods = Object.freeze({
  16094. __proto__: null,
  16095. contrastWCAG21: contrastWCAG21,
  16096. contrastAPCA: contrastAPCA,
  16097. contrastMichelson: contrastMichelson,
  16098. contrastWeber: contrastWeber,
  16099. contrastLstar: contrastLstar,
  16100. contrastDeltaPhi: contrastDeltaPhi
  16101. });
  16102. function contrast(background, foreground) {
  16103. var o = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  16104. if (isString(o)) {
  16105. o = {
  16106. algorithm: o
  16107. };
  16108. }
  16109. var _o = o, algorithm = _o.algorithm, rest = _objectWithoutProperties(_o, _excluded11);
  16110. if (!algorithm) {
  16111. var algorithms = Object.keys(contrastMethods).map(function(a2) {
  16112. return a2.replace(/^contrast/, '');
  16113. }).join(', ');
  16114. throw new TypeError('contrast() function needs a contrast algorithm. Please specify one of: '.concat(algorithms));
  16115. }
  16116. background = getColor(background);
  16117. foreground = getColor(foreground);
  16118. for (var a2 in contrastMethods) {
  16119. if ('contrast' + algorithm.toLowerCase() === a2.toLowerCase()) {
  16120. return contrastMethods[a2](background, foreground, rest);
  16121. }
  16122. }
  16123. throw new TypeError('Unknown contrast algorithm: '.concat(algorithm));
  16124. }
  16125. function uv(color) {
  16126. var _getAll = getAll(color, XYZ_D65), _getAll2 = _slicedToArray(_getAll, 3), X = _getAll2[0], Y = _getAll2[1], Z = _getAll2[2];
  16127. var denom = X + 15 * Y + 3 * Z;
  16128. return [ 4 * X / denom, 9 * Y / denom ];
  16129. }
  16130. function xy(color) {
  16131. var _getAll3 = getAll(color, XYZ_D65), _getAll4 = _slicedToArray(_getAll3, 3), X = _getAll4[0], Y = _getAll4[1], Z = _getAll4[2];
  16132. var sum = X + Y + Z;
  16133. return [ X / sum, Y / sum ];
  16134. }
  16135. function register$1(Color3) {
  16136. Object.defineProperty(Color3.prototype, 'uv', {
  16137. get: function get() {
  16138. return uv(this);
  16139. }
  16140. });
  16141. Object.defineProperty(Color3.prototype, 'xy', {
  16142. get: function get() {
  16143. return xy(this);
  16144. }
  16145. });
  16146. }
  16147. var chromaticity = Object.freeze({
  16148. __proto__: null,
  16149. uv: uv,
  16150. xy: xy,
  16151. register: register$1
  16152. });
  16153. function deltaE76(color, sample) {
  16154. return distance(color, sample, 'lab');
  16155. }
  16156. var \u03c0 = Math.PI;
  16157. var d2r = \u03c0 / 180;
  16158. function deltaECMC(color, sample) {
  16159. var _ref56 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, _ref56$l = _ref56.l, l = _ref56$l === void 0 ? 2 : _ref56$l, _ref56$c = _ref56.c, c4 = _ref56$c === void 0 ? 1 : _ref56$c;
  16160. var _lab$from5 = lab.from(color), _lab$from6 = _slicedToArray(_lab$from5, 3), L1 = _lab$from6[0], a1 = _lab$from6[1], b1 = _lab$from6[2];
  16161. var _lch$from = lch.from(lab, [ L1, a1, b1 ]), _lch$from2 = _slicedToArray(_lch$from, 3), C1 = _lch$from2[1], H1 = _lch$from2[2];
  16162. var _lab$from7 = lab.from(sample), _lab$from8 = _slicedToArray(_lab$from7, 3), L2 = _lab$from8[0], a2 = _lab$from8[1], b2 = _lab$from8[2];
  16163. var C2 = lch.from(lab, [ L2, a2, b2 ])[1];
  16164. if (C1 < 0) {
  16165. C1 = 0;
  16166. }
  16167. if (C2 < 0) {
  16168. C2 = 0;
  16169. }
  16170. var \u0394L = L1 - L2;
  16171. var \u0394C = C1 - C2;
  16172. var \u0394a = a1 - a2;
  16173. var \u0394b = b1 - b2;
  16174. var H2 = Math.pow(\u0394a, 2) + Math.pow(\u0394b, 2) - Math.pow(\u0394C, 2);
  16175. var SL = .511;
  16176. if (L1 >= 16) {
  16177. SL = .040975 * L1 / (1 + .01765 * L1);
  16178. }
  16179. var SC = .0638 * C1 / (1 + .0131 * C1) + .638;
  16180. var T;
  16181. if (Number.isNaN(H1)) {
  16182. H1 = 0;
  16183. }
  16184. if (H1 >= 164 && H1 <= 345) {
  16185. T = .56 + Math.abs(.2 * Math.cos((H1 + 168) * d2r));
  16186. } else {
  16187. T = .36 + Math.abs(.4 * Math.cos((H1 + 35) * d2r));
  16188. }
  16189. var C4 = Math.pow(C1, 4);
  16190. var F = Math.sqrt(C4 / (C4 + 1900));
  16191. var SH = SC * (F * T + 1 - F);
  16192. var dE = Math.pow(\u0394L / (l * SL), 2);
  16193. dE += Math.pow(\u0394C / (c4 * SC), 2);
  16194. dE += H2 / Math.pow(SH, 2);
  16195. return Math.sqrt(dE);
  16196. }
  16197. var Yw$1 = 203;
  16198. var XYZ_Abs_D65 = new ColorSpace({
  16199. id: 'xyz-abs-d65',
  16200. name: 'Absolute XYZ D65',
  16201. coords: {
  16202. x: {
  16203. refRange: [ 0, 9504.7 ],
  16204. name: 'Xa'
  16205. },
  16206. y: {
  16207. refRange: [ 0, 1e4 ],
  16208. name: 'Ya'
  16209. },
  16210. z: {
  16211. refRange: [ 0, 10888.3 ],
  16212. name: 'Za'
  16213. }
  16214. },
  16215. base: XYZ_D65,
  16216. fromBase: function fromBase(XYZ) {
  16217. return XYZ.map(function(v) {
  16218. return Math.max(v * Yw$1, 0);
  16219. });
  16220. },
  16221. toBase: function toBase(AbsXYZ) {
  16222. return AbsXYZ.map(function(v) {
  16223. return Math.max(v / Yw$1, 0);
  16224. });
  16225. }
  16226. });
  16227. var b$1 = 1.15;
  16228. var g = .66;
  16229. var n$1 = 2610 / Math.pow(2, 14);
  16230. var ninv$1 = Math.pow(2, 14) / 2610;
  16231. var c1$2 = 3424 / Math.pow(2, 12);
  16232. var c2$2 = 2413 / Math.pow(2, 7);
  16233. var c3$2 = 2392 / Math.pow(2, 7);
  16234. var p = 1.7 * 2523 / Math.pow(2, 5);
  16235. var pinv = Math.pow(2, 5) / (1.7 * 2523);
  16236. var d = -.56;
  16237. var d0 = 16295499532821565e-27;
  16238. var XYZtoCone_M = [ [ .41478972, .579999, .014648 ], [ -.20151, 1.120649, .0531008 ], [ -.0166008, .2648, .6684799 ] ];
  16239. var ConetoXYZ_M = [ [ 1.9242264357876067, -1.0047923125953657, .037651404030618 ], [ .35031676209499907, .7264811939316552, -.06538442294808501 ], [ -.09098281098284752, -.3127282905230739, 1.5227665613052603 ] ];
  16240. var ConetoIab_M = [ [ .5, .5, 0 ], [ 3.524, -4.066708, .542708 ], [ .199076, 1.096799, -1.295875 ] ];
  16241. var IabtoCone_M = [ [ 1, .1386050432715393, .05804731615611886 ], [ .9999999999999999, -.1386050432715393, -.05804731615611886 ], [ .9999999999999998, -.09601924202631895, -.8118918960560388 ] ];
  16242. var Jzazbz = new ColorSpace({
  16243. id: 'jzazbz',
  16244. name: 'Jzazbz',
  16245. coords: {
  16246. jz: {
  16247. refRange: [ 0, 1 ],
  16248. name: 'Jz'
  16249. },
  16250. az: {
  16251. refRange: [ -.5, .5 ]
  16252. },
  16253. bz: {
  16254. refRange: [ -.5, .5 ]
  16255. }
  16256. },
  16257. base: XYZ_Abs_D65,
  16258. fromBase: function fromBase(XYZ) {
  16259. var _XYZ = _slicedToArray(XYZ, 3), Xa = _XYZ[0], Ya = _XYZ[1], Za = _XYZ[2];
  16260. var Xm = b$1 * Xa - (b$1 - 1) * Za;
  16261. var Ym = g * Ya - (g - 1) * Xa;
  16262. var LMS = multiplyMatrices(XYZtoCone_M, [ Xm, Ym, Za ]);
  16263. var PQLMS = LMS.map(function(val) {
  16264. var num = c1$2 + c2$2 * Math.pow(val / 1e4, n$1);
  16265. var denom = 1 + c3$2 * Math.pow(val / 1e4, n$1);
  16266. return Math.pow(num / denom, p);
  16267. });
  16268. var _multiplyMatrices = multiplyMatrices(ConetoIab_M, PQLMS), _multiplyMatrices2 = _slicedToArray(_multiplyMatrices, 3), Iz = _multiplyMatrices2[0], az = _multiplyMatrices2[1], bz = _multiplyMatrices2[2];
  16269. var Jz = (1 + d) * Iz / (1 + d * Iz) - d0;
  16270. return [ Jz, az, bz ];
  16271. },
  16272. toBase: function toBase(Jzazbz2) {
  16273. var _Jzazbz = _slicedToArray(Jzazbz2, 3), Jz = _Jzazbz[0], az = _Jzazbz[1], bz = _Jzazbz[2];
  16274. var Iz = (Jz + d0) / (1 + d - d * (Jz + d0));
  16275. var PQLMS = multiplyMatrices(IabtoCone_M, [ Iz, az, bz ]);
  16276. var LMS = PQLMS.map(function(val) {
  16277. var num = c1$2 - Math.pow(val, pinv);
  16278. var denom = c3$2 * Math.pow(val, pinv) - c2$2;
  16279. var x = 1e4 * Math.pow(num / denom, ninv$1);
  16280. return x;
  16281. });
  16282. var _multiplyMatrices3 = multiplyMatrices(ConetoXYZ_M, LMS), _multiplyMatrices4 = _slicedToArray(_multiplyMatrices3, 3), Xm = _multiplyMatrices4[0], Ym = _multiplyMatrices4[1], Za = _multiplyMatrices4[2];
  16283. var Xa = (Xm + (b$1 - 1) * Za) / b$1;
  16284. var Ya = (Ym + (g - 1) * Xa) / g;
  16285. return [ Xa, Ya, Za ];
  16286. },
  16287. formats: {
  16288. color: {}
  16289. }
  16290. });
  16291. var jzczhz = new ColorSpace({
  16292. id: 'jzczhz',
  16293. name: 'JzCzHz',
  16294. coords: {
  16295. jz: {
  16296. refRange: [ 0, 1 ],
  16297. name: 'Jz'
  16298. },
  16299. cz: {
  16300. refRange: [ 0, 1 ],
  16301. name: 'Chroma'
  16302. },
  16303. hz: {
  16304. refRange: [ 0, 360 ],
  16305. type: 'angle',
  16306. name: 'Hue'
  16307. }
  16308. },
  16309. base: Jzazbz,
  16310. fromBase: function fromBase(jzazbz) {
  16311. var _jzazbz = _slicedToArray(jzazbz, 3), Jz = _jzazbz[0], az = _jzazbz[1], bz = _jzazbz[2];
  16312. var hue;
  16313. var \u03b52 = 2e-4;
  16314. if (Math.abs(az) < \u03b52 && Math.abs(bz) < \u03b52) {
  16315. hue = NaN;
  16316. } else {
  16317. hue = Math.atan2(bz, az) * 180 / Math.PI;
  16318. }
  16319. return [ Jz, Math.sqrt(Math.pow(az, 2) + Math.pow(bz, 2)), constrain(hue) ];
  16320. },
  16321. toBase: function toBase(jzczhz2) {
  16322. return [ jzczhz2[0], jzczhz2[1] * Math.cos(jzczhz2[2] * Math.PI / 180), jzczhz2[1] * Math.sin(jzczhz2[2] * Math.PI / 180) ];
  16323. },
  16324. formats: {
  16325. color: {}
  16326. }
  16327. });
  16328. function deltaEJz(color, sample) {
  16329. var _jzczhz$from = jzczhz.from(color), _jzczhz$from2 = _slicedToArray(_jzczhz$from, 3), Jz1 = _jzczhz$from2[0], Cz1 = _jzczhz$from2[1], Hz1 = _jzczhz$from2[2];
  16330. var _jzczhz$from3 = jzczhz.from(sample), _jzczhz$from4 = _slicedToArray(_jzczhz$from3, 3), Jz2 = _jzczhz$from4[0], Cz2 = _jzczhz$from4[1], Hz2 = _jzczhz$from4[2];
  16331. var \u0394J = Jz1 - Jz2;
  16332. var \u0394C = Cz1 - Cz2;
  16333. if (Number.isNaN(Hz1) && Number.isNaN(Hz2)) {
  16334. Hz1 = 0;
  16335. Hz2 = 0;
  16336. } else if (Number.isNaN(Hz1)) {
  16337. Hz1 = Hz2;
  16338. } else if (Number.isNaN(Hz2)) {
  16339. Hz2 = Hz1;
  16340. }
  16341. var \u0394h = Hz1 - Hz2;
  16342. var \u0394H = 2 * Math.sqrt(Cz1 * Cz2) * Math.sin(\u0394h / 2 * (Math.PI / 180));
  16343. return Math.sqrt(Math.pow(\u0394J, 2) + Math.pow(\u0394C, 2) + Math.pow(\u0394H, 2));
  16344. }
  16345. var c1$1 = 3424 / 4096;
  16346. var c2$1 = 2413 / 128;
  16347. var c3$1 = 2392 / 128;
  16348. var m1 = 2610 / 16384;
  16349. var m2 = 2523 / 32;
  16350. var im1 = 16384 / 2610;
  16351. var im2 = 32 / 2523;
  16352. var XYZtoLMS_M$1 = [ [ .3592, .6976, -.0358 ], [ -.1922, 1.1004, .0755 ], [ .007, .0749, .8434 ] ];
  16353. var LMStoIPT_M = [ [ 2048 / 4096, 2048 / 4096, 0 ], [ 6610 / 4096, -13613 / 4096, 7003 / 4096 ], [ 17933 / 4096, -17390 / 4096, -543 / 4096 ] ];
  16354. var IPTtoLMS_M = [ [ .9999888965628402, .008605050147287059, .11103437159861648 ], [ 1.00001110343716, -.008605050147287059, -.11103437159861648 ], [ 1.0000320633910054, .56004913547279, -.3206339100541203 ] ];
  16355. var LMStoXYZ_M$1 = [ [ 2.0701800566956137, -1.326456876103021, .20661600684785517 ], [ .3649882500326575, .6804673628522352, -.04542175307585323 ], [ -.04959554223893211, -.04942116118675749, 1.1879959417328034 ] ];
  16356. var ictcp = new ColorSpace({
  16357. id: 'ictcp',
  16358. name: 'ICTCP',
  16359. coords: {
  16360. i: {
  16361. refRange: [ 0, 1 ],
  16362. name: 'I'
  16363. },
  16364. ct: {
  16365. refRange: [ -.5, .5 ],
  16366. name: 'CT'
  16367. },
  16368. cp: {
  16369. refRange: [ -.5, .5 ],
  16370. name: 'CP'
  16371. }
  16372. },
  16373. base: XYZ_Abs_D65,
  16374. fromBase: function fromBase(XYZ) {
  16375. var LMS = multiplyMatrices(XYZtoLMS_M$1, XYZ);
  16376. return LMStoICtCp(LMS);
  16377. },
  16378. toBase: function toBase(ICtCp) {
  16379. var LMS = ICtCptoLMS(ICtCp);
  16380. return multiplyMatrices(LMStoXYZ_M$1, LMS);
  16381. },
  16382. formats: {
  16383. color: {}
  16384. }
  16385. });
  16386. function LMStoICtCp(LMS) {
  16387. var PQLMS = LMS.map(function(val) {
  16388. var num = c1$1 + c2$1 * Math.pow(val / 1e4, m1);
  16389. var denom = 1 + c3$1 * Math.pow(val / 1e4, m1);
  16390. return Math.pow(num / denom, m2);
  16391. });
  16392. return multiplyMatrices(LMStoIPT_M, PQLMS);
  16393. }
  16394. function ICtCptoLMS(ICtCp) {
  16395. var PQLMS = multiplyMatrices(IPTtoLMS_M, ICtCp);
  16396. var LMS = PQLMS.map(function(val) {
  16397. var num = Math.max(Math.pow(val, im2) - c1$1, 0);
  16398. var denom = c2$1 - c3$1 * Math.pow(val, im2);
  16399. return 1e4 * Math.pow(num / denom, im1);
  16400. });
  16401. return LMS;
  16402. }
  16403. function deltaEITP(color, sample) {
  16404. var _ictcp$from = ictcp.from(color), _ictcp$from2 = _slicedToArray(_ictcp$from, 3), I1 = _ictcp$from2[0], T1 = _ictcp$from2[1], P1 = _ictcp$from2[2];
  16405. var _ictcp$from3 = ictcp.from(sample), _ictcp$from4 = _slicedToArray(_ictcp$from3, 3), I2 = _ictcp$from4[0], T2 = _ictcp$from4[1], P2 = _ictcp$from4[2];
  16406. return 720 * Math.sqrt(Math.pow(I1 - I2, 2) + .25 * Math.pow(T1 - T2, 2) + Math.pow(P1 - P2, 2));
  16407. }
  16408. var XYZtoLMS_M = [ [ .8190224432164319, .3619062562801221, -.12887378261216414 ], [ .0329836671980271, .9292868468965546, .03614466816999844 ], [ .048177199566046255, .26423952494422764, .6335478258136937 ] ];
  16409. var LMStoXYZ_M = [ [ 1.2268798733741557, -.5578149965554813, .28139105017721583 ], [ -.04057576262431372, 1.1122868293970594, -.07171106666151701 ], [ -.07637294974672142, -.4214933239627914, 1.5869240244272418 ] ];
  16410. var LMStoLab_M = [ [ .2104542553, .793617785, -.0040720468 ], [ 1.9779984951, -2.428592205, .4505937099 ], [ .0259040371, .7827717662, -.808675766 ] ];
  16411. var LabtoLMS_M = [ [ .9999999984505198, .39633779217376786, .2158037580607588 ], [ 1.0000000088817609, -.10556134232365635, -.06385417477170591 ], [ 1.0000000546724108, -.08948418209496575, -1.2914855378640917 ] ];
  16412. var OKLab = new ColorSpace({
  16413. id: 'oklab',
  16414. name: 'OKLab',
  16415. coords: {
  16416. l: {
  16417. refRange: [ 0, 1 ],
  16418. name: 'L'
  16419. },
  16420. a: {
  16421. refRange: [ -.4, .4 ]
  16422. },
  16423. b: {
  16424. refRange: [ -.4, .4 ]
  16425. }
  16426. },
  16427. white: 'D65',
  16428. base: XYZ_D65,
  16429. fromBase: function fromBase(XYZ) {
  16430. var LMS = multiplyMatrices(XYZtoLMS_M, XYZ);
  16431. var LMSg = LMS.map(function(val) {
  16432. return Math.cbrt(val);
  16433. });
  16434. return multiplyMatrices(LMStoLab_M, LMSg);
  16435. },
  16436. toBase: function toBase(OKLab2) {
  16437. var LMSg = multiplyMatrices(LabtoLMS_M, OKLab2);
  16438. var LMS = LMSg.map(function(val) {
  16439. return Math.pow(val, 3);
  16440. });
  16441. return multiplyMatrices(LMStoXYZ_M, LMS);
  16442. },
  16443. formats: {
  16444. oklab: {
  16445. coords: [ '<number> | <percentage>', '<number>', '<number>' ]
  16446. }
  16447. }
  16448. });
  16449. function deltaEOK(color, sample) {
  16450. var _OKLab$from = OKLab.from(color), _OKLab$from2 = _slicedToArray(_OKLab$from, 3), L1 = _OKLab$from2[0], a1 = _OKLab$from2[1], b1 = _OKLab$from2[2];
  16451. var _OKLab$from3 = OKLab.from(sample), _OKLab$from4 = _slicedToArray(_OKLab$from3, 3), L2 = _OKLab$from4[0], a2 = _OKLab$from4[1], b2 = _OKLab$from4[2];
  16452. var \u0394L = L1 - L2;
  16453. var \u0394a = a1 - a2;
  16454. var \u0394b = b1 - b2;
  16455. return Math.sqrt(Math.pow(\u0394L, 2) + Math.pow(\u0394a, 2) + Math.pow(\u0394b, 2));
  16456. }
  16457. var deltaEMethods = Object.freeze({
  16458. __proto__: null,
  16459. deltaE76: deltaE76,
  16460. deltaECMC: deltaECMC,
  16461. deltaE2000: deltaE2000,
  16462. deltaEJz: deltaEJz,
  16463. deltaEITP: deltaEITP,
  16464. deltaEOK: deltaEOK
  16465. });
  16466. function deltaE(c12, c22) {
  16467. var o = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  16468. if (isString(o)) {
  16469. o = {
  16470. method: o
  16471. };
  16472. }
  16473. var _o2 = o, _o2$method = _o2.method, method = _o2$method === void 0 ? defaults.deltaE : _o2$method, rest = _objectWithoutProperties(_o2, _excluded12);
  16474. c12 = getColor(c12);
  16475. c22 = getColor(c22);
  16476. for (var m3 in deltaEMethods) {
  16477. if ('deltae' + method.toLowerCase() === m3.toLowerCase()) {
  16478. return deltaEMethods[m3](c12, c22, rest);
  16479. }
  16480. }
  16481. throw new TypeError('Unknown deltaE method: '.concat(method));
  16482. }
  16483. function lighten(color) {
  16484. var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .25;
  16485. var space = ColorSpace.get('oklch', 'lch');
  16486. var lightness = [ space, 'l' ];
  16487. return set(color, lightness, function(l) {
  16488. return l * (1 + amount);
  16489. });
  16490. }
  16491. function darken(color) {
  16492. var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .25;
  16493. var space = ColorSpace.get('oklch', 'lch');
  16494. var lightness = [ space, 'l' ];
  16495. return set(color, lightness, function(l) {
  16496. return l * (1 - amount);
  16497. });
  16498. }
  16499. var variations = Object.freeze({
  16500. __proto__: null,
  16501. lighten: lighten,
  16502. darken: darken
  16503. });
  16504. function mix(c12, c22) {
  16505. var p2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : .5;
  16506. var o = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  16507. var _ref57 = [ getColor(c12), getColor(c22) ];
  16508. c12 = _ref57[0];
  16509. c22 = _ref57[1];
  16510. if (type(p2) === 'object') {
  16511. var _ref58 = [ .5, p2 ];
  16512. p2 = _ref58[0];
  16513. o = _ref58[1];
  16514. }
  16515. var _o3 = o, space = _o3.space, outputSpace = _o3.outputSpace, premultiplied = _o3.premultiplied;
  16516. var r = range(c12, c22, {
  16517. space: space,
  16518. outputSpace: outputSpace,
  16519. premultiplied: premultiplied
  16520. });
  16521. return r(p2);
  16522. }
  16523. function steps(c12, c22) {
  16524. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  16525. var colorRange;
  16526. if (isRange(c12)) {
  16527. colorRange = c12;
  16528. options = c22;
  16529. var _colorRange$rangeArgs = _slicedToArray(colorRange.rangeArgs.colors, 2);
  16530. c12 = _colorRange$rangeArgs[0];
  16531. c22 = _colorRange$rangeArgs[1];
  16532. }
  16533. var _options2 = options, maxDeltaE = _options2.maxDeltaE, deltaEMethod = _options2.deltaEMethod, _options2$steps = _options2.steps, steps2 = _options2$steps === void 0 ? 2 : _options2$steps, _options2$maxSteps = _options2.maxSteps, maxSteps = _options2$maxSteps === void 0 ? 1e3 : _options2$maxSteps, rangeOptions = _objectWithoutProperties(_options2, _excluded13);
  16534. if (!colorRange) {
  16535. var _ref59 = [ getColor(c12), getColor(c22) ];
  16536. c12 = _ref59[0];
  16537. c22 = _ref59[1];
  16538. colorRange = range(c12, c22, rangeOptions);
  16539. }
  16540. var totalDelta = deltaE(c12, c22);
  16541. var actualSteps = maxDeltaE > 0 ? Math.max(steps2, Math.ceil(totalDelta / maxDeltaE) + 1) : steps2;
  16542. var ret = [];
  16543. if (maxSteps !== void 0) {
  16544. actualSteps = Math.min(actualSteps, maxSteps);
  16545. }
  16546. if (actualSteps === 1) {
  16547. ret = [ {
  16548. p: .5,
  16549. color: colorRange(.5)
  16550. } ];
  16551. } else {
  16552. var step = 1 / (actualSteps - 1);
  16553. ret = Array.from({
  16554. length: actualSteps
  16555. }, function(_, i) {
  16556. var p2 = i * step;
  16557. return {
  16558. p: p2,
  16559. color: colorRange(p2)
  16560. };
  16561. });
  16562. }
  16563. if (maxDeltaE > 0) {
  16564. var maxDelta = ret.reduce(function(acc, cur, i) {
  16565. if (i === 0) {
  16566. return 0;
  16567. }
  16568. var \u0394\u0395 = deltaE(cur.color, ret[i - 1].color, deltaEMethod);
  16569. return Math.max(acc, \u0394\u0395);
  16570. }, 0);
  16571. while (maxDelta > maxDeltaE) {
  16572. maxDelta = 0;
  16573. for (var _i20 = 1; _i20 < ret.length && ret.length < maxSteps; _i20++) {
  16574. var prev = ret[_i20 - 1];
  16575. var cur = ret[_i20];
  16576. var p2 = (cur.p + prev.p) / 2;
  16577. var _color = colorRange(p2);
  16578. maxDelta = Math.max(maxDelta, deltaE(_color, prev.color), deltaE(_color, cur.color));
  16579. ret.splice(_i20, 0, {
  16580. p: p2,
  16581. color: colorRange(p2)
  16582. });
  16583. _i20++;
  16584. }
  16585. }
  16586. }
  16587. ret = ret.map(function(a2) {
  16588. return a2.color;
  16589. });
  16590. return ret;
  16591. }
  16592. function range(color1, color2) {
  16593. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  16594. if (isRange(color1)) {
  16595. var r = color1, options2 = color2;
  16596. return range.apply(void 0, _toConsumableArray(r.rangeArgs.colors).concat([ _extends({}, r.rangeArgs.options, options2) ]));
  16597. }
  16598. var space = options.space, outputSpace = options.outputSpace, progression = options.progression, premultiplied = options.premultiplied;
  16599. color1 = getColor(color1);
  16600. color2 = getColor(color2);
  16601. color1 = clone2(color1);
  16602. color2 = clone2(color2);
  16603. var rangeArgs = {
  16604. colors: [ color1, color2 ],
  16605. options: options
  16606. };
  16607. if (space) {
  16608. space = ColorSpace.get(space);
  16609. } else {
  16610. space = ColorSpace.registry[defaults.interpolationSpace] || color1.space;
  16611. }
  16612. outputSpace = outputSpace ? ColorSpace.get(outputSpace) : space;
  16613. color1 = to(color1, space);
  16614. color2 = to(color2, space);
  16615. color1 = toGamut(color1);
  16616. color2 = toGamut(color2);
  16617. if (space.coords.h && space.coords.h.type === 'angle') {
  16618. var arc = options.hue = options.hue || 'shorter';
  16619. var hue = [ space, 'h' ];
  16620. var _ref60 = [ get(color1, hue), get(color2, hue) ], \u03b81 = _ref60[0], \u03b82 = _ref60[1];
  16621. var _adjust = adjust(arc, [ \u03b81, \u03b82 ]);
  16622. var _adjust2 = _slicedToArray(_adjust, 2);
  16623. \u03b81 = _adjust2[0];
  16624. \u03b82 = _adjust2[1];
  16625. set(color1, hue, \u03b81);
  16626. set(color2, hue, \u03b82);
  16627. }
  16628. if (premultiplied) {
  16629. color1.coords = color1.coords.map(function(c4) {
  16630. return c4 * color1.alpha;
  16631. });
  16632. color2.coords = color2.coords.map(function(c4) {
  16633. return c4 * color2.alpha;
  16634. });
  16635. }
  16636. return Object.assign(function(p2) {
  16637. p2 = progression ? progression(p2) : p2;
  16638. var coords = color1.coords.map(function(start, i) {
  16639. var end = color2.coords[i];
  16640. return interpolate(start, end, p2);
  16641. });
  16642. var alpha = interpolate(color1.alpha, color2.alpha, p2);
  16643. var ret = {
  16644. space: space,
  16645. coords: coords,
  16646. alpha: alpha
  16647. };
  16648. if (premultiplied) {
  16649. ret.coords = ret.coords.map(function(c4) {
  16650. return c4 / alpha;
  16651. });
  16652. }
  16653. if (outputSpace !== space) {
  16654. ret = to(ret, outputSpace);
  16655. }
  16656. return ret;
  16657. }, {
  16658. rangeArgs: rangeArgs
  16659. });
  16660. }
  16661. function isRange(val) {
  16662. return type(val) === 'function' && !!val.rangeArgs;
  16663. }
  16664. defaults.interpolationSpace = 'lab';
  16665. function register(Color3) {
  16666. Color3.defineFunction('mix', mix, {
  16667. returns: 'color'
  16668. });
  16669. Color3.defineFunction('range', range, {
  16670. returns: 'function<color>'
  16671. });
  16672. Color3.defineFunction('steps', steps, {
  16673. returns: 'array<color>'
  16674. });
  16675. }
  16676. var interpolation = Object.freeze({
  16677. __proto__: null,
  16678. mix: mix,
  16679. steps: steps,
  16680. range: range,
  16681. isRange: isRange,
  16682. register: register
  16683. });
  16684. var HSL = new ColorSpace({
  16685. id: 'hsl',
  16686. name: 'HSL',
  16687. coords: {
  16688. h: {
  16689. refRange: [ 0, 360 ],
  16690. type: 'angle',
  16691. name: 'Hue'
  16692. },
  16693. s: {
  16694. range: [ 0, 100 ],
  16695. name: 'Saturation'
  16696. },
  16697. l: {
  16698. range: [ 0, 100 ],
  16699. name: 'Lightness'
  16700. }
  16701. },
  16702. base: sRGB,
  16703. fromBase: function fromBase(rgb) {
  16704. var max2 = Math.max.apply(Math, _toConsumableArray(rgb));
  16705. var min = Math.min.apply(Math, _toConsumableArray(rgb));
  16706. var _rgb = _slicedToArray(rgb, 3), r = _rgb[0], g2 = _rgb[1], b2 = _rgb[2];
  16707. var h = NaN, s = 0, l = (min + max2) / 2;
  16708. var d2 = max2 - min;
  16709. if (d2 !== 0) {
  16710. s = l === 0 || l === 1 ? 0 : (max2 - l) / Math.min(l, 1 - l);
  16711. switch (max2) {
  16712. case r:
  16713. h = (g2 - b2) / d2 + (g2 < b2 ? 6 : 0);
  16714. break;
  16715. case g2:
  16716. h = (b2 - r) / d2 + 2;
  16717. break;
  16718. case b2:
  16719. h = (r - g2) / d2 + 4;
  16720. }
  16721. h = h * 60;
  16722. }
  16723. return [ h, s * 100, l * 100 ];
  16724. },
  16725. toBase: function toBase(hsl) {
  16726. var _hsl = _slicedToArray(hsl, 3), h = _hsl[0], s = _hsl[1], l = _hsl[2];
  16727. h = h % 360;
  16728. if (h < 0) {
  16729. h += 360;
  16730. }
  16731. s /= 100;
  16732. l /= 100;
  16733. function f(n2) {
  16734. var k = (n2 + h / 30) % 12;
  16735. var a2 = s * Math.min(l, 1 - l);
  16736. return l - a2 * Math.max(-1, Math.min(k - 3, 9 - k, 1));
  16737. }
  16738. return [ f(0), f(8), f(4) ];
  16739. },
  16740. formats: {
  16741. hsl: {
  16742. toGamut: true,
  16743. coords: [ '<number> | <angle>', '<percentage>', '<percentage>' ]
  16744. },
  16745. hsla: {
  16746. coords: [ '<number> | <angle>', '<percentage>', '<percentage>' ],
  16747. commas: true,
  16748. lastAlpha: true
  16749. }
  16750. }
  16751. });
  16752. var HSV = new ColorSpace({
  16753. id: 'hsv',
  16754. name: 'HSV',
  16755. coords: {
  16756. h: {
  16757. refRange: [ 0, 360 ],
  16758. type: 'angle',
  16759. name: 'Hue'
  16760. },
  16761. s: {
  16762. range: [ 0, 100 ],
  16763. name: 'Saturation'
  16764. },
  16765. v: {
  16766. range: [ 0, 100 ],
  16767. name: 'Value'
  16768. }
  16769. },
  16770. base: HSL,
  16771. fromBase: function fromBase(hsl) {
  16772. var _hsl2 = _slicedToArray(hsl, 3), h = _hsl2[0], s = _hsl2[1], l = _hsl2[2];
  16773. s /= 100;
  16774. l /= 100;
  16775. var v = l + s * Math.min(l, 1 - l);
  16776. return [ h, v === 0 ? 0 : 200 * (1 - l / v), 100 * v ];
  16777. },
  16778. toBase: function toBase(hsv) {
  16779. var _hsv = _slicedToArray(hsv, 3), h = _hsv[0], s = _hsv[1], v = _hsv[2];
  16780. s /= 100;
  16781. v /= 100;
  16782. var l = v * (1 - s / 2);
  16783. return [ h, l === 0 || l === 1 ? 0 : (v - l) / Math.min(l, 1 - l) * 100, l * 100 ];
  16784. },
  16785. formats: {
  16786. color: {
  16787. toGamut: true
  16788. }
  16789. }
  16790. });
  16791. var hwb = new ColorSpace({
  16792. id: 'hwb',
  16793. name: 'HWB',
  16794. coords: {
  16795. h: {
  16796. refRange: [ 0, 360 ],
  16797. type: 'angle',
  16798. name: 'Hue'
  16799. },
  16800. w: {
  16801. range: [ 0, 100 ],
  16802. name: 'Whiteness'
  16803. },
  16804. b: {
  16805. range: [ 0, 100 ],
  16806. name: 'Blackness'
  16807. }
  16808. },
  16809. base: HSV,
  16810. fromBase: function fromBase(hsv) {
  16811. var _hsv2 = _slicedToArray(hsv, 3), h = _hsv2[0], s = _hsv2[1], v = _hsv2[2];
  16812. return [ h, v * (100 - s) / 100, 100 - v ];
  16813. },
  16814. toBase: function toBase(hwb2) {
  16815. var _hwb = _slicedToArray(hwb2, 3), h = _hwb[0], w = _hwb[1], b2 = _hwb[2];
  16816. w /= 100;
  16817. b2 /= 100;
  16818. var sum = w + b2;
  16819. if (sum >= 1) {
  16820. var gray = w / sum;
  16821. return [ h, 0, gray * 100 ];
  16822. }
  16823. var v = 1 - b2;
  16824. var s = v === 0 ? 0 : 1 - w / v;
  16825. return [ h, s * 100, v * 100 ];
  16826. },
  16827. formats: {
  16828. hwb: {
  16829. toGamut: true,
  16830. coords: [ '<number> | <angle>', '<percentage>', '<percentage>' ]
  16831. }
  16832. }
  16833. });
  16834. var toXYZ_M$2 = [ [ .5766690429101305, .1855582379065463, .1882286462349947 ], [ .29734497525053605, .6273635662554661, .07529145849399788 ], [ .02703136138641234, .07068885253582723, .9913375368376388 ] ];
  16835. var fromXYZ_M$2 = [ [ 2.0415879038107465, -.5650069742788596, -.34473135077832956 ], [ -.9692436362808795, 1.8759675015077202, .04155505740717557 ], [ .013444280632031142, -.11836239223101838, 1.0151749943912054 ] ];
  16836. var A98Linear = new RGBColorSpace({
  16837. id: 'a98rgb-linear',
  16838. name: 'Linear Adobe\xae 98 RGB compatible',
  16839. white: 'D65',
  16840. toXYZ_M: toXYZ_M$2,
  16841. fromXYZ_M: fromXYZ_M$2
  16842. });
  16843. var a98rgb = new RGBColorSpace({
  16844. id: 'a98rgb',
  16845. name: 'Adobe\xae 98 RGB compatible',
  16846. base: A98Linear,
  16847. toBase: function toBase(RGB) {
  16848. return RGB.map(function(val) {
  16849. return Math.pow(Math.abs(val), 563 / 256) * Math.sign(val);
  16850. });
  16851. },
  16852. fromBase: function fromBase(RGB) {
  16853. return RGB.map(function(val) {
  16854. return Math.pow(Math.abs(val), 256 / 563) * Math.sign(val);
  16855. });
  16856. },
  16857. formats: {
  16858. color: {
  16859. id: 'a98-rgb'
  16860. }
  16861. }
  16862. });
  16863. var toXYZ_M$1 = [ [ .7977604896723027, .13518583717574031, .0313493495815248 ], [ .2880711282292934, .7118432178101014, 8565396060525902e-20 ], [ 0, 0, .8251046025104601 ] ];
  16864. var fromXYZ_M$1 = [ [ 1.3457989731028281, -.25558010007997534, -.05110628506753401 ], [ -.5446224939028347, 1.5082327413132781, .02053603239147973 ], [ 0, 0, 1.2119675456389454 ] ];
  16865. var ProPhotoLinear = new RGBColorSpace({
  16866. id: 'prophoto-linear',
  16867. name: 'Linear ProPhoto',
  16868. white: 'D50',
  16869. base: XYZ_D50,
  16870. toXYZ_M: toXYZ_M$1,
  16871. fromXYZ_M: fromXYZ_M$1
  16872. });
  16873. var Et = 1 / 512;
  16874. var Et2 = 16 / 512;
  16875. var prophoto = new RGBColorSpace({
  16876. id: 'prophoto',
  16877. name: 'ProPhoto',
  16878. base: ProPhotoLinear,
  16879. toBase: function toBase(RGB) {
  16880. return RGB.map(function(v) {
  16881. return v < Et2 ? v / 16 : Math.pow(v, 1.8);
  16882. });
  16883. },
  16884. fromBase: function fromBase(RGB) {
  16885. return RGB.map(function(v) {
  16886. return v >= Et ? Math.pow(v, 1 / 1.8) : 16 * v;
  16887. });
  16888. },
  16889. formats: {
  16890. color: {
  16891. id: 'prophoto-rgb'
  16892. }
  16893. }
  16894. });
  16895. var oklch = new ColorSpace({
  16896. id: 'oklch',
  16897. name: 'OKLCh',
  16898. coords: {
  16899. l: {
  16900. refRange: [ 0, 1 ],
  16901. name: 'Lightness'
  16902. },
  16903. c: {
  16904. refRange: [ 0, .4 ],
  16905. name: 'Chroma'
  16906. },
  16907. h: {
  16908. refRange: [ 0, 360 ],
  16909. type: 'angle',
  16910. name: 'Hue'
  16911. }
  16912. },
  16913. white: 'D65',
  16914. base: OKLab,
  16915. fromBase: function fromBase(oklab) {
  16916. var _oklab = _slicedToArray(oklab, 3), L = _oklab[0], a2 = _oklab[1], b2 = _oklab[2];
  16917. var h;
  16918. var \u03b52 = 2e-4;
  16919. if (Math.abs(a2) < \u03b52 && Math.abs(b2) < \u03b52) {
  16920. h = NaN;
  16921. } else {
  16922. h = Math.atan2(b2, a2) * 180 / Math.PI;
  16923. }
  16924. return [ L, Math.sqrt(Math.pow(a2, 2) + Math.pow(b2, 2)), constrain(h) ];
  16925. },
  16926. toBase: function toBase(oklch2) {
  16927. var _oklch = _slicedToArray(oklch2, 3), L = _oklch[0], C = _oklch[1], h = _oklch[2];
  16928. var a2, b2;
  16929. if (isNaN(h)) {
  16930. a2 = 0;
  16931. b2 = 0;
  16932. } else {
  16933. a2 = C * Math.cos(h * Math.PI / 180);
  16934. b2 = C * Math.sin(h * Math.PI / 180);
  16935. }
  16936. return [ L, a2, b2 ];
  16937. },
  16938. formats: {
  16939. oklch: {
  16940. coords: [ '<number> | <percentage>', '<number>', '<number> | <angle>' ]
  16941. }
  16942. }
  16943. });
  16944. var Yw = 203;
  16945. var n = 2610 / Math.pow(2, 14);
  16946. var ninv = Math.pow(2, 14) / 2610;
  16947. var m = 2523 / Math.pow(2, 5);
  16948. var minv = Math.pow(2, 5) / 2523;
  16949. var c1 = 3424 / Math.pow(2, 12);
  16950. var c2 = 2413 / Math.pow(2, 7);
  16951. var c3 = 2392 / Math.pow(2, 7);
  16952. var rec2100Pq = new RGBColorSpace({
  16953. id: 'rec2100pq',
  16954. name: 'REC.2100-PQ',
  16955. base: REC2020Linear,
  16956. toBase: function toBase(RGB) {
  16957. return RGB.map(function(val) {
  16958. var x = Math.pow(Math.max(Math.pow(val, minv) - c1, 0) / (c2 - c3 * Math.pow(val, minv)), ninv);
  16959. return x * 1e4 / Yw;
  16960. });
  16961. },
  16962. fromBase: function fromBase(RGB) {
  16963. return RGB.map(function(val) {
  16964. var x = Math.max(val * Yw / 1e4, 0);
  16965. var num = c1 + c2 * Math.pow(x, n);
  16966. var denom = 1 + c3 * Math.pow(x, n);
  16967. return Math.pow(num / denom, m);
  16968. });
  16969. },
  16970. formats: {
  16971. color: {
  16972. id: 'rec2100-pq'
  16973. }
  16974. }
  16975. });
  16976. var a = .17883277;
  16977. var b = .28466892;
  16978. var c = .55991073;
  16979. var scale = 3.7743;
  16980. var rec2100Hlg = new RGBColorSpace({
  16981. id: 'rec2100hlg',
  16982. cssid: 'rec2100-hlg',
  16983. name: 'REC.2100-HLG',
  16984. referred: 'scene',
  16985. base: REC2020Linear,
  16986. toBase: function toBase(RGB) {
  16987. return RGB.map(function(val) {
  16988. if (val <= .5) {
  16989. return Math.pow(val, 2) / 3 * scale;
  16990. }
  16991. return Math.exp((val - c) / a + b) / 12 * scale;
  16992. });
  16993. },
  16994. fromBase: function fromBase(RGB) {
  16995. return RGB.map(function(val) {
  16996. val /= scale;
  16997. if (val <= 1 / 12) {
  16998. return Math.sqrt(3 * val);
  16999. }
  17000. return a * Math.log(12 * val - b) + c;
  17001. });
  17002. },
  17003. formats: {
  17004. color: {
  17005. id: 'rec2100-hlg'
  17006. }
  17007. }
  17008. });
  17009. var CATs = {};
  17010. hooks.add('chromatic-adaptation-start', function(env) {
  17011. if (env.options.method) {
  17012. env.M = adapt(env.W1, env.W2, env.options.method);
  17013. }
  17014. });
  17015. hooks.add('chromatic-adaptation-end', function(env) {
  17016. if (!env.M) {
  17017. env.M = adapt(env.W1, env.W2, env.options.method);
  17018. }
  17019. });
  17020. function defineCAT(_ref61) {
  17021. var id = _ref61.id, toCone_M = _ref61.toCone_M, fromCone_M = _ref61.fromCone_M;
  17022. CATs[id] = arguments[0];
  17023. }
  17024. function adapt(W1, W2) {
  17025. var id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Bradford';
  17026. var method = CATs[id];
  17027. var _multiplyMatrices5 = multiplyMatrices(method.toCone_M, W1), _multiplyMatrices6 = _slicedToArray(_multiplyMatrices5, 3), \u03c1s = _multiplyMatrices6[0], \u03b3s = _multiplyMatrices6[1], \u03b2s = _multiplyMatrices6[2];
  17028. var _multiplyMatrices7 = multiplyMatrices(method.toCone_M, W2), _multiplyMatrices8 = _slicedToArray(_multiplyMatrices7, 3), \u03c1d = _multiplyMatrices8[0], \u03b3d = _multiplyMatrices8[1], \u03b2d = _multiplyMatrices8[2];
  17029. var scale2 = [ [ \u03c1d / \u03c1s, 0, 0 ], [ 0, \u03b3d / \u03b3s, 0 ], [ 0, 0, \u03b2d / \u03b2s ] ];
  17030. var scaled_cone_M = multiplyMatrices(scale2, method.toCone_M);
  17031. var adapt_M = multiplyMatrices(method.fromCone_M, scaled_cone_M);
  17032. return adapt_M;
  17033. }
  17034. defineCAT({
  17035. id: 'von Kries',
  17036. toCone_M: [ [ .40024, .7076, -.08081 ], [ -.2263, 1.16532, .0457 ], [ 0, 0, .91822 ] ],
  17037. fromCone_M: [ [ 1.8599364, -1.1293816, .2198974 ], [ .3611914, .6388125, -64e-7 ], [ 0, 0, 1.0890636 ] ]
  17038. });
  17039. defineCAT({
  17040. id: 'Bradford',
  17041. toCone_M: [ [ .8951, .2664, -.1614 ], [ -.7502, 1.7135, .0367 ], [ .0389, -.0685, 1.0296 ] ],
  17042. fromCone_M: [ [ .9869929, -.1470543, .1599627 ], [ .4323053, .5183603, .0492912 ], [ -.0085287, .0400428, .9684867 ] ]
  17043. });
  17044. defineCAT({
  17045. id: 'CAT02',
  17046. toCone_M: [ [ .7328, .4296, -.1624 ], [ -.7036, 1.6975, .0061 ], [ .003, .0136, .9834 ] ],
  17047. fromCone_M: [ [ 1.0961238, -.278869, .1827452 ], [ .454369, .4735332, .0720978 ], [ -.0096276, -.005698, 1.0153256 ] ]
  17048. });
  17049. defineCAT({
  17050. id: 'CAT16',
  17051. toCone_M: [ [ .401288, .650173, -.051461 ], [ -.250268, 1.204414, .045854 ], [ -.002079, .048952, .953127 ] ],
  17052. fromCone_M: [ [ 1.862067855087233, -1.011254630531685, .1491867754444518 ], [ .3875265432361372, .6214474419314753, -.008973985167612518 ], [ -.01584149884933386, -.03412293802851557, 1.04996443687785 ] ]
  17053. });
  17054. Object.assign(WHITES, {
  17055. A: [ 1.0985, 1, .35585 ],
  17056. C: [ .98074, 1, 1.18232 ],
  17057. D55: [ .95682, 1, .92149 ],
  17058. D75: [ .94972, 1, 1.22638 ],
  17059. E: [ 1, 1, 1 ],
  17060. F2: [ .99186, 1, .67393 ],
  17061. F7: [ .95041, 1, 1.08747 ],
  17062. F11: [ 1.00962, 1, .6435 ]
  17063. });
  17064. WHITES.ACES = [ .32168 / .33767, 1, (1 - .32168 - .33767) / .33767 ];
  17065. var toXYZ_M = [ [ .6624541811085053, .13400420645643313, .1561876870049078 ], [ .27222871678091454, .6740817658111484, .05368951740793705 ], [ -.005574649490394108, .004060733528982826, 1.0103391003129971 ] ];
  17066. var fromXYZ_M = [ [ 1.6410233796943257, -.32480329418479, -.23642469523761225 ], [ -.6636628587229829, 1.6153315916573379, .016756347685530137 ], [ .011721894328375376, -.008284441996237409, .9883948585390215 ] ];
  17067. var ACEScg = new RGBColorSpace({
  17068. id: 'acescg',
  17069. name: 'ACEScg',
  17070. coords: {
  17071. r: {
  17072. range: [ 0, 65504 ],
  17073. name: 'Red'
  17074. },
  17075. g: {
  17076. range: [ 0, 65504 ],
  17077. name: 'Green'
  17078. },
  17079. b: {
  17080. range: [ 0, 65504 ],
  17081. name: 'Blue'
  17082. }
  17083. },
  17084. referred: 'scene',
  17085. white: WHITES.ACES,
  17086. toXYZ_M: toXYZ_M,
  17087. fromXYZ_M: fromXYZ_M,
  17088. formats: {
  17089. color: {}
  17090. }
  17091. });
  17092. var \u03b5 = Math.pow(2, -16);
  17093. var ACES_min_nonzero = -.35828683;
  17094. var ACES_cc_max = (Math.log2(65504) + 9.72) / 17.52;
  17095. var acescc = new RGBColorSpace({
  17096. id: 'acescc',
  17097. name: 'ACEScc',
  17098. coords: {
  17099. r: {
  17100. range: [ ACES_min_nonzero, ACES_cc_max ],
  17101. name: 'Red'
  17102. },
  17103. g: {
  17104. range: [ ACES_min_nonzero, ACES_cc_max ],
  17105. name: 'Green'
  17106. },
  17107. b: {
  17108. range: [ ACES_min_nonzero, ACES_cc_max ],
  17109. name: 'Blue'
  17110. }
  17111. },
  17112. referred: 'scene',
  17113. base: ACEScg,
  17114. toBase: function toBase(RGB) {
  17115. var low = (9.72 - 15) / 17.52;
  17116. return RGB.map(function(val) {
  17117. if (val <= low) {
  17118. return (Math.pow(2, val * 17.52 - 9.72) - \u03b5) * 2;
  17119. } else if (val < ACES_cc_max) {
  17120. return Math.pow(2, val * 17.52 - 9.72);
  17121. } else {
  17122. return 65504;
  17123. }
  17124. });
  17125. },
  17126. fromBase: function fromBase(RGB) {
  17127. return RGB.map(function(val) {
  17128. if (val <= 0) {
  17129. return (Math.log2(\u03b5) + 9.72) / 17.52;
  17130. } else if (val < \u03b5) {
  17131. return (Math.log2(\u03b5 + val * .5) + 9.72) / 17.52;
  17132. } else {
  17133. return (Math.log2(val) + 9.72) / 17.52;
  17134. }
  17135. });
  17136. },
  17137. formats: {
  17138. color: {}
  17139. }
  17140. });
  17141. var spaces = Object.freeze({
  17142. __proto__: null,
  17143. XYZ_D65: XYZ_D65,
  17144. XYZ_D50: XYZ_D50,
  17145. XYZ_ABS_D65: XYZ_Abs_D65,
  17146. Lab_D65: lab_d65,
  17147. Lab: lab,
  17148. LCH: lch,
  17149. sRGB_Linear: sRGBLinear,
  17150. sRGB: sRGB,
  17151. HSL: HSL,
  17152. HWB: hwb,
  17153. HSV: HSV,
  17154. P3_Linear: P3Linear,
  17155. P3: P3,
  17156. A98RGB_Linear: A98Linear,
  17157. A98RGB: a98rgb,
  17158. ProPhoto_Linear: ProPhotoLinear,
  17159. ProPhoto: prophoto,
  17160. REC_2020_Linear: REC2020Linear,
  17161. REC_2020: REC2020,
  17162. OKLab: OKLab,
  17163. OKLCH: oklch,
  17164. Jzazbz: Jzazbz,
  17165. JzCzHz: jzczhz,
  17166. ICTCP: ictcp,
  17167. REC_2100_PQ: rec2100Pq,
  17168. REC_2100_HLG: rec2100Hlg,
  17169. ACEScg: ACEScg,
  17170. ACEScc: acescc
  17171. });
  17172. var _Color = (_space = new WeakMap(), function() {
  17173. function Color() {
  17174. var _this2 = this;
  17175. _classCallCheck(this, Color);
  17176. _classPrivateFieldInitSpec(this, _space, void 0);
  17177. var color;
  17178. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  17179. args[_key3] = arguments[_key3];
  17180. }
  17181. if (args.length === 1) {
  17182. color = getColor(args[0]);
  17183. }
  17184. var space, coords, alpha;
  17185. if (color) {
  17186. space = color.space || color.spaceId;
  17187. coords = color.coords;
  17188. alpha = color.alpha;
  17189. } else {
  17190. space = args[0];
  17191. coords = args[1];
  17192. alpha = args[2];
  17193. }
  17194. _classPrivateFieldSet(_space, this, ColorSpace.get(space));
  17195. this.coords = coords ? coords.slice() : [ 0, 0, 0 ];
  17196. this.alpha = alpha < 1 ? alpha : 1;
  17197. for (var _i21 = 0; _i21 < this.coords.length; _i21++) {
  17198. if (this.coords[_i21] === 'NaN') {
  17199. this.coords[_i21] = NaN;
  17200. }
  17201. }
  17202. var _loop7 = function _loop7(id) {
  17203. Object.defineProperty(_this2, id, {
  17204. get: function get() {
  17205. return _this2.get(id);
  17206. },
  17207. set: function set(value) {
  17208. return _this2.set(id, value);
  17209. }
  17210. });
  17211. };
  17212. for (var id in _classPrivateFieldGet(_space, this).coords) {
  17213. _loop7(id);
  17214. }
  17215. }
  17216. return _createClass(Color, [ {
  17217. key: 'space',
  17218. get: function get() {
  17219. return _classPrivateFieldGet(_space, this);
  17220. }
  17221. }, {
  17222. key: 'spaceId',
  17223. get: function get() {
  17224. return _classPrivateFieldGet(_space, this).id;
  17225. }
  17226. }, {
  17227. key: 'clone',
  17228. value: function clone() {
  17229. return new _Color(this.space, this.coords, this.alpha);
  17230. }
  17231. }, {
  17232. key: 'toJSON',
  17233. value: function toJSON() {
  17234. return {
  17235. spaceId: this.spaceId,
  17236. coords: this.coords,
  17237. alpha: this.alpha
  17238. };
  17239. }
  17240. }, {
  17241. key: 'display',
  17242. value: function display() {
  17243. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  17244. args[_key4] = arguments[_key4];
  17245. }
  17246. var ret = _display.apply(void 0, [ this ].concat(args));
  17247. ret.color = new _Color(ret.color);
  17248. return ret;
  17249. }
  17250. } ], [ {
  17251. key: 'get',
  17252. value: function get(color) {
  17253. if (color instanceof _Color) {
  17254. return color;
  17255. }
  17256. for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {
  17257. args[_key5 - 1] = arguments[_key5];
  17258. }
  17259. return _construct(_Color, [ color ].concat(args));
  17260. }
  17261. }, {
  17262. key: 'defineFunction',
  17263. value: function defineFunction(name, code) {
  17264. var o = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : code;
  17265. var _o$instance = o.instance, instance = _o$instance === void 0 ? true : _o$instance, returns = o.returns;
  17266. var func = function func() {
  17267. var ret = code.apply(void 0, arguments);
  17268. if (returns === 'color') {
  17269. ret = _Color.get(ret);
  17270. } else if (returns === 'function<color>') {
  17271. var f = ret;
  17272. ret = function ret() {
  17273. var ret2 = f.apply(void 0, arguments);
  17274. return _Color.get(ret2);
  17275. };
  17276. Object.assign(ret, f);
  17277. } else if (returns === 'array<color>') {
  17278. ret = ret.map(function(c4) {
  17279. return _Color.get(c4);
  17280. });
  17281. }
  17282. return ret;
  17283. };
  17284. if (!(name in _Color)) {
  17285. _Color[name] = func;
  17286. }
  17287. if (instance) {
  17288. _Color.prototype[name] = function() {
  17289. for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
  17290. args[_key6] = arguments[_key6];
  17291. }
  17292. return func.apply(void 0, [ this ].concat(args));
  17293. };
  17294. }
  17295. }
  17296. }, {
  17297. key: 'defineFunctions',
  17298. value: function defineFunctions(o) {
  17299. for (var name in o) {
  17300. _Color.defineFunction(name, o[name], o[name]);
  17301. }
  17302. }
  17303. }, {
  17304. key: 'extend',
  17305. value: function extend(exports) {
  17306. if (exports.register) {
  17307. exports.register(_Color);
  17308. } else {
  17309. for (var name in exports) {
  17310. _Color.defineFunction(name, exports[name]);
  17311. }
  17312. }
  17313. }
  17314. } ]);
  17315. }());
  17316. _Color.defineFunctions({
  17317. get: get,
  17318. getAll: getAll,
  17319. set: set,
  17320. setAll: setAll,
  17321. to: to,
  17322. equals: equals,
  17323. inGamut: inGamut,
  17324. toGamut: toGamut,
  17325. distance: distance,
  17326. toString: serialize
  17327. });
  17328. Object.assign(_Color, {
  17329. util: util,
  17330. hooks: hooks,
  17331. WHITES: WHITES,
  17332. Space: ColorSpace,
  17333. spaces: ColorSpace.registry,
  17334. parse: parse2,
  17335. defaults: defaults
  17336. });
  17337. for (var _i22 = 0, _Object$keys2 = Object.keys(spaces); _i22 < _Object$keys2.length; _i22++) {
  17338. var key = _Object$keys2[_i22];
  17339. ColorSpace.register(spaces[key]);
  17340. }
  17341. for (var id in ColorSpace.registry) {
  17342. addSpaceAccessors(id, ColorSpace.registry[id]);
  17343. }
  17344. hooks.add('colorspace-init-end', function(space) {
  17345. var _space$aliases;
  17346. addSpaceAccessors(space.id, space);
  17347. (_space$aliases = space.aliases) === null || _space$aliases === void 0 || _space$aliases.forEach(function(alias) {
  17348. addSpaceAccessors(alias, space);
  17349. });
  17350. });
  17351. function addSpaceAccessors(id, space) {
  17352. Object.keys(space.coords);
  17353. Object.values(space.coords).map(function(c4) {
  17354. return c4.name;
  17355. });
  17356. var propId = id.replace(/-/g, '_');
  17357. Object.defineProperty(_Color.prototype, propId, {
  17358. get: function get() {
  17359. var _this3 = this;
  17360. var ret = this.getAll(id);
  17361. if (typeof Proxy === 'undefined') {
  17362. return ret;
  17363. }
  17364. return new Proxy(ret, {
  17365. has: function has(obj, property) {
  17366. try {
  17367. ColorSpace.resolveCoord([ space, property ]);
  17368. return true;
  17369. } catch (e) {}
  17370. return Reflect.has(obj, property);
  17371. },
  17372. get: function get(obj, property, receiver) {
  17373. if (property && _typeof(property) !== 'symbol' && !(property in obj)) {
  17374. var _ColorSpace$resolveCo3 = ColorSpace.resolveCoord([ space, property ]), index = _ColorSpace$resolveCo3.index;
  17375. if (index >= 0) {
  17376. return obj[index];
  17377. }
  17378. }
  17379. return Reflect.get(obj, property, receiver);
  17380. },
  17381. set: function set(obj, property, value, receiver) {
  17382. if (property && _typeof(property) !== 'symbol' && !(property in obj) || property >= 0) {
  17383. var _ColorSpace$resolveCo4 = ColorSpace.resolveCoord([ space, property ]), index = _ColorSpace$resolveCo4.index;
  17384. if (index >= 0) {
  17385. obj[index] = value;
  17386. _this3.setAll(id, obj);
  17387. return true;
  17388. }
  17389. }
  17390. return Reflect.set(obj, property, value, receiver);
  17391. }
  17392. });
  17393. },
  17394. set: function set(coords) {
  17395. this.setAll(id, coords);
  17396. },
  17397. configurable: true,
  17398. enumerable: true
  17399. });
  17400. }
  17401. _Color.extend(deltaEMethods);
  17402. _Color.extend({
  17403. deltaE: deltaE
  17404. });
  17405. _Color.extend(variations);
  17406. _Color.extend({
  17407. contrast: contrast
  17408. });
  17409. _Color.extend(chromaticity);
  17410. _Color.extend(luminance);
  17411. _Color.extend(interpolation);
  17412. _Color.extend(contrastMethods);
  17413. var import_from2 = __toModule(require_from4());
  17414. import_dot['default'].templateSettings.strip = false;
  17415. var hexRegex = /^#[0-9a-f]{3,8}$/i;
  17416. var hslRegex = /hsl\(\s*([-\d.]+)(rad|turn)/;
  17417. var _Color2 = (_r = new WeakMap(), _g = new WeakMap(), _b = new WeakMap(), _red = new WeakMap(),
  17418. _green = new WeakMap(), _blue = new WeakMap(), _Class3_brand = new WeakSet(),
  17419. function() {
  17420. function Color2(red, green, blue) {
  17421. var alpha = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
  17422. _classCallCheck(this, Color2);
  17423. _classPrivateMethodInitSpec(this, _Class3_brand);
  17424. _classPrivateFieldInitSpec(this, _r, void 0);
  17425. _classPrivateFieldInitSpec(this, _g, void 0);
  17426. _classPrivateFieldInitSpec(this, _b, void 0);
  17427. _classPrivateFieldInitSpec(this, _red, void 0);
  17428. _classPrivateFieldInitSpec(this, _green, void 0);
  17429. _classPrivateFieldInitSpec(this, _blue, void 0);
  17430. if (red instanceof _Color2) {
  17431. var r = red.r, g2 = red.g, b2 = red.b;
  17432. this.r = r;
  17433. this.g = g2;
  17434. this.b = b2;
  17435. this.alpha = red.alpha;
  17436. return;
  17437. }
  17438. this.red = red;
  17439. this.green = green;
  17440. this.blue = blue;
  17441. this.alpha = alpha;
  17442. }
  17443. return _createClass(Color2, [ {
  17444. key: 'r',
  17445. get: function get() {
  17446. return _classPrivateFieldGet(_r, this);
  17447. },
  17448. set: function set(value) {
  17449. _classPrivateFieldSet(_r, this, value);
  17450. _classPrivateFieldSet(_red, this, Math.round(clamp(value, 0, 1) * 255));
  17451. }
  17452. }, {
  17453. key: 'g',
  17454. get: function get() {
  17455. return _classPrivateFieldGet(_g, this);
  17456. },
  17457. set: function set(value) {
  17458. _classPrivateFieldSet(_g, this, value);
  17459. _classPrivateFieldSet(_green, this, Math.round(clamp(value, 0, 1) * 255));
  17460. }
  17461. }, {
  17462. key: 'b',
  17463. get: function get() {
  17464. return _classPrivateFieldGet(_b, this);
  17465. },
  17466. set: function set(value) {
  17467. _classPrivateFieldSet(_b, this, value);
  17468. _classPrivateFieldSet(_blue, this, Math.round(clamp(value, 0, 1) * 255));
  17469. }
  17470. }, {
  17471. key: 'red',
  17472. get: function get() {
  17473. return _classPrivateFieldGet(_red, this);
  17474. },
  17475. set: function set(value) {
  17476. _classPrivateFieldSet(_r, this, value / 255);
  17477. _classPrivateFieldSet(_red, this, clamp(value, 0, 255));
  17478. }
  17479. }, {
  17480. key: 'green',
  17481. get: function get() {
  17482. return _classPrivateFieldGet(_green, this);
  17483. },
  17484. set: function set(value) {
  17485. _classPrivateFieldSet(_g, this, value / 255);
  17486. _classPrivateFieldSet(_green, this, clamp(value, 0, 255));
  17487. }
  17488. }, {
  17489. key: 'blue',
  17490. get: function get() {
  17491. return _classPrivateFieldGet(_blue, this);
  17492. },
  17493. set: function set(value) {
  17494. _classPrivateFieldSet(_b, this, value / 255);
  17495. _classPrivateFieldSet(_blue, this, clamp(value, 0, 255));
  17496. }
  17497. }, {
  17498. key: 'toHexString',
  17499. value: function toHexString() {
  17500. var redString = Math.round(this.red).toString(16);
  17501. var greenString = Math.round(this.green).toString(16);
  17502. var blueString = Math.round(this.blue).toString(16);
  17503. return '#' + (this.red > 15.5 ? redString : '0' + redString) + (this.green > 15.5 ? greenString : '0' + greenString) + (this.blue > 15.5 ? blueString : '0' + blueString);
  17504. }
  17505. }, {
  17506. key: 'toJSON',
  17507. value: function toJSON() {
  17508. var red = this.red, green = this.green, blue = this.blue, alpha = this.alpha;
  17509. return {
  17510. red: red,
  17511. green: green,
  17512. blue: blue,
  17513. alpha: alpha
  17514. };
  17515. }
  17516. }, {
  17517. key: 'parseString',
  17518. value: function parseString(colorString) {
  17519. colorString = colorString.replace(hslRegex, function(match, angle, unit) {
  17520. var value = angle + unit;
  17521. switch (unit) {
  17522. case 'rad':
  17523. return match.replace(value, radToDeg(angle));
  17524. case 'turn':
  17525. return match.replace(value, turnToDeg(angle));
  17526. }
  17527. });
  17528. try {
  17529. var prototypeArrayFrom;
  17530. if ('Prototype' in window && 'Version' in window.Prototype) {
  17531. prototypeArrayFrom = Array.from;
  17532. Array.from = import_from2['default'];
  17533. }
  17534. var _color2 = new _Color(colorString).to('srgb');
  17535. if (prototypeArrayFrom) {
  17536. Array.from = prototypeArrayFrom;
  17537. prototypeArrayFrom = null;
  17538. }
  17539. this.r = _color2.r;
  17540. this.g = _color2.g;
  17541. this.b = _color2.b;
  17542. this.alpha = +_color2.alpha;
  17543. } catch (_unused4) {
  17544. throw new Error('Unable to parse color "'.concat(colorString, '"'));
  17545. }
  17546. return this;
  17547. }
  17548. }, {
  17549. key: 'parseRgbString',
  17550. value: function parseRgbString(colorString) {
  17551. this.parseString(colorString);
  17552. }
  17553. }, {
  17554. key: 'parseHexString',
  17555. value: function parseHexString(colorString) {
  17556. if (!colorString.match(hexRegex) || [ 6, 8 ].includes(colorString.length)) {
  17557. return;
  17558. }
  17559. this.parseString(colorString);
  17560. }
  17561. }, {
  17562. key: 'parseColorFnString',
  17563. value: function parseColorFnString(colorString) {
  17564. this.parseString(colorString);
  17565. }
  17566. }, {
  17567. key: 'getRelativeLuminance',
  17568. value: function getRelativeLuminance() {
  17569. var rSRGB = this.r, gSRGB = this.g, bSRGB = this.b;
  17570. var r = rSRGB <= .03928 ? rSRGB / 12.92 : Math.pow((rSRGB + .055) / 1.055, 2.4);
  17571. var g2 = gSRGB <= .03928 ? gSRGB / 12.92 : Math.pow((gSRGB + .055) / 1.055, 2.4);
  17572. var b2 = bSRGB <= .03928 ? bSRGB / 12.92 : Math.pow((bSRGB + .055) / 1.055, 2.4);
  17573. return .2126 * r + .7152 * g2 + .0722 * b2;
  17574. }
  17575. }, {
  17576. key: 'getLuminosity',
  17577. value: function getLuminosity() {
  17578. return .3 * this.r + .59 * this.g + .11 * this.b;
  17579. }
  17580. }, {
  17581. key: 'setLuminosity',
  17582. value: function setLuminosity(L) {
  17583. var d2 = L - this.getLuminosity();
  17584. return _assertClassBrand(_Class3_brand, this, _add).call(this, d2).clip();
  17585. }
  17586. }, {
  17587. key: 'getSaturation',
  17588. value: function getSaturation() {
  17589. return Math.max(this.r, this.g, this.b) - Math.min(this.r, this.g, this.b);
  17590. }
  17591. }, {
  17592. key: 'setSaturation',
  17593. value: function setSaturation(s) {
  17594. var C = new _Color2(this);
  17595. var colorEntires = [ {
  17596. name: 'r',
  17597. value: C.r
  17598. }, {
  17599. name: 'g',
  17600. value: C.g
  17601. }, {
  17602. name: 'b',
  17603. value: C.b
  17604. } ];
  17605. var _colorEntires$sort = colorEntires.sort(function(a2, b2) {
  17606. return a2.value - b2.value;
  17607. }), _colorEntires$sort2 = _slicedToArray(_colorEntires$sort, 3), Cmin = _colorEntires$sort2[0], Cmid = _colorEntires$sort2[1], Cmax = _colorEntires$sort2[2];
  17608. if (Cmax.value > Cmin.value) {
  17609. Cmid.value = (Cmid.value - Cmin.value) * s / (Cmax.value - Cmin.value);
  17610. Cmax.value = s;
  17611. } else {
  17612. Cmid.value = Cmax.value = 0;
  17613. }
  17614. Cmin.value = 0;
  17615. C[Cmax.name] = Cmax.value;
  17616. C[Cmin.name] = Cmin.value;
  17617. C[Cmid.name] = Cmid.value;
  17618. return C;
  17619. }
  17620. }, {
  17621. key: 'clip',
  17622. value: function clip() {
  17623. var C = new _Color2(this);
  17624. var L = C.getLuminosity();
  17625. var n2 = Math.min(C.r, C.g, C.b);
  17626. var x = Math.max(C.r, C.g, C.b);
  17627. if (n2 < 0) {
  17628. C.r = L + (C.r - L) * L / (L - n2);
  17629. C.g = L + (C.g - L) * L / (L - n2);
  17630. C.b = L + (C.b - L) * L / (L - n2);
  17631. }
  17632. if (x > 1) {
  17633. C.r = L + (C.r - L) * (1 - L) / (x - L);
  17634. C.g = L + (C.g - L) * (1 - L) / (x - L);
  17635. C.b = L + (C.b - L) * (1 - L) / (x - L);
  17636. }
  17637. return C;
  17638. }
  17639. } ]);
  17640. }());
  17641. function _add(value) {
  17642. var C = new _Color2(this);
  17643. C.r += value;
  17644. C.g += value;
  17645. C.b += value;
  17646. return C;
  17647. }
  17648. var color_default = _Color2;
  17649. function clamp(value, min, max2) {
  17650. return Math.min(Math.max(min, value), max2);
  17651. }
  17652. function radToDeg(rad) {
  17653. return rad * 180 / Math.PI;
  17654. }
  17655. function turnToDeg(turn) {
  17656. return turn * 360;
  17657. }
  17658. function getOwnBackgroundColor(elmStyle) {
  17659. var bgColor = new color_default();
  17660. bgColor.parseString(elmStyle.getPropertyValue('background-color'));
  17661. if (bgColor.alpha !== 0) {
  17662. var opacity = elmStyle.getPropertyValue('opacity');
  17663. bgColor.alpha = bgColor.alpha * opacity;
  17664. }
  17665. return bgColor;
  17666. }
  17667. var get_own_background_color_default = getOwnBackgroundColor;
  17668. function isOpaque(node) {
  17669. var style = window.getComputedStyle(node);
  17670. return element_has_image_default(node, style) || get_own_background_color_default(style).alpha === 1;
  17671. }
  17672. var is_opaque_default = isOpaque;
  17673. function _isSkipLink(element) {
  17674. if (!element.href) {
  17675. return false;
  17676. }
  17677. var firstPageLink = cache_default.get('firstPageLink', generateFirstPageLink);
  17678. if (!firstPageLink) {
  17679. return true;
  17680. }
  17681. return element.compareDocumentPosition(firstPageLink.actualNode) === element.DOCUMENT_POSITION_FOLLOWING;
  17682. }
  17683. function generateFirstPageLink() {
  17684. var firstPageLink;
  17685. if (!window.location.origin) {
  17686. firstPageLink = query_selector_all_default(axe._tree, 'a:not([href^="#"]):not([href^="/#"]):not([href^="javascript:"])')[0];
  17687. } else {
  17688. firstPageLink = query_selector_all_default(axe._tree, 'a[href]:not([href^="javascript:"])').find(function(link) {
  17689. return !_isCurrentPageLink(link.actualNode);
  17690. });
  17691. }
  17692. return firstPageLink || null;
  17693. }
  17694. var clipRegex2 = /rect\s*\(([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px\s*\)/;
  17695. var clipPathRegex2 = /(\w+)\((\d+)/;
  17696. function isClipped(style) {
  17697. var matchesClip = style.getPropertyValue('clip').match(clipRegex2);
  17698. var matchesClipPath = style.getPropertyValue('clip-path').match(clipPathRegex2);
  17699. if (matchesClip && matchesClip.length === 5) {
  17700. var position = style.getPropertyValue('position');
  17701. if ([ 'fixed', 'absolute' ].includes(position)) {
  17702. return matchesClip[3] - matchesClip[1] <= 0 && matchesClip[2] - matchesClip[4] <= 0;
  17703. }
  17704. }
  17705. if (matchesClipPath) {
  17706. var type2 = matchesClipPath[1];
  17707. var value = parseInt(matchesClipPath[2], 10);
  17708. switch (type2) {
  17709. case 'inset':
  17710. return value >= 50;
  17711. case 'circle':
  17712. return value === 0;
  17713. default:
  17714. }
  17715. }
  17716. return false;
  17717. }
  17718. function isAreaVisible(el, screenReader, recursed) {
  17719. var mapEl = find_up_default(el, 'map');
  17720. if (!mapEl) {
  17721. return false;
  17722. }
  17723. var mapElName = mapEl.getAttribute('name');
  17724. if (!mapElName) {
  17725. return false;
  17726. }
  17727. var mapElRootNode = get_root_node_default2(el);
  17728. if (!mapElRootNode || mapElRootNode.nodeType !== 9) {
  17729. return false;
  17730. }
  17731. var refs = query_selector_all_default(axe._tree, 'img[usemap="#'.concat(escape_selector_default(mapElName), '"]'));
  17732. if (!refs || !refs.length) {
  17733. return false;
  17734. }
  17735. return refs.some(function(_ref62) {
  17736. var actualNode = _ref62.actualNode;
  17737. return isVisible(actualNode, screenReader, recursed);
  17738. });
  17739. }
  17740. function isVisible(el, screenReader, recursed) {
  17741. var _window$Node2;
  17742. if (!el) {
  17743. throw new TypeError('Cannot determine if element is visible for non-DOM nodes');
  17744. }
  17745. var vNode = el instanceof abstract_virtual_node_default ? el : get_node_from_tree_default(el);
  17746. el = vNode ? vNode.actualNode : el;
  17747. var cacheName = '_isVisible' + (screenReader ? 'ScreenReader' : '');
  17748. var _ref63 = (_window$Node2 = window.Node) !== null && _window$Node2 !== void 0 ? _window$Node2 : {}, DOCUMENT_NODE = _ref63.DOCUMENT_NODE, DOCUMENT_FRAGMENT_NODE = _ref63.DOCUMENT_FRAGMENT_NODE;
  17749. var nodeType = vNode ? vNode.props.nodeType : el.nodeType;
  17750. var nodeName2 = vNode ? vNode.props.nodeName : el.nodeName.toLowerCase();
  17751. if (vNode && typeof vNode[cacheName] !== 'undefined') {
  17752. return vNode[cacheName];
  17753. }
  17754. if (nodeType === DOCUMENT_NODE) {
  17755. return true;
  17756. }
  17757. if ([ 'style', 'script', 'noscript', 'template' ].includes(nodeName2)) {
  17758. return false;
  17759. }
  17760. if (el && nodeType === DOCUMENT_FRAGMENT_NODE) {
  17761. el = el.host;
  17762. }
  17763. if (screenReader) {
  17764. var ariaHiddenValue = vNode ? vNode.attr('aria-hidden') : el.getAttribute('aria-hidden');
  17765. if (ariaHiddenValue === 'true') {
  17766. return false;
  17767. }
  17768. }
  17769. if (!el) {
  17770. var parent2 = vNode.parent;
  17771. var visible3 = true;
  17772. if (parent2) {
  17773. visible3 = isVisible(parent2, screenReader, true);
  17774. }
  17775. if (vNode) {
  17776. vNode[cacheName] = visible3;
  17777. }
  17778. return visible3;
  17779. }
  17780. var style = window.getComputedStyle(el, null);
  17781. if (style === null) {
  17782. return false;
  17783. }
  17784. if (nodeName2 === 'area') {
  17785. return isAreaVisible(el, screenReader, recursed);
  17786. }
  17787. if (style.getPropertyValue('display') === 'none') {
  17788. return false;
  17789. }
  17790. var elHeight = parseInt(style.getPropertyValue('height'));
  17791. var elWidth = parseInt(style.getPropertyValue('width'));
  17792. var scroll = get_scroll_default(el);
  17793. var scrollableWithZeroHeight = scroll && elHeight === 0;
  17794. var scrollableWithZeroWidth = scroll && elWidth === 0;
  17795. var posAbsoluteOverflowHiddenAndSmall = style.getPropertyValue('position') === 'absolute' && (elHeight < 2 || elWidth < 2) && style.getPropertyValue('overflow') === 'hidden';
  17796. if (!screenReader && (isClipped(style) || style.getPropertyValue('opacity') === '0' || scrollableWithZeroHeight || scrollableWithZeroWidth || posAbsoluteOverflowHiddenAndSmall)) {
  17797. return false;
  17798. }
  17799. if (!recursed && (style.getPropertyValue('visibility') === 'hidden' || !screenReader && is_offscreen_default(el))) {
  17800. return false;
  17801. }
  17802. var parent = el.assignedSlot ? el.assignedSlot : el.parentNode;
  17803. var visible2 = false;
  17804. if (parent) {
  17805. visible2 = isVisible(parent, screenReader, true);
  17806. }
  17807. if (vNode) {
  17808. vNode[cacheName] = visible2;
  17809. }
  17810. return visible2;
  17811. }
  17812. var is_visible_default = isVisible;
  17813. function reduceToElementsBelowFloating(elements, targetNode) {
  17814. var floatingPositions = [ 'fixed', 'sticky' ];
  17815. var finalElements = [];
  17816. var targetFound = false;
  17817. for (var index = 0; index < elements.length; ++index) {
  17818. var currentNode = elements[index];
  17819. if (currentNode === targetNode) {
  17820. targetFound = true;
  17821. }
  17822. var style = window.getComputedStyle(currentNode);
  17823. if (!targetFound && floatingPositions.indexOf(style.position) !== -1) {
  17824. finalElements = [];
  17825. continue;
  17826. }
  17827. finalElements.push(currentNode);
  17828. }
  17829. return finalElements;
  17830. }
  17831. var reduce_to_elements_below_floating_default = reduceToElementsBelowFloating;
  17832. function _visuallyContains(node, parent) {
  17833. var parentScrollAncestor = getScrollAncestor(parent);
  17834. do {
  17835. var nextScrollAncestor = getScrollAncestor(node);
  17836. if (nextScrollAncestor === parentScrollAncestor || nextScrollAncestor === parent) {
  17837. return contains2(node, parent);
  17838. }
  17839. node = nextScrollAncestor;
  17840. } while (node);
  17841. return false;
  17842. }
  17843. function getScrollAncestor(node) {
  17844. var vNode = get_node_from_tree_default(node);
  17845. var ancestor = vNode.parent;
  17846. while (ancestor) {
  17847. if (get_scroll_default(ancestor.actualNode)) {
  17848. return ancestor.actualNode;
  17849. }
  17850. ancestor = ancestor.parent;
  17851. }
  17852. }
  17853. function contains2(node, parent) {
  17854. var style = window.getComputedStyle(parent);
  17855. var overflow = style.getPropertyValue('overflow');
  17856. if (style.getPropertyValue('display') === 'inline') {
  17857. return true;
  17858. }
  17859. var clientRects = Array.from(node.getClientRects());
  17860. var boundingRect = parent.getBoundingClientRect();
  17861. var rect = {
  17862. left: boundingRect.left,
  17863. top: boundingRect.top,
  17864. width: boundingRect.width,
  17865. height: boundingRect.height
  17866. };
  17867. if ([ 'scroll', 'auto' ].includes(overflow) || parent instanceof window.HTMLHtmlElement) {
  17868. rect.width = parent.scrollWidth;
  17869. rect.height = parent.scrollHeight;
  17870. }
  17871. if (clientRects.length === 1 && overflow === 'hidden' && style.getPropertyValue('white-space') === 'nowrap') {
  17872. clientRects[0] = rect;
  17873. }
  17874. return clientRects.some(function(clientRect) {
  17875. return !(Math.ceil(clientRect.left) < Math.floor(rect.left) || Math.ceil(clientRect.top) < Math.floor(rect.top) || Math.floor(clientRect.left + clientRect.width) > Math.ceil(rect.left + rect.width) || Math.floor(clientRect.top + clientRect.height) > Math.ceil(rect.top + rect.height));
  17876. });
  17877. }
  17878. function shadowElementsFromPoint(nodeX, nodeY) {
  17879. var root = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : document;
  17880. var i = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  17881. if (i > 999) {
  17882. throw new Error('Infinite loop detected');
  17883. }
  17884. return Array.from(root.elementsFromPoint(nodeX, nodeY) || []).filter(function(nodes) {
  17885. return get_root_node_default2(nodes) === root;
  17886. }).reduce(function(stack, elm) {
  17887. if (is_shadow_root_default(elm)) {
  17888. var shadowStack = shadowElementsFromPoint(nodeX, nodeY, elm.shadowRoot, i + 1);
  17889. stack = stack.concat(shadowStack);
  17890. if (stack.length && _visuallyContains(stack[0], elm)) {
  17891. stack.push(elm);
  17892. }
  17893. } else {
  17894. stack.push(elm);
  17895. }
  17896. return stack;
  17897. }, []);
  17898. }
  17899. var shadow_elements_from_point_default = shadowElementsFromPoint;
  17900. function urlPropsFromAttribute(node, attribute) {
  17901. if (!node.hasAttribute(attribute)) {
  17902. return void 0;
  17903. }
  17904. var nodeName2 = node.nodeName.toUpperCase();
  17905. var parser2 = node;
  17906. if (![ 'A', 'AREA' ].includes(nodeName2) || node.ownerSVGElement) {
  17907. parser2 = document.createElement('a');
  17908. parser2.href = node.getAttribute(attribute);
  17909. }
  17910. var protocol = [ 'https:', 'ftps:' ].includes(parser2.protocol) ? parser2.protocol.replace(/s:$/, ':') : parser2.protocol;
  17911. var parserPathname = /^\//.test(parser2.pathname) ? parser2.pathname : '/'.concat(parser2.pathname);
  17912. var _getPathnameOrFilenam = getPathnameOrFilename(parserPathname), pathname = _getPathnameOrFilenam.pathname, filename = _getPathnameOrFilenam.filename;
  17913. return {
  17914. protocol: protocol,
  17915. hostname: parser2.hostname,
  17916. port: getPort(parser2.port),
  17917. pathname: /\/$/.test(pathname) ? pathname : ''.concat(pathname, '/'),
  17918. search: getSearchPairs(parser2.search),
  17919. hash: getHashRoute(parser2.hash),
  17920. filename: filename
  17921. };
  17922. }
  17923. function getPort(port) {
  17924. var excludePorts = [ '443', '80' ];
  17925. return !excludePorts.includes(port) ? port : '';
  17926. }
  17927. function getPathnameOrFilename(pathname) {
  17928. var filename = pathname.split('/').pop();
  17929. if (!filename || filename.indexOf('.') === -1) {
  17930. return {
  17931. pathname: pathname,
  17932. filename: ''
  17933. };
  17934. }
  17935. return {
  17936. pathname: pathname.replace(filename, ''),
  17937. filename: /index./.test(filename) ? '' : filename
  17938. };
  17939. }
  17940. function getSearchPairs(searchStr) {
  17941. var query = {};
  17942. if (!searchStr || !searchStr.length) {
  17943. return query;
  17944. }
  17945. var pairs = searchStr.substring(1).split('&');
  17946. if (!pairs || !pairs.length) {
  17947. return query;
  17948. }
  17949. for (var index = 0; index < pairs.length; index++) {
  17950. var pair = pairs[index];
  17951. var _pair$split = pair.split('='), _pair$split2 = _slicedToArray(_pair$split, 2), _key7 = _pair$split2[0], _pair$split2$ = _pair$split2[1], value = _pair$split2$ === void 0 ? '' : _pair$split2$;
  17952. query[decodeURIComponent(_key7)] = decodeURIComponent(value);
  17953. }
  17954. return query;
  17955. }
  17956. function getHashRoute(hash) {
  17957. if (!hash) {
  17958. return '';
  17959. }
  17960. var hashRegex = /#!?\/?/g;
  17961. var hasMatch = hash.match(hashRegex);
  17962. if (!hasMatch) {
  17963. return '';
  17964. }
  17965. var _hasMatch = _slicedToArray(hasMatch, 1), matchedStr = _hasMatch[0];
  17966. if (matchedStr === '#') {
  17967. return '';
  17968. }
  17969. return hash;
  17970. }
  17971. var url_props_from_attribute_default = urlPropsFromAttribute;
  17972. function visuallyOverlaps(rect, parent) {
  17973. var parentRect = parent.getBoundingClientRect();
  17974. var parentTop = parentRect.top;
  17975. var parentLeft = parentRect.left;
  17976. var parentScrollArea = {
  17977. top: parentTop - parent.scrollTop,
  17978. bottom: parentTop - parent.scrollTop + parent.scrollHeight,
  17979. left: parentLeft - parent.scrollLeft,
  17980. right: parentLeft - parent.scrollLeft + parent.scrollWidth
  17981. };
  17982. if (rect.left > parentScrollArea.right && rect.left > parentRect.right || rect.top > parentScrollArea.bottom && rect.top > parentRect.bottom || rect.right < parentScrollArea.left && rect.right < parentRect.left || rect.bottom < parentScrollArea.top && rect.bottom < parentRect.top) {
  17983. return false;
  17984. }
  17985. var style = window.getComputedStyle(parent);
  17986. if (rect.left > parentRect.right || rect.top > parentRect.bottom) {
  17987. return style.overflow === 'scroll' || style.overflow === 'auto' || parent instanceof window.HTMLBodyElement || parent instanceof window.HTMLHtmlElement;
  17988. }
  17989. return true;
  17990. }
  17991. var visually_overlaps_default = visuallyOverlaps;
  17992. var nodeIndex2 = 0;
  17993. var VirtualNode = function(_abstract_virtual_nod) {
  17994. function VirtualNode(node, parent, shadowId) {
  17995. var _this4;
  17996. _classCallCheck(this, VirtualNode);
  17997. _this4 = _callSuper(this, VirtualNode);
  17998. _this4.shadowId = shadowId;
  17999. _this4.children = [];
  18000. _this4.actualNode = node;
  18001. _this4.parent = parent;
  18002. if (!parent) {
  18003. nodeIndex2 = 0;
  18004. }
  18005. _this4.nodeIndex = nodeIndex2++;
  18006. _this4._isHidden = null;
  18007. _this4._cache = {};
  18008. _this4._isXHTML = is_xhtml_default(node.ownerDocument);
  18009. if (node.nodeName.toLowerCase() === 'input') {
  18010. var type2 = node.getAttribute('type');
  18011. type2 = _this4._isXHTML ? type2 : (type2 || '').toLowerCase();
  18012. if (!valid_input_type_default().includes(type2)) {
  18013. type2 = 'text';
  18014. }
  18015. _this4._type = type2;
  18016. }
  18017. if (cache_default.get('nodeMap')) {
  18018. cache_default.get('nodeMap').set(node, _this4);
  18019. }
  18020. return _this4;
  18021. }
  18022. _inherits(VirtualNode, _abstract_virtual_nod);
  18023. return _createClass(VirtualNode, [ {
  18024. key: 'props',
  18025. get: function get() {
  18026. if (!this._cache.hasOwnProperty('props')) {
  18027. var _this$actualNode = this.actualNode, nodeType = _this$actualNode.nodeType, nodeName2 = _this$actualNode.nodeName, _id = _this$actualNode.id, nodeValue = _this$actualNode.nodeValue;
  18028. this._cache.props = {
  18029. nodeType: nodeType,
  18030. nodeName: this._isXHTML ? nodeName2 : nodeName2.toLowerCase(),
  18031. id: _id,
  18032. type: this._type,
  18033. nodeValue: nodeValue
  18034. };
  18035. if (nodeType === 1) {
  18036. this._cache.props.multiple = this.actualNode.multiple;
  18037. this._cache.props.value = this.actualNode.value;
  18038. this._cache.props.selected = this.actualNode.selected;
  18039. this._cache.props.checked = this.actualNode.checked;
  18040. this._cache.props.indeterminate = this.actualNode.indeterminate;
  18041. }
  18042. }
  18043. return this._cache.props;
  18044. }
  18045. }, {
  18046. key: 'attr',
  18047. value: function attr(attrName) {
  18048. if (typeof this.actualNode.getAttribute !== 'function') {
  18049. return null;
  18050. }
  18051. return this.actualNode.getAttribute(attrName);
  18052. }
  18053. }, {
  18054. key: 'hasAttr',
  18055. value: function hasAttr(attrName) {
  18056. if (typeof this.actualNode.hasAttribute !== 'function') {
  18057. return false;
  18058. }
  18059. return this.actualNode.hasAttribute(attrName);
  18060. }
  18061. }, {
  18062. key: 'attrNames',
  18063. get: function get() {
  18064. if (!this._cache.hasOwnProperty('attrNames')) {
  18065. var attrs;
  18066. if (this.actualNode.attributes instanceof window.NamedNodeMap) {
  18067. attrs = this.actualNode.attributes;
  18068. } else {
  18069. attrs = this.actualNode.cloneNode(false).attributes;
  18070. }
  18071. this._cache.attrNames = Array.from(attrs).map(function(attr) {
  18072. return attr.name;
  18073. });
  18074. }
  18075. return this._cache.attrNames;
  18076. }
  18077. }, {
  18078. key: 'getComputedStylePropertyValue',
  18079. value: function getComputedStylePropertyValue(property) {
  18080. var key = 'computedStyle_' + property;
  18081. if (!this._cache.hasOwnProperty(key)) {
  18082. if (!this._cache.hasOwnProperty('computedStyle')) {
  18083. this._cache.computedStyle = window.getComputedStyle(this.actualNode);
  18084. }
  18085. this._cache[key] = this._cache.computedStyle.getPropertyValue(property);
  18086. }
  18087. return this._cache[key];
  18088. }
  18089. }, {
  18090. key: 'isFocusable',
  18091. get: function get() {
  18092. if (!this._cache.hasOwnProperty('isFocusable')) {
  18093. this._cache.isFocusable = _isFocusable(this.actualNode);
  18094. }
  18095. return this._cache.isFocusable;
  18096. }
  18097. }, {
  18098. key: 'tabbableElements',
  18099. get: function get() {
  18100. if (!this._cache.hasOwnProperty('tabbableElements')) {
  18101. this._cache.tabbableElements = get_tabbable_elements_default(this);
  18102. }
  18103. return this._cache.tabbableElements;
  18104. }
  18105. }, {
  18106. key: 'clientRects',
  18107. get: function get() {
  18108. if (!this._cache.hasOwnProperty('clientRects')) {
  18109. this._cache.clientRects = Array.from(this.actualNode.getClientRects()).filter(function(rect) {
  18110. return rect.width > 0;
  18111. });
  18112. }
  18113. return this._cache.clientRects;
  18114. }
  18115. }, {
  18116. key: 'boundingClientRect',
  18117. get: function get() {
  18118. if (!this._cache.hasOwnProperty('boundingClientRect')) {
  18119. this._cache.boundingClientRect = this.actualNode.getBoundingClientRect();
  18120. }
  18121. return this._cache.boundingClientRect;
  18122. }
  18123. } ]);
  18124. }(abstract_virtual_node_default);
  18125. var virtual_node_default = VirtualNode;
  18126. function tokenList(str) {
  18127. return (str || '').trim().replace(/\s{2,}/g, ' ').split(' ');
  18128. }
  18129. var token_list_default = tokenList;
  18130. var idsKey = ' [idsMap]';
  18131. function getNodesMatchingExpression(domTree, expressions, filter) {
  18132. var selectorMap = domTree[0]._selectorMap;
  18133. if (!selectorMap) {
  18134. return;
  18135. }
  18136. var shadowId = domTree[0].shadowId;
  18137. for (var _i23 = 0; _i23 < expressions.length; _i23++) {
  18138. if (expressions[_i23].length > 1 && expressions[_i23].some(function(expression) {
  18139. return isGlobalSelector(expression);
  18140. })) {
  18141. return;
  18142. }
  18143. }
  18144. var nodeSet = new Set();
  18145. expressions.forEach(function(expression) {
  18146. var _matchingNodes$nodes;
  18147. var matchingNodes = findMatchingNodes(expression, selectorMap, shadowId);
  18148. matchingNodes === null || matchingNodes === void 0 || (_matchingNodes$nodes = matchingNodes.nodes) === null || _matchingNodes$nodes === void 0 || _matchingNodes$nodes.forEach(function(node) {
  18149. if (matchingNodes.isComplexSelector && !_matchesExpression(node, expression)) {
  18150. return;
  18151. }
  18152. nodeSet.add(node);
  18153. });
  18154. });
  18155. var matchedNodes = [];
  18156. nodeSet.forEach(function(node) {
  18157. return matchedNodes.push(node);
  18158. });
  18159. if (filter) {
  18160. matchedNodes = matchedNodes.filter(filter);
  18161. }
  18162. return matchedNodes.sort(function(a2, b2) {
  18163. return a2.nodeIndex - b2.nodeIndex;
  18164. });
  18165. }
  18166. function findMatchingNodes(expression, selectorMap, shadowId) {
  18167. var exp = expression[expression.length - 1];
  18168. var nodes = null;
  18169. var isComplexSelector = expression.length > 1 || !!exp.pseudos || !!exp.classes;
  18170. if (isGlobalSelector(exp)) {
  18171. nodes = selectorMap['*'];
  18172. } else {
  18173. if (exp.id) {
  18174. var _selectorMap$idsKey$e;
  18175. if (!selectorMap[idsKey] || !Object.hasOwn(selectorMap[idsKey], exp.id) || !((_selectorMap$idsKey$e = selectorMap[idsKey][exp.id]) !== null && _selectorMap$idsKey$e !== void 0 && _selectorMap$idsKey$e.length)) {
  18176. return;
  18177. }
  18178. nodes = selectorMap[idsKey][exp.id].filter(function(node) {
  18179. return node.shadowId === shadowId;
  18180. });
  18181. }
  18182. if (exp.tag && exp.tag !== '*') {
  18183. var _selectorMap$exp$tag;
  18184. if (!((_selectorMap$exp$tag = selectorMap[exp.tag]) !== null && _selectorMap$exp$tag !== void 0 && _selectorMap$exp$tag.length)) {
  18185. return;
  18186. }
  18187. var cachedNodes = selectorMap[exp.tag];
  18188. nodes = nodes ? getSharedValues(cachedNodes, nodes) : cachedNodes;
  18189. }
  18190. if (exp.classes) {
  18191. var _selectorMap$Class;
  18192. if (!((_selectorMap$Class = selectorMap['[class]']) !== null && _selectorMap$Class !== void 0 && _selectorMap$Class.length)) {
  18193. return;
  18194. }
  18195. var _cachedNodes = selectorMap['[class]'];
  18196. nodes = nodes ? getSharedValues(_cachedNodes, nodes) : _cachedNodes;
  18197. }
  18198. if (exp.attributes) {
  18199. for (var _i24 = 0; _i24 < exp.attributes.length; _i24++) {
  18200. var _selectorMap;
  18201. var attr = exp.attributes[_i24];
  18202. if (attr.type === 'attrValue') {
  18203. isComplexSelector = true;
  18204. }
  18205. if (!((_selectorMap = selectorMap['['.concat(attr.key, ']')]) !== null && _selectorMap !== void 0 && _selectorMap.length)) {
  18206. return;
  18207. }
  18208. var _cachedNodes2 = selectorMap['['.concat(attr.key, ']')];
  18209. nodes = nodes ? getSharedValues(_cachedNodes2, nodes) : _cachedNodes2;
  18210. }
  18211. }
  18212. }
  18213. return {
  18214. nodes: nodes,
  18215. isComplexSelector: isComplexSelector
  18216. };
  18217. }
  18218. function isGlobalSelector(expression) {
  18219. return expression.tag === '*' && !expression.attributes && !expression.id && !expression.classes;
  18220. }
  18221. function getSharedValues(a2, b2) {
  18222. return a2.filter(function(node) {
  18223. return b2.includes(node);
  18224. });
  18225. }
  18226. function cacheSelector(key, vNode, map) {
  18227. if (!Object.hasOwn(map, key)) {
  18228. map[key] = [];
  18229. }
  18230. map[key].push(vNode);
  18231. }
  18232. function cacheNodeSelectors(vNode, selectorMap) {
  18233. if (vNode.props.nodeType !== 1) {
  18234. return;
  18235. }
  18236. cacheSelector(vNode.props.nodeName, vNode, selectorMap);
  18237. cacheSelector('*', vNode, selectorMap);
  18238. vNode.attrNames.forEach(function(attrName) {
  18239. if (attrName === 'id') {
  18240. selectorMap[idsKey] = selectorMap[idsKey] || {};
  18241. token_list_default(vNode.attr(attrName)).forEach(function(value) {
  18242. cacheSelector(value, vNode, selectorMap[idsKey]);
  18243. });
  18244. }
  18245. cacheSelector('['.concat(attrName, ']'), vNode, selectorMap);
  18246. });
  18247. }
  18248. var hasShadowRoot;
  18249. function _getFlattenedTree() {
  18250. var node = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.documentElement;
  18251. var shadowId = arguments.length > 1 ? arguments[1] : undefined;
  18252. hasShadowRoot = false;
  18253. var selectorMap = {};
  18254. cache_default.set('nodeMap', new WeakMap());
  18255. cache_default.set('selectorMap', selectorMap);
  18256. var tree = flattenTree(node, shadowId, null);
  18257. tree[0]._selectorMap = selectorMap;
  18258. tree[0]._hasShadowRoot = hasShadowRoot;
  18259. return tree;
  18260. }
  18261. function getSlotChildren(node) {
  18262. var retVal = [];
  18263. node = node.firstChild;
  18264. while (node) {
  18265. retVal.push(node);
  18266. node = node.nextSibling;
  18267. }
  18268. return retVal;
  18269. }
  18270. function createNode(node, parent, shadowId) {
  18271. var vNode = new virtual_node_default(node, parent, shadowId);
  18272. cacheNodeSelectors(vNode, cache_default.get('selectorMap'));
  18273. return vNode;
  18274. }
  18275. function flattenTree(node, shadowId, parent) {
  18276. var retVal, realArray;
  18277. function reduceShadowDOM(res, child, parentVNode) {
  18278. var replacements = flattenTree(child, shadowId, parentVNode);
  18279. if (replacements) {
  18280. res = res.concat(replacements);
  18281. }
  18282. return res;
  18283. }
  18284. if (node.documentElement) {
  18285. node = node.documentElement;
  18286. }
  18287. var nodeName2 = node.nodeName.toLowerCase();
  18288. if (is_shadow_root_default(node)) {
  18289. hasShadowRoot = true;
  18290. retVal = createNode(node, parent, shadowId);
  18291. shadowId = 'a' + Math.random().toString().substring(2);
  18292. realArray = Array.from(node.shadowRoot.childNodes);
  18293. retVal.children = realArray.reduce(function(res, child) {
  18294. return reduceShadowDOM(res, child, retVal);
  18295. }, []);
  18296. return [ retVal ];
  18297. } else {
  18298. if (nodeName2 === 'content' && typeof node.getDistributedNodes === 'function') {
  18299. realArray = Array.from(node.getDistributedNodes());
  18300. return realArray.reduce(function(res, child) {
  18301. return reduceShadowDOM(res, child, parent);
  18302. }, []);
  18303. } else if (nodeName2 === 'slot' && typeof node.assignedNodes === 'function') {
  18304. realArray = Array.from(node.assignedNodes());
  18305. if (!realArray.length) {
  18306. realArray = getSlotChildren(node);
  18307. }
  18308. var styl = window.getComputedStyle(node);
  18309. if (false) {
  18310. retVal = createNode(node, parent, shadowId);
  18311. retVal.children = realArray.reduce(function(res, child) {
  18312. return reduceShadowDOM(res, child, retVal);
  18313. }, []);
  18314. return [ retVal ];
  18315. } else {
  18316. return realArray.reduce(function(res, child) {
  18317. return reduceShadowDOM(res, child, parent);
  18318. }, []);
  18319. }
  18320. } else {
  18321. if (node.nodeType === 1) {
  18322. retVal = createNode(node, parent, shadowId);
  18323. realArray = Array.from(node.childNodes);
  18324. retVal.children = realArray.reduce(function(res, child) {
  18325. return reduceShadowDOM(res, child, retVal);
  18326. }, []);
  18327. return [ retVal ];
  18328. } else if (node.nodeType === 3) {
  18329. return [ createNode(node, parent) ];
  18330. }
  18331. return void 0;
  18332. }
  18333. }
  18334. }
  18335. function getBaseLang(lang) {
  18336. if (!lang) {
  18337. return '';
  18338. }
  18339. return lang.trim().split('-')[0].toLowerCase();
  18340. }
  18341. var get_base_lang_default = getBaseLang;
  18342. function failureSummary(nodeData) {
  18343. var failingChecks = {};
  18344. failingChecks.none = nodeData.none.concat(nodeData.all);
  18345. failingChecks.any = nodeData.any;
  18346. return Object.keys(failingChecks).map(function(key) {
  18347. if (!failingChecks[key].length) {
  18348. return;
  18349. }
  18350. var sum = axe._audit.data.failureSummaries[key];
  18351. if (sum && typeof sum.failureMessage === 'function') {
  18352. return sum.failureMessage(failingChecks[key].map(function(check) {
  18353. return check.message || '';
  18354. }));
  18355. }
  18356. }).filter(function(i) {
  18357. return i !== void 0;
  18358. }).join('\n\n');
  18359. }
  18360. var failure_summary_default = failureSummary;
  18361. function incompleteFallbackMessage() {
  18362. var message = axe._audit.data.incompleteFallbackMessage;
  18363. if (typeof message === 'function') {
  18364. message = message();
  18365. }
  18366. if (typeof message !== 'string') {
  18367. return '';
  18368. }
  18369. return message;
  18370. }
  18371. var resultKeys = constants_default.resultGroups;
  18372. function processAggregate(results, options) {
  18373. var resultObject = axe.utils.aggregateResult(results);
  18374. resultKeys.forEach(function(key) {
  18375. if (options.resultTypes && !options.resultTypes.includes(key)) {
  18376. (resultObject[key] || []).forEach(function(ruleResult) {
  18377. if (Array.isArray(ruleResult.nodes) && ruleResult.nodes.length > 0) {
  18378. ruleResult.nodes = [ ruleResult.nodes[0] ];
  18379. }
  18380. });
  18381. }
  18382. resultObject[key] = (resultObject[key] || []).map(function(ruleResult) {
  18383. ruleResult = Object.assign({}, ruleResult);
  18384. if (Array.isArray(ruleResult.nodes) && ruleResult.nodes.length > 0) {
  18385. ruleResult.nodes = ruleResult.nodes.map(function(subResult) {
  18386. if (_typeof(subResult.node) === 'object') {
  18387. var serialElm = trimElementSpec(subResult.node, options);
  18388. Object.assign(subResult, serialElm);
  18389. }
  18390. delete subResult.result;
  18391. delete subResult.node;
  18392. normalizeRelatedNodes(subResult, options);
  18393. return subResult;
  18394. });
  18395. }
  18396. resultKeys.forEach(function(resultKey) {
  18397. return delete ruleResult[resultKey];
  18398. });
  18399. delete ruleResult.pageLevel;
  18400. delete ruleResult.result;
  18401. return ruleResult;
  18402. });
  18403. });
  18404. return resultObject;
  18405. }
  18406. function normalizeRelatedNodes(node, options) {
  18407. [ 'any', 'all', 'none' ].forEach(function(type2) {
  18408. if (!Array.isArray(node[type2])) {
  18409. return;
  18410. }
  18411. node[type2].filter(function(checkRes) {
  18412. return Array.isArray(checkRes.relatedNodes);
  18413. }).forEach(function(checkRes) {
  18414. checkRes.relatedNodes = checkRes.relatedNodes.map(function(relatedNode) {
  18415. return trimElementSpec(relatedNode, options);
  18416. });
  18417. });
  18418. });
  18419. }
  18420. function trimElementSpec() {
  18421. var elmSpec = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  18422. var runOptions = arguments.length > 1 ? arguments[1] : undefined;
  18423. elmSpec = node_serializer_default.dqElmToSpec(elmSpec, runOptions);
  18424. var serialElm = {};
  18425. if (axe._audit.noHtml) {
  18426. serialElm.html = null;
  18427. } else {
  18428. var _elmSpec$source;
  18429. serialElm.html = (_elmSpec$source = elmSpec.source) !== null && _elmSpec$source !== void 0 ? _elmSpec$source : 'Undefined';
  18430. }
  18431. if (runOptions.elementRef && !elmSpec.fromFrame) {
  18432. var _elmSpec$element;
  18433. serialElm.element = (_elmSpec$element = elmSpec.element) !== null && _elmSpec$element !== void 0 ? _elmSpec$element : null;
  18434. }
  18435. if (runOptions.selectors !== false || elmSpec.fromFrame) {
  18436. var _elmSpec$selector;
  18437. serialElm.target = (_elmSpec$selector = elmSpec.selector) !== null && _elmSpec$selector !== void 0 ? _elmSpec$selector : [ ':root' ];
  18438. }
  18439. if (runOptions.ancestry) {
  18440. var _elmSpec$ancestry;
  18441. serialElm.ancestry = (_elmSpec$ancestry = elmSpec.ancestry) !== null && _elmSpec$ancestry !== void 0 ? _elmSpec$ancestry : [ ':root' ];
  18442. }
  18443. if (runOptions.xpath) {
  18444. var _elmSpec$xpath;
  18445. serialElm.xpath = (_elmSpec$xpath = elmSpec.xpath) !== null && _elmSpec$xpath !== void 0 ? _elmSpec$xpath : [ '/' ];
  18446. }
  18447. return serialElm;
  18448. }
  18449. var dataRegex = /\$\{\s?data\s?\}/g;
  18450. function substitute(str, data) {
  18451. if (typeof data === 'string') {
  18452. return str.replace(dataRegex, data);
  18453. }
  18454. for (var prop in data) {
  18455. if (data.hasOwnProperty(prop)) {
  18456. var regex = new RegExp('\\${\\s?data\\.' + prop + '\\s?}', 'g');
  18457. var replace = typeof data[prop] === 'undefined' ? '' : String(data[prop]);
  18458. str = str.replace(regex, replace);
  18459. }
  18460. }
  18461. return str;
  18462. }
  18463. function processMessage(message, data) {
  18464. if (!message) {
  18465. return;
  18466. }
  18467. if (Array.isArray(data)) {
  18468. data.values = data.join(', ');
  18469. if (typeof message.singular === 'string' && typeof message.plural === 'string') {
  18470. var str2 = data.length === 1 ? message.singular : message.plural;
  18471. return substitute(str2, data);
  18472. }
  18473. return substitute(message, data);
  18474. }
  18475. if (typeof message === 'string') {
  18476. return substitute(message, data);
  18477. }
  18478. if (typeof data === 'string') {
  18479. var _str = message[data];
  18480. return substitute(_str, data);
  18481. }
  18482. var str = message['default'] || incompleteFallbackMessage();
  18483. if (data && data.messageKey && message[data.messageKey]) {
  18484. str = message[data.messageKey];
  18485. }
  18486. return processMessage(str, data);
  18487. }
  18488. var process_message_default = processMessage;
  18489. function getCheckMessage(checkId, type2, data) {
  18490. var check = axe._audit.data.checks[checkId];
  18491. if (!check) {
  18492. throw new Error('Cannot get message for unknown check: '.concat(checkId, '.'));
  18493. }
  18494. if (!check.messages[type2]) {
  18495. throw new Error('Check "'.concat(checkId, '"" does not have a "').concat(type2, '" message.'));
  18496. }
  18497. return process_message_default(check.messages[type2], data);
  18498. }
  18499. var get_check_message_default = getCheckMessage;
  18500. function getCheckOption(check, ruleID, options) {
  18501. var ruleCheckOption = ((options.rules && options.rules[ruleID] || {}).checks || {})[check.id];
  18502. var checkOption = (options.checks || {})[check.id];
  18503. var enabled = check.enabled;
  18504. var opts = check.options;
  18505. if (checkOption) {
  18506. if (checkOption.hasOwnProperty('enabled')) {
  18507. enabled = checkOption.enabled;
  18508. }
  18509. if (checkOption.hasOwnProperty('options')) {
  18510. opts = checkOption.options;
  18511. }
  18512. }
  18513. if (ruleCheckOption) {
  18514. if (ruleCheckOption.hasOwnProperty('enabled')) {
  18515. enabled = ruleCheckOption.enabled;
  18516. }
  18517. if (ruleCheckOption.hasOwnProperty('options')) {
  18518. opts = ruleCheckOption.options;
  18519. }
  18520. }
  18521. return {
  18522. enabled: enabled,
  18523. options: opts,
  18524. absolutePaths: options.absolutePaths
  18525. };
  18526. }
  18527. var get_check_option_default = getCheckOption;
  18528. function _getEnvironmentData() {
  18529. var _win$location;
  18530. var metadata = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  18531. var win = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window;
  18532. if (metadata && _typeof(metadata) === 'object') {
  18533. return metadata;
  18534. } else if (_typeof(win) !== 'object') {
  18535. return {};
  18536. }
  18537. return {
  18538. testEngine: {
  18539. name: 'axe-core',
  18540. version: axe.version
  18541. },
  18542. testRunner: {
  18543. name: axe._audit.brand
  18544. },
  18545. testEnvironment: getTestEnvironment(win),
  18546. timestamp: new Date().toISOString(),
  18547. url: (_win$location = win.location) === null || _win$location === void 0 ? void 0 : _win$location.href
  18548. };
  18549. }
  18550. function getTestEnvironment(win) {
  18551. if (!win.navigator || _typeof(win.navigator) !== 'object') {
  18552. return {};
  18553. }
  18554. var navigator2 = win.navigator, innerHeight = win.innerHeight, innerWidth = win.innerWidth;
  18555. var _ref64 = getOrientation(win) || {}, angle = _ref64.angle, type2 = _ref64.type;
  18556. return {
  18557. userAgent: navigator2.userAgent,
  18558. windowWidth: innerWidth,
  18559. windowHeight: innerHeight,
  18560. orientationAngle: angle,
  18561. orientationType: type2
  18562. };
  18563. }
  18564. function getOrientation(_ref65) {
  18565. var screen = _ref65.screen;
  18566. return screen.orientation || screen.msOrientation || screen.mozOrientation;
  18567. }
  18568. function createFrameContext(frame, _ref66) {
  18569. var focusable = _ref66.focusable, page = _ref66.page;
  18570. return {
  18571. node: frame,
  18572. include: [],
  18573. exclude: [],
  18574. initiator: false,
  18575. focusable: focusable && frameFocusable(frame),
  18576. size: getBoundingSize(frame),
  18577. page: page
  18578. };
  18579. }
  18580. function frameFocusable(frame) {
  18581. var tabIndex = parse_tabindex_default(frame.getAttribute('tabindex'));
  18582. return tabIndex === null || tabIndex >= 0;
  18583. }
  18584. function getBoundingSize(domNode) {
  18585. var width = parseInt(domNode.getAttribute('width'), 10);
  18586. var height = parseInt(domNode.getAttribute('height'), 10);
  18587. if (isNaN(width) || isNaN(height)) {
  18588. var rect = domNode.getBoundingClientRect();
  18589. width = isNaN(width) ? rect.width : width;
  18590. height = isNaN(height) ? rect.height : height;
  18591. }
  18592. return {
  18593. width: width,
  18594. height: height
  18595. };
  18596. }
  18597. function normalizeContext(contextSpec) {
  18598. if (_isContextObject(contextSpec)) {
  18599. var msg = ' must be used inside include or exclude. It should not be on the same object.';
  18600. assert2(!_objectHasOwn(contextSpec, 'fromFrames'), 'fromFrames' + msg);
  18601. assert2(!_objectHasOwn(contextSpec, 'fromShadowDom'), 'fromShadowDom' + msg);
  18602. } else if (_isContextProp(contextSpec)) {
  18603. contextSpec = {
  18604. include: contextSpec,
  18605. exclude: []
  18606. };
  18607. } else {
  18608. return {
  18609. include: [ document ],
  18610. exclude: []
  18611. };
  18612. }
  18613. var include = normalizeContextList(contextSpec.include);
  18614. if (include.length === 0) {
  18615. include.push(document);
  18616. }
  18617. var exclude = normalizeContextList(contextSpec.exclude);
  18618. return {
  18619. include: include,
  18620. exclude: exclude
  18621. };
  18622. }
  18623. function normalizeContextList() {
  18624. var selectorList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  18625. var normalizedList = [];
  18626. if (!_isArrayLike(selectorList)) {
  18627. selectorList = [ selectorList ];
  18628. }
  18629. for (var _i25 = 0; _i25 < selectorList.length; _i25++) {
  18630. var normalizedSelector = normalizeContextSelector(selectorList[_i25]);
  18631. if (normalizedSelector) {
  18632. normalizedList.push(normalizedSelector);
  18633. }
  18634. }
  18635. return normalizedList;
  18636. }
  18637. function normalizeContextSelector(selector) {
  18638. if (selector instanceof window.Node) {
  18639. return selector;
  18640. }
  18641. if (typeof selector === 'string') {
  18642. return [ selector ];
  18643. }
  18644. if (_isLabelledFramesSelector(selector)) {
  18645. assertLabelledFrameSelector(selector);
  18646. selector = selector.fromFrames;
  18647. } else if (_isLabelledShadowDomSelector(selector)) {
  18648. selector = [ selector ];
  18649. }
  18650. return normalizeFrameSelectors(selector);
  18651. }
  18652. function normalizeFrameSelectors(frameSelectors) {
  18653. if (!Array.isArray(frameSelectors)) {
  18654. return;
  18655. }
  18656. var normalizedSelectors = [];
  18657. var _iterator11 = _createForOfIteratorHelper(frameSelectors), _step11;
  18658. try {
  18659. for (_iterator11.s(); !(_step11 = _iterator11.n()).done; ) {
  18660. var selector = _step11.value;
  18661. if (_isLabelledShadowDomSelector(selector)) {
  18662. assertLabelledShadowDomSelector(selector);
  18663. selector = selector.fromShadowDom;
  18664. }
  18665. if (typeof selector !== 'string' && !isShadowSelector(selector)) {
  18666. return;
  18667. }
  18668. normalizedSelectors.push(selector);
  18669. }
  18670. } catch (err) {
  18671. _iterator11.e(err);
  18672. } finally {
  18673. _iterator11.f();
  18674. }
  18675. return normalizedSelectors;
  18676. }
  18677. function assertLabelledFrameSelector(selector) {
  18678. assert2(Array.isArray(selector.fromFrames), 'fromFrames property must be an array');
  18679. assert2(selector.fromFrames.every(function(fromFrameSelector) {
  18680. return !_objectHasOwn(fromFrameSelector, 'fromFrames');
  18681. }), 'Invalid context; fromFrames selector must be appended, rather than nested');
  18682. assert2(!_objectHasOwn(selector, 'fromShadowDom'), 'fromFrames and fromShadowDom cannot be used on the same object');
  18683. }
  18684. function assertLabelledShadowDomSelector(selector) {
  18685. assert2(Array.isArray(selector.fromShadowDom), 'fromShadowDom property must be an array');
  18686. assert2(selector.fromShadowDom.every(function(fromShadowDomSelector) {
  18687. return !_objectHasOwn(fromShadowDomSelector, 'fromFrames');
  18688. }), 'shadow selector must be inside fromFrame instead');
  18689. assert2(selector.fromShadowDom.every(function(fromShadowDomSelector) {
  18690. return !_objectHasOwn(fromShadowDomSelector, 'fromShadowDom');
  18691. }), 'fromShadowDom selector must be appended, rather than nested');
  18692. }
  18693. function isShadowSelector(selector) {
  18694. return Array.isArray(selector) && selector.every(function(str) {
  18695. return typeof str === 'string';
  18696. });
  18697. }
  18698. function assert2(bool, str) {
  18699. assert_default(bool, 'Invalid context; '.concat(str, '\nSee: https://github.com/dequelabs/axe-core/blob/master/doc/context.md'));
  18700. }
  18701. function parseSelectorArray(context, type2) {
  18702. var result = [];
  18703. for (var _i26 = 0, l = context[type2].length; _i26 < l; _i26++) {
  18704. var item = context[type2][_i26];
  18705. if (item instanceof window.Node) {
  18706. if (item.documentElement instanceof window.Node) {
  18707. result.push(context.flatTree[0]);
  18708. } else {
  18709. result.push(get_node_from_tree_default(item));
  18710. }
  18711. } else if (item && item.length) {
  18712. if (item.length > 1) {
  18713. pushUniqueFrameSelector(context, type2, item);
  18714. } else {
  18715. var nodeList = _shadowSelectAll(item[0]);
  18716. result.push.apply(result, _toConsumableArray(nodeList.map(function(node) {
  18717. return get_node_from_tree_default(node);
  18718. })));
  18719. }
  18720. }
  18721. }
  18722. return result.filter(function(r) {
  18723. return r;
  18724. });
  18725. }
  18726. function pushUniqueFrameSelector(context, type2, selectorArray) {
  18727. context.frames = context.frames || [];
  18728. var frameSelector = selectorArray.shift();
  18729. var frames = _shadowSelectAll(frameSelector);
  18730. frames.forEach(function(frame) {
  18731. var frameContext = context.frames.find(function(result) {
  18732. return result.node === frame;
  18733. });
  18734. if (!frameContext) {
  18735. frameContext = createFrameContext(frame, context);
  18736. context.frames.push(frameContext);
  18737. }
  18738. frameContext[type2].push(selectorArray);
  18739. });
  18740. }
  18741. function Context(spec, flatTree) {
  18742. var _spec2, _spec3, _spec4, _spec5, _this5 = this;
  18743. spec = _clone(spec);
  18744. this.frames = [];
  18745. this.page = typeof ((_spec2 = spec) === null || _spec2 === void 0 ? void 0 : _spec2.page) === 'boolean' ? spec.page : void 0;
  18746. this.initiator = typeof ((_spec3 = spec) === null || _spec3 === void 0 ? void 0 : _spec3.initiator) === 'boolean' ? spec.initiator : true;
  18747. this.focusable = typeof ((_spec4 = spec) === null || _spec4 === void 0 ? void 0 : _spec4.focusable) === 'boolean' ? spec.focusable : true;
  18748. this.size = _typeof((_spec5 = spec) === null || _spec5 === void 0 ? void 0 : _spec5.size) === 'object' ? spec.size : {};
  18749. spec = normalizeContext(spec);
  18750. this.flatTree = flatTree !== null && flatTree !== void 0 ? flatTree : _getFlattenedTree(getRootNode2(spec));
  18751. this.exclude = spec.exclude;
  18752. this.include = spec.include;
  18753. this.include = parseSelectorArray(this, 'include');
  18754. this.exclude = parseSelectorArray(this, 'exclude');
  18755. _select('frame, iframe', this).forEach(function(frame) {
  18756. if (_isNodeInContext(frame, _this5)) {
  18757. pushUniqueFrame(_this5, frame.actualNode);
  18758. }
  18759. });
  18760. if (typeof this.page === 'undefined') {
  18761. this.page = isPageContext(this);
  18762. this.frames.forEach(function(frame) {
  18763. frame.page = _this5.page;
  18764. });
  18765. }
  18766. validateContext(this);
  18767. if (!Array.isArray(this.include)) {
  18768. this.include = Array.from(this.include);
  18769. }
  18770. this.include.sort(node_sorter_default);
  18771. }
  18772. function pushUniqueFrame(context, frame) {
  18773. if (!_isVisibleToScreenReaders(frame) || find_by_default(context.frames, 'node', frame)) {
  18774. return;
  18775. }
  18776. context.frames.push(createFrameContext(frame, context));
  18777. }
  18778. function isPageContext(_ref67) {
  18779. var include = _ref67.include;
  18780. return include.length === 1 && include[0].actualNode === document.documentElement;
  18781. }
  18782. function validateContext(context) {
  18783. if (context.include.length === 0 && context.frames.length === 0) {
  18784. var env = _respondable.isInFrame() ? 'frame' : 'page';
  18785. throw new Error('No elements found for include in ' + env + ' Context');
  18786. }
  18787. }
  18788. function getRootNode2(_ref68) {
  18789. var include = _ref68.include, exclude = _ref68.exclude;
  18790. var selectors = Array.from(include).concat(Array.from(exclude));
  18791. for (var _i27 = 0; _i27 < selectors.length; _i27++) {
  18792. var item = selectors[_i27];
  18793. if (item instanceof window.Element) {
  18794. return item.ownerDocument.documentElement;
  18795. }
  18796. if (item instanceof window.Document) {
  18797. return item.documentElement;
  18798. }
  18799. }
  18800. return document.documentElement;
  18801. }
  18802. function _getFrameContexts(context) {
  18803. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  18804. if (options.iframes === false) {
  18805. return [];
  18806. }
  18807. var _Context = new Context(context), frames = _Context.frames;
  18808. return frames.map(function(_ref69) {
  18809. var node = _ref69.node, frameContext = _objectWithoutProperties(_ref69, _excluded14);
  18810. frameContext.initiator = false;
  18811. var frameSelector = _getAncestry(node);
  18812. return {
  18813. frameSelector: frameSelector,
  18814. frameContext: frameContext
  18815. };
  18816. });
  18817. }
  18818. function _getRule(ruleId) {
  18819. var rule = axe._audit.rules.find(function(_ref70) {
  18820. var id = _ref70.id;
  18821. return id === ruleId;
  18822. });
  18823. if (!rule) {
  18824. throw new Error('Cannot find rule by id: '.concat(ruleId));
  18825. }
  18826. return rule;
  18827. }
  18828. function getScroll(elm) {
  18829. var buffer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  18830. var overflowX = elm.scrollWidth > elm.clientWidth + buffer;
  18831. var overflowY = elm.scrollHeight > elm.clientHeight + buffer;
  18832. if (!(overflowX || overflowY)) {
  18833. return;
  18834. }
  18835. var style = window.getComputedStyle(elm);
  18836. var scrollableX = isScrollable(style, 'overflow-x');
  18837. var scrollableY = isScrollable(style, 'overflow-y');
  18838. if (overflowX && scrollableX || overflowY && scrollableY) {
  18839. return {
  18840. elm: elm,
  18841. top: elm.scrollTop,
  18842. left: elm.scrollLeft
  18843. };
  18844. }
  18845. }
  18846. function isScrollable(style, prop) {
  18847. var overflowProp = style.getPropertyValue(prop);
  18848. return [ 'scroll', 'auto' ].includes(overflowProp);
  18849. }
  18850. var get_scroll_default = memoize_default(getScroll);
  18851. function getElmScrollRecursive(root) {
  18852. return Array.from(root.children || root.childNodes || []).reduce(function(scrolls, elm) {
  18853. var scroll = get_scroll_default(elm);
  18854. if (scroll) {
  18855. scrolls.push(scroll);
  18856. }
  18857. return scrolls.concat(getElmScrollRecursive(elm));
  18858. }, []);
  18859. }
  18860. function getScrollState() {
  18861. var win = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
  18862. var root = win.document.documentElement;
  18863. var windowScroll = [ win.pageXOffset !== void 0 ? {
  18864. elm: win,
  18865. top: win.pageYOffset,
  18866. left: win.pageXOffset
  18867. } : {
  18868. elm: root,
  18869. top: root.scrollTop,
  18870. left: root.scrollLeft
  18871. } ];
  18872. return windowScroll.concat(getElmScrollRecursive(document.body));
  18873. }
  18874. var get_scroll_state_default = getScrollState;
  18875. function _getStandards() {
  18876. return _clone(standards_default);
  18877. }
  18878. function getStyleSheetFactory(dynamicDoc) {
  18879. if (!dynamicDoc) {
  18880. throw new Error('axe.utils.getStyleSheetFactory should be invoked with an argument');
  18881. }
  18882. return function(options) {
  18883. var data = options.data, _options$isCrossOrigi = options.isCrossOrigin, isCrossOrigin = _options$isCrossOrigi === void 0 ? false : _options$isCrossOrigi, shadowId = options.shadowId, root = options.root, priority = options.priority, _options$isLink = options.isLink, isLink = _options$isLink === void 0 ? false : _options$isLink;
  18884. var style = dynamicDoc.createElement('style');
  18885. if (isLink) {
  18886. var text = dynamicDoc.createTextNode('@import "'.concat(data.href, '"'));
  18887. style.appendChild(text);
  18888. } else {
  18889. style.appendChild(dynamicDoc.createTextNode(data));
  18890. }
  18891. dynamicDoc.head.appendChild(style);
  18892. return {
  18893. sheet: style.sheet,
  18894. isCrossOrigin: isCrossOrigin,
  18895. shadowId: shadowId,
  18896. root: root,
  18897. priority: priority
  18898. };
  18899. };
  18900. }
  18901. var get_stylesheet_factory_default = getStyleSheetFactory;
  18902. var styleSheet;
  18903. function injectStyle(style) {
  18904. if (styleSheet && styleSheet.parentNode) {
  18905. if (styleSheet.styleSheet === void 0) {
  18906. styleSheet.appendChild(document.createTextNode(style));
  18907. } else {
  18908. styleSheet.styleSheet.cssText += style;
  18909. }
  18910. return styleSheet;
  18911. }
  18912. if (!style) {
  18913. return;
  18914. }
  18915. var head = document.head || document.getElementsByTagName('head')[0];
  18916. styleSheet = document.createElement('style');
  18917. styleSheet.type = 'text/css';
  18918. if (styleSheet.styleSheet === void 0) {
  18919. styleSheet.appendChild(document.createTextNode(style));
  18920. } else {
  18921. styleSheet.styleSheet.cssText = style;
  18922. }
  18923. head.appendChild(styleSheet);
  18924. return styleSheet;
  18925. }
  18926. var inject_style_default = injectStyle;
  18927. function _isArrayLike(arr) {
  18928. return !!arr && _typeof(arr) === 'object' && typeof arr.length === 'number' && arr instanceof window.Node === false;
  18929. }
  18930. function _objectHasOwn(obj, prop) {
  18931. if (!obj || _typeof(obj) !== 'object') {
  18932. return false;
  18933. }
  18934. return Object.prototype.hasOwnProperty.call(obj, prop);
  18935. }
  18936. function _isContextSpec(contextSpec) {
  18937. return _isContextObject(contextSpec) || _isContextProp(contextSpec);
  18938. }
  18939. function _isContextObject(contextSpec) {
  18940. return [ 'include', 'exclude' ].some(function(prop) {
  18941. return _objectHasOwn(contextSpec, prop) && _isContextProp(contextSpec[prop]);
  18942. });
  18943. }
  18944. function _isContextProp(contextList) {
  18945. return typeof contextList === 'string' || contextList instanceof window.Node || _isLabelledFramesSelector(contextList) || _isLabelledShadowDomSelector(contextList) || _isArrayLike(contextList);
  18946. }
  18947. function _isLabelledFramesSelector(selector) {
  18948. return _objectHasOwn(selector, 'fromFrames');
  18949. }
  18950. function _isLabelledShadowDomSelector(selector) {
  18951. return _objectHasOwn(selector, 'fromShadowDom');
  18952. }
  18953. function isHidden(el, recursed) {
  18954. var node = get_node_from_tree_default(el);
  18955. if (el.nodeType === 9) {
  18956. return false;
  18957. }
  18958. if (el.nodeType === 11) {
  18959. el = el.host;
  18960. }
  18961. if (node && node._isHidden !== null) {
  18962. return node._isHidden;
  18963. }
  18964. var style = window.getComputedStyle(el, null);
  18965. if (!style || !el.parentNode || style.getPropertyValue('display') === 'none' || !recursed && style.getPropertyValue('visibility') === 'hidden' || el.getAttribute('aria-hidden') === 'true') {
  18966. return true;
  18967. }
  18968. var parent = el.assignedSlot ? el.assignedSlot : el.parentNode;
  18969. var hidden = isHidden(parent, true);
  18970. if (node) {
  18971. node._isHidden = hidden;
  18972. }
  18973. return hidden;
  18974. }
  18975. var is_hidden_default = isHidden;
  18976. function isHtmlElement(node) {
  18977. var _node$props$nodeName, _node$props;
  18978. var nodeName2 = (_node$props$nodeName = (_node$props = node.props) === null || _node$props === void 0 ? void 0 : _node$props.nodeName) !== null && _node$props$nodeName !== void 0 ? _node$props$nodeName : node.nodeName.toLowerCase();
  18979. if (node.namespaceURI === 'http://www.w3.org/2000/svg') {
  18980. return false;
  18981. }
  18982. return !!standards_default.htmlElms[nodeName2];
  18983. }
  18984. var is_html_element_default = isHtmlElement;
  18985. function _isNodeInContext(node, _ref71) {
  18986. var _ref71$include = _ref71.include, include = _ref71$include === void 0 ? [] : _ref71$include, _ref71$exclude = _ref71.exclude, exclude = _ref71$exclude === void 0 ? [] : _ref71$exclude;
  18987. var filterInclude = include.filter(function(candidate) {
  18988. return _contains(candidate, node);
  18989. });
  18990. if (filterInclude.length === 0) {
  18991. return false;
  18992. }
  18993. var filterExcluded = exclude.filter(function(candidate) {
  18994. return _contains(candidate, node);
  18995. });
  18996. if (filterExcluded.length === 0) {
  18997. return true;
  18998. }
  18999. var deepestInclude = getDeepest(filterInclude);
  19000. var deepestExclude = getDeepest(filterExcluded);
  19001. return _contains(deepestExclude, deepestInclude);
  19002. }
  19003. function getDeepest(collection) {
  19004. var deepest;
  19005. var _iterator12 = _createForOfIteratorHelper(collection), _step12;
  19006. try {
  19007. for (_iterator12.s(); !(_step12 = _iterator12.n()).done; ) {
  19008. var node = _step12.value;
  19009. if (!deepest || !_contains(node, deepest)) {
  19010. deepest = node;
  19011. }
  19012. }
  19013. } catch (err) {
  19014. _iterator12.e(err);
  19015. } finally {
  19016. _iterator12.f();
  19017. }
  19018. return deepest;
  19019. }
  19020. function _matchAncestry(ancestryA, ancestryB) {
  19021. if (ancestryA.length !== ancestryB.length) {
  19022. return false;
  19023. }
  19024. return ancestryA.every(function(selectorA, ancestorIndex) {
  19025. var selectorB = ancestryB[ancestorIndex];
  19026. if (!Array.isArray(selectorA)) {
  19027. return selectorA === selectorB;
  19028. }
  19029. if (selectorA.length !== selectorB.length) {
  19030. return false;
  19031. }
  19032. return selectorA.every(function(str, selectorIndex) {
  19033. return selectorB[selectorIndex] === str;
  19034. });
  19035. });
  19036. }
  19037. function nodeSorter(nodeA, nodeB) {
  19038. nodeA = nodeA.actualNode || nodeA;
  19039. nodeB = nodeB.actualNode || nodeB;
  19040. if (nodeA === nodeB) {
  19041. return 0;
  19042. }
  19043. if (nodeA.compareDocumentPosition(nodeB) & 4) {
  19044. return -1;
  19045. } else {
  19046. return 1;
  19047. }
  19048. }
  19049. var node_sorter_default = nodeSorter;
  19050. function _nodeLookup(node) {
  19051. if (node instanceof abstract_virtual_node_default) {
  19052. return {
  19053. vNode: node,
  19054. domNode: node.actualNode
  19055. };
  19056. }
  19057. return {
  19058. vNode: get_node_from_tree_default(node),
  19059. domNode: node
  19060. };
  19061. }
  19062. function parseSameOriginStylesheet(sheet, options, priority, importedUrls) {
  19063. var isCrossOrigin = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  19064. var rules = Array.from(sheet.cssRules);
  19065. if (!rules) {
  19066. return Promise.resolve();
  19067. }
  19068. var cssImportRules = rules.filter(function(r) {
  19069. return r.type === 3;
  19070. });
  19071. if (!cssImportRules.length) {
  19072. return Promise.resolve({
  19073. isCrossOrigin: isCrossOrigin,
  19074. priority: priority,
  19075. root: options.rootNode,
  19076. shadowId: options.shadowId,
  19077. sheet: sheet
  19078. });
  19079. }
  19080. var cssImportUrlsNotAlreadyImported = cssImportRules.filter(function(rule) {
  19081. return rule.href;
  19082. }).map(function(rule) {
  19083. return rule.href;
  19084. }).filter(function(url) {
  19085. return !importedUrls.includes(url);
  19086. });
  19087. var promises = cssImportUrlsNotAlreadyImported.map(function(importUrl, cssRuleIndex) {
  19088. var newPriority = [].concat(_toConsumableArray(priority), [ cssRuleIndex ]);
  19089. var isCrossOriginRequest = /^https?:\/\/|^\/\//i.test(importUrl);
  19090. return parse_crossorigin_stylesheet_default(importUrl, options, newPriority, importedUrls, isCrossOriginRequest);
  19091. });
  19092. var nonImportCSSRules = rules.filter(function(r) {
  19093. return r.type !== 3;
  19094. });
  19095. if (!nonImportCSSRules.length) {
  19096. return Promise.all(promises);
  19097. }
  19098. promises.push(Promise.resolve(options.convertDataToStylesheet({
  19099. data: nonImportCSSRules.map(function(rule) {
  19100. return rule.cssText;
  19101. }).join(),
  19102. isCrossOrigin: isCrossOrigin,
  19103. priority: priority,
  19104. root: options.rootNode,
  19105. shadowId: options.shadowId
  19106. })));
  19107. return Promise.all(promises);
  19108. }
  19109. var parse_sameorigin_stylesheet_default = parseSameOriginStylesheet;
  19110. function parseStylesheet(sheet, options, priority, importedUrls) {
  19111. var isCrossOrigin = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  19112. var isSameOrigin = isSameOriginStylesheet(sheet);
  19113. if (isSameOrigin) {
  19114. return parse_sameorigin_stylesheet_default(sheet, options, priority, importedUrls, isCrossOrigin);
  19115. }
  19116. return parse_crossorigin_stylesheet_default(sheet.href, options, priority, importedUrls, true);
  19117. }
  19118. function isSameOriginStylesheet(sheet) {
  19119. try {
  19120. var rules = sheet.cssRules;
  19121. if (!rules && sheet.href) {
  19122. return false;
  19123. }
  19124. return true;
  19125. } catch (e) {
  19126. return false;
  19127. }
  19128. }
  19129. var parse_stylesheet_default = parseStylesheet;
  19130. function parseCrossOriginStylesheet(url, options, priority, importedUrls, isCrossOrigin) {
  19131. importedUrls.push(url);
  19132. return new Promise(function(resolve, reject) {
  19133. var request = new window.XMLHttpRequest();
  19134. request.open('GET', url);
  19135. request.timeout = constants_default.preload.timeout;
  19136. request.addEventListener('error', reject);
  19137. request.addEventListener('timeout', reject);
  19138. request.addEventListener('loadend', function(event) {
  19139. if (event.loaded && request.responseText) {
  19140. return resolve(request.responseText);
  19141. }
  19142. reject(request.responseText);
  19143. });
  19144. request.send();
  19145. }).then(function(data) {
  19146. var result = options.convertDataToStylesheet({
  19147. data: data,
  19148. isCrossOrigin: isCrossOrigin,
  19149. priority: priority,
  19150. root: options.rootNode,
  19151. shadowId: options.shadowId
  19152. });
  19153. return parse_stylesheet_default(result.sheet, options, priority, importedUrls, result.isCrossOrigin);
  19154. });
  19155. }
  19156. var parse_crossorigin_stylesheet_default = parseCrossOriginStylesheet;
  19157. function parseTabindex(value) {
  19158. if (typeof value !== 'string') {
  19159. return null;
  19160. }
  19161. var match = value.trim().match(/^([-+]?\d+)/);
  19162. if (match) {
  19163. return Number(match[1]);
  19164. }
  19165. return null;
  19166. }
  19167. var parse_tabindex_default = parseTabindex;
  19168. var performanceTimer = function() {
  19169. function now() {
  19170. if (window.performance && window.performance) {
  19171. return window.performance.now();
  19172. }
  19173. }
  19174. var originalTime = null;
  19175. var lastRecordedTime = now();
  19176. return {
  19177. start: function start() {
  19178. this.mark('mark_axe_start');
  19179. },
  19180. end: function end() {
  19181. this.mark('mark_axe_end');
  19182. this.measure('axe', 'mark_axe_start', 'mark_axe_end');
  19183. this.logMeasures('axe');
  19184. },
  19185. auditStart: function auditStart() {
  19186. this.mark('mark_audit_start');
  19187. },
  19188. auditEnd: function auditEnd() {
  19189. this.mark('mark_audit_end');
  19190. this.measure('audit_start_to_end', 'mark_audit_start', 'mark_audit_end');
  19191. this.logMeasures();
  19192. },
  19193. mark: function mark(markName) {
  19194. if (window.performance && window.performance.mark !== void 0) {
  19195. window.performance.mark(markName);
  19196. }
  19197. },
  19198. measure: function measure(measureName, startMark, endMark) {
  19199. if (window.performance && window.performance.measure !== void 0) {
  19200. window.performance.measure(measureName, startMark, endMark);
  19201. }
  19202. },
  19203. logMeasures: function logMeasures(measureName) {
  19204. function logMeasure(req) {
  19205. log_default('Measure ' + req.name + ' took ' + req.duration + 'ms');
  19206. }
  19207. if (window.performance && window.performance.getEntriesByType !== void 0) {
  19208. var axeStart = window.performance.getEntriesByName('mark_axe_start')[0];
  19209. var measures = window.performance.getEntriesByType('measure').filter(function(measure) {
  19210. return measure.startTime >= axeStart.startTime;
  19211. });
  19212. for (var _i28 = 0; _i28 < measures.length; ++_i28) {
  19213. var req = measures[_i28];
  19214. if (req.name === measureName) {
  19215. logMeasure(req);
  19216. return;
  19217. }
  19218. logMeasure(req);
  19219. }
  19220. }
  19221. },
  19222. timeElapsed: function timeElapsed() {
  19223. return now() - lastRecordedTime;
  19224. },
  19225. reset: function reset() {
  19226. if (!originalTime) {
  19227. originalTime = now();
  19228. }
  19229. lastRecordedTime = now();
  19230. }
  19231. };
  19232. }();
  19233. var performance_timer_default = performanceTimer;
  19234. function _pollyfillElementsFromPoint() {
  19235. if (document.elementsFromPoint) {
  19236. return document.elementsFromPoint;
  19237. }
  19238. if (document.msElementsFromPoint) {
  19239. return document.msElementsFromPoint;
  19240. }
  19241. var usePointer = function() {
  19242. var element = document.createElement('x');
  19243. element.style.cssText = 'pointer-events:auto';
  19244. return element.style.pointerEvents === 'auto';
  19245. }();
  19246. var cssProp = usePointer ? 'pointer-events' : 'visibility';
  19247. var cssDisableVal = usePointer ? 'none' : 'hidden';
  19248. var style = document.createElement('style');
  19249. style.innerHTML = usePointer ? '* { pointer-events: all }' : '* { visibility: visible }';
  19250. return function(x, y) {
  19251. var current, i, d2;
  19252. var elements = [];
  19253. var previousPointerEvents = [];
  19254. document.head.appendChild(style);
  19255. while ((current = document.elementFromPoint(x, y)) && elements.indexOf(current) === -1) {
  19256. elements.push(current);
  19257. previousPointerEvents.push({
  19258. value: current.style.getPropertyValue(cssProp),
  19259. priority: current.style.getPropertyPriority(cssProp)
  19260. });
  19261. current.style.setProperty(cssProp, cssDisableVal, 'important');
  19262. }
  19263. if (elements.indexOf(document.documentElement) < elements.length - 1) {
  19264. elements.splice(elements.indexOf(document.documentElement), 1);
  19265. elements.push(document.documentElement);
  19266. }
  19267. for (i = previousPointerEvents.length; !!(d2 = previousPointerEvents[--i]); ) {
  19268. elements[i].style.setProperty(cssProp, d2.value ? d2.value : '', d2.priority);
  19269. }
  19270. document.head.removeChild(style);
  19271. return elements;
  19272. };
  19273. }
  19274. if (typeof window.addEventListener === 'function') {
  19275. document.elementsFromPoint = _pollyfillElementsFromPoint();
  19276. }
  19277. function uniqueArray(arr1, arr2) {
  19278. return arr1.concat(arr2).filter(function(elem, pos, arr) {
  19279. return arr.indexOf(elem) === pos;
  19280. });
  19281. }
  19282. var unique_array_default = uniqueArray;
  19283. function createLocalVariables(vNodes, anyLevel, thisLevel, parentShadowId, recycledLocalVariable) {
  19284. var retVal = recycledLocalVariable || {};
  19285. retVal.vNodes = vNodes;
  19286. retVal.vNodesIndex = 0;
  19287. retVal.anyLevel = anyLevel;
  19288. retVal.thisLevel = thisLevel;
  19289. retVal.parentShadowId = parentShadowId;
  19290. return retVal;
  19291. }
  19292. function matchExpressions(domTree, expressions, filter) {
  19293. var recycledLocalVariables = cache_default.get('qsa.recycledLocalVariables', function() {
  19294. return [];
  19295. });
  19296. var stack = [];
  19297. var vNodes = Array.isArray(domTree) ? domTree : [ domTree ];
  19298. var currentLevel = createLocalVariables(vNodes, expressions, null, domTree[0].shadowId, recycledLocalVariables.pop());
  19299. var result = [];
  19300. while (currentLevel.vNodesIndex < currentLevel.vNodes.length) {
  19301. var _currentLevel$anyLeve, _currentLevel$thisLev;
  19302. var vNode = currentLevel.vNodes[currentLevel.vNodesIndex++];
  19303. var childOnly = null;
  19304. var childAny = null;
  19305. var combinedLength = (((_currentLevel$anyLeve = currentLevel.anyLevel) === null || _currentLevel$anyLeve === void 0 ? void 0 : _currentLevel$anyLeve.length) || 0) + (((_currentLevel$thisLev = currentLevel.thisLevel) === null || _currentLevel$thisLev === void 0 ? void 0 : _currentLevel$thisLev.length) || 0);
  19306. var added = false;
  19307. for (var _i29 = 0; _i29 < combinedLength; _i29++) {
  19308. var _currentLevel$anyLeve2, _currentLevel$anyLeve3, _currentLevel$anyLeve4;
  19309. var exp = _i29 < (((_currentLevel$anyLeve2 = currentLevel.anyLevel) === null || _currentLevel$anyLeve2 === void 0 ? void 0 : _currentLevel$anyLeve2.length) || 0) ? currentLevel.anyLevel[_i29] : currentLevel.thisLevel[_i29 - (((_currentLevel$anyLeve3 = currentLevel.anyLevel) === null || _currentLevel$anyLeve3 === void 0 ? void 0 : _currentLevel$anyLeve3.length) || 0)];
  19310. if ((!exp[0].id || vNode.shadowId === currentLevel.parentShadowId) && _matchesExpression(vNode, exp[0])) {
  19311. if (exp.length === 1) {
  19312. if (!added && (!filter || filter(vNode))) {
  19313. result.push(vNode);
  19314. added = true;
  19315. }
  19316. } else {
  19317. var rest = exp.slice(1);
  19318. if ([ ' ', '>' ].includes(rest[0].combinator) === false) {
  19319. throw new Error('axe.utils.querySelectorAll does not support the combinator: ' + exp[1].combinator);
  19320. }
  19321. if (rest[0].combinator === '>') {
  19322. (childOnly = childOnly || []).push(rest);
  19323. } else {
  19324. (childAny = childAny || []).push(rest);
  19325. }
  19326. }
  19327. }
  19328. if ((!exp[0].id || vNode.shadowId === currentLevel.parentShadowId) && (_currentLevel$anyLeve4 = currentLevel.anyLevel) !== null && _currentLevel$anyLeve4 !== void 0 && _currentLevel$anyLeve4.includes(exp)) {
  19329. (childAny = childAny || []).push(exp);
  19330. }
  19331. }
  19332. if (vNode.children && vNode.children.length) {
  19333. stack.push(currentLevel);
  19334. currentLevel = createLocalVariables(vNode.children, childAny, childOnly, vNode.shadowId, recycledLocalVariables.pop());
  19335. }
  19336. while (currentLevel.vNodesIndex === currentLevel.vNodes.length && stack.length) {
  19337. recycledLocalVariables.push(currentLevel);
  19338. currentLevel = stack.pop();
  19339. }
  19340. }
  19341. return result;
  19342. }
  19343. function querySelectorAllFilter(domTree, selector, filter) {
  19344. domTree = Array.isArray(domTree) ? domTree : [ domTree ];
  19345. var expressions = _convertSelector(selector);
  19346. var nodes = getNodesMatchingExpression(domTree, expressions, filter);
  19347. if (nodes) {
  19348. return nodes;
  19349. }
  19350. return matchExpressions(domTree, expressions, filter);
  19351. }
  19352. var query_selector_all_filter_default = querySelectorAllFilter;
  19353. function preloadCssom(_ref72) {
  19354. var _ref72$treeRoot = _ref72.treeRoot, treeRoot = _ref72$treeRoot === void 0 ? axe._tree[0] : _ref72$treeRoot;
  19355. var rootNodes = getAllRootNodesInTree(treeRoot);
  19356. if (!rootNodes.length) {
  19357. return Promise.resolve();
  19358. }
  19359. var dynamicDoc = document.implementation.createHTMLDocument('Dynamic document for loading cssom');
  19360. var convertDataToStylesheet = get_stylesheet_factory_default(dynamicDoc);
  19361. return getCssomForAllRootNodes(rootNodes, convertDataToStylesheet).then(function(assets) {
  19362. return flattenAssets(assets);
  19363. });
  19364. }
  19365. var preload_cssom_default = preloadCssom;
  19366. function getAllRootNodesInTree(tree) {
  19367. var ids = [];
  19368. var rootNodes = query_selector_all_filter_default(tree, '*', function(node) {
  19369. if (ids.includes(node.shadowId)) {
  19370. return false;
  19371. }
  19372. ids.push(node.shadowId);
  19373. return true;
  19374. }).map(function(node) {
  19375. return {
  19376. shadowId: node.shadowId,
  19377. rootNode: get_root_node_default(node.actualNode)
  19378. };
  19379. });
  19380. return unique_array_default(rootNodes, []);
  19381. }
  19382. function getCssomForAllRootNodes(rootNodes, convertDataToStylesheet) {
  19383. var promises = [];
  19384. rootNodes.forEach(function(_ref73, index) {
  19385. var rootNode = _ref73.rootNode, shadowId = _ref73.shadowId;
  19386. var sheets = getStylesheetsOfRootNode(rootNode, shadowId, convertDataToStylesheet);
  19387. if (!sheets) {
  19388. return Promise.all(promises);
  19389. }
  19390. var rootIndex = index + 1;
  19391. var parseOptions = {
  19392. rootNode: rootNode,
  19393. shadowId: shadowId,
  19394. convertDataToStylesheet: convertDataToStylesheet,
  19395. rootIndex: rootIndex
  19396. };
  19397. var importedUrls = [];
  19398. var p2 = Promise.all(sheets.map(function(sheet, sheetIndex) {
  19399. var priority = [ rootIndex, sheetIndex ];
  19400. return parse_stylesheet_default(sheet, parseOptions, priority, importedUrls);
  19401. }));
  19402. promises.push(p2);
  19403. });
  19404. return Promise.all(promises);
  19405. }
  19406. function flattenAssets(assets) {
  19407. return assets.reduce(function(acc, val) {
  19408. return Array.isArray(val) ? acc.concat(flattenAssets(val)) : acc.concat(val);
  19409. }, []);
  19410. }
  19411. function getStylesheetsOfRootNode(rootNode, shadowId, convertDataToStylesheet) {
  19412. var sheets;
  19413. if (rootNode.nodeType === 11 && shadowId) {
  19414. sheets = getStylesheetsFromDocumentFragment(rootNode, convertDataToStylesheet);
  19415. } else {
  19416. sheets = getStylesheetsFromDocument(rootNode);
  19417. }
  19418. return filterStylesheetsWithSameHref(sheets);
  19419. }
  19420. function getStylesheetsFromDocumentFragment(rootNode, convertDataToStylesheet) {
  19421. return Array.from(rootNode.children).filter(filerStyleAndLinkAttributesInDocumentFragment).reduce(function(out, node) {
  19422. var nodeName2 = node.nodeName.toUpperCase();
  19423. var data = nodeName2 === 'STYLE' ? node.textContent : node;
  19424. var isLink = nodeName2 === 'LINK';
  19425. var stylesheet = convertDataToStylesheet({
  19426. data: data,
  19427. isLink: isLink,
  19428. root: rootNode
  19429. });
  19430. if (stylesheet.sheet) {
  19431. out.push(stylesheet.sheet);
  19432. }
  19433. return out;
  19434. }, []);
  19435. }
  19436. function getStylesheetsFromDocument(rootNode) {
  19437. return Array.from(rootNode.styleSheets).filter(function(sheet) {
  19438. if (!sheet.media) {
  19439. return false;
  19440. }
  19441. return filterMediaIsPrint(sheet.media.mediaText);
  19442. });
  19443. }
  19444. function filerStyleAndLinkAttributesInDocumentFragment(node) {
  19445. var nodeName2 = node.nodeName.toUpperCase();
  19446. var linkHref = node.getAttribute('href');
  19447. var linkRel = node.getAttribute('rel');
  19448. var isLink = nodeName2 === 'LINK' && linkHref && linkRel && node.rel.toUpperCase().includes('STYLESHEET');
  19449. var isStyle = nodeName2 === 'STYLE';
  19450. return isStyle || isLink && filterMediaIsPrint(node.media);
  19451. }
  19452. function filterMediaIsPrint(media) {
  19453. if (!media) {
  19454. return true;
  19455. }
  19456. return !media.toUpperCase().includes('PRINT');
  19457. }
  19458. function filterStylesheetsWithSameHref(sheets) {
  19459. var hrefs = [];
  19460. return sheets.filter(function(sheet) {
  19461. if (!sheet.href) {
  19462. return true;
  19463. }
  19464. if (hrefs.includes(sheet.href)) {
  19465. return false;
  19466. }
  19467. hrefs.push(sheet.href);
  19468. return true;
  19469. });
  19470. }
  19471. function preloadMedia(_ref74) {
  19472. var _ref74$treeRoot = _ref74.treeRoot, treeRoot = _ref74$treeRoot === void 0 ? axe._tree[0] : _ref74$treeRoot;
  19473. var mediaVirtualNodes = query_selector_all_filter_default(treeRoot, 'video[autoplay], audio[autoplay]', function(_ref75) {
  19474. var actualNode = _ref75.actualNode;
  19475. if (actualNode.preload === 'none' && actualNode.readyState === 0 && actualNode.networkState !== actualNode.NETWORK_LOADING) {
  19476. return false;
  19477. }
  19478. if (actualNode.hasAttribute('paused') || actualNode.hasAttribute('muted')) {
  19479. return false;
  19480. }
  19481. if (actualNode.hasAttribute('src')) {
  19482. return !!actualNode.getAttribute('src');
  19483. }
  19484. var sourceWithSrc = Array.from(actualNode.getElementsByTagName('source')).filter(function(source) {
  19485. return !!source.getAttribute('src');
  19486. });
  19487. if (sourceWithSrc.length <= 0) {
  19488. return false;
  19489. }
  19490. return true;
  19491. });
  19492. return Promise.all(mediaVirtualNodes.map(function(_ref76) {
  19493. var actualNode = _ref76.actualNode;
  19494. return isMediaElementReady(actualNode);
  19495. }));
  19496. }
  19497. var preload_media_default = preloadMedia;
  19498. function isMediaElementReady(elm) {
  19499. return new Promise(function(resolve) {
  19500. if (elm.readyState > 0) {
  19501. resolve(elm);
  19502. }
  19503. function onMediaReady() {
  19504. elm.removeEventListener('loadedmetadata', onMediaReady);
  19505. resolve(elm);
  19506. }
  19507. elm.addEventListener('loadedmetadata', onMediaReady);
  19508. });
  19509. }
  19510. function _preload(options) {
  19511. var preloadFunctionsMap = {
  19512. cssom: preload_cssom_default,
  19513. media: preload_media_default
  19514. };
  19515. if (!_shouldPreload(options)) {
  19516. return Promise.resolve();
  19517. }
  19518. return new Promise(function(resolve, reject) {
  19519. var _getPreloadConfig2 = _getPreloadConfig(options), assets = _getPreloadConfig2.assets, timeout = _getPreloadConfig2.timeout;
  19520. var preloadTimeout = setTimeout(function() {
  19521. return reject(new Error('Preload assets timed out.'));
  19522. }, timeout);
  19523. Promise.all(assets.map(function(asset) {
  19524. return preloadFunctionsMap[asset](options).then(function(results) {
  19525. return _defineProperty({}, asset, results);
  19526. });
  19527. })).then(function(results) {
  19528. var preloadAssets = results.reduce(function(out, result) {
  19529. return _extends({}, out, result);
  19530. }, {});
  19531. clearTimeout(preloadTimeout);
  19532. resolve(preloadAssets);
  19533. })['catch'](function(err2) {
  19534. clearTimeout(preloadTimeout);
  19535. reject(err2);
  19536. });
  19537. });
  19538. }
  19539. function isValidPreloadObject(preloadObj) {
  19540. return _typeof(preloadObj) === 'object' && Array.isArray(preloadObj.assets);
  19541. }
  19542. function _shouldPreload(options) {
  19543. if (!options || options.preload === void 0 || options.preload === null) {
  19544. return true;
  19545. }
  19546. if (typeof options.preload === 'boolean') {
  19547. return options.preload;
  19548. }
  19549. return isValidPreloadObject(options.preload);
  19550. }
  19551. function _getPreloadConfig(options) {
  19552. var _constants_default$pr = constants_default.preload, assets = _constants_default$pr.assets, timeout = _constants_default$pr.timeout;
  19553. var config = {
  19554. assets: assets,
  19555. timeout: timeout
  19556. };
  19557. if (!options.preload) {
  19558. return config;
  19559. }
  19560. if (typeof options.preload === 'boolean') {
  19561. return config;
  19562. }
  19563. var areRequestedAssetsValid = options.preload.assets.every(function(a2) {
  19564. return assets.includes(a2.toLowerCase());
  19565. });
  19566. if (!areRequestedAssetsValid) {
  19567. throw new Error('Requested assets, not supported. Supported assets are: '.concat(assets.join(', '), '.'));
  19568. }
  19569. config.assets = unique_array_default(options.preload.assets.map(function(a2) {
  19570. return a2.toLowerCase();
  19571. }), []);
  19572. if (options.preload.timeout && typeof options.preload.timeout === 'number' && !isNaN(options.preload.timeout)) {
  19573. config.timeout = options.preload.timeout;
  19574. }
  19575. return config;
  19576. }
  19577. function _publishMetaData(ruleResult) {
  19578. var checksData = axe._audit.data.checks || {};
  19579. var rulesData = axe._audit.data.rules || {};
  19580. var rule = find_by_default(axe._audit.rules, 'id', ruleResult.id) || {};
  19581. ruleResult.tags = _clone(rule.tags || []);
  19582. var shouldBeTrue = extender(checksData, true, rule);
  19583. var shouldBeFalse = extender(checksData, false, rule);
  19584. ruleResult.nodes.forEach(function(detail) {
  19585. detail.any.forEach(shouldBeTrue);
  19586. detail.all.forEach(shouldBeTrue);
  19587. detail.none.forEach(shouldBeFalse);
  19588. });
  19589. extend_meta_data_default(ruleResult, _clone(rulesData[ruleResult.id] || {}));
  19590. }
  19591. function getIncompleteReason(checkData, messages) {
  19592. function getDefaultMsg(message) {
  19593. if (message.incomplete && message.incomplete['default']) {
  19594. return message.incomplete['default'];
  19595. } else {
  19596. return incompleteFallbackMessage();
  19597. }
  19598. }
  19599. if (checkData && checkData.missingData) {
  19600. try {
  19601. var msg = messages.incomplete[checkData.missingData[0].reason];
  19602. if (!msg) {
  19603. throw new Error();
  19604. }
  19605. return msg;
  19606. } catch (_unused5) {
  19607. if (typeof checkData.missingData === 'string') {
  19608. return messages.incomplete[checkData.missingData];
  19609. } else {
  19610. return getDefaultMsg(messages);
  19611. }
  19612. }
  19613. } else if (checkData && checkData.messageKey) {
  19614. return messages.incomplete[checkData.messageKey];
  19615. } else {
  19616. return getDefaultMsg(messages);
  19617. }
  19618. }
  19619. function extender(checksData, shouldBeTrue, rule) {
  19620. return function(check) {
  19621. var sourceData = checksData[check.id] || {};
  19622. var messages = sourceData.messages || {};
  19623. var data = Object.assign({}, sourceData);
  19624. delete data.messages;
  19625. if (!rule.reviewOnFail && check.result === void 0) {
  19626. if (_typeof(messages.incomplete) === 'object' && !Array.isArray(check.data)) {
  19627. data.message = getIncompleteReason(check.data, messages);
  19628. }
  19629. if (!data.message) {
  19630. data.message = messages.incomplete;
  19631. }
  19632. } else {
  19633. data.message = check.result === shouldBeTrue ? messages.pass : messages.fail;
  19634. }
  19635. if (typeof data.message !== 'function') {
  19636. data.message = process_message_default(data.message, check.data);
  19637. }
  19638. extend_meta_data_default(check, data);
  19639. };
  19640. }
  19641. function querySelectorAll(domTree, selector) {
  19642. return query_selector_all_filter_default(domTree, selector);
  19643. }
  19644. var query_selector_all_default = querySelectorAll;
  19645. function matchTags(rule, runOnly) {
  19646. var include, exclude;
  19647. var defaultExclude = axe._audit && axe._audit.tagExclude ? axe._audit.tagExclude : [];
  19648. if (runOnly.hasOwnProperty('include') || runOnly.hasOwnProperty('exclude')) {
  19649. include = runOnly.include || [];
  19650. include = Array.isArray(include) ? include : [ include ];
  19651. exclude = runOnly.exclude || [];
  19652. exclude = Array.isArray(exclude) ? exclude : [ exclude ];
  19653. exclude = exclude.concat(defaultExclude.filter(function(tag) {
  19654. return include.indexOf(tag) === -1;
  19655. }));
  19656. } else {
  19657. include = Array.isArray(runOnly) ? runOnly : [ runOnly ];
  19658. exclude = defaultExclude.filter(function(tag) {
  19659. return include.indexOf(tag) === -1;
  19660. });
  19661. }
  19662. var matching = include.some(function(tag) {
  19663. return rule.tags.indexOf(tag) !== -1;
  19664. });
  19665. if (matching || include.length === 0 && rule.enabled !== false) {
  19666. return exclude.every(function(tag) {
  19667. return rule.tags.indexOf(tag) === -1;
  19668. });
  19669. } else {
  19670. return false;
  19671. }
  19672. }
  19673. function ruleShouldRun(rule, context, options) {
  19674. var runOnly = options.runOnly || {};
  19675. var ruleOptions = (options.rules || {})[rule.id];
  19676. if (rule.pageLevel && !context.page) {
  19677. return false;
  19678. } else if (runOnly.type === 'rule') {
  19679. return runOnly.values.indexOf(rule.id) !== -1;
  19680. } else if (ruleOptions && typeof ruleOptions.enabled === 'boolean') {
  19681. return ruleOptions.enabled;
  19682. } else if (runOnly.type === 'tag' && runOnly.values) {
  19683. return matchTags(rule, runOnly.values);
  19684. } else {
  19685. return matchTags(rule, []);
  19686. }
  19687. }
  19688. var rule_should_run_default = ruleShouldRun;
  19689. function _filterHtmlAttrs(element, filterAttrs) {
  19690. if (!filterAttrs) {
  19691. return element;
  19692. }
  19693. var node = element.cloneNode(false);
  19694. var attributes2 = get_node_attributes_default(node);
  19695. if (node.nodeType === 1) {
  19696. var outerHTML = node.outerHTML;
  19697. node = cache_default.get(outerHTML, function() {
  19698. return setNodeAttributes(node, attributes2, element, filterAttrs);
  19699. });
  19700. } else {
  19701. node = setNodeAttributes(node, attributes2, element, filterAttrs);
  19702. }
  19703. Array.from(element.childNodes).forEach(function(child) {
  19704. node.appendChild(_filterHtmlAttrs(child, filterAttrs));
  19705. });
  19706. return node;
  19707. }
  19708. function setNodeAttributes(node, attributes2, element, filterAttrs) {
  19709. if (!attributes2) {
  19710. return node;
  19711. }
  19712. node = document.createElement(node.nodeName);
  19713. Array.from(attributes2).forEach(function(attr) {
  19714. if (!attributeMatches(element, attr.name, filterAttrs)) {
  19715. node.setAttribute(attr.name, attr.value);
  19716. }
  19717. });
  19718. return node;
  19719. }
  19720. function attributeMatches(node, attrName, filterAttrs) {
  19721. if (typeof filterAttrs[attrName] === 'undefined') {
  19722. return false;
  19723. }
  19724. if (filterAttrs[attrName] === true) {
  19725. return true;
  19726. }
  19727. return element_matches_default(node, filterAttrs[attrName]);
  19728. }
  19729. function _select(selector, context) {
  19730. var result = [];
  19731. var candidate;
  19732. if (axe._selectCache) {
  19733. for (var j = 0, l = axe._selectCache.length; j < l; j++) {
  19734. var item = axe._selectCache[j];
  19735. if (item.selector === selector) {
  19736. return item.result;
  19737. }
  19738. }
  19739. }
  19740. var outerIncludes = getOuterIncludes(context.include);
  19741. var isInContext = getContextFilter(context);
  19742. for (var _i30 = 0; _i30 < outerIncludes.length; _i30++) {
  19743. candidate = outerIncludes[_i30];
  19744. var nodes = query_selector_all_filter_default(candidate, selector, isInContext);
  19745. result = mergeArrayUniques(result, nodes);
  19746. }
  19747. if (axe._selectCache) {
  19748. axe._selectCache.push({
  19749. selector: selector,
  19750. result: result
  19751. });
  19752. }
  19753. return result;
  19754. }
  19755. function getOuterIncludes(includes) {
  19756. return includes.reduce(function(res, el) {
  19757. if (!res.length || !_contains(res[res.length - 1], el)) {
  19758. res.push(el);
  19759. }
  19760. return res;
  19761. }, []);
  19762. }
  19763. function getContextFilter(context) {
  19764. if (!context.exclude || context.exclude.length === 0) {
  19765. return null;
  19766. }
  19767. return function(node) {
  19768. return _isNodeInContext(node, context);
  19769. };
  19770. }
  19771. function mergeArrayUniques(arr1, arr2) {
  19772. if (arr1.length === 0) {
  19773. return arr2;
  19774. }
  19775. if (arr1.length < arr2.length) {
  19776. var temp = arr1;
  19777. arr1 = arr2;
  19778. arr2 = temp;
  19779. }
  19780. for (var _i31 = 0, l = arr2.length; _i31 < l; _i31++) {
  19781. if (!arr1.includes(arr2[_i31])) {
  19782. arr1.push(arr2[_i31]);
  19783. }
  19784. }
  19785. return arr1;
  19786. }
  19787. function setScroll(elm, top, left) {
  19788. if (elm === window) {
  19789. return elm.scroll(left, top);
  19790. } else {
  19791. elm.scrollTop = top;
  19792. elm.scrollLeft = left;
  19793. }
  19794. }
  19795. function setScrollState(scrollState) {
  19796. scrollState.forEach(function(_ref78) {
  19797. var elm = _ref78.elm, top = _ref78.top, left = _ref78.left;
  19798. return setScroll(elm, top, left);
  19799. });
  19800. }
  19801. var set_scroll_state_default = setScrollState;
  19802. function _shadowSelect(selectors) {
  19803. var selectorArr = Array.isArray(selectors) ? _toConsumableArray(selectors) : [ selectors ];
  19804. return selectRecursive(selectorArr, document);
  19805. }
  19806. function selectRecursive(selectors, doc) {
  19807. var selectorStr = selectors.shift();
  19808. var elm = selectorStr ? doc.querySelector(selectorStr) : null;
  19809. if (selectors.length === 0) {
  19810. return elm;
  19811. }
  19812. if (!(elm !== null && elm !== void 0 && elm.shadowRoot)) {
  19813. return null;
  19814. }
  19815. return selectRecursive(selectors, elm.shadowRoot);
  19816. }
  19817. function _shadowSelectAll(selectors) {
  19818. var doc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
  19819. var selectorArr = Array.isArray(selectors) ? _toConsumableArray(selectors) : [ selectors ];
  19820. if (selectors.length === 0) {
  19821. return [];
  19822. }
  19823. return selectAllRecursive(selectorArr, doc);
  19824. }
  19825. function selectAllRecursive(_ref79, doc) {
  19826. var _ref80 = _toArray(_ref79), selectorStr = _ref80[0], restSelector = _ref80.slice(1);
  19827. var elms = doc.querySelectorAll(selectorStr);
  19828. if (restSelector.length === 0) {
  19829. return Array.from(elms);
  19830. }
  19831. var selected = [];
  19832. var _iterator13 = _createForOfIteratorHelper(elms), _step13;
  19833. try {
  19834. for (_iterator13.s(); !(_step13 = _iterator13.n()).done; ) {
  19835. var elm = _step13.value;
  19836. if (elm !== null && elm !== void 0 && elm.shadowRoot) {
  19837. selected.push.apply(selected, _toConsumableArray(selectAllRecursive(restSelector, elm.shadowRoot)));
  19838. }
  19839. }
  19840. } catch (err) {
  19841. _iterator13.e(err);
  19842. } finally {
  19843. _iterator13.f();
  19844. }
  19845. return selected;
  19846. }
  19847. function validInputTypes() {
  19848. return [ 'hidden', 'text', 'search', 'tel', 'url', 'email', 'password', 'date', 'month', 'week', 'time', 'datetime-local', 'number', 'range', 'color', 'checkbox', 'radio', 'file', 'submit', 'image', 'reset', 'button' ];
  19849. }
  19850. var valid_input_type_default = validInputTypes;
  19851. var langs = [ , [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, 1, 1, , 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, , , , , , 1, 1, 1, 1, , , 1, 1, 1, , 1, , 1, , 1, 1 ], [ 1, 1, 1, , 1, 1, , 1, 1, 1, , 1, , , 1, 1, 1, , , 1, 1, 1, , , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , , , , 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1 ], [ , 1, , , , , , 1, , 1, , , , , 1, , 1, , , , 1, 1, , 1, , , 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, 1, 1, 1, , , 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, 1, , , 1, , , , , 1, 1, 1, , 1, , 1, , 1, , , , , , 1 ], [ 1, , 1, 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, , 1, , 1, , , , , 1, , 1, 1, 1, 1, 1, , , , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, , 1, , 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , 1, , , 1, , 1, , , , 1, 1, 1, , , , , , , , , , , 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1 ], [ 1, 1, 1, 1, 1, , , 1, , , 1, , , 1, 1, 1, , , , , 1, , , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1 ], [ , 1, , 1, 1, 1, , 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, , , 1, 1, , , , , , 1, 1 ], [ 1, 1, 1, , , , , 1, , , , 1, 1, , 1, , , , , , 1, , , , , 1 ], [ , 1, , , 1, , , 1, , , , , , 1 ], [ , 1, , 1, , , , 1, , , , 1 ], [ 1, , 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , , 1, , , 1, , 1, 1, , 1, , 1, , , , , 1, , 1 ], [ , 1, , , , 1, , , 1, 1, , 1, , 1, 1, 1, 1, , 1, 1, , , 1, , , 1 ], [ , 1, 1, , , , , , 1, , , , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], [ , 1, , 1, 1, 1, , , 1, 1, 1, 1, 1, 1, , 1, , , , , 1, 1, , 1, , 1 ], [ , 1, , 1, , 1, , 1, , 1, , 1, 1, 1, 1, 1, , , 1, 1, 1 ], [ , 1, 1, 1, , , , 1, 1, 1, , 1, 1, , , 1, 1, , 1, 1, 1, 1, , 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, , 1, 1, 1, , 1, , , , , 1, 1, 1, , , 1, , 1, , , 1, 1 ], [ , , , , 1, , , , , , , , , , , , , , , , , 1 ], [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, , 1, 1, 1, , 1, 1, , , , 1, 1, 1, 1, 1, , , 1, 1, 1, , , , , 1 ], [ 1, 1, 1, 1, , , , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , , , , , , 1, , , , , , , 1 ], [ , 1, 1, , 1, 1, , 1, , , , , , , , , , , , , 1 ], , [ 1, 1, 1, , , , , , , , , , , , , 1 ], [ , , , , , , , , 1, , , 1, , , 1, 1, , , , , 1 ] ], [ , [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ , , , 1, , , , , , , , , , , , , , , 1 ], [ , 1, , , 1, 1, , 1, , 1, 1, , , , 1, 1, , , 1, 1, , , , 1 ], [ 1, , , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, , , 1, , , , 1 ], , [ , 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, , 1, 1, , , 1, 1, 1, 1, , 1, 1, , 1 ], [ , 1, , , 1, , , 1, , 1, , , 1, 1, 1, 1, , , 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, , , 1, , , 1, , 1 ], [ , 1, , , , , , , , , , 1, 1, , , , , , 1, 1, , , , , 1 ], [ , , , , , , , 1, , , , 1, , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, , , , 1, 1, 1, 1, 1, , , 1, 1, , 1, 1, 1, 1, 1 ], [ , 1, , , 1, 1, , 1, , 1, 1, 1, , , 1, 1, , , 1, , 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, , 1, 1, , 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ , , , , , , , , , , , , , , , , 1 ], , [ , 1, 1, 1, 1, 1, , 1, 1, 1, , , 1, , 1, 1, , 1, 1, 1, 1, 1, , 1, , 1 ], [ , , 1, , , 1, , , 1, 1, , , 1, , 1, 1, , 1 ], [ , 1, 1, , 1, , , , 1, 1, , 1, , 1, 1, 1, 1, , 1, 1, 1, 1, , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ 1, 1 ], [ , 1, , , , , , , , , , 1, 1, , , , , , 1, 1, , 1, , 1, , 1, 1 ], , [ , 1, 1, , 1, , , 1, , 1, , , , 1, 1, 1, , , , , , 1, , , , 1 ], [ 1, 1, , , 1, 1, , 1, , , , , 1, , 1 ] ], [ , [ , 1 ], [ , , , 1, , , , 1, , , , 1, , , , 1, , , 1, , , 1 ], [ , , , , , , , , , , , , , , , , , , 1, 1, , , , , , 1 ], , [ 1, , , , , 1 ], [ , 1, , , , 1, , , , 1 ], [ , 1, , , , , , , , , , , 1, , , 1, , , , , , , , , 1, 1 ], [ , , , , , , , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , , , 1, , , , 1, , 1 ], [ , 1 ], [ , 1, , 1, , 1, , 1, , 1, , 1, 1, 1, , 1, 1, , 1, , , , , , , 1 ], [ 1, , , , , 1, , , 1, 1, , 1, , 1, , 1, 1, , , , , 1, , , 1 ], [ , 1, 1, , , 1, , 1, , 1, , 1, , 1, 1, 1, 1, , , 1, , 1, , 1, 1, 1 ], [ 1, 1, 1, 1, 1, , 1, , 1, , , , 1, 1, 1, 1, , 1, 1, , , 1, 1, 1, 1 ], [ 1, , , , , , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , 1 ], , [ , 1, , , , , , 1, 1, 1, , 1, , , , 1, , , 1, 1, 1, , , 1 ], [ 1, , , , , 1, , 1, 1, 1, , 1, 1, 1, 1, 1, , 1, , 1, , 1, , , 1, 1 ], [ 1, , 1, 1, , , , , 1, , , , , , 1, 1, , , 1, 1, 1, 1, , , 1, , 1 ], [ 1, , , , , , , , , , , , , , , , , 1 ], [ , , , , , 1, , , 1, , , , , , 1 ], [ , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , , 1 ], [ , 1, , , , , , , , , , , , , , 1 ], [ , 1, , , , 1 ] ], [ , [ 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, , 1, 1, , , 1, 1, 1 ], [ , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , 1 ], , [ , , , , , , , , , , , , , , , , , , 1 ], [ 1, , , , , , , , , 1, , , , 1 ], [ , , , , , , , , , , , , , , , , , , 1 ], , [ 1, 1, , , , 1, 1, , , , , , 1, , , , 1, , 1, , 1, 1, , 1 ], [ 1 ], [ , , , , , , , , , , , 1, , , , , , , , , , , 1 ], [ , 1, , , , , , , 1, 1, , , 1, , 1, , , , 1, , , , , , , 1 ], [ , , , , , , , , , , , , , , , , 1, , , , , 1 ], [ , , 1, , , , , 1, , 1 ], [ 1, , , , 1, , , , , 1, , , , 1, 1, , , , 1, 1, , , , , 1 ], [ , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , 1 ], [ 1, , , 1, 1, , , , , , , 1, , 1, , 1, 1, 1, 1, 1, 1 ], [ , , , , , 1, , , , , , , 1, , , , , , , 1 ], , [ , , 1, 1, 1, 1, 1, , 1, 1, 1, , , 1, 1, , , 1, 1, , 1, 1, 1, , , 1 ], [ , , , , , , , , , , , , , , , , , , 1 ], [ , 1, , , , 1 ], , [ 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , , , 1, 1, 1, 1, , , , , , 1, , 1, , , , 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , , 1 ], [ , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, , 1, , , 1, 1, 1, 1, 1 ], [ , , , , , , , , , , , 1, , , , , , , , , 1, , , , 1 ], [ , 1, 1, , 1, 1, , 1, , , , 1, 1, , 1, 1, , , 1, , 1, 1, , 1 ], [ , 1, , 1, , 1, , , 1, , , 1, 1, , 1, 1, , , 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, , , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , , , , , , , , , 1, , 1, , 1, 1, , , , 1, , , 1 ], [ , 1, , , 1, 1, , , , , , , , , 1, 1, 1, , , , , 1 ], [ 1, , , 1, 1, , , , 1, 1, 1, 1, 1, , , 1, , , 1, , , 1, , 1, , 1 ], [ , 1, 1, , 1, 1, , 1, 1, , , , 1, 1, 1, , , 1, 1, , , 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, , 1, , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, , , , 1, , , , , , , , , 1 ], [ , 1, , , , , , , , 1, , , , , 1, , , , 1, , , 1 ], [ , 1, 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , , , 1, , 1, , , , , 1, 1, 1, 1, 1, , , 1, , , , 1 ], [ , 1, , , , , , , , 1, , , , , , , , , , , , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ 1, 1, , 1, , 1, 1, , , , 1, , 1, 1, 1, 1, 1, , 1, 1, , , , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, , 1, 1, , , 1, 1, , , , 1, , 1, 1, , 1, 1 ], [ , , , , , , , , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, , 1, 1, 1, 1, , 1, , , 1, 1, 1, 1, , , 1, , , , , , , 1 ], [ , 1, , , , , , , , 1, , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1 ], [ , 1, 1, , , , , , , , , , , , 1, 1, , , , , , 1 ], [ , 1, , , , , , , 1 ], [ , , , , , , , , , , , , , , 1, , , , , 1, , , , , , 1 ], [ 1, 1, , , 1, , , 1, 1, 1, , , , 1 ], , [ , , , , , , , , , , , , , 1, , , , , , , , , , 1 ], [ , , , , , , , , , 1, , , , , , , , , 1, , , , , , , 1 ], [ 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1, , , 1, , 1, , , 1, 1 ], [ , , , , , , , , , 1 ], [ , 1, , , , 1, , , , , , 1, , , 1, , , , , 1 ], [ , 1, 1, , 1, 1, , , , , , , , , , , , , , , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , 1, 1, , 1, 1, 1, 1, , , , 1, 1, , , , 1, , 1 ], [ 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, , 1, 1, , 1, 1 ], [ , , , , , , , , , , , , , , , 1, , , , 1 ], , [ 1, 1, , 1, , 1, , , , , , 1, , 1, , 1, 1, , 1, , 1, 1, , 1, 1, , 1 ], [ , , 1, , , , , , 1, , , , 1, , 1, , , , , 1 ], [ 1, , , , , , , , , 1, , , , , , 1, , , , 1, , 1, , , 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , 1, , 1, , , , , , 1, , , 1, , , , , , , , 1 ], [ , 1, , 1, , , , , , , , , , , , 1 ], , [ 1, 1, , , , , , , , , , , , , , , , , , , , , , 1, 1 ], [ 1 ] ], [ , [ 1, , , , , , , , , 1, , , , , 1, , 1, , 1 ], [ , 1, 1, , 1, 1, , 1, 1, 1, , , 1, 1, 1, , , , 1, , , 1, , , , 1 ], [ , 1, , , , , , , 1, , , , 1, , , , , , 1 ], [ 1, 1, 1, 1, 1, 1, , , , 1, , , , , , , , , 1, 1, 1, 1 ], [ 1 ], [ , 1, 1, , , 1, 1, , , , , 1, , 1, , , , , , , , 1, , , , 1 ], [ 1, , 1, , , 1, , 1, , , , , 1, 1, 1, 1, , , , 1, , , , 1 ], [ , , 1, , , , , , , 1, , , , , , , 1, , , , , , , 1 ], [ 1, , , , , , , , , , , , , , 1, , , , 1 ], [ , , , 1, , 1, , , , , 1, , , , 1, 1, , , , 1 ], [ 1, , , , , 1, , , , 1, , 1, 1, , , 1, 1, , 1, 1, 1, , 1, 1, 1, , 1 ], [ , 1, 1, , , , , 1, , 1, , 1, 1, 1, , 1, 1, , , 1, , 1, 1, 1 ], [ , 1, , , , 1, , , , 1, , , 1, , 1, 1, , , 1, 1, , , , , , 1 ], [ 1, , 1, 1, , 1, , 1, 1, , 1, , 1, 1, 1, 1, 1, , , 1, 1, , , , , , 1 ], [ 1, , , , , , , , , , , , , , , , , , 1, , , 1, , 1 ], [ , , , , , , , , , 1, , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , , , 1, , 1 ], [ , 1, , , , 1, , , 1, 1, , 1, , , 1, 1, , , 1, , , 1, , , 1, 1 ], [ 1, 1, , 1, 1, 1, , 1, 1, 1, , 1, , 1, 1, 1, , , 1, , 1, 1 ], [ 1, , 1, 1, 1, 1, , , , 1, , 1, 1, 1, , 1, , , 1, 1, 1, , 1, 1, 1, 1, 1 ], [ 1, , , , , , , , , , , , , 1 ], [ , , 1, , , , , , , , , , , , , , , , , , , , 1 ], [ 1, , , , , , , , , , , 1, , 1, , 1, , , , 1 ], [ , , , 1, , , , , , , , , 1 ], [ , 1, , , , , , , , , , , , , , 1, , , , , , , , , 1 ], [ , , , , , , , , 1, 1, , , , , , , , , 1, , , , , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , , 1, 1, 1 ], [ , , , , , 1, , , , 1, 1, 1, , , 1, 1, , , 1, , 1, 1, , 1 ], [ , , , , , , , , , , , , , , , , , , , 1, 1 ], [ , 1, , , , , , 1, , , , , , , , , , , , , 1 ], [ , , 1, , , 1, , 1, 1, 1, , 1, 1, , 1, , , , 1, , 1, 1 ], , [ , , 1, , , 1, , , , , , 1, , , , 1 ], [ , , , , , , , , , 1, , , , , , , , , , 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, , , 1, 1, , 1, , 1, , , 1, 1, 1, , , 1 ], [ , , , , , 1, , , , , , , , , , , , , 1 ], [ , 1, , , , , , , , , , , , 1, , 1, 1, , 1, , , 1 ], [ , , , , , 1, , , , , , , , , , , , , , 1 ], [ , 1, 1, 1, 1, , , , , 1, , , 1, , 1, , , , 1, 1, , , , 1, 1 ], [ , 1, , , 1, , , 1, , 1, 1, , 1, , , , , , , 1 ], [ , , 1, , 1, , , 1, , , , , , , , , , , 1, 1, , , , 1 ], [ , 1, , , , , , , , , , , , , , , , , 1, , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, , , , , , , , , , , , , , , , 1, , 1, 1 ], [ , , , , , , , , , , , , 1 ], , [ , 1, 1, 1, 1, , , , 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, , 1 ], [ 1, , , , 1, , , , , , , , , , 1 ], [ 1, , , , , , , , , 1 ], , [ , 1, , , , 1, , , , , , , , , , , , , , , , , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, , , , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , 1, 1, 1, 1, , 1, , , , 1, 1, , , 1, 1, , 1 ], [ , 1, 1, , 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , , , , , , , , , , 1 ], [ 1, 1, 1, , , , , 1, 1, 1, , 1, 1, 1, 1, , , 1, 1, , 1, 1, , , , , 1 ], [ , 1, , , , , , , 1, 1, , , 1, 1, 1, , 1, , , 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, , , , 1, , , , 1, , , 1, , , , 1, , , , , , , 1, 1 ], [ , 1, 1, 1, 1, 1, , , 1, 1, 1, , 1, 1, 1, 1, , , 1, 1, 1, 1, , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, , 1, , , 1, 1, 1, 1, , 1, 1, 1, 1, , , , 1, , 1, , 1, , , 1 ], [ 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , 1, , , , , , , , , 1, 1, , , , , , , , , 1 ], , [ , 1, , 1, , 1, , 1, , 1, , 1, 1, 1, 1, 1, , , 1, , 1, , 1, , , , 1 ], [ , 1, , , 1, 1, , 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1, 1, , 1, , , 1 ], [ 1, , , 1, , , , 1, 1, 1, , , , , 1, 1, , , , 1, , 1 ], [ 1, 1, , 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ 1, 1, , , , , , , , 1, , 1, , , , , , , , 1, , 1 ], [ , 1, , , , 1, , 1, 1, , , , 1, 1, , 1, , , , 1, 1, 1, , 1 ], , [ , 1, , , , , , 1, , , , , , , 1 ], [ , , , , , , , , 1, , , , 1, , 1, , , , , , , , , , , , 1 ] ], [ , [ , 1, 1, , 1, 1, 1, 1, , 1, 1, 1, , 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], [ , 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, , 1 ], [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , 1, , , , , , , , 1, , , , , , 1, , , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, , , , 1, 1, 1, , 1, 1, 1, 1, , , 1, 1, 1, 1, , , 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ 1, 1, , 1, , 1, , 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, , , 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, , , , , 1, 1, 1, , , 1, , 1, 1, , , , 1, , 1, , , 1, 1 ], [ , , , , , , , 1, , , , 1, 1, 1, 1, 1, , 1, , , , , , , , 1 ], [ 1, 1, 1, 1, , 1, 1, 1, , 1, , 1, 1, 1, 1, , 1, , 1, , 1, 1, , , 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , , 1, 1, , 1, , 1, 1, 1, , 1, , 1, 1, , 1, 1, , 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , , , , , , , 1, , , , , 1, , 1 ], [ , 1, 1, 1, , 1, , 1, , 1, , , , 1, , 1, , , 1, , , , , , 1, 1 ], [ , 1, , , 1, 1, , 1, , 1, , 1, 1, 1, 1, 1, , 1, 1, , , 1, , , 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, , , , , 1, , 1, , 1, , , , , , 1, , 1, , , , 1, 1 ] ], [ , [ , 1, , 1, , , , , , , , , , , , , , , 1, , , , 1 ], [ , , , , , , , , , 1, , 1, 1, 1, , 1, , , 1, , 1, 1 ], [ 1, 1, , , , , , , 1, , , , , , , 1, , , , , , 1 ], [ , 1, , , , , , , , , , 1, , , , , , , , , 1, 1 ], , [ , , , , , , , , , , , , , , , 1, , , , 1, , 1 ], [ , , 1, 1, , 1, , 1, , , , , , , , 1, , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , , 1, 1 ], [ , 1, , , , , , , , , , , , , 1 ], [ 1, , 1, 1, , , , 1, , , , , , , , , 1, , , 1, , , 1, 1 ], [ , 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, , 1, 1, , 1 ], [ , 1, , , 1, 1, , , , , , 1, , 1, , 1, , , 1, , 1, 1 ], [ 1, 1, 1, 1, , 1, , 1, , 1, , 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ , 1, 1, , , 1, , 1, , 1, 1, 1, , , 1, 1, 1, , 1, 1, 1, 1, , 1, 1 ], [ , , , , 1, , , 1, , , , , , , 1, , , , 1, 1 ], [ , 1, , , , , , , , , , 1, , 1, , 1, , , , , 1, , , , , 1 ], , [ 1, 1, , 1, , 1, , 1, 1, , , , , , 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, , , , , , 1, , , , , , 1, 1, , , , 1, 1, , , 1 ], [ , 1, 1, , 1, 1, , , , 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, , , 1, , , , 1, , , , 1, 1 ], [ , , , , 1 ], [ , , , , , , , , , 1, , , 1 ], , [ , , 1, , 1, , , , , , , , , 1, , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , 1, 1, , 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, , , , , 1 ], [ , 1, , 1, , , , , , 1, , , , , 1, 1, , , , , 1, 1 ], [ , 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, , , 1, , 1, 1, 1 ], [ , 1, , , , 1, , , , , , , 1 ], [ , 1, , , 1, , , 1, , 1, , 1, 1, , 1, , , , , 1, , 1, , , , 1, 1 ], [ , 1, , , 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, 1, , , , 1, 1, , , , , , 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1 ], [ , 1, , , , 1, , , , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , 1, , , , , , , , 1, , , , , , , , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, , 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1 ], [ 1, 1, , , , , , , 1, 1, , , , , 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, , 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1 ], , [ , 1, 1, , , , , 1, , 1, , , , 1, 1, 1, , , 1, , , , , 1 ], [ , , , , , , , , , , , , , 1 ], [ , , , , , 1, , , , , , , , 1, 1, , , , , 1, , 1, , , 1, 1 ], [ , , , , , , , , , , , , , , 1 ] ], [ , [ , 1 ], , , , , , , , , , , , , , , , , , , , [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, , , 1, 1, 1, 1, 1 ], [ , 1, , 1, , 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, , , 1, , , , 1, , 1, 1 ], [ , 1, , 1, , 1, , , 1, , , , , 1, , , , , , 1, 1 ], [ , 1, , 1, , , , , 1, , , , 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ , 1, , , , , , , , , , , , , , , 1 ] ], [ , [ , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , 1, , , , , , , , , 1, 1, , , , 1 ], [ , , , , , , 1 ], [ , , 1 ], [ , 1, 1, , , 1, , 1, , 1, 1, , 1, 1, 1, , , , 1, 1, 1, , , , , 1 ], , [ , 1, , , , 1, , , , , , 1, , , 1, , , , 1, 1, , 1 ], [ , , , , , , , 1, , , , , , , , , 1 ], [ , 1, , , , 1, 1, , , , , , 1, 1, 1, , , , 1, , 1, 1 ], [ , , , , , , , 1, , 1, , , , , , , , , , 1 ], [ , 1, 1, , , , , , 1, 1, , , , 1, , , , , , , 1, , , 1 ], , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , , 1, , , 1, , , , , 1, , 1, , 1, , 1, , , , , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , , , , 1, 1, , 1, 1, , 1, , , 1, , 1 ], [ , , , , , , , , , , , , , , 1, , , , , , 1 ], , [ , , , , , , , , , 1, , , , , , 1, , , , , 1 ], [ , , 1, , , , , , , 1, , , 1, 1 ], [ , , , 1, , , , , 1, , , , , 1, , , , , , 1, , , , 1 ], [ 1, , 1, 1, , 1, 1, 1, 1, 1, , 1, , , , 1, 1, 1, , , 1, 1, , , , 1, 1 ], , [ 1, 1, , , , , , , , , , 1, , 1, , 1, , , 1 ], [ , , , , 1, , , , , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , 1, , , , , 1, , 1 ], [ , , , , , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , , 1, , , 1, , , , , , , , 1, , , , , , 1, , , , 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, 1, , 1, , , , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , , 1, 1, 1, 1, , 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ 1, 1, , , , , , , 1, , 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], [ 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ 1, 1, 1, 1, , 1, , 1, , 1, 1, 1, 1, 1, , , , 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, , , , , , 1, , 1, , , , , 1, 1, , , , , 1 ], [ 1, , 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , 1, 1, , 1, , 1, , , , 1, 1, 1, 1, 1, , , 1, 1, , 1, , 1 ], [ , 1, 1, 1, 1, , , , , 1, , 1, 1, 1, 1, 1, , , 1, 1, , , , 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, , , , , 1, , 1, , 1, , , 1, , , 1, 1, , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , , , , , , , 1, , , , , 1, 1, , , 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , , 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , , , 1, , 1, 1, , 1, 1, 1, 1, 1, , , 1, , 1, , 1 ], [ 1, 1, 1, , 1, 1, 1, 1, , , , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , , 1, , , , , , , , , , 1, 1, 1, 1, 1, 1, 1, , 1, 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , 1, 1, , , , , , 1, 1, 1, 1, 1, , , , 1, 1, 1, , 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1 ], [ , 1, 1, 1, , 1, , 1, 1, 1, 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, , , 1, 1 ], [ 1, 1, , , , 1, , , 1, 1, 1, , 1, , 1, , 1, , 1, 1, 1, 1, 1, , 1, , 1 ], [ , 1, , , , , , , 1, , 1, , 1, 1, 1, 1, , , , , , , , , 1 ] ], [ , [ , , , , , , , , , , , , , 1, 1, , , , 1 ], [ , 1, , , , , , , , 1, , , 1, , , , , , 1, , , 1, , , , 1 ], , [ , 1, , , , 1, , 1, , 1, 1, , 1, 1, , , , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , 1 ], [ 1, 1, 1, , , 1, , , , , , , , , 1, 1, , , , , , , , , , 1 ], [ , 1, , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , 1, , , 1 ], [ , , , , , , , , , 1 ], [ 1, 1, , , , , , 1, 1, 1, , 1, 1, , , , 1, 1, , 1, , 1, 1, 1, , 1 ], [ , 1, 1, 1, , 1, 1, , , 1, , 1, 1, 1, 1, , , , , , , 1, , 1 ], [ , 1, 1, 1, 1, , , 1, , 1, , , , 1, 1, 1, 1, , 1, 1, , 1 ], [ , 1, , , 1, 1, , 1, , , , 1, , 1, 1, , 1, , 1, , , 1, , , 1, , 1 ], [ , , , , , , , , , , , 1 ], [ , , , , , , , , , 1, , , , , , , , , , , , , 1 ], , [ 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , , , , 1, 1, , 1, , , , , 1, , , 1, , 1 ], [ , 1, , , , 1, , , 1, , , , , , , , 1, , 1, , , 1 ], [ , , , , , , , , , , , , , 1, 1, , , , 1, , , 1 ], [ , , , , , 1, , , 1, , , , 1 ], [ , 1 ], , [ , 1 ], [ 1, , , , , , , , , , , , , , 1, , , , , 1 ] ], [ , [ , 1, , , , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, , 1, 1, , , 1 ], [ , , 1, , , , , , , , , 1 ], , , [ 1, , , 1, 1, , , , , , , , 1, 1, , 1, 1, , 1 ], , [ , , , , , , , , , , , , , , , , , , 1, , 1 ], , [ 1, , , 1, 1, , 1, 1, , , , , 1, , 1, , , , , 1, 1, , 1 ], , [ , 1, , , , , , , , 1, 1, 1, 1, 1, , 1, 1, , , , 1, 1 ], [ , , , , , , , , , , , , , , , , 1, , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , , , , , , , , , , , 1, , 1, , , 1 ], [ 1, , , , , , , , , , , , , , , , , , 1, , 1 ], , , [ , 1, , , , , , , , , , , , , , 1, , , , 1, 1 ], [ , , , , , , , , , 1, , , 1, , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , 1, 1, , , , , , 1 ], , [ , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , , 1, 1, , 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, , , , , , , , 1 ], [ , , , , 1, , , 1, , , 1, 1, , , , , , , , , , 1, , , , 1 ], [ , 1, , 1, 1, , , 1, 1, 1, , , , 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ , , , , , , , 1 ], [ , 1, 1, , , , , 1, , 1, , , , , , 1, , , , , , 1, , 1, , 1 ], [ , 1, , , , , , 1, , , , 1, , , , , , , , , , 1 ], [ , , 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, , 1, 1, 1, 1, , 1 ], [ , 1, , , , , , , , 1 ], [ , 1, 1, , 1, , , , , , , , 1, , , , , , 1, , , 1, , 1, , 1 ], [ , 1, , 1, , 1, , 1, 1, 1, , 1, 1, 1, , 1, , , 1, 1, , 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , , 1, 1, , , , 1, 1, 1, , , , 1, 1, , , 1, 1 ], [ , , 1, 1, 1, 1, , 1, , 1, , 1, , 1, 1, 1, 1, , , , , 1, , 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, , 1, 1, 1, , , 1, 1, , , , 1, , 1 ], [ , , , 1 ], , [ , 1, 1, , 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, , , , , , 1, , 1, , 1, , , , , , , 1, 1, , 1, 1 ], [ , , , , , , 1, , 1, 1, , 1, , 1, , , , , , , , , , 1 ], [ , 1, 1, , 1, , , , 1, , , , 1, 1, 1, , , , 1, , 1, 1, 1, , 1, 1 ], , [ , 1, 1, , , , , , , , , , , , , 1, , , 1, , , , , 1 ], [ , 1, , , , , , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, , , , , , , 1, , , , 1, , , , , 1, , , , , , , 1 ] ], [ , [ , 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, , 1, , 1, 1, , , 1, 1, 1, 1, , 1, , , , , 1, 1, 1 ], [ , , 1, 1, , 1, , 1, 1, , , , 1, 1, 1, 1, , , 1, , 1, 1, 1, 1, , 1 ], [ , 1, , 1, , , , , , , , 1, , 1, , 1, , , , , , , , , , 1 ], [ , , 1, , 1, , , 1, , , , , 1, 1, , , 1, , 1, 1, 1, 1 ], [ , 1 ], [ , 1, 1, , 1, , 1, 1, , 1, , , 1, 1, 1, , , , 1, , , 1, , 1 ], [ 1, 1, , 1, 1, 1, , , , , , , , , , , , , 1, , 1, 1, 1 ], [ , 1, 1, , , , , , , 1, , , 1, , 1, , 1, , 1, 1, , , 1, , , 1 ], [ , , 1, , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, , 1, , , , , 1, 1, 1, , , 1, , 1, , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, , , 1, 1, 1, , 1, , 1, 1, 1, , , 1, 1, 1, 1, , , , 1, 1 ], [ , , , 1, 1, , , 1, , 1, , 1, , 1, 1, 1, 1, , 1, , , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, , 1, 1, , 1, , 1, , , , 1, 1, , , 1, 1, , 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, , , 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, , 1, , , 1, , , 1, , 1, 1, 1, 1, 1, , 1, , 1, 1 ], [ , , , , , 1, , , , 1, , , , , 1, 1, , , , 1 ], [ , 1, , 1, 1, 1, , 1, , , 1, 1, 1, , , 1, , , 1, , 1, , , 1 ], [ , , 1, , , , , , , , , 1, , 1, , , , , 1, , 1 ], [ , 1, 1, , , , , , , , 1, 1, 1, , , , , , , , 1, , , , , 1 ], [ , , , , , , , , 1, , , , , 1, , , 1 ] ], [ , [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, , , , , , , , , 1, 1 ], [ , , , , , , , , 1, , , , 1, , 1, , 1 ], [ , 1, , , 1, 1, , 1, , , , 1, , , , , , , , 1 ], [ , 1, , 1, , 1, , , , 1, 1, , 1, , 1, , , , 1, 1, 1, 1, 1, , , 1 ], , [ , 1, , , , , , , , 1, , , 1, 1, , , 1, , 1, 1, , 1, , 1 ], [ , 1, , , 1, , , , , , , , 1, , , , , , , 1 ], [ 1, 1, , , , , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], , [ , 1, , , , , , 1, , 1, , 1, 1, 1, 1, 1, , , 1, , 1, 1, , , , 1 ], [ , 1, 1, , , 1, , 1, , 1, , , 1, 1, 1, 1, , , 1, , , 1, , , , 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, , 1 ], [ , 1, , , 1, 1, , 1, 1, , , 1, 1, , 1, 1, , 1, , 1, , 1 ], [ 1, , 1, , , , , 1, , 1, , 1, 1, 1, 1, , , , , 1, 1, , , , 1, 1 ], [ , 1, 1, , , , , 1, 1, , , 1, , 1, 1, 1, 1, , , , , , , , , , 1 ], , [ , 1, 1, , , 1, , , , 1, , 1, 1, 1, 1, 1, , , , 1, , , , 1, , 1 ], [ , , , 1, 1, , , 1, , , , , 1, , 1, 1, 1, , 1, 1, , , , , , 1 ], [ , 1, , , , , , , , , , , 1, , , , 1, , , , , , , 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, , 1, 1, 1, 1 ], [ , 1, , , , , , , , , , , , , , , , , , , 1 ], [ , 1, , , , , , 1, , , , , 1, , 1, , , 1, 1, , 1, 1, , 1 ], [ , 1, , , , , , 1, , , , , 1, 1, , , , , , , , 1, , , , 1 ], [ , , , , , , , , , , , , , , , , , , 1, , , 1, , , , , 1 ], [ , , , , , , , 1, , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, , 1, , , , , , , 1, , , , , , , , 1, , , 1 ], [ , 1, , , , , , , 1 ], [ , , , , , , , , , , 1 ], [ , 1, , , , , , 1, 1, , , , , , 1 ], , [ , 1, 1, , , , , , 1, , , , , 1, 1, , , , 1 ], [ 1, , 1, , 1, , , , , 1, , , , , 1, , , , , , , , , 1, 1 ], [ , 1, 1, , , , , , , , , 1, 1, 1, 1, , , , 1, , , , , 1, , , 1 ], , [ , 1, 1, , 1, , , 1, 1, , , 1, , , 1, 1, 1, , 1, , 1, 1, 1, , , , 1 ], [ , , , , , 1, , , , , 1, , , 1, 1, , , 1, , 1, , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , 1, 1, , 1, , , , 1, , , , , , , , 1 ], [ , , , 1, , , , , 1, , , , , 1, , 1, , 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , , , 1 ], [ , 1, , , , , , 1, , , , , , , 1, 1, 1, , , 1 ], [ , 1, , , , , , , , , , 1, 1, 1, , , , , 1, , , 1 ], [ , , , , , 1, , 1, , , , , 1, 1, 1, , 1, 1, , 1, 1, 1, , , 1, 1 ], [ 1, 1, , , , , , , 1, , , , , 1, 1, , , , , , , , , , , 1 ], , [ , 1 ], [ , , , , , , , , , , , , , , , , , , , , , , , , 1 ], [ , , 1, , , , , 1, , , 1, , , , 1, , 1 ], [ , 1, , , , , , , , , 1 ] ] ];
  19852. function isValidLang(lang) {
  19853. var array = langs;
  19854. while (lang.length < 3) {
  19855. lang += '`';
  19856. }
  19857. for (var _i32 = 0; _i32 <= lang.length - 1; _i32++) {
  19858. var index = lang.charCodeAt(_i32) - 96;
  19859. array = array[index];
  19860. if (!array) {
  19861. return false;
  19862. }
  19863. }
  19864. return true;
  19865. }
  19866. function _validLangs(langArray) {
  19867. langArray = Array.isArray(langArray) ? langArray : langs;
  19868. var codes = [];
  19869. langArray.forEach(function(lang, index) {
  19870. var _char3 = String.fromCharCode(index + 96).replace('`', '');
  19871. if (Array.isArray(lang)) {
  19872. codes = codes.concat(_validLangs(lang).map(function(newLang) {
  19873. return _char3 + newLang;
  19874. }));
  19875. } else {
  19876. codes.push(_char3);
  19877. }
  19878. });
  19879. return codes;
  19880. }
  19881. var valid_langs_default = isValidLang;
  19882. var SerialVirtualNode = function(_abstract_virtual_nod2) {
  19883. function SerialVirtualNode(serialNode) {
  19884. var _this6;
  19885. _classCallCheck(this, SerialVirtualNode);
  19886. _this6 = _callSuper(this, SerialVirtualNode);
  19887. _this6._props = normaliseProps(serialNode);
  19888. _this6._attrs = normaliseAttrs(serialNode);
  19889. return _this6;
  19890. }
  19891. _inherits(SerialVirtualNode, _abstract_virtual_nod2);
  19892. return _createClass(SerialVirtualNode, [ {
  19893. key: 'props',
  19894. get: function get() {
  19895. return this._props;
  19896. }
  19897. }, {
  19898. key: 'attr',
  19899. value: function attr(attrName) {
  19900. var _this$_attrs$attrName;
  19901. return (_this$_attrs$attrName = this._attrs[attrName]) !== null && _this$_attrs$attrName !== void 0 ? _this$_attrs$attrName : null;
  19902. }
  19903. }, {
  19904. key: 'hasAttr',
  19905. value: function hasAttr(attrName) {
  19906. return this._attrs[attrName] !== void 0;
  19907. }
  19908. }, {
  19909. key: 'attrNames',
  19910. get: function get() {
  19911. return Object.keys(this._attrs);
  19912. }
  19913. } ]);
  19914. }(abstract_virtual_node_default);
  19915. var nodeNamesToTypes = {
  19916. '#cdata-section': 2,
  19917. '#text': 3,
  19918. '#comment': 8,
  19919. '#document': 9,
  19920. '#document-fragment': 11
  19921. };
  19922. var nodeTypeToName = {};
  19923. var nodeNames = Object.keys(nodeNamesToTypes);
  19924. nodeNames.forEach(function(nodeName2) {
  19925. nodeTypeToName[nodeNamesToTypes[nodeName2]] = nodeName2;
  19926. });
  19927. function normaliseProps(serialNode) {
  19928. var _serialNode$nodeName, _ref81, _serialNode$nodeType;
  19929. var nodeName2 = (_serialNode$nodeName = serialNode.nodeName) !== null && _serialNode$nodeName !== void 0 ? _serialNode$nodeName : nodeTypeToName[serialNode.nodeType];
  19930. var nodeType = (_ref81 = (_serialNode$nodeType = serialNode.nodeType) !== null && _serialNode$nodeType !== void 0 ? _serialNode$nodeType : nodeNamesToTypes[serialNode.nodeName]) !== null && _ref81 !== void 0 ? _ref81 : 1;
  19931. assert_default(typeof nodeType === 'number', 'nodeType has to be a number, got \''.concat(nodeType, '\''));
  19932. assert_default(typeof nodeName2 === 'string', 'nodeName has to be a string, got \''.concat(nodeName2, '\''));
  19933. nodeName2 = nodeName2.toLowerCase();
  19934. var type2 = null;
  19935. if (nodeName2 === 'input') {
  19936. type2 = (serialNode.type || serialNode.attributes && serialNode.attributes.type || '').toLowerCase();
  19937. if (!valid_input_type_default().includes(type2)) {
  19938. type2 = 'text';
  19939. }
  19940. }
  19941. var props = _extends({}, serialNode, {
  19942. nodeType: nodeType,
  19943. nodeName: nodeName2
  19944. });
  19945. if (type2) {
  19946. props.type = type2;
  19947. }
  19948. delete props.attributes;
  19949. return Object.freeze(props);
  19950. }
  19951. function normaliseAttrs(_ref82) {
  19952. var _ref82$attributes = _ref82.attributes, attributes2 = _ref82$attributes === void 0 ? {} : _ref82$attributes;
  19953. var attrMap = {
  19954. htmlFor: 'for',
  19955. className: 'class'
  19956. };
  19957. return Object.keys(attributes2).reduce(function(attrs, attrName) {
  19958. var value = attributes2[attrName];
  19959. assert_default(_typeof(value) !== 'object' || value === null, 'expects attributes not to be an object, \''.concat(attrName, '\' was'));
  19960. if (value !== void 0) {
  19961. var mappedName = attrMap[attrName] || attrName;
  19962. attrs[mappedName] = value !== null ? String(value) : null;
  19963. }
  19964. return attrs;
  19965. }, {});
  19966. }
  19967. var serial_virtual_node_default = SerialVirtualNode;
  19968. function cleanup(resolve, reject) {
  19969. resolve = resolve || function res() {};
  19970. reject = reject || axe.log;
  19971. if (!axe._audit) {
  19972. throw new Error('No audit configured');
  19973. }
  19974. var q = axe.utils.queue();
  19975. var cleanupErrors = [];
  19976. Object.keys(axe.plugins).forEach(function(key) {
  19977. q.defer(function(res) {
  19978. var rej = function rej2(err2) {
  19979. cleanupErrors.push(err2);
  19980. res();
  19981. };
  19982. try {
  19983. axe.plugins[key].cleanup(res, rej);
  19984. } catch (err2) {
  19985. rej(err2);
  19986. }
  19987. });
  19988. });
  19989. var flattenedTree = axe.utils.getFlattenedTree(document.body);
  19990. axe.utils.querySelectorAll(flattenedTree, 'iframe, frame').forEach(function(node) {
  19991. q.defer(function(res, rej) {
  19992. return axe.utils.sendCommandToFrame(node.actualNode, {
  19993. command: 'cleanup-plugin'
  19994. }, res, rej);
  19995. });
  19996. });
  19997. q.then(function(results) {
  19998. if (cleanupErrors.length === 0) {
  19999. resolve(results);
  20000. } else {
  20001. reject(cleanupErrors);
  20002. }
  20003. })['catch'](reject);
  20004. }
  20005. var cleanup_default = cleanup;
  20006. var reporters = {};
  20007. var defaultReporter;
  20008. function hasReporter(reporterName) {
  20009. return reporters.hasOwnProperty(reporterName);
  20010. }
  20011. function getReporter(reporter) {
  20012. if (typeof reporter === 'string' && reporters[reporter]) {
  20013. return reporters[reporter];
  20014. }
  20015. if (typeof reporter === 'function') {
  20016. return reporter;
  20017. }
  20018. return defaultReporter;
  20019. }
  20020. function addReporter(name, cb, isDefault) {
  20021. reporters[name] = cb;
  20022. if (isDefault) {
  20023. defaultReporter = cb;
  20024. }
  20025. }
  20026. function configure(spec) {
  20027. var audit = axe._audit;
  20028. if (!audit) {
  20029. throw new Error('No audit configured');
  20030. }
  20031. if (spec.axeVersion || spec.ver) {
  20032. var specVersion = spec.axeVersion || spec.ver;
  20033. if (!/^\d+\.\d+\.\d+(-canary)?/.test(specVersion)) {
  20034. throw new Error('Invalid configured version '.concat(specVersion));
  20035. }
  20036. var _specVersion$split = specVersion.split('-'), _specVersion$split2 = _slicedToArray(_specVersion$split, 2), version = _specVersion$split2[0], canary = _specVersion$split2[1];
  20037. var _version$split$map = version.split('.').map(Number), _version$split$map2 = _slicedToArray(_version$split$map, 3), major = _version$split$map2[0], minor = _version$split$map2[1], patch = _version$split$map2[2];
  20038. var _axe$version$split = axe.version.split('-'), _axe$version$split2 = _slicedToArray(_axe$version$split, 2), axeVersion = _axe$version$split2[0], axeCanary = _axe$version$split2[1];
  20039. var _axeVersion$split$map = axeVersion.split('.').map(Number), _axeVersion$split$map2 = _slicedToArray(_axeVersion$split$map, 3), axeMajor = _axeVersion$split$map2[0], axeMinor = _axeVersion$split$map2[1], axePatch = _axeVersion$split$map2[2];
  20040. if (major !== axeMajor || axeMinor < minor || axeMinor === minor && axePatch < patch || major === axeMajor && minor === axeMinor && patch === axePatch && canary && canary !== axeCanary) {
  20041. throw new Error('Configured version '.concat(specVersion, ' is not compatible with current axe version ').concat(axe.version));
  20042. }
  20043. }
  20044. if (spec.reporter && (typeof spec.reporter === 'function' || hasReporter(spec.reporter))) {
  20045. audit.reporter = spec.reporter;
  20046. }
  20047. if (spec.checks) {
  20048. if (!Array.isArray(spec.checks)) {
  20049. throw new TypeError('Checks property must be an array');
  20050. }
  20051. spec.checks.forEach(function(check) {
  20052. if (!check.id) {
  20053. throw new TypeError('Configured check '.concat(JSON.stringify(check), ' is invalid. Checks must be an object with at least an id property'));
  20054. }
  20055. audit.addCheck(check);
  20056. });
  20057. }
  20058. var modifiedRules = [];
  20059. if (spec.rules) {
  20060. if (!Array.isArray(spec.rules)) {
  20061. throw new TypeError('Rules property must be an array');
  20062. }
  20063. spec.rules.forEach(function(rule) {
  20064. if (!rule.id) {
  20065. throw new TypeError('Configured rule '.concat(JSON.stringify(rule), ' is invalid. Rules must be an object with at least an id property'));
  20066. }
  20067. modifiedRules.push(rule.id);
  20068. audit.addRule(rule);
  20069. });
  20070. }
  20071. if (spec.disableOtherRules) {
  20072. audit.rules.forEach(function(rule) {
  20073. if (modifiedRules.includes(rule.id) === false) {
  20074. rule.enabled = false;
  20075. }
  20076. });
  20077. }
  20078. if (typeof spec.branding !== 'undefined') {
  20079. audit.setBranding(spec.branding);
  20080. } else {
  20081. audit._constructHelpUrls();
  20082. }
  20083. if (spec.tagExclude) {
  20084. audit.tagExclude = spec.tagExclude;
  20085. }
  20086. if (spec.locale) {
  20087. audit.applyLocale(spec.locale);
  20088. }
  20089. if (spec.standards) {
  20090. configureStandards(spec.standards);
  20091. }
  20092. if (spec.noHtml) {
  20093. audit.noHtml = true;
  20094. }
  20095. if (spec.allowedOrigins) {
  20096. if (!Array.isArray(spec.allowedOrigins)) {
  20097. throw new TypeError('Allowed origins property must be an array');
  20098. }
  20099. if (spec.allowedOrigins.includes('*')) {
  20100. throw new Error('"*" is not allowed. Use "'.concat(constants_default.allOrigins, '" instead'));
  20101. }
  20102. audit.setAllowedOrigins(spec.allowedOrigins);
  20103. }
  20104. }
  20105. var configure_default = configure;
  20106. function frameMessenger2(frameHandler) {
  20107. _respondable.updateMessenger(frameHandler);
  20108. }
  20109. function getRules(tags) {
  20110. tags = tags || [];
  20111. var matchingRules = !tags.length ? axe._audit.rules : axe._audit.rules.filter(function(item) {
  20112. return !!tags.filter(function(tag) {
  20113. return item.tags.indexOf(tag) !== -1;
  20114. }).length;
  20115. });
  20116. var ruleData = axe._audit.data.rules || {};
  20117. return matchingRules.map(function(matchingRule) {
  20118. var rd = ruleData[matchingRule.id] || {};
  20119. return {
  20120. ruleId: matchingRule.id,
  20121. description: rd.description,
  20122. help: rd.help,
  20123. helpUrl: rd.helpUrl,
  20124. tags: matchingRule.tags,
  20125. actIds: matchingRule.actIds
  20126. };
  20127. });
  20128. }
  20129. var get_rules_default = getRules;
  20130. function hiddenContentEvaluate(node, options, virtualNode) {
  20131. var allowlist = [ 'SCRIPT', 'HEAD', 'TITLE', 'NOSCRIPT', 'STYLE', 'TEMPLATE' ];
  20132. if (!allowlist.includes(node.nodeName.toUpperCase()) && has_content_virtual_default(virtualNode)) {
  20133. var styles = window.getComputedStyle(node);
  20134. if (styles.getPropertyValue('display') === 'none') {
  20135. return void 0;
  20136. } else if (styles.getPropertyValue('visibility') === 'hidden') {
  20137. var parent = get_composed_parent_default(node);
  20138. var parentStyle = parent && window.getComputedStyle(parent);
  20139. if (!parentStyle || parentStyle.getPropertyValue('visibility') !== 'hidden') {
  20140. return void 0;
  20141. }
  20142. }
  20143. }
  20144. return true;
  20145. }
  20146. var hidden_content_evaluate_default = hiddenContentEvaluate;
  20147. var table_exports = {};
  20148. __export(table_exports, {
  20149. getAllCells: function getAllCells() {
  20150. return get_all_cells_default;
  20151. },
  20152. getCellPosition: function getCellPosition() {
  20153. return get_cell_position_default;
  20154. },
  20155. getHeaders: function getHeaders() {
  20156. return get_headers_default;
  20157. },
  20158. getScope: function getScope() {
  20159. return _getScope;
  20160. },
  20161. isColumnHeader: function isColumnHeader() {
  20162. return is_column_header_default;
  20163. },
  20164. isDataCell: function isDataCell() {
  20165. return is_data_cell_default;
  20166. },
  20167. isDataTable: function isDataTable() {
  20168. return is_data_table_default;
  20169. },
  20170. isHeader: function isHeader() {
  20171. return is_header_default;
  20172. },
  20173. isRowHeader: function isRowHeader() {
  20174. return is_row_header_default;
  20175. },
  20176. toArray: function toArray() {
  20177. return to_grid_default;
  20178. },
  20179. toGrid: function toGrid() {
  20180. return to_grid_default;
  20181. },
  20182. traverse: function traverse() {
  20183. return traverse_default;
  20184. }
  20185. });
  20186. function getAllCells(tableElm) {
  20187. var rowIndex, cellIndex, rowLength, cellLength;
  20188. var cells = [];
  20189. for (rowIndex = 0, rowLength = tableElm.rows.length; rowIndex < rowLength; rowIndex++) {
  20190. for (cellIndex = 0, cellLength = tableElm.rows[rowIndex].cells.length; cellIndex < cellLength; cellIndex++) {
  20191. cells.push(tableElm.rows[rowIndex].cells[cellIndex]);
  20192. }
  20193. }
  20194. return cells;
  20195. }
  20196. var get_all_cells_default = getAllCells;
  20197. function traverseForHeaders(headerType, position, tableGrid) {
  20198. var property = headerType === 'row' ? '_rowHeaders' : '_colHeaders';
  20199. var predicate = headerType === 'row' ? is_row_header_default : is_column_header_default;
  20200. var startCell = tableGrid[position.y][position.x];
  20201. var colspan = startCell.colSpan - 1;
  20202. var rowspanAttr = startCell.getAttribute('rowspan');
  20203. var rowspanValue = parseInt(rowspanAttr) === 0 || startCell.rowspan === 0 ? tableGrid.length : startCell.rowSpan;
  20204. var rowspan = rowspanValue - 1;
  20205. var rowStart = position.y + rowspan;
  20206. var colStart = position.x + colspan;
  20207. var rowEnd = headerType === 'row' ? position.y : 0;
  20208. var colEnd = headerType === 'row' ? 0 : position.x;
  20209. var headers;
  20210. var cells = [];
  20211. for (var row = rowStart; row >= rowEnd && !headers; row--) {
  20212. for (var col = colStart; col >= colEnd; col--) {
  20213. var cell = tableGrid[row] ? tableGrid[row][col] : void 0;
  20214. if (!cell) {
  20215. continue;
  20216. }
  20217. var vNode = axe.utils.getNodeFromTree(cell);
  20218. if (vNode[property]) {
  20219. headers = vNode[property];
  20220. break;
  20221. }
  20222. cells.push(cell);
  20223. }
  20224. }
  20225. headers = (headers || []).concat(cells.filter(predicate));
  20226. cells.forEach(function(tableCell) {
  20227. var vNode = axe.utils.getNodeFromTree(tableCell);
  20228. vNode[property] = headers;
  20229. });
  20230. return headers;
  20231. }
  20232. function getHeaders(cell, tableGrid) {
  20233. if (cell.getAttribute('headers')) {
  20234. var headers = idrefs_default(cell, 'headers');
  20235. if (headers.filter(function(header) {
  20236. return header;
  20237. }).length) {
  20238. return headers;
  20239. }
  20240. }
  20241. if (!tableGrid) {
  20242. tableGrid = to_grid_default(find_up_default(cell, 'table'));
  20243. }
  20244. var position = get_cell_position_default(cell, tableGrid);
  20245. var rowHeaders = traverseForHeaders('row', position, tableGrid);
  20246. var colHeaders = traverseForHeaders('col', position, tableGrid);
  20247. return [].concat(rowHeaders, colHeaders).reverse();
  20248. }
  20249. var get_headers_default = getHeaders;
  20250. function isDataCell(cell) {
  20251. if (!cell.children.length && !cell.textContent.trim()) {
  20252. return false;
  20253. }
  20254. var role = cell.getAttribute('role');
  20255. if (is_valid_role_default(role)) {
  20256. return [ 'cell', 'gridcell' ].includes(role);
  20257. } else {
  20258. return cell.nodeName.toUpperCase() === 'TD';
  20259. }
  20260. }
  20261. var is_data_cell_default = isDataCell;
  20262. function isDataTable(node) {
  20263. var role = (node.getAttribute('role') || '').toLowerCase();
  20264. if ((role === 'presentation' || role === 'none') && !_isFocusable(node)) {
  20265. return false;
  20266. }
  20267. if (node.getAttribute('contenteditable') === 'true' || find_up_default(node, '[contenteditable="true"]')) {
  20268. return true;
  20269. }
  20270. if (role === 'grid' || role === 'treegrid' || role === 'table') {
  20271. return true;
  20272. }
  20273. if (get_role_type_default(role) === 'landmark') {
  20274. return true;
  20275. }
  20276. if (node.getAttribute('datatable') === '0') {
  20277. return false;
  20278. }
  20279. if (node.getAttribute('summary')) {
  20280. return true;
  20281. }
  20282. if (node.tHead || node.tFoot || node.caption) {
  20283. return true;
  20284. }
  20285. for (var childIndex = 0, childLength = node.children.length; childIndex < childLength; childIndex++) {
  20286. if (node.children[childIndex].nodeName.toUpperCase() === 'COLGROUP') {
  20287. return true;
  20288. }
  20289. }
  20290. var cells = 0;
  20291. var rowLength = node.rows.length;
  20292. var row, cell;
  20293. var hasBorder = false;
  20294. for (var rowIndex = 0; rowIndex < rowLength; rowIndex++) {
  20295. row = node.rows[rowIndex];
  20296. for (var cellIndex = 0, cellLength = row.cells.length; cellIndex < cellLength; cellIndex++) {
  20297. cell = row.cells[cellIndex];
  20298. if (cell.nodeName.toUpperCase() === 'TH') {
  20299. return true;
  20300. }
  20301. if (!hasBorder && (cell.offsetWidth !== cell.clientWidth || cell.offsetHeight !== cell.clientHeight)) {
  20302. hasBorder = true;
  20303. }
  20304. if (cell.getAttribute('scope') || cell.getAttribute('headers') || cell.getAttribute('abbr')) {
  20305. return true;
  20306. }
  20307. if ([ 'columnheader', 'rowheader' ].includes((cell.getAttribute('role') || '').toLowerCase())) {
  20308. return true;
  20309. }
  20310. if (cell.children.length === 1 && cell.children[0].nodeName.toUpperCase() === 'ABBR') {
  20311. return true;
  20312. }
  20313. cells++;
  20314. }
  20315. }
  20316. if (node.getElementsByTagName('table').length) {
  20317. return false;
  20318. }
  20319. if (rowLength < 2) {
  20320. return false;
  20321. }
  20322. var sampleRow = node.rows[Math.ceil(rowLength / 2)];
  20323. if (sampleRow.cells.length === 1 && sampleRow.cells[0].colSpan === 1) {
  20324. return false;
  20325. }
  20326. if (sampleRow.cells.length >= 5) {
  20327. return true;
  20328. }
  20329. if (hasBorder) {
  20330. return true;
  20331. }
  20332. var bgColor, bgImage;
  20333. for (var _rowIndex = 0; _rowIndex < rowLength; _rowIndex++) {
  20334. row = node.rows[_rowIndex];
  20335. if (bgColor && bgColor !== window.getComputedStyle(row).getPropertyValue('background-color')) {
  20336. return true;
  20337. } else {
  20338. bgColor = window.getComputedStyle(row).getPropertyValue('background-color');
  20339. }
  20340. if (bgImage && bgImage !== window.getComputedStyle(row).getPropertyValue('background-image')) {
  20341. return true;
  20342. } else {
  20343. bgImage = window.getComputedStyle(row).getPropertyValue('background-image');
  20344. }
  20345. }
  20346. if (rowLength >= 20) {
  20347. return true;
  20348. }
  20349. if (get_element_coordinates_default(node).width > get_viewport_size_default(window).width * .95) {
  20350. return false;
  20351. }
  20352. if (cells < 10) {
  20353. return false;
  20354. }
  20355. if (node.querySelector('object, embed, iframe, applet')) {
  20356. return false;
  20357. }
  20358. return true;
  20359. }
  20360. var is_data_table_default = isDataTable;
  20361. function isHeader(cell) {
  20362. if (is_column_header_default(cell) || is_row_header_default(cell)) {
  20363. return true;
  20364. }
  20365. if (cell.getAttribute('id')) {
  20366. var _id2 = escape_selector_default(cell.getAttribute('id'));
  20367. return !!document.querySelector('[headers~="'.concat(_id2, '"]'));
  20368. }
  20369. return false;
  20370. }
  20371. var is_header_default = isHeader;
  20372. function traverseTable(dir, position, tableGrid, callback) {
  20373. var result;
  20374. var cell = tableGrid[position.y] ? tableGrid[position.y][position.x] : void 0;
  20375. if (!cell) {
  20376. return [];
  20377. }
  20378. if (typeof callback === 'function') {
  20379. result = callback(cell, position, tableGrid);
  20380. if (result === true) {
  20381. return [ cell ];
  20382. }
  20383. }
  20384. result = traverseTable(dir, {
  20385. x: position.x + dir.x,
  20386. y: position.y + dir.y
  20387. }, tableGrid, callback);
  20388. result.unshift(cell);
  20389. return result;
  20390. }
  20391. function traverse(dir, startPos, tableGrid, callback) {
  20392. if (Array.isArray(startPos)) {
  20393. callback = tableGrid;
  20394. tableGrid = startPos;
  20395. startPos = {
  20396. x: 0,
  20397. y: 0
  20398. };
  20399. }
  20400. if (typeof dir === 'string') {
  20401. switch (dir) {
  20402. case 'left':
  20403. dir = {
  20404. x: -1,
  20405. y: 0
  20406. };
  20407. break;
  20408. case 'up':
  20409. dir = {
  20410. x: 0,
  20411. y: -1
  20412. };
  20413. break;
  20414. case 'right':
  20415. dir = {
  20416. x: 1,
  20417. y: 0
  20418. };
  20419. break;
  20420. case 'down':
  20421. dir = {
  20422. x: 0,
  20423. y: 1
  20424. };
  20425. break;
  20426. }
  20427. }
  20428. return traverseTable(dir, {
  20429. x: startPos.x + dir.x,
  20430. y: startPos.y + dir.y
  20431. }, tableGrid, callback);
  20432. }
  20433. var traverse_default = traverse;
  20434. function thHasDataCellsEvaluate(node) {
  20435. var cells = get_all_cells_default(node);
  20436. var checkResult = this;
  20437. var reffedHeaders = [];
  20438. cells.forEach(function(cell) {
  20439. var headers2 = cell.getAttribute('headers');
  20440. if (headers2) {
  20441. reffedHeaders = reffedHeaders.concat(headers2.split(/\s+/));
  20442. }
  20443. var ariaLabel = cell.getAttribute('aria-labelledby');
  20444. if (ariaLabel) {
  20445. reffedHeaders = reffedHeaders.concat(ariaLabel.split(/\s+/));
  20446. }
  20447. });
  20448. var headers = cells.filter(function(cell) {
  20449. if (sanitize_default(cell.textContent) === '') {
  20450. return false;
  20451. }
  20452. return cell.nodeName.toUpperCase() === 'TH' || [ 'rowheader', 'columnheader' ].indexOf(cell.getAttribute('role')) !== -1;
  20453. });
  20454. var tableGrid = to_grid_default(node);
  20455. var out = true;
  20456. headers.forEach(function(header) {
  20457. if (header.getAttribute('id') && reffedHeaders.includes(header.getAttribute('id'))) {
  20458. return;
  20459. }
  20460. var pos = get_cell_position_default(header, tableGrid);
  20461. var hasCell = false;
  20462. if (is_column_header_default(header)) {
  20463. hasCell = traverse_default('down', pos, tableGrid).find(function(cell) {
  20464. return !is_column_header_default(cell) && get_headers_default(cell, tableGrid).includes(header);
  20465. });
  20466. }
  20467. if (!hasCell && is_row_header_default(header)) {
  20468. hasCell = traverse_default('right', pos, tableGrid).find(function(cell) {
  20469. return !is_row_header_default(cell) && get_headers_default(cell, tableGrid).includes(header);
  20470. });
  20471. }
  20472. if (!hasCell) {
  20473. checkResult.relatedNodes(header);
  20474. }
  20475. out = out && hasCell;
  20476. });
  20477. return out ? true : void 0;
  20478. }
  20479. var th_has_data_cells_evaluate_default = thHasDataCellsEvaluate;
  20480. function tdHeadersAttrEvaluate(node) {
  20481. var cells = [];
  20482. var reviewCells = [];
  20483. var badCells = [];
  20484. for (var rowIndex = 0; rowIndex < node.rows.length; rowIndex++) {
  20485. var row = node.rows[rowIndex];
  20486. for (var cellIndex = 0; cellIndex < row.cells.length; cellIndex++) {
  20487. cells.push(row.cells[cellIndex]);
  20488. }
  20489. }
  20490. var ids = cells.filter(function(cell) {
  20491. return cell.getAttribute('id');
  20492. }).map(function(cell) {
  20493. return cell.getAttribute('id');
  20494. });
  20495. cells.forEach(function(cell) {
  20496. var isSelf = false;
  20497. var notOfTable = false;
  20498. if (!cell.hasAttribute('headers') || !_isVisibleToScreenReaders(cell)) {
  20499. return;
  20500. }
  20501. var headersAttr = cell.getAttribute('headers').trim();
  20502. if (!headersAttr) {
  20503. return reviewCells.push(cell);
  20504. }
  20505. var headers = token_list_default(headersAttr);
  20506. if (headers.length !== 0) {
  20507. if (cell.getAttribute('id')) {
  20508. isSelf = headers.indexOf(cell.getAttribute('id').trim()) !== -1;
  20509. }
  20510. notOfTable = headers.some(function(header) {
  20511. return !ids.includes(header);
  20512. });
  20513. if (isSelf || notOfTable) {
  20514. badCells.push(cell);
  20515. }
  20516. }
  20517. });
  20518. if (badCells.length > 0) {
  20519. this.relatedNodes(badCells);
  20520. return false;
  20521. }
  20522. if (reviewCells.length) {
  20523. this.relatedNodes(reviewCells);
  20524. return void 0;
  20525. }
  20526. return true;
  20527. }
  20528. var aria_exports = {};
  20529. __export(aria_exports, {
  20530. allowedAttr: function allowedAttr() {
  20531. return allowed_attr_default;
  20532. },
  20533. arialabelText: function arialabelText() {
  20534. return _arialabelText;
  20535. },
  20536. arialabelledbyText: function arialabelledbyText() {
  20537. return arialabelledby_text_default;
  20538. },
  20539. getAccessibleRefs: function getAccessibleRefs() {
  20540. return get_accessible_refs_default;
  20541. },
  20542. getElementUnallowedRoles: function getElementUnallowedRoles() {
  20543. return get_element_unallowed_roles_default;
  20544. },
  20545. getExplicitRole: function getExplicitRole() {
  20546. return get_explicit_role_default;
  20547. },
  20548. getImplicitRole: function getImplicitRole() {
  20549. return implicit_role_default;
  20550. },
  20551. getOwnedVirtual: function getOwnedVirtual() {
  20552. return get_owned_virtual_default;
  20553. },
  20554. getRole: function getRole() {
  20555. return get_role_default;
  20556. },
  20557. getRoleType: function getRoleType() {
  20558. return get_role_type_default;
  20559. },
  20560. getRolesByType: function getRolesByType() {
  20561. return get_roles_by_type_default;
  20562. },
  20563. getRolesWithNameFromContents: function getRolesWithNameFromContents() {
  20564. return get_roles_with_name_from_contents_default;
  20565. },
  20566. implicitNodes: function implicitNodes() {
  20567. return implicit_nodes_default;
  20568. },
  20569. implicitRole: function implicitRole() {
  20570. return implicit_role_default;
  20571. },
  20572. isAccessibleRef: function isAccessibleRef() {
  20573. return is_accessible_ref_default;
  20574. },
  20575. isAriaRoleAllowedOnElement: function isAriaRoleAllowedOnElement() {
  20576. return is_aria_role_allowed_on_element_default;
  20577. },
  20578. isComboboxPopup: function isComboboxPopup() {
  20579. return _isComboboxPopup;
  20580. },
  20581. isUnsupportedRole: function isUnsupportedRole() {
  20582. return is_unsupported_role_default;
  20583. },
  20584. isValidRole: function isValidRole() {
  20585. return is_valid_role_default;
  20586. },
  20587. label: function label() {
  20588. return label_default2;
  20589. },
  20590. labelVirtual: function labelVirtual() {
  20591. return label_virtual_default;
  20592. },
  20593. lookupTable: function lookupTable() {
  20594. return lookup_table_default;
  20595. },
  20596. namedFromContents: function namedFromContents() {
  20597. return named_from_contents_default;
  20598. },
  20599. requiredAttr: function requiredAttr() {
  20600. return required_attr_default;
  20601. },
  20602. requiredContext: function requiredContext() {
  20603. return required_context_default;
  20604. },
  20605. requiredOwned: function requiredOwned() {
  20606. return required_owned_default;
  20607. },
  20608. validateAttr: function validateAttr() {
  20609. return validate_attr_default;
  20610. },
  20611. validateAttrValue: function validateAttrValue() {
  20612. return validate_attr_value_default;
  20613. }
  20614. });
  20615. function allowedAttr(role) {
  20616. var roleDef = standards_default.ariaRoles[role];
  20617. var attrs = _toConsumableArray(get_global_aria_attrs_default());
  20618. if (!roleDef) {
  20619. return attrs;
  20620. }
  20621. if (roleDef.allowedAttrs) {
  20622. attrs.push.apply(attrs, _toConsumableArray(roleDef.allowedAttrs));
  20623. }
  20624. if (roleDef.requiredAttrs) {
  20625. attrs.push.apply(attrs, _toConsumableArray(roleDef.requiredAttrs));
  20626. }
  20627. return attrs;
  20628. }
  20629. var allowed_attr_default = allowedAttr;
  20630. var idRefsRegex = /^idrefs?$/;
  20631. function cacheIdRefs(node, idRefs, refAttrs) {
  20632. if (node.hasAttribute) {
  20633. if (node.nodeName.toUpperCase() === 'LABEL' && node.hasAttribute('for')) {
  20634. var _id3 = node.getAttribute('for');
  20635. if (!idRefs.has(_id3)) {
  20636. idRefs.set(_id3, [ node ]);
  20637. } else {
  20638. idRefs.get(_id3).push(node);
  20639. }
  20640. }
  20641. for (var _i33 = 0; _i33 < refAttrs.length; ++_i33) {
  20642. var attr = refAttrs[_i33];
  20643. var attrValue = sanitize_default(node.getAttribute(attr) || '');
  20644. if (!attrValue) {
  20645. continue;
  20646. }
  20647. var _iterator14 = _createForOfIteratorHelper(token_list_default(attrValue)), _step14;
  20648. try {
  20649. for (_iterator14.s(); !(_step14 = _iterator14.n()).done; ) {
  20650. var token = _step14.value;
  20651. if (!idRefs.has(token)) {
  20652. idRefs.set(token, [ node ]);
  20653. } else {
  20654. idRefs.get(token).push(node);
  20655. }
  20656. }
  20657. } catch (err) {
  20658. _iterator14.e(err);
  20659. } finally {
  20660. _iterator14.f();
  20661. }
  20662. }
  20663. }
  20664. for (var _i34 = 0; _i34 < node.childNodes.length; _i34++) {
  20665. if (node.childNodes[_i34].nodeType === 1) {
  20666. cacheIdRefs(node.childNodes[_i34], idRefs, refAttrs);
  20667. }
  20668. }
  20669. }
  20670. function getAccessibleRefs(node) {
  20671. var _idRefs$get;
  20672. node = node.actualNode || node;
  20673. var root = get_root_node_default2(node);
  20674. root = root.documentElement || root;
  20675. var idRefsByRoot = cache_default.get('idRefsByRoot', function() {
  20676. return new Map();
  20677. });
  20678. var idRefs = idRefsByRoot.get(root);
  20679. if (!idRefs) {
  20680. idRefs = new Map();
  20681. idRefsByRoot.set(root, idRefs);
  20682. var refAttrs = Object.keys(standards_default.ariaAttrs).filter(function(attr) {
  20683. var type2 = standards_default.ariaAttrs[attr].type;
  20684. return idRefsRegex.test(type2);
  20685. });
  20686. cacheIdRefs(root, idRefs, refAttrs);
  20687. }
  20688. return (_idRefs$get = idRefs.get(node.id)) !== null && _idRefs$get !== void 0 ? _idRefs$get : [];
  20689. }
  20690. var get_accessible_refs_default = getAccessibleRefs;
  20691. function isAriaRoleAllowedOnElement(node, role) {
  20692. var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  20693. var implicitRole3 = implicit_role_default(vNode);
  20694. var spec = get_element_spec_default(vNode);
  20695. if (Array.isArray(spec.allowedRoles)) {
  20696. return spec.allowedRoles.includes(role);
  20697. }
  20698. if (role === implicitRole3) {
  20699. return false;
  20700. }
  20701. return !!spec.allowedRoles;
  20702. }
  20703. var is_aria_role_allowed_on_element_default = isAriaRoleAllowedOnElement;
  20704. var dpubRoles2 = [ 'doc-backlink', 'doc-biblioentry', 'doc-biblioref', 'doc-cover', 'doc-endnote', 'doc-glossref', 'doc-noteref' ];
  20705. var landmarkRoles = {
  20706. header: 'banner',
  20707. footer: 'contentinfo'
  20708. };
  20709. function getRoleSegments(vNode) {
  20710. var roles = [];
  20711. if (!vNode) {
  20712. return roles;
  20713. }
  20714. if (vNode.hasAttr('role')) {
  20715. var nodeRoles = token_list_default(vNode.attr('role').toLowerCase());
  20716. roles = roles.concat(nodeRoles);
  20717. }
  20718. return roles.filter(function(role) {
  20719. return is_valid_role_default(role);
  20720. });
  20721. }
  20722. function getElementUnallowedRoles(node) {
  20723. var allowImplicit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  20724. var _nodeLookup21 = _nodeLookup(node), vNode = _nodeLookup21.vNode;
  20725. if (!is_html_element_default(vNode)) {
  20726. return [];
  20727. }
  20728. var nodeName2 = vNode.props.nodeName;
  20729. var implicitRole3 = implicit_role_default(vNode) || landmarkRoles[nodeName2];
  20730. var roleSegments = getRoleSegments(vNode);
  20731. return roleSegments.filter(function(role) {
  20732. return !roleIsAllowed(role, vNode, allowImplicit, implicitRole3);
  20733. });
  20734. }
  20735. function roleIsAllowed(role, vNode, allowImplicit, implicitRole3) {
  20736. if (allowImplicit && role === implicitRole3) {
  20737. return true;
  20738. }
  20739. if (dpubRoles2.includes(role) && get_role_type_default(role) !== implicitRole3) {
  20740. return false;
  20741. }
  20742. return is_aria_role_allowed_on_element_default(vNode, role);
  20743. }
  20744. var get_element_unallowed_roles_default = getElementUnallowedRoles;
  20745. function getAriaRolesByType(type2) {
  20746. return Object.keys(standards_default.ariaRoles).filter(function(roleName) {
  20747. return standards_default.ariaRoles[roleName].type === type2;
  20748. });
  20749. }
  20750. var get_aria_roles_by_type_default = getAriaRolesByType;
  20751. function getRolesByType(roleType) {
  20752. return get_aria_roles_by_type_default(roleType);
  20753. }
  20754. var get_roles_by_type_default = getRolesByType;
  20755. function getAriaRolesSupportingNameFromContent() {
  20756. return cache_default.get('ariaRolesNameFromContent', function() {
  20757. return Object.keys(standards_default.ariaRoles).filter(function(roleName) {
  20758. return standards_default.ariaRoles[roleName].nameFromContent;
  20759. });
  20760. });
  20761. }
  20762. var get_aria_roles_supporting_name_from_content_default = getAriaRolesSupportingNameFromContent;
  20763. function getRolesWithNameFromContents() {
  20764. return get_aria_roles_supporting_name_from_content_default();
  20765. }
  20766. var get_roles_with_name_from_contents_default = getRolesWithNameFromContents;
  20767. var isNull = function isNull(value) {
  20768. return value === null;
  20769. };
  20770. var isNotNull = function isNotNull(value) {
  20771. return value !== null;
  20772. };
  20773. var lookupTable = {};
  20774. lookupTable.attributes = {
  20775. 'aria-activedescendant': {
  20776. type: 'idref',
  20777. allowEmpty: true,
  20778. unsupported: false
  20779. },
  20780. 'aria-atomic': {
  20781. type: 'boolean',
  20782. values: [ 'true', 'false' ],
  20783. unsupported: false
  20784. },
  20785. 'aria-autocomplete': {
  20786. type: 'nmtoken',
  20787. values: [ 'inline', 'list', 'both', 'none' ],
  20788. unsupported: false
  20789. },
  20790. 'aria-busy': {
  20791. type: 'boolean',
  20792. values: [ 'true', 'false' ],
  20793. unsupported: false
  20794. },
  20795. 'aria-checked': {
  20796. type: 'nmtoken',
  20797. values: [ 'true', 'false', 'mixed', 'undefined' ],
  20798. unsupported: false
  20799. },
  20800. 'aria-colcount': {
  20801. type: 'int',
  20802. unsupported: false
  20803. },
  20804. 'aria-colindex': {
  20805. type: 'int',
  20806. unsupported: false
  20807. },
  20808. 'aria-colspan': {
  20809. type: 'int',
  20810. unsupported: false
  20811. },
  20812. 'aria-controls': {
  20813. type: 'idrefs',
  20814. allowEmpty: true,
  20815. unsupported: false
  20816. },
  20817. 'aria-current': {
  20818. type: 'nmtoken',
  20819. allowEmpty: true,
  20820. values: [ 'page', 'step', 'location', 'date', 'time', 'true', 'false' ],
  20821. unsupported: false
  20822. },
  20823. 'aria-describedby': {
  20824. type: 'idrefs',
  20825. allowEmpty: true,
  20826. unsupported: false
  20827. },
  20828. 'aria-describedat': {
  20829. unsupported: true,
  20830. unstandardized: true
  20831. },
  20832. 'aria-details': {
  20833. type: 'idref',
  20834. allowEmpty: true,
  20835. unsupported: false
  20836. },
  20837. 'aria-disabled': {
  20838. type: 'boolean',
  20839. values: [ 'true', 'false' ],
  20840. unsupported: false
  20841. },
  20842. 'aria-dropeffect': {
  20843. type: 'nmtokens',
  20844. values: [ 'copy', 'move', 'reference', 'execute', 'popup', 'none' ],
  20845. unsupported: false
  20846. },
  20847. 'aria-errormessage': {
  20848. type: 'idref',
  20849. allowEmpty: true,
  20850. unsupported: false
  20851. },
  20852. 'aria-expanded': {
  20853. type: 'nmtoken',
  20854. values: [ 'true', 'false', 'undefined' ],
  20855. unsupported: false
  20856. },
  20857. 'aria-flowto': {
  20858. type: 'idrefs',
  20859. allowEmpty: true,
  20860. unsupported: false
  20861. },
  20862. 'aria-grabbed': {
  20863. type: 'nmtoken',
  20864. values: [ 'true', 'false', 'undefined' ],
  20865. unsupported: false
  20866. },
  20867. 'aria-haspopup': {
  20868. type: 'nmtoken',
  20869. allowEmpty: true,
  20870. values: [ 'true', 'false', 'menu', 'listbox', 'tree', 'grid', 'dialog' ],
  20871. unsupported: false
  20872. },
  20873. 'aria-hidden': {
  20874. type: 'boolean',
  20875. values: [ 'true', 'false' ],
  20876. unsupported: false
  20877. },
  20878. 'aria-invalid': {
  20879. type: 'nmtoken',
  20880. allowEmpty: true,
  20881. values: [ 'true', 'false', 'spelling', 'grammar' ],
  20882. unsupported: false
  20883. },
  20884. 'aria-keyshortcuts': {
  20885. type: 'string',
  20886. allowEmpty: true,
  20887. unsupported: false
  20888. },
  20889. 'aria-label': {
  20890. type: 'string',
  20891. allowEmpty: true,
  20892. unsupported: false
  20893. },
  20894. 'aria-labelledby': {
  20895. type: 'idrefs',
  20896. allowEmpty: true,
  20897. unsupported: false
  20898. },
  20899. 'aria-level': {
  20900. type: 'int',
  20901. unsupported: false
  20902. },
  20903. 'aria-live': {
  20904. type: 'nmtoken',
  20905. values: [ 'off', 'polite', 'assertive' ],
  20906. unsupported: false
  20907. },
  20908. 'aria-modal': {
  20909. type: 'boolean',
  20910. values: [ 'true', 'false' ],
  20911. unsupported: false
  20912. },
  20913. 'aria-multiline': {
  20914. type: 'boolean',
  20915. values: [ 'true', 'false' ],
  20916. unsupported: false
  20917. },
  20918. 'aria-multiselectable': {
  20919. type: 'boolean',
  20920. values: [ 'true', 'false' ],
  20921. unsupported: false
  20922. },
  20923. 'aria-orientation': {
  20924. type: 'nmtoken',
  20925. values: [ 'horizontal', 'vertical' ],
  20926. unsupported: false
  20927. },
  20928. 'aria-owns': {
  20929. type: 'idrefs',
  20930. allowEmpty: true,
  20931. unsupported: false
  20932. },
  20933. 'aria-placeholder': {
  20934. type: 'string',
  20935. allowEmpty: true,
  20936. unsupported: false
  20937. },
  20938. 'aria-posinset': {
  20939. type: 'int',
  20940. unsupported: false
  20941. },
  20942. 'aria-pressed': {
  20943. type: 'nmtoken',
  20944. values: [ 'true', 'false', 'mixed', 'undefined' ],
  20945. unsupported: false
  20946. },
  20947. 'aria-readonly': {
  20948. type: 'boolean',
  20949. values: [ 'true', 'false' ],
  20950. unsupported: false
  20951. },
  20952. 'aria-relevant': {
  20953. type: 'nmtokens',
  20954. values: [ 'additions', 'removals', 'text', 'all' ],
  20955. unsupported: false
  20956. },
  20957. 'aria-required': {
  20958. type: 'boolean',
  20959. values: [ 'true', 'false' ],
  20960. unsupported: false
  20961. },
  20962. 'aria-roledescription': {
  20963. type: 'string',
  20964. allowEmpty: true,
  20965. unsupported: false
  20966. },
  20967. 'aria-rowcount': {
  20968. type: 'int',
  20969. unsupported: false
  20970. },
  20971. 'aria-rowindex': {
  20972. type: 'int',
  20973. unsupported: false
  20974. },
  20975. 'aria-rowspan': {
  20976. type: 'int',
  20977. unsupported: false
  20978. },
  20979. 'aria-selected': {
  20980. type: 'nmtoken',
  20981. values: [ 'true', 'false', 'undefined' ],
  20982. unsupported: false
  20983. },
  20984. 'aria-setsize': {
  20985. type: 'int',
  20986. unsupported: false
  20987. },
  20988. 'aria-sort': {
  20989. type: 'nmtoken',
  20990. values: [ 'ascending', 'descending', 'other', 'none' ],
  20991. unsupported: false
  20992. },
  20993. 'aria-valuemax': {
  20994. type: 'decimal',
  20995. unsupported: false
  20996. },
  20997. 'aria-valuemin': {
  20998. type: 'decimal',
  20999. unsupported: false
  21000. },
  21001. 'aria-valuenow': {
  21002. type: 'decimal',
  21003. unsupported: false
  21004. },
  21005. 'aria-valuetext': {
  21006. type: 'string',
  21007. unsupported: false
  21008. }
  21009. };
  21010. lookupTable.globalAttributes = [ 'aria-atomic', 'aria-busy', 'aria-controls', 'aria-current', 'aria-describedby', 'aria-details', 'aria-disabled', 'aria-dropeffect', 'aria-flowto', 'aria-grabbed', 'aria-haspopup', 'aria-hidden', 'aria-invalid', 'aria-keyshortcuts', 'aria-label', 'aria-labelledby', 'aria-live', 'aria-owns', 'aria-relevant', 'aria-roledescription' ];
  21011. lookupTable.role = {
  21012. alert: {
  21013. type: 'widget',
  21014. attributes: {
  21015. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21016. },
  21017. owned: null,
  21018. nameFrom: [ 'author' ],
  21019. context: null,
  21020. unsupported: false,
  21021. allowedElements: [ 'section' ]
  21022. },
  21023. alertdialog: {
  21024. type: 'widget',
  21025. attributes: {
  21026. allowed: [ 'aria-expanded', 'aria-modal', 'aria-errormessage' ]
  21027. },
  21028. owned: null,
  21029. nameFrom: [ 'author' ],
  21030. context: null,
  21031. unsupported: false,
  21032. allowedElements: [ 'dialog', 'section' ]
  21033. },
  21034. application: {
  21035. type: 'landmark',
  21036. attributes: {
  21037. allowed: [ 'aria-expanded', 'aria-errormessage', 'aria-activedescendant' ]
  21038. },
  21039. owned: null,
  21040. nameFrom: [ 'author' ],
  21041. context: null,
  21042. unsupported: false,
  21043. allowedElements: [ 'article', 'audio', 'embed', 'iframe', 'object', 'section', 'svg', 'video' ]
  21044. },
  21045. article: {
  21046. type: 'structure',
  21047. attributes: {
  21048. allowed: [ 'aria-expanded', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
  21049. },
  21050. owned: null,
  21051. nameFrom: [ 'author' ],
  21052. context: null,
  21053. implicit: [ 'article' ],
  21054. unsupported: false
  21055. },
  21056. banner: {
  21057. type: 'landmark',
  21058. attributes: {
  21059. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21060. },
  21061. owned: null,
  21062. nameFrom: [ 'author' ],
  21063. context: null,
  21064. implicit: [ 'header' ],
  21065. unsupported: false,
  21066. allowedElements: [ 'section' ]
  21067. },
  21068. button: {
  21069. type: 'widget',
  21070. attributes: {
  21071. allowed: [ 'aria-expanded', 'aria-pressed', 'aria-errormessage' ]
  21072. },
  21073. owned: null,
  21074. nameFrom: [ 'author', 'contents' ],
  21075. context: null,
  21076. implicit: [ 'button', 'input[type="button"]', 'input[type="image"]', 'input[type="reset"]', 'input[type="submit"]', 'summary' ],
  21077. unsupported: false,
  21078. allowedElements: [ {
  21079. nodeName: 'a',
  21080. attributes: {
  21081. href: isNotNull
  21082. }
  21083. } ]
  21084. },
  21085. cell: {
  21086. type: 'structure',
  21087. attributes: {
  21088. allowed: [ 'aria-colindex', 'aria-colspan', 'aria-rowindex', 'aria-rowspan', 'aria-errormessage' ]
  21089. },
  21090. owned: null,
  21091. nameFrom: [ 'author', 'contents' ],
  21092. context: [ 'row' ],
  21093. implicit: [ 'td', 'th' ],
  21094. unsupported: false
  21095. },
  21096. checkbox: {
  21097. type: 'widget',
  21098. attributes: {
  21099. allowed: [ 'aria-checked', 'aria-required', 'aria-readonly', 'aria-errormessage' ]
  21100. },
  21101. owned: null,
  21102. nameFrom: [ 'author', 'contents' ],
  21103. context: null,
  21104. implicit: [ 'input[type="checkbox"]' ],
  21105. unsupported: false,
  21106. allowedElements: [ 'button' ]
  21107. },
  21108. columnheader: {
  21109. type: 'structure',
  21110. attributes: {
  21111. allowed: [ 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan', 'aria-required', 'aria-readonly', 'aria-selected', 'aria-sort', 'aria-errormessage' ]
  21112. },
  21113. owned: null,
  21114. nameFrom: [ 'author', 'contents' ],
  21115. context: [ 'row' ],
  21116. implicit: [ 'th' ],
  21117. unsupported: false
  21118. },
  21119. combobox: {
  21120. type: 'composite',
  21121. attributes: {
  21122. allowed: [ 'aria-autocomplete', 'aria-required', 'aria-activedescendant', 'aria-orientation', 'aria-errormessage' ],
  21123. required: [ 'aria-expanded' ]
  21124. },
  21125. owned: {
  21126. all: [ 'listbox', 'tree', 'grid', 'dialog', 'textbox' ]
  21127. },
  21128. nameFrom: [ 'author' ],
  21129. context: null,
  21130. unsupported: false,
  21131. allowedElements: [ {
  21132. nodeName: 'input',
  21133. properties: {
  21134. type: [ 'text', 'search', 'tel', 'url', 'email' ]
  21135. }
  21136. } ]
  21137. },
  21138. command: {
  21139. nameFrom: [ 'author' ],
  21140. type: 'abstract',
  21141. unsupported: false
  21142. },
  21143. complementary: {
  21144. type: 'landmark',
  21145. attributes: {
  21146. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21147. },
  21148. owned: null,
  21149. nameFrom: [ 'author' ],
  21150. context: null,
  21151. implicit: [ 'aside' ],
  21152. unsupported: false,
  21153. allowedElements: [ 'section' ]
  21154. },
  21155. composite: {
  21156. nameFrom: [ 'author' ],
  21157. type: 'abstract',
  21158. unsupported: false
  21159. },
  21160. contentinfo: {
  21161. type: 'landmark',
  21162. attributes: {
  21163. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21164. },
  21165. owned: null,
  21166. nameFrom: [ 'author' ],
  21167. context: null,
  21168. implicit: [ 'footer' ],
  21169. unsupported: false,
  21170. allowedElements: [ 'section' ]
  21171. },
  21172. definition: {
  21173. type: 'structure',
  21174. attributes: {
  21175. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21176. },
  21177. owned: null,
  21178. nameFrom: [ 'author' ],
  21179. context: null,
  21180. implicit: [ 'dd', 'dfn' ],
  21181. unsupported: false
  21182. },
  21183. dialog: {
  21184. type: 'widget',
  21185. attributes: {
  21186. allowed: [ 'aria-expanded', 'aria-modal', 'aria-errormessage' ]
  21187. },
  21188. owned: null,
  21189. nameFrom: [ 'author' ],
  21190. context: null,
  21191. implicit: [ 'dialog' ],
  21192. unsupported: false,
  21193. allowedElements: [ 'section' ]
  21194. },
  21195. directory: {
  21196. type: 'structure',
  21197. attributes: {
  21198. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21199. },
  21200. owned: null,
  21201. nameFrom: [ 'author', 'contents' ],
  21202. context: null,
  21203. unsupported: false,
  21204. allowedElements: [ 'ol', 'ul' ]
  21205. },
  21206. document: {
  21207. type: 'structure',
  21208. attributes: {
  21209. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21210. },
  21211. owned: null,
  21212. nameFrom: [ 'author' ],
  21213. context: null,
  21214. implicit: [ 'body' ],
  21215. unsupported: false,
  21216. allowedElements: [ 'article', 'embed', 'iframe', 'object', 'section', 'svg' ]
  21217. },
  21218. 'doc-abstract': {
  21219. type: 'section',
  21220. attributes: {
  21221. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21222. },
  21223. owned: null,
  21224. nameFrom: [ 'author' ],
  21225. context: null,
  21226. unsupported: false,
  21227. allowedElements: [ 'section' ]
  21228. },
  21229. 'doc-acknowledgments': {
  21230. type: 'landmark',
  21231. attributes: {
  21232. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21233. },
  21234. owned: null,
  21235. nameFrom: [ 'author' ],
  21236. context: null,
  21237. unsupported: false,
  21238. allowedElements: [ 'section' ]
  21239. },
  21240. 'doc-afterword': {
  21241. type: 'landmark',
  21242. attributes: {
  21243. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21244. },
  21245. owned: null,
  21246. nameFrom: [ 'author' ],
  21247. context: null,
  21248. unsupported: false,
  21249. allowedElements: [ 'section' ]
  21250. },
  21251. 'doc-appendix': {
  21252. type: 'landmark',
  21253. attributes: {
  21254. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21255. },
  21256. owned: null,
  21257. nameFrom: [ 'author' ],
  21258. context: null,
  21259. unsupported: false,
  21260. allowedElements: [ 'section' ]
  21261. },
  21262. 'doc-backlink': {
  21263. type: 'link',
  21264. attributes: {
  21265. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21266. },
  21267. owned: null,
  21268. nameFrom: [ 'author', 'contents' ],
  21269. context: null,
  21270. unsupported: false,
  21271. allowedElements: [ {
  21272. nodeName: 'a',
  21273. attributes: {
  21274. href: isNotNull
  21275. }
  21276. } ]
  21277. },
  21278. 'doc-biblioentry': {
  21279. type: 'listitem',
  21280. attributes: {
  21281. allowed: [ 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
  21282. },
  21283. owned: null,
  21284. nameFrom: [ 'author' ],
  21285. context: [ 'doc-bibliography' ],
  21286. unsupported: false,
  21287. allowedElements: [ 'li' ]
  21288. },
  21289. 'doc-bibliography': {
  21290. type: 'landmark',
  21291. attributes: {
  21292. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21293. },
  21294. owned: {
  21295. one: [ 'doc-biblioentry' ]
  21296. },
  21297. nameFrom: [ 'author' ],
  21298. context: null,
  21299. unsupported: false,
  21300. allowedElements: [ 'section' ]
  21301. },
  21302. 'doc-biblioref': {
  21303. type: 'link',
  21304. attributes: {
  21305. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21306. },
  21307. owned: null,
  21308. nameFrom: [ 'author', 'contents' ],
  21309. context: null,
  21310. unsupported: false,
  21311. allowedElements: [ {
  21312. nodeName: 'a',
  21313. attributes: {
  21314. href: isNotNull
  21315. }
  21316. } ]
  21317. },
  21318. 'doc-chapter': {
  21319. type: 'landmark',
  21320. attributes: {
  21321. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21322. },
  21323. owned: null,
  21324. namefrom: [ 'author' ],
  21325. context: null,
  21326. unsupported: false,
  21327. allowedElements: [ 'section' ]
  21328. },
  21329. 'doc-colophon': {
  21330. type: 'section',
  21331. attributes: {
  21332. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21333. },
  21334. owned: null,
  21335. namefrom: [ 'author' ],
  21336. context: null,
  21337. unsupported: false,
  21338. allowedElements: [ 'section' ]
  21339. },
  21340. 'doc-conclusion': {
  21341. type: 'landmark',
  21342. attributes: {
  21343. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21344. },
  21345. owned: null,
  21346. namefrom: [ 'author' ],
  21347. context: null,
  21348. unsupported: false,
  21349. allowedElements: [ 'section' ]
  21350. },
  21351. 'doc-cover': {
  21352. type: 'img',
  21353. attributes: {
  21354. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21355. },
  21356. owned: null,
  21357. namefrom: [ 'author' ],
  21358. context: null,
  21359. unsupported: false
  21360. },
  21361. 'doc-credit': {
  21362. type: 'section',
  21363. attributes: {
  21364. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21365. },
  21366. owned: null,
  21367. namefrom: [ 'author' ],
  21368. context: null,
  21369. unsupported: false,
  21370. allowedElements: [ 'section' ]
  21371. },
  21372. 'doc-credits': {
  21373. type: 'landmark',
  21374. attributes: {
  21375. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21376. },
  21377. owned: null,
  21378. namefrom: [ 'author' ],
  21379. context: null,
  21380. unsupported: false,
  21381. allowedElements: [ 'section' ]
  21382. },
  21383. 'doc-dedication': {
  21384. type: 'section',
  21385. attributes: {
  21386. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21387. },
  21388. owned: null,
  21389. namefrom: [ 'author' ],
  21390. context: null,
  21391. unsupported: false,
  21392. allowedElements: [ 'section' ]
  21393. },
  21394. 'doc-endnote': {
  21395. type: 'listitem',
  21396. attributes: {
  21397. allowed: [ 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
  21398. },
  21399. owned: null,
  21400. namefrom: [ 'author' ],
  21401. context: [ 'doc-endnotes' ],
  21402. unsupported: false,
  21403. allowedElements: [ 'li' ]
  21404. },
  21405. 'doc-endnotes': {
  21406. type: 'landmark',
  21407. attributes: {
  21408. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21409. },
  21410. owned: {
  21411. one: [ 'doc-endnote' ]
  21412. },
  21413. namefrom: [ 'author' ],
  21414. context: null,
  21415. unsupported: false,
  21416. allowedElements: [ 'section' ]
  21417. },
  21418. 'doc-epigraph': {
  21419. type: 'section',
  21420. attributes: {
  21421. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21422. },
  21423. owned: null,
  21424. namefrom: [ 'author' ],
  21425. context: null,
  21426. unsupported: false
  21427. },
  21428. 'doc-epilogue': {
  21429. type: 'landmark',
  21430. attributes: {
  21431. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21432. },
  21433. owned: null,
  21434. namefrom: [ 'author' ],
  21435. context: null,
  21436. unsupported: false,
  21437. allowedElements: [ 'section' ]
  21438. },
  21439. 'doc-errata': {
  21440. type: 'landmark',
  21441. attributes: {
  21442. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21443. },
  21444. owned: null,
  21445. namefrom: [ 'author' ],
  21446. context: null,
  21447. unsupported: false,
  21448. allowedElements: [ 'section' ]
  21449. },
  21450. 'doc-example': {
  21451. type: 'section',
  21452. attributes: {
  21453. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21454. },
  21455. owned: null,
  21456. namefrom: [ 'author' ],
  21457. context: null,
  21458. unsupported: false,
  21459. allowedElements: [ 'aside', 'section' ]
  21460. },
  21461. 'doc-footnote': {
  21462. type: 'section',
  21463. attributes: {
  21464. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21465. },
  21466. owned: null,
  21467. namefrom: [ 'author' ],
  21468. context: null,
  21469. unsupported: false,
  21470. allowedElements: [ 'aside', 'footer', 'header' ]
  21471. },
  21472. 'doc-foreword': {
  21473. type: 'landmark',
  21474. attributes: {
  21475. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21476. },
  21477. owned: null,
  21478. namefrom: [ 'author' ],
  21479. context: null,
  21480. unsupported: false,
  21481. allowedElements: [ 'section' ]
  21482. },
  21483. 'doc-glossary': {
  21484. type: 'landmark',
  21485. attributes: {
  21486. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21487. },
  21488. owned: [ 'term', 'definition' ],
  21489. namefrom: [ 'author' ],
  21490. context: null,
  21491. unsupported: false,
  21492. allowedElements: [ 'dl' ]
  21493. },
  21494. 'doc-glossref': {
  21495. type: 'link',
  21496. attributes: {
  21497. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21498. },
  21499. owned: null,
  21500. namefrom: [ 'author', 'contents' ],
  21501. context: null,
  21502. unsupported: false,
  21503. allowedElements: [ {
  21504. nodeName: 'a',
  21505. attributes: {
  21506. href: isNotNull
  21507. }
  21508. } ]
  21509. },
  21510. 'doc-index': {
  21511. type: 'navigation',
  21512. attributes: {
  21513. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21514. },
  21515. owned: null,
  21516. namefrom: [ 'author' ],
  21517. context: null,
  21518. unsupported: false,
  21519. allowedElements: [ 'nav', 'section' ]
  21520. },
  21521. 'doc-introduction': {
  21522. type: 'landmark',
  21523. attributes: {
  21524. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21525. },
  21526. owned: null,
  21527. namefrom: [ 'author' ],
  21528. context: null,
  21529. unsupported: false,
  21530. allowedElements: [ 'section' ]
  21531. },
  21532. 'doc-noteref': {
  21533. type: 'link',
  21534. attributes: {
  21535. allowed: [ 'aria-expanded' ]
  21536. },
  21537. owned: null,
  21538. namefrom: [ 'author', 'contents' ],
  21539. context: null,
  21540. unsupported: false,
  21541. allowedElements: [ {
  21542. nodeName: 'a',
  21543. attributes: {
  21544. href: isNotNull
  21545. }
  21546. } ]
  21547. },
  21548. 'doc-notice': {
  21549. type: 'note',
  21550. attributes: {
  21551. allowed: [ 'aria-expanded' ]
  21552. },
  21553. owned: null,
  21554. namefrom: [ 'author' ],
  21555. context: null,
  21556. unsupported: false,
  21557. allowedElements: [ 'section' ]
  21558. },
  21559. 'doc-pagebreak': {
  21560. type: 'separator',
  21561. attributes: {
  21562. allowed: [ 'aria-expanded' ]
  21563. },
  21564. owned: null,
  21565. namefrom: [ 'author' ],
  21566. context: null,
  21567. unsupported: false,
  21568. allowedElements: [ 'hr' ]
  21569. },
  21570. 'doc-pagelist': {
  21571. type: 'navigation',
  21572. attributes: {
  21573. allowed: [ 'aria-expanded' ]
  21574. },
  21575. owned: null,
  21576. namefrom: [ 'author' ],
  21577. context: null,
  21578. unsupported: false,
  21579. allowedElements: [ 'nav', 'section' ]
  21580. },
  21581. 'doc-part': {
  21582. type: 'landmark',
  21583. attributes: {
  21584. allowed: [ 'aria-expanded' ]
  21585. },
  21586. owned: null,
  21587. namefrom: [ 'author' ],
  21588. context: null,
  21589. unsupported: false,
  21590. allowedElements: [ 'section' ]
  21591. },
  21592. 'doc-preface': {
  21593. type: 'landmark',
  21594. attributes: {
  21595. allowed: [ 'aria-expanded' ]
  21596. },
  21597. owned: null,
  21598. namefrom: [ 'author' ],
  21599. context: null,
  21600. unsupported: false,
  21601. allowedElements: [ 'section' ]
  21602. },
  21603. 'doc-prologue': {
  21604. type: 'landmark',
  21605. attributes: {
  21606. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21607. },
  21608. owned: null,
  21609. namefrom: [ 'author' ],
  21610. context: null,
  21611. unsupported: false,
  21612. allowedElements: [ 'section' ]
  21613. },
  21614. 'doc-pullquote': {
  21615. type: 'none',
  21616. attributes: {
  21617. allowed: [ 'aria-expanded' ]
  21618. },
  21619. owned: null,
  21620. namefrom: [ 'author' ],
  21621. context: null,
  21622. unsupported: false,
  21623. allowedElements: [ 'aside', 'section' ]
  21624. },
  21625. 'doc-qna': {
  21626. type: 'section',
  21627. attributes: {
  21628. allowed: [ 'aria-expanded' ]
  21629. },
  21630. owned: null,
  21631. namefrom: [ 'author' ],
  21632. context: null,
  21633. unsupported: false,
  21634. allowedElements: [ 'section' ]
  21635. },
  21636. 'doc-subtitle': {
  21637. type: 'sectionhead',
  21638. attributes: {
  21639. allowed: [ 'aria-expanded' ]
  21640. },
  21641. owned: null,
  21642. namefrom: [ 'author' ],
  21643. context: null,
  21644. unsupported: false,
  21645. allowedElements: {
  21646. nodeName: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ]
  21647. }
  21648. },
  21649. 'doc-tip': {
  21650. type: 'note',
  21651. attributes: {
  21652. allowed: [ 'aria-expanded' ]
  21653. },
  21654. owned: null,
  21655. namefrom: [ 'author' ],
  21656. context: null,
  21657. unsupported: false,
  21658. allowedElements: [ 'aside' ]
  21659. },
  21660. 'doc-toc': {
  21661. type: 'navigation',
  21662. attributes: {
  21663. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21664. },
  21665. owned: null,
  21666. namefrom: [ 'author' ],
  21667. context: null,
  21668. unsupported: false,
  21669. allowedElements: [ 'nav', 'section' ]
  21670. },
  21671. feed: {
  21672. type: 'structure',
  21673. attributes: {
  21674. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21675. },
  21676. owned: {
  21677. one: [ 'article' ]
  21678. },
  21679. nameFrom: [ 'author' ],
  21680. context: null,
  21681. unsupported: false,
  21682. allowedElements: [ 'article', 'aside', 'section' ]
  21683. },
  21684. figure: {
  21685. type: 'structure',
  21686. attributes: {
  21687. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21688. },
  21689. owned: null,
  21690. nameFrom: [ 'author', 'contents' ],
  21691. context: null,
  21692. implicit: [ 'figure' ],
  21693. unsupported: false
  21694. },
  21695. form: {
  21696. type: 'landmark',
  21697. attributes: {
  21698. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21699. },
  21700. owned: null,
  21701. nameFrom: [ 'author' ],
  21702. context: null,
  21703. implicit: [ 'form' ],
  21704. unsupported: false
  21705. },
  21706. grid: {
  21707. type: 'composite',
  21708. attributes: {
  21709. allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-colcount', 'aria-level', 'aria-multiselectable', 'aria-readonly', 'aria-rowcount', 'aria-errormessage' ]
  21710. },
  21711. owned: {
  21712. one: [ 'rowgroup', 'row' ]
  21713. },
  21714. nameFrom: [ 'author' ],
  21715. context: null,
  21716. implicit: [ 'table' ],
  21717. unsupported: false
  21718. },
  21719. gridcell: {
  21720. type: 'widget',
  21721. attributes: {
  21722. allowed: [ 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan', 'aria-selected', 'aria-readonly', 'aria-required', 'aria-errormessage' ]
  21723. },
  21724. owned: null,
  21725. nameFrom: [ 'author', 'contents' ],
  21726. context: [ 'row' ],
  21727. implicit: [ 'td', 'th' ],
  21728. unsupported: false
  21729. },
  21730. group: {
  21731. type: 'structure',
  21732. attributes: {
  21733. allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-errormessage' ]
  21734. },
  21735. owned: null,
  21736. nameFrom: [ 'author' ],
  21737. context: null,
  21738. implicit: [ 'details', 'optgroup' ],
  21739. unsupported: false,
  21740. allowedElements: [ 'dl', 'figcaption', 'fieldset', 'figure', 'footer', 'header', 'ol', 'ul' ]
  21741. },
  21742. heading: {
  21743. type: 'structure',
  21744. attributes: {
  21745. required: [ 'aria-level' ],
  21746. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21747. },
  21748. owned: null,
  21749. nameFrom: [ 'author', 'contents' ],
  21750. context: null,
  21751. implicit: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ],
  21752. unsupported: false
  21753. },
  21754. img: {
  21755. type: 'structure',
  21756. attributes: {
  21757. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21758. },
  21759. owned: null,
  21760. nameFrom: [ 'author' ],
  21761. context: null,
  21762. implicit: [ 'img' ],
  21763. unsupported: false,
  21764. allowedElements: [ 'embed', 'iframe', 'object', 'svg' ]
  21765. },
  21766. input: {
  21767. nameFrom: [ 'author' ],
  21768. type: 'abstract',
  21769. unsupported: false
  21770. },
  21771. landmark: {
  21772. nameFrom: [ 'author' ],
  21773. type: 'abstract',
  21774. unsupported: false
  21775. },
  21776. link: {
  21777. type: 'widget',
  21778. attributes: {
  21779. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21780. },
  21781. owned: null,
  21782. nameFrom: [ 'author', 'contents' ],
  21783. context: null,
  21784. implicit: [ 'a[href]', 'area[href]' ],
  21785. unsupported: false,
  21786. allowedElements: [ 'button', {
  21787. nodeName: 'input',
  21788. properties: {
  21789. type: [ 'image', 'button' ]
  21790. }
  21791. } ]
  21792. },
  21793. list: {
  21794. type: 'structure',
  21795. attributes: {
  21796. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21797. },
  21798. owned: {
  21799. all: [ 'listitem' ]
  21800. },
  21801. nameFrom: [ 'author' ],
  21802. context: null,
  21803. implicit: [ 'ol', 'ul', 'dl' ],
  21804. unsupported: false
  21805. },
  21806. listbox: {
  21807. type: 'composite',
  21808. attributes: {
  21809. allowed: [ 'aria-activedescendant', 'aria-multiselectable', 'aria-readonly', 'aria-required', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ]
  21810. },
  21811. owned: {
  21812. all: [ 'option' ]
  21813. },
  21814. nameFrom: [ 'author' ],
  21815. context: null,
  21816. implicit: [ 'select' ],
  21817. unsupported: false,
  21818. allowedElements: [ 'ol', 'ul' ]
  21819. },
  21820. listitem: {
  21821. type: 'structure',
  21822. attributes: {
  21823. allowed: [ 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-expanded', 'aria-errormessage' ]
  21824. },
  21825. owned: null,
  21826. nameFrom: [ 'author', 'contents' ],
  21827. context: [ 'list' ],
  21828. implicit: [ 'li', 'dt' ],
  21829. unsupported: false
  21830. },
  21831. log: {
  21832. type: 'widget',
  21833. attributes: {
  21834. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21835. },
  21836. owned: null,
  21837. nameFrom: [ 'author' ],
  21838. context: null,
  21839. unsupported: false,
  21840. allowedElements: [ 'section' ]
  21841. },
  21842. main: {
  21843. type: 'landmark',
  21844. attributes: {
  21845. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21846. },
  21847. owned: null,
  21848. nameFrom: [ 'author' ],
  21849. context: null,
  21850. implicit: [ 'main' ],
  21851. unsupported: false,
  21852. allowedElements: [ 'article', 'section' ]
  21853. },
  21854. marquee: {
  21855. type: 'widget',
  21856. attributes: {
  21857. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21858. },
  21859. owned: null,
  21860. nameFrom: [ 'author' ],
  21861. context: null,
  21862. unsupported: false,
  21863. allowedElements: [ 'section' ]
  21864. },
  21865. math: {
  21866. type: 'structure',
  21867. attributes: {
  21868. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21869. },
  21870. owned: null,
  21871. nameFrom: [ 'author' ],
  21872. context: null,
  21873. implicit: [ 'math' ],
  21874. unsupported: false
  21875. },
  21876. menu: {
  21877. type: 'composite',
  21878. attributes: {
  21879. allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ]
  21880. },
  21881. owned: {
  21882. one: [ 'menuitem', 'menuitemradio', 'menuitemcheckbox' ]
  21883. },
  21884. nameFrom: [ 'author' ],
  21885. context: null,
  21886. implicit: [ 'menu[type="context"]' ],
  21887. unsupported: false,
  21888. allowedElements: [ 'ol', 'ul' ]
  21889. },
  21890. menubar: {
  21891. type: 'composite',
  21892. attributes: {
  21893. allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ]
  21894. },
  21895. owned: {
  21896. one: [ 'menuitem', 'menuitemradio', 'menuitemcheckbox' ]
  21897. },
  21898. nameFrom: [ 'author' ],
  21899. context: null,
  21900. unsupported: false,
  21901. allowedElements: [ 'ol', 'ul' ]
  21902. },
  21903. menuitem: {
  21904. type: 'widget',
  21905. attributes: {
  21906. allowed: [ 'aria-posinset', 'aria-setsize', 'aria-expanded', 'aria-errormessage' ]
  21907. },
  21908. owned: null,
  21909. nameFrom: [ 'author', 'contents' ],
  21910. context: [ 'menu', 'menubar' ],
  21911. implicit: [ 'menuitem[type="command"]' ],
  21912. unsupported: false,
  21913. allowedElements: [ 'button', 'li', {
  21914. nodeName: 'iput',
  21915. properties: {
  21916. type: [ 'image', 'button' ]
  21917. }
  21918. }, {
  21919. nodeName: 'a',
  21920. attributes: {
  21921. href: isNotNull
  21922. }
  21923. } ]
  21924. },
  21925. menuitemcheckbox: {
  21926. type: 'widget',
  21927. attributes: {
  21928. allowed: [ 'aria-checked', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
  21929. },
  21930. owned: null,
  21931. nameFrom: [ 'author', 'contents' ],
  21932. context: [ 'menu', 'menubar' ],
  21933. implicit: [ 'menuitem[type="checkbox"]' ],
  21934. unsupported: false,
  21935. allowedElements: [ {
  21936. nodeName: [ 'button', 'li' ]
  21937. }, {
  21938. nodeName: 'input',
  21939. properties: {
  21940. type: [ 'checkbox', 'image', 'button' ]
  21941. }
  21942. }, {
  21943. nodeName: 'a',
  21944. attributes: {
  21945. href: isNotNull
  21946. }
  21947. } ]
  21948. },
  21949. menuitemradio: {
  21950. type: 'widget',
  21951. attributes: {
  21952. allowed: [ 'aria-checked', 'aria-selected', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
  21953. },
  21954. owned: null,
  21955. nameFrom: [ 'author', 'contents' ],
  21956. context: [ 'menu', 'menubar' ],
  21957. implicit: [ 'menuitem[type="radio"]' ],
  21958. unsupported: false,
  21959. allowedElements: [ {
  21960. nodeName: [ 'button', 'li' ]
  21961. }, {
  21962. nodeName: 'input',
  21963. properties: {
  21964. type: [ 'image', 'button', 'radio' ]
  21965. }
  21966. }, {
  21967. nodeName: 'a',
  21968. attributes: {
  21969. href: isNotNull
  21970. }
  21971. } ]
  21972. },
  21973. navigation: {
  21974. type: 'landmark',
  21975. attributes: {
  21976. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  21977. },
  21978. owned: null,
  21979. nameFrom: [ 'author' ],
  21980. context: null,
  21981. implicit: [ 'nav' ],
  21982. unsupported: false,
  21983. allowedElements: [ 'section' ]
  21984. },
  21985. none: {
  21986. type: 'structure',
  21987. attributes: null,
  21988. owned: null,
  21989. nameFrom: [ 'author' ],
  21990. context: null,
  21991. unsupported: false,
  21992. allowedElements: [ {
  21993. nodeName: [ 'article', 'aside', 'dl', 'embed', 'figcaption', 'fieldset', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'iframe', 'li', 'ol', 'section', 'ul' ]
  21994. }, {
  21995. nodeName: 'img',
  21996. attributes: {
  21997. alt: isNotNull
  21998. }
  21999. } ]
  22000. },
  22001. note: {
  22002. type: 'structure',
  22003. attributes: {
  22004. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  22005. },
  22006. owned: null,
  22007. nameFrom: [ 'author' ],
  22008. context: null,
  22009. unsupported: false,
  22010. allowedElements: [ 'aside' ]
  22011. },
  22012. option: {
  22013. type: 'widget',
  22014. attributes: {
  22015. allowed: [ 'aria-selected', 'aria-posinset', 'aria-setsize', 'aria-checked', 'aria-errormessage' ]
  22016. },
  22017. owned: null,
  22018. nameFrom: [ 'author', 'contents' ],
  22019. context: [ 'listbox' ],
  22020. implicit: [ 'option' ],
  22021. unsupported: false,
  22022. allowedElements: [ {
  22023. nodeName: [ 'button', 'li' ]
  22024. }, {
  22025. nodeName: 'input',
  22026. properties: {
  22027. type: [ 'checkbox', 'button' ]
  22028. }
  22029. }, {
  22030. nodeName: 'a',
  22031. attributes: {
  22032. href: isNotNull
  22033. }
  22034. } ]
  22035. },
  22036. presentation: {
  22037. type: 'structure',
  22038. attributes: null,
  22039. owned: null,
  22040. nameFrom: [ 'author' ],
  22041. context: null,
  22042. unsupported: false,
  22043. allowedElements: [ {
  22044. nodeName: [ 'article', 'aside', 'dl', 'embed', 'figcaption', 'fieldset', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'iframe', 'li', 'ol', 'section', 'ul' ]
  22045. }, {
  22046. nodeName: 'img',
  22047. attributes: {
  22048. alt: isNotNull
  22049. }
  22050. } ]
  22051. },
  22052. progressbar: {
  22053. type: 'widget',
  22054. attributes: {
  22055. allowed: [ 'aria-valuetext', 'aria-valuenow', 'aria-valuemax', 'aria-valuemin', 'aria-expanded', 'aria-errormessage' ]
  22056. },
  22057. owned: null,
  22058. nameFrom: [ 'author' ],
  22059. context: null,
  22060. implicit: [ 'progress' ],
  22061. unsupported: false
  22062. },
  22063. radio: {
  22064. type: 'widget',
  22065. attributes: {
  22066. allowed: [ 'aria-selected', 'aria-posinset', 'aria-setsize', 'aria-required', 'aria-errormessage', 'aria-checked' ]
  22067. },
  22068. owned: null,
  22069. nameFrom: [ 'author', 'contents' ],
  22070. context: null,
  22071. implicit: [ 'input[type="radio"]' ],
  22072. unsupported: false,
  22073. allowedElements: [ {
  22074. nodeName: [ 'button', 'li' ]
  22075. }, {
  22076. nodeName: 'input',
  22077. properties: {
  22078. type: [ 'image', 'button' ]
  22079. }
  22080. } ]
  22081. },
  22082. radiogroup: {
  22083. type: 'composite',
  22084. attributes: {
  22085. allowed: [ 'aria-activedescendant', 'aria-required', 'aria-expanded', 'aria-readonly', 'aria-errormessage', 'aria-orientation' ]
  22086. },
  22087. owned: {
  22088. all: [ 'radio' ]
  22089. },
  22090. nameFrom: [ 'author' ],
  22091. context: null,
  22092. unsupported: false,
  22093. allowedElements: {
  22094. nodeName: [ 'ol', 'ul', 'fieldset' ]
  22095. }
  22096. },
  22097. range: {
  22098. nameFrom: [ 'author' ],
  22099. type: 'abstract',
  22100. unsupported: false
  22101. },
  22102. region: {
  22103. type: 'landmark',
  22104. attributes: {
  22105. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  22106. },
  22107. owned: null,
  22108. nameFrom: [ 'author' ],
  22109. context: null,
  22110. implicit: [ 'section[aria-label]', 'section[aria-labelledby]', 'section[title]' ],
  22111. unsupported: false,
  22112. allowedElements: {
  22113. nodeName: [ 'article', 'aside' ]
  22114. }
  22115. },
  22116. roletype: {
  22117. type: 'abstract',
  22118. unsupported: false
  22119. },
  22120. row: {
  22121. type: 'structure',
  22122. attributes: {
  22123. allowed: [ 'aria-activedescendant', 'aria-colindex', 'aria-expanded', 'aria-level', 'aria-selected', 'aria-rowindex', 'aria-errormessage' ]
  22124. },
  22125. owned: {
  22126. one: [ 'cell', 'columnheader', 'rowheader', 'gridcell' ]
  22127. },
  22128. nameFrom: [ 'author', 'contents' ],
  22129. context: [ 'rowgroup', 'grid', 'treegrid', 'table' ],
  22130. implicit: [ 'tr' ],
  22131. unsupported: false
  22132. },
  22133. rowgroup: {
  22134. type: 'structure',
  22135. attributes: {
  22136. allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-errormessage' ]
  22137. },
  22138. owned: {
  22139. all: [ 'row' ]
  22140. },
  22141. nameFrom: [ 'author', 'contents' ],
  22142. context: [ 'grid', 'table', 'treegrid' ],
  22143. implicit: [ 'tbody', 'thead', 'tfoot' ],
  22144. unsupported: false
  22145. },
  22146. rowheader: {
  22147. type: 'structure',
  22148. attributes: {
  22149. allowed: [ 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan', 'aria-required', 'aria-readonly', 'aria-selected', 'aria-sort', 'aria-errormessage' ]
  22150. },
  22151. owned: null,
  22152. nameFrom: [ 'author', 'contents' ],
  22153. context: [ 'row' ],
  22154. implicit: [ 'th' ],
  22155. unsupported: false
  22156. },
  22157. scrollbar: {
  22158. type: 'widget',
  22159. attributes: {
  22160. required: [ 'aria-controls', 'aria-valuenow' ],
  22161. allowed: [ 'aria-valuetext', 'aria-orientation', 'aria-errormessage', 'aria-valuemax', 'aria-valuemin' ]
  22162. },
  22163. owned: null,
  22164. nameFrom: [ 'author' ],
  22165. context: null,
  22166. unsupported: false
  22167. },
  22168. search: {
  22169. type: 'landmark',
  22170. attributes: {
  22171. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  22172. },
  22173. owned: null,
  22174. nameFrom: [ 'author' ],
  22175. context: null,
  22176. unsupported: false,
  22177. allowedElements: {
  22178. nodeName: [ 'aside', 'form', 'section' ]
  22179. }
  22180. },
  22181. searchbox: {
  22182. type: 'widget',
  22183. attributes: {
  22184. allowed: [ 'aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-readonly', 'aria-required', 'aria-placeholder', 'aria-errormessage' ]
  22185. },
  22186. owned: null,
  22187. nameFrom: [ 'author' ],
  22188. context: null,
  22189. implicit: [ 'input[type="search"]' ],
  22190. unsupported: false,
  22191. allowedElements: {
  22192. nodeName: 'input',
  22193. properties: {
  22194. type: 'text'
  22195. }
  22196. }
  22197. },
  22198. section: {
  22199. nameFrom: [ 'author', 'contents' ],
  22200. type: 'abstract',
  22201. unsupported: false
  22202. },
  22203. sectionhead: {
  22204. nameFrom: [ 'author', 'contents' ],
  22205. type: 'abstract',
  22206. unsupported: false
  22207. },
  22208. select: {
  22209. nameFrom: [ 'author' ],
  22210. type: 'abstract',
  22211. unsupported: false
  22212. },
  22213. separator: {
  22214. type: 'structure',
  22215. attributes: {
  22216. allowed: [ 'aria-expanded', 'aria-orientation', 'aria-valuenow', 'aria-valuemax', 'aria-valuemin', 'aria-valuetext', 'aria-errormessage' ]
  22217. },
  22218. owned: null,
  22219. nameFrom: [ 'author' ],
  22220. context: null,
  22221. implicit: [ 'hr' ],
  22222. unsupported: false,
  22223. allowedElements: [ 'li' ]
  22224. },
  22225. slider: {
  22226. type: 'widget',
  22227. attributes: {
  22228. allowed: [ 'aria-valuetext', 'aria-orientation', 'aria-readonly', 'aria-errormessage', 'aria-valuemax', 'aria-valuemin' ],
  22229. required: [ 'aria-valuenow' ]
  22230. },
  22231. owned: null,
  22232. nameFrom: [ 'author' ],
  22233. context: null,
  22234. implicit: [ 'input[type="range"]' ],
  22235. unsupported: false
  22236. },
  22237. spinbutton: {
  22238. type: 'widget',
  22239. attributes: {
  22240. allowed: [ 'aria-valuetext', 'aria-required', 'aria-readonly', 'aria-errormessage', 'aria-valuemax', 'aria-valuemin' ],
  22241. required: [ 'aria-valuenow' ]
  22242. },
  22243. owned: null,
  22244. nameFrom: [ 'author' ],
  22245. context: null,
  22246. implicit: [ 'input[type="number"]' ],
  22247. unsupported: false,
  22248. allowedElements: {
  22249. nodeName: 'input',
  22250. properties: {
  22251. type: [ 'text', 'tel' ]
  22252. }
  22253. }
  22254. },
  22255. status: {
  22256. type: 'widget',
  22257. attributes: {
  22258. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  22259. },
  22260. owned: null,
  22261. nameFrom: [ 'author' ],
  22262. context: null,
  22263. implicit: [ 'output' ],
  22264. unsupported: false,
  22265. allowedElements: [ 'section' ]
  22266. },
  22267. structure: {
  22268. type: 'abstract',
  22269. unsupported: false
  22270. },
  22271. switch: {
  22272. type: 'widget',
  22273. attributes: {
  22274. allowed: [ 'aria-errormessage' ],
  22275. required: [ 'aria-checked' ]
  22276. },
  22277. owned: null,
  22278. nameFrom: [ 'author', 'contents' ],
  22279. context: null,
  22280. unsupported: false,
  22281. allowedElements: [ 'button', {
  22282. nodeName: 'input',
  22283. properties: {
  22284. type: [ 'checkbox', 'image', 'button' ]
  22285. }
  22286. }, {
  22287. nodeName: 'a',
  22288. attributes: {
  22289. href: isNotNull
  22290. }
  22291. } ]
  22292. },
  22293. tab: {
  22294. type: 'widget',
  22295. attributes: {
  22296. allowed: [ 'aria-selected', 'aria-expanded', 'aria-setsize', 'aria-posinset', 'aria-errormessage' ]
  22297. },
  22298. owned: null,
  22299. nameFrom: [ 'author', 'contents' ],
  22300. context: [ 'tablist' ],
  22301. unsupported: false,
  22302. allowedElements: [ {
  22303. nodeName: [ 'button', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'li' ]
  22304. }, {
  22305. nodeName: 'input',
  22306. properties: {
  22307. type: 'button'
  22308. }
  22309. }, {
  22310. nodeName: 'a',
  22311. attributes: {
  22312. href: isNotNull
  22313. }
  22314. } ]
  22315. },
  22316. table: {
  22317. type: 'structure',
  22318. attributes: {
  22319. allowed: [ 'aria-colcount', 'aria-rowcount', 'aria-errormessage' ]
  22320. },
  22321. owned: {
  22322. one: [ 'rowgroup', 'row' ]
  22323. },
  22324. nameFrom: [ 'author', 'contents' ],
  22325. context: null,
  22326. implicit: [ 'table' ],
  22327. unsupported: false
  22328. },
  22329. tablist: {
  22330. type: 'composite',
  22331. attributes: {
  22332. allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-level', 'aria-multiselectable', 'aria-orientation', 'aria-errormessage' ]
  22333. },
  22334. owned: {
  22335. all: [ 'tab' ]
  22336. },
  22337. nameFrom: [ 'author' ],
  22338. context: null,
  22339. unsupported: false,
  22340. allowedElements: [ 'ol', 'ul' ]
  22341. },
  22342. tabpanel: {
  22343. type: 'widget',
  22344. attributes: {
  22345. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  22346. },
  22347. owned: null,
  22348. nameFrom: [ 'author' ],
  22349. context: null,
  22350. unsupported: false,
  22351. allowedElements: [ 'section' ]
  22352. },
  22353. term: {
  22354. type: 'structure',
  22355. attributes: {
  22356. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  22357. },
  22358. owned: null,
  22359. nameFrom: [ 'author', 'contents' ],
  22360. context: null,
  22361. implicit: [ 'dt' ],
  22362. unsupported: false
  22363. },
  22364. textbox: {
  22365. type: 'widget',
  22366. attributes: {
  22367. allowed: [ 'aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-readonly', 'aria-required', 'aria-placeholder', 'aria-errormessage' ]
  22368. },
  22369. owned: null,
  22370. nameFrom: [ 'author' ],
  22371. context: null,
  22372. implicit: [ 'input[type="text"]', 'input[type="email"]', 'input[type="password"]', 'input[type="tel"]', 'input[type="url"]', 'input:not([type])', 'textarea' ],
  22373. unsupported: false
  22374. },
  22375. timer: {
  22376. type: 'widget',
  22377. attributes: {
  22378. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  22379. },
  22380. owned: null,
  22381. nameFrom: [ 'author' ],
  22382. context: null,
  22383. unsupported: false
  22384. },
  22385. toolbar: {
  22386. type: 'structure',
  22387. attributes: {
  22388. allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ]
  22389. },
  22390. owned: null,
  22391. nameFrom: [ 'author' ],
  22392. context: null,
  22393. implicit: [ 'menu[type="toolbar"]' ],
  22394. unsupported: false,
  22395. allowedElements: [ 'ol', 'ul' ]
  22396. },
  22397. tooltip: {
  22398. type: 'structure',
  22399. attributes: {
  22400. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  22401. },
  22402. owned: null,
  22403. nameFrom: [ 'author', 'contents' ],
  22404. context: null,
  22405. unsupported: false
  22406. },
  22407. tree: {
  22408. type: 'composite',
  22409. attributes: {
  22410. allowed: [ 'aria-activedescendant', 'aria-multiselectable', 'aria-required', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ]
  22411. },
  22412. owned: {
  22413. all: [ 'treeitem' ]
  22414. },
  22415. nameFrom: [ 'author' ],
  22416. context: null,
  22417. unsupported: false,
  22418. allowedElements: [ 'ol', 'ul' ]
  22419. },
  22420. treegrid: {
  22421. type: 'composite',
  22422. attributes: {
  22423. allowed: [ 'aria-activedescendant', 'aria-colcount', 'aria-expanded', 'aria-level', 'aria-multiselectable', 'aria-readonly', 'aria-required', 'aria-rowcount', 'aria-orientation', 'aria-errormessage' ]
  22424. },
  22425. owned: {
  22426. one: [ 'rowgroup', 'row' ]
  22427. },
  22428. nameFrom: [ 'author' ],
  22429. context: null,
  22430. unsupported: false
  22431. },
  22432. treeitem: {
  22433. type: 'widget',
  22434. attributes: {
  22435. allowed: [ 'aria-checked', 'aria-selected', 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
  22436. },
  22437. owned: null,
  22438. nameFrom: [ 'author', 'contents' ],
  22439. context: [ 'group', 'tree' ],
  22440. unsupported: false,
  22441. allowedElements: [ 'li', {
  22442. nodeName: 'a',
  22443. attributes: {
  22444. href: isNotNull
  22445. }
  22446. } ]
  22447. },
  22448. widget: {
  22449. type: 'abstract',
  22450. unsupported: false
  22451. },
  22452. window: {
  22453. nameFrom: [ 'author' ],
  22454. type: 'abstract',
  22455. unsupported: false
  22456. }
  22457. };
  22458. lookupTable.implicitHtmlRole = implicit_html_roles_default;
  22459. lookupTable.elementsAllowedNoRole = [ {
  22460. nodeName: [ 'base', 'body', 'caption', 'col', 'colgroup', 'datalist', 'dd', 'details', 'dt', 'head', 'html', 'keygen', 'label', 'legend', 'main', 'map', 'math', 'meta', 'meter', 'noscript', 'optgroup', 'param', 'picture', 'progress', 'script', 'source', 'style', 'template', 'textarea', 'title', 'track' ]
  22461. }, {
  22462. nodeName: 'area',
  22463. attributes: {
  22464. href: isNotNull
  22465. }
  22466. }, {
  22467. nodeName: 'input',
  22468. properties: {
  22469. type: [ 'color', 'data', 'datatime', 'file', 'hidden', 'month', 'number', 'password', 'range', 'reset', 'submit', 'time', 'week' ]
  22470. }
  22471. }, {
  22472. nodeName: 'link',
  22473. attributes: {
  22474. href: isNotNull
  22475. }
  22476. }, {
  22477. nodeName: 'menu',
  22478. attributes: {
  22479. type: 'context'
  22480. }
  22481. }, {
  22482. nodeName: 'menuitem',
  22483. attributes: {
  22484. type: [ 'command', 'checkbox', 'radio' ]
  22485. }
  22486. }, {
  22487. nodeName: 'select',
  22488. condition: function condition(vNode) {
  22489. if (!(vNode instanceof axe.AbstractVirtualNode)) {
  22490. vNode = axe.utils.getNodeFromTree(vNode);
  22491. }
  22492. return Number(vNode.attr('size')) > 1;
  22493. },
  22494. properties: {
  22495. multiple: true
  22496. }
  22497. }, {
  22498. nodeName: [ 'clippath', 'cursor', 'defs', 'desc', 'feblend', 'fecolormatrix', 'fecomponenttransfer', 'fecomposite', 'feconvolvematrix', 'fediffuselighting', 'fedisplacementmap', 'fedistantlight', 'fedropshadow', 'feflood', 'fefunca', 'fefuncb', 'fefuncg', 'fefuncr', 'fegaussianblur', 'feimage', 'femerge', 'femergenode', 'femorphology', 'feoffset', 'fepointlight', 'fespecularlighting', 'fespotlight', 'fetile', 'feturbulence', 'filter', 'hatch', 'hatchpath', 'lineargradient', 'marker', 'mask', 'meshgradient', 'meshpatch', 'meshrow', 'metadata', 'mpath', 'pattern', 'radialgradient', 'solidcolor', 'stop', 'switch', 'view' ]
  22499. } ];
  22500. lookupTable.elementsAllowedAnyRole = [ {
  22501. nodeName: 'a',
  22502. attributes: {
  22503. href: isNull
  22504. }
  22505. }, {
  22506. nodeName: 'img',
  22507. attributes: {
  22508. alt: isNull
  22509. }
  22510. }, {
  22511. nodeName: [ 'abbr', 'address', 'canvas', 'div', 'p', 'pre', 'blockquote', 'ins', 'del', 'output', 'span', 'table', 'tbody', 'thead', 'tfoot', 'td', 'em', 'strong', 'small', 's', 'cite', 'q', 'dfn', 'abbr', 'time', 'code', 'var', 'samp', 'kbd', 'sub', 'sup', 'i', 'b', 'u', 'mark', 'ruby', 'rt', 'rp', 'bdi', 'bdo', 'br', 'wbr', 'th', 'tr' ]
  22512. } ];
  22513. lookupTable.evaluateRoleForElement = {
  22514. A: function A(_ref83) {
  22515. var node = _ref83.node, out = _ref83.out;
  22516. if (node.namespaceURI === 'http://www.w3.org/2000/svg') {
  22517. return true;
  22518. }
  22519. if (node.href.length) {
  22520. return out;
  22521. }
  22522. return true;
  22523. },
  22524. AREA: function AREA(_ref84) {
  22525. var node = _ref84.node;
  22526. return !node.href;
  22527. },
  22528. BUTTON: function BUTTON(_ref85) {
  22529. var node = _ref85.node, role = _ref85.role, out = _ref85.out;
  22530. if (node.getAttribute('type') === 'menu') {
  22531. return role === 'menuitem';
  22532. }
  22533. return out;
  22534. },
  22535. IMG: function IMG(_ref86) {
  22536. var node = _ref86.node, role = _ref86.role, out = _ref86.out;
  22537. switch (node.alt) {
  22538. case null:
  22539. return out;
  22540. case '':
  22541. return role === 'presentation' || role === 'none';
  22542. default:
  22543. return role !== 'presentation' && role !== 'none';
  22544. }
  22545. },
  22546. INPUT: function INPUT(_ref87) {
  22547. var node = _ref87.node, role = _ref87.role, out = _ref87.out;
  22548. switch (node.type) {
  22549. case 'button':
  22550. case 'image':
  22551. return out;
  22552. case 'checkbox':
  22553. if (role === 'button' && node.hasAttribute('aria-pressed')) {
  22554. return true;
  22555. }
  22556. return out;
  22557. case 'radio':
  22558. return role === 'menuitemradio';
  22559. case 'text':
  22560. return role === 'combobox' || role === 'searchbox' || role === 'spinbutton';
  22561. case 'tel':
  22562. return role === 'combobox' || role === 'spinbutton';
  22563. case 'url':
  22564. case 'search':
  22565. case 'email':
  22566. return role === 'combobox';
  22567. default:
  22568. return false;
  22569. }
  22570. },
  22571. LI: function LI(_ref88) {
  22572. var node = _ref88.node, out = _ref88.out;
  22573. var hasImplicitListitemRole = axe.utils.matchesSelector(node, 'ol li, ul li');
  22574. if (hasImplicitListitemRole) {
  22575. return out;
  22576. }
  22577. return true;
  22578. },
  22579. MENU: function MENU(_ref89) {
  22580. var node = _ref89.node;
  22581. if (node.getAttribute('type') === 'context') {
  22582. return false;
  22583. }
  22584. return true;
  22585. },
  22586. OPTION: function OPTION(_ref90) {
  22587. var node = _ref90.node;
  22588. var withinOptionList = axe.utils.matchesSelector(node, 'select > option, datalist > option, optgroup > option');
  22589. return !withinOptionList;
  22590. },
  22591. SELECT: function SELECT(_ref91) {
  22592. var node = _ref91.node, role = _ref91.role;
  22593. return !node.multiple && node.size <= 1 && role === 'menu';
  22594. },
  22595. SVG: function SVG(_ref92) {
  22596. var node = _ref92.node, out = _ref92.out;
  22597. if (node.parentNode && node.parentNode.namespaceURI === 'http://www.w3.org/2000/svg') {
  22598. return true;
  22599. }
  22600. return out;
  22601. }
  22602. };
  22603. lookupTable.rolesOfType = {
  22604. widget: [ 'button', 'checkbox', 'dialog', 'gridcell', 'link', 'log', 'marquee', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'progressbar', 'radio', 'scrollbar', 'searchbox', 'slider', 'spinbutton', 'status', 'switch', 'tab', 'tabpanel', 'textbox', 'timer', 'tooltip', 'tree', 'treeitem' ]
  22605. };
  22606. var lookup_table_default = lookupTable;
  22607. function implicitNodes(role) {
  22608. var implicit = null;
  22609. var roles = lookup_table_default.role[role];
  22610. if (roles && roles.implicit) {
  22611. implicit = _clone(roles.implicit);
  22612. }
  22613. return implicit;
  22614. }
  22615. var implicit_nodes_default = implicitNodes;
  22616. function isAccessibleRef(node) {
  22617. return !!get_accessible_refs_default(node).length;
  22618. }
  22619. var is_accessible_ref_default = isAccessibleRef;
  22620. function _isComboboxPopup(virtualNode) {
  22621. var _popupRoles;
  22622. var _ref93 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, popupRoles = _ref93.popupRoles;
  22623. var role = get_role_default(virtualNode);
  22624. (_popupRoles = popupRoles) !== null && _popupRoles !== void 0 ? _popupRoles : popupRoles = aria_attrs_default['aria-haspopup'].values;
  22625. if (!popupRoles.includes(role)) {
  22626. return false;
  22627. }
  22628. var vParent = nearestParentWithRole(virtualNode);
  22629. if (isCombobox(vParent)) {
  22630. return true;
  22631. }
  22632. var id = virtualNode.props.id;
  22633. if (!id) {
  22634. return false;
  22635. }
  22636. if (!virtualNode.actualNode) {
  22637. throw new Error('Unable to determine combobox popup without an actualNode');
  22638. }
  22639. var root = get_root_node_default(virtualNode.actualNode);
  22640. var ownedCombobox = root.querySelectorAll('[aria-owns~="'.concat(id, '"][role~="combobox"]:not(select),\n [aria-controls~="').concat(id, '"][role~="combobox"]:not(select)'));
  22641. return Array.from(ownedCombobox).some(isCombobox);
  22642. }
  22643. var isCombobox = function isCombobox(node) {
  22644. return node && get_role_default(node) === 'combobox';
  22645. };
  22646. function nearestParentWithRole(vNode) {
  22647. while (vNode = vNode.parent) {
  22648. if (get_role_default(vNode, {
  22649. noPresentational: true
  22650. }) !== null) {
  22651. return vNode;
  22652. }
  22653. }
  22654. return null;
  22655. }
  22656. function label2(node) {
  22657. node = get_node_from_tree_default(node);
  22658. return label_virtual_default(node);
  22659. }
  22660. var label_default2 = label2;
  22661. function requiredAttr(role) {
  22662. var roleDef = standards_default.ariaRoles[role];
  22663. if (!roleDef || !Array.isArray(roleDef.requiredAttrs)) {
  22664. return [];
  22665. }
  22666. return _toConsumableArray(roleDef.requiredAttrs);
  22667. }
  22668. var required_attr_default = requiredAttr;
  22669. function requiredContext(role) {
  22670. var roleDef = standards_default.ariaRoles[role];
  22671. if (!roleDef || !Array.isArray(roleDef.requiredContext)) {
  22672. return null;
  22673. }
  22674. return _toConsumableArray(roleDef.requiredContext);
  22675. }
  22676. var required_context_default = requiredContext;
  22677. function requiredOwned(role) {
  22678. var roleDef = standards_default.ariaRoles[role];
  22679. if (!roleDef || !Array.isArray(roleDef.requiredOwned)) {
  22680. return null;
  22681. }
  22682. return _toConsumableArray(roleDef.requiredOwned);
  22683. }
  22684. var required_owned_default = requiredOwned;
  22685. function validateAttrValue(vNode, attr) {
  22686. vNode = vNode instanceof abstract_virtual_node_default ? vNode : get_node_from_tree_default(vNode);
  22687. var matches4;
  22688. var list;
  22689. var value = vNode.attr(attr);
  22690. var attrInfo = standards_default.ariaAttrs[attr];
  22691. if (!attrInfo) {
  22692. return true;
  22693. }
  22694. if (attrInfo.allowEmpty && (!value || value.trim() === '')) {
  22695. return true;
  22696. }
  22697. switch (attrInfo.type) {
  22698. case 'boolean':
  22699. return [ 'true', 'false' ].includes(value.toLowerCase());
  22700. case 'nmtoken':
  22701. return typeof value === 'string' && attrInfo.values.includes(value.toLowerCase());
  22702. case 'nmtokens':
  22703. list = token_list_default(value);
  22704. return list.reduce(function(result, token) {
  22705. return result && attrInfo.values.includes(token);
  22706. }, list.length !== 0);
  22707. case 'idref':
  22708. try {
  22709. var doc = get_root_node_default2(vNode.actualNode);
  22710. return !!(value && doc.getElementById(value));
  22711. } catch (_unused6) {
  22712. throw new TypeError('Cannot resolve id references for partial DOM');
  22713. }
  22714. case 'idrefs':
  22715. return idrefs_default(vNode, attr).some(function(node) {
  22716. return !!node;
  22717. });
  22718. case 'string':
  22719. return value.trim() !== '';
  22720. case 'decimal':
  22721. matches4 = value.match(/^[-+]?([0-9]*)\.?([0-9]*)$/);
  22722. return !!(matches4 && (matches4[1] || matches4[2]));
  22723. case 'int':
  22724. var minValue = typeof attrInfo.minValue !== 'undefined' ? attrInfo.minValue : -Infinity;
  22725. return /^[-+]?[0-9]+$/.test(value) && parseInt(value) >= minValue;
  22726. }
  22727. }
  22728. var validate_attr_value_default = validateAttrValue;
  22729. function validateAttr(att) {
  22730. var attrDefinition = standards_default.ariaAttrs[att];
  22731. return !!attrDefinition;
  22732. }
  22733. var validate_attr_default = validateAttr;
  22734. function tdHasHeaderEvaluate(node) {
  22735. var badCells = [];
  22736. var cells = get_all_cells_default(node);
  22737. var tableGrid = to_grid_default(node);
  22738. cells.forEach(function(cell) {
  22739. if (has_content_default(cell) && is_data_cell_default(cell) && !label_default2(cell)) {
  22740. var hasHeaders = get_headers_default(cell, tableGrid).some(function(header) {
  22741. return header !== null && !!has_content_default(header);
  22742. });
  22743. if (!hasHeaders) {
  22744. badCells.push(cell);
  22745. }
  22746. }
  22747. });
  22748. if (badCells.length) {
  22749. this.relatedNodes(badCells);
  22750. return false;
  22751. }
  22752. return true;
  22753. }
  22754. var td_has_header_evaluate_default = tdHasHeaderEvaluate;
  22755. function scopeValueEvaluate(node, options) {
  22756. var value = node.getAttribute('scope').toLowerCase();
  22757. return options.values.indexOf(value) !== -1;
  22758. }
  22759. var scope_value_evaluate_default = scopeValueEvaluate;
  22760. var same_caption_summary_evaluate_default = sameCaptionSummaryEvaluate;
  22761. function sameCaptionSummaryEvaluate(node, options, virtualNode) {
  22762. if (virtualNode.children === void 0) {
  22763. return void 0;
  22764. }
  22765. var summary = virtualNode.attr('summary');
  22766. var captionNode = virtualNode.children.find(isCaptionNode);
  22767. var caption = captionNode ? sanitize_default(subtree_text_default(captionNode)) : false;
  22768. if (!caption || !summary) {
  22769. return false;
  22770. }
  22771. return sanitize_default(summary).toLowerCase() === sanitize_default(caption).toLowerCase();
  22772. }
  22773. function isCaptionNode(virtualNode) {
  22774. return virtualNode.props.nodeName === 'caption';
  22775. }
  22776. function html5ScopeEvaluate(node) {
  22777. if (!is_html5_default(document)) {
  22778. return true;
  22779. }
  22780. return node.nodeName.toUpperCase() === 'TH';
  22781. }
  22782. var html5_scope_evaluate_default = html5ScopeEvaluate;
  22783. function captionFakedEvaluate(node) {
  22784. var table = to_grid_default(node);
  22785. var firstRow = table[0];
  22786. if (table.length <= 1 || firstRow.length <= 1 || node.rows.length <= 1) {
  22787. return true;
  22788. }
  22789. return firstRow.reduce(function(out, curr, i) {
  22790. return out || curr !== firstRow[i + 1] && firstRow[i + 1] !== void 0;
  22791. }, false);
  22792. }
  22793. var caption_faked_evaluate_default = captionFakedEvaluate;
  22794. function svgNonEmptyTitleEvaluate(node, options, virtualNode) {
  22795. if (!virtualNode.children) {
  22796. return void 0;
  22797. }
  22798. var titleNode = virtualNode.children.find(function(_ref94) {
  22799. var props = _ref94.props;
  22800. return props.nodeName === 'title';
  22801. });
  22802. if (!titleNode) {
  22803. this.data({
  22804. messageKey: 'noTitle'
  22805. });
  22806. return false;
  22807. }
  22808. try {
  22809. var titleText2 = subtree_text_default(titleNode, {
  22810. includeHidden: true
  22811. }).trim();
  22812. if (titleText2 === '') {
  22813. this.data({
  22814. messageKey: 'emptyTitle'
  22815. });
  22816. return false;
  22817. }
  22818. } catch (_unused7) {
  22819. return void 0;
  22820. }
  22821. return true;
  22822. }
  22823. var svg_non_empty_title_evaluate_default = svgNonEmptyTitleEvaluate;
  22824. var standards_exports = {};
  22825. __export(standards_exports, {
  22826. getAriaRolesByType: function getAriaRolesByType() {
  22827. return get_aria_roles_by_type_default;
  22828. },
  22829. getAriaRolesSupportingNameFromContent: function getAriaRolesSupportingNameFromContent() {
  22830. return get_aria_roles_supporting_name_from_content_default;
  22831. },
  22832. getElementSpec: function getElementSpec() {
  22833. return get_element_spec_default;
  22834. },
  22835. getElementsByContentType: function getElementsByContentType() {
  22836. return get_elements_by_content_type_default;
  22837. },
  22838. getGlobalAriaAttrs: function getGlobalAriaAttrs() {
  22839. return get_global_aria_attrs_default;
  22840. },
  22841. implicitHtmlRoles: function implicitHtmlRoles() {
  22842. return implicit_html_roles_default;
  22843. }
  22844. });
  22845. function presentationalRoleEvaluate(node, options, virtualNode) {
  22846. var explicitRole2 = get_explicit_role_default(virtualNode);
  22847. if ([ 'presentation', 'none' ].includes(explicitRole2) && [ 'iframe', 'frame' ].includes(virtualNode.props.nodeName) && virtualNode.hasAttr('title')) {
  22848. this.data({
  22849. messageKey: 'iframe',
  22850. nodeName: virtualNode.props.nodeName
  22851. });
  22852. return false;
  22853. }
  22854. var role = get_role_default(virtualNode);
  22855. if ([ 'presentation', 'none' ].includes(role)) {
  22856. this.data({
  22857. role: role
  22858. });
  22859. return true;
  22860. }
  22861. if (![ 'presentation', 'none' ].includes(explicitRole2)) {
  22862. return false;
  22863. }
  22864. var hasGlobalAria = get_global_aria_attrs_default().some(function(attr) {
  22865. return virtualNode.hasAttr(attr);
  22866. });
  22867. var focusable = _isFocusable(virtualNode);
  22868. var messageKey;
  22869. if (hasGlobalAria && !focusable) {
  22870. messageKey = 'globalAria';
  22871. } else if (!hasGlobalAria && focusable) {
  22872. messageKey = 'focusable';
  22873. } else {
  22874. messageKey = 'both';
  22875. }
  22876. this.data({
  22877. messageKey: messageKey,
  22878. role: role
  22879. });
  22880. return false;
  22881. }
  22882. function nonEmptyIfPresentEvaluate(node, options, virtualNode) {
  22883. var nodeName2 = virtualNode.props.nodeName;
  22884. var type2 = (virtualNode.attr('type') || '').toLowerCase();
  22885. var label3 = virtualNode.attr('value');
  22886. if (label3) {
  22887. this.data({
  22888. messageKey: 'has-label'
  22889. });
  22890. }
  22891. if (nodeName2 === 'input' && [ 'submit', 'reset' ].includes(type2)) {
  22892. return label3 === null;
  22893. }
  22894. return false;
  22895. }
  22896. var non_empty_if_present_evaluate_default = nonEmptyIfPresentEvaluate;
  22897. function isOnScreenEvaluate(node) {
  22898. return _isVisibleOnScreen(node);
  22899. }
  22900. var is_on_screen_evaluate_default = isOnScreenEvaluate;
  22901. function inlineStyleProperty(node, options) {
  22902. var cssProperty = options.cssProperty, absoluteValues = options.absoluteValues, minValue = options.minValue, maxValue = options.maxValue, _options$normalValue = options.normalValue, normalValue = _options$normalValue === void 0 ? 0 : _options$normalValue, noImportant = options.noImportant, multiLineOnly = options.multiLineOnly;
  22903. if (!noImportant && node.style.getPropertyPriority(cssProperty) !== 'important' || multiLineOnly && !_isMultiline(node)) {
  22904. return true;
  22905. }
  22906. var data = {};
  22907. if (typeof minValue === 'number') {
  22908. data.minValue = minValue;
  22909. }
  22910. if (typeof maxValue === 'number') {
  22911. data.maxValue = maxValue;
  22912. }
  22913. var declaredPropValue = node.style.getPropertyValue(cssProperty);
  22914. if ([ 'inherit', 'unset', 'revert', 'revert-layer' ].includes(declaredPropValue)) {
  22915. this.data(_extends({
  22916. value: declaredPropValue
  22917. }, data));
  22918. return true;
  22919. }
  22920. var value = getNumberValue(node, {
  22921. absoluteValues: absoluteValues,
  22922. cssProperty: cssProperty,
  22923. normalValue: normalValue
  22924. });
  22925. this.data(_extends({
  22926. value: value
  22927. }, data));
  22928. if (typeof value !== 'number') {
  22929. return void 0;
  22930. }
  22931. if ((typeof minValue !== 'number' || value >= minValue) && (typeof maxValue !== 'number' || value <= maxValue)) {
  22932. return true;
  22933. }
  22934. return false;
  22935. }
  22936. function getNumberValue(domNode, _ref95) {
  22937. var cssProperty = _ref95.cssProperty, absoluteValues = _ref95.absoluteValues, normalValue = _ref95.normalValue;
  22938. var computedStyle = window.getComputedStyle(domNode);
  22939. var cssPropValue = computedStyle.getPropertyValue(cssProperty);
  22940. if (cssPropValue === 'normal') {
  22941. return normalValue;
  22942. }
  22943. var parsedValue = parseFloat(cssPropValue);
  22944. if (absoluteValues) {
  22945. return parsedValue;
  22946. }
  22947. var fontSize = parseFloat(computedStyle.getPropertyValue('font-size'));
  22948. var value = Math.round(parsedValue / fontSize * 100) / 100;
  22949. if (isNaN(value)) {
  22950. return cssPropValue;
  22951. }
  22952. return value;
  22953. }
  22954. function hasAltEvaluate(node, options, virtualNode) {
  22955. var nodeName2 = virtualNode.props.nodeName;
  22956. if (![ 'img', 'input', 'area' ].includes(nodeName2)) {
  22957. return false;
  22958. }
  22959. return virtualNode.hasAttr('alt');
  22960. }
  22961. var has_alt_evaluate_default = hasAltEvaluate;
  22962. function existsEvaluate() {
  22963. return void 0;
  22964. }
  22965. var exists_evaluate_default = existsEvaluate;
  22966. function docHasTitleEvaluate() {
  22967. var title = document.title;
  22968. return !!sanitize_default(title);
  22969. }
  22970. var doc_has_title_evaluate_default = docHasTitleEvaluate;
  22971. function avoidInlineSpacingEvaluate(node, options) {
  22972. var overriddenProperties = options.cssProperties.filter(function(property) {
  22973. if (node.style.getPropertyPriority(property) === 'important') {
  22974. return property;
  22975. }
  22976. });
  22977. if (overriddenProperties.length > 0) {
  22978. this.data(overriddenProperties);
  22979. return false;
  22980. }
  22981. return true;
  22982. }
  22983. var avoid_inline_spacing_evaluate_default = avoidInlineSpacingEvaluate;
  22984. function ariaLabelledbyEvaluate(node, options, virtualNode) {
  22985. try {
  22986. return !!sanitize_default(arialabelledby_text_default(virtualNode));
  22987. } catch (_unused8) {
  22988. return void 0;
  22989. }
  22990. }
  22991. var aria_labelledby_evaluate_default = ariaLabelledbyEvaluate;
  22992. function ariaLabelEvaluate(node, options, virtualNode) {
  22993. return !!sanitize_default(_arialabelText(virtualNode));
  22994. }
  22995. var aria_label_evaluate_default = ariaLabelEvaluate;
  22996. function duplicateIdEvaluate(node) {
  22997. var id = node.getAttribute('id').trim();
  22998. if (!id) {
  22999. return true;
  23000. }
  23001. var root = get_root_node_default2(node);
  23002. var matchingNodes = Array.from(root.querySelectorAll('[id="'.concat(escape_selector_default(id), '"]'))).filter(function(foundNode) {
  23003. return foundNode !== node;
  23004. });
  23005. if (matchingNodes.length) {
  23006. this.relatedNodes(matchingNodes);
  23007. }
  23008. this.data(id);
  23009. return matchingNodes.length === 0;
  23010. }
  23011. var duplicate_id_evaluate_default = duplicateIdEvaluate;
  23012. function duplicateIdAfter(results) {
  23013. var uniqueIds = [];
  23014. return results.filter(function(r) {
  23015. if (uniqueIds.indexOf(r.data) === -1) {
  23016. uniqueIds.push(r.data);
  23017. return true;
  23018. }
  23019. return false;
  23020. });
  23021. }
  23022. var duplicate_id_after_default = duplicateIdAfter;
  23023. function uniqueFrameTitleEvaluate(node, options, vNode) {
  23024. var title = sanitize_default(vNode.attr('title')).toLowerCase();
  23025. this.data(title);
  23026. return true;
  23027. }
  23028. var unique_frame_title_evaluate_default = uniqueFrameTitleEvaluate;
  23029. function uniqueFrameTitleAfter(results) {
  23030. var titles = {};
  23031. results.forEach(function(r) {
  23032. titles[r.data] = titles[r.data] !== void 0 ? ++titles[r.data] : 0;
  23033. });
  23034. results.forEach(function(r) {
  23035. r.result = !!titles[r.data];
  23036. });
  23037. return results;
  23038. }
  23039. var unique_frame_title_after_default = uniqueFrameTitleAfter;
  23040. function skipLinkEvaluate(node) {
  23041. var target = get_element_by_reference_default(node, 'href');
  23042. if (target) {
  23043. return _isVisibleToScreenReaders(target) || void 0;
  23044. }
  23045. return false;
  23046. }
  23047. var skip_link_evaluate_default = skipLinkEvaluate;
  23048. var implicitAriaLiveRoles = [ 'alert', 'log', 'status' ];
  23049. function regionEvaluate(node, options, virtualNode) {
  23050. this.data({
  23051. isIframe: [ 'iframe', 'frame' ].includes(virtualNode.props.nodeName)
  23052. });
  23053. var regionlessNodes = cache_default.get('regionlessNodes', function() {
  23054. return getRegionlessNodes(options);
  23055. });
  23056. return !regionlessNodes.includes(virtualNode);
  23057. }
  23058. function getRegionlessNodes(options) {
  23059. var regionlessNodes = findRegionlessElms(axe._tree[0], options).map(function(vNode) {
  23060. while (vNode.parent && !vNode.parent._hasRegionDescendant && vNode.parent.actualNode !== document.body) {
  23061. vNode = vNode.parent;
  23062. }
  23063. return vNode;
  23064. }).filter(function(vNode, index, array) {
  23065. return array.indexOf(vNode) === index;
  23066. });
  23067. return regionlessNodes;
  23068. }
  23069. function findRegionlessElms(virtualNode, options) {
  23070. var node = virtualNode.actualNode;
  23071. if (get_role_default(virtualNode) === 'button' || isRegion(virtualNode, options) || [ 'iframe', 'frame' ].includes(virtualNode.props.nodeName) || _isSkipLink(virtualNode.actualNode) && get_element_by_reference_default(virtualNode.actualNode, 'href') || !_isVisibleToScreenReaders(node)) {
  23072. var vNode = virtualNode;
  23073. while (vNode) {
  23074. vNode._hasRegionDescendant = true;
  23075. vNode = vNode.parent;
  23076. }
  23077. if ([ 'iframe', 'frame' ].includes(virtualNode.props.nodeName)) {
  23078. return [ virtualNode ];
  23079. }
  23080. return [];
  23081. } else if (node !== document.body && has_content_default(node, true) && !isShallowlyHidden(virtualNode)) {
  23082. return [ virtualNode ];
  23083. } else {
  23084. return virtualNode.children.filter(function(_ref96) {
  23085. var actualNode = _ref96.actualNode;
  23086. return actualNode.nodeType === 1;
  23087. }).map(function(vNode) {
  23088. return findRegionlessElms(vNode, options);
  23089. }).reduce(function(a2, b2) {
  23090. return a2.concat(b2);
  23091. }, []);
  23092. }
  23093. }
  23094. function isShallowlyHidden(virtualNode) {
  23095. return [ 'none', 'presentation' ].includes(get_role_default(virtualNode)) && !hasChildTextNodes(virtualNode);
  23096. }
  23097. function isRegion(virtualNode, options) {
  23098. var node = virtualNode.actualNode;
  23099. var role = get_role_default(virtualNode);
  23100. var ariaLive = (node.getAttribute('aria-live') || '').toLowerCase().trim();
  23101. var landmarkRoles2 = get_aria_roles_by_type_default('landmark');
  23102. if ([ 'assertive', 'polite' ].includes(ariaLive) || implicitAriaLiveRoles.includes(role)) {
  23103. return true;
  23104. }
  23105. if (landmarkRoles2.includes(role)) {
  23106. return true;
  23107. }
  23108. if (options.regionMatcher && matches_default2(virtualNode, options.regionMatcher)) {
  23109. return true;
  23110. }
  23111. return false;
  23112. }
  23113. function regionAfter(results) {
  23114. var iframeResults = results.filter(function(r) {
  23115. return r.data.isIframe;
  23116. });
  23117. results.forEach(function(r) {
  23118. if (r.result || r.node.ancestry.length === 1) {
  23119. return;
  23120. }
  23121. var frameAncestry = r.node.ancestry.slice(0, -1);
  23122. var _iterator15 = _createForOfIteratorHelper(iframeResults), _step15;
  23123. try {
  23124. for (_iterator15.s(); !(_step15 = _iterator15.n()).done; ) {
  23125. var iframeResult = _step15.value;
  23126. if (_matchAncestry(frameAncestry, iframeResult.node.ancestry)) {
  23127. r.result = iframeResult.result;
  23128. break;
  23129. }
  23130. }
  23131. } catch (err) {
  23132. _iterator15.e(err);
  23133. } finally {
  23134. _iterator15.f();
  23135. }
  23136. });
  23137. iframeResults.forEach(function(r) {
  23138. if (!r.result) {
  23139. r.result = true;
  23140. }
  23141. });
  23142. return results;
  23143. }
  23144. var region_after_default = regionAfter;
  23145. function normalizeFontWeight(weight) {
  23146. switch (weight) {
  23147. case 'lighter':
  23148. return 100;
  23149. case 'normal':
  23150. return 400;
  23151. case 'bold':
  23152. return 700;
  23153. case 'bolder':
  23154. return 900;
  23155. }
  23156. weight = parseInt(weight);
  23157. return !isNaN(weight) ? weight : 400;
  23158. }
  23159. function getTextContainer(elm) {
  23160. var nextNode = elm;
  23161. var outerText = elm.textContent.trim();
  23162. var innerText = outerText;
  23163. while (innerText === outerText && nextNode !== void 0) {
  23164. var _i35 = -1;
  23165. elm = nextNode;
  23166. if (elm.children.length === 0) {
  23167. return elm;
  23168. }
  23169. do {
  23170. _i35++;
  23171. innerText = elm.children[_i35].textContent.trim();
  23172. } while (innerText === '' && _i35 + 1 < elm.children.length);
  23173. nextNode = elm.children[_i35];
  23174. }
  23175. return elm;
  23176. }
  23177. function getStyleValues(node) {
  23178. var style = window.getComputedStyle(getTextContainer(node));
  23179. return {
  23180. fontWeight: normalizeFontWeight(style.getPropertyValue('font-weight')),
  23181. fontSize: parseInt(style.getPropertyValue('font-size')),
  23182. isItalic: style.getPropertyValue('font-style') === 'italic'
  23183. };
  23184. }
  23185. function isHeaderStyle(styleA, styleB, margins) {
  23186. return margins.reduce(function(out, margin) {
  23187. return out || (!margin.size || styleA.fontSize / margin.size > styleB.fontSize) && (!margin.weight || styleA.fontWeight - margin.weight > styleB.fontWeight) && (!margin.italic || styleA.isItalic && !styleB.isItalic);
  23188. }, false);
  23189. }
  23190. function pAsHeadingEvaluate(node, options, virtualNode) {
  23191. var siblings = Array.from(node.parentNode.children);
  23192. var currentIndex = siblings.indexOf(node);
  23193. options = options || {};
  23194. var margins = options.margins || [];
  23195. var nextSibling = siblings.slice(currentIndex + 1).find(function(elm) {
  23196. return elm.nodeName.toUpperCase() === 'P';
  23197. });
  23198. var prevSibling = siblings.slice(0, currentIndex).reverse().find(function(elm) {
  23199. return elm.nodeName.toUpperCase() === 'P';
  23200. });
  23201. var currStyle = getStyleValues(node);
  23202. var nextStyle = nextSibling ? getStyleValues(nextSibling) : null;
  23203. var prevStyle = prevSibling ? getStyleValues(prevSibling) : null;
  23204. var optionsPassLength = options.passLength;
  23205. var optionsFailLength = options.failLength;
  23206. var headingLength = node.textContent.trim().length;
  23207. var paragraphLength = nextSibling === null || nextSibling === void 0 ? void 0 : nextSibling.textContent.trim().length;
  23208. if (headingLength > paragraphLength * optionsPassLength) {
  23209. return true;
  23210. }
  23211. if (!nextStyle || !isHeaderStyle(currStyle, nextStyle, margins)) {
  23212. return true;
  23213. }
  23214. var blockquote = find_up_virtual_default(virtualNode, 'blockquote');
  23215. if (blockquote && blockquote.nodeName.toUpperCase() === 'BLOCKQUOTE') {
  23216. return void 0;
  23217. }
  23218. if (prevStyle && !isHeaderStyle(currStyle, prevStyle, margins)) {
  23219. return void 0;
  23220. }
  23221. if (headingLength > paragraphLength * optionsFailLength) {
  23222. return void 0;
  23223. }
  23224. return false;
  23225. }
  23226. var p_as_heading_evaluate_default = pAsHeadingEvaluate;
  23227. var separatorRegex = /[;,\s]/;
  23228. var validRedirectNumRegex = /^[0-9.]+$/;
  23229. function metaRefreshEvaluate(node, options, virtualNode) {
  23230. var _ref97 = options || {}, minDelay = _ref97.minDelay, maxDelay = _ref97.maxDelay;
  23231. var content = (virtualNode.attr('content') || '').trim();
  23232. var _content$split = content.split(separatorRegex), _content$split2 = _slicedToArray(_content$split, 1), redirectStr = _content$split2[0];
  23233. if (!redirectStr.match(validRedirectNumRegex)) {
  23234. return true;
  23235. }
  23236. var redirectDelay = parseFloat(redirectStr);
  23237. this.data({
  23238. redirectDelay: redirectDelay
  23239. });
  23240. if (typeof minDelay === 'number' && redirectDelay <= options.minDelay) {
  23241. return true;
  23242. }
  23243. if (typeof maxDelay === 'number' && redirectDelay > options.maxDelay) {
  23244. return true;
  23245. }
  23246. return false;
  23247. }
  23248. function internalLinkPresentEvaluate(node, options, virtualNode) {
  23249. var links = query_selector_all_default(virtualNode, 'a[href]');
  23250. return links.some(function(vLink) {
  23251. return /^#[^/!]/.test(vLink.attr('href'));
  23252. });
  23253. }
  23254. var internal_link_present_evaluate_default = internalLinkPresentEvaluate;
  23255. var commons_exports = {};
  23256. __export(commons_exports, {
  23257. aria: function aria() {
  23258. return aria_exports;
  23259. },
  23260. color: function color() {
  23261. return color_exports;
  23262. },
  23263. dom: function dom() {
  23264. return dom_exports;
  23265. },
  23266. forms: function forms() {
  23267. return forms_exports;
  23268. },
  23269. matches: function matches() {
  23270. return matches_default2;
  23271. },
  23272. math: function math() {
  23273. return math_exports;
  23274. },
  23275. standards: function standards() {
  23276. return standards_exports;
  23277. },
  23278. table: function table() {
  23279. return table_exports;
  23280. },
  23281. text: function text() {
  23282. return text_exports;
  23283. },
  23284. utils: function utils() {
  23285. return utils_exports;
  23286. }
  23287. });
  23288. var color_exports = {};
  23289. __export(color_exports, {
  23290. Color: function Color() {
  23291. return color_default;
  23292. },
  23293. centerPointOfRect: function centerPointOfRect() {
  23294. return center_point_of_rect_default;
  23295. },
  23296. elementHasImage: function elementHasImage() {
  23297. return element_has_image_default;
  23298. },
  23299. elementIsDistinct: function elementIsDistinct() {
  23300. return element_is_distinct_default;
  23301. },
  23302. filteredRectStack: function filteredRectStack() {
  23303. return filtered_rect_stack_default;
  23304. },
  23305. flattenColors: function flattenColors() {
  23306. return _flattenColors;
  23307. },
  23308. flattenShadowColors: function flattenShadowColors() {
  23309. return _flattenShadowColors;
  23310. },
  23311. getBackgroundColor: function getBackgroundColor() {
  23312. return _getBackgroundColor2;
  23313. },
  23314. getBackgroundStack: function getBackgroundStack() {
  23315. return _getBackgroundStack;
  23316. },
  23317. getContrast: function getContrast() {
  23318. return get_contrast_default;
  23319. },
  23320. getForegroundColor: function getForegroundColor() {
  23321. return _getForegroundColor;
  23322. },
  23323. getOwnBackgroundColor: function getOwnBackgroundColor() {
  23324. return get_own_background_color_default;
  23325. },
  23326. getRectStack: function getRectStack() {
  23327. return get_rect_stack_default;
  23328. },
  23329. getStackingContext: function getStackingContext() {
  23330. return _getStackingContext;
  23331. },
  23332. getStrokeColorsFromShadows: function getStrokeColorsFromShadows() {
  23333. return _getStrokeColorsFromShadows;
  23334. },
  23335. getTextShadowColors: function getTextShadowColors() {
  23336. return _getTextShadowColors;
  23337. },
  23338. hasValidContrastRatio: function hasValidContrastRatio() {
  23339. return has_valid_contrast_ratio_default;
  23340. },
  23341. incompleteData: function incompleteData() {
  23342. return incomplete_data_default;
  23343. },
  23344. parseTextShadows: function parseTextShadows() {
  23345. return _parseTextShadows;
  23346. },
  23347. stackingContextToColor: function stackingContextToColor() {
  23348. return _stackingContextToColor;
  23349. }
  23350. });
  23351. function centerPointOfRect(rect) {
  23352. if (rect.left > window.innerWidth) {
  23353. return void 0;
  23354. }
  23355. if (rect.top > window.innerHeight) {
  23356. return void 0;
  23357. }
  23358. var x = Math.min(Math.ceil(rect.left + rect.width / 2), window.innerWidth - 1);
  23359. var y = Math.min(Math.ceil(rect.top + rect.height / 2), window.innerHeight - 1);
  23360. return {
  23361. x: x,
  23362. y: y
  23363. };
  23364. }
  23365. var center_point_of_rect_default = centerPointOfRect;
  23366. function _getFonts(style) {
  23367. return style.getPropertyValue('font-family').split(/[,;]/g).map(function(font) {
  23368. return font.trim().toLowerCase();
  23369. });
  23370. }
  23371. function elementIsDistinct(node, ancestorNode) {
  23372. var nodeStyle = window.getComputedStyle(node);
  23373. if (nodeStyle.getPropertyValue('background-image') !== 'none') {
  23374. return true;
  23375. }
  23376. var hasBorder = [ 'border-bottom', 'border-top', 'outline' ].reduce(function(result, edge) {
  23377. var borderClr = new color_default();
  23378. borderClr.parseString(nodeStyle.getPropertyValue(edge + '-color'));
  23379. return result || nodeStyle.getPropertyValue(edge + '-style') !== 'none' && parseFloat(nodeStyle.getPropertyValue(edge + '-width')) > 0 && borderClr.alpha !== 0;
  23380. }, false);
  23381. if (hasBorder) {
  23382. return true;
  23383. }
  23384. var parentStyle = window.getComputedStyle(ancestorNode);
  23385. if (_getFonts(nodeStyle)[0] !== _getFonts(parentStyle)[0]) {
  23386. return true;
  23387. }
  23388. var hasStyle = [ 'text-decoration-line', 'text-decoration-style', 'font-weight', 'font-style', 'font-size' ].reduce(function(result, cssProp) {
  23389. return result || nodeStyle.getPropertyValue(cssProp) !== parentStyle.getPropertyValue(cssProp);
  23390. }, false);
  23391. var tDec = nodeStyle.getPropertyValue('text-decoration');
  23392. if (tDec.split(' ').length < 3) {
  23393. hasStyle = hasStyle || tDec !== parentStyle.getPropertyValue('text-decoration');
  23394. }
  23395. return hasStyle;
  23396. }
  23397. var element_is_distinct_default = elementIsDistinct;
  23398. function getRectStack2(elm) {
  23399. var boundingStack = get_element_stack_default(elm);
  23400. var filteredArr = get_text_element_stack_default(elm);
  23401. if (!filteredArr || filteredArr.length <= 1) {
  23402. return [ boundingStack ];
  23403. }
  23404. if (filteredArr.some(function(stack) {
  23405. return stack === void 0;
  23406. })) {
  23407. return null;
  23408. }
  23409. filteredArr.splice(0, 0, boundingStack);
  23410. return filteredArr;
  23411. }
  23412. var get_rect_stack_default = getRectStack2;
  23413. function filteredRectStack(elm) {
  23414. var rectStack = get_rect_stack_default(elm);
  23415. if (rectStack && rectStack.length === 1) {
  23416. return rectStack[0];
  23417. }
  23418. if (rectStack && rectStack.length > 1) {
  23419. var boundingStack = rectStack.shift();
  23420. var isSame;
  23421. rectStack.forEach(function(rectList, index) {
  23422. if (index === 0) {
  23423. return;
  23424. }
  23425. var rectA = rectStack[index - 1], rectB = rectStack[index];
  23426. isSame = rectA.every(function(element, elementIndex) {
  23427. return element === rectB[elementIndex];
  23428. }) || boundingStack.includes(elm);
  23429. });
  23430. if (!isSame) {
  23431. incomplete_data_default.set('bgColor', 'elmPartiallyObscuring');
  23432. return null;
  23433. }
  23434. return rectStack[0];
  23435. }
  23436. incomplete_data_default.set('bgColor', 'outsideViewport');
  23437. return null;
  23438. }
  23439. var filtered_rect_stack_default = filteredRectStack;
  23440. var nonSeparableBlendModes = [ 'hue', 'saturation', 'color', 'luminosity' ];
  23441. var blendFunctions = {
  23442. normal: function normal(Cb, Cs) {
  23443. return Cs;
  23444. },
  23445. multiply: function multiply(Cb, Cs) {
  23446. return Cs * Cb;
  23447. },
  23448. screen: function screen(Cb, Cs) {
  23449. return Cb + Cs - Cb * Cs;
  23450. },
  23451. overlay: function overlay(Cb, Cs) {
  23452. return this['hard-light'](Cs, Cb);
  23453. },
  23454. darken: function darken(Cb, Cs) {
  23455. return Math.min(Cb, Cs);
  23456. },
  23457. lighten: function lighten(Cb, Cs) {
  23458. return Math.max(Cb, Cs);
  23459. },
  23460. 'color-dodge': function colorDodge(Cb, Cs) {
  23461. return Cb === 0 ? 0 : Cs === 1 ? 1 : Math.min(1, Cb / (1 - Cs));
  23462. },
  23463. 'color-burn': function colorBurn(Cb, Cs) {
  23464. return Cb === 1 ? 1 : Cs === 0 ? 0 : 1 - Math.min(1, (1 - Cb) / Cs);
  23465. },
  23466. 'hard-light': function hardLight(Cb, Cs) {
  23467. return Cs <= .5 ? this.multiply(Cb, 2 * Cs) : this.screen(Cb, 2 * Cs - 1);
  23468. },
  23469. 'soft-light': function softLight(Cb, Cs) {
  23470. if (Cs <= .5) {
  23471. return Cb - (1 - 2 * Cs) * Cb * (1 - Cb);
  23472. } else {
  23473. var D = Cb <= .25 ? ((16 * Cb - 12) * Cb + 4) * Cb : Math.sqrt(Cb);
  23474. return Cb + (2 * Cs - 1) * (D - Cb);
  23475. }
  23476. },
  23477. difference: function difference(Cb, Cs) {
  23478. return Math.abs(Cb - Cs);
  23479. },
  23480. exclusion: function exclusion(Cb, Cs) {
  23481. return Cb + Cs - 2 * Cb * Cs;
  23482. },
  23483. hue: function hue(Cb, Cs) {
  23484. return Cs.setSaturation(Cb.getSaturation()).setLuminosity(Cb.getLuminosity());
  23485. },
  23486. saturation: function saturation(Cb, Cs) {
  23487. return Cb.setSaturation(Cs.getSaturation()).setLuminosity(Cb.getLuminosity());
  23488. },
  23489. color: function color(Cb, Cs) {
  23490. return Cs.setLuminosity(Cb.getLuminosity());
  23491. },
  23492. luminosity: function luminosity(Cb, Cs) {
  23493. return Cb.setLuminosity(Cs.getLuminosity());
  23494. }
  23495. };
  23496. function _flattenColors(sourceColor, backdrop) {
  23497. var blendMode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'normal';
  23498. var blendingResult = blend(backdrop, sourceColor, blendMode);
  23499. var r = simpleAlphaCompositing(sourceColor.red, sourceColor.alpha, backdrop.red, backdrop.alpha, blendingResult.r * 255);
  23500. var g2 = simpleAlphaCompositing(sourceColor.green, sourceColor.alpha, backdrop.green, backdrop.alpha, blendingResult.g * 255);
  23501. var b2 = simpleAlphaCompositing(sourceColor.blue, sourceColor.alpha, backdrop.blue, backdrop.alpha, blendingResult.b * 255);
  23502. var \u03b1o = clamp2(sourceColor.alpha + backdrop.alpha * (1 - sourceColor.alpha), 0, 1);
  23503. if (\u03b1o === 0) {
  23504. return new color_default(r, g2, b2, \u03b1o);
  23505. }
  23506. var Cr = Math.round(r / \u03b1o);
  23507. var Cg = Math.round(g2 / \u03b1o);
  23508. var Cb = Math.round(b2 / \u03b1o);
  23509. return new color_default(Cr, Cg, Cb, \u03b1o);
  23510. }
  23511. function simpleAlphaCompositing(Cs, \u03b1s, Cb, \u03b1b, blendingResult) {
  23512. return \u03b1s * (1 - \u03b1b) * Cs + \u03b1s * \u03b1b * blendingResult + (1 - \u03b1s) * \u03b1b * Cb;
  23513. }
  23514. function clamp2(value, min, max2) {
  23515. return Math.min(Math.max(min, value), max2);
  23516. }
  23517. function blend(Cb, Cs, blendMode) {
  23518. if (nonSeparableBlendModes.includes(blendMode)) {
  23519. return blendFunctions[blendMode](Cb, Cs);
  23520. }
  23521. var C = new color_default();
  23522. [ 'r', 'g', 'b' ].forEach(function(channel) {
  23523. C[channel] = blendFunctions[blendMode](Cb[channel], Cs[channel]);
  23524. });
  23525. return C;
  23526. }
  23527. function _flattenShadowColors(fgColor, bgColor) {
  23528. var alpha = fgColor.alpha;
  23529. var r = (1 - alpha) * bgColor.red + alpha * fgColor.red;
  23530. var g2 = (1 - alpha) * bgColor.green + alpha * fgColor.green;
  23531. var b2 = (1 - alpha) * bgColor.blue + alpha * fgColor.blue;
  23532. var a2 = fgColor.alpha + bgColor.alpha * (1 - fgColor.alpha);
  23533. return new color_default(r, g2, b2, a2);
  23534. }
  23535. function _getBackgroundStack(node) {
  23536. var stacks = get_text_element_stack_default(node).map(function(stack) {
  23537. stack = reduce_to_elements_below_floating_default(stack, node);
  23538. stack = sortPageBackground(stack);
  23539. return stack;
  23540. });
  23541. for (var index = 0; index < stacks.length; index++) {
  23542. var stack = stacks[index];
  23543. if (stack[0] !== node) {
  23544. incomplete_data_default.set('bgColor', 'bgOverlap');
  23545. return null;
  23546. }
  23547. if (index !== 0 && !shallowArraysEqual(stack, stacks[0])) {
  23548. incomplete_data_default.set('bgColor', 'elmPartiallyObscuring');
  23549. return null;
  23550. }
  23551. }
  23552. return stacks[0] || null;
  23553. }
  23554. function sortPageBackground(elmStack) {
  23555. var bodyIndex = elmStack.indexOf(document.body);
  23556. var bgNodes = elmStack;
  23557. var htmlBgColor = get_own_background_color_default(window.getComputedStyle(document.documentElement));
  23558. if (bodyIndex > 1 && htmlBgColor.alpha === 0 && !element_has_image_default(document.documentElement)) {
  23559. if (bodyIndex > 1) {
  23560. bgNodes.splice(bodyIndex, 1);
  23561. bgNodes.push(document.body);
  23562. }
  23563. var htmlIndex = bgNodes.indexOf(document.documentElement);
  23564. if (htmlIndex > 0) {
  23565. bgNodes.splice(htmlIndex, 1);
  23566. bgNodes.push(document.documentElement);
  23567. }
  23568. }
  23569. return bgNodes;
  23570. }
  23571. function shallowArraysEqual(a2, b2) {
  23572. if (a2 === b2) {
  23573. return true;
  23574. }
  23575. if (a2 === null || b2 === null) {
  23576. return false;
  23577. }
  23578. if (a2.length !== b2.length) {
  23579. return false;
  23580. }
  23581. for (var _i36 = 0; _i36 < a2.length; ++_i36) {
  23582. if (a2[_i36] !== b2[_i36]) {
  23583. return false;
  23584. }
  23585. }
  23586. return true;
  23587. }
  23588. var SHADOW_STROKE_ALPHA = .54;
  23589. var VISIBLE_SHADOW_MIN_PX = .5;
  23590. var OPAQUE_STROKE_OFFSET_MIN_PX = 1.5;
  23591. var edges = [ 'top', 'right', 'bottom', 'left' ];
  23592. function _getStrokeColorsFromShadows(parsedShadows) {
  23593. var _ref98 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref98$ignoreEdgeCoun = _ref98.ignoreEdgeCount, ignoreEdgeCount = _ref98$ignoreEdgeCoun === void 0 ? false : _ref98$ignoreEdgeCoun;
  23594. var shadowMap = getShadowColorsMap(parsedShadows);
  23595. var shadowsByColor = Object.entries(shadowMap).map(function(_ref99) {
  23596. var _ref100 = _slicedToArray(_ref99, 2), colorStr = _ref100[0], sides = _ref100[1];
  23597. var edgeCount = edges.filter(function(side) {
  23598. return sides[side].length !== 0;
  23599. }).length;
  23600. return {
  23601. colorStr: colorStr,
  23602. sides: sides,
  23603. edgeCount: edgeCount
  23604. };
  23605. });
  23606. if (!ignoreEdgeCount && shadowsByColor.some(function(_ref101) {
  23607. var edgeCount = _ref101.edgeCount;
  23608. return edgeCount > 1 && edgeCount < 4;
  23609. })) {
  23610. return null;
  23611. }
  23612. return shadowsByColor.map(shadowGroupToColor).filter(function(shadow) {
  23613. return shadow !== null;
  23614. });
  23615. }
  23616. function getShadowColorsMap(parsedShadows) {
  23617. var colorMap = {};
  23618. var _iterator16 = _createForOfIteratorHelper(parsedShadows), _step16;
  23619. try {
  23620. for (_iterator16.s(); !(_step16 = _iterator16.n()).done; ) {
  23621. var _colorMap$colorStr;
  23622. var _step16$value = _step16.value, colorStr = _step16$value.colorStr, pixels = _step16$value.pixels;
  23623. (_colorMap$colorStr = colorMap[colorStr]) !== null && _colorMap$colorStr !== void 0 ? _colorMap$colorStr : colorMap[colorStr] = {
  23624. top: [],
  23625. right: [],
  23626. bottom: [],
  23627. left: []
  23628. };
  23629. var borders = colorMap[colorStr];
  23630. var _pixels = _slicedToArray(pixels, 2), offsetX = _pixels[0], offsetY = _pixels[1];
  23631. if (offsetX > VISIBLE_SHADOW_MIN_PX) {
  23632. borders.right.push(offsetX);
  23633. } else if (-offsetX > VISIBLE_SHADOW_MIN_PX) {
  23634. borders.left.push(-offsetX);
  23635. }
  23636. if (offsetY > VISIBLE_SHADOW_MIN_PX) {
  23637. borders.bottom.push(offsetY);
  23638. } else if (-offsetY > VISIBLE_SHADOW_MIN_PX) {
  23639. borders.top.push(-offsetY);
  23640. }
  23641. }
  23642. } catch (err) {
  23643. _iterator16.e(err);
  23644. } finally {
  23645. _iterator16.f();
  23646. }
  23647. return colorMap;
  23648. }
  23649. function shadowGroupToColor(_ref102) {
  23650. var colorStr = _ref102.colorStr, sides = _ref102.sides, edgeCount = _ref102.edgeCount;
  23651. if (edgeCount !== 4) {
  23652. return null;
  23653. }
  23654. var strokeColor = new color_default();
  23655. strokeColor.parseString(colorStr);
  23656. var density = 0;
  23657. var isSolid = true;
  23658. edges.forEach(function(edge) {
  23659. density += sides[edge].length / 4;
  23660. isSolid && (isSolid = sides[edge].every(function(offset) {
  23661. return offset > OPAQUE_STROKE_OFFSET_MIN_PX;
  23662. }));
  23663. });
  23664. if (!isSolid) {
  23665. strokeColor.alpha = 1 - Math.pow(SHADOW_STROKE_ALPHA, density);
  23666. }
  23667. return strokeColor;
  23668. }
  23669. function _parseTextShadows(textShadow) {
  23670. var current = {
  23671. pixels: []
  23672. };
  23673. var str = textShadow.trim();
  23674. var shadows = [ current ];
  23675. if (!str) {
  23676. return [];
  23677. }
  23678. while (str) {
  23679. var colorMatch = str.match(/^[a-z]+(\([^)]+\))?/i) || str.match(/^#[0-9a-f]+/i);
  23680. var pixelMatch = str.match(/^([0-9.-]+)px/i) || str.match(/^(0)/);
  23681. if (colorMatch) {
  23682. assert_default(!current.colorStr, 'Multiple colors identified in text-shadow: '.concat(textShadow));
  23683. str = str.replace(colorMatch[0], '').trim();
  23684. current.colorStr = colorMatch[0];
  23685. } else if (pixelMatch) {
  23686. assert_default(current.pixels.length < 3, 'Too many pixel units in text-shadow: '.concat(textShadow));
  23687. str = str.replace(pixelMatch[0], '').trim();
  23688. var pixelUnit = parseFloat((pixelMatch[1][0] === '.' ? '0' : '') + pixelMatch[1]);
  23689. current.pixels.push(pixelUnit);
  23690. } else if (str[0] === ',') {
  23691. assert_default(current.pixels.length >= 2, 'Missing pixel value in text-shadow: '.concat(textShadow));
  23692. current = {
  23693. pixels: []
  23694. };
  23695. shadows.push(current);
  23696. str = str.substr(1).trim();
  23697. } else {
  23698. throw new Error('Unable to process text-shadows: '.concat(str));
  23699. }
  23700. }
  23701. shadows.forEach(function(_ref103) {
  23702. var pixels = _ref103.pixels;
  23703. if (pixels.length === 2) {
  23704. pixels.push(0);
  23705. }
  23706. });
  23707. return shadows;
  23708. }
  23709. function _getTextShadowColors(node) {
  23710. var _ref104 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, minRatio = _ref104.minRatio, maxRatio = _ref104.maxRatio, ignoreEdgeCount = _ref104.ignoreEdgeCount;
  23711. var shadowColors = [];
  23712. var style = window.getComputedStyle(node);
  23713. var textShadow = style.getPropertyValue('text-shadow');
  23714. if (textShadow === 'none') {
  23715. return shadowColors;
  23716. }
  23717. var fontSizeStr = style.getPropertyValue('font-size');
  23718. var fontSize = parseInt(fontSizeStr);
  23719. assert_default(isNaN(fontSize) === false, 'Unable to determine font-size value '.concat(fontSizeStr));
  23720. var thinShadows = [];
  23721. var shadows = _parseTextShadows(textShadow);
  23722. var _iterator17 = _createForOfIteratorHelper(shadows), _step17;
  23723. try {
  23724. for (_iterator17.s(); !(_step17 = _iterator17.n()).done; ) {
  23725. var shadow = _step17.value;
  23726. var colorStr = shadow.colorStr || style.getPropertyValue('color');
  23727. var _shadow$pixels = _slicedToArray(shadow.pixels, 3), offsetX = _shadow$pixels[0], offsetY = _shadow$pixels[1], _shadow$pixels$ = _shadow$pixels[2], blurRadius = _shadow$pixels$ === void 0 ? 0 : _shadow$pixels$;
  23728. if (maxRatio && blurRadius >= fontSize * maxRatio) {
  23729. continue;
  23730. }
  23731. if (minRatio && blurRadius < fontSize * minRatio) {
  23732. thinShadows.push({
  23733. colorStr: colorStr,
  23734. pixels: shadow.pixels
  23735. });
  23736. continue;
  23737. }
  23738. if (thinShadows.length > 0) {
  23739. var _strokeColors = _getStrokeColorsFromShadows(thinShadows, {
  23740. ignoreEdgeCount: ignoreEdgeCount
  23741. });
  23742. if (_strokeColors === null) {
  23743. return null;
  23744. }
  23745. shadowColors.push.apply(shadowColors, _toConsumableArray(_strokeColors));
  23746. thinShadows.splice(0, thinShadows.length);
  23747. }
  23748. var _color3 = textShadowColor({
  23749. colorStr: colorStr,
  23750. offsetX: offsetX,
  23751. offsetY: offsetY,
  23752. blurRadius: blurRadius,
  23753. fontSize: fontSize
  23754. });
  23755. shadowColors.push(_color3);
  23756. }
  23757. } catch (err) {
  23758. _iterator17.e(err);
  23759. } finally {
  23760. _iterator17.f();
  23761. }
  23762. if (thinShadows.length > 0) {
  23763. var strokeColors = _getStrokeColorsFromShadows(thinShadows, {
  23764. ignoreEdgeCount: ignoreEdgeCount
  23765. });
  23766. if (strokeColors === null) {
  23767. return null;
  23768. }
  23769. shadowColors.push.apply(shadowColors, _toConsumableArray(strokeColors));
  23770. }
  23771. return shadowColors;
  23772. }
  23773. function textShadowColor(_ref105) {
  23774. var colorStr = _ref105.colorStr, offsetX = _ref105.offsetX, offsetY = _ref105.offsetY, blurRadius = _ref105.blurRadius, fontSize = _ref105.fontSize;
  23775. if (offsetX > blurRadius || offsetY > blurRadius) {
  23776. return new color_default(0, 0, 0, 0);
  23777. }
  23778. var shadowColor = new color_default();
  23779. shadowColor.parseString(colorStr);
  23780. shadowColor.alpha *= blurRadiusToAlpha(blurRadius, fontSize);
  23781. return shadowColor;
  23782. }
  23783. function blurRadiusToAlpha(blurRadius, fontSize) {
  23784. if (blurRadius === 0) {
  23785. return 1;
  23786. }
  23787. var relativeBlur = blurRadius / fontSize;
  23788. return .185 / (relativeBlur + .4);
  23789. }
  23790. function _getStackingContext(elm, elmStack) {
  23791. var _elmStack;
  23792. var virtualNode = get_node_from_tree_default(elm);
  23793. if (virtualNode._stackingContext) {
  23794. return virtualNode._stackingContext;
  23795. }
  23796. var stackingContext = [];
  23797. var contextMap = new Map();
  23798. elmStack = (_elmStack = elmStack) !== null && _elmStack !== void 0 ? _elmStack : _getBackgroundStack(elm);
  23799. elmStack.forEach(function(bgElm) {
  23800. var _stackingOrder2;
  23801. var bgVNode = get_node_from_tree_default(bgElm);
  23802. var bgColor = getOwnBackgroundColor2(bgVNode);
  23803. var stackingOrder = bgVNode._stackingOrder.filter(function(_ref106) {
  23804. var vNode = _ref106.vNode;
  23805. return !!vNode;
  23806. });
  23807. stackingOrder.forEach(function(_ref107, index) {
  23808. var _stackingOrder;
  23809. var vNode = _ref107.vNode;
  23810. var ancestorVNode2 = (_stackingOrder = stackingOrder[index - 1]) === null || _stackingOrder === void 0 ? void 0 : _stackingOrder.vNode;
  23811. var context2 = addToStackingContext(contextMap, vNode, ancestorVNode2);
  23812. if (index === 0 && !contextMap.get(vNode)) {
  23813. stackingContext.unshift(context2);
  23814. }
  23815. contextMap.set(vNode, context2);
  23816. });
  23817. var ancestorVNode = (_stackingOrder2 = stackingOrder[stackingOrder.length - 1]) === null || _stackingOrder2 === void 0 ? void 0 : _stackingOrder2.vNode;
  23818. var context = addToStackingContext(contextMap, bgVNode, ancestorVNode);
  23819. if (!stackingOrder.length) {
  23820. stackingContext.unshift(context);
  23821. }
  23822. context.bgColor = bgColor;
  23823. });
  23824. virtualNode._stackingContext = stackingContext;
  23825. return stackingContext;
  23826. }
  23827. function _stackingContextToColor(context) {
  23828. var _context$descendants;
  23829. if (!((_context$descendants = context.descendants) !== null && _context$descendants !== void 0 && _context$descendants.length)) {
  23830. var color2 = context.bgColor;
  23831. color2.alpha *= context.opacity;
  23832. return {
  23833. color: color2,
  23834. blendMode: context.blendMode
  23835. };
  23836. }
  23837. var sourceColor = context.descendants.reduce(reduceToColor, createStackingContext2());
  23838. var color = _flattenColors(sourceColor, context.bgColor, context.descendants[0].blendMode);
  23839. color.alpha *= context.opacity;
  23840. return {
  23841. color: color,
  23842. blendMode: context.blendMode
  23843. };
  23844. }
  23845. function reduceToColor(backdropContext, sourceContext) {
  23846. var backdrop;
  23847. if (backdropContext instanceof color_default) {
  23848. backdrop = backdropContext;
  23849. } else {
  23850. backdrop = _stackingContextToColor(backdropContext).color;
  23851. }
  23852. var sourceColor = _stackingContextToColor(sourceContext).color;
  23853. return _flattenColors(sourceColor, backdrop, sourceContext.blendMode);
  23854. }
  23855. function createStackingContext2(vNode, ancestorContext) {
  23856. var _vNode$getComputedSty;
  23857. return {
  23858. vNode: vNode,
  23859. ancestor: ancestorContext,
  23860. opacity: parseFloat((_vNode$getComputedSty = vNode === null || vNode === void 0 ? void 0 : vNode.getComputedStylePropertyValue('opacity')) !== null && _vNode$getComputedSty !== void 0 ? _vNode$getComputedSty : 1),
  23861. bgColor: new color_default(0, 0, 0, 0),
  23862. blendMode: normalizeBlendMode(vNode === null || vNode === void 0 ? void 0 : vNode.getComputedStylePropertyValue('mix-blend-mode')),
  23863. descendants: []
  23864. };
  23865. }
  23866. function normalizeBlendMode(blendmode) {
  23867. return !!blendmode ? blendmode : void 0;
  23868. }
  23869. function addToStackingContext(contextMap, vNode, ancestorVNode) {
  23870. var _contextMap$get;
  23871. var ancestorContext = contextMap.get(ancestorVNode);
  23872. var context = (_contextMap$get = contextMap.get(vNode)) !== null && _contextMap$get !== void 0 ? _contextMap$get : createStackingContext2(vNode, ancestorContext);
  23873. if (ancestorContext && ancestorVNode !== vNode && !ancestorContext.descendants.includes(context)) {
  23874. ancestorContext.descendants.unshift(context);
  23875. }
  23876. return context;
  23877. }
  23878. function getOwnBackgroundColor2(vNode) {
  23879. var bgColor = new color_default();
  23880. bgColor.parseString(vNode.getComputedStylePropertyValue('background-color'));
  23881. return bgColor;
  23882. }
  23883. function _getBackgroundColor2(elm) {
  23884. var bgElms = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  23885. var shadowOutlineEmMax = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : .1;
  23886. var vNode = get_node_from_tree_default(elm);
  23887. var bgColorCache = vNode._cache.getBackgroundColor;
  23888. if (bgColorCache) {
  23889. bgElms.push.apply(bgElms, _toConsumableArray(bgColorCache.bgElms));
  23890. incomplete_data_default.set('bgColor', bgColorCache.incompleteData);
  23891. return bgColorCache.bgColor;
  23892. }
  23893. var bgColor = _getBackgroundColor(elm, bgElms, shadowOutlineEmMax);
  23894. vNode._cache.getBackgroundColor = {
  23895. bgColor: bgColor,
  23896. bgElms: bgElms,
  23897. incompleteData: incomplete_data_default.get('bgColor')
  23898. };
  23899. return bgColor;
  23900. }
  23901. function _getBackgroundColor(elm, bgElms, shadowOutlineEmMax) {
  23902. var _getTextShadowColors2, _bgColors;
  23903. var elmStack = _getBackgroundStack(elm);
  23904. if (!elmStack) {
  23905. return null;
  23906. }
  23907. var textRects = get_visible_child_text_rects_default(elm);
  23908. var bgColors = (_getTextShadowColors2 = _getTextShadowColors(elm, {
  23909. minRatio: shadowOutlineEmMax,
  23910. ignoreEdgeCount: true
  23911. })) !== null && _getTextShadowColors2 !== void 0 ? _getTextShadowColors2 : [];
  23912. if (bgColors.length) {
  23913. bgColors = [ {
  23914. color: bgColors.reduce(_flattenShadowColors)
  23915. } ];
  23916. }
  23917. for (var _i37 = 0; _i37 < elmStack.length; _i37++) {
  23918. var bgElm = elmStack[_i37];
  23919. var bgElmStyle = window.getComputedStyle(bgElm);
  23920. if (element_has_image_default(bgElm, bgElmStyle)) {
  23921. bgElms.push(bgElm);
  23922. return null;
  23923. }
  23924. var bgColor = get_own_background_color_default(bgElmStyle);
  23925. if (bgColor.alpha === 0) {
  23926. continue;
  23927. }
  23928. if (bgElmStyle.getPropertyValue('display') !== 'inline' && !fullyEncompasses(bgElm, textRects)) {
  23929. bgElms.push(bgElm);
  23930. incomplete_data_default.set('bgColor', 'elmPartiallyObscured');
  23931. return null;
  23932. }
  23933. bgElms.push(bgElm);
  23934. if (bgColor.alpha === 1) {
  23935. break;
  23936. }
  23937. }
  23938. var stackingContext = _getStackingContext(elm, elmStack);
  23939. bgColors = stackingContext.map(_stackingContextToColor).concat(bgColors);
  23940. var pageBgs = getPageBackgroundColors(elm, elmStack.includes(document.body));
  23941. (_bgColors = bgColors).unshift.apply(_bgColors, _toConsumableArray(pageBgs));
  23942. if (bgColors.length === 0) {
  23943. return new color_default(255, 255, 255, 1);
  23944. }
  23945. var blendedColor = bgColors.reduce(function(bgColor, fgColor) {
  23946. return _flattenColors(fgColor.color, bgColor.color instanceof color_default ? bgColor.color : bgColor, fgColor.blendMode);
  23947. });
  23948. return _flattenColors(blendedColor.color instanceof color_default ? blendedColor.color : blendedColor, new color_default(255, 255, 255, 1));
  23949. }
  23950. function fullyEncompasses(node, rects) {
  23951. rects = Array.isArray(rects) ? rects : [ rects ];
  23952. var nodeRect = node.getBoundingClientRect();
  23953. var right = nodeRect.right, bottom = nodeRect.bottom;
  23954. var style = window.getComputedStyle(node);
  23955. var overflow = style.getPropertyValue('overflow');
  23956. if ([ 'scroll', 'auto' ].includes(overflow) || node instanceof window.HTMLHtmlElement) {
  23957. right = nodeRect.left + node.scrollWidth;
  23958. bottom = nodeRect.top + node.scrollHeight;
  23959. }
  23960. return rects.every(function(rect) {
  23961. return rect.top >= nodeRect.top && rect.bottom <= bottom && rect.left >= nodeRect.left && rect.right <= right;
  23962. });
  23963. }
  23964. function normalizeBlendMode2(blendmode) {
  23965. return !!blendmode ? blendmode : void 0;
  23966. }
  23967. function getPageBackgroundColors(elm, stackContainsBody) {
  23968. var pageColors = [];
  23969. if (!stackContainsBody) {
  23970. var html = document.documentElement;
  23971. var body = document.body;
  23972. var htmlStyle = window.getComputedStyle(html);
  23973. var bodyStyle = window.getComputedStyle(body);
  23974. var htmlBgColor = get_own_background_color_default(htmlStyle);
  23975. var bodyBgColor = get_own_background_color_default(bodyStyle);
  23976. var bodyBgColorApplies = bodyBgColor.alpha !== 0 && fullyEncompasses(body, elm.getBoundingClientRect());
  23977. if (bodyBgColor.alpha !== 0 && htmlBgColor.alpha === 0 || bodyBgColorApplies && bodyBgColor.alpha !== 1) {
  23978. pageColors.unshift({
  23979. color: bodyBgColor,
  23980. blendMode: normalizeBlendMode2(bodyStyle.getPropertyValue('mix-blend-mode'))
  23981. });
  23982. }
  23983. if (htmlBgColor.alpha !== 0 && (!bodyBgColorApplies || bodyBgColorApplies && bodyBgColor.alpha !== 1)) {
  23984. pageColors.unshift({
  23985. color: htmlBgColor,
  23986. blendMode: normalizeBlendMode2(htmlStyle.getPropertyValue('mix-blend-mode'))
  23987. });
  23988. }
  23989. }
  23990. return pageColors;
  23991. }
  23992. function getContrast(bgColor, fgColor) {
  23993. if (!fgColor || !bgColor) {
  23994. return null;
  23995. }
  23996. if (fgColor.alpha < 1) {
  23997. fgColor = _flattenColors(fgColor, bgColor);
  23998. }
  23999. var bL = bgColor.getRelativeLuminance();
  24000. var fL = fgColor.getRelativeLuminance();
  24001. return (Math.max(fL, bL) + .05) / (Math.min(fL, bL) + .05);
  24002. }
  24003. var get_contrast_default = getContrast;
  24004. function _getForegroundColor(node, _, bgColor) {
  24005. var _bgColor;
  24006. var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  24007. var nodeStyle = window.getComputedStyle(node);
  24008. var colorStack = [ function() {
  24009. return getStrokeColor(nodeStyle, options);
  24010. }, function() {
  24011. return getTextColor(nodeStyle);
  24012. }, function() {
  24013. return _getTextShadowColors(node, {
  24014. minRatio: 0
  24015. });
  24016. } ];
  24017. var fgColors = [];
  24018. for (var _i38 = 0, _colorStack = colorStack; _i38 < _colorStack.length; _i38++) {
  24019. var colorFn = _colorStack[_i38];
  24020. var _color4 = colorFn();
  24021. if (!_color4) {
  24022. continue;
  24023. }
  24024. fgColors = fgColors.concat(_color4);
  24025. if (_color4.alpha === 1) {
  24026. break;
  24027. }
  24028. }
  24029. var fgColor = fgColors.reduce(function(source, backdrop) {
  24030. return _flattenColors(source, backdrop);
  24031. });
  24032. (_bgColor = bgColor) !== null && _bgColor !== void 0 ? _bgColor : bgColor = _getBackgroundColor2(node, []);
  24033. if (bgColor === null) {
  24034. var reason = incomplete_data_default.get('bgColor');
  24035. incomplete_data_default.set('fgColor', reason);
  24036. return null;
  24037. }
  24038. var stackingContexts = _getStackingContext(node);
  24039. var context = findNodeInContexts(stackingContexts, node);
  24040. return _flattenColors(calculateBlendedForegroundColor(fgColor, context, stackingContexts), new color_default(255, 255, 255, 1));
  24041. }
  24042. function getTextColor(nodeStyle) {
  24043. return new color_default().parseString(nodeStyle.getPropertyValue('-webkit-text-fill-color') || nodeStyle.getPropertyValue('color'));
  24044. }
  24045. function getStrokeColor(nodeStyle, _ref108) {
  24046. var _ref108$textStrokeEmM = _ref108.textStrokeEmMin, textStrokeEmMin = _ref108$textStrokeEmM === void 0 ? 0 : _ref108$textStrokeEmM;
  24047. var strokeWidth = parseFloat(nodeStyle.getPropertyValue('-webkit-text-stroke-width'));
  24048. if (strokeWidth === 0) {
  24049. return null;
  24050. }
  24051. var fontSize = nodeStyle.getPropertyValue('font-size');
  24052. var relativeStrokeWidth = strokeWidth / parseFloat(fontSize);
  24053. if (isNaN(relativeStrokeWidth) || relativeStrokeWidth < textStrokeEmMin) {
  24054. return null;
  24055. }
  24056. var strokeColor = nodeStyle.getPropertyValue('-webkit-text-stroke-color');
  24057. return new color_default().parseString(strokeColor);
  24058. }
  24059. function calculateBlendedForegroundColor(fgColor, context, stackingContexts) {
  24060. while (context) {
  24061. var _context$ancestor;
  24062. if (context.opacity === 1 && context.ancestor) {
  24063. context = context.ancestor;
  24064. continue;
  24065. }
  24066. fgColor.alpha *= context.opacity;
  24067. var stack = ((_context$ancestor = context.ancestor) === null || _context$ancestor === void 0 ? void 0 : _context$ancestor.descendants) || stackingContexts;
  24068. if (context.opacity !== 1) {
  24069. stack = stack.slice(0, stack.indexOf(context));
  24070. }
  24071. var bgColors = stack.map(_stackingContextToColor);
  24072. if (!bgColors.length) {
  24073. context = context.ancestor;
  24074. continue;
  24075. }
  24076. var bgColor = bgColors.reduce(function(backdrop, source) {
  24077. return _flattenColors(source.color, backdrop.color instanceof color_default ? backdrop.color : backdrop);
  24078. }, {
  24079. color: new color_default(0, 0, 0, 0),
  24080. blendMode: 'normal'
  24081. });
  24082. fgColor = _flattenColors(fgColor, bgColor);
  24083. context = context.ancestor;
  24084. }
  24085. return fgColor;
  24086. }
  24087. function findNodeInContexts(contexts, node) {
  24088. var _iterator18 = _createForOfIteratorHelper(contexts), _step18;
  24089. try {
  24090. for (_iterator18.s(); !(_step18 = _iterator18.n()).done; ) {
  24091. var _context$vNode;
  24092. var context = _step18.value;
  24093. if (((_context$vNode = context.vNode) === null || _context$vNode === void 0 ? void 0 : _context$vNode.actualNode) === node) {
  24094. return context;
  24095. }
  24096. var found = findNodeInContexts(context.descendants, node);
  24097. if (found) {
  24098. return found;
  24099. }
  24100. }
  24101. } catch (err) {
  24102. _iterator18.e(err);
  24103. } finally {
  24104. _iterator18.f();
  24105. }
  24106. }
  24107. function hasValidContrastRatio(bg, fg, fontSize, isBold) {
  24108. var contrast2 = get_contrast_default(bg, fg);
  24109. var isSmallFont = isBold && Math.ceil(fontSize * 72) / 96 < 14 || !isBold && Math.ceil(fontSize * 72) / 96 < 18;
  24110. var expectedContrastRatio = isSmallFont ? 4.5 : 3;
  24111. return {
  24112. isValid: contrast2 > expectedContrastRatio,
  24113. contrastRatio: contrast2,
  24114. expectedContrastRatio: expectedContrastRatio
  24115. };
  24116. }
  24117. var has_valid_contrast_ratio_default = hasValidContrastRatio;
  24118. var forms_exports = {};
  24119. __export(forms_exports, {
  24120. isAriaCombobox: function isAriaCombobox() {
  24121. return is_aria_combobox_default;
  24122. },
  24123. isAriaListbox: function isAriaListbox() {
  24124. return is_aria_listbox_default;
  24125. },
  24126. isAriaRange: function isAriaRange() {
  24127. return is_aria_range_default;
  24128. },
  24129. isAriaTextbox: function isAriaTextbox() {
  24130. return is_aria_textbox_default;
  24131. },
  24132. isDisabled: function isDisabled() {
  24133. return is_disabled_default;
  24134. },
  24135. isNativeSelect: function isNativeSelect() {
  24136. return is_native_select_default;
  24137. },
  24138. isNativeTextbox: function isNativeTextbox() {
  24139. return is_native_textbox_default;
  24140. }
  24141. });
  24142. var disabledNodeNames = [ 'fieldset', 'button', 'select', 'input', 'textarea' ];
  24143. function isDisabled(virtualNode) {
  24144. var disabledState = virtualNode._isDisabled;
  24145. if (typeof disabledState === 'boolean') {
  24146. return disabledState;
  24147. }
  24148. var nodeName2 = virtualNode.props.nodeName;
  24149. var ariaDisabled = virtualNode.attr('aria-disabled');
  24150. if (disabledNodeNames.includes(nodeName2) && virtualNode.hasAttr('disabled')) {
  24151. disabledState = true;
  24152. } else if (ariaDisabled) {
  24153. disabledState = ariaDisabled.toLowerCase() === 'true';
  24154. } else if (virtualNode.parent) {
  24155. disabledState = isDisabled(virtualNode.parent);
  24156. } else {
  24157. disabledState = false;
  24158. }
  24159. virtualNode._isDisabled = disabledState;
  24160. return disabledState;
  24161. }
  24162. var is_disabled_default = isDisabled;
  24163. function identicalLinksSamePurposeEvaluate(node, options, virtualNode) {
  24164. var accText = text_exports.accessibleTextVirtual(virtualNode);
  24165. var name = text_exports.sanitize(text_exports.removeUnicode(accText, {
  24166. emoji: true,
  24167. nonBmp: true,
  24168. punctuations: true
  24169. })).toLowerCase();
  24170. if (!name) {
  24171. return void 0;
  24172. }
  24173. var afterData = {
  24174. name: name,
  24175. urlProps: dom_exports.urlPropsFromAttribute(node, 'href')
  24176. };
  24177. this.data(afterData);
  24178. this.relatedNodes([ node ]);
  24179. return true;
  24180. }
  24181. var identical_links_same_purpose_evaluate_default = identicalLinksSamePurposeEvaluate;
  24182. function isIdenticalObject(a2, b2) {
  24183. if (!a2 || !b2) {
  24184. return false;
  24185. }
  24186. var aProps = Object.getOwnPropertyNames(a2);
  24187. var bProps = Object.getOwnPropertyNames(b2);
  24188. if (aProps.length !== bProps.length) {
  24189. return false;
  24190. }
  24191. var result = aProps.every(function(propName) {
  24192. var aValue = a2[propName];
  24193. var bValue = b2[propName];
  24194. if (_typeof(aValue) !== _typeof(bValue)) {
  24195. return false;
  24196. }
  24197. if (_typeof(aValue) === 'object' || _typeof(bValue) === 'object') {
  24198. return isIdenticalObject(aValue, bValue);
  24199. }
  24200. return aValue === bValue;
  24201. });
  24202. return result;
  24203. }
  24204. function identicalLinksSamePurposeAfter(results) {
  24205. if (results.length < 2) {
  24206. return results;
  24207. }
  24208. var incompleteResults = results.filter(function(_ref109) {
  24209. var result = _ref109.result;
  24210. return result !== void 0;
  24211. });
  24212. var uniqueResults = [];
  24213. var nameMap = {};
  24214. var _loop8 = function _loop8(index) {
  24215. var _currentResult$relate;
  24216. var currentResult = incompleteResults[index];
  24217. var _currentResult$data = currentResult.data, name = _currentResult$data.name, urlProps = _currentResult$data.urlProps;
  24218. if (nameMap[name]) {
  24219. return 1;
  24220. }
  24221. var sameNameResults = incompleteResults.filter(function(_ref110, resultNum) {
  24222. var data = _ref110.data;
  24223. return data.name === name && resultNum !== index;
  24224. });
  24225. var isSameUrl = sameNameResults.every(function(_ref111) {
  24226. var data = _ref111.data;
  24227. return isIdenticalObject(data.urlProps, urlProps);
  24228. });
  24229. if (sameNameResults.length && !isSameUrl) {
  24230. currentResult.result = void 0;
  24231. }
  24232. currentResult.relatedNodes = [];
  24233. (_currentResult$relate = currentResult.relatedNodes).push.apply(_currentResult$relate, _toConsumableArray(sameNameResults.map(function(node) {
  24234. return node.relatedNodes[0];
  24235. })));
  24236. nameMap[name] = sameNameResults;
  24237. uniqueResults.push(currentResult);
  24238. };
  24239. for (var index = 0; index < incompleteResults.length; index++) {
  24240. if (_loop8(index)) {
  24241. continue;
  24242. }
  24243. }
  24244. return uniqueResults;
  24245. }
  24246. var identical_links_same_purpose_after_default = identicalLinksSamePurposeAfter;
  24247. function getLevel(vNode) {
  24248. var role = get_role_default(vNode);
  24249. var headingRole = role && role.includes('heading');
  24250. var ariaHeadingLevel = vNode.attr('aria-level');
  24251. var ariaLevel = parseInt(ariaHeadingLevel, 10);
  24252. var _ref112 = vNode.props.nodeName.match(/h(\d)/) || [], _ref113 = _slicedToArray(_ref112, 2), headingLevel = _ref113[1];
  24253. if (!headingRole) {
  24254. return -1;
  24255. }
  24256. if (headingLevel && !ariaHeadingLevel) {
  24257. return parseInt(headingLevel, 10);
  24258. }
  24259. if (isNaN(ariaLevel) || ariaLevel < 1) {
  24260. if (headingLevel) {
  24261. return parseInt(headingLevel, 10);
  24262. }
  24263. return 2;
  24264. }
  24265. if (ariaLevel) {
  24266. return ariaLevel;
  24267. }
  24268. return -1;
  24269. }
  24270. function headingOrderEvaluate() {
  24271. var headingOrder = cache_default.get('headingOrder');
  24272. if (headingOrder) {
  24273. return true;
  24274. }
  24275. var selector = 'h1, h2, h3, h4, h5, h6, [role=heading], iframe, frame';
  24276. var vNodes = query_selector_all_filter_default(axe._tree[0], selector, _isVisibleToScreenReaders);
  24277. headingOrder = vNodes.map(function(vNode) {
  24278. return {
  24279. ancestry: [ _getAncestry(vNode.actualNode) ],
  24280. level: getLevel(vNode)
  24281. };
  24282. });
  24283. this.data({
  24284. headingOrder: headingOrder
  24285. });
  24286. cache_default.set('headingOrder', vNodes);
  24287. return true;
  24288. }
  24289. var heading_order_evaluate_default = headingOrderEvaluate;
  24290. function headingOrderAfter(results) {
  24291. var headingOrder = getHeadingOrder(results);
  24292. results.forEach(function(result) {
  24293. result.result = getHeadingOrderOutcome(result, headingOrder);
  24294. });
  24295. return results;
  24296. }
  24297. function getHeadingOrderOutcome(result, headingOrder) {
  24298. var _headingOrder$index$l, _headingOrder$index, _headingOrder$level, _headingOrder;
  24299. var index = findHeadingOrderIndex(headingOrder, result.node.ancestry);
  24300. var currLevel = (_headingOrder$index$l = (_headingOrder$index = headingOrder[index]) === null || _headingOrder$index === void 0 ? void 0 : _headingOrder$index.level) !== null && _headingOrder$index$l !== void 0 ? _headingOrder$index$l : -1;
  24301. var prevLevel = (_headingOrder$level = (_headingOrder = headingOrder[index - 1]) === null || _headingOrder === void 0 ? void 0 : _headingOrder.level) !== null && _headingOrder$level !== void 0 ? _headingOrder$level : -1;
  24302. if (index === 0) {
  24303. return true;
  24304. }
  24305. if (currLevel === -1) {
  24306. return void 0;
  24307. }
  24308. return currLevel - prevLevel <= 1;
  24309. }
  24310. function getHeadingOrder(results) {
  24311. results = _toConsumableArray(results);
  24312. results.sort(function(_ref114, _ref115) {
  24313. var nodeA = _ref114.node;
  24314. var nodeB = _ref115.node;
  24315. return nodeA.ancestry.length - nodeB.ancestry.length;
  24316. });
  24317. var headingOrder = results.reduce(mergeHeadingOrder, []);
  24318. return headingOrder.filter(function(_ref116) {
  24319. var level = _ref116.level;
  24320. return level !== -1;
  24321. });
  24322. }
  24323. function mergeHeadingOrder(mergedHeadingOrder, result) {
  24324. var _result$data;
  24325. var frameHeadingOrder = (_result$data = result.data) === null || _result$data === void 0 ? void 0 : _result$data.headingOrder;
  24326. var frameAncestry = shortenArray(result.node.ancestry, 1);
  24327. if (!frameHeadingOrder) {
  24328. return mergedHeadingOrder;
  24329. }
  24330. var normalizedHeadingOrder = frameHeadingOrder.map(function(heading) {
  24331. return addFrameToHeadingAncestry(heading, frameAncestry);
  24332. });
  24333. var index = getFrameIndex(mergedHeadingOrder, frameAncestry);
  24334. if (index === -1) {
  24335. mergedHeadingOrder.push.apply(mergedHeadingOrder, _toConsumableArray(normalizedHeadingOrder));
  24336. } else {
  24337. mergedHeadingOrder.splice.apply(mergedHeadingOrder, [ index, 0 ].concat(_toConsumableArray(normalizedHeadingOrder)));
  24338. }
  24339. return mergedHeadingOrder;
  24340. }
  24341. function getFrameIndex(headingOrder, frameAncestry) {
  24342. while (frameAncestry.length) {
  24343. var index = findHeadingOrderIndex(headingOrder, frameAncestry);
  24344. if (index !== -1) {
  24345. return index;
  24346. }
  24347. frameAncestry = shortenArray(frameAncestry, 1);
  24348. }
  24349. return -1;
  24350. }
  24351. function findHeadingOrderIndex(headingOrder, ancestry) {
  24352. return headingOrder.findIndex(function(heading) {
  24353. return _matchAncestry(heading.ancestry, ancestry);
  24354. });
  24355. }
  24356. function addFrameToHeadingAncestry(heading, frameAncestry) {
  24357. var ancestry = frameAncestry.concat(heading.ancestry);
  24358. return _extends({}, heading, {
  24359. ancestry: ancestry
  24360. });
  24361. }
  24362. function shortenArray(arr, spliceLength) {
  24363. return arr.slice(0, arr.length - spliceLength);
  24364. }
  24365. function targetSizeEvaluate(node, options, vNode) {
  24366. var minSize = (options === null || options === void 0 ? void 0 : options.minSize) || 24;
  24367. var nodeRect = vNode.boundingClientRect;
  24368. if (_rectHasMinimumSize(minSize * 10, nodeRect)) {
  24369. this.data({
  24370. messageKey: 'large',
  24371. minSize: minSize
  24372. });
  24373. return true;
  24374. }
  24375. var hasMinimumSize = _rectHasMinimumSize.bind(null, minSize);
  24376. var nearbyElms = _findNearbyElms(vNode);
  24377. var overflowingContent = filterOverflowingContent(vNode, nearbyElms);
  24378. var _filterByElmsOverlap = filterByElmsOverlap(vNode, nearbyElms), fullyObscuringElms = _filterByElmsOverlap.fullyObscuringElms, partialObscuringElms = _filterByElmsOverlap.partialObscuringElms;
  24379. if (overflowingContent.length && (fullyObscuringElms.length || !hasMinimumSize(nodeRect))) {
  24380. this.data({
  24381. minSize: minSize,
  24382. messageKey: 'contentOverflow'
  24383. });
  24384. this.relatedNodes(mapActualNodes(overflowingContent));
  24385. return void 0;
  24386. }
  24387. if (fullyObscuringElms.length) {
  24388. this.relatedNodes(mapActualNodes(fullyObscuringElms));
  24389. this.data({
  24390. messageKey: 'obscured'
  24391. });
  24392. return true;
  24393. }
  24394. var negativeOutcome = _isInTabOrder(vNode) ? false : void 0;
  24395. if (!hasMinimumSize(nodeRect)) {
  24396. this.data(_extends({
  24397. minSize: minSize
  24398. }, toDecimalSize(nodeRect)));
  24399. return negativeOutcome;
  24400. }
  24401. var obscuredWidgets = filterFocusableWidgets(partialObscuringElms);
  24402. if (!obscuredWidgets.length) {
  24403. this.data(_extends({
  24404. minSize: minSize
  24405. }, toDecimalSize(nodeRect)));
  24406. return true;
  24407. }
  24408. var largestInnerRect = getLargestUnobscuredArea(vNode, obscuredWidgets);
  24409. if (!largestInnerRect) {
  24410. this.data({
  24411. minSize: minSize,
  24412. messageKey: 'tooManyRects'
  24413. });
  24414. return void 0;
  24415. }
  24416. if (!hasMinimumSize(largestInnerRect)) {
  24417. if (overflowingContent.length) {
  24418. this.data({
  24419. minSize: minSize,
  24420. messageKey: 'contentOverflow'
  24421. });
  24422. this.relatedNodes(mapActualNodes(overflowingContent));
  24423. return void 0;
  24424. }
  24425. var allTabbable = obscuredWidgets.every(_isInTabOrder);
  24426. var messageKey = 'partiallyObscured'.concat(allTabbable ? '' : 'NonTabbable');
  24427. this.data(_extends({
  24428. messageKey: messageKey,
  24429. minSize: minSize
  24430. }, toDecimalSize(largestInnerRect)));
  24431. this.relatedNodes(mapActualNodes(obscuredWidgets));
  24432. return allTabbable ? negativeOutcome : void 0;
  24433. }
  24434. this.data(_extends({
  24435. minSize: minSize
  24436. }, toDecimalSize(largestInnerRect || nodeRect)));
  24437. this.relatedNodes(mapActualNodes(obscuredWidgets));
  24438. return true;
  24439. }
  24440. function filterOverflowingContent(vNode, nearbyElms) {
  24441. return nearbyElms.filter(function(nearbyElm) {
  24442. return !isEnclosedRect2(nearbyElm, vNode) && isDescendantNotInTabOrder2(vNode, nearbyElm);
  24443. });
  24444. }
  24445. function filterByElmsOverlap(vNode, nearbyElms) {
  24446. var fullyObscuringElms = [];
  24447. var partialObscuringElms = [];
  24448. var _iterator19 = _createForOfIteratorHelper(nearbyElms), _step19;
  24449. try {
  24450. for (_iterator19.s(); !(_step19 = _iterator19.n()).done; ) {
  24451. var vNeighbor = _step19.value;
  24452. if (!isDescendantNotInTabOrder2(vNode, vNeighbor) && _hasVisualOverlap(vNode, vNeighbor) && getCssPointerEvents(vNeighbor) !== 'none') {
  24453. if (isEnclosedRect2(vNode, vNeighbor)) {
  24454. fullyObscuringElms.push(vNeighbor);
  24455. } else {
  24456. partialObscuringElms.push(vNeighbor);
  24457. }
  24458. }
  24459. }
  24460. } catch (err) {
  24461. _iterator19.e(err);
  24462. } finally {
  24463. _iterator19.f();
  24464. }
  24465. return {
  24466. fullyObscuringElms: fullyObscuringElms,
  24467. partialObscuringElms: partialObscuringElms
  24468. };
  24469. }
  24470. function getLargestUnobscuredArea(vNode, obscuredNodes) {
  24471. var nodeRect = vNode.boundingClientRect;
  24472. var obscuringRects = obscuredNodes.map(function(_ref117) {
  24473. var rect = _ref117.boundingClientRect;
  24474. return rect;
  24475. });
  24476. var unobscuredRects;
  24477. try {
  24478. unobscuredRects = _splitRects(nodeRect, obscuringRects);
  24479. } catch (_unused9) {
  24480. return null;
  24481. }
  24482. return getLargestRect2(unobscuredRects);
  24483. }
  24484. function getLargestRect2(rects, minSize) {
  24485. return rects.reduce(function(rectA, rectB) {
  24486. var rectAisMinimum = _rectHasMinimumSize(minSize, rectA);
  24487. var rectBisMinimum = _rectHasMinimumSize(minSize, rectB);
  24488. if (rectAisMinimum !== rectBisMinimum) {
  24489. return rectAisMinimum ? rectA : rectB;
  24490. }
  24491. var areaA = rectA.width * rectA.height;
  24492. var areaB = rectB.width * rectB.height;
  24493. return areaA > areaB ? rectA : rectB;
  24494. });
  24495. }
  24496. function filterFocusableWidgets(vNodes) {
  24497. return vNodes.filter(function(vNode) {
  24498. return get_role_type_default(vNode) === 'widget' && _isFocusable(vNode);
  24499. });
  24500. }
  24501. function isEnclosedRect2(vNodeA, vNodeB) {
  24502. var rectA = vNodeA.boundingClientRect;
  24503. var rectB = vNodeB.boundingClientRect;
  24504. return rectA.top >= rectB.top && rectA.left >= rectB.left && rectA.bottom <= rectB.bottom && rectA.right <= rectB.right;
  24505. }
  24506. function getCssPointerEvents(vNode) {
  24507. return vNode.getComputedStylePropertyValue('pointer-events');
  24508. }
  24509. function toDecimalSize(rect) {
  24510. return {
  24511. width: Math.round(rect.width * 10) / 10,
  24512. height: Math.round(rect.height * 10) / 10
  24513. };
  24514. }
  24515. function isDescendantNotInTabOrder2(vAncestor, vNode) {
  24516. return _contains(vAncestor, vNode) && !_isInTabOrder(vNode);
  24517. }
  24518. function mapActualNodes(vNodes) {
  24519. return vNodes.map(function(_ref118) {
  24520. var actualNode = _ref118.actualNode;
  24521. return actualNode;
  24522. });
  24523. }
  24524. var roundingMargin2 = .05;
  24525. function targetOffsetEvaluate(node, options, vNode) {
  24526. var minOffset = (options === null || options === void 0 ? void 0 : options.minOffset) || 24;
  24527. if (_rectHasMinimumSize(minOffset * 10, vNode.boundingClientRect)) {
  24528. this.data({
  24529. messageKey: 'large',
  24530. minOffset: minOffset
  24531. });
  24532. return true;
  24533. }
  24534. var closeNeighbors = [];
  24535. var closestOffset = minOffset;
  24536. var _iterator20 = _createForOfIteratorHelper(_findNearbyElms(vNode, minOffset)), _step20;
  24537. try {
  24538. for (_iterator20.s(); !(_step20 = _iterator20.n()).done; ) {
  24539. var vNeighbor = _step20.value;
  24540. if (get_role_type_default(vNeighbor) !== 'widget' || !_isFocusable(vNeighbor)) {
  24541. continue;
  24542. }
  24543. var offset = null;
  24544. try {
  24545. offset = _getOffset(vNode, vNeighbor, minOffset / 2);
  24546. } catch (err2) {
  24547. if (err2.message.startsWith('splitRects')) {
  24548. this.data({
  24549. messageKey: 'tooManyRects',
  24550. closestOffset: 0,
  24551. minOffset: minOffset
  24552. });
  24553. return void 0;
  24554. }
  24555. throw err2;
  24556. }
  24557. if (offset === null) {
  24558. continue;
  24559. }
  24560. offset = roundToSingleDecimal(offset) * 2;
  24561. if (offset + roundingMargin2 >= minOffset) {
  24562. continue;
  24563. }
  24564. closestOffset = Math.min(closestOffset, offset);
  24565. closeNeighbors.push(vNeighbor);
  24566. }
  24567. } catch (err) {
  24568. _iterator20.e(err);
  24569. } finally {
  24570. _iterator20.f();
  24571. }
  24572. if (closeNeighbors.length === 0) {
  24573. this.data({
  24574. closestOffset: closestOffset,
  24575. minOffset: minOffset
  24576. });
  24577. return true;
  24578. }
  24579. this.relatedNodes(closeNeighbors.map(function(_ref119) {
  24580. var actualNode = _ref119.actualNode;
  24581. return actualNode;
  24582. }));
  24583. if (!closeNeighbors.some(_isInTabOrder)) {
  24584. this.data({
  24585. messageKey: 'nonTabbableNeighbor',
  24586. closestOffset: closestOffset,
  24587. minOffset: minOffset
  24588. });
  24589. return void 0;
  24590. }
  24591. this.data({
  24592. closestOffset: closestOffset,
  24593. minOffset: minOffset
  24594. });
  24595. return _isInTabOrder(vNode) ? false : void 0;
  24596. }
  24597. function roundToSingleDecimal(num) {
  24598. return Math.round(num * 10) / 10;
  24599. }
  24600. function metaViewportScaleEvaluate(node, options, virtualNode) {
  24601. var _ref120 = options || {}, _ref120$scaleMinimum = _ref120.scaleMinimum, scaleMinimum = _ref120$scaleMinimum === void 0 ? 2 : _ref120$scaleMinimum, _ref120$lowerBound = _ref120.lowerBound, lowerBound = _ref120$lowerBound === void 0 ? false : _ref120$lowerBound;
  24602. var content = virtualNode.attr('content') || '';
  24603. if (!content) {
  24604. return true;
  24605. }
  24606. var result = content.split(/[;,]/).reduce(function(out, item) {
  24607. var contentValue = item.trim();
  24608. if (!contentValue) {
  24609. return out;
  24610. }
  24611. var _contentValue$split = contentValue.split('='), _contentValue$split2 = _slicedToArray(_contentValue$split, 2), key = _contentValue$split2[0], value = _contentValue$split2[1];
  24612. if (!key || !value) {
  24613. return out;
  24614. }
  24615. var curatedKey = key.toLowerCase().trim();
  24616. var curatedValue = value.toLowerCase().trim();
  24617. if (curatedKey === 'maximum-scale' && curatedValue === 'yes') {
  24618. curatedValue = 1;
  24619. }
  24620. if (curatedKey === 'maximum-scale' && parseFloat(curatedValue) < 0) {
  24621. return out;
  24622. }
  24623. out[curatedKey] = curatedValue;
  24624. return out;
  24625. }, {});
  24626. if (lowerBound && result['maximum-scale'] && parseFloat(result['maximum-scale']) < lowerBound) {
  24627. return true;
  24628. }
  24629. if (!lowerBound && result['user-scalable'] === 'no') {
  24630. this.data('user-scalable=no');
  24631. return false;
  24632. }
  24633. var userScalableAsFloat = parseFloat(result['user-scalable']);
  24634. if (!lowerBound && result['user-scalable'] && (userScalableAsFloat || userScalableAsFloat === 0) && userScalableAsFloat > -1 && userScalableAsFloat < 1) {
  24635. this.data('user-scalable');
  24636. return false;
  24637. }
  24638. if (result['maximum-scale'] && parseFloat(result['maximum-scale']) < scaleMinimum) {
  24639. this.data('maximum-scale');
  24640. return false;
  24641. }
  24642. return true;
  24643. }
  24644. var meta_viewport_scale_evaluate_default = metaViewportScaleEvaluate;
  24645. function cssOrientationLockEvaluate(node, options, virtualNode, context) {
  24646. var _ref121 = context || {}, _ref121$cssom = _ref121.cssom, cssom = _ref121$cssom === void 0 ? void 0 : _ref121$cssom;
  24647. var _ref122 = options || {}, _ref122$degreeThresho = _ref122.degreeThreshold, degreeThreshold = _ref122$degreeThresho === void 0 ? 0 : _ref122$degreeThresho;
  24648. if (!cssom || !cssom.length) {
  24649. return void 0;
  24650. }
  24651. var isLocked = false;
  24652. var relatedElements = [];
  24653. var rulesGroupByDocumentFragment = groupCssomByDocument(cssom);
  24654. var _loop9 = function _loop9() {
  24655. var key = _Object$keys3[_i39];
  24656. var _rulesGroupByDocument = rulesGroupByDocumentFragment[key], root = _rulesGroupByDocument.root, rules = _rulesGroupByDocument.rules;
  24657. var orientationRules = rules.filter(isMediaRuleWithOrientation);
  24658. if (!orientationRules.length) {
  24659. return 1;
  24660. }
  24661. orientationRules.forEach(function(_ref123) {
  24662. var cssRules = _ref123.cssRules;
  24663. Array.from(cssRules).forEach(function(cssRule) {
  24664. var locked = getIsOrientationLocked(cssRule);
  24665. if (locked && cssRule.selectorText.toUpperCase() !== 'HTML') {
  24666. var elms = Array.from(root.querySelectorAll(cssRule.selectorText)) || [];
  24667. relatedElements = relatedElements.concat(elms);
  24668. }
  24669. isLocked = isLocked || locked;
  24670. });
  24671. });
  24672. };
  24673. for (var _i39 = 0, _Object$keys3 = Object.keys(rulesGroupByDocumentFragment); _i39 < _Object$keys3.length; _i39++) {
  24674. if (_loop9()) {
  24675. continue;
  24676. }
  24677. }
  24678. if (!isLocked) {
  24679. return true;
  24680. }
  24681. if (relatedElements.length) {
  24682. this.relatedNodes(relatedElements);
  24683. }
  24684. return false;
  24685. function groupCssomByDocument(cssObjectModel) {
  24686. return cssObjectModel.reduce(function(out, _ref124) {
  24687. var sheet = _ref124.sheet, root = _ref124.root, shadowId = _ref124.shadowId;
  24688. var key = shadowId ? shadowId : 'topDocument';
  24689. if (!out[key]) {
  24690. out[key] = {
  24691. root: root,
  24692. rules: []
  24693. };
  24694. }
  24695. if (!sheet || !sheet.cssRules) {
  24696. return out;
  24697. }
  24698. var rules = Array.from(sheet.cssRules);
  24699. out[key].rules = out[key].rules.concat(rules);
  24700. return out;
  24701. }, {});
  24702. }
  24703. function isMediaRuleWithOrientation(_ref125) {
  24704. var type2 = _ref125.type, cssText = _ref125.cssText;
  24705. if (type2 !== 4) {
  24706. return false;
  24707. }
  24708. return /orientation:\s*landscape/i.test(cssText) || /orientation:\s*portrait/i.test(cssText);
  24709. }
  24710. function getIsOrientationLocked(_ref126) {
  24711. var selectorText = _ref126.selectorText, style = _ref126.style;
  24712. if (!selectorText || style.length <= 0) {
  24713. return false;
  24714. }
  24715. var transformStyle = style.transform || style.webkitTransform || style.msTransform || false;
  24716. if (!transformStyle && !style.rotate) {
  24717. return false;
  24718. }
  24719. var transformDegrees = getTransformDegrees(transformStyle);
  24720. var rotateDegrees = getRotationInDegrees('rotate', style.rotate);
  24721. var degrees = transformDegrees + rotateDegrees;
  24722. if (!degrees) {
  24723. return false;
  24724. }
  24725. degrees = Math.abs(degrees);
  24726. if (Math.abs(degrees - 180) % 180 <= degreeThreshold) {
  24727. return false;
  24728. }
  24729. return Math.abs(degrees - 90) % 90 <= degreeThreshold;
  24730. }
  24731. function getTransformDegrees(transformStyle) {
  24732. if (!transformStyle) {
  24733. return 0;
  24734. }
  24735. var matches4 = transformStyle.match(/(rotate|rotateZ|rotate3d|matrix|matrix3d)\(([^)]+)\)(?!.*(rotate|rotateZ|rotate3d|matrix|matrix3d))/);
  24736. if (!matches4) {
  24737. return 0;
  24738. }
  24739. var _matches2 = _slicedToArray(matches4, 3), transformFn = _matches2[1], transformFnValue = _matches2[2];
  24740. return getRotationInDegrees(transformFn, transformFnValue);
  24741. }
  24742. function getRotationInDegrees(transformFunction, transformFnValue) {
  24743. switch (transformFunction) {
  24744. case 'rotate':
  24745. case 'rotateZ':
  24746. return getAngleInDegrees(transformFnValue);
  24747. case 'rotate3d':
  24748. var _transformFnValue$spl = transformFnValue.split(',').map(function(value) {
  24749. return value.trim();
  24750. }), _transformFnValue$spl2 = _slicedToArray(_transformFnValue$spl, 4), z = _transformFnValue$spl2[2], angleWithUnit = _transformFnValue$spl2[3];
  24751. if (parseInt(z) === 0) {
  24752. return;
  24753. }
  24754. return getAngleInDegrees(angleWithUnit);
  24755. case 'matrix':
  24756. case 'matrix3d':
  24757. return getAngleInDegreesFromMatrixTransform(transformFnValue);
  24758. default:
  24759. return 0;
  24760. }
  24761. }
  24762. function getAngleInDegrees(angleWithUnit) {
  24763. var _ref127 = angleWithUnit.match(/(deg|grad|rad|turn)/) || [], _ref128 = _slicedToArray(_ref127, 1), unit = _ref128[0];
  24764. if (!unit) {
  24765. return 0;
  24766. }
  24767. var angle = parseFloat(angleWithUnit.replace(unit, ''));
  24768. switch (unit) {
  24769. case 'rad':
  24770. return convertRadToDeg(angle);
  24771. case 'grad':
  24772. return convertGradToDeg(angle);
  24773. case 'turn':
  24774. return convertTurnToDeg(angle);
  24775. case 'deg':
  24776. default:
  24777. return parseInt(angle);
  24778. }
  24779. }
  24780. function getAngleInDegreesFromMatrixTransform(transformFnValue) {
  24781. var values2 = transformFnValue.split(',');
  24782. if (values2.length <= 6) {
  24783. var _values = _slicedToArray(values2, 2), a2 = _values[0], b3 = _values[1];
  24784. var radians = Math.atan2(parseFloat(b3), parseFloat(a2));
  24785. return convertRadToDeg(radians);
  24786. }
  24787. var sinB = parseFloat(values2[8]);
  24788. var b2 = Math.asin(sinB);
  24789. var cosB = Math.cos(b2);
  24790. var rotateZRadians = Math.acos(parseFloat(values2[0]) / cosB);
  24791. return convertRadToDeg(rotateZRadians);
  24792. }
  24793. function convertRadToDeg(radians) {
  24794. return Math.round(radians * (180 / Math.PI));
  24795. }
  24796. function convertGradToDeg(grad) {
  24797. grad = grad % 400;
  24798. if (grad < 0) {
  24799. grad += 400;
  24800. }
  24801. return Math.round(grad / 400 * 360);
  24802. }
  24803. function convertTurnToDeg(turn) {
  24804. return Math.round(360 / (1 / turn));
  24805. }
  24806. }
  24807. var css_orientation_lock_evaluate_default = cssOrientationLockEvaluate;
  24808. function noAutoplayAudioEvaluate(node, options) {
  24809. var hasControls = node.hasAttribute('controls');
  24810. if (node.hasAttribute('loop')) {
  24811. return hasControls;
  24812. }
  24813. if (!node.duration) {
  24814. console.warn('axe.utils.preloadMedia did not load metadata');
  24815. return void 0;
  24816. }
  24817. var _options$allowedDurat = options.allowedDuration, allowedDuration = _options$allowedDurat === void 0 ? 3 : _options$allowedDurat;
  24818. var playableDuration = getPlayableDuration(node);
  24819. if (playableDuration <= allowedDuration) {
  24820. return true;
  24821. }
  24822. if (!hasControls) {
  24823. return false;
  24824. }
  24825. return true;
  24826. function getPlayableDuration(elm) {
  24827. if (!elm.currentSrc) {
  24828. return 0;
  24829. }
  24830. var playbackRange = getPlaybackRange(elm.currentSrc);
  24831. if (!playbackRange) {
  24832. return Math.abs(elm.duration - (elm.currentTime || 0));
  24833. }
  24834. if (playbackRange.length === 1) {
  24835. return Math.abs(elm.duration - playbackRange[0]);
  24836. }
  24837. return Math.abs(playbackRange[1] - playbackRange[0]);
  24838. }
  24839. function getPlaybackRange(src) {
  24840. var match = src.match(/#t=(.*)/);
  24841. if (!match) {
  24842. return;
  24843. }
  24844. var _match = _slicedToArray(match, 2), value = _match[1];
  24845. var ranges = value.split(',');
  24846. return ranges.map(function(range2) {
  24847. if (/:/.test(range2)) {
  24848. return convertHourMinSecToSeconds(range2);
  24849. }
  24850. return parseFloat(range2);
  24851. });
  24852. }
  24853. function convertHourMinSecToSeconds(hhMmSs) {
  24854. var parts = hhMmSs.split(':');
  24855. var secs = 0;
  24856. var mins = 1;
  24857. while (parts.length > 0) {
  24858. secs += mins * parseInt(parts.pop(), 10);
  24859. mins *= 60;
  24860. }
  24861. return parseFloat(secs);
  24862. }
  24863. }
  24864. var no_autoplay_audio_evaluate_default = noAutoplayAudioEvaluate;
  24865. function frameTestedEvaluate(node, options) {
  24866. return options.isViolation ? false : void 0;
  24867. }
  24868. var frame_tested_evaluate_default = frameTestedEvaluate;
  24869. var joinStr = ' > ';
  24870. function frameTestedAfter(results) {
  24871. var iframes = {};
  24872. return results.filter(function(result) {
  24873. var frameResult = result.node.ancestry[result.node.ancestry.length - 1] !== 'html';
  24874. if (frameResult) {
  24875. var ancestry2 = result.node.ancestry.flat(Infinity).join(joinStr);
  24876. iframes[ancestry2] = result;
  24877. return true;
  24878. }
  24879. var ancestry = result.node.ancestry.slice(0, result.node.ancestry.length - 1).flat(Infinity).join(joinStr);
  24880. if (iframes[ancestry]) {
  24881. iframes[ancestry].result = true;
  24882. }
  24883. return false;
  24884. });
  24885. }
  24886. var frame_tested_after_default = frameTestedAfter;
  24887. function captionEvaluate(node, options, virtualNode) {
  24888. var tracks = query_selector_all_default(virtualNode, 'track');
  24889. var hasCaptions = tracks.some(function(vNode) {
  24890. return (vNode.attr('kind') || '').toLowerCase() === 'captions';
  24891. });
  24892. return hasCaptions ? false : void 0;
  24893. }
  24894. var caption_evaluate_default = captionEvaluate;
  24895. function structuredDlitemsEvaluate(node, options, virtualNode) {
  24896. var children = virtualNode.children;
  24897. if (!children || !children.length) {
  24898. return false;
  24899. }
  24900. var hasDt = false, hasDd = false, nodeName2;
  24901. for (var _i40 = 0; _i40 < children.length; _i40++) {
  24902. nodeName2 = children[_i40].props.nodeName.toUpperCase();
  24903. if (nodeName2 === 'DT') {
  24904. hasDt = true;
  24905. }
  24906. if (hasDt && nodeName2 === 'DD') {
  24907. return false;
  24908. }
  24909. if (nodeName2 === 'DD') {
  24910. hasDd = true;
  24911. }
  24912. }
  24913. return hasDt || hasDd;
  24914. }
  24915. var structured_dlitems_evaluate_default = structuredDlitemsEvaluate;
  24916. function onlyListitemsEvaluate(node, options, virtualNode) {
  24917. var hasNonEmptyTextNode = false;
  24918. var atLeastOneListitem = false;
  24919. var isEmpty2 = true;
  24920. var badNodes = [];
  24921. var badRoleNodes = [];
  24922. var badRoles = [];
  24923. virtualNode.children.forEach(function(vNode) {
  24924. var actualNode = vNode.actualNode;
  24925. if (actualNode.nodeType === 3 && actualNode.nodeValue.trim() !== '') {
  24926. hasNonEmptyTextNode = true;
  24927. return;
  24928. }
  24929. if (actualNode.nodeType !== 1 || !_isVisibleToScreenReaders(actualNode)) {
  24930. return;
  24931. }
  24932. isEmpty2 = false;
  24933. var isLi = actualNode.nodeName.toUpperCase() === 'LI';
  24934. var role = get_role_default(vNode);
  24935. var isListItemRole = role === 'listitem';
  24936. if (!isLi && !isListItemRole) {
  24937. badNodes.push(actualNode);
  24938. }
  24939. if (isLi && !isListItemRole) {
  24940. badRoleNodes.push(actualNode);
  24941. if (!badRoles.includes(role)) {
  24942. badRoles.push(role);
  24943. }
  24944. }
  24945. if (isListItemRole) {
  24946. atLeastOneListitem = true;
  24947. }
  24948. });
  24949. if (hasNonEmptyTextNode || badNodes.length) {
  24950. this.relatedNodes(badNodes);
  24951. return true;
  24952. }
  24953. if (isEmpty2 || atLeastOneListitem) {
  24954. return false;
  24955. }
  24956. this.relatedNodes(badRoleNodes);
  24957. this.data({
  24958. messageKey: 'roleNotValid',
  24959. roles: badRoles.join(', ')
  24960. });
  24961. return true;
  24962. }
  24963. var only_listitems_evaluate_default = onlyListitemsEvaluate;
  24964. function onlyDlitemsEvaluate(node, options, virtualNode) {
  24965. var ALLOWED_ROLES = [ 'definition', 'term', 'list' ];
  24966. var base = {
  24967. badNodes: [],
  24968. hasNonEmptyTextNode: false
  24969. };
  24970. var content = virtualNode.children.reduce(function(vNodes, child) {
  24971. var actualNode = child.actualNode;
  24972. if (actualNode.nodeName.toUpperCase() === 'DIV' && get_role_default(actualNode) === null) {
  24973. return vNodes.concat(child.children);
  24974. }
  24975. return vNodes.concat(child);
  24976. }, []);
  24977. var result = content.reduce(function(out, childNode) {
  24978. var actualNode = childNode.actualNode;
  24979. var tagName = actualNode.nodeName.toUpperCase();
  24980. if (actualNode.nodeType === 1 && _isVisibleToScreenReaders(actualNode)) {
  24981. var explicitRole2 = get_explicit_role_default(actualNode);
  24982. if (tagName !== 'DT' && tagName !== 'DD' || explicitRole2) {
  24983. if (!ALLOWED_ROLES.includes(explicitRole2)) {
  24984. out.badNodes.push(actualNode);
  24985. }
  24986. }
  24987. } else if (actualNode.nodeType === 3 && actualNode.nodeValue.trim() !== '') {
  24988. out.hasNonEmptyTextNode = true;
  24989. }
  24990. return out;
  24991. }, base);
  24992. if (result.badNodes.length) {
  24993. this.relatedNodes(result.badNodes);
  24994. }
  24995. return !!result.badNodes.length || result.hasNonEmptyTextNode;
  24996. }
  24997. function listitemEvaluate(node, options, virtualNode) {
  24998. var parent = virtualNode.parent;
  24999. if (!parent) {
  25000. return void 0;
  25001. }
  25002. var parentNodeName = parent.props.nodeName;
  25003. var parentRole = get_explicit_role_default(parent);
  25004. if ([ 'presentation', 'none', 'list' ].includes(parentRole)) {
  25005. return true;
  25006. }
  25007. if (parentRole && is_valid_role_default(parentRole)) {
  25008. this.data({
  25009. messageKey: 'roleNotValid'
  25010. });
  25011. return false;
  25012. }
  25013. return [ 'ul', 'ol', 'menu' ].includes(parentNodeName);
  25014. }
  25015. function invalidChildrenEvaluate(node) {
  25016. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  25017. var virtualNode = arguments.length > 2 ? arguments[2] : undefined;
  25018. var relatedNodes = [];
  25019. var issues = [];
  25020. if (!virtualNode.children) {
  25021. return void 0;
  25022. }
  25023. var vChildren = mapWithNested(virtualNode.children);
  25024. while (vChildren.length) {
  25025. var _vChild$actualNode;
  25026. var _vChildren$shift = vChildren.shift(), vChild = _vChildren$shift.vChild, nested = _vChildren$shift.nested;
  25027. if (options.divGroups && !nested && isDivGroup(vChild)) {
  25028. if (!vChild.children) {
  25029. return void 0;
  25030. }
  25031. var vGrandChildren = mapWithNested(vChild.children, true);
  25032. vChildren.push.apply(vChildren, _toConsumableArray(vGrandChildren));
  25033. continue;
  25034. }
  25035. var issue = getInvalidSelector(vChild, nested, options);
  25036. if (!issue) {
  25037. continue;
  25038. }
  25039. if (!issues.includes(issue)) {
  25040. issues.push(issue);
  25041. }
  25042. if ((vChild === null || vChild === void 0 || (_vChild$actualNode = vChild.actualNode) === null || _vChild$actualNode === void 0 ? void 0 : _vChild$actualNode.nodeType) === 1) {
  25043. relatedNodes.push(vChild.actualNode);
  25044. }
  25045. }
  25046. if (issues.length === 0) {
  25047. return false;
  25048. }
  25049. this.data({
  25050. values: issues.join(', ')
  25051. });
  25052. this.relatedNodes(relatedNodes);
  25053. return true;
  25054. }
  25055. function getInvalidSelector(vChild, nested, _ref129) {
  25056. var _ref129$validRoles = _ref129.validRoles, validRoles = _ref129$validRoles === void 0 ? [] : _ref129$validRoles, _ref129$validNodeName = _ref129.validNodeNames, validNodeNames = _ref129$validNodeName === void 0 ? [] : _ref129$validNodeName;
  25057. var _vChild$props = vChild.props, nodeName2 = _vChild$props.nodeName, nodeType = _vChild$props.nodeType, nodeValue = _vChild$props.nodeValue;
  25058. var selector = nested ? 'div > ' : '';
  25059. if (nodeType === 3 && nodeValue.trim() !== '') {
  25060. return selector + '#text';
  25061. }
  25062. if (nodeType !== 1 || !_isVisibleToScreenReaders(vChild)) {
  25063. return false;
  25064. }
  25065. var role = get_explicit_role_default(vChild);
  25066. if (role) {
  25067. return validRoles.includes(role) ? false : selector + '[role='.concat(role, ']');
  25068. } else {
  25069. return validNodeNames.includes(nodeName2) ? false : selector + nodeName2;
  25070. }
  25071. }
  25072. function isDivGroup(vNode) {
  25073. return vNode.props.nodeName === 'div' && get_explicit_role_default(vNode) === null;
  25074. }
  25075. function mapWithNested(vNodes) {
  25076. var nested = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  25077. return vNodes.map(function(vChild) {
  25078. return {
  25079. vChild: vChild,
  25080. nested: nested
  25081. };
  25082. });
  25083. }
  25084. function dlitemEvaluate(node) {
  25085. var parent = get_composed_parent_default(node);
  25086. var parentTagName = parent.nodeName.toUpperCase();
  25087. var parentRole = get_explicit_role_default(parent);
  25088. if (parentTagName === 'DIV' && [ 'presentation', 'none', null ].includes(parentRole)) {
  25089. parent = get_composed_parent_default(parent);
  25090. parentTagName = parent.nodeName.toUpperCase();
  25091. parentRole = get_explicit_role_default(parent);
  25092. }
  25093. if (parentTagName !== 'DL') {
  25094. return false;
  25095. }
  25096. if (!parentRole || [ 'presentation', 'none', 'list' ].includes(parentRole)) {
  25097. return true;
  25098. }
  25099. return false;
  25100. }
  25101. var dlitem_evaluate_default = dlitemEvaluate;
  25102. function xmlLangMismatchEvaluate(node, options, vNode) {
  25103. var primaryLangValue = get_base_lang_default(vNode.attr('lang'));
  25104. var primaryXmlLangValue = get_base_lang_default(vNode.attr('xml:lang'));
  25105. return primaryLangValue === primaryXmlLangValue;
  25106. }
  25107. var xml_lang_mismatch_evaluate_default = xmlLangMismatchEvaluate;
  25108. function validLangEvaluate(node, options, virtualNode) {
  25109. var invalid = [];
  25110. options.attributes.forEach(function(langAttr) {
  25111. var langVal = virtualNode.attr(langAttr);
  25112. if (typeof langVal !== 'string') {
  25113. return;
  25114. }
  25115. var baselangVal = get_base_lang_default(langVal);
  25116. var invalidLang = options.value ? !options.value.map(get_base_lang_default).includes(baselangVal) : !valid_langs_default(baselangVal);
  25117. if (baselangVal !== '' && invalidLang || langVal !== '' && !sanitize_default(langVal)) {
  25118. invalid.push(langAttr + '="' + virtualNode.attr(langAttr) + '"');
  25119. }
  25120. });
  25121. if (!invalid.length) {
  25122. return false;
  25123. }
  25124. if (virtualNode.props.nodeName !== 'html' && !_hasLangText(virtualNode)) {
  25125. return false;
  25126. }
  25127. this.data(invalid);
  25128. return true;
  25129. }
  25130. var valid_lang_evaluate_default = validLangEvaluate;
  25131. function hasValue(value) {
  25132. return (value || '').trim() !== '';
  25133. }
  25134. function hasLangEvaluate(node, options, virtualNode) {
  25135. var xhtml = typeof document !== 'undefined' ? is_xhtml_default(document) : false;
  25136. if (options.attributes.includes('xml:lang') && options.attributes.includes('lang') && hasValue(virtualNode.attr('xml:lang')) && !hasValue(virtualNode.attr('lang')) && !xhtml) {
  25137. this.data({
  25138. messageKey: 'noXHTML'
  25139. });
  25140. return false;
  25141. }
  25142. var hasLang = options.attributes.some(function(name) {
  25143. return hasValue(virtualNode.attr(name));
  25144. });
  25145. if (!hasLang) {
  25146. this.data({
  25147. messageKey: 'noLang'
  25148. });
  25149. return false;
  25150. }
  25151. return true;
  25152. }
  25153. var has_lang_evaluate_default = hasLangEvaluate;
  25154. function landmarkIsUniqueEvaluate(node, options, virtualNode) {
  25155. var role = get_role_default(node);
  25156. var accessibleText2 = _accessibleTextVirtual(virtualNode);
  25157. accessibleText2 = accessibleText2 ? accessibleText2.toLowerCase() : null;
  25158. this.data({
  25159. role: role,
  25160. accessibleText: accessibleText2
  25161. });
  25162. this.relatedNodes([ node ]);
  25163. return true;
  25164. }
  25165. var landmark_is_unique_evaluate_default = landmarkIsUniqueEvaluate;
  25166. function landmarkIsUniqueAfter(results) {
  25167. var uniqueLandmarks = [];
  25168. return results.filter(function(currentResult) {
  25169. var findMatch = function findMatch(someResult) {
  25170. return currentResult.data.role === someResult.data.role && currentResult.data.accessibleText === someResult.data.accessibleText;
  25171. };
  25172. var matchedResult = uniqueLandmarks.find(findMatch);
  25173. if (matchedResult) {
  25174. matchedResult.result = false;
  25175. matchedResult.relatedNodes.push(currentResult.relatedNodes[0]);
  25176. return false;
  25177. }
  25178. uniqueLandmarks.push(currentResult);
  25179. currentResult.relatedNodes = [];
  25180. return true;
  25181. });
  25182. }
  25183. var landmark_is_unique_after_default = landmarkIsUniqueAfter;
  25184. function titleOnlyEvaluate(node, options, virtualNode) {
  25185. var labelText2 = label_virtual_default2(virtualNode);
  25186. var title = title_text_default(virtualNode);
  25187. var ariaDescribedBy = virtualNode.attr('aria-describedby');
  25188. return !labelText2 && !!(title || ariaDescribedBy);
  25189. }
  25190. var title_only_evaluate_default = titleOnlyEvaluate;
  25191. function multipleLabelEvaluate(node) {
  25192. var id = escape_selector_default(node.getAttribute('id'));
  25193. var parent = node.parentNode;
  25194. var root = get_root_node_default2(node);
  25195. root = root.documentElement || root;
  25196. var labels = Array.from(root.querySelectorAll('label[for="'.concat(id, '"]')));
  25197. if (labels.length) {
  25198. labels = labels.filter(function(label3) {
  25199. return !_isHiddenForEveryone(label3);
  25200. });
  25201. }
  25202. while (parent) {
  25203. if (parent.nodeName.toUpperCase() === 'LABEL' && labels.indexOf(parent) === -1) {
  25204. labels.push(parent);
  25205. }
  25206. parent = parent.parentNode;
  25207. }
  25208. this.relatedNodes(labels);
  25209. if (labels.length > 1) {
  25210. var ATVisibleLabels = labels.filter(function(label3) {
  25211. return _isVisibleToScreenReaders(label3);
  25212. });
  25213. if (ATVisibleLabels.length > 1) {
  25214. return void 0;
  25215. }
  25216. var labelledby = idrefs_default(node, 'aria-labelledby');
  25217. return !labelledby.includes(ATVisibleLabels[0]) ? void 0 : false;
  25218. }
  25219. return false;
  25220. }
  25221. var multiple_label_evaluate_default = multipleLabelEvaluate;
  25222. function isStringContained(compare, compareWith) {
  25223. var curatedCompareWith = curateString(compareWith);
  25224. var curatedCompare = curateString(compare);
  25225. if (!curatedCompareWith || !curatedCompare) {
  25226. return false;
  25227. }
  25228. return curatedCompareWith.includes(curatedCompare);
  25229. }
  25230. function curateString(str) {
  25231. var noUnicodeStr = remove_unicode_default(str, {
  25232. emoji: true,
  25233. nonBmp: true,
  25234. punctuations: true
  25235. });
  25236. return sanitize_default(noUnicodeStr);
  25237. }
  25238. function labelContentNameMismatchEvaluate(node, options, virtualNode) {
  25239. var _options$occurrenceTh;
  25240. var pixelThreshold = options === null || options === void 0 ? void 0 : options.pixelThreshold;
  25241. var occurrenceThreshold = (_options$occurrenceTh = options === null || options === void 0 ? void 0 : options.occurrenceThreshold) !== null && _options$occurrenceTh !== void 0 ? _options$occurrenceTh : options === null || options === void 0 ? void 0 : options.occuranceThreshold;
  25242. var accText = accessible_text_default(node).toLowerCase();
  25243. var visibleText = sanitize_default(subtree_text_default(virtualNode, {
  25244. subtreeDescendant: true,
  25245. ignoreIconLigature: true,
  25246. pixelThreshold: pixelThreshold,
  25247. occurrenceThreshold: occurrenceThreshold
  25248. })).toLowerCase();
  25249. if (!visibleText) {
  25250. return true;
  25251. }
  25252. if (is_human_interpretable_default(accText) < 1 || is_human_interpretable_default(visibleText) < 1) {
  25253. return void 0;
  25254. }
  25255. return isStringContained(visibleText, accText);
  25256. }
  25257. var label_content_name_mismatch_evaluate_default = labelContentNameMismatchEvaluate;
  25258. function implicitEvaluate(node, options, virtualNode) {
  25259. try {
  25260. var label3 = closest_default(virtualNode, 'label');
  25261. if (label3) {
  25262. var implicitLabel = sanitize_default(_accessibleTextVirtual(label3, {
  25263. inControlContext: true,
  25264. startNode: virtualNode
  25265. }));
  25266. if (label3.actualNode) {
  25267. this.relatedNodes([ label3.actualNode ]);
  25268. }
  25269. this.data({
  25270. implicitLabel: implicitLabel
  25271. });
  25272. return !!implicitLabel;
  25273. }
  25274. return false;
  25275. } catch (_unused10) {
  25276. return void 0;
  25277. }
  25278. }
  25279. var implicit_evaluate_default = implicitEvaluate;
  25280. function hiddenExplicitLabelEvaluate(node, options, virtualNode) {
  25281. if (virtualNode.hasAttr('id')) {
  25282. if (!virtualNode.actualNode) {
  25283. return void 0;
  25284. }
  25285. var root = get_root_node_default2(node);
  25286. var _id4 = escape_selector_default(node.getAttribute('id'));
  25287. var label3 = root.querySelector('label[for="'.concat(_id4, '"]'));
  25288. if (label3 && !_isVisibleToScreenReaders(label3)) {
  25289. var name;
  25290. try {
  25291. name = _accessibleTextVirtual(virtualNode).trim();
  25292. } catch (_unused11) {
  25293. return void 0;
  25294. }
  25295. var isNameEmpty = name === '';
  25296. return isNameEmpty;
  25297. }
  25298. }
  25299. return false;
  25300. }
  25301. var hidden_explicit_label_evaluate_default = hiddenExplicitLabelEvaluate;
  25302. function helpSameAsLabelEvaluate(node, options, virtualNode) {
  25303. var labelText2 = label_virtual_default2(virtualNode);
  25304. var check = node.getAttribute('title');
  25305. if (!labelText2) {
  25306. return false;
  25307. }
  25308. if (!check) {
  25309. check = '';
  25310. if (node.getAttribute('aria-describedby')) {
  25311. var ref = idrefs_default(node, 'aria-describedby');
  25312. check = ref.map(function(thing) {
  25313. return thing ? accessible_text_default(thing) : '';
  25314. }).join('');
  25315. }
  25316. }
  25317. return sanitize_default(check) === sanitize_default(labelText2);
  25318. }
  25319. var help_same_as_label_evaluate_default = helpSameAsLabelEvaluate;
  25320. function explicitEvaluate(node, options, virtualNode) {
  25321. var _this7 = this;
  25322. if (!virtualNode.attr('id')) {
  25323. return false;
  25324. }
  25325. if (!virtualNode.actualNode) {
  25326. return void 0;
  25327. }
  25328. var root = get_root_node_default2(virtualNode.actualNode);
  25329. var id = escape_selector_default(virtualNode.attr('id'));
  25330. var labels = Array.from(root.querySelectorAll('label[for="'.concat(id, '"]')));
  25331. this.relatedNodes(labels);
  25332. if (!labels.length) {
  25333. return false;
  25334. }
  25335. try {
  25336. return labels.some(function(label3) {
  25337. if (!_isVisibleOnScreen(label3)) {
  25338. return true;
  25339. } else {
  25340. var explicitLabel = sanitize_default(accessible_text_default(label3, {
  25341. inControlContext: true,
  25342. startNode: virtualNode
  25343. }));
  25344. _this7.data({
  25345. explicitLabel: explicitLabel
  25346. });
  25347. return !!explicitLabel;
  25348. }
  25349. });
  25350. } catch (_unused12) {
  25351. return void 0;
  25352. }
  25353. }
  25354. var explicit_evaluate_default = explicitEvaluate;
  25355. function duplicateImgLabelEvaluate(node, options, virtualNode) {
  25356. if ([ 'none', 'presentation' ].includes(get_role_default(virtualNode))) {
  25357. return false;
  25358. }
  25359. var parentVNode = closest_default(virtualNode, options.parentSelector);
  25360. if (!parentVNode) {
  25361. return false;
  25362. }
  25363. var visibleText = visible_virtual_default(parentVNode, true).toLowerCase();
  25364. if (visibleText === '') {
  25365. return false;
  25366. }
  25367. return visibleText === _accessibleTextVirtual(virtualNode).toLowerCase();
  25368. }
  25369. var duplicate_img_label_evaluate_default = duplicateImgLabelEvaluate;
  25370. function altSpaceValueEvaluate(node, options, virtualNode) {
  25371. var alt = virtualNode.attr('alt');
  25372. var isOnlySpace = /^\s+$/;
  25373. return typeof alt === 'string' && isOnlySpace.test(alt);
  25374. }
  25375. var alt_space_value_evaluate_default = altSpaceValueEvaluate;
  25376. function tabindexEvaluate(node, options, virtualNode) {
  25377. var tabIndex = parse_tabindex_default(virtualNode.attr('tabindex'));
  25378. return tabIndex === null || tabIndex <= 0;
  25379. }
  25380. var tabindex_evaluate_default = tabindexEvaluate;
  25381. function noFocusableContentEvaluate(node, options, virtualNode) {
  25382. if (!virtualNode.children) {
  25383. return void 0;
  25384. }
  25385. try {
  25386. var focusableDescendants2 = getFocusableDescendants(virtualNode);
  25387. if (!focusableDescendants2.length) {
  25388. return true;
  25389. }
  25390. var notHiddenElements = focusableDescendants2.filter(usesUnreliableHidingStrategy);
  25391. if (notHiddenElements.length > 0) {
  25392. this.data({
  25393. messageKey: 'notHidden'
  25394. });
  25395. this.relatedNodes(notHiddenElements);
  25396. } else {
  25397. this.relatedNodes(focusableDescendants2);
  25398. }
  25399. return false;
  25400. } catch (_unused13) {
  25401. return void 0;
  25402. }
  25403. }
  25404. function getFocusableDescendants(vNode) {
  25405. if (!vNode.children) {
  25406. if (vNode.props.nodeType === 1) {
  25407. throw new Error('Cannot determine children');
  25408. }
  25409. return [];
  25410. }
  25411. var retVal = [];
  25412. vNode.children.forEach(function(child) {
  25413. if (get_role_type_default(child) === 'widget' && _isFocusable(child)) {
  25414. retVal.push(child);
  25415. } else {
  25416. retVal.push.apply(retVal, _toConsumableArray(getFocusableDescendants(child)));
  25417. }
  25418. });
  25419. return retVal;
  25420. }
  25421. function usesUnreliableHidingStrategy(vNode) {
  25422. var tabIndex = parse_tabindex_default(vNode.attr('tabindex'));
  25423. return tabIndex !== null && tabIndex < 0;
  25424. }
  25425. function landmarkIsTopLevelEvaluate(node) {
  25426. var landmarks = get_aria_roles_by_type_default('landmark');
  25427. var parent = get_composed_parent_default(node);
  25428. var nodeRole = get_role_default(node);
  25429. this.data({
  25430. role: nodeRole
  25431. });
  25432. while (parent) {
  25433. var role = parent.getAttribute('role');
  25434. if (!role && parent.nodeName.toUpperCase() !== 'FORM') {
  25435. role = implicit_role_default(parent);
  25436. }
  25437. if (role && landmarks.includes(role) && !(role === 'main' && nodeRole === 'complementary')) {
  25438. return false;
  25439. }
  25440. parent = get_composed_parent_default(parent);
  25441. }
  25442. return true;
  25443. }
  25444. var landmark_is_top_level_evaluate_default = landmarkIsTopLevelEvaluate;
  25445. function frameFocusableContentEvaluate(node, options, virtualNode) {
  25446. if (!virtualNode.children) {
  25447. return void 0;
  25448. }
  25449. try {
  25450. return !virtualNode.children.some(function(child) {
  25451. return focusableDescendants(child);
  25452. });
  25453. } catch (_unused14) {
  25454. return void 0;
  25455. }
  25456. }
  25457. function focusableDescendants(vNode) {
  25458. if (_isInTabOrder(vNode)) {
  25459. return true;
  25460. }
  25461. if (!vNode.children) {
  25462. if (vNode.props.nodeType === 1) {
  25463. throw new Error('Cannot determine children');
  25464. }
  25465. return false;
  25466. }
  25467. return vNode.children.some(function(child) {
  25468. return focusableDescendants(child);
  25469. });
  25470. }
  25471. function focusableNotTabbableEvaluate(node, options, virtualNode) {
  25472. var elementsThatCanBeDisabled = [ 'button', 'fieldset', 'input', 'select', 'textarea' ];
  25473. var tabbableElements = virtualNode.tabbableElements;
  25474. if (!tabbableElements || !tabbableElements.length) {
  25475. return true;
  25476. }
  25477. var relatedNodes = tabbableElements.filter(function(vNode) {
  25478. return !elementsThatCanBeDisabled.includes(vNode.props.nodeName);
  25479. });
  25480. this.relatedNodes(relatedNodes.map(function(vNode) {
  25481. return vNode.actualNode;
  25482. }));
  25483. if (relatedNodes.length === 0 || is_modal_open_default()) {
  25484. return true;
  25485. }
  25486. return relatedNodes.every(function(vNode) {
  25487. var pointerEvents = vNode.getComputedStylePropertyValue('pointer-events');
  25488. var width = parseInt(vNode.getComputedStylePropertyValue('width'));
  25489. var height = parseInt(vNode.getComputedStylePropertyValue('height'));
  25490. return vNode.actualNode.onfocus || (width === 0 || height === 0) && pointerEvents === 'none';
  25491. }) ? void 0 : false;
  25492. }
  25493. var focusable_not_tabbable_evaluate_default = focusableNotTabbableEvaluate;
  25494. function focusableNoNameEvaluate(node, options, virtualNode) {
  25495. if (!_isInTabOrder(virtualNode)) {
  25496. return false;
  25497. }
  25498. try {
  25499. return !_accessibleTextVirtual(virtualNode);
  25500. } catch (_unused15) {
  25501. return void 0;
  25502. }
  25503. }
  25504. var focusable_no_name_evaluate_default = focusableNoNameEvaluate;
  25505. function focusableModalOpenEvaluate(node, options, virtualNode) {
  25506. var tabbableElements = virtualNode.tabbableElements.map(function(_ref130) {
  25507. var actualNode = _ref130.actualNode;
  25508. return actualNode;
  25509. });
  25510. if (!tabbableElements || !tabbableElements.length) {
  25511. return true;
  25512. }
  25513. if (is_modal_open_default()) {
  25514. this.relatedNodes(tabbableElements);
  25515. return void 0;
  25516. }
  25517. return true;
  25518. }
  25519. var focusable_modal_open_evaluate_default = focusableModalOpenEvaluate;
  25520. function focusableElementEvaluate(node, options, virtualNode) {
  25521. if (virtualNode.hasAttr('contenteditable') && isContenteditable(virtualNode)) {
  25522. return true;
  25523. }
  25524. return _isInTabOrder(virtualNode);
  25525. function isContenteditable(vNode) {
  25526. var contenteditable = vNode.attr('contenteditable');
  25527. if (contenteditable === 'true' || contenteditable === '') {
  25528. return true;
  25529. }
  25530. if (contenteditable === 'false') {
  25531. return false;
  25532. }
  25533. var ancestor = closest_default(virtualNode.parent, '[contenteditable]');
  25534. if (!ancestor) {
  25535. return false;
  25536. }
  25537. return isContenteditable(ancestor);
  25538. }
  25539. }
  25540. var focusable_element_evaluate_default = focusableElementEvaluate;
  25541. function focusableDisabledEvaluate(node, options, virtualNode) {
  25542. var elementsThatCanBeDisabled = [ 'button', 'fieldset', 'input', 'select', 'textarea' ];
  25543. var tabbableElements = virtualNode.tabbableElements;
  25544. if (!tabbableElements || !tabbableElements.length) {
  25545. return true;
  25546. }
  25547. var relatedNodes = tabbableElements.filter(function(vNode) {
  25548. return elementsThatCanBeDisabled.includes(vNode.props.nodeName);
  25549. });
  25550. this.relatedNodes(relatedNodes.map(function(vNode) {
  25551. return vNode.actualNode;
  25552. }));
  25553. if (relatedNodes.length === 0 || is_modal_open_default()) {
  25554. return true;
  25555. }
  25556. return relatedNodes.every(function(vNode) {
  25557. var pointerEvents = vNode.getComputedStylePropertyValue('pointer-events');
  25558. var width = parseInt(vNode.getComputedStylePropertyValue('width'));
  25559. var height = parseInt(vNode.getComputedStylePropertyValue('height'));
  25560. return vNode.actualNode.onfocus || (width === 0 || height === 0) && pointerEvents === 'none';
  25561. }) ? void 0 : false;
  25562. }
  25563. var focusable_disabled_evaluate_default = focusableDisabledEvaluate;
  25564. function focusableContentEvaluate(node, options, virtualNode) {
  25565. var tabbableElements = virtualNode.tabbableElements;
  25566. if (!tabbableElements) {
  25567. return false;
  25568. }
  25569. var tabbableContentElements = tabbableElements.filter(function(el) {
  25570. return el !== virtualNode;
  25571. });
  25572. return tabbableContentElements.length > 0;
  25573. }
  25574. var focusable_content_evaluate_default = focusableContentEvaluate;
  25575. function accesskeysEvaluate(node, options, vNode) {
  25576. if (!_isHiddenForEveryone(vNode)) {
  25577. this.data(vNode.attr('accesskey'));
  25578. this.relatedNodes([ node ]);
  25579. }
  25580. return true;
  25581. }
  25582. var accesskeys_evaluate_default = accesskeysEvaluate;
  25583. function accesskeysAfter(results) {
  25584. var seen = {};
  25585. return results.filter(function(r) {
  25586. if (!r.data) {
  25587. return false;
  25588. }
  25589. var key = r.data.toUpperCase();
  25590. if (!seen[key]) {
  25591. seen[key] = r;
  25592. r.relatedNodes = [];
  25593. return true;
  25594. }
  25595. seen[key].relatedNodes.push(r.relatedNodes[0]);
  25596. return false;
  25597. }).map(function(r) {
  25598. r.result = !!r.relatedNodes.length;
  25599. return r;
  25600. });
  25601. }
  25602. var accesskeys_after_default = accesskeysAfter;
  25603. function pageNoDuplicateEvaluate(node, options, virtualNode) {
  25604. if (!options || !options.selector || typeof options.selector !== 'string') {
  25605. throw new TypeError('page-no-duplicate requires options.selector to be a string');
  25606. }
  25607. var key = 'page-no-duplicate;' + options.selector;
  25608. if (cache_default.get(key)) {
  25609. this.data('ignored');
  25610. return;
  25611. }
  25612. cache_default.set(key, true);
  25613. var elms = query_selector_all_filter_default(axe._tree[0], options.selector, function(elm) {
  25614. return _isVisibleToScreenReaders(elm);
  25615. });
  25616. if (typeof options.nativeScopeFilter === 'string') {
  25617. elms = elms.filter(function(elm) {
  25618. return elm.actualNode.hasAttribute('role') || !find_up_virtual_default(elm, options.nativeScopeFilter);
  25619. });
  25620. }
  25621. if (typeof options.role === 'string') {
  25622. elms = elms.filter(function(elm) {
  25623. return get_role_default(elm) === options.role;
  25624. });
  25625. }
  25626. this.relatedNodes(elms.filter(function(elm) {
  25627. return elm !== virtualNode;
  25628. }).map(function(elm) {
  25629. return elm.actualNode;
  25630. }));
  25631. return elms.length <= 1;
  25632. }
  25633. var page_no_duplicate_evaluate_default = pageNoDuplicateEvaluate;
  25634. function pageNoDuplicateAfter(results) {
  25635. return results.filter(function(checkResult) {
  25636. return checkResult.data !== 'ignored';
  25637. });
  25638. }
  25639. var page_no_duplicate_after_default = pageNoDuplicateAfter;
  25640. function matchesDefinitionEvaluate(_, options, virtualNode) {
  25641. return matches_default2(virtualNode, options.matcher);
  25642. }
  25643. var matches_definition_evaluate_default = matchesDefinitionEvaluate;
  25644. function hasTextContentEvaluate(node, options, virtualNode) {
  25645. try {
  25646. return sanitize_default(subtree_text_default(virtualNode)) !== '';
  25647. } catch (_unused16) {
  25648. return void 0;
  25649. }
  25650. }
  25651. function hasDescendant(node, options, virtualNode) {
  25652. if (!options || !options.selector || typeof options.selector !== 'string') {
  25653. throw new TypeError('has-descendant requires options.selector to be a string');
  25654. }
  25655. if (options.passForModal && is_modal_open_default()) {
  25656. return true;
  25657. }
  25658. var matchingElms = query_selector_all_filter_default(virtualNode, options.selector, function(vNode) {
  25659. return _isVisibleToScreenReaders(vNode);
  25660. });
  25661. this.relatedNodes(matchingElms.map(function(vNode) {
  25662. return vNode.actualNode;
  25663. }));
  25664. return matchingElms.length > 0;
  25665. }
  25666. var has_descendant_evaluate_default = hasDescendant;
  25667. function pageHasElmAfter(results) {
  25668. var elmUsedAnywhere = results.some(function(frameResult) {
  25669. return frameResult.result === true;
  25670. });
  25671. if (elmUsedAnywhere) {
  25672. results.forEach(function(result) {
  25673. result.result = true;
  25674. });
  25675. }
  25676. return results;
  25677. }
  25678. var has_descendant_after_default = pageHasElmAfter;
  25679. function attrNonSpaceContentEvaluate(node) {
  25680. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  25681. var vNode = arguments.length > 2 ? arguments[2] : undefined;
  25682. if (!options.attribute || typeof options.attribute !== 'string') {
  25683. throw new TypeError('attr-non-space-content requires options.attribute to be a string');
  25684. }
  25685. if (!vNode.hasAttr(options.attribute)) {
  25686. this.data({
  25687. messageKey: 'noAttr'
  25688. });
  25689. return false;
  25690. }
  25691. var attribute = vNode.attr(options.attribute);
  25692. var attributeIsEmpty = !sanitize_default(attribute);
  25693. if (attributeIsEmpty) {
  25694. this.data({
  25695. messageKey: 'emptyAttr'
  25696. });
  25697. return false;
  25698. }
  25699. return true;
  25700. }
  25701. var attr_non_space_content_evaluate_default = attrNonSpaceContentEvaluate;
  25702. function autocompleteValidEvaluate(_node, options, virtualNode) {
  25703. var autocomplete2 = virtualNode.attr('autocomplete') || '';
  25704. return is_valid_autocomplete_default(autocomplete2, options);
  25705. }
  25706. var autocomplete_valid_evaluate_default = autocompleteValidEvaluate;
  25707. function autocompleteAppropriateEvaluate(node, options, virtualNode) {
  25708. if (virtualNode.props.nodeName !== 'input') {
  25709. return true;
  25710. }
  25711. var number = [ 'text', 'search', 'number', 'tel' ];
  25712. var url = [ 'text', 'search', 'url' ];
  25713. var allowedTypesMap = {
  25714. bday: [ 'text', 'search', 'date' ],
  25715. email: [ 'text', 'search', 'email' ],
  25716. username: [ 'text', 'search', 'email' ],
  25717. 'street-address': [ 'text' ],
  25718. tel: [ 'text', 'search', 'tel' ],
  25719. 'tel-country-code': [ 'text', 'search', 'tel' ],
  25720. 'tel-national': [ 'text', 'search', 'tel' ],
  25721. 'tel-area-code': [ 'text', 'search', 'tel' ],
  25722. 'tel-local': [ 'text', 'search', 'tel' ],
  25723. 'tel-local-prefix': [ 'text', 'search', 'tel' ],
  25724. 'tel-local-suffix': [ 'text', 'search', 'tel' ],
  25725. 'tel-extension': [ 'text', 'search', 'tel' ],
  25726. 'cc-number': number,
  25727. 'cc-exp': [ 'text', 'search', 'month', 'tel' ],
  25728. 'cc-exp-month': number,
  25729. 'cc-exp-year': number,
  25730. 'cc-csc': number,
  25731. 'transaction-amount': number,
  25732. 'bday-day': number,
  25733. 'bday-month': number,
  25734. 'bday-year': number,
  25735. 'new-password': [ 'text', 'search', 'password' ],
  25736. 'current-password': [ 'text', 'search', 'password' ],
  25737. url: url,
  25738. photo: url,
  25739. impp: url
  25740. };
  25741. if (_typeof(options) === 'object') {
  25742. Object.keys(options).forEach(function(key) {
  25743. if (!allowedTypesMap[key]) {
  25744. allowedTypesMap[key] = [];
  25745. }
  25746. allowedTypesMap[key] = allowedTypesMap[key].concat(options[key]);
  25747. });
  25748. }
  25749. var autocompleteAttr = virtualNode.attr('autocomplete');
  25750. var autocompleteTerms = autocompleteAttr.split(/\s+/g).map(function(term) {
  25751. return term.toLowerCase();
  25752. });
  25753. var purposeTerm = autocompleteTerms[autocompleteTerms.length - 1];
  25754. if (_autocomplete.stateTerms.includes(purposeTerm)) {
  25755. return true;
  25756. }
  25757. var allowedTypes = allowedTypesMap[purposeTerm];
  25758. var type2 = virtualNode.hasAttr('type') ? sanitize_default(virtualNode.attr('type')).toLowerCase() : 'text';
  25759. type2 = valid_input_type_default().includes(type2) ? type2 : 'text';
  25760. if (typeof allowedTypes === 'undefined') {
  25761. return type2 === 'text';
  25762. }
  25763. return allowedTypes.includes(type2);
  25764. }
  25765. var autocomplete_appropriate_evaluate_default = autocompleteAppropriateEvaluate;
  25766. var blockLike2 = [ 'block', 'list-item', 'table', 'flex', 'grid', 'inline-block' ];
  25767. function linkInTextBlockStyleEvaluate(node) {
  25768. if (isBlock2(node)) {
  25769. return false;
  25770. }
  25771. var parentBlock = get_composed_parent_default(node);
  25772. while (parentBlock && parentBlock.nodeType === 1 && !isBlock2(parentBlock)) {
  25773. parentBlock = get_composed_parent_default(parentBlock);
  25774. }
  25775. if (!parentBlock) {
  25776. return void 0;
  25777. }
  25778. this.relatedNodes([ parentBlock ]);
  25779. if (element_is_distinct_default(node, parentBlock)) {
  25780. return true;
  25781. }
  25782. if (hasPseudoContent(node)) {
  25783. this.data({
  25784. messageKey: 'pseudoContent'
  25785. });
  25786. return void 0;
  25787. }
  25788. return false;
  25789. }
  25790. function isBlock2(elm) {
  25791. var display2 = window.getComputedStyle(elm).getPropertyValue('display');
  25792. return blockLike2.indexOf(display2) !== -1 || display2.substr(0, 6) === 'table-';
  25793. }
  25794. function hasPseudoContent(node) {
  25795. for (var _i41 = 0, _arr3 = [ 'before', 'after' ]; _i41 < _arr3.length; _i41++) {
  25796. var pseudo = _arr3[_i41];
  25797. var style = window.getComputedStyle(node, ':'.concat(pseudo));
  25798. var content = style.getPropertyValue('content');
  25799. if (content !== 'none') {
  25800. return true;
  25801. }
  25802. }
  25803. return false;
  25804. }
  25805. function getContrast2(color1, color2) {
  25806. var c1lum = color1.getRelativeLuminance();
  25807. var c2lum = color2.getRelativeLuminance();
  25808. return (Math.max(c1lum, c2lum) + .05) / (Math.min(c1lum, c2lum) + .05);
  25809. }
  25810. var blockLike3 = [ 'block', 'list-item', 'table', 'flex', 'grid', 'inline-block' ];
  25811. function isBlock3(elm) {
  25812. var display2 = window.getComputedStyle(elm).getPropertyValue('display');
  25813. return blockLike3.indexOf(display2) !== -1 || display2.substr(0, 6) === 'table-';
  25814. }
  25815. function linkInTextBlockEvaluate(node, options) {
  25816. var requiredContrastRatio = options.requiredContrastRatio, allowSameColor = options.allowSameColor;
  25817. if (isBlock3(node)) {
  25818. return false;
  25819. }
  25820. var parentBlock = get_composed_parent_default(node);
  25821. while (parentBlock && parentBlock.nodeType === 1 && !isBlock3(parentBlock)) {
  25822. parentBlock = get_composed_parent_default(parentBlock);
  25823. }
  25824. if (!parentBlock) {
  25825. return void 0;
  25826. }
  25827. this.relatedNodes([ parentBlock ]);
  25828. var nodeColor = _getForegroundColor(node);
  25829. var parentColor = _getForegroundColor(parentBlock);
  25830. var nodeBackgroundColor = _getBackgroundColor2(node);
  25831. var parentBackgroundColor = _getBackgroundColor2(parentBlock);
  25832. var textContrast = nodeColor && parentColor ? getContrast2(nodeColor, parentColor) : void 0;
  25833. if (textContrast) {
  25834. textContrast = Math.floor(textContrast * 100) / 100;
  25835. }
  25836. if (textContrast && textContrast >= requiredContrastRatio) {
  25837. return true;
  25838. }
  25839. var backgroundContrast = nodeBackgroundColor && parentBackgroundColor ? getContrast2(nodeBackgroundColor, parentBackgroundColor) : void 0;
  25840. if (backgroundContrast) {
  25841. backgroundContrast = Math.floor(backgroundContrast * 100) / 100;
  25842. }
  25843. if (backgroundContrast && backgroundContrast >= requiredContrastRatio) {
  25844. return true;
  25845. }
  25846. if (!backgroundContrast) {
  25847. var _incomplete_data_defa;
  25848. var reason = (_incomplete_data_defa = incomplete_data_default.get('bgColor')) !== null && _incomplete_data_defa !== void 0 ? _incomplete_data_defa : 'bgContrast';
  25849. this.data({
  25850. messageKey: reason
  25851. });
  25852. incomplete_data_default.clear();
  25853. return void 0;
  25854. }
  25855. if (!textContrast) {
  25856. return void 0;
  25857. }
  25858. if (allowSameColor && textContrast === 1 && backgroundContrast === 1) {
  25859. return true;
  25860. }
  25861. if (textContrast === 1 && backgroundContrast > 1) {
  25862. this.data({
  25863. messageKey: 'bgContrast',
  25864. contrastRatio: backgroundContrast,
  25865. requiredContrastRatio: requiredContrastRatio,
  25866. nodeBackgroundColor: nodeBackgroundColor ? nodeBackgroundColor.toHexString() : void 0,
  25867. parentBackgroundColor: parentBackgroundColor ? parentBackgroundColor.toHexString() : void 0
  25868. });
  25869. return false;
  25870. }
  25871. this.data({
  25872. messageKey: 'fgContrast',
  25873. contrastRatio: textContrast,
  25874. requiredContrastRatio: requiredContrastRatio,
  25875. nodeColor: nodeColor ? nodeColor.toHexString() : void 0,
  25876. parentColor: parentColor ? parentColor.toHexString() : void 0
  25877. });
  25878. return false;
  25879. }
  25880. var link_in_text_block_evaluate_default = linkInTextBlockEvaluate;
  25881. function colorContrastEvaluate(node, options, virtualNode) {
  25882. var ignoreUnicode = options.ignoreUnicode, ignoreLength = options.ignoreLength, ignorePseudo = options.ignorePseudo, boldValue = options.boldValue, boldTextPt = options.boldTextPt, largeTextPt = options.largeTextPt, contrastRatio = options.contrastRatio, shadowOutlineEmMax = options.shadowOutlineEmMax, pseudoSizeThreshold = options.pseudoSizeThreshold;
  25883. if (!_isVisibleOnScreen(node)) {
  25884. this.data({
  25885. messageKey: 'hidden'
  25886. });
  25887. return true;
  25888. }
  25889. var visibleText = visible_virtual_default(virtualNode, false, true);
  25890. if (ignoreUnicode && textIsEmojis(visibleText)) {
  25891. this.data({
  25892. messageKey: 'nonBmp'
  25893. });
  25894. return void 0;
  25895. }
  25896. var nodeStyle = window.getComputedStyle(node);
  25897. var fontSize = parseFloat(nodeStyle.getPropertyValue('font-size'));
  25898. var fontWeight = nodeStyle.getPropertyValue('font-weight');
  25899. var bold = parseFloat(fontWeight) >= boldValue || fontWeight === 'bold';
  25900. var ptSize = Math.ceil(fontSize * 72) / 96;
  25901. var isSmallFont = bold && ptSize < boldTextPt || !bold && ptSize < largeTextPt;
  25902. var _ref131 = isSmallFont ? contrastRatio.normal : contrastRatio.large, expected = _ref131.expected, minThreshold = _ref131.minThreshold, maxThreshold = _ref131.maxThreshold;
  25903. var pseudoElm = findPseudoElement(virtualNode, {
  25904. ignorePseudo: ignorePseudo,
  25905. pseudoSizeThreshold: pseudoSizeThreshold
  25906. });
  25907. if (pseudoElm) {
  25908. this.data({
  25909. fontSize: ''.concat((fontSize * 72 / 96).toFixed(1), 'pt (').concat(fontSize, 'px)'),
  25910. fontWeight: bold ? 'bold' : 'normal',
  25911. messageKey: 'pseudoContent',
  25912. expectedContrastRatio: expected + ':1'
  25913. });
  25914. this.relatedNodes(pseudoElm.actualNode);
  25915. return void 0;
  25916. }
  25917. var shadowColors = _getTextShadowColors(node, {
  25918. minRatio: .001,
  25919. maxRatio: shadowOutlineEmMax
  25920. });
  25921. if (shadowColors === null) {
  25922. this.data({
  25923. messageKey: 'complexTextShadows'
  25924. });
  25925. return void 0;
  25926. }
  25927. var bgNodes = [];
  25928. var bgColor = _getBackgroundColor2(node, bgNodes, shadowOutlineEmMax);
  25929. var fgColor = _getForegroundColor(node, false, bgColor, options);
  25930. var contrast2 = null;
  25931. var contrastContributor = null;
  25932. var shadowColor = null;
  25933. if (shadowColors.length === 0) {
  25934. contrast2 = get_contrast_default(bgColor, fgColor);
  25935. } else if (fgColor && bgColor) {
  25936. shadowColor = [].concat(_toConsumableArray(shadowColors), [ bgColor ]).reduce(_flattenShadowColors);
  25937. var fgBgContrast = get_contrast_default(bgColor, fgColor);
  25938. var bgShContrast = get_contrast_default(bgColor, shadowColor);
  25939. var fgShContrast = get_contrast_default(shadowColor, fgColor);
  25940. contrast2 = Math.max(fgBgContrast, bgShContrast, fgShContrast);
  25941. if (contrast2 !== fgBgContrast) {
  25942. contrastContributor = bgShContrast > fgShContrast ? 'shadowOnBgColor' : 'fgOnShadowColor';
  25943. }
  25944. }
  25945. var isValid = contrast2 > expected;
  25946. if (typeof minThreshold === 'number' && (typeof contrast2 !== 'number' || contrast2 < minThreshold) || typeof maxThreshold === 'number' && (typeof contrast2 !== 'number' || contrast2 > maxThreshold)) {
  25947. this.data({
  25948. contrastRatio: contrast2
  25949. });
  25950. return true;
  25951. }
  25952. var truncatedResult = Math.floor(contrast2 * 100) / 100;
  25953. var missing;
  25954. if (bgColor === null) {
  25955. missing = incomplete_data_default.get('bgColor');
  25956. } else if (!isValid) {
  25957. missing = contrastContributor;
  25958. }
  25959. var equalRatio = truncatedResult === 1;
  25960. var shortTextContent = visibleText.length === 1;
  25961. if (equalRatio) {
  25962. missing = incomplete_data_default.set('bgColor', 'equalRatio');
  25963. } else if (!isValid && shortTextContent && !ignoreLength) {
  25964. missing = 'shortTextContent';
  25965. }
  25966. this.data({
  25967. fgColor: fgColor ? fgColor.toHexString() : void 0,
  25968. bgColor: bgColor ? bgColor.toHexString() : void 0,
  25969. contrastRatio: truncatedResult,
  25970. fontSize: ''.concat((fontSize * 72 / 96).toFixed(1), 'pt (').concat(fontSize, 'px)'),
  25971. fontWeight: bold ? 'bold' : 'normal',
  25972. messageKey: missing,
  25973. expectedContrastRatio: expected + ':1',
  25974. shadowColor: shadowColor ? shadowColor.toHexString() : void 0
  25975. });
  25976. if (fgColor === null || bgColor === null || equalRatio || shortTextContent && !ignoreLength && !isValid) {
  25977. missing = null;
  25978. incomplete_data_default.clear();
  25979. this.relatedNodes(bgNodes);
  25980. return void 0;
  25981. }
  25982. if (!isValid) {
  25983. this.relatedNodes(bgNodes);
  25984. }
  25985. return isValid;
  25986. }
  25987. function findPseudoElement(vNode, _ref132) {
  25988. var _ref132$pseudoSizeThr = _ref132.pseudoSizeThreshold, pseudoSizeThreshold = _ref132$pseudoSizeThr === void 0 ? .25 : _ref132$pseudoSizeThr, _ref132$ignorePseudo = _ref132.ignorePseudo, ignorePseudo = _ref132$ignorePseudo === void 0 ? false : _ref132$ignorePseudo;
  25989. if (ignorePseudo) {
  25990. return;
  25991. }
  25992. var rect = vNode.boundingClientRect;
  25993. var minimumSize = rect.width * rect.height * pseudoSizeThreshold;
  25994. do {
  25995. var beforeSize = getPseudoElementArea(vNode.actualNode, ':before');
  25996. var afterSize = getPseudoElementArea(vNode.actualNode, ':after');
  25997. if (beforeSize + afterSize > minimumSize) {
  25998. return vNode;
  25999. }
  26000. } while (vNode = vNode.parent);
  26001. }
  26002. var getPseudoElementArea = memoize_default(function getPseudoElementArea2(node, pseudo) {
  26003. var style = window.getComputedStyle(node, pseudo);
  26004. var matchPseudoStyle = function matchPseudoStyle(prop, value) {
  26005. return style.getPropertyValue(prop) === value;
  26006. };
  26007. if (matchPseudoStyle('content', 'none') || matchPseudoStyle('display', 'none') || matchPseudoStyle('visibility', 'hidden') || matchPseudoStyle('position', 'absolute') === false) {
  26008. return 0;
  26009. }
  26010. if (get_own_background_color_default(style).alpha === 0 && matchPseudoStyle('background-image', 'none')) {
  26011. return 0;
  26012. }
  26013. var pseudoWidth = parseUnit(style.getPropertyValue('width'));
  26014. var pseudoHeight = parseUnit(style.getPropertyValue('height'));
  26015. if (pseudoWidth.unit !== 'px' || pseudoHeight.unit !== 'px') {
  26016. return pseudoWidth.value === 0 || pseudoHeight.value === 0 ? 0 : Infinity;
  26017. }
  26018. return pseudoWidth.value * pseudoHeight.value;
  26019. });
  26020. function textIsEmojis(visibleText) {
  26021. var options = {
  26022. nonBmp: true
  26023. };
  26024. var hasUnicodeChars = has_unicode_default(visibleText, options);
  26025. var hasNonUnicodeChars = sanitize_default(remove_unicode_default(visibleText, options)) === '';
  26026. return hasUnicodeChars && hasNonUnicodeChars;
  26027. }
  26028. function parseUnit(str) {
  26029. var unitRegex = /^([0-9.]+)([a-z]+)$/i;
  26030. var _ref133 = str.match(unitRegex) || [], _ref134 = _slicedToArray(_ref133, 3), _ref134$ = _ref134[1], value = _ref134$ === void 0 ? '' : _ref134$, _ref134$2 = _ref134[2], unit = _ref134$2 === void 0 ? '' : _ref134$2;
  26031. return {
  26032. value: parseFloat(value),
  26033. unit: unit.toLowerCase()
  26034. };
  26035. }
  26036. var VALID_TAG_NAMES_FOR_SCROLLABLE_REGIONS = {
  26037. ARTICLE: true,
  26038. ASIDE: true,
  26039. NAV: true,
  26040. SECTION: true
  26041. };
  26042. var VALID_ROLES_FOR_SCROLLABLE_REGIONS = {
  26043. alert: true,
  26044. alertdialog: true,
  26045. application: true,
  26046. article: true,
  26047. banner: false,
  26048. complementary: true,
  26049. contentinfo: true,
  26050. dialog: true,
  26051. form: true,
  26052. log: true,
  26053. main: true,
  26054. navigation: true,
  26055. region: true,
  26056. search: false,
  26057. status: true,
  26058. tabpanel: true
  26059. };
  26060. function validScrollableTagName(node) {
  26061. var nodeName2 = node.nodeName.toUpperCase();
  26062. return VALID_TAG_NAMES_FOR_SCROLLABLE_REGIONS[nodeName2] || false;
  26063. }
  26064. function validScrollableRole(node, options) {
  26065. var role = get_explicit_role_default(node);
  26066. if (!role) {
  26067. return false;
  26068. }
  26069. return VALID_ROLES_FOR_SCROLLABLE_REGIONS[role] || options.roles.includes(role) || false;
  26070. }
  26071. function validScrollableSemanticsEvaluate(node, options) {
  26072. return validScrollableRole(node, options) || validScrollableTagName(node);
  26073. }
  26074. var valid_scrollable_semantics_evaluate_default = validScrollableSemanticsEvaluate;
  26075. function unsupportedroleEvaluate(node, options, virtualNode) {
  26076. var role = get_role_default(virtualNode, {
  26077. dpub: true,
  26078. fallback: true
  26079. });
  26080. var isUnsupported = is_unsupported_role_default(role);
  26081. if (isUnsupported) {
  26082. this.data(role);
  26083. }
  26084. return isUnsupported;
  26085. }
  26086. var unsupportedrole_evaluate_default = unsupportedroleEvaluate;
  26087. function noImplicitExplicitLabelEvaluate(node, options, virtualNode) {
  26088. var role = get_role_default(virtualNode, {
  26089. noImplicit: true
  26090. });
  26091. this.data(role);
  26092. var label3;
  26093. var accText;
  26094. try {
  26095. label3 = sanitize_default(label_text_default(virtualNode)).toLowerCase();
  26096. accText = sanitize_default(_accessibleTextVirtual(virtualNode)).toLowerCase();
  26097. } catch (_unused17) {
  26098. return void 0;
  26099. }
  26100. if (!accText && !label3) {
  26101. return false;
  26102. }
  26103. if (!accText && label3) {
  26104. return void 0;
  26105. }
  26106. if (!accText.includes(label3)) {
  26107. return void 0;
  26108. }
  26109. return false;
  26110. }
  26111. var no_implicit_explicit_label_evaluate_default = noImplicitExplicitLabelEvaluate;
  26112. function isElementFocusableEvaluate(node, options, virtualNode) {
  26113. return _isFocusable(virtualNode);
  26114. }
  26115. var is_element_focusable_evaluate_default = isElementFocusableEvaluate;
  26116. function invalidroleEvaluate(node, options, virtualNode) {
  26117. var allRoles = token_list_default(virtualNode.attr('role'));
  26118. var allInvalid = allRoles.every(function(role) {
  26119. return !is_valid_role_default(role.toLowerCase(), {
  26120. allowAbstract: true
  26121. });
  26122. });
  26123. if (allInvalid) {
  26124. this.data(allRoles);
  26125. return true;
  26126. }
  26127. return false;
  26128. }
  26129. var invalidrole_evaluate_default = invalidroleEvaluate;
  26130. function hasWidgetRoleEvaluate(node) {
  26131. var role = node.getAttribute('role');
  26132. if (role === null) {
  26133. return false;
  26134. }
  26135. var roleType = get_role_type_default(role);
  26136. return roleType === 'widget' || roleType === 'composite';
  26137. }
  26138. var has_widget_role_evaluate_default = hasWidgetRoleEvaluate;
  26139. function hasGlobalAriaAttributeEvaluate(node, options, virtualNode) {
  26140. var globalAttrs = get_global_aria_attrs_default().filter(function(attr) {
  26141. return virtualNode.hasAttr(attr);
  26142. });
  26143. this.data(globalAttrs);
  26144. return globalAttrs.length > 0;
  26145. }
  26146. var has_global_aria_attribute_evaluate_default = hasGlobalAriaAttributeEvaluate;
  26147. function nonePresentationOnElementWithNoImplicitRole(virtualNode, explicitRoles) {
  26148. var hasImplicitRole = implicit_role_default(virtualNode);
  26149. return !hasImplicitRole && explicitRoles.length === 2 && explicitRoles.includes('none') && explicitRoles.includes('presentation');
  26150. }
  26151. function fallbackroleEvaluate(node, options, virtualNode) {
  26152. var explicitRoles = token_list_default(virtualNode.attr('role'));
  26153. if (explicitRoles.length <= 1) {
  26154. return false;
  26155. }
  26156. return nonePresentationOnElementWithNoImplicitRole(virtualNode, explicitRoles) ? void 0 : true;
  26157. }
  26158. var fallbackrole_evaluate_default = fallbackroleEvaluate;
  26159. function deprecatedroleEvaluate(node, options, virtualNode) {
  26160. var role = get_role_default(virtualNode, {
  26161. dpub: true,
  26162. fallback: true
  26163. });
  26164. var roleDefinition = standards_default.ariaRoles[role];
  26165. if (!(roleDefinition !== null && roleDefinition !== void 0 && roleDefinition.deprecated)) {
  26166. return false;
  26167. }
  26168. this.data(role);
  26169. return true;
  26170. }
  26171. function brailleRoleDescriptionEquivalentEvaluate(node, options, virtualNode) {
  26172. var _virtualNode$attr;
  26173. var brailleRoleDesc = (_virtualNode$attr = virtualNode.attr('aria-brailleroledescription')) !== null && _virtualNode$attr !== void 0 ? _virtualNode$attr : '';
  26174. if (sanitize_default(brailleRoleDesc) === '') {
  26175. return true;
  26176. }
  26177. var roleDesc = virtualNode.attr('aria-roledescription');
  26178. if (typeof roleDesc !== 'string') {
  26179. this.data({
  26180. messageKey: 'noRoleDescription'
  26181. });
  26182. return false;
  26183. }
  26184. if (sanitize_default(roleDesc) === '') {
  26185. this.data({
  26186. messageKey: 'emptyRoleDescription'
  26187. });
  26188. return false;
  26189. }
  26190. return true;
  26191. }
  26192. function brailleLabelEquivalentEvaluate(node, options, virtualNode) {
  26193. var _virtualNode$attr2;
  26194. var brailleLabel = (_virtualNode$attr2 = virtualNode.attr('aria-braillelabel')) !== null && _virtualNode$attr2 !== void 0 ? _virtualNode$attr2 : '';
  26195. if (!brailleLabel.trim()) {
  26196. return true;
  26197. }
  26198. try {
  26199. return sanitize_default(_accessibleTextVirtual(virtualNode)) !== '';
  26200. } catch (_unused18) {
  26201. return void 0;
  26202. }
  26203. }
  26204. function ariaValidAttrValueEvaluate(node, options, virtualNode) {
  26205. options = Array.isArray(options.value) ? options.value : [];
  26206. var needsReview = '';
  26207. var messageKey = '';
  26208. var invalid = [];
  26209. var aria = /^aria-/;
  26210. var skipAttrs = [ 'aria-errormessage' ];
  26211. var preChecks = {
  26212. 'aria-controls': function ariaControls() {
  26213. var hasPopup = [ 'false', null ].includes(virtualNode.attr('aria-haspopup')) === false;
  26214. if (hasPopup) {
  26215. needsReview = 'aria-controls="'.concat(virtualNode.attr('aria-controls'), '"');
  26216. messageKey = 'controlsWithinPopup';
  26217. }
  26218. return virtualNode.attr('aria-expanded') !== 'false' && virtualNode.attr('aria-selected') !== 'false' && hasPopup === false;
  26219. },
  26220. 'aria-current': function ariaCurrent(validValue) {
  26221. if (!validValue) {
  26222. needsReview = 'aria-current="'.concat(virtualNode.attr('aria-current'), '"');
  26223. messageKey = 'ariaCurrent';
  26224. }
  26225. return;
  26226. },
  26227. 'aria-owns': function ariaOwns() {
  26228. return virtualNode.attr('aria-expanded') !== 'false';
  26229. },
  26230. 'aria-describedby': function ariaDescribedby(validValue) {
  26231. if (!validValue) {
  26232. needsReview = 'aria-describedby="'.concat(virtualNode.attr('aria-describedby'), '"');
  26233. messageKey = axe._tree && axe._tree[0]._hasShadowRoot ? 'noIdShadow' : 'noId';
  26234. }
  26235. return;
  26236. },
  26237. 'aria-labelledby': function ariaLabelledby(validValue) {
  26238. if (!validValue) {
  26239. needsReview = 'aria-labelledby="'.concat(virtualNode.attr('aria-labelledby'), '"');
  26240. messageKey = axe._tree && axe._tree[0]._hasShadowRoot ? 'noIdShadow' : 'noId';
  26241. }
  26242. }
  26243. };
  26244. virtualNode.attrNames.forEach(function(attrName) {
  26245. if (skipAttrs.includes(attrName) || options.includes(attrName) || !aria.test(attrName)) {
  26246. return;
  26247. }
  26248. var validValue;
  26249. var attrValue = virtualNode.attr(attrName);
  26250. try {
  26251. validValue = validate_attr_value_default(virtualNode, attrName);
  26252. } catch (_unused19) {
  26253. needsReview = ''.concat(attrName, '="').concat(attrValue, '"');
  26254. messageKey = 'idrefs';
  26255. return;
  26256. }
  26257. if ((preChecks[attrName] ? preChecks[attrName](validValue) : true) && !validValue) {
  26258. if (attrValue === '' && !isStringType(attrName)) {
  26259. needsReview = attrName;
  26260. messageKey = 'empty';
  26261. } else {
  26262. invalid.push(''.concat(attrName, '="').concat(attrValue, '"'));
  26263. }
  26264. }
  26265. });
  26266. if (invalid.length) {
  26267. this.data(invalid);
  26268. return false;
  26269. }
  26270. if (needsReview) {
  26271. this.data({
  26272. messageKey: messageKey,
  26273. needsReview: needsReview
  26274. });
  26275. return void 0;
  26276. }
  26277. return true;
  26278. }
  26279. function isStringType(attrName) {
  26280. var _standards_default$ar;
  26281. return ((_standards_default$ar = standards_default.ariaAttrs[attrName]) === null || _standards_default$ar === void 0 ? void 0 : _standards_default$ar.type) === 'string';
  26282. }
  26283. function ariaValidAttrEvaluate(node, options, virtualNode) {
  26284. options = Array.isArray(options.value) ? options.value : [];
  26285. var invalid = [];
  26286. var aria = /^aria-/;
  26287. virtualNode.attrNames.forEach(function(attr) {
  26288. if (options.indexOf(attr) === -1 && aria.test(attr) && !validate_attr_default(attr)) {
  26289. invalid.push(attr);
  26290. }
  26291. });
  26292. if (invalid.length) {
  26293. this.data(invalid);
  26294. return false;
  26295. }
  26296. return true;
  26297. }
  26298. var aria_valid_attr_evaluate_default = ariaValidAttrEvaluate;
  26299. function ariaUnsupportedAttrEvaluate(node, options, virtualNode) {
  26300. var unsupportedAttrs = virtualNode.attrNames.filter(function(name) {
  26301. var attribute = standards_default.ariaAttrs[name];
  26302. if (!validate_attr_default(name)) {
  26303. return false;
  26304. }
  26305. var unsupported = attribute.unsupported;
  26306. if (_typeof(unsupported) !== 'object') {
  26307. return !!unsupported;
  26308. }
  26309. return !matches_default2(node, unsupported.exceptions);
  26310. });
  26311. if (unsupportedAttrs.length) {
  26312. this.data(unsupportedAttrs);
  26313. return true;
  26314. }
  26315. return false;
  26316. }
  26317. var aria_unsupported_attr_evaluate_default = ariaUnsupportedAttrEvaluate;
  26318. function ariaRoledescriptionEvaluate(node) {
  26319. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  26320. var virtualNode = arguments.length > 2 ? arguments[2] : undefined;
  26321. var role = get_role_default(virtualNode);
  26322. var supportedRoles = options.supportedRoles || [];
  26323. if (supportedRoles.includes(role)) {
  26324. return true;
  26325. }
  26326. if (role && role !== 'presentation' && role !== 'none') {
  26327. return void 0;
  26328. }
  26329. return false;
  26330. }
  26331. var aria_roledescription_evaluate_default = ariaRoledescriptionEvaluate;
  26332. function getMissingContext(virtualNode, ownGroupRoles, reqContext, includeElement) {
  26333. var explicitRole2 = get_explicit_role_default(virtualNode);
  26334. if (!reqContext) {
  26335. reqContext = required_context_default(explicitRole2);
  26336. }
  26337. if (!reqContext) {
  26338. return null;
  26339. }
  26340. var allowsGroup = reqContext.includes('group');
  26341. var vNode = includeElement ? virtualNode : virtualNode.parent;
  26342. while (vNode) {
  26343. var role = get_role_default(vNode, {
  26344. noPresentational: true
  26345. });
  26346. if (!role) {
  26347. vNode = vNode.parent;
  26348. } else if (role === 'group' && allowsGroup) {
  26349. if (ownGroupRoles.includes(explicitRole2)) {
  26350. reqContext.push(explicitRole2);
  26351. }
  26352. reqContext = reqContext.filter(function(r) {
  26353. return r !== 'group';
  26354. });
  26355. vNode = vNode.parent;
  26356. } else if (reqContext.includes(role)) {
  26357. return null;
  26358. } else {
  26359. return reqContext;
  26360. }
  26361. }
  26362. return reqContext;
  26363. }
  26364. function getAriaOwners(element) {
  26365. var owners = [];
  26366. var o = null;
  26367. while (element) {
  26368. if (element.getAttribute('id')) {
  26369. var _id5 = escape_selector_default(element.getAttribute('id'));
  26370. var doc = get_root_node_default2(element);
  26371. o = doc.querySelector('[aria-owns~='.concat(_id5, ']'));
  26372. if (o) {
  26373. owners.push(o);
  26374. }
  26375. }
  26376. element = element.parentElement;
  26377. }
  26378. return owners.length ? owners : null;
  26379. }
  26380. function ariaRequiredParentEvaluate(node, options, virtualNode) {
  26381. var ownGroupRoles = options && Array.isArray(options.ownGroupRoles) ? options.ownGroupRoles : [];
  26382. var missingParents = getMissingContext(virtualNode, ownGroupRoles);
  26383. if (!missingParents) {
  26384. return true;
  26385. }
  26386. var owners = getAriaOwners(node);
  26387. if (owners) {
  26388. for (var _i42 = 0, l = owners.length; _i42 < l; _i42++) {
  26389. missingParents = getMissingContext(get_node_from_tree_default(owners[_i42]), ownGroupRoles, missingParents, true);
  26390. if (!missingParents) {
  26391. return true;
  26392. }
  26393. }
  26394. }
  26395. this.data(missingParents);
  26396. return false;
  26397. }
  26398. var aria_required_parent_evaluate_default = ariaRequiredParentEvaluate;
  26399. function ariaRequiredChildrenEvaluate(node, options, virtualNode) {
  26400. var reviewEmpty = options && Array.isArray(options.reviewEmpty) ? options.reviewEmpty : [];
  26401. var explicitRole2 = get_explicit_role_default(virtualNode, {
  26402. dpub: true
  26403. });
  26404. var required = required_owned_default(explicitRole2);
  26405. if (required === null) {
  26406. return true;
  26407. }
  26408. var ownedRoles = getOwnedRoles(virtualNode, required);
  26409. var unallowed = ownedRoles.filter(function(_ref135) {
  26410. var role = _ref135.role, vNode = _ref135.vNode;
  26411. return vNode.props.nodeType === 1 && !required.includes(role);
  26412. });
  26413. if (unallowed.length) {
  26414. this.relatedNodes(unallowed.map(function(_ref136) {
  26415. var vNode = _ref136.vNode;
  26416. return vNode;
  26417. }));
  26418. this.data({
  26419. messageKey: 'unallowed',
  26420. values: unallowed.map(function(_ref137) {
  26421. var vNode = _ref137.vNode, attr = _ref137.attr;
  26422. return getUnallowedSelector(vNode, attr);
  26423. }).filter(function(selector, index, array) {
  26424. return array.indexOf(selector) === index;
  26425. }).join(', ')
  26426. });
  26427. return false;
  26428. }
  26429. if (hasRequiredChildren(required, ownedRoles)) {
  26430. return true;
  26431. }
  26432. if (virtualNode.attr('aria-busy') === 'true') {
  26433. this.data({
  26434. messageKey: 'aria-busy'
  26435. });
  26436. return true;
  26437. }
  26438. this.data(required);
  26439. if (reviewEmpty.includes(explicitRole2) && !ownedRoles.some(isContent)) {
  26440. return void 0;
  26441. }
  26442. return false;
  26443. }
  26444. function getOwnedRoles(virtualNode, required) {
  26445. var vNode;
  26446. var ownedRoles = [];
  26447. var ownedVirtual = get_owned_virtual_default(virtualNode);
  26448. var _loop10 = function _loop10() {
  26449. if (vNode.props.nodeType === 3) {
  26450. ownedRoles.push({
  26451. vNode: vNode,
  26452. role: null
  26453. });
  26454. }
  26455. if (vNode.props.nodeType !== 1 || !_isVisibleToScreenReaders(vNode)) {
  26456. return 1;
  26457. }
  26458. var role = get_role_default(vNode, {
  26459. noPresentational: true
  26460. });
  26461. var globalAriaAttr = getGlobalAriaAttr(vNode);
  26462. var hasGlobalAriaOrFocusable = !!globalAriaAttr || _isFocusable(vNode);
  26463. if (!role && !hasGlobalAriaOrFocusable || [ 'group', 'rowgroup' ].includes(role) && required.some(function(requiredRole) {
  26464. return requiredRole === role;
  26465. })) {
  26466. ownedVirtual.push.apply(ownedVirtual, _toConsumableArray(vNode.children));
  26467. } else if (role || hasGlobalAriaOrFocusable) {
  26468. var attr = globalAriaAttr || 'tabindex';
  26469. ownedRoles.push({
  26470. role: role,
  26471. attr: attr,
  26472. vNode: vNode
  26473. });
  26474. }
  26475. };
  26476. while (vNode = ownedVirtual.shift()) {
  26477. if (_loop10()) {
  26478. continue;
  26479. }
  26480. }
  26481. return ownedRoles;
  26482. }
  26483. function hasRequiredChildren(required, ownedRoles) {
  26484. return ownedRoles.some(function(_ref138) {
  26485. var role = _ref138.role;
  26486. return role && required.includes(role);
  26487. });
  26488. }
  26489. function getGlobalAriaAttr(vNode) {
  26490. return get_global_aria_attrs_default().find(function(attr) {
  26491. return vNode.hasAttr(attr);
  26492. });
  26493. }
  26494. function getUnallowedSelector(vNode, attr) {
  26495. var _vNode$props = vNode.props, nodeName2 = _vNode$props.nodeName, nodeType = _vNode$props.nodeType;
  26496. if (nodeType === 3) {
  26497. return '#text';
  26498. }
  26499. var role = get_explicit_role_default(vNode, {
  26500. dpub: true
  26501. });
  26502. if (role) {
  26503. return '[role='.concat(role, ']');
  26504. }
  26505. if (attr) {
  26506. return nodeName2 + '['.concat(attr, ']');
  26507. }
  26508. return nodeName2;
  26509. }
  26510. function isContent(_ref139) {
  26511. var vNode = _ref139.vNode;
  26512. if (vNode.props.nodeType === 3) {
  26513. return vNode.props.nodeValue.trim().length > 0;
  26514. }
  26515. return has_content_virtual_default(vNode, false, true);
  26516. }
  26517. function ariaRequiredAttrEvaluate(node) {
  26518. var _virtualNode$attr3;
  26519. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  26520. var virtualNode = arguments.length > 2 ? arguments[2] : undefined;
  26521. var role = get_explicit_role_default(virtualNode);
  26522. var attrs = virtualNode.attrNames;
  26523. var requiredAttrs = required_attr_default(role);
  26524. if (Array.isArray(options[role])) {
  26525. requiredAttrs = unique_array_default(options[role], requiredAttrs);
  26526. }
  26527. if (!role || !attrs.length || !requiredAttrs.length) {
  26528. return true;
  26529. }
  26530. if (isStaticSeparator(virtualNode, role) || isClosedCombobox(virtualNode, role)) {
  26531. return true;
  26532. }
  26533. if (role === 'slider' && (_virtualNode$attr3 = virtualNode.attr('aria-valuetext')) !== null && _virtualNode$attr3 !== void 0 && _virtualNode$attr3.trim()) {
  26534. return true;
  26535. }
  26536. var elmSpec = get_element_spec_default(virtualNode);
  26537. var missingAttrs = requiredAttrs.filter(function(requiredAttr2) {
  26538. return !virtualNode.attr(requiredAttr2) && !hasImplicitAttr(elmSpec, requiredAttr2);
  26539. });
  26540. if (missingAttrs.length) {
  26541. this.data(missingAttrs);
  26542. return false;
  26543. }
  26544. return true;
  26545. }
  26546. function isStaticSeparator(vNode, role) {
  26547. return role === 'separator' && !_isFocusable(vNode);
  26548. }
  26549. function hasImplicitAttr(elmSpec, attr) {
  26550. var _elmSpec$implicitAttr;
  26551. return ((_elmSpec$implicitAttr = elmSpec.implicitAttrs) === null || _elmSpec$implicitAttr === void 0 ? void 0 : _elmSpec$implicitAttr[attr]) !== void 0;
  26552. }
  26553. function isClosedCombobox(vNode, role) {
  26554. return role === 'combobox' && vNode.attr('aria-expanded') === 'false';
  26555. }
  26556. function ariaProhibitedAttrEvaluate(node) {
  26557. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  26558. var virtualNode = arguments.length > 2 ? arguments[2] : undefined;
  26559. var elementsAllowedAriaLabel = (options === null || options === void 0 ? void 0 : options.elementsAllowedAriaLabel) || [];
  26560. var nodeName2 = virtualNode.props.nodeName;
  26561. var role = get_role_default(virtualNode, {
  26562. chromium: true
  26563. });
  26564. var prohibitedList = listProhibitedAttrs(virtualNode, role, nodeName2, elementsAllowedAriaLabel);
  26565. var prohibited = prohibitedList.filter(function(attrName) {
  26566. if (!virtualNode.attrNames.includes(attrName)) {
  26567. return false;
  26568. }
  26569. return sanitize_default(virtualNode.attr(attrName)) !== '';
  26570. });
  26571. if (prohibited.length === 0) {
  26572. return false;
  26573. }
  26574. var messageKey = virtualNode.hasAttr('role') ? 'hasRole' : 'noRole';
  26575. messageKey += prohibited.length > 1 ? 'Plural' : 'Singular';
  26576. this.data({
  26577. role: role,
  26578. nodeName: nodeName2,
  26579. messageKey: messageKey,
  26580. prohibited: prohibited
  26581. });
  26582. var textContent = subtree_text_default(virtualNode, {
  26583. subtreeDescendant: true
  26584. });
  26585. if (sanitize_default(textContent) !== '') {
  26586. return void 0;
  26587. }
  26588. return true;
  26589. }
  26590. function listProhibitedAttrs(vNode, role, nodeName2, elementsAllowedAriaLabel) {
  26591. var roleSpec = standards_default.ariaRoles[role];
  26592. if (roleSpec) {
  26593. return roleSpec.prohibitedAttrs || [];
  26594. }
  26595. if (!!role || elementsAllowedAriaLabel.includes(nodeName2) || getClosestAncestorRoleType(vNode) === 'widget') {
  26596. return [];
  26597. }
  26598. return [ 'aria-label', 'aria-labelledby' ];
  26599. }
  26600. var getClosestAncestorRoleType = memoize_default(function getClosestAncestorRoleTypeMemoized(vNode) {
  26601. if (!vNode) {
  26602. return;
  26603. }
  26604. var role = get_role_default(vNode, {
  26605. noPresentational: true,
  26606. chromium: true
  26607. });
  26608. if (role) {
  26609. return get_role_type_default(role);
  26610. }
  26611. return getClosestAncestorRoleType(vNode.parent);
  26612. });
  26613. function ariaLevelEvaluate(node, options, virtualNode) {
  26614. var ariaHeadingLevel = virtualNode.attr('aria-level');
  26615. var ariaLevel = parseInt(ariaHeadingLevel, 10);
  26616. if (ariaLevel > 6) {
  26617. return void 0;
  26618. }
  26619. return true;
  26620. }
  26621. var aria_level_evaluate_default = ariaLevelEvaluate;
  26622. function ariaHiddenBodyEvaluate(node, options, virtualNode) {
  26623. return virtualNode.attr('aria-hidden') !== 'true';
  26624. }
  26625. var aria_hidden_body_evaluate_default = ariaHiddenBodyEvaluate;
  26626. function ariaErrormessageEvaluate(node, options, virtualNode) {
  26627. options = Array.isArray(options) ? options : [];
  26628. var errorMessageAttr = virtualNode.attr('aria-errormessage');
  26629. var hasAttr = virtualNode.hasAttr('aria-errormessage');
  26630. var invaid = virtualNode.attr('aria-invalid');
  26631. var hasInvallid = virtualNode.hasAttr('aria-invalid');
  26632. if (!hasInvallid || invaid === 'false') {
  26633. return true;
  26634. }
  26635. function validateAttrValue2(attr) {
  26636. if (attr.trim() === '') {
  26637. return standards_default.ariaAttrs['aria-errormessage'].allowEmpty;
  26638. }
  26639. var idref;
  26640. try {
  26641. idref = attr && idrefs_default(virtualNode, 'aria-errormessage')[0];
  26642. } catch (_unused20) {
  26643. this.data({
  26644. messageKey: 'idrefs',
  26645. values: token_list_default(attr)
  26646. });
  26647. return void 0;
  26648. }
  26649. if (idref) {
  26650. if (!_isVisibleToScreenReaders(idref)) {
  26651. this.data({
  26652. messageKey: 'hidden',
  26653. values: token_list_default(attr)
  26654. });
  26655. return false;
  26656. }
  26657. return idref.getAttribute('role') === 'alert' || idref.getAttribute('aria-live') === 'assertive' || idref.getAttribute('aria-live') === 'polite' || token_list_default(virtualNode.attr('aria-describedby')).indexOf(attr) > -1;
  26658. }
  26659. return;
  26660. }
  26661. if (options.indexOf(errorMessageAttr) === -1 && hasAttr) {
  26662. this.data(token_list_default(errorMessageAttr));
  26663. return validateAttrValue2.call(this, errorMessageAttr);
  26664. }
  26665. return true;
  26666. }
  26667. function ariaConditionalRowAttr(node) {
  26668. var _invalidTableRowAttrs, _invalidTableRowAttrs2;
  26669. var _ref140 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, invalidTableRowAttrs = _ref140.invalidTableRowAttrs;
  26670. var virtualNode = arguments.length > 2 ? arguments[2] : undefined;
  26671. var invalidAttrs = (_invalidTableRowAttrs = invalidTableRowAttrs === null || invalidTableRowAttrs === void 0 || (_invalidTableRowAttrs2 = invalidTableRowAttrs.filter) === null || _invalidTableRowAttrs2 === void 0 ? void 0 : _invalidTableRowAttrs2.call(invalidTableRowAttrs, function(invalidAttr) {
  26672. return virtualNode.hasAttr(invalidAttr);
  26673. })) !== null && _invalidTableRowAttrs !== void 0 ? _invalidTableRowAttrs : [];
  26674. if (invalidAttrs.length === 0) {
  26675. return true;
  26676. }
  26677. var owner = getRowOwner(virtualNode);
  26678. var ownerRole = owner && get_role_default(owner);
  26679. if (!ownerRole || ownerRole === 'treegrid') {
  26680. return true;
  26681. }
  26682. var messageKey = 'row'.concat(invalidAttrs.length > 1 ? 'Plural' : 'Singular');
  26683. this.data({
  26684. messageKey: messageKey,
  26685. invalidAttrs: invalidAttrs,
  26686. ownerRole: ownerRole
  26687. });
  26688. return false;
  26689. }
  26690. function getRowOwner(virtualNode) {
  26691. if (!virtualNode.parent) {
  26692. return;
  26693. }
  26694. var rowOwnerQuery = 'table:not([role]), [role~="treegrid"], [role~="table"], [role~="grid"]';
  26695. return closest_default(virtualNode, rowOwnerQuery);
  26696. }
  26697. function ariaConditionalCheckboxAttr(node, options, virtualNode) {
  26698. var _virtualNode$props = virtualNode.props, nodeName2 = _virtualNode$props.nodeName, type2 = _virtualNode$props.type;
  26699. var ariaChecked = normalizeAriaChecked(virtualNode.attr('aria-checked'));
  26700. if (nodeName2 !== 'input' || type2 !== 'checkbox' || !ariaChecked) {
  26701. return true;
  26702. }
  26703. var checkState = getCheckState(virtualNode);
  26704. if (ariaChecked === checkState) {
  26705. return true;
  26706. }
  26707. this.data({
  26708. messageKey: 'checkbox',
  26709. checkState: checkState
  26710. });
  26711. return false;
  26712. }
  26713. function getCheckState(vNode) {
  26714. if (vNode.props.indeterminate) {
  26715. return 'mixed';
  26716. }
  26717. return vNode.props.checked ? 'true' : 'false';
  26718. }
  26719. function normalizeAriaChecked(ariaCheckedVal) {
  26720. if (!ariaCheckedVal) {
  26721. return '';
  26722. }
  26723. ariaCheckedVal = ariaCheckedVal.toLowerCase();
  26724. if ([ 'mixed', 'true' ].includes(ariaCheckedVal)) {
  26725. return ariaCheckedVal;
  26726. }
  26727. return 'false';
  26728. }
  26729. var conditionalRoleMap = {
  26730. row: ariaConditionalRowAttr,
  26731. checkbox: ariaConditionalCheckboxAttr
  26732. };
  26733. function ariaConditionalAttrEvaluate(node, options, virtualNode) {
  26734. var role = get_role_default(virtualNode);
  26735. if (!conditionalRoleMap[role]) {
  26736. return true;
  26737. }
  26738. return conditionalRoleMap[role].call(this, node, options, virtualNode);
  26739. }
  26740. function ariaBusyEvaluate(node, options, virtualNode) {
  26741. return virtualNode.attr('aria-busy') === 'true';
  26742. }
  26743. function ariaAllowedRoleEvaluate(node) {
  26744. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  26745. var virtualNode = arguments.length > 2 ? arguments[2] : undefined;
  26746. var _options$allowImplici = options.allowImplicit, allowImplicit = _options$allowImplici === void 0 ? true : _options$allowImplici, _options$ignoredTags = options.ignoredTags, ignoredTags = _options$ignoredTags === void 0 ? [] : _options$ignoredTags;
  26747. var nodeName2 = virtualNode.props.nodeName;
  26748. if (ignoredTags.map(function(tag) {
  26749. return tag.toLowerCase();
  26750. }).includes(nodeName2)) {
  26751. return true;
  26752. }
  26753. var unallowedRoles = get_element_unallowed_roles_default(virtualNode, allowImplicit);
  26754. if (unallowedRoles.length) {
  26755. this.data(unallowedRoles);
  26756. if (!_isVisibleToScreenReaders(virtualNode)) {
  26757. return void 0;
  26758. }
  26759. return false;
  26760. }
  26761. return true;
  26762. }
  26763. var aria_allowed_role_evaluate_default = ariaAllowedRoleEvaluate;
  26764. function ariaAllowedAttrEvaluate(node, options, virtualNode) {
  26765. var invalid = [];
  26766. var role = get_role_default(virtualNode);
  26767. var allowed = allowed_attr_default(role);
  26768. if (Array.isArray(options[role])) {
  26769. allowed = unique_array_default(options[role].concat(allowed));
  26770. }
  26771. var _iterator21 = _createForOfIteratorHelper(virtualNode.attrNames), _step21;
  26772. try {
  26773. for (_iterator21.s(); !(_step21 = _iterator21.n()).done; ) {
  26774. var attrName = _step21.value;
  26775. if (validate_attr_default(attrName) && !allowed.includes(attrName) && !ignoredAttrs(attrName, virtualNode.attr(attrName), virtualNode)) {
  26776. invalid.push(attrName);
  26777. }
  26778. }
  26779. } catch (err) {
  26780. _iterator21.e(err);
  26781. } finally {
  26782. _iterator21.f();
  26783. }
  26784. if (!invalid.length) {
  26785. return true;
  26786. }
  26787. this.data(invalid.map(function(attrName) {
  26788. return attrName + '="' + virtualNode.attr(attrName) + '"';
  26789. }));
  26790. if (!role && !is_html_element_default(virtualNode) && !_isFocusable(virtualNode)) {
  26791. return void 0;
  26792. }
  26793. return false;
  26794. }
  26795. function ignoredAttrs(attrName, attrValue, vNode) {
  26796. if (attrName === 'aria-required' && attrValue === 'false') {
  26797. return true;
  26798. }
  26799. if (attrName === 'aria-multiline' && attrValue === 'false' && vNode.hasAttr('contenteditable')) {
  26800. return true;
  26801. }
  26802. return false;
  26803. }
  26804. function abstractroleEvaluate(node, options, virtualNode) {
  26805. var abstractRoles = token_list_default(virtualNode.attr('role')).filter(function(role) {
  26806. return get_role_type_default(role) === 'abstract';
  26807. });
  26808. if (abstractRoles.length > 0) {
  26809. this.data(abstractRoles);
  26810. return true;
  26811. }
  26812. return false;
  26813. }
  26814. var abstractrole_evaluate_default = abstractroleEvaluate;
  26815. function xmlLangMismatchMatches(node) {
  26816. var primaryLangValue = get_base_lang_default(node.getAttribute('lang'));
  26817. var primaryXmlLangValue = get_base_lang_default(node.getAttribute('xml:lang'));
  26818. return valid_langs_default(primaryLangValue) && valid_langs_default(primaryXmlLangValue);
  26819. }
  26820. var xml_lang_mismatch_matches_default = xmlLangMismatchMatches;
  26821. function windowIsTopMatches(node) {
  26822. return node.ownerDocument.defaultView.self === node.ownerDocument.defaultView.top;
  26823. }
  26824. var window_is_top_matches_default = windowIsTopMatches;
  26825. function svgNamespaceMatches(node, virtualNode) {
  26826. try {
  26827. var nodeName2 = virtualNode.props.nodeName;
  26828. if (nodeName2 === 'svg') {
  26829. return true;
  26830. }
  26831. return !!closest_default(virtualNode, 'svg');
  26832. } catch (_unused21) {
  26833. return false;
  26834. }
  26835. }
  26836. var svg_namespace_matches_default = svgNamespaceMatches;
  26837. function widgetNotInline(node, vNode) {
  26838. return matchesFns.every(function(fn) {
  26839. return fn(node, vNode);
  26840. });
  26841. }
  26842. var matchesFns = [ function(node, vNode) {
  26843. return isWidgetType(vNode);
  26844. }, function(node, vNode) {
  26845. return isNotAreaElement(vNode);
  26846. }, function(node, vNode) {
  26847. return !svg_namespace_matches_default(node, vNode);
  26848. }, function(node, vNode) {
  26849. return _isFocusable(vNode);
  26850. }, function(node, vNode) {
  26851. return _isInTabOrder(vNode) || !hasWidgetAncestorInTabOrder(vNode);
  26852. }, function(node) {
  26853. return !is_in_text_block_default(node, {
  26854. noLengthCompare: true
  26855. });
  26856. } ];
  26857. function isWidgetType(vNode) {
  26858. return get_role_type_default(vNode) === 'widget';
  26859. }
  26860. function isNotAreaElement(vNode) {
  26861. return vNode.props.nodeName !== 'area';
  26862. }
  26863. var hasWidgetAncestorInTabOrder = memoize_default(function hasWidgetAncestorInTabOrderMemoized(vNode) {
  26864. if (!(vNode !== null && vNode !== void 0 && vNode.parent)) {
  26865. return false;
  26866. }
  26867. if (isWidgetType(vNode.parent) && _isInTabOrder(vNode.parent)) {
  26868. return true;
  26869. }
  26870. return hasWidgetAncestorInTabOrderMemoized(vNode.parent);
  26871. });
  26872. function tableOrGridRoleMatches(_, vNode) {
  26873. var role = get_role_default(vNode);
  26874. return [ 'treegrid', 'grid', 'table' ].includes(role);
  26875. }
  26876. function summaryIsInteractiveMatches(_, virtualNode) {
  26877. var parent = virtualNode.parent;
  26878. if (parent.props.nodeName !== 'details' || isSlottedElm(virtualNode)) {
  26879. return false;
  26880. }
  26881. var firstSummary = parent.children.find(function(child) {
  26882. return child.props.nodeName === 'summary';
  26883. });
  26884. if (firstSummary !== virtualNode) {
  26885. return false;
  26886. }
  26887. return true;
  26888. }
  26889. function isSlottedElm(vNode) {
  26890. var _vNode$actualNode;
  26891. var domParent = (_vNode$actualNode = vNode.actualNode) === null || _vNode$actualNode === void 0 ? void 0 : _vNode$actualNode.parentElement;
  26892. return domParent && domParent !== vNode.parent.actualNode;
  26893. }
  26894. function skipLinkMatches(node) {
  26895. return _isSkipLink(node) && is_offscreen_default(node);
  26896. }
  26897. var skip_link_matches_default = skipLinkMatches;
  26898. function scrollableRegionFocusableMatches(node, virtualNode) {
  26899. return get_scroll_default(node, 13) !== void 0 && _isComboboxPopup(virtualNode) === false && isNoneEmptyElement(virtualNode);
  26900. }
  26901. function isNoneEmptyElement(vNode) {
  26902. return query_selector_all_default(vNode, '*').some(function(elm) {
  26903. return has_content_virtual_default(elm, true, true);
  26904. });
  26905. }
  26906. function presentationRoleConflictMatches(node, virtualNode) {
  26907. return implicit_role_default(virtualNode, {
  26908. chromiumRoles: true
  26909. }) !== null;
  26910. }
  26911. var presentation_role_conflict_matches_default = presentationRoleConflictMatches;
  26912. function pAsHeadingMatches(node) {
  26913. var children = Array.from(node.parentNode.childNodes);
  26914. var nodeText = node.textContent.trim();
  26915. var isSentence = /[.!?:;](?![.!?:;])/g;
  26916. if (nodeText.length === 0 || (nodeText.match(isSentence) || []).length >= 2) {
  26917. return false;
  26918. }
  26919. var siblingsAfter = children.slice(children.indexOf(node) + 1).filter(function(elm) {
  26920. return elm.nodeName.toUpperCase() === 'P' && elm.textContent.trim() !== '';
  26921. });
  26922. return siblingsAfter.length !== 0;
  26923. }
  26924. var p_as_heading_matches_default = pAsHeadingMatches;
  26925. function noExplicitNameRequired(node, virtualNode) {
  26926. var role = get_explicit_role_default(virtualNode);
  26927. if (!role || [ 'none', 'presentation' ].includes(role)) {
  26928. return true;
  26929. }
  26930. var _ref141 = aria_roles_default[role] || {}, accessibleNameRequired = _ref141.accessibleNameRequired;
  26931. if (accessibleNameRequired || _isFocusable(virtualNode)) {
  26932. return true;
  26933. }
  26934. return false;
  26935. }
  26936. var no_explicit_name_required_matches_default = noExplicitNameRequired;
  26937. var object_is_loaded_matches_default = function object_is_loaded_matches_default(node, vNode) {
  26938. return [ no_explicit_name_required_matches_default, objectHasLoaded ].every(function(fn) {
  26939. return fn(node, vNode);
  26940. });
  26941. };
  26942. function objectHasLoaded(node) {
  26943. var _node$ownerDocument;
  26944. if (!(node !== null && node !== void 0 && (_node$ownerDocument = node.ownerDocument) !== null && _node$ownerDocument !== void 0 && _node$ownerDocument.createRange)) {
  26945. return true;
  26946. }
  26947. var range2 = node.ownerDocument.createRange();
  26948. range2.setStart(node, 0);
  26949. range2.setEnd(node, node.childNodes.length);
  26950. return range2.getClientRects().length === 0;
  26951. }
  26952. function notHtmlMatches(node, virtualNode) {
  26953. return virtualNode.props.nodeName !== 'html';
  26954. }
  26955. var not_html_matches_default = notHtmlMatches;
  26956. function noRoleMatches(node, vNode) {
  26957. return !vNode.attr('role');
  26958. }
  26959. var no_role_matches_default = noRoleMatches;
  26960. function noNegativeTabindexMatches(node, virtualNode) {
  26961. var tabindex = parse_tabindex_default(virtualNode.attr('tabindex'));
  26962. return tabindex === null || tabindex >= 0;
  26963. }
  26964. var no_negative_tabindex_matches_default = noNegativeTabindexMatches;
  26965. function noNamingMethodMatches(node, virtualNode) {
  26966. var _get_element_spec_def3 = get_element_spec_default(virtualNode), namingMethods = _get_element_spec_def3.namingMethods;
  26967. if (namingMethods && namingMethods.length !== 0) {
  26968. return false;
  26969. }
  26970. if (get_explicit_role_default(virtualNode) === 'combobox' && query_selector_all_default(virtualNode, 'input:not([type="hidden"])').length) {
  26971. return false;
  26972. }
  26973. if (_isComboboxPopup(virtualNode, {
  26974. popupRoles: [ 'listbox' ]
  26975. })) {
  26976. return false;
  26977. }
  26978. return true;
  26979. }
  26980. var no_naming_method_matches_default = noNamingMethodMatches;
  26981. function noEmptyRoleMatches(node, virtualNode) {
  26982. if (!virtualNode.hasAttr('role')) {
  26983. return false;
  26984. }
  26985. if (!virtualNode.attr('role').trim()) {
  26986. return false;
  26987. }
  26988. return true;
  26989. }
  26990. var no_empty_role_matches_default = noEmptyRoleMatches;
  26991. function noAutoplayAudioMatches(node) {
  26992. if (!node.currentSrc) {
  26993. return false;
  26994. }
  26995. if (node.hasAttribute('paused') || node.hasAttribute('muted')) {
  26996. return false;
  26997. }
  26998. return true;
  26999. }
  27000. var no_autoplay_audio_matches_default = noAutoplayAudioMatches;
  27001. function nestedInteractiveMatches(node, virtualNode) {
  27002. var role = get_role_default(virtualNode);
  27003. if (!role) {
  27004. return false;
  27005. }
  27006. return !!standards_default.ariaRoles[role].childrenPresentational;
  27007. }
  27008. var nested_interactive_matches_default = nestedInteractiveMatches;
  27009. function linkInTextBlockMatches(node) {
  27010. var text = sanitize_default(node.innerText);
  27011. var role = node.getAttribute('role');
  27012. if (role && role !== 'link') {
  27013. return false;
  27014. }
  27015. if (!text) {
  27016. return false;
  27017. }
  27018. if (!_isVisibleOnScreen(node)) {
  27019. return false;
  27020. }
  27021. return is_in_text_block_default(node);
  27022. }
  27023. var link_in_text_block_matches_default = linkInTextBlockMatches;
  27024. function dataTableMatches(node) {
  27025. return !is_data_table_default(node) && !_isFocusable(node);
  27026. }
  27027. var layout_table_matches_default = dataTableMatches;
  27028. function landmarkUniqueMatches(node, virtualNode) {
  27029. return isLandmarkVirtual(virtualNode) && _isVisibleToScreenReaders(virtualNode);
  27030. }
  27031. function isLandmarkVirtual(vNode) {
  27032. var landmarkRoles2 = get_aria_roles_by_type_default('landmark');
  27033. var role = get_role_default(vNode);
  27034. if (!role) {
  27035. return false;
  27036. }
  27037. var nodeName2 = vNode.props.nodeName;
  27038. if (nodeName2 === 'section' || nodeName2 === 'form') {
  27039. var accessibleText2 = _accessibleTextVirtual(vNode);
  27040. return !!accessibleText2;
  27041. }
  27042. return landmarkRoles2.indexOf(role) >= 0 || role === 'region';
  27043. }
  27044. function landmarkHasBodyContextMatches(node, virtualNode) {
  27045. var nativeScopeFilter = 'article, aside, main, nav, section';
  27046. return node.hasAttribute('role') || !find_up_virtual_default(virtualNode, nativeScopeFilter);
  27047. }
  27048. var landmark_has_body_context_matches_default = landmarkHasBodyContextMatches;
  27049. function labelMatches(node, virtualNode) {
  27050. if (virtualNode.props.nodeName !== 'input' || virtualNode.hasAttr('type') === false) {
  27051. return true;
  27052. }
  27053. var type2 = virtualNode.attr('type').toLowerCase();
  27054. return [ 'hidden', 'image', 'button', 'submit', 'reset' ].includes(type2) === false;
  27055. }
  27056. var label_matches_default = labelMatches;
  27057. function labelContentNameMismatchMatches(node, virtualNode) {
  27058. var role = get_role_default(node);
  27059. if (!role) {
  27060. return false;
  27061. }
  27062. var widgetRoles = get_aria_roles_by_type_default('widget');
  27063. var isWidgetType2 = widgetRoles.includes(role);
  27064. if (!isWidgetType2) {
  27065. return false;
  27066. }
  27067. var rolesWithNameFromContents = get_aria_roles_supporting_name_from_content_default();
  27068. if (!rolesWithNameFromContents.includes(role)) {
  27069. return false;
  27070. }
  27071. if (!sanitize_default(_arialabelText(virtualNode)) && !sanitize_default(arialabelledby_text_default(node))) {
  27072. return false;
  27073. }
  27074. if (!sanitize_default(visible_virtual_default(virtualNode))) {
  27075. return false;
  27076. }
  27077. return true;
  27078. }
  27079. var label_content_name_mismatch_matches_default = labelContentNameMismatchMatches;
  27080. function isVisibleOnScreenMatches(node, virtualNode) {
  27081. return _isVisibleOnScreen(virtualNode);
  27082. }
  27083. function hasVisibleTextMatches(node) {
  27084. return _isVisibleOnScreen(node);
  27085. }
  27086. function isInitiatorMatches(node, virtualNode, context) {
  27087. return context.initiator;
  27088. }
  27089. var is_initiator_matches_default = isInitiatorMatches;
  27090. function insertedIntoFocusOrderMatches(node) {
  27091. return inserted_into_focus_order_default(node);
  27092. }
  27093. var inserted_into_focus_order_matches_default = insertedIntoFocusOrderMatches;
  27094. function identicalLinksSamePurposeMatches(node, virtualNode) {
  27095. var hasAccName = !!_accessibleTextVirtual(virtualNode);
  27096. if (!hasAccName) {
  27097. return false;
  27098. }
  27099. var role = get_role_default(node);
  27100. if (role && role !== 'link') {
  27101. return false;
  27102. }
  27103. return true;
  27104. }
  27105. var identical_links_same_purpose_matches_default = identicalLinksSamePurposeMatches;
  27106. function htmlNamespaceMatches(node, virtualNode) {
  27107. return !svg_namespace_matches_default(node, virtualNode);
  27108. }
  27109. var html_namespace_matches_default = htmlNamespaceMatches;
  27110. function headingMatches(node, virtualNode) {
  27111. return get_role_default(virtualNode) === 'heading';
  27112. }
  27113. function hasImplicitChromiumRoleMatches(node, virtualNode) {
  27114. return implicit_role_default(virtualNode, {
  27115. chromium: true
  27116. }) !== null;
  27117. }
  27118. var has_implicit_chromium_role_matches_default = hasImplicitChromiumRoleMatches;
  27119. function frameTitleHasTextMatches(node) {
  27120. var title = node.getAttribute('title');
  27121. return !!sanitize_default(title);
  27122. }
  27123. var frame_title_has_text_matches_default = frameTitleHasTextMatches;
  27124. function frameFocusableContentMatches(node, virtualNode, context) {
  27125. var _context$size, _context$size2;
  27126. return !context.initiator && !context.focusable && ((_context$size = context.size) === null || _context$size === void 0 ? void 0 : _context$size.width) * ((_context$size2 = context.size) === null || _context$size2 === void 0 ? void 0 : _context$size2.height) > 1;
  27127. }
  27128. var frame_focusable_content_matches_default = frameFocusableContentMatches;
  27129. function duplicateIdMiscMatches(node) {
  27130. var id = node.getAttribute('id').trim();
  27131. var idSelector = '*[id="'.concat(escape_selector_default(id), '"]');
  27132. var idMatchingElms = Array.from(get_root_node_default2(node).querySelectorAll(idSelector));
  27133. return !is_accessible_ref_default(node) && idMatchingElms.every(function(elm) {
  27134. return !_isFocusable(elm);
  27135. });
  27136. }
  27137. var duplicate_id_misc_matches_default = duplicateIdMiscMatches;
  27138. function duplicateIdAriaMatches(node) {
  27139. return is_accessible_ref_default(node);
  27140. }
  27141. var duplicate_id_aria_matches_default = duplicateIdAriaMatches;
  27142. function duplicateIdActiveMatches(node) {
  27143. var id = node.getAttribute('id').trim();
  27144. var idSelector = '*[id="'.concat(escape_selector_default(id), '"]');
  27145. var idMatchingElms = Array.from(get_root_node_default2(node).querySelectorAll(idSelector));
  27146. return !is_accessible_ref_default(node) && idMatchingElms.some(_isFocusable);
  27147. }
  27148. var duplicate_id_active_matches_default = duplicateIdActiveMatches;
  27149. function dataTableMatches2(node) {
  27150. return is_data_table_default(node);
  27151. }
  27152. var data_table_matches_default = dataTableMatches2;
  27153. function dataTableLargeMatches(node) {
  27154. if (is_data_table_default(node)) {
  27155. var tableArray = to_grid_default(node);
  27156. return tableArray.length >= 3 && tableArray[0].length >= 3 && tableArray[1].length >= 3 && tableArray[2].length >= 3;
  27157. }
  27158. return false;
  27159. }
  27160. var data_table_large_matches_default = dataTableLargeMatches;
  27161. function colorContrastMatches(node, virtualNode) {
  27162. var _virtualNode$props2 = virtualNode.props, nodeName2 = _virtualNode$props2.nodeName, inputType = _virtualNode$props2.type;
  27163. if (nodeName2 === 'option') {
  27164. return false;
  27165. }
  27166. if (nodeName2 === 'select' && !node.options.length) {
  27167. return false;
  27168. }
  27169. var nonTextInput = [ 'hidden', 'range', 'color', 'checkbox', 'radio', 'image' ];
  27170. if (nodeName2 === 'input' && nonTextInput.includes(inputType)) {
  27171. return false;
  27172. }
  27173. if (is_disabled_default(virtualNode) || _isInert(virtualNode)) {
  27174. return false;
  27175. }
  27176. var formElements = [ 'input', 'select', 'textarea' ];
  27177. if (formElements.includes(nodeName2)) {
  27178. var style = window.getComputedStyle(node);
  27179. var textIndent = parseInt(style.getPropertyValue('text-indent'), 10);
  27180. if (textIndent) {
  27181. var rect = node.getBoundingClientRect();
  27182. rect = {
  27183. top: rect.top,
  27184. bottom: rect.bottom,
  27185. left: rect.left + textIndent,
  27186. right: rect.right + textIndent
  27187. };
  27188. if (!visually_overlaps_default(rect, node)) {
  27189. return false;
  27190. }
  27191. }
  27192. return true;
  27193. }
  27194. var nodeParentLabel = find_up_virtual_default(virtualNode, 'label');
  27195. if (nodeName2 === 'label' || nodeParentLabel) {
  27196. var labelNode = nodeParentLabel || node;
  27197. var labelVirtual3 = nodeParentLabel ? get_node_from_tree_default(nodeParentLabel) : virtualNode;
  27198. if (labelNode.htmlFor) {
  27199. var doc = get_root_node_default2(labelNode);
  27200. var explicitControl = doc.getElementById(labelNode.htmlFor);
  27201. var explicitControlVirtual = explicitControl && get_node_from_tree_default(explicitControl);
  27202. if (explicitControlVirtual && is_disabled_default(explicitControlVirtual)) {
  27203. return false;
  27204. }
  27205. }
  27206. var query = 'input:not([type="hidden"],[type="image"],[type="button"],[type="submit"],[type="reset"]), select, textarea';
  27207. var implicitControl = query_selector_all_default(labelVirtual3, query)[0];
  27208. if (implicitControl && is_disabled_default(implicitControl)) {
  27209. return false;
  27210. }
  27211. }
  27212. var ariaLabelledbyControls = [];
  27213. var ancestorNode = virtualNode;
  27214. while (ancestorNode) {
  27215. if (ancestorNode.props.id) {
  27216. var virtualControls = get_accessible_refs_default(ancestorNode).filter(function(control) {
  27217. return token_list_default(control.getAttribute('aria-labelledby') || '').includes(ancestorNode.props.id);
  27218. }).map(function(control) {
  27219. return get_node_from_tree_default(control);
  27220. });
  27221. ariaLabelledbyControls.push.apply(ariaLabelledbyControls, _toConsumableArray(virtualControls));
  27222. }
  27223. ancestorNode = ancestorNode.parent;
  27224. }
  27225. if (ariaLabelledbyControls.length > 0 && ariaLabelledbyControls.every(is_disabled_default)) {
  27226. return false;
  27227. }
  27228. if (!hasRealTextChildren(virtualNode)) {
  27229. return false;
  27230. }
  27231. var range2 = document.createRange();
  27232. var childNodes = virtualNode.children;
  27233. for (var index = 0; index < childNodes.length; index++) {
  27234. var child = childNodes[index];
  27235. if (child.actualNode.nodeType === 3 && sanitize_default(child.actualNode.nodeValue) !== '') {
  27236. range2.selectNodeContents(child.actualNode);
  27237. }
  27238. }
  27239. var rects = Array.from(range2.getClientRects());
  27240. var clippingAncestors = get_overflow_hidden_ancestors_default(virtualNode);
  27241. return rects.some(function(rect) {
  27242. var overlaps = visually_overlaps_default(rect, node);
  27243. if (!clippingAncestors.length) {
  27244. return overlaps;
  27245. }
  27246. var withinOverflow = clippingAncestors.some(function(overflowNode) {
  27247. return _rectsOverlap(rect, overflowNode.boundingClientRect);
  27248. });
  27249. return overlaps && withinOverflow;
  27250. });
  27251. }
  27252. var color_contrast_matches_default = colorContrastMatches;
  27253. var removeUnicodeOptions = {
  27254. emoji: true,
  27255. nonBmp: false,
  27256. punctuations: true
  27257. };
  27258. function hasRealTextChildren(virtualNode) {
  27259. var visibleText = visible_virtual_default(virtualNode, false, true);
  27260. if (visibleText === '' || remove_unicode_default(visibleText, removeUnicodeOptions) === '') {
  27261. return false;
  27262. }
  27263. return virtualNode.children.some(function(vChild) {
  27264. return vChild.props.nodeName === '#text' && !_isIconLigature(vChild);
  27265. });
  27266. }
  27267. function bypassMatches(node, virtualNode, context) {
  27268. if (is_initiator_matches_default(node, virtualNode, context)) {
  27269. return !!node.querySelector('a[href]');
  27270. }
  27271. return true;
  27272. }
  27273. var bypass_matches_default = bypassMatches;
  27274. function autocompleteMatches(node, virtualNode) {
  27275. var autocomplete2 = virtualNode.attr('autocomplete');
  27276. if (!autocomplete2 || sanitize_default(autocomplete2) === '') {
  27277. return false;
  27278. }
  27279. var nodeName2 = virtualNode.props.nodeName;
  27280. if ([ 'textarea', 'input', 'select' ].includes(nodeName2) === false) {
  27281. return false;
  27282. }
  27283. var excludedInputTypes = [ 'submit', 'reset', 'button', 'hidden' ];
  27284. if (nodeName2 === 'input' && excludedInputTypes.includes(virtualNode.props.type)) {
  27285. return false;
  27286. }
  27287. var ariaDisabled = virtualNode.attr('aria-disabled') || 'false';
  27288. if (virtualNode.hasAttr('disabled') || ariaDisabled.toLowerCase() === 'true') {
  27289. return false;
  27290. }
  27291. var role = virtualNode.attr('role');
  27292. var tabIndex = parse_tabindex_default(virtualNode.attr('tabindex'));
  27293. if (tabIndex < 0 && role) {
  27294. var roleDef = standards_default.ariaRoles[role];
  27295. if (roleDef === void 0 || roleDef.type !== 'widget') {
  27296. return false;
  27297. }
  27298. }
  27299. if (tabIndex < 0 && virtualNode.actualNode && !_isVisibleOnScreen(virtualNode) && !_isVisibleToScreenReaders(virtualNode)) {
  27300. return false;
  27301. }
  27302. return true;
  27303. }
  27304. var autocomplete_matches_default = autocompleteMatches;
  27305. function ariaRequiredParentMatches(node, virtualNode) {
  27306. var role = get_explicit_role_default(virtualNode);
  27307. return !!required_context_default(role);
  27308. }
  27309. var aria_required_parent_matches_default = ariaRequiredParentMatches;
  27310. function ariaRequiredChildrenMatches(node, virtualNode) {
  27311. var role = get_explicit_role_default(virtualNode, {
  27312. dpub: true
  27313. });
  27314. return !!required_owned_default(role);
  27315. }
  27316. var aria_required_children_matches_default = ariaRequiredChildrenMatches;
  27317. function shouldMatchElement(el) {
  27318. if (!el) {
  27319. return true;
  27320. }
  27321. if (el.getAttribute('aria-hidden') === 'true') {
  27322. return false;
  27323. }
  27324. return shouldMatchElement(get_composed_parent_default(el));
  27325. }
  27326. function ariaHiddenFocusMatches(node) {
  27327. return shouldMatchElement(get_composed_parent_default(node));
  27328. }
  27329. var aria_hidden_focus_matches_default = ariaHiddenFocusMatches;
  27330. function ariaHasAttrMatches(node, virtualNode) {
  27331. var aria = /^aria-/;
  27332. return virtualNode.attrNames.some(function(attr) {
  27333. return aria.test(attr);
  27334. });
  27335. }
  27336. var aria_has_attr_matches_default = ariaHasAttrMatches;
  27337. function ariaAllowedRoleMatches(node, virtualNode) {
  27338. return get_explicit_role_default(virtualNode, {
  27339. dpub: true,
  27340. fallback: true
  27341. }) !== null;
  27342. }
  27343. var aria_allowed_role_matches_default = ariaAllowedRoleMatches;
  27344. function ariaAllowedAttrMatches(node, virtualNode) {
  27345. var aria = /^aria-/;
  27346. var attrs = virtualNode.attrNames;
  27347. if (attrs.length) {
  27348. for (var _i43 = 0, l = attrs.length; _i43 < l; _i43++) {
  27349. if (aria.test(attrs[_i43])) {
  27350. return true;
  27351. }
  27352. }
  27353. }
  27354. return false;
  27355. }
  27356. var aria_allowed_attr_matches_default = ariaAllowedAttrMatches;
  27357. var metadataFunctionMap = {
  27358. 'abstractrole-evaluate': abstractrole_evaluate_default,
  27359. 'accesskeys-after': accesskeys_after_default,
  27360. 'accesskeys-evaluate': accesskeys_evaluate_default,
  27361. 'alt-space-value-evaluate': alt_space_value_evaluate_default,
  27362. 'aria-allowed-attr-evaluate': ariaAllowedAttrEvaluate,
  27363. 'aria-allowed-attr-matches': aria_allowed_attr_matches_default,
  27364. 'aria-allowed-role-evaluate': aria_allowed_role_evaluate_default,
  27365. 'aria-allowed-role-matches': aria_allowed_role_matches_default,
  27366. 'aria-busy-evaluate': ariaBusyEvaluate,
  27367. 'aria-conditional-attr-evaluate': ariaConditionalAttrEvaluate,
  27368. 'aria-conditional-checkbox-attr-evaluate': ariaConditionalCheckboxAttr,
  27369. 'aria-conditional-row-attr-evaluate': ariaConditionalRowAttr,
  27370. 'aria-errormessage-evaluate': ariaErrormessageEvaluate,
  27371. 'aria-has-attr-matches': aria_has_attr_matches_default,
  27372. 'aria-hidden-body-evaluate': aria_hidden_body_evaluate_default,
  27373. 'aria-hidden-focus-matches': aria_hidden_focus_matches_default,
  27374. 'aria-label-evaluate': aria_label_evaluate_default,
  27375. 'aria-labelledby-evaluate': aria_labelledby_evaluate_default,
  27376. 'aria-level-evaluate': aria_level_evaluate_default,
  27377. 'aria-prohibited-attr-evaluate': ariaProhibitedAttrEvaluate,
  27378. 'aria-required-attr-evaluate': ariaRequiredAttrEvaluate,
  27379. 'aria-required-children-evaluate': ariaRequiredChildrenEvaluate,
  27380. 'aria-required-children-matches': aria_required_children_matches_default,
  27381. 'aria-required-parent-evaluate': aria_required_parent_evaluate_default,
  27382. 'aria-required-parent-matches': aria_required_parent_matches_default,
  27383. 'aria-roledescription-evaluate': aria_roledescription_evaluate_default,
  27384. 'aria-unsupported-attr-evaluate': aria_unsupported_attr_evaluate_default,
  27385. 'aria-valid-attr-evaluate': aria_valid_attr_evaluate_default,
  27386. 'aria-valid-attr-value-evaluate': ariaValidAttrValueEvaluate,
  27387. 'attr-non-space-content-evaluate': attr_non_space_content_evaluate_default,
  27388. 'autocomplete-appropriate-evaluate': autocomplete_appropriate_evaluate_default,
  27389. 'autocomplete-matches': autocomplete_matches_default,
  27390. 'autocomplete-valid-evaluate': autocomplete_valid_evaluate_default,
  27391. 'avoid-inline-spacing-evaluate': avoid_inline_spacing_evaluate_default,
  27392. 'braille-label-equivalent-evaluate': brailleLabelEquivalentEvaluate,
  27393. 'braille-roledescription-equivalent-evaluate': brailleRoleDescriptionEquivalentEvaluate,
  27394. 'bypass-matches': bypass_matches_default,
  27395. 'caption-evaluate': caption_evaluate_default,
  27396. 'caption-faked-evaluate': caption_faked_evaluate_default,
  27397. 'color-contrast-evaluate': colorContrastEvaluate,
  27398. 'color-contrast-matches': color_contrast_matches_default,
  27399. 'css-orientation-lock-evaluate': css_orientation_lock_evaluate_default,
  27400. 'data-table-large-matches': data_table_large_matches_default,
  27401. 'data-table-matches': data_table_matches_default,
  27402. 'deprecatedrole-evaluate': deprecatedroleEvaluate,
  27403. 'dlitem-evaluate': dlitem_evaluate_default,
  27404. 'doc-has-title-evaluate': doc_has_title_evaluate_default,
  27405. 'duplicate-id-active-matches': duplicate_id_active_matches_default,
  27406. 'duplicate-id-after': duplicate_id_after_default,
  27407. 'duplicate-id-aria-matches': duplicate_id_aria_matches_default,
  27408. 'duplicate-id-evaluate': duplicate_id_evaluate_default,
  27409. 'duplicate-id-misc-matches': duplicate_id_misc_matches_default,
  27410. 'duplicate-img-label-evaluate': duplicate_img_label_evaluate_default,
  27411. 'exists-evaluate': exists_evaluate_default,
  27412. 'explicit-evaluate': explicit_evaluate_default,
  27413. 'fallbackrole-evaluate': fallbackrole_evaluate_default,
  27414. 'focusable-content-evaluate': focusable_content_evaluate_default,
  27415. 'focusable-disabled-evaluate': focusable_disabled_evaluate_default,
  27416. 'focusable-element-evaluate': focusable_element_evaluate_default,
  27417. 'focusable-modal-open-evaluate': focusable_modal_open_evaluate_default,
  27418. 'focusable-no-name-evaluate': focusable_no_name_evaluate_default,
  27419. 'focusable-not-tabbable-evaluate': focusable_not_tabbable_evaluate_default,
  27420. 'frame-focusable-content-evaluate': frameFocusableContentEvaluate,
  27421. 'frame-focusable-content-matches': frame_focusable_content_matches_default,
  27422. 'frame-tested-after': frame_tested_after_default,
  27423. 'frame-tested-evaluate': frame_tested_evaluate_default,
  27424. 'frame-title-has-text-matches': frame_title_has_text_matches_default,
  27425. 'has-alt-evaluate': has_alt_evaluate_default,
  27426. 'has-descendant-after': has_descendant_after_default,
  27427. 'has-descendant-evaluate': has_descendant_evaluate_default,
  27428. 'has-global-aria-attribute-evaluate': has_global_aria_attribute_evaluate_default,
  27429. 'has-implicit-chromium-role-matches': has_implicit_chromium_role_matches_default,
  27430. 'has-lang-evaluate': has_lang_evaluate_default,
  27431. 'has-text-content-evaluate': hasTextContentEvaluate,
  27432. 'has-widget-role-evaluate': has_widget_role_evaluate_default,
  27433. 'heading-matches': headingMatches,
  27434. 'heading-order-after': headingOrderAfter,
  27435. 'heading-order-evaluate': heading_order_evaluate_default,
  27436. 'help-same-as-label-evaluate': help_same_as_label_evaluate_default,
  27437. 'hidden-content-evaluate': hidden_content_evaluate_default,
  27438. 'hidden-explicit-label-evaluate': hidden_explicit_label_evaluate_default,
  27439. 'html-namespace-matches': html_namespace_matches_default,
  27440. 'html5-scope-evaluate': html5_scope_evaluate_default,
  27441. 'identical-links-same-purpose-after': identical_links_same_purpose_after_default,
  27442. 'identical-links-same-purpose-evaluate': identical_links_same_purpose_evaluate_default,
  27443. 'identical-links-same-purpose-matches': identical_links_same_purpose_matches_default,
  27444. 'implicit-evaluate': implicit_evaluate_default,
  27445. 'inline-style-property-evaluate': inlineStyleProperty,
  27446. 'inserted-into-focus-order-matches': inserted_into_focus_order_matches_default,
  27447. 'internal-link-present-evaluate': internal_link_present_evaluate_default,
  27448. 'invalid-children-evaluate': invalidChildrenEvaluate,
  27449. 'invalidrole-evaluate': invalidrole_evaluate_default,
  27450. 'is-element-focusable-evaluate': is_element_focusable_evaluate_default,
  27451. 'is-initiator-matches': is_initiator_matches_default,
  27452. 'is-on-screen-evaluate': is_on_screen_evaluate_default,
  27453. 'is-visible-matches': hasVisibleTextMatches,
  27454. 'is-visible-on-screen-matches': isVisibleOnScreenMatches,
  27455. 'label-content-name-mismatch-evaluate': label_content_name_mismatch_evaluate_default,
  27456. 'label-content-name-mismatch-matches': label_content_name_mismatch_matches_default,
  27457. 'label-matches': label_matches_default,
  27458. 'landmark-has-body-context-matches': landmark_has_body_context_matches_default,
  27459. 'landmark-is-top-level-evaluate': landmark_is_top_level_evaluate_default,
  27460. 'landmark-is-unique-after': landmark_is_unique_after_default,
  27461. 'landmark-is-unique-evaluate': landmark_is_unique_evaluate_default,
  27462. 'landmark-unique-matches': landmarkUniqueMatches,
  27463. 'layout-table-matches': layout_table_matches_default,
  27464. 'link-in-text-block-evaluate': link_in_text_block_evaluate_default,
  27465. 'link-in-text-block-matches': link_in_text_block_matches_default,
  27466. 'link-in-text-block-style-evaluate': linkInTextBlockStyleEvaluate,
  27467. 'listitem-evaluate': listitemEvaluate,
  27468. 'matches-definition-evaluate': matches_definition_evaluate_default,
  27469. 'meta-refresh-evaluate': metaRefreshEvaluate,
  27470. 'meta-viewport-scale-evaluate': meta_viewport_scale_evaluate_default,
  27471. 'multiple-label-evaluate': multiple_label_evaluate_default,
  27472. 'nested-interactive-matches': nested_interactive_matches_default,
  27473. 'no-autoplay-audio-evaluate': no_autoplay_audio_evaluate_default,
  27474. 'no-autoplay-audio-matches': no_autoplay_audio_matches_default,
  27475. 'no-empty-role-matches': no_empty_role_matches_default,
  27476. 'no-explicit-name-required-matches': no_explicit_name_required_matches_default,
  27477. 'no-focusable-content-evaluate': noFocusableContentEvaluate,
  27478. 'no-implicit-explicit-label-evaluate': no_implicit_explicit_label_evaluate_default,
  27479. 'no-naming-method-matches': no_naming_method_matches_default,
  27480. 'no-negative-tabindex-matches': no_negative_tabindex_matches_default,
  27481. 'no-role-matches': no_role_matches_default,
  27482. 'non-empty-if-present-evaluate': non_empty_if_present_evaluate_default,
  27483. 'not-html-matches': not_html_matches_default,
  27484. 'object-is-loaded-matches': object_is_loaded_matches_default,
  27485. 'only-dlitems-evaluate': onlyDlitemsEvaluate,
  27486. 'only-listitems-evaluate': only_listitems_evaluate_default,
  27487. 'p-as-heading-evaluate': p_as_heading_evaluate_default,
  27488. 'p-as-heading-matches': p_as_heading_matches_default,
  27489. 'page-no-duplicate-after': page_no_duplicate_after_default,
  27490. 'page-no-duplicate-evaluate': page_no_duplicate_evaluate_default,
  27491. 'presentation-role-conflict-matches': presentation_role_conflict_matches_default,
  27492. 'presentational-role-evaluate': presentationalRoleEvaluate,
  27493. 'region-after': region_after_default,
  27494. 'region-evaluate': regionEvaluate,
  27495. 'same-caption-summary-evaluate': same_caption_summary_evaluate_default,
  27496. 'scope-value-evaluate': scope_value_evaluate_default,
  27497. 'scrollable-region-focusable-matches': scrollableRegionFocusableMatches,
  27498. 'skip-link-evaluate': skip_link_evaluate_default,
  27499. 'skip-link-matches': skip_link_matches_default,
  27500. 'structured-dlitems-evaluate': structured_dlitems_evaluate_default,
  27501. 'summary-interactive-matches': summaryIsInteractiveMatches,
  27502. 'svg-namespace-matches': svg_namespace_matches_default,
  27503. 'svg-non-empty-title-evaluate': svg_non_empty_title_evaluate_default,
  27504. 'tabindex-evaluate': tabindex_evaluate_default,
  27505. 'table-or-grid-role-matches': tableOrGridRoleMatches,
  27506. 'target-offset-evaluate': targetOffsetEvaluate,
  27507. 'target-size-evaluate': targetSizeEvaluate,
  27508. 'td-has-header-evaluate': td_has_header_evaluate_default,
  27509. 'td-headers-attr-evaluate': tdHeadersAttrEvaluate,
  27510. 'th-has-data-cells-evaluate': th_has_data_cells_evaluate_default,
  27511. 'title-only-evaluate': title_only_evaluate_default,
  27512. 'unique-frame-title-after': unique_frame_title_after_default,
  27513. 'unique-frame-title-evaluate': unique_frame_title_evaluate_default,
  27514. 'unsupportedrole-evaluate': unsupportedrole_evaluate_default,
  27515. 'valid-lang-evaluate': valid_lang_evaluate_default,
  27516. 'valid-scrollable-semantics-evaluate': valid_scrollable_semantics_evaluate_default,
  27517. 'widget-not-inline-matches': widgetNotInline,
  27518. 'window-is-top-matches': window_is_top_matches_default,
  27519. 'xml-lang-mismatch-evaluate': xml_lang_mismatch_evaluate_default,
  27520. 'xml-lang-mismatch-matches': xml_lang_mismatch_matches_default
  27521. };
  27522. var metadata_function_map_default = metadataFunctionMap;
  27523. function CheckResult(check) {
  27524. this.id = check.id;
  27525. this.data = null;
  27526. this.relatedNodes = [];
  27527. this.result = null;
  27528. }
  27529. var check_result_default = CheckResult;
  27530. function createExecutionContext(spec) {
  27531. if (typeof spec === 'string') {
  27532. if (metadata_function_map_default[spec]) {
  27533. return metadata_function_map_default[spec];
  27534. }
  27535. if (/^\s*function[\s\w]*\(/.test(spec)) {
  27536. return new Function('return ' + spec + ';')();
  27537. }
  27538. throw new ReferenceError('Function ID does not exist in the metadata-function-map: '.concat(spec));
  27539. }
  27540. return spec;
  27541. }
  27542. function normalizeOptions() {
  27543. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  27544. if (Array.isArray(options) || _typeof(options) !== 'object') {
  27545. options = {
  27546. value: options
  27547. };
  27548. }
  27549. return options;
  27550. }
  27551. function Check(spec) {
  27552. if (spec) {
  27553. this.id = spec.id;
  27554. this.configure(spec);
  27555. }
  27556. }
  27557. Check.prototype.enabled = true;
  27558. Check.prototype.run = function run(node, options, context, resolve, reject) {
  27559. options = options || {};
  27560. var enabled = options.hasOwnProperty('enabled') ? options.enabled : this.enabled;
  27561. var checkOptions = this.getOptions(options.options);
  27562. if (enabled) {
  27563. var checkResult = new check_result_default(this);
  27564. var helper = check_helper_default(checkResult, options, resolve, reject);
  27565. var result;
  27566. try {
  27567. result = this.evaluate.call(helper, node.actualNode, checkOptions, node, context);
  27568. } catch (e) {
  27569. if (node && node.actualNode) {
  27570. e.errorNode = node_serializer_default.toSpec(node);
  27571. }
  27572. reject(e);
  27573. return;
  27574. }
  27575. if (!helper.isAsync) {
  27576. checkResult.result = result;
  27577. resolve(checkResult);
  27578. }
  27579. } else {
  27580. resolve(null);
  27581. }
  27582. };
  27583. Check.prototype.runSync = function runSync(node, options, context) {
  27584. options = options || {};
  27585. var _options3 = options, _options3$enabled = _options3.enabled, enabled = _options3$enabled === void 0 ? this.enabled : _options3$enabled;
  27586. if (!enabled) {
  27587. return null;
  27588. }
  27589. var checkOptions = this.getOptions(options.options);
  27590. var checkResult = new check_result_default(this);
  27591. var helper = check_helper_default(checkResult, options);
  27592. helper.async = function async() {
  27593. throw new Error('Cannot run async check while in a synchronous run');
  27594. };
  27595. var result;
  27596. try {
  27597. result = this.evaluate.call(helper, node.actualNode, checkOptions, node, context);
  27598. } catch (e) {
  27599. if (node && node.actualNode) {
  27600. e.errorNode = node_serializer_default.toSpec(node);
  27601. }
  27602. throw e;
  27603. }
  27604. checkResult.result = result;
  27605. return checkResult;
  27606. };
  27607. Check.prototype.configure = function configure2(spec) {
  27608. var _this8 = this;
  27609. if (!spec.evaluate || metadata_function_map_default[spec.evaluate]) {
  27610. this._internalCheck = true;
  27611. }
  27612. if (spec.hasOwnProperty('enabled')) {
  27613. this.enabled = spec.enabled;
  27614. }
  27615. if (spec.hasOwnProperty('options')) {
  27616. if (this._internalCheck) {
  27617. this.options = normalizeOptions(spec.options);
  27618. } else {
  27619. this.options = spec.options;
  27620. }
  27621. }
  27622. [ 'evaluate', 'after' ].filter(function(prop) {
  27623. return spec.hasOwnProperty(prop);
  27624. }).forEach(function(prop) {
  27625. return _this8[prop] = createExecutionContext(spec[prop]);
  27626. });
  27627. };
  27628. Check.prototype.getOptions = function getOptions(options) {
  27629. if (this._internalCheck) {
  27630. return deep_merge_default(this.options, normalizeOptions(options || {}));
  27631. } else {
  27632. return options || this.options;
  27633. }
  27634. };
  27635. var check_default = Check;
  27636. function RuleResult(rule) {
  27637. this.id = rule.id;
  27638. this.result = constants_default.NA;
  27639. this.pageLevel = rule.pageLevel;
  27640. this.impact = null;
  27641. this.nodes = [];
  27642. }
  27643. var rule_result_default = RuleResult;
  27644. function Rule(spec, parentAudit) {
  27645. this._audit = parentAudit;
  27646. this.id = spec.id;
  27647. this.selector = spec.selector || '*';
  27648. if (spec.impact) {
  27649. assert_default(constants_default.impact.includes(spec.impact), 'Impact '.concat(spec.impact, ' is not a valid impact'));
  27650. this.impact = spec.impact;
  27651. }
  27652. this.excludeHidden = typeof spec.excludeHidden === 'boolean' ? spec.excludeHidden : true;
  27653. this.enabled = typeof spec.enabled === 'boolean' ? spec.enabled : true;
  27654. this.pageLevel = typeof spec.pageLevel === 'boolean' ? spec.pageLevel : false;
  27655. this.reviewOnFail = typeof spec.reviewOnFail === 'boolean' ? spec.reviewOnFail : false;
  27656. this.any = spec.any || [];
  27657. this.all = spec.all || [];
  27658. this.none = spec.none || [];
  27659. this.tags = spec.tags || [];
  27660. this.preload = spec.preload ? true : false;
  27661. this.actIds = spec.actIds;
  27662. if (spec.matches) {
  27663. this.matches = createExecutionContext(spec.matches);
  27664. }
  27665. }
  27666. Rule.prototype.matches = function matches3() {
  27667. return true;
  27668. };
  27669. Rule.prototype.gather = function gather(context) {
  27670. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  27671. var markStart = 'mark_gather_start_' + this.id;
  27672. var markEnd = 'mark_gather_end_' + this.id;
  27673. var markHiddenStart = 'mark_isVisibleToScreenReaders_start_' + this.id;
  27674. var markHiddenEnd = 'mark_isVisibleToScreenReaders_end_' + this.id;
  27675. if (options.performanceTimer) {
  27676. performance_timer_default.mark(markStart);
  27677. }
  27678. var elements = _select(this.selector, context);
  27679. if (this.excludeHidden) {
  27680. if (options.performanceTimer) {
  27681. performance_timer_default.mark(markHiddenStart);
  27682. }
  27683. elements = elements.filter(function(element) {
  27684. return _isVisibleToScreenReaders(element);
  27685. });
  27686. if (options.performanceTimer) {
  27687. performance_timer_default.mark(markHiddenEnd);
  27688. performance_timer_default.measure('rule_' + this.id + '#gather_axe.utils.isVisibleToScreenReaders', markHiddenStart, markHiddenEnd);
  27689. }
  27690. }
  27691. if (options.performanceTimer) {
  27692. performance_timer_default.mark(markEnd);
  27693. performance_timer_default.measure('rule_' + this.id + '#gather', markStart, markEnd);
  27694. }
  27695. return elements;
  27696. };
  27697. Rule.prototype.runChecks = function runChecks(type2, node, options, context, resolve, reject) {
  27698. var self2 = this;
  27699. var checkQueue = queue_default();
  27700. this[type2].forEach(function(c4) {
  27701. var check = self2._audit.checks[c4.id || c4];
  27702. var option = get_check_option_default(check, self2.id, options);
  27703. checkQueue.defer(function(res, rej) {
  27704. check.run(node, option, context, res, rej);
  27705. });
  27706. });
  27707. checkQueue.then(function(results) {
  27708. results = results.filter(function(check) {
  27709. return check;
  27710. });
  27711. resolve({
  27712. type: type2,
  27713. results: results
  27714. });
  27715. })['catch'](reject);
  27716. };
  27717. Rule.prototype.runChecksSync = function runChecksSync(type2, node, options, context) {
  27718. var self2 = this;
  27719. var results = [];
  27720. this[type2].forEach(function(c4) {
  27721. var check = self2._audit.checks[c4.id || c4];
  27722. var option = get_check_option_default(check, self2.id, options);
  27723. results.push(check.runSync(node, option, context));
  27724. });
  27725. results = results.filter(function(check) {
  27726. return check;
  27727. });
  27728. return {
  27729. type: type2,
  27730. results: results
  27731. };
  27732. };
  27733. Rule.prototype.run = function run2(context) {
  27734. var _this9 = this;
  27735. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  27736. var resolve = arguments.length > 2 ? arguments[2] : undefined;
  27737. var reject = arguments.length > 3 ? arguments[3] : undefined;
  27738. if (options.performanceTimer) {
  27739. this._trackPerformance();
  27740. }
  27741. var q = queue_default();
  27742. var ruleResult = new rule_result_default(this);
  27743. var nodes;
  27744. try {
  27745. nodes = this.gatherAndMatchNodes(context, options);
  27746. } catch (error) {
  27747. reject(new SupportError({
  27748. cause: error,
  27749. ruleId: this.id
  27750. }));
  27751. return;
  27752. }
  27753. if (options.performanceTimer) {
  27754. this._logGatherPerformance(nodes);
  27755. }
  27756. nodes.forEach(function(node) {
  27757. q.defer(function(resolveNode, rejectNode) {
  27758. var checkQueue = queue_default();
  27759. [ 'any', 'all', 'none' ].forEach(function(type2) {
  27760. checkQueue.defer(function(res, rej) {
  27761. _this9.runChecks(type2, node, options, context, res, rej);
  27762. });
  27763. });
  27764. checkQueue.then(function(results) {
  27765. var result = getResult(results);
  27766. if (result) {
  27767. result.node = new dq_element_default(node);
  27768. ruleResult.nodes.push(result);
  27769. if (_this9.reviewOnFail) {
  27770. [ 'any', 'all' ].forEach(function(type2) {
  27771. result[type2].forEach(function(checkResult) {
  27772. if (checkResult.result === false) {
  27773. checkResult.result = void 0;
  27774. }
  27775. });
  27776. });
  27777. result.none.forEach(function(checkResult) {
  27778. if (checkResult.result === true) {
  27779. checkResult.result = void 0;
  27780. }
  27781. });
  27782. }
  27783. }
  27784. resolveNode();
  27785. })['catch'](function(err2) {
  27786. return rejectNode(err2);
  27787. });
  27788. });
  27789. });
  27790. q.then(function() {
  27791. if (options.performanceTimer) {
  27792. _this9._logRulePerformance();
  27793. }
  27794. setTimeout(function() {
  27795. resolve(ruleResult);
  27796. }, 0);
  27797. })['catch'](function(error) {
  27798. if (options.performanceTimer) {
  27799. _this9._logRulePerformance();
  27800. }
  27801. reject(error);
  27802. });
  27803. };
  27804. Rule.prototype.runSync = function runSync2(context) {
  27805. var _this10 = this;
  27806. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  27807. if (options.performanceTimer) {
  27808. this._trackPerformance();
  27809. }
  27810. var ruleResult = new rule_result_default(this);
  27811. var nodes;
  27812. try {
  27813. nodes = this.gatherAndMatchNodes(context, options);
  27814. } catch (error) {
  27815. throw new SupportError({
  27816. cause: error,
  27817. ruleId: this.id
  27818. });
  27819. }
  27820. if (options.performanceTimer) {
  27821. this._logGatherPerformance(nodes);
  27822. }
  27823. nodes.forEach(function(node) {
  27824. var results = [];
  27825. [ 'any', 'all', 'none' ].forEach(function(type2) {
  27826. results.push(_this10.runChecksSync(type2, node, options, context));
  27827. });
  27828. var result = getResult(results);
  27829. if (result) {
  27830. result.node = node.actualNode ? new dq_element_default(node) : null;
  27831. ruleResult.nodes.push(result);
  27832. if (_this10.reviewOnFail) {
  27833. [ 'any', 'all' ].forEach(function(type2) {
  27834. result[type2].forEach(function(checkResult) {
  27835. if (checkResult.result === false) {
  27836. checkResult.result = void 0;
  27837. }
  27838. });
  27839. });
  27840. result.none.forEach(function(checkResult) {
  27841. if (checkResult.result === true) {
  27842. checkResult.result = void 0;
  27843. }
  27844. });
  27845. }
  27846. }
  27847. });
  27848. if (options.performanceTimer) {
  27849. this._logRulePerformance();
  27850. }
  27851. return ruleResult;
  27852. };
  27853. Rule.prototype._trackPerformance = function _trackPerformance() {
  27854. this._markStart = 'mark_rule_start_' + this.id;
  27855. this._markEnd = 'mark_rule_end_' + this.id;
  27856. this._markChecksStart = 'mark_runchecks_start_' + this.id;
  27857. this._markChecksEnd = 'mark_runchecks_end_' + this.id;
  27858. };
  27859. Rule.prototype._logGatherPerformance = function _logGatherPerformance(nodes) {
  27860. log_default('gather (', nodes.length, '):', performance_timer_default.timeElapsed() + 'ms');
  27861. performance_timer_default.mark(this._markChecksStart);
  27862. };
  27863. Rule.prototype._logRulePerformance = function _logRulePerformance() {
  27864. performance_timer_default.mark(this._markChecksEnd);
  27865. performance_timer_default.mark(this._markEnd);
  27866. performance_timer_default.measure('runchecks_' + this.id, this._markChecksStart, this._markChecksEnd);
  27867. performance_timer_default.measure('rule_' + this.id, this._markStart, this._markEnd);
  27868. };
  27869. function getResult(results) {
  27870. if (results.length) {
  27871. var hasResults = false;
  27872. var result = {};
  27873. results.forEach(function(r) {
  27874. var res = r.results.filter(function(_result) {
  27875. return _result;
  27876. });
  27877. result[r.type] = res;
  27878. if (res.length) {
  27879. hasResults = true;
  27880. }
  27881. });
  27882. if (hasResults) {
  27883. return result;
  27884. }
  27885. return null;
  27886. }
  27887. }
  27888. Rule.prototype.gatherAndMatchNodes = function gatherAndMatchNodes(context, options) {
  27889. var _this11 = this;
  27890. var markMatchesStart = 'mark_matches_start_' + this.id;
  27891. var markMatchesEnd = 'mark_matches_end_' + this.id;
  27892. var nodes = this.gather(context, options);
  27893. if (options.performanceTimer) {
  27894. performance_timer_default.mark(markMatchesStart);
  27895. }
  27896. nodes = nodes.filter(function(node) {
  27897. return _this11.matches(node.actualNode, node, context);
  27898. });
  27899. if (options.performanceTimer) {
  27900. performance_timer_default.mark(markMatchesEnd);
  27901. performance_timer_default.measure('rule_' + this.id + '#matches', markMatchesStart, markMatchesEnd);
  27902. }
  27903. return nodes;
  27904. };
  27905. function findAfterChecks(rule) {
  27906. return get_all_checks_default(rule).map(function(c4) {
  27907. var check = rule._audit.checks[c4.id || c4];
  27908. return check && typeof check.after === 'function' ? check : null;
  27909. }).filter(Boolean);
  27910. }
  27911. function findCheckResults(nodes, checkID) {
  27912. var checkResults = [];
  27913. nodes.forEach(function(nodeResult) {
  27914. var checks = get_all_checks_default(nodeResult);
  27915. checks.forEach(function(checkResult) {
  27916. if (checkResult.id === checkID) {
  27917. checkResult.node = nodeResult.node;
  27918. checkResults.push(checkResult);
  27919. }
  27920. });
  27921. });
  27922. return checkResults;
  27923. }
  27924. function filterChecks(checks) {
  27925. return checks.filter(function(check) {
  27926. return check.filtered !== true;
  27927. });
  27928. }
  27929. function sanitizeNodes(result) {
  27930. var checkTypes2 = [ 'any', 'all', 'none' ];
  27931. var nodes = result.nodes.filter(function(detail) {
  27932. var length = 0;
  27933. checkTypes2.forEach(function(type2) {
  27934. detail[type2] = filterChecks(detail[type2]);
  27935. length += detail[type2].length;
  27936. });
  27937. return length > 0;
  27938. });
  27939. if (result.pageLevel && nodes.length) {
  27940. nodes = [ nodes.reduce(function(a2, b2) {
  27941. if (a2) {
  27942. checkTypes2.forEach(function(type2) {
  27943. a2[type2].push.apply(a2[type2], b2[type2]);
  27944. });
  27945. return a2;
  27946. }
  27947. }) ];
  27948. }
  27949. return nodes;
  27950. }
  27951. Rule.prototype.after = function after(result, options) {
  27952. var _this12 = this;
  27953. var afterChecks = findAfterChecks(this);
  27954. var ruleID = this.id;
  27955. afterChecks.forEach(function(check) {
  27956. var beforeResults = findCheckResults(result.nodes, check.id);
  27957. var checkOption = get_check_option_default(check, ruleID, options);
  27958. var afterResults = check.after(beforeResults, checkOption.options);
  27959. if (_this12.reviewOnFail) {
  27960. afterResults.forEach(function(checkResult) {
  27961. var changeAnyAllResults = (_this12.any.includes(checkResult.id) || _this12.all.includes(checkResult.id)) && checkResult.result === false;
  27962. var changeNoneResult = _this12.none.includes(checkResult.id) && checkResult.result === true;
  27963. if (changeAnyAllResults || changeNoneResult) {
  27964. checkResult.result = void 0;
  27965. }
  27966. });
  27967. }
  27968. beforeResults.forEach(function(item) {
  27969. delete item.node;
  27970. if (afterResults.indexOf(item) === -1) {
  27971. item.filtered = true;
  27972. }
  27973. });
  27974. });
  27975. result.nodes = sanitizeNodes(result);
  27976. return result;
  27977. };
  27978. Rule.prototype.configure = function configure3(spec) {
  27979. if (spec.hasOwnProperty('selector')) {
  27980. this.selector = spec.selector;
  27981. }
  27982. if (spec.hasOwnProperty('excludeHidden')) {
  27983. this.excludeHidden = typeof spec.excludeHidden === 'boolean' ? spec.excludeHidden : true;
  27984. }
  27985. if (spec.hasOwnProperty('enabled')) {
  27986. this.enabled = typeof spec.enabled === 'boolean' ? spec.enabled : true;
  27987. }
  27988. if (spec.hasOwnProperty('pageLevel')) {
  27989. this.pageLevel = typeof spec.pageLevel === 'boolean' ? spec.pageLevel : false;
  27990. }
  27991. if (spec.hasOwnProperty('reviewOnFail')) {
  27992. this.reviewOnFail = typeof spec.reviewOnFail === 'boolean' ? spec.reviewOnFail : false;
  27993. }
  27994. if (spec.hasOwnProperty('any')) {
  27995. this.any = spec.any;
  27996. }
  27997. if (spec.hasOwnProperty('all')) {
  27998. this.all = spec.all;
  27999. }
  28000. if (spec.hasOwnProperty('none')) {
  28001. this.none = spec.none;
  28002. }
  28003. if (spec.hasOwnProperty('tags')) {
  28004. this.tags = spec.tags;
  28005. }
  28006. if (spec.hasOwnProperty('actIds')) {
  28007. this.actIds = spec.actIds;
  28008. }
  28009. if (spec.hasOwnProperty('matches')) {
  28010. this.matches = createExecutionContext(spec.matches);
  28011. }
  28012. if (spec.impact) {
  28013. assert_default(constants_default.impact.includes(spec.impact), 'Impact '.concat(spec.impact, ' is not a valid impact'));
  28014. this.impact = spec.impact;
  28015. }
  28016. };
  28017. var import_dot2 = __toModule(require_doT());
  28018. var dotRegex = /\{\{.+?\}\}/g;
  28019. var Audit = function() {
  28020. function Audit(audit) {
  28021. _classCallCheck(this, Audit);
  28022. this.lang = 'en';
  28023. this.defaultConfig = audit;
  28024. this.standards = standards_default;
  28025. this._init();
  28026. this._defaultLocale = null;
  28027. }
  28028. return _createClass(Audit, [ {
  28029. key: '_setDefaultLocale',
  28030. value: function _setDefaultLocale() {
  28031. if (this._defaultLocale) {
  28032. return;
  28033. }
  28034. var locale = {
  28035. checks: {},
  28036. rules: {},
  28037. failureSummaries: {},
  28038. incompleteFallbackMessage: '',
  28039. lang: this.lang
  28040. };
  28041. var checkIDs = Object.keys(this.data.checks);
  28042. for (var _i44 = 0; _i44 < checkIDs.length; _i44++) {
  28043. var _id6 = checkIDs[_i44];
  28044. var check = this.data.checks[_id6];
  28045. var _check$messages = check.messages, pass = _check$messages.pass, fail = _check$messages.fail, incomplete = _check$messages.incomplete;
  28046. locale.checks[_id6] = {
  28047. pass: pass,
  28048. fail: fail,
  28049. incomplete: incomplete
  28050. };
  28051. }
  28052. var ruleIDs = Object.keys(this.data.rules);
  28053. for (var _i45 = 0; _i45 < ruleIDs.length; _i45++) {
  28054. var _id7 = ruleIDs[_i45];
  28055. var rule = this.data.rules[_id7];
  28056. var description = rule.description, help = rule.help;
  28057. locale.rules[_id7] = {
  28058. description: description,
  28059. help: help
  28060. };
  28061. }
  28062. var failureSummaries = Object.keys(this.data.failureSummaries);
  28063. for (var _i46 = 0; _i46 < failureSummaries.length; _i46++) {
  28064. var type2 = failureSummaries[_i46];
  28065. var failureSummary2 = this.data.failureSummaries[type2];
  28066. var failureMessage = failureSummary2.failureMessage;
  28067. locale.failureSummaries[type2] = {
  28068. failureMessage: failureMessage
  28069. };
  28070. }
  28071. locale.incompleteFallbackMessage = this.data.incompleteFallbackMessage;
  28072. this._defaultLocale = locale;
  28073. }
  28074. }, {
  28075. key: '_resetLocale',
  28076. value: function _resetLocale() {
  28077. var defaultLocale = this._defaultLocale;
  28078. if (!defaultLocale) {
  28079. return;
  28080. }
  28081. this.applyLocale(defaultLocale);
  28082. }
  28083. }, {
  28084. key: '_applyCheckLocale',
  28085. value: function _applyCheckLocale(checks) {
  28086. var keys = Object.keys(checks);
  28087. for (var _i47 = 0; _i47 < keys.length; _i47++) {
  28088. var _id8 = keys[_i47];
  28089. if (!this.data.checks[_id8]) {
  28090. throw new Error('Locale provided for unknown check: "'.concat(_id8, '"'));
  28091. }
  28092. this.data.checks[_id8] = mergeCheckLocale(this.data.checks[_id8], checks[_id8]);
  28093. }
  28094. }
  28095. }, {
  28096. key: '_applyRuleLocale',
  28097. value: function _applyRuleLocale(rules) {
  28098. var keys = Object.keys(rules);
  28099. for (var _i48 = 0; _i48 < keys.length; _i48++) {
  28100. var _id9 = keys[_i48];
  28101. if (!this.data.rules[_id9]) {
  28102. throw new Error('Locale provided for unknown rule: "'.concat(_id9, '"'));
  28103. }
  28104. this.data.rules[_id9] = mergeRuleLocale(this.data.rules[_id9], rules[_id9]);
  28105. }
  28106. }
  28107. }, {
  28108. key: '_applyFailureSummaries',
  28109. value: function _applyFailureSummaries(messages) {
  28110. var keys = Object.keys(messages);
  28111. for (var _i49 = 0; _i49 < keys.length; _i49++) {
  28112. var _key8 = keys[_i49];
  28113. if (!this.data.failureSummaries[_key8]) {
  28114. throw new Error('Locale provided for unknown failureMessage: "'.concat(_key8, '"'));
  28115. }
  28116. this.data.failureSummaries[_key8] = mergeFailureMessage(this.data.failureSummaries[_key8], messages[_key8]);
  28117. }
  28118. }
  28119. }, {
  28120. key: 'applyLocale',
  28121. value: function applyLocale(locale) {
  28122. this._setDefaultLocale();
  28123. if (locale.checks) {
  28124. this._applyCheckLocale(locale.checks);
  28125. }
  28126. if (locale.rules) {
  28127. this._applyRuleLocale(locale.rules);
  28128. }
  28129. if (locale.failureSummaries) {
  28130. this._applyFailureSummaries(locale.failureSummaries, 'failureSummaries');
  28131. }
  28132. if (locale.incompleteFallbackMessage) {
  28133. this.data.incompleteFallbackMessage = mergeFallbackMessage(this.data.incompleteFallbackMessage, locale.incompleteFallbackMessage);
  28134. }
  28135. if (locale.lang) {
  28136. this.lang = locale.lang;
  28137. }
  28138. }
  28139. }, {
  28140. key: 'setAllowedOrigins',
  28141. value: function setAllowedOrigins(allowedOrigins) {
  28142. var defaultOrigin = getDefaultOrigin();
  28143. this.allowedOrigins = [];
  28144. var _iterator22 = _createForOfIteratorHelper(allowedOrigins), _step22;
  28145. try {
  28146. for (_iterator22.s(); !(_step22 = _iterator22.n()).done; ) {
  28147. var origin = _step22.value;
  28148. if (origin === constants_default.allOrigins) {
  28149. this.allowedOrigins = [ '*' ];
  28150. return;
  28151. } else if (origin !== constants_default.sameOrigin) {
  28152. this.allowedOrigins.push(origin);
  28153. } else if (defaultOrigin) {
  28154. this.allowedOrigins.push(defaultOrigin);
  28155. }
  28156. }
  28157. } catch (err) {
  28158. _iterator22.e(err);
  28159. } finally {
  28160. _iterator22.f();
  28161. }
  28162. }
  28163. }, {
  28164. key: '_init',
  28165. value: function _init() {
  28166. var audit = getDefaultConfiguration(this.defaultConfig);
  28167. this.lang = audit.lang || 'en';
  28168. this.reporter = audit.reporter;
  28169. this.commands = {};
  28170. this.rules = [];
  28171. this.checks = {};
  28172. this.brand = 'axe';
  28173. this.application = 'axeAPI';
  28174. this.tagExclude = [ 'experimental', 'deprecated' ];
  28175. this.noHtml = audit.noHtml;
  28176. this.allowedOrigins = audit.allowedOrigins;
  28177. unpackToObject(audit.rules, this, 'addRule');
  28178. unpackToObject(audit.checks, this, 'addCheck');
  28179. this.data = {};
  28180. this.data.checks = audit.data && audit.data.checks || {};
  28181. this.data.rules = audit.data && audit.data.rules || {};
  28182. this.data.failureSummaries = audit.data && audit.data.failureSummaries || {};
  28183. this.data.incompleteFallbackMessage = audit.data && audit.data.incompleteFallbackMessage || '';
  28184. this._constructHelpUrls();
  28185. }
  28186. }, {
  28187. key: 'registerCommand',
  28188. value: function registerCommand(command) {
  28189. this.commands[command.id] = command.callback;
  28190. }
  28191. }, {
  28192. key: 'addRule',
  28193. value: function addRule(spec) {
  28194. if (spec.metadata) {
  28195. this.data.rules[spec.id] = spec.metadata;
  28196. }
  28197. var rule = this.getRule(spec.id);
  28198. if (rule) {
  28199. rule.configure(spec);
  28200. } else {
  28201. this.rules.push(new Rule(spec, this));
  28202. }
  28203. }
  28204. }, {
  28205. key: 'addCheck',
  28206. value: function addCheck(spec) {
  28207. var metadata = spec.metadata;
  28208. if (_typeof(metadata) === 'object') {
  28209. this.data.checks[spec.id] = metadata;
  28210. if (_typeof(metadata.messages) === 'object') {
  28211. Object.keys(metadata.messages).filter(function(prop) {
  28212. return metadata.messages.hasOwnProperty(prop) && typeof metadata.messages[prop] === 'string';
  28213. }).forEach(function(prop) {
  28214. if (metadata.messages[prop].indexOf('function') === 0) {
  28215. metadata.messages[prop] = new Function('return ' + metadata.messages[prop] + ';')();
  28216. }
  28217. });
  28218. }
  28219. }
  28220. if (this.checks[spec.id]) {
  28221. this.checks[spec.id].configure(spec);
  28222. } else {
  28223. this.checks[spec.id] = new check_default(spec);
  28224. }
  28225. }
  28226. }, {
  28227. key: 'run',
  28228. value: function run(context, options, resolve, reject) {
  28229. this.normalizeOptions(options);
  28230. dq_element_default.setRunOptions(options);
  28231. axe._selectCache = [];
  28232. var allRulesToRun = getRulesToRun(this.rules, context, options);
  28233. var runNowRules = allRulesToRun.now;
  28234. var runLaterRules = allRulesToRun.later;
  28235. var nowRulesQueue = queue_default();
  28236. runNowRules.forEach(function(rule) {
  28237. nowRulesQueue.defer(getDefferedRule(rule, context, options));
  28238. });
  28239. var preloaderQueue = queue_default();
  28240. if (runLaterRules.length) {
  28241. preloaderQueue.defer(function(res) {
  28242. _preload(options).then(function(assets) {
  28243. return res(assets);
  28244. })['catch'](function(err2) {
  28245. console.warn('Couldn\'t load preload assets: ', err2);
  28246. res(void 0);
  28247. });
  28248. });
  28249. }
  28250. var queueForNowRulesAndPreloader = queue_default();
  28251. queueForNowRulesAndPreloader.defer(nowRulesQueue);
  28252. queueForNowRulesAndPreloader.defer(preloaderQueue);
  28253. queueForNowRulesAndPreloader.then(function(nowRulesAndPreloaderResults) {
  28254. var assetsFromQueue = nowRulesAndPreloaderResults.pop();
  28255. if (assetsFromQueue && assetsFromQueue.length) {
  28256. var assets = assetsFromQueue[0];
  28257. if (assets) {
  28258. context = _extends({}, context, assets);
  28259. }
  28260. }
  28261. var nowRulesResults = nowRulesAndPreloaderResults[0];
  28262. if (!runLaterRules.length) {
  28263. axe._selectCache = void 0;
  28264. resolve(nowRulesResults.filter(function(result) {
  28265. return !!result;
  28266. }));
  28267. return;
  28268. }
  28269. var laterRulesQueue = queue_default();
  28270. runLaterRules.forEach(function(rule) {
  28271. var deferredRule = getDefferedRule(rule, context, options);
  28272. laterRulesQueue.defer(deferredRule);
  28273. });
  28274. laterRulesQueue.then(function(laterRuleResults) {
  28275. axe._selectCache = void 0;
  28276. resolve(nowRulesResults.concat(laterRuleResults).filter(function(result) {
  28277. return !!result;
  28278. }));
  28279. })['catch'](reject);
  28280. })['catch'](reject);
  28281. }
  28282. }, {
  28283. key: 'after',
  28284. value: function after(results, options) {
  28285. var rules = this.rules;
  28286. return results.map(function(ruleResult) {
  28287. var rule = find_by_default(rules, 'id', ruleResult.id);
  28288. if (!rule) {
  28289. throw new Error('Result for unknown rule. You may be running mismatch axe-core versions');
  28290. }
  28291. return rule.after(ruleResult, options);
  28292. });
  28293. }
  28294. }, {
  28295. key: 'getRule',
  28296. value: function getRule(ruleId) {
  28297. return this.rules.find(function(rule) {
  28298. return rule.id === ruleId;
  28299. });
  28300. }
  28301. }, {
  28302. key: 'normalizeOptions',
  28303. value: function normalizeOptions(options) {
  28304. var audit = this;
  28305. var tags = [];
  28306. var ruleIds = [];
  28307. audit.rules.forEach(function(rule) {
  28308. ruleIds.push(rule.id);
  28309. rule.tags.forEach(function(tag) {
  28310. if (!tags.includes(tag)) {
  28311. tags.push(tag);
  28312. }
  28313. });
  28314. });
  28315. if ([ 'object', 'string' ].includes(_typeof(options.runOnly))) {
  28316. if (typeof options.runOnly === 'string') {
  28317. options.runOnly = [ options.runOnly ];
  28318. }
  28319. if (Array.isArray(options.runOnly)) {
  28320. var hasTag = options.runOnly.find(function(value) {
  28321. return tags.includes(value);
  28322. });
  28323. var hasRule = options.runOnly.find(function(value) {
  28324. return ruleIds.includes(value);
  28325. });
  28326. if (hasTag && hasRule) {
  28327. throw new Error('runOnly cannot be both rules and tags');
  28328. }
  28329. if (hasRule) {
  28330. options.runOnly = {
  28331. type: 'rule',
  28332. values: options.runOnly
  28333. };
  28334. } else {
  28335. options.runOnly = {
  28336. type: 'tag',
  28337. values: options.runOnly
  28338. };
  28339. }
  28340. }
  28341. var only = options.runOnly;
  28342. if (only.value && !only.values) {
  28343. only.values = only.value;
  28344. delete only.value;
  28345. }
  28346. if (!Array.isArray(only.values) || only.values.length === 0) {
  28347. throw new Error('runOnly.values must be a non-empty array');
  28348. }
  28349. if ([ 'rule', 'rules' ].includes(only.type)) {
  28350. only.type = 'rule';
  28351. only.values.forEach(function(ruleId) {
  28352. if (!ruleIds.includes(ruleId)) {
  28353. throw new Error('unknown rule `' + ruleId + '` in options.runOnly');
  28354. }
  28355. });
  28356. } else if ([ 'tag', 'tags', void 0 ].includes(only.type)) {
  28357. only.type = 'tag';
  28358. var unmatchedTags = only.values.filter(function(tag) {
  28359. return !tags.includes(tag) && !/wcag2[1-3]a{1,3}/.test(tag);
  28360. });
  28361. if (unmatchedTags.length !== 0) {
  28362. axe.log('Could not find tags `' + unmatchedTags.join('`, `') + '`');
  28363. }
  28364. } else {
  28365. throw new Error('Unknown runOnly type \''.concat(only.type, '\''));
  28366. }
  28367. }
  28368. if (_typeof(options.rules) === 'object') {
  28369. Object.keys(options.rules).forEach(function(ruleId) {
  28370. if (!ruleIds.includes(ruleId)) {
  28371. throw new Error('unknown rule `' + ruleId + '` in options.rules');
  28372. }
  28373. });
  28374. }
  28375. return options;
  28376. }
  28377. }, {
  28378. key: 'setBranding',
  28379. value: function setBranding(branding) {
  28380. var previous = {
  28381. brand: this.brand,
  28382. application: this.application
  28383. };
  28384. if (typeof branding === 'string') {
  28385. this.application = branding;
  28386. }
  28387. if (branding && branding.hasOwnProperty('brand') && branding.brand && typeof branding.brand === 'string') {
  28388. this.brand = branding.brand;
  28389. }
  28390. if (branding && branding.hasOwnProperty('application') && branding.application && typeof branding.application === 'string') {
  28391. this.application = branding.application;
  28392. }
  28393. this._constructHelpUrls(previous);
  28394. }
  28395. }, {
  28396. key: '_constructHelpUrls',
  28397. value: function _constructHelpUrls() {
  28398. var _this13 = this;
  28399. var previous = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  28400. var version = (axe.version.match(/^[1-9][0-9]*\.[0-9]+/) || [ 'x.y' ])[0];
  28401. this.rules.forEach(function(rule) {
  28402. if (!_this13.data.rules[rule.id]) {
  28403. _this13.data.rules[rule.id] = {};
  28404. }
  28405. var metaData = _this13.data.rules[rule.id];
  28406. if (typeof metaData.helpUrl !== 'string' || previous && metaData.helpUrl === getHelpUrl(previous, rule.id, version)) {
  28407. metaData.helpUrl = getHelpUrl(_this13, rule.id, version);
  28408. }
  28409. });
  28410. }
  28411. }, {
  28412. key: 'resetRulesAndChecks',
  28413. value: function resetRulesAndChecks() {
  28414. this._init();
  28415. this._resetLocale();
  28416. }
  28417. } ]);
  28418. }();
  28419. var audit_default = Audit;
  28420. function getDefaultOrigin() {
  28421. if (window.origin && window.origin !== 'null') {
  28422. return window.origin;
  28423. }
  28424. if (window.location && window.location.origin && window.location.origin !== 'null') {
  28425. return window.location.origin;
  28426. }
  28427. }
  28428. function getDefaultConfiguration(audit) {
  28429. var config;
  28430. if (audit) {
  28431. config = _clone(audit);
  28432. config.commons = audit.commons;
  28433. } else {
  28434. config = {};
  28435. }
  28436. config.reporter = config.reporter || null;
  28437. config.noHtml = config.noHtml || false;
  28438. if (!config.allowedOrigins) {
  28439. var defaultOrigin = getDefaultOrigin();
  28440. config.allowedOrigins = defaultOrigin ? [ defaultOrigin ] : [];
  28441. }
  28442. config.rules = config.rules || [];
  28443. config.checks = config.checks || [];
  28444. config.data = _extends({
  28445. checks: {},
  28446. rules: {}
  28447. }, config.data);
  28448. return config;
  28449. }
  28450. function unpackToObject(collection, audit, method) {
  28451. var i, l;
  28452. for (i = 0, l = collection.length; i < l; i++) {
  28453. audit[method](collection[i]);
  28454. }
  28455. }
  28456. var mergeCheckLocale = function mergeCheckLocale(a2, b2) {
  28457. var pass = b2.pass, fail = b2.fail;
  28458. if (typeof pass === 'string' && dotRegex.test(pass)) {
  28459. pass = import_dot2['default'].compile(pass);
  28460. }
  28461. if (typeof fail === 'string' && dotRegex.test(fail)) {
  28462. fail = import_dot2['default'].compile(fail);
  28463. }
  28464. return _extends({}, a2, {
  28465. messages: {
  28466. pass: pass || a2.messages.pass,
  28467. fail: fail || a2.messages.fail,
  28468. incomplete: _typeof(a2.messages.incomplete) === 'object' ? _extends({}, a2.messages.incomplete, b2.incomplete) : b2.incomplete
  28469. }
  28470. });
  28471. };
  28472. var mergeRuleLocale = function mergeRuleLocale(a2, b2) {
  28473. var help = b2.help, description = b2.description;
  28474. if (typeof help === 'string' && dotRegex.test(help)) {
  28475. help = import_dot2['default'].compile(help);
  28476. }
  28477. if (typeof description === 'string' && dotRegex.test(description)) {
  28478. description = import_dot2['default'].compile(description);
  28479. }
  28480. return _extends({}, a2, {
  28481. help: help || a2.help,
  28482. description: description || a2.description
  28483. });
  28484. };
  28485. var mergeFailureMessage = function mergeFailureMessage(a2, b2) {
  28486. var failureMessage = b2.failureMessage;
  28487. if (typeof failureMessage === 'string' && dotRegex.test(failureMessage)) {
  28488. failureMessage = import_dot2['default'].compile(failureMessage);
  28489. }
  28490. return _extends({}, a2, {
  28491. failureMessage: failureMessage || a2.failureMessage
  28492. });
  28493. };
  28494. var mergeFallbackMessage = function mergeFallbackMessage(a2, b2) {
  28495. if (typeof b2 === 'string' && dotRegex.test(b2)) {
  28496. b2 = import_dot2['default'].compile(b2);
  28497. }
  28498. return b2 || a2;
  28499. };
  28500. function getRulesToRun(rules, context, options) {
  28501. var base = {
  28502. now: [],
  28503. later: []
  28504. };
  28505. var splitRules = rules.reduce(function(out, rule) {
  28506. if (!rule_should_run_default(rule, context, options)) {
  28507. return out;
  28508. }
  28509. if (rule.preload) {
  28510. out.later.push(rule);
  28511. return out;
  28512. }
  28513. out.now.push(rule);
  28514. return out;
  28515. }, base);
  28516. return splitRules;
  28517. }
  28518. function getDefferedRule(rule, context, options) {
  28519. if (options.performanceTimer) {
  28520. performance_timer_default.mark('mark_rule_start_' + rule.id);
  28521. }
  28522. return function(resolve, reject) {
  28523. rule.run(context, options, function(ruleResult) {
  28524. resolve(ruleResult);
  28525. }, function(err2) {
  28526. if (!options.debug) {
  28527. var errResult = Object.assign(new rule_result_default(rule), {
  28528. result: constants_default.CANTTELL,
  28529. description: 'An error occured while running this rule',
  28530. message: err2.message,
  28531. stack: err2.stack,
  28532. error: err2,
  28533. errorNode: err2.errorNode
  28534. });
  28535. resolve(errResult);
  28536. } else {
  28537. reject(err2);
  28538. }
  28539. });
  28540. };
  28541. }
  28542. function getHelpUrl(_ref142, ruleId, version) {
  28543. var brand = _ref142.brand, application = _ref142.application, lang = _ref142.lang;
  28544. return constants_default.helpUrlBase + brand + '/' + (version || axe.version.substring(0, axe.version.lastIndexOf('.'))) + '/' + ruleId + '?application=' + encodeURIComponent(application) + (lang && lang !== 'en' ? '&lang=' + encodeURIComponent(lang) : '');
  28545. }
  28546. function setupGlobals(context) {
  28547. var hasWindow = window && 'Node' in window && 'NodeList' in window;
  28548. var hasDoc = !!document;
  28549. if (hasWindow && hasDoc) {
  28550. return;
  28551. }
  28552. if (!context || !context.ownerDocument) {
  28553. throw new Error('Required "window" or "document" globals not defined and cannot be deduced from the context. Either set the globals before running or pass in a valid Element.');
  28554. }
  28555. if (!hasDoc) {
  28556. cache_default.set('globalDocumentSet', true);
  28557. document = context.ownerDocument;
  28558. }
  28559. if (!hasWindow) {
  28560. cache_default.set('globalWindowSet', true);
  28561. window = document.defaultView;
  28562. }
  28563. }
  28564. function resetGlobals() {
  28565. if (cache_default.get('globalDocumentSet')) {
  28566. cache_default.set('globalDocumentSet', false);
  28567. document = null;
  28568. }
  28569. if (cache_default.get('globalWindowSet')) {
  28570. cache_default.set('globalWindowSet', false);
  28571. window = null;
  28572. }
  28573. }
  28574. function teardown() {
  28575. resetGlobals();
  28576. axe._memoizedFns.forEach(function(fn) {
  28577. return fn.clear();
  28578. });
  28579. cache_default.clear();
  28580. axe._tree = void 0;
  28581. axe._selectorData = void 0;
  28582. axe._selectCache = void 0;
  28583. }
  28584. var teardown_default = teardown;
  28585. function runRules(context, options, resolve, reject) {
  28586. try {
  28587. context = new Context(context);
  28588. axe._tree = context.flatTree;
  28589. axe._selectorData = _getSelectorData(context.flatTree);
  28590. } catch (e) {
  28591. teardown_default();
  28592. return reject(e);
  28593. }
  28594. var q = queue_default();
  28595. var audit = axe._audit;
  28596. if (options.performanceTimer) {
  28597. performance_timer_default.auditStart();
  28598. }
  28599. if (context.frames.length && options.iframes !== false) {
  28600. q.defer(function(res, rej) {
  28601. _collectResultsFromFrames(context, options, 'rules', null, res, rej);
  28602. });
  28603. }
  28604. q.defer(function(res, rej) {
  28605. audit.run(context, options, res, rej);
  28606. });
  28607. q.then(function(data) {
  28608. try {
  28609. if (options.performanceTimer) {
  28610. performance_timer_default.auditEnd();
  28611. }
  28612. var results = merge_results_default(data.map(function(res) {
  28613. return {
  28614. results: res
  28615. };
  28616. }));
  28617. if (context.initiator) {
  28618. if (options.performanceTimer) {
  28619. performance_timer_default.mark('auditAfterStart');
  28620. }
  28621. results = audit.after(results, options);
  28622. if (options.performanceTimer) {
  28623. performance_timer_default.mark('auditAfterEnd');
  28624. performance_timer_default.measure('audit.after', 'auditAfterStart', 'auditAfterEnd');
  28625. performance_timer_default.logMeasures('audit.after');
  28626. }
  28627. results.forEach(_publishMetaData);
  28628. results = results.map(_finalizeRuleResult);
  28629. }
  28630. try {
  28631. resolve(results, teardown_default);
  28632. } catch (e) {
  28633. teardown_default();
  28634. log_default(e);
  28635. }
  28636. } catch (e) {
  28637. teardown_default();
  28638. reject(e);
  28639. }
  28640. })['catch'](function(e) {
  28641. teardown_default();
  28642. reject(e);
  28643. });
  28644. }
  28645. function load(audit) {
  28646. axe._audit = new audit_default(audit);
  28647. }
  28648. function runCommand(data, keepalive, callback) {
  28649. var resolve = callback;
  28650. var reject = function reject2(err2) {
  28651. if (err2 instanceof Error === false) {
  28652. err2 = new Error(err2);
  28653. }
  28654. callback(err2);
  28655. };
  28656. var context = data && data.context || {};
  28657. if (context.hasOwnProperty('include') && !context.include.length) {
  28658. context.include = [ document ];
  28659. }
  28660. var options = data && data.options || {};
  28661. switch (data.command) {
  28662. case 'rules':
  28663. return runRules(context, options, function(results, cleanupFn) {
  28664. results = node_serializer_default.mapRawResults(results);
  28665. resolve(results);
  28666. cleanupFn();
  28667. }, reject);
  28668. case 'cleanup-plugin':
  28669. return cleanup_default(resolve, reject);
  28670. default:
  28671. if (axe._audit && axe._audit.commands && axe._audit.commands[data.command]) {
  28672. return axe._audit.commands[data.command](data, callback);
  28673. }
  28674. }
  28675. }
  28676. if (window.top !== window) {
  28677. _respondable.subscribe('axe.start', runCommand);
  28678. _respondable.subscribe('axe.ping', function(data, keepalive, respond) {
  28679. respond({
  28680. axe: true
  28681. });
  28682. });
  28683. }
  28684. function Plugin(spec) {
  28685. this._run = spec.run;
  28686. this._collect = spec.collect;
  28687. this._registry = {};
  28688. spec.commands.forEach(function(command) {
  28689. axe._audit.registerCommand(command);
  28690. });
  28691. }
  28692. Plugin.prototype.run = function run3() {
  28693. return this._run.apply(this, arguments);
  28694. };
  28695. Plugin.prototype.collect = function collect() {
  28696. return this._collect.apply(this, arguments);
  28697. };
  28698. Plugin.prototype.cleanup = function cleanup2(done) {
  28699. var q = axe.utils.queue();
  28700. var that = this;
  28701. Object.keys(this._registry).forEach(function(key) {
  28702. q.defer(function(_done) {
  28703. that._registry[key].cleanup(_done);
  28704. });
  28705. });
  28706. q.then(done);
  28707. };
  28708. Plugin.prototype.add = function add(impl) {
  28709. this._registry[impl.id] = impl;
  28710. };
  28711. function registerPlugin(plugin) {
  28712. axe.plugins[plugin.id] = new Plugin(plugin);
  28713. }
  28714. var plugins_default = registerPlugin;
  28715. function reset() {
  28716. var audit = axe._audit;
  28717. if (!audit) {
  28718. throw new Error('No audit configured');
  28719. }
  28720. audit.resetRulesAndChecks();
  28721. resetStandards();
  28722. }
  28723. var reset_default = reset;
  28724. function runVirtualRule(ruleId, vNode) {
  28725. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  28726. options.reporter = options.reporter || axe._audit.reporter || 'v1';
  28727. axe._selectorData = {};
  28728. if (!(vNode instanceof abstract_virtual_node_default)) {
  28729. vNode = new serial_virtual_node_default(vNode);
  28730. }
  28731. var rule = _getRule(ruleId);
  28732. if (!rule) {
  28733. throw new Error('unknown rule `' + ruleId + '`');
  28734. }
  28735. rule = Object.create(rule, {
  28736. excludeHidden: {
  28737. value: false
  28738. }
  28739. });
  28740. var context = {
  28741. initiator: true,
  28742. include: [ vNode ],
  28743. exclude: [],
  28744. frames: [],
  28745. page: false,
  28746. focusable: true,
  28747. size: {},
  28748. flatTree: []
  28749. };
  28750. var rawResults = rule.runSync(context, options);
  28751. _publishMetaData(rawResults);
  28752. _finalizeRuleResult(rawResults);
  28753. var results = aggregate_result_default([ rawResults ]);
  28754. results.violations.forEach(function(result) {
  28755. return result.nodes.forEach(function(nodeResult) {
  28756. nodeResult.failureSummary = failure_summary_default(nodeResult);
  28757. });
  28758. });
  28759. return _extends({}, _getEnvironmentData(), results, {
  28760. toolOptions: options
  28761. });
  28762. }
  28763. function normalizeRunParams(_ref143) {
  28764. var _ref145, _options$reporter, _axe$_audit;
  28765. var _ref144 = _slicedToArray(_ref143, 3), context = _ref144[0], options = _ref144[1], callback = _ref144[2];
  28766. var typeErr = new TypeError('axe.run arguments are invalid');
  28767. if (!_isContextSpec(context)) {
  28768. if (callback !== void 0) {
  28769. throw typeErr;
  28770. }
  28771. callback = options;
  28772. options = context;
  28773. context = document;
  28774. }
  28775. if (_typeof(options) !== 'object') {
  28776. if (callback !== void 0) {
  28777. throw typeErr;
  28778. }
  28779. callback = options;
  28780. options = {};
  28781. }
  28782. if (typeof callback !== 'function' && callback !== void 0) {
  28783. throw typeErr;
  28784. }
  28785. options = _clone(options);
  28786. options.reporter = (_ref145 = (_options$reporter = options.reporter) !== null && _options$reporter !== void 0 ? _options$reporter : (_axe$_audit = axe._audit) === null || _axe$_audit === void 0 ? void 0 : _axe$_audit.reporter) !== null && _ref145 !== void 0 ? _ref145 : 'v1';
  28787. return {
  28788. context: context,
  28789. options: options,
  28790. callback: callback
  28791. };
  28792. }
  28793. var noop2 = function noop2() {};
  28794. function run4() {
  28795. for (var _len7 = arguments.length, args = new Array(_len7), _key9 = 0; _key9 < _len7; _key9++) {
  28796. args[_key9] = arguments[_key9];
  28797. }
  28798. setupGlobals(args[0]);
  28799. var _normalizeRunParams = normalizeRunParams(args), context = _normalizeRunParams.context, options = _normalizeRunParams.options, _normalizeRunParams$c = _normalizeRunParams.callback, callback = _normalizeRunParams$c === void 0 ? noop2 : _normalizeRunParams$c;
  28800. var _getPromiseHandlers = getPromiseHandlers(callback), thenable = _getPromiseHandlers.thenable, resolve = _getPromiseHandlers.resolve, reject = _getPromiseHandlers.reject;
  28801. try {
  28802. assert_default(axe._audit, 'No audit configured');
  28803. assert_default(!axe._running, 'Axe is already running. Use `await axe.run()` to wait for the previous run to finish before starting a new run.');
  28804. } catch (e) {
  28805. return handleError(e, callback);
  28806. }
  28807. axe._running = true;
  28808. if (options.performanceTimer) {
  28809. performance_timer_default.start();
  28810. }
  28811. function handleRunRules(rawResults, teardown2) {
  28812. var respond = function respond(results) {
  28813. if (options.performanceTimer) {
  28814. performance_timer_default.mark('reporterEnd');
  28815. performance_timer_default.measure('reporter', 'reporterStart', 'reporterEnd');
  28816. performance_timer_default.logMeasures('reporter');
  28817. performance_timer_default.end();
  28818. }
  28819. axe._running = false;
  28820. teardown2();
  28821. try {
  28822. resolve(results);
  28823. } catch (e) {
  28824. axe.log(e);
  28825. }
  28826. };
  28827. var wrappedReject = function wrappedReject(err2) {
  28828. axe._running = false;
  28829. teardown2();
  28830. try {
  28831. reject(err2);
  28832. } catch (e) {
  28833. axe.log(e);
  28834. }
  28835. };
  28836. try {
  28837. if (options.performanceTimer) {
  28838. performance_timer_default.mark('reporterStart');
  28839. }
  28840. createReport(rawResults, options, respond, wrappedReject);
  28841. } catch (err2) {
  28842. wrappedReject(err2);
  28843. }
  28844. }
  28845. function errorRunRules(err2) {
  28846. if (options.performanceTimer) {
  28847. performance_timer_default.end();
  28848. }
  28849. axe._running = false;
  28850. callback(err2);
  28851. reject(err2);
  28852. }
  28853. axe._runRules(context, options, handleRunRules, errorRunRules);
  28854. return thenable;
  28855. }
  28856. function getPromiseHandlers(callback) {
  28857. var thenable, reject, resolve;
  28858. if (typeof Promise === 'function' && callback === noop2) {
  28859. thenable = new Promise(function(_resolve, _reject) {
  28860. reject = _reject;
  28861. resolve = _resolve;
  28862. });
  28863. } else {
  28864. resolve = function resolve(result) {
  28865. return callback(null, result);
  28866. };
  28867. reject = function reject(err2) {
  28868. return callback(err2);
  28869. };
  28870. }
  28871. return {
  28872. thenable: thenable,
  28873. reject: reject,
  28874. resolve: resolve
  28875. };
  28876. }
  28877. function createReport(rawResults, options, respond, reject) {
  28878. var reporter = getReporter(options.reporter);
  28879. var results = reporter(rawResults, options, respond, reject);
  28880. if (results !== void 0) {
  28881. respond(results);
  28882. }
  28883. }
  28884. function handleError(err2, callback) {
  28885. if (typeof callback === 'function' && callback !== noop2) {
  28886. callback(err2.message);
  28887. return;
  28888. }
  28889. throw err2;
  28890. }
  28891. function runPartial() {
  28892. for (var _len8 = arguments.length, args = new Array(_len8), _key10 = 0; _key10 < _len8; _key10++) {
  28893. args[_key10] = arguments[_key10];
  28894. }
  28895. var _normalizeRunParams2 = normalizeRunParams(args), options = _normalizeRunParams2.options, context = _normalizeRunParams2.context;
  28896. assert_default(axe._audit, 'Axe is not configured. Audit is missing.');
  28897. assert_default(!axe._running, 'Axe is already running. Use `await axe.run()` to wait for the previous run to finish before starting a new run.');
  28898. var contextObj = new Context(context, axe._tree);
  28899. axe._tree = contextObj.flatTree;
  28900. axe._selectorData = _getSelectorData(contextObj.flatTree);
  28901. axe._running = true;
  28902. options.elementRef = false;
  28903. return new Promise(function(res, rej) {
  28904. axe._audit.run(contextObj, options, res, rej);
  28905. }).then(function(results) {
  28906. results = node_serializer_default.mapRawResults(results);
  28907. var frames = contextObj.frames.map(function(_ref146) {
  28908. var node = _ref146.node;
  28909. return node_serializer_default.toSpec(node);
  28910. });
  28911. var environmentData;
  28912. if (contextObj.initiator) {
  28913. environmentData = _getEnvironmentData();
  28914. }
  28915. axe._running = false;
  28916. teardown_default();
  28917. return {
  28918. results: results,
  28919. frames: frames,
  28920. environmentData: environmentData
  28921. };
  28922. })['catch'](function(err2) {
  28923. axe._running = false;
  28924. teardown_default();
  28925. return Promise.reject(err2);
  28926. });
  28927. }
  28928. function finishRun(partialResults) {
  28929. var _ref148, _options$reporter2, _axe$_audit2;
  28930. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  28931. options = _clone(options);
  28932. var _ref147 = partialResults.find(function(r) {
  28933. return r.environmentData;
  28934. }) || {}, environmentData = _ref147.environmentData;
  28935. axe._audit.normalizeOptions(options);
  28936. options.reporter = (_ref148 = (_options$reporter2 = options.reporter) !== null && _options$reporter2 !== void 0 ? _options$reporter2 : (_axe$_audit2 = axe._audit) === null || _axe$_audit2 === void 0 ? void 0 : _axe$_audit2.reporter) !== null && _ref148 !== void 0 ? _ref148 : 'v1';
  28937. setFrameSpec(partialResults);
  28938. var results = merge_results_default(partialResults);
  28939. results = axe._audit.after(results, options);
  28940. results.forEach(_publishMetaData);
  28941. results = results.map(_finalizeRuleResult);
  28942. return createReport2(results, _extends({
  28943. environmentData: environmentData
  28944. }, options));
  28945. }
  28946. function setFrameSpec(partialResults) {
  28947. var frameStack = [];
  28948. var _iterator23 = _createForOfIteratorHelper(partialResults), _step23;
  28949. try {
  28950. for (_iterator23.s(); !(_step23 = _iterator23.n()).done; ) {
  28951. var partialResult = _step23.value;
  28952. var frameSpec = frameStack.shift();
  28953. if (!partialResult) {
  28954. continue;
  28955. }
  28956. partialResult.frameSpec = frameSpec !== null && frameSpec !== void 0 ? frameSpec : null;
  28957. var frameSpecs = getMergedFrameSpecs(partialResult);
  28958. frameStack.unshift.apply(frameStack, _toConsumableArray(frameSpecs));
  28959. }
  28960. } catch (err) {
  28961. _iterator23.e(err);
  28962. } finally {
  28963. _iterator23.f();
  28964. }
  28965. }
  28966. function getMergedFrameSpecs(_ref149) {
  28967. var childFrameSpecs = _ref149.frames, parentFrameSpec = _ref149.frameSpec;
  28968. if (!parentFrameSpec) {
  28969. return childFrameSpecs;
  28970. }
  28971. return childFrameSpecs.map(function(childFrameSpec) {
  28972. return node_serializer_default.mergeSpecs(childFrameSpec, parentFrameSpec);
  28973. });
  28974. }
  28975. function createReport2(results, options) {
  28976. return new Promise(function(resolve, reject) {
  28977. var reporter = getReporter(options.reporter);
  28978. reporter(results, options, resolve, reject);
  28979. });
  28980. }
  28981. function setup(node) {
  28982. if (axe._tree) {
  28983. throw new Error('Axe is already setup. Call `axe.teardown()` before calling `axe.setup` again.');
  28984. }
  28985. if (node && _typeof(node.documentElement) === 'object' && _typeof(node.defaultView) === 'object') {
  28986. node = node.documentElement;
  28987. }
  28988. setupGlobals(node);
  28989. axe._tree = _getFlattenedTree(node);
  28990. axe._selectorData = _getSelectorData(axe._tree);
  28991. return axe._tree[0];
  28992. }
  28993. var setup_default = setup;
  28994. var naReporter = function naReporter(results, options, callback) {
  28995. console.warn('"na" reporter will be deprecated in axe v4.0. Use the "v2" reporter instead.');
  28996. if (typeof options === 'function') {
  28997. callback = options;
  28998. options = {};
  28999. }
  29000. var _options4 = options, environmentData = _options4.environmentData, toolOptions = _objectWithoutProperties(_options4, _excluded15);
  29001. callback(_extends({}, _getEnvironmentData(environmentData), {
  29002. toolOptions: toolOptions
  29003. }, processAggregate(results, options)));
  29004. };
  29005. var na_default = naReporter;
  29006. var noPassesReporter = function noPassesReporter(results, options, callback) {
  29007. if (typeof options === 'function') {
  29008. callback = options;
  29009. options = {};
  29010. }
  29011. var _options5 = options, environmentData = _options5.environmentData, toolOptions = _objectWithoutProperties(_options5, _excluded16);
  29012. options.resultTypes = [ 'violations' ];
  29013. var _processAggregate = processAggregate(results, options), violations = _processAggregate.violations;
  29014. callback(_extends({}, _getEnvironmentData(environmentData), {
  29015. toolOptions: toolOptions,
  29016. violations: violations
  29017. }));
  29018. };
  29019. var no_passes_default = noPassesReporter;
  29020. var rawReporter = function rawReporter(results, options, callback) {
  29021. if (typeof options === 'function') {
  29022. callback = options;
  29023. options = {};
  29024. }
  29025. if (!results || !Array.isArray(results)) {
  29026. return callback(results);
  29027. }
  29028. var transformedResults = results.map(function(result) {
  29029. var transformedResult = _extends({}, result);
  29030. var types = [ 'passes', 'violations', 'incomplete', 'inapplicable' ];
  29031. for (var _i50 = 0, _types = types; _i50 < _types.length; _i50++) {
  29032. var type2 = _types[_i50];
  29033. transformedResult[type2] = node_serializer_default.mapRawNodeResults(transformedResult[type2]);
  29034. }
  29035. return transformedResult;
  29036. });
  29037. callback(transformedResults);
  29038. };
  29039. var raw_default = rawReporter;
  29040. var rawEnvReporter = function rawEnvReporter(results, options, callback) {
  29041. if (typeof options === 'function') {
  29042. callback = options;
  29043. options = {};
  29044. }
  29045. var _options6 = options, environmentData = _options6.environmentData, toolOptions = _objectWithoutProperties(_options6, _excluded17);
  29046. raw_default(results, toolOptions, function(raw) {
  29047. var env = _getEnvironmentData(environmentData);
  29048. callback({
  29049. raw: raw,
  29050. env: env
  29051. });
  29052. });
  29053. };
  29054. var raw_env_default = rawEnvReporter;
  29055. var v1Reporter = function v1Reporter(results, options, callback) {
  29056. if (typeof options === 'function') {
  29057. callback = options;
  29058. options = {};
  29059. }
  29060. var _options7 = options, environmentData = _options7.environmentData, toolOptions = _objectWithoutProperties(_options7, _excluded18);
  29061. var out = processAggregate(results, options);
  29062. var addFailureSummaries = function addFailureSummaries(result) {
  29063. result.nodes.forEach(function(nodeResult) {
  29064. nodeResult.failureSummary = failure_summary_default(nodeResult);
  29065. });
  29066. };
  29067. out.incomplete.forEach(addFailureSummaries);
  29068. out.violations.forEach(addFailureSummaries);
  29069. callback(_extends({}, _getEnvironmentData(environmentData), {
  29070. toolOptions: toolOptions
  29071. }, out));
  29072. };
  29073. var v1_default = v1Reporter;
  29074. var v2Reporter = function v2Reporter(results, options, callback) {
  29075. if (typeof options === 'function') {
  29076. callback = options;
  29077. options = {};
  29078. }
  29079. var _options8 = options, environmentData = _options8.environmentData, toolOptions = _objectWithoutProperties(_options8, _excluded19);
  29080. var out = processAggregate(results, options);
  29081. callback(_extends({}, _getEnvironmentData(environmentData), {
  29082. toolOptions: toolOptions
  29083. }, out));
  29084. };
  29085. var v2_default = v2Reporter;
  29086. var _thisWillBeDeletedDoNotUse = {
  29087. base: {
  29088. Audit: audit_default,
  29089. CheckResult: check_result_default,
  29090. Check: check_default,
  29091. Context: Context,
  29092. RuleResult: rule_result_default,
  29093. Rule: Rule,
  29094. metadataFunctionMap: metadata_function_map_default
  29095. },
  29096. public: {
  29097. reporters: reporters
  29098. },
  29099. helpers: {
  29100. failureSummary: failure_summary_default,
  29101. incompleteFallbackMessage: incompleteFallbackMessage,
  29102. processAggregate: processAggregate
  29103. },
  29104. utils: {
  29105. setDefaultFrameMessenger: setDefaultFrameMessenger,
  29106. cacheNodeSelectors: cacheNodeSelectors,
  29107. getNodesMatchingExpression: getNodesMatchingExpression,
  29108. convertSelector: _convertSelector
  29109. },
  29110. commons: {
  29111. dom: {
  29112. nativelyHidden: nativelyHidden,
  29113. displayHidden: displayHidden,
  29114. visibilityHidden: visibilityHidden,
  29115. contentVisibiltyHidden: contentVisibiltyHidden,
  29116. ariaHidden: ariaHidden,
  29117. opacityHidden: opacityHidden,
  29118. scrollHidden: scrollHidden,
  29119. overflowHidden: overflowHidden,
  29120. clipHidden: clipHidden,
  29121. areaHidden: areaHidden,
  29122. detailsHidden: detailsHidden
  29123. }
  29124. }
  29125. };
  29126. var exposed_for_testing_default = _thisWillBeDeletedDoNotUse;
  29127. axe._thisWillBeDeletedDoNotUse = exposed_for_testing_default;
  29128. axe.constants = constants_default;
  29129. axe.log = log_default;
  29130. axe.AbstractVirtualNode = abstract_virtual_node_default;
  29131. axe.SerialVirtualNode = serial_virtual_node_default;
  29132. axe.VirtualNode = virtual_node_default;
  29133. axe._cache = cache_default;
  29134. axe.imports = imports_exports;
  29135. axe.cleanup = cleanup_default;
  29136. axe.configure = configure_default;
  29137. axe.frameMessenger = frameMessenger2;
  29138. axe.getRules = get_rules_default;
  29139. axe._load = load;
  29140. axe.plugins = {};
  29141. axe.registerPlugin = plugins_default;
  29142. axe.hasReporter = hasReporter;
  29143. axe.getReporter = getReporter;
  29144. axe.addReporter = addReporter;
  29145. axe.reset = reset_default;
  29146. axe._runRules = runRules;
  29147. axe.runVirtualRule = runVirtualRule;
  29148. axe.run = run4;
  29149. axe.setup = setup_default;
  29150. axe.teardown = teardown_default;
  29151. axe.runPartial = runPartial;
  29152. axe.finishRun = finishRun;
  29153. axe.commons = commons_exports;
  29154. axe.utils = utils_exports;
  29155. axe.addReporter('na', na_default);
  29156. axe.addReporter('no-passes', no_passes_default);
  29157. axe.addReporter('rawEnv', raw_env_default);
  29158. axe.addReporter('raw', raw_default);
  29159. axe.addReporter('v1', v1_default);
  29160. axe.addReporter('v2', v2_default, true);
  29161. })();
  29162. 'use strict';
  29163. axe._load({
  29164. lang: 'en',
  29165. data: {
  29166. rules: {
  29167. accesskeys: {
  29168. description: 'Ensure every accesskey attribute value is unique',
  29169. help: 'accesskey attribute value should be unique'
  29170. },
  29171. 'area-alt': {
  29172. description: 'Ensure <area> elements of image maps have alternative text',
  29173. help: 'Active <area> elements must have alternative text'
  29174. },
  29175. 'aria-allowed-attr': {
  29176. description: 'Ensure an element\'s role supports its ARIA attributes',
  29177. help: 'Elements must only use supported ARIA attributes'
  29178. },
  29179. 'aria-allowed-role': {
  29180. description: 'Ensure role attribute has an appropriate value for the element',
  29181. help: 'ARIA role should be appropriate for the element'
  29182. },
  29183. 'aria-braille-equivalent': {
  29184. description: 'Ensure aria-braillelabel and aria-brailleroledescription have a non-braille equivalent',
  29185. help: 'aria-braille attributes must have a non-braille equivalent'
  29186. },
  29187. 'aria-command-name': {
  29188. description: 'Ensure every ARIA button, link and menuitem has an accessible name',
  29189. help: 'ARIA commands must have an accessible name'
  29190. },
  29191. 'aria-conditional-attr': {
  29192. description: 'Ensure ARIA attributes are used as described in the specification of the element\'s role',
  29193. help: 'ARIA attributes must be used as specified for the element\'s role'
  29194. },
  29195. 'aria-deprecated-role': {
  29196. description: 'Ensure elements do not use deprecated roles',
  29197. help: 'Deprecated ARIA roles must not be used'
  29198. },
  29199. 'aria-dialog-name': {
  29200. description: 'Ensure every ARIA dialog and alertdialog node has an accessible name',
  29201. help: 'ARIA dialog and alertdialog nodes should have an accessible name'
  29202. },
  29203. 'aria-hidden-body': {
  29204. description: 'Ensure aria-hidden="true" is not present on the document body.',
  29205. help: 'aria-hidden="true" must not be present on the document body'
  29206. },
  29207. 'aria-hidden-focus': {
  29208. description: 'Ensure aria-hidden elements are not focusable nor contain focusable elements',
  29209. help: 'ARIA hidden element must not be focusable or contain focusable elements'
  29210. },
  29211. 'aria-input-field-name': {
  29212. description: 'Ensure every ARIA input field has an accessible name',
  29213. help: 'ARIA input fields must have an accessible name'
  29214. },
  29215. 'aria-meter-name': {
  29216. description: 'Ensure every ARIA meter node has an accessible name',
  29217. help: 'ARIA meter nodes must have an accessible name'
  29218. },
  29219. 'aria-progressbar-name': {
  29220. description: 'Ensure every ARIA progressbar node has an accessible name',
  29221. help: 'ARIA progressbar nodes must have an accessible name'
  29222. },
  29223. 'aria-prohibited-attr': {
  29224. description: 'Ensure ARIA attributes are not prohibited for an element\'s role',
  29225. help: 'Elements must only use permitted ARIA attributes'
  29226. },
  29227. 'aria-required-attr': {
  29228. description: 'Ensure elements with ARIA roles have all required ARIA attributes',
  29229. help: 'Required ARIA attributes must be provided'
  29230. },
  29231. 'aria-required-children': {
  29232. description: 'Ensure elements with an ARIA role that require child roles contain them',
  29233. help: 'Certain ARIA roles must contain particular children'
  29234. },
  29235. 'aria-required-parent': {
  29236. description: 'Ensure elements with an ARIA role that require parent roles are contained by them',
  29237. help: 'Certain ARIA roles must be contained by particular parents'
  29238. },
  29239. 'aria-roledescription': {
  29240. description: 'Ensure aria-roledescription is only used on elements with an implicit or explicit role',
  29241. help: 'aria-roledescription must be on elements with a semantic role'
  29242. },
  29243. 'aria-roles': {
  29244. description: 'Ensure all elements with a role attribute use a valid value',
  29245. help: 'ARIA roles used must conform to valid values'
  29246. },
  29247. 'aria-text': {
  29248. description: 'Ensure role="text" is used on elements with no focusable descendants',
  29249. help: '"role=text" should have no focusable descendants'
  29250. },
  29251. 'aria-toggle-field-name': {
  29252. description: 'Ensure every ARIA toggle field has an accessible name',
  29253. help: 'ARIA toggle fields must have an accessible name'
  29254. },
  29255. 'aria-tooltip-name': {
  29256. description: 'Ensure every ARIA tooltip node has an accessible name',
  29257. help: 'ARIA tooltip nodes must have an accessible name'
  29258. },
  29259. 'aria-treeitem-name': {
  29260. description: 'Ensure every ARIA treeitem node has an accessible name',
  29261. help: 'ARIA treeitem nodes should have an accessible name'
  29262. },
  29263. 'aria-valid-attr-value': {
  29264. description: 'Ensure all ARIA attributes have valid values',
  29265. help: 'ARIA attributes must conform to valid values'
  29266. },
  29267. 'aria-valid-attr': {
  29268. description: 'Ensure attributes that begin with aria- are valid ARIA attributes',
  29269. help: 'ARIA attributes must conform to valid names'
  29270. },
  29271. 'audio-caption': {
  29272. description: 'Ensure <audio> elements have captions',
  29273. help: '<audio> elements must have a captions track'
  29274. },
  29275. 'autocomplete-valid': {
  29276. description: 'Ensure the autocomplete attribute is correct and suitable for the form field',
  29277. help: 'autocomplete attribute must be used correctly'
  29278. },
  29279. 'avoid-inline-spacing': {
  29280. description: 'Ensure that text spacing set through style attributes can be adjusted with custom stylesheets',
  29281. help: 'Inline text spacing must be adjustable with custom stylesheets'
  29282. },
  29283. blink: {
  29284. description: 'Ensure <blink> elements are not used',
  29285. help: '<blink> elements are deprecated and must not be used'
  29286. },
  29287. 'button-name': {
  29288. description: 'Ensure buttons have discernible text',
  29289. help: 'Buttons must have discernible text'
  29290. },
  29291. bypass: {
  29292. description: 'Ensure each page has at least one mechanism for a user to bypass navigation and jump straight to the content',
  29293. help: 'Page must have means to bypass repeated blocks'
  29294. },
  29295. 'color-contrast-enhanced': {
  29296. description: 'Ensure the contrast between foreground and background colors meets WCAG 2 AAA enhanced contrast ratio thresholds',
  29297. help: 'Elements must meet enhanced color contrast ratio thresholds'
  29298. },
  29299. 'color-contrast': {
  29300. description: 'Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds',
  29301. help: 'Elements must meet minimum color contrast ratio thresholds'
  29302. },
  29303. 'css-orientation-lock': {
  29304. description: 'Ensure content is not locked to any specific display orientation, and the content is operable in all display orientations',
  29305. help: 'CSS Media queries must not lock display orientation'
  29306. },
  29307. 'definition-list': {
  29308. description: 'Ensure <dl> elements are structured correctly',
  29309. help: '<dl> elements must only directly contain properly-ordered <dt> and <dd> groups, <script>, <template> or <div> elements'
  29310. },
  29311. dlitem: {
  29312. description: 'Ensure <dt> and <dd> elements are contained by a <dl>',
  29313. help: '<dt> and <dd> elements must be contained by a <dl>'
  29314. },
  29315. 'document-title': {
  29316. description: 'Ensure each HTML document contains a non-empty <title> element',
  29317. help: 'Documents must have <title> element to aid in navigation'
  29318. },
  29319. 'duplicate-id-active': {
  29320. description: 'Ensure every id attribute value of active elements is unique',
  29321. help: 'IDs of active elements must be unique'
  29322. },
  29323. 'duplicate-id-aria': {
  29324. description: 'Ensure every id attribute value used in ARIA and in labels is unique',
  29325. help: 'IDs used in ARIA and labels must be unique'
  29326. },
  29327. 'duplicate-id': {
  29328. description: 'Ensure every id attribute value is unique',
  29329. help: 'id attribute value must be unique'
  29330. },
  29331. 'empty-heading': {
  29332. description: 'Ensure headings have discernible text',
  29333. help: 'Headings should not be empty'
  29334. },
  29335. 'empty-table-header': {
  29336. description: 'Ensure table headers have discernible text',
  29337. help: 'Table header text should not be empty'
  29338. },
  29339. 'focus-order-semantics': {
  29340. description: 'Ensure elements in the focus order have a role appropriate for interactive content',
  29341. help: 'Elements in the focus order should have an appropriate role'
  29342. },
  29343. 'form-field-multiple-labels': {
  29344. description: 'Ensure form field does not have multiple label elements',
  29345. help: 'Form field must not have multiple label elements'
  29346. },
  29347. 'frame-focusable-content': {
  29348. description: 'Ensure <frame> and <iframe> elements with focusable content do not have tabindex=-1',
  29349. help: 'Frames with focusable content must not have tabindex=-1'
  29350. },
  29351. 'frame-tested': {
  29352. description: 'Ensure <iframe> and <frame> elements contain the axe-core script',
  29353. help: 'Frames should be tested with axe-core'
  29354. },
  29355. 'frame-title-unique': {
  29356. description: 'Ensure <iframe> and <frame> elements contain a unique title attribute',
  29357. help: 'Frames must have a unique title attribute'
  29358. },
  29359. 'frame-title': {
  29360. description: 'Ensure <iframe> and <frame> elements have an accessible name',
  29361. help: 'Frames must have an accessible name'
  29362. },
  29363. 'heading-order': {
  29364. description: 'Ensure the order of headings is semantically correct',
  29365. help: 'Heading levels should only increase by one'
  29366. },
  29367. 'hidden-content': {
  29368. description: 'Informs users about hidden content.',
  29369. help: 'Hidden content on the page should be analyzed'
  29370. },
  29371. 'html-has-lang': {
  29372. description: 'Ensure every HTML document has a lang attribute',
  29373. help: '<html> element must have a lang attribute'
  29374. },
  29375. 'html-lang-valid': {
  29376. description: 'Ensure the lang attribute of the <html> element has a valid value',
  29377. help: '<html> element must have a valid value for the lang attribute'
  29378. },
  29379. 'html-xml-lang-mismatch': {
  29380. description: 'Ensure that HTML elements with both valid lang and xml:lang attributes agree on the base language of the page',
  29381. help: 'HTML elements with lang and xml:lang must have the same base language'
  29382. },
  29383. 'identical-links-same-purpose': {
  29384. description: 'Ensure that links with the same accessible name serve a similar purpose',
  29385. help: 'Links with the same name must have a similar purpose'
  29386. },
  29387. 'image-alt': {
  29388. description: 'Ensure <img> elements have alternative text or a role of none or presentation',
  29389. help: 'Images must have alternative text'
  29390. },
  29391. 'image-redundant-alt': {
  29392. description: 'Ensure image alternative is not repeated as text',
  29393. help: 'Alternative text of images should not be repeated as text'
  29394. },
  29395. 'input-button-name': {
  29396. description: 'Ensure input buttons have discernible text',
  29397. help: 'Input buttons must have discernible text'
  29398. },
  29399. 'input-image-alt': {
  29400. description: 'Ensure <input type="image"> elements have alternative text',
  29401. help: 'Image buttons must have alternative text'
  29402. },
  29403. 'label-content-name-mismatch': {
  29404. description: 'Ensure that elements labelled through their content must have their visible text as part of their accessible name',
  29405. help: 'Elements must have their visible text as part of their accessible name'
  29406. },
  29407. 'label-title-only': {
  29408. description: 'Ensure that every form element has a visible label and is not solely labeled using hidden labels, or the title or aria-describedby attributes',
  29409. help: 'Form elements should have a visible label'
  29410. },
  29411. label: {
  29412. description: 'Ensure every form element has a label',
  29413. help: 'Form elements must have labels'
  29414. },
  29415. 'landmark-banner-is-top-level': {
  29416. description: 'Ensure the banner landmark is at top level',
  29417. help: 'Banner landmark should not be contained in another landmark'
  29418. },
  29419. 'landmark-complementary-is-top-level': {
  29420. description: 'Ensure the complementary landmark or aside is at top level',
  29421. help: 'Aside should not be contained in another landmark'
  29422. },
  29423. 'landmark-contentinfo-is-top-level': {
  29424. description: 'Ensure the contentinfo landmark is at top level',
  29425. help: 'Contentinfo landmark should not be contained in another landmark'
  29426. },
  29427. 'landmark-main-is-top-level': {
  29428. description: 'Ensure the main landmark is at top level',
  29429. help: 'Main landmark should not be contained in another landmark'
  29430. },
  29431. 'landmark-no-duplicate-banner': {
  29432. description: 'Ensure the document has at most one banner landmark',
  29433. help: 'Document should not have more than one banner landmark'
  29434. },
  29435. 'landmark-no-duplicate-contentinfo': {
  29436. description: 'Ensure the document has at most one contentinfo landmark',
  29437. help: 'Document should not have more than one contentinfo landmark'
  29438. },
  29439. 'landmark-no-duplicate-main': {
  29440. description: 'Ensure the document has at most one main landmark',
  29441. help: 'Document should not have more than one main landmark'
  29442. },
  29443. 'landmark-one-main': {
  29444. description: 'Ensure the document has a main landmark',
  29445. help: 'Document should have one main landmark'
  29446. },
  29447. 'landmark-unique': {
  29448. description: 'Ensure landmarks are unique',
  29449. help: 'Landmarks should have a unique role or role/label/title (i.e. accessible name) combination'
  29450. },
  29451. 'link-in-text-block': {
  29452. description: 'Ensure links are distinguished from surrounding text in a way that does not rely on color',
  29453. help: 'Links must be distinguishable without relying on color'
  29454. },
  29455. 'link-name': {
  29456. description: 'Ensure links have discernible text',
  29457. help: 'Links must have discernible text'
  29458. },
  29459. list: {
  29460. description: 'Ensure that lists are structured correctly',
  29461. help: '<ul> and <ol> must only directly contain <li>, <script> or <template> elements'
  29462. },
  29463. listitem: {
  29464. description: 'Ensure <li> elements are used semantically',
  29465. help: '<li> elements must be contained in a <ul> or <ol>'
  29466. },
  29467. marquee: {
  29468. description: 'Ensure <marquee> elements are not used',
  29469. help: '<marquee> elements are deprecated and must not be used'
  29470. },
  29471. 'meta-refresh-no-exceptions': {
  29472. description: 'Ensure <meta http-equiv="refresh"> is not used for delayed refresh',
  29473. help: 'Delayed refresh must not be used'
  29474. },
  29475. 'meta-refresh': {
  29476. description: 'Ensure <meta http-equiv="refresh"> is not used for delayed refresh',
  29477. help: 'Delayed refresh under 20 hours must not be used'
  29478. },
  29479. 'meta-viewport-large': {
  29480. description: 'Ensure <meta name="viewport"> can scale a significant amount',
  29481. help: 'Users should be able to zoom and scale the text up to 500%'
  29482. },
  29483. 'meta-viewport': {
  29484. description: 'Ensure <meta name="viewport"> does not disable text scaling and zooming',
  29485. help: 'Zooming and scaling must not be disabled'
  29486. },
  29487. 'nested-interactive': {
  29488. description: 'Ensure interactive controls are not nested as they are not always announced by screen readers or can cause focus problems for assistive technologies',
  29489. help: 'Interactive controls must not be nested'
  29490. },
  29491. 'no-autoplay-audio': {
  29492. description: 'Ensure <video> or <audio> elements do not autoplay audio for more than 3 seconds without a control mechanism to stop or mute the audio',
  29493. help: '<video> or <audio> elements must not play automatically'
  29494. },
  29495. 'object-alt': {
  29496. description: 'Ensure <object> elements have alternative text',
  29497. help: '<object> elements must have alternative text'
  29498. },
  29499. 'p-as-heading': {
  29500. description: 'Ensure bold, italic text and font-size is not used to style <p> elements as a heading',
  29501. help: 'Styled <p> elements must not be used as headings'
  29502. },
  29503. 'page-has-heading-one': {
  29504. description: 'Ensure that the page, or at least one of its frames contains a level-one heading',
  29505. help: 'Page should contain a level-one heading'
  29506. },
  29507. 'presentation-role-conflict': {
  29508. description: 'Elements marked as presentational should not have global ARIA or tabindex to ensure all screen readers ignore them',
  29509. help: 'Ensure elements marked as presentational are consistently ignored'
  29510. },
  29511. region: {
  29512. description: 'Ensure all page content is contained by landmarks',
  29513. help: 'All page content should be contained by landmarks'
  29514. },
  29515. 'role-img-alt': {
  29516. description: 'Ensure [role="img"] elements have alternative text',
  29517. help: '[role="img"] elements must have an alternative text'
  29518. },
  29519. 'scope-attr-valid': {
  29520. description: 'Ensure the scope attribute is used correctly on tables',
  29521. help: 'scope attribute should be used correctly'
  29522. },
  29523. 'scrollable-region-focusable': {
  29524. description: 'Ensure elements that have scrollable content are accessible by keyboard',
  29525. help: 'Scrollable region must have keyboard access'
  29526. },
  29527. 'select-name': {
  29528. description: 'Ensure select element has an accessible name',
  29529. help: 'Select element must have an accessible name'
  29530. },
  29531. 'server-side-image-map': {
  29532. description: 'Ensure that server-side image maps are not used',
  29533. help: 'Server-side image maps must not be used'
  29534. },
  29535. 'skip-link': {
  29536. description: 'Ensure all skip links have a focusable target',
  29537. help: 'The skip-link target should exist and be focusable'
  29538. },
  29539. 'summary-name': {
  29540. description: 'Ensure summary elements have discernible text',
  29541. help: 'Summary elements must have discernible text'
  29542. },
  29543. 'svg-img-alt': {
  29544. description: 'Ensure <svg> elements with an img, graphics-document or graphics-symbol role have an accessible text',
  29545. help: '<svg> elements with an img role must have an alternative text'
  29546. },
  29547. tabindex: {
  29548. description: 'Ensure tabindex attribute values are not greater than 0',
  29549. help: 'Elements should not have tabindex greater than zero'
  29550. },
  29551. 'table-duplicate-name': {
  29552. description: 'Ensure the <caption> element does not contain the same text as the summary attribute',
  29553. help: 'Tables should not have the same summary and caption'
  29554. },
  29555. 'table-fake-caption': {
  29556. description: 'Ensure that tables with a caption use the <caption> element.',
  29557. help: 'Data or header cells must not be used to give caption to a data table.'
  29558. },
  29559. 'target-size': {
  29560. description: 'Ensure touch targets have sufficient size and space',
  29561. help: 'All touch targets must be 24px large, or leave sufficient space'
  29562. },
  29563. 'td-has-header': {
  29564. description: 'Ensure that each non-empty data cell in a <table> larger than 3 by 3 has one or more table headers',
  29565. help: 'Non-empty <td> elements in larger <table> must have an associated table header'
  29566. },
  29567. 'td-headers-attr': {
  29568. description: 'Ensure that each cell in a table that uses the headers attribute refers only to other cells in that table',
  29569. help: 'Table cells that use the headers attribute must only refer to cells in the same table'
  29570. },
  29571. 'th-has-data-cells': {
  29572. description: 'Ensure that <th> elements and elements with role=columnheader/rowheader have data cells they describe',
  29573. help: 'Table headers in a data table must refer to data cells'
  29574. },
  29575. 'valid-lang': {
  29576. description: 'Ensure lang attributes have valid values',
  29577. help: 'lang attribute must have a valid value'
  29578. },
  29579. 'video-caption': {
  29580. description: 'Ensure <video> elements have captions',
  29581. help: '<video> elements must have captions'
  29582. }
  29583. },
  29584. checks: {
  29585. abstractrole: {
  29586. impact: 'serious',
  29587. messages: {
  29588. pass: 'Abstract roles are not used',
  29589. fail: {
  29590. singular: 'Abstract role cannot be directly used: ${data.values}',
  29591. plural: 'Abstract roles cannot be directly used: ${data.values}'
  29592. }
  29593. }
  29594. },
  29595. 'aria-allowed-attr': {
  29596. impact: 'critical',
  29597. messages: {
  29598. pass: 'ARIA attributes are used correctly for the defined role',
  29599. fail: {
  29600. singular: 'ARIA attribute is not allowed: ${data.values}',
  29601. plural: 'ARIA attributes are not allowed: ${data.values}'
  29602. },
  29603. incomplete: 'Check that there is no problem if the ARIA attribute is ignored on this element: ${data.values}'
  29604. }
  29605. },
  29606. 'aria-allowed-role': {
  29607. impact: 'minor',
  29608. messages: {
  29609. pass: 'ARIA role is allowed for given element',
  29610. fail: {
  29611. singular: 'ARIA role ${data.values} is not allowed for given element',
  29612. plural: 'ARIA roles ${data.values} are not allowed for given element'
  29613. },
  29614. incomplete: {
  29615. singular: 'ARIA role ${data.values} must be removed when the element is made visible, as it is not allowed for the element',
  29616. plural: 'ARIA roles ${data.values} must be removed when the element is made visible, as they are not allowed for the element'
  29617. }
  29618. }
  29619. },
  29620. 'aria-busy': {
  29621. impact: 'serious',
  29622. messages: {
  29623. pass: 'Element has an aria-busy attribute',
  29624. fail: 'Element uses aria-busy="true" while showing a loader'
  29625. }
  29626. },
  29627. 'aria-conditional-attr': {
  29628. impact: 'serious',
  29629. messages: {
  29630. pass: 'ARIA attribute is allowed',
  29631. fail: {
  29632. checkbox: 'Remove aria-checked, or set it to "${data.checkState}" to match the real checkbox state',
  29633. rowSingular: 'This attribute is supported with treegrid rows, but not ${data.ownerRole}: ${data.invalidAttrs}',
  29634. rowPlural: 'These attributes are supported with treegrid rows, but not ${data.ownerRole}: ${data.invalidAttrs}'
  29635. }
  29636. }
  29637. },
  29638. 'aria-errormessage': {
  29639. impact: 'critical',
  29640. messages: {
  29641. pass: 'aria-errormessage exists and references elements visible to screen readers that use a supported aria-errormessage technique',
  29642. fail: {
  29643. singular: 'aria-errormessage value `${data.values}` must use a technique to announce the message (e.g., aria-live, aria-describedby, role=alert, etc.)',
  29644. plural: 'aria-errormessage values `${data.values}` must use a technique to announce the message (e.g., aria-live, aria-describedby, role=alert, etc.)',
  29645. hidden: 'aria-errormessage value `${data.values}` cannot reference a hidden element'
  29646. },
  29647. incomplete: {
  29648. singular: 'Ensure aria-errormessage value `${data.values}` references an existing element',
  29649. plural: 'Ensure aria-errormessage values `${data.values}` reference existing elements',
  29650. idrefs: 'Unable to determine if aria-errormessage element exists on the page: ${data.values}'
  29651. }
  29652. }
  29653. },
  29654. 'aria-hidden-body': {
  29655. impact: 'critical',
  29656. messages: {
  29657. pass: 'No aria-hidden attribute is present on document body',
  29658. fail: 'aria-hidden=true should not be present on the document body'
  29659. }
  29660. },
  29661. 'aria-level': {
  29662. impact: 'serious',
  29663. messages: {
  29664. pass: 'aria-level values are valid',
  29665. incomplete: 'aria-level values greater than 6 are not supported in all screenreader and browser combinations'
  29666. }
  29667. },
  29668. 'aria-prohibited-attr': {
  29669. impact: 'serious',
  29670. messages: {
  29671. pass: 'ARIA attribute is allowed',
  29672. fail: {
  29673. hasRolePlural: '${data.prohibited} attributes cannot be used with role "${data.role}".',
  29674. hasRoleSingular: '${data.prohibited} attribute cannot be used with role "${data.role}".',
  29675. noRolePlural: '${data.prohibited} attributes cannot be used on a ${data.nodeName} with no valid role attribute.',
  29676. noRoleSingular: '${data.prohibited} attribute cannot be used on a ${data.nodeName} with no valid role attribute.'
  29677. },
  29678. incomplete: {
  29679. hasRoleSingular: '${data.prohibited} attribute is not well supported with role "${data.role}".',
  29680. hasRolePlural: '${data.prohibited} attributes are not well supported with role "${data.role}".',
  29681. noRoleSingular: '${data.prohibited} attribute is not well supported on a ${data.nodeName} with no valid role attribute.',
  29682. noRolePlural: '${data.prohibited} attributes are not well supported on a ${data.nodeName} with no valid role attribute.'
  29683. }
  29684. }
  29685. },
  29686. 'aria-required-attr': {
  29687. impact: 'critical',
  29688. messages: {
  29689. pass: 'All required ARIA attributes are present',
  29690. fail: {
  29691. singular: 'Required ARIA attribute not present: ${data.values}',
  29692. plural: 'Required ARIA attributes not present: ${data.values}'
  29693. }
  29694. }
  29695. },
  29696. 'aria-required-children': {
  29697. impact: 'critical',
  29698. messages: {
  29699. pass: {
  29700. default: 'Required ARIA children are present',
  29701. 'aria-busy': 'Element has an aria-busy attribute, so it is allowed to omit required children'
  29702. },
  29703. fail: {
  29704. singular: 'Required ARIA child role not present: ${data.values}',
  29705. plural: 'Required ARIA children role not present: ${data.values}',
  29706. unallowed: 'Element has children which are not allowed: ${data.values}'
  29707. },
  29708. incomplete: {
  29709. singular: 'Expecting ARIA child role to be added: ${data.values}',
  29710. plural: 'Expecting ARIA children role to be added: ${data.values}'
  29711. }
  29712. }
  29713. },
  29714. 'aria-required-parent': {
  29715. impact: 'critical',
  29716. messages: {
  29717. pass: 'Required ARIA parent role present',
  29718. fail: {
  29719. singular: 'Required ARIA parent role not present: ${data.values}',
  29720. plural: 'Required ARIA parents role not present: ${data.values}'
  29721. }
  29722. }
  29723. },
  29724. 'aria-roledescription': {
  29725. impact: 'serious',
  29726. messages: {
  29727. pass: 'aria-roledescription used on a supported semantic role',
  29728. incomplete: 'Check that the aria-roledescription is announced by supported screen readers',
  29729. fail: 'Give the element a role that supports aria-roledescription'
  29730. }
  29731. },
  29732. 'aria-unsupported-attr': {
  29733. impact: 'critical',
  29734. messages: {
  29735. pass: 'ARIA attribute is supported',
  29736. fail: 'ARIA attribute is not widely supported in screen readers and assistive technologies: ${data.values}'
  29737. }
  29738. },
  29739. 'aria-valid-attr-value': {
  29740. impact: 'critical',
  29741. messages: {
  29742. pass: 'ARIA attribute values are valid',
  29743. fail: {
  29744. singular: 'Invalid ARIA attribute value: ${data.values}',
  29745. plural: 'Invalid ARIA attribute values: ${data.values}'
  29746. },
  29747. incomplete: {
  29748. noId: 'ARIA attribute element ID does not exist on the page: ${data.needsReview}',
  29749. noIdShadow: 'ARIA attribute element ID does not exist on the page or is a descendant of a different shadow DOM tree: ${data.needsReview}',
  29750. ariaCurrent: 'ARIA attribute value is invalid and will be treated as "aria-current=true": ${data.needsReview}',
  29751. idrefs: 'Unable to determine if ARIA attribute element ID exists on the page: ${data.needsReview}',
  29752. empty: 'ARIA attribute value is ignored while empty: ${data.needsReview}',
  29753. controlsWithinPopup: 'Unable to determine if aria-controls referenced ID exists on the page while using aria-haspopup: ${data.needsReview}'
  29754. }
  29755. }
  29756. },
  29757. 'aria-valid-attr': {
  29758. impact: 'critical',
  29759. messages: {
  29760. pass: 'ARIA attribute name is valid',
  29761. fail: {
  29762. singular: 'Invalid ARIA attribute name: ${data.values}',
  29763. plural: 'Invalid ARIA attribute names: ${data.values}'
  29764. }
  29765. }
  29766. },
  29767. 'braille-label-equivalent': {
  29768. impact: 'serious',
  29769. messages: {
  29770. pass: 'aria-braillelabel is used on an element with accessible text',
  29771. fail: 'aria-braillelabel is used on an element with no accessible text',
  29772. incomplete: 'Unable to compute accessible text'
  29773. }
  29774. },
  29775. 'braille-roledescription-equivalent': {
  29776. impact: 'serious',
  29777. messages: {
  29778. pass: 'aria-brailleroledescription is used on an element with aria-roledescription',
  29779. fail: {
  29780. noRoleDescription: 'aria-brailleroledescription is used on an element with no aria-roledescription',
  29781. emptyRoleDescription: 'aria-brailleroledescription is used on an element with an empty aria-roledescription'
  29782. }
  29783. }
  29784. },
  29785. deprecatedrole: {
  29786. impact: 'minor',
  29787. messages: {
  29788. pass: 'ARIA role is not deprecated',
  29789. fail: 'The role used is deprecated: ${data}'
  29790. }
  29791. },
  29792. fallbackrole: {
  29793. impact: 'serious',
  29794. messages: {
  29795. pass: 'Only one role value used',
  29796. fail: 'Use only one role value, since fallback roles are not supported in older browsers',
  29797. incomplete: 'Use only role \'presentation\' or \'none\' since they are synonymous.'
  29798. }
  29799. },
  29800. 'has-global-aria-attribute': {
  29801. impact: 'minor',
  29802. messages: {
  29803. pass: {
  29804. singular: 'Element has global ARIA attribute: ${data.values}',
  29805. plural: 'Element has global ARIA attributes: ${data.values}'
  29806. },
  29807. fail: 'Element does not have global ARIA attribute'
  29808. }
  29809. },
  29810. 'has-widget-role': {
  29811. impact: 'minor',
  29812. messages: {
  29813. pass: 'Element has a widget role.',
  29814. fail: 'Element does not have a widget role.'
  29815. }
  29816. },
  29817. invalidrole: {
  29818. impact: 'critical',
  29819. messages: {
  29820. pass: 'ARIA role is valid',
  29821. fail: {
  29822. singular: 'Role must be one of the valid ARIA roles: ${data.values}',
  29823. plural: 'Roles must be one of the valid ARIA roles: ${data.values}'
  29824. }
  29825. }
  29826. },
  29827. 'is-element-focusable': {
  29828. impact: 'minor',
  29829. messages: {
  29830. pass: 'Element is focusable.',
  29831. fail: 'Element is not focusable.'
  29832. }
  29833. },
  29834. 'no-implicit-explicit-label': {
  29835. impact: 'serious',
  29836. messages: {
  29837. pass: 'There is no mismatch between a <label> and accessible name',
  29838. incomplete: 'Check that the <label> does not need be part of the ARIA ${data} field\'s name'
  29839. }
  29840. },
  29841. unsupportedrole: {
  29842. impact: 'critical',
  29843. messages: {
  29844. pass: 'ARIA role is supported',
  29845. fail: 'The role used is not widely supported in screen readers and assistive technologies: ${data}'
  29846. }
  29847. },
  29848. 'valid-scrollable-semantics': {
  29849. impact: 'minor',
  29850. messages: {
  29851. pass: 'Element has valid semantics for an element in the focus order.',
  29852. fail: 'Element has invalid semantics for an element in the focus order.'
  29853. }
  29854. },
  29855. 'color-contrast-enhanced': {
  29856. impact: 'serious',
  29857. messages: {
  29858. pass: 'Element has sufficient color contrast of ${data.contrastRatio}',
  29859. fail: {
  29860. default: 'Element has insufficient color contrast of ${data.contrastRatio} (foreground color: ${data.fgColor}, background color: ${data.bgColor}, font size: ${data.fontSize}, font weight: ${data.fontWeight}). Expected contrast ratio of ${data.expectedContrastRatio}',
  29861. fgOnShadowColor: 'Element has insufficient color contrast of ${data.contrastRatio} between the foreground and shadow color (foreground color: ${data.fgColor}, text-shadow color: ${data.shadowColor}, font size: ${data.fontSize}, font weight: ${data.fontWeight}). Expected contrast ratio of ${data.expectedContrastRatio}',
  29862. shadowOnBgColor: 'Element has insufficient color contrast of ${data.contrastRatio} between the shadow color and background color (text-shadow color: ${data.shadowColor}, background color: ${data.bgColor}, font size: ${data.fontSize}, font weight: ${data.fontWeight}). Expected contrast ratio of ${data.expectedContrastRatio}'
  29863. },
  29864. incomplete: {
  29865. default: 'Unable to determine contrast ratio',
  29866. bgImage: 'Element\'s background color could not be determined due to a background image',
  29867. bgGradient: 'Element\'s background color could not be determined due to a background gradient',
  29868. imgNode: 'Element\'s background color could not be determined because element contains an image node',
  29869. bgOverlap: 'Element\'s background color could not be determined because it is overlapped by another element',
  29870. fgAlpha: 'Element\'s foreground color could not be determined because of alpha transparency',
  29871. elmPartiallyObscured: 'Element\'s background color could not be determined because it\'s partially obscured by another element',
  29872. elmPartiallyObscuring: 'Element\'s background color could not be determined because it partially overlaps other elements',
  29873. outsideViewport: 'Element\'s background color could not be determined because it\'s outside the viewport',
  29874. equalRatio: 'Element has a 1:1 contrast ratio with the background',
  29875. shortTextContent: 'Element content is too short to determine if it is actual text content',
  29876. nonBmp: 'Element content contains only non-text characters',
  29877. pseudoContent: 'Element\'s background color could not be determined due to a pseudo element'
  29878. }
  29879. }
  29880. },
  29881. 'color-contrast': {
  29882. impact: 'serious',
  29883. messages: {
  29884. pass: {
  29885. default: 'Element has sufficient color contrast of ${data.contrastRatio}',
  29886. hidden: 'Element is hidden'
  29887. },
  29888. fail: {
  29889. default: 'Element has insufficient color contrast of ${data.contrastRatio} (foreground color: ${data.fgColor}, background color: ${data.bgColor}, font size: ${data.fontSize}, font weight: ${data.fontWeight}). Expected contrast ratio of ${data.expectedContrastRatio}',
  29890. fgOnShadowColor: 'Element has insufficient color contrast of ${data.contrastRatio} between the foreground and shadow color (foreground color: ${data.fgColor}, text-shadow color: ${data.shadowColor}, font size: ${data.fontSize}, font weight: ${data.fontWeight}). Expected contrast ratio of ${data.expectedContrastRatio}',
  29891. shadowOnBgColor: 'Element has insufficient color contrast of ${data.contrastRatio} between the shadow color and background color (text-shadow color: ${data.shadowColor}, background color: ${data.bgColor}, font size: ${data.fontSize}, font weight: ${data.fontWeight}). Expected contrast ratio of ${data.expectedContrastRatio}'
  29892. },
  29893. incomplete: {
  29894. default: 'Unable to determine contrast ratio',
  29895. bgImage: 'Element\'s background color could not be determined due to a background image',
  29896. bgGradient: 'Element\'s background color could not be determined due to a background gradient',
  29897. imgNode: 'Element\'s background color could not be determined because element contains an image node',
  29898. bgOverlap: 'Element\'s background color could not be determined because it is overlapped by another element',
  29899. complexTextShadows: 'Element\'s contrast could not be determined because it uses complex text shadows',
  29900. fgAlpha: 'Element\'s foreground color could not be determined because of alpha transparency',
  29901. elmPartiallyObscured: 'Element\'s background color could not be determined because it\'s partially obscured by another element',
  29902. elmPartiallyObscuring: 'Element\'s background color could not be determined because it partially overlaps other elements',
  29903. outsideViewport: 'Element\'s background color could not be determined because it\'s outside the viewport',
  29904. equalRatio: 'Element has a 1:1 contrast ratio with the background',
  29905. shortTextContent: 'Element content is too short to determine if it is actual text content',
  29906. nonBmp: 'Element content contains only non-text characters',
  29907. pseudoContent: 'Element\'s background color could not be determined due to a pseudo element'
  29908. }
  29909. }
  29910. },
  29911. 'link-in-text-block-style': {
  29912. impact: 'serious',
  29913. messages: {
  29914. pass: 'Links can be distinguished from surrounding text by visual styling',
  29915. incomplete: {
  29916. default: 'Check if the link needs styling to distinguish it from nearby text',
  29917. pseudoContent: 'Check if the link\'s pseudo style is sufficient to distinguish it from the surrounding text'
  29918. },
  29919. fail: 'The link has no styling (such as underline) to distinguish it from the surrounding text'
  29920. }
  29921. },
  29922. 'link-in-text-block': {
  29923. impact: 'serious',
  29924. messages: {
  29925. pass: 'Links can be distinguished from surrounding text in some way other than by color',
  29926. fail: {
  29927. fgContrast: 'The link has insufficient color contrast of ${data.contrastRatio}:1 with the surrounding text. (Minimum contrast is ${data.requiredContrastRatio}:1, link text: ${data.nodeColor}, surrounding text: ${data.parentColor})',
  29928. bgContrast: 'The link background has insufficient color contrast of ${data.contrastRatio} (Minimum contrast is ${data.requiredContrastRatio}:1, link background color: ${data.nodeBackgroundColor}, surrounding background color: ${data.parentBackgroundColor})'
  29929. },
  29930. incomplete: {
  29931. default: 'Element\'s foreground contrast ratio could not be determined',
  29932. bgContrast: 'Element\'s background contrast ratio could not be determined',
  29933. bgImage: 'Element\'s contrast ratio could not be determined due to a background image',
  29934. bgGradient: 'Element\'s contrast ratio could not be determined due to a background gradient',
  29935. imgNode: 'Element\'s contrast ratio could not be determined because element contains an image node',
  29936. bgOverlap: 'Element\'s contrast ratio could not be determined because of element overlap'
  29937. }
  29938. }
  29939. },
  29940. 'autocomplete-appropriate': {
  29941. impact: 'serious',
  29942. messages: {
  29943. pass: 'The autocomplete value is on an appropriate element',
  29944. fail: 'The autocomplete value is inappropriate for this type of input'
  29945. }
  29946. },
  29947. 'autocomplete-valid': {
  29948. impact: 'serious',
  29949. messages: {
  29950. pass: 'the autocomplete attribute is correctly formatted',
  29951. fail: 'the autocomplete attribute is incorrectly formatted',
  29952. incomplete: 'the autocomplete attribute has a non-standard value. Check whether any standard value could be used instead.'
  29953. }
  29954. },
  29955. accesskeys: {
  29956. impact: 'serious',
  29957. messages: {
  29958. pass: 'Accesskey attribute value is unique',
  29959. fail: 'Document has multiple elements with the same accesskey'
  29960. }
  29961. },
  29962. 'focusable-content': {
  29963. impact: 'serious',
  29964. messages: {
  29965. pass: 'Element contains focusable elements',
  29966. fail: 'Element should have focusable content'
  29967. }
  29968. },
  29969. 'focusable-disabled': {
  29970. impact: 'serious',
  29971. messages: {
  29972. pass: 'No focusable elements contained within element',
  29973. incomplete: 'Check if the focusable elements immediately move the focus indicator',
  29974. fail: 'Focusable content should be disabled or be removed from the DOM'
  29975. }
  29976. },
  29977. 'focusable-element': {
  29978. impact: 'serious',
  29979. messages: {
  29980. pass: 'Element is focusable',
  29981. fail: 'Element should be focusable'
  29982. }
  29983. },
  29984. 'focusable-modal-open': {
  29985. impact: 'serious',
  29986. messages: {
  29987. pass: 'No focusable elements while a modal is open',
  29988. incomplete: 'Check that focusable elements are not tabbable in the current state'
  29989. }
  29990. },
  29991. 'focusable-no-name': {
  29992. impact: 'serious',
  29993. messages: {
  29994. pass: 'Element is not in tab order or has accessible text',
  29995. fail: 'Element is in tab order and does not have accessible text',
  29996. incomplete: 'Unable to determine if element has an accessible name'
  29997. }
  29998. },
  29999. 'focusable-not-tabbable': {
  30000. impact: 'serious',
  30001. messages: {
  30002. pass: 'No focusable elements contained within element',
  30003. incomplete: 'Check if the focusable elements immediately move the focus indicator',
  30004. fail: 'Focusable content should have tabindex="-1" or be removed from the DOM'
  30005. }
  30006. },
  30007. 'frame-focusable-content': {
  30008. impact: 'serious',
  30009. messages: {
  30010. pass: 'Element does not have focusable descendants',
  30011. fail: 'Element has focusable descendants',
  30012. incomplete: 'Could not determine if element has descendants'
  30013. }
  30014. },
  30015. 'landmark-is-top-level': {
  30016. impact: 'moderate',
  30017. messages: {
  30018. pass: 'The ${data.role} landmark is at the top level.',
  30019. fail: 'The ${data.role} landmark is contained in another landmark.'
  30020. }
  30021. },
  30022. 'no-focusable-content': {
  30023. impact: 'serious',
  30024. messages: {
  30025. pass: 'Element does not have focusable descendants',
  30026. fail: {
  30027. default: 'Element has focusable descendants',
  30028. notHidden: 'Using a negative tabindex on an element inside an interactive control does not prevent assistive technologies from focusing the element (even with aria-hidden="true")'
  30029. },
  30030. incomplete: 'Could not determine if element has descendants'
  30031. }
  30032. },
  30033. 'page-has-heading-one': {
  30034. impact: 'moderate',
  30035. messages: {
  30036. pass: 'Page has at least one level-one heading',
  30037. fail: 'Page must have a level-one heading'
  30038. }
  30039. },
  30040. 'page-has-main': {
  30041. impact: 'moderate',
  30042. messages: {
  30043. pass: 'Document has at least one main landmark',
  30044. fail: 'Document does not have a main landmark'
  30045. }
  30046. },
  30047. 'page-no-duplicate-banner': {
  30048. impact: 'moderate',
  30049. messages: {
  30050. pass: 'Document does not have more than one banner landmark',
  30051. fail: 'Document has more than one banner landmark'
  30052. }
  30053. },
  30054. 'page-no-duplicate-contentinfo': {
  30055. impact: 'moderate',
  30056. messages: {
  30057. pass: 'Document does not have more than one contentinfo landmark',
  30058. fail: 'Document has more than one contentinfo landmark'
  30059. }
  30060. },
  30061. 'page-no-duplicate-main': {
  30062. impact: 'moderate',
  30063. messages: {
  30064. pass: 'Document does not have more than one main landmark',
  30065. fail: 'Document has more than one main landmark'
  30066. }
  30067. },
  30068. tabindex: {
  30069. impact: 'serious',
  30070. messages: {
  30071. pass: 'Element does not have a tabindex greater than 0',
  30072. fail: 'Element has a tabindex greater than 0'
  30073. }
  30074. },
  30075. 'alt-space-value': {
  30076. impact: 'critical',
  30077. messages: {
  30078. pass: 'Element has a valid alt attribute value',
  30079. fail: 'Element has an alt attribute containing only a space character, which is not ignored by all screen readers'
  30080. }
  30081. },
  30082. 'duplicate-img-label': {
  30083. impact: 'minor',
  30084. messages: {
  30085. pass: 'Element does not duplicate existing text in <img> alt text',
  30086. fail: 'Element contains <img> element with alt text that duplicates existing text'
  30087. }
  30088. },
  30089. 'explicit-label': {
  30090. impact: 'critical',
  30091. messages: {
  30092. pass: 'Element has an explicit <label>',
  30093. fail: 'Element does not have an explicit <label>',
  30094. incomplete: 'Unable to determine if form element has an explicit <label>'
  30095. }
  30096. },
  30097. 'help-same-as-label': {
  30098. impact: 'minor',
  30099. messages: {
  30100. pass: 'Help text (title or aria-describedby) does not duplicate label text',
  30101. fail: 'Help text (title or aria-describedby) text is the same as the label text'
  30102. }
  30103. },
  30104. 'hidden-explicit-label': {
  30105. impact: 'critical',
  30106. messages: {
  30107. pass: 'Form element has a visible explicit <label>',
  30108. fail: 'Form element has explicit <label> that is hidden',
  30109. incomplete: 'Unable to determine if form element has explicit <label> that is hidden'
  30110. }
  30111. },
  30112. 'implicit-label': {
  30113. impact: 'critical',
  30114. messages: {
  30115. pass: 'Element has an implicit (wrapped) <label>',
  30116. fail: 'Element does not have an implicit (wrapped) <label>',
  30117. incomplete: 'Unable to determine if form element has an implicit (wrapped) <label>'
  30118. }
  30119. },
  30120. 'label-content-name-mismatch': {
  30121. impact: 'serious',
  30122. messages: {
  30123. pass: 'Element contains visible text as part of it\'s accessible name',
  30124. fail: 'Text inside the element is not included in the accessible name'
  30125. }
  30126. },
  30127. 'multiple-label': {
  30128. impact: 'moderate',
  30129. messages: {
  30130. pass: 'Form field does not have multiple label elements',
  30131. incomplete: 'Multiple label elements is not widely supported in assistive technologies. Ensure the first label contains all necessary information.'
  30132. }
  30133. },
  30134. 'title-only': {
  30135. impact: 'serious',
  30136. messages: {
  30137. pass: 'Form element does not solely use title attribute for its label',
  30138. fail: 'Only title used to generate label for form element'
  30139. }
  30140. },
  30141. 'landmark-is-unique': {
  30142. impact: 'moderate',
  30143. messages: {
  30144. pass: 'Landmarks must have a unique role or role/label/title (i.e. accessible name) combination',
  30145. fail: 'The landmark must have a unique aria-label, aria-labelledby, or title to make landmarks distinguishable'
  30146. }
  30147. },
  30148. 'has-lang': {
  30149. impact: 'serious',
  30150. messages: {
  30151. pass: 'The <html> element has a lang attribute',
  30152. fail: {
  30153. noXHTML: 'The xml:lang attribute is not valid on HTML pages, use the lang attribute.',
  30154. noLang: 'The <html> element does not have a lang attribute'
  30155. }
  30156. }
  30157. },
  30158. 'valid-lang': {
  30159. impact: 'serious',
  30160. messages: {
  30161. pass: 'Value of lang attribute is included in the list of valid languages',
  30162. fail: 'Value of lang attribute not included in the list of valid languages'
  30163. }
  30164. },
  30165. 'xml-lang-mismatch': {
  30166. impact: 'moderate',
  30167. messages: {
  30168. pass: 'Lang and xml:lang attributes have the same base language',
  30169. fail: 'Lang and xml:lang attributes do not have the same base language'
  30170. }
  30171. },
  30172. dlitem: {
  30173. impact: 'serious',
  30174. messages: {
  30175. pass: 'Description list item has a <dl> parent element',
  30176. fail: 'Description list item does not have a <dl> parent element'
  30177. }
  30178. },
  30179. listitem: {
  30180. impact: 'serious',
  30181. messages: {
  30182. pass: 'List item has a <ul>, <ol> or role="list" parent element',
  30183. fail: {
  30184. default: 'List item does not have a <ul>, <ol> parent element',
  30185. roleNotValid: 'List item parent element has a role that is not role="list"'
  30186. }
  30187. }
  30188. },
  30189. 'only-dlitems': {
  30190. impact: 'serious',
  30191. messages: {
  30192. pass: 'dl element only has direct children that are allowed inside; <dt>, <dd>, or <div> elements',
  30193. fail: 'dl element has direct children that are not allowed: ${data.values}'
  30194. }
  30195. },
  30196. 'only-listitems': {
  30197. impact: 'serious',
  30198. messages: {
  30199. pass: 'List element only has direct children that are allowed inside <li> elements',
  30200. fail: 'List element has direct children that are not allowed: ${data.values}'
  30201. }
  30202. },
  30203. 'structured-dlitems': {
  30204. impact: 'serious',
  30205. messages: {
  30206. pass: 'When not empty, element has both <dt> and <dd> elements',
  30207. fail: 'When not empty, element does not have at least one <dt> element followed by at least one <dd> element'
  30208. }
  30209. },
  30210. caption: {
  30211. impact: 'critical',
  30212. messages: {
  30213. pass: 'The multimedia element has a captions track',
  30214. incomplete: 'Check that captions are available for the element'
  30215. }
  30216. },
  30217. 'frame-tested': {
  30218. impact: 'critical',
  30219. messages: {
  30220. pass: 'The iframe was tested with axe-core',
  30221. fail: 'The iframe could not be tested with axe-core',
  30222. incomplete: 'The iframe still has to be tested with axe-core'
  30223. }
  30224. },
  30225. 'no-autoplay-audio': {
  30226. impact: 'moderate',
  30227. messages: {
  30228. pass: '<video> or <audio> does not output audio for more than allowed duration or has controls mechanism',
  30229. fail: '<video> or <audio> outputs audio for more than allowed duration and does not have a controls mechanism',
  30230. incomplete: 'Check that the <video> or <audio> does not output audio for more than allowed duration or provides a controls mechanism'
  30231. }
  30232. },
  30233. 'css-orientation-lock': {
  30234. impact: 'serious',
  30235. messages: {
  30236. pass: 'Display is operable, and orientation lock does not exist',
  30237. fail: 'CSS Orientation lock is applied, and makes display inoperable',
  30238. incomplete: 'CSS Orientation lock cannot be determined'
  30239. }
  30240. },
  30241. 'meta-viewport-large': {
  30242. impact: 'minor',
  30243. messages: {
  30244. pass: '<meta> tag does not prevent significant zooming on mobile devices',
  30245. fail: '<meta> tag limits zooming on mobile devices'
  30246. }
  30247. },
  30248. 'meta-viewport': {
  30249. impact: 'critical',
  30250. messages: {
  30251. pass: '<meta> tag does not disable zooming on mobile devices',
  30252. fail: '${data} on <meta> tag disables zooming on mobile devices'
  30253. }
  30254. },
  30255. 'target-offset': {
  30256. impact: 'serious',
  30257. messages: {
  30258. pass: {
  30259. default: 'Target has sufficient space from its closest neighbors. Safe clickable space has a diameter of ${data.closestOffset}px which is at least ${data.minOffset}px.',
  30260. large: 'Target far exceeds the minimum size of ${data.minOffset}px.'
  30261. },
  30262. fail: 'Target has insufficient space to its closest neighbors. Safe clickable space has a diameter of ${data.closestOffset}px instead of at least ${data.minOffset}px.',
  30263. incomplete: {
  30264. default: 'Element with negative tabindex has insufficient space to its closest neighbors. Safe clickable space has a diameter of ${data.closestOffset}px instead of at least ${data.minOffset}px. Is this a target?',
  30265. nonTabbableNeighbor: 'Target has insufficient space to its closest neighbors. Safe clickable space has a diameter of ${data.closestOffset}px instead of at least ${data.minOffset}px. Is the neighbor a target?',
  30266. tooManyRects: 'Could not get the target size because there are too many overlapping elements'
  30267. }
  30268. }
  30269. },
  30270. 'target-size': {
  30271. impact: 'serious',
  30272. messages: {
  30273. pass: {
  30274. default: 'Control has sufficient size (${data.width}px by ${data.height}px, should be at least ${data.minSize}px by ${data.minSize}px)',
  30275. obscured: 'Control is ignored because it is fully obscured and thus not clickable',
  30276. large: 'Target far exceeds the minimum size of ${data.minSize}px.'
  30277. },
  30278. fail: {
  30279. default: 'Target has insufficient size (${data.width}px by ${data.height}px, should be at least ${data.minSize}px by ${data.minSize}px)',
  30280. partiallyObscured: 'Target has insufficient size because it is partially obscured (smallest space is ${data.width}px by ${data.height}px, should be at least ${data.minSize}px by ${data.minSize}px)'
  30281. },
  30282. incomplete: {
  30283. default: 'Element with negative tabindex has insufficient size (${data.width}px by ${data.height}px, should be at least ${data.minSize}px by ${data.minSize}px). Is this a target?',
  30284. contentOverflow: 'Element size could not be accurately determined due to overflow content',
  30285. partiallyObscured: 'Element with negative tabindex has insufficient size because it is partially obscured (smallest space is ${data.width}px by ${data.height}px, should be at least ${data.minSize}px by ${data.minSize}px). Is this a target?',
  30286. partiallyObscuredNonTabbable: 'Target has insufficient size because it is partially obscured by a neighbor with negative tabindex (smallest space is ${data.width}px by ${data.height}px, should be at least ${data.minSize}px by ${data.minSize}px). Is the neighbor a target?',
  30287. tooManyRects: 'Could not get the target size because there are too many overlapping elements'
  30288. }
  30289. }
  30290. },
  30291. 'header-present': {
  30292. impact: 'serious',
  30293. messages: {
  30294. pass: 'Page has a heading',
  30295. fail: 'Page does not have a heading'
  30296. }
  30297. },
  30298. 'heading-order': {
  30299. impact: 'moderate',
  30300. messages: {
  30301. pass: 'Heading order valid',
  30302. fail: 'Heading order invalid',
  30303. incomplete: 'Unable to determine previous heading'
  30304. }
  30305. },
  30306. 'identical-links-same-purpose': {
  30307. impact: 'minor',
  30308. messages: {
  30309. pass: 'There are no other links with the same name, that go to a different URL',
  30310. incomplete: 'Check that links have the same purpose, or are intentionally ambiguous.'
  30311. }
  30312. },
  30313. 'internal-link-present': {
  30314. impact: 'serious',
  30315. messages: {
  30316. pass: 'Valid skip link found',
  30317. fail: 'No valid skip link found'
  30318. }
  30319. },
  30320. landmark: {
  30321. impact: 'serious',
  30322. messages: {
  30323. pass: 'Page has a landmark region',
  30324. fail: 'Page does not have a landmark region'
  30325. }
  30326. },
  30327. 'meta-refresh-no-exceptions': {
  30328. impact: 'minor',
  30329. messages: {
  30330. pass: '<meta> tag does not immediately refresh the page',
  30331. fail: '<meta> tag forces timed refresh of page'
  30332. }
  30333. },
  30334. 'meta-refresh': {
  30335. impact: 'critical',
  30336. messages: {
  30337. pass: '<meta> tag does not immediately refresh the page',
  30338. fail: '<meta> tag forces timed refresh of page (less than 20 hours)'
  30339. }
  30340. },
  30341. 'p-as-heading': {
  30342. impact: 'serious',
  30343. messages: {
  30344. pass: '<p> elements are not styled as headings',
  30345. fail: 'Heading elements should be used instead of styled <p> elements',
  30346. incomplete: 'Unable to determine if <p> elements are styled as headings'
  30347. }
  30348. },
  30349. region: {
  30350. impact: 'moderate',
  30351. messages: {
  30352. pass: 'All page content is contained by landmarks',
  30353. fail: 'Some page content is not contained by landmarks'
  30354. }
  30355. },
  30356. 'skip-link': {
  30357. impact: 'moderate',
  30358. messages: {
  30359. pass: 'Skip link target exists',
  30360. incomplete: 'Skip link target should become visible on activation',
  30361. fail: 'No skip link target'
  30362. }
  30363. },
  30364. 'unique-frame-title': {
  30365. impact: 'serious',
  30366. messages: {
  30367. pass: 'Element\'s title attribute is unique',
  30368. fail: 'Element\'s title attribute is not unique'
  30369. }
  30370. },
  30371. 'duplicate-id-active': {
  30372. impact: 'serious',
  30373. messages: {
  30374. pass: 'Document has no active elements that share the same id attribute',
  30375. fail: 'Document has active elements with the same id attribute: ${data}'
  30376. }
  30377. },
  30378. 'duplicate-id-aria': {
  30379. impact: 'critical',
  30380. messages: {
  30381. pass: 'Document has no elements referenced with ARIA or labels that share the same id attribute',
  30382. fail: 'Document has multiple elements referenced with ARIA with the same id attribute: ${data}'
  30383. }
  30384. },
  30385. 'duplicate-id': {
  30386. impact: 'minor',
  30387. messages: {
  30388. pass: 'Document has no static elements that share the same id attribute',
  30389. fail: 'Document has multiple static elements with the same id attribute: ${data}'
  30390. }
  30391. },
  30392. 'aria-label': {
  30393. impact: 'serious',
  30394. messages: {
  30395. pass: 'aria-label attribute exists and is not empty',
  30396. fail: 'aria-label attribute does not exist or is empty'
  30397. }
  30398. },
  30399. 'aria-labelledby': {
  30400. impact: 'serious',
  30401. messages: {
  30402. pass: 'aria-labelledby attribute exists and references elements that are visible to screen readers',
  30403. fail: 'aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty',
  30404. incomplete: 'Ensure aria-labelledby references an existing element'
  30405. }
  30406. },
  30407. 'avoid-inline-spacing': {
  30408. impact: 'serious',
  30409. messages: {
  30410. pass: 'No inline styles with \'!important\' that affect text spacing has been specified',
  30411. fail: {
  30412. singular: 'Remove \'!important\' from inline style ${data.values}, as overriding this is not supported by most browsers',
  30413. plural: 'Remove \'!important\' from inline styles ${data.values}, as overriding this is not supported by most browsers'
  30414. }
  30415. }
  30416. },
  30417. 'button-has-visible-text': {
  30418. impact: 'critical',
  30419. messages: {
  30420. pass: 'Element has inner text that is visible to screen readers',
  30421. fail: 'Element does not have inner text that is visible to screen readers',
  30422. incomplete: 'Unable to determine if element has children'
  30423. }
  30424. },
  30425. 'doc-has-title': {
  30426. impact: 'serious',
  30427. messages: {
  30428. pass: 'Document has a non-empty <title> element',
  30429. fail: 'Document does not have a non-empty <title> element'
  30430. }
  30431. },
  30432. exists: {
  30433. impact: 'minor',
  30434. messages: {
  30435. pass: 'Element does not exist',
  30436. incomplete: 'Element exists'
  30437. }
  30438. },
  30439. 'has-alt': {
  30440. impact: 'critical',
  30441. messages: {
  30442. pass: 'Element has an alt attribute',
  30443. fail: 'Element does not have an alt attribute'
  30444. }
  30445. },
  30446. 'has-visible-text': {
  30447. impact: 'minor',
  30448. messages: {
  30449. pass: 'Element has text that is visible to screen readers',
  30450. fail: 'Element does not have text that is visible to screen readers',
  30451. incomplete: 'Unable to determine if element has children'
  30452. }
  30453. },
  30454. 'important-letter-spacing': {
  30455. impact: 'serious',
  30456. messages: {
  30457. pass: 'Letter-spacing in the style attribute is not set to !important, or meets the minimum',
  30458. fail: 'letter-spacing in the style attribute must not use !important, or be at ${data.minValue}em (current ${data.value}em)'
  30459. }
  30460. },
  30461. 'important-line-height': {
  30462. impact: 'serious',
  30463. messages: {
  30464. pass: 'line-height in the style attribute is not set to !important, or meets the minimum',
  30465. fail: 'line-height in the style attribute must not use !important, or be at ${data.minValue}em (current ${data.value}em)'
  30466. }
  30467. },
  30468. 'important-word-spacing': {
  30469. impact: 'serious',
  30470. messages: {
  30471. pass: 'word-spacing in the style attribute is not set to !important, or meets the minimum',
  30472. fail: 'word-spacing in the style attribute must not use !important, or be at ${data.minValue}em (current ${data.value}em)'
  30473. }
  30474. },
  30475. 'is-on-screen': {
  30476. impact: 'serious',
  30477. messages: {
  30478. pass: 'Element is not visible',
  30479. fail: 'Element is visible'
  30480. }
  30481. },
  30482. 'non-empty-alt': {
  30483. impact: 'critical',
  30484. messages: {
  30485. pass: 'Element has a non-empty alt attribute',
  30486. fail: {
  30487. noAttr: 'Element has no alt attribute',
  30488. emptyAttr: 'Element has an empty alt attribute'
  30489. }
  30490. }
  30491. },
  30492. 'non-empty-if-present': {
  30493. impact: 'critical',
  30494. messages: {
  30495. pass: {
  30496. default: 'Element does not have a value attribute',
  30497. 'has-label': 'Element has a non-empty value attribute'
  30498. },
  30499. fail: 'Element has a value attribute and the value attribute is empty'
  30500. }
  30501. },
  30502. 'non-empty-placeholder': {
  30503. impact: 'serious',
  30504. messages: {
  30505. pass: 'Element has a placeholder attribute',
  30506. fail: {
  30507. noAttr: 'Element has no placeholder attribute',
  30508. emptyAttr: 'Element has an empty placeholder attribute'
  30509. }
  30510. }
  30511. },
  30512. 'non-empty-title': {
  30513. impact: 'serious',
  30514. messages: {
  30515. pass: 'Element has a title attribute',
  30516. fail: {
  30517. noAttr: 'Element has no title attribute',
  30518. emptyAttr: 'Element has an empty title attribute'
  30519. }
  30520. }
  30521. },
  30522. 'non-empty-value': {
  30523. impact: 'critical',
  30524. messages: {
  30525. pass: 'Element has a non-empty value attribute',
  30526. fail: {
  30527. noAttr: 'Element has no value attribute',
  30528. emptyAttr: 'Element has an empty value attribute'
  30529. }
  30530. }
  30531. },
  30532. 'presentational-role': {
  30533. impact: 'minor',
  30534. messages: {
  30535. pass: 'Element\'s default semantics were overridden with role="${data.role}"',
  30536. fail: {
  30537. default: 'Element\'s default semantics were not overridden with role="none" or role="presentation"',
  30538. globalAria: 'Element\'s role is not presentational because it has a global ARIA attribute',
  30539. focusable: 'Element\'s role is not presentational because it is focusable',
  30540. both: 'Element\'s role is not presentational because it has a global ARIA attribute and is focusable',
  30541. iframe: 'Using the "title" attribute on an ${data.nodeName} element with a presentational role behaves inconsistently between screen readers'
  30542. }
  30543. }
  30544. },
  30545. 'role-none': {
  30546. impact: 'minor',
  30547. messages: {
  30548. pass: 'Element\'s default semantics were overridden with role="none"',
  30549. fail: 'Element\'s default semantics were not overridden with role="none"'
  30550. }
  30551. },
  30552. 'role-presentation': {
  30553. impact: 'minor',
  30554. messages: {
  30555. pass: 'Element\'s default semantics were overridden with role="presentation"',
  30556. fail: 'Element\'s default semantics were not overridden with role="presentation"'
  30557. }
  30558. },
  30559. 'svg-non-empty-title': {
  30560. impact: 'serious',
  30561. messages: {
  30562. pass: 'Element has a child that is a title',
  30563. fail: {
  30564. noTitle: 'Element has no child that is a title',
  30565. emptyTitle: 'Element child title is empty'
  30566. },
  30567. incomplete: 'Unable to determine element has a child that is a title'
  30568. }
  30569. },
  30570. 'caption-faked': {
  30571. impact: 'serious',
  30572. messages: {
  30573. pass: 'The first row of a table is not used as a caption',
  30574. fail: 'The first child of the table should be a caption instead of a table cell'
  30575. }
  30576. },
  30577. 'html5-scope': {
  30578. impact: 'moderate',
  30579. messages: {
  30580. pass: 'Scope attribute is only used on table header elements (<th>)',
  30581. fail: 'In HTML 5, scope attributes may only be used on table header elements (<th>)'
  30582. }
  30583. },
  30584. 'same-caption-summary': {
  30585. impact: 'minor',
  30586. messages: {
  30587. pass: 'Content of summary attribute and <caption> are not duplicated',
  30588. fail: 'Content of summary attribute and <caption> element are identical',
  30589. incomplete: 'Unable to determine if <table> element has a caption'
  30590. }
  30591. },
  30592. 'scope-value': {
  30593. impact: 'critical',
  30594. messages: {
  30595. pass: 'Scope attribute is used correctly',
  30596. fail: 'The value of the scope attribute may only be \'row\' or \'col\''
  30597. }
  30598. },
  30599. 'td-has-header': {
  30600. impact: 'critical',
  30601. messages: {
  30602. pass: 'All non-empty data cells have table headers',
  30603. fail: 'Some non-empty data cells do not have table headers'
  30604. }
  30605. },
  30606. 'td-headers-attr': {
  30607. impact: 'serious',
  30608. messages: {
  30609. pass: 'The headers attribute is exclusively used to refer to other cells in the table',
  30610. incomplete: 'The headers attribute is empty',
  30611. fail: 'The headers attribute is not exclusively used to refer to other cells in the table'
  30612. }
  30613. },
  30614. 'th-has-data-cells': {
  30615. impact: 'serious',
  30616. messages: {
  30617. pass: 'All table header cells refer to data cells',
  30618. fail: 'Not all table header cells refer to data cells',
  30619. incomplete: 'Table data cells are missing or empty'
  30620. }
  30621. },
  30622. 'hidden-content': {
  30623. impact: 'minor',
  30624. messages: {
  30625. pass: 'All content on the page has been analyzed.',
  30626. fail: 'There were problems analyzing the content on this page.',
  30627. incomplete: 'There is hidden content on the page that was not analyzed. You will need to trigger the display of this content in order to analyze it.'
  30628. }
  30629. }
  30630. },
  30631. failureSummaries: {
  30632. any: {
  30633. failureMessage: function anonymous(it) {
  30634. var out = 'Fix any of the following:';
  30635. var arr1 = it;
  30636. if (arr1) {
  30637. var value, i1 = -1, l1 = arr1.length - 1;
  30638. while (i1 < l1) {
  30639. value = arr1[i1 += 1];
  30640. out += '\n ' + value.split('\n').join('\n ');
  30641. }
  30642. }
  30643. return out;
  30644. }
  30645. },
  30646. none: {
  30647. failureMessage: function anonymous(it) {
  30648. var out = 'Fix all of the following:';
  30649. var arr1 = it;
  30650. if (arr1) {
  30651. var value, i1 = -1, l1 = arr1.length - 1;
  30652. while (i1 < l1) {
  30653. value = arr1[i1 += 1];
  30654. out += '\n ' + value.split('\n').join('\n ');
  30655. }
  30656. }
  30657. return out;
  30658. }
  30659. }
  30660. },
  30661. incompleteFallbackMessage: 'axe couldn\'t tell the reason. Time to break out the element inspector!'
  30662. },
  30663. rules: [ {
  30664. id: 'accesskeys',
  30665. impact: 'serious',
  30666. selector: '[accesskey]',
  30667. excludeHidden: false,
  30668. tags: [ 'cat.keyboard', 'best-practice' ],
  30669. all: [],
  30670. any: [],
  30671. none: [ 'accesskeys' ]
  30672. }, {
  30673. id: 'area-alt',
  30674. impact: 'critical',
  30675. selector: 'map area[href]',
  30676. excludeHidden: false,
  30677. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag244', 'wcag412', 'section508', 'section508.22.a', 'TTv5', 'TT6.a', 'EN-301-549', 'EN-9.2.4.4', 'EN-9.4.1.2', 'ACT' ],
  30678. actIds: [ 'c487ae' ],
  30679. all: [],
  30680. any: [ {
  30681. options: {
  30682. attribute: 'alt'
  30683. },
  30684. id: 'non-empty-alt'
  30685. }, 'aria-label', 'aria-labelledby', {
  30686. options: {
  30687. attribute: 'title'
  30688. },
  30689. id: 'non-empty-title'
  30690. } ],
  30691. none: []
  30692. }, {
  30693. id: 'aria-allowed-attr',
  30694. impact: 'critical',
  30695. matches: 'aria-allowed-attr-matches',
  30696. tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'EN-301-549', 'EN-9.4.1.2' ],
  30697. actIds: [ '5c01ea' ],
  30698. all: [ {
  30699. options: {
  30700. validTreeRowAttrs: [ 'aria-posinset', 'aria-setsize', 'aria-expanded', 'aria-level' ]
  30701. },
  30702. id: 'aria-allowed-attr'
  30703. } ],
  30704. any: [],
  30705. none: [ 'aria-unsupported-attr' ]
  30706. }, {
  30707. id: 'aria-allowed-role',
  30708. impact: 'minor',
  30709. excludeHidden: false,
  30710. selector: '[role]',
  30711. matches: 'aria-allowed-role-matches',
  30712. tags: [ 'cat.aria', 'best-practice' ],
  30713. all: [],
  30714. any: [ {
  30715. options: {
  30716. allowImplicit: true,
  30717. ignoredTags: []
  30718. },
  30719. id: 'aria-allowed-role'
  30720. } ],
  30721. none: []
  30722. }, {
  30723. id: 'aria-braille-equivalent',
  30724. reviewOnFail: true,
  30725. impact: 'serious',
  30726. selector: '[aria-brailleroledescription], [aria-braillelabel]',
  30727. tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'EN-301-549', 'EN-9.4.1.2' ],
  30728. all: [ 'braille-roledescription-equivalent', 'braille-label-equivalent' ],
  30729. any: [],
  30730. none: []
  30731. }, {
  30732. id: 'aria-command-name',
  30733. impact: 'serious',
  30734. selector: '[role="link"], [role="button"], [role="menuitem"]',
  30735. matches: 'no-naming-method-matches',
  30736. tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'TTv5', 'TT6.a', 'EN-301-549', 'EN-9.4.1.2', 'ACT' ],
  30737. actIds: [ '97a4e1' ],
  30738. all: [],
  30739. any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
  30740. options: {
  30741. attribute: 'title'
  30742. },
  30743. id: 'non-empty-title'
  30744. } ],
  30745. none: []
  30746. }, {
  30747. id: 'aria-conditional-attr',
  30748. impact: 'serious',
  30749. matches: 'aria-allowed-attr-matches',
  30750. tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'EN-301-549', 'EN-9.4.1.2' ],
  30751. actIds: [ '5c01ea' ],
  30752. all: [ {
  30753. options: {
  30754. invalidTableRowAttrs: [ 'aria-posinset', 'aria-setsize', 'aria-expanded', 'aria-level' ]
  30755. },
  30756. id: 'aria-conditional-attr'
  30757. } ],
  30758. any: [],
  30759. none: []
  30760. }, {
  30761. id: 'aria-deprecated-role',
  30762. impact: 'minor',
  30763. selector: '[role]',
  30764. matches: 'no-empty-role-matches',
  30765. tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'EN-301-549', 'EN-9.4.1.2' ],
  30766. actIds: [ '674b10' ],
  30767. all: [],
  30768. any: [],
  30769. none: [ 'deprecatedrole' ]
  30770. }, {
  30771. id: 'aria-dialog-name',
  30772. impact: 'serious',
  30773. selector: '[role="dialog"], [role="alertdialog"]',
  30774. matches: 'no-naming-method-matches',
  30775. tags: [ 'cat.aria', 'best-practice' ],
  30776. all: [],
  30777. any: [ 'aria-label', 'aria-labelledby', {
  30778. options: {
  30779. attribute: 'title'
  30780. },
  30781. id: 'non-empty-title'
  30782. } ],
  30783. none: []
  30784. }, {
  30785. id: 'aria-hidden-body',
  30786. impact: 'critical',
  30787. selector: 'body',
  30788. excludeHidden: false,
  30789. matches: 'is-initiator-matches',
  30790. tags: [ 'cat.aria', 'wcag2a', 'wcag131', 'wcag412', 'EN-301-549', 'EN-9.1.3.1', 'EN-9.4.1.2' ],
  30791. all: [],
  30792. any: [ 'aria-hidden-body' ],
  30793. none: []
  30794. }, {
  30795. id: 'aria-hidden-focus',
  30796. impact: 'serious',
  30797. selector: '[aria-hidden="true"]',
  30798. matches: 'aria-hidden-focus-matches',
  30799. excludeHidden: false,
  30800. tags: [ 'cat.name-role-value', 'wcag2a', 'wcag412', 'TTv5', 'TT6.a', 'EN-301-549', 'EN-9.4.1.2' ],
  30801. actIds: [ '6cfa84' ],
  30802. all: [ 'focusable-modal-open', 'focusable-disabled', 'focusable-not-tabbable' ],
  30803. any: [],
  30804. none: []
  30805. }, {
  30806. id: 'aria-input-field-name',
  30807. impact: 'serious',
  30808. selector: '[role="combobox"], [role="listbox"], [role="searchbox"], [role="slider"], [role="spinbutton"], [role="textbox"]',
  30809. matches: 'no-naming-method-matches',
  30810. tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'TTv5', 'TT5.c', 'EN-301-549', 'EN-9.4.1.2', 'ACT' ],
  30811. actIds: [ 'e086e5' ],
  30812. all: [],
  30813. any: [ 'aria-label', 'aria-labelledby', {
  30814. options: {
  30815. attribute: 'title'
  30816. },
  30817. id: 'non-empty-title'
  30818. } ],
  30819. none: [ 'no-implicit-explicit-label' ]
  30820. }, {
  30821. id: 'aria-meter-name',
  30822. impact: 'serious',
  30823. selector: '[role="meter"]',
  30824. matches: 'no-naming-method-matches',
  30825. tags: [ 'cat.aria', 'wcag2a', 'wcag111', 'EN-301-549', 'EN-9.1.1.1' ],
  30826. all: [],
  30827. any: [ 'aria-label', 'aria-labelledby', {
  30828. options: {
  30829. attribute: 'title'
  30830. },
  30831. id: 'non-empty-title'
  30832. } ],
  30833. none: []
  30834. }, {
  30835. id: 'aria-progressbar-name',
  30836. impact: 'serious',
  30837. selector: '[role="progressbar"]',
  30838. matches: 'no-naming-method-matches',
  30839. tags: [ 'cat.aria', 'wcag2a', 'wcag111', 'EN-301-549', 'EN-9.1.1.1' ],
  30840. all: [],
  30841. any: [ 'aria-label', 'aria-labelledby', {
  30842. options: {
  30843. attribute: 'title'
  30844. },
  30845. id: 'non-empty-title'
  30846. } ],
  30847. none: []
  30848. }, {
  30849. id: 'aria-prohibited-attr',
  30850. impact: 'serious',
  30851. matches: 'aria-allowed-attr-matches',
  30852. tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'EN-301-549', 'EN-9.4.1.2' ],
  30853. actIds: [ '5c01ea' ],
  30854. all: [],
  30855. any: [],
  30856. none: [ {
  30857. options: {
  30858. elementsAllowedAriaLabel: [ 'applet', 'input' ]
  30859. },
  30860. id: 'aria-prohibited-attr'
  30861. } ]
  30862. }, {
  30863. id: 'aria-required-attr',
  30864. impact: 'critical',
  30865. selector: '[role]',
  30866. tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'EN-301-549', 'EN-9.4.1.2' ],
  30867. actIds: [ '4e8ab6' ],
  30868. all: [],
  30869. any: [ 'aria-required-attr' ],
  30870. none: []
  30871. }, {
  30872. id: 'aria-required-children',
  30873. impact: 'critical',
  30874. selector: '[role]',
  30875. matches: 'aria-required-children-matches',
  30876. tags: [ 'cat.aria', 'wcag2a', 'wcag131', 'EN-301-549', 'EN-9.1.3.1' ],
  30877. actIds: [ 'bc4a75', 'ff89c9' ],
  30878. all: [],
  30879. any: [ {
  30880. options: {
  30881. reviewEmpty: [ 'doc-bibliography', 'doc-endnotes', 'grid', 'list', 'listbox', 'menu', 'menubar', 'table', 'tablist', 'tree', 'treegrid', 'rowgroup' ]
  30882. },
  30883. id: 'aria-required-children'
  30884. } ],
  30885. none: []
  30886. }, {
  30887. id: 'aria-required-parent',
  30888. impact: 'critical',
  30889. selector: '[role]',
  30890. matches: 'aria-required-parent-matches',
  30891. tags: [ 'cat.aria', 'wcag2a', 'wcag131', 'EN-301-549', 'EN-9.1.3.1' ],
  30892. actIds: [ 'ff89c9' ],
  30893. all: [],
  30894. any: [ {
  30895. options: {
  30896. ownGroupRoles: [ 'listitem', 'treeitem' ]
  30897. },
  30898. id: 'aria-required-parent'
  30899. } ],
  30900. none: []
  30901. }, {
  30902. id: 'aria-roledescription',
  30903. impact: 'serious',
  30904. selector: '[aria-roledescription]',
  30905. tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'EN-301-549', 'EN-9.4.1.2', 'deprecated' ],
  30906. enabled: false,
  30907. all: [],
  30908. any: [ {
  30909. options: {
  30910. supportedRoles: [ 'button', 'img', 'checkbox', 'radio', 'combobox', 'menuitemcheckbox', 'menuitemradio' ]
  30911. },
  30912. id: 'aria-roledescription'
  30913. } ],
  30914. none: []
  30915. }, {
  30916. id: 'aria-roles',
  30917. impact: 'critical',
  30918. selector: '[role]',
  30919. matches: 'no-empty-role-matches',
  30920. tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'EN-301-549', 'EN-9.4.1.2' ],
  30921. actIds: [ '674b10' ],
  30922. all: [],
  30923. any: [],
  30924. none: [ 'invalidrole', 'abstractrole', 'unsupportedrole' ]
  30925. }, {
  30926. id: 'aria-text',
  30927. impact: 'serious',
  30928. selector: '[role=text]',
  30929. tags: [ 'cat.aria', 'best-practice' ],
  30930. all: [],
  30931. any: [ 'no-focusable-content' ],
  30932. none: []
  30933. }, {
  30934. id: 'aria-toggle-field-name',
  30935. impact: 'serious',
  30936. selector: '[role="checkbox"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="radio"], [role="switch"], [role="option"]',
  30937. matches: 'no-naming-method-matches',
  30938. tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'TTv5', 'TT5.c', 'EN-301-549', 'EN-9.4.1.2', 'ACT' ],
  30939. actIds: [ 'e086e5' ],
  30940. all: [],
  30941. any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
  30942. options: {
  30943. attribute: 'title'
  30944. },
  30945. id: 'non-empty-title'
  30946. } ],
  30947. none: [ 'no-implicit-explicit-label' ]
  30948. }, {
  30949. id: 'aria-tooltip-name',
  30950. impact: 'serious',
  30951. selector: '[role="tooltip"]',
  30952. matches: 'no-naming-method-matches',
  30953. tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'EN-301-549', 'EN-9.4.1.2' ],
  30954. all: [],
  30955. any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
  30956. options: {
  30957. attribute: 'title'
  30958. },
  30959. id: 'non-empty-title'
  30960. } ],
  30961. none: []
  30962. }, {
  30963. id: 'aria-treeitem-name',
  30964. impact: 'serious',
  30965. selector: '[role="treeitem"]',
  30966. matches: 'no-naming-method-matches',
  30967. tags: [ 'cat.aria', 'best-practice' ],
  30968. all: [],
  30969. any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
  30970. options: {
  30971. attribute: 'title'
  30972. },
  30973. id: 'non-empty-title'
  30974. } ],
  30975. none: []
  30976. }, {
  30977. id: 'aria-valid-attr-value',
  30978. impact: 'critical',
  30979. matches: 'aria-has-attr-matches',
  30980. tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'EN-301-549', 'EN-9.4.1.2' ],
  30981. actIds: [ '6a7281' ],
  30982. all: [ {
  30983. options: [],
  30984. id: 'aria-valid-attr-value'
  30985. }, 'aria-errormessage', 'aria-level' ],
  30986. any: [],
  30987. none: []
  30988. }, {
  30989. id: 'aria-valid-attr',
  30990. impact: 'critical',
  30991. matches: 'aria-has-attr-matches',
  30992. tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'EN-301-549', 'EN-9.4.1.2' ],
  30993. actIds: [ '5f99a7' ],
  30994. all: [],
  30995. any: [ {
  30996. options: [],
  30997. id: 'aria-valid-attr'
  30998. } ],
  30999. none: []
  31000. }, {
  31001. id: 'audio-caption',
  31002. impact: 'critical',
  31003. selector: 'audio',
  31004. enabled: false,
  31005. excludeHidden: false,
  31006. tags: [ 'cat.time-and-media', 'wcag2a', 'wcag121', 'EN-301-549', 'EN-9.1.2.1', 'section508', 'section508.22.a', 'deprecated' ],
  31007. actIds: [ '2eb176', 'afb423' ],
  31008. all: [],
  31009. any: [],
  31010. none: [ 'caption' ]
  31011. }, {
  31012. id: 'autocomplete-valid',
  31013. impact: 'serious',
  31014. matches: 'autocomplete-matches',
  31015. tags: [ 'cat.forms', 'wcag21aa', 'wcag135', 'EN-301-549', 'EN-9.1.3.5', 'ACT' ],
  31016. actIds: [ '73f2c2' ],
  31017. all: [ {
  31018. options: {
  31019. stateTerms: [ 'none', 'false', 'true', 'disabled', 'enabled', 'undefined', 'null' ],
  31020. ignoredValues: [ 'text', 'pronouns', 'gender', 'message', 'content' ]
  31021. },
  31022. id: 'autocomplete-valid'
  31023. } ],
  31024. any: [],
  31025. none: []
  31026. }, {
  31027. id: 'avoid-inline-spacing',
  31028. impact: 'serious',
  31029. selector: '[style]',
  31030. matches: 'is-visible-on-screen-matches',
  31031. tags: [ 'cat.structure', 'wcag21aa', 'wcag1412', 'EN-301-549', 'EN-9.1.4.12', 'ACT' ],
  31032. actIds: [ '24afc2', '9e45ec', '78fd32' ],
  31033. all: [ {
  31034. options: {
  31035. cssProperty: 'letter-spacing',
  31036. minValue: .12
  31037. },
  31038. id: 'important-letter-spacing'
  31039. }, {
  31040. options: {
  31041. cssProperty: 'word-spacing',
  31042. minValue: .16
  31043. },
  31044. id: 'important-word-spacing'
  31045. }, {
  31046. options: {
  31047. multiLineOnly: true,
  31048. cssProperty: 'line-height',
  31049. minValue: 1.5,
  31050. normalValue: 1
  31051. },
  31052. id: 'important-line-height'
  31053. } ],
  31054. any: [],
  31055. none: []
  31056. }, {
  31057. id: 'blink',
  31058. impact: 'serious',
  31059. selector: 'blink',
  31060. excludeHidden: false,
  31061. tags: [ 'cat.time-and-media', 'wcag2a', 'wcag222', 'section508', 'section508.22.j', 'TTv5', 'TT2.b', 'EN-301-549', 'EN-9.2.2.2' ],
  31062. all: [],
  31063. any: [],
  31064. none: [ 'is-on-screen' ]
  31065. }, {
  31066. id: 'button-name',
  31067. impact: 'critical',
  31068. selector: 'button',
  31069. matches: 'no-explicit-name-required-matches',
  31070. tags: [ 'cat.name-role-value', 'wcag2a', 'wcag412', 'section508', 'section508.22.a', 'TTv5', 'TT6.a', 'EN-301-549', 'EN-9.4.1.2', 'ACT' ],
  31071. actIds: [ '97a4e1', 'm6b1q3' ],
  31072. all: [],
  31073. any: [ 'button-has-visible-text', 'aria-label', 'aria-labelledby', {
  31074. options: {
  31075. attribute: 'title'
  31076. },
  31077. id: 'non-empty-title'
  31078. }, 'implicit-label', 'explicit-label', 'presentational-role' ],
  31079. none: []
  31080. }, {
  31081. id: 'bypass',
  31082. impact: 'serious',
  31083. selector: 'html',
  31084. pageLevel: true,
  31085. matches: 'bypass-matches',
  31086. reviewOnFail: true,
  31087. tags: [ 'cat.keyboard', 'wcag2a', 'wcag241', 'section508', 'section508.22.o', 'TTv5', 'TT9.a', 'EN-301-549', 'EN-9.2.4.1' ],
  31088. actIds: [ 'cf77f2', '047fe0', 'b40fd1', '3e12e1', 'ye5d6e' ],
  31089. all: [],
  31090. any: [ 'internal-link-present', {
  31091. options: {
  31092. selector: ':is(h1, h2, h3, h4, h5, h6):not([role]), [role=heading]'
  31093. },
  31094. id: 'header-present'
  31095. }, {
  31096. options: {
  31097. selector: 'main, [role=main]'
  31098. },
  31099. id: 'landmark'
  31100. } ],
  31101. none: []
  31102. }, {
  31103. id: 'color-contrast-enhanced',
  31104. impact: 'serious',
  31105. matches: 'color-contrast-matches',
  31106. excludeHidden: false,
  31107. enabled: false,
  31108. tags: [ 'cat.color', 'wcag2aaa', 'wcag146', 'ACT' ],
  31109. actIds: [ '09o5cg' ],
  31110. all: [],
  31111. any: [ {
  31112. options: {
  31113. ignoreUnicode: true,
  31114. ignoreLength: false,
  31115. ignorePseudo: false,
  31116. boldValue: 700,
  31117. boldTextPt: 14,
  31118. largeTextPt: 18,
  31119. contrastRatio: {
  31120. normal: {
  31121. expected: 7,
  31122. minThreshold: 4.5
  31123. },
  31124. large: {
  31125. expected: 4.5,
  31126. minThreshold: 3
  31127. }
  31128. },
  31129. pseudoSizeThreshold: .25,
  31130. shadowOutlineEmMax: .1,
  31131. textStrokeEmMin: .03
  31132. },
  31133. id: 'color-contrast-enhanced'
  31134. } ],
  31135. none: []
  31136. }, {
  31137. id: 'color-contrast',
  31138. impact: 'serious',
  31139. matches: 'color-contrast-matches',
  31140. excludeHidden: false,
  31141. tags: [ 'cat.color', 'wcag2aa', 'wcag143', 'TTv5', 'TT13.c', 'EN-301-549', 'EN-9.1.4.3', 'ACT' ],
  31142. actIds: [ 'afw4f7', '09o5cg' ],
  31143. all: [],
  31144. any: [ {
  31145. options: {
  31146. ignoreUnicode: true,
  31147. ignoreLength: false,
  31148. ignorePseudo: false,
  31149. boldValue: 700,
  31150. boldTextPt: 14,
  31151. largeTextPt: 18,
  31152. contrastRatio: {
  31153. normal: {
  31154. expected: 4.5
  31155. },
  31156. large: {
  31157. expected: 3
  31158. }
  31159. },
  31160. pseudoSizeThreshold: .25,
  31161. shadowOutlineEmMax: .2,
  31162. textStrokeEmMin: .03
  31163. },
  31164. id: 'color-contrast'
  31165. } ],
  31166. none: []
  31167. }, {
  31168. id: 'css-orientation-lock',
  31169. impact: 'serious',
  31170. selector: 'html',
  31171. tags: [ 'cat.structure', 'wcag134', 'wcag21aa', 'EN-301-549', 'EN-9.1.3.4', 'experimental' ],
  31172. actIds: [ 'b33eff' ],
  31173. all: [ {
  31174. options: {
  31175. degreeThreshold: 2
  31176. },
  31177. id: 'css-orientation-lock'
  31178. } ],
  31179. any: [],
  31180. none: [],
  31181. preload: true
  31182. }, {
  31183. id: 'definition-list',
  31184. impact: 'serious',
  31185. selector: 'dl',
  31186. matches: 'no-role-matches',
  31187. tags: [ 'cat.structure', 'wcag2a', 'wcag131', 'EN-301-549', 'EN-9.1.3.1' ],
  31188. all: [],
  31189. any: [],
  31190. none: [ 'structured-dlitems', {
  31191. options: {
  31192. validRoles: [ 'definition', 'term', 'listitem' ],
  31193. validNodeNames: [ 'dt', 'dd' ],
  31194. divGroups: true
  31195. },
  31196. id: 'only-dlitems'
  31197. } ]
  31198. }, {
  31199. id: 'dlitem',
  31200. impact: 'serious',
  31201. selector: 'dd, dt',
  31202. matches: 'no-role-matches',
  31203. tags: [ 'cat.structure', 'wcag2a', 'wcag131', 'EN-301-549', 'EN-9.1.3.1' ],
  31204. all: [],
  31205. any: [ 'dlitem' ],
  31206. none: []
  31207. }, {
  31208. id: 'document-title',
  31209. impact: 'serious',
  31210. selector: 'html',
  31211. matches: 'is-initiator-matches',
  31212. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag242', 'TTv5', 'TT12.a', 'EN-301-549', 'EN-9.2.4.2', 'ACT' ],
  31213. actIds: [ '2779a5' ],
  31214. all: [],
  31215. any: [ 'doc-has-title' ],
  31216. none: []
  31217. }, {
  31218. id: 'duplicate-id-active',
  31219. impact: 'serious',
  31220. selector: '[id]',
  31221. matches: 'duplicate-id-active-matches',
  31222. excludeHidden: false,
  31223. tags: [ 'cat.parsing', 'wcag2a-obsolete', 'wcag411', 'deprecated' ],
  31224. enabled: false,
  31225. actIds: [ '3ea0c8' ],
  31226. all: [],
  31227. any: [ 'duplicate-id-active' ],
  31228. none: []
  31229. }, {
  31230. id: 'duplicate-id-aria',
  31231. impact: 'critical',
  31232. selector: '[id]',
  31233. matches: 'duplicate-id-aria-matches',
  31234. excludeHidden: false,
  31235. tags: [ 'cat.parsing', 'wcag2a', 'wcag412', 'EN-301-549', 'EN-9.4.1.2' ],
  31236. reviewOnFail: true,
  31237. actIds: [ '3ea0c8' ],
  31238. all: [],
  31239. any: [ 'duplicate-id-aria' ],
  31240. none: []
  31241. }, {
  31242. id: 'duplicate-id',
  31243. impact: 'minor',
  31244. selector: '[id]',
  31245. matches: 'duplicate-id-misc-matches',
  31246. excludeHidden: false,
  31247. tags: [ 'cat.parsing', 'wcag2a-obsolete', 'wcag411', 'deprecated' ],
  31248. enabled: false,
  31249. actIds: [ '3ea0c8' ],
  31250. all: [],
  31251. any: [ 'duplicate-id' ],
  31252. none: []
  31253. }, {
  31254. id: 'empty-heading',
  31255. impact: 'minor',
  31256. selector: 'h1, h2, h3, h4, h5, h6, [role="heading"]',
  31257. matches: 'heading-matches',
  31258. tags: [ 'cat.name-role-value', 'best-practice' ],
  31259. actIds: [ 'ffd0e9' ],
  31260. all: [],
  31261. any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
  31262. options: {
  31263. attribute: 'title'
  31264. },
  31265. id: 'non-empty-title'
  31266. } ],
  31267. none: []
  31268. }, {
  31269. id: 'empty-table-header',
  31270. impact: 'minor',
  31271. selector: 'th:not([role]), [role="rowheader"], [role="columnheader"]',
  31272. tags: [ 'cat.name-role-value', 'best-practice' ],
  31273. all: [],
  31274. any: [ 'has-visible-text' ],
  31275. none: []
  31276. }, {
  31277. id: 'focus-order-semantics',
  31278. impact: 'minor',
  31279. selector: 'div, h1, h2, h3, h4, h5, h6, [role=heading], p, span',
  31280. matches: 'inserted-into-focus-order-matches',
  31281. tags: [ 'cat.keyboard', 'best-practice', 'experimental' ],
  31282. all: [],
  31283. any: [ {
  31284. options: [],
  31285. id: 'has-widget-role'
  31286. }, {
  31287. options: {
  31288. roles: [ 'tooltip' ]
  31289. },
  31290. id: 'valid-scrollable-semantics'
  31291. } ],
  31292. none: []
  31293. }, {
  31294. id: 'form-field-multiple-labels',
  31295. impact: 'moderate',
  31296. selector: 'input, select, textarea',
  31297. matches: 'label-matches',
  31298. tags: [ 'cat.forms', 'wcag2a', 'wcag332', 'TTv5', 'TT5.c', 'EN-301-549', 'EN-9.3.3.2' ],
  31299. all: [],
  31300. any: [],
  31301. none: [ 'multiple-label' ]
  31302. }, {
  31303. id: 'frame-focusable-content',
  31304. impact: 'serious',
  31305. selector: 'html',
  31306. matches: 'frame-focusable-content-matches',
  31307. tags: [ 'cat.keyboard', 'wcag2a', 'wcag211', 'TTv5', 'TT4.a', 'EN-301-549', 'EN-9.2.1.1' ],
  31308. actIds: [ 'akn7bn' ],
  31309. all: [],
  31310. any: [ 'frame-focusable-content' ],
  31311. none: []
  31312. }, {
  31313. id: 'frame-tested',
  31314. impact: 'critical',
  31315. selector: 'html, frame, iframe',
  31316. tags: [ 'cat.structure', 'best-practice', 'review-item' ],
  31317. all: [ {
  31318. options: {
  31319. isViolation: false
  31320. },
  31321. id: 'frame-tested'
  31322. } ],
  31323. any: [],
  31324. none: []
  31325. }, {
  31326. id: 'frame-title-unique',
  31327. impact: 'serious',
  31328. selector: 'frame[title], iframe[title]',
  31329. matches: 'frame-title-has-text-matches',
  31330. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag412', 'TTv5', 'TT12.d', 'EN-301-549', 'EN-9.4.1.2' ],
  31331. actIds: [ '4b1c6c' ],
  31332. all: [],
  31333. any: [],
  31334. none: [ 'unique-frame-title' ],
  31335. reviewOnFail: true
  31336. }, {
  31337. id: 'frame-title',
  31338. impact: 'serious',
  31339. selector: 'frame, iframe',
  31340. matches: 'no-negative-tabindex-matches',
  31341. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag412', 'section508', 'section508.22.i', 'TTv5', 'TT12.d', 'EN-301-549', 'EN-9.4.1.2' ],
  31342. actIds: [ 'cae760' ],
  31343. all: [],
  31344. any: [ {
  31345. options: {
  31346. attribute: 'title'
  31347. },
  31348. id: 'non-empty-title'
  31349. }, 'aria-label', 'aria-labelledby', 'presentational-role' ],
  31350. none: []
  31351. }, {
  31352. id: 'heading-order',
  31353. impact: 'moderate',
  31354. selector: 'h1, h2, h3, h4, h5, h6, [role=heading]',
  31355. matches: 'heading-matches',
  31356. tags: [ 'cat.semantics', 'best-practice' ],
  31357. all: [],
  31358. any: [ 'heading-order' ],
  31359. none: []
  31360. }, {
  31361. id: 'hidden-content',
  31362. impact: 'minor',
  31363. selector: '*',
  31364. excludeHidden: false,
  31365. tags: [ 'cat.structure', 'best-practice', 'experimental', 'review-item' ],
  31366. all: [],
  31367. any: [ 'hidden-content' ],
  31368. none: []
  31369. }, {
  31370. id: 'html-has-lang',
  31371. impact: 'serious',
  31372. selector: 'html',
  31373. matches: 'is-initiator-matches',
  31374. tags: [ 'cat.language', 'wcag2a', 'wcag311', 'TTv5', 'TT11.a', 'EN-301-549', 'EN-9.3.1.1', 'ACT' ],
  31375. actIds: [ 'b5c3f8' ],
  31376. all: [],
  31377. any: [ {
  31378. options: {
  31379. attributes: [ 'lang', 'xml:lang' ]
  31380. },
  31381. id: 'has-lang'
  31382. } ],
  31383. none: []
  31384. }, {
  31385. id: 'html-lang-valid',
  31386. impact: 'serious',
  31387. selector: 'html[lang]:not([lang=""]), html[xml\\:lang]:not([xml\\:lang=""])',
  31388. tags: [ 'cat.language', 'wcag2a', 'wcag311', 'TTv5', 'TT11.a', 'EN-301-549', 'EN-9.3.1.1', 'ACT' ],
  31389. actIds: [ 'bf051a' ],
  31390. all: [],
  31391. any: [],
  31392. none: [ {
  31393. options: {
  31394. attributes: [ 'lang', 'xml:lang' ]
  31395. },
  31396. id: 'valid-lang'
  31397. } ]
  31398. }, {
  31399. id: 'html-xml-lang-mismatch',
  31400. impact: 'moderate',
  31401. selector: 'html[lang][xml\\:lang]',
  31402. matches: 'xml-lang-mismatch-matches',
  31403. tags: [ 'cat.language', 'wcag2a', 'wcag311', 'EN-301-549', 'EN-9.3.1.1', 'ACT' ],
  31404. actIds: [ '5b7ae0' ],
  31405. all: [ 'xml-lang-mismatch' ],
  31406. any: [],
  31407. none: []
  31408. }, {
  31409. id: 'identical-links-same-purpose',
  31410. impact: 'minor',
  31411. selector: 'a[href], area[href], [role="link"]',
  31412. excludeHidden: false,
  31413. enabled: false,
  31414. matches: 'identical-links-same-purpose-matches',
  31415. tags: [ 'cat.semantics', 'wcag2aaa', 'wcag249' ],
  31416. actIds: [ 'b20e66' ],
  31417. all: [ 'identical-links-same-purpose' ],
  31418. any: [],
  31419. none: []
  31420. }, {
  31421. id: 'image-alt',
  31422. impact: 'critical',
  31423. selector: 'img',
  31424. matches: 'no-explicit-name-required-matches',
  31425. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag111', 'section508', 'section508.22.a', 'TTv5', 'TT7.a', 'TT7.b', 'EN-301-549', 'EN-9.1.1.1', 'ACT' ],
  31426. actIds: [ '23a2a8' ],
  31427. all: [],
  31428. any: [ 'has-alt', 'aria-label', 'aria-labelledby', {
  31429. options: {
  31430. attribute: 'title'
  31431. },
  31432. id: 'non-empty-title'
  31433. }, 'presentational-role' ],
  31434. none: [ 'alt-space-value' ]
  31435. }, {
  31436. id: 'image-redundant-alt',
  31437. impact: 'minor',
  31438. selector: 'img',
  31439. tags: [ 'cat.text-alternatives', 'best-practice' ],
  31440. all: [],
  31441. any: [],
  31442. none: [ {
  31443. options: {
  31444. parentSelector: 'button, [role=button], a[href], p, li, td, th'
  31445. },
  31446. id: 'duplicate-img-label'
  31447. } ]
  31448. }, {
  31449. id: 'input-button-name',
  31450. impact: 'critical',
  31451. selector: 'input[type="button"], input[type="submit"], input[type="reset"]',
  31452. matches: 'no-explicit-name-required-matches',
  31453. tags: [ 'cat.name-role-value', 'wcag2a', 'wcag412', 'section508', 'section508.22.a', 'TTv5', 'TT5.c', 'EN-301-549', 'EN-9.4.1.2', 'ACT' ],
  31454. actIds: [ '97a4e1' ],
  31455. all: [],
  31456. any: [ 'non-empty-if-present', {
  31457. options: {
  31458. attribute: 'value'
  31459. },
  31460. id: 'non-empty-value'
  31461. }, 'aria-label', 'aria-labelledby', {
  31462. options: {
  31463. attribute: 'title'
  31464. },
  31465. id: 'non-empty-title'
  31466. }, 'implicit-label', 'explicit-label', 'presentational-role' ],
  31467. none: []
  31468. }, {
  31469. id: 'input-image-alt',
  31470. impact: 'critical',
  31471. selector: 'input[type="image"]',
  31472. matches: 'no-explicit-name-required-matches',
  31473. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag111', 'wcag412', 'section508', 'section508.22.a', 'TTv5', 'TT7.a', 'EN-301-549', 'EN-9.1.1.1', 'EN-9.4.1.2', 'ACT' ],
  31474. actIds: [ '59796f' ],
  31475. all: [],
  31476. any: [ {
  31477. options: {
  31478. attribute: 'alt'
  31479. },
  31480. id: 'non-empty-alt'
  31481. }, 'aria-label', 'aria-labelledby', {
  31482. options: {
  31483. attribute: 'title'
  31484. },
  31485. id: 'non-empty-title'
  31486. }, 'implicit-label', 'explicit-label' ],
  31487. none: []
  31488. }, {
  31489. id: 'label-content-name-mismatch',
  31490. impact: 'serious',
  31491. matches: 'label-content-name-mismatch-matches',
  31492. tags: [ 'cat.semantics', 'wcag21a', 'wcag253', 'EN-301-549', 'EN-9.2.5.3', 'experimental' ],
  31493. actIds: [ '2ee8b8' ],
  31494. all: [],
  31495. any: [ {
  31496. options: {
  31497. pixelThreshold: .1,
  31498. occurrenceThreshold: 3
  31499. },
  31500. id: 'label-content-name-mismatch'
  31501. } ],
  31502. none: []
  31503. }, {
  31504. id: 'label-title-only',
  31505. impact: 'serious',
  31506. selector: 'input, select, textarea',
  31507. matches: 'label-matches',
  31508. tags: [ 'cat.forms', 'best-practice' ],
  31509. all: [],
  31510. any: [],
  31511. none: [ 'title-only' ]
  31512. }, {
  31513. id: 'label',
  31514. impact: 'critical',
  31515. selector: 'input, textarea',
  31516. matches: 'label-matches',
  31517. tags: [ 'cat.forms', 'wcag2a', 'wcag412', 'section508', 'section508.22.n', 'TTv5', 'TT5.c', 'EN-301-549', 'EN-9.4.1.2', 'ACT' ],
  31518. actIds: [ 'e086e5' ],
  31519. all: [],
  31520. any: [ 'implicit-label', 'explicit-label', 'aria-label', 'aria-labelledby', {
  31521. options: {
  31522. attribute: 'title'
  31523. },
  31524. id: 'non-empty-title'
  31525. }, {
  31526. options: {
  31527. attribute: 'placeholder'
  31528. },
  31529. id: 'non-empty-placeholder'
  31530. }, 'presentational-role' ],
  31531. none: [ 'hidden-explicit-label' ]
  31532. }, {
  31533. id: 'landmark-banner-is-top-level',
  31534. impact: 'moderate',
  31535. selector: 'header:not([role]), [role=banner]',
  31536. matches: 'landmark-has-body-context-matches',
  31537. tags: [ 'cat.semantics', 'best-practice' ],
  31538. all: [],
  31539. any: [ 'landmark-is-top-level' ],
  31540. none: []
  31541. }, {
  31542. id: 'landmark-complementary-is-top-level',
  31543. impact: 'moderate',
  31544. selector: 'aside:not([role]), [role=complementary]',
  31545. tags: [ 'cat.semantics', 'best-practice' ],
  31546. all: [],
  31547. any: [ 'landmark-is-top-level' ],
  31548. none: []
  31549. }, {
  31550. id: 'landmark-contentinfo-is-top-level',
  31551. impact: 'moderate',
  31552. selector: 'footer:not([role]), [role=contentinfo]',
  31553. matches: 'landmark-has-body-context-matches',
  31554. tags: [ 'cat.semantics', 'best-practice' ],
  31555. all: [],
  31556. any: [ 'landmark-is-top-level' ],
  31557. none: []
  31558. }, {
  31559. id: 'landmark-main-is-top-level',
  31560. impact: 'moderate',
  31561. selector: 'main:not([role]), [role=main]',
  31562. tags: [ 'cat.semantics', 'best-practice' ],
  31563. all: [],
  31564. any: [ 'landmark-is-top-level' ],
  31565. none: []
  31566. }, {
  31567. id: 'landmark-no-duplicate-banner',
  31568. impact: 'moderate',
  31569. selector: 'header:not([role]), [role=banner]',
  31570. tags: [ 'cat.semantics', 'best-practice' ],
  31571. all: [],
  31572. any: [ {
  31573. options: {
  31574. selector: 'header:not([role]), [role=banner]',
  31575. role: 'banner'
  31576. },
  31577. id: 'page-no-duplicate-banner'
  31578. } ],
  31579. none: []
  31580. }, {
  31581. id: 'landmark-no-duplicate-contentinfo',
  31582. impact: 'moderate',
  31583. selector: 'footer:not([role]), [role=contentinfo]',
  31584. tags: [ 'cat.semantics', 'best-practice' ],
  31585. all: [],
  31586. any: [ {
  31587. options: {
  31588. selector: 'footer:not([role]), [role=contentinfo]',
  31589. role: 'contentinfo'
  31590. },
  31591. id: 'page-no-duplicate-contentinfo'
  31592. } ],
  31593. none: []
  31594. }, {
  31595. id: 'landmark-no-duplicate-main',
  31596. impact: 'moderate',
  31597. selector: 'main:not([role]), [role=main]',
  31598. tags: [ 'cat.semantics', 'best-practice' ],
  31599. all: [],
  31600. any: [ {
  31601. options: {
  31602. selector: 'main:not([role]), [role=\'main\']'
  31603. },
  31604. id: 'page-no-duplicate-main'
  31605. } ],
  31606. none: []
  31607. }, {
  31608. id: 'landmark-one-main',
  31609. impact: 'moderate',
  31610. selector: 'html',
  31611. tags: [ 'cat.semantics', 'best-practice' ],
  31612. all: [ {
  31613. options: {
  31614. selector: 'main:not([role]), [role=\'main\']',
  31615. passForModal: true
  31616. },
  31617. id: 'page-has-main'
  31618. } ],
  31619. any: [],
  31620. none: []
  31621. }, {
  31622. id: 'landmark-unique',
  31623. impact: 'moderate',
  31624. selector: '[role=banner], [role=complementary], [role=contentinfo], [role=main], [role=navigation], [role=region], [role=search], [role=form], form, footer, header, aside, main, nav, section',
  31625. tags: [ 'cat.semantics', 'best-practice' ],
  31626. matches: 'landmark-unique-matches',
  31627. all: [],
  31628. any: [ 'landmark-is-unique' ],
  31629. none: []
  31630. }, {
  31631. id: 'link-in-text-block',
  31632. impact: 'serious',
  31633. selector: 'a[href], [role=link]',
  31634. matches: 'link-in-text-block-matches',
  31635. excludeHidden: false,
  31636. tags: [ 'cat.color', 'wcag2a', 'wcag141', 'TTv5', 'TT13.a', 'EN-301-549', 'EN-9.1.4.1' ],
  31637. all: [],
  31638. any: [ {
  31639. options: {
  31640. requiredContrastRatio: 3,
  31641. allowSameColor: true
  31642. },
  31643. id: 'link-in-text-block'
  31644. }, 'link-in-text-block-style' ],
  31645. none: []
  31646. }, {
  31647. id: 'link-name',
  31648. impact: 'serious',
  31649. selector: 'a[href]',
  31650. tags: [ 'cat.name-role-value', 'wcag2a', 'wcag244', 'wcag412', 'section508', 'section508.22.a', 'TTv5', 'TT6.a', 'EN-301-549', 'EN-9.2.4.4', 'EN-9.4.1.2', 'ACT' ],
  31651. actIds: [ 'c487ae' ],
  31652. all: [],
  31653. any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
  31654. options: {
  31655. attribute: 'title'
  31656. },
  31657. id: 'non-empty-title'
  31658. } ],
  31659. none: [ 'focusable-no-name' ]
  31660. }, {
  31661. id: 'list',
  31662. impact: 'serious',
  31663. selector: 'ul, ol',
  31664. matches: 'no-role-matches',
  31665. tags: [ 'cat.structure', 'wcag2a', 'wcag131', 'EN-301-549', 'EN-9.1.3.1' ],
  31666. all: [],
  31667. any: [],
  31668. none: [ {
  31669. options: {
  31670. validRoles: [ 'listitem' ],
  31671. validNodeNames: [ 'li' ]
  31672. },
  31673. id: 'only-listitems'
  31674. } ]
  31675. }, {
  31676. id: 'listitem',
  31677. impact: 'serious',
  31678. selector: 'li',
  31679. matches: 'no-role-matches',
  31680. tags: [ 'cat.structure', 'wcag2a', 'wcag131', 'EN-301-549', 'EN-9.1.3.1' ],
  31681. all: [],
  31682. any: [ 'listitem' ],
  31683. none: []
  31684. }, {
  31685. id: 'marquee',
  31686. impact: 'serious',
  31687. selector: 'marquee',
  31688. excludeHidden: false,
  31689. tags: [ 'cat.parsing', 'wcag2a', 'wcag222', 'TTv5', 'TT2.b', 'EN-301-549', 'EN-9.2.2.2' ],
  31690. all: [],
  31691. any: [],
  31692. none: [ 'is-on-screen' ]
  31693. }, {
  31694. id: 'meta-refresh-no-exceptions',
  31695. impact: 'minor',
  31696. selector: 'meta[http-equiv="refresh"][content]',
  31697. excludeHidden: false,
  31698. enabled: false,
  31699. tags: [ 'cat.time-and-media', 'wcag2aaa', 'wcag224', 'wcag325' ],
  31700. actIds: [ 'bisz58' ],
  31701. all: [],
  31702. any: [ {
  31703. options: {
  31704. minDelay: 72e3,
  31705. maxDelay: false
  31706. },
  31707. id: 'meta-refresh-no-exceptions'
  31708. } ],
  31709. none: []
  31710. }, {
  31711. id: 'meta-refresh',
  31712. impact: 'critical',
  31713. selector: 'meta[http-equiv="refresh"][content]',
  31714. excludeHidden: false,
  31715. tags: [ 'cat.time-and-media', 'wcag2a', 'wcag221', 'TTv5', 'TT8.a', 'EN-301-549', 'EN-9.2.2.1' ],
  31716. actIds: [ 'bc659a', 'bisz58' ],
  31717. all: [],
  31718. any: [ {
  31719. options: {
  31720. minDelay: 0,
  31721. maxDelay: 72e3
  31722. },
  31723. id: 'meta-refresh'
  31724. } ],
  31725. none: []
  31726. }, {
  31727. id: 'meta-viewport-large',
  31728. impact: 'minor',
  31729. selector: 'meta[name="viewport"]',
  31730. matches: 'is-initiator-matches',
  31731. excludeHidden: false,
  31732. tags: [ 'cat.sensory-and-visual-cues', 'best-practice' ],
  31733. all: [],
  31734. any: [ {
  31735. options: {
  31736. scaleMinimum: 5,
  31737. lowerBound: 2
  31738. },
  31739. id: 'meta-viewport-large'
  31740. } ],
  31741. none: []
  31742. }, {
  31743. id: 'meta-viewport',
  31744. impact: 'critical',
  31745. selector: 'meta[name="viewport"]',
  31746. matches: 'is-initiator-matches',
  31747. excludeHidden: false,
  31748. tags: [ 'cat.sensory-and-visual-cues', 'wcag2aa', 'wcag144', 'EN-301-549', 'EN-9.1.4.4', 'ACT' ],
  31749. actIds: [ 'b4f0c3' ],
  31750. all: [],
  31751. any: [ {
  31752. options: {
  31753. scaleMinimum: 2
  31754. },
  31755. id: 'meta-viewport'
  31756. } ],
  31757. none: []
  31758. }, {
  31759. id: 'nested-interactive',
  31760. impact: 'serious',
  31761. matches: 'nested-interactive-matches',
  31762. tags: [ 'cat.keyboard', 'wcag2a', 'wcag412', 'TTv5', 'TT6.a', 'EN-301-549', 'EN-9.4.1.2' ],
  31763. actIds: [ '307n5z' ],
  31764. all: [],
  31765. any: [ 'no-focusable-content' ],
  31766. none: []
  31767. }, {
  31768. id: 'no-autoplay-audio',
  31769. impact: 'moderate',
  31770. excludeHidden: false,
  31771. selector: 'audio[autoplay], video[autoplay]',
  31772. matches: 'no-autoplay-audio-matches',
  31773. reviewOnFail: true,
  31774. tags: [ 'cat.time-and-media', 'wcag2a', 'wcag142', 'TTv5', 'TT2.a', 'EN-301-549', 'EN-9.1.4.2', 'ACT' ],
  31775. actIds: [ '80f0bf' ],
  31776. preload: true,
  31777. all: [ {
  31778. options: {
  31779. allowedDuration: 3
  31780. },
  31781. id: 'no-autoplay-audio'
  31782. } ],
  31783. any: [],
  31784. none: []
  31785. }, {
  31786. id: 'object-alt',
  31787. impact: 'serious',
  31788. selector: 'object[data]',
  31789. matches: 'object-is-loaded-matches',
  31790. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag111', 'section508', 'section508.22.a', 'EN-301-549', 'EN-9.1.1.1' ],
  31791. actIds: [ '8fc3b6' ],
  31792. all: [],
  31793. any: [ 'aria-label', 'aria-labelledby', {
  31794. options: {
  31795. attribute: 'title'
  31796. },
  31797. id: 'non-empty-title'
  31798. }, 'presentational-role' ],
  31799. none: []
  31800. }, {
  31801. id: 'p-as-heading',
  31802. impact: 'serious',
  31803. selector: 'p',
  31804. matches: 'p-as-heading-matches',
  31805. tags: [ 'cat.semantics', 'wcag2a', 'wcag131', 'EN-301-549', 'EN-9.1.3.1', 'experimental' ],
  31806. all: [ {
  31807. options: {
  31808. margins: [ {
  31809. weight: 150,
  31810. italic: true
  31811. }, {
  31812. weight: 150,
  31813. size: 1.15
  31814. }, {
  31815. italic: true,
  31816. size: 1.15
  31817. }, {
  31818. size: 1.4
  31819. } ],
  31820. passLength: 1,
  31821. failLength: .5
  31822. },
  31823. id: 'p-as-heading'
  31824. } ],
  31825. any: [],
  31826. none: []
  31827. }, {
  31828. id: 'page-has-heading-one',
  31829. impact: 'moderate',
  31830. selector: 'html',
  31831. tags: [ 'cat.semantics', 'best-practice' ],
  31832. all: [ {
  31833. options: {
  31834. selector: 'h1:not([role], [aria-level]), :is(h1, h2, h3, h4, h5, h6):not([role])[aria-level=1], [role=heading][aria-level=1]',
  31835. passForModal: true
  31836. },
  31837. id: 'page-has-heading-one'
  31838. } ],
  31839. any: [],
  31840. none: []
  31841. }, {
  31842. id: 'presentation-role-conflict',
  31843. impact: 'minor',
  31844. selector: 'img[alt=\'\'], [role="none"], [role="presentation"]',
  31845. matches: 'has-implicit-chromium-role-matches',
  31846. tags: [ 'cat.aria', 'best-practice', 'ACT' ],
  31847. actIds: [ '46ca7f' ],
  31848. all: [],
  31849. any: [],
  31850. none: [ 'is-element-focusable', 'has-global-aria-attribute' ]
  31851. }, {
  31852. id: 'region',
  31853. impact: 'moderate',
  31854. selector: 'body *',
  31855. tags: [ 'cat.keyboard', 'best-practice' ],
  31856. all: [],
  31857. any: [ {
  31858. options: {
  31859. regionMatcher: 'dialog, [role=dialog], [role=alertdialog], svg'
  31860. },
  31861. id: 'region'
  31862. } ],
  31863. none: []
  31864. }, {
  31865. id: 'role-img-alt',
  31866. impact: 'serious',
  31867. selector: '[role=\'img\']:not(img, area, input, object)',
  31868. matches: 'html-namespace-matches',
  31869. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag111', 'section508', 'section508.22.a', 'TTv5', 'TT7.a', 'EN-301-549', 'EN-9.1.1.1', 'ACT' ],
  31870. actIds: [ '23a2a8' ],
  31871. all: [],
  31872. any: [ 'aria-label', 'aria-labelledby', {
  31873. options: {
  31874. attribute: 'title'
  31875. },
  31876. id: 'non-empty-title'
  31877. } ],
  31878. none: []
  31879. }, {
  31880. id: 'scope-attr-valid',
  31881. impact: 'moderate',
  31882. selector: 'td[scope], th[scope]',
  31883. tags: [ 'cat.tables', 'best-practice' ],
  31884. all: [ 'html5-scope', {
  31885. options: {
  31886. values: [ 'row', 'col', 'rowgroup', 'colgroup' ]
  31887. },
  31888. id: 'scope-value'
  31889. } ],
  31890. any: [],
  31891. none: []
  31892. }, {
  31893. id: 'scrollable-region-focusable',
  31894. impact: 'serious',
  31895. selector: '*:not(select,textarea)',
  31896. matches: 'scrollable-region-focusable-matches',
  31897. tags: [ 'cat.keyboard', 'wcag2a', 'wcag211', 'wcag213', 'TTv5', 'TT4.a', 'EN-301-549', 'EN-9.2.1.1', 'EN-9.2.1.3' ],
  31898. actIds: [ '0ssw9k' ],
  31899. all: [],
  31900. any: [ 'focusable-content', 'focusable-element' ],
  31901. none: []
  31902. }, {
  31903. id: 'select-name',
  31904. impact: 'critical',
  31905. selector: 'select',
  31906. tags: [ 'cat.forms', 'wcag2a', 'wcag412', 'section508', 'section508.22.n', 'TTv5', 'TT5.c', 'EN-301-549', 'EN-9.4.1.2', 'ACT' ],
  31907. actIds: [ 'e086e5' ],
  31908. all: [],
  31909. any: [ 'implicit-label', 'explicit-label', 'aria-label', 'aria-labelledby', {
  31910. options: {
  31911. attribute: 'title'
  31912. },
  31913. id: 'non-empty-title'
  31914. }, 'presentational-role' ],
  31915. none: [ 'hidden-explicit-label' ]
  31916. }, {
  31917. id: 'server-side-image-map',
  31918. impact: 'minor',
  31919. selector: 'img[ismap]',
  31920. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag211', 'section508', 'section508.22.f', 'TTv5', 'TT4.a', 'EN-301-549', 'EN-9.2.1.1' ],
  31921. all: [],
  31922. any: [],
  31923. none: [ 'exists' ]
  31924. }, {
  31925. id: 'skip-link',
  31926. impact: 'moderate',
  31927. selector: 'a[href^="#"], a[href^="/#"]',
  31928. matches: 'skip-link-matches',
  31929. tags: [ 'cat.keyboard', 'best-practice' ],
  31930. all: [],
  31931. any: [ 'skip-link' ],
  31932. none: []
  31933. }, {
  31934. id: 'summary-name',
  31935. impact: 'serious',
  31936. selector: 'summary',
  31937. matches: 'summary-interactive-matches',
  31938. tags: [ 'cat.name-role-value', 'wcag2a', 'wcag412', 'section508', 'section508.22.a', 'TTv5', 'TT6.a', 'EN-301-549', 'EN-9.4.1.2' ],
  31939. all: [],
  31940. any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
  31941. options: {
  31942. attribute: 'title'
  31943. },
  31944. id: 'non-empty-title'
  31945. } ],
  31946. none: []
  31947. }, {
  31948. id: 'svg-img-alt',
  31949. impact: 'serious',
  31950. selector: '[role="img"], [role="graphics-symbol"], svg[role="graphics-document"]',
  31951. matches: 'svg-namespace-matches',
  31952. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag111', 'section508', 'section508.22.a', 'TTv5', 'TT7.a', 'EN-301-549', 'EN-9.1.1.1', 'ACT' ],
  31953. actIds: [ '7d6734' ],
  31954. all: [],
  31955. any: [ 'svg-non-empty-title', 'aria-label', 'aria-labelledby', {
  31956. options: {
  31957. attribute: 'title'
  31958. },
  31959. id: 'non-empty-title'
  31960. } ],
  31961. none: []
  31962. }, {
  31963. id: 'tabindex',
  31964. impact: 'serious',
  31965. selector: '[tabindex]',
  31966. tags: [ 'cat.keyboard', 'best-practice' ],
  31967. all: [],
  31968. any: [ 'tabindex' ],
  31969. none: []
  31970. }, {
  31971. id: 'table-duplicate-name',
  31972. impact: 'minor',
  31973. selector: 'table',
  31974. tags: [ 'cat.tables', 'best-practice' ],
  31975. all: [],
  31976. any: [],
  31977. none: [ 'same-caption-summary' ]
  31978. }, {
  31979. id: 'table-fake-caption',
  31980. impact: 'serious',
  31981. selector: 'table',
  31982. matches: 'data-table-matches',
  31983. tags: [ 'cat.tables', 'experimental', 'wcag2a', 'wcag131', 'section508', 'section508.22.g', 'EN-301-549', 'EN-9.1.3.1' ],
  31984. all: [ 'caption-faked' ],
  31985. any: [],
  31986. none: []
  31987. }, {
  31988. id: 'target-size',
  31989. impact: 'serious',
  31990. selector: '*',
  31991. enabled: false,
  31992. matches: 'widget-not-inline-matches',
  31993. tags: [ 'cat.sensory-and-visual-cues', 'wcag22aa', 'wcag258' ],
  31994. all: [],
  31995. any: [ {
  31996. options: {
  31997. minSize: 24
  31998. },
  31999. id: 'target-size'
  32000. }, {
  32001. options: {
  32002. minOffset: 24
  32003. },
  32004. id: 'target-offset'
  32005. } ],
  32006. none: []
  32007. }, {
  32008. id: 'td-has-header',
  32009. impact: 'critical',
  32010. selector: 'table',
  32011. matches: 'data-table-large-matches',
  32012. tags: [ 'cat.tables', 'experimental', 'wcag2a', 'wcag131', 'section508', 'section508.22.g', 'TTv5', 'TT14.b', 'EN-301-549', 'EN-9.1.3.1' ],
  32013. all: [ 'td-has-header' ],
  32014. any: [],
  32015. none: []
  32016. }, {
  32017. id: 'td-headers-attr',
  32018. impact: 'serious',
  32019. selector: 'table',
  32020. matches: 'table-or-grid-role-matches',
  32021. tags: [ 'cat.tables', 'wcag2a', 'wcag131', 'section508', 'section508.22.g', 'TTv5', 'TT14.b', 'EN-301-549', 'EN-9.1.3.1' ],
  32022. actIds: [ 'a25f45' ],
  32023. all: [ 'td-headers-attr' ],
  32024. any: [],
  32025. none: []
  32026. }, {
  32027. id: 'th-has-data-cells',
  32028. impact: 'serious',
  32029. selector: 'table',
  32030. matches: 'data-table-matches',
  32031. tags: [ 'cat.tables', 'wcag2a', 'wcag131', 'section508', 'section508.22.g', 'TTv5', 'TT14.b', 'EN-301-549', 'EN-9.1.3.1' ],
  32032. actIds: [ 'd0f69e' ],
  32033. all: [ 'th-has-data-cells' ],
  32034. any: [],
  32035. none: []
  32036. }, {
  32037. id: 'valid-lang',
  32038. impact: 'serious',
  32039. selector: '[lang]:not(html), [xml\\:lang]:not(html)',
  32040. tags: [ 'cat.language', 'wcag2aa', 'wcag312', 'TTv5', 'TT11.b', 'EN-301-549', 'EN-9.3.1.2', 'ACT' ],
  32041. actIds: [ 'de46e4' ],
  32042. all: [],
  32043. any: [],
  32044. none: [ {
  32045. options: {
  32046. attributes: [ 'lang', 'xml:lang' ]
  32047. },
  32048. id: 'valid-lang'
  32049. } ]
  32050. }, {
  32051. id: 'video-caption',
  32052. impact: 'critical',
  32053. selector: 'video',
  32054. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag122', 'section508', 'section508.22.a', 'TTv5', 'TT17.a', 'EN-301-549', 'EN-9.1.2.2' ],
  32055. actIds: [ 'eac66b' ],
  32056. all: [],
  32057. any: [],
  32058. none: [ 'caption' ]
  32059. } ],
  32060. checks: [ {
  32061. id: 'abstractrole',
  32062. evaluate: 'abstractrole-evaluate'
  32063. }, {
  32064. id: 'aria-allowed-attr',
  32065. evaluate: 'aria-allowed-attr-evaluate',
  32066. options: {
  32067. validTreeRowAttrs: [ 'aria-posinset', 'aria-setsize', 'aria-expanded', 'aria-level' ]
  32068. }
  32069. }, {
  32070. id: 'aria-allowed-role',
  32071. evaluate: 'aria-allowed-role-evaluate',
  32072. options: {
  32073. allowImplicit: true,
  32074. ignoredTags: []
  32075. }
  32076. }, {
  32077. id: 'aria-busy',
  32078. evaluate: 'aria-busy-evaluate',
  32079. deprecated: true
  32080. }, {
  32081. id: 'aria-conditional-attr',
  32082. evaluate: 'aria-conditional-attr-evaluate',
  32083. options: {
  32084. invalidTableRowAttrs: [ 'aria-posinset', 'aria-setsize', 'aria-expanded', 'aria-level' ]
  32085. }
  32086. }, {
  32087. id: 'aria-errormessage',
  32088. evaluate: 'aria-errormessage-evaluate'
  32089. }, {
  32090. id: 'aria-hidden-body',
  32091. evaluate: 'aria-hidden-body-evaluate'
  32092. }, {
  32093. id: 'aria-level',
  32094. evaluate: 'aria-level-evaluate'
  32095. }, {
  32096. id: 'aria-prohibited-attr',
  32097. evaluate: 'aria-prohibited-attr-evaluate',
  32098. options: {
  32099. elementsAllowedAriaLabel: [ 'applet', 'input' ]
  32100. }
  32101. }, {
  32102. id: 'aria-required-attr',
  32103. evaluate: 'aria-required-attr-evaluate'
  32104. }, {
  32105. id: 'aria-required-children',
  32106. evaluate: 'aria-required-children-evaluate',
  32107. options: {
  32108. reviewEmpty: [ 'doc-bibliography', 'doc-endnotes', 'grid', 'list', 'listbox', 'menu', 'menubar', 'table', 'tablist', 'tree', 'treegrid', 'rowgroup' ]
  32109. }
  32110. }, {
  32111. id: 'aria-required-parent',
  32112. evaluate: 'aria-required-parent-evaluate',
  32113. options: {
  32114. ownGroupRoles: [ 'listitem', 'treeitem' ]
  32115. }
  32116. }, {
  32117. id: 'aria-roledescription',
  32118. evaluate: 'aria-roledescription-evaluate',
  32119. options: {
  32120. supportedRoles: [ 'button', 'img', 'checkbox', 'radio', 'combobox', 'menuitemcheckbox', 'menuitemradio' ]
  32121. }
  32122. }, {
  32123. id: 'aria-unsupported-attr',
  32124. evaluate: 'aria-unsupported-attr-evaluate'
  32125. }, {
  32126. id: 'aria-valid-attr-value',
  32127. evaluate: 'aria-valid-attr-value-evaluate',
  32128. options: []
  32129. }, {
  32130. id: 'aria-valid-attr',
  32131. evaluate: 'aria-valid-attr-evaluate',
  32132. options: []
  32133. }, {
  32134. id: 'braille-label-equivalent',
  32135. evaluate: 'braille-label-equivalent-evaluate'
  32136. }, {
  32137. id: 'braille-roledescription-equivalent',
  32138. evaluate: 'braille-roledescription-equivalent-evaluate'
  32139. }, {
  32140. id: 'deprecatedrole',
  32141. evaluate: 'deprecatedrole-evaluate'
  32142. }, {
  32143. id: 'fallbackrole',
  32144. evaluate: 'fallbackrole-evaluate'
  32145. }, {
  32146. id: 'has-global-aria-attribute',
  32147. evaluate: 'has-global-aria-attribute-evaluate'
  32148. }, {
  32149. id: 'has-widget-role',
  32150. evaluate: 'has-widget-role-evaluate',
  32151. options: []
  32152. }, {
  32153. id: 'invalidrole',
  32154. evaluate: 'invalidrole-evaluate'
  32155. }, {
  32156. id: 'is-element-focusable',
  32157. evaluate: 'is-element-focusable-evaluate'
  32158. }, {
  32159. id: 'no-implicit-explicit-label',
  32160. evaluate: 'no-implicit-explicit-label-evaluate'
  32161. }, {
  32162. id: 'unsupportedrole',
  32163. evaluate: 'unsupportedrole-evaluate'
  32164. }, {
  32165. id: 'valid-scrollable-semantics',
  32166. evaluate: 'valid-scrollable-semantics-evaluate',
  32167. options: {
  32168. roles: [ 'tooltip' ]
  32169. }
  32170. }, {
  32171. id: 'color-contrast-enhanced',
  32172. evaluate: 'color-contrast-evaluate',
  32173. options: {
  32174. ignoreUnicode: true,
  32175. ignoreLength: false,
  32176. ignorePseudo: false,
  32177. boldValue: 700,
  32178. boldTextPt: 14,
  32179. largeTextPt: 18,
  32180. contrastRatio: {
  32181. normal: {
  32182. expected: 7,
  32183. minThreshold: 4.5
  32184. },
  32185. large: {
  32186. expected: 4.5,
  32187. minThreshold: 3
  32188. }
  32189. },
  32190. pseudoSizeThreshold: .25,
  32191. shadowOutlineEmMax: .1,
  32192. textStrokeEmMin: .03
  32193. }
  32194. }, {
  32195. id: 'color-contrast',
  32196. evaluate: 'color-contrast-evaluate',
  32197. options: {
  32198. ignoreUnicode: true,
  32199. ignoreLength: false,
  32200. ignorePseudo: false,
  32201. boldValue: 700,
  32202. boldTextPt: 14,
  32203. largeTextPt: 18,
  32204. contrastRatio: {
  32205. normal: {
  32206. expected: 4.5
  32207. },
  32208. large: {
  32209. expected: 3
  32210. }
  32211. },
  32212. pseudoSizeThreshold: .25,
  32213. shadowOutlineEmMax: .2,
  32214. textStrokeEmMin: .03
  32215. }
  32216. }, {
  32217. id: 'link-in-text-block-style',
  32218. evaluate: 'link-in-text-block-style-evaluate'
  32219. }, {
  32220. id: 'link-in-text-block',
  32221. evaluate: 'link-in-text-block-evaluate',
  32222. options: {
  32223. requiredContrastRatio: 3,
  32224. allowSameColor: true
  32225. }
  32226. }, {
  32227. id: 'autocomplete-appropriate',
  32228. evaluate: 'autocomplete-appropriate-evaluate',
  32229. deprecated: true
  32230. }, {
  32231. id: 'autocomplete-valid',
  32232. evaluate: 'autocomplete-valid-evaluate',
  32233. options: {
  32234. stateTerms: [ 'none', 'false', 'true', 'disabled', 'enabled', 'undefined', 'null' ],
  32235. ignoredValues: [ 'text', 'pronouns', 'gender', 'message', 'content' ]
  32236. }
  32237. }, {
  32238. id: 'accesskeys',
  32239. evaluate: 'accesskeys-evaluate',
  32240. after: 'accesskeys-after'
  32241. }, {
  32242. id: 'focusable-content',
  32243. evaluate: 'focusable-content-evaluate'
  32244. }, {
  32245. id: 'focusable-disabled',
  32246. evaluate: 'focusable-disabled-evaluate'
  32247. }, {
  32248. id: 'focusable-element',
  32249. evaluate: 'focusable-element-evaluate'
  32250. }, {
  32251. id: 'focusable-modal-open',
  32252. evaluate: 'focusable-modal-open-evaluate'
  32253. }, {
  32254. id: 'focusable-no-name',
  32255. evaluate: 'focusable-no-name-evaluate'
  32256. }, {
  32257. id: 'focusable-not-tabbable',
  32258. evaluate: 'focusable-not-tabbable-evaluate'
  32259. }, {
  32260. id: 'frame-focusable-content',
  32261. evaluate: 'frame-focusable-content-evaluate'
  32262. }, {
  32263. id: 'landmark-is-top-level',
  32264. evaluate: 'landmark-is-top-level-evaluate'
  32265. }, {
  32266. id: 'no-focusable-content',
  32267. evaluate: 'no-focusable-content-evaluate'
  32268. }, {
  32269. id: 'page-has-heading-one',
  32270. evaluate: 'has-descendant-evaluate',
  32271. after: 'has-descendant-after',
  32272. options: {
  32273. selector: 'h1:not([role], [aria-level]), :is(h1, h2, h3, h4, h5, h6):not([role])[aria-level=1], [role=heading][aria-level=1]',
  32274. passForModal: true
  32275. }
  32276. }, {
  32277. id: 'page-has-main',
  32278. evaluate: 'has-descendant-evaluate',
  32279. after: 'has-descendant-after',
  32280. options: {
  32281. selector: 'main:not([role]), [role=\'main\']',
  32282. passForModal: true
  32283. }
  32284. }, {
  32285. id: 'page-no-duplicate-banner',
  32286. evaluate: 'page-no-duplicate-evaluate',
  32287. after: 'page-no-duplicate-after',
  32288. options: {
  32289. selector: 'header:not([role]), [role=banner]',
  32290. role: 'banner'
  32291. }
  32292. }, {
  32293. id: 'page-no-duplicate-contentinfo',
  32294. evaluate: 'page-no-duplicate-evaluate',
  32295. after: 'page-no-duplicate-after',
  32296. options: {
  32297. selector: 'footer:not([role]), [role=contentinfo]',
  32298. role: 'contentinfo'
  32299. }
  32300. }, {
  32301. id: 'page-no-duplicate-main',
  32302. evaluate: 'page-no-duplicate-evaluate',
  32303. after: 'page-no-duplicate-after',
  32304. options: {
  32305. selector: 'main:not([role]), [role=\'main\']'
  32306. }
  32307. }, {
  32308. id: 'tabindex',
  32309. evaluate: 'tabindex-evaluate'
  32310. }, {
  32311. id: 'alt-space-value',
  32312. evaluate: 'alt-space-value-evaluate'
  32313. }, {
  32314. id: 'duplicate-img-label',
  32315. evaluate: 'duplicate-img-label-evaluate',
  32316. options: {
  32317. parentSelector: 'button, [role=button], a[href], p, li, td, th'
  32318. }
  32319. }, {
  32320. id: 'explicit-label',
  32321. evaluate: 'explicit-evaluate'
  32322. }, {
  32323. id: 'help-same-as-label',
  32324. evaluate: 'help-same-as-label-evaluate'
  32325. }, {
  32326. id: 'hidden-explicit-label',
  32327. evaluate: 'hidden-explicit-label-evaluate'
  32328. }, {
  32329. id: 'implicit-label',
  32330. evaluate: 'implicit-evaluate'
  32331. }, {
  32332. id: 'label-content-name-mismatch',
  32333. evaluate: 'label-content-name-mismatch-evaluate',
  32334. options: {
  32335. pixelThreshold: .1,
  32336. occurrenceThreshold: 3
  32337. }
  32338. }, {
  32339. id: 'multiple-label',
  32340. evaluate: 'multiple-label-evaluate'
  32341. }, {
  32342. id: 'title-only',
  32343. evaluate: 'title-only-evaluate'
  32344. }, {
  32345. id: 'landmark-is-unique',
  32346. evaluate: 'landmark-is-unique-evaluate',
  32347. after: 'landmark-is-unique-after'
  32348. }, {
  32349. id: 'has-lang',
  32350. evaluate: 'has-lang-evaluate',
  32351. options: {
  32352. attributes: [ 'lang', 'xml:lang' ]
  32353. }
  32354. }, {
  32355. id: 'valid-lang',
  32356. evaluate: 'valid-lang-evaluate',
  32357. options: {
  32358. attributes: [ 'lang', 'xml:lang' ]
  32359. }
  32360. }, {
  32361. id: 'xml-lang-mismatch',
  32362. evaluate: 'xml-lang-mismatch-evaluate'
  32363. }, {
  32364. id: 'dlitem',
  32365. evaluate: 'dlitem-evaluate'
  32366. }, {
  32367. id: 'listitem',
  32368. evaluate: 'listitem-evaluate'
  32369. }, {
  32370. id: 'only-dlitems',
  32371. evaluate: 'invalid-children-evaluate',
  32372. options: {
  32373. validRoles: [ 'definition', 'term', 'listitem' ],
  32374. validNodeNames: [ 'dt', 'dd' ],
  32375. divGroups: true
  32376. }
  32377. }, {
  32378. id: 'only-listitems',
  32379. evaluate: 'invalid-children-evaluate',
  32380. options: {
  32381. validRoles: [ 'listitem' ],
  32382. validNodeNames: [ 'li' ]
  32383. }
  32384. }, {
  32385. id: 'structured-dlitems',
  32386. evaluate: 'structured-dlitems-evaluate'
  32387. }, {
  32388. id: 'caption',
  32389. evaluate: 'caption-evaluate'
  32390. }, {
  32391. id: 'frame-tested',
  32392. evaluate: 'frame-tested-evaluate',
  32393. after: 'frame-tested-after',
  32394. options: {
  32395. isViolation: false
  32396. }
  32397. }, {
  32398. id: 'no-autoplay-audio',
  32399. evaluate: 'no-autoplay-audio-evaluate',
  32400. options: {
  32401. allowedDuration: 3
  32402. }
  32403. }, {
  32404. id: 'css-orientation-lock',
  32405. evaluate: 'css-orientation-lock-evaluate',
  32406. options: {
  32407. degreeThreshold: 2
  32408. }
  32409. }, {
  32410. id: 'meta-viewport-large',
  32411. evaluate: 'meta-viewport-scale-evaluate',
  32412. options: {
  32413. scaleMinimum: 5,
  32414. lowerBound: 2
  32415. }
  32416. }, {
  32417. id: 'meta-viewport',
  32418. evaluate: 'meta-viewport-scale-evaluate',
  32419. options: {
  32420. scaleMinimum: 2
  32421. }
  32422. }, {
  32423. id: 'target-offset',
  32424. evaluate: 'target-offset-evaluate',
  32425. options: {
  32426. minOffset: 24
  32427. }
  32428. }, {
  32429. id: 'target-size',
  32430. evaluate: 'target-size-evaluate',
  32431. options: {
  32432. minSize: 24
  32433. }
  32434. }, {
  32435. id: 'header-present',
  32436. evaluate: 'has-descendant-evaluate',
  32437. after: 'has-descendant-after',
  32438. options: {
  32439. selector: ':is(h1, h2, h3, h4, h5, h6):not([role]), [role=heading]'
  32440. }
  32441. }, {
  32442. id: 'heading-order',
  32443. evaluate: 'heading-order-evaluate',
  32444. after: 'heading-order-after'
  32445. }, {
  32446. id: 'identical-links-same-purpose',
  32447. evaluate: 'identical-links-same-purpose-evaluate',
  32448. after: 'identical-links-same-purpose-after'
  32449. }, {
  32450. id: 'internal-link-present',
  32451. evaluate: 'internal-link-present-evaluate'
  32452. }, {
  32453. id: 'landmark',
  32454. evaluate: 'has-descendant-evaluate',
  32455. options: {
  32456. selector: 'main, [role=main]'
  32457. }
  32458. }, {
  32459. id: 'meta-refresh-no-exceptions',
  32460. evaluate: 'meta-refresh-evaluate',
  32461. options: {
  32462. minDelay: 72e3,
  32463. maxDelay: false
  32464. }
  32465. }, {
  32466. id: 'meta-refresh',
  32467. evaluate: 'meta-refresh-evaluate',
  32468. options: {
  32469. minDelay: 0,
  32470. maxDelay: 72e3
  32471. }
  32472. }, {
  32473. id: 'p-as-heading',
  32474. evaluate: 'p-as-heading-evaluate',
  32475. options: {
  32476. margins: [ {
  32477. weight: 150,
  32478. italic: true
  32479. }, {
  32480. weight: 150,
  32481. size: 1.15
  32482. }, {
  32483. italic: true,
  32484. size: 1.15
  32485. }, {
  32486. size: 1.4
  32487. } ],
  32488. passLength: 1,
  32489. failLength: .5
  32490. }
  32491. }, {
  32492. id: 'region',
  32493. evaluate: 'region-evaluate',
  32494. after: 'region-after',
  32495. options: {
  32496. regionMatcher: 'dialog, [role=dialog], [role=alertdialog], svg'
  32497. }
  32498. }, {
  32499. id: 'skip-link',
  32500. evaluate: 'skip-link-evaluate'
  32501. }, {
  32502. id: 'unique-frame-title',
  32503. evaluate: 'unique-frame-title-evaluate',
  32504. after: 'unique-frame-title-after'
  32505. }, {
  32506. id: 'duplicate-id-active',
  32507. evaluate: 'duplicate-id-evaluate',
  32508. after: 'duplicate-id-after'
  32509. }, {
  32510. id: 'duplicate-id-aria',
  32511. evaluate: 'duplicate-id-evaluate',
  32512. after: 'duplicate-id-after'
  32513. }, {
  32514. id: 'duplicate-id',
  32515. evaluate: 'duplicate-id-evaluate',
  32516. after: 'duplicate-id-after'
  32517. }, {
  32518. id: 'aria-label',
  32519. evaluate: 'aria-label-evaluate'
  32520. }, {
  32521. id: 'aria-labelledby',
  32522. evaluate: 'aria-labelledby-evaluate'
  32523. }, {
  32524. id: 'avoid-inline-spacing',
  32525. evaluate: 'avoid-inline-spacing-evaluate',
  32526. options: {
  32527. cssProperties: [ 'line-height', 'letter-spacing', 'word-spacing' ]
  32528. }
  32529. }, {
  32530. id: 'button-has-visible-text',
  32531. evaluate: 'has-text-content-evaluate'
  32532. }, {
  32533. id: 'doc-has-title',
  32534. evaluate: 'doc-has-title-evaluate'
  32535. }, {
  32536. id: 'exists',
  32537. evaluate: 'exists-evaluate'
  32538. }, {
  32539. id: 'has-alt',
  32540. evaluate: 'has-alt-evaluate'
  32541. }, {
  32542. id: 'has-visible-text',
  32543. evaluate: 'has-text-content-evaluate'
  32544. }, {
  32545. id: 'important-letter-spacing',
  32546. evaluate: 'inline-style-property-evaluate',
  32547. options: {
  32548. cssProperty: 'letter-spacing',
  32549. minValue: .12
  32550. }
  32551. }, {
  32552. id: 'important-line-height',
  32553. evaluate: 'inline-style-property-evaluate',
  32554. options: {
  32555. multiLineOnly: true,
  32556. cssProperty: 'line-height',
  32557. minValue: 1.5,
  32558. normalValue: 1
  32559. }
  32560. }, {
  32561. id: 'important-word-spacing',
  32562. evaluate: 'inline-style-property-evaluate',
  32563. options: {
  32564. cssProperty: 'word-spacing',
  32565. minValue: .16
  32566. }
  32567. }, {
  32568. id: 'is-on-screen',
  32569. evaluate: 'is-on-screen-evaluate'
  32570. }, {
  32571. id: 'non-empty-alt',
  32572. evaluate: 'attr-non-space-content-evaluate',
  32573. options: {
  32574. attribute: 'alt'
  32575. }
  32576. }, {
  32577. id: 'non-empty-if-present',
  32578. evaluate: 'non-empty-if-present-evaluate'
  32579. }, {
  32580. id: 'non-empty-placeholder',
  32581. evaluate: 'attr-non-space-content-evaluate',
  32582. options: {
  32583. attribute: 'placeholder'
  32584. }
  32585. }, {
  32586. id: 'non-empty-title',
  32587. evaluate: 'attr-non-space-content-evaluate',
  32588. options: {
  32589. attribute: 'title'
  32590. }
  32591. }, {
  32592. id: 'non-empty-value',
  32593. evaluate: 'attr-non-space-content-evaluate',
  32594. options: {
  32595. attribute: 'value'
  32596. }
  32597. }, {
  32598. id: 'presentational-role',
  32599. evaluate: 'presentational-role-evaluate'
  32600. }, {
  32601. id: 'role-none',
  32602. evaluate: 'matches-definition-evaluate',
  32603. deprecated: true,
  32604. options: {
  32605. matcher: {
  32606. attributes: {
  32607. role: 'none'
  32608. }
  32609. }
  32610. }
  32611. }, {
  32612. id: 'role-presentation',
  32613. evaluate: 'matches-definition-evaluate',
  32614. deprecated: true,
  32615. options: {
  32616. matcher: {
  32617. attributes: {
  32618. role: 'presentation'
  32619. }
  32620. }
  32621. }
  32622. }, {
  32623. id: 'svg-non-empty-title',
  32624. evaluate: 'svg-non-empty-title-evaluate'
  32625. }, {
  32626. id: 'caption-faked',
  32627. evaluate: 'caption-faked-evaluate'
  32628. }, {
  32629. id: 'html5-scope',
  32630. evaluate: 'html5-scope-evaluate'
  32631. }, {
  32632. id: 'same-caption-summary',
  32633. evaluate: 'same-caption-summary-evaluate'
  32634. }, {
  32635. id: 'scope-value',
  32636. evaluate: 'scope-value-evaluate',
  32637. options: {
  32638. values: [ 'row', 'col', 'rowgroup', 'colgroup' ]
  32639. }
  32640. }, {
  32641. id: 'td-has-header',
  32642. evaluate: 'td-has-header-evaluate'
  32643. }, {
  32644. id: 'td-headers-attr',
  32645. evaluate: 'td-headers-attr-evaluate'
  32646. }, {
  32647. id: 'th-has-data-cells',
  32648. evaluate: 'th-has-data-cells-evaluate'
  32649. }, {
  32650. id: 'hidden-content',
  32651. evaluate: 'hidden-content-evaluate'
  32652. } ]
  32653. });
  32654. })(typeof window === 'object' ? window : this);